diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2022-03-10 23:12:35 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2022-04-17 11:03:34 +0200 |
| commit | a9e13fa5533df7fc004aeab00d45822eacb8461e (patch) | |
| tree | 6d759bc7958cc987f346f6e7f1d00b3487fc7b01 /src/test/ui | |
| parent | ca57bada05373ff227c661cc542e99c92b70c0ee (diff) | |
| download | rust-a9e13fa5533df7fc004aeab00d45822eacb8461e.tar.gz rust-a9e13fa5533df7fc004aeab00d45822eacb8461e.zip | |
Lint elided lifetimes in path on the AST.
Diffstat (limited to 'src/test/ui')
| -rw-r--r-- | src/test/ui/async-await/async-fn-path-elision.stderr | 6 | ||||
| -rw-r--r-- | src/test/ui/impl-header-lifetime-elision/path-elided.stderr | 6 | ||||
| -rw-r--r-- | src/test/ui/impl-header-lifetime-elision/trait-elided.stderr | 6 | ||||
| -rw-r--r-- | src/test/ui/issues/issue-10412.stderr | 6 | ||||
| -rw-r--r-- | src/test/ui/lifetimes/issue-91763.stderr | 6 | ||||
| -rw-r--r-- | src/test/ui/lint/force-warn/allowed-by-default-lint.stderr | 6 | ||||
| -rw-r--r-- | src/test/ui/lint/reasons.rs | 4 | ||||
| -rw-r--r-- | src/test/ui/lint/reasons.stderr | 8 | ||||
| -rw-r--r-- | src/test/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr | 6 |
9 files changed, 40 insertions, 14 deletions
diff --git a/src/test/ui/async-await/async-fn-path-elision.stderr b/src/test/ui/async-await/async-fn-path-elision.stderr index 3d18d9c4125..5e0c8c29989 100644 --- a/src/test/ui/async-await/async-fn-path-elision.stderr +++ b/src/test/ui/async-await/async-fn-path-elision.stderr @@ -2,9 +2,13 @@ error[E0726]: implicit elided lifetime not allowed here --> $DIR/async-fn-path-elision.rs:5:20 | LL | async fn error(lt: HasLifetime) { - | ^^^^^^^^^^^- help: indicate the anonymous lifetime: `<'_>` + | ^^^^^^^^^^^ expected lifetime parameter | = note: assuming a `'static` lifetime... +help: indicate the anonymous lifetime + | +LL | async fn error(lt: HasLifetime<'_>) { + | ++++ error: aborting due to previous error diff --git a/src/test/ui/impl-header-lifetime-elision/path-elided.stderr b/src/test/ui/impl-header-lifetime-elision/path-elided.stderr index 90522a885ab..0b7d3f1e851 100644 --- a/src/test/ui/impl-header-lifetime-elision/path-elided.stderr +++ b/src/test/ui/impl-header-lifetime-elision/path-elided.stderr @@ -2,9 +2,13 @@ error[E0726]: implicit elided lifetime not allowed here --> $DIR/path-elided.rs:7:18 | LL | impl MyTrait for Foo { - | ^^^- help: indicate the anonymous lifetime: `<'_>` + | ^^^ expected lifetime parameter | = note: assuming a `'static` lifetime... +help: indicate the anonymous lifetime + | +LL | impl MyTrait for Foo<'_> { + | ++++ error: aborting due to previous error diff --git a/src/test/ui/impl-header-lifetime-elision/trait-elided.stderr b/src/test/ui/impl-header-lifetime-elision/trait-elided.stderr index be918d0a30c..412bba6be71 100644 --- a/src/test/ui/impl-header-lifetime-elision/trait-elided.stderr +++ b/src/test/ui/impl-header-lifetime-elision/trait-elided.stderr @@ -2,9 +2,13 @@ error[E0726]: implicit elided lifetime not allowed here --> $DIR/trait-elided.rs:5:6 | LL | impl MyTrait for u32 {} - | ^^^^^^^- help: indicate the anonymous lifetime: `<'_>` + | ^^^^^^^ expected lifetime parameter | = note: assuming a `'static` lifetime... +help: indicate the anonymous lifetime + | +LL | impl MyTrait<'_> for u32 {} + | ++++ error: aborting due to previous error diff --git a/src/test/ui/issues/issue-10412.stderr b/src/test/ui/issues/issue-10412.stderr index a65005fd72d..46b9fd541ad 100644 --- a/src/test/ui/issues/issue-10412.stderr +++ b/src/test/ui/issues/issue-10412.stderr @@ -44,9 +44,13 @@ error[E0726]: implicit elided lifetime not allowed here --> $DIR/issue-10412.rs:7:13 | LL | impl<'self> Serializable<str> for &'self str { - | ^^^^^^^^^^^^^^^^^ help: indicate the anonymous lifetime: `Serializable<'_, str>` + | ^^^^^^^^^^^^^^^^^ expected lifetime parameter | = note: assuming a `'static` lifetime... +help: indicate the anonymous lifetime + | +LL | impl<'self> Serializable<'_, str> for &'self str { + | +++ error[E0277]: the size for values of type `str` cannot be known at compilation time --> $DIR/issue-10412.rs:7:13 diff --git a/src/test/ui/lifetimes/issue-91763.stderr b/src/test/ui/lifetimes/issue-91763.stderr index 1b1912c8e45..6ccf008c003 100644 --- a/src/test/ui/lifetimes/issue-91763.stderr +++ b/src/test/ui/lifetimes/issue-91763.stderr @@ -2,13 +2,17 @@ error: hidden lifetime parameters in types are deprecated --> $DIR/issue-91763.rs:8:20 | LL | fn f() -> Ptr<Thing>; - | ^ expected named lifetime parameter + | ^ expected lifetime parameter | note: the lint level is defined here --> $DIR/issue-91763.rs:3:9 | LL | #![deny(elided_lifetimes_in_paths)] | ^^^^^^^^^^^^^^^^^^^^^^^^^ +help: indicate the anonymous lifetime + | +LL | fn f() -> Ptr<Thing><'_>; + | ++++ error: aborting due to previous error diff --git a/src/test/ui/lint/force-warn/allowed-by-default-lint.stderr b/src/test/ui/lint/force-warn/allowed-by-default-lint.stderr index f5e8b41b163..ac98b5896ca 100644 --- a/src/test/ui/lint/force-warn/allowed-by-default-lint.stderr +++ b/src/test/ui/lint/force-warn/allowed-by-default-lint.stderr @@ -2,13 +2,13 @@ warning: hidden lifetime parameters in types are deprecated --> $DIR/allowed-by-default-lint.rs:9:12 | LL | fn foo(x: &Foo) {} - | ^^^ expected named lifetime parameter + | ^^^ expected lifetime parameter | = note: requested on the command line with `--force-warn elided-lifetimes-in-paths` -help: consider using the `'_` lifetime +help: indicate the anonymous lifetime | LL | fn foo(x: &Foo<'_>) {} - | ~~~~~~~ + | ++++ warning: 1 warning emitted diff --git a/src/test/ui/lint/reasons.rs b/src/test/ui/lint/reasons.rs index b1792e2e9cb..da1c740c4a3 100644 --- a/src/test/ui/lint/reasons.rs +++ b/src/test/ui/lint/reasons.rs @@ -19,9 +19,9 @@ pub struct CheaterDetectionMechanism {} impl fmt::Debug for CheaterDetectionMechanism { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { //~^ WARN hidden lifetime parameters in types are deprecated - //~| NOTE expected named lifetime parameter + //~| NOTE expected lifetime parameter //~| NOTE explicit anonymous lifetimes aid - //~| HELP consider using the `'_` lifetime + //~| HELP indicate the anonymous lifetime fmt.debug_struct("CheaterDetectionMechanism").finish() } } diff --git a/src/test/ui/lint/reasons.stderr b/src/test/ui/lint/reasons.stderr index a692d6af703..cd8412153f1 100644 --- a/src/test/ui/lint/reasons.stderr +++ b/src/test/ui/lint/reasons.stderr @@ -2,7 +2,9 @@ warning: hidden lifetime parameters in types are deprecated --> $DIR/reasons.rs:20:34 | LL | fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { - | ^^^^^^^^^ expected named lifetime parameter + | -----^^^^^^^^^ + | | + | expected lifetime parameter | = note: explicit anonymous lifetimes aid reasoning about ownership note: the lint level is defined here @@ -10,10 +12,10 @@ note: the lint level is defined here | LL | #![warn(elided_lifetimes_in_paths, | ^^^^^^^^^^^^^^^^^^^^^^^^^ -help: consider using the `'_` lifetime +help: indicate the anonymous lifetime | LL | fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { - | ~~~~~~~~~~~~~ + | ++++ warning: variable `Social_exchange_psychology` should have a snake case name --> $DIR/reasons.rs:30:9 diff --git a/src/test/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr b/src/test/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr index ba624507c21..16d19872552 100644 --- a/src/test/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr +++ b/src/test/ui/wf/wf-in-foreign-fn-decls-issue-80468.stderr @@ -2,9 +2,13 @@ error[E0726]: implicit elided lifetime not allowed here --> $DIR/wf-in-foreign-fn-decls-issue-80468.rs:13:16 | LL | impl Trait for Ref {} - | ^^^- help: indicate the anonymous lifetime: `<'_>` + | ^^^ expected lifetime parameter | = note: assuming a `'static` lifetime... +help: indicate the anonymous lifetime + | +LL | impl Trait for Ref<'_> {} + | ++++ error: incompatible lifetime on type --> $DIR/wf-in-foreign-fn-decls-issue-80468.rs:16:21 |
