Skip to content

Commit b676fc4

Browse files
committed
Bless ui tests.
1 parent 5fc261e commit b676fc4

File tree

6 files changed

+27
-10
lines changed

6 files changed

+27
-10
lines changed

src/test/ui/async-await/issue-61949-self-return-type.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ async fn foo() {
1919
let x = {
2020
let bar = 22;
2121
Foo::new(&bar).await
22+
//~^ ERROR `bar` does not live long enough
2223
};
2324
drop(x);
2425
}

src/test/ui/async-await/issue-61949-self-return-type.stderr

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ error[E0760]: `async fn` return type cannot contain a projection or `Self` that
44
LL | pub async fn new(_bar: &'a i32) -> Self {
55
| ^^^^ help: consider spelling out the type instead: `Foo<'a>`
66

7-
error: aborting due to previous error
7+
error[E0597]: `bar` does not live long enough
8+
--> $DIR/issue-61949-self-return-type.rs:21:18
9+
|
10+
LL | let x = {
11+
| - borrow later stored here
12+
LL | let bar = 22;
13+
LL | Foo::new(&bar).await
14+
| ^^^^ borrowed value does not live long enough
15+
LL |
16+
LL | };
17+
| - `bar` dropped here while still borrowed
18+
19+
error: aborting due to 2 previous errors
820

9-
For more information about this error, try `rustc --explain E0760`.
21+
Some errors have detailed explanations: E0597, E0760.
22+
For more information about an error, try `rustc --explain E0597`.

src/test/ui/impl-trait/bound-normalization-fail.stderr

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ error[E0760]: `impl Trait` return type cannot contain a projection or `Self` tha
2525
LL | fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output = T::Assoc> {
2626
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2727

28-
error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'static>>::Assoc`
28+
error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'a>>::Assoc`
2929
--> $DIR/bound-normalization-fail.rs:41:41
3030
|
3131
LL | fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output = T::Assoc> {
32-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'static>>::Assoc`
32+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'a>>::Assoc`
3333
...
3434
LL | Foo(())
3535
| ------- return type was inferred to be `Foo<()>` here
@@ -40,8 +40,8 @@ note: expected this to be `()`
4040
LL | type Output = T;
4141
| ^
4242
= note: expected unit type `()`
43-
found associated type `<T as lifetimes::Trait<'static>>::Assoc`
44-
help: consider constraining the associated type `<T as lifetimes::Trait<'static>>::Assoc` to `()`
43+
found associated type `<T as lifetimes::Trait<'a>>::Assoc`
44+
help: consider constraining the associated type `<T as lifetimes::Trait<'a>>::Assoc` to `()`
4545
|
4646
LL | fn foo2_fail<'a, T: Trait<'a, Assoc = ()>>() -> impl FooLike<Output = T::Assoc> {
4747
| ++++++++++++

src/test/ui/nll/ty-outlives/impl-trait-captures.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0700]: hidden type for `Opaque(DefId(0:13 ~ impl_trait_captures[1afc]::foo::{opaque#0}), [ReStatic, T, ReEarlyBound(0, 'a)])` captures lifetime that does not appear in bounds
1+
error[E0700]: hidden type for `Opaque(DefId(0:13 ~ impl_trait_captures[1afc]::foo::{opaque#0}), [ReEarlyBound(0, 'a), T, ReEarlyBound(0, 'a)])` captures lifetime that does not appear in bounds
22
--> $DIR/impl-trait-captures.rs:11:5
33
|
44
LL | fn foo<'a, T>(x: &T) -> impl Foo<'a> {

src/test/ui/type-alias-impl-trait/missing_lifetime_bound.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
type Opaque<'a, T> = impl Sized;
44
fn defining<'a, T>(x: &'a i32) -> Opaque<T> { x }
5-
//~^ ERROR: non-defining opaque type use in defining scope
5+
//~^ ERROR: hidden type for `Opaque<'a, T>` captures lifetime that does not appear in bounds
66

77
fn main() {}
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
error: non-defining opaque type use in defining scope
1+
error[E0700]: hidden type for `Opaque<'a, T>` captures lifetime that does not appear in bounds
22
--> $DIR/missing_lifetime_bound.rs:4:47
33
|
44
LL | fn defining<'a, T>(x: &'a i32) -> Opaque<T> { x }
5-
| ^ lifetime `'a` is part of concrete type but not used in parameter list of the `impl Trait` type alias
5+
| -- ^
6+
| |
7+
| hidden type `&'a i32` captures the lifetime `'a` as defined here
68

79
error: aborting due to previous error
810

11+
For more information about this error, try `rustc --explain E0700`.

0 commit comments

Comments
 (0)