mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-01 08:53:29 +00:00

Full list of `impl const Default` types: - () - bool - char - Cell - std::ascii::Char - usize - u8 - u16 - u32 - u64 - u128 - i8 - i16 - i32 - i64 - i128 - f16 - f32 - f64 - f128 - std::marker::PhantomData<T> - Option<T> - std::iter::Empty<T> - std::ptr::Alignment - &[T] - &mut [T] - &str - &mut str - String - Vec<T>
10 lines
208 B
Rust
10 lines
208 B
Rust
//@ run-pass
|
|
#![feature(const_trait_impl, const_default)]
|
|
#![allow(dead_code)]
|
|
// alloc::string
|
|
const STRING: String = Default::default();
|
|
// alloc::vec
|
|
const VEC: Vec<()> = Default::default();
|
|
|
|
fn main() {}
|