Skip to content

Commit cb1924a

Browse files
committed
Auto merge of #95779 - cjgillot:ast-lifetimes-undeclared, r=petrochenkov
Report undeclared lifetimes during late resolution. First step in #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`
2 parents cc25cbd + e4110cf commit cb1924a

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/ui/unused_unit.stderr

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
error: unneeded unit return type
2-
--> $DIR/unused_unit.rs:19:28
2+
--> $DIR/unused_unit.rs:19:58
33
|
44
LL | pub fn get_unit<F: Fn() -> (), G>(&self, f: F, _g: G) -> ()
5-
| ^^^^^^ help: remove the `-> ()`
5+
| ^^^^^^ help: remove the `-> ()`
66
|
77
note: the lint level is defined here
88
--> $DIR/unused_unit.rs:12:9
@@ -11,16 +11,16 @@ LL | #![deny(clippy::unused_unit)]
1111
| ^^^^^^^^^^^^^^^^^^^
1212

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

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

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

0 commit comments

Comments
 (0)