-
Notifications
You must be signed in to change notification settings - Fork 13k
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 #111490 - compiler-errors:layout-placeholder, r=aliemjay
Don't ICE in layout computation for placeholder types We use `layout_of` for the built-in `PointerLike` trait to check if a type can be coerced to a `dyn*`. Since the new solver canonicalizes parameter types to placeholders, that code needs to be able to treat placeholders like params, and for the most part it does, **except** for a call to `is_trivially_sized`. This PR fixes that.
- Loading branch information
Showing
4 changed files
with
21 additions
and
5 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
2 changes: 1 addition & 1 deletion
2
...check-size-at-cast-polymorphic-bad.stderr → ...ze-at-cast-polymorphic-bad.current.stderr
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
15 changes: 15 additions & 0 deletions
15
tests/ui/dyn-star/check-size-at-cast-polymorphic-bad.next.stderr
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,15 @@ | ||
error[E0277]: `&T` needs to have the same ABI as a pointer | ||
--> $DIR/check-size-at-cast-polymorphic-bad.rs:14:15 | ||
| | ||
LL | dyn_debug(t); | ||
| ^ `&T` needs to be a pointer-like type | ||
| | ||
= help: the trait `PointerLike` is not implemented for `&T` | ||
help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement | ||
| | ||
LL | fn polymorphic<T: Debug + ?Sized>(t: &T) where &T: PointerLike { | ||
| +++++++++++++++++++++ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0277`. |
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