Update ui tests to 2018 edition

This commit is contained in:
David Tolnay 2019-01-12 15:16:36 -08:00
parent 4d5234c8d9
commit 48980ef754
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
19 changed files with 35 additions and 37 deletions

View File

@ -5,7 +5,14 @@ fn ui() {
compiletest::run_tests(&compiletest::Config {
mode: compiletest::common::Mode::Ui,
src_base: std::path::PathBuf::from("tests/ui"),
target_rustcflags: Some(String::from("-L tests/deps/target/debug/deps")),
target_rustcflags: Some(String::from(
"\
--edition=2018 \
-L tests/deps/target/debug/deps \
-Z unstable-options \
--extern serde_json \
",
)),
..Default::default()
});
}

View File

@ -1,5 +1,4 @@
#[macro_use]
extern crate serde_json;
use serde_json::json;
fn main() {
json!({ "a" });

View File

@ -1,7 +1,7 @@
error: unexpected end of macro invocation
--> $DIR/missing_colon.rs:5:5
--> $DIR/missing_colon.rs:4:5
|
5 | json!({ "a" });
4 | json!({ "a" });
| ^^^^^^^^^^^^^^^ missing tokens in macro arguments
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

View File

@ -1,5 +1,4 @@
#[macro_use]
extern crate serde_json;
use serde_json::json;
fn main() {
json!({ "a" : });

View File

@ -1,7 +1,7 @@
error: unexpected end of macro invocation
--> $DIR/missing_value.rs:5:5
--> $DIR/missing_value.rs:4:5
|
5 | json!({ "a" : });
4 | json!({ "a" : });
| ^^^^^^^^^^^^^^^^^ missing tokens in macro arguments
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

View File

@ -1,5 +1,4 @@
#[macro_use]
extern crate serde_json;
use serde_json::json;
fn main() {
json!({ "a" : x });

View File

@ -1,7 +1,7 @@
error[E0425]: cannot find value `x` in this scope
--> $DIR/not_found.rs:5:19
--> $DIR/not_found.rs:4:19
|
5 | json!({ "a" : x });
4 | json!({ "a" : x });
| ^ not found in this scope
error: aborting due to previous error

View File

@ -1,5 +1,4 @@
#[macro_use]
extern crate serde_json;
use serde_json::json;
fn main() {
json!({ "a" : ~ });

View File

@ -1,7 +1,7 @@
error: unexpected end of macro invocation
--> $DIR/parse_expr.rs:5:5
--> $DIR/parse_expr.rs:4:5
|
5 | json!({ "a" : ~ });
4 | json!({ "a" : ~ });
| ^^^^^^^^^^^^^^^^^^^ missing tokens in macro arguments
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

View File

@ -1,5 +1,4 @@
#[macro_use]
extern crate serde_json;
use serde_json::json;
fn main() {
json!({ "".s : true });

View File

@ -1,7 +1,7 @@
error[E0609]: no field `s` on type `&'static str`
--> $DIR/parse_key.rs:5:16
--> $DIR/parse_key.rs:4:16
|
5 | json!({ "".s : true });
4 | json!({ "".s : true });
| ^
error: aborting due to previous error

View File

@ -1,5 +1,4 @@
#[macro_use]
extern crate serde_json;
use serde_json::json;
fn main() {
json!([ true => ]);

View File

@ -1,7 +1,7 @@
error: no rules expected the token `=>`
--> $DIR/unexpected_after_array_element.rs:5:18
--> $DIR/unexpected_after_array_element.rs:4:18
|
5 | json!([ true => ]);
4 | json!([ true => ]);
| ^^ no rules expected this token in macro call
error: aborting due to previous error

View File

@ -1,5 +1,4 @@
#[macro_use]
extern crate serde_json;
use serde_json::json;
fn main() {
json!({ "k": true => });

View File

@ -1,7 +1,7 @@
error: no rules expected the token `=>`
--> $DIR/unexpected_after_map_entry.rs:5:23
--> $DIR/unexpected_after_map_entry.rs:4:23
|
5 | json!({ "k": true => });
4 | json!({ "k": true => });
| ^^ no rules expected this token in macro call
error: aborting due to previous error

View File

@ -1,5 +1,4 @@
#[macro_use]
extern crate serde_json;
use serde_json::json;
fn main() {
json!({ : true });

View File

@ -1,7 +1,7 @@
error: no rules expected the token `:`
--> $DIR/unexpected_colon.rs:5:13
--> $DIR/unexpected_colon.rs:4:13
|
5 | json!({ : true });
4 | json!({ : true });
| ^ no rules expected this token in macro call
error: aborting due to previous error

View File

@ -1,5 +1,4 @@
#[macro_use]
extern crate serde_json;
use serde_json::json;
fn main() {
json!({ "a" , "b": true });

View File

@ -1,7 +1,7 @@
error: no rules expected the token `,`
--> $DIR/unexpected_comma.rs:5:17
--> $DIR/unexpected_comma.rs:4:17
|
5 | json!({ "a" , "b": true });
4 | json!({ "a" , "b": true });
| ^ no rules expected this token in macro call
error: aborting due to previous error