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

[do not merge] Test parallel queries #56765

Open
wants to merge 3 commits into
base: master
from

Conversation

Projects
None yet
@Zoxc
Copy link
Contributor

Zoxc commented Dec 13, 2018

Let's see if I have more luck

r? @michaelwoerister

@Zoxc

This comment has been minimized.

Copy link
Contributor

Zoxc commented Dec 13, 2018

@bors try

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 13, 2018

⌛️ Trying commit 0e76967 with merge 2d81646...

bors added a commit that referenced this pull request Dec 13, 2018

Auto merge of #56765 - Zoxc:pq-test, r=<try>
[do not merge] Test parallel queries

Let's see if I have more luck

r? @michaelwoerister
@michaelwoerister

This comment has been minimized.

Copy link
Contributor

michaelwoerister commented Dec 13, 2018

I was able to do a local perf.rlo run last we week. I'll post the results here if this doesn't succeed.

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 13, 2018

💔 Test failed - status-travis

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

rust-highfive commented Dec 13, 2018

The job dist-x86_64-linux 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_fold:end:services

travis_fold:start:git.checkout
travis_time:start:064da348
$ git clone --depth=2 --branch=try https://github.com/rust-lang/rust.git rust-lang/rust
---
[02:59:00] [ 53%] Building CXX object lib/Transforms/Scalar/CMakeFiles/LLVMScalarOpts.dir/ConstantProp.cpp.o
[02:59:09] [ 53%] Building CXX object lib/Transforms/InstCombine/CMakeFiles/LLVMInstCombine.dir/InstCombineVectorOps.cpp.o
[02:59:19] [ 53%] Building CXX object lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MachineOptimizationRemarkEmitter.cpp.o

Broadcast message from root@travis-job-4836455b-5ea9-47ca-9cc3-5ef69ddf168f
 (unknown) at 9:08 ...
The system is going down for power off NOW!

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)

@michaelwoerister

This comment has been minimized.

Copy link
Contributor

michaelwoerister commented Dec 13, 2018

@bors retry

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 13, 2018

⌛️ Trying commit 0e76967 with merge b98d215...

bors added a commit that referenced this pull request Dec 13, 2018

Auto merge of #56765 - Zoxc:pq-test, r=<try>
[do not merge] Test parallel queries

Let's see if I have more luck

r? @michaelwoerister
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 13, 2018

💔 Test failed - status-travis

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

rust-highfive commented Dec 13, 2018

The job dist-x86_64-linux 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_fold:end:services

travis_fold:start:git.checkout
travis_time:start:14c874ad
$ git clone --depth=2 --branch=try https://github.com/rust-lang/rust.git rust-lang/rust
---
[01:24:40] 
[01:24:41]     Checking syntax_ext v0.0.0 (/checkout/src/libsyntax_ext)
[01:24:41]  Documenting rustc v0.0.0 (/checkout/src/librustc)
[01:24:41]  Documenting syntax_ext v0.0.0 (/checkout/src/libsyntax_ext)
[01:24:43] error[E0275]: overflow evaluating the requirement `std::vec::Vec<syntax::ptr::P<syntax::ast::Expr>>: std::marker::Sync`
[01:24:43]   |
[01:24:43]   = help: consider adding a `#![recursion_limit="128"]` attribute to your crate
[01:24:43]   = note: required because it appears within the type `syntax::ast::ExprKind`
[01:24:43]   = note: required because it appears within the type `syntax::ast::Expr`
[01:24:43]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::Expr>`
[01:24:43]   = note: required because it appears within the type `std::boxed::Box<syntax::ast::Expr>`
[01:24:43]   = note: required because it appears within the type `syntax::ptr::P<syntax::ast::Expr>`
[01:24:43]   = note: required because it appears within the type `syntax::ast::AnonConst`
[01:24:43]   = note: required because it appears within the type `syntax::ast::TyKind`
[01:24:43]   = note: required because it appears within the type `syntax::ast::Ty`
[01:24:43]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::Ty>`
[01:24:43]   = note: required because it appears within the type `std::boxed::Box<syntax::ast::Ty>`
[01:24:43]   = note: required because it appears within the type `syntax::ptr::P<syntax::ast::Ty>`
[01:24:43]   = note: required because it appears within the type `syntax::ast::GenericArg`
[01:24:43]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::GenericArg>`
[01:24:43]   = note: required because it appears within the type `alloc::raw_vec::RawVec<syntax::ast::GenericArg>`
[01:24:43]   = note: required because it appears within the type `std::vec::Vec<syntax::ast::GenericArg>`
[01:24:43]   = note: required because it appears within the type `syntax::ast::AngleBracketedArgs`
[01:24:43]   = note: required because it appears within the type `syntax::ast::GenericArgs`
[01:24:43]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::GenericArgs>`
[01:24:43]   = note: required because it appears within the type `std::boxed::Box<syntax::ast::GenericArgs>`
[01:24:43]   = note: required because it appears within the type `syntax::ptr::P<syntax::ast::GenericArgs>`
[01:24:43]   = note: required because it appears within the type `std::option::Option<syntax::ptr::P<syntax::ast::GenericArgs>>`
[01:24:43]   = note: required because it appears within the type `syntax::ast::PathSegment`
[01:24:43]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::PathSegment>`
[01:24:43]   = note: required because it appears within the type `alloc::raw_vec::RawVec<syntax::ast::PathSegment>`
[01:24:43]   = note: required because it appears within the type `std::vec::Vec<syntax::ast::PathSegment>`
[01:24:43]   = note: required because it appears within the type `syntax::ast::Path`
[01:24:43]   = note: required because it appears within the type `syntax::ast::Attribute`
[01:24:43]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::Attribute>`
[01:24:43]   = note: required because it appears within the type `alloc::raw_vec::RawVec<syntax::ast::Attribute>`
[01:24:43]   = note: required because it appears within the type `std::vec::Vec<syntax::ast::Attribute>`
[01:24:43]   = note: required because it appears within the type `syntax::ast::Item`
[01:24:43]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::Item>`
[01:24:43]   = note: required because it appears within the type `std::boxed::Box<syntax::ast::Item>`
[01:24:43]   = note: required because it appears within the type `syntax::ptr::P<syntax::ast::Item>`
[01:24:43]   = note: required because it appears within the type `syntax::parse::token::Nonterminal`
[01:24:43]   = note: required because it appears within the type `(syntax::parse::token::Nonterminal, syntax::parse::token::LazyTokenStream)`
[01:24:43]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::sync::Arc<(syntax::parse::token::Nonterminal, syntax::parse::token::LazyTokenStream)>`
[01:24:43]   = note: required because it appears within the type `syntax::parse::token::Token`
[01:24:43]   = note: required because it appears within the type `syntax::tokenstream::TokenTree`
[01:24:43]   = note: required because it appears within the type `syntax::tokenstream::TokenStreamKind`
[01:24:43]   = note: required because it appears within the type `syntax::tokenstream::TokenStream`
[01:24:43]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::tokenstream::TokenStream>`
[01:24:43]   = note: required because it appears within the type `alloc::raw_vec::RawVec<syntax::tokenstream::TokenStream>`
[01:24:43]   = note: required because it appears within the type `std::vec::Vec<syntax::tokenstream::TokenStream>`
[01:24:43]   = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc<std::vec::Vec<syntax::tokenstream::TokenStream>>`
[01:24:43]   = note: required because it appears within the type `syntax::util::RcVec<syntax::tokenstream::TokenStream>`
[01:24:43] error: Could not document `syntax_ext`.
[01:24:43] 
[01:24:43] Caused by:
[01:24:43] Caused by:
[01:24:43]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustdoc --crate-name syntax_ext src/libsyntax_ext/lib.rs --color always --target x86_64-unknown-linux-gnu -o /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/doc -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps --extern fmt_macros=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libfmt_macros-8239fefad5bc759d.rmeta --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-aeb8a81c811b0b35.rmeta --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-b765a9dc216fc88d.rmeta --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-31246a3b2649fa63.rmeta --extern rustc_target=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-a0a7c26140788693.rmeta --extern smallvec=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsmallvec-d6753d7706de69ac.rmeta --extern syntax=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax-5aa2face1b26e88c.rmeta --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-cf4d5923473a267b.rmeta --document-private-items` (exit code: 1)
[01:25:34] warning: `[xxx]` cannot be resolved, ignoring it...
[01:25:34]   --> src/librustc/hir/intravisit.rs:55:11
[01:25:34]    |
[01:25:34] 55 |     /// #[xxx] pub async/const/extern "Abi" fn foo()
---
[01:25:34] 
[01:25:38] error: build failed
[01:25:38] 
[01:25:38] 
[01:25:38] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "doc" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--no-deps" "-p" "rustc_llvm" "-p" "rustc_incremental" "-p" "syntax" "-p" "fmt_macros" "-p" "rustc_mir" "-p" "serialize" "-p" "syntax_pos" "-p" "rustc_allocator" "-p" "rustc_resolve" "-p" "rustc_driver" "-p" "rustc_traits" "-p" "rustc_errors" "-p" "rustc_fs_util" "-p" "rustc_borrowck" "-p" "graphviz" "-p" "rustc" "-p" "rustc_apfloat" "-p" "rustc_typeck" "-p" "syntax_ext" "-p" "rustc_metadata" "-p" "rustc_codegen_llvm" "-p" "build_helper" "-p" "rustc_target" "-p" "rustc_passes" "-p" "rustc_save_analysis" "-p" "rustc_plugin" "-p" "rustc_platform_intrinsics" "-p" "rustc_lint" "-p" "rustc_codegen_ssa" "-p" "rustc_codegen_utils" "-p" "rustc_data_structures" "-p" "rustc_privacy" "-p" "arena"
[01:25:38] 
[01:25:38] 
[01:25:38] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap dist --host x86_64-unknown-linux-gnu --target x86_64-unknown-linux-gnu
[01:25:38] Build completed unsuccessfully in 1:20:52
---
travis_time:end:132ea85e:start=1544703039804753742,finish=1544703039816286796,duration=11533054
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:09ec63d0
$ 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:024c2187
travis_time:start:024c2187
$ 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:1e66e69e
$ 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

rust-highfive commented Dec 13, 2018

The job x86_64-gnu-llvm-5.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:050eab2f:start=1544716747421564043,finish=1544716831066624575,duration=83645060532
$ 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
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
travis_time:start:test_ui
Check compiletest suite=ui mode=ui (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:44:50] 
[00:44:50] running 5170 tests
[00:44:53] ............................F..................................................F....F....F.........F 100/5170
[00:44:56] .............................................................................FF.......F....F.FF..F.F 200/5170
[00:44:59] .......F.FFFFFF.........F.FF.FF...F..FFF.F.FF.....F..F..F.................FF.F.FF..........F....FF.. 300/5170
[00:45:02] ..F.....F..F......FFF...F..F.........F..........F..F..F.........F...............F.....F...F......... 400/5170
[00:45:05] ..................FFF.FF...FFF.FF...F......FF....F.FF..................F................F.......F... 500/5170
[00:45:09] ............FF................i........F........F................................................... 600/5170
[00:45:12] .................................F.....F..........................................F................. 700/5170
[00:45:18] ................................F................................FF..F....FF...FF...........F....... 800/5170
[00:45:22] .i...............i.......................F....F.......................FFFF.......F...........F..F... 900/5170
[00:45:25] .......F...F............iiiii...............F...........................F........................... 1000/5170
[00:45:28] .............................................F...................................................... 1100/5170
[00:45:31] .................................F....................F................F............................ 1200/5170
[00:45:36] .................................................................................................... 1400/5170
[00:45:38] .................................................................................................... 1500/5170
[00:45:38] .................................................................................................... 1500/5170
[00:45:41] ............................i..........................FF..............................F.......F.i.. 1600/5170
[00:45:44] ..........................................F.F....................................................... 1700/5170
[00:45:48] .................................................F.................................................. 1800/5170
[00:45:51] ..............F.........................................................................F........... 1900/5170
[00:45:55] ........................................i............................FF....F........................ 2000/5170
[00:45:58] ................F................................................................................... 2100/5170
[00:46:02] ......................F........................................................................F.... 2200/5170
[00:46:06] ......F............................................................................................. 2300/5170
[00:46:10] ...................................................................................................F 2400/5170
[00:46:14] .................................................................................................... 2500/5170
[00:46:17] ................................F...............................F................................... 2600/5170
[00:46:22] .................F.F...........................................FF.....................F............. 2700/5170
[00:46:25] ....................................................F.............................F................. 2800/5170
[00:46:28] ......................................................................F.F.FF........................ 2900/5170
[00:46:32] .............................F......................................................F......F....F... 3000/5170
[00:46:35] .......F.F...................................F.................F.....................i.............. 3100/5170
[00:46:38] ..............................................................................F.........FF.......... 3200/5170
[00:46:42] ..F...........F.FF........F.....................ii..i..ii.................F.F...F..................F 3300/5170
[00:46:45] ...............FFFFF..................F.F...............F...F...............F.F.....F............... 3400/5170
[00:46:49] F.....FF..F...........F.F....FF..........F.....FFFF..FF..F.FF..F..F.FFFF..F.......FF....FF.....FFF.F 3500/5170
[00:46:52] F................................ii.....................F.....F..................................... 3600/5170
[00:46:55] .................................................................................................... 3800/5170
[00:46:56] ........i........................................................................................... 3900/5170
[00:46:56] ........i........................................................................................... 3900/5170
[00:47:01] ..........................F.......F......................................................F.......F.. 4000/5170
[00:47:09] ...................................F...........F.......................................FFF.....F.F.F 4100/5170
[00:47:12] .F...F............FF............FF......F..F.F......FF.........FF...............F.......F.....F..... 4200/5170
[00:47:15] .......F.F.........F........................F........................................F...F.......... 4300/5170
[00:47:19] ..........F........................F...i............................................................ 4400/5170
[00:47:24] .................................................................................................... 4500/5170
[00:47:28] ...............................F.FF.F......F........F................F.F....F.....F....F............ 4600/5170
[00:47:31] .F.F....................F............F...........F................................FF.....F.F.......F 4700/5170
[00:47:34] F........................i..........F....................................F........................F. 4800/5170
[00:47:38] F......F..........F........FF...................................F...........F..................F..FF 4900/5170
[00:47:43] ................................F..F...................................F.FFFF.FFFFF...............F. 5100/5170
[00:47:45] .........i.......................F.F.........................F........
[00:47:45] 
[00:47:45] ---- [ui] ui/allocator/not-an-allocator.rs stdout ----
[00:47:45] diff of stderr:
[00:47:45] 
[00:47:45] 
[00:47:45] 4 LL | static A: usize = 0;
[00:47:45] 5    | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`
[00:47:45] -    = note: required by `std::alloc::GlobalAlloc::alloc`
[00:47:45] +    = note: required by `std::alloc::GlobalAlloc::dealloc`
[00:47:45] 8 
[00:47:45] 9 error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
[00:47:45] 9 error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
[00:47:45] 10   --> $DIR/not-an-allocator.rs:12:1
[00:47:45] 
[00:47:45] 12 LL | static A: usize = 0;
[00:47:45] 13    | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`
[00:47:45] -    = note: required by `std::alloc::GlobalAlloc::dealloc`
[00:47:45] +    = note: required by `std::alloc::GlobalAlloc::realloc`
[00:47:45] 16 
[00:47:45] 17 error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
[00:47:45] 17 error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
[00:47:45] 18   --> $DIR/not-an-allocator.rs:12:1
[00:47:45] 
[00:47:45] 20 LL | static A: usize = 0;
[00:47:45] 21    | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`
[00:47:45] -    = note: required by `std::alloc::GlobalAlloc::realloc`
[00:47:45] +    = note: required by `std::alloc::GlobalAlloc::alloc`
[00:47:45] 24 
[00:47:45] 25 error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
[00:47:45] 25 error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
[00:47:45] 26   --> $DIR/not-an-allocator.rs:12:1
[00:47:45] 
[00:47:45] 
[00:47:45] The actual stderr differed from the expected stderr.
[00:47:45] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/allocator/not-an-allocator/not-an-allocator.stderr
[00:47:45] To update references, rerun the tests and pass the `--bless` flag
[00:47:45] To only update this specific test, also pass `--test-args allocator/not-an-allocator.rs`
[00:47:45] error: 1 errors occurred comparing output.
[00:47:45] status: exit code: 1
[00:47:45] status: exit code: 1
[00:47:45] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/allocator/not-an-allocator.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/allocator/not-an-allocator/a" "-Crpath" "-O" "-Zunstable-options    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/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":true,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":"the trait `std::alloc::GlobalAlloc` is not implemented for `usize`","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":false,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[global_allocator]","def_site_span":null}}],"children":[{"message":"required by `std::alloc::GlobalAlloc::dealloc`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied\n  --> /checkout/src/test/ui/allocator/not-an-allocator.rs:12:1\n   |\nLL | static A: usize = 0;\n   | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`\n   |\n   = note: required by `std::alloc::GlobalAlloc::dealloc`\n\n"}
[00:47:45] {"message":"the trait bound `usize: std::alloc::GlobalAlloc` 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/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":true,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":"the trait `std::alloc::GlobalAlloc` is not implemented for `usize`","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":false,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[global_allocator]","def_site_span":null}}],"children":[{"message":"required by `std::alloc::GlobalAlloc::realloc`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied\n  --> /checkout/src/test/ui/allocator/not-an-allocator.rs:12:1\n   |\nLL | static A: usize = 0;\n   | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`\n   |\n   = note: required by `std::alloc::GlobalAlloc::realloc`\n\n"}
[00:47:45] {"message":"the trait bound `usize: std::alloc::GlobalAlloc` 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/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":true,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":"the trait `std::alloc::GlobalAlloc` is not implemented for `usize`","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":false,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[global_allocator]","def_site_span":null}}],"children":[{"message":"required by `std::alloc::GlobalAlloc::alloc`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied\n  --> /checkout/src/test/ui/allocator/not-an-allocator.rs:12:1\n   |\nLL | static A: usize = 0;\n   | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`\n   |\n   = note: required by `std::alloc::GlobalAlloc::alloc`\n\n"}
[00:47:45] {"message":"the trait bound `usize: std::alloc::GlobalAlloc` 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/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":true,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":"the trait `std::alloc::GlobalAlloc` is not implemented for `usize`","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":false,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[global_allocator]","def_site_span":null}}],"t `Blue`
[00:47:45] 25    = note: expected type `Black`
[00:47:45] 26               found type `Blue`
[00:47:45] 
[00:47:45] 27 
[00:47:45] 27 
[00:47:45] 28 error[E0308]: mismatched types
[00:47:45] -   --> $DIR/associated-type-projection-from-supertrait.rs:51:28
[00:47:45] +   --> $DIR/associated-type-projection-from-supertrait.rs:44:23
[00:47:45] 30    |
[00:47:45] - LL | fn g() { ModelU.chip_paint(Black); } //~ ERROR mismatched types
[00:47:45] -    |                            ^^^^^ expected struct `Blue`, found struct `Black`
[00:47:45] + LL | fn c() { dent(ModelU, Black); } //~ ERROR mismatched types
[00:47:45] +    |                       ^^^^^ expected struct `Blue`, found struct `Black`
[00:47:45] 34    = note: expected type `Blue`
[00:47:45] 35               found type `Black`
[00:47:45] 
[00:47:45] 
[00:47:45] 
[00:47:45] The actual stderr differed from the expected stderr.
[00:47:45] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-type/associated-type-projection-from-supertrait/associated-type-projection-from-supertrait.stderr
[00:47:45] To update references, rerun the tests and pass the `--bless` flag
[00:47:45] To only update this specific test, also pass `--test-args associated-type/associated-type-projection-from-supertrait.rs`
[00:47:45] error: 1 errors occurred comparing output.
[00:47:45] status: exit code: 1
[00:47:45] status: exit code: 1
[00:47:45] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-type/associated-type-projection-from-supertrait/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-type/associated-type-projection-from-supertrait/auxiliary" "-A" "unused"
[00:47:45] ------------------------------------------
[00:47:45] 
[00:47:45] ------------------------------------------
[00:47:45] stderr:
[00:47:45] stderr:
[00:47:45] ------------------------------------------
[00:47:45] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs","byte_start":1548,"byte_end":1552,"line_start":50,"line_end":50,"column_start":28,"column_end":32,"is_primary":true,"text":[{"text":"fn f() { ModelT.chip_paint(Blue); } //~ ERROR mismatched types","highlight_start":28,"highlight_end":32}],"label":"expected struct `Black`, found struct `Blue`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `Black`\n   found type `Blue`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs:50:28\n   |\nLL | fn f() { ModelT.chip_paint(Blue); } //~ ERROR mismatched types\n   |                            ^^^^ expected struct `Black`, found struct `Blue`\n   |\n   = note: expected type `Black`\n              found type `Blue`\n\n"}
[00:47:45] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs","byte_start":1611,"byte_end":1616,"line_start":51,"line_end":51,"column_start":28,"column_end":33,"is_primary":true,"text":[{"text":"fn g() { ModelU.chip_paint(Blacprimary":true,"text":[{"text":"fn c() { dent(ModelU, Black); } //~ ERROR mismatched types","highlight_start":23,"highlight_end":28}],"label":"expected struct `Blue`, found struct `Black`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `Blue`\n   found type `Black`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs:44:23\n   |\nLL | fn c() { dent(ModelU, Black); } //~ ERROR mismatched types\n   |                       ^^^^^ expected struct `Blue`, found struct `Black`\n   |\n   = note: expected type `Blue`\n              found type `Black`\n\n"}
[00:47:45] {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors\n\n"}
[00:47:45] {"message":"For more information about this error, try `rustc --explain E0308`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0308`.\n"}
[00:47:45] ------------------------------------------
[00:47:45] 
[00:47:45] thread '[ui] ui/associated-type/associated-type-projection-from-supertrait.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[00:47:45] 
[00:47:45] 
[00:47:45] ---- [ui] ui/associated-types/associated-types-eq-3.rs stdout ----
[00:47:45] diff of stderr:
[00:47:45] 
[00:47:45] - error[E0308]: mismatched types
[00:47:45] -   --> $DIR/associated-types-eq-3.rs:33:18
[00:47:45] -    |
[00:47:45] - LL |     let _: Bar = x.boo();
[00:47:45] -    |                  ^^^^^^^ expected struct `Bar`, found associated type
[00:47:45] -    = note: expected type `Bar`
[00:47:45] -    = note: expected type `Bar`
[00:47:45] -               found type `<I as Foo>::A`
[00:47:45] - 
[00:47:45] 10 error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`
[00:47:45] 12    |
[00:47:45] 
[00:47:45] 30    = note: expected type `usize`
[00:47:45] 31               found type `Bar`
[00:47:45] 31               found type `Bar`
[00:47:45] 32    = note: required for the cast to the object type `dyn Foo<A=Bar>`
[00:47:45] + error[E0308]: mismatched types
[00:47:45] +   --> $DIR/associated-types-eq-3.rs:33:18
[00:47:45] +    |
[00:47:45] +    |
[00:47:45] + LL |     let _: Bar = x.boo();
[00:47:45] +    |                  ^^^^^^^ expected struct `Bar`, found associated type
[00:47:45] +    = note: expected type `Bar`
[00:47:45] +    = note: expected type `Bar`
[00:47:45] +               found type `<I as Foo>::A`
[00:47:45] 34 error: aborting due to 3 previous errors
[00:47:45] 35 
[00:47:45] 
[00:47:45] 
[00:47:45] 
[00:47:45] The actual stderr differed from the expected stderr.
[00:47:45] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-eq-3/associated-types-eq-3.stderr
[00:47:45] To update references, rerun the tests and pass the `--bless` flag
[00:47:45] To only update this specific test, also pass `--test-args associated-types/associated-types-eq-3.rs`
[00:47:45] error: 1 errors occurred comparing output.
[00:47:45] status: exit code: 1
[00:47:45] status: exit code: 1
[00:47:45] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-types/associated-types-eq-3.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-eq-3/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-eq-3/auxiliary" "-A" "unused"
[00:47:45] ------------------------------------------
[00:47:45] 
[00:47:45] ------------------------------------------
[00:47:45] stderr:
[00:47:45] stderr:
[00:47:45] ------------------------------------------
[00:47:45] {"message":"type mismatch resolving `<isize as Foo>::A == Bar`","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/&1 => {}\n        _ => {}\n    }\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-eq-3.rs","byte_start":1096,"byte_end":1100,"line_start":48,"line_end":48,"column_start":5,"column_end":9,"is_primary":true,"text":[{"text":"    foo1(a);","highlight_start":5,"highlight_end":9}],"label":"expected usize, found struct `Bar`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `usize`\n   found type `Bar`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by `foo1`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-eq-3.rs","byte_start":736,"byte_end":764,"line_start":28,"line_end":28,"column_start":1,"column_end":29,"is_primary":true,"text":[{"text":"fn foo1<I: Foo<A=Bar>>(x: I) {","highlight_start":1,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`\n  --> /checkout/src/test/ui/associated-types/associated-types-eq-3.rs:48:5\n   |\nLL |     foo1(a);\n   |     ^^^^ expected usize, found struct `Bar`\n   |\n   = note: expected type `usize`\n              found type `Bar`\nnote: required by `foo1`\n  --> /checkout/src/test/ui/associated-types/associated-types-eq-3.rs:28:1\n   |\nLL | fn foo1<I: Foo<A=Bar>>(x: I) {\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:47:45] {"message":"type mismatch resolving `<isize as Foo>::A == Bar`","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-eq-3.rs","byte_start":1196,"byte_end":1198,"line_start":51,"line_end":51,"column_start":9,"column_end":11,"is_primary":true,"text":[{"text":"    baz(&a);","highlight_start":9,"highlight_end":11}],"label":"expected usize, found struct `Bar`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `usize`\n   found type `Bar`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required for the cast to the object type `dyn Foo<A=Bar>`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`\n  --> /checkout/src/test/ui/associated-types/associated-types-eq-3.rs:51:9\n   |\nLL |     baz(&a);\n   |         ^^ expected usize, found struct `Bar`\n   |\n   = note: expected type `usize`\n              found type `Bar`\n   = note: required for the cast to the object type `dyn Foo<A=Bar>`\n\n"}
[00:47:45] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-eq-3.rs","byte_start":837,"byte_end":844,"line_start":33,"line_end":33,"column_start":18,"column_end":25,"is_primary":true,"text":[{"text":"    let _: Bar = x.boo();","highlight_start":18,"highlight_end":25}],"label":"expected struct `Bar`, found associated type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `Bar`\n   found type `<I as Foo>::A`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/associated-types/associated-types-eq-3.rs:33:18\n   |\nLL |     let _: Bar = x.boo();\n   |                  ^^^^^^^ expected struct `Bar`, found associated type\n   |\n   = note: expected type `Bar`\n              found type `<I as Foo>::A`\n\n"}
[00:47:45] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[00:47:45] {"message":"Some errors occurred: E0271, E0308.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0271, E0308.\n"}
[00:47:45] {"message":"For more information about an error, try `rustc --explain E0271`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0271`.\n"}
[00:47:45] ------------------------------------------
[00:47:45] 
[00:47:45] thread '[ui] ui/associated-types/associated-types-eq-3.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[00:47:45] 
[00:47:45] 
[00:47:45] ---- [ui] ui/associated-types/associated-types-multiple-types-one-trait.rs stdout ----
[00:47:45] diff of stderr:
[00:47:45] 
[00:47:45] - error[E0271]: type mismatch resolving `<T as Foo>::Y == i32`
[00:47:45] -    |
[00:47:45] -    |
[00:47:45] - LL |     want_y(t); //~ ERROR type mismatch
[00:47:45] -    |     ^^^^^^ expected associated type, found i32
[00:47:45] -    |
[00:47:45] -    = note: expected type `<T as Foo>::Y`
[00:47:45] -               found type `i32`
[00:47:45] - note: required by `want_y`
[00:47:45] -    |
[00:47:45] -    |
[00:47:45] - LL | fn want_y<T:Foo<Y=i32>>(t: &T) { }
[00:47:45] - 
[00:47:45] - 
[00:47:45] 15 error[E0271]: type mismatch resolving `<T as Foo>::X == u32`
[00:47:45] 17    |
[00:47:45] 
[00:47:45] 24   --> $DIR/associated-types-multiple-types-one-trait.rs:52:1
[00:47:45] 25    |
[00:47:45] 25    |
[00:47:45] 26 LL | fn want_x<T:Foo<X=u32>>(t: &T) { }
[00:47:45] + 
[00:47:45] + 
[00:47:45] + error[E0271]: type mismatch resolving `<T as Foo>::Y == i32`
[00:47:45] +   --> $DIR/associated-types-multiple-types-one-trait.rs:23:5
[00:47:45] +    |
[00:47:45] + LL |     want_y(t); //~ ERROR type mismatch
[00:47:45] +    |     ^^^^^^ expected associated type, found i32
[00:47:45] +    |
[00:47:45] +    = note: expected type `<T as Foo>::Y`
[00:47:45] +               found type `i32`
[00:47:45] + note: required by `want_y`
[00:47:45] +   --> $DIR/associated-types-multiple-types-one-trait.rs:54:1
[00:47:45] +    |
[00:47:45] + LL | fn want_y<T:Foo<Y=i32>>(t: &T) { }
[00:47:45] 28 
[00:47:45] 29 error: aborting due to 2 previous errors
[00:47:45] 
[00:47:45] 
[00:47:45] 
[00:47:45] The actual stderr differed from the expected stderr.
[00:47:45] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-multiple-types-one-trait/associated-types-multiple-types-one-trait.stderr
[00:47:45] To update references, rerun the tests and pass the `--bless` flag
[00:47:45] To only update this specific test, also pass `--test-args associated-types/associated-types-multiple-types-one-trait.rs`
[00:47:45] error: 1 errors occurred comparing output.
[00:47:45] status: exit code: 1
[00:47:45] status: exit code: 1
[00:47:45] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-types/associated-types-multiple-types-one-trait.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-multiple-types-one-trait/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-multiple-types-one-trait/auxiliary" "-A" "unused"
[00:47:45] ------------------------------------------
[00:47:45] 
[00:47:45] ------------------------------------------
[00:47:45] stderr:
[00:47:45] stderr:
[00:47:45] ------------------------------------------
[00:47:45] {"message":"type mismatch resolving `<T as Foo>::X == u32`","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-multiple-types-one-trait.rs","byte_start":690,"byte_end":696,"line_start":28,"line_end":28,"column_start":5,"column_end":11,"is_primary":true,"text":[{"text":"    want_x(t); //~ ERROR type mismatch","highlight_start":5,"highlight_end":11}],"label":"expected associated type, found u32","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `<T as Foo>::X`\n   found type `u32`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by `want_x`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-multiple-types-one-trait.rs","byte_start":997,"byte_end":1027,"line_start":52,"line_end":52,"column_start":1,"column_end":31,"is_primary":true,"text":[{"text":"fn want_x<T:Foo<X=u32>>(t: &T) { }","highlight_start":1,"highlight_end":31}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0271]: type mismatch resolving `<T as Foo>::X == u32`\n  --> /checkout/src/test/ui/associated-types/associated-types-multiple-types-one-trait.rs:28:5\n   |\nLL |     want_x(t); //~ ERROR type mismatch\n   |     ^^^^^^ expected associated type, found u32\n   |\n   = note: expected type `<T as Foo>::X`\n              found type `u32`\nnote: required by `want_x`\n  --> /checkout/src/test/ui/associated-types/associated-types-multiple-types-one-trait.rs:52:1\n   |\nLL | fn want_x<T:Foo<X=u32>>(t: &T) { }\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:47:45] {"message":"type mismatch resolving `<T as Foo>::Y == 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 Assoc45] + error[E0308]: mismatched types
[00:47:45] +   --> $DIR/associated-types-path-2.rs:51:18
[00:47:45] +    |
[00:47:45] + LL |     let _: i32 = f2(2i32);
[00:47:45] +    |                  ^^^^^^^^ expected i32, found u32
[00:47:45] + 
[00:47:45] 37 error[E0277]: the trait bound `u32: Foo` is not satisfied
[00:47:45] 39    |
[00:47:45] 
[00:47:45] 
[00:47:45] 41    |     ^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `u32`
[00:47:45] 43 error[E0308]: mismatched types
[00:47:45] -   --> $DIR/associated-types-path-2.rs:51:18
[00:47:45] +   --> $DIR/associated-types-path-2.rs:29:14
[00:47:45] 45    |
[00:47:45] 45    |
[00:47:45] - LL |     let _: i32 = f2(2i32);
[00:47:45] -    |                  ^^^^^^^^ expected i32, found u32
[00:47:45] + LL |     f1(2i32, 4i32);
[00:47:45] 48 
[00:47:45] 49 error: aborting due to 6 previous errors
[00:47:45] 50 
[00:47:45] 
[00:47:45] 
[00:47:45] 
[00:47:45] The actual stderr differed from the expected stderr.
[00:47:45] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-path-2/associated-types-path-2.stderr
[00:47:45] To update references, rerun the tests and pass the `--bless` flag
[00:47:45] To only update this specific test, also pass `--test-args associated-types/associated-types-path-2.rs`
[00:47:45] error: 1 errors occurred comparing output.
[00:47:45] status: exit code: 1
[00:47:45] status: exit code: 1
[00:47:45] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-types/associated-types-path-2.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-path-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-path-2/auxiliary" "-A" "unused"
[00:47:45] ------------------------------------------
[00:47:45] 
[00:47:45] ------------------------------------------
[00:47:45] stderr:
[00:47:45] stderr:
[00:47:45] ------------------------------------------
[00:47:45] {"message":"the trait bound `u32: Foo` is not satisfied","code":{"code":"E0277","explanation":"\nYou tried to use a type which doesn't implement some trait in a place which\nexpected that trait. Erroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n    fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n    foo.bar();\n}\n\nfn main() {\n    // we now call the method with the i32 type, which doesn't implement\n    // the Foo trait\n    some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n    fn bar(&self);\n}\n\nfn some_func<T: Foo>(foo: T) {\n    foo.bar(); // we can now use this method since i32 implements the\n               // Foo trait\n}\n\2, 4u32);","highlight_start":5,"highlight_end":7}],"label":"the trait `Foo` is not implemented for `u32`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"required by `f1`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-path-2.rs","byte_start":632,"byte_end":664,"line_start":23,"line_end":23,"column_start":1,"column_end":33,"is_primary":true,"text":[{"text":"pub fn f1<T: Foo>(a: T, x: T::A) {}","highlight_start":1,"highlight_end":33}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `u32: Foo` is not satisfied\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:39:5\n   |\nLL |     f1(2u32, 4u32);\n   |     ^^ the trait `Foo` is not implemented for `u32`\n   |\nnote: required by `f1`\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:23:1\n   |\nLL | pub fn f1<T: Foo>(a: T, x: T::A) {}\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:47:45] {"message":"the trait bound `u32: Foo` is not satisfied","code":{"code":"E0277","explanation":"\nYou tried to use a type which doesn't implement some trait in a place which\nexpected that trait. Erroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n    fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n    foo.bar();\n}\n\nfn main() {\n    // we now call the method with the i32 type, which doesn't implement\n    // the Foo trait\n    some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n    fn bar(&self);\n}\n\nfn some_func<T: Foo>(foo: T) {\n    foo.bar(); // we can now use this method since i32 implements the\n               // Foo trait\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n    fn bar(&self) {}\n}\n\nfn main() {\n    some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n    println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n                           //        implemented for the type `T`\n}\n\nfn main() {\n    // We now call the method with the i32 type,\n    // which *does* implement the Debug trait.\n    some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function: Although\nwe only call it with a parameter that does implement `Debug`, the compiler\nstill rejects the function: It must work with all possible input types. In\norder to make this example compile, we need to restrict the generic type we're\naccepting:\n\n```\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(Withoutiated-types/associated-types-path-2.rs","byte_start":1035,"byte_end":1037,"line_start":45,"line_end":45,"column_start":5,"column_end":7,"is_primary":true,"text":[{"text":"    f1(2u32, 4i32);","highlight_start":5,"highlight_end":7}],"label":"the trait `Foo` is not implemented for `u32`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"required by `f1`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-path-2.rs","byte_start":632,"byte_end":664,"line_start":23,"line_end":23,"column_start":1,"column_end":33,"is_primary":true,"text":[{"text":"pub fn f1<T: Foo>(a: T, x: T::A) {}","highlight_start":1,"highlight_end":33}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `u32: Foo` is not satisfied\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:45:5\n   |\nLL |     f1(2u32, 4i32);\n   |     ^^ the trait `Foo` is not implemented for `u32`\n   |\nnote: required by `f1`\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:23:1\n   |\nLL | pub fn f1<T: Foo>(a: T, x: T::A) {}\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:47:45] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-path-2.rs","byte_start":1175,"byte_end":1183,"line_start":51,"line_end":51,"column_start":18,"column_end":26,"is_primary":true,"text":[{"text":"    let _: i32 = f2(2i32);","highlight_start":18,"highlight_end":26}],"label":"expected i32, found u32","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:51:18\n   |\nLL |     let _: i32 = f2(2i32);\n   |                  ^^^^^^^^ expected i32, found u32\n\n"}
[00:47:45] {"message":"the trait bound `u32: Foo` is not satisfied","code":{"code":"E0277","explanation":"\nYou tried to use a type which doesn't implement some trait in a place which\nexpected that trait. Erroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n    fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n    foo.bar();\n}\n\nfn main() {\n    // we now call the method with the i32 type, which doesn't implement\n    // the Foo trait\n    some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n    fn bar(&self);\n}\n\nfn some_func<T: Foo>(foo: T) {\n    foo.bar(); // we can now use this method since i32 implements the\n               // Foo trait\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n    fn bar(&self) {}\n}\n\nfn main() {\n    some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n    println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n                           //        implemented for the type `T`\n}\n\nfn main() {\n    // We now call the method with the i32 type,\n    // which *does* implement the Debug trait.\n    some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function: Although\nwe only call it with a parameter that does implement `Debug`, the compiler\nstill rejects the function: It must work with all possible input types. In\norder to make this example compile, we need to restrict the generic type we're\naccepting:\n\n```\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/associated-types/associated-types-path-2.rs","byte_start":1035,"byte_end":1049,"line_start":45,"line_end":45,"column_start":5,"column_end":19,"is_primary":true,"text":[{"text":"    f1(2u32, 4i32);","highlight_start":5,"highlight_end":19}],"label":"the trait `Foo` is not implemented for `u32`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0277]: the trait bound `u32: Foo` is not satisfied\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:45:5\n   |\nLL |     f1(2u32, 4i32);\n   |     ^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `u32`\n\n"}
[00:47:45] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-path-2.rs","byte_start":754,"byte_end":758,"line_start":29,"line_end":29,"column_start":14,"column_end":18,"is_primary":true,"text":[{"text":"    f1(2i32, 4i32);","highlight_start":14,"highlight_end":18}],"label":"expected u32, found i32","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:29:14\n   |\nLL |     f1(2i32, 4i32);\n   |              ^^^^ expected u32, found i32\n\n"}
[00:47:45] {"message":"aborting due to 6 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 6 previous errors\n\n"}
[00:47:45] {"message":"Some errors occurred: E0277, E0308.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0277, E0308.\n"}
[00:47:45] {"message":"For more information about an error, try `rustc --explain E0277`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0277`.\n"}
[00:47:45] ------------------------------------------
[00:47:45] 
[00:47:45] thread '[ui] ui/associated-types/associated-types-path-2.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[00:47:45] 
[00:47:45] 
[00:47:45] ---- [ui] ui/binop/binop-consume-args.rs stdout ----
[00:47:45] diff of stderr:
[00:47:45] 
[00:47:45] 1 error[E0382]: use of moved value: `lhs`
[00:47:45] +   --> $DIR/binop-consume-args.rs:47:10
[00:47:45] 3    |
[00:47:45] 3    |
[00:47:45] - LL |     lhs + rhs;
[00:47:45] + LL |     lhs & rhs;
[00:47:45] 5    |     --- value moved here
[00:47:45] 6 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:47:45] 7    |          ^^^ value used here after move
[00:47:45] 
[00:47:45] 9    = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
[00:47:45] 10 
[00:47:45] 11 error[E0382]: use of moved value: `rhs`
[00:47:45] +   --> $DIR/binop-consume-args.rs:48:10
[00:47:45] 13    |
[00:47:45] 13    |
[00:47:45] - LL |     lhs + rhs;
[00:47:45] + LL |     lhs & rhs;
[00:47:45] 15    |           --- value moved here
[00:47:45] 16 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:47:45] 17 LL |     drop(rhs);  //~ ERROR use of moved value: `rhs`
[00:47:45] 
[00:47:45] 20    = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
[00:47:45] 21 
[00:47:45] 22 error[E0382]: use of moved value: `lhs`
[00:47:45] +   --> $DIR/binop-consume-args.rs:53:10
[00:47:45] 24    |
[00:47:45] 24    |
[00:47:45] - LL |     lhs - rhs;
[00:47:45] + LL |     lhs | rhs;
[00:47:45] 26    |     --- value moved here
[00:47:45] 27 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:47:45] 28    |          ^^^ value used here after move
[00:47:45] 
[00:47:45] 30    = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
[00:47:45] 31 
[00:47:45] 32 error[E0382]: use of moved value: `rhs`
[00:47:45] +   --> $DIR/binop-consume-args.rs:54:10
[00:47:45] 34    |
[00:47:45] 34    |
[00:47:45] - LL |     lhs - rhs;
[00:47:45] + LL |     lhs | rhs;
[00:47:45] 36    |           --- value moved here
[00:47:45] +   --> $DIR/binop-consume-args.rs:72:10
[00:47:45] 97    |
[00:47:45] 97    |
[00:47:45] - LL |     lhs % rhs;
[00:47:45] -    |           --- value moved here
[00:47:45] + LL |     lhs >> rhs;
[00:47:45] +    |            --- value moved here
[00:47:45] 100 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:47:45] 101 LL |     drop(rhs);  //~ ERROR use of moved value: `rhs`
[00:47:45] 102    |          ^^^ value used here after move
[00:47:45] 
[00:47:45] 104    = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
[00:47:45] 105 
[00:47:45] 106 error[E0382]: use of moved value: `lhs`
[00:47:45] +   --> $DIR/binop-consume-args.rs:29:10
[00:47:45] 108    |
[00:47:45] 108    |
[00:47:45] - LL |     lhs & rhs;
[00:47:45] + LL |     lhs * rhs;
[00:47:45] 110    |     --- value moved here
[00:47:45] 111 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:47:45] 112    |          ^^^ value used here after move
[00:47:45] 
[00:47:45] 114    = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
[00:47:45] 115 
[00:47:45] 116 error[E0382]: use of moved value: `rhs`
[00:47:45] +   --> $DIR/binop-consume-args.rs:30:10
[00:47:45] 118    |
[00:47:45] 118    |
[00:47:45] - LL |     lhs & rhs;
[00:47:45] + LL |     lhs * rhs;
[00:47:45] 120    |           --- value moved here
[00:47:45] 121 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:47:45] 122 LL |     drop(rhs);  //~ ERROR use of moved value: `rhs`
[00:47:45] 
[00:47:45] 125    = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
[00:47:45] 126 
[00:47:45] 127 error[E0382]: use of moved value: `lhs`
[00:47:45] +   --> $DIR/binop-consume-args.rs:35:10
[00:47:45] 129    |
[00:47:45] 129    |
[00:47:45] - LL |     lhs | rhs;
[00:47:45] + LL |     lhs / rhs;
[00:47:45] 131    |     --- value moved here
[00:47:45] 132 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:47:45] 133    |          ^^^ value used here after move
[00:47:45] 
[00:47:45] 135    = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
[00:47:45] 136 
[00:47:45] 137 error[E0382]: use of moved value: `rhs`
[00:47:45] +   --> $DIR/binop-consume-args.rs:36:10
[00:47:45] 139    |
[00:47:45] 139    |
[00:47:45] - LL |     lhs | rhs;
[00:47:45] + LL |     lhs / rhs;
[00:47:45] 141    |           --- value moved here
[00:47:45] 142 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:47:45] 143 LL |     drop(rhs);  //~ ERROR use of moved value: `rhs`
[00:47:45] 
[00:47:45] 146    = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
[00:47:45] 147 
[00:47:45] 148 error[E0382]: use of moved value: `lhs`
[00:47:45] +   --> $DIR/binop-consume-args.rs:41:10
[00:47:45] 150    |
[00:47:45] 150    |
[00:47:45] - LL |     lhs ^ rhs;
[00:47:45] + LL |     lhs % rhs;
[00:47:45] 152    |     --- value moved here
[00:47:45] 153 LL |     drop(lhs);  //~ ERROR use of moved + LL |     lhs - rhs;
[00:47:45] +    |           --- value moved here
[00:47:45] 184 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:47:45] 185 LL |     drop(rhs);  //~ ERROR use of moved value: `rhs`
[00:47:45] 186    |          ^^^ value used here after move
[00:47:45] 
[00:47:45] 188    = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
[00:47:45] 189 
[00:47:45] 190 error[E0382]: use of moved value: `lhs`
[00:47:45] +   --> $DIR/binop-consume-args.rs:17:10
[00:47:45] 192    |
[00:47:45] 192    |
[00:47:45] - LL |     lhs >> rhs;
[00:47:45] + LL |     lhs + rhs;
[00:47:45] 194    |     --- value moved here
[00:47:45] 195 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:47:45] 196    |          ^^^ value used here after move
[00:47:45] 
[00:47:45] 198    = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
[00:47:45] 199 
[00:47:45] 200 error[E0382]: use of moved value: `rhs`
[00:47:45] +   --> $DIR/binop-consume-args.rs:18:10
[00:47:45] 202    |
[00:47:45] 202    |
[00:47:45] - LL |     lhs >> rhs;
[00:47:45] -    |            --- value moved here
[00:47:45] + LL |     lhs + rhs;
[00:47:45] +    |           --- value moved here
[00:47:45] 205 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:47:45] 206 LL |     drop(rhs);  //~ ERROR use of moved value: `rhs`
[00:47:45] 207    |          ^^^ value used here after move
[00:47:45] 
[00:47:45] The actual stderr differed from the expected stderr.
[00:47:45] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/binop/binop-consume-args/binop-consume-args.stderr
[00:47:45] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/binop/binop-consume-args/binop-consume-args.stderr
[00:47:45] To update references, rerun the tests and pass the `--bless` flag
[00:47:45] To only update this specific test, also pass `--test-args binop/binop-consume-args.rs`
[00:47:45] error: 1 errors occurred comparing output.
[00:47:45] status: exit code: 1
[00:47:45] status: exit code: 1
[00:47:45] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/binop/binop-consume-args.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/binop/binop-consume-args/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/binop/binop-consume-args/auxiliary" "-A" "unused"
[00:47:45] ------------------------------------------
[00:47:45] 
[00:47:45] ------------------------------------------
[00:47:45] stderr:
[00:47:45] stderr:
[00:47:45] ------------------------------------------
[00:47:45] {"message":"use of moved value: `lhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1517,"byte_end":1520,"line_start":46,"line_end":46,"column_start":5,"column_end":8,"is_primary":false,"text":[{"text":"    lhs & rhs;","highlight_start":5,"highlight_end":8}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `lhs` has type `A`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `lhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:47:10\n   |\nLL |     lhs & rhs;\n   |     --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait\n\n"}
[00:47:45] {"message":"use of moved value: `rhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own tsted_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1523,"byte_end":1526,"line_start":46,"line_end":46,"column_start":11,"column_end":14,"is_primary":false,"text":[{"text":"    lhs & rhs;","highlight_start":11,"highlight_end":14}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `rhs` has type `B`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `rhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:48:10\n   |\nLL |     lhs & rhs;\n   |           --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\nLL |     drop(rhs);  //~ ERROR use of moved value: `rhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait\n\n"}
[00:47:45] {"message":"use of moved value: `lhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1713,"byte_end":1716,"line_start":53,"line_end":53,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(lhs);  //~ ERROR use of moved value: `lhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1693,"byte_end":1696,"line_start":52,"line_end":52,"column_start":5,"column_end":8,"is_primary":false,"text":[{"text":"    lhs | rhs;","highlight_start":5,"highlight_end":8}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `lhs` has type `A`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `lhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:53:10\n   |\nLL |     lhs | rhs;\n   |     --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait\n\n"}
[00:47:45] {"message":"use of moved value: `rhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1765,"byte_end":1768,"line_start":54,"line_end":54,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(rhs);  //~ ERROR use of moved value: `rhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1699,"byte_end":1702,"line_start":52,"line_end":52,"column_start":11,"column_end":14,"is_primary":false,"text":[{"text":"    lhs | rhs;","highlight_start":11,"highlight_end":14}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `rhs` has type `B`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `rhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:54:10\n   |\nLL |     lhs | rhs;\n   |           --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\nLL |     drop(rhs);  //~ ERROR use of moved value: `rhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait\n\n"}
[00:47:45] {"message":"use of moved value: `lhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p:11,"column_end":14,"is_primary":false,"text":[{"text":"    lhs ^ rhs;","highlight_start":11,"highlight_end":14}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `rhs` has type `B`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `rhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:60:10\n   |\nLL |     lhs ^ rhs;\n   |           --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\nLL |     drop(rhs);  //~ ERROR use of moved value: `rhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait\n\n"}
[00:47:45] {"message":"use of moved value: `lhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1`&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":2116,"byte_end":2119,"line_start":66,"line_end":66,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(rhs);  //~ ERROR use of moved value: `rhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":2050,"byte_end":2053,"line_start":64,"line_end":64,"column_start":12,"column_end":15,"is_primary":false,"text":[{"text":"    lhs << rhs;","highlight_start":12,"highlight_end":15}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `rhs` has type `B`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `rhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:66:10\n   |\nLL |     lhs << rhs;\n   |            --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\nLL |     drop(rhs);  //~ ERROR use of moved value: `rhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait\n\n"}
[00:47:45] {"message":"use of moved value: `lhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n``ut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":2237,"byte_end":2240,"line_start":71,"line_end":71,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(lhs);  //~ ERROR use of moved value: `lhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":2216,"byte_end":2219,"line_start":70,"line_end":70,"column_start":5,"column_end":8,"is_primary":false,"text":[{"text":"    lhs >> rhs;","highlight_start":5,"highlight_end":8}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `lhs` has type `A`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `lhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:71:10\n   |\nLL |     lhs >> rhs;\n   |     --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait\n\n"}
[00:47:45] {"message":"use of moved value: `rhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":2289,"byte_end":2292,"line_start":72,"line_end":72,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(rhs);  //~ ERROR use of moved value: `rhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":2223,"byte_end":2226,"line_start":70,"line_end":70,"column_start":12,"column_end":15,"is_primary":false,"text":[{"text":"    lhs >> rhs;","highlight_start":12,"highlight_end":15}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `rhs` has type `B`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `rhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:72:10\n   |\nLL |     lhs >> rhs;\n   |            --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\nLL |     drop(rhs);  //~ ERROR use of moved value: `rhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait\n\n"}
[00:47:45] {"message":"use of moved value: `lhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1015,"byte_end":1018,"line_start":29,"line_end":29,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(lhs);  //~ ERROR use of moved value: `lhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":995,"byte_end":998,"line_start":28,"line_end":28,"column_start":5,"column_end":8,"is_primary":false,"text":[{"text":"    lhs * rhs;","highlight_start":5,"highlight_end":8}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `lhs` has type `A`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `lhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:29:10\n   |\nLL |     lhs * rhs;\n   |     --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait\n\n"}
[00:47:45] {"message":"use of moved value: `rhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> uopy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `rhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:30:10\n   |\nLL |     lhs * rhs;\n   |           --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\nLL |     drop(rhs);  //~ ERROR use of moved value: `rhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait\n\n"}
[00:47:45] {"message":"use of moved value: `lhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's defin"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `lhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:35:10\n   |\nLL |     lhs / rhs;\n   |     --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait\n\n"}
[00:47:45] {"message":"use of moved value: `rhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1239,"byte_end":1242,"line_start":36,"line_end":36,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(rhs);  //~ ERROR use of moved value: `rhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1173,"byte_end":1176,"line_start":34,"line_end":34,"column_start":11,"column_end":14,"is_primary":false,"text":[{"text":"    lhs / rhs;","highlight_start":11,"highlight_end":14}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `rhs` has type `B`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: licate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1359,"byte_end":1362,"line_start":41,"line_end":41,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(lhs);  //~ ERROR use of moved value: `lhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1339,"byte_end":1342,"line_start":40,"line_end":40,"column_start":5,"column_end":8,"is_primary":false,"text":[{"text":"    lhs % rhs;","highlight_start":5,"highlight_end":8}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `lhs` has type `A`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `lhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:41:10\n   |\nLL |     lhs % rhs;\n   |     --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait\n\n"}
[00:47:45] {"message":"use of moved value: `rhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1411,"byte_end":1414,"line_start":42,"line_end":42,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(rhs);  //~ ERROR use of moved value: `rhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1345,"byte_end":1348,"line_start":40,"line_end":40,"column_start":11,"column_end":14,"is_primary":false,"text":[{"text":"    lhs % rhs;","highlight_start":11,"highlight_end":14}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `rhs` has type `B`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `rhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:42:10\n   |\nLL |     lhs % rhs;\n   |           --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\nLL |     drop(rhs);  //~ ERROR use of moved value: `rhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait\n\n"}
[00:47:45] {"message":"use of moved value: `lhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::n The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":895,"byte_end":898,"line_start":24,"line_end":24,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(rhs);  //~ ERROR use of moved value: `rhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":829,"byte_end":832,"line_start":22,"line_end":22,"column_start":11,"column_end":14,"is_primary":false,"text":[{"text":"    lhs - rhs;","highlight_start":11,"highlight_end":14}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `rhs` has type `B`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `rhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:24:10\n   |\nLL |     lhs - rhs;\n   |           --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\nLL |     dronstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":671,"byte_end":674,"line_start":17,"line_end":17,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(lhs);  //~ ERROR use of moved value: `lhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":651,"byte_end":654,"line_start":16,"line_end":16,"column_start":5,"column_end":8,"is_primary":false,"text":[{"text":"    lhs + rhs;","highlight_start":5,"highlight_end":8}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `lhs` has type `A`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `lhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:17:10\n   |\nLL |     lhs + rhs;\n   |     --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\n   |          ^^^ value used here after move\nunt type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":723,"byte_end":726,"line_start":18,"line_end":18,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(rhs);  //~ ERROR use of moved value: `rhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":657,"byte_end":660,"line_start":16,"line_end":16,"column_start":11,"column_end":14,"is_primary":false,"text":[{"text":"    lhs + rhs;","highlight_start":11,"highlight_end":14}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `rhs` has type `B`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `rhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:18:10\n   |\nLL |     lhs + rhs;\n   |           --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\nLL |     drop(rhs);  //~ ERROR use of moved value: `rhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait\n\n"}
[00:47:45] {"message":"aborting due to 20 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 20 previous errors\n\n"}
[00:47:45] {"message":"For more information about this error, try `rustc --explain E0382`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0382`.\n"}
[00:47:45] ------------------------------------------
[00:47:45] 
[00:47:45] thread '[ui] ui/binop/binop-consume-args.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[00:47:45] 
[00:47:45] 
[00:47:45] ---- [ui] ui/binop/binop-move-semantics.rs stdout ----
[00:47:45] diff of stderr:
[00:47:45] 
[00:47:45] - error[E0382]: use of moved value: `x`
[00:47:45] -   --> $DIR/binop-move-semantics.rs:18:5
[00:47:45] + error[E0502]: cannot borrow `f` as immutable because it is also borrowed as mutable
[00:47:45] +   --> $DIR/binop-move-semantics.rs:64:6
[00:47:45] 3    |
[00:47:45] - LL |     x
[00:47:45] -    |     - value moved here

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)

@Zoxc

This comment has been minimized.

Copy link
Contributor

Zoxc commented Dec 13, 2018

@bors try

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 13, 2018

⌛️ Trying commit 435a684 with merge 83824a5...

bors added a commit that referenced this pull request Dec 13, 2018

Auto merge of #56765 - Zoxc:pq-test, r=<try>
[do not merge] Test parallel queries

Let's see if I have more luck

r? @michaelwoerister
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 13, 2018

💔 Test failed - status-travis

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

rust-highfive commented Dec 13, 2018

The job dist-x86_64-linux 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_fold:end:services

travis_fold:start:git.checkout
travis_time:start:07f80f94
$ git clone --depth=2 --branch=try https://github.com/rust-lang/rust.git rust-lang/rust
---
[01:45:06]  Documenting rustc_mir v0.0.0 (/checkout/src/librustc_mir)
[01:45:10]  Documenting rustc_incremental v0.0.0 (/checkout/src/librustc_incremental)
[01:45:20]  Documenting rustc_typeck v0.0.0 (/checkout/src/librustc_typeck)
[01:45:20]  Documenting rustc_lint v0.0.0 (/checkout/src/librustc_lint)
[01:45:23] error[E0275]: overflow evaluating the requirement `syntax::ast::FieldPat: std::marker::Sync`
[01:45:23]   |
[01:45:23]   = help: consider adding a `#![recursion_limit="128"]` attribute to your crate
[01:45:23]   = note: required because it appears within the type `syntax::source_map::Spanned<syntax::ast::FieldPat>`
[01:45:23]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::source_map::Spanned<syntax::ast::FieldPat>>`
[01:45:23]   = note: required because it appears within the type `alloc::raw_vec::RawVec<syntax::source_map::Spanned<syntax::ast::FieldPat>>`
[01:45:23]   = note: required because it appears within the type `std::vec::Vec<syntax::source_map::Spanned<syntax::ast::FieldPat>>`
[01:45:23]   = note: required because it appears within the type `syntax::ast::PatKind`
[01:45:23]   = note: required because it appears within the type `syntax::ast::Pat`
[01:45:23]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::Pat>`
[01:45:23]   = note: required because it appears within the type `std::boxed::Box<syntax::ast::Pat>`
[01:45:23]   = note: required because it appears within the type `syntax::ptr::P<syntax::ast::Pat>`
[01:45:23]   = note: required because it appears within the type `syntax::ast::Local`
[01:45:23]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::Local>`
[01:45:23]   = note: required because it appears within the type `std::boxed::Box<syntax::ast::Local>`
[01:45:23]   = note: required because it appears within the type `syntax::ptr::P<syntax::ast::Local>`
[01:45:23]   = note: required because it appears within the type `syntax::ast::StmtKind`
[01:45:23]   = note: required because it appears within the type `syntax::ast::Stmt`
[01:45:23]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::Stmt>`
[01:45:23]   = note: required because it appears within the type `alloc::raw_vec::RawVec<syntax::ast::Stmt>`
[01:45:23]   = note: required because it appears within the type `std::vec::Vec<syntax::ast::Stmt>`
[01:45:23]   = note: required because it appears within the type `syntax::ast::Block`
[01:45:23]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::Block>`
[01:45:23]   = note: required because it appears within the type `std::boxed::Box<syntax::ast::Block>`
[01:45:23]   = note: required because it appears within the type `syntax::ptr::P<syntax::ast::Block>`
[01:45:23]   = note: required because it appears within the type `syntax::ast::ExprKind`
[01:45:23]   = note: required because it appears within the type `syntax::ast::Expr`
[01:45:23]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::Expr>`
[01:45:23]   = note: required because it appears within the type `std::boxed::Box<syntax::ast::Expr>`
[01:45:23]   = note: required because it appears within the type `syntax::ptr::P<syntax::ast::Expr>`
[01:45:23]   = note: required because it appears within the type `syntax::ast::AnonConst`
[01:45:23]   = note: required because it appears within the type `syntax::ast::TyKind`
[01:45:23]   = note: required because it appears within the type `syntax::ast::Ty`
[01:45:23]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::Ty>`
[01:45:23]   = note: required because it appears within the type `std::boxed::Box<syntax::ast::Ty>`
[01:45:23]   = note: required because it appears within the type `syntax::ptr::P<syntax::ast::Ty>`
[01:45:23]   = note: required because it appears within the type `syntax::ast::GenericArg`
[01:45:23]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::GenericArg>`
[01:45:23]   = note: required because it appears within the type `alloc::raw_vec::RawVec<syntax::ast::GenericArg>`
[01:45:23]   = note: required because it appears within the type `std::vec::Vec<syntax::ast::GenericArg>`
[01:45:23]   = note: required because it appears within the type `syntax::ast::AngleBracketedArgs`
[01:45:23]   = note: required because it appears within the type `syntax::ast::GenericArgs`
[01:45:23]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::GenericArgs>`
[01:45:23]   = note: required because it appears within the type `std::boxed::Box<syntax::ast::GenericArgs>`
[01:45:23]   = note: required because it appears within the type `syntax::ptr::P<syntax::ast::GenericArgs>`
[01:45:23]   = note: required because it appears within the type `std::option::Option<syntax::ptr::P<syntax::ast::GenericArgs>>`
[01:45:23]   = note: required because it appears within the type `syntax::ast::PathSegment`
[01:45:23]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::PathSegment>`
[01:45:23]   = note: required because it appears within the type `alloc::raw_vec::RawVec<syntax::ast::PathSegment>`
[01:45:23]   = note: required because it appears within the type `std::vec::Vec<syntax::ast::PathSegment>`
[01:45:23]   = note: required because it appears within the type `syntax::ast::Path`
[01:45:23]   = note: required because it appears within the type `syntax::ast::Attribute`
[01:45:23]   = note: required because it appears within the type `[syntax::ast::Attribute]`
[01:45:23]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<[syntax::ast::Attribute]>`
[01:45:23]   = note: required because it appears within the type `std::boxed::Box<[syntax::ast::Attribute]>`
[01:45:23]   = note: required because it appears within the type `syntax::ptr::P<[syntax::ast::Attribute]>`
[01:45:23]   = note: required because it appears within the type `rustc::hir::GenericParam`
[01:45:23]   = note: required because it appears within the type `[rustc::hir::GenericParam]`
[01:45:23]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<[rustc::hir::GenericParam]>`
[01:45:23]   = note: required because it appears within the type `std::boxed::Box<[rustc::hir::GenericParam]>`
[01:45:23]   = note: required because it appears within the type `syntax::ptr::P<[rustc::hir::GenericParam]>`
[01:45:23]   = note: required because it appears within the type `rustc::hir::Generics`
[01:45:23]   = note: required because it appears within the type `&'tcx rustc::hir::Generics`
[01:45:23]   = note: required because it appears within the type `std::option::Option<&'tcx rustc::hir::Generics>`
[01:45:23]   = note: required because it appears within the type `rustc::lint::LateContext<'a, 'tcx>`
[01:45:23]   = note: required because of the requirements on the impl of `std::marker::Send` for `&'a rustc::lint::LateContext<'a, 'tcx>`
[01:45:23]   = note: required because it appears within the type `types::ImproperCTypesVisitor<'a, 'tcx>`
[01:45:23] error: Could not document `rustc_lint`.
[01:45:23] 
[01:45:23] Caused by:
[01:45:23] Caused by:
[01:45:23]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustdoc --crate-name rustc_lint src/librustc_lint/lib.rs --color always --target x86_64-unknown-linux-gnu -o /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/doc -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-9c5c77c34a03c5e4.rmeta --extern rustc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc-55bb2e998705ec79.rmeta --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/st[01:45:25] warning: `[xxx]` cannot be resolved, ignoring it...
[01:45:25]    |
[01:45:25] 55 |     /// #[xxx] pub async/const/extern "Abi" fn foo()
[01:45:25]    |           ^^^ cannot be resolved, ignoring
[01:45:25]    |
---
[01:45:48] 
[01:45:49] error: build failed
[01:45:49] 
[01:45:49] 
[01:45:49] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "doc" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--no-deps" "-p" "rustc_borrowck" "-p" "arena" "-p" "syntax_ext" "-p" "rustc_platform_intrinsics" "-p" "rustc_codegen_ssa" "-p" "rustc" "-p" "serialize" "-p" "rustc_passes" "-p" "rustc_resolve" "-p" "rustc_apfloat" "-p" "syntax_pos" "-p" "graphviz" "-p" "rustc_plugin" "-p" "rustc_target" "-p" "fmt_macros" "-p" "rustc_save_analysis" "-p" "rustc_traits" "-p" "rustc_driver" "-p" "rustc_errors" "-p" "rustc_data_structures" "-p" "rustc_metadata" "-p" "rustc_incremental" "-p" "rustc_codegen_llvm" "-p" "rustc_llvm" "-p" "rustc_lint" "-p" "rustc_typeck" "-p" "rustc_allocator" "-p" "rustc_privacy" "-p" "syntax" "-p" "rustc_fs_util" "-p" "rustc_mir" "-p" "rustc_codegen_utils" "-p" "build_helper"
[01:45:49] 
[01:45:49] 
[01:45:49] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap dist --host x86_64-unknown-linux-gnu --target x86_64-unknown-linux-gnu
[01:45:49] Build completed unsuccessfully in 1:17:49

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)

@Zoxc Zoxc force-pushed the Zoxc:pq-test branch from 435a684 to 16d6920 Dec 13, 2018

@Zoxc

This comment has been minimized.

Copy link
Contributor

Zoxc commented Dec 13, 2018

@bors try

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 13, 2018

⌛️ Trying commit 16d6920 with merge 4c48bb4...

bors added a commit that referenced this pull request Dec 13, 2018

Auto merge of #56765 - Zoxc:pq-test, r=<try>
[do not merge] Test parallel queries

Let's see if I have more luck

r? @michaelwoerister
@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

rust-highfive commented Dec 13, 2018

The job x86_64-gnu-llvm-5.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:06eb029d:start=1544727628802084094,finish=1544727696109196850,duration=67307112756
$ 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
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
travis_time:start:test_ui
Check compiletest suite=ui mode=ui (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:57:48] 
[00:57:48] running 5170 tests
[00:57:51] ............................F.................................................F........F..F........F 100/5170
[00:57:55] .............................................................................FF..............FF.F..F 200/5170
[00:57:58] ........FFFFF.F.........FF.F.FF..F...FF..FF.F.....F..F...F...............FF..F.F.F..F.....F.....FF.. 300/5170
[00:58:01] ..F...F.F...F.....FF....F..F.........F..........F..F..F.........F...............F....F....F......... 400/5170
[00:58:04] ...................FF..FFF..FFF.F....F.....FF....F.FF..................F................F......F.... 500/5170
[00:58:08] ............FF................i........FF..F....F................................................... 600/5170
[00:58:12] .................................F.....F..........................................F................. 700/5170
[00:58:18] ................................F................................FF..F..F.FF.F.FF...........F....... 800/5170
[00:58:23] .i...............i.......................F..F.........................FFFF........F..........F..F... 900/5170
[00:58:26] ......F....F............iiiii................F.........................F............................ 1000/5170
[00:58:29] .............................................F...................................................... 1100/5170
[00:58:32] ..................................F...................F................F............................ 1200/5170
[00:58:34] .................................................................................................... 1300/5170
[00:58:37] ................F................................................................................... 1400/5170
[00:58:40] .................................................................................................... 1500/5170
[00:58:43] ............................i.........................F.F......................................F.i.. 1600/5170
[00:58:47] ..........................................F......................................................... 1700/5170
[00:58:50] .................................................F.................................................. 1800/5170
[00:58:54] ................F.....................................................................F............. 1900/5170
[00:58:57] ........................................i............................FF.....F....................... 2000/5170
[00:59:01] .................................................................................................... 2100/5170
[00:59:05] ......................F........................................................................F.... 2200/5170
[00:59:14] ...................................................................................................F 2400/5170
[00:59:18] .................................................................................................... 2500/5170
[00:59:18] .................................................................................................... 2500/5170
[00:59:21] ...............................F................................F..F...............F................ 2600/5170
[00:59:26] .................F.F..........F...............................F.F.....................F............. 2700/5170
[00:59:30] ....................................................F.............................F................. 2800/5170
[00:59:33] .......................................................................FF..FF....................... 2900/5170
[00:59:37] .............................F......................................................F......F...F.... 3000/5170
[00:59:41] .......F.F...................................F.................FF....................i.............. 3100/5170
[00:59:44] ..............................................................................F....F...F.F.......... 3200/5170
[00:59:48] ..F...........F....F.....F......................ii..i..ii.................F.F...F..................F 3300/5170
[00:59:52] ...............FFFFF...................F..F.........F...F..F...............F...F...F................ 3400/5170
[00:59:55] F..F.....FF.F.........F.F....FF..........F.....FFFF..FF.F..F.F.F...F.FFF.F........F.F..FFF.....FFFF. 3500/5170
[00:59:59] .F...............................ii.....................F........................................... 3600/5170
[01:00:02] .................................................................................................... 3800/5170
[01:00:04] .......i............................................................................................ 3900/5170
[01:00:04] .......i............................................................................................ 3900/5170
[01:00:08] .................................F.......................................................F.......F.. 4000/5170
[01:00:17] ...............................................F................................F......FFF.....FF... 4100/5170
[01:00:20] FF...F............FF......F....F.F......F..F.F......FF.........FF.......................F..F..F..... 4200/5170
[01:00:24] ........FF.........F.....F.................F.............................................F.......... 4300/5170
[01:00:28] ..........F.......................F....i............................................................ 4400/5170
[01:00:34] .................................................................................................... 4500/5170
[01:00:37] ...............................FF.F.F......F........F...............F...F...F.....F....F............ 4600/5170
[01:00:41] .F...F..................F............F...........F................................FF.....F.......F.. 4700/5170
[01:00:45] F........................i..........F....................................F.......................F.F 4800/5170
[01:00:49] .......F..........F..........F.................................F...............F..................F. 4900/5170
[01:00:52] ...............F.........F....F.F.F.........................F.........................F....F........ 5000/5170
[01:00:55] .............................F..F..F...................................F.F..FFFFFFF...............F. 5100/5170
[01:00:57] .........i.......................F.F.........................F........
[01:00:57] 
[01:00:57] ---- [ui] ui/allocator/not-an-allocator.rs stdout ----
[01:00:57] diff of stderr:
[01:00:57] 
[01:00:57] 
[01:00:57] 4 LL | static A: usize = 0;
[01:00:57] 5    | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`
[01:00:57] -    = note: required by `std::alloc::GlobalAlloc::alloc`
[01:00:57] +    = note: required by `std::alloc::GlobalAlloc::dealloc`
[01:00:57] 8 
[01:00:57] 9 error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
[01:00:57] 9 error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
[01:00:57] 10   --> $DIR/not-an-allocator.rs:12:1
[01:00:57] 
[01:00:57] 12 LL | static A: usize = 0;
[01:00:57] 13    | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`
[01:00:57] -    = note: required by `std::alloc::GlobalAlloc::dealloc`
[01:00:57] +    = note: required by `std::alloc::GlobalAlloc::realloc`
[01:00:57] 16 
[01:00:57] 17 error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
[01:00:57] 17 error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
[01:00:57] 18   --> $DIR/not-an-allocator.rs:12:1
[01:00:57] 
[01:00:57] 20 LL | static A: usize = 0;
[01:00:57] 21    | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`
[01:00:57] -    = note: required by `std::alloc::GlobalAlloc::realloc`
[01:00:57] +    = note: required by `std::alloc::GlobalAlloc::alloc`
[01:00:57] 24 
[01:00:57] 25 error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
[01:00:57] 25 error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
[01:00:57] 26   --> $DIR/not-an-allocator.rs:12:1
[01:00:57] 
[01:00:57] 
[01:00:57] The actual stderr differed from the expected stderr.
[01:00:57] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/allocator/not-an-allocator/not-an-allocator.stderr
[01:00:57] To update references, rerun the tests and pass the `--bless` flag
[01:00:57] To only update this specific test, also pass `--test-args allocator/not-an-allocator.rs`
[01:00:57] error: 1 errors occurred comparing output.
[01:00:57] status: exit code: 1
[01:00:57] status: exit code: 1
[01:00:57] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/allocator/not-an-allocator.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/allocator/not-an-allocator/a" "-Crpath" "-O" "-Zunstable-options    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/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":true,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":"the trait `std::alloc::GlobalAlloc` is not implemented for `usize`","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":false,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[global_allocator]","def_site_span":null}}],"children":[{"message":"required by `std::alloc::GlobalAlloc::dealloc`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied\n  --> /checkout/src/test/ui/allocator/not-an-allocator.rs:12:1\n   |\nLL | static A: usize = 0;\n   | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`\n   |\n   = note: required by `std::alloc::GlobalAlloc::dealloc`\n\n"}
[01:00:57] {"message":"the trait bound `usize: std::alloc::GlobalAlloc` 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/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":true,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":"the trait `std::alloc::GlobalAlloc` is not implemented for `usize`","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":false,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[global_allocator]","def_site_span":null}}],"children":[{"message":"required by `std::alloc::GlobalAlloc::realloc`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied\n  --> /checkout/src/test/ui/allocator/not-an-allocator.rs:12:1\n   |\nLL | static A: usize = 0;\n   | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`\n   |\n   = note: required by `std::alloc::GlobalAlloc::realloc`\n\n"}
[01:00:57] {"message":"the trait bound `usize: std::alloc::GlobalAlloc` 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/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":true,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":"the trait `std::alloc::GlobalAlloc` is not implemented for `usize`","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":false,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[global_allocator]","def_site_span":null}}],"children":[{"message":"required by `std::alloc::GlobalAlloc::alloc`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied\n  --> /checkout/src/test/ui/allocator/not-an-allocator.rs:12:1\n   |\nLL | static A: usize = 0;\n   | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`\n   |\n   = note: required by `std::alloc::GlobalAlloc::alloc`\n\n"}
[01:00:57] {"message":"the trait bound `usize: std::alloc::GlobalAlloc` 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 children":[{"message":"required by `std::alloc::GlobalAlloc::alloc_zeroed`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied\n  --> /checkout/src/test/ui/allocator/not-an-allocator.rs:12:1\n   |\nLL | static A: usize = 0;\n   | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`\n   |\n   = note: required by `std::alloc::GlobalAlloc::alloc_zeroed`\n\n"}
[01:00:57] {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors\n\n"}
[01:00:57] {"message":"For more information about this error, try `rustc --explain E0277`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0277`.\n"}
[01:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] thread '[ui] ui/allocator/not-an-allocator.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[01:00:57] note: Run with `RUST_BACKTRACE=1` for a backtrace.
---
[01:00:57] 9 
[01:00:57] 10 error[E0308]: mismatched types
[01:00:57] -   --> $DIR/associated-type-projection-from-supertrait.rs:44:23
[01:00:57] -    |
[01:00:57] - LL | fn c() { dent(ModelU, Black); } //~ ERROR mismatched types
[01:00:57] -    |                       om-supertrait.rs`
[01:00:57] error: 1 errors occurred comparing output.
[01:00:57] status: exit code: 1
[01:00:57] status: exit code: 1
[01:00:57] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-type/associated-type-projection-from-supertrait/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-type/associated-type-projection-from-supertrait/auxiliary" "-A" "unused"
[01:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] ------------------------------------------
[01:00:57] stderr:
[01:00:57] stderr:
[01:00:57] ------------------------------------------
[01:00:57] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs","byte_start":1280,"byte_end":1284,"line_start":43,"line_end":43,"column_start":23,"column_end":27,"is_primary":true,"text":[{"text":"fn b() { dent(ModelT, Blue); } //~ ERROR mismatched types","highlight_start":23,"highlight_end":27}],"label":"expected struct `Black`, found struct `Blue`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `Black`\n   found type `Blue`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs:43:23\n   |\nLL | fn b() { dent(ModelT, Blue); } //~ ERROR mismatched types\n   |                       ^^^^ expected struct `Black`, found struct `Blue`\n   |\n   = note: expected type `Black`\n              found type `Blue`\n\n"}
[01:00:57] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs","byte_start":1548,"byte_end":1552,"line_start":50,"line_end":50,"column_start":28,"column_end":32,"is_primary":true,"text":[{"text":"fn f() { ModelT.chip_paint(Blue); } //~ ERROR mismatched types","highlight_start":28,"highlight_end":32}],"label":"expected struct `Black`, found struct `Blue`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `Black`\n   found type `Blue`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs:50:28\n   |\nLL | fn f() { ModelT.chip_paint(Blue); } //~ ERROR mismatched types\n   |                            ^^^^ expected struct `Black`, found struct `Blue`\n   |\n   = note: expected type `Black`\n              found type `Blue`\n\n"}
[01:00:57] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs","byte_start":1611,"byte_end":1616,"line_start":51,"line_end":51,"column_start":28,"column_end":33,"is_primary":true,"text":[{"text":"fn g() { ModelU.chip_paint(Black); } //~ ERROR mismatched types","highlight_start":28,"highlight_end":33}],"label":"expected struct `Blue`, found struct `Black`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `Blue`\n   found type `Black`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs:51:28\n   |\nLL | fn g() { ModelU.chip_paint(Black); } //~ ERROR mismatched types\n   |                            ^^^^^ expected struct `Blue`, found struct `Black`\n   |\n   = note: expected type `Blue`\n              found type `Black`\n\n"}
[01:00:57] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs","byte_start":1338,"byte_end":1343,"line_start":44,"line_end":44,"column_start":23,"column_end":28,"is_primary":true,"text":[{"text":"fn c() { dent(ModelU, Black); } //~ ERROR mismatched types","highlight_start":23,"highlight_end":28}],"label":"expected struct `Blue`, found struct `Black`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `Blue`\n   found type `Black`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs:44:23\n   |\nLL | fn c() { dent(ModelU, Black); } //~ ERROR mismatched types\n   |                       ^^^^^ expected struct `Blue`, found struct `Black`\n   |\n   = note: expected type `Blue`\n              found type `Black`\n\n"}
[01:00:57] {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors\n\n"}
[01:00:57] {"message":"For more information about this error, try `rustc --explain E0308`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0308`.\n"}
[01:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] thread '[ui] ui/associated-type/associated-type-projection-from-supertrait.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[01:00:57] 
[01:00:57] 
[01:00:57] ---- [ui] ui/associated-types/associated-types-eq-3.rs stdout ----
[01:00:57] diff of stderr:
[01:00:57] 
[01:00:57] - error[E0308]: mismatched types
[01:00:57] -   --> $DIR/associated-types-eq-3.rs:33:18
[01:00:57] -    |
[01:00:57] - LL |     let _: Bar = x.boo();
[01:00:57] -    |                  ^^^^^^^ expected struct `Bar`, found associated type
[01:00:57] -    = note: expected type `Bar`
[01:00:57] -    = note: expected type `Bar`
[01:00:57] -               found type `<I as Foo>::A`
[01:00:57] - 
[01:00:57] 10 error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`
[01:00:57] 12    |
[01:00:57] 
[01:00:57] 30    = note: expected type `usize`
[01:00:57] 31               found type `Bar`
[01:00:57] 31               found type `Bar`
[01:00:57] 32    = note: required for the cast to the object type `dyn Foo<A=Bar>`
[01:00:57] + error[E0308]: mismatched types
[01:00:57] +   --> $DIR/associated-types-eq-3.rs:33:18
[01:00:57] +    |
[01:00:57] +    |
[01:00:57] + LL |     let _: Bar = x.boo();
[01:00:57] +    |                  ^^^^^^^ expected struct `Bar`, found associated type
[01:00:57] +    = note: expected type `Bar`
[01:00:57] +    = note: expected type `Bar`
[01:00:57] +               found type `<I as Foo>::A`
[01:00:57] 34 error: aborting due to 3 previous errors
[01:00:57] 35 
[01:00:57] 
[01:00:57] 
[01:00:57] 
[01:00:57] The actual stderr differed from the expected stderr.
[01:00:57] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-eq-3/associated-types-eq-3.stderr
[01:00:57] To update references, rerun the tests and pass the `--bless` flag
[01:00:57] To only update this specific test, also pass `--test-args associated-types/associated-types-eq-3.rs`
[01:00:57] error: 1 errors occurred comparing output.
[01:00:57] status: exit code: 1
[01:00:57] status: exit code: 1
[01:00:57] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-types/associated-types-eq-3.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-eq-3/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-eq-3/auxiliary" "-A" "unused"
[01:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] ------------------------------------------
[01:00:57] stderr:
[01:00:57] stderr:
[01:00:57] ------------------------------------------
[01:00:57] {"message":"type mismatch resolving `<isize as Foo>::A == Bar`","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!(\"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-eq-3.rs","byte_start":1096,"byte_end":1100,"line_start":48,"line_end":48,"column_start":5,"column_end":9,"is_primary":true,"text":[{"text":"    foo1(a);","highlight_start":5,"highlight_end":9}],"label":"expected usize, found struct `Bar`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `usize`\n   found type `Bar`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by `foo1`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-eq-3.rs","byte_start":736,"byte_end":764,"line_start":28,"line_end":28,"column_start":1,"column_end":29,"is_primary":true,"text":[{"text":"fn foo1<I: Foo<A=Bar>>(x: I) {","highlight_start":1,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`\n  --> /checkout/src/test/ui/associated-types/associated-types-eq-3.rs:48:5\n   |\nLL |     foo1(a);\n   |     ^^^^ expected usize, found struct `Bar`\n   |\n   = note: exn\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-eq-3.rs","byte_start":1196,"byte_end":1198,"line_start":51,"line_end":51,"column_start":9,"column_end":11,"is_primary":true,"text":[{"text":"    baz(&a);","highlight_start":9,"highlight_end":11}],"label":"expected usize, found struct `Bar`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `usize`\n   found type `Bar`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required for the cast to the object type `dyn Foo<A=Bar>`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`\n  --> /checkout/src/test/ui/associated-types/associated-types-eq-3.rs:51:9\n   |\nLL |     baz(&a);\n   |         ^^ expected usize, found struct `Bar`\n   |\n   = note: expected type `usize`\n              found type `Bar`\n   = note: required for the cast to the object type `dyn Foo<A=Bar>`\n\n"}
[01:00:57] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-eq-3.rs","byte_start":837,"byte_end":844,"line_start":33,"line_end":33,"column_start":18,"column_end":25,"is_primary":true,"text":[{"text":"    let _: Bar = x.boo();","highlight_start":18,"highlight_end":25}],"label":"expected struct `Bar`, found associated type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `Bar`\n   found type `<I as Foo>::A`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/associated-types/associated-types-eq-3.rs:33:18\n   |\nLL |     let _: Bar = x.boo();\n   |                  ^^^^^^^ expected struct `Bar`, found associated type\n   |\n   = note: expected type `Bar`\n              found type `<I as Foo>::A`\n\n"}
[01:00:57] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[01:00:57] {"message":"Some errors occurred: E0271, E0308.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0271, E0308.\n"}
[01:00:57] {"message":"For more information about an error, try `rustc --explain E0271`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0271`.\n"}
[01:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] thread '[ui] ui/associated-types/associated-types-eq-3.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[01:00:57] 
[01:00:57] 
[01:00:57] ---- [ui] ui/associated-types/associated-types-multiple-types-one-trait.rs stdout ----
[01:00:57] diff of stderr:
[01:00:57] 
[01:00:57] - error[E0271]: type mismatch resolving `<T as Foo>::Y == i32`
[01:00:57] -    |
[01:00:57] -    |
[01:00:57] - LL |     want_y(t); //~ ERROR type mismatch
[01:00:57] -    |     ^^^^^^ expected associated type, found i32
[01:00:57] -    |
[01:00:57] -    = note: expected type `<T as Foo>::Y`
[01:00:57] -               found type `i32`
[01:00:57] - note: required by `want_y`
[01:00:57] -    |
[01:00:57] -    |
[01:00:57] - LL | fn want_y<T:Foo<Y=i32>>(t: &T) { }
[01:00:57] - 
[01:00:57] - 
[01:00:57] 15 error[E0271]: type mismatch resolving `<T as Foo>::X == u32`
[01:00:57] 17    |
[01:00:57] 
[01:00:57] 24   --> $DIR/associated-types-multiple-types-one-trait.rs:52:1
[01:00:57] 25    |
[01:00:57] 25    |
[01:00:57] 26 LL | fn want_x<T:Foo<X=u32>>(t: &T) { }
[01:00:57] + 
[01:00:57] + 
[01:00:57] + error[E0271]: type mismatch resolving `<T as Foo>::Y == i32`
[01:00:57] +   --> $DIR/associated-types-multiple-types-one-trait.rs:23:5
[01:00:57] +    |
[01:00:57] + LL |     want_y(t); //~ ERROR type mismatch
[01:00:57] +    |     ^^^^^^ expected associated type, found i32
[01:00:57] +    |
[01:00:57] +    = note: expected type `<T as Foo>::Y`
[01:00:57] +               found type `i32`
[01:00:57] + note: required by `want_y`
[01:00:57] +   --> $DIR/associated-types-multiple-types-one-trait.rs:54:1
[01:00:57] +    |
[01:00:57] + LL | fn want_y<T:Foo<Y=i32>>(t: &T) { }
[01:00:57] 28 
[01:00:57] 29 error: aborting due to 2 previous errors
[01:00:57] 
[01:00:57] 
[01:00:57] 
[01:00:57] The actual stderr differed from the expected stderr.
[01:00:57] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-multiple-types-one-trait/associated-types-multiple-types-one-trait.stderr
[01:00:57] To update references, rerun the tests and pass the `--bless` flag
[01:00:57] To only update this specific test, also pass `--test-args associated-types/associated-types-multiple-types-one-trait.rs`
[01:00:57] error: 1 errors occurred comparing output.
[01:00:57] status: exit code: 1
[01:00:57] status: exit code: 1
[01:00:57] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-types/associated-types-multiple-types-one-trait.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-multiple-types-one-trait/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-multiple-types-one-trait/auxiliary" "-A" "unused"
[01:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] ------------------------------------------
[01:00:57] stderr:
[01:00:57] stderr:
[01:00:57] ------------------------------------------
[01:00:57] {"message":"type mismatch resolving `<T as Foo>::X == u32`","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 reqnt `<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-multiple-types-one-trait.rs","byte_start":690,"byte_end":696,"line_start":28,"line_end":28,"column_start":5,"column_end":11,"is_primary":true,"text":[{"text":"    want_x(t); //~ ERROR type mismatch","highlight_start":5,"highlight_end":11}],"label":"expected associated type, found u32","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `<T as Foo>::X`\n   found type `u32`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by `want_x`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-multiple-types-one-trait.rs","byte_start":997,"byte_end":1027,"line_start":52,"line_end":52,"column_start":1,"column_end":31,"is_primary":true,"text":[{"text":"fn want_x<T:Foo<X=u32>>(t: &T) { }","highlight_start":1,"highlight_end":31}],"label":null,"suggested_replacement":null,"suggestion_applicabilitylements `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-multiple-types-one-trait.rs","byte_start":608,"byte_end":614,"line_start":23,"line_end":23,"column_start":5,"column_end":11,"is_primary":true,"text":[{"text":"    want_y(t); //~ ERROR type mismatch","highlight_start":5,"highlight_end":11}],"label":"expected associated type, found i32","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `<T as Foo>::Y`\n   found type `i32`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by `want_y`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-multiple-types-one-trait.rs","byte_start":1033,"byte_end":1063,"line_start":54,"line_end":54,"column_start":1,"column_end":31,"is_primary":true,"text":[{"text":"fn want_y<T:Foo<Y=i32>>(t: &T) { }","highlight_start":1,"highlight_end":31}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0271]: type mismatch resolving `<T as Foo>::Y == i32`\n  --> /checkout/src/test/ui/associated-types/associated-types-multiple-types-one-trait.rs:23:5\n   |\nLL |     want_y(t); //~ ERROR type mismatch\n   |     ^^^^^^ expected associated type, found i32\n   |\n   = note: expected type `<T as Foo>::Y`\n              found type `i32`\nnote: required by `want_y`\n  --> /checkout/src/test/ui/associated-types/associated-types-multiple-types-one-trait.rs:54:1\n   |\nLL | fn want_y<T:Foo<Y=i32>>(t: &T) { }\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:00:57] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[01:00:57] {"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:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] thread '[ui] ui/associated-types/associated-types-multiple-types-one-trait.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[01:00:57] 
[01:00:57] 
[01:00:57] ---- [ui] ui/associated-types/associated-types-path-2.rs stdout ----
[01:00:57] diff of stderr:
[01:00:57] 
[01:00:57] - error[E0308]: mismatched types
[01:00:57] -   --> $DIR/associated-types-path-2.rs:29:14
[01:00:57] -    |
[01:00:57] - LL |     f1(2i32, 4i32);
[01:00:57] - 
[01:00:57] - 
[01:00:57] 7 error[E0277]: the trait bound `u32: Foo` is not satisfied
[01:00:57] 9    |
[01:00:57] 
[01:00:57] 45    |
[01:00:57] 45    |
[01:00:57] 46 LL |     let _: i32 = f2(2i32);
[01:00:57] 47    |                  ^^^^^^^^ expected i32, found u32
[01:00:57] + error[E0308]: mismatched types
[01:00:57] +   --> $DIR/associated-types-path-2.rs:29:14
[01:00:57] +    |
[01:00:57] +    |
[01:00:57] + LL |     f1(2i32, 4i32);
[01:00:57] 48 
[01:00:57] 49 error: aborting due to 6 previous errors
[01:00:57] 50 
[01:00:57] 
[01:00:57] 
[01:00:57] 
[01:00:57] The actual stderr differed from the expected stderr.
[01:00:57] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-path-2/associated-types-path-2.stderr
[01:00:57] To update references, rerun the tests and pass the `--bless` flag
[01:00:57] To only update this specific test, also pass `--test-args associated-types/associated-types-path-2.rs`
[01:00:57] error: 1 errors occurred comparing output.
[01:00:57] status: exit code: 1
[01:00:57] status: exit code: 1
[01:00:57] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-types/associated-types-path-2.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-path-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-path-2/auxiliary" "-A" "unused"
[01:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] ------------------------------------------
[01:00:57] stderr:
[01:00:57] stderr:
[01:00:57] ------------------------------------------
[01:00:57] {"message":"the trait bound `u32: Foo` is not satisfied","code":{"code":"E0277","explanation":"\nYou tried to use a type which doesn't implement some trait in a place which\nexpected that trait. Erroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n    fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n    foo.bar();\n}\n\nfn main() {\n    // we now call the method with the i32 type, which doesn't implement\n    // the Foo trait\n    some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n    fn bar(&self);\n}\n\nfn some_func<T: Foo>(foo: T) {\n    foo.bar(); // we can now use this method since i32 implements the\n               // Foo trait\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n    fn bar(&self) {}\n}\n\nfn main() {\n    some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n    println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n                           //        implemented for the type `T`\n}\n\nfn main() {\n    // We now call the method with the i32 type,\n    // which *does* implement the Debug trait.\n    some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function: Although\nwe only call it with a parameter that does implement `Debug`, the compiler\nstill rejects the function: It must work with all possible input types. In\norder to make this example compile, we need to restrict the generic type we're\naccepting:\n\n```\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/associated-types/associated-types-path-2.rs","byte_start":903,"byte_end":905,"line_start":39,"line_end":39,"column_start":5,"column_end":7,"is_primary":true,"text":[{"text":"    f1(2u32, 4u32);","highlight_start":5,"highlight_end":7}],"label":"the trait `Foo` is not implemented for `u32`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"required by `f1`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-path-2.rs","byte_start":632,"byte_end":664,"line_start":23,"line_end":23,"column_start":1,"column_end":33,"is_primary":true,"text":[{"text":"pub fn f1<T: Foo>(a: T, x: T::A) {}","highlight_start":1,"highlight_end":33}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `u32: Foo` is not satisfied\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:39:5\n   |\nLL |     f1(2u32, 4u32);\n   |     ^^ the trait `Foo` is not implemented for `u32`\n   |\nnote: required by `f1`\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:23:1\n   |\nLL | pub fn f1<T: Foo>(a: T, x: T::A) {}\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:00:57] {"message":"the trait bound `u32: Foo` is not satisfied","code":{"code":"E0277","explanation":"\nYou tried to use a type which doesn't implement some trait in a place which\nexpected that trait. Erroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n    fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n    foo.bar();\n}\n\nfn main() {\n    // we now call the method with the i32 type, which doesn't implement\n    // the Foo trait\n    some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n    fn bar(&self);\n}\n\nfn some_func<T: Foo>(foo: T) {\n    foo.bar(); // we can now use this method since i32 implements the\n               // Foo trait\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n    fn bar(&self) {}\n}\n\nfn main() {\n    some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n    println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n                           //        implemented for the type `T`\n}\n\nfn main() {\n    // We now call the method with the i32 type,\n    // which *does* implement the Debug trait.\n    some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function: Although\nwe only call it with a parameter that does implement `Debug`, the cfail,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 tha`f1`\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:23:1\n   |\nLL | pub fn f1<T: Foo>(a: T, x: T::A) {}\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:00:57] {"message":"the trait bound `u32: Foo` is not satisfied","code":{"code":"E0277","explanation":"\nYou tried to use a type which doesn't implement some trait in a place which\nexpected that trait. Erroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n    fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n    foo.bar();\n}\n\nfn main() {\n    // we now call the method with the i32 type, which doesn't implement\n    // the Foo trait\n    some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n    fn bar(&self);\n}\n\nfn some_func<T: Foo>(foo: T) {\n    foo.bar(); // we can now use this method since i32 implements the\n               // Foo trait\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n    fn bar(&self) {}\n}\n\nfn main() {\n    some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n    println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n                           //        implemented for the type `T`\n}\n\nfn main() {\n    // We now call the method with the i32 type,\n    // which *does* implement the Debug trait.\n    some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function: Although\nwe only call it with a parameter that does implement `Debug`, the compiler\nstill rejects the function: It must work with all possible input types. In\norder to make this example compile, we need to restrict the generic type we're\naccepting:\n\n```\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/associated-types/associated-types-path-2.rs","byte_start":1035,"byte_end":1049,"line_start":45,"line_end":45,"column_start":5,"column_end":19,"is_primary":true,"text":[{"text":"    f1(2u32, 4i32);","highlight_start":5,"highlight_end":19}],"label":"the trait `Foo` is not implemented for `u32`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0277]: the trait bound `u32: Foo` is not satisfied\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:45:5\n   |\nLL |     f1(2u32, 4i32);\n   |     ^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `u32`\n\n"}
[01:00:57] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-path-2.rs","byte_start":1175,"byte_end":1183,"line_start":51,"line_end":51,"column_start":18,"column_end":26,"is_primary":true,"text":[{"text":"    let _: i32 = f2(2i32);","highlight_start":18,"highlight_end":26}],"label":"expected i32, found u32","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:51:18\n   |\nLL |     let _: i32 = f2(2i32);\n   |                  ^^^^^^^^ expected i32, found u32\n\n"}
[01:00:57] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-path-2.rs","byte_start":754,"byte_end":758,"line_start":29,"line_end":29,"column_start":14,"column_end":18,"is_primary":true,"text":[{"text":"    f1(2i32, 4i32);","highlight_start":14,"highlight_end":18}],"label":"expected u32, found i32","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:29:14\n   |\nLL |     f1(2i32, 4i32);\n   |              ^^^^ expected u32, found i32\n\n"}
[01:00:57] {"message":"aborting due to 6 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 6 previous errors\n\n"}
[01:00:57] {"message":"Some errors occurred: E0277, E0308.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0277, E0308.\n"}
[01:00:57] {"message":"For more information about an error, try `rustc --explain E0277`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0277`.\n"}
[01:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] thread '[ui] ui/associated-types/associated-types-path-2.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[01:00:57] 
[01:00:57] 
[01:00:57] ---- [ui] ui/binop/binop-consume-args.rs stdout ----
[01:00:57] diff of stderr:
[01:00:57] 
[01:00:57] 1 error[E0382]: use of moved value: `lhs`
[01:00:57] +   --> $DIR/binop-consume-args.rs:65:10
[01:00:57] 3    |
[01:00:57] 3    |
[01:00:57] - LL |     lhs + rhs;
[01:00:57] + LL |     lhs << rhs;
[01:00:57] 5    |     --- value moved here
[01:00:57] 6 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[01:00:57] 7    |          ^^^ value used here after move
[01:00:57] 
[01:00:57] 9    = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
[01:00:57] 10 
[01:00:57] 11 error[E0382]: use of moved value: `rhs`
[01:00:57] +   --> $DIR/binop-consume-args.rs:66:10
[01:00:57] 13    |
[01:00:57] 13    |
[01:00:57] - LL |     lhs + rhs;
[01:00:57] -    |           --- value moved here
[01:00:57] + LL |     lhs << rhs;
[01:00:57] +    |            --- value moved here
[01:00:57] 16 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[01:00:57] 17 LL |     drop(rhs);  //~ ERROR use of moved value: `rhs`
[01:00:57] 18    |          ^^^ value used here after move
[01:00:57] 
[01:00:57] 20    = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
[01:00:57] 21 
[01:00:57] 22 error[E0382]: use of moved value: `lhs`
[01:00:57] +   --> $DIR/binop-consume-args.rs:53:10
[01:00:57] 24    |
[01:00:57] 24    |
[01:00:57] - LL |     lhs - rhs;
[01:00:57] + LL |     lhs | rhs;
[01:00:57] 26    |     --- value moved here
[01:00:57] 27 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[01:00:57] 28    |          ^^^ value used here after move
[01:00:57] 
[01:00:57] 30    = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
[01:00:57] 31 
[01:00:57] 32 error[E0382]: use of moved value: `rhs`
[01:00:57] +   --> $DIR/binop-consume-args.rs:54:10
[01:00:57] 34    |
[01:00:57] 34    |
[01:00:57] - LL |     lhs - rhs;
[01:00:57] + LL |     lhs | rhs;
[01:00:57] 36    |           --- value moved here
[01:00:57] 37 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[01:00:57] 38 LL |     drop(rhs);  //~ ERROR use of moved value: `rhs`
[01:00:57] 
[01:00:57] 41    = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
[01:00:57] 42 
[01:00:57] 43 error[E0382]: use of moved value: `lhs`
[01:00:57] +   --> $DIR/binop-consume-args.rs:59:10
[01:00:57] 45    |
[01:00:57] 45    |
[01:00:57] - LL |     lhs * rhs;
[01:00:57] + LL |     lhs ^ rhs;
[01:00:57] 47    |     --- value moved here
[01:00:57] 48 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[01:00:57] 49    |          ^^^ value used here after move
[01:00:57] 
[01:00:57] 51    = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
[01:00:57] 52 
[01:00:57] 53 error[E0382]: use of moved value: `rhs`
[01:00:57] +   --> $DIR/binop-consume-args.rs:60:10
[01:00:[01:00:57] 84 
[01:00:[01:00:57] 84 
[01:00:57] 85 error[E0382]: use of moved value: `lhs`
[01:00:57] +   --> $DIR/binop-consume-args.rs:47:10
[01:00:57] 87    |
[01:00:57] 87    |
[01:00:57] - LL |     lhs % rhs;
[01:00:57] + LL |     lhs & rhs;
[01:00:57] 89    |     --- value moved here
[01:00:57] 90 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[01:00:57] 91    |          ^^^ value used here after move
[01:00:57] 
[01:00:57] 93    = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
[01:00:57] 94 
[01:00:57] 95 error[E0382]: use of moved value: `rhs`
[01:00:57] +   --> $DIR/binop-consume-args.rs:48:10
[01:00:57] 97    |
[01:00:57] 97    |
[01:00:57] - LL |     lhs % rhs;
[01:00:57] + LL |     lhs & rhs;
[01:00:57] 99    |           --- value moved here
[01:00:57] 100 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[01:00:57] 101 LL |     drop(rhs);  //~ ERROR use of moved value: `rhs`
[01:00:57] 
[01:00:57] 104    = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
[01:00:57] 105 
[01:00:57] 106 error[E0382]: use of moved value: `lhs`
[01:00:57] +   --> $DIR/binop-consume-args.rs:29:10
[01:00:57] 108    |
[01:00:57] 108    |
[01:00:57] - LL |     lhs & rhs;
[01:00:57] + LL |     lhs * rhs;
[01:00:57] 110    |     --- value moved here
[01:00:57] 111 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[01:00:57] 112    |          ^^^ value used here after move
[01:00:57] 
[01:00:57] 114    = note: move occurs because~ ERROR use of moved value: `rhs`
[01:00:57] 
[01:00:57] 146    = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
[01:00:57] 147 
[01:00:57] 148 error[E0382]: use of moved value: `lhs`
[01:00:57] +   --> $DIR/binop-consume-args.rs:41:10
[01:00:57] 150    |
[01:00:57] 150    |
[01:00:57] - LL |     lhs ^ rhs;
[01:00:57] + LL |     lhs % rhs;
[01:00:57] 152    |     --- value moved here
[01:00:57] 153 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[01:00:57] 154    |          ^^^ value used here after move
[01:00:57] 
[01:00:57] 156    = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
[01:00:57] 157 
[01:00:57] 158 error[E0382]: use of moved value: `rhs`
[01:00:57] +   --> $DIR/binop-consume-args.rs:42:10
[01:00:57] 160    |
[01:00:57] 160    |
[01:00:57] - LL |     lhs ^ rhs;
[01:00:57] + LL |     lhs % rhs;
[01:00:57] 162    |           --- value moved here
[01:00:57] 163 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[01:00:57] 164 LL |     drop(rhs);  //~ ERROR use of moved value: `rhs`
[01:00:57] 
[01:00:57] 167    = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
[01:00:57] 168 
[01:00:57] 169 error[E0382]: use of moved value: `lhs`
[01:00:57] +   --> $DIR/binop-consume-args.rs:23:10
[01:00:57] 171    |
[01:00:57] 171    |
[01:00:57] - LL |     lhs << rhs;
[01:00:57] + LL |     lhs - rhs;
[01:00:57] 173    |     --- value moved here
[01:00:57] 174 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[01:00:57] 175    |          ^^^ value used here after move
[01:00:57] 
[01:00:57] 177    = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
[01:00:57] 178 
[01:00:57] 179 error[E0382]: use of moved value: `rhs`
[01:00:57] +   --> $DIR/binop-consume-args.rs:24:10
[01:00:57] 181    |
[01:00:57] 181    |
[01:00:57] - LL |     lhs << rhs;
[01:00:57] -    |            --- value moved here
[01:00:57] + LL |     lhs - rhs;
[01:00:57] +    |           --- value moved here
[01:00:57] 184 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[01:00:57] 185 LL |     drop(rhs);  //~ ERROR use of moved value: `rhs`
[01:00:57] 186    |          ^^^ value used here after move
[01:00:57] 
[01:00:57] 188    = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
[01:00:57] 189 
[01:00:57] 190 error[E0382]: use of moved value: `lhs`
[01:00:57] +   --> $DIR/binop-consume-args.rs:17:10
[01:00:57] 192    |
[01:00:57] 192    |
[01:00:57] - LL |     lhs >> rhs;
[01:00:57] + LL |     lhs + rhs;
[01:00:57] 194    |     --- value moved here
[01:00:57] 195 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[01:00:57] 196    |          ^^^ value used here after move
[01:00:57] 
[01:00:57] 198    = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
[01:00:57] 199 
[01:00:57] 200 error[E0382]: use of moved value: `rhs`
[01:00:57] +   --> $DIR/7] ------------------------------------------
[01:00:57] +   --> $DIR/7] ------------------------------------------
[01:00:57] {"message":"use of moved value: `lhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":2064,"byte_end":2067,"line_start":65,"line_end":65,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(lhs);  //~ ERROR use of moved value: `lhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":2043,"byte_end":2046,"line_start":64,"line_end":64,"column_start":5,"column_end":8,"is_primary":false,"text":[{"text":"    lhs << rhs;","highlight_start":5,"highlight_end":8}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `lhs` has type `A`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `lhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:65:10\n   |\nLL |     lhs << rhs;\n   |     --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait\n\n"}
[01:00:57] {"message":"use of moved value: `rhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":2116,"byte_end":2119,"line_start":66,"line_end":66,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(rhs);  //~ ERROR use of moved value: `rhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":2050,"byte_end":2053,"line_start":64,"line_end":64,"column_start":12,"column_end":15,"is_primary":false,"text":[{"text":"    lhs << rhs;","highlight_start":12,"highlight_end":15}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `rhs` has type `B`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `rhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:66:10\n   |\nLL |     lhs << rhs;\n   |            --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\nLL |     drop(rhs);  //~ ERROR use of moved value: `rhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait\n\n"}
[01:00:57] {"message":"use of moved value: `lhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1713,"byte_end":1716,"line_start":53,"line_end":53,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(lhs);  //~ ERROR use of moved value: `lhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1693,"byte_end":1696,"line_start":52,"line_end":52,"column_start":5,"column_end":8,"is_primary":false,"text":[{"text":"    lhs | rhs;","highlight_start":5,"highlight_end":8}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `lhs` has type `A`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `lhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:53:10\n   |\nLL |     lhs | rhs;\n   |     --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait\n\n"}
[01:00:57] {"message":"use of moved value: `rhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a var2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\nents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1891,"byte_end":1894,"line_start":59,"line_end":59,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(lhs);  //~ ERROR use of moved value: `lhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1871,"byte_end":1874,"line_start":58,"line_end":58,"column_start":5,"column_end":8,"is_primary":false,"text":[{"text":"    lhs ^ rhs;","highlight_start":5,"highlight_end":8}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `lhs` has type `A`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `lhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:59:10\n   |\nLL |     lhs ^ rhs;\n   |     --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait\n\n"}
[01:00:57] {"message":"use of moved value: `rhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1943,"byte_end":1946,"line_start":60,"line_end":60,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(rhs);  //~ ERROR use of moved value: `rhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1877,"byte_end":1880,"line_start":58,"line_end":58,"column_start":11,"column_end":14,"is_primary":false,"text":[{"text":"    lhs ^ rhs;","highlight_start":11,"highlight_end":14}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `rhs` has type `B`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `rhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:60:10\n   |\nLL |     lhs ^ rhs;\n   |           --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\nLL |     drop(rhs);  //~ ERROR use of moved value: `rhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait\n\n"}
[01:00:57] {"message":"use of moved value: `lhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn maie types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/b!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":2289,"byte_end":2292,"line_start":72,"line_end":72,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(rhs);  //~ ERROR use of moved value: `rhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":2223,"byte_end":2226,"line_start":70,"line_end":70,"column_start":12,"column_end":15,"is_primary":false,"text":[{"text":"    lhs >> rhs;","highlight_start":12,"highlight_end":15}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `rhs` has type `B`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `rhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:72:10\n   |\nLL |     lhs >> rhs;\n   |            --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\nLL |     drop(rhs);  //~ ERROR use of moved value: `rhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait\n\n"}
[01:00:57] {"message":"use of moved value: `lhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1537,"byte_end":1540,"line_start":47,"line_end":47,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(lhs);  //~ ERROR use of moved value: `lhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1517,"byte_end":1520,"line_start":46,"line_end":46,"column_start":5,"column_end":8,"is_primary":false,"text":[{"text":"    lhs & rhs;","highlight_start":5,"highlight_end":8}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `lhs` has type `A`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `lhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:47:10\n   |\nLL |     lhs & rhs;\n   |     --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait\n\n"}
[01:00:57] {"message":"use of moved value: `rhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\ked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1589,"byte_end":1592,"line_start":48,"line_end":48,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(rhs);  //~ ERROR use `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1015,"byte_end":1018,"line_start":29,"line_end":29,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(lhs);  //~ ERROR use of moved value: `lhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":995,"byte_end":998,"line_start":28,"line_end":28,"column_start":5,"column_end":8,"is_primary":false,"text":[{"text":"    lhs * rhs;","highlight_start":5,"highlight_end":8}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `lhs` has type `A`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `lhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:29:10\n   |\nLL |     lhs * rhs;\n   |     --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait\n\n"}
[01:00:57] {"message":"use of moved value: `rhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1067,"byte_end":1070,"line_start":30,"line_end":30,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(rhs);  //~ ERROR use of moved value: `rhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1001,"byte_end":1004,"line_start":28,"line_end":28,"column_start":11,"column_end":14,"is_primary":false,"text":[{"text":"    lhs * rhs;","highlight_start":11,"highlight_end":14}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `rhs` has type `B`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `rhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:30:10\n   |\nLL |     lhs * rhs;\n   |           --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\nLL |     drop(rhs);  //~ ERROR use of moved value: `rhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait\n\n"}
[01:00:57] {"message":"use of moved value: `lhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owneeir members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1187,"byte_end":1190,"line_start":35,"line_end":35,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(lhs);  //~ ERROR use of moved value: `lhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":nullence, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1239,"byte_end":1242,"line_start":36,"line_end":36,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(rhs);  //~ ERROR use of moved value: `rhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1173,"byte_end":1176,"line_start":34,"line_end":34,"column_start":11,"column_end":14,"is_primary":false,"text":[{"text":"    lhs / rhs;","highlight_start":11,"highlight_end":14}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `rhs` has type `B`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `rhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:36:10\n   |\nLL |     lhs / rhs;\n   |           --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\nLL |     drop(rhs);  //~ ERROR use of moved value: `rhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait\n\n"}
[01:00:57] {"message":"use of moved value: `lhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1359,"byte_end":1362,"line_start":41,"line_end":41,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(lhs);  //~ ERROR use of moved value: `lhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1339,"byte_end":1342,"line_start":40,"line_end":40,"column_start":5,"column_end":8,"is_primary":false,"text":[{"text":"    lhs % rhs;","highlight_start":5,"highlight_end":8}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `lhs` has type `A`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `lhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:41:10\n   |\nLL |     lhs % rhs;\n   |     --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait\n\n"}
[01:00:57] {"message":"use of moved value: `rhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nw= p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1411,"byte_end":1414,"line_start":42,"line_end":42,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(rhs);  //~ ERROR use of moved value: `rhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":1345,"byte_end":1348,"line_start":40,"line_end":40,"column_start":1e to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":843,"byte_end":846,"line_start":23,"line_end":23,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(lhs);  //~ ERROR use of moved value: `lhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":823,"byte_end":826,"line_start":22,"line_end":22,"column_start":5,"column_end":8,"is_primary":false,"text":[{"text":"    lhs - rhs;","highlight_start":5,"highlight_end":8}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `lhs` has type `A`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `lhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:23:10\n   |\nLL |     lhs - rhs;\n   |     --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait\n\n"}
[01:00:57] {"message":"use of moved value: `rhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\n    let s1 = String::from(\"hello\");\n\n    let len = calculate_length(&s1);\n\n    println!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":895,"byte_end":898,"line_start":24,"line_end":24,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(rhs);  //~ ERROR use of moved value: `rhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":829,"byte_end":832,"line_start":22,"line_end":22,"column_start":11,"column_end":14,"is_primary":false,"text":[{"text":"    lhs - rhs;","highlight_start":11,"highlight_end":14}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `rhs` has type `B`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `rhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:24:10\n   |\nLL |     lhs - rhs;\n   |           --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\nLL |     drop(rhs);  //~ ERROR use of moved value: `rhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait\n\n"}
[01:00:57] {"message":"use of moved value: `lhs`","code":{"code":"E0382","explanation":"\nThis error occurs when an attempt is made to use a variable after its contents\nhave been moved elsewhere. For example:\n\n```compile_fail,E0382\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = MyStruct{ s: 5u32 };\n    let y = x;\n    x.s = 6;\n    println!(\"{}\", x.s);\n}\n```\n\nSince `MyStruct` is a type that is not marked `Copy`, the data gets moved out\nof `x` when we set `y`. This is fundamental to Rust's ownership system: outside\nof workarounds like `Rc`, a value cannot be owned by more than one variable.\n\nSometimes we don't need to move the value. Using a reference, we can let another\nfunction borrow the value without changing its ownership. In the example below,\nwe don't actually have to move our string to `calculate_length`, we can give it\na reference to it with `&` instead.\n\n```\nfn main() {\x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":671,"byte_end":674,"line_start":17,"line_end":17,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(lhs);  //~ ERROR use of moved value: `lhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":651,"byte_end":654,"line_start":16,"line_end":16,"column_start":5,"column_end":8,"is_primary":false,"text":[{"text":"    lhs + rhs;","highlight_start":5,"highlight_end":8}],"label":"value moved here","suggn!(\"The length of '{}' is {}.\", s1, len);\n}\n\nfn calculate_length(s: &String) -> usize {\n    s.len()\n}\n```\n\nA mutable reference can be created with `&mut`.\n\nSometimes we don't want a reference, but a duplicate. All types marked `Clone`\ncan be duplicated by calling `.clone()`. Subsequent changes to a clone do not\naffect the original variable.\n\nMost types in the standard library are marked `Clone`. The example below\ndemonstrates using `clone()` on a string. `s1` is first set to \"many\", and then\ncopied to `s2`. Then the first character of `s1` is removed, without affecting\n`s2`. \"any many\" is printed to the console.\n\n```\nfn main() {\n    let mut s1 = String::from(\"many\");\n    let s2 = s1.clone();\n    s1.remove(0);\n    println!(\"{} {}\", s1, s2);\n}\n```\n\nIf we control the definition of a type, we can implement `Clone` on it ourselves\nwith `#[derive(Clone)]`.\n\nSome types have no ownership semantics at all and are trivial to duplicate. An\nexample is `i32` and the other number types. We don't have to call `.clone()` to\nclone them, because they are marked `Copy` in addition to `Clone`.  Implicit\ncloning is more convenient in this case. We can mark our own types `Copy` if\nall their members also are marked `Copy`.\n\nIn the example below, we implement a `Point` type. Because it only stores two\nintegers, we opt-out of ownership semantics with `Copy`. Then we can\n`let p2 = p1` without `p1` being moved.\n\n```\n#[derive(Copy, Clone)]\nstruct Point { x: i32, y: i32 }\n\nfn main() {\n    let mut p1 = Point{ x: -1, y: 2 };\n    let p2 = p1;\n    p1.x = 1;\n    println!(\"p1: {}, {}\", p1.x, p1.y);\n    println!(\"p2: {}, {}\", p2.x, p2.y);\n}\n```\n\nAlternatively, if we don't control the struct's definition, or mutable shared\nownership is truly required, we can use `Rc` and `RefCell`:\n\n```\nuse std::cell::RefCell;\nuse std::rc::Rc;\n\nstruct MyStruct { s: u32 }\n\nfn main() {\n    let mut x = Rc::new(RefCell::new(MyStruct{ s: 5u32 }));\n    let y = x.clone();\n    x.borrow_mut().s = 6;\n    println!(\"{}\", x.borrow().s);\n}\n```\n\nWith this approach, x and y share ownership of the data via the `Rc` (reference\ncount type). `RefCell` essentially performs runtime borrow checking: ensuring\nthat at most one writer or multiple readers can access the data at any one time.\n\nIf you wish to learn more about ownership in Rust, start with the chapter in the\nBook:\n\nhttps://doc.rust-lang.org/book/first-edition/ownership.html\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":723,"byte_end":726,"line_start":18,"line_end":18,"column_start":10,"column_end":13,"is_primary":true,"text":[{"text":"    drop(rhs);  //~ ERROR use of moved value: `rhs`","highlight_start":10,"highlight_end":13}],"label":"value used here after move","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/binop/binop-consume-args.rs","byte_start":657,"byte_end":660,"line_start":16,"line_end":16,"column_start":11,"column_end":14,"is_primary":false,"text":[{"text":"    lhs + rhs;","highlight_start":11,"highlight_end":14}],"label":"value moved here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"move occurs because `rhs` has type `B`, which does not implement the `Copy` trait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0382]: use of moved value: `rhs`\n  --> /checkout/src/test/ui/binop/binop-consume-args.rs:18:10\n   |\nLL |     lhs + rhs;\n   |           --- value moved here\nLL |     drop(lhs);  //~ ERROR use of moved value: `lhs`\nLL |     drop(rhs);  //~ ERROR use of moved value: `rhs`\n   |          ^^^ value used here after move\n   |\n   = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait\n\n"}
[01:00:57] {"message":"aborting due to 20 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 20 previous errors\n\n"}
[01:00:57] {"message":"For more information about this error, try `rustc --explain E0382`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0382`.\n"}
[01:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] thread '[ui] ui/binop/binop-consume-args.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[01:00:57] 
[01:00:57] 
[01:00:57] ---- [ui] ui/binop/binop-move-semantics.rs stdout ----
[01:00:57] diff of stderr:
[01:00:57] 
[01:00:57] - error[E0382]: use of moved value: `x`
[01:00:57] -   --> $DIR/binop-move-semantics.rs:18:5
[01:00:57] + error[E0502]: cannot borrow `f` as immutable because it is also borrowed as mutable
[01:00:57] +   --> $DIR/binop-move-semantics.rs:64:6
[01:00:57] 3    |
[01:00:57] - LL |     x
[01:00:57] -    |     - value moved here
[01:00:57] + LL |     &mut f
[01:00:57] +    |          - mutable borrow occurs here
[01:00:57] 6 LL |     +
[01:00:57] - LL |     x;  //~ ERROR: use of moved value
[01:00:57] -    |     ^ value used here after move
[01:00:57] -    |
[01:00:57] -    = note: move occurs because `x` has type `T`, which does not implement the `Copy` trait
[01:00:57] + LL |     &f;  //~ ERROR: cannot borrow `f` as immutable because it is also borrowed as mutable
[01:00:57] +    |      |
[01:00:57] +    |      immutable borrow occurs here
[01:00:57] +    |      immutable borrow occurs here
[01:00:57] +    |      mutable borrow ends here
[01:00:57] 11 
[01:00:57] - error[E0382]: use of moved value: `x`
[01:00:57] -   --> $DIR/binop-move-semantics.rs:24:5
[01:00:57] + error[E0502]: cannot borrow `f` as mutable because it is also borrowed as immutable
[01:00:57] +   --> $DIR/binop-move-semantics.rs:72:10
[01:00:57] 14    |
[01:00:57] - LL |     x
[01:00:57] -    |     - value moved here
[01:00:57] + LL |     &f
[01:00:57] +    |      - immutable borrow occurs here
[01:00:57] 17 LL |     +
[01:00:57] - LL |     x.clone();  //~ ERROR: use of moved value
[01:00:57] -    |     ^ value used here after move
[01:00:57] -    |
[01:00:57] -    = note: move occurs because `x` has type `T`, which does not implement the `Copy` trait
[01:00:57] + LL |     &mut f;  //~ ERROR: cannot borrow `f` as mutable because it is also borrowed as immutable
[01:00:57] +    |          |
[01:00:57] +    |          mutable borrow occurs here
[01:00:57] +    |          mutable borrow occurs here
[01:00:57] +    |          immutable borrow ends here
[01:00:57] 23 error[E0505]: cannot move out of `x` because it is borrowed
[01:00:57] 24   --> $DIR/binop-move-semantics.rs:31:5
[01:00:57] 
[01:00:57] 
[01:00:57] 50 LL |     *n;  //~ ERROR: cannot move out of borrowed content
[01:00:57] 51    |     ^^ cannot move out of borrowed content
[01:00:57] 52 
[01:00:57] - error[E0502]: cannot borrow `f` as immutable because it is also borrowed as mutable
[01:00:57] -   --> $DIR/binop-move-semantics.rs:64:6
[01:00:57] + error[E0382]: use of moved value: `x`
[01:00:57] +   --> $DIR/binop-move-semantics.rs:24:5
[01:00:57] 55    |
[01:00:57] - LL |     &mut f
[01:00:57] -    |          - mutable borrow occurs here
[01:00:57] + LL |     x
[01:00:57] +    |     - value moved here
[01:00:57] 58 LL |     +
[01:00:57] - LL |     &f;  //~ ERROR: cannot borrow `f` as immutable because it is also borrowed as mutable
[01:00:57] -    |      |
[01:00:57] -    |      immutable borrow occurs here
[01:00:57] -    |      immutable borrow occurs here
[01:00:57] -    |      mutable borrow ends here
[01:00:57] + LL |     x.clone();  //~ ERROR: use of moved value
[01:00:57] +    |     ^ value used here after move
[01:00:57] +    |
[01:00:57] +    = note: move occurs because `x` has type `T`, which does not implement the `Copy` trait
[01:00:57] 64 
[01:00:57] - error[E0502]: cannot borrow `f` as mutable because it is also borrowed as immutable
[01:00:57] -   --> $DIR/binop-move-semantics.rs:72:10
[01:00:57] + error[E0382]: use of moved value: `x`
[01:00:57] +   --> $DIR/binop-move-semantics.rs:18:5
[01:00:57] 67    |
[01:00:57] - LL |     &f
[01:00:57] -    |      - immutable borrow occurs here
[01:00:57] + LL |     x
[01:00:57] +    |     - value moved here
[01:00:57] 70 LL |     +
[01:00:57] - LL |     &mut f;  //~ ERROR: cannot borrow `f` as mutable because it is also borrowed as immutable
[01:00:57] -    |          |
[01:00:57] -    |          mutable borrow occurs here
[01:00:57] -    |          mutable borrow occurs here
[01:00:57] -    |          immutable borrow ends here
[01:00:57] + LL |     x;  //~ ERROR: use of moved value
[01:00:57] +    |     ^ value used here after move
[01:00:57] +    |
[01:00:57] +    = note: move occurs because `x` has type `T`, which does not implement the `Copy` trait
[01:00:57] 77 error: aborting due to 8 previous errors
[01:00:57] 78 
[01:00:57] 
[01:00:57] 
[01:00:57] 
[01:00:57] The actual stderr differed from the expected stderr.
[01:00:57] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/binop/binop-move-semantics/binop-move-semantics.stderr
[01:00:57] To update references, rerun the tests and pass the `--bless` flag
[01:00:57] To only update this specific test, also pass `--test-args binop/binop-move-semantics.rs`
[01:00:57] error: 1 errors occurred comparing output.
[01:00:57] status: exit code: 1
[01:00:57] status: exit code: 1
[01:00:57] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/binop/binop-move-semantics.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/binop/binop-move-semantics/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/binop/binop-move-semantics/auxiliary" "-A" "unused"
[01:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] ------------------------------------------
---
[01:00:57] 
[01:00:57] 1 error[E0308]: mismatched types
[01:00:57] -   --> $DIR/no_revealing_outside_defining_module.rs:26:19
[01:00:57] -    |
[01:00:57] - LL |     let _: &str = bomp(); //~ ERROR mismatched types
[01:00:57] -    |                   ^^^^^^ expected &str, found opaque type
[01:00:57] -    = note: expected type `&str`
[01:00:57] -               found type `Boo`
[01:00:57] - 
[01:00:57] - error[E0308]: mismatched types
[01:00:57] - error[E0308]: mismatched types
[01:00:57] 11   --> $DIR/no_revealing_outside_defining_module.rs:30:5
[01:00:57] 12    |
[01:00:57] 13 LL | fn bomp() -> boo::Boo {
[01:00:57] 17    |
[01:00:57] 18    = note: expected type `Boo`
[01:00:57] 19               found type `&'static str`
[01:00:57] + 
[01:00:57] + 
[01:00:57] + error[E0308]: mismatched types
[01:00:57] +   --> $DIR/no_revealing_outside_defining_module.rs:26:19
[01:00:57] +    |
[01:00:57] + LL |     let _: &str = bomp(); //~ ERROR mismatched types
[01:00:57] +    |                   ^^^^^^ expected &str, found opaque type
[01:00:57] +    = note: expected type `&str`
[01:00:57] +               found type `Boo`
[01:00:57] 20 
[01:00:57] 21 error: aborting due to 2 previous errors
[01:00:57] 21 error: aborting due to 2 previous errors
[01:00:57] 22 
[01:00:57] 
[01:00:57] 
[01:00:57] The actual stderr differed from the expected stderr.
[01:00:57] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/existential_types/no_revealing_outsidend type `&'static str`\n\n"}
[01:00:57] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/existential_types/no_revealing_outside_defining_module.rs","byte_start":684,"byte_end":690,"line_start":26,"line_end":26,"column_start":19,"column_end":25,"is_primary":true,"text":[{"text":"    let _: &str = bomp(); //~ ERROR mismatched types","highlight_start":19,"highlight_end":25}],"label":"expected &str, found opaque type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `&str`\n   found type `Boo`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/existential_types/no_revealing_outside_defining_module.rs:26:19\n   |\nLL |     let _: &str = bomp(); //~ ERROR mismatched types\n   |                   ^^^^^^ expected &str, found opaque type\n   |\n   = note: expected type `&str`\n              found type `Boo`\n\n"}
[01:00:57] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[01:00:57] {"message":"For more information about this error, try `rustc --explain E0308`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0308`.\n"}
[01:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] thread '[ui] ui/existential_types/no_revealing_outside_defining_module.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[01:00:57] 
[01:00:57] 
[01:00:57] ---- [ui] ui/generator/yield-while-local-borrowed.rs stdout ----
[01:00:57] diff of stderr:
[01:00:57] 
[01:00:57] 1 error[E0626]: borrow may still be in use when generator yields (Ast)
[01:00:57] -   --> $DIR/yield-while-local-borrowed.rs:24:22
[01:00:57] -    |
[01:00:57] - LL |         let a = &mut 3;
[01:00:57] - ...
[01:00:57] - ...
[01:00:57] - LL |         yield();
[01:00:57] -    |         ------- possible yield occurs here
[01:00:57] - 
[01:00:57] - error[E0626]: borrow may still be in use when generator yields (Ast)
[01:00:57] 11   --> $DIR/yield-while-local-borrowed.rs:52:22
[01:00:57] 12    |
[01:00:57] 13 LL |             let b = &a;
[01:00:57] 
[01:00:57] 16 LL |             yield();
[01:00:57] 17    |             ------- possible yield occurs here
[01:00:57] 18 
[01:00:57] - error[E0626]: borrow may still be in use when generator yields (Mir)
[01:00:57] -   --> $DIR/yield-while-local-borrowed.rs:24:17
[01:00:57] + tor;\nlet mut b = || {\n    let a = 3;\n    yield ();\n    println!(\"{}\", a);\n};\nunsafe { b.resume() };\n```\n\nThis is a very simple case, of course. In more complex cases, we may\nwish to have more than one reference to the value that was borrowed --\nin those cases, something like the `Rc` or `Arc` types may be useful.\n\nThis error also frequently arises with iteration:\n\n```compile_fail,E0626\n# #![feature(generators, generator_trait)]\n# use std::ops::Generator;\nlet mut b = || {\n  let v = vec![1,2,3];\n  for &x in &v { // <-- borrow of `v` is still in scope...\n    yield x; // ...when this yield occurs.\n  }\n};\nunsafe { b.resume() };\n```\n\nSuch cases can sometimes be resolved by iterating \"by value\" (or using\n`into_iter()`) to avoid borrowing:\n\n```\n# #![feature(generators, generator_trait)]\n# use std::ops::Generator;\nlet mut b = || {\n  let v = vec![1,2,3];\n  for x in v { // <-- Take ownership of the values instead!\n    yield x; // <-- Now yield is OK.\n  }\n};\nunsafe { b.resume() };\n```\n\nIf taking ownership is not an option, using indices can work too:\n\n```\n# #![feature(generators, generator_trait)]\n# use std::ops::Generator;\nlet mut b = || {\n  let v = vec![1,2,3];\n  let len = v.len(); // (*)\n  for i in 0..len {\n    let x = v[i]; // (*)\n    yield x; // <-- Now yield is OK.\n  }\n};\nunsafe { b.resume() };\n\n// (*) -- Unfortunately, these temporaries are currently required.\n// See <https://github.com/rust-lang/rust/issues/43122>.\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/generator/yield-while-local-borrowed.rs","byte_start":1774,"byte_end":1781,"line_startt overlap the\nyield or else eliminated in another way. So, for example, we might\nresolve the previous example by removing the borrow and just storing\nthe integer by value:\n\n```\n# #![feature(generators, generator_trait)]\n# use std::ops::Generator;\nlet mut b = || {\n    let a = 3;\n    yield ();\n    println!(\"{}\", a);\n};\nunsafe { b.resume() };\n```\n\nThis is a very simple case, of course. In more complex cases, we may\nwish to have more than one reference to the value that was borrowed --\nin those cases, something like the `Rc` or `Arc` types may be useful.\n\nThis error also frequently arises with iteration:\n\n```compile_fail,E0626\n# #![feature(generators, generator_trait)]\n# use std::ops::Generator;\nlet mut b = || {\n  let v = vec![1,2,3];\n  for &x in &v { // <-- borrow of `v` is still in scope...\n    yield x; // ...when this yield occurs.\n  }\n};\nunsafe { b.resume() };\n```\n\nSuch cases can sometimes be resolved by iterating \"by value\" (or using\n`into_iter()`) to avoid borrowing:\n\n```\n# #![feature(generators, generator_trait)]\n# use std::ops::Generator;\nlet mut b = || {\n  let v = vec![1,2,3];\n  for x in v { // <-- Take ownership of the values instead!\n    yield x; // <-- Now yield is OK.\n  }\n};\nunsafe { b.resume() };\n```\n\nIf taking ownership is not an option, using indices can work too:\n\n```\n# #![feature(generators, generator_trait)]\n# use std::ops::Generator;\nlet mut b = || {\n  let v = vec![1,2,3];\n  let len = v.len(); // (*)\n  for i in 0..len {\n    let x = v[i]; // (*)\n    yield x; // <-- Now yield is OK.\n  }\n};\nunsafe { b.resume() };\n\n// (*) -- Unfortunately, these temporaries are currently required.\n// See <https://github.com/rust-lang/rust/issues/43122>.\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/generator/yield-while-local-borrowed.rs","byte_start":1033,"byte_end":1040,"line_start":27,"line_end":27,"column_start":9,"column_end":16,"is_primary":false,"text":[{"text":"        yield();","highlight_start":9,"highlight_end":16}],"label":"possible yield occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/generator/yield-while-local-borrowed.rs","byte_start":874,"byte_end":875,"line_start":24,"line_end":24,"column_start":22,"column_end":23,"is_primary":true,"text":[{"text":"        let a = &mut 3;","highlight_start":22,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0626]: borrow may still be in use when generator yields (Ast)\n  --> /checkout/src/test/ui/generator/yield-while-local-borrowed.rs:24:22\n   |\nLL |         let a = &mut 3;\n   |                      ^\n...\nLL |         yield();\n   |         ------- possible yield occurs here\n\n"}
[01:00:57] {"message":"borrow may still be in use when generator yields (Mir)","code":{"code":"E0626","explanation":"\nThis error occurs because a borrow in a generator persists across a\nyield point.\n\n```compile_fail,E0626\n# #![feature(generators, generator_trait)]\n# use std::ops::Generator;\nlet mut b = || {\n    let a = &String::new(); // <-- This borrow...\n    yield (); // ...is still in scope here, when the yield occurs.\n    println!(\"{}\nerator;\nlet mut b = || {\n  let v = vec![1,2,3];\n  let len = v.len(); // (*)\n  for i in 0..len {\n    let x = v[i]; // (*)\n    yield x; // <-- Now yield is OK.\n  }\n};\nunsafe { b.resume() };\n\n// (*) -- Unfortunately, these temporaries are currently required.\n// See <https://github.com/rust-lang/rust/issues/43122>.\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/generator/yield-while-local-borrowed.rs","byte_start":1774,"byte_end":1781,"line_start":55,"line_end":55,"column_start":13,"column_end":20,"is_primary":false,"text":[{"text":"            yield();","highlight_start":13,"highlight_end":20}],"label":"possible yield occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/generator/yield-while-local-borrowed.rs","byte_start":1602,"byte_end":1604,"line_start":52,"line_end":52,"column_start":21,"column_end":23,"is_primary":true,"text":[{"text":"            let b = &a;","highlight_start":21,"highlight_end":23}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0626]: borrow may still be in use when generator yields (Mir)\n  --> /checkout/src/test/ui/generator/yield-while-local-borrowed.rs:52:21\n   |\nLL |             let b = &a;\n   |                     ^^\n...\nLL |             yield();\n   |             ------- possible yield occurs here\n\n"}
[01:00:57] {"message":"borrow may still be in use when generator yields (Mir)","code":{"code":"E0626","explanation":"\nThis error occurs because a borrow in a generator persists across a\nyield point.\n\n`2","explanation":"\nThis error indicates that you are trying to borrow a variable as mutable when it\nhas already been borrowed as immutable.\n\nExample of erroneous code:\n\n```compile_fail,E0502\nfn bar(x: &mut i32) {}\nfn foo(a: &mut i32) {\n    let ref y = a; // a is borrowed as immutable.\n    bar(a); // error: cannot borrow `*a` as mutable because `a` is also borrowed\n            //        as immutable\n}\n```\n\nTo fix this error, ensure that you don't have any other references to the\nvariable before trying to access it mutably:\n\n```\nfn bar(x: &mut i32) {}\nfn foo(a: &mut i32) {\n    bar(a);\n    let ref y = a; // ok!\n}\n```\n\nFor more information on the rust ownership system, take a look at\nhttps://doc.rust-lang.org/stable/book/references-and-borrowing.html.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/generator/yield-while-iterating.rs","byte_start":1798,"byte_end":1799,"line_start":67,"line_end":67,"column_start":20,"column_end":21,"is_primary":true,"text":[{"text":"    println!(\"{}\", x[0]); //~ ERROR","highlight_start":20,"highlight_end":21}],"label":"immutable borrow occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/generator/yield-while-iterating.rs","byte_start":1710,"byte_end":1712,"line_start":62,"line_end":62,"column_start":17,"column_end":19,"is_primary":false,"text":[{"text":"    let mut b = || {","highlight_start":17,"highlight_end":19}],"label":"mutable borrow occurs here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/generator/yieo 2 previous errors\n\n"}
[01:00:57] {"message":"Some errors occurred: E0502, E0626.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0502, E0626.\n"}
[01:00:57] {"message":"For more information about an error, try `rustc --explain E0502`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0502`.\n"}
[01:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] thread '[ui] ui/generator/yield-while-iterating.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[01:00:57] 
[01:00:57] 
[01:00:57] ---- [ui] ui/hrtb/hrtb-higher-ranker-supertraits.rs stdout ----
[01:00:57] diff of stderr:
[01:00:57] 
[01:00:57] - error[E0277]: the trait bound `for<'tcx> F: Foo<'tcx>` is not satisfied
[01:00:57] -   --> $DIR/hrtb-higher-ranker-supertraits.rs:28:5
[01:00:57] -    |
[01:00:57] - LL |     want_foo_for_any_tcx(f); //~ ERROR E0277
[01:00:57] -    |     ^^^^^^^^^^^^^^^^^^^^ the trait `for<'tcx> Foo<'tcx>` is not implemented for `F`
[01:00:57] -    |
[01:00:57] -    = help: consider adding a `where for<'tcx> F: Foo<'tcx>` bound
[01:00:57] - note: required by `want_foo_for_any_tcx`
[01:00:57] -   --> $DIR/hrtb-higher-ranker-supertraits.rs:31:1
[01:00:57] -    |
[01:00:57] - LL | / fn want_foo_for_any_tcx<F>(f: &F)
[01:00:57] - LL | |     where F : for<'tcx> Foo<'tcx>
[01:00:57] - LL | | {
[01:00:57] - LL | |     want_foo_for_some_tcx(f);
[01:00:57] - LL | |     want_foo_for_any_tcx(f);
[01:00:57] - LL | | }
[01:00:57] - 
[01:00:57] - 
[01:00:57] 19 error[E0277]: the trait bound `for<'ccx> B: Bar<'ccx>` is not satisfied
[01:00:57] 20   --> $DIR/hrtb-higher-ranker-supertraits.rs:45:5
[01:00:57] 
[01:00:57] 
[01:00:57] 32 LL | |     want_foo_for_some_tcx(b);
[01:00:57] 33 ...  |
[01:00:57] 34 LL | |     want_bar_for_any_ccx(b);
[01:00:57] + LL | | }
[01:00:57] + 
[01:00:57] + 
[01:00:57] + error[E0277]: the trait bound `for<'tcx> F: Foo<'tcx>` is not satisfied
[01:00:57] +   --> $DIR/hrtb-higher-ranker-supertraits.rs:28:5
[01:00:57] +    |
[01:00:57] + LL |     want_foo_for_any_tcx(f); //~ ERROR E0277
[01:00:57] +    |     ^^^^^^^^^^^^^^^^^^^^ the trait `for<'tcx> Foo<'tcx>` is not implemented for `F`
[01:00:57] +    |
[01:00:57] +    = help: consider adding a `where for<'tcx> F: Foo<'tcx>` bound
[01:00:57] + note: required by `want_foo_for_any_tcx`
[01:00:57] +   --> $DIR/hrtb-higher-ranker-supertraits.rs:31:1
[01:00:57] +    |
[01:00:57] + LL | / fn want_foo_for_any_tcx<F>(f: &F)
[01:00:57] + LL | |     where F : for<'tcx> Foo<'tcx>
[01:00:57] + LL | | {
[01:00:57] + LL | |     want_foo_for_some_tcx(f);
[01:00:57] + LL | |     want_foo_for_any_tcx(f);
[01:00:57] 35 LL | | }
[01:00:57] 37 
[01:00:57] 
[01:00:57] 
[01:00:57] The actual stderr differed from the expected stderr.
[01:00:57] The actual stderr differed from the expected stderr.
[01:00:57] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/hrtb/hrtb-higher-ranker-supertraits/hrtb-higher-ranker-supertraits.stderr
[01:00:57] To update references, rerun the tests and pass the `--bless` flag
[01:00:57] To only update this specific test, also pass `--test-args hrtb/hrtb-higher-ranker-supertraits.rsile_name":"/checkout/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.rs","byte_start":1102,"byte_end":1122,"line_start":45,"line_end":45,"column_start":5,"column_end":25,"is_primary":true,"text":[{"text":"    want_bar_for_any_ccx(b); //~ ERROR E0277","highlight_start":5,"highlight_end":25}],"label":"the trait `for<'ccx> Bar<'ccx>` is not implemented for `B`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider adding a `where for<'ccx> B: Bar<'ccx>` bound","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required by `want_bar_for_any_ccx`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.rs","byte_start":1146,"byte_end":1336,"line_start":48,"line_end":56,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn want_bar_for_any_ccx<B>(b: &B)","highlight_start":1,"highlight_end":34},{"text":"    where B : for<'ccx> Bar<'ccx>","highlight_start":1,"highlight_end":34},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"    want_foo_for_some_tcx(b);","highlight_start":1,"highlight_end":30},{"text":"    want_foo_for_any_tcx(b);","highlight_start":1,"highlight_end":29},{"text":"","highlight_start":1,"highlight_end":1},{"text":"    want_bar_for_some_ccx(b);","highlight_start":1,"highlight_end":30},{"text":"    want_bar_for_any_ccx(b);","highlight_start":1,"highlight_end":29},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `for<'ccx> B: Bar<'ccx>` is not satisfied\n  --> /checkout/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.rs:45:5\n   |\nLL |     want_bar_for_any_ccx(b); //~ ERROR E0277\n   |     ^^^^^^^^^^^^^^^^^^^^ the trait `for<'ccx> Bar<'ccx>` is not implemented for `B`\n   |\n   = help: consider adding a `where for<'ccx> B: Bar<'ccx>` bound\nnote: required by `want_bar_for_any_ccx`\n  --> /checkout/src/test/ui/hrtb/hrtb-higher-ranker-supertraits.rs:48:1\n   |\nLL | / fn want_bar_for_any_ccx<B>(b: &B)\nLL | |     where B : for<'ccx> Bar<'ccx>\nLL | | {\nLL | |     want_foo_for_some_tcx(b);\n...  |\nLL | |     want_bar_for_any_ccx(b);\nLL | | }\n   | |_^\n\n"}
[01:00:57] {"message":"the trait bound `for<'tcx> F: Foo<'tcx>` 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/hrtb/hrtb-higher-ranker-supertraits.rs","byte_start":770,"byte_end":790,"line_start":28,"line_end":28,"column_start":5,"column_end":25,"is_primary":true,"text":[{"text":"    want_foo_f/hrtb/hrtb-higher-ranker-supertraits.rs:31:1\n   |\nLL | / fn want_foo_for_any_tcx<F>(f: &F)\nLL | |     where F : for<'tcx> Foo<'tcx>\nLL | | {\nLL | |     want_foo_for_some_tcx(f);\nLL | |     want_foo_for_any_tcx(f);\nLL | | }\n   | |_^\n\n"}
[01:00:57] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[01:00:57] {"message":"For more information about this error, try `rustc --explain E0277`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0277`.\n"}
[01:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] thread '[ui] ui/hrtb/hrtb-higher-ranker-supertraits.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[01:00:57] 
[01:00:57] 
[01:00:57] ---- [ui] ui/immut-function-arguments.rs#ast stdout ----
[01:00:57] diff of stderr:
[01:00:57] 
[01:00:57] - error[E0594]: cannot assign to immutable `Box` content `*y`
[01:00:57] -   --> $DIR/immut-function-arguments.rs:15:5
[01:00:57] -    |
[01:00:57] - LL | fn f(y: Box<isize>) {
[01:00:57] -    |      - help: make this binding mutable: `mut y`
[01:00:57] - LL |     *y = 5; //[ast]~ ERROR cannot assign
[01:00:57] -    |     ^^^^^^ cannot borrow as mutable
[01:00:57] - 
[01:00:57] 9 error[E0594]: cannot assign to immutable `Box` content `*q`
[01:00:57] 10   --> $DIR/immut-function-arguments.rs:20:35
[01:00:57] 
[01:00:57] 13    |                  -                ^^^^^^ cannot borrow as mutable
[01:00:57] 13    |                  -                ^^^^^^ cannot borrow as mutable
[01:00:57] 14    |    lifetime mismatch","highlight_start":24,"highlight_end":31}],"label":"this parameter and the return type are declared with different lifetimes...","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/in-band-lifetimes/mismatched.rs","byte_start":637,"byte_end":644,"line_start":16,"line_end":16,"column_start":36,"column_end":43,"is_primary":false,"text":[{"text":"fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y } //~ ERROR lifetime mismatch","highlight_start":36,"highlight_end":43}],"label":"","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/in-band-lifetimes/mismatched.rs","byte_start":647,"byte_end":648,"line_start":16,"line_end":16,"column_start":46,"column_end":47,"is_primary":true,"text":[{"text":"fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y } //~ ERROR lifetime mismatch","highlight_start":46,"highlight_end":47}],"label":"...but data from `y` is returned here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0623]: lifetime mismatch\n  --> /checkout/src/test/ui/in-band-lifetimes/mismatched.rs:16:46\n   |\nLL | fn foo2(x: &'a u32, y: &'b u32) -> &'a u32 { y } //~ ERROR lifetime mismatch\n   |                        -------     -------   ^ ...but data from `y` is returned here\n   |                        |\n   |                        this parameter and the return type are declared with different lifetimes...\n\n"}
[01:00:57] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"X {\n    Entry,\n}\n\nX::Entry(); // error: expected function, found `X::Entry`\n\n// Or even simpler:\nlet x = 0i32;\nx(); // error: expected function, found `i32`\n```\n\nOnly functions and methods can be called using `()`. Example:\n\n```\n// We declare a function:\nfn i_am_a_function() {}\n\n// And we call it:\ni_am_a_function();\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-10969.rs","byte_start":489,"byte_end":492,"line_start":12,"line_end":12,"column_start":5,"column_end":8,"is_primary":false,"text":[{"text":"    i(); //~ERROR expected function, found `i32`","highlight_start":5,"highlight_end":8}],"label":"call expression requires function","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-10969.rs","byte_start":475,"byte_end":476,"line_start":11,"line_end":11,"column_start":9,"column_end":10,"is_primary":false,"text":[{"text":"fn func(i: i32) {","highlight_start":9,"highlight_end":10}],"label":"`i32` defined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-10969.rs","byte_start":489,"byte_end":490,"line_start":12,"line_end":12,"column_start":5,"column_end":6,"is_primary":true,"text":[{"text":"    i(); //~ERROR expected function, found `i32`","highlight_start":5,"highlight_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0618]: expected function, found `i32`\n  --> /checkout/src/test/ui/issues/issue-10969.rs:12:5\n   |\nLL | fn func(i: i32) {\n   |         - `i32` defined here\nLL |     i(); //~ERROR expected function, found `i32`\n   |     ^--\n   |     |\n   |     call expression requires function\n\n"}
[01:00:57] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[01:00:57] {"message":"For more information about this error, try `rustc --explain E0618`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0618`.\n"}
[01:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] thread '[ui] ui/issues/issue-10969.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[01:00:57] 
[01:00:57] 
[01:00:57] ---- [ui] ui/issues/issue-13853.rs stdout ----
[01:00:57] diff of stderr:
[01:00:57] 
[01:00:57] 1 error[E0308]: mismatched types
[01:00:57] -   --> $DIR/issue-13853.rs:24:9
[01:00:57] +   --> $DIR/issue-13853.rs:47:13
[01:00:57] 3    |
[01:00:57] - LL |     fn nodes<'a, I: Iterator<Item=&'a N>>(&self) -> I
[01:00:57] -    |                                                     - expected `I` because of return type
[01:00:57] - ...
[01:00:57] - LL |         self.iter() //~ ERROR mismatched types
[01:00:57] -    |         ^^^^^^^^^^^ expected type parameter, found struct `std::slice::Iter`
[01:00:57] + LL |     iterate(graph); //~ ERROR mismatched types
[01:00:57] +    |             |
[01:00:57] +    |             expected reference, found struct `std::vec::Vec`
[01:00:57] +    |             expected reference, found struct `std::vec::Vec`
[01:00:57] +    |             hel: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-13853.rs","byte_start":1089,"byte_end":1094,"line_start":47,"line_end":47,"column_start":13,"column_end":18,"is_primary":true,"text":[{"text":"    iterate(graph); //~ ERROR mismatched types","highlight_start":13,"highlight_end":18}],"label":"expected reference, found struct `std::vec::Vec`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `&_`\n   found type `std::vec::Vec<Stuff>`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"consider borrowing here","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-13853.rs","byte_start":1089,"byte_end":1094,"line_start":47,"line_end":47,"column_start":13,"column_end":18,"is_primary":true,"text":[{"text":"    iterate(graph); //~ ERROR mismatched types","highlight_start":13,"highlight_end":18}],"label":null,"suggested_replacement":"&graph","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/issues/issue-13853.rs:47:13\n   |\nLL |     iterate(graph); //~ ERROR mismatched types\n   |             ^^^^^\n   |             |\n   |             expected reference, found struct `std::vec::Vec`\n   |             help: consider borrowing here: `&l,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-13853.rs","byte_start":726,"byte_end":737,"line_start":24,"line_end":24,"column_start":9,"column_end":20,"is_primary":true,"text":[{"text":"        self.iter() //~ ERROR mismatched types","highlight_start":9,"highlight_end":20}],"label":"expected type parameter, found struct `std::slice::Iter`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-13853.rs","byte_start":690,"byte_end":691,"line_start":21,"line_end":21,"column_start":53,"column_end":54,"is_primary":false,"text":[{"text":"    fn nodes<'a, I: Iterator<Item=&'a N>>(&self) -> I","highlight_start":53,"highlight_end":54}],"label":"expected `I` because of return type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `I`\n   found type `std::slice::Iter<'_, N>`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/issues/issue-13853.rs:24:9\n   |\nLL |     fn nodes<'a, I: Iterator<Item=&'a N>>(&self) -> I\n   |                                                     - expected `I` because of return type\n...\nLL |         self.iter() //~ ERROR mismatched types\n   |         ^^^^^^^^^^^ expected type parameter, found struct `std::slice::Iter`\n   |\n   = note: expected type `I`\n              found type `std::slice::Iter<'_, N>`\n\n"}
[01:00:57] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[01:00:57] {"message":"Some errors occurred: E0308, E0599.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0308, E0599.\n"}
[01:00:57] {"message":"For more information about an error, try `rustc --explain E0308`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0308`.\n"}
[01:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] thread '[ui] ui/issues/issue-13853.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[01:00:57] 
[01:00:57] 
[01:00:57] ---- [ui] ui/issues/issue-17718-const-bad-values.rs stdout ----
[01:00:57] diff of stderr:
[01:00:57] 
[01:00:57] - error[E0017]: references in constants may only refer to immutable values
[01:00:57] -    |
[01:00:57] -    |
[01:00:57] - LL | const C1: &'static mut [usize] = &mut [];
[01:00:57] -    |                                  ^^^^^^^ constants require immutable values
[01:00:57] 7 error[E0013]: constants cannot refer to statics, use a constant instead
[01:00:57] 8   --> $DIR/issue-17718-const-bad-values.rs:15:41
[01:00:57] 9    |
[01:00:57] 
[01:00:57] 
[01:00:57] 15    |
[01:00:57] 16 LL | const C2: &'static mut usize = unsafe { &mut S };
[01:00:57] 
[01:00:57] ------------------------------------------
[01:00:57] stderr:
[01:00:57] ------------------------------------------
[01:00:57] ------------------------------------------
[01:00:57] {"message":"constants cannot refer to statics, use a constant instead","code":{"code":"E0013","explanation":"\nStatic and const variables can refer to other const variables. But a const\nvariable cannot refer to a static variable. For example, `Y` cannot refer to\n`X` here:\n\n```compile_fail,E0013\nstatic X: i32 = 42;\nconst Y: i32 = X;\n```\n\nTo fix this, the value can be extracted as a const and then used:\n\n```\nconst A: i32 = 42;\nstatic X: i32 = A;\nconst Y: i32 = A;\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-17718-const-bad-values.rs","byte_start":646,"byte_end":652,"line_start":15,"line_end":15,"column_start":41,"column_end":47,"is_primary":true,"text":[{"text":"const C2: &'static mut usize = unsafe { &mut S };","highlight_start":41,"highlight_end":47}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0013]: constants cannot refer to statics, use a constant instead\n  --> /checkout/src/test/ui/issues/issue-17718-const-bad-values.rs:15:41\n   |\nLL | const C2: &'static mut usize = unsafe { &mut S };\n   |                                         ^^^^^^\n\n"}
[01:00:57] {"message":"references in constants may only refer to immutable values","code":{"code":"E0017","explanation":"\nReferences in statics and constants may only refer to immutable values.\nErroneous code example:\n\n```compile_fail,E0017\nstatic X: i32 = 1;\nco-----------------------
[01:00:57] thread '[ui] ui/issues/issue-17718-const-bad-values.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[01:00:57] 
[01:00:57] ---- [ui] ui/issues/issue-17718-const-borrow.rs stdout ----
[01:00:57] diff of stderr:
[01:00:57] diff of stderr:
[01:00:57] 
[01:00:57] 1 error[E0492]: cannot borrow a constant which may contain interior mutability, create a static instead
[01:00:57] -    |
[01:00:57] -    |
[01:00:57] - LL | const B: &'static UnsafeCell<usize> = &A;
[01:00:57] - 
[01:00:57] - 
[01:00:57] - error[E0492]: cannot borrow a constant which may contain interior mutability, create a static instead
[01:00:57] 9    |
[01:00:57] 9    |
[01:00:57] 10 LL | const E: &'static UnsafeCell<usize> = &D.a;
[01:00:57] 15    |
[01:00:57] 15    |
[01:00:57] 16 LL | const F: &'static C = &D;
[01:00:57] + 
[01:00:57] + 
[01:00:57] + error[E0492]: cannot borrow a constant which may contain interior mutability, create a static instead
[01:00:57] +   --> $DIR/issue-17718-const-borrow.rs:14:39
[01:00:57] +    |
[01:00:57] + LL | const B: &'static UnsafeCell<usize> = &A;
[01:00:57] 18 
[01:00:57] 19 error: aborting due to 3 previous errors
[01:00:57] 20 
[01:00:57] 
[01:00:57] 
[01:00:57] 
[01:00:57] The actual stderr differed from the expected stderr.
[01:00:57] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-17718-const-borrow/issue-1er this solution is unsafe! You will have to ensure that accesses to the\ncell are synchronized.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-17718-const-borrow.rs","byte_start":776,"byte_end":780,"line_start":19,"line_end":19,"column_start":39,"column_end":43,"is_primary":true,"text":[{"text":"const E: &'static UnsafeCell<usize> = &D.a;","highlight_start":39,"highlight_end":43}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0492]: cannot borrow a constant which may contain interior mutability, create a static instead\n  --> /checkout/src/test/ui/issues/issue-17718-const-borrow.rs:19:39\n   |\nLL | const E: &'static UnsafeCell<usize> = &D.a;\n   |                                       ^^^^\n\n"}
[01:00:57] {"message":"cannot borrow a constant which may contain interior mutability, create a static instead","code":{"code":"E0492","explanation":"\nA borrow of a constant containing interior mutability was attempted. Erroneous\ncode example:\n\n```compile_fail,E0492\nuse std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT};\n\nconst A: AtomicUsize = ATOMIC_USIZE_INIT;\nstatic B: &'static AtomicUsize = &A;\n// error: cannot borrow a constant which may contain interior mutability,\n//        create a static instead\n```\n\nA `const` represents a constant value that should never change. If one takes\na `&` reference to the constant, then one is taking a pointer to some memory\nlocation containing the value. Normally this is perfectly fine: most values\ncan't be changed via a shared `&` pointer, but interior mutability woul"column_end":25,"is_primary":true,"text":[{"text":"const F: &'static C = &D;","highlight_start":23,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0492]: cannot borrow a constant which may contain interior mutability, create a static instead\n  --> /checkout/src/test/ui/issues/issue-17718-const-borrow.rs:21:23\n   |\nLL | const F: &'static C = &D;\n   |                       ^^\n\n"}
[01:00:57] {"message":"cannot borrow a constant which may contain interior mutability, create a static instead","code":{"code":"E0492","explanation":"\nA borrow of a constant containing interior mutability was attempted. Erroneous\ncode example:\n\n```compile_fail,E0492\nuse std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT};\n\nconst A: AtomicUsize = ATOMIC_USIZE_INIT;\nstatic B: &'static AtomicUsize = &A;\n// error: cannot borrow a constant which may contain interior mutability,\n//        create a static instead\n```\n\nA `const` represents a constant value that should never change. If one takes\na `&` reference to the constant, then one is taking a pointer to some memory\nlocation containing the value. Normally this is perfectly fine: most values\ncan't be changed via a shared `&` pointer, but interior mutability would allow\nit. That is, a constant value could be mutated. On the other hand, a `static` is\nexplicitly a single memory location, which can be mutated at will.\n\nSo, in order to solve this error, either use statics which are `Sync`:\n\n```\nuse std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT};\n\nstatic A: AtomicUsize = ATOMIC_USIZE_INIT;\nstatic B: &'static AtomicUsize = &A; // ok!\n```\n\nYou can also have this error while using a cell type:\n\n```compile_fail,E0492\nuse std::cell::Cell;\n\nconst A: Cell<usize> = Cell::new(1);\nconst B: &Cell<usize> = &A;\n// error: cannot borrow a constant which may contain interior mutability,\n//        create a static instead\n\n// or:\nstruct C { a: Cell<usize> }\n\nconst D: C = C { a: Cell::new(1) };\nconst E: &Cell<usize> = &D.a; // error\n\n// or:\nconst F: &C = &D; // error\n```\n\nThis is because cell types do operations that are not thread-safe. Due to this,\nthey don't implement Sync and thus can't be placed in statics.\n\nHowever, if you still wish to use these types, you can achieve this by an unsafe\nwrapper:\n\n```\nuse std::cell::Cell;\nuse std::marker::Sync;\n\nstruct NotThreadSafe<T> {\n    value: Cell<T>,\n}\n\nunsafe impl<T> Sync for NotThreadSafe<T> {}\n\nstatic A: NotThreadSafe<usize> = NotThreadSafe { value : Cell::new(1) };\nstatic B: &'static NotThreadSafe<usize> = &A; // ok!\n```\n\nRemember this solution is unsafe! You will have to ensure that accesses to the\ncell are synchronized.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-17718-const-borrow.rs","byte_start":582,"byte_end":584,"line_start":14,"line_end":14,"column_start":39,"column_end":41,"is_primary":true,"text":[{"text":"const B: &'static UnsafeCell<usize> = &A;","highlight_start":39,"highlight_end":41}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0492]: cannot borrow a constant which may contain interior mutability,
[01:00:57] + 
[01:00:57] + error[E0013]: constants cannot refer to statics, use a constant instead
[01:00:57] +   --> $DIR/issue-17718-references.rs:19:28
[01:00:57] +    |
[01:00:57] + LL | const T2: &'static usize = &S; //~ ERROR: constants cannot refer to statics
[01:00:57] 18 
[01:00:57] 19 error: aborting due to 3 previous errors
[01:00:57] 20 
[01:00:57] 
[01:00:57] 
[01:00:57] 
[01:00:57] The actual stderr differed from the expected stderr.
[01:00:57] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-17718-references/issue-17718-references.stderr
[01:00:57] To update references, rerun the tests and pass the `--bless` flag
[01:00:57] To only update this specific test, also pass `--test-args issues/issue-17718-references.rs`
[01:00:57] error: 1 errors occurred comparing output.
[01:00:57] status: exit code: 1
[01:00:57] status: exit code: 1
[01:00:57] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-17718-references.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-17718-references/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-17718-references/auxiliary" "-A" "unused"
[01:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] ------------------------------------------
[01:00:57] ------------------------------------------
[01:00:57] stde   let f = Bar();","highlight_start":13,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0618]: expected function, found `Bar`\n  --> /checkout/src/test/ui/issues/issue-21701.rs:19:13\n   |\nLL | struct Bar;\n   | ----------- `Bar` defined here\n...\nLL |     let f = Bar();\n   |             ^^^--\n   |             |\n   |             call expression requires function\n\n"}
[01:00:57] {"message":"expected function, found `U`","code":{"code":"E0618","explanation":"\nAttempted to call something which isn't a function nor a method.\n\nErroneous code examples:\n\n```compile_fail,E0618\nenum X {\n    Entry,\n}\n\nX::Entry(); // error: expected function, found `X::Entry`\n\n// Or even simpler:\nlet x = 0i32;\nx(); // error: expected function, found `i32`\n```\n\nOnly functions and methods can be called using `()`. Example:\n\n```\n// We declare a function:\nfn i_am_a_function() {}\n\n// And we call it:\ni_am_a_function();\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-21701.rs","byte_start":497,"byte_end":500,"line_start":12,"line_end":12,"column_start":13,"column_end":16,"is_primary":false,"text":[{"text":"    let y = t();","highlight_start":13,"highlight_end":16}],"label":"call expression requires function","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-21701.rs","byte_start":477,"byte_end":478,"line_start":11,"line_end":11,"column_start":11,"column_end":12,"is_primary":false,"text":[{"text":"fn foo<U>(t: U) {","highltwo closures, even if identical, have the same type","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"consider boxing your closure and/or using it as a trait object","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: match arms have incompatible types\n  --> /checkout/src/test/ui/issues/issue-24036.rs:18:13\n   |\nLL |       let x = match 1usize {\n   |  _____________^\nLL | |     //~^ ERROR match arms have incompatible types\nLL | |         1 => |c| c + 1,\nLL | |         2 => |c| c - 1,\n   | |              --------- match arm with an incompatible type\nLL | |         _ => |c| c - 1\nLL | |     };\n   | |_____^ expected closure, found a different closure\n   |\n   = note: expected type `[closure@/checkout/src/test/ui/issues/issue-24036.rs:20:14: 20:23]`\n              found type `[closure@/checkout/src/test/ui/issues/issue-24036.rs:21:14: 21:23]`\n   = note: no two closures, even if identical, have the same type\n   = help: consider boxing your closure and/or using it as a trait object\n\n"}
[01:00:57] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expressie issue #48821)
[01:00:57] + error[E0658]: statements in statics are unstable (see issue #48821)
[01:00:57] +   --> $DIR/issue-32829-2.rs:75:9
[01:00:57] 17    |
[01:00:57] 17    |
[01:00:57] 18 LL |         invalid();
[01:00:57] 
[01:00:57] 20    |
[01:00:57] 21    = help: add #![feature(const_let)] to the crate attributes to enable
[01:00:57] 22 
[01:00:57] 22 
[01:00:57] - error[E0658]: statements in constants are unstable (see issue #48821)
[01:00:57] -   --> $DIR/issue-32829-2.rs:34:9
[01:00:57] + error[E0658]: statements in statics are unstable (see issue #48821)
[01:00:57] +   --> $DIR/issue-32829-2.rs:84:9
[01:00:57] 25    |
[01:00:57] 26 LL |         valid();
[01:00:57] 
[01:00:57] 58    |
[01:00:57] 59    = help: add #![feature(const_let)] to the crate attributes to enable
[01:00:57] 60 
[01:00:57] 60 
[01:00:57] - error[E0658]: statements in statics are unstable (see issue #48821)
[01:00:57] -   --> $DIR/issue-32829-2.rs:67:9
[01:00:57] + error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
[01:00:57] +   --> $DIR/issue-32829-2.rs:25:9
[01:00:57] 63    |
[01:00:57] - LL |         5;
[01:00:57] -    |
[01:00:57] -    = help: add #![feature(const_let)] to the crate attributes to enable
[01:00:57] - 
[01:00:57] - 
[01:00:57] - error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
[01:00:57] -    |
[01:00:57] -    |
[01:00:57] 72 LL |         invalid();
[01:00:57] 73    |         ^^^:57] To only update this specific test, also pass `--test-args issues/issue-32829-2.rs`
[01:00:57] error: 1 errors occurred comparing output.
[01:00:57] status: exit code: 1
[01:00:57] status: exit code: 1
[01:00:57] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-32829-2.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-32829-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/issues/issue-32829-2/auxiliary" "-A" "unused"
[01:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] ------------------------------------------
[01:00:57] stderr:
[01:00:57] stderr:
[01:00:57] ------------------------------------------
[01:00:57] {"message":"statements in statics are unstable (see issue #48821)","code":{"code":"E0658","explanation":"\nAn unstable feature was used.\n\nErroneous code example:\n\n```compile_fail,E658\n#[repr(u128)] // error: use of unstable library feature 'repr128'\nenum Foo {\n    Bar(u64),\n}\n```\n\nIf you're using a stable or a beta version of rustc, you won't be able to use\nany unstable features. In order to do so, please switch to a nightly version of\nrustc (by using rustup).\n\nIf you're using a nightly version of rustc, just add the corresponding feature\nto be able to use it:\n\n```\n#![feature(repr128)]\n\n#[repr(u128)] // ok!\nenum Foo {\n    Bar(u64),\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-32829-2.rs","byte_start":1502,"byte_end":1503,"line_start":67,"line_end":67,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":"        5;","highlight_start":9,"highlight_end":10}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_let)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0658]: statements in statics are unstable (see issue #48821)\n  --> /checkout/src/test/ui/issues/issue-32829-2.rs:67:9\n   |\nLL |         5;\n   |         ^\n   |\n   = help: add #![feature(const_let)] to the crate attributes to enable\n\n"}
[01:00:57] {"message":"calls in statics are limited to constant functions, tuple structs and tuple variants","code":{"code":"E0015","explanation":"\nThe only functions that can be called in static or constant expressions are\n`const` functions, and struct/enum constructors. `const` functions are only\navailable on a nightly compiler. Rust currently does not support more general\ncompile-time function execution.\n\n```\nconst FOO: Option<u8> = Some(1); // enum constructor\nstruct Bar {x: u8}\nconst BAR: Bar = Bar {x: 1}; // struct constructor\n```\n\nSee [RFC 911] for more details on the design of `const fn`s.\n\n[RFC 911]: https://github.com/rust-lang/rfcs/blob/master/text/0911-const-fn.md\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-32829-2.rs","byte_start":1624,"byte_end":1633,"line_start":75,"line_end":75,"column_start":9,"column_end":18,"is_primrror[E0658]: statements in statics are unstable (see issue #48821)\n  --> /checkout/src/test/ui/issues/issue-32829-2.rs:75:9\n   |\nLL |         invalid();\n   |         ^^^^^^^^^\n   |\n   = help: add #![feature(const_let)] to the crate attributes to enable\n\n"}
[01:00:57] {"message":"statements in statics are unstable (see issue #48821)","code":{"code":"E0658","explanation":"\nAn unstable feature was used.\n\nErroneous code example:\n\n```compile_fail,E658\n#[repr(u128)] // error: use of unstable library feature 'repr128'\nenum Foo {\n    Bar(u64),\n}\n```\n\nIf you're using a stable or a beta version of rustc, you won't be able to use\nany unstable features. In order to do so, please switch to a nightly version of\nrustc (by using rustup).\n\nIf you're using a nightly version of rustc, just add the corresponding feature\nto be able to use it:\n\n```\n#![feature(repr128)]\n\n#[repr(u128)] // ok!\nenum Foo {\n    Bar(u64),\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-32829-2.rs","byte_start":1858,"byte_end":1865,"line_start":84,"line_end":84,"column_start":9,"column_end":16,"is_primary":true,"text":[{"text":"        valid();","highlight_start":9,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_let)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0658]: statements in statics are unstable (see issue #48821)\n  --> /checkout/src/test/ui/issues/issue-32829-2.rs:84:9\n   |\nLL |         valid();\n   |   ssage":"add #![feature(const_let)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0658]: statements in constants are unstable (see issue #48821)\n  --> /checkout/src/test/ui/issues/issue-32829-2.rs:25:9\n   |\nLL |         invalid();\n   |         ^^^^^^^^^\n   |\n   = help: add #![feature(const_let)] to the crate attributes to enable\n\n"}
[01:00:57] {"message":"statements in constants are unstable (see issue #48821)","code":{"code":"E0658","explanation":"\nAn unstable feature was used.\n\nErroneous code example:\n\n```compile_fail,E658\n#[repr(u128)] // error: use of unstable library feature 'repr128'\nenum Foo {\n    Bar(u64),\n}\n```\n\nIf you're using a stable or a beta version of rustc, you won't be able to use\nany unstable features. In order to do so, please switch to a nightly version of\nrustc (by using rustup).\n\nIf you're using a nightly version of rustc, just add the corresponding feature\nto be able to use it:\n\n```\n#![feature(repr128)]\n\n#[repr(u128)] // ok!\nenum Foo {\n    Bar(u64),\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-32829-2.rs","byte_start":903,"byte_end":910,"line_start":34,"line_end":34,"column_start":9,"column_end":16,"is_primary":true,"text":[{"text":"        valid();","highlight_start":9,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_let)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0est/ui/issues/issue-40288-2.rs","byte_start":1057,"byte_end":1065,"line_start":34,"line_end":34,"column_start":5,"column_end":13,"is_primary":true,"text":[{"text":"    out.head","highlight_start":5,"highlight_end":13}],"label":"lifetime `'a` required","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add explicit lifetime `'a` to the type of `y`","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-40288-2.rs","byte_start":903,"byte_end":905,"line_start":28,"line_end":28,"column_start":58,"column_end":60,"is_primary":true,"text":[{"text":"fn lifetime_transmute_struct<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T {","highlight_start":58,"highlight_end":60}],"label":null,"suggested_replacement":"&'a T","suggestion_applicability":"Unspecified","expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0621]: explicit lifetime required in the type of `y`\n  --> /checkout/src/test/ui/issues/issue-40288-2.rs:34:5\n   |\nLL | fn lifetime_transmute_struct<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T {\n   |                                                          -- help: add explicit lifetime `'a` to the type of `y`: `&'a T`\n...\nLL |     out.head\n   |     ^^^^^^^^ lifetime `'a` required\n\n"}
[01:00:57] {"message":"explicit lifetime required in the type of `y`","code":{"code":"E0621","explanation":"\nThis error code indicates a mismatch between the lifetimes appearing in the\nfunction signature (i.e., the parameter types and the return type) and the\ndata-flow found in the function body.\n\nErroneous code example:\n\n```compile_fail,E0621\nfnin a constant
[01:00:57] -    |                ^^^^^^^^^^^^^ reserved keyword
[01:00:57] - 
[01:00:57] - error[E0516]: `typeof` is a reserved keyword but unimplemented
[01:00:57] 21    |
[01:00:57] 21    |
[01:00:57] 22 LL |     <typeof(q)>::N //~ ERROR attempt to use a non-constant value in a constant
[01:00:57] 23    |      ^^^^^^^^^ reserved keyword
[01:00:57] + 
[01:00:57] + 
[01:00:57] + error[E0516]: `typeof` is a reserved keyword but unimplemented
[01:00:57] +   --> $DIR/issue-42060.rs:13:16
[01:00:57] +    |
[01:00:57] + LL |     let other: typeof(thing) = thing; //~ ERROR attempt to use a non-constant value in a constant
[01:00:57] +    |                ^^^^^^^^^^^^^ reserved keyword
[01:00:57] 25 error: aborting due to 4 previous errors
[01:00:57] 26 
[01:00:57] 
[01:00:57] 
[01:00:57] 
[01:00:57] The actual stderr differed from the expected stderr.
[01:00:57] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-42060/issue-42060.stderr
[01:00:57] To update references, rerun the tests and pass the `--bless` flag
[01:00:57] To only update this specific test, also pass `--test-args issues/issue-42060.rs`
[01:00:57] error: 1 errors occurred comparing output.
[01:00:57] status: exit code: 1
[01:00:57] status: exit code: 1
[01:00:57] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-42060.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-42060/a" "-Crpath" "-O" "-Zunstable-             ^^^^^ non-constant value\n\n"}
[01:00:57] {"message":"attempt to use a non-constant value in a constant","code":{"code":"E0435","explanation":"\nA non-constant value was used in a constant expression.\n\nErroneous code example:\n\n```compile_fail,E0435\nlet foo = 42;\nlet a: [u8; foo]; // error: attempt to use a non-constant value in a constant\n```\n\nTo fix this error, please replace the value with a constant. Example:\n\n```\nlet a: [u8; 42]; // ok!\n```\n\nOr:\n\n```\nconst FOO: usize = 42;\nlet a: [u8; FOO]; // ok!\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-42060.rs","byte_start":707,"byte_end":708,"line_start":19,"line_end":19,"column_start":13,"column_end":14,"is_primary":true,"text":[{"text":"    <typeof(q)>::N //~ ERROR attempt to use a non-constant value in a constant","highlight_start":13,"highlight_end":14}],"label":"non-constant value","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0435]: attempt to use a non-constant value in a constant\n  --> /checkout/src/test/ui/issues/issue-42060.rs:19:13\n   |\nLL |     <typeof(q)>::N //~ ERROR attempt to use a non-constant value in a constant\n   |             ^ non-constant value\n\n"}
[01:00:57] {"message":"`typeof` is a reserved keyword but unimplemented","code":{"code":"E0516","explanation":"\nThe `typeof` keyword is currently reserved but unimplemented.\nErroneous code example:\n\n```compile_fail,E0516\nfn main() {\n    let x: typeof(92) = 92;\n}\n```\n\nTry using type inference instead. Example:\n\n```\nfn main() {\n    let x = 92;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-42060.rs","byte_start":700,"byte_end":709,"line_start":19,"line_end":19,"column_start":6,"column_end":15,"is_primary":true,"text":[{"text":"    <typeof(q)>::N //~ ERROR attempt to use a non-constant value in a constant","highlight_start":6,"highlight_end":15}],"label":"reserved keyword","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0516]: `typeof` is a reserved keyword but unimplemented\n  --> /checkout/src/test/ui/issues/issue-42060.rs:19:6\n   |\nLL |     <typeof(q)>::N //~ ERROR attempt to use a non-constant value in a constant\n   |      ^^^^^^^^^ reserved keyword\n\n"}
[01:00:57] {"message":"`typeof` is a reserved keyword but unimplemented","code":{"code":"E0516","explanation":"\nThe `typeof` keyword is currently reserved but unimplemented.\nErroneous code example:\n\n```compile_fail,E0516\nfn main() {\n    let x: typeof(92) = 92;\n}\n```\n\nTry using type inference instead. Example:\n\n```\nfn main() {\n    let x = 92;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-42060.rs","byte_start":514,"byte_end":527,"line_start":13,"line_end":13,"column_start":16,"column_end":29,"is_primary":true,"text":[{"text":"    let other: typeof(thing) = thing; //~ ERROR attempt to use a non-constant value in a constant","highlight_start":16,"highlight_end":29}],"label":"reserved keyword","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0516]: `typeof` is a reserved keyword but unimplemented\n  --> /checg) {}
[01:00:57] +    |                       ^ doesn't have a size known at compile-time
[01:00:57] 6    |
[01:00:57] -    = help: the trait `std::marker::Sized` is not implemented for `<Self as std::ops::Deref>::Target`
[01:00:57] +    = help: the trait `std::marker::Sized` is not implemented for `(dyn std::string::ToString + 'static)`
[01:00:57] 8    = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
[01:00:57] -    = help: consider adding a `where <Self as std::ops::Deref>::Target: std::marker::Sized` bound
[01:00:57] 10    = note: all function arguments must have a statically known size
[01:00:57] 12 
[01:00:57] 
[01:00:57] 
[01:00:57] - error[E0277]: the size for values of type `(dyn std::string::ToString + 'static)` cannot be known at compilation time
[01:00:57] -   --> $DIR/issue-42312.rs:18:23
[01:00:57] + error[E0277]: the size for values of type `<Self as std::ops::Deref>::Target` cannot be known at compilation time
[01:00:57] +   --> $DIR/issue-42312.rs:14:29
[01:00:57] 15    |
[01:00:57] - LL | pub fn f(_: ToString) {}
[01:00:57] -    |                       ^ doesn't have a size known at compile-time
[01:00:57] + LL |     fn baz(_: Self::Target) where Self: Deref {}
[01:00:57] +    |                             ^ doesn't have a size known at compile-time
[01:00:57] 18    |
[01:00:57] -    = help: the trait `std::marker::Sized` is not implemented for `(dyn std::string::ToString + 'static)`
[01:00:57] +    = help: the trait `std::markere 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-42312.rs","byte_start":533,"byte_end":533,"line_start":14,"line_end":14,"column_start":29,"column_end":29,"is_primary":true,"text":[{"text":"    fn baz(_: Self::Target) where Self: Deref {}","highlight_start":29,"highlight_end":29}],"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 `<Self as std::ops::Deref>::Target`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"consider adding a `where <Self as std::ops::Deref>::Target: std::marker::Sized` bound","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"all function arguments must have a statically known size","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"unsized locals are gated as an unstable feature","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the size for values of type `<Self as std::ops::Deref>::Target` cannot be known at compilation time\n  --> /checkout/src/test/ui/issues/issue-42312.rs:14:29\n   |\nLL |     fn baz(_: Self::Target) where Self: Deref {}\n35.rs:16:20\n   |\nLL |     id(Box::new(|| *v))\n   |                    ^^ cannot move out of borrowed content\n\n"}
[01:00:57] {"message":"closure may outlive the current function, but it borrows `v`, which is owned by the current function","code":{"code":"E0373","explanation":"\nThis error occurs when an attempt is made to use data captured by a closure,\nwhen that data may no longer exist. It's most commonly seen when attempting to\nreturn a closure:\n\n```compile_fail,E0373\nfn foo() -> Box<Fn(u32) -> u32> {\n    let x = 0u32;\n    Box::new(|y| x + y)\n}\n```\n\nNotice that `x` is stack-allocated by `foo()`. By default, Rust captures\nclosed-over data by reference. This means that once `foo()` returns, `x` no\nlonger exists. An attempt to access `x` within the closure would thus be\nunsafe.\n\nAnother situation where this might be encountered is when spawning threads:\n\n```compile_fail,E0373\nfn foo() {\n    let x = 0u32;\n    let y = 1u32;\n\n    let thr = std::thread::spawn(|| {\n        x + y\n    });\n}\n```\n\nSince our new thread runs in parallel, the stack frame containing `x` and `y`\nmay well have disappeared by the time we try to use them. Even if we call\n`thr.join()` within foo (which blocks until `thr` has completed, ensuring the\nstack frame won't disappear), we will not succeed: the compiler cannot prove\nthat this behaviour is safe, and so won't let us do it.\n\nThe solution to this problem is usually to switch to using a `move` closure.\nThis approach moves (or copies, where possible) data into the closure, rather\nthan taking references to it. For example:\n\n```\nfn foo() -> Box<Fn(u32) -> u32> {\n  OR cannot assign twice to immutable variable
[01:00:57] -    |     ^^^^^^^^^^^^^^^ cannot assign twice to immutable variable
[01:00:57] - 
[01:00:57] - error[E0384]: cannot assign twice to immutable variable `b`
[01:00:57] 12    |
[01:00:57] 12    |
[01:00:57] 13 LL |     let b = Box::new(1);    //[ast]~ NOTE first assignment
[01:00:57] 23    |              - first assignment to `b`
[01:00:57] 24 ...
[01:00:57] 24 ...
[01:00:57] 25 LL |     b = Box::new(2);            //[ast]~ ERROR cannot assign twice to immutable variable
[01:00:57] +    |     ^^^^^^^^^^^^^^^ cannot assign twice to immutable variable
[01:00:57] + 
[01:00:57] + error[E0384]: cannot assign twice to immutable variable `b`
[01:00:57] +   --> $DIR/issue-45199.rs:20:5
[01:00:57] +    |
[01:00:57] + LL |     b = Box::new(1);    //[ast]~ NOTE first assignment
[01:00:57] +    |     --------------- first assignment to `b`
[01:00:57] + LL |                         //[mir]~^ NOTE first assignment
[01:00:57] + LL |     b = Box::new(2);    //[ast]~ ERROR cannot assign twice to immutable variable
[01:00:57] 26    |     ^^^^^^^^^^^^^^^ cannot assign twice to immutable variable
[01:00:57] 28 error: aborting due to 3 previous errors
[01:00:57] 
[01:00:57] 
[01:00:57] The actual stderr differed from the expected stderr.
[01:00:57] The actual stderr differed from the expected stderr.
[01:00:57] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-45199.ast/issue-45199.ast.stderr
[01:00:57] To update references, rerun the tests and pass the `--bless` flag
[01:00:57] To only update this specific test, also pass `--test-args issues/issue-45199.r = Box::new(2);        //[ast]~ ERROR cannot assign twice to immutable variable","highlight_start":5,"highlight_end":20}],"label":"cannot assign twice to immutable variable","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-45199.rs","byte_start":1101,"byte_end":1102,"line_start":27,"line_end":27,"column_start":9,"column_end":10,"is_primary":false,"text":[{"text":"    let b = Box::new(1);    //[ast]~ NOTE first assignment","highlight_start":9,"highlight_end":10}],"label":"first assignment to `b`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0384]: cannot assign twice to immutable variable `b`\n  --> /checkout/src/test/ui/issues/issue-45199.rs:31:5\n   |\nLL |     let b = Box::new(1);    //[ast]~ NOTE first assignment\n   |         - first assignment to `b`\n...\nLL |     b = Box::new(2);        //[ast]~ ERROR cannot assign twice to immutable variable\n   |     ^^^^^^^^^^^^^^^ cannot assign twice to immutable variable\n\n"}
[01:00:57] {"message":"cannot assign twice to immutable variable `b`","code":{"code":"E0384","explanation":"\nThis error occurs when an attempt is made to reassign an immutable variable.\nFor example:\n\n```compile_fail,E0384\nfn main() {\n    let x = 3;\n    x = 5; // error, reassignment of immutable variable\n}\n```\n\nBy default, variables in Rust are immutable. To fix this error, add the keyword\n`mut` after the keyword `let` when declaring the variable. For example:\n\n```\nfn main() {\n    let mut x = 3;\n    x = 5;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-45199.rs","byte_start":1862,"byte_end":1877,"line_start":40,"line_end":40,"column_start":5,"column_end":20,"is_primary":true,"text":[{"text":"    b = Box::new(2);            //[ast]~ ERROR cannot assign twice to immutable variable","highlight_start":5,"highlight_end":20}],"label":"cannot assign twice to immutable variable","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-45199.rs","byte_start":1679,"byte_end":1680,"line_start":37,"line_end":37,"column_start":14,"column_end":15,"is_primary":false,"text":[{"text":"fn test_args(b: Box<i32>) {  //[ast]~ NOTE first assignment","highlight_start":14,"highlight_end":15}],"label":"first assignment to `b`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0384]: cannot assign twice to immutable variable `b`\n  --> /checkout/src/test/ui/issues/issue-45199.rs:40:5\n   |\nLL | fn test_args(b: Box<i32>) {  //[ast]~ NOTE first assignment\n   |              - first assignment to `b`\n...\nLL |     b = Box::new(2);            //[ast]~ ERROR cannot assign twice to immutable variable\n   |     ^^^^^^^^^^^^^^^ cannot assign twice to immutable variable\n\n"}
[01:00:57] {"message":"cannot assign twice to immutable variable `b`","code":{"code":"E0384","explanation":"\nThis error occurs when an attempt is made to reassign an immutable variable.\nFor example:\n\n```compile_fail,E0384\nfn main() {\n    let x = 3;\n    x = 5; // error, reassignment of immutable variable\n}\n```\n\nBy default, variables in Rust are imm:"error: aborting due to 3 previous errors\n\n"}
[01:00:57] {"message":"For more information about this error, try `rustc --explain E0384`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0384`.\n"}
[01:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] thread '[ui] ui/issues/issue-45199.rs#ast' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[01:00:57] 
[01:00:57] 
[01:00:57] ---- [ui] ui/issues/issue-45199.rs#mir stdout ----
[01:00:57] diff of stderr:
[01:00:57] 
[01:00:57] - error[E0384]: cannot assign twice to immutable variable `b`
[01:00:57] -   --> $DIR/issue-45199.rs:20:5
[01:00:57] + error[E0384]: cannot assign to immutable argument `b`
[01:00:57] +   --> $DIR/issue-45199.rs:40:5
[01:00:57] 3    |
[01:00:57] - LL |     let b: Box<isize>;
[01:00:57] -    |         - help: make this binding mutable: `mut b`
[01:00:57] + LL | fn test_args(b: Box<i32>) {  //[ast]~ NOTE first assignment
[01:00:57] +    |              - help: make this binding mutable: `mut b`
[01:00:57] 6 ...
[01:00:57] - LL |     b = Box::new(1);    //[ast]~ NOTE first assignment
[01:00:57] -    |     - first assignment to `b`
[01:00:57] - LL |                         //[mir]~^ NOTE first assignment
[01:00:57] - LL |     b = Box::new(2);    //[ast]~ ERROR cannot assign twice to immutable variable
[01:00:57] -    |     ^ cannot assign twice to immutable variable
[01:00:57] + LL |     b = Box::new(2);            //[ast]~ ERROR cannot assign twice to immutable variable
[01:00:57] +    |     ^ cannot assign to imcolumn_start":5,"column_end":6,"is_primary":true,"text":[{"text":"    b = Box::new(2);    //[ast]~ ERROR cannot assign twice to immutable variable","highlight_start":5,"highlight_end":6}],"label":"cannot assign twice to immutable variable","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"make this binding mutable","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-45199.rs","byte_start":560,"byte_end":561,"line_start":15,"line_end":15,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":"    let b: Box<isize>;","highlight_start":9,"highlight_end":10}],"label":null,"suggested_replacement":"mut b","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0384]: cannot assign twice to immutable variable `b`\n  --> /checkout/src/test/ui/issues/issue-45199.rs:20:5\n   |\nLL |     let b: Box<isize>;\n   |         - help: make this binding mutable: `mut b`\n...\nLL |     b = Box::new(1);    //[ast]~ NOTE first assignment\n   |     - first assignment to `b`\nLL |                         //[mir]~^ NOTE first assignment\nLL |     b = Box::new(2);    //[ast]~ ERROR cannot assign twice to immutable variable\n   |     ^ cannot assign twice to immutable variable\n\n"}
[01:00:57] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[01:00:57] {"message":"For more information about this error, try `rustc --explain E0384`.","code":null,"level":"","spans":[],"children":[],"rendep of\n`s` would be a violation of the principle that `&mut`-borrows have\nexclusive, unaliased access to their referenced data.\n\nThis error can be fixed by changing `demo` so that the destructor does\nnot run while the string-data is borrowed; for example by taking `S`\nby reference:\n\n```\n#![feature(nll)]\n\npub struct S<'a> { data: &'a mut String }\n\nimpl<'a> Drop for S<'a> {\n    fn drop(&mut self) { self.data.push_str(\"being dropped\"); }\n}\n\nfn demo<'a>(s: &'a mut S<'a>) -> &'a mut String { let p = &mut *(*s).data; p }\n```\n\nNote that this approach needs a reference to S with lifetime `'a`.\nNothing shorter than `'a` will suffice: a shorter lifetime would imply\nthat after `demo` finishes executing, something else (such as the\ndestructor!) could access `s.data` after the end of that shorter\nlifetime, which would again violate the `&mut`-borrow's exclusive\naccess.\n"},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs","byte_start":3710,"byte_end":3711,"line_start":86,"line_end":86,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"}","highlight_start":1,"highlight_end":2}],"label":"here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs","byte_start":3393,"byte_end":3395,"line_start":82,"line_end":82,"column_start":26,"column_end":28,"is_primary":false,"text":[{"text":"fn boxed_boxed_scribbled<'a>(s: Box<Box<Scribble<'pl<'a> Drop for S<'a> {\n    fn drop(&mut self) { self.data.push_str(\"being dropped\"); }\n}\n\nfn demo<'a>(s: &'a mut S<'a>) -> &'a mut String { let p = &mut *(*s).data; p }\n```\n\nNote that this approach needs a reference to S with lifetime `'a`.\nNothing shorter than `'a` will suffice: a shorter lifetime would imply\nthat after `demo` finishes executing, something else (such as the\ndestructor!) could access `s.data` after the end of that shorter\nlifetime, which would again violate the `&mut`-borrow's exclusive\naccess.\n"},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs","byte_start":2730,"byte_end":2731,"line_start":66,"line_end":66,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"}","highlight_start":1,"highlight_end":2}],"label":"here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs","byte_start":2427,"byte_end":2429,"line_start":62,"line_end":62,"column_start":14,"column_end":16,"is_primary":false,"text":[{"text":"fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 {","highlight_start":14,"highlight_end":16}],"label":"lifetime `'a` defined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs","byte_start":2469,"byte_end":2478,"line_start":63,"line_end":63,"column_start":5,"column_end":14,"is_primary":true,"teop` trait.\n\nExample of erroneous code:\n\n```compile_fail,E0713\n#![feature(nll)]\n\npub struct S<'a> { data: &'a mut String }\n\nimpl<'a> Drop for S<'a> {\n    fn drop(&mut self) { self.data.push_str(\"being dropped\"); }\n}\n\nfn demo<'a>(s: S<'a>) -> &'a mut String { let p = &mut *s.data; p }\n```\n\nHere, `demo` tries to borrow the string data held within its\nargument `s` and then return that borrow. However, `S` is\ndeclared as implementing `Drop`.\n\nStructs implementing the `Drop` trait have an implicit destructor that\ngets called when they go out of scope. This destructor gets exclusive\naccess to the fields of the struct when it runs.\n\nThis means that when `s` reaches the end of `demo`, its destructor\ngets exclusive access to its `&mut`-borrowed string data.  allowing\nanother borrow of that string data (`p`), to exist across the drop of\n`s` would be a violation of the principle that `&mut`-borrows have\nexclusive, unaliased access to their referenced data.\n\nThis error can be fixed by changing `demo` so that the destructor does\nnot run while the string-data is borrowed; for example by taking `S`\nby reference:\n\n```\n#![feature(nll)]\n\npub struct S<'a> { data: &'a mut String }\n\nimpl<'a> Drop for S<'a> {\n    fn drop(&mut self) { self.data.push_str(\"being dropped\"); }\n}\n\nfn demo<'a>(s: &'a mut S<'a>) -> &'a mut String { let p = &mut *(*s).data; p }\n```\n\nNote that this approach needs a reference to S with lifetime `'a`.\nNothing shorter than `'a` will suffice: a shorter lifetime would imply\nthat after `demo` finishes executing, something else (such as the\ndestructor!) could access `s.data` after the end of that shorter\nlifetime, which would again violate the `&mut`-borrow's exclusive\naccess.\n"},"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs","byte_start":3214,"byte_end":3215,"line_start":76,"line_end":76,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"}","highlight_start":1,"highlight_end":2}],"label":"here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs","byte_start":2903,"byte_end":2905,"line_start":72,"line_end":72,"column_start":20,"column_end":22,"is_primary":false,"text":[{"text":"fn boxed_scribbled<'a>(s: Box<Scribble<'a>>) -> &'a mut u32 {","highlight_start":20,"highlight_end":22}],"label":"lifetime `'a` defined here","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs","byte_start":2950,"byte_end":2962,"line_start":73,"line_end":73,"column_start":5,"column_end":17,"is_primary":true,"text":[{"text":"    &mut *(*s).0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]","highlight_start":5,"highlight_end":17}],"label":"returning this value requires that `*s.0` is borrowed for `'a`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"This error has been downgraded to a warning for backwards compatibility with previous releases.\nI    let mut long_lived = Scribble(&mut x);","highlight_start":1,"highlight_end":47},{"text":"        *borrowed_scribble(&mut long_lived) += 10;","highlight_start":1,"highlight_end":51},{"text":"        // (Scribble dtor runs here, after `&mut`-borrow above ends)","highlight_start":1,"highlight_end":69},{"text":"    }","highlight_start":1,"highlight_end":6},{"text":"    {","highlight_start":1,"highlight_end":6},{"text":"        let mut long_lived = Scribble(&mut x);","highlight_start":1,"highlight_end":47},{"text":"        *boxed_borrowed_scribble(Box::new(&mut long_lived)) += 10;","highlight_start":1,"highlight_end":67},{"text":"        // (Scribble dtor runs here, after `&mut`-borrow above ends)","highlight_start":1,"highlight_end":69},{"text":"    }","highlight_start":1,"highlight_end":6},{"text":"    {","highlight_start":1,"highlight_end":6},{"text":"        let mut long_lived = Scribble(&mut x);","highlight_start":1,"highlight_end":47},{"text":"        *boxed_boxed_borrowed_scribble(Box::new(Box::new(&mut long_lived))) += 10;","highlight_start":1,"highlight_end":83},{"text":"        // (Scribble dtor runs here, after `&mut`-borrow above ends)","highlight_start":1,"highlight_end":69},{"text":"    }","highlight_start":1,"highlight_end":6},{"text":"    *scribbled(Scribble(&mut x)) += 10;","highlight_start":1,"highlight_end":40},{"text":"    *boxed_scribbled(Box::new(Scribble(&mut x))) += 10;","highlight_start":1,"highlight_end":56},{"text":"    *boxed_boxed_scribbled(Box::new(Box::new(Scribble(&mut x)))) += 10;","highlight_start":1,"highlight_end":72},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggeste] diff of stderr:
[01:00:57] 
[01:00:57] - error[E0017]: references in statics may only refer to immutable values
[01:00:57] -    |
[01:00:57] -    |
[01:00:57] - LL | static buf: &mut [u8] = &mut [1u8,2,3,4,5,7];   //[ast]~ ERROR E0017
[01:00:57] -    |                         ^^^^^^^^^^^^^^^^^^^^ statics require immutable values
[01:00:57] - 
[01:00:57] 7 error[E0594]: cannot assign to `buf[..]`, as `buf` is an immutable static item
[01:00:57] 9    |
[01:00:57] 
[01:00:57] 
[01:00:57] 10 LL |     buf[0]=2;                                   //[ast]~ ERROR E0389
[01:00:57] + 
[01:00:57] + 
[01:00:57] + error[E0017]: references in statics may only refer to immutable values
[01:00:57] +   --> $DIR/issue-46604.rs:14:25
[01:00:57] +    |
[01:00:57] + LL | static buf: &mut [u8] = &mut [1u8,2,3,4,5,7];   //[ast]~ ERROR E0017
[01:00:57] +    |                         ^^^^^^^^^^^^^^^^^^^^ statics require immutable values
[01:00:57] 13 error: aborting due to 2 previous errors
[01:00:57] 14 
[01:00:57] 
[01:00:57] 
[01:00:57] 
[01:00:57] The actual stderr differed from the expected stderr.
[01:00:57] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-46604.mir/issue-46604.mir.stderr
[01:00:57] To update references, rerun the tests and pass the `--bless` flag
[01:00:57] To only update this specific test, also pass `--test-args issues/issue-46604.rs`
[01:00:57] 
[01:00:57] error in revision `mir`: 1 errors occurred comparing output.
[01:00:57] status: exit code: 1
[01:00:57] c:"E0593","explanation":"\nYou tried to supply an `Fn`-based type with an incorrect number of arguments\nthan what was expected.\n\nErroneous code example:\n\n```compile_fail,E0593\nfn foo<F: Fn()>(x: F) { }\n\nfn main() {\n    // [E0593] closure takes 1 argument but 0 arguments are required\n    foo(|y| { });\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-47706.rs","byte_start":848,"byte_end":851,"line_start":37,"line_end":37,"column_start":5,"column_end":8,"is_primary":true,"text":[{"text":"    foo(Qux::Bar);","highlight_start":5,"highlight_end":8}],"label":"expected function that takes 0 arguments","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-47706.rs","byte_start":779,"byte_end":787,"line_start":27,"line_end":27,"column_start":5,"column_end":13,"is_primary":false,"text":[{"text":"    Bar(i32),","highlight_start":5,"highlight_end":13}],"label":"takes 1 argument","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"required by `foo`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-47706.rs","byte_start":792,"byte_end":830,"line_start":30,"line_end":34,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn foo<F>(f: F)","highlight_start":1,"highlight_end":16},{"text":"where","highlight_start":1,"highlight_end":6},{"text":"    F: Fn(),","highlight_start":1,"highlight_end":13},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_repla:00:57] 9    |
[01:00:57] 10 LL |     [(); return || {}];
[01:00:57] 21    |
[01:00:57] 21    |
[01:00:57] 22 LL |     [(); return while let Some(n) = Some(0) {}];
[01:00:57] + 
[01:00:57] + 
[01:00:57] + error[E0572]: return statement outside of function body
[01:00:57] +   --> $DIR/issue-51714.rs:12:14
[01:00:57] +    |
[01:00:57] + LL |     |_:  [_; return || {}] | {};
[01:00:57] 24 
[01:00:57] 25 error[E0165]: irrefutable while-let pattern
[01:00:57] 26   --> $DIR/issue-51714.rs:21:27
[01:00:57] 
[01:00:57] 
[01:00:57] 
[01:00:57] The actual stderr differed from the expected stderr.
[01:00:57] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-51714/issue-51714.stderr
[01:00:57] To update references, rerun the tests and pass the `--bless` flag
[01:00:57] To only update this specific test, also pass `--test-args issues/issue-51714.rs`
[01:00:57] error: 1 errors occurred comparing output.
[01:00:57] status: exit code: 1
[01:00:57] status: exit code: 1
[01:00:57] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-51714.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-51714/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-51714/auxiliary" "-A" "unused"
[01:00:57] stdout:
[01:00:57] ------e return keyword or move the expression into a\nfunction. Example:\n\n```\nconst FOO: u32 = 0;\n\nfn some_fn() -> u32 {\n    return FOO;\n}\n\nfn main() {\n    some_fn();\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-51714.rs","byte_start":661,"byte_end":676,"line_start":18,"line_end":18,"column_start":10,"column_end":25,"is_primary":true,"text":[{"text":"    [(); return |ice| {}];","highlight_start":10,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0572]: return statement outside of function body\n  --> /checkout/src/test/ui/issues/issue-51714.rs:18:10\n   |\nLL |     [(); return |ice| {}];\n   |          ^^^^^^^^^^^^^^^\n\n"}
[01:00:57] {"message":"return statement outside of function body","code":{"code":"E0572","explanation":"\nA return statement was found outside of a function body.\n\nErroneous code example:\n\n```compile_fail,E0572\nconst FOO: u32 = return 0; // error: return statement outside of function body\n\nfn main() {}\n```\n\nTo fix this issue, just remove the return keyword or move the expression into a\nfunction. Example:\n\n```\nconst FOO: u32 = 0;\n\nfn some_fn() -> u32 {\n    return FOO;\n}\n\nfn main() {\n    some_fn();\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-51714.rs","byte_start":746,"byte_end":783,"line_start":21,"line_end":21,"column_start":10,"column_end":47,"is_primary":true,"text":[{"text":"    [(); return while let Some(n) = Some(0) {}];","highlight_start":10,"highlight_end":47}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0572]: return statement outside of function body\n  --> /checkout/src/test/ui/issues/issue-51714.rs:21:10\n   |\nLL |     [(); return while let Some(n) = Some(0) {}];\n   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[01:00:57] {"message":"return statement outside of function body","code":{"code":"E0572","explanation":"\nA return statement was found outside of a function body.\n\nErroneous code example:\n\n```compile_fail,E0572\nconst FOO: u32 = return 0; // error: return statement outside of function body\n\nfn main() {}\n```\n\nTo fix this issue, just remove the return keyword or move the expression into a\nfunction. Example:\n\n```\nconst FOO: u32 = 0;\n\nfn some_fn() -> u32 {\n    return FOO;\n}\n\nfn main() {\n    some_fn();\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-51714.rs","byte_start":492,"byte_end":504,"line_start":12,"line_end":12,"column_start":14,"column_end":26,"is_primary":true,"text":[{"text":"    |_:  [_; return || {}] | {};","highlight_start":14,"highlight_end":26}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0572]: return statement outside of function body\n  --> /checkout/src/test/ui/issues/issue-51714.rs:12:14\n   |\nLL |     |_:  [_; return || {}] | {};\n   |              ^^^^^^^^^^^^\n\n"}
[01:00:57] {"message":"irrefutable while-let pattern","code":{"code":"E0165","explanation":"\nA while-let pattern attempts to match the pattern, and enters the body if the\nmatch was successfubout an error, try `rustc --explain E0165`.\n"}
[01:00:57] ------------------------------------------
[01:00:57] 
[01:00:57] thread '[ui] ui/issues/issue-51714.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3252:9
[01:00:57] 
[01:00:57] 
[01:00:57] ---- [ui] ui/issues/issue-54302-cases.rs stdout ----
[01:00:57] diff of stderr:

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 has been minimized.

Copy link
Contributor

bors commented Dec 13, 2018

💔 Test failed - status-travis

@rust-highfive

This comment was marked as outdated.

Copy link
Collaborator

rust-highfive commented Dec 13, 2018

The job dist-x86_64-linux 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_fold:end:services

travis_fold:start:git.checkout
travis_time:start:01ffb2fa
$ git clone --depth=2 --branch=try https://github.com/rust-lang/rust.git rust-lang/rust
---
[01:28:11] 
[01:28:11]  Documenting rustc_passes v0.0.0 (/checkout/src/librustc_passes)
[01:28:13]  Documenting rustc_borrowck v0.0.0 (/checkout/src/librustc_borrowck)
[01:28:14]     Checking rustc_save_analysis v0.0.0 (/checkout/src/librustc_save_analysis)
[01:28:14] error[E0275]: overflow evaluating the requirement `std::boxed::Box<std::vec::Vec<syntax::ast::Attribute>>: std::marker::Sync`
[01:28:14]   |
[01:28:14]   = help: consider adding a `#![recursion_limit="128"]` attribute to your crate
[01:28:14]   = note: required because it appears within the type `std::option::Option<std::boxed::Box<std::vec::Vec<syntax::ast::Attribute>>>`
[01:28:14]   = note: required because it appears within the type `syntax::ThinVec<syntax::ast::Attribute>`
[01:28:14]   = note: required because it appears within the type `syntax::ast::FieldPat`
[01:28:14]   = note: required because it appears within the type `syntax::source_map::Spanned<syntax::ast::FieldPat>`
[01:28:14]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::source_map::Spanned<syntax::ast::FieldPat>>`
[01:28:14]   = note: required because it appears within the type `alloc::raw_vec::RawVec<syntax::source_map::Spanned<syntax::ast::FieldPat>>`
[01:28:14]   = note: required because it appears within the type `std::vec::Vec<syntax::source_map::Spanned<syntax::ast::FieldPat>>`
[01:28:14]   = note: required because it appears within the type `syntax::ast::PatKind`
[01:28:14]   = note: required because it appears within the type `syntax::ast::Pat`
[01:28:14]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::Pat>`
[01:28:14]   = note: required because it appears within the type `std::boxed::Box<syntax::ast::Pat>`
[01:28:14]   = note: required because it appears within the type `syntax::ptr::P<syntax::ast::Pat>`
[01:28:14]   = note: required because it appears within the type `syntax::ast::Local`
[01:28:14]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::Local>`
[01:28:14]   = note: required because it appears within the type `std::boxed::Box<syntax::ast::Local>`
[01:28:14]   = note: required because it appears within the type `syntax::ptr::P<syntax::ast::Local>`
[01:28:14]   = note: required because it appears within the type `syntax::ast::StmtKind`
[01:28:14]   = note: required because it appears within the type `syntax::ast::Stmt`
[01:28:14]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::Stmt>`
[01:28:14]   = note: required because it appears within the type `alloc::raw_vec::RawVec<syntax::ast::Stmt>`
[01:28:14]   = note: required because it appears within the type `std::vec::Vec<syntax::ast::Stmt>`
[01:28:14]   = note: required because it appears within the type `syntax::ast::Block`
[01:28:14]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::Block>`
[01:28:14]   = note: required because it appears within the type `std::boxed::Box<syntax::ast::Block>`
[01:28:14]   = note: required because it appears within the type `syntax::ptr::P<syntax::ast::Block>`
[01:28:14]   = note: required because it appears within the type `syntax::ast::ExprKind`
[01:28:14]   = note: required because it appears within the type `syntax::ast::Expr`
[01:28:14]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::Expr>`
[01:28:14]   = note: required because it appears within the type `std::boxed::Box<syntax::ast::Expr>`
[01:28:14]   = note: required because it appears within the type `syntax::ptr::P<syntax::ast::Expr>`
[01:28:14]   = note: required because it appears within the type `syntax::ast::AnonConst`
[01:28:14]   = note: required because it appears within the type `syntax::ast::TyKind`
[01:28:14]   = note: required because it appears within the type `syntax::ast::Ty`
[01:28:14]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::Ty>`
[01:28:14]   = note: required because it appears within the type `std::boxed::Box<syntax::ast::Ty>`
[01:28:14]   = note: required because it appears within the type `syntax::ptr::P<syntax::ast::Ty>`
[01:28:14]   = note: required because it appears within the type `syntax::ast::GenericArg`
[01:28:14]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::GenericArg>`
[01:28:14]   = note: required because it appears within the type `alloc::raw_vec::RawVec<syntax::ast::GenericArg>`
[01:28:14]   = note: required because it appears within the type `std::vec::Vec<syntax::ast::GenericArg>`
[01:28:14]   = note: required because it appears within the type `syntax::ast::AngleBracketedArgs`
[01:28:14]   = note: required because it appears within the type `syntax::ast::GenericArgs`
[01:28:14]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::GenericArgs>`
[01:28:14]   = note: required because it appears within the type `std::boxed::Box<syntax::ast::GenericArgs>`
[01:28:14]   = note: required because it appears within the type `syntax::ptr::P<syntax::ast::GenericArgs>`
[01:28:14]   = note: required because it appears within the type `std::option::Option<syntax::ptr::P<syntax::ast::GenericArgs>>`
[01:28:14]   = note: required because it appears within the type `syntax::ast::PathSegment`
[01:28:14]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<syntax::ast::PathSegment>`
[01:28:14]   = note: required because it appears within the type `alloc::raw_vec::RawVec<syntax::ast::PathSegment>`
[01:28:14]   = note: required because it appears within the type `std::vec::Vec<syntax::ast::PathSegment>`
[01:28:14]   = note: required because it appears within the type `syntax::ast::Path`
[01:28:14]   = note: required because it appears within the type `syntax::ast::Attribute`
[01:28:14]   = note: required because it appears within the type `[syntax::ast::Attribute]`
[01:28:14]   = note: required because of the requirements on the impl of `std::marker::Sync` for `std::ptr::Unique<[syntax::ast::Attribute]>`
[01:28:14]   = note: required because it appears within the type `std::boxed::Box<[syntax::ast::Attribute]>`
[01:28:14]   = note: required because it appears within the type `syntax::ptr::P<[syntax::ast::Attribute]>`
[01:28:14]   = note: required because it appears within the type `rustc::hir::Crate`
[01:28:14]   = note: required because it appears within the type `rustc::hir::map::Forest`
[01:28:14]   = note: required because it appears within the type `&'tcx rustc::hir::map::Forest`
[01:28:14]   = note: required because it appears within the type `rustc::hir::map::Map<'tcx>`
[01:28:14]   = note: required because it appears within the type `rustc::ty::context::GlobalCtxt<'tcx>`
[01:28:14]   = note: required because of the requirements on the impl of `std::marker::Send` for `&'a rustc::ty::context::GlobalCtxt<'tcx>`
[01:28:14]   = note: required because it appears within the type `rustc::ty::TyCtxt<'a, 'tcx, 'tcx>`
[01:28:14]   = note: required because it appears within the type `rvalue_promotion::CheckCrateVisitor<'a, 'tcx>`
[01:28:14] error: Could not document `rustc_passes`.
[01:28:14] 
[01:28:14] Caused by:
[01:28:14] Caused by:
[01:28:14]   process didn't exit successfully: `/checkout/obj/build/bootstrap/debug/rustdoc --crate-name rustc_passes src/librustc_passes/lib.rs --color always --target x86_64-unknown-linux-gnu -o /checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/doc -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps --extern log=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-ed63fd56fdbcbbe5.rmeta --extern rustc=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc-76d63ba10f00ac07.rmeta --extern rustc_data_structures=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-1695096f7fd7e5f4.rmeta --extern rustc_errors=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-fb8e2149b42fa290.rmeta --extern rustc_mir=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_mir-70c54d99947a5d4d.rmeta --extern syntax=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax-ec65f188dcafee87.rmeta --extern syntax_pos=/checkout/obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-2fe1af80a43a0355.rmeta --document-private-items` (exit code: 1)
[01:28:19] warning: `[]` cannot be resolved, ignoring it...
[01:28:19]     --> src/librustc_mir/hair/pattern/_match.rs:1289:49
[01:28:19]      |
[01:28:19] 1289 | /// For instance, a tuple pattern (_, 42, Some([])) has the arity of 3.
---
[01:28:20] 
[01:28:20] error: build failed
[01:28:20] 
[01:28:20] 
[01:28:20] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "doc" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "jemalloc" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--no-deps" "-p" "rustc" "-p" "rustc_target" "-p" "syntax_ext" "-p" "rustc_platform_intrinsics" "-p" "rustc_data_structures" "-p" "rustc_driver" "-p" "syntax" "-p" "rustc_metadata" "-p" "rustc_allocator" "-p" "rustc_llvm" "-p" "rustc_privacy" "-p" "rustc_errors" "-p" "rustc_codegen_llvm" "-p" "rustc_apfloat" "-p" "rustc_passes" "-p" "rustc_typeck" "-p" "rustc_codegen_ssa" "-p" "arena" "-p" "rustc_fs_util" "-p" "rustc_incremental" "-p" "rustc_resolve" "-p" "rustc_traits" "-p" "rustc_save_analysis" "-p" "fmt_macros" "-p" "rustc_lint" "-p" "rustc_plugin" "-p" "rustc_borrowck" "-p" "syntax_pos" "-p" "serialize" "-p" "build_helper" "-p" "graphviz" "-p" "rustc_codegen_utils" "-p" "rustc_mir"
[01:28:20] 
[01:28:20] 
[01:28:20] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap dist --host x86_64-unknown-linux-gnu --target x86_64-unknown-linux-gnu
[01:28:20] Build completed unsuccessfully in 1:21:24
---
travis_time:end:0267d5d2:start=1544732969702375083,finish=1544732969715113064,duration=12737981
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:0068ffe1
$ 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:08088520
travis_time:start:08088520
$ 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:1a57f994
$ 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)

@Zoxc

This comment has been minimized.

Copy link
Contributor

Zoxc commented Dec 13, 2018

@bors try

@Zoxc

This comment has been minimized.

Copy link
Contributor

Zoxc commented Dec 23, 2018

@bors try

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 23, 2018

⌛️ Trying commit 9ff6e14 with merge f471219...

bors added a commit that referenced this pull request Dec 23, 2018

Auto merge of #56765 - Zoxc:pq-test, r=<try>
[do not merge] Test parallel queries

Let's see if I have more luck

r? @michaelwoerister
@rust-highfive

This comment has been minimized.

Copy link
Collaborator

rust-highfive commented Dec 23, 2018

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:11f388fe:start=1545559513229234884,finish=1545559515397789051,duration=2168554167
$ 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
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[00:00:39] Successfully built cdc5aa7f2956
[00:00:39] Successfully tagged rust-ci:latest
[00:00:39] Built container sha256:cdc5aa7f2956d3087243778f8146464eb02368034cd1536fc5e0f38a020e877f
[00:00:39] Uploading finished image to s3://rust-lang-ci-sccache2/docker/edb4b0c182cd03fb6cb15ee5994e47ebf5e2bcbda67b08b896aeaed85b4803bd22dc752096b5ed6913438390dc397259347c24173ab37bafa134d42f055fc78d
[00:01:23] upload failed: - to s3://rust-lang-ci-sccache2/docker/edb4b0c182cd03fb6cb15ee5994e47ebf5e2bcbda67b08b896aeaed85b4803bd22dc752096b5ed6913438390dc397259347c24173ab37bafa134d42f055fc78d Unable to locate credentials

[00:01:24] travis_time:end:16d611c0:start=1545559534237869186,finish=1545559607362169901,duration=73124300715
[CI_JOB_NAME=x86_64-gnu-llvm-6.0]
[00:01:24] [CI_JOB_NAME=x86_64-gnu-llvm-6.0]
---
travis_time:start:test_ui
Check compiletest suite=ui mode=ui (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:55:23] 
[00:55:23] running 5194 tests
[00:55:26] ............................F..................................................F.....F...F.........F 100/5194
[00:55:29] .............................................................................FF..............FF.F..F 200/5194
[00:55:32] ........FFFFFFF.........FF.F.FF...F..FFF..FFF.....F..F..F................FF...FFF...............FF.. 300/5194
[00:55:35] .F....FF....F.....FFF...F..F........F...........F..F....FF.....F................F.....F...F......... 400/5194
[00:55:39] ..................FFF.......FFF.F....F.....FF.....FF..................F.................F.......F... 500/5194
[00:55:42] ............FF................i........FF...F...F................................................... 600/5194
[00:55:46] ..................................F.......F.........................................F............... 700/5194
[00:55:52] ...................................F............F...............F....F.....F...FFF...FFF..........FF 800/5194
[00:55:57] ........i...............i.......................F...F.........................FFFF.................. 900/5194
[00:56:00] .F..F...........F..F.............iiiii.............F...........................F.................... 1000/5194
[00:56:04] .....................................................F.............................................. 1100/5194
[00:56:06] ..............................................................F................F.................... 1200/5194
[00:56:09] .................................................................................................... 1300/5194
[00:56:12] ......................F............................................................................. 1400/5194
[00:56:14] ............F....................................................................................... 1500/5194
[00:56:17] .................................i.........................F.F...............................F...... 1600/5194
[00:56:21] F.i............................................FF................................................... 1700/5194
[00:56:24] ......................................................F............................................. 1800/5194
[00:56:28] .....................F.....................................................................F........ 1900/5194
[00:56:31] .............................................i...........................F.F....F....F.............. 2000/5194
[00:56:35] .....................F.............................................................................. 2100/5194
[00:56:39] ...........................F........................................................................ 2200/5194
[00:56:43] F...................................................................................F............... 2300/5194
[00:56:48] .................................................................................................... 2400/5194
[00:56:51] .....F.............................................................................................. 2500/5194
[00:56:55] .......................................F.................................F.......................... 2600/5194
[00:57:00] ........................FF............F................................F.....................F...... 2700/5194
[00:57:04] ...........................................................F.............................F.......... 2800/5194
[00:57:07] FF..............................................................................F.F..F.............. 2900/5194
[00:57:11] .......................................F......................................................F..... 3000/5194
[00:57:14] .F......F........F.F...........................................................................i.... 3100/5194
[00:57:17] ........................................................................................F..........F 3200/5194
[00:57:21] ............F............F.F.......F......................ii..i..ii.................FF.............. 3300/5194
[00:57:25] .F........F..............FFFFF...................F..F...........F.....F..............F....F...F..... 3400/5194
[00:57:29] ...........F...F....FFF.........F..F....FF..........F.....FFFF..FF.F..F.F.F.F..FFFF..F.......FF...FF 3500/5194
[00:57:32] F.....FFF.F.F...............................ii.....................F.....F.......................... 3600/5194
[00:57:35] .................................................................................................... 3800/5194
[00:57:37] ..................i................................................................................. 3900/5194
[00:57:37] ..................i................................................................................. 3900/5194
[00:57:40] ...........................................F...F.................................................... 4000/5194
[00:57:50] ...F.......F.......................................F..........F................................F.... 4100/5194
[00:57:53] ..FFF.....F.F..FF....F................F....F.....F.F......F..FF......F.F.........FF................F 4200/5194
[00:57:57] ......F..F..F...........F..F.........F....F..F...............F...................................... 4300/5194
[00:58:01] .......F....................F.........................F..i.......................................... 4400/5194
[00:58:07] ..................................................................F................................. 4500/5194
[00:58:10] .................................................FF.F..F.....F.......F.................F.F....F..... 4600/5194
[00:58:13] F......F............F..F..................F............F...........F...............................F 4700/5194
[00:58:18] .F.....F...F....F..F....................................F.....................................F..... 4800/5194
[00:58:22] .....................FF.......F...........F.........F..............................................F 4900/5194
[00:58:25] .....................FF................F........F.....F............................F................ 5000/5194
[00:58:28] ...........F...F.......F.............................F..F..F...................................F.F.. 5100/5194
[00:58:30] FFFFFFF...............F..........i........................FF.........................F........
[00:58:30] 
[00:58:30] ---- [ui] ui/allocator/not-an-allocator.rs stdout ----
[00:58:30] diff of stderr:
[00:58:30] 
[00:58:30] 
[00:58:30] 4 LL | static A: usize = 0;
[00:58:30] 5    | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`
[00:58:30] -    = note: required by `std::alloc::GlobalAlloc::alloc`
[00:58:30] +    = note: required by `std::alloc::GlobalAlloc::alloc_zeroed`
[00:58:30] 8 
[00:58:30] 9 error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
[00:58:30] 9 error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied
[00:58:30] 10   --> $DIR/not-an-allocator.rs:12:1
[00:58:30] 
[00:58:30] 28 LL | static A: usize = 0;
[00:58:30] 29    | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`
[00:58:30] -    = note: required by `std::alloc::GlobalAlloc::alloc_zeroed`
[00:58:30] +    = note: required by `std::alloc::GlobalAlloc::alloc`
[00:58:30] 32 
[00:58:30] 33 error: aborting due to 4 previous errors
[00:58:30] 33 error: aborting due to 4 previous errors
[00:58:30] 34 
[00:58:30] 
[00:58:30] 
[00:58:30] The actual stderr differed from the expected stderr.
[00:58:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/allocator/not-an-allocator/not-an-allocator.stderr
[00:58:30] To update references, rerun the tests and pass the `--bless` flag
[00:58:30] To only update this specific test, also pass `--test-args allocator/not-an-allocator.rs`
[00:58:30] error: 1 errors occurred comparing output.
[00:58:30] status: exit code: 1
[00:58:30] status: exit code: 1
[00:58:30] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/allocator/not-an-allocator.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/allocator/not-an-allocator/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/allocator/not-an-allocator/auxiliary" "-A" "unused"
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] ------------------------------------------
[00:58:30] stderr:
[00:58:30] stderr:
[00:58:30] ------------------------------------------
[00:58:30] {"message":"the trait bound `usize: std::alloc::GlobalAlloc` 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/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":true,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":"the trait `std::alloc::GlobalAlloc` is not implemented for `usize`","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":false,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[global_allocator]","def_site_span":null}}],"children":[{"message":"required by `std::alloc::GlobalAlloc::alloc_zeroed`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied\n  --> /checkout/src/test/ui/allocator/not-an-allocator.rs:12:1\n   |\nLL | static A: usize = 0;\n   | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`\n   |\n   = note: required by `std::alloc::GlobalAlloc::alloc_zeroed`\n\n"}
[00:58:30] {"message":"the trait bound `usize: std::alloc::GlobalAlloc` 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/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":true,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":"the trait `std::alloc::GlobalAlloc` is not implemented for `usize`","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":false,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[global_allocator]","def_site_span":null}}],"children":[{"message":"required by `std::alloc::GlobalAlloc::dealloc`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied\n  --> /checkout/src/test/ui/allocator/not-an-allocator.rs:12:1\n   |\nLL | static A: usize = 0;\n   | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`\n   |\n   = note: required by `std::alloc::GlobalAlloc::dealloc`\n\n"}
[00:58:30] {"message":"the trait bound `usize: std::alloc::GlobalAlloc` 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/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":true,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":"the trait `std::alloc::GlobalAlloc` is not implemented for `usize`","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":false,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[global_allocator]","def_site_span":null}}],"children":[{"message":"required by `std::alloc::GlobalAlloc::realloc`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied\n  --> /checkout/src/test/ui/allocator/not-an-allocator.rs:12:1\n   |\nLL | static A: usize = 0;\n   | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`\n   |\n   = note: required by `std::alloc::GlobalAlloc::realloc`\n\n"}
[00:58:30] {"message":"the trait bound `usize: std::alloc::GlobalAlloc` 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/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":true,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":"the trait `std::alloc::GlobalAlloc` is not implemented for `usize`","suggested_replacement":null,"suggestion_applicability":null,"expansion":{"span":{"file_name":"/checkout/src/test/ui/allocator/not-an-allocator.rs","byte_start":487,"byte_end":507,"line_start":12,"line_end":12,"column_start":1,"column_end":21,"is_primary":false,"text":[{"text":"static A: usize = 0;","highlight_start":1,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null},"macro_decl_name":"#[global_allocator]","def_site_span":null}}],"children":[{"message":"required by `std::alloc::GlobalAlloc::alloc`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `usize: std::alloc::GlobalAlloc` is not satisfied\n  --> /checkout/src/test/ui/allocator/not-an-allocator.rs:12:1\n   |\nLL | static A: usize = 0;\n   | ^^^^^^^^^^^^^^^^^^^^ the trait `std::alloc::GlobalAlloc` is not implemented for `usize`\n   |\n   = note: required by `std::alloc::GlobalAlloc::alloc`\n\n"}
[00:58:30] {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors\n\n"}
[00:58:30] {"message":"For more information about this error, try `rustc --explain E0277`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0277`.\n"}
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] thread '[ui] ui/allocator/not-an-allocator.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[00:58:30] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:58:30] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:58:30] 
[00:58:30] ---- [ui] ui/associated-type/associated-type-projection-from-supertrait.rs stdout ----
[00:58:30] diff of stderr:
[00:58:30] 
[00:58:30] 1 error[E0308]: mismatched types
[00:58:30] -   --> $DIR/associated-type-projection-from-supertrait.rs:43:23
[00:58:30] -    |
[00:58:30] - LL | fn b() { dent(ModelT, Blue); } //~ ERROR mismatched types
[00:58:30] -    |                       ^^^^ expected struct `Black`, found struct `Blue`
[00:58:30] -    = note: expected type `Black`
[00:58:30] -               found type `Blue`
[00:58:30] - 
[00:58:30] - error[E0308]: mismatched types
[00:58:30] - error[E0308]: mismatched types
[00:58:30] 11   --> $DIR/associated-type-projection-from-supertrait.rs:44:23
[00:58:30] 12    |
[00:58:30] 13 LL | fn c() { dent(ModelU, Black); } //~ ERROR mismatched types
[00:58:30] 21    |
[00:58:30] 21    |
[00:58:30] 22 LL | fn f() { ModelT.chip_paint(Blue); } //~ ERROR mismatched types
[00:58:30] 23    |                            ^^^^ expected struct `Black`, found struct `Blue`
[00:58:30] +    = note: expected type `Black`
[00:58:30] +               found type `Blue`
[00:58:30] + 
[00:58:30] + error[E0308]: mismatched types
[00:58:30] + error[E0308]: mismatched types
[00:58:30] +   --> $DIR/associated-type-projection-from-supertrait.rs:43:23
[00:58:30] +    |
[00:58:30] + LL | fn b() { dent(ModelT, Blue); } //~ ERROR mismatched types
[00:58:30] +    |                       ^^^^ expected struct `Black`, found struct `Blue`
[00:58:30] 25    = note: expected type `Black`
[00:58:30] 26               found type `Blue`
[00:58:30] 
[00:58:30] 
[00:58:30] 
[00:58:30] The actual stderr differed from the expected stderr.
[00:58:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-type/associated-type-projection-from-supertrait/associated-type-projection-from-supertrait.stderr
[00:58:30] To update references, rerun the tests and pass the `--bless` flag
[00:58:30] To only update this specific test, also pass `--test-args associated-type/associated-type-projection-from-supertrait.rs`
[00:58:30] error: 1 errors occurred comparing output.
[00:58:30] status: exit code: 1
[00:58:30] status: exit code: 1
[00:58:30] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-type/associated-type-projection-from-supertrait/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-type/associated-type-projection-from-supertrait/auxiliary" "-A" "unused"
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] ------------------------------------------
[00:58:30] stderr:
[00:58:30] stderr:
[00:58:30] ------------------------------------------
[00:58:30] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs","byte_start":1338,"byte_end":1343,"line_start":44,"line_end":44,"column_start":23,"column_end":28,"is_primary":true,"text":[{"text":"fn c() { dent(ModelU, Black); } //~ ERROR mismatched types","highlight_start":23,"highlight_end":28}],"label":"expected struct `Blue`, found struct `Black`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `Blue`\n   found type `Black`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs:44:23\n   |\nLL | fn c() { dent(ModelU, Black); } //~ ERROR mismatched types\n   |                       ^^^^^ expected struct `Blue`, found struct `Black`\n   |\n   = note: expected type `Blue`\n              found type `Black`\n\n"}
[00:58:30] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs","byte_start":1548,"byte_end":1552,"line_start":50,"line_end":50,"column_start":28,"column_end":32,"is_primary":true,"text":[{"text":"fn f() { ModelT.chip_paint(Blue); } //~ ERROR mismatched types","highlight_start":28,"highlight_end":32}],"label":"expected struct `Black`, found struct `Blue`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `Black`\n   found type `Blue`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs:50:28\n   |\nLL | fn f() { ModelT.chip_paint(Blue); } //~ ERROR mismatched types\n   |                            ^^^^ expected struct `Black`, found struct `Blue`\n   |\n   = note: expected type `Black`\n              found type `Blue`\n\n"}
[00:58:30] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs","byte_start":1280,"byte_end":1284,"line_start":43,"line_end":43,"column_start":23,"column_end":27,"is_primary":true,"text":[{"text":"fn b() { dent(ModelT, Blue); } //~ ERROR mismatched types","highlight_start":23,"highlight_end":27}],"label":"expected struct `Black`, found struct `Blue`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `Black`\n   found type `Blue`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs:43:23\n   |\nLL | fn b() { dent(ModelT, Blue); } //~ ERROR mismatched types\n   |                       ^^^^ expected struct `Black`, found struct `Blue`\n   |\n   = note: expected type `Black`\n              found type `Blue`\n\n"}
[00:58:30] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs","byte_start":1611,"byte_end":1616,"line_start":51,"line_end":51,"column_start":28,"column_end":33,"is_primary":true,"text":[{"text":"fn g() { ModelU.chip_paint(Black); } //~ ERROR mismatched types","highlight_start":28,"highlight_end":33}],"label":"expected struct `Blue`, found struct `Black`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `Blue`\n   found type `Black`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/associated-type/associated-type-projection-from-supertrait.rs:51:28\n   |\nLL | fn g() { ModelU.chip_paint(Black); } //~ ERROR mismatched types\n   |                            ^^^^^ expected struct `Blue`, found struct `Black`\n   |\n   = note: expected type `Blue`\n              found type `Black`\n\n"}
[00:58:30] {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors\n\n"}
[00:58:30] {"message":"For more information about this error, try `rustc --explain E0308`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0308`.\n"}
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] thread '[ui] ui/associated-type/associated-type-projection-from-supertrait.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[00:58:30] 
[00:58:30] 
[00:58:30] ---- [ui] ui/associated-types/associated-types-eq-3.rs stdout ----
[00:58:30] diff of stderr:
[00:58:30] 
[00:58:30] - error[E0308]: mismatched types
[00:58:30] -   --> $DIR/associated-types-eq-3.rs:33:18
[00:58:30] -    |
[00:58:30] - LL |     let _: Bar = x.boo();
[00:58:30] -    |                  ^^^^^^^ expected struct `Bar`, found associated type
[00:58:30] -    = note: expected type `Bar`
[00:58:30] -    = note: expected type `Bar`
[00:58:30] -               found type `<I as Foo>::A`
[00:58:30] - 
[00:58:30] 10 error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`
[00:58:30] 12    |
[00:58:30] 
[00:58:30] 30    = note: expected type `usize`
[00:58:30] 31               found type `Bar`
[00:58:30] 31               found type `Bar`
[00:58:30] 32    = note: required for the cast to the object type `dyn Foo<A=Bar>`
[00:58:30] + error[E0308]: mismatched types
[00:58:30] +   --> $DIR/associated-types-eq-3.rs:33:18
[00:58:30] +    |
[00:58:30] +    |
[00:58:30] + LL |     let _: Bar = x.boo();
[00:58:30] +    |                  ^^^^^^^ expected struct `Bar`, found associated type
[00:58:30] +    = note: expected type `Bar`
[00:58:30] +    = note: expected type `Bar`
[00:58:30] +               found type `<I as Foo>::A`
[00:58:30] 34 error: aborting due to 3 previous errors
[00:58:30] 35 
[00:58:30] 
[00:58:30] 
[00:58:30] 
[00:58:30] The actual stderr differed from the expected stderr.
[00:58:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-eq-3/associated-types-eq-3.stderr
[00:58:30] To update references, rerun the tests and pass the `--bless` flag
[00:58:30] To only update this specific test, also pass `--test-args associated-types/associated-types-eq-3.rs`
[00:58:30] error: 1 errors occurred comparing output.
[00:58:30] status: exit code: 1
[00:58:30] status: exit code: 1
[00:58:30] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-types/associated-types-eq-3.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-eq-3/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-eq-3/auxiliary" "-A" "unused"
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] ------------------------------------------
[00:58:30] stderr:
[00:58:30] stderr:
[00:58:30] ------------------------------------------
[00:58:30] {"message":"type mismatch resolving `<isize as Foo>::A == Bar`","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-eq-3.rs","byte_start":1096,"byte_end":1100,"line_start":48,"line_end":48,"column_start":5,"column_end":9,"is_primary":true,"text":[{"text":"    foo1(a);","highlight_start":5,"highlight_end":9}],"label":"expected usize, found struct `Bar`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `usize`\n   found type `Bar`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by `foo1`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-eq-3.rs","byte_start":736,"byte_end":764,"line_start":28,"line_end":28,"column_start":1,"column_end":29,"is_primary":true,"text":[{"text":"fn foo1<I: Foo<A=Bar>>(x: I) {","highlight_start":1,"highlight_end":29}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`\n  --> /checkout/src/test/ui/associated-types/associated-types-eq-3.rs:48:5\n   |\nLL |     foo1(a);\n   |     ^^^^ expected usize, found struct `Bar`\n   |\n   = note: expected type `usize`\n              found type `Bar`\nnote: required by `foo1`\n  --> /checkout/src/test/ui/associated-types/associated-types-eq-3.rs:28:1\n   |\nLL | fn foo1<I: Foo<A=Bar>>(x: I) {\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:58:30] {"message":"type mismatch resolving `<isize as Foo>::A == Bar`","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-eq-3.rs","byte_start":1196,"byte_end":1198,"line_start":51,"line_end":51,"column_start":9,"column_end":11,"is_primary":true,"text":[{"text":"    baz(&a);","highlight_start":9,"highlight_end":11}],"label":"expected usize, found struct `Bar`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `usize`\n   found type `Bar`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required for the cast to the object type `dyn Foo<A=Bar>`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0271]: type mismatch resolving `<isize as Foo>::A == Bar`\n  --> /checkout/src/test/ui/associated-types/associated-types-eq-3.rs:51:9\n   |\nLL |     baz(&a);\n   |         ^^ expected usize, found struct `Bar`\n   |\n   = note: expected type `usize`\n              found type `Bar`\n   = note: required for the cast to the object type `dyn Foo<A=Bar>`\n\n"}
[00:58:30] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-eq-3.rs","byte_start":837,"byte_end":844,"line_start":33,"line_end":33,"column_start":18,"column_end":25,"is_primary":true,"text":[{"text":"    let _: Bar = x.boo();","highlight_start":18,"highlight_end":25}],"label":"expected struct `Bar`, found associated type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `Bar`\n   found type `<I as Foo>::A`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/associated-types/associated-types-eq-3.rs:33:18\n   |\nLL |     let _: Bar = x.boo();\n   |                  ^^^^^^^ expected struct `Bar`, found associated type\n   |\n   = note: expected type `Bar`\n              found type `<I as Foo>::A`\n\n"}
[00:58:30] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[00:58:30] {"message":"Some errors occurred: E0271, E0308.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0271, E0308.\n"}
[00:58:30] {"message":"For more information about an error, try `rustc --explain E0271`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0271`.\n"}
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] thread '[ui] ui/associated-types/associated-types-eq-3.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[00:58:30] 
[00:58:30] 
[00:58:30] ---- [ui] ui/associated-types/associated-types-multiple-types-one-trait.rs stdout ----
[00:58:30] diff of stderr:
[00:58:30] 
[00:58:30] - error[E0271]: type mismatch resolving `<T as Foo>::Y == i32`
[00:58:30] -    |
[00:58:30] -    |
[00:58:30] - LL |     want_y(t); //~ ERROR type mismatch
[00:58:30] -    |     ^^^^^^ expected associated type, found i32
[00:58:30] -    |
[00:58:30] -    = note: expected type `<T as Foo>::Y`
[00:58:30] -               found type `i32`
[00:58:30] - note: required by `want_y`
[00:58:30] -    |
[00:58:30] -    |
[00:58:30] - LL | fn want_y<T:Foo<Y=i32>>(t: &T) { }
[00:58:30] - 
[00:58:30] - 
[00:58:30] 15 error[E0271]: type mismatch resolving `<T as Foo>::X == u32`
[00:58:30] 17    |
[00:58:30] 
[00:58:30] 24   --> $DIR/associated-types-multiple-types-one-trait.rs:52:1
[00:58:30] 25    |
[00:58:30] 25    |
[00:58:30] 26 LL | fn want_x<T:Foo<X=u32>>(t: &T) { }
[00:58:30] + 
[00:58:30] + 
[00:58:30] + error[E0271]: type mismatch resolving `<T as Foo>::Y == i32`
[00:58:30] +   --> $DIR/associated-types-multiple-types-one-trait.rs:23:5
[00:58:30] +    |
[00:58:30] + LL |     want_y(t); //~ ERROR type mismatch
[00:58:30] +    |     ^^^^^^ expected associated type, found i32
[00:58:30] +    |
[00:58:30] +    = note: expected type `<T as Foo>::Y`
[00:58:30] +               found type `i32`
[00:58:30] + note: required by `want_y`
[00:58:30] +   --> $DIR/associated-types-multiple-types-one-trait.rs:54:1
[00:58:30] +    |
[00:58:30] + LL | fn want_y<T:Foo<Y=i32>>(t: &T) { }
[00:58:30] 28 
[00:58:30] 29 error: aborting due to 2 previous errors
[00:58:30] 
[00:58:30] 
[00:58:30] 
[00:58:30] The actual stderr differed from the expected stderr.
[00:58:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-multiple-types-one-trait/associated-types-multiple-types-one-trait.stderr
[00:58:30] To update references, rerun the tests and pass the `--bless` flag
[00:58:30] To only update this specific test, also pass `--test-args associated-types/associated-types-multiple-types-one-trait.rs`
[00:58:30] error: 1 errors occurred comparing output.
[00:58:30] status: exit code: 1
[00:58:30] status: exit code: 1
[00:58:30] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-types/associated-types-multiple-types-one-trait.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-multiple-types-one-trait/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-multiple-types-one-trait/auxiliary" "-A" "unused"
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] ------------------------------------------
[00:58:30] stderr:
[00:58:30] stderr:
[00:58:30] ------------------------------------------
[00:58:30] {"message":"type mismatch resolving `<T as Foo>::X == u32`","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-multiple-types-one-trait.rs","byte_start":690,"byte_end":696,"line_start":28,"line_end":28,"column_start":5,"column_end":11,"is_primary":true,"text":[{"text":"    want_x(t); //~ ERROR type mismatch","highlight_start":5,"highlight_end":11}],"label":"expected associated type, found u32","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `<T as Foo>::X`\n   found type `u32`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by `want_x`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-multiple-types-one-trait.rs","byte_start":997,"byte_end":1027,"line_start":52,"line_end":52,"column_start":1,"column_end":31,"is_primary":true,"text":[{"text":"fn want_x<T:Foo<X=u32>>(t: &T) { }","highlight_start":1,"highlight_end":31}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0271]: type mismatch resolving `<T as Foo>::X == u32`\n  --> /checkout/src/test/ui/associated-types/associated-types-multiple-types-one-trait.rs:28:5\n   |\nLL |     want_x(t); //~ ERROR type mismatch\n   |     ^^^^^^ expected associated type, found u32\n   |\n   = note: expected type `<T as Foo>::X`\n              found type `u32`\nnote: required by `want_x`\n  --> /checkout/src/test/ui/associated-types/associated-types-multiple-types-one-trait.rs:52:1\n   |\nLL | fn want_x<T:Foo<X=u32>>(t: &T) { }\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:58:30] {"message":"type mismatch resolving `<T as Foo>::Y == 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-multiple-types-one-trait.rs","byte_start":608,"byte_end":614,"line_start":23,"line_end":23,"column_start":5,"column_end":11,"is_primary":true,"text":[{"text":"    want_y(t); //~ ERROR type mismatch","highlight_start":5,"highlight_end":11}],"label":"expected associated type, found i32","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected type `<T as Foo>::Y`\n   found type `i32`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by `want_y`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-multiple-types-one-trait.rs","byte_start":1033,"byte_end":1063,"line_start":54,"line_end":54,"column_start":1,"column_end":31,"is_primary":true,"text":[{"text":"fn want_y<T:Foo<Y=i32>>(t: &T) { }","highlight_start":1,"highlight_end":31}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0271]: type mismatch resolving `<T as Foo>::Y == i32`\n  --> /checkout/src/test/ui/associated-types/associated-types-multiple-types-one-trait.rs:23:5\n   |\nLL |     want_y(t); //~ ERROR type mismatch\n   |     ^^^^^^ expected associated type, found i32\n   |\n   = note: expected type `<T as Foo>::Y`\n              found type `i32`\nnote: required by `want_y`\n  --> /checkout/src/test/ui/associated-types/associated-types-multiple-types-one-trait.rs:54:1\n   |\nLL | fn want_y<T:Foo<Y=i32>>(t: &T) { }\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:58:30] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[00:58:30] {"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"}
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] thread '[ui] ui/associated-types/associated-types-multiple-types-one-trait.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[00:58:30] 
[00:58:30] 
[00:58:30] ---- [ui] ui/associated-types/associated-types-path-2.rs stdout ----
[00:58:30] diff of stderr:
[00:58:30] 
[00:58:30] - error[E0308]: mismatched types
[00:58:30] -   --> $DIR/associated-types-path-2.rs:29:14
[00:58:30] -    |
[00:58:30] - LL |     f1(2i32, 4i32);
[00:58:30] - 
[00:58:30] - 
[00:58:30] 7 error[E0277]: the trait bound `u32: Foo` is not satisfied
[00:58:30] 9    |
[00:58:30] 
[00:58:30] 45    |
[00:58:30] 45    |
[00:58:30] 46 LL |     let _: i32 = f2(2i32);
[00:58:30] 47    |                  ^^^^^^^^ expected i32, found u32
[00:58:30] + error[E0308]: mismatched types
[00:58:30] +   --> $DIR/associated-types-path-2.rs:29:14
[00:58:30] +    |
[00:58:30] +    |
[00:58:30] + LL |     f1(2i32, 4i32);
[00:58:30] 48 
[00:58:30] 49 error: aborting due to 6 previous errors
[00:58:30] 50 
[00:58:30] 
[00:58:30] 
[00:58:30] 
[00:58:30] The actual stderr differed from the expected stderr.
[00:58:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-path-2/associated-types-path-2.stderr
[00:58:30] To update references, rerun the tests and pass the `--bless` flag
[00:58:30] To only update this specific test, also pass `--test-args associated-types/associated-types-path-2.rs`
[00:58:30] error: 1 errors occurred comparing output.
[00:58:30] status: exit code: 1
[00:58:30] status: exit code: 1
[00:58:30] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-types/associated-types-path-2.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-types/associated-types-path-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-path-2/auxiliary" "-A" "unused"
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] ------------------------------------------
[00:58:30] stderr:
[00:58:30] stderr:
[00:58:30] ------------------------------------------
[00:58:30] {"message":"the trait bound `u32: Foo` is not satisfied","code":{"code":"E0277","explanation":"\nYou tried to use a type which doesn't implement some trait in a place which\nexpected that trait. Erroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n    fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n    foo.bar();\n}\n\nfn main() {\n    // we now call the method with the i32 type, which doesn't implement\n    // the Foo trait\n    some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n    fn bar(&self);\n}\n\nfn some_func<T: Foo>(foo: T) {\n    foo.bar(); // we can now use this method since i32 implements the\n               // Foo trait\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n    fn bar(&self) {}\n}\n\nfn main() {\n    some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n    println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n                           //        implemented for the type `T`\n}\n\nfn main() {\n    // We now call the method with the i32 type,\n    // which *does* implement the Debug trait.\n    some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function: Although\nwe only call it with a parameter that does implement `Debug`, the compiler\nstill rejects the function: It must work with all possible input types. In\norder to make this example compile, we need to restrict the generic type we're\naccepting:\n\n```\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/associated-types/associated-types-path-2.rs","byte_start":903,"byte_end":905,"line_start":39,"line_end":39,"column_start":5,"column_end":7,"is_primary":true,"text":[{"text":"    f1(2u32, 4u32);","highlight_start":5,"highlight_end":7}],"label":"the trait `Foo` is not implemented for `u32`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"required by `f1`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-path-2.rs","byte_start":632,"byte_end":664,"line_start":23,"line_end":23,"column_start":1,"column_end":33,"is_primary":true,"text":[{"text":"pub fn f1<T: Foo>(a: T, x: T::A) {}","highlight_start":1,"highlight_end":33}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `u32: Foo` is not satisfied\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:39:5\n   |\nLL |     f1(2u32, 4u32);\n   |     ^^ the trait `Foo` is not implemented for `u32`\n   |\nnote: required by `f1`\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:23:1\n   |\nLL | pub fn f1<T: Foo>(a: T, x: T::A) {}\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:58:30] {"message":"the trait bound `u32: Foo` is not satisfied","code":{"code":"E0277","explanation":"\nYou tried to use a type which doesn't implement some trait in a place which\nexpected that trait. Erroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n    fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n    foo.bar();\n}\n\nfn main() {\n    // we now call the method with the i32 type, which doesn't implement\n    // the Foo trait\n    some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n    fn bar(&self);\n}\n\nfn some_func<T: Foo>(foo: T) {\n    foo.bar(); // we can now use this method since i32 implements the\n               // Foo trait\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n    fn bar(&self) {}\n}\n\nfn main() {\n    some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n    println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n                           //        implemented for the type `T`\n}\n\nfn main() {\n    // We now call the method with the i32 type,\n    // which *does* implement the Debug trait.\n    some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function: Although\nwe only call it with a parameter that does implement `Debug`, the compiler\nstill rejects the function: It must work with all possible input types. In\norder to make this example compile, we need to restrict the generic type we're\naccepting:\n\n```\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/associated-types/associated-types-path-2.rs","byte_start":903,"byte_end":917,"line_start":39,"line_end":39,"column_start":5,"column_end":19,"is_primary":true,"text":[{"text":"    f1(2u32, 4u32);","highlight_start":5,"highlight_end":19}],"label":"the trait `Foo` is not implemented for `u32`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0277]: the trait bound `u32: Foo` is not satisfied\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:39:5\n   |\nLL |     f1(2u32, 4u32);\n   |     ^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `u32`\n\n"}
[00:58:30] {"message":"the trait bound `u32: Foo` is not satisfied","code":{"code":"E0277","explanation":"\nYou tried to use a type which doesn't implement some trait in a place which\nexpected that trait. Erroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n    fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n    foo.bar();\n}\n\nfn main() {\n    // we now call the method with the i32 type, which doesn't implement\n    // the Foo trait\n    some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n    fn bar(&self);\n}\n\nfn some_func<T: Foo>(foo: T) {\n    foo.bar(); // we can now use this method since i32 implements the\n               // Foo trait\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n    fn bar(&self) {}\n}\n\nfn main() {\n    some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n    println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n                           //        implemented for the type `T`\n}\n\nfn main() {\n    // We now call the method with the i32 type,\n    // which *does* implement the Debug trait.\n    some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function: Although\nwe only call it with a parameter that does implement `Debug`, the compiler\nstill rejects the function: It must work with all possible input types. In\norder to make this example compile, we need to restrict the generic type we're\naccepting:\n\n```\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/associated-types/associated-types-path-2.rs","byte_start":1035,"byte_end":1037,"line_start":45,"line_end":45,"column_start":5,"column_end":7,"is_primary":true,"text":[{"text":"    f1(2u32, 4i32);","highlight_start":5,"highlight_end":7}],"label":"the trait `Foo` is not implemented for `u32`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"required by `f1`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-path-2.rs","byte_start":632,"byte_end":664,"line_start":23,"line_end":23,"column_start":1,"column_end":33,"is_primary":true,"text":[{"text":"pub fn f1<T: Foo>(a: T, x: T::A) {}","highlight_start":1,"highlight_end":33}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `u32: Foo` is not satisfied\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:45:5\n   |\nLL |     f1(2u32, 4i32);\n   |     ^^ the trait `Foo` is not implemented for `u32`\n   |\nnote: required by `f1`\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:23:1\n   |\nLL | pub fn f1<T: Foo>(a: T, x: T::A) {}\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:58:30] {"message":"the trait bound `u32: Foo` is not satisfied","code":{"code":"E0277","explanation":"\nYou tried to use a type which doesn't implement some trait in a place which\nexpected that trait. Erroneous code example:\n\n```compile_fail,E0277\n// here we declare the Foo trait with a bar method\ntrait Foo {\n    fn bar(&self);\n}\n\n// we now declare a function which takes an object implementing the Foo trait\nfn some_func<T: Foo>(foo: T) {\n    foo.bar();\n}\n\nfn main() {\n    // we now call the method with the i32 type, which doesn't implement\n    // the Foo trait\n    some_func(5i32); // error: the trait bound `i32 : Foo` is not satisfied\n}\n```\n\nIn order to fix this error, verify that the type you're using does implement\nthe trait. Example:\n\n```\ntrait Foo {\n    fn bar(&self);\n}\n\nfn some_func<T: Foo>(foo: T) {\n    foo.bar(); // we can now use this method since i32 implements the\n               // Foo trait\n}\n\n// we implement the trait on the i32 type\nimpl Foo for i32 {\n    fn bar(&self) {}\n}\n\nfn main() {\n    some_func(5i32); // ok!\n}\n```\n\nOr in a generic context, an erroneous code example would look like:\n\n```compile_fail,E0277\nfn some_func<T>(foo: T) {\n    println!(\"{:?}\", foo); // error: the trait `core::fmt::Debug` is not\n                           //        implemented for the type `T`\n}\n\nfn main() {\n    // We now call the method with the i32 type,\n    // which *does* implement the Debug trait.\n    some_func(5i32);\n}\n```\n\nNote that the error here is in the definition of the generic function: Although\nwe only call it with a parameter that does implement `Debug`, the compiler\nstill rejects the function: It must work with all possible input types. In\norder to make this example compile, we need to restrict the generic type we're\naccepting:\n\n```\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/associated-types/associated-types-path-2.rs","byte_start":1035,"byte_end":1049,"line_start":45,"line_end":45,"column_start":5,"column_end":19,"is_primary":true,"text":[{"text":"    f1(2u32, 4i32);","highlight_start":5,"highlight_end":19}],"label":"the trait `Foo` is not implemented for `u32`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0277]: the trait bound `u32: Foo` is not satisfied\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:45:5\n   |\nLL |     f1(2u32, 4i32);\n   |     ^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `u32`\n\n"}
[00:58:30] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-path-2.rs","byte_start":1175,"byte_end":1183,"line_start":51,"line_end":51,"column_start":18,"column_end":26,"is_primary":true,"text":[{"text":"    let _: i32 = f2(2i32);","highlight_start":18,"highlight_end":26}],"label":"expected i32, found u32","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:51:18\n   |\nLL |     let _: i32 = f2(2i32);\n   |                  ^^^^^^^^ expected i32, found u32\n\n"}
[00:58:30] {"message":"mismatched types","code":{"code":"E0308","explanation":"\nThis error occurs when the compiler was unable to infer the concrete type of a\nvariable. It can occur for several cases, the most common of which is a\nmismatch in the expected type that the compiler inferred for a variable's\ninitializing expression, and the actual type explicitly assigned to the\nvariable.\n\nFor example:\n\n```compile_fail,E0308\nlet x: i32 = \"I am not a number!\";\n//     ~~~   ~~~~~~~~~~~~~~~~~~~~\n//      |             |\n//      |    initializing expression;\n//      |    compiler infers type `&str`\n//      |\n//    type `i32` assigned to variable `x`\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/associated-types/associated-types-path-2.rs","byte_start":754,"byte_end":758,"line_start":29,"line_end":29,"column_start":14,"column_end":18,"is_primary":true,"text":[{"text":"    f1(2i32, 4i32);","highlight_start":14,"highlight_end":18}],"label":"expected u32, found i32","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0308]: mismatched types\n  --> /checkout/src/test/ui/associated-types/associated-types-path-2.rs:29:14\n   |\nLL |     f1(2i32, 4i32);\n   |              ^^^^ expected u32, found i32\n\n"}
[00:58:30] {"message":"aborting due to 6 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 6 previous errors\n\n"}
[00:58:30] {"message":"Some errors occurred: E0277, E0308.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0277, E0308.\n"}
[00:58:30] {"message":"For more information about an error, try `rustc --explain E0277`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0277`.\n"}
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] thread '[ui] ui/associated-types/associated-types-path-2.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[00:58:30] 
[00:58:30] 
[00:58:30] ---- [ui] ui/binop/binop-consume-args.rs stdout ----
[00:58:30] diff of stderr:
[00:58:30] 
[00:58:30] 1 error[E0382]: use of moved value: `lhs`
[00:58:30] +   --> $DIR/binop-consume-args.rs:47:10
[00:58:30] 3    |
[00:58:30] 3    |
[00:58:30] - LL |     lhs + rhs;
[00:58:30] + LL |     lhs & rhs;
[00:58:30] 5    |     --- value moved here
[00:58:30] 6 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:58:30] 7    |          ^^^ value used here after move
[00:58:30] 
[00:58:30] 9    = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
[00:58:30] 10 
[00:58:30] 11 error[E0382]: use of moved value: `rhs`
[00:58:30] +   --> $DIR/binop-consume-args.rs:48:10
[00:58:30] 13    |
[00:58:30] 13    |
[00:58:30] - LL |     lhs + rhs;
[00:58:30] + LL |     lhs & rhs;
[00:58:30] 15    |           --- value moved here
[00:58:30] 16 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:58:30] 17 LL |     drop(rhs);  //~ ERROR use of moved value: `rhs`
[00:58:30] 
[00:58:30] 20    = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
[00:58:30] 21 
[00:58:30] 22 error[E0382]: use of moved value: `lhs`
[00:58:30] +   --> $DIR/binop-consume-args.rs:53:10
[00:58:30] 24    |
[00:58:30] 24    |
[00:58:30] - LL |     lhs - rhs;
[00:58:30] + LL |     lhs | rhs;
[00:58:30] 26    |     --- value moved here
[00:58:30] 27 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:58:30] 28    |          ^^^ value used here after move
[00:58:30] 29    |
[00:58:30] 29    |
[00:58:30] 30    = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
[00:58:30] 31 
[00:58:30] + error[E0382]: use of moved value: `lhs`
[00:58:30] +   --> $DIR/binop-consume-args.rs:65:10
[00:58:30] +    |
[00:58:30] + LL |     lhs << rhs;
[00:58:30] +    |     --- value moved here
[00:58:30] + LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:58:30] +    |          ^^^ value used here after move
[00:58:30] +    |
[00:58:30] +    = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
[00:58:30] + 
[00:58:30] 32 error[E0382]: use of moved value: `rhs`
[00:58:30] +   --> $DIR/binop-consume-args.rs:66:10
[00:58:30] 34    |
[00:58:30] 34    |
[00:58:30] - LL |     lhs - rhs;
[00:58:30] -    |           --- value moved here
[00:58:30] + LL |     lhs << rhs;
[00:58:30] +    |            --- value moved here
[00:58:30] 37 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:58:30] 38 LL |     drop(rhs);  //~ ERROR use of moved value: `rhs`
[00:58:30] 39    |          ^^^ value used here after move
[00:58:30] 
[00:58:30] 41    = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
[00:58:30] 42 
[00:58:30] 43 error[E0382]: use of moved value: `lhs`
[00:58:30] +   --> $DIR/binop-consume-args.rs:71:10
[00:58:30] 45    |
[00:58:30] 45    |
[00:58:30] - LL |     lhs * rhs;
[00:58:30] + LL |     lhs >> rhs;
[00:58:30] 47    |     --- value moved here
[00:58:30] 48 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:58:30] 49    |          ^^^ value used here after move
[00:58:30] 
[00:58:30] 51    = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
[00:58:30] 52 
[00:58:30] 53 error[E0382]: use of moved value: `rhs`
[00:58:30] +   --> $DIR/binop-consume-args.rs:72:10
[00:58:30] 55    |
[00:58:30] 55    |
[00:58:30] - LL |     lhs * rhs;
[00:58:30] -    |           --- value moved here
[00:58:30] + LL |     lhs >> rhs;
[00:58:30] +    |            --- value moved here
[00:58:30] 58 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:58:30] 59 LL |     drop(rhs);  //~ ERROR use of moved value: `rhs`
[00:58:30] 60    |          ^^^ value used here after move
[00:58:30] 
[00:58:30] 62    = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
[00:58:30] 63 
[00:58:30] 64 error[E0382]: use of moved value: `lhs`
[00:58:30] +   --> $DIR/binop-consume-args.rs:59:10
[00:58:30] 66    |
[00:58:30] 66    |
[00:58:30] - LL |     lhs / rhs;
[00:58:30] + LL |     lhs ^ rhs;
[00:58:30] 68    |     --- value moved here
[00:58:30] 69 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:58:30] 70    |          ^^^ value used here after move
[00:58:30] 
[00:58:30] 72    = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
[00:58:30] 73 
[00:58:30] 74 error[E0382]: use of moved value: `rhs`
[00:58:30] +   --> $DIR/binop-consume-args.rs:60:10
[00:58:30] 76    |
[00:58:30] 76    |
[00:58:30] - LL |     lhs / rhs;
[00:58:30] + LL |     lhs ^ rhs;
[00:58:30] 78    |           --- value moved here
[00:58:30] 79 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:58:30] 80 LL |     drop(rhs);  //~ ERROR use of moved value: `rhs`
[00:58:30] 82    |
[00:58:30] 82    |
[00:58:30] 83    = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
[00:58:30] 84 
[00:58:30] - error[E0382]: use of moved value: `lhs`
[00:58:30] -    |
[00:58:30] -    |
[00:58:30] - LL |     lhs % rhs;
[00:58:30] -    |     --- value moved here
[00:58:30] - LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:58:30] -    |          ^^^ value used here after move
[00:58:30] -    |
[00:58:30] -    = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
[00:58:30] - 
[00:58:30] 95 error[E0382]: use of moved value: `rhs`
[00:58:30] +   --> $DIR/binop-consume-args.rs:54:10
[00:58:30] 97    |
[00:58:30] 97    |
[00:58:30] - LL |     lhs % rhs;
[00:58:30] + LL |     lhs | rhs;
[00:58:30] 99    |           --- value moved here
[00:58:30] 100 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:58:30] 101 LL |     drop(rhs);  //~ ERROR use of moved value: `rhs`
[00:58:30] 
[00:58:30] 104    = note: move occurs because `rhs` has type `B`, which does not implement the `Copy` trait
[00:58:30] 105 
[00:58:30] 106 error[E0382]: use of moved value: `lhs`
[00:58:30] +   --> $DIR/binop-consume-args.rs:29:10
[00:58:30] 108    |
[00:58:30] 108    |
[00:58:30] - LL |     lhs & rhs;
[00:58:30] + LL |     lhs * rhs;
[00:58:30] 110    |     --- value moved here
[00:58:30] 111 LL |     drop(lhs);  //~ ERROR use of moved value: `lhs`
[00:58:30] 112    |          ^^^ value used here after move
[00:58:30] 
[00:58:30] 114    = note: move occurs because `lhs` has type `A`, which does not implement the `Copy` trait
[00:58:30] 115 
[00:58:30] 116 error[E0382]: use of moved value: `rhs`
[00:58:30] +   --> $DIR/binop-consume-args.rs:30:10
[00:58:30] 118    |
[00:58:30] 118    |
[00:58:30] - LL |     lhs & rhs;
[00:58:30] + LL |     lhs * rhs;
[00:58:30] 120    |           --- value moved here
---
[00:58:30] -   --> $DIR/issue-32829-2.rs:17:9
[00:58:30] + error[E0658]: statements in statics are unstable (see issue #48821)
[00:58:30] +   --> $DIR/issue-32829-2.rs:67:9
[00:58:30] 3    |
[00:58:30] 4 LL |         5;
[00:58:30] 
[00:58:30] 6    |
[00:58:30] 7    = help: add #![feature(const_let)] to the crate attributes to enable
[00:58:30] 8 
[00:58:30] 8 
[00:58:30] - error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
[00:58:30] -   --> $DIR/issue-32829-2.rs:25:9
[00:58:30] + error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
[00:58:30] +   --> $DIR/issue-32829-2.rs:75:9
[00:58:30] 11 unctions, tuple structs and tuple variants
[00:58:30] -    |
[00:58:30] -    |
[00:58:30] 72 LL |         invalid();
[00:58:30] 74 
[00:58:30] 
[00:58:30] - error[E0658]: statements in statics are unstable (see issue #48821)
[00:58:30] -   --> $DIR/issue-32829-2.rs:75:9
[00:58:30] -   --> $DIR/issue-32829-2.rs:75:9
[00:58:30] + error[E0658]: statements in constants are unstable (see issue #48821)
[00:58:30] +   --> $DIR/issue-32829-2.rs:25:9
[00:58:30] 77    |
[00:58:30] 78 LL |         invalid();
[00:58:30] 
[00:58:30] 80    |
[00:58:30] 81    = help: add #![feature(const_let)] to the crate attributes to enable
[00:58:30] 82 
[00:58:30] 82 
[00:58:30] - error[E0658]: statements in statics are unstable (see issue #48821)
[00:58:30] -   --> $DIR/issue-32829-2.rs:84:9
[00:58:30] + error[E0658]: statements in constants are unstable (see issue #48821)
[00:58:30] +   --> $DIR/issue-32829-2.rs:34:9
[00:58:30] 85    |
[00:58:30] 86 LL |         valid();
[00:58:30] 
[00:58:30] +    |
[00:58:30] +    = help: add #![feature(const_let)] to the crate attributes to enable
[00:58:30] + 
[00:58:30] + 
[00:58:30] + error[E0658]: statements in constants are unstable (see issue #48821)
[00:58:30] +   --> $DIR/issue-32829-2.rs:17:9
[00:58:30] +    |
[00:58:30] + LL |         5;
[00:58:30] 88    |
[00:58:30] 89    = help: add #![feature(const_let)] to the crate attributes to enable
[00:58:30] 90 
[00:58:30] 
[00:58:30] 
[00:58:30] 
[00:58:30] The actual stderr differed from the expected stderr.
[00:58:30] Actual stderr saved to /stc, just add the corresponding feature\nto be able to use it:\n\n```\n#![feature(repr128)]\n\n#[repr(u128)] // ok!\nenum Foo {\n    Bar(u64),\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-32829-2.rs","byte_start":1502,"byte_end":1503,"line_start":67,"line_end":67,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":"        5;","highlight_start":9,"highlight_end":10}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_let)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0658]: statements in statics are unstable (see issue #48821)\n  --> /checkout/src/test/ui/issues/issue-32829-2.rs:67:9\n   |\nLL |         5;\n   |         ^\n   |\n   = help: add #![feature(const_let)] to the crate attributes to enable\n\n"}
[00:58:30] {"message":"calls in statics are limited to constant functions, tuple structs and tuple variants","code":{"code":"E0015","explanation":"\nThe only functions that can be called in static or constant expressions are\n`const` functions, and struct/enum constructors. `const` functions are only\navailable on a nightly compiler. Rust currently does not support more general\ncompile-time function execution.\n\n```\nconst FOO: Option<u8> = Some(1); // enum constructor\nstruct Bar {x: u8}\nconst BAR: Bar = Bar {x: 1}; // struct constructor\n```\n\nSee [RFC 911] for more details on the design of `const fn`s.\n\n[RFC 911]: https://github.com/rust-lang/rfcs/blob/master/text/0911-const-fn.md\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-32829-2.rs","byte_start":1624,"byte_end":1633,"line_start":75,"line_end":75,"column_start":9,"column_end":18,"is_primary":true,"text":[{"text":"        invalid();","highlight_start":9,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants\n  --> /checkout/src/test/ui/issues/issue-32829-2.rs:75:9\n   |\nLL |         invalid();\n   |         ^^^^^^^^^\n\n"}
[00:58:30] {"message":"statements in statics are unstable (see issue #48821)","code":{"code":"E0658","explanation":"\nAn unstable feature was used.\n\nErroneous code example:\n\n```compile_fail,E658\n#[repr(u128)] // error: use of unstable library feature 'repr128'\nenum Foo {\n    Bar(u64),\n}\n```\n\nIf you're using a stable or a beta version of rustc, you won't be able to use\nany unstable features. In order to do so, please switch to a nightly version of\nrustc (by using rustup).\n\nIf you're using a nightly version of rustc, just add the corresponding feature\nto be able to use it:\n\n```\n#![feature(repr128)]\n\n#[repr(u128)] // ok!\nenum Foo {\n    Bar(u64),\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-32829-2.rs","byte_start":1624,"byte_end":1633,"line_start":75,"line_end":75,"column_start":9,"column_end":18,"is_primary":true,"text":[{"text":"        invalid();","highlight_start":9,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansiol}],"rendered":"error[E0658]: statements in statics are unstable (see issue #48821)\n  --> /checkout/src/test/ui/issues/issue-32829-2.rs:84:9\n   |\nLL |         valid();\n   |         ^^^^^^^\n   |\n   = help: add #![feature(const_let)] to the crate attributes to enable\n\n"}
[00:58:30] {"message":"statements in statics are unstable (see issue #48821)","code":{"code":"E0658","explanation":"\nAn unstable feature was used.\n\nErroneous code example:\n\n```compile_fail,E658\n#[repr(u128)] // error: use of unstable library feature 'repr128'\nenum Foo {\n    Bar(u64),\n}\n```\n\nIf you're using a stable or a beta version of rustc, you won't be able to use\nany unstable features. In order to do so, please switch to a nightly version of\nrustc (by using rustup).\n\nIf you're using a nightly version of rustc, just add the corresponding feature\nto be able to use it:\n\n```\n#![feature(repr128)]\n\n#[repr(u128)] // ok!\nenum Foo {\n    Bar(u64),\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-32829-2.rs","byte_start":1028,"byte_end":1029,"line_start":42,"line_end":42,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":"        5;","highlight_start":9,"highlight_end":10}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_let)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0658]: statements in statics are unstable (see issue #48821)\n  --> /checkout/src/test/ui/issues/issue-32829-2.rs:42:9\n   |\nLL |         5;\n   |         ^\n   |\n   = help: add #![feature(const_let)] to the crate attributes to enable\n\n"}
[00:58:30] {"message":"calls in statics are limited to constant functions, tuple structs and tuple variants","code":{"code":"E0015","explanation":"\nThe only functions that can be called in static or constant expressions are\n`const` functions, and struct/enum constructors. `const` functions are only\navailable on a nightly compiler. Rust currently does not support more general\ncompile-time function execution.\n\n```\nconst FOO: Option<u8> = Some(1); // enum constructor\nstruct Bar {x: u8}\nconst BAR: Bar = Bar {x: 1}; // struct constructor\n```\n\nSee [RFC 911] for more details on the design of `const fn`s.\n\n[RFC 911]: https://github.com/rust-lang/rfcs/blob/master/text/0911-const-fn.md\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-32829-2.rs","byte_start":1145,"byte_end":1154,"line_start":50,"line_end":50,"column_start":9,"column_end":18,"is_primary":true,"text":[{"text":"        invalid();","highlight_start":9,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants\n  --> /checkout/src/test/ui/issues/issue-32829-2.rs:50:9\n   |\nLL |         invalid();\n   |         ^^^^^^^^^\n\n"}
[00:58:30] {"message":"statements in statics are unstable (see issue #48821)","code":{"code":"E0658","explanation":"\nAn unstable feature was used.\n\nErroneous code example:\n\n```compile_fail,E658\n#[repr(u128)] // error: use of unstablatures. In order to do so, please switch to a nightly version of\nrustc (by using rustup).\n\nIf you're using a nightly version of rustc, just add the corresponding feature\nto be able to use it:\n\n```\n#![feature(repr128)]\n\n#[repr(u128)] // ok!\nenum Foo {\n    Bar(u64),\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-32829-2.rs","byte_start":1374,"byte_end":1381,"line_start":59,"line_end":59,"column_start":9,"column_end":16,"is_primary":true,"text":[{"text":"        valid();","highlight_start":9,"highlight_end":16}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"add #![feature(const_let)] to the crate attributes to enable","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0658]: statements in statics are unstable (see issue #48821)\n  --> /checkout/src/test/ui/issues/issue-32829-2.rs:59:9\n   |\nLL |         valid();\n   |         ^^^^^^^\n   |\n   = help: add #![feature(const_let)] to the crate attributes to enable\n\n"}
[00:58:30] {"message":"calls in constants are limited to constant functions, tuple structs and tuple variants","code":{"code":"E0015","explanation":"\nThe only functions that can be called in static or constant expressions are\n`const` functions, and struct/enum constructors. `const` functions are only\navailable on a nightly compiler. Rust currently does not support more general\ncompile-time function execution.\n\n```\nconst FOO: Option<u8> = Some(1); // enum constructor\nstruct Bar {x: u8}\nconst BAR: Bar = Bar {x: 1}; // struct constructor\n```\n\nSee [RFC 911] for more details on the design of `const fn`s.\n\n[RFC 911]: https://github.com/rust-lang/rfcs/blob/master/text/0911-const-fn.md\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-32829-2.rs","byte_start":668,"byte_end":677,"line_start":25,"line_end":25,"column_start":9,"column_end":18,"is_primary":true,"text":[{"text":"        invalid();","highlight_start":9,"highlight_end":18}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants\n  --> /checkout/src/test/ui/issues/issue-32829-2.rs:25:9\n   |\nLL |         invalid();\n   |         ^^^^^^^^^\n\n"}
[00:58:30] {"message":"statements in constants are unstable (see issue #48821)","code":{"code":"E0658","explanation":"\nAn unstable feature was used.\n\nErroneous code example:\n\n```compile_fail,E658\n#[repr(u128)] // error: use of unstable library feature 'repr128'\nenum Foo {\n    Bar(u64),\n}\n```\n\nIf you're using a stable or a beta version of rustc, you won't be able to use\nany unstable features. In order to do so, please switch to a nightly version of\nrustc (by using rustup).\n\nIf you're using a nightly version of rustc, just add the corresponding feature\nto be able to use it:\n\n```\n#![feature(repr128)]\n\n#[repr(u128)] // ok!\nenum Foo {\n    Bar(u64),\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-32829-2.rs","byte_start":668,"byte_end":677,"line_start":25,"line_end":25,"column_start":9,"column_end":18,"is_primary":true,"text":[lifetime required in the type of `y`
[00:58:30] 12    |
[00:58:30] 12    |
[00:58:30] 13 LL | fn lifetime_transmute_struct<'a, T: ?Sized>(x: &'a T, y: &T) -> &'a T {
[00:58:30] 
[00:58:30] 16 LL |     out.head
[00:58:30] 17    |     ^^^^^^^^ lifetime `'a` required
[00:58:30] - error: aborting due to 2 previous errors
[00:58:30] + error: aborting due to previous error
[00:58:30] 20 
[00:58:30] 21 For more information about this error, try `rustc --explain E0621`.
[00:58:30] 21 For more information about this error, try `rustc --explain E0621`.
[00:58:30] 22 
[00:58:30] 
[00:58:30] 
[00:58:30] The actual stderr differed from the expected stderr.
[00:58:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-40288-2/issue-40288-2.stderr
[00:58:30] To update references, rerun the tests and pass the `--bless` flag
[00:58:30] To only update this specific test, also pass `--test-args issues/issue-40288-2.rs`
[00:58:30] error: 1 errors occurred comparing output.
[00:58:30] status: exit code: 1
[00:58:30] status: exit code: 1
[00:58:30] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-40288-2.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-40288-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/issues/issue-40288-2/auxiliary" "-A" "unused"
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] ------------------------------------------
[00:58:30] stderr:
[00:58:30] stderr:
[00:58:30] ------------------------------------------
[00:58:30] {"message":"explicit lifetime required in the type of `y`","code":{"code":"E0621","explanation":"\nThis error code indicates a mismatch between the lifetimes appearing in the\nfunction signature (i.e., the parameter types and the return type) and the\ndata-flow found in the function body.\n\nErroneous code example:\n\n```compile_fail,E0621\nfn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 { // error: explicit lifetime\n                                             //        required in the type of\n                                             //        `y`\n    if x > y { x } else { y }\n}\n```\n\nIn the code above, the function is returning data borrowed from either `x` or\n`y`, but the `'a` annotation indicates that it is returning data only from `x`.\nTo fix the error, the signature and the body must be made to match. Typically,\nthis is done by updating the function signature. So, in this case, we change\nthe type of `y` to `&'a i32`, like so:\n\n```\nfn foo<'a>(x: &'a i32, y: &'a i32) -> &'a i32 {\n    if x > y { x } else { y }\n}\n```\n\nNow the signature indicates that the function data borrowed from either `x` or\n`y`. Alternatively, you could change the body to not return data from `y`:\n\n```\nfn foo<'a>(x: &'a i32, y: &i32) -> &'a i32 {\n    x\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-40288-2.rs","byte_start":1057,"byte_end":1065,"line_start":34,"line_end":34,"column_start":5,"column_end":13,"is_primary":true,"text":[{"text":"    out.hea at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[00:58:30] ---- [ui] ui/issues/issue-42060.rs stdout ----
[00:58:30] diff of stderr:
[00:58:30] 
[00:58:30] 11    |             ^ non-constant value
[00:58:30] 11    |             ^ non-constant value
[00:58:30] 12 
[00:58:30] 13 error[E0516]: `typeof` is a reserved keyword but unimplemented
[00:58:30] -    |
[00:58:30] -    |
[00:58:30] - LL |     let other: typeof(thing) = thing; //~ ERROR attempt to use a non-constant value in a constant
[00:58:30] -    |                ^^^^^^^^^^^^^ reserved keyword
[00:58:30] - 
[00:58:30] - error[E0516]: `typeof` is a reserved keyword but unimplemented
[00:58:30] 21    |
[00:58:30] 21    |
[00:58:30] 22 LL |     <typeof(q)>::N //~ ERROR attempt to use a non-constant value in a constant
[00:58:30] 23    |      ^^^^^^^^^ reserved keyword
[00:58:30] + 
[00:58:30] + 
[00:58:30] + error[E0516]: `typeof` is a reserved keyword but unimplemented
[00:58:30] +   --> $DIR/issue-42060.rs:13:16
[00:58:30] +    |
[00:58:30] + LL |     let other: typeof(thing) = thing; //~ ERROR attempt to use a non-constant value in a constant
[00:58:30] +    |                ^^^^^^^^^^^^^ reserved keyword
[00:58:30] 25 error: aborting due to 4 previous errors
[00:58:30] 26 
[00:58:30] 
[00:58:30] 
[00:58:30] 
[00:58:30] The actual stderr differed from the expected stderr.
[00:58:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-42060/issue-42060.stderr
[00:58:30] To update references, rerun the tests and pass the `--bless` flag
[00:58:30] To only update this spectypeof(q)>::N //~ ERROR attempt to use a non-constant value in a constant\n   |             ^ non-constant value\n\n"}
[00:58:30] {"message":"`typeof` is a reserved keyword but unimplemented","code":{"code":"E0516","explanation":"\nThe `typeof` keyword is currently reserved but unimplemented.\nErroneous code example:\n\n```compile_fail,E0516\nfn main() {\n    let x: typeof(92) = 92;\n}\n```\n\nTry using type inference instead. Example:\n\n```\nfn main() {\n    let x = 92;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-42060.rs","byte_start":700,"byte_end":709,"line_start":19,"line_end":19,"column_start":6,"column_end":15,"is_primary":true,"text":[{"text":"    <typeof(q)>::N //~ ERROR attempt to use a non-constant value in a constant","highlight_start":6,"highlight_end":15}],"label":"reserved keyword","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0516]: `typeof` is a reserved keyword but unimplemented\n  --> /checkout/src/test/ui/issues/issue-42060.rs:19:6\n   |\nLL |     <typeof(q)>::N //~ ERROR attempt to use a non-constant value in a constant\n   |      ^^^^^^^^^ reserved keyword\n\n"}
[00:58:30] {"message":"`typeof` is a reserved keyword but unimplemented","code":{"code":"E0516","explanation":"\nThe `typeof` keyword is currently reserved but unimplemented.\nErroneous code example:\n\n```compile_fail,E0516\nfn main() {\n    let x: typeof(92) = 92;\n}\n```\n\nTry using type inference instead. Example:\n\n```\nfn main() {\n    let x = 92;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-42060.rs","byte_start":514,"byte_end":527,"line_start":13,"line_end":13,"column_start":16,"column_end":29,"is_primary":true,"text":[{"text":"    let other: typeof(thing) = thing; //~ ERROR attempt to use a non-constant value in a constant","highlight_start":16,"highlight_end":29}],"label":"reserved keyword","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0516]: `typeof` is a reserved keyword but unimplemented\n  --> /checkout/src/test/ui/issues/issue-42060.rs:13:16\n   |\nLL |     let other: typeof(thing) = thing; //~ ERROR attempt to use a non-constant value in a constant\n   |                ^^^^^^^^^^^^^ reserved keyword\n\n"}
[00:58:30] {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors\n\n"}
[00:58:30] {"message":"Some errors occurred: E0435, E0516.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0435, E0516.\n"}
[00:58:30] {"message":"For more information about an error, try `rustc --explain E0435`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0435`.\n"}
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] thread '[ui] ui/issues/issue-42060.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[00:58:30] 
[00:58:30] 
[00:58:30] ---- [ui] ui/issues/issue-45199.rs#ast stdout ----
[00:58:30] diff of stderr:
[00:58:30] 
[00:58:30] 1 error[E0384]: cannot assign twice to immutable variable b = Box::new(2);    //[ast]~ ERROR cannot assign twice to immutable variable
[00:58:30] 26    |     ^^^^^^^^^^^^^^^ cannot assign twice to immutable variable
[00:58:30] 28 error: aborting due to 3 previous errors
[00:58:30] 
[00:58:30] 
[00:58:30] The actual stderr differed from the expected stderr.
[00:58:30] The actual stderr differed from the expected stderr.
[00:58:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-45199.ast/issue-45199.ast.stderr
[00:58:30] To update references, rerun the tests and pass the `--bless` flag
[00:58:30] To only update this specific test, also pass `--test-args issues/issue-45199.rs`
[00:58:30] 
[00:58:30] error in revision `ast`: 1 errors occurred comparing output.
[00:58:30] status: exit code: 1
[00:58:30] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-45199.rs" "--target=x86_64-unknown-linux-gnu" "--cfg" "ast" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-45199.ast/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-45199.ast/auxiliary" "-A" "unused"
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] ------------------------------------------
[00:58:30] stderr:
[00:58:30] stderr:
[00:58:30] ------------------------------------------
[00:58:30] {"message":"cannot assign twice to immutable variable `b`","code":{"code":"E0384","explanation":"\nThis error occurs when an a |     ^^^^^^^^^^^^^^^ cannot assign twice to immutable variable\n\n"}
[00:58:30] {"message":"cannot assign twice to immutable variable `b`","code":{"code":"E0384","explanation":"\nThis error occurs when an attempt is made to reassign an immutable variable.\nFor example:\n\n```compile_fail,E0384\nfn main() {\n    let x = 3;\n    x = 5; // error, reassignment of immutable variable\n}\n```\n\nBy default, variables in Rust are immutable. To fix this error, add the keyword\n`mut` after the keyword `let` when declaring the variable. For example:\n\n```\nfn main() {\n    let mut x = 3;\n    x = 5;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-45199.rs","byte_start":1340,"byte_end":1355,"line_start":31,"line_end":31,"column_start":5,"column_end":20,"is_primary":true,"text":[{"text":"    b = Box::new(2);        //[ast]~ ERROR cannot assign twice to immutable variable","highlight_start":5,"highlight_end":20}],"label":"cannot assign twice to immutable variable","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-45199.rs","byte_start":1101,"byte_end":1102,"line_start":27,"line_end":27,"column_start":9,"column_end":10,"is_primary":false,"text":[{"text":"    let b = Box::new(1);    //[ast]~ NOTE first assignment","highlight_start":9,"highlight_end":10}],"label":"first assignment to `b`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0384]: cannot assign twice to immutable variable `b`\n  --> /checkout/src/test/ui/issues/issue-45199.rs:31:5\n   |\nLL |     let b = Box::new(1);    //[ast]~ NOTE first assignment\n   |         - first assignment to `b`\n...\nLL |     b = Box::new(2);        //[ast]~ ERROR cannot assign twice to immutable variable\n   |     ^^^^^^^^^^^^^^^ cannot assign twice to immutable variable\n\n"}
[00:58:30] {"message":"cannot assign twice to immutable variable `b`","code":{"code":"E0384","explanation":"\nThis error occurs when an attempt is made to reassign an immutable variable.\nFor example:\n\n```compile_fail,E0384\nfn main() {\n    let x = 3;\n    x = 5; // error, reassignment of immutable variable\n}\n```\n\nBy default, variables in Rust are immutable. To fix this error, add the keyword\n`mut` after the keyword `let` when declaring the variable. For example:\n\n```\nfn main() {\n    let mut x = 3;\n    x = 5;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-45199.rs","byte_start":766,"byte_end":781,"line_start":20,"line_end":20,"column_start":5,"column_end":20,"is_primary":true,"text":[{"text":"    b = Box::new(2);    //[ast]~ ERROR cannot assign twice to immutable variable","highlight_start":5,"highlight_end":20}],"label":"cannot assign twice to immutable variable","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-45199.rs","byte_start":655,"byte_end":670,"line_start":18,"line_end":18,"column_start":5,"column_end":20,"is_primary":false,"text":[{"text":"    b = Box::new(1);    //[ast]~ NOTE first assignment","highlight_start":5,"highlight_end":20}],"label":"first assignment to `b`","suggested_replacement":null,"suggestion_applicability":nullst assignment
[00:58:30] +    |              - help: make this binding mutable: `mut b`
[00:58:30] 6 ...
[00:58:30] - LL |     b = Box::new(1);    //[ast]~ NOTE first assignment
[00:58:30] -    |     - first assignment to `b`
[00:58:30] - LL |                         //[mir]~^ NOTE first assignment
[00:58:30] - LL |     b = Box::new(2);    //[ast]~ ERROR cannot assign twice to immutable variable
[00:58:30] -    |     ^ cannot assign twice to immutable variable
[00:58:30] + LL |     b = Box::new(2);            //[ast]~ ERROR cannot assign twice to immutable variable
[00:58:30] +    |     ^ cannot assign to immutable argument
[00:58:30] 12 
[00:58:30] 13 error[E0384]: cannot assign twice to immutable variable `b`
[00:58:30] 
[00:58:30] 
[00:58:30] 22 LL |     b = Box::new(2);        //[ast]~ ERROR cannot assign twice to immutable variable
[00:58:30] 23    |     ^ cannot assign twice to immutable variable
[00:58:30] 24 
[00:58:30] - error[E0384]: cannot assign to immutable argument `b`
[00:58:30] -   --> $DIR/issue-45199.rs:40:5
[00:58:30] + error[E0384]: cannot assign twice to immutable variable `b`
[00:58:30] +   --> $DIR/issue-45199.rs:20:5
[00:58:30] 27    |
[00:58:30] - LL | fn test_args(b: Box<i32>) {  //[ast]~ NOTE first assignment
[00:58:30] -    |              - help: make this binding mutable: `mut b`
[00:58:30] + LL |     let b: Box<isize>;
[00:58:30] +    |         - help: make this binding mutable: `mut b`
[00:58:30] 30 ...
[00:58:30] - LL |     b = Box::new(2);            //[ast]~ ERROR cannot assign twice to immutable variable
[00:58:30] -    |     ^ cannot assign to immutable argument
[00:58:30] + LL |     b = Box::new(1);    //[ast]~ NOTE first assignment
[00:58:30] +    |     - first assignment to `b`
[00:58:30] + LL |                         //[mir]~^ NOTE first assignment
[00:58:30] + LL |     b = Box::new(2);    //[ast]~ ERROR cannot assign twice to immutable variable
[00:58:30] +    |     ^ cannot assign twice to immutable variable
[00:58:30] 34 error: aborting due to 3 previous errors
[00:58:30] 35 
[00:58:30] 
[00:58:30] 
[00:58:30] 
[00:58:30] The actual stderr differed from the expected stderr.
[00:58:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-45199.mir/issue-45199.mir.stderr
[00:58:30] To update references, rerun the tests and pass the `--bless` flag
[00:58:30] To only update this specific test, also pass `--test-args issues/issue-45199.rs`
[00:58:30] 
[00:58:30] error in revision `mir`: 1 errors occurred comparing output.
[00:58:30] status: exit code: 1
[00:58:30] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-45199.rs" "--target=x86_64-unknown-linux-gnu" "--cfg" "mir" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-45199.mir/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-45199.mir/auxiliary" "-A" "unused"
[00:58:30] ------------------------------------------
[00:58:30] ------------------------------------------
[00:58:3. For example:\n\n```\nfn main() {\n    let mut x = 3;\n    x = 5;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-45199.rs","byte_start":655,"byte_end":656,"line_start":18,"line_end":18,"column_start":5,"column_end":6,"is_primary":false,"text":[{"text":"    b = Box::new(1);    //[ast]~ NOTE first assignment","highlight_start":5,"highlight_end":6}],"label":"first assignment to `b`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-45199.rs","byte_start":766,"byte_end":767,"line_start":20,"line_end":20,"column_start":5,"column_end":6,"is_primary":true,"text":[{"text":"    b = Box::new(2);    //[ast]~ ERROR cannot assign twice to immutable variable","highlight_start":5,"highlight_end":6}],"label":"cannot assign twice to immutable variable","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"make this binding mutable","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-45199.rs","byte_start":560,"byte_end":561,"line_start":15,"line_end":15,"column_start":9,"column_end":10,"is_primary":true,"text":[{"text":"    let b: Box<isize>;","highlight_start":9,"highlight_end":10}],"label":null,"suggested_replacement":"mut b","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0384]: cannot assign twice to immutable variable `b`\n  --> /checkout/src/test/ui/issues/issue-45199.rs:20:5\n   |\nLL |     let b: Box<isize>;\n   |         - help: make this binding mutable: `mut b`\n...\nLL |     b = Box::new(1);    //[ast]~ NOTE first assignment\n   |     - first assignment to `b`\nLL |                         //[mir]~^ NOTE first assignment\nLL |     b = Box::new(2);    //[ast]~ ERROR cannot assign twice to immutable variable\n   |     ^ cannot assign twice to immutable variable\n\n"}
[00:58:30] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[00:58:30] {"message":"For more information about this error, try `rustc --explain E0384`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0384`.\n"}
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] thread '[ui] ui/issues/issue-45199.rs#mir' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[00:58:30] 
[00:58:30] 
[00:58:30] ---- [ui] ui/issues/issue-45696-scribble-on-boxed-borrow.rs#nll stdout ----
[00:58:30] diff of stderr:
[00:58:30] 
[00:58:30] 1 error[E0713]: borrow may still be in use when destructor runs
[00:58:30] +   --> $DIR/issue-45696-scribble-on-boxed-borrow.rs:85:5
[00:58:30] 3    |
[00:58:30] 3    |
[00:58:30] - LL | fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 {
[00:58:30] -    |              -- lifetime `'a` defined here
[00:58:30] - LL |     &mut *s.0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]
[00:58:30] -    |     ^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a`
[00:58:30] + LL | fn boxed_boxesive access to its `&mut`-borrowed string data.  allowing\nanother borrow of that string data (`p`), to exist across the drop of\n`s` would be a violation of the principle that `&mut`-borrows have\nexclusive, unaliased access to their referenced data.\n\nThis error can be fixed by changing `demo` so that the destructor does\nnot run while the string-data is borrowed; for example by taking `S`\nby reference:\n\n```\n#![feature(nll)]\n\npub struct S<'a> { data: &'a mut String }\n\nimpl<'a> Drop for S<'a> {\n    fn drop(&mut self) { self.data.push_str(\"being dropped\"); }\n}\n\nfn demo<'a>(s: &'a mut S<'a>) -> &'a mut String { let p = &mut *(*s).data; p }\n```\n\nNote that this approach needs a reference to S with lifetime `'a`.\nNothing shorter than `'a` will suffice: a shorter lifetime would imply\nthat after `demo` finishes executing, something else (such as the\ndestructor!) could access `s.data` after the end of that shorter\nlifetime, which would again violate the `&mut`-borrow's exclusive\naccess.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs","byte_start":3382,"byte_end":3383,"line_start":78,"line_end":78,"column_start":1,"column_end":2,"is_primary":false,"text":[{"text":"}","highlight_start":1,"highlight_end":2}],"label":"here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-45696-scribble-on-boxed-borrow.rs","byte_start":2987,"byte_end":2989,"line_start":73,"line_end":7\n\nExample of erroneous code:\n\n```compile_fail,E0713\n#![feature(nll)]\n\npub struct S<'a> { data: &'a mut String }\n\nimpl<'a> Drop for S<'a> {\n    fn drop(&mut self) { self.data.push_str(\"being dropped\"); }\n}\n\nfn demo<'a>(s: S<'a>) -> &'a mut String { let p = &mut *s.data; p }\n```\n\nHere, `demo` tries to borrow the string data held within its\nargument `s` and then return that borrow. However, `S` is\ndeclared as implementing `Drop`.\n\nStructs implementing the `Drop` trait have an implicit destructor that\ngets called when they go out of scope. This destructor gets exclusive\naccess to the fields of the struct when it runs.\n\nThis means that when `s` reaches the end of `demo`, its destructor\ngets exclusive access to its `&mut`-borrowed string data.  allowing\nanother borrow of that string data (`p`), to exist across the drop of\n`s` would be a violation of the principle that `&mut`-borrows have\nexclusive, unaliased access to their referenced data.\n\nThis error can be fixed by changing `demo` so that the destructor does\nnot run while the string-data is borrowed; for example by taking `S`\nby reference:\n\n```\n#![feature(nll)]\n\npub struct S<'a> { data: &'a mut String }\n\nimpl<'a> Drop for S<'a> {\n    fn drop(&mut self) { self.data.push_str(\"being dropped\"); }\n}\n\nfn demo<'a>(s: &'a mut S<'a>) -> &'a mut String { let p = &mut *(*s).data; p }\n```\n\nNote that this approach needs a reference to S with lifetime `'a`.\nNothing shorter than `'a` will suffice: a shorter lifetime would imply\nthat after `demo` finishes executing, something else (such as the\ndestructor!) could access `s.data` after the end boxed-borrow.rs:63:5\n   |\nLL | fn scribbled<'a>(s: Scribble<'a>) -> &'a mut u32 {\n   |              -- lifetime `'a` defined here\nLL |     &mut *s.0 //[nll]~ ERROR borrow may still be in use when destructor runs [E0713]\n   |     ^^^^^^^^^ returning this value requires that `*s.0` is borrowed for `'a`\n...\nLL | }\n   | - here, drop of `s` needs exclusive access to `*s.0`, because the type `Scribble<'_>` implements the `Drop` trait\n\n"}
[00:58:30] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[00:58:30] {"message":"For more information about this error, try `rustc --explain E0713`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0713`.\n"}
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] thread '[ui] ui/issues/issue-45696-scribble-on-boxed-borrow.rs#nll' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[00:58:30] 
[00:58:30] 
[00:58:30] ---- [ui] ui/issues/issue-46604.rs#mir stdout ----
[00:58:30] diff of stderr:
[00:58:30] 
[00:58:30] - error[E0017]: references in statics may only refer to immutable values
[00:58:30] -    |
[00:58:30] -    |
[00:58:30] - LL | static buf: &mut [u8] = &mut [1u8,2,3,4,5,7];   //[ast]~ ERROR E0017
[00:58:30] -    |                         ^^^^^^^^^^^^^^^^^^^^ statics require immutable values
[00:58:30] - 
[00:58:30] 7 error[E0594]: cannot assign to `buf[..]`, as `buf` is an immutable static item
[00:58:30] 9    |
[00:58:30] 
[00:58:30] 
[00:58:30] 10 LL |     buf[0]=2;                                   //[ast]~ ERROR E0389
[00:58:30] + 
[00:58:30] + 
[00:58:30] + error[E0017]: references in statics may only refer to immutable values
[00:58:30] +   --> $DIR/issue-46604.rs:14:25
[00:58:30] +    |
[00:58:30] + LL | static buf: &mut [u8] = &mut [1u8,2,3,4,5,7];   //[ast]~ ERROR E0017
[00:58:30] +    |                         ^^^^^^^^^^^^^^^^^^^^ statics require immutable values
[00:58:30] 13 error: aborting due to 2 previous errors
[00:58:30] 14 
[00:58:30] 
[00:58:30] 
[00:58:30] 
[00:58:30] The actual stderr differed from the expected stderr.
[00:58:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-46604.mir/issue-46604.mir.stderr
[00:58:30] To update references, rerun the tests and pass the `--bless` flag
[00:58:30] To only update this specific test, also pass `--test-args issues/issue-46604.rs`
[00:58:30] 
[00:58:30] error in revision `mir`: 1 errors occurred comparing output.
[00:58:30] status: exit code: 1
[00:58:30] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-46604.rs" "--target=x86_64-unknown-linux-gnu" "--cfg" "mir" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-46604.mir/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Z" "borrowck=mir" "-L" "/checkout/obj/build/x86_64-unknownviolate memory safety since holding multiple mutable references to shared data\nis not allowed.\n\nIf you really want global mutable state, try using `static mut` or a global\n`UnsafeCell`.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-46604.rs","byte_start":552,"byte_end":572,"line_start":14,"line_end":14,"column_start":25,"column_end":45,"is_primary":true,"text":[{"text":"static buf: &mut [u8] = &mut [1u8,2,3,4,5,7];   //[ast]~ ERROR E0017","highlight_start":25,"highlight_end":45}],"label":"statics require immutable values","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0017]: references in statics may only refer to immutable values\n  --> /checkout/src/test/ui/issues/issue-46604.rs:14:25\n   |\nLL | static buf: &mut [u8] = &mut [1u8,2,3,4,5,7];   //[ast]~ ERROR E0017\n   |                         ^^^^^^^^^^^^^^^^^^^^ statics require immutable values\n\n"}
[00:58:30] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[00:58:30] {"message":"Some errors occurred: E0017, E0594.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0017, E0594.\n"}
[00:58:30] {"message":"For more information about an error, try `rustc --explain E0017`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about an error, try `rustc --explain E0017`.\n"}
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] thread '[ui] ui/issues/issue-46604.rs#mir' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3255:9
[00:58:30] 
[00:58:30] 
[00:58:30] ---- [ui] ui/issues/issue-47706.rs stdout ----
[00:58:30] diff of stderr:
[00:58:30] 
[00:58:30] - error[E0593]: function is expected to take 1 argument, but it takes 2 arguments
[00:58:30] -    |
[00:58:30] -    |
[00:58:30] - LL |     pub fn new(foo: Option<i32>, _: ()) -> Foo {
[00:58:30] -    |     ------------------------------------------ takes 2 arguments
[00:58:30] - ...
[00:58:30] - LL |         self.foo.map(Foo::new)
[00:58:30] -    |                  ^^^ expected function that takes 1 argument
[00:58:30] - 
[00:58:30] 10 error[E0593]: function is expected to take 0 arguments, but it takes 1 argument
[00:58:30] 12    |
[00:58:30] 
[00:58:30] 
[00:58:30] 25 LL | | {
[00:58:30] 26 LL | | }
[00:58:30] + 
[00:58:30] + 
[00:58:30] + error[E0593]: function is expected to take 1 argument, but it takes 2 arguments
[00:58:30] +   --> $DIR/issue-47706.rs:21:18
[00:58:30] +    |
[00:58:30] + LL |     pub fn new(foo: Option<i32>, _: ()) -> Foo {
[00:58:30] +    |     ------------------------------------------ takes 2 arguments
[00:58:30] + ...
[00:58:30] + LL |         self.foo.map(Foo::new)
[00:58:30] +    |                  ^^^ expected function that takes 1 argument
[00:58:30] 29 error: aborting due to 2 previous errors
[00:58:30] 30 
[00:58:30] 
[00:58:30] 
[00:58:30] 
[00:58:30] The actual stderr differed from the expected stderr.
[00:58:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/uiumn_end":8,"is_primary":true,"text":[{"text":"    foo(Qux::Bar);","highlight_start":5,"highlight_end":8}],"label":"expected function that takes 0 arguments","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-47706.rs","byte_start":779,"byte_end":787,"line_start":27,"line_end":27,"column_start":5,"column_end":13,"is_primary":false,"text":[{"text":"    Bar(i32),","highlight_start":5,"highlight_end":13}],"label":"takes 1 argument","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"required by `foo`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-47706.rs","byte_start":792,"byte_end":830,"line_start":30,"line_end":34,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn foo<F>(f: F)","highlight_start":1,"highlight_end":16},{"text":"where","highlight_start":1,"highlight_end":6},{"text":"    F: Fn(),","highlight_start":1,"highlight_end":13},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0593]: function is expected to take 0 arguments, but it takes 1 argument\n  --> /checkout/src/test/ui/issues/issue-47706.rs:37:5\n   |\nLL |     Bar(i32),\n   |     -------- takes 1 argument\n...\nLL |     foo(Qux::Bar);\n   |     ^^^ expected function that takes 0 arguments\n   |\nnote: required by `foo`\n  --> /checkout/src/test/ui/issues/issue-47706.rs:30:1\n   |\nLL | / fn foo<F>(f: F)\nLL | | where\nLL | |     F: Fn(),\nLL | | {\nLL | | }\n   | |_^\n\n"}
[00:58:30] {"message":"function is expected to take 1 argument, but it takes 2 arguments","code":{"code":"E0593","explanation":"\nYou tried to supply an `Fn`-based type with an incorrect number of arguments\nthan what was expected.\n\nErroneous code example:\n\n```compile_fail,E0593\nfn foo<F: Fn()>(x: F) { }\n\nfn main() {\n    // [E0593] closure takes 1 argument but 0 arguments are required\n    foo(|y| { });\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-47706.rs","byte_start":651,"byte_end":654,"line_start":21,"line_end":21,"column_start":18,"column_end":21,"is_primary":true,"text":[{"text":"        self.foo.map(Foo::new)","highlight_start":18,"highlight_end":21}],"label":"expected function that takes 1 argument","suggested_replacement":null,"suggestion_applicability":null,"expansion":null},{"file_name":"/checkout/src/test/ui/issues/issue-47706.rs","byte_start":524,"byte_end":566,"line_start":16,"line_end":16,"column_start":5,"column_end":47,"is_primary":false,"text":[{"text":"    pub fn new(foo: Option<i32>, _: ()) -> Foo {","highlight_start":5,"highlight_end":47}],"label":"takes 2 arguments","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0593]: function is expected to take 1 argument, but it takes 2 arguments\n  --> /checkout/src/test/ui/issues/issue-47706.rs:21:18\n   |\nLL |     pub fn new(foo: Option<i32>, _: ()) -> Foo {\n   |     ------------------------------------------ takes 2 arguments\n...\nLL |         self.foo.map(Fo"error[E0572]: return statement outside of function body\n  --> /checkout/src/test/ui/issues/issue-51714.rs:12:14\n   |\nLL |     |_:  [_; return || {}] | {};\n   |              ^^^^^^^^^^^^\n\n"}
[00:58:30] {"message":"return statement outside of function body","code":{"code":"E0572","explanation":"\nA return statement was found outside of a function body.\n\nErroneous code example:\n\n```compile_fail,E0572\nconst FOO: u32 = return 0; // error: return statement outside of function body\n\nfn main() {}\n```\n\nTo fix this issue, just remove the return keyword or move the expression into a\nfunction. Example:\n\n```\nconst FOO: u32 = 0;\n\nfn some_fn() -> u32 {\n    return FOO;\n}\n\nfn main() {\n    some_fn();\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-51714.rs","byte_start":661,"byte_end":676,"line_start":18,"line_end":18,"column_start":10,"column_end":25,"is_primary":true,"text":[{"text":"    [(); return |ice| {}];","highlight_start":10,"highlight_end":25}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0572]: return statement outside of function body\n  --> /checkout/src/test/ui/issues/issue-51714.rs:18:10\n   |\nLL |     [(); return |ice| {}];\n   |          ^^^^^^^^^^^^^^^\n\n"}
[00:58:30] {"message":"return statement outside of function body","code":{"code":"E0572","explanation":"\nA return statement was found outside of a function body.\n\nErroneous code example:\n\n```compile_fail,E0572\nconst FOO: u32 = return 0; // error: return statement outside of function body\n\nfn main() {}\n```\n\nTo fix this issue, just remove the return keyword or move the expression into a\nfunction. Example:\n\n```\nconst FOO: u32 = 0;\n\nfn some_fn() -> u32 {\n    return FOO;\n}\n\nfn main() {\n    some_fn();\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-51714.rs","byte_start":746,"byte_end":783,"line_start":21,"line_end":21,"column_start":10,"column_end":47,"is_primary":true,"text":[{"text":"    [(); return while let Some(n) = Some(0) {}];","highlight_start":10,"highlight_end":47}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0572]: return statement outside of function body\n  --> /checkout/src/test/ui/issues/issue-51714.rs:21:10\n   |\nLL |     [(); return while let Some(n) = Some(0) {}];\n   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:58:30] {"message":"irrefutable while-let pattern","code":{"code":"E0165","explanation":"\nA while-let pattern attempts to match the pattern, and enters the body if the\nmatch was successful. If the match is irrefutable (when it cannot fail to\nmatch), use a regular `let`-binding inside a `loop` instead. For instance:\n\n```compile_fail,E0165\nstruct Irrefutable(i32);\nlet irr = Irrefutable(0);\n\n// This fails to compile because the match is irrefutable.\nwhile let Irrefutable(x) = irr {\n    // ...\n}\n```\n\nTry this instead:\n\n```no_run\nstruct Irrefutable(i32);\nlet irr = Irrefutable(0);\n\nloop {\n    let Irrefutable(x) = irr;\n    // ...\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-51714.rs","byte_start":763,"byte_end":770ut/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-54302-cases.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-54302-cases/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-54302-cases/auxiliary" "-A" "unused"
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] ------------------------------------------
[00:58:30] stderr:
[00:58:30] stderr:
[00:58:30] ------------------------------------------
[00:58:30] {"message":"type mismatch resolving `for<'a> <&'a u64 as Mirror>::Image == &u64`","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//     vel":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-54302-cases.rs","byte_start":1959,"byte_end":1988,"line_start":85,"line_end":85,"column_start":5,"column_end":34,"is_primary":true,"text":[{"text":"    <u64 as RefFoo<u64>>::ref_foo(a)","highlight_start":5,"highlight_end":34}],"label":"expected bound lifetime parameter 'a, found concrete lifetime","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"required because of the requirements on the impl of `for<'a> Foo2<'_, u64>` for `&'a u64`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required because of the requirements on the impl of `for<'a> Foo<'static, u64>` for `&'a u64`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required because of the requirements on the impl of `RefFoo<u64>` for `u64`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by `RefFoo::ref_foo`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-54302-cases.rs","byte_start":1423,"byte_end":1455,"line_start":61,"line_end":61,"column_start":5,"column_end":37,"is_primary":true,"text":[{"text":"    fn ref_foo(&self) -> &'static T;","highlight_start":5,"highlight_end":37}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0271]: type mismatch resolving `for<'a> <&'a u64 as Mirror>::Image == &u64`\n  --> /checkout/src/test/ui/issues/issue-54302-cases.rs:85:5\n   |\nLL |     <u64 as RefFoo<u64>>::ref_foo(a)\n   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'a, found concrete lifetime\n   |\n   = note: required because of the requirements on the impl of `for<'a> Foo2<'_, u64>` for `&'a u64`\n   = note: required because of the requirements on the impl of `for<'a> Foo<'static, u64>` for `&'a u64`\n   = note: required because of the requirements on the impl of `RefFoo<u64>` for `u64`\nnote: required by `RefFoo::ref_foo`\n  --> /checkout/src/test/ui/issues/issue-54302-cases.rs:61:5\n   |\nLL |     fn ref_foo(&self) -> &'static T;\n   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:58:30] {"message":"type mismatch resolving `for<'a> <&'a i64 as Mirror>::Image == &i64`","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//         impl91,"line_end":91,"column_start":5,"column_end":34,"is_primary":true,"text":[{"text":"    <i64 as RefFoo<i64>>::ref_foo(a)","highlight_start":5,"highlight_end":34}],"label":"expected bound lifetime parameter 'a, found concrete lifetime","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"required because of the requirements on the impl of `for<'a> Foo2<'_, i64>` for `&'a i64`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required because of the requirements on the impl of `for<'a> Foo<'static, i64>` for `&'a i64`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required because of the requirements on the impl of `RefFoo<i64>` for `i64`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by `RefFoo::ref_foo`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-54302-cases.rs","byte_start":1423,"byte_end":1455,"line_start":61,"line_end":61,"column_start":5,"column_end":37,"is_primary":true,"text":[{"text":"    fn ref_foo(&self) -> &'static T;","highlight_start":5,"highlight_end":37}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0271]: type mismatch resolving `for<'a> <&'a i64 as Mirror>::Image == &i64`\n  --> /checkout/src/test/ui/issues/issue-54302-cases.rs:91:5\n   |\nLL |     <i64 as RefFoo<i64>>::ref_foo(a)\n   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'a, found concrete lifetime\n   |\n   = note: required because of the requirements on the impl of `for<'a> Foo2<'_, i64>` for `&'a i64`\n   = note: required because of the requirements on the impl of `for<'a> Foo<'static, i64>` for `&'a i64`\n   = note: required because of the requirements on the impl of `RefFoo<i64>` for `i64`\nnote: required by `RefFoo::ref_foo`\n  --> /checkout/src/test/ui/issues/issue-54302-cases.rs:61:5\n   |\nLL |     fn ref_foo(&self) -> &'static T;\n   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:58:30] {"message":"the trait bound `for<'a> &'a u32: Foo2<'_, u32>` 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 likll}],"children":[{"message":"the following implementations were found:\n  <&'x u32 as Foo2<'x, u32>>","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because of the requirements on the impl of `for<'a> Foo<'static, u32>` for `&'a u32`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required because of the requirements on the impl of `RefFoo<u32>` for `u32`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by `RefFoo::ref_foo`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-54302-cases.rs","byte_start":1423,"byte_end":1455,"line_start":61,"line_end":61,"column_start":5,"column_end":37,"is_primary":true,"text":[{"text":"    fn ref_foo(&self) -> &'static T;","highlight_start":5,"highlight_end":37}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `for<'a> &'a u32: Foo2<'_, u32>` is not satisfied\n  --> /checkout/src/test/ui/issues/issue-54302-cases.rs:73:5\n   |\nLL |     <u32 as RefFoo<u32>>::ref_foo(a)\n   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Foo2<'_, u32>` is not implemented for `&'a u32`\n   |\n   = help: the following implementations were found:\n             <&'x u32 as Foo2<'x, u32>>\n   = note: required because of the requirements on the impl of `for<'a> Foo<'static, u32>` for `&'a u32`\n   = note: required because of the requirements on the impl of `RefFoo<u32>` for `u32`\nnote: required by `RefFoo::ref_foo`\n  --> /checkout/src/test/ui/issues/issue-54302-cases.rs:61:5\n   |\nLL |     fn ref_foo(&self) -> &'static T;\n   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:58:30] {"message":"the requirement `for<'a> 'a : ` is not satisfied (`expected bound lifetime parameter 'a, found concrete lifetime`)","code":{"code":"E0279","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-54302-cases.rs","byte_start":1808,"byte_end":1837,"line_start":79,"line_end":79,"column_start":5,"column_end":34,"is_primary":true,"text":[{"text":"    <i32 as RefFoo<i32>>::ref_foo(a)","highlight_start":5,"highlight_end":34}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"required because of the requirements on the impl of `for<'a> Foo2<'_, i32>` for `&'a i32`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required because of the requirements on the impl of `for<'a> Foo<'static, i32>` for `&'a i32`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required because of the requirements on the impl of `RefFoo<i32>` for `i32`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by `RefFoo::ref_foo`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-54302-cases.rs","byte_start":1423,"byte_end":1455,"line_start":61,"line_end":61,"column_start":5,"column_end":37,"is_primary":true,"text":[{"text":"    fn ref_foo(&self) -> &'static T;","highlight_start":5,"highlight_end":37}],"label":null,"suggested_replacement":null,"suggestion_applicability":etime bounds
[00:58:30] +   --> $DIR/issue-55796.rs:16:9
[00:58:30] 39    |
[00:58:30] - LL |         Box::new(self.in_edges(u).map(|e| e.target()))
[00:58:30] -    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:58:30] + LL |         Box::new(self.out_edges(u).map(|e| e.target()))
[00:58:30] +    |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[00:58:30] 42    = note: but, the lifetime must be valid for the static lifetime...
[00:58:30] 43    = note: ...so that the expression is assignable:
[00:58:30] 44            expected std::boxed::Box<(dyn std::iter::Iterator<Item=<Self as Graph<'a>>::Node> + 'static)>
[00:58:30] 
[00:58:30] The actual stderr differed from the expected stderr.
[00:58:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-55796/issue-55796.stderr
[00:58:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-55796/issue-55796.stderr
[00:58:30] To update references, rerun the tests and pass the `--bless` flag
[00:58:30] To only update this specific test, also pass `--test-args issues/issue-55796.rs`
[00:58:30] error: 1 errors occurred comparing output.
[00:58:30] status: exit code: 1
[00:58:30] status: exit code: 1
[00:58:30] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-55796.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-55796/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-55796/auxiliary" "-A" "unused"
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] ------------------------------------------
[00:58:30] stderr:
[00:58:30] stderr:
[00:58:30] ------------------------------------------
[00:58:30] {"message":"`main` function not found in crate `issue_55796`","code":{"code":"E0601","explanation":"\nNo `main` function was found in a binary crate. To fix this error, add a\n`main` function. For example:\n\n```\nfn main() {\n    // Your program will start here.\n    println!(\"Hello world!\");\n}\n```\n\nIf you don't know the basics of Rust, you can go look to the Rust Book to get\nstarted: https://doc.rust-lang.org/book/\n"},"level":"error","spans":[],"children":[{"message":"consider adding a `main` function to `/checkout/src/test/ui/issues/issue-55796.rs`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0601]: `main` function not found in crate `issue_55796`\n   |\n   = note: consider adding a `main` function to `/checkout/src/test/ui/issues/issue-55796.rs`\n\n"}
[00:58:30] {"message":"cannot infer an appropriate lifetime due to conflicting requirements","code":{"code":"E0495","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-55796.rs","byte_start":672,"byte_end":718,"line_start":21,"line_end":21,"column_start":9,"column_end":55,"is_primary":true,"text":[{"text":"        Box::new(self.in_edges(u).map(|e| e.target()))","highlight_start":9,"highlight_end":55}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"first, the lifetime cannot:58:30] +    = note: did you mean to use one of the enum's variants?
[00:58:30] 22 
[00:58:30] 23 error: the `Self` constructor can only be used with tuple or unit structs
[00:58:30] +   --> $DIR/issue-56199.rs:9:17
[00:58:30] 25    |
[00:58:30] 25    |
[00:58:30] 26 LL |         let _ = Self();
[00:58:30] -    |                 ^^^^ did you mean `Self { /* fields */ }`?
[00:58:30] +    |
[00:58:30] +    |
[00:58:30] +    = note: did you mean to use one of the enum's variants?
[00:58:30] 29 error: aborting due to 4 previous errors
[00:58:30] 30 
[00:58:30] 
[00:58:30] 
[00:58:30] 
[00:58:30] The actual stderr differed from the expected stderr.
[00:58:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-56199/issue-56199.stderr
[00:58:30] To update references, rerun the tests and pass the `--bless` flag
[00:58:30] To only update this specific test, also pass `--test-args issues/issue-56199.rs`
[00:58:30] error: 1 errors occurred comparing output.
[00:58:30] status: exit code: 1
[00:58:30] status: exit code: 1
[00:58:30] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-56199.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-56199/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-56199/auxiliary" "-A" "unused"
[00:58:7\n   |\nLL |         let _ = Self();\n   |                 ^^^^ did you mean `Self { /* fields */ }`?\n\n"}
[00:58:30] {"message":"the `Self` constructor can only be used with tuple or unit structs","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-56199.rs","byte_start":70,"byte_end":74,"line_start":7,"line_end":7,"column_start":17,"column_end":21,"is_primary":true,"text":[{"text":"        let _ = Self;","highlight_start":17,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"did you mean to use one of the enum's variants?","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error: the `Self` constructor can only be used with tuple or unit structs\n  --> /checkout/src/test/ui/issues/issue-56199.rs:7:17\n   |\nLL |         let _ = Self;\n   |                 ^^^^\n   |\n   = note: did you mean to use one of the enum's variants?\n\n"}
[00:58:30] {"message":"the `Self` constructor can only be used with tuple or unit structs","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-56199.rs","byte_start":178,"byte_end":182,"line_start":9,"line_end":9,"column_start":17,"column_end":21,"is_primary":true,"text":[{"text":"        let _ = Self();","highlight_start":17,"highlight_end":21}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"did you mean to use one of the enum's variants?","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error: the `Self` cond `foo3::Foo: std::marker::Copy` is not satisfied
[00:58:30] +   --> $DIR/kindck-impl-type-params.rs:56:33
[00:58:30] 45    |
[00:58:30] - LL |     let a = &t as &Gettable<&'a isize>;
[00:58:30] -    |             ^^
[00:58:30] + LL |     let a: Box<Gettable<Foo>> = t;
[00:58:30] +    |                                 ^ the trait `std::marker::Copy` is not implemented for `foo3::Foo`
[00:58:30] -    = note: type must satisfy the static lifetime
[00:58:30] -    = note: type must satisfy the static lifetime
[00:58:30] +    = note: required because of the requirements on the impl of `Gettable<foo3::Foo>` for `S<foo3::Foo>`
[00:58:30] +    = note: required for the cast to the object type `dyn Gettable<foo3::Foo>`
[00:58:30] 51 error[E0277]: the trait bound `std::string::String: std::marker::Copy` is not satisfied
[00:58:30] 52   --> $DIR/kindck-impl-type-params.rs:48:13
[00:58:30] 
[00:58:30] 56    |
[00:58:30] 56    |
[00:58:30] 57    = note: required because of the requirements on the impl of `Gettable<std::string::String>` for `S<std::string::String>`
[00:58:30] 58    = note: required for the cast to the object type `dyn Gettable<std::string::String>`
[00:58:30] - 
[00:58:30] - error[E0277]: the trait bound `foo3::Foo: std::marker::Copy` is not satisfied
[00:58:30] -   --> $DIR/kindck-impl-type-params.rs:56:33
[00:58:30] -    |
[00:58:30] - LL |     let a: Box<Gettable<Foo>> = t;
[00:58:30] -    |                                 ^ the trait `std::marker::Copy` is not implemented for `foo3::Foo`
[00:58:30] -    |
[00:58:30] -    = note: required because of the requirements on the impl of `Gettable<foo3::Foo>` for `S<foo3::Foo>`
[00:58:30] -    = note: required for the cast to the object type `dyn Gettable<foo3::Foo>`
[00:58:30] 69 error: aborting due to 7 previous errors
[00:58:30] 70 
[00:58:30] 
[00:58:30] 
[00:58:30] 
[00:58:30] The actual stderr differed from the expected stderr.
[00:58:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/kindck/kindck-impl-type-params/kindck-impl-type-params.stderr
[00:58:30] To update references, rerun the tests and pass the `--bless` flag
[00:58:30] To only update this specific test, also pass `--test-args kindck/kindck-impl-type-params.rs`
[00:58:30] error: 1 errors occurred comparing output.
[00:58:30] status: exit code: 1
[00:58:30] status: exit code: 1
[00:58:30] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/kindck/kindck-impl-type-params.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/kindck/kindck-impl-type-params/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/kindck/kindck-impl-type-params/auxiliary" "-A" "unused"
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] ------------------------------------------
[00:58:30] stderr:
[00:58:30] stderr:
[00:58:30] ------------------------------------------
[00:58:30] {"message":"the type `&'a isize` does not fulfill the required lifetime","code":{"code":"E0477","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/his 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/kindck/kindck-impl-type-params.rs","byte_start":845,"byte_end":847,"line_start":28,"line_end":28,"column_start":13,"column_end":15,"is_primary":true,"text":[{"text":"    let a = &t as &Gettable<T>;","highlight_start":13,"highlight_end":15}],"label":"`T` cannot be sent between threads safely","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the trait `std::marker::Send` is not implemented for `T`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"consider adding a `where T: std::marker::Send` bound","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because of the requirements on the impl of `Gettable<T>` for `S<T>`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required for the cast to the object type `dyn Gettable<T>`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: `T` cannot be sent between threads safely\n  --> /checkout/src/test/ui/kindck/kindck-impl-type-params.rs:28:13\n   |\nLL |     let a = &t as &Gettable<T>;\n   |             ^^ `T` cannot be sent between threads safely\n   |\n   = help: the trait `std::marker::Send` is not implemented for `T`\n   = help: consider adding a `where T: std::marker::Send` bound\n   = note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`\n   = note: required for the cast to the object type `dyn Gettable<T>`\n\n"}
[00:58:30] {"message":"the trait bound `T: 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_t 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/kindck/kindck-impl-type-params.rs","byte_start":845,"byte_end":847,"line_start":28,"line_end":28,"column_start":13,"column_end":15,"is_primary":true,"text":[{"text":"    let a = &t as &Gettable<T>;","highlight_start":13,"highlight_end":15}],"label":"the trait `std::marker::Copy` is not implemented for `T`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider adding a `where T: std::marker::Copy` bound","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because of the requirements on the impl of `Gettable<T>` for `S<T>`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required for the cast to the object type `dyn Gettable<T>`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied\n  --> /checkout/src/test/ui/kindck/kindck-impl-type-params.rs:28:13\n   |\nLL |     let a = &t as &Gettable<T>;\n   |             ^^ the trait `std::marker::Copy` is not implemented for `T`\n   |\n   = help: consider adding a `where T: std::marker::Copy` bound\n   = note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`\n   = note: required for the cast to the object type `dyn Gettable<T>`\n\n"}
[00:58:30] {"message":"`T` cannot be sent between threads safely","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    //-impl-type-params.rs","byte_start":1064,"byte_end":1066,"line_start":35,"line_end":35,"column_start":27,"column_end":29,"is_primary":true,"text":[{"text":"    let a: &Gettable<T> = &t;","highlight_start":27,"highlight_end":29}],"label":"the trait `std::marker::Copy` is not implemented for `T`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider adding a `where T: std::marker::Copy` bound","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because of the requirements on the impl of `Gettable<T>` for `S<T>`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required for the cast to the object type `dyn Gettable<T>`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `T: std::marker::Copy` is not satisfied\n  --> /checkout/src/test/ui/kindck/kindck-impl-type-params.rs:35:27\n   |\nLL |     let a: &Gettable<T> = &t;\n   |                           ^^ the trait `std::marker::Copy` is not implemented for `T`\n   |\n   = help: consider adding a `where T: std::marker::Copy` bound\n   = note: required because of the requirements on the impl of `Gettable<T>` for `S<T>`\n   = note: required for the cast to the object type `dyn Gettable<T>`\n\n"}
[00:58:30] {"message":"the trait bound `foo3::Foo: 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 traibug>(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/kindck/kindck-impl-type-params.rs","byte_start":1629,"byte_end":1630,"line_start":56,"line_end":56,"column_start":33,"column_end":34,"is_primary":true,"text":[{"text":"    let a: Box<Gettable<Foo>> = t;","highlight_start":33,"highlight_end":34}],"label":"the trait `std::marker::Copy` is not implemented for `foo3::Foo`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"required because of the requirements on the impl of `Gettable<foo3::Foo>` for `S<foo3::Foo>`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required for the cast to the object type `dyn Gettable<foo3::Foo>`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0277]: the trait bound `foo3::Foo: std::marker::Copy` is not satisfied\n  --> /checkout/src/test/ui/kindck/kindck-impl-type-params.rs:56:33\n   |\nLL |     let a: Box<Gettable<Foo>> = t;\n   |                                 ^ the trait `std::marker::Copy` is not implemented for `foo3::Foo`\n   |\n   = note: required because of the requirements on the impl of `Gettable<foo3::Foo>` for `S<foo3::Foo>`\n   = noteinition 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/kindck/kindck-impl-type-params.rs","byte_start":1405,"byte_end":1406,"line_start":48,"line_end":48,"column_start":13,"column_end":14,"is_primary":true,"text":[{"text":"    let a = t as Box<Gettable<String>>;","highlight_start":13,"highlight_end":14}],"label":"the trait `std::marker::Copy` is not implemented for `std::string::String`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"required because of the requirements on the impl of `Gettable<std::string::String>` for `S<std::string::String>`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required for the cast to the object type `dyn Gettable<std::string::String>`","code":null,"level":"note","spans":[],"children":[],"rendered":n |     take_param(&x); //~ ERROR E0277
[00:58:30] -    |     ^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<{integer}>`
[00:58:30] -    |
[00:58:30] -    = note: required because of the requirements on the impl of `Foo` for `std::boxed::Box<{integer}>`
[00:58:30] - note: required by `take_param`
[00:58:30] -   --> $DIR/kindck-inherited-copy-bound.rs:24:1
[00:58:30] -    |
[00:58:30] - LL | fn take_param<T:Foo>(foo: &T) { }
[00:58:30] - 
[00:58:30] - 
[00:58:30] 14 error[E0038]: the trait `Foo` cannot be made into an object
[00:58:30] 15   --> $DIR/kindck-inherited-copy-bound.rs:34:19
[00:58:30] 
[00:58:30] 27    |
[00:58:30] 27    |
[00:58:30] 28    = note: the trait cannot require that `Self : Sized`
[00:58:30] 29    = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<&dyn Foo>` for `&std::boxed::Box<{integer}>`
[00:58:30] + 
[00:58:30] + error[E0277]: the trait bound `std::boxed::Box<{integer}>: std::marker::Copy` is not satisfied
[00:58:30] +   --> $DIR/kindck-inherited-copy-bound.rs:28:5
[00:58:30] +    |
[00:58:30] + LL |     take_param(&x); //~ ERROR E0277
[00:58:30] +    |     ^^^^^^^^^^ the trait `std::marker::Copy` is not implemented for `std::boxed::Box<{integer}>`
[00:58:30] +    |
[00:58:30] +    = note: required because of the requirements on the impl of `Foo` for `std::boxed::Box<{integer}>`
[00:58:30] + note: required by `take_param`
[00:58:30] +   --> $DIR/kindck-inherited-copy-bound.rs:24:1
[00:58:30] +    |
[00:58:30] + LL | fn take_param<T:Foo>(foo: &T) { }
[00:58:30] 30 
[00:58:30] 31 error: aborting due to 3 previous errors
[00:58:30] 32 
[00:58:30] 
[00:58:30] 
[00:58:30] 
[00:58:30] The actual stderr differed from the expected stderr.
[00:58:30] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/kindck/kindck-inherited-copy-bound/kindck-inherited-copy-bound.stderr
[00:58:30] To update references, rerun the tests and pass the `--bless` flag
[00:58:30] To only update this specific test, also pass `--test-args kindck/kindck-inherited-copy-bound.rs`
[00:58:30] error: 1 errors occurred comparing output.
[00:58:30] status: exit code: 1
[00:58:30] status: exit code: 1
[00:58:30] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/kindck/kindck-inherited-copy-bound.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/kindck/kindck-inherited-copy-bound/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/kindck/kindck-inherited-copy-bound/auxiliary" "-A" "unused"
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] ------------------------------------------
[00:58:30] stderr:
[00:58:30] stderr:
[00:58:30] ------------------------------------------
[00:58:30] {"message":"the trait `Foo` cannot be made into an object","code":{"code":"E0038","explanation":"\nTrait objects like `Box<Trait>` can only be constructed when certain\nrequirements are satisfied  }\n}\n```\n\n(Note that `&self` and `&mut self` are okay, it's additional `Self` types which\ncause this problem.)\n\nIn such a case, the compiler cannot predict the return type of `foo()` in a\nsituation like the following:\n\n```compile_fail\ntrait Trait {\n    fn foo(&self) -> Self;\n}\n\nfn call_foo(x: Box<Trait>) {\n    let y = x.foo(); // What type is y?\n    // ...\n}\n```\n\nIf only some methods aren't object-safe, you can add a `where Self: Sized` bound\non them to mark them as explicitly unavailable to trait objects. The\nfunctionality will still be available to all other implementers, including\n`Box<Trait>` which is itself sized (assuming you `impl Trait for Box<Trait>`).\n\n```\ntrait Trait {\n    fn foo(&self) -> Self where Self: Sized;\n    // more functions\n}\n```\n\nNow, `foo()` can no longer be called on a trait object, but you will now be\nallowed to make a trait object, and that will be able to call any object-safe\nmethods. With such a bound, one can still call `foo()` on types implementing\nthat trait that aren't behind trait objects.\n\n### Method has generic type parameters\n\nAs mentioned before, trait objects contain pointers to method tables. So, if we\nhave:\n\n```\ntrait Trait {\n    fn foo(&self);\n}\n\nimpl Trait for String {\n    fn foo(&self) {\n        // implementation 1\n    }\n}\n\nimpl Trait for u8 {\n    fn foo(&self) {\n        // implementation 2\n    }\n}\n// ...\n```\n\nAt compile time each implementation of `Trait` will produce a table containing\nthe various methods (and other items) related to the implementation.\n\nThis works fine, but when the method gains generic parameters, we can have a\nproblem.\n\nUsually, generic parameters get _monomorphized_. For example, if I have\n\n```\nfn foo<T>(x: T) {\n    // ...\n}\n```\n\nThe machine code for `foo::<u8>()`, `foo::<bool>()`, `foo::<String>()`, or any\nother type substitution is different. Hence the compiler generates the\nimplementation on-demand. If you call `foo()` with a `bool` parameter, the\ncompiler will only generate code for `foo::<bool>()`. When we have additional\ntype parameters, the number of monomorphized implementations the compiler\ngenerates does not grow drastically, since the compiler will only generate an\nimplementation if the function is called with unparametrized substitutions\n(i.e., substitutions where none of the substituted types are themselves\nparametrized).\n\nHowever, with trait objects we have to make a table containing _every_ object\nthat implements the trait. Now, if it has type parameters, we need to add\nimplementations for every type that implements the trait, and there could\ntheoretically be an infinite number of types.\n\nFor example, with:\n\n```\ntrait Trait {\n    fn foo<T>(&self, on: T);\n    // more methods\n}\n\nimpl Trait for String {\n    fn foo<T>(&self, on: T) {\n        // implementation 1\n    }\n}\n\nimpl Trait for u8 {\n    fn foo<T>(&self, on: T) {\n        // implementation 2\n    }\n}\n\n// 8 more implementations\n```\n\nNow, if we have the following code:\n\n```compile_fail,E0038\n# trait Trait { fn foo<T>(&self, on: T); }\n# impl Trait for String { fn foo<T>(&self, on: T) {} }\n# impl Trait for u8 { fn foo<T>(&self, on: T) {} }\n# impl Trait for bool { fn foo<T>(&self, on: T) {} }\n# // etc method\ntable. If the trait or any subtrait contain an associated constant, they cannot\nbe made into an object.\n\n```compile_fail,E0038\ntrait Foo {\n    const X: i32;\n}\n\nimpl Foo {}\n```\n\nA simple workaround is to use a helper method instead:\n\n```\ntrait Foo {\n    fn x(&self) -> i32;\n}\n```\n\n### The trait cannot use `Self` as a type parameter in the supertrait listing\n\nThis is similar to the second sub-error, but subtler. It happens in situations\nlike the following:\n\n```compile_fail\ntrait Super<A> {}\n\ntrait Trait: Super<Self> {\n}\n\nstruct Foo;\n\nimpl Super<Foo> for Foo{}\n\nimpl Trait for Foo {}\n```\n\nHere, the supertrait might have methods as follows:\n\n```\ntrait Super<A> {\n    fn get_a(&self) -> A; // note that this is object safe!\n}\n```\n\nIf the trait `Foo` was deriving from something like `Super<String>` or\n`Super<T>` (where `Foo` itself is `Foo<T>`), this is okay, because given a type\n`get_a()` will definitely return an object of that type.\n\nHowever, if it derives from `Super<Self>`, even though `Super` is object safe,\nthe method `get_a()` would return an object of unknown type when called on the\nfunction. `Self` type parameters let us make object safe traits no longer safe,\nso they are forbidden when specifying supertraits.\n\nThere's no easy fix for this, generally code will need to be refactored so that\nyou no longer need to derive from `Super<Self>`.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/kindck/kindck-inherited-copy-bound.rs","byte_start":821,"byte_end":825,"line_start":34,"line_end":34,"column_start":19,"column_end":23,"is_primary":true,"text":[{"text":"    let z = &x as &Foo;","highlight_start":19,"highlight_end":23}],"label":"the trait `Foo` cannot be made into an object","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the trait cannot require that `Self : Sized`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0038]: the trait `Foo` cannot be made into an object\n  --> /checkout/src/test/ui/kindck/kindck-inherited-copy-bound.rs:34:19\n   |\nLL |     let z = &x as &Foo;\n   |                   ^^^^ the trait `Foo` cannot be made into an object\n   |\n   = note: the trait cannot require that `Self : Sized`\n\n"}
[00:58:30] {"message":"the trait `Foo` cannot be made into an object","code":{"code":"E0038","explanation":"\nTrait objects like `Box<Trait>` can only be constructed when certain\nrequirements are satisfied by the trait in question.\n\nTrait objects are a form of dynamic dispatch and use a dynamically sized type\nfor the inner type. So, for a given trait `Trait`, when `Trait` is treated as a\ntype, as in `Box<Trait>`, the inner type is 'unsized'. In such cases the boxed\npointer is a 'fat pointer' that contains an extra pointer to a table of methods\n(among other things) for dynamic dispatch. This design mandates some\nrestrictions on the types of traits that are allowed to be used in trait\nobjects, which are collectively termed as 'object safety' rules.\n\nAttempting to create a trait object for a non object-safe trait will trigger\nthis error.\n\nThere are various rules:\n\n### The trait cannot require `Self: Sized`\n\nWhen `Trait` is treated as a type, the typn```\n\nIf this is not an option, consider replacing the type parameter with another\ntrait object (e.g., if `T: OtherTrait`, use `on: Box<OtherTrait>`). If the\nnumber of types you intend to feed to this method is limited, consider manually\nlisting out the methods of different types.\n\n### Method has no receiver\n\nMethods that do not take a `self` parameter can't be called since there won't be\na way to get a pointer to the method table for them.\n\n```\ntrait Foo {\n    fn foo() -> u8;\n}\n```\n\nThis could be called as `<Foo as Foo>::foo()`, which would not be able to pick\nan implementation.\n\nAdding a `Self: Sized` bound to these methods will generally make this compile.\n\n```\ntrait Foo {\n    fn foo() -> u8 where Self: Sized;\n}\n```\n\n### The trait cannot contain associated constants\n\nJust like static functions, associated constants aren't stored on the method\ntable. If the trait or any subtrait contain an associated constant, they cannot\nbe made into an object.\n\n```compile_fail,E0038\ntrait Foo {\n    const X: i32;\n}\n\nimpl Foo {}\n```\n\nA simple workaround is to use a helper method instead:\n\n```\ntrait Foo {\n    fn x(&self) -> i32;\n}\n```\n\n### The trait cannot use `Self` as a type parameter in the supertrait listing\n\nThis is similar to the second sub-error, but subtler. It happens in situations\nlike the following:\n\n```compile_fail\ntrait Super<A> {}\n\ntrait Trait: Super<Self> {\n}\n\nstruct Foo;\n\nimpl Super<Foo> for Foo{}\n\nimpl Trait for Foo {}\n```\n\nHere, the supertrait might have methods as follows:\n\n```\ntrait Super<A> {\n    fn get_a(&self) -> A; // note that this is object safe!\n}\n```\n\nIf the trait `Foo` was deriving from something like `Super<String>` or\n`Super<T>` (where `Foo` itself is `Foo<T>`), this is okay, because given a type\n`get_a()` will definitely return an object of that type.\n\nHowever, if it derives from `Super<Self>`, even though `Super` is object safe,\nthe method `get_a()` would return an object of unknown type when called on the\nfunction. `Self` type parameters let us make object safe traits no longer safe,\nso they are forbidden when specifying supertraits.\n\nThere's no easy fix for this, generally code will need to be refactored so that\nyou no longer need to derive from `Super<Self>`.\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/kindck/kindck-inherited-copy-bound.rs","byte_start":815,"byte_end":817,"line_start":34,"line_end":34,"column_start":13,"column_end":15,"is_primary":true,"text":[{"text":"    let z = &x as &Foo;","highlight_start":13,"highlight_end":15}],"label":"the trait `Foo` cannot be made into an object","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the trait cannot require that `Self : Sized`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required because of the requirements on the impl of `std::ops::CoerceUnsized<&dyn Foo>` for `&std::boxed::Box<{integer}>`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0038]: the trait `Foo` cannot be made into an object\n  --> /checkout/src/test/ui/kindck/kindck-inherited-copy-bound.rs:34:13\n   |\nLL |     let z = &x as &Foo;\n   |             ^^ the trait `Foo` cesting" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/kindck/kindck-send-object1/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/kindck/kindck-send-object1/auxiliary" "-A" "unused"
[00:58:30] ------------------------------------------
[00:58:30] 
[00:58:30] ------------------------------------------
[00:58:30] stderr:
[00:58:30] stderr:
[00:58:30] ------------------------------------------
[00:58:30] {"message":"`(dyn Dummy + 'a)` cannot be sent between threads safely","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(5ily","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the trait `std::marker::Send` is not implemented for `(dyn Dummy + 'a)`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<(dyn Dummy + 'a)>`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required because it appears within the type `std::boxed::Box<(dyn Dummy + 'a)>`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by `assert_send`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/kindck/kindck-send-object1.rs","byte_start":659,"byte_end":691,"line_start":15,"line_end":15,"column_start":1,"column_end":33,"is_primary":true,"text":[{"text":"fn assert_send<T:Send+'static>() { }","highlight_start":1,"highlight_end":33}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0277]: `(dyn Dummy + 'a)` cannot be sent between threads safely\n  --> /checkout/src/test/ui/kindck/kindck-send-object1.rs:39:5\n   |\nLL |     assert_send::<Box<Dummy+'a>>();\n   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be sent between threads safely\n   |\n   = help: the trait `std::marker::Send` is not implemented for `(dyn Dummy + 'a)`\n   = note: required because of the requirements on the impl of `std::marker::Send` for `std::ptr::Unique<(dyn Dummy + 'a)>`\n   = note: required because it appears within the type `std::boi32 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/kindck/kindck-send-object1.rs","byte_start":799,"byte_end":823,"line_start":20,"line_end":20,"column_start":5,"column_end":29,"is_primary":true,"text":[{"text":"    assert_send::<&'a Dummy>();","highlight_start":5,"highlight_end":29}],"label":"`(dyn Dummy + 'a)` cannot be shared between threads safely","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"the trait `std::marker::Sync` is not implemented for `(dyn Dummy + 'a)`","code":null,"level":"help","spans":[],"children":[],"rendered":null},{"message":"required because of the requirements on the impl of `std::marker::Send` for `&'a (dyn Dummy + 'a)`","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"required by `assert_send`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/kindck/kindck-send-object1.rs","byte_start":659,"byte_end":691,"line_start":15,"line_end":15,"column_start":1,"column_end":33,"is_primary":true,"text":[{"text":"fn assert_send<T:Send+'static>() { }","highlight_start":1,"highlight_end":33}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0277]: `(dyn Dummy + 'a)` cannot be shared between threads safely\n  --> /checkout/src/test/ui/kindck/kindck-send-object1.rs:20:5\n   |\nLL |     assert_send::<&'a Dummy>();\n   |     ^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be shared between threads safely\n   |\n   = help: the trait `std::marker::Sync` is not implemented for `(dyn Dummy + 'a)`\n   = note: required because of the requirements on the impl of `std::marker::Send` for `&'a (dyn Dummy + 'a)`\nnote: required by `assert_send`\n  --> /checkout/src/test/ui/kindck/kindck-send-object1.rs:15:1\n   |\nLL | fn assert_send<T:Send+'static>() { }\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:58:30] {"message":"the type `&'a (dyn Dummy + std::marker::Sync + 'a)` does not fulfill the required lifetime","code":{"code":"E0477","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/kindck/kindck-send-object1.rs","byte_start":933,"byte_end":964,"line_start":24,"line_end":24,"column_start":5,"column_end":36,"is_primary":true,"text":[{"text":"    assert_send::<&'a (Dummy+Sync)local-notes.rs:23:9
[00:58:30] -    |
[00:58:30] - LL |         x = 2;
[00:58:30] -    |         ----- first assignment to `x`
[00:58:30] - LL |         x = 3;      //~ ERROR (Ast) [E0384]
[00:58:30] -    |         ^^^^^ cannot assign twice to immutable variable
[00:58:30] - 
[00:58:30] - error[E0384]: cannot assign twice to immutable variable `x` (Ast)
[00:58:30] -    |
[00:58:30] -    |
[00:58:30] - LL |             x = 2;
[00:58:30] -    |             ----- first assignment to `x`
[00:58:30] - LL |             x = 3;      //~ ERROR (Ast) [E0384]
[00:58:30] -    |             ^^^^^ cannot assign twice to immutable variable
[00:58:30] - 

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 has been minimized.

Copy link
Contributor

bors commented Dec 23, 2018

☀️ Test successful - status-travis
State: approved= try=True

@Zoxc

This comment has been minimized.

Copy link
Contributor

Zoxc commented Dec 23, 2018

@rust-timer

This comment has been minimized.

Copy link

rust-timer commented Dec 23, 2018

Success: Queued f471219 with parent ddab10a, comparison URL.

@rust-timer

This comment has been minimized.

Copy link

rust-timer commented Dec 23, 2018

Finished benchmarking try commit f471219

@Zoxc

This comment has been minimized.

Copy link
Contributor

Zoxc commented Dec 23, 2018

@bors try

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 23, 2018

⌛️ Trying commit b785258 with merge 89874d8...

bors added a commit that referenced this pull request Dec 23, 2018

Auto merge of #56765 - Zoxc:pq-test, r=<try>
[do not merge] Test parallel queries

Let's see if I have more luck

r? @michaelwoerister
@Zoxc

This comment has been minimized.

Copy link
Contributor

Zoxc commented Dec 23, 2018

ctfe-stress doesn't look too good though. cc @oli-obk

@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented Dec 23, 2018

I'm confused. Those tests look like they actually improved by 5-10% Or am I looking at the wrong link? #56765 (comment)

@jonas-schievink

This comment has been minimized.

Copy link
Contributor

jonas-schievink commented Dec 23, 2018

@oli-obk The default view sorts by instructions, sort by wall-time instead and the ctfe tests get much slower

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Dec 23, 2018

☀️ Test successful - status-travis
State: approved= try=True

@oli-obk

This comment has been minimized.

Copy link
Contributor

oli-obk commented Dec 23, 2018

I would have expected incremental to be slower, as decoding large constants can happen to duplicate the work with parallel decoding and then throw away all results but the first one to finish.

I don't know why the non-incremental case is slower. It's not like we're evaluating queries twice, right? Especially weird that wall time would go down. Maybe it's just because evaluating those large constants will run a lot of queries (one or two for all the temporary locals that are written to) and I presume that a single query's evaluation time will be slower than before due to extra synchronizations?

Also note that these tests are know to fluctuate by 2-5% all the time. Maybe that fluctuation gets way worse with parallel queries?

@Zoxc

This comment has been minimized.

Copy link
Contributor

Zoxc commented Dec 24, 2018

@rust-timer

This comment has been minimized.

Copy link

rust-timer commented Dec 24, 2018

Success: Queued 89874d8 with parent ddab10a, comparison URL.

@rust-timer

This comment has been minimized.

Copy link

rust-timer commented Dec 24, 2018

Finished benchmarking try commit 89874d8

Zoxc and others added some commits Dec 13, 2018

@Zoxc Zoxc force-pushed the Zoxc:pq-test branch from b785258 to 33610f1 Jan 19, 2019

@Zoxc

This comment has been minimized.

Copy link
Contributor

Zoxc commented Jan 19, 2019

@bors try

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 19, 2019

⌛️ Trying commit 33610f1 with merge 18d646d...

bors added a commit that referenced this pull request Jan 19, 2019

Auto merge of #56765 - Zoxc:pq-test, r=<try>
[do not merge] Test parallel queries

Let's see if I have more luck

r? @michaelwoerister
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Jan 19, 2019

☀️ Test successful - checks-travis
State: approved= try=True

@Zoxc

This comment has been minimized.

Copy link
Contributor

Zoxc commented Jan 19, 2019

@rust-timer

This comment has been minimized.

Copy link

rust-timer commented Jan 19, 2019

Success: Queued 18d646d with parent f001287, comparison URL.

@rust-timer

This comment has been minimized.

Copy link

rust-timer commented Jan 19, 2019

Finished benchmarking try commit 18d646d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment