-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This macro is like the existing `transmute!`, but it transmutes immutable references rather than values. Issue #159
- Loading branch information
Showing
9 changed files
with
1,066 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../ui/transmute-illegal-lifetime.rs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
error[E0597]: `x` does not live long enough | ||
--> tests/ui-msrv/transmute-illegal-lifetime.rs:12:52 | ||
| | ||
12 | let _: &'static u64 = zerocopy::transmute_ref!(&x); | ||
| ------------ ^^ borrowed value does not live long enough | ||
| | | ||
| type annotation requires that `x` is borrowed for `'static` | ||
13 | } | ||
| - `x` dropped here while still borrowed |
Oops, something went wrong.