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 dyn to display of dynamic (trait) types #51104

Merged
merged 1 commit into from
Jun 26, 2018
Merged

Conversation

zackmdavis
Copy link
Member

@zackmdavis zackmdavis commented May 27, 2018

I'm not sure we want the dyn in the E0277 "trait bound [...] is not satisfied" messages ("bound" sounds like a different thing in contrast to the names of specific trait-object types like Box<dyn Trait>), but I'm finding the code I would need to change that hard to follow—the display object seems to be a Predicate::Trait variant, whose Display implementation calls .print on its PolyTraitPredicate member, which is a type alias for ty::Binder<TraitPredicate<'tcx>>, whose Display implementation ... &c.— so maybe it's time to pull-request this and see what reviewers think.

Resolves #49277 (?).

r? @nikomatsakis

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 27, 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:04:42] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:04:42] tidy error: /checkout/src/test/ui/unsized-enum2.rs:48: line longer than 100 chars
[00:04:44] some tidy checks failed
[00:04:44] 
[00:04:44] 
[00:04:44] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:04:44] 
[00:04:44] 
[00:04:44] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:04:44] Build completed unsuccessfully in 0:01:51
[00:04:44] Build completed unsuccessfully in 0:01:51
[00:04:44] make: *** [tidy] Error 1
[00:04:44] Makefile:79: recipe for target 'tidy' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:16a6e914
$ 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:49:33] .............................................................i......................................
[00:49:38] ....................................................................................................
[00:49:44] ....................................................................................................
[00:49:51] ..........................................................................................i.........
[00:49:54] ........iiiiiiiii...................................................
[00:49:54] 
[00:49:54] travis_fold:start:test_ui_nll
travis_time:start:test_ui_nll
Check compiletest suite=ui mode=ui compare_mode=nll (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
[00:50:46] .............................................................i......................................
[00:50:50] ....................................................................................................
[00:50:56] ....................................................................................................
[00:51:02] ..........................................................................................i.........
[00:51:05] ........iiiiiiiii...................................................
[00:51:05] 
[00:51:05]  finished in 71.396
[00:51:05] travis_fold:end:test_ui_nll

---
[00:53:26] ....................................................................................................
[00:53:42] ....................................................................................................
[00:53:56] ....................................................................................................
[00:54:06] ....................................................................................................
[00:54:18] ..F.................................................................................................
[00:54:52] .......................................................i............................................
[00:55:06] ........................................................................................i...........
[00:55:20] ...........................................................................i........................
[00:55:31] .........................................................test [run-pass] run-pass/issue-29227.rs has been running for over 60 seconds

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:51:25] ..............................................................i.....................................
[00:51:29] ....................................................................................................
[00:51:35] ....................................................................................................
[00:51:42] ...........................................................................................i........
[00:51:44] .........iiiiiiiii...................................................
[00:51:44] 
[00:51:44] travis_fold:start:test_ui_nll
travis_time:start:test_ui_nll
Check compiletest suite=ui mode=ui compare_mode=nll (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
---
[00:52:34] ..............................................................i.....................................
[00:52:38] ....................................................................................................
[00:52:44] ....................................................................................................
[00:52:50] ...........................................................................................i........
[00:52:52] .........iiiiiiiii...................................................
[00:52:52] 
[00:52:52]  finished in 68.036
[00:52:52] travis_fold:end:test_ui_nll

---
Check compiletest suite=compile-fail mode=compile-fail (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:02:05] 
[01:02:05] running 2420 tests
[01:02:09] ....................................................................................................
[01:02:14] ................................F...................................................................
[01:02:23] ....................................................................................................
[01:02:23] ....................................................................................................
[01:02:30] .................................................................................F....i.............
[01:02:35] ...............................................ii.iiiF...................F.FF.......................
[01:02:40] ..............................................................................i..F..................
[01:02:45] .......................i............................................................................
[01:02:49] ....................................F.........................................................i.....
[01:02:53] ..........................................F............F.................................F..........
[01:02:59] .F..........................................F.................F.....................................
[01:03:05] ...............................................................................F....................
[01:03:11] .......................................................................F............F...............
[01:03:16] ........................................F.......F...............................................FF.F
[01:03:24] ....................................................................................................
[01:03:29] ...i....................................F...........................................................
[01:03:35] ..i..ii...............................................................................F...........F.
[01:03:43] ......F..........................................................F.......................F..........
[01:03:53] ..............................................................................i.....................
[01:03:58] ........................i...........................................................................
[01:03:58] ........................i...........................................................................
[01:04:03] .......................F.....................F....................F..F........F...............F.....
[01:04:13] ....................
[01:04:13] failures:
[01:04:13] 
[01:04:13] ---- [compile-fail] compile-fail/bad-sized.rs stdout ----
[01:04:13] ---- [compile-fail] compile-fail/bad-sized.rs stdout ----
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/bad-sized.rs:14: unexpected error: '14:12: 14:30: the trait bound `dyn Trait: std::marker::Sized` is not satisfied [E0277]'
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/bad-sized.rs:14: unexpected error: '14:33: 14:41: the trait bound `dyn Trait: std::marker::Sized` is not satisfied [E0277]'
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/bad-sized.rs:14: expected error not found: the trait bound `Trait: std::marker::Sized` is not satisfied
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/bad-sized.rs:14: expected error not found: the trait bound `Trait: std::marker::Sized` is not satisfied
[01:04:13] 
[01:04:13] error: 2 unexpected errors found, 2 expected errors not found
[01:04:13] status: exit code: 101
[01:04:13] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/bad-sized.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/compile-fail/bad-sized/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-u:04:13] not found errors (from test file): [
[01:04:13]     Error {
[01:04:13]         line_num: 45,
[01:04:13]         kind: None,
[01:04:13]         msg: "expected type `ToBar`"
[01:04:13]     Error {
[01:04:13]         line_num: 45,
[01:04:13]         kind: Some(
[01:04:13]             Error
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "`ToBar: std::marker::Sized` is not satisfied"
[01:04:13] ]
[01:04:13] 
[01:04:13] thread '[compile-fail] compile-fail/dst-bad-assign.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1283:13
[01:04:13] 
[01:04:13] 
[01:04:13] ---- [compile-fail] compile-fail/fn-trait-formatting.rs stdout ----
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/fn-trait-formatting.rs:16: expected message not found: found type `std::boxed::Box<std::ops::FnOnce(isize)>`
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/fn-trait-formatting.rs:20: expected message not found: found type `std::boxed::Box<std::ops::Fn(isize, isize)>`
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/fn-trait-formatting.rs:24: expected message not found: found type `std::boxed::Box<std::ops::FnMut() -> isize>`
[01:04:13] 
[01:04:13] error: 0 unexpected errors found, 3 expected errors not found
[01:04:13] status: exit code: 101
[01:04:13] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/fn-trait-formatting.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/compile-fail/fn-trait-formatting/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/fn-trait-formatting/auxiliary" "-A" "unused"
[01:04:13] not found errors (from test file): [
[01:04:13]     Error {
[01:04:13]         line_num: 16,
[01:04:13]         kind: None,
[01:04:13]         msg: "found type `std::boxed::Box<std::ops::FnOnce(isize)>`"
[01:04:13]     Error {
[01:04:13]         line_num: 20,
[01:04:13]         kind: None,
[01:04:13]         kind: None,
[01:04:13]         msg: "found type `std::boxed::Box<std::ops::Fn(isize, isize)>`"
[01:04:13]     Error {
[01:04:13]         line_num: 24,
[01:04:13]         kind: None,
[01:04:13]         kind: None,
[01:04:13]         msg: "found type `std::boxed::Box<std::ops::FnMut() -> isize>`"
[01:04:13] ]
[01:04:13] 
[01:04:13] thread '[compile-fail] compile-fail/fn-trait-formatting.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1283:13
[01:04:13] 
[01:04:13] 
[01:04:13] ---- [compile-fail] compile-fail/issue-13033.rs stdout ----
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/issue-13033.rs:18: expected message not found: expected type `fn(&mut Baz, &mut Foo)`
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/issue-13033.rs:18: expected message not found: found type `fn(&mut Baz, &Foo)`
[01:04:13] 
[01:04:13] error: 0 unexpected errors found, 2 expected errors not found
[01:04:13] status: exit code: 101
[01:04:13] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compustc" "/checkout/src/test/compile-fail/issue-18107.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/compile-fail/issue-18107/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/issue-18107/auxiliary" "-A" "unused"
[01:04:13] unexpected errors (from JSON output): [
[01:04:13]     Error {
[01:04:13]         line_num: 14,
[01:04:13]         kind: Some(
[01:04:13]         ),
[01:04:13]         ),
[01:04:13]         msg: "14:5: 14:21: the trait bound `dyn AbstractRenderer + \'static: std::marker::Sized` is not satisfied [E0277]"
[01:04:13] ]
[01:04:13] 
[01:04:13] not found errors (from test file): [
[01:04:13]     Error {
[01:04:13]     Error {
[01:04:13]         line_num: 14,
[01:04:13]         kind: Some(
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "`AbstractRenderer + \'static: std::marker::Sized` is not satisfied"
[01:04:13] ]
[01:04:13] 
[01:04:13] thread '[compile-fail] compile-fail/issue-18107.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1283:13
[01:04:13] 
[01:04:13] 
[01:04:13] ---- [compile-fail] compile-fail/issue-18919.rs stdout ----
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/issue-18919.rs:13: unexpected error: '13:1: 15:2: the trait bound `dyn for<'r> std::ops::Fn(&'r isize) -> isize: std::marker::Sized` is not satisfied [E0277]'
[01:04:13] error: /checkout/srcc/runtest.rs:1283:13
[01:04:13] 
[01:04:13] ---- [compile-fail] compile-fail/issue-20605.rs stdout ----
[01:04:13] 
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/issue-20605.rs:12: unexpected error: '12:17: 12:24: the trait bound `dyn std::iter::Iterator<Item=&mut u8>: std::marker::Sized` is not satisfied [E0277]'
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/issue-20605.rs:12: expected error not found: the trait bound `std::iter::Iterator<Item=&mut u8>: std::marker::Sized` is not satisfied
[01:04:13] 
[01:04:13] error: 1 unexpected errors found, 1 expected errors not found
[01:04:13] status: exit code: 101
[01:04:13] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/issue-20605.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/compile-fail/issue-20605/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/issue-20605/auxiliary" "-A" "unused"
[01:04:13] unexpected errors (from JSON output): [
[01:04:13]     Error {
[01:04:13]         line_num: 12,
[01:04:13]         kind: Some(
[01:04:13]         ),
[01:04:13]         ),
[01:04:13]         msg: "12:17: 12:24: the trait bound `dyn std::iter::Iterator<Item=&mut u8>: std::marker::Sized` is not satisfied [E0277]"
[01:04:13] ]
[01:04:13] 
[01:04:13] not found errors (from test file): [
[01:04:13]     Error {
[01:04:13]     Error {
[01:04:13]     Some(
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "13:1: 13:24: the object type `dyn Foo + \'a` automatically implements the trait `Foo` [E0371]"
[01:04:13] ]
[01:04:13] 
[01:04:13] not found errors (from test file): [
[01:04:13]     Error {
[01:04:13]     Error {
[01:04:13]         line_num: 13,
[01:04:13]         kind: Some(
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "the object type `Foo + \'a` automatically implements the trait `Foo`"
[01:04:13] ]
[01:04:13] 
[01:04:13] thread '[compile-fail] compile-fail/issue-20939.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1283:13
[01:04:13] 
[01:04:13] 
[01:04:13] ---- [compile-fail] compile-fail/issue-23281.rs stdout ----
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/issue-23281.rs:16: unexpected error: '16:5: 16:46: the trait bound `dyn std::ops::Fn() + 'static: std::marker::Sized` is not satisfied [E0277]'
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/issue-23281.rs:16: expected error not found: the trait bound `std::ops::Fn() + 'static: std::marker::Sized` is not satisfied
[01:04:13] 
[01:04:13] error: 1 unexpected errors found, 1 expected errors not found
[01:04:13] status: exit code: 101
[01:04:13] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/issue-23281.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/compile-fail/issue-23281/a" "-Crpath" "-O" "-Zunstable-options" "-Lna13] 
[01:04:13] error: /checkout/src/test/compile-fail/issue-32963.rs:18: expected error not found: the trait bound `Misc: std::marker::Copy` is not satisfied
[01:04:13] 
[01:04:13] error: 1 unexpected errors found, 1 expected errors not found
[01:04:13] status: exit code: 101
[01:04:13] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/issue-32963.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/compile-fail/issue-32963/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/issue-32963/auxiliary" "-A" "unused"
[01:04:13] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[01:04:13] unexpected errors (from JSON output): [
[01:04:13]     Error {
[01:04:13]         line_num: 18,
[01:04:13]         kind: Some(
[01:04:13]         ),
[01:04:13]         ),
[01:04:13]         msg: "18:5: 18:30: the trait bound `dyn Misc: std::marker::Copy` is not satisfied [E0277]"
[01:04:13] ]
[01:04:13] 
[01:04:13] not found errors (from test file): [
[01:04:13]     Error {
[01:04:13]     Error {
[01:04:13]         line_num: 18,
[01:04:13]         kind: Some(
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "the trait bound `Misc: std::marker::Copy` is not satisfied"
[01:04:13] ]
[01:04:13] 
[01:04:13] 
[01:04:13] thread '[compile-fail] compile-fail/issue-32963.rs'ile): [
[01:04:13]     Error {
[01:04:13]         line_num: 16,
[01:04:13]         kind: Some(
[01:04:13]         ),
[01:04:13]         ),
[01:04:13]         msg: "cannot move a value of type Trait + \'static"
[01:04:13] ]
[01:04:13] 
[01:04:13] thread '[compile-fail] compile-fail/issue-41139.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1283:13
[01:04:13] 
[01:04:13] 
[01:04:13] ---- [compile-fail] compile-fail/issue-42312.rs stdout ----
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/issue-42312.rs:18: unexpected error: '18:23: 18:23: the trait bound `dyn std::string::ToString + 'static: std::marker::Sized` is not satisfied [E0277]'
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/issue-42312.rs:18: expected error not found: the trait bound `std::string::ToString + 'static: std::marker::Sized` is not satisfied
[01:04:13] 
[01:04:13] error: 1 unexpected errors found, 1 expected errors not found
[01:04:13] status: exit code: 101
[01:04:13] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/issue-42312.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/compile-fail/issue-42312/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/issue-42312/auxiliary" "-A" "unused"
[01:04:13] unexpected errors (from JSON output): [
[01:04:13]     Error {
[01:04:13]         line_num: 18,
[01:04:13]         kind: Some(
[01:04:13]         ),
[01:04:13]         ),
[01:04:13]         msg: "18:23: 18:23: the trait bound `dyn std::string::ToString + \'static: std::marker::Sized` is not satisfied [E0277]"
[01:04:13] ]
[01:04:13] 
[01:04:13] not found errors (from test file): [
[01:04:13]     Error {
[01:04:13]     Error {
[01:04:13]         line_num: 18,
[01:04:13]         kind: Some(
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "the trait bound `std::string::ToString + \'static: std::marker::Sized` is not satisfied"
[01:04:13] ]
[01:04:13] 
[01:04:13] thread '[compile-fail] compile-fail/issue-42312.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1283:13
[01:04:13] 
[01:04:13] 
[01:04:13] ---- [compile-fail] compile-fail/issue-5153.rs stdout ----
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/issue-5153.rs:20: unexpected error: '20:23: 20:26: no method named `foo` found for type `&dyn Foo` in the current scope [E0599]'
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/issue-5153.rs:20: expected error not found: no method named `foo` found for type `&Foo` in the current scope
[01:04:13] 
[01:04:13] error: 1 unexpected errors found, 1 expected errors not found
[01:04:13] status: exit code: 101
[01:04:13] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/issue-5153.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/compile-fail/issue-5ic: std::marker::Sized` is not satisfied
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/issue-5883.rs:18: expected error not found: `A + 'static: std::marker::Sized` is not satisfied
[01:04:13] 
[01:04:13] error: 2 unexpected errors found, 2 expected errors not found
[01:04:13] status: exit code: 101
[01:04:13] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/issue-5883.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/compile-fail/issue-5883/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/issue-5883/auxiliary" "-A" "unused"
[01:04:13] unexpected errors (from JSON output): [
[01:04:13]     Error {
[01:04:13]         line_num: 17,
[01:04:13]         kind: Some(
[01:04:13]         ),
[01:04:13]         ),
[01:04:13]         msg: "17:15: 17:16: the trait bound `dyn A + \'static: std::marker::Sized` is not satisfied [E0277]"
[01:04:13]     Error {
[01:04:13]         line_num: 18,
[01:04:13]         kind: Some(
[01:04:13]             Error
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "18:8: 18:14: the trait bound `dyn A + \'static: std::marker::Sized` is not satisfied in `Struct` [E0277]"
[01:04:13] ]
[01:04:13] 
[01:04:13] not found errors (from test file): [
[01:04:13]     Error {
[01:04:13]     Error {
[01:04:13]         line_num: 17,
[01:04:13]         kind: Some(
["-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/kindck-send-object1/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/kindck-send-object1/auxiliary" "-A" "unused"
[01:04:13] unexpected errors (from JSON output): [
[01:04:13]     Error {
[01:04:13]         line_num: 20,
[01:04:13]         kind: Some(
[01:04:13]         ),
[01:04:13]         ),
[01:04:13]         msg: "20:5: 20:29: `dyn Dummy + \'a` cannot be shared between threads safely [E0277]"
[01:04:13] ]
[01:04:13] 
[01:04:13] not found errors (from test file): [
[01:04:13]     Error {
[01:04:13]     Error {
[01:04:13]         line_num: 20,
[01:04:13]         kind: Some(
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "`Dummy + \'a` cannot be shared between threads safely [E0277]"
[01:04:13] ]
[01:04:13] 
[01:04:13] thread '[compile-fail] compile-fail/kindck-send-object1.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1283:13
[01:04:13] 
[01:04:13] 
[01:04:13] ---- [compile-fail] compile-fail/kindck-send-object2.rs stdout ----
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/kindck-send-object2.rs:17: unexpected error: '17:5: 17:34: `dyn Dummy + 'static` cannot be shared between threads safely [E0277]'
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/kindck-send-object2.rs:17: expected error not found: `Dummy + 'static` cannot be shared between threads safely [E0277]
[01:04:13] 
[01:04:13] error: 1 unexpected errors found, 1 expected errors not found
[01:04:13] status: exit code: 101
[01:04:13] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/kindck-send-object2.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/compile-fail/kindck-send-object2/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/kindck-send-object2/auxiliary" "-A" "unused"
[01:04:13] unexpected errors (from JSON output): [
[01:04:13]     Error {
[01:04:13]         line_num: 17,
[01:04:13]         kind: Some(
[01:04:13]         ),
[01:04:13]         ),
[01:04:13]         msg: "17:5: 17:34: `dyn Dummy + \'static` cannot be shared between threads safely [E0277]"
[01:04:13] ]
[01:04:13] 
[01:04:13] not found errors (from test file): [
[01:04:13]     Error {
[01:04:13]     Error {
[01:04:13]         line_num: 17,
[01:04:13]         kind: Some(
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "`Dummy + \'static` cannot be shared between threads safely [E0277]"
[01:04:13] ]
[01:04:13] 
[01:04:13] thread '[compile-fail] compile-fail/kindck-send-object2.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1283:13
[01:04:13] 
[01:04:13] 
[01:04:13] ---- [compile-fail] compile-fail/map-types.rs stdout ----
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/map-tterger-atomic.rs:73: expected error not found: expected basic integer type, found `&std::ops::Fn()`
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/non-interger-atomic.rs:78: expected error not found: expected basic integer type, found `&std::ops::Fn()`
[01:04:13] 
[01:04:13] error: 4 unexpected errors found, 4 expected errors not found
[01:04:13] status: exit code: 101
[01:04:13] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/non-interger-atomic.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/compile-fail/non-interger-atomic/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/non-interger-atomic/auxiliary" "-A" "unused"
[01:04:13] unexpected errors (from JSON output): [
[01:04:13]     Error {
[01:04:13]         line_num: 63,
[01:04:13]         kind: Some(
[01:04:13]         ),
[01:04:13]         ),
[01:04:13]         msg: "63:5: 63:31: invalid monomorphization of `atomic_load` intrinsic: expected basic integer type, found `&dyn std::ops::Fn()` [E0511]"
[01:04:13]     Error {
[01:04:13]         line_num: 68,
[01:04:13]         kind: Some(
[01:04:13]             Error
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "68:5: 68:35: invalid monomorphization of `atomic_store` intrinsic: expected basic integer type, found `&dyn std::ops::Fn()` [E0511]"
[01:04:13]     Error {
[01:04:13]         line_num: 73,
[01:04:13]         kind: Some(
[01:04:13]             Error
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "73:5: 73:34: invalid monomorphization of `atomic_xchg` intrinsic: expected basic integer type, found `&dyn std::ops::Fn()` [E0511]"
[01:04:13]     Error {
[01:04:13]         line_num: 78,
[01:04:13]         kind: Some(
[01:04:13]             Error
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "78:5: 78:38: invalid monomorphization of `atomic_cxchg` intrinsic: expected basic integer type, found `&dyn std::ops::Fn()` [E0511]"
[01:04:13] ]
[01:04:13] 
[01:04:13] not found errors (from test file): [
[01:04:13]     Error {
[01:04:13]     Error {
[01:04:13]         line_num: 63,
[01:04:13]         kind: Some(
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "expected basic integer type, found `&std::ops::Fn()`"
[01:04:13]     Error {
[01:04:13]         line_num: 68,
[01:04:13]         kind: Some(
[01:04:13]             Error
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "expected basic integer type, found `&std::ops::Fn()`"
[01:04:13]     Error {
[01:04:13]         line_num: 73,
[01:04:13]         kind: Some(
[01:04:13]             Error
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "expected basic integer type, found `&std::ops::Fn()`"
[01:04:13]     Error {
[01:04:13]         line_num: 78,
[01:04:13]         kind: Some(
[01:04:13]             Error
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "expected basic integer type, found `&std::ops::Fn()`"
[01:04:13] ]
[01:04:13] 
[01:04:13] thread '[compile-fail] compile-fail/non-interger-atomic.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1283:13
[01:04:13] 
[01:04:13] 
[01:04:13] ---- [compile-fail] compile-fail/object-does-not-impl-trait.rs stdout ----
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/object-does-not-impl-trait.rs:16: unexpected error: '16:31: 16:39: the trait bound `std::boxed::Box<dyn Foo>: Foo` is not satisfied [E0277]'
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/object-does-not-impl-trait.rs:16: expected error not found: `std::boxed::Box<Foo>: Foo` is not satisfied
[01:04:13] 
[01:04:13] error: 1 unexpected errors found, 1 expected errors not found
[01:04:13] status: exit code: 101
[01:04:13] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/object-does-not-impl-trait.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/compile-fail/object-does-not-impl-trait/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/object-does-not-impl-trait/auxiliary" "-A" "unused"
[01:04:13] unexpected errors (from JSON output): [
[01:04:13]     Error {
[01:04:13]         line_num: 16,
[01:04:13]         kind: Some(
[01:04:13]         ),
[01:04:13]         ),
[01:04:13]         msg: "16:31: 16:39: the trait bound `std::boxed::Box<dyn Foo>: Foo` is not satisfied [E0277]"
[01:04:13] ]
[01:04:13] 
[01:04:13] not found errors (from test file): [
[01:04:13]     Error {
[01:04:13]     Error {
[01:04:13]         line_num: 16,
[01:04:13]         kind: Some(
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "`std::boxed::Box<Foo>: Foo` is not satisfied"
[01:04:13] ]
[01:04:13] 
[01:04:13] thread '[compile-fail] compile-fail/object-does-not-impl-trait.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1283:13
[01:04:13] 
[01:04:13] 
[01:04:13] ---- [compile-fail] compile-fail/object-safety-by-value-self-use.rs stdout ----
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/object-safety-by-value-self-use.rs:25: unexpected error: '25:5: 25:6: cannot move a value of type dyn Bar + 'static: the size of dyn Bar + 'static cannot be statically determined [E0161]'
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/object-safety-by-value-self-use.rs:25: expected error not found: cannot move a value of type Bar
[01:04:13] 
[01:04:13] error: 1 unexpected errors found, 1 expected errors not found
[01:04:13] status: exit code: 101
[01:04:13] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/object-safety-by-value-self-use.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/compile-fail/object-safety-by-value-self-use/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/c36:7: 36:14: the trait bound `dyn CompareToInts: CompareTo<i32>` is not satisfied [E0277]"
[01:04:13]     Error {
[01:04:13]         line_num: 44,
[01:04:13]         kind: Some(
[01:04:13]             Error
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "44:5: 44:27: the trait bound `dyn CompareToInts: CompareTo<i32>` is not satisfied [E0277]"
[01:04:13] ]
[01:04:13] 
[01:04:13] not found errors (from test file): [
[01:04:13]     Error {
[01:04:13]     Error {
[01:04:13]         line_num: 36,
[01:04:13]         kind: Some(
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "`CompareToInts: CompareTo<i32>` is not satisfied"
[01:04:13]     Error {
[01:04:13]         line_num: 44,
[01:04:13]         kind: Some(
[01:04:13]             Error
[01:04:13]             Error
[01:04:13]         ),
[01:04:13]         msg: "`CompareToInts: CompareTo<i32>` is not satisfied"
[01:04:13] ]
[01:04:13] 
[01:04:13] thread '[compile-fail] compile-fail/traits-repeated-supertrait-ambig.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1283:13
[01:04:13] 
[01:04:13] 
[01:04:13] ---- [compile-fail] compile-fail/trivial_casts.rs stdout ----
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/trivial_casts.rs:62: unexpected error: '62:13: 62:22: trivial cast: `&Bar` as `&dyn Foo`. Cast can be replaced by coercion, this might require type ascription or a temporary variable [trivial_casts]'
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/trivial_casts.rs:63: unexpected error: '63:13: 63:28: trivial cast: `&Bar` as `*const dyn Foo`. Cast can be replaced`&mut Foo`
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/trivial_casts.rs:69: expected error not found: trivial cast: `&mut Bar` as `*mut Foo`
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/trivial_casts.rs:74: expected error not found: trivial cast: `std::boxed::Box<Bar>` as `std::boxed::Box<Foo>`
[01:04:13] 
[01:04:13] error: /checkout/src/test/compile-fail/trivial_casts.rs:80: expected error not found: trivial cast: `&fn(i32) {main::baz}` as `&std::ops::Fn(i32)`
[01:04:13] 
[01:04:13] error: 6 unexpected errors found, 6 expected errors not found
[01:04:13] status: exit code: 101
[01:04:13] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/trivial_casts.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/compile-fail/trivial_casts/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/trivial_casts/auxiliary" "-A" "unused"
[01:04:13] unexpected errors (from JSON output): [
[01:04:13]     Error {
[01:04:13]         line_num: 62,
[01:04:13]         kind: Some(
[01:04:13]         ),
[01:04:13]         ),
[01:04:13]         msg: "62:13: 62:22: trivial cast: `&Bar` as `&dyn Foo`. Cast can be replaced by coercion, this might require type ascription or a temporary variable [trivial_casts]"
[01:04:13]     Error {
[01:04:13]         line_num: 63,
---
[01:04:13] test result: FAILED. 2371 passed; 34 failed; 15 ignored; 0 measured; 0 filtered out
[01:04:13] 
[01:04:13] 
[01:04:13] 
[01:04:13] 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" " directory
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:23426676
$ dmesg | grep -i kill

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)

@sanxiyn
Copy link
Member

sanxiyn commented May 27, 2018

Legit test failures.

@sanxiyn sanxiyn added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 27, 2018
@nikomatsakis
Copy link
Contributor

@zackmdavis (btw, --bless may be very useful in keeping this PR up to date)

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.

This seems... basically right? The main thing I see is the precedence issue, but perhaps I am overlooking some subtlety? (cc @eddyb @petrochenkov)

@@ -1063,6 +1063,7 @@ define_print! {
TyParam(ref param_ty) => write!(f, "{}", param_ty),
TyAdt(def, substs) => cx.parameterized(f, substs, def.did, &[]),
TyDynamic(data, r) => {
write!(f, "dyn ")?;
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, I think this may do the wrong thing in terms of precedence in some cases. For example, &dyn Foo + 'a needs some parens, right? I'm not 100% sure how this is handled already, since the same applies to &Foo + 'a... it kind of looks like we just get it wrong now?

Maybe we can concoct a test case to demonstrate this...

@nikomatsakis
Copy link
Contributor

Oh, I sort of missed this:

I'm not sure we want the dyn in the E0277 "trait bound [...] is not satisfied" messages

Or at least forgot about it. Let me look at that specifically.

@eddyb
Copy link
Member

eddyb commented May 31, 2018

but I'm finding the code I would need to change that hard to follow

So, all of that eventually ends up probably in the TraitRef implementation, but we don't want dyn there, since trait bounds are different from dynamic trait objects. You can't write T: dyn Trait.

@nikomatsakis
Copy link
Contributor

Right, right. Let me take a look. I forget how it works now; I know I have had at least one branch that tried to refactor precisely this point but I think it never landed (was part of a lazy norm push on my part)...

@@ -16,13 +16,13 @@ LL | const CONST_FOO: str = *"foo";
= help: the trait `std::marker::Sized` is not implemented for `str`
= note: constant expressions must have a statically known size

error[E0277]: the trait bound `std::fmt::Debug + std::marker::Sync + 'static: std::marker::Sized` is not satisfied
error[E0277]: the trait bound `dyn std::fmt::Debug + std::marker::Sync + 'static: std::marker::Sized` is not satisfied
Copy link
Contributor

Choose a reason for hiding this comment

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

I have to admit — tracing through ppaux.rs — I couldn't quite tel how this arises. Can somebody clarify for me? I imagine that this message is produced from traits/error_reporting.rs:

message.unwrap_or_else(|| {
format!("the trait bound `{}` is not satisfied{}",
trait_ref.to_predicate(), post_message)
}));

But it seems like that is printing a PolyTraitRef, and I'm not clear on the path that leads from that code to the TyDynamic code. What am I missing?

Copy link
Member

Choose a reason for hiding this comment

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

The TyDynamic is the Self type, printed by this:

print!(f, cx, print(self.trait_ref.self_ty()), write(": "), print(self.trait_ref))

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh; in that case, this seems...correct.

Copy link
Contributor

Choose a reason for hiding this comment

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

it might be nicer to print "the trait Sized is not implemented for dyn ...", like we used to, but that seems separate

@nikomatsakis
Copy link
Contributor

@zackmdavis so specifically which cases were worrying you? It seems like (apart from the matter of () precedence) this code is working out pretty well...?

@zackmdavis
Copy link
Member Author

so specifically which cases were worrying you?

The message that says "the trait bound dyn MyTrait" when (as Eddy pointed out) you can't use T: dyn MyTrait as a bound. I like your idea of rephrasing the message (but I won't have time to address this for at least a few days).

@eddyb
Copy link
Member

eddyb commented Jun 8, 2018

@zackmdavis IMO it's fine, since "the trait bound dyn Foo: Bar is not satisfied" means dyn Foo doesn't implement Bar, i.e. dyn Foo isn't "the trait bound", it's what the bound is "applied to".

@zackmdavis
Copy link
Member Author

zackmdavis commented Jun 8, 2018

Oh, right! 😳 OK, so then the only things left to do are:

  • write a test and possibly fix the suspected parentheses precedence issue
  • fix the remaining test expectations

—which I should get to early next week.

@bors
Copy link
Contributor

bors commented Jun 9, 2018

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

@pietroalbini
Copy link
Member

pietroalbini commented Jun 18, 2018

(note for future triage: the author has not so much time for rust at the moment, let's keep this open though #51149 (comment))

@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.
    100% |████████████████████████████████| 61kB 6.3MB/s 
Collecting botocore==1.10.41 (from awscli)
/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/38/37/80162be9e5a50c293ab1646d35d0a4886752df96dbc5a14843733bcaecd0/botocore-1.10.41-py2.py3-none-any.whl (4.3MB)
    0% |                                | 10kB 49.3MB/s eta 0:00:01
    0% |▏                               | 20kB 16.0MB/s eta 0:00:01
    0% |▎                               | 30kB 21.2MB/s eta 0:00:01
    0% |▎                               | 40kB 12.7MB/s eta 0:00:01
---

[00:05:03] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:05:03] tidy error: /checkout/src/test/ui/const-unsized.rs:14: line longer than 100 chars
[00:05:03] tidy error: /checkout/src/test/ui/const-unsized.rs:20: line longer than 100 chars
[00:05:05] some tidy checks failed
[00:05:05] 
[00:05:05] 
[00:05:05] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/tidy" "/checkout/src" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "--no-vendor" "--quiet"
[00:05:05] 
[00:05:05] 
[00:05:05] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:05:05] Build completed unsuccessfully in 0:01:54
[00:05:05] Build completed unsuccessfully in 0:01:54
[00:05:05] Makefile:79: recipe for target 'tidy' failed
[00:05:05] make: *** [tidy] Error 1

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0b2cb858
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:228fde7a:start=1529449734105508991,finish=1529449734111732822,duration=6223831
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:16303c80
$ head -30 ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
head: cannot open ‘./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers’ for reading: No such file or directory
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:066de91c
$ dmesg | grep -i kill

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.
Check compiletest suite=compile-fail mode=compile-fail (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:54:20] 
[00:54:20] running 2426 tests
[00:54:23] ....................................................................................................
[00:54:28] ................................F...................................................................
[00:54:38] ....................................................................................................
[00:54:38] ....................................................................................................
[00:54:44] .................................................................................F....i.............
[00:54:50] ...............................................ii.iii..F.................F.FF.......................
[00:54:54] ..............................................................................i....F................
[00:54:59] .......................i............................................................................
[00:55:04] ....................................F.........................................................i.....
[00:55:08] .........................................F.............F...................................F........
[00:55:14] F...........................................F.................F.....................................
[00:55:19] ...............................................................................F....................
[00:55:25] .......................................................................F...........F................
[00:55:31] ........................................F......F................................................FFF.
[00:55:39] ....................................................................................................
[00:55:44] ...i....................................F...........................................................
[00:55:50] ..i..ii...............................................................................F...........F.
[00:55:58] ......F...................................................................F....................F....
[00:56:07] ....................................................................................i...............
[00:56:12] ..............................i.....................................................................
[00:56:12] ..............................i.....................................................................
[00:56:18] .............................F.....................F...................F...F........F...............
[00:56:22] F...................................................................................................
[00:56:28] ..........................
[00:56:28] failures:
[00:56:28] 
[00:56:28] ---- [compile-fail] compile-fail/bad-sized.rs stdout ----
[00:56:28] ---- [compile-fail] compile-fail/bad-sized.rs stdout ----
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/bad-sized.rs:14: unexpected error: '14:12: 14:30: the trait bound `dyn Trait: std::marker::Sized` is not satisfied [E0277]'
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/bad-sized.rs:14: unexpected error: '14:33: 14:41: the trait bound `dyn Trait: std::marker::Sized` is not satisfied [E0277]'
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/bad-sized.rs:14: expected error not found: the trait bound `Trait: std::marker::Sized` is not satisfied
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/bad-sized.rs:14: expected error not found: the trait bound `Trait: std::marker::Sized` is not satisfied
[00:56:28] 
[00:56:28] error: 2 unexpected errors found, 2 expected errors not found
[00:56:28] status: exit code: 101
[00:56:28] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/bad-sized.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/compile-fail/bad-sized/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/bad-sized/auxiliary" "-A" "unused"
[00:56:28] unexpected errors (from JSON output): [
[00:56:28]     Error {
[00:56:28]         line_num: 14,
[00:56:28]         kind: Some(
[00:56:28]         ),
[00:56:28]         ),
[00:56:28]         msg: "14:12: 14:30: the trait bound `dyn Trait: std::marker::Sized` is not satisfied [E0277]"
[00:56:28]     Error {
[00:56:28]         line_num: 14,
[00:56:28]         kind: Some(
[00:56:28]             Error
[00:56:28]             Error
[00:56:28]         ),
[00:56:28]         msg: "14:33: 14:41: the trait bound `dyn Trait: std::marker::Sized` is not satisfied [E0277]"
[00:56:28] ]
[00:56:28] 
[00:56:28] not found errors (from test file): [
[00:56:28]     Error {
[00:56:28]     Error {
[00:56:28]         line_num: 14,
[00:56:28]         kind: Some(
[00:56:28]             Error
[00:56:28]         ),
[00:56:28]         msg: "the trait bound `Trait: std::marker::Sized` is not satisfied"
[00:56:28]     Error {
[00:56:28]         line_num: 14,
[00:56:28]         kind: Some(
[00:56:28]             Error
[00:56:28]             Error
[00:56:28]         ),
[00:56:28]         msg: "the trait bound `Trait: std::marker::Sized` is not satisfied"
[00:56:28] ]
[00:56:28] 
[00:56:28] thread '[compile-fail] compile-fail/bad-sized.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1284:13
[00:56:28] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:56:28] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:56:28] 
[00:56:28] ---- [compile-fail] compile-fail/cross-borrow-trait.rs stdout ----
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/cross-borrow-trait.rs:20: expected message not found: expected type `&Trait`
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/cross-borrow-trait.rs:20: expected message not found: found type `std::boxed::Box<Trait>`
[00:56:28] 
[00:56:28] error: 0 unexpected errors found, 2 expected errors not found
[00:56:28] status: exit code: 101
[00:56:28] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/cross-borrow-trait.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/compile-fail/cross-borrow-trait/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/cross-borrow-trait/auxiliary" "-A" "unused"
[00:56:28] not found errors (from test file): [
[00:56:28]     Error {
[00:56:28]         line_num: 20,
[00:56:28]         kind: None,
[00:56:28]         msg: "expected type `&Trait`"
[00:56:28]     Error {
[00:56:28]         line_num: 20,
[00:56:28]         kind: None,
[00:56:28]         kind: None,
[00:56:28]         msg: "found type `std::boxed::Box<Trait>`"
[00:56:28] ]
[00:56:28] 
[00:56:28] thread '[compile-fail] compile-fail/cross-borrow-trait.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1284:13
[00:56:28] 
[00:56:28] 
[00:56:28] ---- [compile-fail] compile-fail/destructure-trait-ref.rs stdout ----
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/destructure-trait-ref.rs:36: unexpected error: '36:9: 36:11: type `&dyn T` cannot be dereferenced [E0033]'
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/destructure-trait-ref.rs:37: unexpected error: '37:10: 37:12: type `&dyn T` cannot be dereferenced [E0033]'
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/destructure-trait-ref.rs:38: unexpected error: '38:9: 38:14: type `std::boxed::Box<dyn T>` cannot be dereferenced [E0033]'
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/destructure-trait-ref.rs:36: expected error not found: type `&T` cannot be dereferenced
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/destructure-trait-ref.rs:37: expected error not found: type `&T` cannot be dereferenced
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/destructure-trait-ref.rs:38: expected error not found: type `std::boxed::Box<T>` cannot be dereferenced
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/destructure-trait-ref.rs:41: expected message not found: expected type `T`
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/destructure-trait-ref.rs:46: expected message not found: expected type `T`
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/destructure-trait-ref.rs:51: expected message not found: expected type `T`
[00:56:28] 
[00:56:28] error: 3 unexpected errors found, 6 expected errors not found
[00:56:28] status: exit code: 101
[00:56:28] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/destructure-trait-ref.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/compile-fail/destructure-trait-ref/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/destructure-trait-ref/auxiliary" "-A" "unused"
[00:56:28] unexpected errors (from JSON output): [
[00:56:28]     Error {
[00:56:28]         line_num: 36,
[00:56:28]         kind: Some(
[00:56:28]         ),
[00:56:28]         ),
[00:56:28]         msg: "36:9: 36:11: type `&dyn T` cannot be dereferenced [E0033]"
[00:56:28]     Error {
[00:56:28]         line_num: 37,
[00:56:28]         kind: Some(
[00:56:28]             Error
[00:56:28]             Error
[00:56:28]         ),
[00:56:28]         msg: "37:10: 37:12: type `&dyn T` cannot be dereferenced [E0033]"
[00:56:28]     Error {
[00:56:28]         line_num: 38,
[00:56:28]         kind: Some(
[00:56:28]             Error
[00:56:28]             Error
[00:56:28]         ),
[00:56:28]         msg: "38:9: 38:14: type `std::boxed::Box<dyn T>` cannot be dereferenced [E0033]"
[00:56:28] ]
[00:56:28] 
[00:56:28] not found errors (from test file): [
[00:56:28]     Error {
[00:56:28]     Error {
[00:56:28]         line_num: 36,
[00:56:28]         kind: Some(
[00:56:28]             Error
[00:56:28]         ),
[00:56:28]         msg: "type `&T` cannot be dereferenced"
[00:56:28]     Error {
[00:56:28]         line_num: 37,
[00:56:28]         kind: Some(
[00:56:28]         kind: Some(
[00:56:28] thread 'main' panicked at 'Some tests fa/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/dst-bad-assign-2.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/compile-fail/dst-bad-assign-2/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/dst-bad-assign-2/auxiliary" "-A" "unused"
[00:56:28] unexpected errors (from JSON output): [
[00:56:28]     Error {
[00:56:28]         line_num: 45,
[00:56:28]         kind: Some(
[00:56:28]         ),
[00:56:28]         ),
[00:56:28]         msg: "45:5: 45:11: the trait bound `dyn ToBar: std::marker::Sized` is not satisfied [E0277]"
[00:56:28] ]
[00:56:28] 
[00:56:28] not found errors (from test file): [
[00:56:28]     Error {
[00:56:28]     Error {
[00:56:28]         line_num: 45,
[00:56:28]         kind: Some(
[00:56:28]             Error
[00:56:28]         ),
[00:56:28]         msg: "`ToBar: std::marker::Sized` is not satisfied"
[00:56:28] ]
[00:56:28] 
[00:56:28] thread '[compile-fail] compile-fail/dst-bad-assign-2.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1284:13
[00:56:28] 
[00:56:28] 
[00:56:28] ---- [compile-fail] compile-fail/dst-bad-assign-3.rs stdout ----
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/dst-bad-assign-3.rs:43: unexpected error: '43:5: 43:9: the trait bound `dyn ToBar: std::marker::Sized` is not satisfied [E0277]'
[00:56:28] 
[00:56:28] error: /checkout/src/test/compitd::marker::Sized` is not satisfied"
[00:56:28] ]
[00:56:28] 
[00:56:28] thread '[compile-fail] compile-fail/dst-bad-assign-3.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1284:13
[00:56:28] 
[00:56:28] 
[00:56:28] ---- [compile-fail] compile-fail/dst-bad-assign.rs stdout ----
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/dst-bad-assign.rs:45: unexpected error: '45:5: 45:11: the trait bound `dyn ToBar: std::marker::Sized` is not satisfied [E0277]'
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/dst-bad-assign.rs:45: expected message not found: expected type `ToBar`
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/dst-bad-assign.rs:45: expected error not found: `ToBar: std::marker::Sized` is not satisfied
[00:56:28] 
[00:56:28] error: 1 unexpected errors found, 2 expected errors not found
[00:56:28] status: exit code: 101
[00:56:28] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/dst-bad-assign.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/compile-fail/dst-bad-assign/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/dst-bad-assign/auxiliary" "-A" "unused"
[00:56:28] unexpected errors (from JSON output): [
[00:56:28]     Error {
[00:56:28]         line_num: 45,
[00:56:28]         kind: Some(
[00:56:28]         ),
[00:56:28]         ),
[00:56:28]         msg: "45:5: 45:11: the trait bound `dyn ToBar: std::marker::Sized` is not satisfied [E0277]"
[00:56:28] ]
[00:56:28] 
[00:56:28] not found errors (from test file): [
[00:56:28]     Error {
[00:56:28]     Error {
[00:56:28]         line_num: 45,
[00:56:28]         kind: None,
[00:56:28]         msg: "expected type `ToBar`"
[00:56:28]     Error {
[00:56:28]         line_num: 45,
[00:56:28]         kind: Some(
[00:56:28]             Error
[00:56:28]             Error
[00:56:28]         ),
[00:56:28]         msg: "`ToBar: std::marker::Sized` is not satisfied"
[00:56:28] ]
[00:56:28] 
[00:56:28] thread '[compile-fail] compile-fail/dst-bad-assign.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1284:13
[00:56:28] 
[00:56:28] 
[00:56:28] ---- [compile-fail] compile-fail/fn-trait-formatting.rs stdout ----
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/fn-trait-formatting.rs:16: expected message not found: found type `std::boxed::Box<std::ops::FnOnce(isize)>`
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/fn-trait-formatting.rs:20: expected message not found: found type `std::boxed::Box<std::ops::Fn(isize, isize)>`
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/fn-trait-formatting.rs:24: expected message not found: found type `std::boxed::Box<std::ops::FnMut() -> isize>`
[00:56:28] 
[00:56:28] error: 0 unexpected errors found, 3 expected errors not found
[00:56:28] status: exit code: 101
[00:56:28] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/fn-trait-formatting.rs" "-pected errors not found
[00:56:28] status: exit code: 101
[00:56:28] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/issue-13033.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/compile-fail/issue-13033/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/issue-13033/auxiliary" "-A" "unused"
[00:56:28] not found errors (from test file): [
[00:56:28]     Error {
[00:56:28]         line_num: 18,
[00:56:28]         kind: None,
[00:56:28]         msg: "expected type `fn(&mut Baz, &mut Foo)`"
[00:56:28]     Error {
[00:56:28]         line_num: 18,
[00:56:28]         kind: None,
[00:56:28]         kind: None,
[00:56:28]         msg: "found type `fn(&mut Baz, &Foo)`"
[00:56:28] ]
[00:56:28] 
[00:56:28] thread '[compile-fail] compile-fail/issue-13033.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1284:13
[00:56:28] 
[00:56:28] 
[00:56:28] ---- [compile-fail] compile-fail/issue-18107.rs stdout ----
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/issue-18107.rs:14: unexpected error: '14:5: 14:21: the trait bound `(dyn AbstractRenderer + 'static): std::marker::Sized` is not satisfied [E0277]'
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/issue-18107.rs:14: expected error not found: `AbstractRenderer + 'static: std::marker::Sized` is not satisfied
[00:56:28] 
[00:56:28] error: 1 unexpected errors found, 1 expected errors not found
[00:56:28] status: exit code: 101
[00:56:28] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/issue-18107.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/compile-fail/issue-18107/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/issue-18107/auxiliary" "-A" "unused"
[00:56:28] unexpected errors (from JSON output): [
[00:56:28]     Error {
[00:56:28]         line_num: 14,
[00:56:28]         kind: Some(
[00:56:28]         ),
[00:56:28]         ),
[00:56:28]         msg: "14:5: 14:21: the trait bound `(dyn AbstractRenderer + \'static): std::marker::Sized` is not satisfied [E0277]"
[00:56:28] ]
[00:56:28] 
[00:56:28] not found errors (from test file): [
[00:56:28]     Error {
[00:56:28]     Error {
[00:56:28]         line_num: 14,
[00:56:28]         kind: Some(
[00:56:28]             Error
[00:56:28]         ),
[00:56:28]         msg: "`AbstractRenderer + \'static: std::marker::Sized` is not satisfied"
[00:56:28] ]
[00:56:28] 
[00:56:28] thread '[compile-fail] compile-fail/issue-18107.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1284:13
[00:56:28] 
[00:56:28] 
[00:56:28] ---- [compile-fail] compile-fail/issue-18919.rs stdout ----
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/issue-18919.rs:13: unexpected error: '13:1: 15:2: the trait bound `dyn for<'r> std::ops::Fn(&'r isize) -> isize: std::marker::Sized` is not satisfied [E0277]'
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/issue-18919.rs:13: expected error not found: `for<'r> std::ops::Fn(&'r isize) -> isize: std::marker::Sized` is not satisfied
[00:56:28] 
[00:56:28] error: 1 unexpected errors found, 1 expected errors not found
[00:56:28] status: exit code: 101
[00:56:28] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/issue-18919.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/compile-fail/issue-18919/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/issue-18919/auxiliary" "-A" "unused"
[00:56:28] unexpected errors (from JSON output): [
[00:56:28]     Error {
[00:56:28]         line_num: 13,
[00:56:28]         kind: Some(
[00:56:28]         ),
[00:56:28]         ),
[00:56:28]         msg: "13:1: 15:2: the trait bound `dyn for<\'r> std::ops::Fn(&\'r isize) -> isize: std::marker::Sized` is not satisfied [E0277]"
[00:56:28] ]
[00:56:28] 
[00:56:28] not found errors (from test file): [
[00:56:28]     Error {
[00:56:28]     Error {
[00:56:28]         line_num: 13,
[00:56:28]         kind: Some(
[00:56:28]             Error
[00:56:28]         ),
[00:56:28]         msg: "`for<\'r> std::ops::Fn(&\'r isize) -> isize: std::marker::Sized` is not satisfied"
[00:56:28] ]
[00:56:28] 
[00:56:28] thread '[compile-fail] compile-fail/issue-18919.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1284:13
[00:56:28] 
[00:56:28] 
[00:56:28] ---- [compile-fail] compile-fail/issue-20605.rs stdout ----
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/issue-20605.rs:12: unexpected error: '12:17: 12:24: the trait bound `dyn std::iter::Iterator<Item=&mut u8>: std::marker::Sized` is not satisfied [E0277]'
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/issue-20605.rs:12: expected error not found: the trait bound `std::iter::Iterator<Item=&mut u8>: std::marker::Sized` is not satisfied
[00:56:28] 
[00:56:28] error: 1 unexpected errors found, 1 expected errors not found
[00:56:28] status: exit code: 101
[00:56:28] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/issue-20605.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/compile-fail/issue-20605/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/issue-20605/auxiliary" "-A" "unused"
[00:56:28] unexpected errors (from JSON output): [
[00:56:28]     Error {
[00:56:28]         line_num: 12,
[00:56:28]         kind: Some(
[00:56:28]         ),
[00:56:28]         ),
[00:56:28]         msg: "12:17: 12:24: the trait bound `dyn std::iter::Iterator<Item=&mut u8>: std::marker::Sized` is not satisfied [E0277]"
[00:56:28] ]
[00:56:28] 
[00:56:28] not found errors (from test file): [
[00:56:28]     Error {
[00:56:28]     Error {
[00:56:28]         line_num: 12,
[00:56:28]         kind: Some(
[00:56:28]             Error
[00:56:28]         ),
[00:56:28]         msg: "the trait bound `std::iter::Iterator<Item=&mut u8>: std::marker::Sized` is not satisfied"
[00:56:28] ]
[00:56:28] 
[00:56:28] thread '[compile-fail] compile-fail/issue-20605.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1284:13
[00:56:28] 
[00:56:28] 
[00:56:28] ---- [compile-fail] compile-fail/issue-20939.rs stdout ----
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/issue-20939.rs:13: unexpected error: '13:1: 13:24: the object type `(dyn Foo + 'a)` automatically implements the trait `Foo` [E0371]'
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/issue-20939.rs:13: expected error not found: the object type `Foo + 'a` automatically implements the trait `Foo`
[00:56:28] 
[00:56:28] error: 1 unexpected errors found, 1 expected errors not found
[00:56:28] status: exit code: 101
[00:56:28] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/issue-20939.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/compile-fail/issue-20939/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/issue-20939/auxiliary" "-A" "unused"
[00:56:28] unexpected errors (from JSON output): [
[00:56:28]     Error {
[00:56:28]         line_num: 13,
[00:56:28]         kind: Some(
[00:56:28]         ),
[00:56:28]         ),
[00:56:28]         msg: "13:1: 13:24: the object type `(dyn Foo + \'a)` automatically implements the trait `Foo` [E0371]"
[00:56:28] ]
[00:56:28] 
[00:56:28] not found errors (from test file): [
[00:56:28]     Error {
[00:56:28]     Error {
[00:56:28]         line_num: 13,
[00:56:28]         kind: Some(
[00:56:28]             Error
[00:56:28]         ),
[00:56:28]         msg: "the object type `Foo + \'a` automatically implements the trait `Foo`"
[00:56:28] ]
[00:56:28] 
[00:56:28] thread '[compile-fail] compile-fail/issue-20939.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1284:13
[00:56:28] 
[00:56:28] 
[00:56:28] ---- [compile-fail] compile-fail/issue-23281.rs stdout ----
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/issue-23281.rs:16: unexpected error: '16:5: 16:46: the trait bound `(dyn std::ops::Fn() + 'static): std::marker::Sized` is not satisfied [E0277]'
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/issue-23281.rs:16: expected error not found: the trait bound `std::ops::Fn() + 'static: std::marker::Sized` is not satisfied
[00:56:28] 
[00:56:28] error: 1 unexpected errors found, 1 expected errors not found
[00:56:28] status: exit code: 101
[00:56:28] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/issue-23281.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/compile-fail/issue-23281/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/issue-23281/auxiliary" "-A" "unused"
[00:56:28] unexpected errors (from JSON output): [
[00:56:28]     Error {
[00:56:28]         line_num: 16,
[00:56:28]         kind: Some(
[00:56:28]         ),
[00:56:28]         ),
[00:56:28]         msg: "16:5: 16:46: the trait bound `(dyn std::ops::Fn() + \'static): std::marker::Sized` is not satisfied [E0277]"
[00:56:28] ]
[00:56:28] 
[00:56:28] not found errors (from test file): [
[00:56:28]     Error {
[00:56:28]     Error {
[00:56:28]         line_num: 16,
[00:56:28]         kind: Some(
[00:56:28]             Error
[00:56:28]         ),
[00:56:28]         msg: "the trait bound `std::ops::Fn() + \'static: std::marker::Sized` is not satisfied"
[00:56:28] ]
[00:56:28] 
[00:56:28] thread '[compile-fail] compile-fail/issue-23281.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1284:13
[00:56:28] 
[00:56:28] 
[00:56:28] ---- [compile-fail] compile-fail/issue-24446.rs stdout ----
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/issue-24446.rs:12: unexpected error: '12:31: 16:6: the trait bound `(dyn std::ops::Fn() -> u32 + 'static): std::marker::Sized` is not satisfied [E0277]'
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/issue-24446.rs:12: expected error not found: `std::ops::Fn() -> u32 + 's 
[00:56:28] error: /checkout/src/test/compile-fail/issue-32963.rs:18: unexpected error: '18:5: 18:30: the trait bound `dyn Misc: std::marker::Copy` is not satisfied [E0277]'
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/issue-32963.rs:18: expected error not found: the trait bound `Misc: std::marker::Copy` is not satisfied
[00:56:28] 
[00:56:28] error: 1 unexpected errors found, 1 expected errors not found
[00:56:28] status: exit code: 101
[00:56:28] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/issue-32963.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/compile-fail/issue-32963/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/issue-32963/auxiliary" "-A" "unused"
[00:56:28] unexpected errors (from JSON output): [
[00:56:28]     Error {
[00:56:28]         line_num: 18,
[00:56:28]         kind: Some(
[00:56:28]         ),
[00:56:28]         ),
[00:56:28]         msg: "18:5: 18:30: the trait bound `dyn Misc: std::marker::Copy` is not satisfied [E0277]"
[00:56:28] ]
[00:56:28] 
[00:56:28] not found errors (from test file): [
[00:56:28]     Error {
[00:56:28]     Error {
[00:56:28]         line_num: 18,
[00:56:28]         kind: Some(
[00:56:28]             Error
[00:56:28]         ),
[00:56:28]         msg: "the trait bound `Misc: std::marker::Copy` is not satisfied"
[00:56:28] ]
[00:56:28] 
[00:56:28] thread '[compile-fail] compile-fail/issue-32963.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1284:13
[00:56:28] 
[00:56:28] 
[00:56:28] ---- [compile-fail] compile-fail/issue-41139.rs stdout ----
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/issue-41139.rs:16: unexpected error: '16:23: 16:39: cannot move a value of type (dyn Trait + 'static): the size of (dyn Trait + 'static) cannot be statically determined [E0161]'
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/issue-41139.rs:16: expected error not found: cannot move a value of type Trait + 'static
[00:56:28] 
[00:56:28] error: 1 unexpected errors found, 1 expected errors not found
[00:56:28] status: exit code: 101
[00:56:28] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/issue-41139.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/compile-fail/issue-41139/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/issue-41139/auxiliary" "-A" "unused"
[00:56:28] unexpected errors (from JSON output): [
[00:56:28]     Error {
[00:56:28]         line_num: 16,
[00:56:28]         kind: Some(
[00:56:28]         ),
[00:56:28]         ),
[00:56:28]         msg: "16:23: 16:39: cannot move a value of type (dyn Trait + \'static): the size of (dyn Trait + \'static) cannot be statically determined [E0161]"
[00:56:28] ]
[00:56:28] 
[00:56:28] not found errors (from test file): [
[00:56:28]     Error {
[00:56:28]     Error {
[00:56:28]         line_num: 16,
[00:56:28]         kind: Some(
[00:56:28]             Error
[00:56:28]         ),
[00:56:28]         msg: "cannot move a value of type Trait + \'static"
[00:56:28] ]
[00:56:28] 
[00:56:28] thread '[compile-fail] compile-fail/issue-41139.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1284:13
[00:56:28] 
[00:56:28] 
[00:56:28] ---- [compile-fail] compile-fail/issue-42312.rs stdout ----
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/issue-42312.rs:18: unexpected error: '18:23: 18:23: the trait bound `(dyn std::string::ToString + 'static): std::marker::Sized` is not satisfied [E0277]'
[00:56:28] 
[00:56:28] error: /checkout/src/test/compile-fail/issue-42312.rs:18: expected error not found: the trait bound `std::string::ToString + 'static: std::marker::Sized` is not satisfied
[00:56:28] 
[00:56:28] error: 1 unexpected errors found, 1 expected errors not found
[00:56:28] status: exit code: 101
[00:56:28] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/issue-42312.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/compile-fail/issue-42312/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/issue-42312/auxiliary" "-A" "unused"
[00:56:28] unexpected errors (from JSON output): [
[00:56:28]     Error {
[00:56:28]         line_num: 18,
[00:56:28]         kind: Some(
[00:56:28]         ),
[00:56:28]         ),
[00:56:28]         msg: "18:23: 18:23: the trait bound `(dyn std::string::ToString + \'static): std::marker::Sized` is not satisfied [E0277]"
[00:56:28] ]
[00:56:28] 
[00:56:28] not found errors (from test file): [
---
[00:56:28] test result: FAILED. 2377 passed; 34 failed; 15 ignored; 0 measured; 0 filtered out
[00:56:28] 
[00:56:28] 
[00:56:28] 
[00:56:28] 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/compile-fail" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "compile-fail" "--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" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[00:56:28] 
[00:56:28] 
[00:56:28] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:56:28] Build completed unsuccessfully in 0:14:22
[00:56:28] Build completed unsuccessfully in 0:14:22
[00:56:28] Makefile:58: recipe for target 'check' failed
[00:56:28] make: *** [check] Error 1

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)

@zackmdavis
Copy link
Member Author

@nikomatsakis updated to add parentheses when there's a + 'lifetime, which the parser seems to require. (No dedicated test because this affects a lot of the existing tests.)

@bors
Copy link
Contributor

bors commented Jun 22, 2018

☔ The latest upstream changes (presumably #51463) 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.
Check compiletest suite=ui mode=ui (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:46:50] 
[00:46:50] running 1516 tests
[00:46:55] ...............................................................................................i....
[00:47:01] .........................................................iF.........................................
[00:47:09] ....................................................................................................
[00:47:09] ....................................................................................................
[00:47:13] ......................................................................F.............................
[00:47:16] ..............................................................................................F.....
[00:47:26] ....................................................................................................
[00:47:32] ....................................................................................................
[00:47:32] ....................................................................................................
[00:47:38] ...........................................................................................F........
[00:47:44] .............i................................................................................i.....
[00:47:48] .....................................................................................F..............
[00:48:01] ....................................................................................................
[00:48:07] ...............................i....................................................................
[00:48:07] ...............................i....................................................................
ically known size
[00:48:08] 20 
[00:48:08] - error[E0277]: the size for value values of type `std::fmt::Debug + std::marker::Sync + 'static` cannot be known at compilation time
[00:48:08] + error[E0277]: the size for value values of type `(dyn std::fmt::Debug + std::marker::Sync + 'static)` cannot be known at compilation time
[00:48:08] 23    |
[00:48:08] 23    |
[00:48:08] 24 LL | static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync));
[00:48:08] 
[00:48:08] 25    |                               ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time
[00:48:08] 26    |
[00:48:08] -    = help: the trait `std::marker::Sized` is not implemented for `std::fmt::Debug + std::marker::Sync + 'static`
[00:48:08] +    = help: the trait `std::marker::Sized` is not implemented for `(dyn std::fmt::Debug + std::marker::Sync + 'static)`
[00:48:08] 28    = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
[00:48:08] 29    = note: constant expressions must have a statically known size
[00:48:08] 
[00:48:08] 
[00:48:08] The actual stderr differed from the expected stderr.
[00:48:08] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-unsized/const-unsized.stderr
[00:48:08] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/const-unsized/const-unsized.stderr
[00:48:08] To update references, rerun the tests and pass the `--bless` flag
[00:48:08] To only update this specific test, also pass `--test-args const-unsized.rs`
[00:48:08] error: 1 errors occurred comparing output.
[00:48:08] status: exit code: 101
[00:48:08] status: exit code: 101
[00:48:08] command: "/checkout/obj/ow 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/const-unsized.rs","byte_start":517,"byte_end":539,"line_start":13,"line_end":13,"column_start":29,"column_anation":"\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/const-unsized.rs","byte_start":610,"byte_end":616,"line_start":16,"line_end":16,"column_start":24,"column_end":30,"is_primary":true,"text":[{"text":"const CONST_FOO: str = *\"foo\";","highlight_start":24,"highlight_end":30}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the trait `std::marker::Sized` is not implemented for `str`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"constant expressions must have a statically known size","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the size for value values of type `str` cannot be known at compilation time\n  --> /checkout/src/test/ui/const-unsized.rs:16:24\n   |\nLL | const CONST_FOO: str = *\"foo\";\n   |                        ^^^^^^ doesn't have a size known at compile-time\n   |\n   = help: the trait `std::marker::Sized` is not implemented for `str`\n   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>\n   = note: constant expressions must have a statically known size\n\n"}
[00:48:08] {"message":"the size for value values of type `(dyn std::fmt::Debug + std::marker::Sync + 'static)` cannot be known at compilation time","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, anne_start":19,"line_end":19,"column_start":31,"column_end":33,"is_primary":true,"text":[{"text":"    -> Box<for<'a> Id<impl Lt<'a>>>","highlight_start":31,"highlight_end":33}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0657]: `impl Trait` can only capture lifetimes bound at the fn or impl level\n  --> /checkout/src/test/ui/error-codes/E0657.rs:19:31\n   |\nLL |     -> Box<for<'a> Id<impl Lt<'a>>>\n   |                               ^^\n\n"}
[00:48:08] {"message":"`impl Trait` can only capture lifetimes bound at the fn or impl level","code":{"code":"E0657","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/error-codes/E0657.rs","byte_start":882,"byte_end":884,"line_start":28,"line_end":28,"column_start":35,"column_end":37,"is_primary":true,"text":[{"text":"        -> Box<for<'a> Id<impl Lt<'a>>>","highlight_start":35,"highlight_end":37}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0657]: `impl Trait` can only capture lifetimes bound at the fn or impl level\n  --> /checkout/src/test/ui/error-codes/E0657.rs:28:35\n   |\nLL |         -> Box<for<'a> Id<impl Lt<'a>>>\n   |                                   ^^\n\n"}
[00:48:08] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expressi:[],"rendered":"For more information about an error, try `rustc --explain E0308`.\n"}
[00:48:08] ------------------------------------------
[00:48:08] 
[00:48:08] thread '[ui] ui/error-codes/E0657.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3139:9
[00:48:08] 
[00:48:08] 
[00:48:08] ---- [ui] ui/feature-gate-trivial_bounds.rs stdout ----
[00:48:08] diff of stderr:
[00:48:08] 
[00:48:08] 98    = help: see issue #48214
[00:48:08] 99    = help: add #![feature(trivial_bounds)] to the crate attributes to enable
[00:48:08] 100 
[00:48:08] - error[E0277]: the size for value values of type `A + 'static` cannot be known at compilation time
[00:48:08] + error[E0277]: the size for value values of type `(dyn A + 'static)` cannot be known at compilation time
[00:48:08] 102   --> $DIR/feature-gate-trivial_bounds.rs:65:1
[00:48:08] 103    |
[00:48:08] 104 LL | / fn unsized_local() where Dst<A>: Sized { //~ ERROR
[00:48:08] 
[00:48:08] 106 LL | | }
[00:48:08] 107    | |_^ doesn't have a size known at compile-time
[00:48:08] 108    |
[00:48:08] -    = help: within `Dst<A + 'static>`, the trait `std::marker::Sized` is not implemented for `A + 'static`
[00:48:08] +    = help: within `Dst<(dyn A + 'static)>`, the trait `std::marker::Sized` is not implemented for `(dyn A + 'static)`
[00:48:08] 110    = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
[00:48:08] -    = note: required because it appears within the type `Dst<A + 'static>`
[00:48:08] +    = note: required because it appears within the type `Dst<(dyn A + 'static)>`
[00:48:08] 112    = help: see issue #48214
[00:48:08] 113    = help: add #![feature(trivial_bounds)] to the crate attributes to enable
[00:48:08] 
[00:48:08] 
[00:48:08] The actual stderr differed from the expected stderr.
[00:48:08] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/feature-gate-trivial_bounds/feature-gate-trivial_bounds.stderr
[00:48:08] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/feature-gate-trivial_bounds/feature-gate-trivial_bounds.stderr
[00:48:08] To update references, rerun the tests and pass the `--bless` flag
[00:48:08] To only update this specific test, also pass `--test-args feature-gate-trivial_bounds.rs`
[00:48:08] error: 1 errors occurred comparing output.
[00:48:08] status: exit code: 101
[00:48:08] status: exit code: 101
[00:48:08] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/feature-gate-trivial_bounds.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/feature-gate-trivial_bounds/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/feature-gate-trivial_bounds/auxiliary" "-A" "unused"
[00:48:08] ------------------------------------------
[00:48:08] 
[00:48:08] ------------------------------------------
[00:48:08] stderr:
[00:48:08] stderr:
[00:48:08] ------------------------------------------
[00:48:08] {"message":"the trait bound `i32: Foo` is not satisfied","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```\nis not satisfied","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 wtion: 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/feature-gate-trivial_bounds.rs","byte_start":667,"byte_end":692,"line_start":24,"line_end":24,"column_start":1,"column_end":26,"is_primary":true,"text":[{"text":"trait T where i32: Foo {} //~ ERROR","highlight_start":1,"highlight_end":26}],"label":"the trait `Foo` is not implemented for `i32`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"see issue #48214","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"add #![feature(trivial_bounds)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `i32: Foo` is not satisfied\n  --> /checkout/src/test/ui/feature-gate-trivial_bounds.rs:24:1\n   |\nLL | trait T where i32: Foo*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/feature-gate-trivial_bounds.rs","byte_start":704,"byte_end":737,"line_start":26,"line_end":26,"column_start":1,"column_end":34,"is_primary":true,"text":[{"text":"union U where i32: Foo { f: i32 } //~ ERROR","highlight_start":1,"highlight_end":34}],"label":"the trait `Foo` is not implemented for `i32`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"see issue #48214","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"add #![feature(trivial_bounds)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: theis 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/feature-gate-trivial_bounds.rs","byte_start":803,"byte_end":953,"line_start":30,"line_end":36,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"impl Foo for () where i32: Foo { //~ ERROR","highlight_start":1,"highlight_end":43},{"text":"    fn test(&self) {","highlight_start":1,"highlight_end":21},{"text":"        3i32.test();","highlight_start":1,"highlight_end":21},{"text":"        Foo::test(&4i32);","highlight_start":1,"highlight_end":26},{"text":"        generic_function(5i32);","highlight_start":1,"highlight_end":32},{"text":"    }","highlight_start":1,"highlight_end":6},{"text":"}","highlight_start":1,"highlight_end":2}],"label":"the trait `Foo` is not implemented for `i32`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"see issue #48214","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"add #![feature(trivial_bounds)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `i32: Foo` is not satisfied\n  --> /checkout/src/test/ui/feature-gate-trivial_bounds.rs:30:1\n   |\nLL | / impl Foo for () where i32: Foo { //~ ERROR\nLL | |     fn test(&self) {\nLL | |         3i32.test();\nLL | |         Foo::test(&4i32);\nLL | |         generic_function(5i32);\nLL | |     }\nLL | | }\n   | |_^ the trait `Foo` is not implemented for `i32`\n   |\n   = help: see issue #48214\n   = help: add #![feature(trivial_bounds)] to the crate attributes to enable\n\n"}
[00:48:08] {"message":"the trait bound `i32: Foo` is not satisfied","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_fund 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/feature-gate-trivial_bounds.rs","byte_start":955,"byte_end":1072,"line_start":38,"line_end":44,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn f() where i32: Foo //~ ERROR","highlight_start":1,"highlight_end":32},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"    let s = S;","highlight_start":1,"highlight_end":15},{"text":"    3i32.test();","highlight_start":1,"highlight_end":17},{"text":"    Foo::test(&4i32);","highlight_start":1,"highlight_end":22},{"text":"    generic_function(5i32);","highlight_start":1,"highlight_end":28},{"text":"}","highlight_start":1,"highlight_end":2}],"label":"the trait `Foo` is not implemented for `i32`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"see issue #48214","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"add #![feature(trivial_bounds)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `i32: Foo` is not satisfied\n  --> /checkout/src/test/ui/feature-gate-trivial_bounds.rs:38:1\n   |\nLL | / fn f() where i32: Foo //~ ERROR\nLL | | {\nLL | |     let s = S;\nLL | |     3i32.test();\nLL | |     Foo::test(&4i32);\nLL | |     generic_function(5i32);\nLL | | }\n   | |_^ the trait `Foo` is not implemented for `i32`\n   |\n   = help: see issue #48214\n   = help: add #![feature(trivial_bounds)] to the crate attributes to enable\n\n"}
[00:48:08] {"message":"the trait bound `std::string::String: std::ops::Neg` is not satisfied","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/feature-gate-trivial_bounds.rs","byte_start":1074,"byte_end":1170,"line_start":46,"line_end":48,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn use_op(s: String) -> String where String: ::std::ops::Neg<Output=String> { //~ ERROR","highlight_start":1,"highlight_end":88},{"text":"    -s","highlight_start":1,"highlight_end":7},{"text":"}","highlight_start":1,"highlight_end":2}],"label":"the trait `std::ops::Neg` is not implemented for `std::string::String`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"see issue #48214","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"add #![feature(trivial_bounds)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `std::string::String: std::ops::Neg` is not satisfied\n  --> /checkout/src/test/ui/feature-gate-trivial_bounds.rs:46:1\n   |\nLL | / fn use_op(s: String) -> String where String: ::std::ops::Neg<Output=String> { //~ ERROR\nLL | |     -s\nLL | | }\n   | |_^ the trait `std::ops::Neg` is not implemented for `std::string::String`\n   |\n   = help: see issue #48214\n   = help: add #![feature(trivial_bounds)] to the crate attributes to enable\n\n"}
[00:48:08] {"message":"the trait bound `i32: std::iter::Iterator` is not satisfied","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 li    // 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/feature-gate-trivial_bounds.rs","byte_start":1364,"byte_end":1478,"line_start":65,"line_end":67,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn unsized_local() where Dst<A>: Sized { //~ ERROR","highlight_start":1,"highlight_end":51},{"text":"    let x: Dst<A> = *(Box::new(Dst { x: 1 }) as Box<Dst<A>>);","highlight_start":1,"highlight_end":62},{"text":"}","highlight_start":1,"highlight_end":2}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"within `Dst<(dyn A + 'static)>`, tfunction: 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/feature-gate-trivial_bounds.rs","byte_start":1480,"byte_end":1575,"line_start":69,"line_end":71,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn return_str() -> str where str: Sized { //~ ERROR","highlight_start":1,"highlight_end":52},{"text":"    *\"Sized\".to_string().into_boxed_str()","highlight_start":1,"highlight_end":42},{"text":"}","highlight_start":1,"highlight_end":2}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the trait `std::marker::Sized` is not implemented for `str`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"see issue #48214","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"add #![feature(trivial_bounds)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the size for value values of type `str` cannot be known at compilation time\n  --> /checkout/src/test/ui/feature-gate-trivial_bounds.rs:69:1\n   |\nLL | / fn return_str() -> str where str: Sized { //~ ERROR\nLL | |     *\"Sized\".to_string().into_boxed_str()\nLL | | }\n   | |_^ doesn't have a size known at compile-time\n   |\n   = help: the trait `std::marker::Sized` is not implemented for `str`\n   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>\n   = help: see issue #48214\n   = help: add #![feature(trivial_bounds)] to the crate attributes to enable\n\n"}
[00:48:08] {"message":"aborting due to 11 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 11 previous errors\n\n"}
[00:48:08] {"message":"For more information about this error, try `rustc --explain E0277`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0277`.\n"}
[00:48:08] ------------------------------------------
[00:48:08] 
[00:48:08] thread '[ui] ui/feature-gate-trivial_bounds.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3139:9
[00:48:08] 
[00:48:08] 
[00:48:08] ---- [ui] ui/mismatched_types/cast-rfc0401.rs stdout ----
[00:48:08] diff of stderr:
[00:48:08] 
[00:48:08] 162 LL |     let _ = v as *const [u8]; //~ ERROR cannot cast
[00:48:08] 164 
[00:48:08] 164 
[00:48:08] - error[E0606]: casting `&Foo` as `*const str` is invalid
[00:48:08] + error[E0606]: casting `&dyn Foo` as `*const str` is invalid
[00:48:08] 167    |
[00:48:08] 167    |
[00:48:08] 168 LL |     let _ = foo as *const str; //~ ERROR is invalid
[00:48:08] 169    |             ^^^^^^^^^^^^^^^^^
[00:48:08] 170 
[00:48:08] 170 
[00:48:08] - error[E0606]: casting `&Foo` as `*mut str` is invalid
[00:48:08] + error[E0606]: casting `&dyn Foo` as `*mut str` is invalid
[00:48:08] 173    |
[00:48:08] 173    |
[00:48:08] 174 LL |     let _ = foo as *mut str; //~ ERROR is invalid
[00:48:08] 200    |
[00:48:08] 200    |
[00:48:08] 201    = help: cast through a thin pointer first
[00:48:08] 202 
[00:48:08] - error[E0606]: casting `*const Foo` as `*const [u16]` is invalid
[00:48:08] + error[E0606]: casting `*const dyn Foo` as `*const [u16]` is invalid
[00:48:08] 205    |
[00:48:08] 205    |
[00:48:08] 206 LL |     let _ = cf as *const [u16]; //~ ERROR is invalid
[00:48:08] 208    |
[00:48:08] 208    |
[00:48:08] 209    = note: vtable kinds may not match
[00:48:08] 210 
[00:48:08] - error[E0606]: casting `*const Foo` as `*const Bar` is invalid
[00:48:08] + error[E0606]: casting `*const dyn Foo` as `*const dyn Bar` is invalid
[00:48:08] 213    |
[00:48:08] 213    |
[00:48:08] 214 LL |     let _ = cf as *const Bar; //~ ERROR is invalid
[00:48:08] 224    |
[00:48:08] 224    |
[00:48:08] 225  j/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/mismatched_types/cast-rfc0401.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/mismatched_types/cast-rfc0401/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/mismatched_types/cast-rfc0401/auxiliary" "-A" "unused"
[00:48:08] ------------------------------------------
[00:48:08] 
[00:48:08] ------------------------------------------
[00:48:08] stderr:
[00:48:08] stderr:
[00:48:08] ------------------------------------------
[00:48:08] {"message":"casting `*const U` as `*const V` is invalid","code":{"code":"E0606","explanation":"\nAn incompatible cast was attempted.\n\nErroneous code example:\n\n```compile_fail,E0606\nlet x = &0u8; // Here, `x` is a `&u8`.\nlet y: u32 = x as u32; // error: casting `&u8` as `u32` is invalid\n```\n\nWhen casting, keep in mind that only primitive types can be cast into each\nother. Example:\n\n```\nlet x = &0u8;\nlet y: u32 = *x as u32; // We dereference it first and then cast it.\n```\n\nFor more information about casts, take a look at The Book:\nhttps://doc.rust-lang.org/book/first-edition/casting-between-types.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/mismatched_types/cast-rfc0401.rs","byte_start":533,"byte_end":546,"line_start":13,"line_end":13,"column_start":5,"column_end":18,"is_primary":true,"text":[{"text":"    u as *const V //~ ERROR is invalid","highlight_start":5,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"vtable kinds may not match","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0606]: casting `*const U` as `*const V` is invalid\n  --> /checkout/src/test/ui/mismatched_types/cast-rfc0401.rs:13:5\n   |\nLL |     u as *const V //~ ERROR is invalid\n   |     ^^^^^^^^^^^^^\n   |\n   = note: vtable kinds may not match\n\n"}
[00:48:08] {"message":"casting `*const U` as `*const str` is invalid","code":{"code":"E0606","explanation":"\nAn incompatible cast was attempted.\n\nErroneous code example:\n\n```compile_fail,E0606\nlet x = &0u8; // Here, `x` is a `&u8`.\nlet y: u32 = x as u32; // error: casting `&u8` as `u32` is invalid\n```\n\nWhen casting, keep in mind that only primitive types can be cast into each\nother. Example:\n\n```\nlet x = &0u8;\nlet y: u32 = *x as u32; // We dereference it first and then cast it.\n```\n\nFor more information about casts, take a look at The Book:\nhttps://doc.rust-lang.org/book/first-edition/casting-between-types.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/mismatched_types/cast-rfc0401.rs","byte_start":632,"byte_end":647,"line_start":18,"line_end":18,"column_start":5,"column_end":20,"is_primary":true,"text":[{"text":"    u as *const str //~ ERROR is invalid","highlight_start":5,"highlight_end":20}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"vtable kinds may not match","code":null,"level":"note","spans":[],"605","explanation":"\nAn invalid cast was attempted.\n\nErroneous code examples:\n\n```compile_fail,E0605\nlet x = 0u8;\nx as Vec<u8>; // error: non-primitive cast: `u8` as `std::vec::Vec<u8>`\n\n// Another example\n\nlet v = 0 as *const u8; // So here, `v` is a `*const u8`.\nv as &u8; // error: non-primitive cast: `*const u8` as `&u8`\n```\n\nOnly primitive types can be cast into each other. Examples:\n\n```\nlet x = 0u8;\nx as u32; // ok!\n\nlet v = 0 as *const u8;\nv as *const i8; // ok!\n```\n\nFor more information about casts, take a look at The Book:\nhttps://doc.rust-lang.org/book/first-edition/casting-between-types.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/mismatched_types/cast-rfc0401.rs","byte_start":1029,"byte_end":1037,"line_start":39,"line_end":39,"column_start":13,"column_end":21,"is_primary":true,"text":[{"text":"    let _ = v as &u8; //~ ERROR non-primitive cast","highlight_start":13,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"an `as` expression can only be used to convert between primitive types. Consider using the `From` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0605]: non-primitive cast: `*const u8` as `&u8`\n  --> /checkout/src/test/ui/mismatched_types/cast-rfc0401.rs:39:13\n   |\nLL |     let _ = v as &u8; //~ ERROR non-primitive cast\n   |             ^^^^^^^^\n   |\n   = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait\n\n"}
[00:48:08] {"message":"non-primitive cast: `*age":"non-primitive cast: `*const u8` as `fn()`","code":{"code":"E0605","explanation":"\nAn invalid cast was attempted.\n\nErroneous code examples:\n\n```compile_fail,E0605\nlet x = 0u8;\nx as Vec<u8>; // error: non-primitive cast: `u8` as `std::vec::Vec<u8>`\n\n// Another example\n\nlet v = 0 as *const u8; // So here, `v` is a `*const u8`.\nv as &u8; // error: non-primitive cast: `*const u8` as `&u8`\n```\n\nOnly primitive types can be cast into each other. Examples:\n\n```\nlet x = 0u8;\nx as u32; // ok!\n\nlet v = 0 as *const u8;\nv as *const i8; // ok!\n```\n\nFor more information about casts, take a look at The Book:\nhttps://doc.rust-lang.org/book/first-edition/casting-between-types.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/mismatched_types/cast-rfc0401.rs","byte_start":1129,"byte_end":1138,"line_start":41,"line_end":41,"column_start":13,"column_end":22,"is_primary":true,"text":[{"text":"    let _ = v as fn(); //~ ERROR non-primitive cast","highlight_start":13,"highlight_end":22}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"an `as` expression can only be used to convert between primitive types. Consider using the `From` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0605]: non-primitive cast: `*const u8` as `fn()`\n  --> /checkout/src/test/ui/mismatched_types/cast-rfc0401.rs:41:13\n   |\nLL |     let _ = v as fn(); //~ ERROR non-primitive cast\n   |             ^^^^^^^^^\n   |\n   = note: an `as` expression can only be used to convert between primitive types. Consider usinas *const u8; //~ ERROR non-primitive cast\n   |             ^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: an `as` expression can only be used to convert between primitive types. Consider using the `From` trait\n\n"}
[00:48:08] {"message":"casting `*const u8` as `f32` is invalid","code":{"code":"E0606","explanation":"\nAn incompatible cast was attempted.\n\nErroneous code example:\n\n```compile_fail,E0606\nlet x = &0u8; // Here, `x` is a `&u8`.\nlet y: u32 = x as u32; // error: casting `&u8` as `u32` is invalid\n```\n\nWhen casting, keep in mind that only primitive types can be cast into each\nother. Example:\n\n```\nlet x = &0u8;\nlet y: u32 = *x as u32; // We dereference it first and then cast it.\n```\n\nFor more information about casts, take a look at The Book:\nhttps://doc.rust-lang.org/book/first-edition/casting-between-types.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/mismatched_types/cast-rfc0401.rs","byte_start":1300,"byte_end":1308,"line_start":45,"line_end":45,"column_start":13,"column_end":21,"is_primary":true,"text":[{"text":"    let _ = v as f32; //~ ERROR is invalid","highlight_start":13,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0606]: casting `*const u8` as `f32` is invalid\n  --> /checkout/src/test/ui/mismatched_types/cast-rfc0401.rs:45:13\n   |\nLL |     let _ = v as f32; //~ ERROR is invalid\n   |             ^^^^^^^^\n\n"}
[00:48:08] {"message":"casting `fn() {main}` as `f64` is invalid","code":{"code":"E0606","explanation":"\nAn incompatible cast was attempted.\n\nErroneous code ecast-rfc0401.rs","byte_start":1435,"byte_end":1449,"line_start":48,"line_end":48,"column_start":13,"column_end":27,"is_primary":true,"text":[{"text":"    let _ = f as *const u8; //~ ERROR is invalid","highlight_start":13,"highlight_end":27}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0606]: casting `f32` as `*const u8` is invalid\n  --> /checkout/src/test/ui/mismatched_types/cast-rfc0401.rs:48:13\n   |\nLL |     let _ = f as *const u8; //~ ERROR is invalid\n   |             ^^^^^^^^^^^^^^\n\n"}
[00:48:08] {"message":"cannot cast as `bool`","code":{"code":"E0054","explanation":"\nIt is not allowed to cast to a bool. If you are trying to cast a numeric type\nto a bool, you can compare it with zero instead:\n\n```compile_fail,E0054\nlet x = 5;\n\n// Not allowed, won't compile\nlet x_is_nonzero = x as bool;\n```\n\n```\nlet x = 5;\n\n// Ok\nlet x_is_nonzero = x != 0;\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/mismatched_types/cast-rfc0401.rs","byte_start":1484,"byte_end":1497,"line_start":49,"line_end":49,"column_start":13,"column_end":26,"is_primary":true,"text":[{"text":"    let _ = 3_i32 as bool; //~ ERROR cannot cast","highlight_start":13,"highlight_end":26}],"label":"unsupported cast","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"compare with zero instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0054]: cannot cast as `bool`\n  --> /checkout/src/test/ui/mismatched_types/cast-rfc0401.rs:49:13\n   |\nLL |     let _ = 3_i32 as bool; //~ ERROR cannot cast\n   |             ^^^^^^^^^^^^^ unsupported cast\n   |\n   = help: compare with zero instead\n\n"}
[00:48:08] {"message":"cannot cast as `bool`","code":{"code":"E0054","explanation":"\nIt is not allowed to cast to a bool. If you are trying to cast a numeric type\nto a bool, you can compare it with zero instead:\n\n```compile_fail,E0054\nlet x = 5;\n\n// Not allowed, won't compile\nlet x_is_nonzero = x as bool;\n```\n\n```\nlet x = 5;\n\n// Ok\nlet x_is_nonzero = x != 0;\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/mismatched_types/cast-rfc0401.rs","byte_start":1533,"byte_end":1545,"line_start":50,"line_end":50,"column_start":13,"column_end":25,"is_primary":true,"text":[{"text":"    let _ = E::A as bool; //~ ERROR cannot cast","highlight_start":13,"highlight_end":25}],"label":"unsupported cast","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"compare with zero instead","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0054]: cannot cast as `bool`\n  --> /checkout/src/test/ui/mismatched_types/cast-rfc0401.rs:50:13\n   |\nLL |     let _ = E::A as bool; //~ ERROR cannot cast\n   |             ^^^^^^^^^^^^ unsupported cast\n   |\n   = help: compare with zero instead\n\n"}
[00:48:08] {"message":"only `u8` can be cast as `char`, not `u32`","code":{"code":"E0604","explanation":"\nA cast to `char` was attempted on a type other than `u8`.\n\nErroneous code example:\n\n```compile_fail,E0604\n0u32 as char; // error: only `u8` can be cast as `char`, not `u32`\n```\n\nAs the error message indicates, only `u8` can be cast into `char`. Example:\n\n```\nlet c = 86u8 as char; // ok!\nassert_eq!(c, 'V');\n```\n\nFor more information about casts, take a look at The Book:\nhttps://doc.rust-lang.org/book/first-edition/casting-between-types.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/mismatched_types/cast-rfc0401.rs","byte_start":1581,"byte_end":1596,"line_start":51,"line_end":51,"column_start":13,"column_end":28,"is_primary":true,"text":[{"text":"    let _ = 0x61u32 as char; //~ ERROR can be cast as","highlight_start":13,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0604]: only `u8` can be cast as `char`, not `u32`\n  --> /checkout/src/test/ui/mismatched_types/cast-rfc0401.rs:51:13\n   |\nLL |     let _ = 0x61u32 as char; //~ ERROR can be cast as\n   |             ^^^^^^^^^^^^^^^\n\n"}
[00:48:08] {"message":"casting `bool` as `f32` is invalid","code":{"code":"E0606","explanation":"\nAn incompatible cast was attempted.\n\nErroneous code example:\n\n```compile_fail,E0606\nlet x = &0u8; // Here, `x` is a `&u8`.\nlet y: u32 = x as u32; // error: casting `&u8` as `u32` is invalid\n```\n\nWhen casting, keep in mind that only primitive types can be cast into each\nother. Example:\n\n```\nlet x = &0u8;\nlet y: u32 = *x as u32; // We dereference it first and then cast it.\n```\n\nFor more information about casts, take a look at The Book:\nhttps://doc.rust-lang.org/book/first-edition/casting-between-types.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/mismatched_types/cast-rfc0401.rs","byte_start":1636,"byte_end":1648,"line_start":53,"line_end":53,"column_start":13,"column_end":25,"is_primary":true,"text":[{"text":"    let _ = false as f32; //~ ERROR is invalid","highlight_start":13,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"cast through an integer first","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0606]: casting `bool` as `f32` is invalid\n  --> /checkout/src/test/ui/mismatched_types/cast-rfc0401.rs:53:13\n   |\nLL |     let _ = false as f32; //~ ERROR is invalid\n   |             ^^^^^^^^^^^^\n   |\n   = help: cast through an integer first\n\n"}
[00:48:08] {"message":"casting `E` as `f32` is invalid","code":{"code":"E0606","explanation":"\nAn incompatible cast was attempted.\n\nErroneous code example:\n\n```compile_fail,E0606\nlet x = &0u8; // Here, `x` is a `&u8`.\nlet y: u32 = x as u32; // error: casting `&u8` as `u32` is invalid\n```\n\nWhen casting, keep in mind that only primitive types can be cast into each\nother. Example:\n\n```\nlet x = &0u8;\nlet y: u32 = *x as u32; // We dereference it first and then cast it.\n```\n\nFor more information about casts, take a look at The Book:\nhttps://doc.rust-lang.org/book/first-edition/casting-between-types.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/mismatched_types/cast-rfc0401.rs","byte_start":1683,"byte_end":1694,"line_start":54,"line_end":54,"column_start":13,"column_end":24,"is_primary":true,"text":[{"text":"    let _ = E::A as f32; //~ ERROR is invalid","highlight_start":13pansion":null}],"children":[],"rendered":"error[E0606]: casting `&dyn Foo` as `*const str` is invalid\n  --> /checkout/src/test/ui/mismatched_types/cast-rfc0401.rs:64:13\n   |\nLL |     let _ = foo as *const str; //~ ERROR is invalid\n   |             ^^^^^^^^^^^^^^^^^\n\n"}
[00:48:08] {"message":"casting `&dyn Foo` as `*mut str` is invalid","code":{"code":"E0606","explanation":"\nAn incompatible cast was attempted.\n\nErroneous code example:\n\n```compile_fail,E0606\nlet x = &0u8; // Here, `x` is a `&u8`.\nlet y: u32 = x as u32; // error: casting `&u8` as `u32` is invalid\n```\n\nWhen casting, keep in mind that only primitive types can be cast into each\nother. Example:\n\n```\nlet x = &0u8;\nlet y: u32 = *x as u32; // We dereference it first and then cast it.\n```\n\nFor more information about casts, take a look at The Book:\nhttps://doc.rust-lang.org/book/first-edition/casting-between-types.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/mismatched_types/cast-rfc0401.rs","byte_start":2170,"byte_end":2185,"line_start":65,"line_end":65,"column_start":13,"column_end":28,"is_primary":true,"text":[{"text":"    let _ = foo as *mut str; //~ ERROR is invalid","highlight_start":13,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0606]: casting `&dyn Foo` as `*mut str` is invalid\n  --> /checkout/src/test/ui/mismatched_types/cast-rfc0401.rs:65:13\n   |\nLL |     let _ = foo as *mut str; //~ ERROR is invalid\n   |             ^^^^^^^^^^^^^^^\n\n"}
[00:48:08] {"message":"casting `fn() {main}` as `*mut str` is invalend":2336,"line_start":68,"line_end":68,"column_start":13,"column_end":29,"is_primary":true,"text":[{"text":"    let _ = &f as *const f64; //~ ERROR is invalid","highlight_start":13,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0606]: casting `&f32` as `*const f64` is invalid\n  --> /checkout/src/test/ui/mismatched_types/cast-rfc0401.rs:68:13\n   |\nLL |     let _ = &f as *const f64; //~ ERROR is invalid\n   |             ^^^^^^^^^^^^^^^^\n\n"}
[00:48:08] {"message":"casting `*const [i8]` as `usize` is invalid","code":{"code":"E0606","explanation":"\nAn incompatible cast was attempted.\n\nErroneous code example:\n\n```compile_fail,E0606\nlet x = &0u8; // Here, `x` is a `&u8`.\nlet y: u32 = x as u32; // error: casting `&u8` as `u32` is invalid\n```\n\nWhen casting, keep in mind that only primitive types can be cast into each\nother. Example:\n\n```\nlet x = &0u8;\nlet y: u32 = *x as u32; // We dereference it first and then cast it.\n```\n\nFor more information about casts, take a look at The Book:\nhttps://doc.rust-lang.org/book/first-edition/casting-between-types.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/mismatched_types/cast-rfc0401.rs","byte_start":2371,"byte_end":2386,"line_start":69,"line_end":69,"column_start":13,"column_end":28,"is_primary":true,"text":[{"text":"    let _ = fat_sv as usize; //~ ERROR is invalid","highlight_start":13,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"cast through a thin pointer first","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0606]: casting `*const [i8]` as `usize` is invalid\n  --> /checkout/src/test/ui/mismatched_types/cast-rfc0401.rs:69:13\n   |\nLL |     let _ = fat_sv as usize; //~ ERROR is invalid\n   |             ^^^^^^^^^^^^^^^\n   |\n   = help: cast through a thin pointer first\n\n"}
[00:48:08] {"message":"casting `*const dyn Foo` as `*const [u16]` is invalid","code":{"code":"E0606","explanation":"\nAn incompatible cast was attempted.\n\nErroneous code example:\n\n```compile_fail,E0606\nlet x = &0u8; // Here, `x` is a `&u8`.\nlet y: u32 = x as u32; // error: casting `&u8` as `u32` is invalid\n```\n\nWhen casting, keep in mind that only primitive types can be cast into each\nother. Example:\n\n```\nlet x = &0u8;\nlet y: u32 = *x as u32; // We dereference it first and then cast it.\n```\n\nFor more information about casts, take a look at The Book:\nhttps://doc.rust-lang.org/book/first-edition/casting-between-types.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/mismatched_types/cast-rfc0401.rs","byte_start":2643,"byte_end":2661,"line_start":78,"line_end":78,"column_start":13,"column_end":31,"is_primary":true,"text":[{"text":"    let _ = cf as *const [u16]; //~ ERROR is invalid","highlight_start":13,"highlight_end":31}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"vtable kinds may not match","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0606]: casting `*const dyn Foo` as `*const [u16]` is invalid\n  --> /checkout/src/test/ui/mismatched_types/cast-rfc0401.rs:78:13\n   |\nLL |     let _ = cf as *const [u16]; //~ ERROR is invalid\n   |             ^^^^^^^^^^^^^^^^^^\n   |\n   = note: vtable kinds may not match\n\n"}
[00:48:08] {"message":"casting `*const dyn Foo` as `*const dyn Bar` is invalid","code":{"code":"E0606","explanation":"\nAn incompatible cast was attempted.\n\nErroneous code example:\n\n```compile_fail,E0606\nlet x = &0u8; // Here, `x` is a `&u8`.\nlet y: u32 = x as u32; // error: casting `&u8` as `u32` is invalid\n```\n\nWhen casting, keep in mind that only primitive types can be cast into each\nother. Example:\n\n```\nlet x = &0u8;\nlet y: u32 = *x as u32; // We dereference it first and then cast it.\n```\n\nFor more information about casts, take a look at The Book:\nhttps://doc.rust-lang.org/book/first-edition/casting-between-types.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/mismatched_types/cast-rfc0401.rs","byte_start":2696,"byte_end":2712,"line_start":79,"line_end":79,"column_start":13,"column_end":29,"is_primary":true,"text":[{"text":"    let _ = cf as *const Bar; //~ ERROR is invalid","highlight_start":13,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"vtable kinds may not match","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0606]: casting `*const dyn Foo` as `*const dyn Bar` is invalid\n  --> /checkout/src/test/ui/mismatched_types/cast-rfc0401.rs:79:13\n   |\nLL |     let _ = cf as *const Bar; //~ ERROR is invalid\n   |             ^^^^^^^^^^^^^^^^\n   nction: 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/mismatched_types/cast-rfc0401.rs","byte_start":2041,"byte_end":2046,"line_start":63,"line_end":63,"column_start":13,"column_end":18,"is_primary":true,"text":[{"text":"    let _ = fat_v as *const Foo; //~ ERROR the size for value values of type","highlight_start":13,"highlight_end":18}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the trait `std::marker::Sized` is not implemented for `[u8]`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required for the cast to the object type `dyn Foo`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the size for value values of type `[u8]` cannot be known at compilation time\n  --> /checkout/src/test/ui/mismatched_types/cast-rfc0401.rs:63:13\n   |\nLL |     let _ = fat_v as *const Foo; //~ ERROR the size for value values of type\n   |             ^^^^^ doesn't have a size known at compile-time\n   |\n   = help: the trait `std::marker::Sized` is not implemented for `[u8]`\n   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>\n   = note: required for the cast to the object type `dyn Foo`\n\n"}
[00:48:08] {"message":"the size for value values of type `str` cannot be known at compilation time","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/mismatched_types/cast-rfc0401.rs","byte_start":2456,"byte_end":2457,"line_start":72,"line_end":72,"column_start":13,"col// error: casting `&u8` as `u32` is invalid\n```\n\nWhen casting, keep in mind that only primitive types can be cast into each\nother. Example:\n\n```\nlet x = &0u8;\nlet y: u32 = *x as u32; // We dereference it first and then cast it.\n```\n\nFor more information about casts, take a look at The Book:\nhttps://doc.rust-lang.org/book/first-edition/casting-between-types.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/mismatched_types/cast-rfc0401.rs","byte_start":2765,"byte_end":2773,"line_start":81,"line_end":81,"column_start":30,"column_end":38,"is_primary":true,"text":[{"text":"    vec![0.0].iter().map(|s| s as f32).collect::<Vec<f32>>(); //~ ERROR is invalid","highlight_start":30,"highlight_end":38}],"label":"cannot cast `&{float}` as `f32`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"did you mean `*s`?","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/ui/mismatched_types/cast-rfc0401.rs","byte_start":2765,"byte_end":2766,"line_start":81,"line_end":81,"column_start":30,"column_end":31,"is_primary":true,"text":[{"text":"    vec![0.0].iter().map(|s| s as f32).collect::<Vec<f32>>(); //~ ERROR is invalid","highlight_start":30,"highlight_end":31}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0606]: casting `&{float}` as `f32` is invalid\n  --> /checkout/src/test/ui/mismatched_types/cast-rfc0401.rs:81:30\n   |\nLL |     vec![0.0].iter().map(|s| s as f32).collect::<Vec<f32>>(); //~ ERROR is invalid\n   |                              8:08] 6    |
[00:48:08] -    = help: the trait `std::marker::Sized` is not implemented for `I + 'static`
[00:48:08] +    = help: the trait `std::marker::Sized` is not implemented for `(dyn I + 'static)`
[00:48:08] 8    = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
[00:48:08] 9    = note: all local variables must have a statically known size
[00:48:08] 
[00:48:08] 
[00:48:08] The actual stderr differed from the expected stderr.
[00:48:08] The actual stderr differed from the expected stderr.
[00:48:08] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/resolve/issue-5035-2/issue-5035-2.stderr
[00:48:08] To update references, rerun the tests and pass the `--bless` flag
[00:48:08] To only update this specific test, also pass `--test-args resolve/issue-5035-2.rs`
[00:48:08] error: 1 errors occurred comparing output.
[00:48:08] status: exit code: 101
[00:48:08] status: exit code: 101
[00:48:08] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/resolve/issue-5035-2.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/resolve/issue-5035-2/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/resolve/issue-5035-2/auxiliary" "-A" "unused"
[00:48:08] ------------------------------------------
[00:48:08] 
[00:48:08] ------------------------------------------
[00:48:08] stderr:
[00:48:08] stderr:
[00:4ze","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the size for value values of type `(dyn I + 'static)` cannot be known at compilation time\n  --> /checkout/src/test/ui/resolve/issue-5035-2.rs:14:8\n   |\nLL | fn foo(_x: K) {}\n   |        ^^ doesn't have a size known at compile-time\n   |\n   = help: the trait `std::marker::Sized` is not implemented for `(dyn I + 'static)`\n   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>\n   = note: all local variables must have a statically known size\n\n"}
[00:48:08] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:48:08] {"message":"For more information about this error, try `rustc --explain E0277`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0277`.\n"}
[00:48:08] ------------------------------------------
[00:48:08] 
[00:48:08] thread '[ui] ui/resolve/issue-5035-2.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3139:9
[00:48:08] 
[00:48:08] 
[00:48:08] ---- [ui] ui/unsized-enum2.rs stdout ----
[00:48:08] diff of stderr:
[00:48:08] 
[00:48:08] 82    = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
[00:48:08] 83    = note: no field of an enum variant may have a dynamically sized type
[00:48:08] 84 
[00:48:08] - error[E0277]: the size for value values cally sized type
[00:48:08] 175 
[00:48:08] 175 
[00:48:08] - error[E0277]: the size for value values of type `PathHelper2 + 'static` cannot be known at compilation time
[00:48:08] + error[E0277]: the size for value values of type `(dyn PathHelper2 + 'static)` cannot be known at compilation time
[00:48:08] 177   --> $DIR/unsized-enum2.rs:55:8
[00:48:08] 178    |
[00:48:08] 179 LL |     VJ{x: Path2},
[00:48:08] 
[00:48:08] 180    |        ^^^^^^^^ doesn't have a size known at compile-time
[00:48:08] 181    |
[00:48:08] -    = help: within `Path2`, the trait `std::marker::Sized` is not implemented for `PathHelper2 + 'static`
[00:48:08] +    = help: within `Path2`, the trait `std::marker::Sized` is not implemented for `(dyn PathHelper2 + 'static)`
[00:48:08] 183    = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>
[00:48:08] 184    = note: required because it appears within the type `Path2`
[00:48:08] 185    = note: no field of an enum variant may have a dynamically sized type
[00:48:08] 186 
[00:48:08] 186 
[00:48:08] - error[E0277]: the size for value values of type `PathHelper3 + 'static` cannot be known at compilation time
[00:48:08] + error[E0277]: the size for value values of type `(dyn PathHelper3 + 'static)` cannot be known at compilation time
[00:48:08] 188   --> $DIR/unsized-enum2.rs:57:15
[00:48:08] 189    |
[00:48:08] 190 LL |     VK(isize, Path3),
[00:48:08] 
[00:48:08] 191    |               ^^^^^ doesn't have a size known at compile-time
[00:48:08] 192    |
[00:48:08] -    = help: within `Path3`, the trait `std:err differed from the expected stderr.
[00:48:08] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/unsized-enum2/unsized-enum2.stderr
[00:48:08] To update references, rerun the tests and pass the `--bless` flag
[00:48:08] To only update this specific test, also pass `--test-args unsized-enum2.rs`
[00:48:08] error: 1 errors occurred comparing output.
[00:48:08] status: exit code: 101
[00:48:08] status: exit code: 101
[00:48:08] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/unsized-enum2.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/unsized-enum2/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/unsized-enum2/auxiliary" "-A" "unused"
[00:48:08] ------------------------------------------
[00:48:08] 
[00:48:08] ------------------------------------------
[00:48:08] stderr:
[00:48:08] stderr:
[00:48:08] ------------------------------------------
[00:48:08] {"message":"the size for value values of type `W` cannot be known at compilation time","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   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/unsized-enum2.rs","byte_start":960,"byte_end":961,"line_start":33,"line_end":33,"column_start":8,"column_end":9,"is_primary":true,"text":[{"text":"    VA(W),","highlight_start":8,"highlight_end":9}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the trait `std::marker::Sized` is not implemented for `W`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"consider adding a `where W: std::marker::Sized` bound","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"no field of an enum variant may have a dynamically sized type","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the size for value values of type `W` cannot be known at compilation time\n  --> /checkout/src/test/ui/unsized-enum2.rs:33:8\n   |\nLL |     VA(W),\n   |        ^ doesn't have a size known at compile-time\n   |\n   = help: the trait `std::marker::Sized` is not implemented for `W`\n   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>\n   = help: consider adding a `where W: std::marker::Sized` bound\n   = note: no field of an enum variant may have a dynamically sized type\n\n"}
[00:48:08] {"message":"the size for value values of type `X` cannot be known at compilation time","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 calld>","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"consider adding a `where X: std::marker::Sized` bound","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"no field of an enum variant may have a dynamically sized type","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the size for value values of type `X` cannot be known at compilation time\n  --> /checkout/src/test/ui/unsized-enum2.rs:35:8\n   |\nLL |     VB{x: X},\n   |        ^^^^ doesn't have a size known at compile-time\n   |\n   = help: the trait `std::marker::Sized` is not implemented for `X`\n   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>\n   = help: consider adding a `where X: std::marker::Sized` bound\n   = note: no field of an enum variant may have a dynamically sized type\n\n"}
[00:48:08] {"message":"the size for value values of type `Y` cannot be known at compilation time","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/unsized-enum2.rs","byte_start":1090,"byte_end":1091,"line_start":37,"line_end":37,"column_start":15,"column_end":16,"is_primary":true,"text":[{"text":"    VC(isize, Y),","highlight_start":15,"highlight_end":16}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the trait `std::marker::Sized` is not implemented for `Y`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"consider adding a `where Y: std::marker::Sized` bound","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"no field of an enum variant may have a dynamically sized type","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the size for value values of type `Y` cannot be known at compilation time\n  --> /checkout/src/test/ui/unsized-enum2.rs:37:15\n   |\nLL |     VC(isize, Y),\n   |               ^ doesn't have a size known at compile-time\n   |\n   = help: the trait `std::marker::Sized` is not implemented for `Y`\n   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>\n   = help: consider adding a `where Y: std::marker::Sized` bound\n   = note: no field of an enum variant may have a dynamically sized type\n\n"}
[00:48:08] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[00:48:08] {"message":"the size for value values of type `Z` cannot be known at compilation time","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    sosize known at compile-time\n   |\n   = help: the trait `std::marker::Sized` is not implemented for `str`\n   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>\n   = note: no field of an enum variant may have a dynamically sized type\n\n"}
[00:48:08] {"message":"the size for value values of type `[f32]` cannot be known at compilation time","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\ou'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/unsized-enum2.rs","byte_start":1452,"byte_end":1460,"line_start":49,"line_end":49,"column_start":18,"column_end":26,"is_primary":true,"text":[{"text":"    VH{u: isize, x: [u32]},","highlight_start":18,"highlight_end":26}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the trait `std::marker::Sized` is not implemented for `[u32]`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"no field of an enum variant may have a dynamically sized type","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the size for value values of type `[u32]` cannot be known at compilation time\n  --> /checkout/src/test/ui/unsized-enum2.rs:49:18\n   |\nLL |     VH{u: isize, x: [u32]},\n   |                  ^^^^^^^^ doesn't have a size known at compile-time\n   |\n   = help: the trait `std::marker::Sized` is not implemented for `[u32]`\n   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>\n   = note: no field of an enum variant may have a dynamically sized type\n\n"}
[00:48:08] {"message":"the size for value values of type `(dyn Foo + 'static)` cannot be known at compilation time","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 compileui/unsized-enum2.rs:63:8\n   |\nLL |     VM(Foo),\n   |        ^^^ doesn't have a size known at compile-time\n   |\n   = help: the trait `std::marker::Sized` is not implemented for `(dyn Foo + 'static)`\n   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>\n   = note: no field of an enum variant may have a dynamically sized type\n\n"}
[00:48:08] {"message":"the size for value values of type `(dyn Bar + 'static)` cannot be known at compilation time","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/unsized-enum2.rs","byte_start":1903,"byte_end":1909,"line_start":65,"line_end":65,"column_start":8,"column_end":14,"is_primary":true,"text":[{"text":"    VN{x: Bar},","highlight_start":8,"highlight_end":14}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the trait `std::marker::Sized` is not implemente 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 ted type\n\n"}
[00:48:08] {"message":"the size for value values of type `(dyn BarFoo + 'static)` cannot be known at compilation time","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/unsized-enum2.rs","byte_start":2050,"byte_end":2059,"line_start":69,"line_end":69,"column_start":18,"column_end":27,"is_primary":true,"text":[{"text":"    VP{u: isize, x: BarFoo},","highlight_start":18,"highlight_end":27}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the trait `std::marker::Sized` is not implemented for `(dyn BarFoo + 'static)`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"no field of an enum variant may have a dynamically sized type","codref>::Target),","highlight_start":8,"highlight_end":40}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the trait `std::marker::Sized` is not implemented for `[i8]`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"no field of an enum variant may have a dynamically sized type","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the size for value values of type `[i8]` cannot be known at compilation time\n  --> /checkout/src/test/ui/unsized-enum2.rs:73:8\n   |\nLL |     VQ(<&'static [i8] as Deref>::Target),\n   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time\n   |\n   = help: the trait `std::marker::Sized` is not implemented for `[i8]`\n   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>\n   = note: no field of an enum variant may have a dynamically sized type\n\n"}
[00:48:08] {"message":"the size for value values of type `[char]` cannot be known at compilation time","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  p: the trait `std::marker::Sized` is not implemented for `[char]`\n   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>\n   = note: no field of an enum variant may have a dynamically sized type\n\n"}
[00:48:08] {"message":"the size for value values of type `[f64]` cannot be known at compilation time","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                           //        ifor every type parameter.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/unsized-enum2.rs","byte_start":2432,"byte_end":2468,"line_start":79,"line_end":79,"column_start":18,"column_end":54,"is_primary":true,"text":[{"text":"    VT{u: isize, x: <&'static [i32] as Deref>::Target},","highlight_start":18,"highlight_end":54}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the trait `std::marker::Sized` is not implemented for `[i32]`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"no field of an enum variant may have a dynamically sized type","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the size for value values of type `[i32]` cannot be known at compilation time\n  --> /checkout/src/test/ui/unsized-enum2.rs:79:18\n   |\nLL |     VT{u: isize, x: <&'static [i32] as Deref>::Target},\n   |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time\n   |\n   = help: the trait `std::marker::Sized` is not implemented for `[i32]`\n   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>\n   = note: no field of an enum variant may have a dynamically sized type\n\n"}
[00:48:08] {"message":"the size for value ent `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/unsized-enum2.rs","byte_start":1542,"byte_end":1547,"line_start":53,"line_end":53,"column_start":8,"column_end":13,"is_primary":true,"text":[{"text":"    VI(Path1),","highlight_start":8,"highlight_end":13}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"within `Path1`, the trait `std::marker::Sized` is not implemented for `(dyn PathHelper1 + 'static)`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `Path1`","code":null,"level":"note","spans":[],"children":[],"rendered``\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/unsized-enum2.rs","byte_start":1606,"byte_end":1614,"line_start":55,"line_end":55,"column_start":8,"column_end":16,"is_primary":true,"text":[{"text":"    VJ{x: Path2},","highlight_start":8,"highlight_end":16}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"within `Path2`, the trait `std::marker::Sized` is not implemented for `(dyn PathHelper2 + 'static)`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `Path2`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"no field of an enum variant may have a dynamically sized type","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the size for value values of type `(dyn PathHelper2 + 'static)` cannot be known at compilation time\n  --> /checkout/src/test/ui/unsized-enum2.rs:55:8\n   |\nLL |     VJ{x: Path2},\n   |        ^^^^^^^^ doesn't have a size known at compile-time\n   |\n   = help: within `Path2`, the trait `std::marker::Sized` is not implemented for `(dyn PathHelper2 + 'static)`\n   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>\n   = note: required because it appears within the type `Path2`\n   = note: no field of an enum variant m be used for every type parameter.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/unsized-enum2.rs","byte_start":1754,"byte_end":1762,"line_start":59,"line_end":59,"column_start":18,"column_end":26,"is_primary":true,"text":[{"text":"    VL{u: isize, x: Path4},","highlight_start":18,"highlight_end":26}],"label":"doesn't have a size known at compile-time","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"within `Path4`, the trait `std::marker::Sized` is not implemented for `(dyn PathHelper4 + 'static)`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized>","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `Path4`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"no field of an enum variant may have a dynamically sized type","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the size for value values of type `(dyn PathHelper4 + 'static)` cannot be known at compilation time\n  --> /checkout/src/test/ui/unsized-enum2.rs:59:18\n   |\nLL |     VL{u: isize, x: Path4},\n   |                  ^^^^^^^^ doesn't have a size known at compile-time\n   |\n   = help: within `Path4`, the trait `std::marker::Sized` is not implemented for `(dyn PathHelper4 + 'static)`\n   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.htm/x86_64-unknown-linux-gnu
56088 ./obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/bin
51360 ./obj/build/x86_64-unknown-linux-gnu/stage0/bin
50808 ./obj/build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps
48756 ./src/test

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)

The `dyn Trait` syntax was stabilized in 199ee32. Resolves rust-lang#49277.
@zackmdavis
Copy link
Member Author

@nikomatsakis rebased 🏁

@nikomatsakis
Copy link
Contributor

@bors r+

@bors
Copy link
Contributor

bors commented Jun 25, 2018

📌 Commit 4b18085 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 25, 2018
@bors
Copy link
Contributor

bors commented Jun 26, 2018

⌛ Testing commit 4b18085 with merge 9b4bd1dfe1d2889a24b16f6f4a62dc13ba254c8b...

@bors
Copy link
Contributor

bors commented Jun 26, 2018

💔 Test failed - status-travis

@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-tools 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.
  0     0    0     0    0     0      0      0 --:--:--  0:00:51 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:52 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:53 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:54 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:55 --:--:--     0curl: (6) Could not resolve host: s3-us-west-1.amazonaws.com
[00:58:01] thread 'main' panicked at 'failed to download openssl source: exit code: 6', bootstrap/native.rs:589:17
[00:58:01] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --no-fail-fast src/doc/book src/doc/nomicon src/doc/reference src/doc/rust-by-example src/tools/rls src/tools/rustfmt src/tools/miri src/tools/clippy
[00:58:01] Build completed unsuccessfully in 0:55:04
[00:58:01] {"nomicon":"test-pass","rust-by-example":"test-pass","miri":"test-pass","clippy-driver":"test-pass","book":"test-pass","rls":"test-pass","reference":"test-pass","rustfmt":"test-pass"}
[00:58:01] Verifying status of book...
---
travis_time:end:2b614c90:start=1529996220523411078,finish=1529996220531583776,duration=8172698
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:2685269d
$ head -30 ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
head: cannot open ‘./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers’ for reading: No such file or directory
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:063eaa32
$ dmesg | grep -i kill

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 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 26, 2018
@rust-highfive
Copy link
Collaborator

The job x86_64-gnu-tools 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.
  0     0    0     0    0     0      0      0 --:--:--  0:00:51 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:52 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:53 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:54 --:--:--     0
  0     0    0     0    0     0      0      0 --:--:--  0:00:55 --:--:--     0curl: (6) Could not resolve host: s3-us-west-1.amazonaws.com
[00:58:01] thread 'main' panicked at 'failed to download openssl source: exit code: 6', bootstrap/native.rs:589:17
[00:58:01] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --no-fail-fast src/doc/book src/doc/nomicon src/doc/reference src/doc/rust-by-example src/tools/rls src/tools/rustfmt src/tools/miri src/tools/clippy
[00:58:01] Build completed unsuccessfully in 0:55:04
[00:58:01] {"nomicon":"test-pass","rust-by-example":"test-pass","miri":"test-pass","clippy-driver":"test-pass","book":"test-pass","rls":"test-pass","reference":"test-pass","rustfmt":"test-pass"}
[00:58:01] Verifying status of book...
---
travis_time:end:2b614c90:start=1529996220523411078,finish=1529996220531583776,duration=8172698
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:2685269d
$ head -30 ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
head: cannot open ‘./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers’ for reading: No such file or directory
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:063eaa32
$ dmesg | grep -i kill

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)

@pietroalbini
Copy link
Member

@bors retry travis-ci/travis-ci#9696

@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 26, 2018
pietroalbini added a commit to pietroalbini/rust that referenced this pull request Jun 26, 2018
add `dyn ` to display of dynamic (trait) types

~~I'm not sure we want the `dyn` in the E0277 "trait bound [...] is not satisfied" messages ("bound" sounds like a different thing in contrast to the names of specific trait-object types like `Box<dyn Trait>`), but I'm finding the code I would need to change that hard to follow—the [display object seems to](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/traits/error_reporting.rs#L600) be a [`Predicate::Trait`](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/ty/mod.rs#L962) variant, whose [`Display` implementation](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/util/ppaux.rs#L1309) calls `.print` on its `PolyTraitPredicate` member, [which is a type alias](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/ty/mod.rs#L1112) for `ty::Binder<TraitPredicate<'tcx>>`, whose [`Display` implementation](https://github.com/rust-lang/rust/blob/f0805a4421449bd6fe3096d63820fbebe2bfcd1d/src/librustc/util/ppaux.rs#L975-L985) ... _&c._— so maybe it's time to pull-request this and see what reviewers think.~~

 Resolves rust-lang#49277 (?).

r? @nikomatsakis
bors added a commit that referenced this pull request Jun 26, 2018
Rollup of 11 pull requests

Successful merges:

 - #51104 (add `dyn ` to display of dynamic (trait) types)
 - #51153 (Link panic and compile_error docs)
 - #51642 (Fix unknown windows build)
 - #51730 (New safe associated functions for PinMut)
 - #51731 (Fix ICEs when using continue as an array length inside closures (inside loop conditions))
 - #51747 (Add error for using null characters in #[export_name])
 - #51769 (Update broken rustc-guide links)
 - #51786 (Remove unnecessary stat64 pointer casts)
 - #51788 (Fix typo)
 - #51789 (Don't ICE when performing `lower_pattern_unadjusted` on a `TyError`)
 - #51791 (Minify css)

Failed merges:

r? @ghost
@bors
Copy link
Contributor

bors commented Jun 26, 2018

⌛ Testing commit 4b18085 with merge 764232c...

@bors bors merged commit 4b18085 into rust-lang:master Jun 26, 2018
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.

7 participants