mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
add edition compiletest header + fix tests
This commit is contained in:
parent
2a1c4eec40
commit
75d33cfa64
@ -9,7 +9,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
// ignore-tidy-linelength
|
||||
// compile-flags: --edition=2015 -Zunstable-options
|
||||
// edition:2015
|
||||
|
||||
// tests that editions work with the tyvar warning-turned-error
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
// ignore-tidy-linelength
|
||||
// compile-flags: --edition=2018 -Zunstable-options
|
||||
// edition:2018
|
||||
|
||||
// tests that editions work with the tyvar warning-turned-error
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2018 -Zunstable-options
|
||||
// edition:2018
|
||||
|
||||
#![feature(extern_absolute_paths)]
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2018 -Zunstable-options
|
||||
// edition:2018
|
||||
|
||||
#![feature(extern_absolute_paths)]
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2018 -Zunstable-options
|
||||
// edition:2018
|
||||
|
||||
#![feature(extern_absolute_paths)]
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
// aux-build:xcrate.rs
|
||||
// compile-flags: --edition=2018 -Zunstable-options
|
||||
// edition:2018
|
||||
|
||||
#![feature(crate_in_paths)]
|
||||
#![feature(extern_absolute_paths)]
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2018
|
||||
// edition:2018
|
||||
|
||||
#![feature(arbitrary_self_types, async_await, await_macro, futures_api, pin)]
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2015
|
||||
// edition:2015
|
||||
|
||||
#![feature(raw_identifiers)]
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2018
|
||||
// edition:2018
|
||||
|
||||
#![feature(raw_identifiers)]
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2015
|
||||
// edition:2015
|
||||
// aux-build:edition-kw-macro-2015.rs
|
||||
|
||||
#![feature(raw_identifiers)]
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2015
|
||||
// edition:2015
|
||||
// aux-build:edition-kw-macro-2018.rs
|
||||
|
||||
#![feature(raw_identifiers)]
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2018
|
||||
// edition:2018
|
||||
// aux-build:edition-kw-macro-2015.rs
|
||||
|
||||
#![feature(raw_identifiers)]
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2018
|
||||
// edition:2018
|
||||
// aux-build:edition-kw-macro-2018.rs
|
||||
|
||||
#![feature(raw_identifiers)]
|
||||
|
@ -9,7 +9,7 @@
|
||||
// except according to those terms.
|
||||
|
||||
// aux-build:xcrate.rs
|
||||
// compile-flags: --edition=2018 -Zunstable-options
|
||||
// edition:2018
|
||||
|
||||
#![feature(extern_absolute_paths)]
|
||||
|
||||
|
@ -12,7 +12,8 @@
|
||||
//
|
||||
// Regression test for #47075.
|
||||
|
||||
// compile-flags: --test --edition=2018 -Zunstable-options
|
||||
// edition:2018
|
||||
// compile-flags: --test
|
||||
|
||||
#![feature(extern_absolute_paths)]
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2018
|
||||
// edition:2018
|
||||
|
||||
#![feature(arbitrary_self_types, async_await, await_macro, futures_api, pin)]
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2015
|
||||
// edition:2015
|
||||
|
||||
#![feature(raw_identifiers)]
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2018
|
||||
// edition:2018
|
||||
|
||||
#![feature(raw_identifiers)]
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2015
|
||||
// edition:2015
|
||||
// aux-build:edition-kw-macro-2015.rs
|
||||
// compile-pass
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2015
|
||||
// edition:2015
|
||||
// aux-build:edition-kw-macro-2015.rs
|
||||
|
||||
#![feature(raw_identifiers)]
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2015
|
||||
// edition:2015
|
||||
// aux-build:edition-kw-macro-2018.rs
|
||||
|
||||
#![feature(raw_identifiers)]
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2015
|
||||
// edition:2015
|
||||
// aux-build:edition-kw-macro-2018.rs
|
||||
|
||||
#![feature(raw_identifiers)]
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2018
|
||||
// edition:2018
|
||||
// aux-build:edition-kw-macro-2015.rs
|
||||
// compile-pass
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2018
|
||||
// edition:2018
|
||||
// aux-build:edition-kw-macro-2015.rs
|
||||
|
||||
#![feature(raw_identifiers)]
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2018
|
||||
// edition:2018
|
||||
// aux-build:edition-kw-macro-2018.rs
|
||||
|
||||
#![feature(raw_identifiers)]
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2018
|
||||
// edition:2018
|
||||
// aux-build:edition-kw-macro-2018.rs
|
||||
|
||||
#![feature(raw_identifiers)]
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2015
|
||||
// edition:2015
|
||||
|
||||
#![feature(futures_api)]
|
||||
|
||||
|
@ -8,7 +8,8 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2018
|
||||
// edition:2018
|
||||
|
||||
#![feature(futures_api)]
|
||||
|
||||
async fn foo() {} //~ ERROR async fn is unstable
|
||||
|
@ -1,5 +1,5 @@
|
||||
error[E0658]: async fn is unstable (see issue #50547)
|
||||
--> $DIR/feature-gate-async-await.rs:14:1
|
||||
--> $DIR/feature-gate-async-await.rs:15:1
|
||||
|
|
||||
LL | async fn foo() {} //~ ERROR async fn is unstable
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
@ -7,7 +7,7 @@ LL | async fn foo() {} //~ ERROR async fn is unstable
|
||||
= help: add #![feature(async_await)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: async blocks are unstable (see issue #50547)
|
||||
--> $DIR/feature-gate-async-await.rs:17:13
|
||||
--> $DIR/feature-gate-async-await.rs:18:13
|
||||
|
|
||||
LL | let _ = async {}; //~ ERROR async blocks are unstable
|
||||
| ^^^^^^^^
|
||||
@ -15,7 +15,7 @@ LL | let _ = async {}; //~ ERROR async blocks are unstable
|
||||
= help: add #![feature(async_await)] to the crate attributes to enable
|
||||
|
||||
error[E0658]: async closures are unstable (see issue #50547)
|
||||
--> $DIR/feature-gate-async-await.rs:18:13
|
||||
--> $DIR/feature-gate-async-await.rs:19:13
|
||||
|
|
||||
LL | let _ = async || {}; //~ ERROR async closures are unstable
|
||||
| ^^^^^^^^^^^
|
||||
|
@ -11,7 +11,7 @@
|
||||
// tests that the anonymous_parameters lint is warn-by-default on the 2018 edition
|
||||
|
||||
// compile-pass
|
||||
// compile-flags: --edition=2018
|
||||
// edition:2018
|
||||
// run-rustfix
|
||||
|
||||
trait Foo {
|
||||
|
@ -11,7 +11,7 @@
|
||||
// tests that the anonymous_parameters lint is warn-by-default on the 2018 edition
|
||||
|
||||
// compile-pass
|
||||
// compile-flags: --edition=2018
|
||||
// edition:2018
|
||||
// run-rustfix
|
||||
|
||||
trait Foo {
|
||||
|
@ -8,7 +8,7 @@
|
||||
// option. This file may not be copied, modified, or distributed
|
||||
// except according to those terms.
|
||||
|
||||
// compile-flags: --edition=2018
|
||||
// edition:2018
|
||||
|
||||
#![feature(arbitrary_self_types, async_await, await_macro, futures_api, pin)]
|
||||
|
||||
|
@ -298,6 +298,10 @@ impl TestProps {
|
||||
.extend(flags.split_whitespace().map(|s| s.to_owned()));
|
||||
}
|
||||
|
||||
if let Some(edition) = config.parse_edition(ln) {
|
||||
self.compile_flags.push(format!("--edition={}", edition));
|
||||
}
|
||||
|
||||
if let Some(r) = config.parse_revisions(ln) {
|
||||
self.revisions.extend(r);
|
||||
}
|
||||
@ -371,9 +375,9 @@ impl TestProps {
|
||||
self.compile_pass = config.parse_compile_pass(ln) || self.run_pass;
|
||||
}
|
||||
|
||||
if !self.skip_codegen {
|
||||
self.skip_codegen = config.parse_skip_codegen(ln);
|
||||
}
|
||||
if !self.skip_codegen {
|
||||
self.skip_codegen = config.parse_skip_codegen(ln);
|
||||
}
|
||||
|
||||
if !self.disable_ui_testing_normalization {
|
||||
self.disable_ui_testing_normalization =
|
||||
@ -647,6 +651,10 @@ impl Config {
|
||||
fn parse_run_rustfix(&self, line: &str) -> bool {
|
||||
self.parse_name_directive(line, "run-rustfix")
|
||||
}
|
||||
|
||||
fn parse_edition(&self, line: &str) -> Option<String> {
|
||||
self.parse_name_value_directive(line, "edition")
|
||||
}
|
||||
}
|
||||
|
||||
pub fn lldb_version_to_int(version_string: &str) -> isize {
|
||||
|
@ -1368,6 +1368,7 @@ impl<'test> TestCx<'test> {
|
||||
.arg(out_dir)
|
||||
.arg(&self.testpaths.file)
|
||||
.args(&self.props.compile_flags);
|
||||
|
||||
if let Some(ref linker) = self.config.linker {
|
||||
rustdoc
|
||||
.arg("--linker")
|
||||
|
Loading…
Reference in New Issue
Block a user