-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 #114606 - bvanjoi:fix-113462, r=compiler-errors
fix: not insert missing lifetime for `ConstParamTy` Fixes #113462 We should ignore the missing lifetime, as it's illegal to include a lifetime in a const param. r? ``@compiler-errors``
- Loading branch information
Showing
4 changed files
with
31 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// https://github.com/rust-lang/rust/issues/113462 | ||
|
||
struct S2<'b>(&'b ()); | ||
|
||
struct S<'a, const N: S2>(&'a ()); | ||
//~^ ERROR missing lifetime specifier [E0106] | ||
//~| ERROR `S2<'_>` is forbidden as the type of a const generic parameter | ||
|
||
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,18 @@ | ||
error[E0106]: missing lifetime specifier | ||
--> $DIR/lifetime-in-const-param.rs:5:23 | ||
| | ||
LL | struct S<'a, const N: S2>(&'a ()); | ||
| ^^ expected named lifetime parameter | ||
|
||
error: `S2<'_>` is forbidden as the type of a const generic parameter | ||
--> $DIR/lifetime-in-const-param.rs:5:23 | ||
| | ||
LL | struct S<'a, const N: S2>(&'a ()); | ||
| ^^ | ||
| | ||
= note: the only supported types are integers, `bool` and `char` | ||
= help: more complex types are supported with `#![feature(adt_const_params)]` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0106`. |
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