Using the std option, so now `rust_std=..` will work. I've chosen to use "std" even though rust calls these "editions", as meson refers to language versions as "standards", which makes meson feel more uniform, and be less surprising. Fixes: #5100pull/7157/merge
parent
be2c1a4300
commit
7860a6aeab
6 changed files with 57 additions and 0 deletions
@ -0,0 +1,5 @@ |
||||
## Rust now has a a standard option |
||||
|
||||
Rust calls these `editions`, however, meson generally refers to such language |
||||
versions as "standards", or "std" for short. Rust uses "std" to keep normalize |
||||
it with other languages. |
@ -0,0 +1,3 @@ |
||||
trait Foo { |
||||
fn foo(&self, Box<dyn Foo>); |
||||
} |
@ -0,0 +1,9 @@ |
||||
const fn foo(x: i32) -> i32 { |
||||
return x + 1; |
||||
} |
||||
|
||||
const VALUE: i32 = foo(-1); |
||||
|
||||
pub fn main() { |
||||
std::process::exit(VALUE); |
||||
} |
@ -0,0 +1,18 @@ |
||||
project('rust std options', 'rust') |
||||
|
||||
# this only works in 2018 |
||||
new = executable( |
||||
'new', |
||||
'2018.rs', |
||||
override_options : ['rust_std=2018'], |
||||
) |
||||
|
||||
# this only works in 2015 |
||||
old = static_library( |
||||
'old', |
||||
'2015.rs', |
||||
override_options : ['rust_std=2015'], |
||||
) |
||||
|
||||
|
||||
test('2018 std', new) |
Loading…
Reference in new issue