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

Stabilize unit tests with non-() return type #51298

Merged
merged 7 commits into from
Jun 9, 2018

Conversation

Dylan-DPC-zz
Copy link

References #48854

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @petrochenkov (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 2, 2018
@Dylan-DPC-zz
Copy link
Author

r? @nikomatsakis

@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:05:51]    Compiling rustc_data_structures v0.0.0 (file:///checkout/src/librustc_data_structures)
[00:05:54]    Compiling arena v0.0.0 (file:///checkout/src/libarena)
[00:05:54]    Compiling syntax_pos v0.0.0 (file:///checkout/src/libsyntax_pos)
[00:05:58]    Compiling rustc_errors v0.0.0 (file:///checkout/src/librustc_errors)
[00:06:06] error: no rules expected the token `accepted`
[00:06:06]    --> libsyntax/feature_gate.rs:477:6
[00:06:06]     |
[00:06:06] 477 |     (accepted, termination_trait_test, "1.28.0", Some(48854), Some(Edition::Edition2018)),
[00:06:06] 
[00:06:06] error: aborting due to previous error
[00:06:06] 
[00:06:06] error: Could not compile `syntax`.
[00:06:06] error: Could not compile `syntax`.
[00:06:06] 
[00:06:06] Caused by:
[00:06:06]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name syntax libsyntax/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -C metadata=4c5434c80172b18c -C extra-filename=-4c5434c80172b18c --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps --extern scoped_tls=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libscoped_tls-b76c070114255d98.rlib --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-41b116eaee1e5535.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-5d0a8a65bb9fe29f.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-5d0a8a65bb9fe29f.rlib --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-5073f1296cd24b67.rlib --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-0404335fb4ae3dc1.so --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-58741ed9de9aae4f.so --extern bitflags=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-99b4534960f92449.rlib --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-05d59ed98ebd8949.so` (exit code: 101)
[00:06:06] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:06:06] expected success, got: exit code: 101
[00:06:06] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1091:9
[00:06:06] travis_fold:end:stage0-rustc

[00:06:06] travis_time:end:stage0-rustc:start=1527941275944866405,finish=1527941337502711783,duration=61557845378


[00:06:06] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:06:06] Build completed unsuccessfully in 0:01:13
[00:06:06] Makefile:28: recipe for target 'all' failed
[00:06:06] make: *** [all] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:077fbed8
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

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)

@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:06:03]    Compiling rustc_data_structures v0.0.0 (file:///checkout/src/librustc_data_structures)
[00:06:06]    Compiling arena v0.0.0 (file:///checkout/src/libarena)
[00:06:06]    Compiling syntax_pos v0.0.0 (file:///checkout/src/libsyntax_pos)
[00:06:10]    Compiling rustc_errors v0.0.0 (file:///checkout/src/librustc_errors)
/libbitflags-99b4534960f92449.rlib --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-5d0a8a65bb9fe29f.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-5d0a8a65bb9fe29f.rlib --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-0404335fb4ae3dc1.so --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-5073f1296cd24b67.rlib --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-05d59ed98ebd8949.so --extern scoped_tls=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libscoped_tls-b76c070114255d98.rlib --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-58741ed9de9aae4f.so` (exit code: 101)
[00:06:18] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:06:18] expected success, got: exit code: 101
[00:06:18] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1091:9
[00:06:18] travis_fol2292740 .
1404348 ./obj
1404316 ./obj/build
803072 ./obj/build/x86_64-unknown-linux-gnu
---
147048 ./.git/modules
147044 ./.git/modules/src
137732 ./obj/build/bootstrap/debug/incremental
123180 ./obj/build/bootstrap/debug/incremental/bootstrap-1r3bppl29tbrj
123176 ./obj/build/bootstrap/debug/incremental/bootstrap-1r3bppl29tbrj/s-f1lz7zhofl-pihry7-2rxy29zuufd4c
89796 ./src/llvm/test/CodeGen
81804 ./obj/build/x86_64-unknown-linux-gnu/stage0-rustc
72256 ./.git/modules/src/tools
70500 ./obj/build/x86_64-unknown-linux-gnu/native

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)

@Mark-Simulacrum Mark-Simulacrum added the relnotes Marks issues that should be documented in the release notes of the next release. label Jun 2, 2018
@Dylan-DPC-zz
Copy link
Author

Dylan-DPC-zz commented Jun 2, 2018

@nikomatsakis

error: no rules expected the token Some
[00:06:18] --> libsyntax/feature_gate.rs:611:63
[00:06:18] |
[00:06:18] 611 | (accepted, termination_trait_test, "1.27.0", Some(48854), Some(Edition::Edition2018)),
[00:06:18] | ^^^^
[00:06:18]

should it be None instead? feels odd 😛

@bors
Copy link
Contributor

bors commented Jun 3, 2018

☔ The latest upstream changes (presumably #50338) made this pull request unmergeable. Please resolve the merge conflicts.

@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:05:54]    Compiling rustc_data_structures v0.0.0 (file:///checkout/src/librustc_data_structures)
[00:05:57]    Compiling arena v0.0.0 (file:///checkout/src/libarena)
[00:05:57]    Compiling syntax_pos v0.0.0 (file:///checkout/src/libsyntax_pos)
[00:06:01]    Compiling rustc_errors v0.0.0 (file:///checkout/src/librustc_errors)
[00:06:09] error: no rules expected the token `Some`
[00:06:09]    --> libsyntax/feature_gate.rs:613:63
[00:06:09]     |
[00:06:09] 613 |     (accepted, termination_trait_test, "1.27.0", Some(48854), Some(Edition::Edition2018)),
[00:06:09] 
[00:06:09] error: aborting due to previous error
[00:06:09] 
[00:06:09] error: Could not compile `syntax`.
[00:06:09] error: Could not compile `syntax`.
[00:06:09] 
[00:06:09] Caused by:
[00:06:09]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name syntax libsyntax/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -C metadata=4c5434c80172b18c -C extra-filename=-4c5434c80172b18c --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps --extern bitflags=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-99b4534960f92449.rlib --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-58741ed9de9aae4f.so --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-05d59ed98ebd8949.so --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-0404335fb4ae3dc1.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-5d0a8a65bb9fe29f.so --extern serialize=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-5d0a8a65bb9fe29f.rlib --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-41b116eaee1e5535.so --extern scoped_tls=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libscoped_tls-b76c070114255d98.rlib --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-5073f1296cd24b67.rlib` (exit code: 101)
[00:06:09] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" " jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:06:09] expected success, got: exit code: 101
[00:06:09] thread 'main' panicked at 'cargo must succeed', bootstrap/compile.rs:1091:9
[00:06:09] travis_fold:end:stage0-rustc

[00:06:09] travis_time:end:stage0-rustc:start=1528090583616150206,finish=1528090645655049394,duration=62038899188


[00:06:09] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:06:09] Build completed unsuccessfully in 0:01:14
[00:06:09] make: *** [all] Error 1
[00:06:09] Makefile:28: recipe for target 'all' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:1b9cc874
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

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)

@@ -612,6 +609,8 @@ declare_features! (
(accepted, fn_must_use, "1.27.0", Some(43302), None),
// Allows use of the :lifetime macro fragment specifier
(accepted, macro_lifetime_matcher, "1.27.0", Some(34303), None),
// Termination trait in tests (RFC 1937)
(accepted, termination_trait_test, "1.27.0", Some(48854), Some(Edition::Edition2018)),
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not really clear on why the Edition::Edition2018 flag was set here, actually. I would imagine that this feature would just be generally available on any edition. Can we just change to None?

Copy link
Contributor

Choose a reason for hiding this comment

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

@Dylan-DPC

should it be None instead? feels odd 😛

Yeah, I think it should. I don't think that flag actually has meaning for accepted feature gates.

@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:06:36]    Compiling rustc_errors v0.0.0 (file:///checkout/src/librustc_errors)
[00:06:50] error: unreachable pattern
[00:06:50]    --> libsyntax/test.rs:361:21
[00:06:50]     |
[00:06:50] 361 |                     (true, _) => No(BadTestSignature::WrongTypeSignature),
[00:06:50]     |
[00:06:50]     = note: `-D unreachable-patterns` implied by `-D warnings`
[00:06:50] 
[00:06:50] error: aborting due to previous error
[00:06:50] error: aborting due to previous error
[00:06:50] 
[00:06:51] error: Could not compile `syntax`.
[00:06:51] 
[00:06:51] Caused by:
[00:06:51]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustc --crate-name syntax libsyntax/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -C metadata=4c5434c80172b18c -C extra-filename=-4c5434c80172b18c --out-dir /checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/release/deps --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-58741ed9de9aae4f.so --extern scoped_tls=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libscoped_tls-b76c070114255d98.rlib --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-5073f1296cd24b67.rlib --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-41b116eaee1e5535.so --extern bitflags=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-99b4534960f92449.rlib --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-ary/Logs/DiagnosticReports/: No such file or directory
travis_fold:end:after_failure.2
travis_fold:start:after_failure.3
travis_time:start:0d6266f7
$ find $HOME/Library/Logs/DiagnosticReports -type f -name '*.crash' -not -name '*.stage2-*.crash' -not -name 'com.apple.CoreSimulator.CoreSimulatorService-*.crash' -exec printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" {} \; -exec head -750 {} \; -exec echo travis_fold":"end:crashlog \; || true

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)

@rust-highfive
Copy link
Collaborator

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.

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)

@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:43:06] ....................................................................................................
[00:43:12] ....................................................................................................
[00:43:17] ....................................................................................................
[00:43:22] i..............................................................................i....................
[00:43:27] .........................................................................................F.F........
[00:43:39] ....................................................................................................
[00:43:39] ....................................................................................................
[00:43:44] ............i.................iiiiiiiii...................................................
[00:43:44] 
[00:43:44] ---- [ui] ui/rfc-1937-termination-trait/termination-trait-in-test-should-panic.rs stdout ----
[00:43:44] diff of stderr:
[00:43:44] 
[00:43:44] 
[00:43:44] 1 error: functions using `#[should_panic]` must return `()`
[00:43:44] -   --> $DIR/termination-trait-in-test-should-panic.rs:22:1
[00:43:44] +   --> $DIR/termination-trait-in-test-should-panic.rs:21:1
[00:43:44] 3    |
[00:43:44] 4 LL | / fn not_a_num() -> Result<(), ParseIntError> {
[00:43:44] 5 LL | |     //~^ ERROR functions using `#[should_panic]` must retrait/termination-trait-test-wrong-type.rs stdout ----
[00:43:44] 
[00:43:44] 
[00:43:44] 1 error[E0277]: `main` has invalid return type `std::result::Result<f32, std::num::ParseIntError>`
[00:43:44] -   --> $DIR/termination-trait-test-wrong-type.rs:18:1
[00:43:44] +   --> $DIR/termination-trait-test-wrong-type.rs:16:1
[00:43:44] 3    |
[00:43:44] 4 LL | / fn can_parse_zero_as_f32() -> Result<f32, ParseIntError> { //~ ERROR
[00:43:44] 5 LL | |     "0".parse()
[00:43:44] 
[00:43:44] The actual stderr differed from the expected stderr.
[00:43:44] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type/termination-trait-test-wrong-type.stderr
[00:43:44] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type/termination-trait-test-wrong-type.stderr
[00:43:44] To update references, rerun the tests and pass the `--bless` flag
[00:43:44] To only update this specific test, also pass `--test-args rfc-1937-termination-trait/termination-trait-test-wrong-type.rs`
[00:43:44] error: 1 errors occurred comparing output.
[00:43:44] status: exit code: 101
[00:43:44] status: exit code: 101
[00:43:44] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.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/rfc-1937-termination-trait/termination-trait-test-wrong-type/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--test" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type/auxiliary" "-A" "unused"
[00:43:44] ------------------------------------------
[00:43:44] 
[00:43:44] ------------------------------------------
[00:43:44] stderr:
[00:43:44] stderr:
[00:43:44] ------------------------------------------
[00:43:44] {"message":"`main` has invalid return type `std::result::Result<f32, std::num::ParseIntError>`","code":{"code":"E0277","explanation":"\nYou tried to use a type which doesn't implement some trait in a place which\nexpected that trait. Erroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n    fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n    foo.bar();\n}\n\nfn main() {\n    // we now call the method with the i32 type, which doesn't implement\n    // the Foo trait\n    some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n    fn bar(&self);\n}\n\nfn some_func<T: Foo>(foo: T) {\n    foo.bar(); // we can now use this method since i32 implements the\n               // Foo trait\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n    fn bar(&self) {}\n}\n\nfn main() {\n    some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n    println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n                           //        implemented for the type `T`\n}\n\nfn main() {\n    // We now call the method with the i32 type,\n    // which *does* implement the Debug trait.\n    some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function: Although\nwe only call it with a parameter that does implement `Debug`, the compiler\nstill rejects the function: It must work with all possible input types. In\norder to make this example compile, we need to restrict the generic type we're\naccepting:\n\n```\nuse std::fmt;\n\n// Restrict the input type to types that implement Debug.\nfn some_func<T: fmt::Debug>(foo: T) {\n    println!(\"{:?}\", foo);\n}\n\nfn main() {\n    // Calling the method is still fine, as i32 implements Debug.\n    some_func(5i32);\n\n    // This would fail to compile now:\n    // struct WithoutDebug;\n    // some_func(WithoutDebug);\n}\n```\n\nRust only looks at the signature of the called function, as such it must\nalready specify all requirements that will be used for every type parameter.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/rfc-1937-termination-trait/termination-trait-test-wrong-type.rs","byte_start":531,"byte_end":617,"line_start":16,"line_end":18,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn can_parse_zero_as_f32() -> Result<f32, ParseIntError> { //~ ERROR","highlight_start":1,"highlight_end":69},{"text":"    \"0\".parse()","highlight_start":1,"highlight_end":16},{"text":"}","highlight_start":1,"highlight_end":2}],"label":"`main` can only return types that implement `std::process::Termination`","suggested_replacement":

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:00366298
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)

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)

@Dylan-DPC-zz
Copy link
Author

@bors r=nikomatsakis

@bors
Copy link
Contributor

bors commented Jun 6, 2018

@Dylan-DPC: 🔑 Insufficient privileges: Not in reviewers

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jun 6, 2018

📌 Commit 8ecbd35 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 6, 2018
@bors
Copy link
Contributor

bors commented Jun 7, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 7, 2018
@rust-highfive
Copy link
Collaborator

The job dist-x86_64-netbsd 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.
$ travis_retry gem update --system
ERROR:  While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
    timed out (https://api.rubygems.org/specs.4.8.gz)
The command "gem update --system" failed. Retrying, 2 of 3.
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    IOError: HTTP session not yet started (https://api.rubygems.org/quick/Marshal.4.8/rubygems-update-2.7.7.gemspec.rz)
The command "gem update --system" failed. Retrying, 3 of 3.
ERROR:  While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
    timed out (https://api.rubygems.org/specs.4.8.gz)
The command "gem update --system" failed 3 times.
The command "gem update --system" failed 3 times.
travis_time:end:0f039645:start=1528346150873026769,finish=1528346467837961401,duration=316964934632

The command "travis_retry gem update --system" failed and exited with 1 during .
Your build has been stopped.

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)

1 similar comment
@rust-highfive
Copy link
Collaborator

The job dist-x86_64-netbsd 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.
$ travis_retry gem update --system
ERROR:  While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
    timed out (https://api.rubygems.org/specs.4.8.gz)
The command "gem update --system" failed. Retrying, 2 of 3.
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    IOError: HTTP session not yet started (https://api.rubygems.org/quick/Marshal.4.8/rubygems-update-2.7.7.gemspec.rz)
The command "gem update --system" failed. Retrying, 3 of 3.
ERROR:  While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
    timed out (https://api.rubygems.org/specs.4.8.gz)
The command "gem update --system" failed 3 times.
The command "gem update --system" failed 3 times.
travis_time:end:0f039645:start=1528346150873026769,finish=1528346467837961401,duration=316964934632

The command "travis_retry gem update --system" failed and exited with 1 during .
Your build has been stopped.

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)

@kennytm
Copy link
Member

kennytm commented Jun 7, 2018

@bors retry #40474

@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 7, 2018
@bors
Copy link
Contributor

bors commented Jun 8, 2018

⌛ Testing commit 8ecbd35 with merge 2396a06e5a6b723307f7f7c750b7636566369b6a...

@bors
Copy link
Contributor

bors commented Jun 8, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jun 8, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-distcheck 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.
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7ff11f89d110>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/awscli/
  InsecurePlatformWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading https://files.pythonhosted.org/packages/8e/af/cbd346c1800c58ca8552b346cf911a1e5e84f201b4cb1c7fd8f6e303e94a/awscli-1.15.34-py2.py3-none-any.whl (1.3MB)

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)

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-distcheck 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.
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x7ff11f89d110>, 'Connection to pypi.org timed out. (connect timeout=15)')': /simple/awscli/
  InsecurePlatformWarning
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Downloading https://files.pythonhosted.org/packages/8e/af/cbd346c1800c58ca8552b346cf911a1e5e84f201b4cb1c7fd8f6e303e94a/awscli-1.15.34-py2.py3-none-any.whl (1.3MB)
---
[02:48:27] [RUSTC-TIMING] regex test:false 19.421
[02:48:27]    Compiling minifier v0.0.11
[02:48:30] [RUSTC-TIMING] minifier test:false 2.653
[02:48:30]    Compiling rustdoc v0.0.0 (file:///checkout/obj/build/tmp/distcheck/src/librustdoc)
The job exceeded the maximum time limit for jobs, and has been terminated.

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)

@kennytm
Copy link
Member

kennytm commented Jun 8, 2018

@bors retry 3 hour timeout.

@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 8, 2018
Mark-Simulacrum added a commit to Mark-Simulacrum/rust that referenced this pull request Jun 8, 2018
…t, r=nikomatsakis

Stabilize unit tests with non-`()` return type

References rust-lang#48854
@bors
Copy link
Contributor

bors commented Jun 8, 2018

⌛ Testing commit 8ecbd35 with merge 52bb230d937274b84074266b71438b72b46bffbb...

@Mark-Simulacrum
Copy link
Member

@bors retry -- rolled up

bors added a commit that referenced this pull request Jun 8, 2018
Rollup of 13 pull requests

Successful merges:

 - #50143 (Add deprecation lint for duplicated `macro_export`s)
 - #51099 (Fix Issue 38777)
 - #51276 (Dedup auto traits in trait objects.)
 - #51298 (Stabilize unit tests with non-`()` return type)
 - #51360 (Suggest parentheses when a struct literal needs them)
 - #51391 (Use spans pointing at the inside of a rustdoc attribute)
 - #51394 (Use scope tree depths to speed up `nearest_common_ancestor`.)
 - #51396 (Make the size of Option<NonZero*> a documented guarantee.)
 - #51401 (Warn on `repr` without hints)
 - #51412 (Avoid useless Vec clones in pending_obligations().)
 - #51427 (compiletest: autoremove duplicate .nll.* files (#51204))
 - #51436 (Do not require stage 2 compiler for rustdoc)
 - #51437 (rustbuild: generate full list of dependencies for metadata)

Failed merges:
@rust-highfive
Copy link
Collaborator

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.
Cloning into 'rust-lang/rust'...
travis_time:end:16c35c04:start=1528500158960864053,finish=1528500169881549033,duration=10920684980
$ cd rust-lang/rust
$ git checkout -qf 52bb230d937274b84074266b71438b72b46bffbb
fatal: reference is not a tree: 52bb230d937274b84074266b71438b72b46bffbb
The command "git checkout -qf 52bb230d937274b84074266b71438b72b46bffbb" failed and exited with 128 during .
Your build has been stopped.

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)

@bors bors merged commit 8ecbd35 into rust-lang:master Jun 9, 2018
@Dylan-DPC-zz Dylan-DPC-zz deleted the stabilise/termination-test branch December 3, 2018 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. 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.

8 participants