Rollup merge of #99168 - TaKO8Ki:add-regression-test-for-74713, r=Dylan-DPC

Add regression test for #74713

closes #74713
This commit is contained in:
Guillaume Gomez 2022-07-13 10:38:47 +02:00 committed by GitHub
commit 75d03d6e92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View File

@ -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() {}

View File

@ -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`.