Skip to content

Commit

Permalink
Rollup merge of #126833 - RalfJung:extern-type-field-ice, r=compiler-…
Browse files Browse the repository at this point in the history
…errors

don't ICE when encountering an extern type field during validation

"extern type" is a pain that keeps on giving...

Fixes rust-lang/rust#126814

r? ```@oli-obk```
  • Loading branch information
matthiaskrgr authored Jun 23, 2024
2 parents 4a51364 + 6b3267f commit 28e625f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@ pub fn report_error<'tcx>(
ResourceExhaustion(_) => "resource exhaustion",
Unsupported(
// We list only the ones that can actually happen.
UnsupportedOpInfo::Unsupported(_) | UnsupportedOpInfo::UnsizedLocal,
UnsupportedOpInfo::Unsupported(_)
| UnsupportedOpInfo::UnsizedLocal
| UnsupportedOpInfo::ExternTypeField,
) => "unsupported operation",
InvalidProgram(
// We list only the ones that can actually happen.
Expand Down
4 changes: 2 additions & 2 deletions tests/fail/extern-type-field-offset.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error: unsupported operation: `extern type` does not have a known offset
error: unsupported operation: `extern type` field does not have a known offset
--> $DIR/extern-type-field-offset.rs:LL:CC
|
LL | let _field = &x.a;
| ^^^^ `extern type` does not have a known offset
| ^^^^ `extern type` field does not have a known offset
|
= help: this is likely not a bug in the program; it indicates that the program performed an operation that Miri does not support
= note: BACKTRACE:
Expand Down

0 comments on commit 28e625f

Please sign in to comment.