rust/src/test/ui/error-codes/E0771.rs
Gabriel Smith 69d5dd6a50 disallow non-static lifetimes in const generics
This has been put in place to patch over an ICE caused when we encounter
a non-static lifetime in a const generic during borrow checking. This
restriction may be relaxed in the future, but we need more discussion
before then, and in the meantime we should still deal with this ICE.

Fixes issue #60814
2020-07-19 12:52:36 -04:00

8 lines
209 B
Rust

#![feature(const_generics)]
//~^ WARN the feature `const_generics` is incomplete
fn function_with_str<'a, const STRING: &'a str>() {} //~ ERROR E0771
fn main() {
function_with_str::<"Hello, world!">()
}