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

Take supertraits into account when calculating associated types #55687

Merged
merged 5 commits into from Nov 11, 2018

Conversation

Projects
None yet
9 participants
@alexreg
Contributor

alexreg commented Nov 5, 2018

Fixes #24010 and #23856. Applies to trait aliases too.

As a by-product, this PR also makes repeated bindings of the same associated item in the same definition a hard error. This was previously a warning with a note about it becoming a hard error in the future. See #50589 for more info.

I talked about this with @nikomatsakis recently, but only very superficially, so this shouldn't stop anyone from assigning it to themself to review and r+.

N.B. The "WIP" commits represent imperfect attempts to solve the problem just for trait objects, but I've left them in for reference for the sake of whomever is reviewing this.

CC @carllerche @theemathas @durka @mbrubeck

@rust-highfive

This comment was marked as outdated.

Collaborator

rust-highfive commented Nov 5, 2018

r? @eddyb

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

@alexreg

This comment has been minimized.

Contributor

alexreg commented Nov 5, 2018

r? @nikomatsakis

(If someone else would rather take it, feel free to r? yourself, per above.)

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Nov 5, 2018

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

Click to expand the log.
travis_time:end:21206dd8:start=1541389148107204406,finish=1541389205107126493,duration=56999922087
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
[00:21:28]    Compiling rustc_tsan v0.0.0 (/checkout/src/librustc_tsan)
[00:21:28]    Compiling rustc_asan v0.0.0 (/checkout/src/librustc_asan)
[00:21:29]    Compiling rustc_msan v0.0.0 (/checkout/src/librustc_msan)
[00:21:29]    Compiling rustc_lsan v0.0.0 (/checkout/src/librustc_lsan)
[00:21:31] error[E0284]: type annotations required: cannot resolve `<T as ops::arith::Mul>::Output == T`
[00:21:31]   --> libcore/num/flt2dec/decoder.rs:69:1
[00:21:31]    |
[00:21:31] 69 | / pub fn decode<T: DecodableFloat>(v: T) -> (/*negative?*/ bool, FullDecoded) {
[00:21:31] 70 | |     let (mant, exp, sign) = v.integer_decode();
[00:21:31] 71 | |     let even = (mant & 1) == 0;
[00:21:31] 72 | |     let decoded = match v.classify() {
[00:21:31] ...  |
[00:21:31] 97 | |     (sign < 0, decoded)
[00:21:31]    | |_^
[00:21:31]    |
[00:21:31]    |
[00:21:31] note: required by `num::flt2dec::decoder::DecodableFloat`
[00:21:31]   --> libcore/num/flt2dec/decoder.rs:54:1
[00:21:31]    |
[00:21:31] 54 | pub trait DecodableFloat: RawFloat + Copy {
[00:21:31] 
[00:21:31] error[E0277]: the size for values of type `Self` cannot be known at compilation time
[00:21:31] error[E0277]: the size for values of type `Self` cannot be known at compilation time
[00:21:31]   --> libcore/num/dec2flt/num.rs:49:1
[00:21:31]    |
[00:21:31] 49 | / pub fn from_str_unchecked<'a, T>(bytes: T) -> u64 where T : IntoIterator<Item=&'a u8> {
[00:21:31] 50 | |     let mut result = 0;
[00:21:31] 51 | |     for &c in bytes {
[00:21:31] 52 | |         result = result * 10 + (c - b'0') as u64;
[00:21:31] 54 | |     result
[00:21:31] 55 | | }
[00:21:31]    | |_^ doesn't have a size known at compile-time
[00:21:31]    |
[00:21:31]    |
[00:21:31]    = help: the trait `marker::Sized` is not implemented for `Self`
[00:21:31]    = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
[00:21:31]    = help: consider adding a `where Self: marker::Sized` bound
[00:21:31]    = note: required because of the requirements on the impl of `iter::traits::IntoIterator` for `Self`
[00:21:31] error[E0277]: `Self` is not an iterator
[00:21:31] error[E0277]: `Self` is not an iterator
[00:21:31]   --> libcore/num/dec2flt/num.rs:49:1
[00:21:31]    |
[00:21:31] 49 | / pub fn from_str_unchecked<'a, T>(bytes: T) -> u64 where T : IntoIterator<Item=&'a u8> {
[00:21:31] 50 | |     let mut result = 0;
[00:21:31] 51 | |     for &c in bytes {
[00:21:31] 52 | |         result = result * 10 + (c - b'0') as u64;
[00:21:31] 54 | |     result
[00:21:3] note: rustc 1.32.0-dev running on x86_64-unknown-linux-gnu
[00:21:31] 
[00:21:31] 
[00:21:31] note: compiler flags: -Z force-unstable-if-unmarked -C opt-level=2 -C prefer-dynamic -C debug-assertions=y -C codegen-units=1 -C link-args=-Wl,-rpath,$ORIGIN/../lib --crate-type lib
[00:21:31] note: some of the compiler flags provided by cargo are hidden
[00:21:31] 
[00:21:31] error: Could not compile `core`.
[00:21:31] warning: build failed, waiting for other jobs to finish...
---
151412 ./src/tools/clang
150256 ./obj/build/bootstrap/debug/incremental
149112 ./src/llvm-emscripten/test
134672 ./obj/build/bootstrap/debug/incremental/bootstrap-zemjd6kcyh2u
134668 ./obj/build/bootstrap/debug/incremental/bootstrap-zemjd6kcyh2u/s-f6dkhs26j5-dz49aw-1ixyktdm53mj
107892 ./obj/build/x86_64-unknown-linux-gnu/stage0/lib/rustlib/x86_64-unknown-linux-gnu/codegen-backends
104700 ./src/tools/lldb
94832 ./obj/build/x86_64-unknown-linux-gnu/stage1
94812 ./

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

@pietroalbini

This comment has been minimized.

Member

pietroalbini commented Nov 5, 2018

@craterbot run start=6cfc6033955dd2685dfa7baeec6f6bc3bfdfe2f1 end=6cfc6033955dd2685dfa7baeec6f6bc3bfdfe2f1+rustflags=-Dduplicate_associated_type_bindings mode=check-only

@craterbot

This comment has been minimized.

Collaborator

craterbot commented Nov 5, 2018

👌 Experiment pr-55687 created and queued.
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot

This comment has been minimized.

Collaborator

craterbot commented Nov 5, 2018

🚧 Experiment pr-55687 is now running on agent aws-1.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@alexreg alexreg force-pushed the alexreg:fix-24010 branch from 9b0d8a1 to 5297665 Nov 6, 2018

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Nov 6, 2018

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

Click to expand the log.
travis_time:end:00856f0e:start=1541474090098267045,finish=1541474146686383844,duration=56588116799
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
[00:19:57]    Compiling cmake v0.1.33
[00:19:57]    Compiling std v0.0.0 (/checkout/src/libstd)
e trait `marker::Sized` is not implemented for `Self`
[00:20:03]    = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
[00:20:03]    = help: consider adding a `where Self: marker::Sized` bound
[00:20:03]    = note: required because of the requirements on the impl of `iter::traits::IntoIterator` for `Self`
[00:20:03] error[E0277]: `Self` is not an iterator
[00:20:03] error[E0277]: `Self` is not an iterator
[00:20:03]   --> libcore/num/dec2flt/num.rs:49:1
[00:20:03]    |
[00:20:03] 49 | / pub fn from_str_unchecked<'a, T>(bytes: T) -> u64 where T : IntoIterator<Item=&'a u8> {
[00:20:03] 50 | |     let mut result = 0;
[00:20:03] 51 | |     for &c in bytes {
[00:20:03] 52 | |         result = result * 10 + (c - b'0') as u64;
[00:20:03] 54 | |     result
[00:20:0

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)

@oli-obk

First pass, will review in detail when back on a pc

// FIXME(alexreg): associated type should be gotten from trait alias definition
// let c: &dyn I32Iterator = &vec![123].into_iter();
// assert_eq!(c.next(), Some(123));
let c: &mut dyn I32Iterator<Item = u32> = &mut vec![123].into_iter();

This comment has been minimized.

@oli-obk

oli-obk Nov 6, 2018

Contributor

Should the commented out code also be legal?

This comment has been minimized.

@alexreg

alexreg Nov 6, 2018

Contributor

Actually only the commented-out code should be legal. I was messing around and forgot to revert. Thanks for the catch.

Show resolved Hide resolved src/librustc_typeck/astconv.rs Outdated
Show resolved Hide resolved src/librustc_typeck/astconv.rs Outdated
@pietroalbini

This comment has been minimized.

Member

pietroalbini commented Nov 6, 2018

Uh, woops.

@craterbot abort

@craterbot

This comment has been minimized.

Collaborator

craterbot commented Nov 6, 2018

🗑 Experiment pr-55687 deleted!

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@pietroalbini

This comment has been minimized.

Member

pietroalbini commented Nov 6, 2018

Wrong commit hash...

@craterbot run start=24e66c28980442a48d9458f1a4f9b76cc722dc8a end=24e66c28980442a48d9458f1a4f9b76cc722dc8a+rustflags=-Dduplicate_associated_type_bindings mode=check-only

@craterbot

This comment has been minimized.

Collaborator

craterbot commented Nov 6, 2018

👌 Experiment pr-55687 created and queued.
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot

This comment has been minimized.

Collaborator

craterbot commented Nov 6, 2018

🚧 Experiment pr-55687 is now running on agent aws-1.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@pietroalbini

This comment has been minimized.

Member

pietroalbini commented Nov 6, 2018

@craterbot abort

@craterbot

This comment has been minimized.

Collaborator

craterbot commented Nov 6, 2018

🗑 Experiment pr-55687 deleted!

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@pietroalbini

This comment has been minimized.

Member

pietroalbini commented Nov 6, 2018

...forgot this is not my local branch...

@craterbot run start=master#24e66c28980442a48d9458f1a4f9b76cc722dc8a end=master#24e66c28980442a48d9458f1a4f9b76cc722dc8a+rustflags=-Dduplicate_associated_type_bindings mode=check-only

@scalexm

A summary of what we discussed on Zulip. Two additional items:

  • we'd need a test which shows off the "transitive" elaboration, e.g.:
trait Foo: Iterator<Item = i32> { }
trait Bar: Foo { }

fn main {
    let x: &dyn Bar;
}
  • maybe clean the commit history
Show resolved Hide resolved src/librustc_typeck/astconv.rs Outdated
Show resolved Hide resolved src/librustc_typeck/astconv.rs Outdated
Show resolved Hide resolved src/librustc_typeck/astconv.rs Outdated
Show resolved Hide resolved src/librustc_typeck/astconv.rs Outdated
Show resolved Hide resolved src/librustc_typeck/astconv.rs Outdated
Show resolved Hide resolved src/test/ui/error-codes/E0719-trait-alias-object.rs Outdated
Show resolved Hide resolved src/test/ui/error-codes/E0719-trait-alias.rs Outdated
@nikomatsakis

This comment has been minimized.

Contributor

nikomatsakis commented Nov 7, 2018

@rust-highfive rust-highfive assigned scalexm and unassigned nikomatsakis Nov 7, 2018

@nikomatsakis

This comment has been minimized.

Contributor

nikomatsakis commented Nov 7, 2018

Seems like @scalexm is on this? =)

@alexreg alexreg force-pushed the alexreg:fix-24010 branch 2 times, most recently from 92ac02a to 19d71f2 Nov 7, 2018

@rust-highfive

This comment has been minimized.

Collaborator

rust-highfive commented Nov 7, 2018

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

Click to expand the log.
travis_time:end:332630e3:start=1541614101428998140,finish=1541614102570944219,duration=1141946079
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#Pull-Requests-and-Security-Restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-5.0
---
[00:48:15] ........................................................................................iiiii....... 900/5000
[00:48:18] .................................................................................................... 1000/5000
[00:48:20] .................................................................................................... 1100/5000
[00:48:23] .................................................................................................... 1200/5000
[00:48:25] .........................................FF.F....................................................... 1300/5000
[00:48:30] ...........................................................................................i........ 1500/5000
[00:48:33] .............................................................i...................................... 1600/5000
[00:48:36] .................................................................................................... 1700/5000
[00:48:40] .................................................................................................... 1800/5000
---
[00:49:05] .................................................................................................... 2500/5000
[00:49:09] .................................................................................................... 2600/5000
[00:49:13] .................................................................................................... 2700/5000
[00:49:16] .................................................................................................... 2800/5000
[00:49:19] ..................................................................................F................. 2900/5000
[00:49:26] ...........................i........................................................................ 3100/5000
[00:49:29] .........................................................................................i.i..ii.... 3200/5000
[00:49:32] .................................................................................................... 3300/5000
[00:49:36] .................................................................................................... 3400/5000
---
[00:50:22] 
[00:50:22] ---- [ui] ui/error-codes/E0719-trait-alias.rs stdout ----
[00:50:22] diff of stderr:
[00:50:22] 
[00:50:22] - error[E0719]: the value of the associated type `Item` (from the trait `std::iter::Iterator`) is already specified
[00:50:22] -   --> $DIR/E0719-trait-alias.rs:14:34
[00:50:22] + error[E0284]: type annotations required: cannot resolve `<Self as std::iter::I-- `Item` bound here first
[00:50:22] - ...
[00:50:22] - LL | trait U32Iterator2 = U32Iterator<Item = u32>; //~ ERROR E0719
[00:50:22] -    |                                  ^^^^^^^^^^ re-bound here
[00:50:22] + error: aborting due to previous error
[00:50:22] - error: aborting due to 3 previous errors
[00:50:22] - 
[00:50:22] - For more information about this error, try `rustc --explain E0719`.
[00:50:22] + For more information about this error, try `rustc --explain E0284`.
[00:50:22] + For more information about this error, try `rustc --explain E0284`.
[00:50:22] 30 
[00:50:22] 
[00:50:22] 
[00:50:22] The actual stderr differed from the expected stderr.
[00:50:22] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/error-codes/E0719-trait-alias/E0719-trait-alias.stderr
[00:50:22] To update references, rerun the tests and pass the `--bless` flag
[00:50:22] To only update this specific test, also pass `--test-args error-codes/E0719-trait-alias.rs`
[00:50:22] error: 1 errors occurred comparing output.
[00:50:22] status: exit code: 1
[00:50:22] status: exit code: 1
[00:50:22] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/error-codes/E0719-trait-alias.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/error-codes/E0719-trait-alias/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/error-codes/E0719-trait-alias/auxiliary" "-A" "unused"
[00:50:22] ------------------------------------------
[00:50:22] 
[00:50:22] ------------------------------------------
[00:50:22] stderr:
[00:50:22] stderr:
[00:50:22] ------------------------------------------
[00:50:22] {"message":"type annotations required: cannot resolve `<Self as std::iter::Iterator>::Item == i32`","code":{"code":"E0284","explanation":null},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/error-codes/E0719-trait-alias.rs","byte_start":659,"byte_end":704,"line_start":16,"line_end":16,"column_start":1,"column_end":46,"is_primary":true,"text":[{"text":"trait U32Iterator2 = U32Iterator<Item = u32>; //~ ERROR E0719","highlight_start":1,"highlight_end":46}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"required by `U32Iterator`","code":null,"level":"note","spans":[{"file_name":"/checkout/src/test/ui/error-codes/E0719-trait-alias.rs","byte_start":597,"byte_end":642,"line_start":15,"line_end":15,"column_start":1,"column_end":46,"is_primary":true,"text":[{"text":"trait U32Iterator = I32Iterator2<Item = i32>; //~ ERROR E0719","highlight_start":1,"highlight_end":46}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0284]: type annotations required: cannot resolve `<Self as std::iter::Iterator>::Item == i32`\n  --> /checkout/src/test/ui/error-codes/E0719-trait-alias.rs:16:1\n   |\nLL | trait U32Iterator2 = U32Iterator<Item = u32>; //~ ERROR E0719\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n   |\nnote: required by `U32Iterator`\n  --> /checkout/src/test/ui/error-codes/E0719-trait-alias.rs:15:1\n   |\nLL | trait U32Iterator = I32Iterator2<Item = i32>; //~ ERROR E0719\n   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n"}
[00:50:22] {"message":"aborting due to previous error","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to previous error\n\n"}
[00:50:22] {"message":"For more information about this error, try `rustc --explain E0284`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0284`.\n"}
[00:50:22] ------------------------------------------
[00:50:22] 
[00:50:22] thread '[ui] ui/error-codes/E0719-trait-alias.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3284:9
[00:50:22] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:50:22] note: Run with `RUST_BACKTRACE=1` for a backtrace.
[00:50:22] 
[00:50:22] ---- [ui] ui/error-codes/E0719-trait-alias-object.rs stdout ----
[00:50:22] 
[00:50:22] error: ui test compiled successfully!
[00:50:22] status: exit code: 0
[00:50:22] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/error-codes/E0719-trait-alias-object.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/error-codes/E0719-trait-alias-object/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/error-codes/E0719-trait-alias-object/auxiliary" "-A" "unused"
[00:50:22] ------------------------------------------
[00:50:22] 
[00:50:22] ------------------------------------------
[00:50:22] stderr:
---
[00:50:22] ---- [ui] ui/error-codes/E0719.rs stdout ----
[00:50:22] 
[00:50:22] error: ui test compiled successfully!
[00:50:22] status: exit code: 0
[00:50:22] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/error-codes/E0719.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/error-codes/E0719/a" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/error-codes/E0719/auxiliary" "-A" "unused"
[00:50:22] ------------------------------------------
[00:50:22] 
[00:50:22] ------------------------------------------
[00:50:22] stderr:
---
[00:50:22] 
[00:50:22] ---- [ui] ui/lint/issue-50589-multiple-associated-types.rs stdout ----
[00:50:22] diff of stderr:
[00:50:22] 
[00:50:22] - warning: associated type binding `Item` specified more than once
[00:50:22] -    |
[00:50:22] -    |
[00:50:22] - LL | fn test() ->  Box<Iterator<Item = (), Item = Unit>> {
[00:50:22] -    |                            ---------  ^^^^^^^^^^^ used more than once
[00:50:22] -    |                            first use of `Item`
[00:50:22] -    |
[00:50:22] -    |
[00:50:22] -    = note: #[warn(duplicate_associated_type_bindings)] on by default
[00:50:22] -    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
[00:50:22] - 
[00:50:22] - 
[00:50:22] - warning: associated type binding `Item` specified more than once
[00:50:22] -    |
[00:50:22] -    |
[00:50:22] - LL | fn test() ->  Box<Iterator<Item = (), Item = Unit>> {
[00:50:22] -    |                            ---------  ^^^^^^^^^^^ used more than once
[00:50:22] -    |                            first use of `Item`
[00:50:22] -    |
[00:50:22] -    = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
[00:50:22] -    = note: for more information, see issue #50589 <https://github.com/rust-lang/rust/issues/50589>
[00:50:22] -    = note: for more information, see issue #50589 <https://github.com/rust-lang/rust/issues/50589>
[00:50:22] - 
[00:50:22] - 
[00:50:22] 
[00:50:22] 
[00:50:22] error: failed to delete `/checkout/obj/build/x86_64-unknown-linux-gnu/tenknown-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" "" "--color" "always"
[00:50:22] 
[00:50:22] 
[00:50:22] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test
[00:50:22] Build completed unsuccessfully in 0:03:40
[00:50:22] Build completed unsuccessfully in 0:03:40
[00:50:22] make: *** [check] Error 1
[00:50:22] Makefile:58: recipe for target 'check' failed

The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:240c4da0
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
---
travis_time:end:0aee8af4:start=1541617136840251653,finish=1541617136845788125,duration=5536472
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:09353ee0
$ ln -s . checkout && for CORE in obj/cores/core.*; do EXE=$(echo $CORE | sed 's|obj/cores/core\.[0-9]*\.!checkout!\(.*\)|\1|;y|!|/|'); if [ -f "$EXE" ]; then printf travis_fold":start:crashlog\n\033[31;1m%s\033[0m\n" "$CORE"; gdb --batch -q -c "$CORE" "$EXE" -iex 'set auto-load off' -iex 'dir src/' -iex 'set sysroot .' -ex bt -ex q; echo travis_fold":"end:crashlog; fi; done || true
travis_fold:end:after_failure.4
travis_fold:start:after_failure.5
travis_time:start:074400de
travis_time:start:074400de
$ 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:2920518f
$ dmesg | grep -i kill
$ dmesg | grep -i kill
[   10.888543] init: failsafe main process (1093) killed by TERM signal
[   42.343723] init: plymouth-upstart-bridge main process (510) killed by TERM signal
travis_fold:end:after_failure.6

Done. Your build exited with 1.

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

@craterbot

This comment has been minimized.

Collaborator

craterbot commented Nov 7, 2018

🎉 Experiment pr-55687 is completed!
📰 Open the full report.

⚠️ If you notice any spurious failure please add them to the blacklist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@alexreg alexreg force-pushed the alexreg:fix-24010 branch 2 times, most recently from 5825653 to 4c1d24a Nov 7, 2018

@scalexm

scalexm approved these changes Nov 7, 2018

@alexreg alexreg force-pushed the alexreg:fix-24010 branch from 4c1d24a to 90a1438 Nov 7, 2018

@scalexm

This comment has been minimized.

Member

scalexm commented Nov 7, 2018

@bors r+

@bors

This comment has been minimized.

Contributor

bors commented Nov 7, 2018

📌 Commit 90a1438 has been approved by scalexm

pietroalbini added a commit to pietroalbini/rust that referenced this pull request Nov 10, 2018

Rollup merge of rust-lang#55687 - alexreg:fix-24010, r=scalexm
Take supertraits into account when calculating associated types

Fixes rust-lang#24010 and rust-lang#23856. Applies to trait aliases too.

As a by-product, this PR also makes repeated bindings of the same associated item in the same definition a hard error. This was previously a warning with a note about it becoming a hard error in the future. See rust-lang#50589 for more info.

I talked about this with @nikomatsakis recently, but only very superficially, so this shouldn't stop anyone from assigning it to themself to review and r+.

N.B. The "WIP" commits represent imperfect attempts to solve the problem just for trait objects, but I've left them in for reference for the sake of whomever is reviewing this.

CC @carllerche @theemathas @durka @mbrubeck

bors added a commit that referenced this pull request Nov 11, 2018

Auto merge of #55859 - pietroalbini:rollup, r=pietroalbini
Rollup of 14 pull requests

Successful merges:

 - #55687 (Take supertraits into account when calculating associated types)
 - #55745 (Convert `outlives_components`' return value to a `SmallVec` outparam.)
 - #55764 (Fix Rc/Arc allocation layout)
 - #55792 (Prevent ICE in const-prop array oob check)
 - #55799 (Removed unneeded instance of `// revisions` from a lint test)
 - #55800 (Fix ICE in `return_type_impl_trait`)
 - #55801 (NLL: Update box insensitivity test)
 - #55802 (Don't inline virtual calls (take 2))
 - #55816 (Use `SmallVec` to avoid allocations in `from_decimal_string`.)
 - #55819 (Typecheck patterns of all match arms first, so we get types for bindings)
 - #55822 (ICE with #![feature(nll)] and elided lifetimes)
 - #55828 (Add missing `rustc_promotable` attribute to unsigned `min_value` and `max_value`)
 - #55839 (Fix docstring spelling mistakes)
 - #55844 (Fix documentation typos.)

Failed merges:

r? @ghost

bors added a commit that referenced this pull request Nov 11, 2018

Auto merge of #55859 - pietroalbini:rollup, r=kennytm
Rollup of 17 pull requests

Successful merges:

 - #55630 (resolve: Filter away macro prelude in modules with `#[no_implicit_prelude]` on 2018 edition)
 - #55687 (Take supertraits into account when calculating associated types)
 - #55745 (Convert `outlives_components`' return value to a `SmallVec` outparam.)
 - #55764 (Fix Rc/Arc allocation layout)
 - #55792 (Prevent ICE in const-prop array oob check)
 - #55799 (Removed unneeded instance of `// revisions` from a lint test)
 - #55800 (Fix ICE in `return_type_impl_trait`)
 - #55801 (NLL: Update box insensitivity test)
 - #55802 (Don't inline virtual calls (take 2))
 - #55816 (Use `SmallVec` to avoid allocations in `from_decimal_string`.)
 - #55819 (Typecheck patterns of all match arms first, so we get types for bindings)
 - #55822 (ICE with #![feature(nll)] and elided lifetimes)
 - #55828 (Add missing `rustc_promotable` attribute to unsigned `min_value` and `max_value`)
 - #55839 (Fix docstring spelling mistakes)
 - #55844 (Fix documentation typos.)
 - #55845 (Set BINARYEN_TRAP_MODE=clamp)
 - #55856 (rustdoc: refactor: move all static-file include!s into a single module)

@bors bors merged commit 90a1438 into rust-lang:master Nov 11, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment