Skip to content

Commit

Permalink
update test expectations
Browse files Browse the repository at this point in the history
  • Loading branch information
lqd committed Nov 5, 2024
1 parent 39592bc commit e7bfc56
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion tests/ui/consts/const-promoted-opaque.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 9 additions & 3 deletions tests/ui/consts/const-promoted-opaque.string.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
|
Expand All @@ -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`.
2 changes: 1 addition & 1 deletion tests/ui/type-alias-impl-trait/reveal_local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Foo>();
//~^ 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
}
Expand Down
10 changes: 7 additions & 3 deletions tests/ui/type-alias-impl-trait/reveal_local.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@ note: required by a bound in `is_send`
LL | fn is_send<T: 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::<Foo>();
| ^^^
|
= 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
|
Expand All @@ -31,4 +36,3 @@ LL | fn is_send<T: Send>() {}

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0283`.

0 comments on commit e7bfc56

Please sign in to comment.