forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 1
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 rust-lang#114615 - RalfJung:interpret-invalid-where, …
…r=lcnr interpret: remove incomplete protection against invalid where clauses Cc rust-lang#97477, rust-lang/project-const-generics#37 r? `@lcnr`
- Loading branch information
Showing
7 changed files
with
16 additions
and
84 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
75 changes: 7 additions & 68 deletions
75
tests/ui/const-generics/generic_const_exprs/issue-80742.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 |
---|---|---|
@@ -1,71 +1,10 @@ | ||
error[E0080]: evaluation of `Inline::<dyn Debug>::{constant#0}` failed | ||
error: internal compiler error: compiler/rustc_const_eval/src/interpret/step.rs:272:21: SizeOf MIR operator called for unsized type dyn Debug | ||
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL | ||
| | ||
= note: size_of called on unsized type `dyn Debug` | ||
| | ||
note: inside `std::mem::size_of::<dyn Debug>` | ||
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL | ||
note: inside `Inline::<dyn Debug>::{constant#0}` | ||
--> $DIR/issue-80742.rs:22:10 | ||
| | ||
LL | [u8; size_of::<T>() + 1]: , | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error[E0599]: the function or associated item `new` exists for struct `Inline<dyn Debug>`, but its trait bounds were not satisfied | ||
--> $DIR/issue-80742.rs:30:36 | ||
| | ||
LL | struct Inline<T> | ||
| ---------------- function or associated item `new` not found for this struct | ||
... | ||
LL | let dst = Inline::<dyn Debug>::new(0); | ||
| ^^^ function or associated item cannot be called on `Inline<dyn Debug>` due to unsatisfied trait bounds | ||
--> $SRC_DIR/core/src/fmt/mod.rs:LL:COL | ||
| | ||
= note: doesn't satisfy `dyn Debug: Sized` | ||
| | ||
note: trait bound `dyn Debug: Sized` was not satisfied | ||
--> $DIR/issue-80742.rs:20:6 | ||
| | ||
LL | impl<T> Inline<T> | ||
| ^ --------- | ||
| | | ||
| unsatisfied trait bound introduced here | ||
help: consider relaxing the type parameter's implicit `Sized` bound | ||
| | ||
LL | impl<T: ?Sized> Inline<T> | ||
| ++++++++ | ||
|
||
error[E0080]: evaluation of `Inline::<dyn Debug>::{constant#0}` failed | ||
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL | ||
| | ||
= note: size_of called on unsized type `dyn Debug` | ||
| | ||
note: inside `std::mem::size_of::<dyn Debug>` | ||
--> $SRC_DIR/core/src/mem/mod.rs:LL:COL | ||
note: inside `Inline::<dyn Debug>::{constant#0}` | ||
--> $DIR/issue-80742.rs:14:10 | ||
| | ||
LL | [u8; size_of::<T>() + 1]: , | ||
| ^^^^^^^^^^^^^^ | ||
|
||
error[E0277]: the size for values of type `dyn Debug` cannot be known at compilation time | ||
--> $DIR/issue-80742.rs:30:15 | ||
| | ||
LL | let dst = Inline::<dyn Debug>::new(0); | ||
| ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | ||
| | ||
= help: the trait `Sized` is not implemented for `dyn Debug` | ||
note: required by a bound in `Inline` | ||
--> $DIR/issue-80742.rs:12:15 | ||
| | ||
LL | struct Inline<T> | ||
| ^ required by this bound in `Inline` | ||
help: consider relaxing the implicit `Sized` restriction | ||
| | ||
LL | struct Inline<T: ?Sized> | ||
| ++++++++ | ||
|
||
error: aborting due to 4 previous errors | ||
Box<dyn Any> | ||
query stack during panic: | ||
#0 [eval_to_allocation_raw] const-evaluating + checking `<impl at $DIR/issue-80742.rs:25:1: 25:18>::{constant#0}` | ||
#1 [eval_to_valtree] evaluating type-level constant | ||
end of query stack | ||
error: aborting due to previous error | ||
|
||
Some errors have detailed explanations: E0080, E0277, E0599. | ||
For more information about an error, try `rustc --explain E0080`. |