forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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 rust-lang#99168 - TaKO8Ki:add-regression-test-for-747…
…13, r=Dylan-DPC Add regression test for rust-lang#74713 closes rust-lang#74713
- Loading branch information
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
src/test/ui/const-generics/generic_const_exprs/issue-74713.rs
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 @@ | ||
fn bug<'a>() | ||
where | ||
[(); { //~ ERROR mismatched types | ||
let _: &'a (); //~ ERROR a non-static lifetime is not allowed in a `const` | ||
}]: | ||
{} | ||
|
||
fn main() {} |
22 changes: 22 additions & 0 deletions
22
src/test/ui/const-generics/generic_const_exprs/issue-74713.stderr
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,22 @@ | ||
error[E0658]: a non-static lifetime is not allowed in a `const` | ||
--> $DIR/issue-74713.rs:4:17 | ||
| | ||
LL | let _: &'a (); | ||
| ^^ | ||
| | ||
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information | ||
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/issue-74713.rs:3:10 | ||
| | ||
LL | [(); { | ||
| __________^ | ||
LL | | let _: &'a (); | ||
LL | | }]: | ||
| |_____^ expected `usize`, found `()` | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
Some errors have detailed explanations: E0308, E0658. | ||
For more information about an error, try `rustc --explain E0308`. |