Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 2822aff

Browse files
committed
bless tests
1 parent bec8f58 commit 2822aff

30 files changed

+192
-22
lines changed

tests/ui/async-await/issues/issue-63388-1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait Foo {}
99
impl Xyz {
1010
async fn do_sth<'a>(
1111
&'a self, foo: &dyn Foo
12-
) -> &dyn Foo
12+
) -> &dyn Foo //~ WARNING elided lifetime has a name
1313
{
1414
//~^ ERROR explicit lifetime required in the type of `foo` [E0621]
1515
foo

tests/ui/async-await/issues/issue-63388-1.stderr

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
warning: elided lifetime has a name
2+
--> $DIR/issue-63388-1.rs:12:10
3+
|
4+
LL | async fn do_sth<'a>(
5+
| -- lifetime `'a` declared here
6+
LL | &'a self, foo: &dyn Foo
7+
LL | ) -> &dyn Foo
8+
| ^ this elided lifetime gets resolved as `'a`
9+
|
10+
= note: `#[warn(elided_named_lifetimes)]` on by default
11+
112
error[E0621]: explicit lifetime required in the type of `foo`
213
--> $DIR/issue-63388-1.rs:13:5
314
|
@@ -10,6 +21,6 @@ LL | | foo
1021
LL | | }
1122
| |_____^ lifetime `'a` required
1223

13-
error: aborting due to 1 previous error
24+
error: aborting due to 1 previous error; 1 warning emitted
1425

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

tests/ui/consts/min_const_fn/min_const_fn.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ impl<T> Foo<T> {
4444
impl<'a, T> Foo<T> {
4545
const fn new_lt(t: T) -> Self { Foo(t) }
4646
const fn into_inner_lt(self) -> T { self.0 } //~ destructor of
47-
const fn get_lt(&'a self) -> &T { &self.0 }
48-
const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
47+
const fn get_lt(&'a self) -> &T { &self.0 } //~ WARNING elided lifetime has a name
48+
const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 } //~ WARNING elided lifetime has a name
4949
//~^ mutable references
5050
//~| mutable references
5151
//~| mutable references

tests/ui/consts/min_const_fn/min_const_fn.stderr

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,23 @@
1+
warning: elided lifetime has a name
2+
--> $DIR/min_const_fn.rs:47:34
3+
|
4+
LL | impl<'a, T> Foo<T> {
5+
| -- lifetime `'a` declared here
6+
...
7+
LL | const fn get_lt(&'a self) -> &T { &self.0 }
8+
| ^ this elided lifetime gets resolved as `'a`
9+
|
10+
= note: `#[warn(elided_named_lifetimes)]` on by default
11+
12+
warning: elided lifetime has a name
13+
--> $DIR/min_const_fn.rs:48:42
14+
|
15+
LL | impl<'a, T> Foo<T> {
16+
| -- lifetime `'a` declared here
17+
...
18+
LL | const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
19+
| ^ this elided lifetime gets resolved as `'a`
20+
121
error[E0493]: destructor of `Foo<T>` cannot be evaluated at compile-time
222
--> $DIR/min_const_fn.rs:37:25
323
|
@@ -228,7 +248,7 @@ LL | const fn no_apit(_x: impl std::fmt::Debug) {}
228248
| |
229249
| the destructor for this type cannot be evaluated in constant functions
230250

231-
error: aborting due to 24 previous errors
251+
error: aborting due to 24 previous errors; 2 warnings emitted
232252

233253
Some errors have detailed explanations: E0493, E0658.
234254
For more information about an error, try `rustc --explain E0493`.

tests/ui/generics/generic-no-mangle.fixed

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-rustfix
2-
#![allow(dead_code)]
2+
#![allow(dead_code, elided_named_lifetimes)]
33
#![deny(no_mangle_generic_items)]
44

55
pub fn foo<T>() {} //~ ERROR functions generic over types or consts must be mangled

tests/ui/generics/generic-no-mangle.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ run-rustfix
2-
#![allow(dead_code)]
2+
#![allow(dead_code, elided_named_lifetimes)]
33
#![deny(no_mangle_generic_items)]
44

55
#[no_mangle]

tests/ui/impl-trait/impl-fn-hrtb-bounds.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ fn b() -> impl for<'a> Fn(&'a u8) -> (impl Debug + 'a) {
1313

1414
fn c() -> impl for<'a> Fn(&'a u8) -> (impl Debug + '_) {
1515
//~^ ERROR `impl Trait` cannot capture higher-ranked lifetime from outer `impl Trait`
16+
//~| WARNING elided lifetime has a name
1617
|x| x
1718
}
1819

tests/ui/impl-trait/impl-fn-hrtb-bounds.stderr

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0106]: missing lifetime specifier
2-
--> $DIR/impl-fn-hrtb-bounds.rs:19:38
2+
--> $DIR/impl-fn-hrtb-bounds.rs:20:38
33
|
44
LL | fn d() -> impl Fn() -> (impl Debug + '_) {
55
| ^^ expected named lifetime parameter
@@ -10,6 +10,14 @@ help: consider using the `'static` lifetime, but this is uncommon unless you're
1010
LL | fn d() -> impl Fn() -> (impl Debug + 'static) {
1111
| ~~~~~~~
1212

13+
warning: elided lifetime has a name
14+
--> $DIR/impl-fn-hrtb-bounds.rs:14:52
15+
|
16+
LL | fn c() -> impl for<'a> Fn(&'a u8) -> (impl Debug + '_) {
17+
| -- lifetime `'a` declared here ^^ this elided lifetime gets resolved as `'a`
18+
|
19+
= note: `#[warn(elided_named_lifetimes)]` on by default
20+
1321
error[E0657]: `impl Trait` cannot capture higher-ranked lifetime from outer `impl Trait`
1422
--> $DIR/impl-fn-hrtb-bounds.rs:4:41
1523
|
@@ -46,7 +54,7 @@ note: lifetime declared here
4654
LL | fn c() -> impl for<'a> Fn(&'a u8) -> (impl Debug + '_) {
4755
| ^^
4856

49-
error: aborting due to 4 previous errors
57+
error: aborting due to 4 previous errors; 1 warning emitted
5058

5159
Some errors have detailed explanations: E0106, E0657.
5260
For more information about an error, try `rustc --explain E0106`.

tests/ui/impl-trait/impl-fn-predefined-lifetimes.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::fmt::Debug;
33

44
fn a<'a>() -> impl Fn(&'a u8) -> (impl Debug + '_) {
55
//~^ ERROR cannot resolve opaque type
6+
//~| WARNING elided lifetime has a name
67
|x| x
78
//~^ ERROR expected generic lifetime parameter, found `'_`
89
}
Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
1+
warning: elided lifetime has a name
2+
--> $DIR/impl-fn-predefined-lifetimes.rs:4:48
3+
|
4+
LL | fn a<'a>() -> impl Fn(&'a u8) -> (impl Debug + '_) {
5+
| -- lifetime `'a` declared here ^^ this elided lifetime gets resolved as `'a`
6+
|
7+
= note: `#[warn(elided_named_lifetimes)]` on by default
8+
19
error[E0792]: expected generic lifetime parameter, found `'_`
2-
--> $DIR/impl-fn-predefined-lifetimes.rs:6:9
10+
--> $DIR/impl-fn-predefined-lifetimes.rs:7:9
311
|
412
LL | fn a<'a>() -> impl Fn(&'a u8) -> (impl Debug + '_) {
513
| -- this generic parameter must be used with a generic lifetime parameter
6-
LL |
14+
...
715
LL | |x| x
816
| ^
917

@@ -13,7 +21,7 @@ error[E0720]: cannot resolve opaque type
1321
LL | fn a<'a>() -> impl Fn(&'a u8) -> (impl Debug + '_) {
1422
| ^^^^^^^^^^^^^^^ cannot resolve opaque type
1523

16-
error: aborting due to 2 previous errors
24+
error: aborting due to 2 previous errors; 1 warning emitted
1725

1826
Some errors have detailed explanations: E0720, E0792.
1927
For more information about an error, try `rustc --explain E0720`.

0 commit comments

Comments
 (0)