forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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#123491 - gurry:123154-ice-unsized-struct-ev…
…al, r=oli-obk Fix ICE in `eval_body_using_ecx` Ensures `TypeckResults` is tainted by failing candidate assembly for types with error Fixes rust-lang#123154
- Loading branch information
Showing
12 changed files
with
72 additions
and
37 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 was deleted.
Oops, something went wrong.
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
15 changes: 15 additions & 0 deletions
15
tests/ui/consts/const-eval/ice-unsized-struct-const-eval-123154.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,15 @@ | ||
// Regression test for #123154 | ||
|
||
struct AA { | ||
pub data: [&usize] | ||
//~^ ERROR missing lifetime specifier | ||
} | ||
|
||
impl AA { | ||
const fn new() -> Self { } | ||
//~^ ERROR mismatched types | ||
} | ||
|
||
static ST: AA = AA::new(); | ||
|
||
fn main() {} |
24 changes: 24 additions & 0 deletions
24
tests/ui/consts/const-eval/ice-unsized-struct-const-eval-123154.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,24 @@ | ||
error[E0106]: missing lifetime specifier | ||
--> $DIR/ice-unsized-struct-const-eval-123154.rs:4:16 | ||
| | ||
LL | pub data: [&usize] | ||
| ^ expected named lifetime parameter | ||
| | ||
help: consider introducing a named lifetime parameter | ||
| | ||
LL ~ struct AA<'a> { | ||
LL ~ pub data: [&'a usize] | ||
| | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/ice-unsized-struct-const-eval-123154.rs:9:23 | ||
| | ||
LL | const fn new() -> Self { } | ||
| --- ^^^^ expected `AA`, found `()` | ||
| | | ||
| implicitly returns `()` as its body has no tail or `return` expression | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0106, E0308. | ||
For more information about an error, try `rustc --explain E0106`. |
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