-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #110038 - compiler-errors:infer-regions-in-transmutab…
…ility, r=lcnr Erase regions when confirming transmutability candidate Fixes an ICE where we call `layout_of` on a type with infer regions.
- Loading branch information
Showing
8 changed files
with
89 additions
and
45 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
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
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
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,22 @@ | ||
#![feature(transmutability)] | ||
|
||
use std::mem::{Assume, BikeshedIntrinsicFrom}; | ||
pub struct Context; | ||
|
||
#[repr(C)] | ||
struct W<'a>(&'a ()); | ||
|
||
fn test<'a>() | ||
where | ||
W<'a>: BikeshedIntrinsicFrom< | ||
(), | ||
Context, | ||
{ Assume { alignment: true, lifetimes: true, safety: true, validity: true } }, | ||
>, | ||
{ | ||
} | ||
|
||
fn main() { | ||
test(); | ||
//~^ ERROR `()` cannot be safely transmuted into `W<'_>` | ||
} |
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,23 @@ | ||
error[E0277]: `()` cannot be safely transmuted into `W<'_>` in the defining scope of `Context` | ||
--> $DIR/region-infer.rs:20:5 | ||
| | ||
LL | test(); | ||
| ^^^^ `W<'_>` does not have a well-specified layout | ||
| | ||
note: required by a bound in `test` | ||
--> $DIR/region-infer.rs:11:12 | ||
| | ||
LL | fn test<'a>() | ||
| ---- required by a bound in this function | ||
LL | where | ||
LL | W<'a>: BikeshedIntrinsicFrom< | ||
| ____________^ | ||
LL | | (), | ||
LL | | Context, | ||
LL | | { Assume { alignment: true, lifetimes: true, safety: true, validity: true } }, | ||
LL | | >, | ||
| |_________^ required by this bound in `test` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |