Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Associate an allocator to boxes #58418

Closed
wants to merge 1 commit into from
Closed

Conversation

glandium
Copy link
Contributor

At this point, I only want CI results.

@rust-highfive
Copy link
Collaborator

r? @shepmaster

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 13, 2019
@glandium
Copy link
Contributor Author

r? @ghost

@rust-highfive
Copy link
Collaborator

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:11cb64a2:start=1550048321033275438,finish=1550048321913495416,duration=880219978
$ 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:58:42] .................................................................................................... 1600/5383
[00:58:45] ..i..........................................................................i...................... 1700/5383
[00:58:49] .................................................................................................... 1800/5383
[00:58:53] .................................................................................................... 1900/5383
[00:58:56] ................................................................................F................... 2000/5383
[00:59:03] .................................................................................................... 2200/5383
[00:59:07] .................................................................................................... 2300/5383
[00:59:11] .................................................................................................... 2400/5383
[00:59:15] .................................................................................................... 2500/5383
[00:59:15] .................................................................................................... 2500/5383
[00:59:18] .................................................................................................... 2600/5383
[00:59:22] ...........................................................F........................................ 2700/5383
[00:59:30] .................................................................................................... 2900/5383
[00:59:34] .................................................................................................... 3000/5383
[00:59:37] .................................................................................................... 3100/5383
[00:59:41] .................................................................................................... 3200/5383
[00:59:41] .................................................................................................... 3200/5383
[00:59:44] .................................i.................................................................. 3300/5383
[00:59:48] .................................................................................................... 3400/5383
[00:59:51] ..ii...i..ii........................................................................................ 3500/5383
[00:59:55] .................................................................................................... 3600/5383
[00:59:58] ............F..........F............................................................................ 3700/5383
[01:00:01] .ii................................................................................................. 3800/5383
[01:00:05] ............................................................................i....................... 4000/5383
[01:00:07] .................................................................................................... 4100/5383
[01:00:14] .................................................................................................... 4200/5383
[01:00:21] .................................................................................................... 4300/5383
---
[01:01:00] 
[01:01:00] ---- [ui] ui/issues/issue-14092.rs stdout ----
[01:01:00] diff of stderr:
[01:01:00] 
[01:01:00] - error[E0107]: wrong number of type arguments: expected 1, found 0
[01:01:00] + error[E0107]: wrong number of type arguments: expected at least 1, found 0
[01:01:00] 3    |
[01:01:00] 3    |
[01:01:00] 4 LL | fn fn1(0: Box) {}
[01:01:00] -    |           ^^^ expected 1 type argument
[01:01:00] +    |           ^^^ expected at least 1 type argument
[01:01:00] 6 
[01:01:00] 7 error: aborting due to previous error
[01:01:00] 7 error: aborting due to previous error
[01:01:00] 8 
[01:01:00] 
[01:01:00] 
[01:01:00] The actual stderr differed from the expected stderr.
[01:01:00] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-14092/issue-14092.stderr
[01:01:00] To update references, rerun the tests and pass the `--bless` flag
[01:01:00] To only update this specific test, also pass `--test-args issues/issue-14092.rs`
[01:01:00] error: 1 errors occurred comparing output.
[01:01:00] status: exit code: 1
[01:01:00] status: exit code: 1
[01:01:00] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-14092.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-14092/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-14092/auxiliary" "-A" "unused"
[01:01:00] ------------------------------------------
[01:01:00] 
[01:01:00] ------------------------------------------
[01:01:00] stderr:
[01:01:00] stderr:
[01:01:00] ------------------------------------------
[01:01:00] {"message":"wrong number of type arguments: expected at least 1, found 0","code":{"code":"E0107","explanation":"\nThis error means that an incorrect number of generic arguments were provided:\n\n```compile_fail,E0107\nstruct Foo<T> { x: T }\n\nstruct Bar { x: Foo }             // error: wrong number of type arguments:\n                                  //        expected 1, found 0\nstruct Baz<S, T> { x: Foo<S, T> } // error: wrong number of type arguments:\n                                  //        expected 1, found 2\n\nfn foo<T, U>(x: T, y: U) {}\n\nfn main() {\n    let x: bool = true;\n    foo::<bool>(x);                 // error: wrong number of type arguments:\n                                    //        expected 2, found 1\n    foo::<bool, i32, i32>(x, 2, 4); // error: wrong number of type arguments:\n                                    //        expected 2, found 3\n}\n\nfn f() {}\n\nfn main() {\n    f::<'static>(); // error: wrong number of lifetime arguments:\n                    //        expected 0, found 1\n}\n```\n\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-14092.rs","byte_start":10,"byte_end":13,"line_start":1,"line_end":1,"column_start":11,"column_end":14,"is_primary":true,"text":[{"text":"fn fn1(0: Box) {}","highlight_start":11,"highlight_end":14}],"label":"expected at least 1 type argument","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0107]: wrong number of type arguments: expected at least 1, found 0\n  --> /checkout/src/test/ui/issues/issue-14092.rs:1:11\n   |\nLL | fn fn1(0: Box) {}\n   |           ^^^ expected at least 1 type argument\n\n"}
[01:01:00] {"message":"For more information about this error, try `rustc --explain E0107`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0107`.\n"}
[01:01:00] 
[01:01:00] ------------------------------------------
[01:01:00] 
[01:01:00] 
[01:01:00] thread '[ui] ui/issues/issue-14092.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3295:9
[01:01:00] note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
[01:01:00] 
[01:01:00] ---- [ui] ui/issues/issue-41974.rs stdout ----
[01:01:00] diff of stderr:
[01:01:00] 
[01:01:00] - error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `std::boxed::Box<_>`:
[01:01:00] + error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `std::boxed::Box<_, _>`:
[01:01:00] 3    |
[01:01:00] 3    |
[01:01:00] 4 LL | impl<T> Drop for T where T: A { //~ ERROR E0119
[01:01:00] 5    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[01:01:00] 6    |
[01:01:00] 7    = note: conflicting implementation in crate `alloc`:
[01:01:00] 7    = note: conflicting implementation in crate `alloc`:
[01:01:00] -            - impl<T> std::ops::Drop for std::boxed::Box<T>
[01:01:00] -              where T: ?Sized;
[01:01:00] -    = note: downstream crates may implement trait `A` for type `std::boxed::Box<_>`
[01:01:00] +            - impl<T, A> std::ops::Drop for std::boxed::Box<T, A>
[01:01:00] +              where A: std::default::Default, A: std::alloc::Alloc, T: ?Sized;
[01:01:00] +    = note: downstream crates may implement trait `A` for type `std::boxed::Box<_, _>`
[01:01:00] 11 
[01:01:00] 12 error[E0120]: the Drop trait may only be implemented on structures
[01:01:00] 
[01:01:00] 
[01:01:00] The actual stderr differed from the expected stderr.
[01:01:00] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-41974/issue-41974.stderr
[01:01:00] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-41974/issue-41974.stderr
[01:01:00] To update references, rerun the tests and pass the `--bless` flag
[01:01:00] To only update this specific test, also pass `--test-args issues/issue-41974.rs`
[01:01:00] error: 1 errors occurred comparing output.
[01:01:00] status: exit code: 1
[01:01:00] status: exit code: 1
[01:01:00] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issues/issue-41974.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-41974/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-41974/auxiliary" "-A" "unused"
[01:01:00] ------------------------------------------
[01:01:00] 
[01:01:00] ------------------------------------------
[01:01:00] stderr:
[01:01:00] stderr:
[01:01:00] ------------------------------------------
[01:01:00] {"message":"conflicting implementations of trait `std::ops::Drop` for type `std::boxed::Box<_, _>`:","code":{"code":"E0119","explanation":"\nThere are conflicting trait implementations for the same type.\nExample of erroneous code:\n\n```compile_fail,E0119\ntrait MyTrait {\n    fn get(&self) -> usize;\n}\n\nimpl<T> MyTrait for T {\n    fn get(&self) -> usize { 0 }\n}\n\nstruct Foo {\n    value: usize\n}\n\nimpl MyTrait for Foo { // error: conflicting implementations of trait\n                       //        `MyTrait` for type `Foo`\n    fn get(&self) -> usize { self.value }\n}\n```\n\nWhen looking for the implementation for the trait, the compiler finds\nboth the `impl<T> MyTrait for T` where T is all types and the `impl\nMyTrait for Foo`. Since a trait cannot be implemented multiple times,\nthis is an error. So, when you write:\n\n```\ntrait MyTrait {\n    fn get(&self) -> usize;\n}\n\nimpl<T> MyTrait for T {\n    fn get(&self) -> usize { 0 }\n}\n```\n\nThis makes the trait implemented on all types in the scope. So if you\ntry to implement it on another one after that, the implementations will\nconflict. Example:\n\n```\ntrait MyTrait {\n    fn get(&self) -> usize;\n}\n\nimpl<T> MyTrait for T {\n    fn get(&self) -> usize { 0 }\n}\n\nstruct Foo;\n\nfn main() {\n    let f = Foo;\n\n    f.get(); // the trait is implemented so we can use it\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-41974.rs","byte_start":51,"byte_end":80,"line_start":7,"line_end":7,"column_start":1,"column_end":30,"is_primary":true,"text":[{"text":"impl<T> Drop for T where T: A { //~ ERROR E0119","highlight_start":1,"highlight_end":30}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"conflicting implementation in crate `alloc`:\n- impl<T, A> std::ops::Drop for std::boxed::Box<T, A>\n  where A: std::default::Default, A: std::alloc::Alloc, T: ?Sized;","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"downstream crates may implement trait `A` for type `std::boxed::Box<_, _>`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0119]: conflicting implementations of trait `std::ops::Drop` for type `std::boxed::Box<_, _>`:\n  --> /checkout/src/test/ui/issues/issue-41974.rs:7:1\n   |\nLL | impl<T> Drop for T where T: A { //~ ERROR E0119\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: conflicting implementation in crate `alloc`:\n           - impl<T, A> std::ops::Drop for std::boxed::Box<T, A>\n             where A: std::default::Default, A: std::alloc::Alloc, T: ?Sized;\n   = note: downstream crates may implement trait `A` for type `std::boxed::Box<_, _>`\n\n"}
[01:01:00] {"message":"the Drop trait may only be implemented on structures","code":{"code":"E0120","explanation":"\nAn attempt was made to implement Drop on a trait, which is not allowed: only\nstructs and enums can implement Drop. An example causing this error:\n\n```compile_fail,E0120\ntrait MyTrait {}\n\nimpl Drop for MyTrait {\n    fn drop(&mut self) {}\n}\n```\n\nA workaround for this problem is to wrap the trait up in a struct, and implement\nDrop on that. An example is shown below:\n\n```\ntrait MyTrait {}\nstruct MyWrapper<T: MyTrait> { foo: T }\n\nimpl <T: MyTrait> Drop for MyWrapper<T> {\n    fn drop(&mut self) {}\n}\n\n```\n\nAlternatively, wrapping trait objects requires something like the following:\n\n```\ntrait MyTrait {}\n\n//or Box<MyTrait>, if you wanted an owned trait object\nstruct MyWrapper<'a> { foo: &'a MyTrait }\n\nimpl <'a> Drop for MyWrapper<'a> {\n    fn drop(&mut self) {}\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-41974.rs","byte_start":68,"byte_end":69,"line_start":7,"line_end":7,"column_start":18,"column_end":19,"is_primary":true,"text":[{"text":"impl<T> Drop for T where T: A { //~ ERROR E0119","highlight_start":18,"highlight_end":19}],"label":"implementing Drop requires a struct","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":"error[E0120]: the Drop trait may only be implemented on structures\n  --> /checkout/src/test/ui/issues/issue-41974.rs:7:18\n   |\nLL | impl<T> Drop for T where T: A { //~ ERROR E0119\n   |                  ^ implementing Drop requires a struct\n\n"}
[01:01:00] {"message":"type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)","code":{"code":"E0210","explanation":"\nThis error indicates a violation of one of Rust's orphan rules for trait\nimplementations. The rule concerns the use of type parameters in an\nimplementation of a foreign trait (a trait defined in another crate), and\nstates that type parameters must be \"covered\" by a local type. To understand\nwhat this means, it is perhaps easiest to consider a few examples.\n\nIf `ForeignTrait` is a trait defined in some external crate `foo`, then the\nfollowing trait `impl` is an error:\n\n```compile_fail,E0210\n# #[cfg(for_demonstration_only)]\nextern crate foo;\n# #[cfg(for_demonstration_only)]\nuse foo::ForeignTrait;\n# use std::panic::UnwindSafe as ForeignTrait;\n\nimpl<T> ForeignTrait for T { } // error\n# fn main() {}\n```\n\nTo work around this, it can be covered with a local type, `MyType`:\n\n```\n# use std::panic::UnwindSafe as ForeignTrait;\nstruct MyType<T>(T);\nimpl<T> ForeignTrait for MyType<T> { } // Ok\n```\n\nPlease note that a type alias is not sufficient.\n\nFor another example of an error, suppose there's another trait defined in `foo`\nnamed `ForeignTrait2` that takes two type parameters. Then this `impl` results\nin the same rule violation:\n\n```ignore (cannot-doctest-multicrate-project)\nstruct MyType2;\nimpl<T> ForeignTrait2<T, MyType<T>> for MyType2 { } // error\n```\n\nThe reason for this is that there are two appearances of type parameter `T` in\nthe `impl` header, both as parameters for `ForeignTrait2`. The first appearance\nis uncovered, and so runs afoul of the orphan rule.\n\nConsider one more example:\n\n```ignore (cannot-doctest-multicrate-project)\nimpl<T> ForeignTrait2<MyType<T>, T> for MyType2 { } // Ok\n```\n\nThis only differs from the previous `impl` in that the parameters `T` and\n`MyType<T>` for `ForeignTrait2` have been swapped. This example does *not*\nviolate the orphan rule; it is permitted.\n\nTo see why that last example was allowed, you need to understand the general\nrule. Unfortunately this rule is a bit tricky to state. Consider an `impl`:\n\n```ignore (only-for-syntax-highlight)\nimpl<P1, ..., Pm> ForeignTrait<T1, ..., Tn> for T0 { ... }\n```\n\nwhere `P1, ..., Pm` are the type parameters of the `impl` and `T0, ..., Tn`\nare types. One of the types `T0, ..., Tn` must be a local type (this is another\norphan rule, see the explanation for E0117). Let `i` be the smallest integer\nsuch that `Ti` is a local type. Then no type parameter can appear in any of the\n`Tj` for `j < i`.\n\nFor information on the design of the orphan rules, see [RFC 1023].\n\n[RFC 1023]: https://github.com/rust-lang/rfcs/blob/master/text/1023-rebalancing-coherence.md\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issues/issue-41974.rs","byte_start":51,"byte_end":80,"line_start":7,"line_end":7,"column_start":1,"column_end":30,"is_primary":true,"text":[{"text":"impl<T> Drop for T where T: A { //~ ERROR E0119","highlight_start":1,"highlight_end":30}],"label":"type parameter `T` must be used as the type parameter for some local type","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"only traits defined in the current crate can be implemented for a type parameter","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0210]: type parameter `T` must be used as the type parameter for some local type (e.g., `MyStruct<T>`)\n  --> /checkout/src/test/ui/issues/issue-41974.rs:7:1\n   |\nLL | impl<T> Drop for T where T: A { //~ ERROR E0119\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ type parameter `T` must be used as the type parameter for some local type\n   |\n   = note: only traits defined in the current crate can be implemented for a type parameter\n\n"}
[01:01:00] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[01:01:00] {"message":"Some errors occurred: E0119, E0120, E0210.","code":null,"level":"","spans":[],"children":[],"rendered":"Some errors occurred: E0119, E0120, E0210.\n"}
[01:01:00] 
[01:01:00] ------------------------------------------
[01:01:00] 
[01:01:00] thread '[ui] ui/issues/issue-41974.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3295:9
[01:01:00] thread '[ui] ui/issues/issue-41974.rs' panicked at 'explicit panic', src/tools/compiletest/src/runtest.rs:3295:9
[01:01:00] 
[01:01:00] ---- [ui] ui/nll/ty-outlives/projection-no-regions-closure.rs stdout ----
[01:01:00] diff of stderr:
[01:01:00] 
[01:01:00] 8                '_#1r,
[01:01:00] 9                T,
[01:01:00] 10                i32,
[01:01:00] -                extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#2r)>
[01:01:00] +                extern "rust-call" fn((std::boxed::Box<T, std::alloc::Global>,)) -> std::boxed::Box<(dyn Anything + '_#2r), std::alloc::Global>
[01:01:00] 12            ]
[01:01:00] 13    = note: number of external vids: 3
[01:01:00] 14    = note: where <T as std::iter::Iterator>::Item: '_#2r
[01:01:00] 48                '_#1r,
[01:01:00] 49                T,
[01:01:00] 50                i32,
[01:01:00] 50                i32,
[01:01:00] -                extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#2r)>
[01:01:00] +                extern "rust-call" fn((std::boxed::Box<T, std::alloc::Global>,)) -> std::boxed::Box<(dyn Anything + '_#2r), std::alloc::Global>
[01:01:00] 52            ]
[01:01:00] 53    = note: number of external vids: 3
[01:01:00] 54    = note: where <T as std::iter::Iterator>::Item: '_#2r
[01:01:00] 80                '_#2r,
[01:01:00] 81                T,
[01:01:00] 82                i32,
[01:01:00] 82                i32,
[01:01:00] -                extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#3r)>
[01:01:00] +                extern "rust-call" fn((std::boxed::Box<T, std::alloc::Global>,)) -> std::boxed::Box<(dyn Anything + '_#3r), std::alloc::Global>
[01:01:00] 84            ]
[01:01:00] 85    = note: number of external vids: 4
[01:01:00] 86    = note: where <T as std::iter::Iterator>::Item: '_#3r
[01:01:00] 122                '_#2r,
[01:01:00] 123                T,
[01:01:00] 124                i32,
[01:01:00] 124                i32,
[01:01:00] -                extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn Anything + '_#3r)>
[01:01:00] +                extern "rust-call" fn((std::boxed::Box<T, std::alloc::Global>,)) -> std::boxed::Box<(dyn Anything + '_#3r), std::alloc::Global>
[01:01:00] 126            ]
[01:01:00] 127    = note: number of external vids: 4
[01:01:00] 128    = note: where <T as std::iter::Iterator>::Item: '_#3r
[01:01:00] 
[01:01:00] The actual stderr differed from the expected stderr.
[01:01:00] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-no-regions-closure/projection-no-regions-closure.stderr
[01:01:00] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-no-regions-closure/projection-no-regions-closure.stderr
[01:01:00] To update references, rerun the tests and pass the `--bless` flag
[01:01:00] To only update this specific test, also pass `--test-args nll/ty-outlives/projection-no-regions-closure.rs`
[01:01:00] error: 1 errors occurred comparing output.
[01:01:00] status: exit code: 1
[01:01:00] status: exit code: 1
[01:01:00] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-no-regions-closure/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-Zverbose" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/projection-no-regions-closure/auxiliary" "-A" "unused"
[01:01:00] ------------------------------------------
[01:01:00] 
[01:01:00] ------------------------------------------
[01:01:00] stderr:
[01:01:00] stderr:
[01:01:00] ------------------------------------------
[01:01:00] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs","byte_start":571,"byte_end":597,"line_start":25,"line_end":25,"column_start":23,"column_end":49,"is_primary":true,"text":[{"text":"    with_signature(x, |mut y| Box::new(y.next()))","highlight_start":23,"highlight_end":49}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:15 ~ projection_no_regions_closure[317d]::no_region[0]::{{closure}}[0]) with closure substs [\n    '_#1r,\n    T,\n    i32,\n    extern \"rust-call\" fn((std::boxed::Box<T, std::alloc::Global>,)) -> std::boxed::Box<(dyn Anything + '_#2r), std::alloc::Global>\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 3","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where <T as std::iter::Iterator>::Item: '_#2r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs:25:23\n   |\nLL |     with_signature(x, |mut y| Box::new(y.next()))\n   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: defining type: DefId(0/1:15 ~ projection_no_regions_closure[317d]::no_region[0]::{{closure}}[0]) with closure substs [\n               '_#1r,\n               T,\n               i32,\n               extern \"rust-call\" fn((std::boxed::Box<T, std::alloc::Global>,)) -> std::boxed::Box<(dyn Anything + '_#2r), std::alloc::Global>\n           ]\n   = note: number of external vids: 3\n   = note: where <T as std::iter::Iterator>::Item: '_#2r\n\n"}
[01:01:00] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs","byte_start":467,"byte_end":695,"line_start":21,"line_end":27,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn no_region<'a, T>(x: Box<T>) -> Box<dyn Anything + 'a>","highlight_start":1,"highlight_end":57},{"text":"where","highlight_start":1,"highlight_end":6},{"text":"    T: Iterator,","highlight_start":1,"highlight_end":17},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"    with_signature(x, |mut y| Box::new(y.next()))","highlight_start":1,"highlight_end":50},{"text":"    //~^ ERROR the associated type `<T as std::iter::Iterator>::Item` may not live long enough","highlight_start":1,"highlight_end":95},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:6 ~ projection_no_regions_closure[317d]::no_region[0]) with substs [\n    '_#1r,\n    T\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs:21:1\n   |\nLL | / fn no_region<'a, T>(x: Box<T>) -> Box<dyn Anything + 'a>\nLL | | where\nLL | |     T: Iterator,\nLL | | {\nLL | |     with_signature(x, |mut y| Box::new(y.next()))\nLL | |     //~^ ERROR the associated type `<T as std::iter::Iterator>::Item` may not live long enough\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:6 ~ projection_no_regions_closure[317d]::no_region[0]) with substs [\n               '_#1r,\n               T\n           ]\n\n"}
[01:01:00] {"message":"the associated type `<T as std::iter::Iterator>::Item` may not live long enough","code":{"code":"E0309","explanation":"\nThe type definition contains some field whose type\nrequires an outlives annotation. Outlives annotations\n(e.g., `T: 'a`) are used to guarantee that all the data in T is valid\nfor at least the lifetime `'a`. This scenario most commonly\narises when the type contains an associated type reference\nlike `<T as SomeTrait<'a>>::Output`, as shown in this example:\n\n```compile_fail,E0309\n// This won't compile because the applicable impl of\n// `SomeTrait` (below) requires that `T: 'a`, but the struct does\n// not have a matching where-clause.\nstruct Foo<'a, T> {\n    foo: <T as SomeTrait<'a>>::Output,\n}\n\ntrait SomeTrait<'a> {\n    type Output;\n}\n\nimpl<'a, T> SomeTrait<'a> for T\nwhere\n    T: 'a,\n{\n    type Output = u32;\n}\n```\n\nHere, the where clause `T: 'a` that appears on the impl is not known to be\nsatisfied on the struct. To make this example compile, you have to add\na where-clause like `T: 'a` to the struct definition:\n\n```\nstruct Foo<'a, T>\nwhere\n    T: 'a,\n{\n    foo: <T as SomeTrait<'a>>::Output\n}\n\ntrait SomeTrait<'a> {\n    type Output;\n}\n\nimpl<'a, T> SomeTrait<'a> for T\nwhere\n    T: 'a,\n{\n    type Output = u32;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs","byte_start":571,"byte_end":597,"line_start":25,"line_end":25,"column_start":23,"column_end":49,"is_primary":true,"text":[{"text":"    with_signature(x, |mut y| Box::new(y.next()))","highlight_start":23,"highlight_end":49}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider adding an explicit lifetime bound `<T as std::iter::Iterator>::Item: ReEarlyBound(0, 'a)`...","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0309]: the associated type `<T as std::iter::Iterator>::Item` may not live long enough\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs:25:23\n   |\nLL |     with_signature(x, |mut y| Box::new(y.next()))\n   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = help: consider adding an explicit lifetime bound `<T as std::iter::Iterator>::Item: ReEarlyBound(0, 'a)`...\n\n"}
[01:01:00] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs","byte_start":828,"byte_end":854,"line_start":34,"line_end":34,"column_start":23,"column_end":49,"is_primary":true,"text":[{"text":"    with_signature(x, |mut y| Box::new(y.next()))","highlight_start":23,"highlight_end":49}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:18 ~ projection_no_regions_closure[317d]::correct_region[0]::{{closure}}[0]) with closure substs [\n    '_#1r,\n    T,\n    i32,\n    extern \"rust-call\" fn((std::boxed::Box<T, std::alloc::Global>,)) -> std::boxed::Box<(dyn Anything + '_#2r), std::alloc::Global>\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 3","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where <T as std::iter::Iterator>::Item: '_#2r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs:34:23\n   |\nLL |     with_signature(x, |mut y| Box::new(y.next()))\n   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: defining type: DefId(0/1:18 ~ projection_no_regions_closure[317d]::correct_region[0]::{{closure}}[0]) with closure substs [\n               '_#1r,\n               T,\n               i32,\n               extern \"rust-call\" fn((std::boxed::Box<T, std::alloc::Global>,)) -> std::boxed::Box<(dyn Anything + '_#2r), std::alloc::Global>\n           ]\n   = note: number of external vids: 3\n   = note: where <T as std::iter::Iterator>::Item: '_#2r\n\n"}
[01:01:00] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs","byte_start":714,"byte_end":857,"line_start":30,"line_end":35,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn correct_region<'a, T>(x: Box<T>) -> Box<dyn Anything + 'a>","highlight_start":1,"highlight_end":62},{"text":"where","highlight_start":1,"highlight_end":6},{"text":"    T: 'a + Iterator,","highlight_start":1,"highlight_end":22},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"    with_signature(x, |mut y| Box::new(y.next()))","highlight_start":1,"highlight_end":50},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:7 ~ projection_no_regions_closure[317d]::correct_region[0]) with substs [\n    '_#1r,\n    T\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs:30:1\n   |\nLL | / fn correct_region<'a, T>(x: Box<T>) -> Box<dyn Anything + 'a>\nLL | | where\nLL | |     T: 'a + Iterator,\nLL | | {\nLL | |     with_signature(x, |mut y| Box::new(y.next()))\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:7 ~ projection_no_regions_closure[317d]::correct_region[0]) with substs [\n               '_#1r,\n               T\n           ]\n\n"}
[01:01:00] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs","byte_start":992,"byte_end":1018,"line_start":42,"line_end":42,"column_start":23,"column_end":49,"is_primary":true,"text":[{"text":"    with_signature(x, |mut y| Box::new(y.next()))","highlight_start":23,"highlight_end":49}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:22 ~ projection_no_regions_closure[317d]::wrong_region[0]::{{closure}}[0]) with closure substs [\n    '_#1r,\n    '_#2r,\n    T,\n    i32,\n    extern \"rust-call\" fn((std::boxed::Box<T, std::alloc::Global>,)) -> std::boxed::Box<(dyn Anything + '_#3r), std::alloc::Global>\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 4","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where <T as std::iter::Iterator>::Item: '_#3r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs:42:23\n   |\nLL |     with_signature(x, |mut y| Box::new(y.next()))\n   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: defining type: DefId(0/1:22 ~ projection_no_regions_closure[317d]::wrong_region[0]::{{closure}}[0]) with closure substs [\n               '_#1r,\n               '_#2r,\n               T,\n               i32,\n               extern \"rust-call\" fn((std::boxed::Box<T, std::alloc::Global>,)) -> std::boxed::Box<(dyn Anything + '_#3r), std::alloc::Global>\n           ]\n   = note: number of external vids: 4\n   = note: where <T as std::iter::Iterator>::Item: '_#3r\n\n"}
[01:01:00] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs","byte_start":876,"byte_end":1116,"line_start":38,"line_end":44,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a>","highlight_start":1,"highlight_end":64},{"text":"where","highlight_start":1,"highlight_end":6},{"text":"    T: 'b + Iterator,","highlight_start":1,"highlight_end":22},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"    with_signature(x, |mut y| Box::new(y.next()))","highlight_start":1,"highlight_end":50},{"text":"    //~^ ERROR the associated type `<T as std::iter::Iterator>::Item` may not live long enough","highlight_start":1,"highlight_end":95},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:8 ~ projection_no_regions_closure[317d]::wrong_region[0]) with substs [\n    '_#1r,\n    '_#2r,\n    T\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs:38:1\n   |\nLL | / fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a>\nLL | | where\nLL | |     T: 'b + Iterator,\nLL | | {\nLL | |     with_signature(x, |mut y| Box::new(y.next()))\nLL | |     //~^ ERROR the associated type `<T as std::iter::Iterator>::Item` may not live long enough\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:8 ~ projection_no_regions_closure[317d]::wrong_region[0]) with substs [\n               '_#1r,\n               '_#2r,\n               T\n           ]\n\n"}
[01:01:00] {"message":"the associated type `<T as std::iter::Iterator>::Item` may not live long enough","code":{"code":"E0309","explanation":"\nThe type definition contains some field whose type\nrequires an outlives annotation. Outlives annotations\n(e.g., `T: 'a`) are used to guarantee that all the data in T is valid\nfor at least the lifetime `'a`. This scenario most commonly\narises when the type contains an associated type reference\nlike `<T as SomeTrait<'a>>::Output`, as shown in this example:\n\n```compile_fail,E0309\n// This won't compile because the applicable impl of\n// `SomeTrait` (below) requires that `T: 'a`, but the struct does\n// not have a matching where-clause.\nstruct Foo<'a, T> {\n    foo: <T as SomeTrait<'a>>::Output,\n}\n\ntrait SomeTrait<'a> {\n    type Output;\n}\n\nimpl<'a, T> SomeTrait<'a> for T\nwhere\n    T: 'a,\n{\n    type Output = u32;\n}\n```\n\nHere, the where clause `T: 'a` that appears on the impl is not known to be\nsatisfied on the struct. To make this example compile, you have to add\na where-clause like `T: 'a` to the struct definition:\n\n```\nstruct Foo<'a, T>\nwhere\n    T: 'a,\n{\n    foo: <T as SomeTrait<'a>>::Output\n}\n\ntrait SomeTrait<'a> {\n    type Output;\n}\n\nimpl<'a, T> SomeTrait<'a> for T\nwhere\n    T: 'a,\n{\n    type Output = u32;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs","byte_start":992,"byte_end":1018,"line_start":42,"line_end":42,"column_start":23,"column_end":49,"is_primary":true,"text":[{"text":"    with_signature(x, |mut y| Box::new(y.next()))","highlight_start":23,"highlight_end":49}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider adding an explicit lifetime bound `<T as std::iter::Iterator>::Item: ReEarlyBound(0, 'a)`...","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0309]: the associated type `<T as std::iter::Iterator>::Item` may not live long enough\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs:42:23\n   |\nLL |     with_signature(x, |mut y| Box::new(y.next()))\n   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = help: consider adding an explicit lifetime bound `<T as std::iter::Iterator>::Item: ReEarlyBound(0, 'a)`...\n\n"}
[01:01:00] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs","byte_start":1266,"byte_end":1292,"line_start":52,"line_end":52,"column_start":23,"column_end":49,"is_primary":true,"text":[{"text":"    with_signature(x, |mut y| Box::new(y.next()))","highlight_start":23,"highlight_end":49}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:26 ~ projection_no_regions_closure[317d]::outlives_region[0]::{{closure}}[0]) with closure substs [\n    '_#1r,\n    '_#2r,\n    T,\n    i32,\n    extern \"rust-call\" fn((std::boxed::Box<T, std::alloc::Global>,)) -> std::boxed::Box<(dyn Anything + '_#3r), std::alloc::Global>\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 4","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where <T as std::iter::Iterator>::Item: '_#3r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs:52:23\n   |\nLL |     with_signature(x, |mut y| Box::new(y.next()))\n   |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: defining type: DefId(0/1:26 ~ projection_no_regions_closure[317d]::outlives_region[0]::{{closure}}[0]) with closure substs [\n               '_#1r,\n               '_#2r,\n               T,\n               i32,\n               extern \"rust-call\" fn((std::boxed::Box<T, std::alloc::Global>,)) -> std::boxed::Box<(dyn Anything + '_#3r), std::alloc::Global>\n           ]\n   = note: number of external vids: 4\n   = note: where <T as std::iter::Iterator>::Item: '_#3r\n\n"}
[01:01:00] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs","byte_start":1135,"byte_end":1295,"line_start":47,"line_end":53,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn outlives_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a>","highlight_start":1,"highlight_end":67},{"text":"where","highlight_start":1,"highlight_end":6},{"text":"    T: 'b + Iterator,","highlight_start":1,"highlight_end":22},{"text":"    'b: 'a,","highlight_start":1,"highlight_end":12},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"    with_signature(x, |mut y| Box::new(y.next()))","highlight_start":1,"highlight_end":50},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:9 ~ projection_no_regions_closure[317d]::outlives_region[0]) with substs [\n    '_#1r,\n    '_#2r,\n    T\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs:47:1\n   |\nLL | / fn outlives_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a>\nLL | | where\nLL | |     T: 'b + Iterator,\nLL | |     'b: 'a,\nLL | | {\nLL | |     with_signature(x, |mut y| Box::new(y.next()))\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:9 ~ projection_no_regions_closure[317d]::outlives_region[0]) with substs [\n               '_#1r,\n               '_#2r,\n               T\n           ]\n\n"}
[01:01:00] {"message":"For more information about this error, try `rustc --explain E0309`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0309`.\n"}
[01:01:00] 
[01:01:00] ------------------------------------------
[01:01:00] 
---
[01:01:00] 
[01:01:00] 8                '_#1r,
[01:01:00] 9                T,
[01:01:00] 10                i32,
[01:01:00] -                extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<(dyn std::fmt::Debug + '_#2r)>
[01:01:00] +                extern "rust-call" fn((std::boxed::Box<T, std::alloc::Global>,)) -> std::boxed::Box<(dyn std::fmt::Debug + '_#2r), std::alloc::Global>
[01:01:00] 12            ]
[01:01:00] 13    = note: number of external vids: 3
[01:01:00] 14    = note: where T: '_#2r
[01:01:00] 
[01:01:00] The actual stderr differed from the expected stderr.
[01:01:00] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type/ty-param-closure-outlives-from-return-type.stderr
[01:01:00] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type/ty-param-closure-outlives-from-return-type.stderr
[01:01:00] To update references, rerun the tests and pass the `--bless` flag
[01:01:00] To only update this specific test, also pass `--test-args nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs`
[01:01:00] error: 1 errors occurred comparing output.
[01:01:00] status: exit code: 1
[01:01:00] status: exit code: 1
[01:01:00] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zborrowck=mir" "-Zverbose" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type/auxiliary" "-A" "unused"
[01:01:00] ------------------------------------------
[01:01:00] 
[01:01:00] ------------------------------------------
[01:01:00] stderr:
[01:01:00] stderr:
[01:01:00] ------------------------------------------
[01:01:00] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs","byte_start":754,"byte_end":759,"line_start":26,"line_end":26,"column_start":23,"column_end":28,"is_primary":true,"text":[{"text":"    with_signature(x, |y| y)","highlight_start":23,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/1:14 ~ ty_param_closure_outlives_from_return_type[317d]::no_region[0]::{{closure}}[0]) with closure substs [\n    '_#1r,\n    T,\n    i32,\n    extern \"rust-call\" fn((std::boxed::Box<T, std::alloc::Global>,)) -> std::boxed::Box<(dyn std::fmt::Debug + '_#2r), std::alloc::Global>\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"number of external vids: 3","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"where T: '_#2r","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs:26:23\n   |\nLL |     with_signature(x, |y| y)\n   |                       ^^^^^\n   |\n   = note: defining type: DefId(0/1:14 ~ ty_param_closure_outlives_from_return_type[317d]::no_region[0]::{{closure}}[0]) with closure substs [\n               '_#1r,\n               T,\n               i32,\n               extern \"rust-call\" fn((std::boxed::Box<T, std::alloc::Global>,)) -> std::boxed::Box<(dyn std::fmt::Debug + '_#2r), std::alloc::Global>\n           ]\n   = note: number of external vids: 3\n   = note: where T: '_#2r\n\n"}
[01:01:00] {"message":"No external requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs","byte_start":263,"byte_end":825,"line_start":15,"line_end":28,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn no_region<'a, T>(x: Box<T>) -> Box<dyn Debug + 'a>","highlight_start":1,"highlight_end":54},{"text":"where","highlight_start":1,"highlight_end":6},{"text":"    T: Debug,","highlight_start":1,"highlight_end":14},{"text":"{","highlight_start":1,"highlight_end":2},{"text":"    // Here, the closure winds up being required to prove that `T:","highlight_start":1,"highlight_end":67},{"text":"    // 'a`.  In principle, it could know that, except that it is","highlight_start":1,"highlight_end":65},{"text":"    // type-checked in a fully generic way, and hence it winds up with","highlight_start":1,"highlight_end":71},{"text":"    // a propagated requirement that `T: '_#2`, where `'_#2` appears","highlight_start":1,"highlight_end":69},{"text":"    // in the return type. The caller makes the mapping from `'_#2` to","highlight_start":1,"highlight_end":71},{"text":"    // `'a` (and subsequently reports an error).","highlight_start":1,"highlight_end":49},{"text":"","highlight_start":1,"highlight_end":1},{"text":"    with_signature(x, |y| y)","highlight_start":1,"highlight_end":29},{"text":"    //~^ ERROR the parameter type `T` may not live long enough","highlight_start":1,"highlight_end":63},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"defining type: DefId(0/0:5 ~ ty_param_closure_outlives_from_return_type[317d]::no_region[0]) with substs [\n    '_#1r,\n    T\n]","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"note: No external requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs:15:1\n   |\nLL | / fn no_region<'a, T>(x: Box<T>) -> Box<dyn Debug + 'a>\nLL | | where\nLL | |     T: Debug,\nLL | | {\n...  |\nLL | |     //~^ ERROR the parameter type `T` may not live long enough\nLL | | }\n   | |_^\n   |\n   = note: defining type: DefId(0/0:5 ~ ty_param_closure_outlives_from_return_type[317d]::no_region[0]) with substs [\n               '_#1r,\n               T\n           ]\n\n"}
[01:01:00] {"message":"the parameter type `T` may not live long enough","code":{"code":"E0309","explanation":"\nThe type definition contains some field whose type\nrequires an outlives annotation. Outlives annotations\n(e.g., `T: 'a`) are used to guarantee that all the data in T is valid\nfor at least the lifetime `'a`. This scenario most commonly\narises when the type contains an associated type reference\nlike `<T as SomeTrait<'a>>::Output`, as shown in this example:\n\n```compile_fail,E0309\n// This won't compile because the applicable impl of\n// `SomeTrait` (below) requires that `T: 'a`, but the struct does\n// not have a matching where-clause.\nstruct Foo<'a, T> {\n    foo: <T as SomeTrait<'a>>::Output,\n}\n\ntrait SomeTrait<'a> {\n    type Output;\n}\n\nimpl<'a, T> SomeTrait<'a> for T\nwhere\n    T: 'a,\n{\n    type Output = u32;\n}\n```\n\nHere, the where clause `T: 'a` that appears on the impl is not known to be\nsatisfied on the struct. To make this example compile, you have to add\na where-clause like `T: 'a` to the struct definition:\n\n```\nstruct Foo<'a, T>\nwhere\n    T: 'a,\n{\n    foo: <T as SomeTrait<'a>>::Output\n}\n\ntrait SomeTrait<'a> {\n    type Output;\n}\n\nimpl<'a, T> SomeTrait<'a> for T\nwhere\n    T: 'a,\n{\n    type Output = u32;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs","byte_start":754,"byte_end":759,"line_start":26,"line_end":26,"column_start":23,"column_end":28,"is_primary":true,"text":[{"text":"    with_signature(x, |y| y)","highlight_start":23,"highlight_end":28}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`...","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0309]: the parameter type `T` may not live long enough\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs:26:23\n   |\nLL |     with_signature(x, |y| y)\n   |                       ^^^^^\n   |\n   = help: consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`...\n\n"}
[01:01:00] {"message":"the parameter type `T` may not live long enough","code":{"code":"E0309","explanation":"\nThe type definition contains some field whose type\nrequires an outlives annotation. Outlives annotations\n(e.g., `T: 'a`) are used to guarantee that all the data in T is valid\nfor at least the lifetime `'a`. This scenario most commonly\narises when the type contains an associated type reference\nlike `<T as SomeTrait<'a>>::Output`, as shown in this example:\n\n```compile_fail,E0309\n// This won't compile because the applicable impl of\n// `SomeTrait` (below) requires that `T: 'a`, but the struct does\n// not have a matching where-clause.\nstruct Foo<'a, T> {\n    foo: <T as SomeTrait<'a>>::Output,\n}\n\ntrait SomeTrait<'a> {\n    type Output;\n}\n\nimpl<'a, T> SomeTrait<'a> for T\nwhere\n    T: 'a,\n{\n    type Output = u32;\n}\n```\n\nHere, the where clause `T: 'a` that appears on the impl is not known to be\nsatisfied on the struct. To make this example compile, you have to add\na where-clause like `T: 'a` to the struct definition:\n\n```\nstruct Foo<'a, T>\nwhere\n    T: 'a,\n{\n    foo: <T as SomeTrait<'a>>::Output\n}\n\ntrait SomeTrait<'a> {\n    type Output;\n}\n\nimpl<'a, T> SomeTrait<'a> for T\nwhere\n    T: 'a,\n{\n    type Output = u32;\n}\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs","byte_start":1006,"byte_end":1007,"line_start":41,"line_end":41,"column_start":5,"column_end":6,"is_primary":true,"text":[{"text":"    x","highlight_start":5,"highlight_end":6}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`...","code":null,"level":"help","spans":[],"children":[],"rendered":null}],"rendered":"error[E0309]: the parameter type `T` may not live long enough\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs:41:5\n   |\nLL |     x\n   |     ^\n   |\n   = help: consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`...\n\n"}
[01:01:00] {"message":"For more information about this error, try `rustc --explain E0309`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0309`.\n"}
[01:01:00] 
[01:01:00] ------------------------------------------
[01:01:00] 
---
[01:01:00] 
[01:01:00] thread 'main' panicked at 'Some tests failed', src/tools/compiletest/src/main.rs:496:22
[01:01:00] 
[01:01:00] 
[01:01:00] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/ui" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "ui" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-6.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "6.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:01:00] 
[01:01:00] 
[01:01:00] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:01:00] Build completed unsuccessfully in 0:04:08
[01:01:00] Build completed unsuccessfully in 0:04:08
[01:01:00] make: *** [check] Error 1
[01:01:00] Makefile:48: recipe for target 'check' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:1b348624
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Wed Feb 13 09:59:51 UTC 2019

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

@glandium
Copy link
Contributor Author

Surprisingly, #52694 seems to be gone...

@glandium glandium closed this Feb 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants