Skip to content

Commit

Permalink
Auto merge of rust-lang#95779 - cjgillot:ast-lifetimes-undeclared, r=…
Browse files Browse the repository at this point in the history
…petrochenkov

Report undeclared lifetimes during late resolution.

First step in rust-lang#91557

We reuse the rib design of the current resolution framework. Specific `LifetimeRib` and `LifetimeRibKind` types are introduced. The most important variant is `LifetimeRibKind::Generics`, which happens each time we encounter something which may introduce generic lifetime parameters. It can be an item or a `for<...>` binder. The `LifetimeBinderKind` specifies how this rib behaves with respect to in-band lifetimes.

r? `@petrochenkov`
  • Loading branch information
bors committed Apr 17, 2022
2 parents cc25cbd + e4110cf commit cb1924a
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tests/ui/unused_unit.stderr
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
error: unneeded unit return type
--> $DIR/unused_unit.rs:19:28
--> $DIR/unused_unit.rs:19:58
|
LL | pub fn get_unit<F: Fn() -> (), G>(&self, f: F, _g: G) -> ()
| ^^^^^^ help: remove the `-> ()`
| ^^^^^^ help: remove the `-> ()`
|
note: the lint level is defined here
--> $DIR/unused_unit.rs:12:9
Expand All @@ -11,16 +11,16 @@ LL | #![deny(clippy::unused_unit)]
| ^^^^^^^^^^^^^^^^^^^

error: unneeded unit return type
--> $DIR/unused_unit.rs:20:18
--> $DIR/unused_unit.rs:19:28
|
LL | where G: Fn() -> () {
| ^^^^^^ help: remove the `-> ()`
LL | pub fn get_unit<F: Fn() -> (), G>(&self, f: F, _g: G) -> ()
| ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
--> $DIR/unused_unit.rs:19:58
--> $DIR/unused_unit.rs:20:18
|
LL | pub fn get_unit<F: Fn() -> (), G>(&self, f: F, _g: G) -> ()
| ^^^^^^ help: remove the `-> ()`
LL | where G: Fn() -> () {
| ^^^^^^ help: remove the `-> ()`

error: unneeded unit return type
--> $DIR/unused_unit.rs:21:26
Expand Down

0 comments on commit cb1924a

Please sign in to comment.