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

Ban multi-trait objects via trait aliases #59445

Merged
merged 12 commits into from May 22, 2019

Conversation

@alexreg
Copy link
Contributor

commented Mar 26, 2019

Obviously, multi-trait objects are not normally supported, so they should not be supported via trait aliases.

This has been factored out from the previous PR #55994 (see point 1).

r? @Centril

CC @nikomatsakis


RELNOTES:

We now allow dyn Send + fmt::Debug with equivalent semantics to dyn fmt::Debug + Send.
That is, the order of the mentioned traits does not matter wrt. principal/not-principal traits.
This is a small change that might deserve a mention in the blog post because it is a language change but most likely not.

See https://github.com/rust-lang/rust/blob/ce2ee305f9165c037ecddddb5792588a15ff6c37/src/test/ui/traits/wf-trait-object-reverse-order.rs.

// @Centril

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Mar 26, 2019

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

Click to expand the log.
travis_time:end:07ebd702:start=1553624941335229273,finish=1553624943279228577,duration=1943999304
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
Setting environment variables from .travis.yml
---

[00:04:05] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:04:06] tidy error: /checkout/src/librustc_typeck/astconv.rs:1159: line longer than 100 chars
[00:04:07] some tidy checks failed
[00:04:07] 
[00:04:07] 
[00:04:07] 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:07] 
[00:04:07] 
[00:04:07] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:04:07] Build completed unsuccessfully in 0:00:44
[00:04:07] Build completed unsuccessfully in 0:00:44
[00:04:07] make: *** [tidy] Error 1
[00:04:07] Makefile:67: recipe for target 'tidy' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:153d614d
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Tue Mar 26 18:33:21 UTC 2019
---
travis_time:end:006ff070:start=1553625202197009039,finish=1553625202201868992,duration=4859953
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:00e17ebb
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:02ae76e1
travis_time:start:02ae76e1
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:1234dc88
$ 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)

@crlf0710

This comment was marked as off-topic.

Copy link
Contributor

commented Mar 26, 2019

Well, According to RFC 1733, trait-alias generated trait objects are actually explicitly allowed by design.

But i'm not familiar with the actual code and i'm sure if this is the time for implementing it either.

@alexreg

This comment was marked as off-topic.

Copy link
Contributor Author

commented Mar 27, 2019

@crlf0710 No, you misunderstand, I think. This is about multi-trait objects. That means multiple non-auto traits. To reference the RFC:

it contains an object safe trait, optionally a lifetime, and zero or more of these other bounds: Send, Sync (that is, trait Show = Display + Debug; would not be object safe);

@alexreg alexreg force-pushed the alexreg:ban-multi-trait-objects-via-aliases branch from ce751e4 to e728b8d Mar 27, 2019

@crlf0710

This comment was marked as off-topic.

Copy link
Contributor

commented Mar 27, 2019

I misunderstood, sorry.

@alexreg

This comment was marked as off-topic.

Copy link
Contributor Author

commented Mar 27, 2019

@crlf0710 No problem. You can still use trait objects just fine via trait aliases. :-) Eventually, we intend to support multi-trait objects though, which will be usable regardless of trait objects.

@Centril
Copy link
Member

left a comment

Implementation looks mostly good aside from comments below... The diagnostics look great.

However, I think some more tests are needed. In particular, it would be nice to exercise the recursive behavior here including things like dyn A + B where trait A = C + D;, trait B = E + F, trait F = G + 'static; and various other combinations including auto traits, region constraints, where clauses on the trait alias, and so on.

Show resolved Hide resolved src/librustc/traits/mod.rs Outdated
Show resolved Hide resolved src/librustc/traits/util.rs Outdated
Show resolved Hide resolved src/librustc/traits/util.rs Outdated
Show resolved Hide resolved src/librustc/traits/util.rs Outdated
Show resolved Hide resolved src/librustc/traits/util.rs Outdated
Show resolved Hide resolved src/librustc/traits/util.rs Outdated
Show resolved Hide resolved src/librustc_typeck/astconv.rs Outdated
Show resolved Hide resolved src/librustc_typeck/astconv.rs Outdated
Show resolved Hide resolved src/librustc_typeck/astconv.rs Outdated
Show resolved Hide resolved src/librustc_typeck/astconv.rs

@alexreg alexreg force-pushed the alexreg:ban-multi-trait-objects-via-aliases branch from 47d6cd3 to c0ef111 Mar 27, 2019

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

commented Mar 27, 2019

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

