diff options
| author | Ralf Jung <post@ralfj.de> | 2024-06-22 16:26:30 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2024-06-22 17:39:01 +0200 |
| commit | 763e3131cc05d9d9b036ce991cc948aefe2cb8ff (patch) | |
| tree | b728a78071c34b87cfbe991699344f9f83bc206b /tests/ui/sized | |
| parent | d03d6c0fead582c98c6446ec92456ca8fd03ff65 (diff) | |
| download | rust-763e3131cc05d9d9b036ce991cc948aefe2cb8ff.tar.gz rust-763e3131cc05d9d9b036ce991cc948aefe2cb8ff.zip | |
don't ICE when encountering an extern type field during validation
Diffstat (limited to 'tests/ui/sized')
4 files changed, 3 insertions, 36 deletions
diff --git a/tests/ui/sized/stack-overflow-trait-infer-98842.32bit.stderr b/tests/ui/sized/stack-overflow-trait-infer-98842.32bit.stderr index 3f8011d961a..6bbd81ae3e1 100644 --- a/tests/ui/sized/stack-overflow-trait-infer-98842.32bit.stderr +++ b/tests/ui/sized/stack-overflow-trait-infer-98842.32bit.stderr @@ -9,15 +9,11 @@ LL | const _: *const Foo = 0 as _; | ^^^^^^^^^^^^^^^^^^^ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information -error[E0080]: it is undefined behavior to use this value +error[E0080]: evaluation of constant value failed --> $DIR/stack-overflow-trait-infer-98842.rs:15:1 | LL | const _: *const Foo = 0 as _; | ^^^^^^^^^^^^^^^^^^^ a cycle occurred during layout computation - | - = note: the raw bytes of the constant (size: 4, align: 4) { - 00 00 00 00 │ .... - } error: aborting due to 2 previous errors diff --git a/tests/ui/sized/stack-overflow-trait-infer-98842.64bit.stderr b/tests/ui/sized/stack-overflow-trait-infer-98842.64bit.stderr index 04e2c4483bf..6bbd81ae3e1 100644 --- a/tests/ui/sized/stack-overflow-trait-infer-98842.64bit.stderr +++ b/tests/ui/sized/stack-overflow-trait-infer-98842.64bit.stderr @@ -9,15 +9,11 @@ LL | const _: *const Foo = 0 as _; | ^^^^^^^^^^^^^^^^^^^ = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information -error[E0080]: it is undefined behavior to use this value +error[E0080]: evaluation of constant value failed --> $DIR/stack-overflow-trait-infer-98842.rs:15:1 | LL | const _: *const Foo = 0 as _; | ^^^^^^^^^^^^^^^^^^^ a cycle occurred during layout computation - | - = note: the raw bytes of the constant (size: 8, align: 8) { - 00 00 00 00 00 00 00 00 │ ........ - } error: aborting due to 2 previous errors diff --git a/tests/ui/sized/stack-overflow-trait-infer-98842.rs b/tests/ui/sized/stack-overflow-trait-infer-98842.rs index 54d50346cc8..be4807b2e4a 100644 --- a/tests/ui/sized/stack-overflow-trait-infer-98842.rs +++ b/tests/ui/sized/stack-overflow-trait-infer-98842.rs @@ -13,6 +13,6 @@ struct Foo(<&'static Foo as ::core::ops::Deref>::Target); // and it will infinitely recurse somewhere trying to figure out the // size of this pointer (is my guess): const _: *const Foo = 0 as _; -//~^ ERROR it is undefined behavior to use this value +//~^ ERROR evaluation of constant value failed pub fn main() {} diff --git a/tests/ui/sized/stack-overflow-trait-infer-98842.stderr b/tests/ui/sized/stack-overflow-trait-infer-98842.stderr deleted file mode 100644 index 8ddddeb5bf2..00000000000 --- a/tests/ui/sized/stack-overflow-trait-infer-98842.stderr +++ /dev/null @@ -1,25 +0,0 @@ -error[E0391]: cycle detected when computing layout of `Foo` - | - = note: ...which requires computing layout of `<&'static Foo as core::ops::deref::Deref>::Target`... - = note: ...which again requires computing layout of `Foo`, completing the cycle -note: cycle used when const-evaluating + checking `_` - --> $DIR/stack-overflow-trait-infer-98842.rs:13:1 - | -LL | const _: *const Foo = 0 as _; - | ^^^^^^^^^^^^^^^^^^^ - = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information - -error[E0080]: it is undefined behavior to use this value - --> $DIR/stack-overflow-trait-infer-98842.rs:13:1 - | -LL | const _: *const Foo = 0 as _; - | ^^^^^^^^^^^^^^^^^^^ a cycle occurred during layout computation - | - = note: the raw bytes of the constant (size: 8, align: 8) { - 00 00 00 00 00 00 00 00 │ ........ - } - -error: aborting due to 2 previous errors - -Some errors have detailed explanations: E0080, E0391. -For more information about an error, try `rustc --explain E0080`. |
