-
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.
Rollup merge of #97683 - cjgillot:no-apit-hrtb, r=nagisa
Fail gracefully when encountering an HRTB in APIT. Fixes #96954 ~The first commit will be merged as part of #97415
- Loading branch information
Showing
4 changed files
with
87 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
trait Trait<'a> { | ||
type Assoc; | ||
} | ||
|
||
fn test_argument_position(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {} | ||
//~^ ERROR `impl Trait` can only mention lifetimes bound at the fn or impl level | ||
|
||
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,14 @@ | ||
error: `impl Trait` can only mention lifetimes bound at the fn or impl level | ||
--> $DIR/universal_wrong_hrtb.rs:5:73 | ||
| | ||
LL | fn test_argument_position(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {} | ||
| ^^ | ||
| | ||
note: lifetime declared here | ||
--> $DIR/universal_wrong_hrtb.rs:5:39 | ||
| | ||
LL | fn test_argument_position(x: impl for<'a> Trait<'a, Assoc = impl Copy + 'a>) {} | ||
| ^^ | ||
|
||
error: aborting due to previous error | ||
|