-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #119042 - bvanjoi:fix-118697-2, r=compiler-errors
fallback `default` to `None` during ast-lowering for lifetime binder Fixes #118697 This is another attempt. It has a fallback, setting `default` to `None` and emit an error for non-lifetime binders during ast lowering. r? `@compiler-errors`
- Loading branch information
Showing
6 changed files
with
69 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// check-pass | ||
|
||
macro_rules! a { ($ty:ty) => {} } | ||
|
||
a! { for<T = &i32> fn() } | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#![allow(incomplete_features)] | ||
#![feature(non_lifetime_binders)] | ||
|
||
type T = dyn for<V = A(&())> Fn(()); | ||
//~^ ERROR default parameter is not allowed in this binder | ||
//~| ERROR cannot find type `A` in this scope | ||
//~| ERROR late-bound type parameter not allowed on trait object types | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
error[E0412]: cannot find type `A` in this scope | ||
--> $DIR/issue-118697.rs:4:22 | ||
| | ||
LL | type T = dyn for<V = A(&())> Fn(()); | ||
| ^ not found in this scope | ||
|
||
error: default parameter is not allowed in this binder | ||
--> $DIR/issue-118697.rs:4:22 | ||
| | ||
LL | type T = dyn for<V = A(&())> Fn(()); | ||
| ^^^^^^ | ||
|
||
error: late-bound type parameter not allowed on trait object types | ||
--> $DIR/issue-118697.rs:4:18 | ||
| | ||
LL | type T = dyn for<V = A(&())> Fn(()); | ||
| ^ | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0412`. |