Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a compiletest header for edition #51800

Merged
merged 1 commit into from
Jun 28, 2018

Conversation

mark-i-m
Copy link
Member

r? @nikomatsakis

Are the -Zunstable-options options needed in these tests? It looks like they aren't. If not, I can remove them.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 26, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-llvm-3.9 of your PR failed on Travis (raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem.

Click to expand the log.
[00:46:32] 
[00:46:32] running 1522 tests
[00:46:36] ................................................................................................i...
[00:46:42] ..........................................................i.........................................
[00:46:46] ......................F..FF.F.......................................................................
[00:46:50] ....................................................................................................
[00:46:53] ...............................................................................................F....
[00:47:01] ....................................................................................................
[00:47:06] ....................................................................................................
[00:47:12] ....................................................................................................
[00:47:12] ....................................................................................................
[00:47:17] ..............................F.....................................................................
[00:47:23] .................i................................................................................Fi
[00:47:28] ....................................................................................................
[00:47:33] ......................................................F.............................................
[00:47:39] ....................................................................................................
[00:47:45] .................F...................i..............................................................
n the tests and pass the `--bless` flag
[00:47:46] To only update this specific test, also pass `--test-args edition-keywords-2015-2018-expansion.rs`
[00:47:46] error: 1 errors occurred comparing output.
[00:47:46] status: exit code: 101
[00:47:46] status: exit code: 101
[00:47:46] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/edition-keywords-2015-2018-expansion.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/edition-keywords-2015-2018-expansion/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/edition-keywords-2015-2018-expansion/auxiliary" "-A" "unused"
[00:47:46] ------------------------------------------
[00:47:46] 
[00:47:46] ------------------------------------------
[00:47:46] stderr:
[00:47:46] stderr:
[00:47:46] ------------------------------------------
[00:47:46] {"message":"`main` function not found in crate `edition_keywords_2015_2018_expansion`","code":{"code":"E0601","explanation":"\nNo `main` function was found in a binary crate. To fix this error, add a\n`main` function. For example:\n\n```\nfn main() {\n    // Your program will start here.\n    println!(\"Hello world!\");\n}\n```\n\nIf you don't know the basics of Rust, you can go look to the Rust Book to get\nstarted: https://doc.rust-lang.org/book/\n"},"level":"error","spans":[],"children":[{"message":"consider adding a `main` function to `/checkout/src/test/ui/edition-keywords-2015-2018-expansion.rs`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0601]: `main` function not found in crate `edition_keywords_2015_2018_expansion`\n   |\n   = note: consider adding a `main` function to `/checkout/src/test/ui/edition-keywords-2015-2018-expansion.rs`\n\n"}
[00:47:46] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:47:46] {"message":"For more information about this error, try `rustc --explain E0601`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0601`.\n"}
[00:47:46] ------------------------------------------
[00:47:46] 
[00:47:46] thread '[ui] ui/edition-keywords-2015-2018-expansion.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3154:9
[00:47:46] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:47:46] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:47:46] 
[00:47:46] ---- [ui] ui/edition-keywords-2018-2015-parsing.rs stdout ----
[00:47:46] diff of stderr:
[00:47:46] 
[00:47:46] - error: expected identifier, found reserved keyword `async`
[00:47:46] -   --> $DIR/edition-keywords-2018-2015-parsing.rs:20:13
[00:47:46] -    |
[00:47:46] - LL |     let mut async = 1; //~ ERROR expected identifier, found reserved keyword `async`
[00:47:46] -    |             ^^^^^ expected identifier, found reserved keyword
[00:47:46] - 
[00:47:46] - error: expected identifier, found reserved keyword `async`
[00:47:46] -   --> $DIR/edition-keywords-2018-2015-parsing.rs:30:13
[00:47:46] -    |
[00:47:46] - LL |     module::async(); //~ ERROR expected identifier, found reserved keyword `async`
[00:47:46] -    |             ^^^^^ expected identifier, found reserved keyword
[00:47:46] - 
[00:47:46] 13 error: no rules expected the token `r#async`
[00:47:46] 14   --> $DIR/edition-keywords-2018-2015-parsing.rs:24:31
[00:47:46] 
[00:47:46] 
[00:47:46] 22 LL |     r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`
[00:47:46] 24 
[00:47:46] 24 
[00:47:46] - error: expected one of `move`, `|`, or `||`, found `<eof>`
[00:47:46] -   --> <passes_ident macros>:1:22
[00:47:46] -    |
[00:47:46] - LL | ( $ i : ident ) => ( $ i )
[00:47:46] -    |                      ^^^ expected one of `move`, `|`, or `||` here
[00:47:46] - error: aborting due to 5 previous errors
[00:47:46] + error: aborting due to 2 previous errors
[00:47:46] 32 
[00:47:46] 33 
[00:47:46] 33 
[00:47:46] 
[00:47:46] 
[00:47:46] The actual stderr differed from the expected stderr.
[00:47:46] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/edition-keywords-2018-2015-parsing/edition-keywords-2018-2015-parsing.stderr
[00:47:46] To update references, rerun the tests and pass the `--bless` flag
[00:47:46] To only update this specific test, also pass `--test-args edition-keywords-2018-2015-parsing.rs`
[00:47:46] error: 1 errors occurred comparing output.
[00:47:46] status: exit code: 101
[00:47:46] status: exit code: 101
[00:47:46] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/edition-keywords-2018-2015-parsing.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/edition-keywords-2018-2015-parsing/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/edition-keywords-2018-2015-parsing/auxiliary" "-A" "unused"
[00:47:46] ------------------------------------------
[00:47:46] 
[00:47:46] ------------------------------------------
[00:47:46] stderr:
[00:47:46] stderr:
[00:47:46] ------------------------------------------
[00:47:46] {"message":"no rules expected the token `r#async`","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/edition-keywords-2018-2015-parsing.rs","byte_start":816,"byte_end":823,"line_start":24,"line_end":24,"column_start":31,"column_end":38,"is_primary":true,"text":[{"text":"    r#async = consumes_async!(r#async); //~ ERROR no rules expected the token `r#async`","highlight_start":31,"highlight_end":38}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: no rules expected the token `r#async`\n  --> /checkout/src/test/ui/edition-keywords-2018-2015-parsing.rs:24:31\n   |\nLL |     r#async = consumes_async!(r#async); //~ ERROR no rules expected the token `r#async`\n   |                               ^^^^^^^\n\n"}
[00:47:46] {"message":"no rules expected the token `async`","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/edition-keywords-2018-2015-parsing.rs","byte_start":908,"byte_end":913,"line_start":25,"line_end":25,"column_start":35,"column_end":40,"is_primary":true,"text":[{"text":"    r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`","highlight_start":35,"highlight_end":40}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: no rules expected the token `async`\n  --> /checkout/src/test/ui/edition-keywords-2018-2015-parsing.rs:25:35\n   |\nLL |     r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`\n   |                                   ^^^^^\n\n"}
[00:47:46] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[00:47:46] ------------------------------------------
[00:47:46] 
[00:47:46] thread '[ui] ui/edition-keywords-2018-2015-parsing.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3154:9
[00:47:46] 
[00:47:46] 
[00:47:46] ---- [ui] ui/edition-keywords-2018-2018-expansion.rs stdout ----
[00:47:46] diff of stderr:
[00:47:46] 
[00:47:46] - error: expected identifier, found reserved keyword `async`
[00:47:46] -   --> $DIR/edition-keywords-2018-2018-expansion.rs:20:5
[00:47:46] + error[E0601]: `main` function not found in crate `edition_keywords_2018_2018_expansion`
[00:47:46] 3    |
[00:47:46] - LL |     produces_async! {} // ERROR expected identifier, found reserved keyword `async`
[00:47:46] -    |     ^^^^^^^^^^^^^^^^^^ expected identifier, found reserved keyword
[00:47:46] -    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:47:46] -    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
[00:47:46] +    = note: consider adding a `main` function to `$DIR/edition-keywords-2018-2018-expansion.rs`
[00:47:46] 9 error: aborting due to previous error
[00:47:46] 10 
[00:47:46] 
[00:47:46] + For more information about this error, try `rustc --explain E0601`.
[00:47:46] + For more information about this error, try `rustc --explain E0601`.
[00:47:46] 11 
[00:47:46] 
[00:47:46] 
[00:47:46] The actual stderr differed from the expected stderr.
[00:47:46] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/edition-keywords-2018-2018-expansion/edition-keywords-2018-2018-expansion.stderr
[00:47:46] To update references, rerun the tests and pass the `--bless` flag
[00:47:46] To only update this specific test, also pass `--test-args edition-keywords-2018-2018-expansion.rs`
[00:47:46] error: 1 errors occurred comparing output.
[00:47:46] status: exit code: 101
[00:47:46] status: exit code: 101
[00:47:46] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/edition-keywords-2018-2018-expansion.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/edition-keywords-2018-2018-expansion/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/edition-keywords-2018-2018-expansion/auxiliary" "-A" "unused"
[panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3154:9
[00:47:46] 
[00:47:46] ---- [ui] ui/edition-keywords-2018-2018-parsing.rs stdout ----
[00:47:46] diff of stderr:
[00:47:46] diff of stderr:
[00:47:46] 
[00:47:46] - error: expected identifier, found reserved keyword `async`
[00:47:46] -   --> $DIR/edition-keywords-2018-2018-parsing.rs:20:13
[00:47:46] -    |
[00:47:46] - LL |     let mut async = 1; //~ ERROR expected identifier, found reserved keyword `async`
[00:47:46] -    |             ^^^^^ expected identifier, found reserved keyword
[00:47:46] - 
[00:47:46] - error: expected identifier, found reserved keyword `async`
[00:47:46] -   --> $DIR/edition-keywords-2018-2018-parsing.rs:30:13
[00:47:46] -    |
[00:47:46] - LL |     module::async(); //~ ERROR expected identifier, found reserved keyword `async`
[00:47:46] -    |             ^^^^^ expected identifier, found reserved keyword
[00:47:46] - 
[00:47:46] 13 error: no rules expected the token `r#async`
[00:47:46] 14   --> $DIR/edition-keywords-2018-2018-parsing.rs:24:31
[00:47:46] 
[00:47:46] 
[00:47:46] 22 LL |     r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`
[00:47:46] 24 
[00:47:46] 24 
[00:47:46] - error: expected one of `move`, `|`, or `||`, found `<eof>`
[00:47:46] -   --> <passes_ident macros>:1:22
[00:47:46] -    |
[00:47:46] - LL | ( $ i : ident ) => ( $ i )
[00:47:46] -    |                      ^^^ expected one of `move`, `|`, or `||` here
[00:47:46] - error: aborting due to 5 previous errors
[00:47:46] + error: aborting due to 2 previous errors
[00:47:46] 32 
[00:47:46] 33 
[00:47:46] 33 
[00:47:46] 
[00:47:46] 
[00:47:46] The actual stderr differed from the expected stderr.
[00:47:46] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/edition-keywords-2018-2018-parsing/edition-keywords-2018-2018-parsing.stderr
[00:47:46] To update references, rerun the tests and pass the `--bless` flag
[00:47:46] To only update this specific test, also pass `--test-args edition-keywords-2018-2018-parsing.rs`
[00:47:46] error: 1 errors occurred comparing output.
[00:47:46] status: exit code: 101
[00:47:46] status: exit code: 101
[00:47:46] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/edition-keywords-2018-2018-parsing.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/edition-keywords-2018-2018-parsing/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/edition-keywords-2018-2018-parsing/auxiliary" "-A" "unused"
[00:47:46] ------------------------------------------
[00:47:46] 
[00:47:46] ------------------------------------------
[00:47:46] stderr:
[00:47:46] stderr:
[00:47:46] ------------------------------------------
[00:47:46] {"message":"no rules expected the token `r#async`","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/edition-keywords-2018-2018-parsing.rs","byte_start":816,"byte_end":823,"line_start":24,"line_end":24,"column_start":31,"column_end":38,"is_primary":true,"text":[{"text":"    r#async = consumes_async!(r#async); //~ ERROR no rules expected the token `r#async`","highlight_start":31,"highlight_end":38}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: no rules expected the token `r#async`\n  --> /checkout/src/test/ui/edition-keywords-2018-2018-parsing.rs:24:31\n   |\nLL |     r#async = consumes_async!(r#async); //~ ERROR no rules expected the token `r#async`\n   |                               ^^^^^^^\n\n"}
[00:47:46] {"message":"no rules expected the token `async`","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/edition-keywords-2018-2018-parsing.rs","byte_start":908,"byte_end":913,"line_start":25,"line_end":25,"column_start":35,"column_end":40,"is_primary":true,"text":[{"text":"    r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`","highlight_start":35,"highlight_end":40}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error: no rules expected the token `async`\n  --> /checkout/src/test/ui/edition-keywords-2018-2018-parsing.rs:25:35\n   |\nLL |     r#async = consumes_async_raw!(async); //~ ERROR no rules expected the token `async`\n   |                                   ^^^^^\n\n"}
[00:47:46] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[00:47:46] ------------------------------------------
[00:47:46] 
[00:47:46] 
[00:47:4ld/x86_64-unknown-linux-gnu/test/ui/feature-gate-async-await/auxiliary" "-A" "unused"
[00:47:46] ------------------------------------------
[00:47:46] 
[00:47:46] ------------------------------------------
[00:47:46] stderr:
[00:47:46] stderr:
[00:47:46] ------------------------------------------
[00:47:46] {"message":"cannot find struct, variant or union type `async` in this scope","code":{"code":"E0422","explanation":"\nYou are trying to use an identifier that is either undefined or not a struct.\nErroneous code example:\n\n```compile_fail,E0422\nfn main () {\n    let x = Foo { x: 1, y: 2 };\n}\n```\n\nIn this case, `Foo` is undefined, so it inherently isn't anything, and\ndefinitely not a struct.\n\n```compile_fail\nfn main () {\n    let foo = 1;\n    let x = foo { x: 1, y: 2 };\n}\n```\n\nIn this case, `foo` is defined, but is not a struct, so Rust can't use it as\none.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/feature-gate-async-await.rs","byte_start":583,"byte_end":588,"line_start":17,"line_end":17,"column_start":13,"column_end":18,"is_primary":true,"text":[{"text":"    let _ = async {}; //~ ERROR async blocks are unstable","highlight_start":13,"highlight_end":18}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0422]: cannot find struct, variant or union type `async` in this scope\n  --> /checkout/src/test/ui/feature-gate-async-await.rs:17:13\n   |\nLL |     let _ = async {}; //~ ERROR async blocks are unstable\n   |             ^^^^^ not found in this scope\n\n"}
[00:47:46] {"message":"cannot find value `async` in this scope","code":{"code":"E0425","explanation":"\nAn unresolved name was used.\n\nErroneous code examples:\n\n```compile_fail,E0425\nsomething_that_doesnt_exist::foo;\n// error: unresolved name `something_that_doesnt_exist::foo`\n\n// or:\n\ntrait Foo {\n    fn bar() {\n        Self; // error: unresolved name `Self`\n    }\n}\n\n// or:\n\nlet x = unknown_variable;  // error: unresolved name `unknown_variable`\n```\n\nPlease verify that the name wasn't misspelled and ensure that the\nidentifier being referred to is valid for the given situation. Example:\n\n```\nenum something_that_does_exist {\n    Foo,\n}\n```\n\nOr:\n\n```\nmod something_that_does_exist {\n    pub static foo : i32 = 0i32;\n}\n\nsomething_that_does_exist::foo; // ok!\n```\n\nOr:\n\n```\nlet unknown_variable = 12u32;\nlet x = unknown_variable; // ok!\n```\n\nIf the item is not defined in the current module, it must be imported using a\n`use` statement, like so:\n\n```\n# mod foo { pub fn bar() {} }\n# fn main() {\nuse foo::bar;\nbar();\n# }\n```\n\nIf the item you are importing is not defined in some super-module of the\ncurrent module, then it must also be declared as public (e.g., `pub fn`).\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/feature-gate-async-await.rs","byte_start":641,"byte_end":646,"line_start":18,"line_end":18,"column_start":13,"column_end":18,"is_primary":true,"text":[{"text":"    let _ = async || {}; //~ ERROR async closures are unstable","highlight_start":13,"highlight_end":18}],"label":"not found in this scope","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0425]: cannot find value `async` in this scope\n  --> /checkout/src/test/ui/feature-gate-async-await.rs:18:13\n   |\nLL |     let _ = async || {}; //~ ERROR async closures are unstable\n   |             ^^^^^ not found in this scope\n\n"}
[00:47:46] {"message":"async fn is unstable (see issue #50547)","code":{"code":"E0658","explanation":"\nAn unstable feature was used.\n\nErroneous code example:\n\n```compile_fail,E658\n#[repr(u128)] // error: use of unstable library feature 'repr128'\nenum Foo {\n    Bar(u64),\n}\n```\n\nIf you're using a stable or a beta version of rustc, you won't be able to use\nany unstable features. In order to do so, please switch to a nightly version of\nrustc (by using rustup).\n\nIf you're using a nightly version of rustc, just add the corresponding feature\nto be able to use it:\n\n```\n#![feature(repr128)]\n\n#[repr(u128)] // ok!\nenum Foo {\n    Bar(u64),\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/feature-gate-async-await.rs","byte_start":509,"byte_end":526,"line_start":14,"line_end":14,"column_start":1,"column_end":18,"is_primary":true,"text":[{"text":"async fn foo() {} //~ ERROR async fn is unstable","highlight_start":1,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(async_await)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0658]: async fn is unstable (see issue #50547)\n  --> /checkout/src/test/ui/feature-gate-async-await.rs:14:1\n   |\nLL | async fn foo() {} //~ ERROR async fn is unstable\n   | ^^^^^^^^^^^^^^^^^\n   |\n   = help: add #![feature(async_await)] to the crate attributes to enable\n\n"}
[00:47:46] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[00:47:46] {"message":"Some errors occurred: E0422, E0425, E0658.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0422, E0425, E0658.\n"}
[00:47:46] {"message":"For more information about an error, try `rustc --explain E0422`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0422`.\n"}
[00:47:46] ------------------------------------------
[00:47:46] 
[00:47:46] thread '[ui] ui/feature-gate-async-await.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3154:9
[00:47:46] 
[00:47:46] 
[00:47:46] ---- [ui] ui/lint-anon-param-edition.rs stdout ----
[00:47:46] diff of stderr:
[00:47:46] 
[00:47:46] - warning: anonymous parameters are deprecated and will be removed in the next edition.
[00:47:46] -    |
[00:47:46] -    |
[00:47:46] - LL |     fn foo(u8);
[00:47:46] -    |            ^^ help: Try naming the parameter or explicitly ignoring it: `_: u8`
[00:47:46] -    |
[00:47:46] -    = note: #[warn(anonymous_parameters)] on by default
[00:47:46] -    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
[00:47:46] -    = note: for more information, see issue #4168n is experimental (see issue #23416)
[00:47:46] +   --> $DIR/no-args-non-move-async-closure.rs:16:20
[00:47:46] +    |
[00:47:46] + LL |     let _ = async |x: u8| {};
[00:47:46] +    |
[00:47:46] +    |
[00:47:46] +    = help: add #![feature(type_ascription)] to the crate attributes to enable
[00:47:46] - For more information about this error, try `rustc --explain E0708`.
[00:47:46] + error: aborting due to 3 previous errors
[00:47:46] + 
[00:47:46] + Some errors occurred: E0425, E0658.
[00:47:46] + Some errors occurred: E0425, E0658.
[00:47:46] + For more information about an error, try `rustc --explain E0425`.
[00:47:46] 12 
[00:47:46] 
[00:47:46] 
[00:47:46] The actual stderr differed from the expected stderr.
[00:47:46] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/no-args-non-move-async-closure/no-args-non-move-async-closure.stderr
[00:47:46] To update references, rerun the tests and pass the `--bless` flag
[00:47:46] To only update this specific test, also pass `--test-args no-args-non-move-async-closure.rs`
[00:47:46] error: 1 errors occurred comparing output.
[00:47:46] status: exit code: 101
[00:47:46] status: exit code: 101
[00:47:46] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/no-args-non-move-async-closure.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/no-args-non-move-async-closure/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--edition=2015" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/no-args-non-move-async-closure/auxiliary" "-A" "unused"
[00:47:46] ------------------------------------------
[00:47:46] 
[00:47:46] ------------------------------------------
[00:47:46] stderr:
[00:47:46] stderr:
[00:47:46] ------------------------------------------
[00:47:46] {"message":"cannot find value `async` in this scope","code":{"code":"E0425","explanation":"\nAn unresolved name was used.\n\nErroneous code examples:\n\n```compile_fail,E0425\nsomething_that_doesnt_exist::foo;\n// error: unresolved name `something_that_doesnt_exist::foo`\n\n// or:\n\ntrait Foo {\n    fn bar() {\n        Self; // error: unresolved name `Self`\n    }\n}\n\n// or:\n\nlet x = unknown_variable;  // error: unresolved name `unknown_variable`\n```\n\nPlease verify that the name wasn't misspelled and ensure that the\nidentifier being referred to is valid for the given situation. Example:\n\n```\nenum something_that_does_exist {\n    Foo,\n}\n```\n\nOr:\n\n```\nmod something_that_does_exist {\n    pub static foo : i32 = 0i32;\n}\n\nsomething_that_does_exist::foo; // ok!\n```\n\nOr:\n\n```\nlet unknown_variable = 12u32;\nlet x = unknown_variable; // ok!\n```\n\nIf the item is not defined in the current module, it must be imported using a\n`use` statement, like so:\n\n```\n# mod foo { pub fn bar() {} }\n# fn main() {\nuse foo::bar;\nbar();\n# }\n```\n\nIf the item you are importing is not defined in some super-module of the\ncurrent module, then it must also be declared as public (e.g., `pub fn`).\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/no-args-non-move-async-closure.rs"edition-keywords-2018-2015-parsing.rs
[00:47:46]     [ui] ui/edition-keywords-2018-2018-parsing.rs
[00:47:46]     [ui] ui/feature-gate-async-await.rs
[00:47:46]     [ui] ui/lint-anon-param-edition.rs
[00:47:46]     [ui] ui/no-args-non-move-async-closure.rs
[00:47:46]     [ui] ui/no-args-non-move-async-closure.rs
[00:47:46]     [ui] ui/rust-2018/extern-crate-idiomatic-in-2018.rs
[00:47:46]     [ui] ui/suggestions/removing-extern-crate.rs
[00:47:46] 
[00:47:46] test result: FAILED. 1508 passed; 9 failed; 5 ignored; 0 measured; 0 filtered out
[00:47:46] 
[00:47:46] 
[00:47:46] 
[00:47:46] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-3.9/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "3.9.1\n" "--system-llvm" "--cc" "" "--3321272 .
2430452 ./obj/build
1826584 ./obj/build/x86_64-unknown-linux-gnu
729204 ./src
549324 ./obj/build/x86_64-unknown-linux-gnu/stage0
---
143820 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu
143816 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release
138748 ./obj/build/bootstrap/debug/incremental
124176 ./obj/build/bootstrap/debug/incremental/bootstrap-1r3bppl29tbrj
124172 ./obj/build/bootstrap/debug/incremental/bootstrap-1r3bppl29tbrj/s-f2c2ciz8yh-9afue1-1ndug1mpblsoe
107672 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release
103608 ./obj/build/x86_64-unknown-linux-gnu/stage0/lib/rus

I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact @TimNN. (Feature Requests)

Copy link
Contributor

@nikomatsakis nikomatsakis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be better only to supply the --edition argument if edition:foo appears in the test. Otherwise, looks great!

Also, I am not sure whether -Zunstable-options are needed or not =)

ed @ "2015" | "2018" => Some(ed.to_owned()),
_ => None,
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should just permit you to write anything here?


fn parse_edition(&self, line: &str) -> Option<String> {
match line {
ed @ "2015" | "2018" => Some(ed.to_owned()),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also, maybe line.trim()? I don't think we'll have edition names w/ internal whitespace =)

@@ -571,6 +571,10 @@ impl<'test> TestCx<'test> {

rustc.args(self.split_maybe_args(&self.config.target_rustcflags));
rustc.args(&self.props.compile_flags);
rustc.arg(&format!(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would prefer more like

if let Some(e) = self.props.editions {
  rustc.arg(&format!("--edition={}", e))
}

this way we can test the compiler's default behavior

@@ -1370,7 +1374,11 @@ impl<'test> TestCx<'test> {
.arg("-o")
.arg(out_dir)
.arg(&self.testpaths.file)
.args(&self.props.compile_flags);
.args(&self.props.compile_flags)
.arg(&format!(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(same here)

@@ -1765,6 +1773,10 @@ impl<'test> TestCx<'test> {
}

rustc.args(&self.props.compile_flags);
rustc.arg(&format!(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...and here. Maybe we want some helper method to make that nicer.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just made this behave as if the user passed compile-flags: --edition=2018 instead.

@mark-i-m mark-i-m force-pushed the edition2018compiletest branch from eb4aba6 to 75d33cf Compare June 27, 2018 00:32
@mark-i-m mark-i-m changed the title [WIP] Add a compiletest header for edition Add a compiletest header for edition Jun 27, 2018
@mark-i-m
Copy link
Member Author

mark-i-m commented Jun 27, 2018

@nikomatsakis Ok so...

  • I think I addressed all your comments. I ended up changing the implementation to be as if the compile-flags: --edition=2018 option was passed. I think this is a lot cleaner.
  • It turns out that -Zunstable-options was not needed for any of those tests, so I removed it.

EDIT: I also squashed everything since the commit history was getting messy.

@@ -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));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, simple. seems good enough for now.

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jun 27, 2018

📌 Commit 75d33cf has been approved by nikomatsakis

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 27, 2018
kennytm added a commit to kennytm/rust that referenced this pull request Jun 27, 2018
…nikomatsakis

Add a compiletest header for edition

r? @nikomatsakis

Are the `-Zunstable-options` options needed in these tests? It looks like they aren't. If not, I can remove them.
bors added a commit that referenced this pull request Jun 27, 2018
Rollup of 7 pull requests

Successful merges:

 - #49987 (Add str::split_ascii_whitespace.)
 - #50342 (Document round-off error in `.mod_euc()`-method, see issue #50179)
 - #51658 (Only do sanity check with debug assertions on)
 - #51799 (Lower case some feature gate error messages)
 - #51800 (Add a compiletest header for edition)
 - #51824 (Fix the error reference for LocalKey::try_with)
 - #51842 (Document that Layout::from_size_align does not allow align=0)

Failed merges:

r? @ghost
@bors bors merged commit 75d33cf into rust-lang:master Jun 28, 2018
@mark-i-m mark-i-m deleted the edition2018compiletest branch November 14, 2018 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants