Skip to content

Commit 082217a

Browse files
committed
Bless ui tests.
1 parent c91a899 commit 082217a

17 files changed

+39
-103
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ pub struct Foo<'a> {
88

99
impl<'a> Foo<'a> {
1010
pub async fn new(_bar: &'a i32) -> Self {
11-
//~^ ERROR `async fn` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
1211
Foo {
1312
bar: &22
1413
}
@@ -19,6 +18,7 @@ async fn foo() {
1918
let x = {
2019
let bar = 22;
2120
Foo::new(&bar).await
21+
//~^ ERROR `bar` does not live long enough
2222
};
2323
drop(x);
2424
}
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
error[E0760]: `async fn` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
2-
--> $DIR/issue-61949-self-return-type.rs:10:40
1+
error[E0597]: `bar` does not live long enough
2+
--> $DIR/issue-61949-self-return-type.rs:20:18
33
|
4-
LL | pub async fn new(_bar: &'a i32) -> Self {
5-
| ^^^^ help: consider spelling out the type instead: `Foo<'a>`
4+
LL | let x = {
5+
| - borrow later stored here
6+
LL | let bar = 22;
7+
LL | Foo::new(&bar).await
8+
| ^^^^ borrowed value does not live long enough
9+
LL |
10+
LL | };
11+
| - `bar` dropped here while still borrowed
612

713
error: aborting due to previous error
814

9-
For more information about this error, try `rustc --explain E0760`.
15+
For more information about this error, try `rustc --explain E0597`.

src/test/ui/async-await/issues/issue-65159.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ async fn copy() -> Result<()>
66
//~^ ERROR this enum takes 2 generic arguments
77
{
88
Ok(())
9-
//~^ ERROR type annotations needed
109
}
1110

1211
fn main() { }

src/test/ui/async-await/issues/issue-65159.stderr

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,6 @@ help: add missing generic argument
1616
LL | async fn copy() -> Result<(), E>
1717
| +++
1818

19-
error[E0282]: type annotations needed
20-
--> $DIR/issue-65159.rs:8:5
21-
|
22-
LL | Ok(())
23-
| ^^ cannot infer type of the type parameter `E` declared on the enum `Result`
24-
|
25-
help: consider specifying the generic arguments
26-
|
27-
LL | Ok::<(), E>(())
28-
| +++++++++
29-
30-
error: aborting due to 2 previous errors
19+
error: aborting due to previous error
3120

32-
Some errors have detailed explanations: E0107, E0282.
33-
For more information about an error, try `rustc --explain E0107`.
21+
For more information about this error, try `rustc --explain E0107`.

src/test/ui/async-await/issues/issue-78600.rs

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/test/ui/async-await/issues/issue-78600.stderr

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/test/ui/borrowck/issue-82126-mismatched-subst-and-hir.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ async fn buy_lock(generator: &Mutex<MarketMultiplier>) -> LockedMarket<'_> {
1717
//~^ ERROR this struct takes 0 lifetime arguments but 1 lifetime argument was supplied
1818
//~^^ ERROR this struct takes 1 generic argument but 0 generic arguments were supplied
1919
LockedMarket(generator.lock().unwrap().buy())
20-
//~^ ERROR cannot return value referencing temporary
2120
}
2221

2322
struct LockedMarket<T>(T);

src/test/ui/borrowck/issue-82126-mismatched-subst-and-hir.stderr

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ LL | async fn buy_lock(generator: &Mutex<MarketMultiplier>) -> LockedMarket<'_>
77
| expected 0 lifetime arguments
88
|
99
note: struct defined here, with 0 lifetime parameters
10-
--> $DIR/issue-82126-mismatched-subst-and-hir.rs:23:8
10+
--> $DIR/issue-82126-mismatched-subst-and-hir.rs:22:8
1111
|
1212
LL | struct LockedMarket<T>(T);
1313
| ^^^^^^^^^^^^
@@ -19,7 +19,7 @@ LL | async fn buy_lock(generator: &Mutex<MarketMultiplier>) -> LockedMarket<'_>
1919
| ^^^^^^^^^^^^ expected 1 generic argument
2020
|
2121
note: struct defined here, with 1 generic parameter: `T`
22-
--> $DIR/issue-82126-mismatched-subst-and-hir.rs:23:8
22+
--> $DIR/issue-82126-mismatched-subst-and-hir.rs:22:8
2323
|
2424
LL | struct LockedMarket<T>(T);
2525
| ^^^^^^^^^^^^ -
@@ -28,16 +28,6 @@ help: add missing generic argument
2828
LL | async fn buy_lock(generator: &Mutex<MarketMultiplier>) -> LockedMarket<'_, T> {
2929
| +++
3030

31-
error[E0515]: cannot return value referencing temporary value
32-
--> $DIR/issue-82126-mismatched-subst-and-hir.rs:19:5
33-
|
34-
LL | LockedMarket(generator.lock().unwrap().buy())
35-
| ^^^^^^^^^^^^^-------------------------^^^^^^^
36-
| | |
37-
| | temporary value created here
38-
| returns a value referencing data owned by the current function
39-
40-
error: aborting due to 3 previous errors
31+
error: aborting due to 2 previous errors
4132

42-
Some errors have detailed explanations: E0107, E0515.
43-
For more information about an error, try `rustc --explain E0107`.
33+
For more information about this error, try `rustc --explain E0107`.

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,7 @@ mod lifetimes {
3939

4040
/// Missing bound constraining `Assoc`, `T::Assoc` can't be normalized further.
4141
fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output = T::Assoc> {
42-
//~^ ERROR `impl Trait` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
43-
//~| ERROR: type mismatch
42+
//~^ ERROR: type mismatch
4443
Foo(())
4544
}
4645
}

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

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,12 @@ help: consider constraining the associated type `<T as impl_trait::Trait>::Assoc
1919
LL | fn foo_fail<T: Trait<Assoc = ()>>() -> impl FooLike<Output = T::Assoc> {
2020
| ++++++++++++
2121

22-
error[E0760]: `impl Trait` return type cannot contain a projection or `Self` that references lifetimes from a parent scope
22+
error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'a>>::Assoc`
2323
--> $DIR/bound-normalization-fail.rs:41:41
2424
|
2525
LL | fn foo2_fail<'a, T: Trait<'a>>() -> impl FooLike<Output = T::Assoc> {
26-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27-
28-
error[E0271]: type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'static>>::Assoc`
29-
--> $DIR/bound-normalization-fail.rs:41:41
30-
|
31-
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`
33-
...
26+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type mismatch resolving `<Foo<()> as FooLike>::Output == <T as lifetimes::Trait<'a>>::Assoc`
27+
LL |
3428
LL | Foo(())
3529
| ------- return type was inferred to be `Foo<()>` here
3630
|
@@ -40,13 +34,12 @@ note: expected this to be `()`
4034
LL | type Output = T;
4135
| ^
4236
= 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 `()`
37+
found associated type `<T as lifetimes::Trait<'a>>::Assoc`
38+
help: consider constraining the associated type `<T as lifetimes::Trait<'a>>::Assoc` to `()`
4539
|
4640
LL | fn foo2_fail<'a, T: Trait<'a, Assoc = ()>>() -> impl FooLike<Output = T::Assoc> {
4741
| ++++++++++++
4842

49-
error: aborting due to 3 previous errors
43+
error: aborting due to 2 previous errors
5044

51-
Some errors have detailed explanations: E0271, E0760.
52-
For more information about an error, try `rustc --explain E0271`.
45+
For more information about this error, try `rustc --explain E0271`.

0 commit comments

Comments
 (0)