From e7bfc5647b7804d1c4ccac0640b4eb739711ea78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Rakic?= Date: Tue, 5 Nov 2024 00:26:17 +0000 Subject: [PATCH] update test expectations --- tests/ui/consts/const-promoted-opaque.rs | 2 +- tests/ui/consts/const-promoted-opaque.string.stderr | 12 +++++++++--- tests/ui/type-alias-impl-trait/reveal_local.rs | 2 +- tests/ui/type-alias-impl-trait/reveal_local.stderr | 10 +++++++--- 4 files changed, 18 insertions(+), 8 deletions(-) diff --git a/tests/ui/consts/const-promoted-opaque.rs b/tests/ui/consts/const-promoted-opaque.rs index bb33e92778aa9..00ccb4b723738 100644 --- a/tests/ui/consts/const-promoted-opaque.rs +++ b/tests/ui/consts/const-promoted-opaque.rs @@ -30,7 +30,7 @@ const BAR: () = { }; const BAZ: &Foo = &FOO; -//[atomic]~^ ERROR: constants cannot refer to interior mutable data +//[string,atomic]~^ ERROR: constants cannot refer to interior mutable data fn main() { let _: &'static _ = &FOO; diff --git a/tests/ui/consts/const-promoted-opaque.string.stderr b/tests/ui/consts/const-promoted-opaque.string.stderr index 33e5f426448ca..b9d5cbf801a80 100644 --- a/tests/ui/consts/const-promoted-opaque.string.stderr +++ b/tests/ui/consts/const-promoted-opaque.string.stderr @@ -7,6 +7,12 @@ LL | LL | }; | - value is dropped here +error[E0492]: constants cannot refer to interior mutable data + --> $DIR/const-promoted-opaque.rs:32:19 + | +LL | const BAZ: &Foo = &FOO; + | ^^^^ this borrow of an interior mutable value may end up in the final value + error[E0716]: temporary value dropped while borrowed --> $DIR/const-promoted-opaque.rs:36:26 | @@ -18,7 +24,7 @@ LL | LL | } | - temporary value is freed at the end of this statement -error: aborting due to 2 previous errors +error: aborting due to 3 previous errors -Some errors have detailed explanations: E0493, E0716. -For more information about an error, try `rustc --explain E0493`. +Some errors have detailed explanations: E0492, E0493, E0716. +For more information about an error, try `rustc --explain E0492`. diff --git a/tests/ui/type-alias-impl-trait/reveal_local.rs b/tests/ui/type-alias-impl-trait/reveal_local.rs index 34f3788e2341b..07fd989b0fa78 100644 --- a/tests/ui/type-alias-impl-trait/reveal_local.rs +++ b/tests/ui/type-alias-impl-trait/reveal_local.rs @@ -20,7 +20,7 @@ fn not_gooder() -> Foo { // while we could know this from the hidden type, it would // need extra roundabout logic to support it. is_send::(); - //~^ ERROR: type annotations needed: cannot satisfy `Foo: Send` + //~^ ERROR: cannot check whether the hidden type of `reveal_local[9507]::Foo::{opaque#0}` satisfies auto traits x } diff --git a/tests/ui/type-alias-impl-trait/reveal_local.stderr b/tests/ui/type-alias-impl-trait/reveal_local.stderr index 9829c58cf73b7..e1b320cc38e31 100644 --- a/tests/ui/type-alias-impl-trait/reveal_local.stderr +++ b/tests/ui/type-alias-impl-trait/reveal_local.stderr @@ -16,13 +16,18 @@ note: required by a bound in `is_send` LL | fn is_send() {} | ^^^^ required by this bound in `is_send` -error[E0283]: type annotations needed: cannot satisfy `Foo: Send` +error: cannot check whether the hidden type of `reveal_local[9507]::Foo::{opaque#0}` satisfies auto traits --> $DIR/reveal_local.rs:22:15 | LL | is_send::(); | ^^^ | - = note: cannot satisfy `Foo: Send` + = note: fetching the hidden types of an opaque inside of the defining scope is not supported. You can try moving the opaque type and the item that actually registers a hidden type into a new submodule +note: opaque type is declared here + --> $DIR/reveal_local.rs:5:12 + | +LL | type Foo = impl Debug; + | ^^^^^^^^^^ note: required by a bound in `is_send` --> $DIR/reveal_local.rs:7:15 | @@ -31,4 +36,3 @@ LL | fn is_send() {} error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0283`.