Skip to content

Commit

Permalink
Update ui tests to 2018 edition
Browse files Browse the repository at this point in the history
  • Loading branch information
dtolnay committed Jan 12, 2019
1 parent 4d5234c commit 48980ef
Show file tree
Hide file tree
Showing 19 changed files with 35 additions and 37 deletions.
9 changes: 8 additions & 1 deletion tests/compiletest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
});
}
3 changes: 1 addition & 2 deletions tests/ui/missing_colon.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#[macro_use]
extern crate serde_json;
use serde_json::json;

fn main() {
json!({ "a" });
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/missing_colon.stderr
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/missing_value.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#[macro_use]
extern crate serde_json;
use serde_json::json;

fn main() {
json!({ "a" : });
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/missing_value.stderr
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/not_found.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#[macro_use]
extern crate serde_json;
use serde_json::json;

fn main() {
json!({ "a" : x });
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/not_found.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/parse_expr.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#[macro_use]
extern crate serde_json;
use serde_json::json;

fn main() {
json!({ "a" : ~ });
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/parse_expr.stderr
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/parse_key.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#[macro_use]
extern crate serde_json;
use serde_json::json;

fn main() {
json!({ "".s : true });
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/parse_key.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/unexpected_after_array_element.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#[macro_use]
extern crate serde_json;
use serde_json::json;

fn main() {
json!([ true => ]);
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/unexpected_after_array_element.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/unexpected_after_map_entry.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#[macro_use]
extern crate serde_json;
use serde_json::json;

fn main() {
json!({ "k": true => });
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/unexpected_after_map_entry.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/unexpected_colon.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#[macro_use]
extern crate serde_json;
use serde_json::json;

fn main() {
json!({ : true });
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/unexpected_colon.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions tests/ui/unexpected_comma.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#[macro_use]
extern crate serde_json;
use serde_json::json;

fn main() {
json!({ "a" , "b": true });
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/unexpected_comma.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 48980ef

Please sign in to comment.