-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 #109101 - compiler-errors:layout-err, r=michaelwoerister
Fall back to old metadata computation when type references errors Projection is a bit too aggressive normalizing `<dyn Trait<[type error]> as Pointee>::Metadata` to `[type error]`, rather than to `DynMetadata<..>`. Side-step that by just falling back to the old structural metadata computation. Fixes #109078
- Loading branch information
Showing
4 changed files
with
32 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
trait Trait<T> {} | ||
|
||
struct Bar(Box<dyn Trait<T>>); | ||
//~^ ERROR cannot find type `T` in this scope | ||
|
||
fn main() { | ||
let x: Bar = unsafe { std::mem::transmute(()) }; | ||
} |
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,14 @@ | ||
error[E0412]: cannot find type `T` in this scope | ||
--> $DIR/transmute-to-tail-with-err.rs:3:26 | ||
| | ||
LL | struct Bar(Box<dyn Trait<T>>); | ||
| ^ not found in this scope | ||
| | ||
help: you might be missing a type parameter | ||
| | ||
LL | struct Bar<T>(Box<dyn Trait<T>>); | ||
| +++ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0412`. |