Click to expand the log.
travis_time:end:011897ee:start=1553701624369405860,finish=1553701758206305691,duration=133836899831
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
Setting environment variables from .travis.yml
---
[01:12:33] .................................................................................................... 900/5496
[01:12:38] .i...............i.................................................................................. 1000/5496
[01:12:42] .................................iiiii.............................................................. 1100/5496
[01:12:45] .................................................................................................... 1200/5496
[01:12:47] ...........................................F........................................................ 1300/5496
[01:12:53] .................................................................................................... 1500/5496
[01:12:56] .................................................................................................... 1600/5496
[01:13:00] ..........................................i......................................................... 1700/5496
[01:13:03] .................................................................................................... 1800/5496
---
[01:15:25] 
[01:15:25] ---- [ui] ui/error-codes/E0225.rs stdout ----
[01:15:25] diff of stderr:
[01:15:25] 
[01:15:25] 11    |                             -------------- non-auto additional trait
[01:15:25] 12 ...
[01:15:25] 13 LL |     let _: Box<Foo>;
[01:15:25] +    |                ^^^ expanded from this trait alias
[01:15:25] 15 
[01:15:25] 16 error: aborting due to 2 previous errors
[01:15:25] 17 
[01:15:25] 17 
[01:15:25] 
[01:15:25] 
[01:15:25] The actual stderr differed from the expected stderr.
[01:15:25] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/error-codes/E0225/E0225.stderr
[01:15:25] To update references, rerun the tests and pass the `--bless` flag
[01:15:25] To only update this specific test, also pass `--test-args error-codes/E0225.rs`
[01:15:25] error: 1 errors occurred comparing output.
[01:15:25] status: exit code: 1
[01:15:25] status: exit code: 1
[01:15:25] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/error-codes/E0225.rs" "-Zthreads=1" "--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/error-codes/E0225/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/error-codes/E0225/auxiliary" "-A" "unused"
[01:15:25] ------------------------------------------
[01:15:25] 
[01:15:25] ------------------------------------------
[01:15:25] stderr:
[01:15:25] stderr:
[01:15:25] ------------------------------------------
[01:15:25] {"message":"only auto traits can be used as additional traits in a trait object","code":{"code":"E0225","explanation":"\nYou attempted to use multiple types as bounds for a closure or trait object.\nRust does not currently support this. A simple example that causes this error:\n\n```compile_fail,E0225\nfn main() {\n    let _: Box<dyn std::io::Read + std::io::Write>;\n}\n```\n\nAuto traits such as Send and Sync are an exception to this rule:\nIt's possible to have bounds of one non-builtin trait, plus any number of\nauto traits. For example, the following compiles correctly:\n\n```\nfn main() {\n    let _: Box<dyn std::io::Read + Send + Sync>;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/error-codes/E0225.rs","byte_start":114,"byte_end":128,"line_start":6,"line_end":6,"column_start":32,"column_end":46,"is_primary":true,"text":[{"text":"    let _: Box<std::io::Read + std::io::Write>;","highlight_start":32,"highlight_end":46}],"label":"non-auto additional trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0225]: only auto traits can be used as additional traits in a trait object\n  --> /checkout/src/test/ui/error-codes/E0225.rs:6:32\n   |\nLL |     let _: Box<std::io::Read + std::io::Write>;\n   |                                ^^^^^^^^^^^^^^ non-auto additional trait\n\n"}
[01:15:25] {"message":"only auto traits can be used as additional traits in a trait object","code":{"code":"E0225","explanation":"\nYou attempted to use multiple types as bounds for a closure or trait object.\nRust does not currently support this. A simple example that causes this error:\n\n```compile_fail,E0225\nfn main() {\n    let _: Box<dyn std::io::Read + std::io::Write>;\n}\n```\n\nAuto traits such as Send and Sync are an exception to this rule:\nIt's possible to have bounds of one non-builtin trait, plus any number of\nauto traits. For example, the following compiles correctly:\n\n```\nfn main() {\n    let _: Box<dyn std::io::Read + Send + Sync>;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/error-codes/E0225.rs","byte_start":54,"byte_end":68,"line_start":3,"line_end":3,"column_start":29,"column_end":43,"is_primary":false,"text":[{"text":"trait Foo = std::io::Read + std::io::Write;","highlight_start":29,"highlight_end":43}],"label":"non-auto additional trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/error-codes/E0225.rs","byte_start":237,"byte_end":240,"line_start":8,"line_end":8,"column_start":16,"column_end":19,"is_primary":true,"text":[{"text":"    let _: Box<Foo>;","highlight_start":16,"highlight_end":19}],"label":"expanded from this trait alias","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0225]: only auto traits can be used as additional traits in a trait object\n  --> /checkout/src/test/ui/error-codes/E0225.rs:8:16\n   |\nLL | trait Foo = std::io::Read + std::io::Write;\n   |                             -------------- non-auto additional trait\n...\nLL |     let _: Box<Foo>;\n   |                ^^^ expanded from this trait alias\n\n"}
[01:15:25] {"message":"For more information about this error, try `rustc --explain E0225`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0225`.\n"}
[01:15:25] 
[01:15:25] ------------------------------------------
[01:15:25] 
---
[01:15:25] 
[01:15:25] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:496:22
[01:15:25] 
[01:15:25] 
[01:15:25] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--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" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:15:25] 
[01:15:25] 
[01:15:25] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:15:25] Build completed unsuccessfully in 0:04:24
[01:15:25] Build completed unsuccessfully in 0:04:24
[01:15:25] Makefile:48: recipe for target 'check' failed
[01:15:25] make: *** [check] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:1386d7bc
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Wed Mar 27 17:04:53 UTC 2019
---
travis_time:end:089ff304:start=1553706294481004769,finish=1553706294486440948,duration=5436179
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:09ec725c
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:036c9426
travis_time:start:036c9426
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:1b60872a
$ 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

This comment was marked as outdated.

Copy link
Collaborator

commented Mar 28, 2019

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

Click to expand the log.
travis_time:end:03778b28:start=1553739625492736934,finish=1553739733789804069,duration=108297067135
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
Setting environment variables from .travis.yml
---
[01:13:01] .................................................................................................... 900/5496
[01:13:07] .i...............i.................................................................................. 1000/5496
[01:13:10] .................................iiiii.............................................................. 1100/5496
[01:13:14] .................................................................................................... 1200/5496
[01:13:16] ............................................F....................................................... 1300/5496
[01:13:22] .................................................................................................... 1500/5496
[01:13:25] .................................................................................................... 1600/5496
[01:13:28] ..........................................i......................................................... 1700/5496
[01:13:32] .................................................................................................... 1800/5496
---
[01:15:55] 
[01:15:55] ---- [ui] ui/error-codes/E0225.rs stdout ----
[01:15:55] diff of stderr:
[01:15:55] 
[01:15:55] 11    |                             -------------- non-auto additional trait
[01:15:55] 12 ...
[01:15:55] 13 LL |     let _: Box<Foo>;
[01:15:55] +    |                ^^^ expanded from this trait alias
[01:15:55] 15 
[01:15:55] 16 error: aborting due to 2 previous errors
[01:15:55] 17 
[01:15:55] 17 
[01:15:55] 
[01:15:55] 
[01:15:55] The actual stderr differed from the expected stderr.
[01:15:55] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/error-codes/E0225/E0225.stderr
[01:15:55] To update references, rerun the tests and pass the `--bless` flag
[01:15:55] To only update this specific test, also pass `--test-args error-codes/E0225.rs`
[01:15:55] error: 1 errors occurred comparing output.
[01:15:55] status: exit code: 1
[01:15:55] status: exit code: 1
[01:15:55] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/error-codes/E0225.rs" "-Zthreads=1" "--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/error-codes/E0225/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/error-codes/E0225/auxiliary" "-A" "unused"
[01:15:55] ------------------------------------------
[01:15:55] 
[01:15:55] ------------------------------------------
[01:15:55] stderr:
[01:15:55] stderr:
[01:15:55] ------------------------------------------
[01:15:55] {"message":"only auto traits can be used as additional traits in a trait object","code":{"code":"E0225","explanation":"\nYou attempted to use multiple types as bounds for a closure or trait object.\nRust does not currently support this. A simple example that causes this error:\n\n```compile_fail,E0225\nfn main() {\n    let _: Box<dyn std::io::Read + std::io::Write>;\n}\n```\n\nAuto traits such as Send and Sync are an exception to this rule:\nIt's possible to have bounds of one non-builtin trait, plus any number of\nauto traits. For example, the following compiles correctly:\n\n```\nfn main() {\n    let _: Box<dyn std::io::Read + Send + Sync>;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/error-codes/E0225.rs","byte_start":114,"byte_end":128,"line_start":6,"line_end":6,"column_start":32,"column_end":46,"is_primary":true,"text":[{"text":"    let _: Box<std::io::Read + std::io::Write>;","highlight_start":32,"highlight_end":46}],"label":"non-auto additional trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0225]: only auto traits can be used as additional traits in a trait object\n  --> /checkout/src/test/ui/error-codes/E0225.rs:6:32\n   |\nLL |     let _: Box<std::io::Read + std::io::Write>;\n   |                                ^^^^^^^^^^^^^^ non-auto additional trait\n\n"}
[01:15:55] {"message":"only auto traits can be used as additional traits in a trait object","code":{"code":"E0225","explanation":"\nYou attempted to use multiple types as bounds for a closure or trait object.\nRust does not currently support this. A simple example that causes this error:\n\n```compile_fail,E0225\nfn main() {\n    let _: Box<dyn std::io::Read + std::io::Write>;\n}\n```\n\nAuto traits such as Send and Sync are an exception to this rule:\nIt's possible to have bounds of one non-builtin trait, plus any number of\nauto traits. For example, the following compiles correctly:\n\n```\nfn main() {\n    let _: Box<dyn std::io::Read + Send + Sync>;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/error-codes/E0225.rs","byte_start":54,"byte_end":68,"line_start":3,"line_end":3,"column_start":29,"column_end":43,"is_primary":false,"text":[{"text":"trait Foo = std::io::Read + std::io::Write;","highlight_start":29,"highlight_end":43}],"label":"non-auto additional trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/error-codes/E0225.rs","byte_start":237,"byte_end":240,"line_start":8,"line_end":8,"column_start":16,"column_end":19,"is_primary":true,"text":[{"text":"    let _: Box<Foo>;","highlight_start":16,"highlight_end":19}],"label":"expanded from this trait alias","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0225]: only auto traits can be used as additional traits in a trait object\n  --> /checkout/src/test/ui/error-codes/E0225.rs:8:16\n   |\nLL | trait Foo = std::io::Read + std::io::Write;\n   |                             -------------- non-auto additional trait\n...\nLL |     let _: Box<Foo>;\n   |                ^^^ expanded from this trait alias\n\n"}
[01:15:55] {"message":"For more information about this error, try `rustc --explain E0225`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0225`.\n"}
[01:15:55] 
[01:15:55] ------------------------------------------
[01:15:55] 
---
[01:15:55] 
[01:15:55] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:496:22
[01:15:55] 
[01:15:55] 
[01:15:55] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--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" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:15:55] 
[01:15:55] 
[01:15:55] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:15:55] Build completed unsuccessfully in 0:04:29
[01:15:55] Build completed unsuccessfully in 0:04:29
[01:15:55] make: *** [check] Error 1
[01:15:55] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:04079f40
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Thu Mar 28 03:38:18 UTC 2019

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)

@@ -1175,14 +1198,13 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
} else {
self.re_infer(span, None).unwrap_or_else(|| {
span_err!(tcx.sess, span, E0228,
"the lifetime bound for this object type cannot be deduced \
from context; please supply an explicit bound");
"the lifetime bound for this object type cannot be deduced \

This comment has been minimized.

Copy link
@Centril

Centril Mar 30, 2019

Member
Suggested change
"the lifetime bound for this object type cannot be deduced \
"the lifetime bound for this object type cannot be inferred \

while reading this PR again, I noticed this... we use "infer" elsewhere and so we should prefer that everywhere instead of C++isms like "deduce".

This comment has been minimized.

Copy link
@alexreg

alexreg Mar 30, 2019

Author Contributor

That should be a separate PR I think. You're welcome to make it though, and I can review. ;-)

This comment has been minimized.

Copy link
@Centril

Centril Mar 30, 2019

Member

@alexreg Sure; leaving it here (unresolved) for visibility and as a reminder ;)

This comment has been minimized.

Copy link
@alexreg

alexreg May 20, 2019

Author Contributor

@Centril With this PR merging now, just a note for you that this is unresolved, in case you want to create an issue or PR for it yourself.

@alexreg alexreg force-pushed the alexreg:ban-multi-trait-objects-via-aliases branch from a54c090 to 50871cb Mar 31, 2019

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Mar 31, 2019

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

Click to expand the log.
travis_time:end:231cb2a2:start=1554048269416135751,finish=1554048270381977278,duration=965841527
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
Setting environment variables from .travis.yml
---

[00:04:20] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:04:21] tidy error: /checkout/src/librustc/ty/query/mod.rs:152: line longer than 100 chars
[00:04:22] some tidy checks failed
[00:04:22] 
[00:04:22] 
[00:04:22] 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:22] 
[00:04:22] 
[00:04:22] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:04:22] Build completed unsuccessfully in 0:00:45
[00:04:22] Build completed unsuccessfully in 0:00:45
[00:04:22] Makefile:67: recipe for target 'tidy' failed
[00:04:22] make: *** [tidy] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:11b02e88
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sun Mar 31 16:09:04 UTC 2019
---
travis_time:end:0dbf7fc4:start=1554048544721569252,finish=1554048544726293930,duration=4724678
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0374c117
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:00463022
travis_time:start:00463022
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:038ab0f8
$ 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)

@alexreg alexreg force-pushed the alexreg:ban-multi-trait-objects-via-aliases branch from 50871cb to d2993e9 Mar 31, 2019

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Mar 31, 2019

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

Click to expand the log.
travis_time:end:38abfb86:start=1554050643712835566,finish=1554050644824230562,duration=1111394996
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
Setting environment variables from .travis.yml
---

[00:04:18] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:04:19] tidy error: /checkout/src/librustc/ty/query/mod.rs:153: line longer than 100 chars
[00:04:20] some tidy checks failed
[00:04:20] 
[00:04:20] 
[00:04:20] 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:20] 
[00:04:20] 
[00:04:20] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:04:20] Build completed unsuccessfully in 0:00:48
[00:04:20] Build completed unsuccessfully in 0:00:48
[00:04:20] Makefile:67: recipe for target 'tidy' failed
[00:04:20] make: *** [tidy] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:2dbb8df4
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Sun Mar 31 16:48:37 UTC 2019
---
travis_time:end:3a6187ae:start=1554050918706529081,finish=1554050918712403628,duration=5874547
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0891aaac
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:06a69c84
travis_time:start:06a69c84
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0b45b032
$ 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)

