mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 06:51:58 +00:00
19 lines
272 B
Rust
19 lines
272 B
Rust
// check-pass
|
|
|
|
#![feature(adt_const_params)]
|
|
#![allow(incomplete_features)]
|
|
|
|
pub trait GetType<const N: &'static str> {
|
|
type Ty;
|
|
fn get(&self) -> &Self::Ty;
|
|
}
|
|
|
|
pub fn get_val<T>(value: &T) -> &T::Ty
|
|
where
|
|
T: GetType<"hello">,
|
|
{
|
|
value.get()
|
|
}
|
|
|
|
fn main() {}
|