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

14 lines
505 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 ()>);
2023-05-05 15:42:51 -05:00
//~^ ERROR: the type of const parameters must not depend on other generic parameters
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<'_, ""> {}