Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/test/ui/const-generics/issues/issue-74713.full.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
error[E0308]: mismatched types
--> $DIR/issue-74713.rs:9:10
|
LL | [(); {
| __________^
LL | | let _: &'a ();
LL | |
LL | | }]: ,
| |_____^ expected `usize`, found `()`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0308`.
12 changes: 12 additions & 0 deletions src/test/ui/const-generics/issues/issue-74713.min.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
error[E0658]: a non-static lifetime is not allowed in a `const`
--> $DIR/issue-74713.rs:10:17
|
LL | let _: &'a ();
| ^^
|
= note: see issue #44580 <https://github.com/rust-lang/rust/issues/44580> for more information
= help: add `#![feature(const_generics)]` to the crate attributes to enable

error: aborting due to previous error

For more information about this error, try `rustc --explain E0658`.
16 changes: 16 additions & 0 deletions src/test/ui/const-generics/issues/issue-74713.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// A regression test for #74713.

// revisions: full min
#![cfg_attr(full, feature(const_generics))]
#![cfg_attr(full, allow(incomplete_features))]

fn bug<'a>()
where
[(); { //[full]~ ERROR: mismatched types
let _: &'a ();
//[min]~^ ERROR: a non-static lifetime is not allowed in a `const`
}]: ,
{
}

fn main() {}