Move /src/test to /tests
This commit is contained in:
parent
ca855e6e42
commit
cf2dff2b1e
27592 changed files with 0 additions and 0 deletions
19
tests/ui/const-generics/slice-const-param.rs
Normal file
19
tests/ui/const-generics/slice-const-param.rs
Normal file
|
@ -0,0 +1,19 @@
|
|||
// run-pass
|
||||
|
||||
#![feature(adt_const_params)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
pub fn function_with_str<const STRING: &'static str>() -> &'static str {
|
||||
STRING
|
||||
}
|
||||
|
||||
pub fn function_with_bytes<const BYTES: &'static [u8]>() -> &'static [u8] {
|
||||
BYTES
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
assert_eq!(function_with_str::<"Rust">(), "Rust");
|
||||
assert_eq!(function_with_str::<"ℇ㇈↦">(), "ℇ㇈↦");
|
||||
assert_eq!(function_with_bytes::<b"AAAA">(), &[0x41, 0x41, 0x41, 0x41]);
|
||||
assert_eq!(function_with_bytes::<{&[0x41, 0x41, 0x41, 0x41]}>(), b"AAAA");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue