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 #50882

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
10 participants
@glandium
Contributor

glandium commented May 19, 2018

This turns Box<T> into Box<T, A: Alloc = Global>. This is a
minimalist change to achieve this, not touching anything that could have
backwards incompatible consequences like requiring type annotations in
places where they currently aren't required,
per #50822 (comment)

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented May 19, 2018

r? @bluss

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

@glandium

This comment has been minimized.

Contributor

glandium commented May 19, 2018

Note this has trivial conflicts with PR #50880, so whichever goes in first will need the other to be rebased on top of it.

@rust-highfive

This comment was marked as resolved.

Collaborator

rust-highfive commented May 19, 2018

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

Click to expand the log.
Check compiletest suite=ui mode=ui (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[00:44:26] 
[00:44:26] running 1436 tests
[00:44:31] .......................................................................................i............
[00:44:36] ......................................i.......................................................F.....
[00:44:44] ....................................................................................................
[00:44:47] ....................................................................................................
[00:44:50] ....................................................................................................
[00:44:50] ....................................................................................................
[00:44:55] .....................................................................F.............................F
[00:45:04] ....................................................................................................
[00:45:04] ....................................................................................................
[00:45:09] ............................................................iF......................................
[00:45:14] .........................F.....F.....i..............................................................
[00:45:24] ....................................................................................................
[00:45:30] ..........................................................i.........................................
[00:45:30] ..........................................................i.........................................
[00:45:32] .............F......................
[00:45:32] 
[00:45:32] ---- [ui] ui/e0119/conflict-with-std.rs stdout ----
[00:45:32] diff of stderr:
[00:45:32] 
[00:45:32] 
[00:45:32] 5    | ^^^^^^^^^^^^^^^^^^^^^^^^
[00:45:32] 6    |
[00:45:32] 7    = note: conflicting implementation in crate `alloc`:
[00:45:32] -            - impl<T> std::convert::AsRef<T> for std::boxed::Box<T>
[00:45:32] -              where T: ?Sized;
[00:45:32] +            - impl<T, A> std::convert::AsRef<T> for std::boxed::Box<T, A>
[00:45:32] +              where A: std::heap::Alloc, T: ?Sized;
[00:45:32] 10 
[00:45:32] 11 error[E0119]: conflicting implementations of trait `std::convert::From<S>` for type `S`:
[00:45:32] 
[00:45:32] 
[00:45:32] The actual stderr differed from the expected stderr.
[00:45:32] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/e0119/conflict-with-std/conflict-with-std.stderr
[00:45:32] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/e0119/conflict-with-std/conflict-with-std.stderr
[00:45:32] To update references, rerun the tests and pass the `--bless` flag
[00:45:32] To only update this specific test, also pass `--test-args e0119/conflict-with-std.rs`
[00:45:32] error: 1 errors occurred comparing output.
[00:45:32] error: 1 errors occurred comparing output.
[00:45:32] stat 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/e0119/conflict-with-std.rs","byte_start":567,"byte_end":591,"line_start":17,"line_end":17,"column_start":1,"column_end":25,"is_primary":true,"text":[{"text":"impl AsRef<Q> for Box<Q> { //~ ERROR conflicting implementations","highlight_start":1,"highlight_end":25}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"conflicting implementation in crate `alloc`:\n- impl<T, A> std::convert::AsRef<T> for std::boxed::Box<T, A>\n  where A: std::heap::Alloc, T: ?Sized;","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0119]: conflicting implementations of trait `std::convert::AsRef<Q>` for type `std::boxed::Box<Q>`:\n  --> /checkout/src/test/ui/e0119/conflict-with-std.rs:17:1\n   |\nLL | impl AsRef<Q> for Box<Q> { //~ ERROR conflicting implementations\n   | ^^^^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: conflicting implementation in crate `alloc`:\n           - impl<T, A> std::convert::AsRef<T> for std::boxed::Box<T, A>\n             where A: std::heap::Alloc, T: ?Sized;\n\n"}
[00:45:32] {"messa"highlight_end":19}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"conflicting implementation in crate `core`:\n- impl<T> std::convert::From<T> for T;","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0119]: conflicting implementations of trait `std::convert::From<S>` for type `S`:\n  --> /checkout/src/test/ui/e0119/conflict-with-std.rs:24:1\n   |\nLL | impl From<S> for S { //~ ERROR conflicting implementations\n   | ^^^^^^^^^^^^^^^^^^\n   |\n   = note: conflicting implementation in crate `core`:\n           - impl<T> std::convert::From<T> for T;\n\n"}
[00:45:32] {"message":"conflicting implementations of trait `std::convert::TryFrom<X>` for type `X`:","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/e0119/conflict-with-std.rs","byte_start":809,"byte_end":830,"line_start":31,"line_end":31,"column_start":1,"column_end":22,"is_primary":true,"text":[{"text":"impl TryFrom<X> for X { //~ ERROR conflicting implementations","highlight_start":1,"highlight_end":22}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[{"message":"conflicting implementation in crate `core`:\n- impl<T, U> std::convert::TryFrom<U> for T\n  where T: std::convert::From<U>;","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0119]: conflicting implementations of trait `std::convert::TryFrom<X>` for type `X`:\n  --> /checkout/src/test/ui/e0119/conflict-with-std.rs:31:1\n   |\nLL | impl TryFrom<X> for X { //~ ERROR conflicting implementations\n   | ^^^^^^^^^^^^^^^^^^^^^\n   |\n   = note: conflicting implementation in crate `core`:\n           - impl<T, U> std::convert::TryFrom<U> for T\n             where T: std::convert::From<U>;\n\n"}
[00:45:32] {"message":"aborting due to 3 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 3 previous errors\n\n"}
[00:45:32] {"message":"For more information about this error, try `rustc --explad":964,"line_start":31,"line_end":31,"column_start":1,"column_end":53,"is_primary":true,"text":[{"text":"fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {","highlight_start":1,"highlight_end":53}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":null},{"message":"...so that the expression is assignable:\nexpected std::boxed::Box<std::fmt::Debug, _>\n   found std::boxed::Box<std::fmt::Debug + 'a, _>","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"but, the lifetime must be valid for the static lifetime...","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"...so that the types are compatible:\nexpected StaticTrait\n   found StaticTrait","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements\n  --> /checkout/src/test/ui/in-band-lifetimes/impl/dyn-trait.rs:32:16\n   |\nLL |     static_val(x); //~ ERROR cannot infer\n   |                ^\n   |\nnote: first, the lifetime cannot outlive the lifetime 'a as defined on the function body at 31:1...\n  --> /checkout/src/test/ui/in-band-lifetimes/impl/dyn-trait.rs:31:1\n   |\nLL | fn with_dyn_debug_static<'a>(x: Box<dyn Debug + 'a>) {\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n   = note: ...so that the expression is assignable:\n           expected std::boxed::Box<std::fmt::Debug, _>\n              found std::boxed::Box<std::fmt::Debug + 'a, _>\n   = note: but, the lifetime must be valid for the static lifetime...\n   = note: ...so that the types are compatible:\n           expected StaticTrait\n              found StaticTrait\n\n"}
[00:45:32] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:45:32] {"message":"For more information about this error, try `rustc --explain E0495`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0495`.\n"}
[00:45:32] ------------------------------------------
[00:45:32] 
[00:45:32] thread '[ui] ui/in-band-lifetimes/impl/dyn-trait.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3042:9
[00:45:32] 
[00:45:32] 
[00:45:32] ---- [ui] ui/issue-14092.rs stdout ----
[00:45:32] diff of stderr:
[00:45:32] 
[00:45:32] - error[E0243]: wrong number of type arguments: expected 1, found 0
[00:45:32] + error[E0243]: wrong number of type arguments: expected at least 1, found 0
[00:45:32] 2   --> $DIR/issue-14092.rs:11:11
[00:45:32] 3    |
[00:45:32] 4 LL | fn fn1(0: Box) {}
[00:45:32] -    |           ^^^ expected 1 type argument
[00:45:32] -    |           ^^^ expected 1 type argument
[00:45:32] +    |           ^^^ expected at least 1 type argument
[00:45:32] 7 error: aborting due to previous error
[00:45:32] 8 
[00:45:32] 
[00:45:32] 
[00:45:32] 
[00:45:32] The actual stderr differed from the expected stderr.
[00:45:32] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issue-14092/issue-14092.stderr
[00:45:32] To update references, rerun the tests and pass the `--bless` flag
[00:45:32] To only update this specific test, also pass `--test-args issue-14092.rs`
[00:45:32] error: 1 errors occurred comparing output.
[00:45:32] status: exit code: 101
[00:45:32] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[00:45:32] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[00:45:32] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/issue-14092.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/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/issue-14092/auxiliary" "-A" "unused"
[00:45:32] ------------------------------------------
[00:45:32] 
[00:45:32] ------------------------------------------
[00:45:32] stderr:
[00:45:32] stderr:
[00:45:32] ------------------------------------------
[00:45:32] {"message":"wrong number of type arguments: expected at least 1, found 0","code":{"code":"E0243","explanation":"\nThis error indicates that not enough type parameters were found in a type or\ntrait.\n\nFor example, the `Foo` struct below is defined to be generic in `T`, but the\ntype parameter is missing in the definition of `Bar`:\n\n```compile_fail,E0243\nstruct Foo<T> { x: T }\n\nstruct Bar { x: Foo }\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/issue-14092.rs","byte_start":477,"byte_end":480,"line_start":11,"line_end":11,"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 t actual stderr differed from the expected stderr.
[00:45:32] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/mismatched_types/trait-bounds-cant-coerce/trait-bounds-cant-coerce.stderr
[00:45:32] To update references, rerun the tests and pass the `--bless` flag
[00:45:32] To only update this specific test, also pass `--test-args mismatched_types/trait-bounds-cant-coerce.rs`
[00:45:32] error: 1 errors occurred comparing output.
[00:45:32] status: exit code: 101
[00:45:32] status: exit code: 101
[00:45:32] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/mismatched_types/trait-bounds-cant-coerce.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/mismatched_types/trait-bounds-cant-coerce/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/mismatched_types/trait-bounds-cant-coerce/auxiliary" "-A" "unused"
[00:45:32] ------------------------------------------
[00:45:32] 
[00:45:32] ------------------------------------------
[00:45:32] stderr:
[00:45:32] stderr:
[00:45:32] ------------------------------------------
[00:45:32] {"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 expre-explain E0308`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0308`.\n"}
[00:45:32] ------------------------------------------
[00:45:32] 
[00:45:32] thread '[ui] ui/mismatched_types/trait-bounds-cant-coerce.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3042:9
[00:45:32] 
[00:45:32] 
[00:45:32] ---- [ui] ui/nll/ty-outlives/projection-no-regions-closure.rs stdout ----
[00:45:32] diff of stderr:
[00:45:32] 
[00:45:32] 20                '_#1r,
[00:45:32] 21                T,
[00:45:32] 22                i32,
[00:45:32] -                extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<Anything + '_#2r>
[00:45:32] +                extern "rust-call" fn((std::boxed::Box<T, std::heap::Global>,)) -> std::boxed::Box<Anything + '_#2r, std::heap::Global>
[00:45:32] 24            ]
[00:45:32] 25    = note: number of external vids: 3
[00:45:32] 26    = note: where <T as std::iter::Iterator>::Item: '_#2r
[00:45:32] 60                '_#1r,
[00:45:32] 61                T,
[00:45:32] 62                i32,
[00:45:32] 62                i32,
[00:45:32] -                extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<Anything + '_#2r>
[00:45:32] +                extern "rust-call" fn((std::boxed::Box<T, std::heap::Global>,)) -> std::boxed::Box<Anything + '_#2r, std::heap::Global>
[00:45:32] 64            ]
[00:45:32] 65    = note: number of external vids: 3
[00:45:32] 66    = note: where <T as std::iter::Iterator>::Item: '_#2r
[00:45:32] 92                '_#2r,
[00:45:32] 93                T,
[00:45:32] 93                T,
[00:4/ty-outlives/projection-no-regions-closure.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/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"
[00:45:32] ------------------------------------------
[00:45:32] 
[00:45:32] ------------------------------------------
[00:45:32] stderr:
[00:45:32] stderr:
[00:45:32] ------------------------------------------
[00:45:32] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs","byte_start":1046,"byte_end":1064,"line_start":35,"line_end":35,"column_start":31,"column_end":49,"is_primary":true,"text":[{"text":"    with_signature(x, |mut y| Box::new(y.next()))","highlight_start":31,"highlight_end":49}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs:35:31\n   |\nLL |     with_signature(x, |mut y| Box::new(y.next()))\n   |                               ^^^^^^^^^^^^^^^^^^\n\n"}
[00:45:32] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outliverendered":null}],"rendered":"note: External requirements\n  --> /checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs:35: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::heap::Global>,)) -> std::boxed::Box<Anything + '_#2r, std::heap::Global>\n           ]\n   = note: number of external vids: 3\n   = note: where <T as std::iter::Iterator>::Item: '_#2r\n\n"}
[00:45:32] {"message":"the associated type `<T as std::iter::Iterator>::Item` may not live long enough","code":{"code":"E0309","explanation":"\nTypes in type definitions have lifetimes associated with them that represent\nhow long the data stored within them is guaranteed to be live. This lifetime\nmust be as long as the data needs to be alive, and missing the constraint that\ndenotes this will cause this error.\n\n```compile_fail,E0309\n// This won't compile because T is not constrained, meaning the data\n// stored in it is not guaranteed to last as long as the reference\nstruct Foo<'a, T> {\n    foo: &'a T\n}\n```\n\nThis will compile, because it has the constraint on the type parameter:\n\n```\nstruct Foo<'a, T: 'a> {\n    foo: &'a T\n}\n```\n\nTo see why this is important, consider the case where `T` is itself a reference\n(e.g., `T = &str`). If we don't include the restriction that `T: 'a`, the\nfollowing code would be phighlight_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":"    //~^ WARNING not reporting region error due to nll","highlight_start":1,"highlight_end":55},{"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,"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:31:1\n   |\nLL | / fn no_region<'a, T>(x: Box<T>) -> Box<dyn Anything + 'a>\nLL | | where\nLL | |     T: Iterator,\nLL | | {\n...  |\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"}
[00:45:32] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs","byte_start":1350,"byte_end":1376,"line_start":45,"line_end":45,"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,"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::heap::Global>,)) -> std::boxed::Box<Anything + '_#2r, std::heap::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:45: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::heap::Global>,)) -> std::boxed::Box<Anything + '_#2r, std::heap::Global>\n           ]\n   = note: number of external vids: 3\n   = note: where <T as std::iter::Iterator>::Item: '_#2r\n\n"}
[00:45:32] {"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":1236,"byte_end":1379,"line_start":41,"line_end":46,"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,"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:41: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"}
[00:45:32] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs","byte_start":1514,"byte_end":1540,"line_start":53,"line_end":53,"column_star_#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:49:1\n   |\nLL | / fn wrong_region<'a, 'b, T>(x: Box<T>) -> Box<dyn Anything + 'a>\nLL | | where\nLL | |     T: 'b + Iterator,\nLL | | {\n...  |\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"}
[00:45:32] {"message":"External requirements","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/projection-no-regions-closure.rs","byte_start":1843,"byte_end":1869,"line_start":64,"line_end":64,"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,"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::heap::Global>,)) -> std::boxed::Box<Anything + '_#3r, std::heap::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:64: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::heap::Global>,)) -> std::boxed::Box<Anything + '_#3r, std::heap::Global>\n           ]\n   = note: number of external vids: 4\n   = note: where <T as std::iter::Iterator>::Item: '_#3r\n\n"}
[00:45:32] {"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":1712,"byte_end":1872,"line_start":59,"line_end":65,"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,"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:59: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"}
[00:45:32] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[00:45:32] {"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"}
[00:45:32] ------------------------------------------
[00:45:32] 
[00:45:32] thread '[ui] ui/nll/ty-outlives/projection-no-regions-closure.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3042:9
[00:45:32] 
[00:45:32] 
[00:45:32] ---- [ui] ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs stdout ----
[00:45:32] diff of stderr:
[00:45:32] 
[00:45:32] 20                '_#1r,
[00:i/nll/ty-outlives/ty-param-closure-outlives-from-return-type/auxiliary" "-A" "unused"
[00:45:32] ------------------------------------------
[00:45:32] 
[00:45:32] ------------------------------------------
[00:45:32] stderr:
[00:45:32] stderr:
[00:45:32] ------------------------------------------
[00:45:32] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs","byte_start":1225,"byte_end":1226,"line_start":36,"line_end":36,"column_start":27,"column_end":28,"is_primary":true,"text":[{"text":"    with_signature(x, |y| y)","highlight_start":27,"highlight_end":28}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs:36:27\n   |\nLL |     with_signature(x, |y| y)\n   |                           ^\n\n"}
[00:45:32] {"message":"not reporting region error due to nll","code":null,"level":"warning","spans":[{"file_name":"/checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs","byte_start":1528,"byte_end":1529,"line_start":52,"line_end":52,"column_start":5,"column_end":6,"is_primary":true,"text":[{"text":"    x","highlight_start":5,"highlight_end":6}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":"warning: not reporting region error due to nll\n  --> /checkout/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.rs:52:5\n   |\nLL |     x\n   ote: number of external vids: 3\n   = note: where T: '_#2r\n\n"}
[00:45:32] {"message":"the parameter type `T` may not live long enough","code":{"code":"E0309","explanation":"\nTypes in type definitions have lifetimes associated with them that represent\nhow long the data stored within them is guaranteed to be live. This lifetime\nmust be as long as the data needs to be alive, and missing the constraint that\ndenotes this will cause this error.\n\n```compile_fail,E0309\n// This won't compile because T is not constrained, meaning the data\n// stored in it is not guaranteed to last as long as the reference\nstruct Foo<'a, T> {\n    foo: &'a T\n}\n```\n\nThis will compile, because it has the constraint on the type parameter:\n\n```\nstruct Foo<'a, T: 'a> {\n    foo: &'a T\n}\n```\n\nTo see why this is important, consider the case where `T` is itself a reference\n(e.g., `T = &str`). If we don't include the restriction that `T: 'a`, the\nfollowing code would be perfectly legal:\n\n```compile_fail,E0309\nstruct Foo<'a, T> {\n    foo: &'a T\n}\n\nfn main() {\n    let v = \"42\".to_string();\n    let f = Foo{foo: &v};\n    drop(v);\n    println!(\"{}\", f.foo); // but we've already dropped v!\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":1221,"byte_end":1226,"line_start":36,"line_end":36,"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,"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:36:23\n   |\nLL |     with_signature(x, |y| y)\n   |                       ^^^^^\n   |\n   = help: consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`...\n\n"}
[00:45:32] {"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":730,"byte_end":1347,"line_start":25,"line_end":39,"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":"    //~^ WARNING not reporting region error due to nll","highlight_start":1,"highlight_end":55},{"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,"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:25: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"}
[00:45:32] {"message":"the parameter type `T` may not live long enough","code":{"code":"E0309","explanation":"\nTypes in type definitions have lifetimes associated with them that represent\nhow long the data stored within them is guaranteed to be live. This lifetime\nmust be as long as the data needs to be alive, and missing the constraint that\ndenotes this will cause this error.\n\n```compile_fail,E0309\n// This won't compile because T is not constrained, meaning the data\n// stored in it is not guaranteed to last as long as the reference\nstruct Foo<'a, T> {\n    foo: &'a T\n}\n```\n\nThis will compile, because it has the constraint on the type parameter:\n\n```\nstruct Foo<'a, T: 'a> {\n    foo: &'a T\n}\n```\n\nTo see why this is important, consider the case where `T` is itself a reference\n(e.g., `T = &str`). If we don't include the restriction that `T: 'a`, the\nfollowing code would be perfectly legal:\n\n```compile_fail,E0309\nstruct Foo<'a, T> {\n    foo: &'a T\n}\n\nfn main() {\n    let v = \"42\".to_string();\n    let f = Foo{foo: &v};\n    drop(v);\n    println!(\"{}\", f.foo); // but we've already dropped v!\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":1528,"byte_end":1529,"line_start":52,"line_end":52,"column_start":5,"column_end":6,"is_primary":true,"text":[{"text":"    x","highlight_start":5,"highlight_end":6}],"label":null,"suggested_replacement":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:52:5\n   |\nLL |     x\n   |     ^\n   |\n   = help: consider adding an explicit lifetime bound `T: ReEarlyBound(0, 'a)`...\n\n"}
[00:45:32] {"message":"aborage":"first, the lifetime cannot outlive the anonymous lifetime #1 defined on the function body at 16:1...","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/underscore-lifetime/dyn-trait-underscore.rs","byte_start":599,"byte_end":812,"line_start":16,"line_end":19,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {","highlight_start":1,"highlight_end":53},{"text":"    //                      ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static`","highlight_start":1,"highlight_end":85},{"text":"    Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime","highlight_start":1,"highlight_end":74},{"text":"}","highlight_start":1,"highlight_end":2}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":null},{"message":"...so that reference does not outlive borrowed content","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/underscore-lifetime/dyn-trait-underscore.rs","byte_start":750,"byte_end":755,"line_start":18,"line_end":18,"column_start":14,"column_end":19,"is_primary":true,"text":[{"text":"    Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime","highlight_start":14,"highlight_end":19}],"label":null,"suggested_replacement":null,"expansion":null}],"children":[],"rendered":null},{"message":"but, the lifetime must be valid for the static lifetime...","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"...so that the expression is assignable:\nexpected std::boxed::Box<std::iter::Iterator<Item=&T> + 'static, _>\n   found std::boxed::Box<std::iter::Iterator<Item=&T>, _>","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"error[E0495]: cannot infer an appropriate lifetime for autoref due to conflicting requirements\n  --> /checkout/src/test/ui/underscore-lifetime/dyn-trait-underscore.rs:18:20\n   |\nLL |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime\n   |                    ^^^^\n   |\nnote: first, the lifetime cannot outlive the anonymous lifetime #1 defined on the function body at 16:1...\n  --> /checkout/src/test/ui/underscore-lifetime/dyn-trait-underscore.rs:16:1\n   |\nLL | / fn a<T>(items: &[T]) -> Box<dyn Iterator<Item=&T>> {\nLL | |     //                      ^^^^^^^^^^^^^^^^^^^^^ bound *here* defaults to `'static`\nLL | |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime\nLL | | }\n   | |_^\nnote: ...so that reference does not outlive borrowed content\n  --> /checkout/src/test/ui/underscore-lifetime/dyn-trait-underscore.rs:18:14\n   |\nLL |     Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime\n   |              ^^^^^\n   = note: but, the lifetime must be valid for the static lifetime...\n   = note: ...so that the expression is assignable:\n           expected std::boxed::Box<std::iter::Iterator<Item=&T> + 'static, _>\n              found std::boxed::Box<std::iter::Iterator<Item=&T>, _>\n\n"}
[00:45:32] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:45:32] {"message":"For more information about this error, try `rustc --explain E0495`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0495`.\n"}
[00:45:32] ------------------------------------------
[00:45:32] 
[00:45:32] thread '[ui] ui/underscore-lifetime/dyn-trait-underscore.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3042:9
[00:45:32] 
---
[00:45:32] test result: FAILED. 1422 passed; 7 failed; 7 ignored; 0 measured; 0 filtered out
[00:45:32] 
[00:45:32] 
[00:45:32] 
[00:45:32] 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"[00:45:32] make: *** [check] Error 1
[00:45:32] Makefile:58: recipe for target 'check' failed

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

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

@glandium glandium force-pushed the glandium:box branch from 096f701 to e726409 May 19, 2018

@rust-highfive

This comment was marked as resolved.

Collaborator

rust-highfive commented May 19, 2018

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

Click to expand the log.
[00:44:30] ....................................................................................................
[00:44:33] ....................................................................................................
[00:44:36] ....................................................................................................
[00:44:40] ....................................................................................................
[00:44:44] .....................................................................F.............................F
[00:44:53] ....................................................................................................
[00:44:53] ....................................................................................................
[00:44:58] ............................................................iF......................................
[00:45:03] .........................F.....F.....i..............................................................
[00:45:12] ....................................................................................................
[00:45:19] ..........................................................i.........................................
this error, try `rustc --explain E0308`.\n"}
[00:45:20] 
[00:45:20] 
[00:45:20] ------------------------------------------
[00:45:20] 
[00:45:20] thread '[ui] ui/mismatched_types/trait-bounds-cant-coerce.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3042:9
[00:45:20] 
[00:45:20] ---- [ui] ui/nll/ty-outlives/projection-no-regions-closure.rs stdout ----
[00:45:20] diff of stderr:
[00:45:20] 
[00:45:20] 92                '_#2r,
[00:45:20] 93                T,
[00:45:20] 94                i32,
[00:45:20] -                extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<Anything + '_#3r>
[00:45:20] +                extern "rust-call" fn((std::boxed::Box<T, std::heap::Global>,)) -> std::boxed::Box<Anything + '_#3r, std::heap::Global>
[00:45:20] 96            ]
[00:45:20] 97    = note: number of external vids: 4
[00:45:20] 98    = note: where <T as std::iter::Iterator>::Item: '_#3r
[00:45:20] 134                '_#2r,
[00:45:20] 135                T,
[00:45:20] 136                i32,
[00:45:20] 136                i32,
[00:45:20] -                extern "rust-call" fn((std::boxed::Box<T>,)) -> std::boxed::Box<Anything + '_#3r>
[00:45:20] +                extern "rust-call" fn((std::boxed::Box<T, std::heap::Global>,)) -> std::boxed::Box<Anything + '_#3r, std::heap::Global>
[00:45:20] 138            ]
[00:45:20] 139    = note: number of external vids: 4
[00:45:20] 140    = note: where <T as std::iter::Iterator>::Item: '_#3r
[00:45:20] 
[00:45:20] The actual stderr differed from the expected stderr.
[00:45:20] The actual stderr differed from the expected stderr.
[00:45:20] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/nll/ty-oue: 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::heap::Global>,)) -> std::boxed::Box<Anything + '_#3r, std::heap::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:64: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::heap::Global>,)) -> std::boxed::Box<Anything + '_#3r, std::heap::Global>\n           ]\n   = note: number of external vids: 4\n   = note: where <T as std::iter::Iterator>::Item: '_#3r\n\n"}
[00:45:20] {"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":1712,"byte_end":1872,"line_start":59,"line_end":65,"column_start":1,"column_end":2,"is_primary":true,"text":[{"text":"fn outlives_region<'a, 'b, T>(x:Iterator<Item=&T> + 'static, _>
[00:45:20] +               found std::boxed::Box<std::iter::Iterator<Item=&T>, _>
[00:45:20] 25 error: aborting due to previous error
[00:45:20] 26 
[00:45:20] 
[00:45:20] 
[00:45:20] 
[00:45:20] The actual stderr differed from the expected stderr.
[00:45:20] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/underscore-lifetime/dyn-trait-underscore/dyn-trait-underscore.stderr
[00:45:20] To update references, rerun the tests and pass the `--bless` flag
[00:45:20] To only update this specific test, also pass `--test-args underscore-lifetime/dyn-trait-underscore.rs`
[00:45:20] error: 1 errors occurred comparing output.
[00:45:20] status: exit code: 101
[00:45:20] status: exit code: 101
[00:45:20] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/underscore-lifetime/dyn-trait-underscore.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/underscore-lifetime/dyn-trait-underscore/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/underscore-lifetime/dyn-trait-underscore/auxiliary" "-A" "unused"
[00:45:20] ------------------------------------------
[00:45:20] 
[00:45:20] ------------------------------------------
[00:45:20] stderr:
[00:45:20] stderr:
[00:45:20] ------------------------------------------
[00:45:20] {"message":"cannot infer an appropriate lifetime for autoref due to conflicting requ for the static lifetime...\n   = note: ...so that the expression is assignable:\n           expected std::boxed::Box<std::iter::Iterator<Item=&T> + 'static, _>\n              found std::boxed::Box<std::iter::Iterator<Item=&T>, _>\n\n"}
[00:45:20] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:45:20] {"message":"For more information about this error, try `rustc --explain E0495`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0495`.\n"}
[00:45:20] ------------------------------------------
[00:45:20] 
[00:45:20] thread '[ui] ui/underscore-lifetime/dyn-trait-underscore.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3042:9
[00:45:20] 

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 glandium force-pushed the glandium:box branch from e726409 to ddfbc0a May 19, 2018

@glandium

This comment has been minimized.

Contributor

glandium commented May 19, 2018

The various UI test changes raise the interesting question whether the compiler should "hide" default generic params in error messages.

@rust-highfive

This comment was marked as resolved.

Collaborator

rust-highfive commented May 19, 2018

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

Click to expand the log.
[00:56:09] ....................................................................................................
[00:56:15] .i..................................................................................................
[00:56:21] i..ii...............................................................................................
[00:56:28] ....................................................................................................
[00:56:33] ............................................................................................F.......
[00:56:42] ......................i.............................................................................
[00:56:42] ......................i.............................................................................
[00:56:47] .................F..........................................................................F.......
[00:56:55] ....................................................................................................
[00:56:55] ..................
[00:56:55] failures:
[00:56:55] 
[00:56:55] 
[00:56:55] ---- [compile-fail] compile-fail/regions-infer-paramd-indirect.rs stdout ----
[00:56:55] 
[00:56:55] error: /checkout/src/test/compile-fail/regions-infer-paramd-indirect.rs:33: expected message not found: expected type `std::boxed::Box<std::boxed::Box<&'a isize>>`
[00:56:55] 
[00:56:55] error: /checkout/src/test/compile-fail/regions-infer-paramd-indirect.rs:33: expected message not found: found type `std::boxed::Box<std::boxed::Box<&isize>>`
[00:56:55] 
[00:56:55] error: 0 unexpected errors found, 2 expected errors not found
[00:56:55] status: exit code: 101
[00:56:55] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/regions-infer-paramd-indirect.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/regions-infer-paramd-indirect/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/regions-infer-paramd-indirect/auxiliary" "-A" "unused"
[00:56:55] not found errors (from test file): [
[00:56:55]     Error {
[00:56:55]         line_num: 33,
[00:56:55]         kind: None,
[00:56:55]         msg: "expected type `std::boxed::Box<std::boxed::Box<&\'a isize>>`"
[00:56:55]     Error {
[00:56:55]         line_num: 33,
[00:56:55]         kind: None,
[00:56:55]         kind: None,
[00:56:55]         msg: "found type `std::boxed::Box<std::boxed::Box<&isize>>`"
[00:56:55] ]
[00:56:55] 
[00:56:55] thread '[compile-fail] compile-fail/regions-infer-paramd-indirect.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1283:13
[00:56:55] 
[00:56:55] 
[00:56:55] ---- [compile-fail] compile-fail/terr-sorts.rs stdout ----
[00:56:55] 
[00:56:55] error: /checkout/src/test/compile-fail/terr-sorts.rs:21: expected message not found: found type `std::boxed::Box<foo>`
[00:56:55] 
[00:56:55] error: 0 unexpected errors found, 1 expected errors not found
[00:56:55] status: exit code: 101
[00:56:55] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/terr-sorts.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/terr-sorts/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/terr-sorts/auxiliary" "-A" "unused"
[00:56:55] not found errors (from test file): [
[00:56:55]     Error {
[00:56:55]         line_num: 21,
[00:56:55]         kind: None,
[00:56:55]         msg: "found type `std::boxed::Box<foo>`"
[00:56:55] ]
[00:56:55] 
[00:56:55] thread '[compile-fail] compile-fail/terr-sorts.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1283:13
[00:56:55] 
[00:56:55] 
[00:56:55] ---- [compile-fail] compile-fail/type-mismatch-same-crate-name.rs stdout ----
[00:56:55] 
[00:56:55] error: /checkout/src/test/compile-fail/type-mismatch-same-crate-name.rs:32: expected message not found: expected type `std::boxed::Box<main::a::Bar + 'static>`
[00:56:55] 
[00:56:55] error: /checkout/src/test/compile-fail/type-mismatch-same-crate-name.rs:32: expected message not found: found type `std::boxed::Box<main::a::Bar>`
[00:56:55] 
[00:56:55] error: 0 unexpected errors found, 2 expected errors not found
[00:56:55] status: exit code: 101
[00:56:55] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/compile-fail/type-mismatch-same-crate-name.rs" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "-Zui-testing" "-C" "prefer-dynamic" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/type-mismatch-same-crate-name/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail/type-mismatch-same-crate-name/auxiliary" "-A" "unused"
[00:56:55] not found errors (from test file): [
[00:56:55]     Error {
[00:56:55]         line_num: 32,
[00:56:55]         kind: None,
[00:56:55]         msg: "expected type `std::boxed::Box<main::a::Bar + \'static>`"
[00:56:55]     Error {
[00:56:55]         line_num: 32,
[00:56:55]         kind: None,
[00:56:55]         kind: None,
[00:56:55]         msg: "found type `std::boxed::Box<main::a::Bar>`"
[00:56:55] ]
[00:56:55] 
[00:56:55] thread '[compile-fail] compile-fail/type-mismatch-same-crate-name.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:1283:13
[00:56:55] 
---
[00:56:55] 
[00:56:55] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[00:56:55] 
[00:56:55] 
[00:56:55] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/compile-fail" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/compile-fail" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "compile-fail" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-3.9/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "3.9.1\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[00:56:55] 
[00:56:55] 
[00:56:55] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:56:55] Build completed unsuccessfully in 0:13:24
[00:56:55] Build completed unsuccessfully in 0:13:24
[00:56:55] Makefile:58: recipe for target 'check' failed
[00:56:55] make: *** [check] Error 1

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

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

@glandium glandium force-pushed the glandium:box branch from ddfbc0a to 3359246 May 19, 2018

@rust-highfive

This comment was marked as resolved.

Collaborator

rust-highfive commented May 19, 2018

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

Click to expand the log.
[00:55:25] ............................................................................test [run-pass] run-pass/mir_heavy_promoted.rs has been running for over 60 seconds
[00:55:31] ........................
[00:55:45] ....................................................................................................
[00:56:29] ......ii..............................................................i.............................
[00:56:51] .......................i.ii....................................................test [run-pass] run-pass/saturating-float-casts.rs has been running for over 60 seconds
[00:57:28] ...............................iiiiiii..............................................................
[00:57:47] ....................................................................................................
[00:58:01] ....................................................................................................
[00:58:19] ....................................................................................................
---
travis_time:start:test_mir-opt
Check compiletest suite=mir-opt mode=mir-opt (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:00:49] 
[01:00:49] running 50 tests
[01:01:06] ERROR 2018-05-19T11:13:39Z: compiletest::runtest: None
[01:01:11] ...........................................F......
[01:01:11] 
[01:01:11] ---- [mir-opt] mir-opt/validate_2.rs stdout ----
[01:01:11] ---- [mir-opt] mir-opt/validate_2.rs stdout ----
[01:01:11] thread '[mir-opt] mir-opt/validate_2.rs' panicked at 'Did not find expected line, error: Mismatch in lines
[01:01:11] Current block: None
[01:01:11] Actual Line: "        Validate(Acquire, [_2: std::boxed::Box<[i32; 3], std::heap::Global>]);"
[01:01:11] Expected Line: "        Validate(Acquire, [_2: std::boxed::Box<[i32; 3]>]);"
[01:01:11] Test Name: rustc.main.EraseRegions.after.mir
[01:01:11] Expected:
[01:01:11] ... (elided)
[01:01:11] fn main() -> () {
[01:01:11] ... (elided)
[01:01:11]     bb1: {
[01:01:11]         Validate(Acquire, [_2: std::boxed::Box<[i32; 3]>]);
[01:01:11]         Validate(Release, [_2: std::boxed::Box<[i32; 3]>]);
[01:01:11]         _1 = move _2 as std::boxed::Box<[i32]> (Unsize);
[01:01:11]         Validate(Acquire, [_1: std::boxed::Box<[i32]>]);
[01:01:11]         StorageDead(_2);
[01:01:11]         StorageDead(_3);
[01:01:11]         _0 = ();
[01:01:11]         Validate(Release, [_1: std::boxed::Box<[i32]>]);
[01:01:11]         drop(_1) -> [return: bb2, unwind: bb3];
[01:01:11]     }
[01:01:11] ... (elided)
[01:01:11] }
[01:01:11] Actual:
[01:01:11] fn main() -> (){
[01:01:11]     let mut _0: ();
[01:01:11]     scope 1 {
[01:01:11]         let _1: std::boxed::Box<[i32], std::heap::Global>;
[01:01:11]     scope 2 {
[01:01:11]     }
[01:01:11]     }
[01:01:11]     let mut _2: std::boxed::Box<[i32; 3], std::heap::Global>;
[01:01:11]     let mut _3: [i32; 3];
[01:01:11]     bb0: {                              
[01:01:11]         StorageLive(_1);
[01:01:11]         StorageLive(_2);
[01:01:11]         StorageLive(_3);
[01:01:11]         _3 = [const 1i32, const 2i32, const 3i32];
[01:01:11]         Validate(Release, [_2: std::boxed::Box<[i32; 3], std::heap::Global>, _3: [i32; 3]]);
[01:01:11]         _2 = const <std::boxed::Box<T, std::heap::Global>>::new(move _3) -> bb1;
[01:01:11]     }
[01:01:11]     bb1: {                              
[01:01:11]         Validate(Acquire, [_2: std::boxed::Box<[i32; 3], std::heap::Global>]);
[01:01:11]         Validate(Release, [_2: std::boxed::Box<[i32; 3], std::heap::Global>]);
[01:01:11]         _1 = move _2 as std::boxed::Box<[i32], std::heap::Global> (Unsize);
[01:01:11]         Validate(Acquire, [_1: std::boxed::Box<[i32], std::heap::Global>]);
[01:01:11]         StorageDead(_2);
[01:01:11]         StorageDead(_3);
[01:01:11]         _0 = ();
[01:01:11]         Validate(Release, [_1: std::boxed::Box<[i32], std::heap::Global>]);
[01:01:11]         drop(_1) -> [return: bb2, unwind: bb3];
[01:01:11]     }
[01:01:11]     bb2: {                              
[01:01:11]         StorageDead(_1);
[01:01:11]         return;
[01:01:11]     bb3: {
[01:01:11]         resume;
[01:01:11]     }
[01:01:11] }', tools/compiletest/src/runtest.rs:2776:13
---
[01:01:11] 
[01:01:11] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[01:01:11] 
[01:01:11] 
[01:01:11] 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/mir-opt" "--build-base" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/mir-opt" "--stage-id" "stage2-x86_64-unknown-linux-gnu" "--mode" "mir-opt" "--target" "x86_64-unknown-linux-gnu" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/usr/lib/llvm-3.9/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "3.9.1\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[01:01:11] 
[01:01:11] 
[01:01:11] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:01:11] Build completed unsuccessfully in 0:15:04
[01:01:11] Build completed unsuccessfully in 0:15:04
[01:01:11] Makefile:58: recipe for target 'check' failed
[01:01:11] make: *** [check] Error 1

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

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

@glandium glandium force-pushed the glandium:box branch from 3359246 to 62020b2 May 19, 2018

@rust-highfive

This comment was marked as resolved.

Collaborator

rust-highfive commented May 19, 2018

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

Click to expand the log.
Testing alloc stage1 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
[01:05:08]    Compiling libc v0.2.40
[01:05:09]    Compiling rand v0.4.2
[01:05:11]    Compiling alloc v0.0.0 (file:///checkout/src/liballoc)
[01:05:14] error[E0624]: method `into_raw_and_alloc` is private
[01:05:14]     |
[01:05:14]     |
[01:05:14] 195 |             let (ptr, a) = Box::into_raw_and_alloc(slice);
[01:05:14] 
[01:05:14] error[E0308]: mismatched types
[01:05:14]    --> liballoc/vec.rs:645:13
[01:05:14]     |
[01:05:14]     |
[01:05:14] 640 |     pub fn into_boxed_slice(mut self) -> Box<[T]> {
[01:05:14]     |                                          -------- expected `std::boxed::Box<[T]>` because of return type
[01:05:14] ...
[01:05:14] 645 |             buf.into_box()
[01:05:14]     |             ^^^^^^^^^^^^^^ expected struct `std::heap::Global`, found struct `alloc::Global`
[01:05:14]     |
[01:05:14]     = note: expected type `std::boxed::Box<_, std::heap::Global>`
[01:05:14]                found type `std::boxed::Box<_, alloc::Global>`
[01:05:16] error: aborting due to 2 previous errors
[01:05:16] 
[01:05:16] Some errors occurred: E0308, E0624.
[01:05:16] For more information about an error, try `rustc --explain E0308`.
---
103868 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu
103864 ./obj/build/x86_64-unknown-linux-gnu/stage0-tools/x86_64-unknown-linux-gnu/release
103604 ./obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends
103220 ./obj/build/bootstrap/debug/incremental/bootstrap-c730863262pt
103216 ./obj/build/bootstrap/debug/incremental/bootstrap-c730863262pt/s-f16j5w4jts-1guxjqd-1fl9pp8y1eh0p
91808 ./obj/build/x86_64-unknown-linux-gnu/stage1
91784 ./obj/build/x86_64-unknown-linux-gnu/stage1/lib
89792 ./src/llvm/test/CodeGen
89200 ./obj/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps

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 glandium force-pushed the glandium:box branch from 62020b2 to 59d5866 May 20, 2018

@rust-highfive

This comment was marked as resolved.

Collaborator

rust-highfive commented May 20, 2018

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

Click to expand the log.
[01:14:14] error: no #[default_lib_allocator] found but one is required; is libstd not linked?
[01:14:14] 
[01:14:14] 
[01:14:14] running 397 tests
[01:14:35] .............................................................F....F.................................
[01:15:17] ....................................................................................................
te attributes to enable
[01:15:39] 
[01:15:39] 
[01:15:39] error[E0658]: use of unstable library feature 'allocator_api' (see issue #32838)
[01:15:39]  --> boxed.rs:175:18
[01:15:39]   |
[01:15:39] 6 | let x = unsafe { Box::from_raw_in(ptr, Global) };
[01:15:39]   |
[01:15:39]   |
[01:15:39]   = help: add #![feature(allocator_api)] to the crate attributes to enable
[01:15:39] 
[01:15:39] thread 'boxed.rs - boxed::Box<T, A>::from_raw_in (line 172)' panicked at 'couldn't compile the test', librustdoc/test.rs:325:17
[01:15:39] 
[01:15:39] 
[01:15:39] ---- boxed.rs - boxed::Box<T, A>::new_in (line 106) stdout ----
[01:15:39] error[E0425]: cannot find value `Global` in this scope
[01:15:39]  --> boxed.rs:107:27
[01:15:39]   |
[01:15:39] 4 | let five = Box::new_in(5, Global);
[01:15:39]   |                           ^^^^^^ not found in this scope
[01:15:39] help: possible candidates are found in other modules, you can import them into scope
[01:15:39] 3 | use std::alloc::Global;
[01:15:39]   |
[01:15:39] 3 | use std::heap::Global;
[01:15:39]   |
[01:15:39]   |
[01:15:39] 3 | use std::net::Ipv6MulticastScope::Global;
[01:15:39] 
[01:15:39] 
[01:15:39] error[E0658]: use of unstable library feature 'allocator_api' (see issue #32838)
[01:15:39]  --> boxed.rs:107:12
[01:15:39]   |
[01:15:39] 4 | let five = Box::new_in(5, Global);
[01:15:39]   |
[01:15:39]   |
[01:15:39]   = help: add #![feature(allocator_api)] to the crate attributes to enable
[01:15:39] 
[01:15:39] thread 'boxed.rs - boxed::Box<T, A>::necom | grep ^Date: | sed 's/Date: //g' || true)
travis_fold:start:after_failure.1
travis_time:start:02ea71d4

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 glandium force-pushed the glandium:box branch from 59d5866 to 1e5328e May 20, 2018

@glandium

This comment has been minimized.

Contributor

glandium commented May 20, 2018

A few comments now that this is passing tests:

  • Since it's now burried in the test reports noise, I'll link to this previous comment, which still applies: #50882 (comment)
  • I didn't intend for into_raw_and_alloc to be public, but I couldn't find a way to make tests work with it being pub(crate) because the boxed module comes from std in that case.
  • into_raw_and_alloc kind of sucks as a name, so please feel free to bikeshed. I was wondering if into_raw should return a (*mut T, A) when A is not Global and *mut T if it is, but I'm not sure it's worth the extra complexity.
@bors

This comment has been minimized.

Contributor

bors commented May 24, 2018

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

@glandium glandium force-pushed the glandium:box branch from 1e5328e to 9aaeb4f May 24, 2018

@TimNN

This comment has been minimized.

Contributor

TimNN commented May 29, 2018

Triage ping, @bluss / @rust-lang/libs: This PR needs you review, and, I assume, a crater run & FCP.

@alexcrichton

This comment has been minimized.

Member

alexcrichton commented May 29, 2018

We've long wanted to do something like this but we've been hesitant to do so historically due to various compiler bugs (which indeed aren't well tracked!). From the looks of the diff here it seems that error messages related to Box may be getting worse? Since I don't think we get a lot of benefit from landing this as-is (as opposed to having a crates.io crate that does this) that to me at least is fairly serious

@glandium

This comment has been minimized.

Contributor

glandium commented May 29, 2018

There is a crates.io crate that does this, but it can't replace Box. It's only by implementing things in liballoc that we end up figuring out what's good and what's bad about it. See #50882 (comment).

@bors

This comment has been minimized.

Contributor

bors commented May 30, 2018

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

@alexcrichton

This comment has been minimized.

Member

alexcrichton commented May 30, 2018

Sure yeah makes sense, but as a PR to rust is this expected to be merged? I'd personally still be wary of the error message segregation

@alexcrichton

This comment has been minimized.

Member

alexcrichton commented May 30, 2018

Re, degredation*

@glandium

This comment has been minimized.

Contributor

glandium commented May 30, 2018

As a PR to rust, it allows tests to run. A crater run could be useful, for instance. There are some implementation details that still need to be figured out. For example, the current patch doesn't remove the use of the box keyword, so only Box has fn new, while Box<T, A: Alloc + Default> theoretically could have it.

@glandium glandium force-pushed the glandium:box branch from 9aaeb4f to d568c8c May 30, 2018

@pietroalbini

This comment has been minimized.

Member

pietroalbini commented Jun 4, 2018

Ping from triage! How should we move forward with this?

@bors

This comment has been minimized.

Contributor

bors commented Jun 6, 2018

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

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Jul 19, 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.
[00:45:45] .......................................i............................................................
[00:45:48] ....................................................................................................
[00:45:51] ....................................................................................................
[00:45:53] ....................................................................................................
[00:45:57] ..................................................................................F.................
[00:46:03] ....................................................................................................
[00:46:07] ............................................................................................i.......
[00:46:11] ..................................................................................i.................
[00:46:14] ....................................................................................................
[00:46:14] ....................................................................................................
[00:46:19] ....................................................................................................
[00:46:27] .................................i..................................................................
arameters. 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/issue-41974.rs","byte_start":518,"byte_end":547,"line_start":17,"lin at 'explicit panic', tools/compiletest/src/runtest.rs:3139:9
[00:46:28] 
[00:46:28] 
[00:46:28] failures:
[00:46:28]     [ui] ui/issue-41974.rs
[00:46:28]     [ui] ui/issue-41974.rs
[00:46:28] 
[00:46:28] test result: FAILED. 2110 passed; 1 failed; 7 ignored; 0 measured; 0 filtered out
[00:46:28] 
[00:46:28] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:498:22
[00:46:28] 
[00:46:28] 
[00:46:28] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0-tools-bin/compiletest" "--compile-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib" "--run-lib-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/lib/rustlib/x86_64-unknown-linux-gnu/lib" "--rustc-path" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--src-base" "/checkout/src/test/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-5.0/bin/FileCheck" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--quiet" "--llvm-version" "5.0.0\n" "--system-llvm" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "6_64-unknown-linux-gnu/stage0/bin
52532 ./obj/build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release
52032 ./obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/bin
51848 ./src/test
48480 ./src/llvm/test/CodeGen/X86

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 glandium force-pushed the glandium:box branch from 4c6a000 to be8f389 Jul 19, 2018

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Jul 19, 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.
[01:10:17]  right: `2`', libstd/sync/mutex.rs:663:13
[01:10:17] thread '<unnamed>' panicked at 'explicit panic', libstd/sync/once.rs:526:28
[01:10:17] thread '<unnamed>' panicked at 'Once instance has previously been poisoned', libstd/sync/once.rs:316:21
[01:10:17] thread '<unnamed>' panicked at 'explicit panic', libstd/sync/once.rs:554:28
[01:10:17] thread '<unnamed>' panicked at 'assertion failed: t1.join().is_ok()', libstd/sync/once.rs:582:9
[01:10:17] thread '<unnamed>' panicked at 'test panic in inner thread to poison RwLock', libstd/sync/rwlock.rs:776:13
[01:10:17] thread '<unnamed>' panicked at 'explicit panic', libstd/sync/rwlock.rs:713:13
[01:10:17] thread '<unnamed>' panicked at 'explicit panic', libstd/sync/rwlock.rs:643:13
[01:10:17] thread '<unnamed>' panicked at 'explicit panic', libstd/sync/rwlock.rs:654:13
[01:10:17] thread '<unnamed>' panicked at 'explicit panic', libstd/sync/rwlock.rs:654:13
[01:10:17] thread '<unnamed>' panicked at 'explicit panic', libstd/sync/rwlock.rs:619:13
[01:10:17] thread '<unnamed>' panicked at 'explicit panic', libstd/sync/rwlock.rs:631:13
[01:10:18] thread '<unnamed>' panicked at 'What the answer to my lifetimes dilemma is?', libstd/sys_common/remutex.rs:241:13
[01:10:18] ..........................................F.........................................................
[01:10:18] thread '<unnamed>' panicked at 'index 2 and/or 4 in `"aé 💩"` do not lie on character boundary', libstd/sys_common/wtf8.rs:784:5
[01:10:18] thread '<unnamed>' panicked at 'index 5 and/or 8 in `"aé 💩"` do not lie on character boundary', libstd/sys_common/wtf8.rs:784:5
[01:10:18] thread '<unnamed>' panicked at 'assertion failed: is_code_point_boundary(self, new_len)', libstd/sys_common/wtf8.rs:329:9
[01:10:18] thread '<unnamed>' panicked at 'assertion failed: is_code_point_boundary(self, new_len)', libstd/sys_common/wtf8.rs:329:9
---
[01:10:27] 
[01:10:27] error: test failed, to rerun pass '--lib'
[01:10:27] 
[01:10:27] 
[01:10:27] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "test" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "panic-unwind jemalloc backtrace" "--manifest-path" "/checkout/src/libstd/Cargo.toml" "-p" "std" "--" "--quiet"
[01:10:27] 
[01:10:27] 
[01:10:27] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[01:10:27] Build completed unsuccessfully in 0:24:00
[01:10:27] Build completed unsuccessfully in 0:24:00
[01:10:27] make: *** [check] Error 1
[01:10:27] Makefile:58: recipe for target 'check' failed

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

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

@SimonSapin

This comment has been minimized.

Contributor

SimonSapin commented Jul 19, 2018

Highfive’s comment elided the relevant part of the log, which was:

[01:10:27] failures:
[01:10:27]     sync::once::tests::wait_for_force_to_finish

CC @TimNN

@glandium

This comment has been minimized.

Contributor

glandium commented Jul 19, 2018

Same error as in #50882 (comment), and I finally managed to reproduce locally. It only happens when linking against system llvm 5. And enabling debuginfo fails the build with "LLVM ERROR: Failed to strip malformed debug info". Will have to dig deeper.

@glandium

This comment has been minimized.

Contributor

glandium commented Jul 24, 2018

Okay, I have a one-liner reproducer for this failure that only happens with llvm 5.

diff --git a/src/liballoc/alloc.rs b/src/liballoc/alloc.rs
index 84bd275..4df7730 100644
--- a/src/liballoc/alloc.rs
+++ b/src/liballoc/alloc.rs
@@ -172,7 +172,7 @@ pub(crate) unsafe fn box_free<T: ?Sized>(ptr: Unique<T>) {
     // We do not allocate for Box<T> when T is ZST, so deallocation is also not necessary.
     if size != 0 {
         let layout = Layout::from_size_align_unchecked(size, align);
-        dealloc(ptr as *mut u8, layout);
+        Global.dealloc(NonNull::new_unchecked(ptr).cast(), layout);
     }
 }
 

I also suspect it's related to using system llvm, rather than a specific version of llvm. (update: now confirmed building with system llvm 6.0)

Update 2: this goes away when I also change exchange_malloc to use Global.alloc. I suspect this is half-due to the weird setup of running libstd tests, which uses some stuff from libstd-the-crate-being-tested and some stuff from libstd-the-crate-from-the-compiler.

@glandium glandium force-pushed the glandium:box branch from be8f389 to e3a1883 Jul 24, 2018

Associate an allocator to boxes
This turns `Box<T>` into `Box<T, A: Alloc = Global>`. This is a
minimalist change to achieve this, not touching anything that could have
backwards incompatible consequences like requiring type annotations in
places where they currently aren't required,
per #50822 (comment)

@glandium glandium force-pushed the glandium:box branch 2 times, most recently from c40d506 to ab1c863 Jul 24, 2018

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Jul 24, 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.
[01:02:12]  right: `2`', libstd/sync/mutex.rs:663:13
[01:02:12] thread '<unnamed>' panicked at 'explicit panic', libstd/sync/once.rs:534:28
[01:02:12] thread '<unnamed>' panicked at 'Once instance has previously been poisoned', libstd/sync/once.rs:324:21
[01:02:12] thread '<unnamed>' panicked at 'explicit panic', libstd/sync/once.rs:562:28
[01:02:12] thread '<unnamed>' panicked at 'assertion failed: t1.join().is_ok()', libstd/sync/once.rs:590:9
[01:02:12] thread '<unnamed>' panicked at 'test panic in inner thread to poison RwLock', libstd/sync/rwlock.rs:776:13
[01:02:12] thread '<unnamed>' panicked at 'explicit panic', libstd/sync/rwlock.rs:713:13
[01:02:12] thread '<unnamed>' panicked at 'explicit panic', libstd/sync/rwlock.rs:643:13
[01:02:12] thread '<unnamed>' panicked at 'explicit panic', libstd/sync/rwlock.rs:654:13
[01:02:12] thread '<unnamed>' panicked at 'explicit panic', libstd/sync/rwlock.rs:654:13
[01:02:12] thread '<unnamed>' panicked at 'explicit panic', libstd/sync/rwlock.rs:619:13
[01:02:12] thread '<unnamed>' panicked at 'explicit panic', libstd/sync/rwlock.rs:631:13
[01:02:13] thread '<unnamed>' panicked at 'What the answer to my lifetimes dilemma is?', libstd/sys_common/remutex.rs:241:13
[01:02:13] ..........................................F.........................................................
[01:02:13] thread '<unnamed>' panicked at 'index 2 and/or 4 in `"aé 💩"` do not lie on character boundary', libstd/sys_common/wtf8.rs:784:5
[01:02:13] thread '<unnamed>' panicked at 'index 5 and/or 8 in `"aé 💩"` do not lie on character boundary', libstd/sys_common/wtf8.rs:784:5
[01:02:13] thread '<unnamed>' panicked at 'assertion failed: is_code_point_boundary(self, new_len)', libstd/sys_common/wtf8.rs:329:9
[01:02:13] thread '<unnamed>' panicked at 'assertion failed: is_code_point_boundary(self, new_len)', libstd/sys_common/wtf8.rs:329:9
---
travis_time:end:0a484780:start=1532428966840538006,finish=1532428966850786970,duration=10248964
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:125184e0
$ 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 -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:09cadaa2
travis_time:start:09cadaa2
$ 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:0c3e69c8
$ 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)

@glandium

This comment has been minimized.

Contributor

glandium commented Jul 24, 2018

Ok. There has to be something wrong with either the compiler or the test.

@alexcrichton

This comment has been minimized.

Member

alexcrichton commented Jul 24, 2018

Sorry for the delay in posing this! As I mentioned before we've long wanted to do this but since Box (and other collections) are such prominent types in the standard library we've been hesitant to take the leap just yet. There's a number of longstanding questions which unfortunately haven't been well articulated up to now which has prevented work on these new type parameters from progressing.

A number of members on @rust-lang/libs have expressed concern about moving forward in this direction (adding allocator parameters everywhere). We don't have the time to work through these concerns, though, before the 2018 edition release. As a result this will likely need to be delayed at least until after the 2018 edition release.

@Ericson2314

This comment has been minimized.

Contributor

Ericson2314 commented Jul 24, 2018

@alexcrichton I'm perfectly find with mine being tabled for now, but this one by @glandium is much smaller, more targeted, and more researched. You mention the list of compiler issues isn't even written down. If anyone knows them, it's @glandium; they've been diligently chasing down issues in commits like 43b24c6, dfa6111, 6614fa0, 64f5233, bd8c177, and b5c2b79 as part of working towards this PR.

IMO if we're ever going to prioritize this, and gather relevant data so the lang team does less work overall, we should merge this on an experimental basis with the understanding that it will be reverted at the first sign of trouble. Either we raise the bus factor, or I fear nothing will happen ever.

@alexcrichton

This comment has been minimized.

Member

alexcrichton commented Jul 24, 2018

Indeed gathering data is good! My point is that we can't amongst the libs team have a serious discussion about landing this until after the edition.

@Ericson2314

This comment has been minimized.

Contributor

Ericson2314 commented Jul 24, 2018

I'm just still disappointed that unstable methods in an unstable create (std's Box has no alloc param, even on nightly) needs any "serious discussion" at all. The Placer API, for example, affected core APIs, sat unstable for a while, and then was reverted, without harming anyone, right?

I'm reminded of the vision best described by @gnzlbg in rust-lang/rfcs#2480 (comment) on making std a facade over rust-lang-nursery, as it relates to enabling more decentralized library experimentation while still giving the core libs team absolute control over what gets stabilized. Hopefully that gets us the best of both worlds by still keeping experiments out of rust-lang/rust while achieving that goal, but until that happens it would be nice to be more liberal about libraries in this repo provided everything is unstable.

@glandium

This comment has been minimized.

Contributor

glandium commented Jul 24, 2018

I'll note that it is possible to experiment with crates today, to some extent, and I've done so with the allocator_api crate, that implements Box<T, A> (could implement more, but I didn't need it, contributions welcome).

BUT "to some extent" is key. Because the liballoc exposes types rather than traits, one can't use an hypothetical my_crate::Vec<T, A> in place of a std::vec::Vec<T>. BTW, this is going to be something to figure out long term, even for std::vec::Vec<T, A>, and even for std::box::Box<T, A>, even if this PR was merged.

That being said, this PR is a relatively small step to start experimenting with these things, and, like @Ericson2314, I don't see why this would need to wait.

Well, except for the fact that, at the moment, I'm concerned that it breaks some compiler assumptions and that that would be the reason for the test failure.

@Ericson2314

This comment has been minimized.

Contributor

Ericson2314 commented Jul 24, 2018

Yeah, it's precisely because this experiment will take so long that that it's important to unlock the parallelism of not hogging tons of lib team time.

@alexcrichton

This comment has been minimized.

Member

alexcrichton commented Jul 26, 2018

Yes the libs team understands the value in experimentation and doesn't want to unnecessarily block efforts, but this PR is touching the Box type, which is a change we cannot take lightly. As a result, we need to postpone this until after the 2018 edition to ensure that other features ship.

@TimNN

This comment has been minimized.

Contributor

TimNN commented Aug 7, 2018

Ping from triage! If I understand correctly, this PR is blocked until after the 2018 edition ships, which is still quite some time to go. As such I'm closing this PR as blocked, following our triage procedure. Please add a comment or re-open if I missunderstood.

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