@alexreg alexreg force-pushed the alexreg:ban-multi-trait-objects-via-aliases branch from d2993e9 to 0f94b88 Apr 1, 2019

@alexreg alexreg force-pushed the alexreg:ban-multi-trait-objects-via-aliases branch from 0f94b88 to 2590f72 Apr 2, 2019

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Apr 2, 2019

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

Click to expand the log.
travis_time:end:0f6f98ee:start=1554230356407689251,finish=1554230464982127162,duration=108574437911
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
Setting environment variables from .travis.yml
---

[00:03:37] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:03:37] tidy error: binary checked into source: /checkout/src/test/ui/traits/wf-trait-object-reverse-order.rs
[00:03:37] tidy error: binary checked into source: /checkout/src/test/ui/traits/wf-trait-object-no-duplicates.rs
[00:03:37] tidy error: binary checked into source: /checkout/src/test/ui/traits/wf-trait-object-no-sized.rs
[00:03:37] tidy error: binary checked into source: /checkout/src/test/ui/traits/trait-alias/trait-alias-no-duplicates.rs
[00:03:37] tidy error: binary checked into source: /checkout/src/test/ui/traits/trait-alias/trait-alias-no-extra-traits.rs
[00:03:37] tidy error: binary checked into source: /checkout/src/test/ui/traits/trait-alias/trait-alias-no-sized.rs
[00:03:37] tidy error: binary checked into source: /checkout/src/test/ui/traits/trait-alias/trait-alias-object-wf.rs
[00:03:39] some tidy checks failed
[00:03:39] 
[00:03:39] 
[00:03:39] 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:03:39] 
[00:03:39] 
[00:03:39] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:39] Build completed unsuccessfully in 0:00:46
[00:03:39] Build completed unsuccessfully in 0:00:46
[00:03:39] Makefile:67: recipe for target 'tidy' failed
[00:03:39] make: *** [tidy] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:123cf046
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Tue Apr  2 18:44:55 UTC 2019
---
travis_time:end:1b01758c:start=1554230695874926133,finish=1554230695879913739,duration=4987606
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:00f2bbe9
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:0d0bca45
travis_time:start:0d0bca45
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:04e20f78
$ 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)

@alexreg alexreg force-pushed the alexreg:ban-multi-trait-objects-via-aliases branch from 2590f72 to d408a1f Apr 3, 2019

@rust-highfive

This comment was marked as resolved.

Copy link
Collaborator

commented Apr 3, 2019

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

Click to expand the log.
travis_time:end:00b0fb4c:start=1554258020243611145,finish=1554258097549181194,duration=77305570049
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
Setting environment variables from .travis.yml
---

[00:03:29] travis_fold:start:tidy
travis_time:start:tidy
tidy check
[00:03:30] tidy error: binary checked into source: /checkout/src/test/ui/traits/trait-alias/trait-alias-no-duplicates.rs
[00:03:30] tidy error: binary checked into source: /checkout/src/test/ui/traits/trait-alias/trait-alias-no-extra-traits.rs
[00:03:30] tidy error: binary checked into source: /checkout/src/test/ui/traits/trait-alias/trait-alias-no-sized.rs
[00:03:30] tidy error: binary checked into source: /checkout/src/test/ui/traits/trait-alias/trait-alias-object-wf.rs
[00:03:32] some tidy checks failed
[00:03:32] 
[00:03:32] 
[00:03:32] 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:03:32] 
[00:03:32] 
[00:03:32] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test src/tools/tidy
[00:03:32] Build completed unsuccessfully in 0:00:45
[00:03:32] Build completed unsuccessfully in 0:00:45
[00:03:32] Makefile:67: recipe for target 'tidy' failed
[00:03:32] make: *** [tidy] Error 1
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:004d4ad0
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Wed Apr  3 02:25:19 UTC 2019
---
travis_time:end:01980d5e:start=1554258320147704325,finish=1554258320153575107,duration=5870782
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0a1c7cf6
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:00002a72
travis_time:start:00002a72
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:12697a19
$ 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)

@alexreg alexreg force-pushed the alexreg:ban-multi-trait-objects-via-aliases branch from d408a1f to a42c23b Apr 3, 2019

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

commented Apr 3, 2019

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

