Skip to content

Commit e93982a

Browse files
committed
adopt to compiler changes
1 parent 690e037 commit e93982a

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

compiler/rustc_ast_lowering/src/path.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
346346
fn lower_parenthesized_parameter_data(
347347
&mut self,
348348
data: &ParenthesizedArgs,
349-
itctx: ImplTraitContext,
349+
itctx: &ImplTraitContext,
350350
) -> (GenericArgsCtor<'hir>, bool) {
351351
// Switch to `PassThrough` mode for anonymous lifetimes; this
352352
// means that we permit things like `&Ref<T>`, where `Ref` has

src/test/ui/impl-trait/impl-fn-predefined-lifetimes.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
use std::fmt::Debug;
33

44
fn a<'a>() -> impl Fn(&'a u8) -> (impl Debug + '_) {
5-
//~^ ERROR hidden type for `impl Debug` captures lifetime that does not appear in bounds
5+
//~^ ERROR cannot resolve opaque type
6+
67
|x| x
8+
//~^ ERROR concrete type differs from previous defining opaque type use
79
}
810

911
fn _b<'a>() -> impl Fn(&'a u8) -> (impl Debug + 'a) {
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
1-
error[E0700]: hidden type for `impl Debug` captures lifetime that does not appear in bounds
2-
--> $DIR/impl-fn-predefined-lifetimes.rs:4:35
1+
error: concrete type differs from previous defining opaque type use
2+
--> $DIR/impl-fn-predefined-lifetimes.rs:7:9
33
|
4-
LL | fn a<'a>() -> impl Fn(&'a u8) -> (impl Debug + '_) {
5-
| ^^^^^^^^^^^^^^^
4+
LL | |x| x
5+
| ^ expected `impl Debug + '_`, got `&u8`
66
|
7-
note: hidden type `&'<empty> u8` captures lifetime smaller than the function body
7+
note: previous use here
8+
--> $DIR/impl-fn-predefined-lifetimes.rs:7:5
9+
|
10+
LL | |x| x
11+
| ^^^^^
12+
13+
error[E0720]: cannot resolve opaque type
814
--> $DIR/impl-fn-predefined-lifetimes.rs:4:35
915
|
1016
LL | fn a<'a>() -> impl Fn(&'a u8) -> (impl Debug + '_) {
11-
| ^^^^^^^^^^^^^^^
17+
| ^^^^^^^^^^^^^^^ recursive opaque type
18+
...
19+
LL | |x| x
20+
| ----- returning here with type `[closure@$DIR/impl-fn-predefined-lifetimes.rs:7:5: 7:8]`
1221

13-
error: aborting due to previous error
22+
error: aborting due to 2 previous errors
1423

15-
For more information about this error, try `rustc --explain E0700`.
24+
For more information about this error, try `rustc --explain E0720`.

0 commit comments

Comments
 (0)