-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 #98609 - TaKO8Ki:fix-ice-for-associated-constant-gene…
…rics, r=lcnr Fix ICE for associated constant generics Fixes #98432
- Loading branch information
Showing
3 changed files
with
24 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
struct Struct<T>(T); | ||
|
||
impl<T> Struct<T> { | ||
const CONST: fn() = || { | ||
struct _Obligation where T:; //~ ERROR can't use generic parameters from outer function | ||
}; | ||
} | ||
|
||
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[E0401]: can't use generic parameters from outer function | ||
--> $DIR/issue-98432.rs:5:34 | ||
| | ||
LL | impl<T> Struct<T> { | ||
| - type parameter from outer function | ||
LL | const CONST: fn() = || { | ||
LL | struct _Obligation where T:; | ||
| ^ use of generic parameter from outer function | ||
| | ||
= help: try using a local generic parameter instead | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0401`. |