Click to expand the log.
travis_time:end:013c9be5:start=1554309819462419222,finish=1554310005520118869,duration=186057699647
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
$ export GCP_CACHE_BUCKET=rust-lang-ci-cache
Setting environment variables from .travis.yml
---
travis_time:start:test_ui
Check compiletest suite=ui mode=ui (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:11:43] 
[01:11:43] running 5532 tests
[01:11:47] ................................................................................................F... 100/5532
[01:11:50] .....................................................................F.............................. 200/5532
[01:11:57] .................................................................................................... 400/5532
[01:12:01] .................................................................................................... 500/5532
[01:12:05] ..........................................i......................................................... 600/5532
[01:12:10] .................................................................................................... 700/5532
[01:12:10] .................................................................................................... 700/5532
[01:12:15] .................................................................................................... 800/5532
[01:12:20] .................................................................................................... 900/5532
[01:12:25] .i...............i.................................................................................. 1000/5532
[01:12:29] ..................................iiiii............................................................. 1100/5532
[01:12:33] .................................................................................................... 1200/5532
[01:12:36] ................................................F................................................... 1300/5532
[01:12:43] .................................................................................................... 1500/5532
[01:12:46] .................................................................................................... 1600/5532
[01:12:49] ..................................................i................................................. 1700/5532
[01:12:53] .................................................................................................... 1800/5532
[01:12:53] .................................................................................................... 1800/5532
[01:12:58] .................................................................................................... 1900/5532
[01:13:02] .................................................................................................... 2000/5532
[01:13:05] ......................................................................................i............. 2100/5532
[01:13:10] .................................................................................................... 2200/5532
[01:13:14] ........................................................................................F........... 2300/5532
[01:13:24] .................................................................................................... 2500/5532
[01:13:24] .................................................................................................... 2500/5532
[01:13:27] ........................................................F........................................... 2600/5532
[01:13:37] .................................................................................................... 2800/5532
[01:13:41] .................................................................................................... 2900/5532
[01:13:46] .................................................................................................... 3000/5532
[01:13:50] .................................................................................................... 3100/5532
---
[01:14:59] .................................................................................................... 4700/5532
[01:15:07] .................................................................................................... 4800/5532
[01:15:10] .................................................................................................... 4900/5532
[01:15:14] .................................................................................................... 5000/5532
[01:15:19] .........................................................................................F.......... 5100/5532
[01:15:27] .................................................................................................... 5300/5532
[01:15:31] .................................................................................................... 5400/5532
[01:15:34] ......................................................................i............................. 5500/5532
[01:15:35] ................................
[01:15:35] ................................
[01:15:35] failures:
[01:15:35] 
[01:15:35] ---- [ui] ui/associated-types/associated-types-overridden-binding-2.rs stdout ----
[01:15:35] diff of stderr:
[01:15:35] 
[01:15:35] 6    |
[01:15:35] 7    = note: expected type `u32`
[01:15:35] 8               found type `i32`
[01:15:35] -    = note: required for the cast to the object type `dyn I32Iterator<Item = u32, Item = i32>`
[01:15:35] +    = note: required for the cast to the object type `dyn std::iter::Iterator<Item = u32, Item = i32>`
[01:15:35] 11 error: aborting due to previous error
[01:15:35] 12 
[01:15:35] 
[01:15:35] 
[01:15:35] 
[01:15:35] The actual stderr differed from the expected stderr.
[01:15:35] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-overridden-binding-2/associated-types-overridden-binding-2.stderr
[01:15:35] To update references, rerun the tests and pass the `--bless` flag
[01:15:35] To only update this specific test, also pass `--test-args associated-types/associated-types-overridden-binding-2.rs`
[01:15:35] error: 1 errors occurred comparing output.
[01:15:35] status: exit code: 1
[01:15:35] status: exit code: 1
[01:15:35] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-types/associated-types-overridden-binding-2.rs" "-Zthreads=1" "--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/associated-types/associated-types-overridden-binding-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/associated-types/associated-types-overridden-binding-2/auxiliary" "-A" "unused"
[01:15:35] ------------------------------------------
[01:15:35] 
[01:15:35] ------------------------------------------
[01:15:35] stderr:
[01:15:35] stderr:
[01:15:35] ------------------------------------------
[01:15:35] {"message":"type mismatch resolving `<std::vec::IntoIter<u32> as std::iter::Iterator>::Item == i32`","code":{"code":"E0271","explanation":"\nThis is because of a type mismatch between the associated type of some\ntrait (e.g., `T::Bar`, where `T` implements `trait Quux { type Bar; }`)\nand another type `U` that is required to be equal to `T::Bar`, but is not.\nExamples follow.\n\nHere is a basic example:\n\n```compile_fail,E0271\ntrait Trait { type AssociatedType; }\n\nfn foo<T>(t: T) where T: Trait<AssociatedType=u32> {\n    println!(\"in foo\");\n}\n\nimpl Trait for i8 { type AssociatedType = &'static str; }\n\nfoo(3_i8);\n```\n\nHere is that same example again, with some explanatory comments:\n\n```compile_fail,E0271\ntrait Trait { type AssociatedType; }\n\nfn foo<T>(t: T) where T: Trait<AssociatedType=u32> {\n//                    ~~~~~~~~ ~~~~~~~~~~~~~~~~~~\n//                        |            |\n//         This says `foo` can         |\n//           only be used with         |\n//              some type that         |\n//         implements `Trait`.         |\n//                                     |\n//                             This says not only must\n//                             `T` be an impl of `Trait`\n//                             but also that the impl\n//                             must assign the type `u32`\n//                             to the associated type.\n    println!(\"in foo\");\n}\n\nimpl Trait for i8 { type AssociatedType = &'static str; }\n//~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n//      |                             |\n// `i8` does have                     |\n// implementation                     |\n// of `Trait`...                      |\n//                     ... but it is an implementation\n//                     that assigns `&'static str` to\n//                     the associated type.\n\nfoo(3_i8);\n// Here, we invoke `foo` with an `i8`, which does not satisfy\n// the constraint `<i8 as Trait>::AssociatedType=u32`, and\n// therefore the type-checker complains with this error code.\n```\n\nTo avoid those issues, you have to make the types match correctly.\nSo we can fix the previous examples like this:\n\n```\n// Basic Example:\ntrait Trait { type AssociatedType; }\n\nfn foo<T>(t: T) where T: Trait<AssociatedType = &'static str> {\n    println!(\"in foo\");\n}\n\nimpl Trait for i8 { type AssociatedType = &'static str; }\n\nfoo(3_i8);\n\n// For-Loop Example:\nlet vs = vec![1, 2, 3, 4];\nfor v in &vs {\n    match v {\n        &1 => {}\n        _ => {}\n    }\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-overridden-binding-2.rs","byte_start":119,"byte_end":140,"line_start":6,"line_end":6,"column_start":39,"column_end":60,"is_primary":true,"text":[{"text":"    let _: &I32Iterator<Item = u32> = &vec![42].into_iter();","highlight_start":39,"highlight_end":60}],"label":"expected u32, found i32","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `u32`\n   found type `i32`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required for the cast to the object type `dyn std::iter::Iterator<Item = u32, Item = i32>`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0271]: type mismatch resolving `<std::vec::IntoIter<u32> as std::iter::Iterator>::Item == i32`\n  --> /checkout/src/test/ui/associated-types/associated-types-overridden-binding-2.rs:6:39\n   |\nLL |     let _: &I32Iterator<Item = u32> = &vec![42].into_iter();\n   |                                       ^^^^^^^^^^^^^^^^^^^^^ expected u32, found i32\n   |\n   = note: expected type `u32`\n              found type `i32`\n   = note: required for the cast to the object type `dyn std::iter::Iterator<Item = u32, Item = i32>`\n\n"}
[01:15:35] {"message":"For more information about this error, try `rustc --explain E0271`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0271`.\n"}
[01:15:35] 
[01:15:35] ------------------------------------------
[01:15:35] 
---
[01:15:35] diff of stderr:
[01:15:35] 
[01:15:35] 2   --> $DIR/bad-sized.rs:4:24
[01:15:35] 3    |
[01:15:35] 4 LL |     let x: Vec<Trait + Sized> = Vec::new();
[01:15:35] -    |                        ^^^^^ non-auto additional trait
[01:15:35] +    |                -----   ^^^^^ additional non-auto trait
[01:15:35] +    |                first non-auto trait
[01:15:35] 6 
[01:15:35] 6 
[01:15:35] 7 error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time
[01:15:35] 
[01:15:35] 
[01:15:35] The actual stderr differed from the expected stderr.
[01:15:35] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/bad/bad-sized/bad-sized.stderr
[01:15:35] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/bad/bad-sized/bad-sized.stderr
[01:15:35] To update references, rerun the tests and pass the `--bless` flag
[01:15:35] To only update this specific test, also pass `--test-args bad/bad-sized.rs`
[01:15:35] error: 1 errors occurred comparing output.
[01:15:35] status: exit code: 1
[01:15:35] status: exit code: 1
[01:15:35] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/bad/bad-sized.rs" "-Zthreads=1" "--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/bad/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/ui/bad/bad-sized/auxiliary" "-A" "unused"
[01:15:35] ------------------------------------------
[01:15:35] 
[01:15:35] ------------------------------------------
[01:15:35] stderr:
[01:15:35] stderr:
[01:15:35] ------------------------------------------
[01:15:35] {"message":"only auto traits can be used as additional traits in a trait object","code":{"code":"E0225","explanation":"\nYou attempted to use multiple types as bounds for a closure or trait object.\nRust does not currently support this. A simple example that causes this error:\n\n```compile_fail,E0225\nfn main() {\n    let _: Box<dyn std::io::Read + std::io::Write>;\n}\n```\n\nAuto traits such as Send and Sync are an exception to this rule:\nIt's possible to have bounds of one non-builtin trait, plus any number of\nauto traits. For example, the following compiles correctly:\n\n```\nfn main() {\n    let _: Box<dyn std::io::Read + Send + Sync>;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/bad/bad-sized.rs","byte_start":55,"byte_end":60,"line_start":4,"line_end":4,"column_start":24,"column_end":29,"is_primary":true,"text":[{"text":"    let x: Vec<Trait + Sized> = Vec::new();","highlight_start":24,"highlight_end":29}],"label":"additional non-auto trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/bad/bad-sized.rs","byte_start":47,"byte_end":52,"line_start":4,"line_end":4,"column_start":16,"column_end":21,"is_primary":false,"text":[{"text":"    let x: Vec<Trait + Sized> = Vec::new();","highlight_start":16,"highlight_end":21}],"label":"first non-auto trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0225]: only auto traits can be used as additional traits in a trait object\n  --> /checkout/src/test/ui/bad/bad-sized.rs:4:24\n   |\nLL |     let x: Vec<Trait + Sized> = Vec::new();\n   |                -----   ^^^^^ additional non-auto trait\n   |                |\n   |                first non-auto trait\n\n"}
[01:15:35] {"message":"the size for values of type `dyn Trait` 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/bad/bad-sized.rs","byte_start":43,"byte_end":61,"line_start":4,"line_end":4,"column_start":12,"column_end":30,"is_primary":true,"text":[{"text":"    let x: Vec<Trait + Sized> = Vec::new();","highlight_start":12,"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 `dyn Trait`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by `std::vec::Vec`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time\n  --> /checkout/src/test/ui/bad/bad-sized.rs:4:12\n   |\nLL |     let x: Vec<Trait + Sized> = Vec::new();\n   |            ^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time\n   |\n   = help: the trait `std::marker::Sized` is not implemented for `dyn Trait`\n   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>\n   = note: required by `std::vec::Vec`\n\n"}
[01:15:35] {"message":"the size for values of type `dyn Trait` 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/bad/bad-sized.rs","byte_start":64,"byte_end":72,"line_start":4,"line_end":4,"column_start":33,"column_end":41,"is_primary":true,"text":[{"text":"    let x: Vec<Trait + Sized> = Vec::new();","highlight_start":33,"highlight_end":41}],"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 Trait`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by `std::vec::Vec::<T>::new`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the size for values of type `dyn Trait` cannot be known at compilation time\n  --> /checkout/src/test/ui/bad/bad-sized.rs:4:33\n   |\nLL |     let x: Vec<Trait + Sized> = Vec::new();\n   |                                 ^^^^^^^^ doesn't have a size known at compile-time\n   |\n   = help: the trait `std::marker::Sized` is not implemented for `dyn Trait`\n   = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>\n   = note: required by `std::vec::Vec::<T>::new`\n\n"}
[01:15:35] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[01:15:35] {"message":"Some errors occurred: E0225, E0277.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0225, E0277.\n"}
[01:15:35] 
[01:15:35] ------------------------------------------
[01:15:35] 
[01:15:35] thread '[ui] ui/bad/bad-sized.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3422:9
[01:15:35] thread '[ui] ui/bad/bad-sized.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3422:9
[01:15:35] 
[01:15:35] ---- [ui] ui/error-codes/E0225.rs stdout ----
[01:15:35] diff of stderr:
[01:15:35] 
[01:15:35] 2   --> $DIR/E0225.rs:6:32
[01:15:35] 3    |
[01:15:35] 4 LL |     let _: Box<std::io::Read + std::io::Write>;
[01:15:35] -    |                                ^^^^^^^^^^^^^^ non-auto additional trait
[01:15:35] +    |                -------------   ^^^^^^^^^^^^^^ additional non-auto trait
[01:15:35] +    |                first non-auto trait
[01:15:35] 6 
[01:15:35] 6 
[01:15:35] 7 error[E0225]: only auto traits can be used as additional traits in a trait object
[01:15:35] 8   --> $DIR/E0225.rs:8:16
[01:15:35] 9    |
[01:15:35] 9    |
[01:15:35] 10 LL | trait Foo = std::io::Read + std::io::Write;
[01:15:35] -    |                             -------------- non-auto additional trait
[01:15:35] +    |             -------------   -------------- additional non-auto trait
[01:15:35] +    |             first non-auto trait
[01:15:35] 12 ...
[01:15:35] 12 ...
[01:15:35] 13 LL |     let _: Box<Foo>;
[01:15:35] 
[01:15:35] 
[01:15:35] The actual stderr differed from the expected stderr.
[01:15:35] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/error-codes/E0225/E0225.stderr
[01:15:35] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/error-codes/E0225/E0225.stderr
[01:15:35] To update references, rerun the tests and pass the `--bless` flag
[01:15:35] To only update this specific test, also pass `--test-args error-codes/E0225.rs`
[01:15:35] error: 1 errors occurred comparing output.
[01:15:35] status: exit code: 1
[01:15:35] status: exit code: 1
[01:15:35] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/error-codes/E0225.rs" "-Zthreads=1" "--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/error-codes/E0225/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/error-codes/E0225/auxiliary" "-A" "unused"
[01:15:35] ------------------------------------------
[01:15:35] 
[01:15:35] ------------------------------------------
[01:15:35] stderr:
[01:15:35] stderr:
[01:15:35] ------------------------------------------
[01:15:35] {"message":"only auto traits can be used as additional traits in a trait object","code":{"code":"E0225","explanation":"\nYou attempted to use multiple types as bounds for a closure or trait object.\nRust does not currently support this. A simple example that causes this error:\n\n```compile_fail,E0225\nfn main() {\n    let _: Box<dyn std::io::Read + std::io::Write>;\n}\n```\n\nAuto traits such as Send and Sync are an exception to this rule:\nIt's possible to have bounds of one non-builtin trait, plus any number of\nauto traits. For example, the following compiles correctly:\n\n```\nfn main() {\n    let _: Box<dyn std::io::Read + Send + Sync>;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/error-codes/E0225.rs","byte_start":114,"byte_end":128,"line_start":6,"line_end":6,"column_start":32,"column_end":46,"is_primary":true,"text":[{"text":"    let _: Box<std::io::Read + std::io::Write>;","highlight_start":32,"highlight_end":46}],"label":"additional non-auto trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/error-codes/E0225.rs","byte_start":98,"byte_end":111,"line_start":6,"line_end":6,"column_start":16,"column_end":29,"is_primary":false,"text":[{"text":"    let _: Box<std::io::Read + std::io::Write>;","highlight_start":16,"highlight_end":29}],"label":"first non-auto trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0225]: only auto traits can be used as additional traits in a trait object\n  --> /checkout/src/test/ui/error-codes/E0225.rs:6:32\n   |\nLL |     let _: Box<std::io::Read + std::io::Write>;\n   |                -------------   ^^^^^^^^^^^^^^ additional non-auto trait\n   |                |\n   |                first non-auto trait\n\n"}
[01:15:35] {"message":"only auto traits can be used as additional traits in a trait object","code":{"code":"E0225","explanation":"\nYou attempted to use multiple types as bounds for a closure or trait object.\nRust does not currently support this. A simple example that causes this error:\n\n```compile_fail,E0225\nfn main() {\n    let _: Box<dyn std::io::Read + std::io::Write>;\n}\n```\n\nAuto traits such as Send and Sync are an exception to this rule:\nIt's possible to have bounds of one non-builtin trait, plus any number of\nauto traits. For example, the following compiles correctly:\n\n```\nfn main() {\n    let _: Box<dyn std::io::Read + Send + Sync>;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/error-codes/E0225.rs","byte_start":54,"byte_end":68,"line_start":3,"line_end":3,"column_start":29,"column_end":43,"is_primary":false,"text":[{"text":"trait Foo = std::io::Read + std::io::Write;","highlight_start":29,"highlight_end":43}],"label":"additional non-auto trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/error-codes/E0225.rs","byte_start":38,"byte_end":51,"line_start":3,"line_end":3,"column_start":13,"column_end":26,"is_primary":false,"text":[{"text":"trait Foo = std::io::Read + std::io::Write;","highlight_start":13,"highlight_end":26}],"label":"first non-auto trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/error-codes/E0225.rs","byte_start":237,"byte_end":240,"line_start":8,"line_end":8,"column_start":16,"column_end":19,"is_primary":true,"text":[{"text":"    let _: Box<Foo>;","highlight_start":16,"highlight_end":19}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0225]: only auto traits can be used as additional traits in a trait object\n  --> /checkout/src/test/ui/error-codes/E0225.rs:8:16\n   |\nLL | trait Foo = std::io::Read + std::io::Write;\n   |             -------------   -------------- additional non-auto trait\n   |             |\n   |             first non-auto trait\n...\nLL |     let _: Box<Foo>;\n   |                ^^^\n\n"}
[01:15:35] {"message":"For more information about this error, try `rustc --explain E0225`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0225`.\n"}
[01:15:35] 
[01:15:35] ------------------------------------------
[01:15:35] 
[01:15:35] 
[01:15:35] thread '[ui] ui/error-codes/E0225.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3422:9
[01:15:35] 
[01:15:35] ---- [ui] ui/issues/issue-22560.rs stdout ----
[01:15:35] diff of stderr:
[01:15:35] 
[01:15:35] 1 error[E0393]: the type parameter `Rhs` must be explicitly specified
[01:15:35] +   --> $DIR/issue-22560.rs:8:13
[01:15:35] 3    |
[01:15:35] 3    |
[01:15:35] - LL | type Test = Add +
[01:15:35] + LL |             Sub;
[01:15:35] 5    |             ^^^ missing reference to `Rhs`
[01:15:35] 6    |
[01:15:35] 7    = note: because of the default `Self` reference, type parameters must be specified on object types
[01:15:35] 8 
[01:15:35] 8 
[01:15:35] 9 error[E0393]: the type parameter `Rhs` must be explicitly specified
[01:15:35] +   --> $DIR/issue-22560.rs:5:13
[01:15:35] 11    |
[01:15:35] - LL |             Sub;
[01:15:35] + LL | type Test = Add +
[01:15:35] + LL | type Test = Add +
[01:15:35] 13    |             ^^^ missing reference to `Rhs`
[01:15:35] 14    |
[01:15:35] 15    = note: because of the default `Self` reference, type parameters must be specified on object types
[01:15:35] 
[01:15:35] 17 error[E0225]: only auto traits can be used as additional traits in a trait object
[01:15:35] 19    |
[01:15:35] + LL | type Test = Add +
[01:15:35] +    |             --- first non-auto trait
[01:15:35] + ...
[01:15:35] + ...
[01:15:35] 20 LL |             Sub;
[01:15:35] -    |             ^^^ non-auto additional trait
[01:15:35] +    |             ^^^ additional non-auto trait
[01:15:35] 22 
[01:15:35] - error[E0191]: the value of the associated type `Output` (from the trait `std::ops::Add`) must be specified
[01:15:35] + error[E0191]: the value of the associated types `Output` (from the trait `std::ops::Add`), `Output` (from the trait `std::ops::Sub`) must be specified
[01:15:35] 25    |
[01:15:35] 26 LL |   type Test = Add +
[01:15:35] 
[01:15:35] 27    |  _____________^
[01:15:35] 27    |  _____________^
[01:15:35] +    | |_____________|
[01:15:35] +    | |
[01:15:35] 28 LL | |
[01:15:35] 29 LL | |
[01:15:35] 30 LL | |             Sub;
[01:15:35] 
[01:15:35] -    | |_______________^ associated type `Output` must be specified
[01:15:35] +    | |_______________|
[01:15:35] +    | |_______________|
[01:15:35] +    | |_______________associated type `Output` must be specified
[01:15:35] +    |                 associated type `Output` must be specified
[01:15:35] 33 error: aborting due to 4 previous errors
[01:15:35] 34 
[01:15:35] 
[01:15:35] 
[01:15:35] 
[01:15:35] The actual stderr differed from the expected stderr.
[01:15:35] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-22560/issue-22560.stderr
[01:15:35] To update references, rerun the tests and pass the `--bless` flag
[01:15:35] To only update this specific test, also pass `--test-args issues/issue-22560.rs`
[01:15:35] error: 1 errors occurred comparing output.
[01:15:35] status: exit code: 1
[01:15:35] status: exit code: 1
[01:15:35] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-22560.rs" "-Zthreads=1" "--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/issues/issue-22560/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/issues/issue-22560/auxiliary" "-A" "unused"
[01:15:35] ------------------------------------------
[01:15:35] 
[01:15:35] ------------------------------------------
[01:15:35] stderr:
[01:15:35] stderr:
[01:15:35] ------------------------------------------
[01:15:35] {"message":"the type parameter `Rhs` must be explicitly specified","code":{"code":"E0393","explanation":"\nA type parameter which references `Self` in its default value was not specified.\nExample of erroneous code:\n\n```compile_fail,E0393\ntrait A<T=Self> {}\n\nfn together_we_will_rule_the_galaxy(son: &A) {}\n// error: the type parameter `T` must be explicitly specified in an\n//        object type because its default value `Self` references the\n//        type `Self`\n```\n\nA trait object is defined over a single, fully-defined trait. With a regular\ndefault parameter, this parameter can just be substituted in. However, if the\ndefault parameter is `Self`, the trait changes for each concrete type; i.e.\n`i32` will be expected to implement `A<i32>`, `bool` will be expected to\nimplement `A<bool>`, etc... These types will not share an implementation of a\nfully-defined trait; instead they share implementations of a trait with\ndifferent parameters substituted in for each implementation. This is\nirreconcilable with what we need to make a trait object work, and is thus\ndisallowed. Making the trait concrete by explicitly specifying the value of the\ndefaulted parameter will fix this issue. Fixed example:\n\n```\ntrait A<T=Self> {}\n\nfn together_we_will_rule_the_galaxy(son: &A<i32>) {} // Ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-22560.rs","byte_start":142,"byte_end":145,"line_start":8,"line_end":8,"column_start":13,"column_end":16,"is_primary":true,"text":[{"text":"            Sub;","highlight_start":13,"highlight_end":16}],"label":"missing reference to `Rhs`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"because of the default `Self` reference, type parameters must be specified on object types","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0393]: the type parameter `Rhs` must be explicitly specified\n  --> /checkout/src/test/ui/issues/issue-22560.rs:8:13\n   |\nLL |             Sub;\n   |             ^^^ missing reference to `Rhs`\n   |\n   = note: because of the default `Self` reference, type parameters must be specified on object types\n\n"}
[01:15:35] {"message":"the type parameter `Rhs` must be explicitly specified","code":{"code":"E0393","explanation":"\nA type parameter which references `Self` in its default value was not specified.\nExample of erroneous code:\n\n```compile_fail,E0393\ntrait A<T=Self> {}\n\nfn together_we_will_rule_the_galaxy(son: &A) {}\n// error: the type parameter `T` must be explicitly specified in an\n//        object type because its default value `Self` references the\n//        type `Self`\n```\n\nA trait object is defined over a single, fully-defined trait. With a regular\ndefault parameter, this parameter can just be substituted in. However, if the\ndefault parameter is `Self`, the trait changes for each concrete type; i.e.\n`i32` will be expected to implement `A<i32>`, `bool` will be expected to\nimplement `A<bool>`, etc... These types will not share an implementation of a\nfully-defined trait; instead they share implementations of a trait with\ndifferent parameters substituted in for each implementation. This is\nirreconcilable with what we need to make a trait object work, and is thus\ndisallowed. Making the trait concrete by explicitly specifying the value of the\ndefaulted parameter will fix this issue. Fixed example:\n\n```\ntrait A<T=Self> {}\n\nfn together_we_will_rule_the_galaxy(son: &A<i32>) {} // Ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-22560.rs","byte_start":66,"byte_end":69,"line_start":5,"line_end":5,"column_start":13,"column_end":16,"is_primary":true,"text":[{"text":"type Test = Add +","highlight_start":13,"highlight_end":16}],"label":"missing reference to `Rhs`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"because of the default `Self` reference, type parameters must be specified on object types","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0393]: the type parameter `Rhs` must be explicitly specified\n  --> /checkout/src/test/ui/issues/issue-22560.rs:5:13\n   |\nLL | type Test = Add +\n   |             ^^^ missing reference to `Rhs`\n   |\n   = note: because of the default `Self` reference, type parameters must be specified on object types\n\n"}
[01:15:35] {"message":"only auto traits can be used as additional traits in a trait object","code":{"code":"E0225","explanation":"\nYou attempted to use multiple types as bounds for a closure or trait object.\nRust does not currently support this. A simple example that causes this error:\n\n```compile_fail,E0225\nfn main() {\n    let _: Box<dyn std::io::Read + std::io::Write>;\n}\n```\n\nAuto traits such as Send and Sync are an exception to this rule:\nIt's possible to have bounds of one non-builtin trait, plus any number of\nauto traits. For example, the following compiles correctly:\n\n```\nfn main() {\n    let _: Box<dyn std::io::Read + Send + Sync>;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-22560.rs","byte_start":142,"byte_end":145,"line_start":8,"line_end":8,"column_start":13,"column_end":16,"is_primary":true,"text":[{"text":"            Sub;","highlight_start":13,"highlight_end":16}],"label":"additional non-auto trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-22560.rs","byte_start":66,"byte_end":69,"line_start":5,"line_end":5,"column_start":13,"column_end":16,"is_primary":false,"text":[{"text":"type Test = Add +","highlight_start":13,"highlight_end":16}],"label":"first non-auto trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0225]: only auto traits can be used as additional traits in a trait object\n  --> /checkout/src/test/ui/issues/issue-22560.rs:8:13\n   |\nLL | type Test = Add +\n   |             --- first non-auto trait\n...\nLL |             Sub;\n   |             ^^^ additional non-auto trait\n\n"}
[01:15:35] {"message":"the value of the associated types `Output` (from the trait `std::ops::Add`), `Output` (from the trait `std::ops::Sub`) must be specified","code":{"code":"E0191","explanation":"\nTrait objects need to have all associated types specified. Erroneous code\nexample:\n\n```compile_fail,E0191\ntrait Trait {\n    type Bar;\n}\n\ntype Foo = Trait; // error: the value of the associated type `Bar` (from\n                  //        the trait `Trait`) must be specified\n```\n\nPlease verify you specified all associated types of the trait and that you\nused the right trait. Example:\n\n```\ntrait Trait {\n    type Bar;\n}\n\ntype Foo = Trait<Bar=i32>; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-22560.rs","byte_start":66,"byte_end":145,"line_start":5,"line_end":8,"column_start":13,"column_end":16,"is_primary":true,"text":[{"text":"type Test = Add +","highlight_start":13,"highlight_end":18},{"text":"            //~^ ERROR E0393","highlight_start":1,"highlight_end":29},{"text":"            //~| ERROR E0191","highlight_start":1,"highlight_end":29},{"text":"            Sub;","highlight_start":1,"highlight_end":16}],"label":"associated type `Output` must be specified","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-22560.rs","byte_start":66,"byte_end":145,"line_start":5,"line_end":8,"column_start":13,"column_end":16,"is_primary":true,"text":[{"text":"type Test = Add +","highlight_start":13,"highlight_end":18},{"text":"            //~^ ERROR E0393","highlight_start":1,"highlight_end":29},{"text":"            //~| ERROR E0191","highlight_start":1,"highlight_end":29},{"text":"            Sub;","highlight_start":1,"highlight_end":16}],"label":"associated type `Output` must be specified","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0191]: the value of the associated types `Output` (from the trait `std::ops::Add`), `Output` (from the trait `std::ops::Sub`) must be specified\n  --> /checkout/src/test/ui/issues/issue-22560.rs:5:13\n   |\nLL |   type Test = Add +\n   |  _____________^\n   | |_____________|\n   | |\nLL | |             //~^ ERROR E0393\nLL | |             //~| ERROR E0191\nLL | |             Sub;\n   | |               ^\n   | |_______________|\n   | |_______________associated type `Output` must be specified\n   |                 associated type `Output` must be specified\n\n"}
[01:15:35] {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors\n\n"}
[01:15:35] {"message":"Some errors occurred: E0191, E0225, E0393.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0191, E0225, E0393.\n"}
[01:15:35] 
[01:15:35] ------------------------------------------
[01:15:35] 
[01:15:35] thread '[ui] ui/issues/issue-22560.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3422:9
[01:15:35] thread '[ui] ui/issues/issue-22560.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3422:9
[01:15:35] 
[01:15:35] ---- [ui] ui/issues/issue-32963.rs stdout ----
[01:15:35] diff of stderr:
[01:15:35] 
[01:15:35] 2   --> $DIR/issue-32963.rs:8:25
[01:15:35] 3    |
[01:15:35] 4 LL |     size_of_copy::<Misc+Copy>();
[01:15:35] -    |                         ^^^^ non-auto additional trait
[01:15:35] +    |                    ---- ^^^^ additional non-auto trait
[01:15:35] +    |                    first non-auto trait
[01:15:35] 6 
[01:15:35] 6 
[01:15:35] 7 error[E0277]: the trait bound `dyn Misc: std::marker::Copy` is not satisfied
[01:15:35] 
[01:15:35] 
[01:15:35] The actual stderr differed from the expected stderr.
[01:15:35] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-32963/issue-32963.stderr
[01:15:35] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-32963/issue-32963.stderr
[01:15:35] To update references, rerun the tests and pass the `--bless` flag
[01:15:35] To only update this specific test, also pass `--test-args issues/issue-32963.rs`
[01:15:35] error: 1 errors occurred comparing output.
[01:15:35] status: exit code: 1
[01:15:35] status: exit code: 1
[01:15:35] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-32963.rs" "-Zthreads=1" "--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/issues/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/ui/issues/issue-32963/auxiliary" "-A" "unused"
[01:15:35] ------------------------------------------
[01:15:35] 
[01:15:35] ------------------------------------------
[01:15:35] stderr:
[01:15:35] stderr:
[01:15:35] ------------------------------------------
[01:15:35] {"message":"only auto traits can be used as additional traits in a trait object","code":{"code":"E0225","explanation":"\nYou attempted to use multiple types as bounds for a closure or trait object.\nRust does not currently support this. A simple example that causes this error:\n\n```compile_fail,E0225\nfn main() {\n    let _: Box<dyn std::io::Read + std::io::Write>;\n}\n```\n\nAuto traits such as Send and Sync are an exception to this rule:\nIt's possible to have bounds of one non-builtin trait, plus any number of\nauto traits. For example, the following compiles correctly:\n\n```\nfn main() {\n    let _: Box<dyn std::io::Read + Send + Sync>;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-32963.rs","byte_start":134,"byte_end":138,"line_start":8,"line_end":8,"column_start":25,"column_end":29,"is_primary":true,"text":[{"text":"    size_of_copy::<Misc+Copy>();","highlight_start":25,"highlight_end":29}],"label":"additional non-auto trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-32963.rs","byte_start":129,"byte_end":133,"line_start":8,"line_end":8,"column_start":20,"column_end":24,"is_primary":false,"text":[{"text":"    size_of_copy::<Misc+Copy>();","highlight_start":20,"highlight_end":24}],"label":"first non-auto trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0225]: only auto traits can be used as additional traits in a trait object\n  --> /checkout/src/test/ui/issues/issue-32963.rs:8:25\n   |\nLL |     size_of_copy::<Misc+Copy>();\n   |                    ---- ^^^^ additional non-auto trait\n   |                    |\n   |                    first non-auto trait\n\n"}
[01:15:35] {"message":"the trait bound `dyn Misc: std::marker::Copy` 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/issues/issue-32963.rs","byte_start":114,"byte_end":139,"line_start":8,"line_end":8,"column_start":5,"column_end":30,"is_primary":true,"text":[{"text":"    size_of_copy::<Misc+Copy>();","highlight_start":5,"highlight_end":30}],"label":"the trait `std::marker::Copy` is not implemented for `dyn Misc`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"required by `size_of_copy`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-32963.rs","byte_start":30,"byte_end":72,"line_start":5,"line_end":5,"column_start":1,"column_end":43,"is_primary":true,"text":[{"text":"fn size_of_copy<T: Copy+?Sized>() -> usize { mem::size_of::<T>() }","highlight_start":1,"highlight_end":43}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `dyn Misc: std::marker::Copy` is not satisfied\n  --> /checkout/src/test/ui/issues/issue-32963.rs:8:5\n   |\nLL |     size_of_copy::<Misc+Copy>();\n   |     ^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `dyn Misc`\n   |\nnote: required by `size_of_copy`\n  --> /checkout/src/test/ui/issues/issue-32963.rs:5:1\n   |\nLL | fn size_of_copy<T: Copy+?Sized>() -> usize { mem::size_of::<T>() }\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:15:35] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[01:15:35] {"message":"Some errors occurred: E0225, E0277.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0225, E0277.\n"}
[01:15:35] 
[01:15:35] ------------------------------------------
[01:15:35] 
[01:15:35] thread '[ui] ui/issues/issue-32963.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3422:9
[01:15:35] thread '[ui] ui/issues/issue-32963.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3422:9
[01:15:35] 
[01:15:35] ---- [ui] ui/traits/trait-alias/trait-alias-no-sized.rs stdout ----
[01:15:35] 
[01:15:35] error: /checkout/src/test/ui/traits/trait-alias/trait-alias-no-sized.rs:12: unexpected error: '12:12: 12:18: at least one non-builtin trait is required for an object type [E0224]'
[01:15:35] 
[01:15:35] error: /checkout/src/test/ui/traits/trait-alias/trait-alias-no-sized.rs:26: unexpected error: '26:12: 26:18: at least one non-builtin trait is required for an object type [E0224]'
[01:15:35] 
[01:15:35] error: /checkout/src/test/ui/traits/trait-alias/trait-alias-no-sized.rs:12: expected error not found: `?Trait` is not permitted in trait object types
[01:15:35] 
[01:15:35] error: /checkout/src/test/ui/traits/trait-alias/trait-alias-no-sized.rs:16: expected error not found: `?Trait` is not permitted in trait object types
[01:15:35] 
[01:15:35] error: /checkout/src/test/ui/traits/trait-alias/trait-alias-no-sized.rs:20: expected error not found: `?Trait` is not permitted in trait object types
[01:15:35] 
[01:15:35] error: /checkout/src/test/ui/traits/trait-alias/trait-alias-no-sized.rs:26: expected error not found: `?Trait` is not permitted in trait object types
[01:15:35] 
[01:15:35] error: /checkout/src/test/ui/traits/trait-alias/trait-alias-no-sized.rs:26: expected error not found: `?Trait` is not permitted in trait object types
[01:15:35] 
[01:15:35] error: /checkout/src/test/ui/traits/trait-alias/trait-alias-no-sized.rs:26: expected error not found: only auto traits can be used as additional traits in a trait object [E0225]
[01:15:35] error: 2 unexpected errors found, 6 expected errors not found
[01:15:35] status: exit code: 1
[01:15:35] status: exit code: 1
[01:15:35] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/traits/trait-alias/trait-alias-no-sized.rs" "-Zthreads=1" "--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/traits/trait-alias/trait-alias-no-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/ui/traits/trait-alias/trait-alias-no-sized/auxiliary" "-A" "unused"
[01:15:35]     Error {
[01:15:35]         line_num: 12,
[01:15:35]         kind: Some(
[01:15:35]             Error
---
[01:15:35]         line_num: 12,
[01:15:35]         kind: Some(
[01:15:35]             Error
[01:15:35]         ),
[01:15:35]         msg: "`?Trait` is not permitted in trait object types"
[01:15:35]     Error {
[01:15:35]         line_num: 16,
[01:15:35]         kind: Some(
[01:15:35]             Error
[01:15:35]             Error
[01:15:35]         ),
[01:15:35]         msg: "`?Trait` is not permitted in trait object types"
[01:15:35]     Error {
[01:15:35]         line_num: 20,
[01:15:35]         kind: Some(
[01:15:35]             Error
[01:15:35]             Error
[01:15:35]         ),
[01:15:35]         msg: "`?Trait` is not permitted in trait object types"
[01:15:35]     Error {
[01:15:35]         line_num: 26,
[01:15:35]         kind: Some(
[01:15:35]             Error
[01:15:35]             Error
[01:15:35]         ),
[01:15:35]         msg: "`?Trait` is not permitted in trait object types"
[01:15:35]     Error {
[01:15:35]         line_num: 26,
[01:15:35]         kind: Some(
[01:15:35]             Error
[01:15:35]             Error
[01:15:35]         ),
[01:15:35]         msg: "`?Trait` is not permitted in trait object types"
[01:15:35]     Error {
[01:15:35]         line_num: 26,
[01:15:35]         kind: Some(
[01:15:35]             Error
[01:15:35]             Error
[01:15:35]         ),
[01:15:35]         msg: "only auto traits can be used as additional traits in a trait object [E0225]"
[01:15:35] ]
[01:15:35] 
[01:15:35] 
[01:15:35] thread '[ui] ui/traits/trait-alias/trait-alias-no-sized.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:1381:13
[01:15:35] 
[01:15:35] failures:
[01:15:35]     [ui] ui/associated-types/associated-types-overridden-binding-2.rs
[01:15:35]     [ui] ui/bad/bad-sized.rs
[01:15:35]     [ui] ui/bad/bad-sized.rs
[01:15:35]     [ui] ui/error-codes/E0225.rs
[01:15:35]     [ui] ui/issues/issue-22560.rs
[01:15:35]     [ui] ui/issues/issue-32963.rs
[01:15:35]     [ui] ui/traits/trait-alias/trait-alias-no-sized.rs
[01:15:35] test result: FAILED. 5505 passed; 6 failed; 21 ignored; 0 measured; 0 filtered out
[01:15:35] 
[01:15:35] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:516:22
[01:15:35] 
[01:15:35] 
[01:15:35] 
[01:15:35] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--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" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:15:35] 
[01:15:35] 
[01:15:35] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:15:35] Build completed unsuccessfully in 0:04:53
[01:15:35] Build completed unsuccessfully in 0:04:53
[01:15:35] make: *** [check] Error 1
[01:15:35] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:0eacfc6f
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Wed Apr  3 18:02:30 UTC 2019
---
travis_time:end:1aed7e97:start=1554314552912349130,finish=1554314552918148012,duration=5798882
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:00c71820
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:20fc13a0
travis_time:start:20fc13a0
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0079c09c
$ 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

This comment was marked as outdated.

Copy link
Contributor

commented Apr 4, 2019

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

@alexreg alexreg force-pushed the alexreg:ban-multi-trait-objects-via-aliases branch from a42c23b to 560a8de Apr 29, 2019

@Centril

This comment has been minimized.

Copy link
Member

commented May 21, 2019

Since it is a large bitrotty PR, @bors p=1 rollup=never

@alexreg

This comment has been minimized.

Copy link
Contributor Author

commented May 21, 2019

@bors retry

@bors bors added S-waiting-on-bors and removed S-blocked labels May 21, 2019

@oli-obk

This comment has been minimized.

Copy link
Contributor

commented May 21, 2019

is the beta cut already successfull even without #60999 having been merged?

@alexreg

This comment has been minimized.

Copy link
Contributor Author

commented May 21, 2019

Not 100% sure, but @Centril and I thought that by the time this PR works its way up the queue now, the toolstate problem should have disappeared at least, so it should be no problem.

@bors

This comment has been minimized.

Copy link
Contributor

commented May 22, 2019

⌛️ Testing commit ce2ee30 with merge de41406...

bors added a commit that referenced this pull request May 22, 2019

Auto merge of #59445 - alexreg:ban-multi-trait-objects-via-aliases, r…
…=oli-obk

Ban multi-trait objects via trait aliases

Obviously, multi-trait objects are not normally supported, so they should not be supported via trait aliases.

This has been factored out from the previous PR #55994 (see point 1).

r? @Centril

CC @nikomatsakis
@bors

This comment has been minimized.

Copy link
Contributor

commented May 22, 2019

💔 Test failed - checks-travis

@rust-highfive

This comment has been minimized.

Copy link
Collaborator

commented May 22, 2019

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

Click to expand the log.
[00:03:51]    Compiling textwrap v0.11.0
[00:03:53] error: failed to run custom build command for `rand_chacha v0.1.1`
[00:03:53] process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/debug/build/rand_chacha-264db25efa48e2e1/build-script-build` (exit code: 101)
[00:03:53] --- stdout
[00:03:53] cargo:rerun-if-changed=build.rs
[00:03:53] --- stderr
[00:03:53] thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:345:21
[00:03:53] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[00:03:53] thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:345:21
[00:03:53] thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:345:21
[00:03:53] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[00:03:53] thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: Other("could not probe for `std`") }', src/libcore/result.rs:997:5
[00:03:53] 
[00:03:53] warning: build failed, waiting for other jobs to finish...
[00:03:53] error: failed to run custom build command for `rand_pcg v0.1.2`
[00:03:53] process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/debug/build/rand_pcg-77510ee48e3cc776/build-script-build` (exit code: 101)
[00:03:53] process didn't exit successfully: `/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools/debug/build/rand_pcg-77510ee48e3cc776/build-script-build` (exit code: 101)
[00:03:53] --- stdout
[00:03:53] cargo:rerun-if-changed=build.rs
[00:03:53] --- stderr
[00:03:53] thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:345:21
[00:03:53] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[00:03:53] thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:345:21
[00:03:53] thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:345:21
[00:03:53] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[00:03:53] thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error { kind: Other("could not probe for `std`") }', src/libcore/result.rs:997:5
[00:03:53] 
[00:03:53] warning: build failed, waiting for other jobs to finish...
[00:03:53] warning: build failed, waiting for other jobs to finish...
[00:03:56] error: failed to compile `cargo-vendor v0.1.22`, intermediate artifacts can be found at `/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-bootstrap-tools`
[00:03:56] Caused by:
[00:03:56]   build failed
[00:03:56] 
[00:03:56] 
[00:03:56] 
[00:03:56] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "install" "-j" "4" "--locked" "--color" "always" "--force" "--debug" "--vers" "0.1.22" "cargo-vendor"
[00:03:56] 
[00:03:56] 
[00:03:56] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test distcheck
[00:03:56] Build completed unsuccessfully in 0:00:34
---
travis_time:end:2065bca2:start=1558486191740556448,finish=1558486191752078901,duration=11522453
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:07ad57f0
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:1213ecc0
travis_time:start:1213ecc0
$ cat ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers || true
cat: ./obj/build/x86_64-unknown-linux-gnu/native/asan/build/lib/asan/clang_rt.asan-dynamic-i386.vers: No such file or directory
travis_fold:end:after_failure.5
travis_fold:start:after_failure.6
travis_time:start:0298c0e0
$ 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)

@mati865

This comment has been minimized.

Copy link
Contributor

commented May 22, 2019

#61027 already broke Clippy so for sure tools don't block it anymore.

@Centril Centril added the relnotes label May 22, 2019

@Centril Centril added this to the 1.37 milestone May 22, 2019

@Centril Centril added the T-lang label May 22, 2019

@Centril

This comment has been minimized.

Copy link
Member

commented May 22, 2019

@bors retry

@bors

This comment has been minimized.

Copy link
Contributor

commented May 22, 2019

⌛️ Testing commit ce2ee30 with merge 37ff5d3...

bors added a commit that referenced this pull request May 22, 2019

Auto merge of #59445 - alexreg:ban-multi-trait-objects-via-aliases, r…
…=oli-obk

Ban multi-trait objects via trait aliases

Obviously, multi-trait objects are not normally supported, so they should not be supported via trait aliases.

This has been factored out from the previous PR #55994 (see point 1).

r? @Centril

CC @nikomatsakis

------------------

### RELNOTES:

We now allow `dyn Send + fmt::Debug` with equivalent semantics to `dyn fmt::Debug + Send`.
That is, the order of the mentioned traits does not matter wrt. principal/not-principal traits.
This is a small change that might deserve a mention in the blog post because it is a language change but most likely not.

See https://github.com/rust-lang/rust/blob/ce2ee305f9165c037ecddddb5792588a15ff6c37/src/test/ui/traits/wf-trait-object-reverse-order.rs.

// @Centril
@bors

This comment has been minimized.

Copy link
Contributor

commented May 22, 2019

☀️ Test successful - checks-travis, status-appveyor
Approved by: oli-obk
Pushing 37ff5d3 to master...

@bors bors added the merged-by-bors label May 22, 2019

@bors bors merged commit ce2ee30 into rust-lang:master May 22, 2019

2 checks passed

Travis CI - Pull Request Build Passed
Details
homu Test successful
Details

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this pull request Jul 5, 2019

he
Update rust to version 1.36.0
Pkgsrc changes:
 * NetBSD/sparc64 disabling of "packed" removed ("packed" removed upstream)
 * Adapt src_libstd_build.rs patch, update sed'ing of .cargo-checksum.json

Build verified on NetBSD 8.0/amd64.

Upstream changes:

Version 1.36.0 (2019-07-04)
==========================

Language
--------
- [Non-Lexical Lifetimes are now enabled on the 2015 edition.][59114]
- [The order of traits in trait objects no longer affects the semantics of that
  object.][59445] e.g. `dyn Send + fmt::Debug` is now equivalent to
  `dyn fmt::Debug + Send`, where this was previously not the case.

Libraries
---------
- [`HashMap`'s implementation has been replaced with `hashbrown::HashMap` implem
entation.][58623]
- [`TryFromSliceError` now implements `From<Infallible>`.][60318]
- [`mem::needs_drop` is now available as a const fn.][60364]
- [`alloc::Layout::from_size_align_unchecked` is now available as a const fn.][6
0370]
- [`String` now implements `BorrowMut<str>`.][60404]
- [`io::Cursor` now implements `Default`.][60234]
- [Both `NonNull::{dangling, cast}` are now const fns.][60244]
- [The `alloc` crate is now stable.][59675] `alloc` allows you to use a subset
  of `std` (e.g. `Vec`, `Box`, `Arc`) in `#![no_std]` environments if the
  environment has access to heap memory allocation.
- [`String` now implements `From<&String>`.][59825]
- [You can now pass multiple arguments to the `dbg!` macro.][59826] `dbg!` will
  return a tuple of each argument when there is multiple arguments.
- [`Result::{is_err, is_ok}` are now `#[must_use]` and will produce a warning if
  not used.][59648]

Stabilized APIs
---------------
- [`VecDeque::rotate_left`]
- [`VecDeque::rotate_right`]
- [`Iterator::copied`]
- [`io::IoSlice`]
- [`io::IoSliceMut`]
- [`Read::read_vectored`]
- [`Write::write_vectored`]
- [`str::as_mut_ptr`]
- [`mem::MaybeUninit`]
- [`pointer::align_offset`]
- [`future::Future`]
- [`task::Context`]
- [`task::RawWaker`]
- [`task::RawWakerVTable`]
- [`task::Waker`]
- [`task::Poll`]

Cargo
-----
- [Cargo will now produce an error if you attempt to use the name of a required
dependency as a feature.][cargo/6860]
- [You can now pass the `--offline` flag to run cargo without accessing the netw
ork.][cargo/6934]

You can find further change's in [Cargo's 1.36.0 release notes][cargo-1-36-0].

Clippy
------
There have been numerous additions and fixes to clippy, see [Clippy's 1.36.0 rel
ease notes][clippy-1-36-0] for more details.

Misc
----

Compatibility Notes
-------------------
- [`std::arch::x86::_rdtsc` returns `u64` instead of `i64`][stdsimd/559]
- [`std::arch::x86_64::_mm_shuffle_ps` takes an `i32` instead of `u32` for `mask
`][stdsimd/522]
- With the stabilisation of `mem::MaybeUninit`, `mem::uninitialized` use is no
  longer recommended, and will be deprecated in 1.38.0.

[60318]: rust-lang/rust#60318
[60364]: rust-lang/rust#60364
[60370]: rust-lang/rust#60370
[60404]: rust-lang/rust#60404
[60234]: rust-lang/rust#60234
[60244]: rust-lang/rust#60244
[58623]: rust-lang/rust#58623
[59648]: rust-lang/rust#59648
[59675]: rust-lang/rust#59675
[59825]: rust-lang/rust#59825
[59826]: rust-lang/rust#59826
[59445]: rust-lang/rust#59445
[59114]: rust-lang/rust#59114
[cargo/6860]: rust-lang/cargo#6860
[cargo/6934]: rust-lang/cargo#6934
[`VecDeque::rotate_left`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.rotate_left
[`VecDeque::rotate_right`]: https://doc.rust-lang.org/std/collections/struct.VecDeque.html#method.rotate_right
[`Iterator::copied`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#tymethod.copied
[`io::IoSlice`]: https://doc.rust-lang.org/std/io/struct.IoSlice.html
[`io::IoSliceMut`]: https://doc.rust-lang.org/std/io/struct.IoSliceMut.html
[`Read::read_vectored`]: https://doc.rust-lang.org/std/io/trait.Read.html#method.read_vectored
[`Write::write_vectored`]: https://doc.rust-lang.org/std/io/trait.Write.html#method.write_vectored
[`str::as_mut_ptr`]: https://doc.rust-lang.org/std/primitive.str.html#method.as_mut_ptr
[`mem::MaybeUninit`]: https://doc.rust-lang.org/std/mem/union.MaybeUninit.html
[`pointer::align_offset`]: https://doc.rust-lang.org/std/primitive.pointer.html#method.align_offset
[`future::Future`]: https://doc.rust-lang.org/std/future/trait.Future.html
[`task::Context`]: https://doc.rust-lang.org/beta/std/task/struct.Context.html
[`task::RawWaker`]: https://doc.rust-lang.org/beta/std/task/struct.RawWaker.html
[`task::RawWakerVTable`]: https://doc.rust-lang.org/beta/std/task/struct.RawWakerVTable.html
[`task::Waker`]: https://doc.rust-lang.org/beta/std/task/struct.Waker.html
[`task::Poll`]: https://doc.rust-lang.org/beta/std/task/enum.Poll.html
[clippy-1-36-0]: https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md#rust-136
[cargo-1-36-0]: https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-136-2019-07-04
[stdsimd/522]: rust-lang/stdarch#522
[stdsimd/559]: rust-lang/stdarch#559
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.