mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-18 11:34:11 +00:00
e22fe4008c
This reverts commita8387aef8c
, reversing changes made to6e12110812
.
17 lines
310 B
Rust
17 lines
310 B
Rust
#[test]
|
|
fn convert() {
|
|
const fn from(x: i32) -> i32 {
|
|
i32::from(x)
|
|
}
|
|
|
|
const FOO: i32 = from(42);
|
|
assert_eq!(FOO, 42);
|
|
|
|
const fn into(x: Vec<String>) -> Vec<String> {
|
|
x.into()
|
|
}
|
|
|
|
const BAR: Vec<String> = into(Vec::new());
|
|
assert_eq!(BAR, Vec::<String>::new());
|
|
}
|