rust/tests/ui/const-generics/issues/issue-56445-1.rs

14 lines
480 B
Rust
Raw Normal View History

2020-07-26 04:54:24 -05:00
// Regression test for https://github.com/rust-lang/rust/issues/56445#issuecomment-518402995.
// revisions: full min
#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]
2020-07-26 04:54:24 -05:00
#![crate_type = "lib"]
use std::marker::PhantomData;
struct Bug<'a, const S: &'a str>(PhantomData<&'a ()>);
//~^ ERROR: use of non-static lifetime `'a` in const generic
2023-02-03 17:21:56 -06:00
//[min]~| ERROR: `&str` is forbidden as the type of a const generic parameter
2020-07-26 04:54:24 -05:00
impl Bug<'_, ""> {}