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`.

src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.edition2021.stderr

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,6 @@ help: add `dyn` keyword before this trait
99
LL | fn ice() -> impl AsRef<dyn Fn(&())> {
1010
| +++
1111

12-
error[E0277]: the trait bound `(): AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not satisfied
13-
--> $DIR/generic-with-implicit-hrtb-without-dyn.rs:6:13
14-
|
15-
LL | fn ice() -> impl AsRef<Fn(&())> {
16-
| ^^^^^^^^^^^^^^^^^^^ the trait `AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not implemented for `()`
17-
18-
error: aborting due to 2 previous errors
12+
error: aborting due to previous error
1913

20-
Some errors have detailed explanations: E0277, E0782.
21-
For more information about an error, try `rustc --explain E0277`.
14+
For more information about this error, try `rustc --explain E0782`.

src/test/ui/impl-trait/generic-with-implicit-hrtb-without-dyn.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#![allow(warnings)]
55

66
fn ice() -> impl AsRef<Fn(&())> {
7-
//~^ ERROR: the trait bound `(): AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not satisfied [E0277]
8-
//[edition2021]~| ERROR: trait objects must include the `dyn` keyword [E0782]
7+
//[edition2015]~^ ERROR: the trait bound `(): AsRef<(dyn for<'a> Fn(&'a ()) + 'static)>` is not satisfied [E0277]
8+
//[edition2021]~^^ ERROR: trait objects must include the `dyn` keyword [E0782]
99
todo!()
1010
}
1111

src/test/ui/impl-trait/issues/issue-92305.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::iter;
44

55
fn f<T>(data: &[T]) -> impl Iterator<Item = Vec> {
66
//~^ ERROR: missing generics for struct `Vec` [E0107]
7-
iter::empty() //~ ERROR: type annotations needed [E0282]
7+
iter::empty()
88
}
99

1010
fn g<T>(data: &[T], target: T) -> impl Iterator<Item = Vec<T>> {

src/test/ui/impl-trait/issues/issue-92305.stderr

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,24 +14,13 @@ help: add missing generic argument
1414
LL | fn f<T>(data: &[T]) -> impl Iterator<Item = Vec<T>> {
1515
| ~~~~~~
1616

17-
error[E0282]: type annotations needed
18-
--> $DIR/issue-92305.rs:7:5
19-
|
20-
LL | iter::empty()
21-
| ^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the function `empty`
22-
|
23-
help: consider specifying the generic argument
24-
|
25-
LL | iter::empty::<T>()
26-
| +++++
27-
2817
error[E0282]: type annotations needed
2918
--> $DIR/issue-92305.rs:10:35
3019
|
3120
LL | fn g<T>(data: &[T], target: T) -> impl Iterator<Item = Vec<T>> {
3221
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot infer type
3322

34-
error: aborting due to 3 previous errors
23+
error: aborting due to 2 previous errors
3524

3625
Some errors have detailed explanations: E0107, E0282.
3726
For more information about an error, try `rustc --explain E0107`.

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}), ['static, T, 'static, 'a/0])` 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}), ['a/0, T, BrNamed(DefId(0:12 ~ impl_trait_captures[1afc]::foo::'_))/2])` 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
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)