mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-03 20:23:59 +00:00
16 lines
184 B
Rust
16 lines
184 B
Rust
//@ check-pass
|
|
pub struct S(u8);
|
|
|
|
impl S {
|
|
pub fn get<const A: u8>(&self) -> &u8 {
|
|
&self.0
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
const A: u8 = 5;
|
|
let s = S(0);
|
|
|
|
s.get::<A>();
|
|
}
|