Skip to content

Commit 75d03d6

Browse files
Rollup merge of #99168 - TaKO8Ki:add-regression-test-for-74713, r=Dylan-DPC
Add regression test for #74713 closes #74713
2 parents 3b30cce + 3de6d6b commit 75d03d6

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
fn bug<'a>()
2+
where
3+
[(); { //~ ERROR mismatched types
4+
let _: &'a (); //~ ERROR a non-static lifetime is not allowed in a `const`
5+
}]:
6+
{}
7+
8+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
error[E0658]: a non-static lifetime is not allowed in a `const`
2+
--> $DIR/issue-74713.rs:4:17
3+
|
4+
LL | let _: &'a ();
5+
| ^^
6+
|
7+
= note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
8+
= help: add `#![feature(generic_const_exprs)]` to the crate attributes to enable
9+
10+
error[E0308]: mismatched types
11+
--> $DIR/issue-74713.rs:3:10
12+
|
13+
LL | [(); {
14+
| __________^
15+
LL | | let _: &'a ();
16+
LL | | }]:
17+
| |_____^ expected `usize`, found `()`
18+
19+
error: aborting due to 2 previous errors
20+
21+
Some errors have detailed explanations: E0308, E0658.
22+
For more information about an error, try `rustc --explain E0308`.

0 commit comments

Comments
 (0)