Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Rollup of 14 pull requests #55746

Merged
merged 31 commits into from
Nov 7, 2018
Merged

Rollup of 14 pull requests #55746

merged 31 commits into from
Nov 7, 2018

Conversation

kennytm
Copy link
Member

@kennytm kennytm commented Nov 7, 2018

Successful merges:

goffrie and others added 24 commits October 26, 2018 12:09
Hopefully this is a bit more precise and also more correct English.
Fixes rust-lang#54705

When constructing synthetic auto trait impls, we may come across
multiple predicates involving the same type, trait, and substitutions.
Since we can only display one of these, we pick the one with the 'most
strict' lifetime paramters. This ensures that the impl we render the
user is actually valid (that is, a struct matching that impl will
actually implement the auto trait in question).

This commit exapnds the definition of 'more strict' to take into account
inference variables. We always choose a predicate without inference
variables over a predicate with inference variables.
Rustbuild passes `--message-format json` to the compiler invocations
which causes JSON to be emitted on stdout. Printing optimization fuel
messages to stdout breaks the json and causes Rustbuild to fail.

Work around this by emitting optimization fuel related messages on
stderr instead.
It's only used in tests.

This reduces instruction counts on several benchmarks by 0.5--1%.
…ep compiletests presumption of JSON.

As a driveby, rename the stdout files to stderr, which should have been part of the earlier commit.
If we're going to emit bitcode (through ThinLTOBuffer), then we
need to ensure that anon globals are named. This was already done
after optimization passes, but also has to happen after LTO passes,
as we always emit the final result in a ThinLTO-compatible manner.

Fixes rust-lang#51947.
This updates lldb to pick up some bug fixes, and makes one minor test
suite fix to account for this.
Slight copy-editing for `std::cell::Cell` docs

Hopefully this is a bit more precise and also more correct English.
Remove unused re import in gdb_rust_pretty_printing
…nkfelix

Choose predicates without inference variables over those with them

Fixes rust-lang#54705

When constructing synthetic auto trait impls, we may come across
multiple predicates involving the same type, trait, and substitutions.
Since we can only display one of these, we pick the one with the 'most
strict' lifetime paramters. This ensures that the impl we render the
user is actually valid (that is, a struct matching that impl will
actually implement the auto trait in question).

This commit exapnds the definition of 'more strict' to take into account
inference variables. We always choose a predicate without inference
variables over a predicate with inference variables.
…ikomatsakis

Don't print opt fuel messages to stdout because it breaks Rustbuild

Rustbuild passes `--message-format json` to the compiler invocations
which causes JSON to be emitted on stdout. Printing optimization fuel
messages to stdout breaks the json and causes Rustbuild to fail.

Work around this by emitting optimization fuel related messages on
stderr instead.
Make `process_obligations`' computation of `completed` optional.

It's only used in tests.

This reduces instruction counts on several benchmarks by 0.5--1%.
…=petrochenkov

Fix feature gate only being checked on first repr attr.

Reported in rust-lang#33158 (comment).
Run name-anon-globals after LTO passes as well

If we're going to emit bitcode (through ThinLTOBuffer), then we need to ensure that anon globals are named. This was already done after optimization passes, but also has to happen after LTO passes, as we always emit the final result in a ThinLTO-compatible manner.

I added the test as `run-make`. The important bit is that we emit bitcode in some way (e.g. `--crate-type rlib` or `--emit=llvm-bc`). Please tell me if there is a better way to test for that.

Fixes rust-lang#51947
Standardised names and location of ui issue tests

None
… r=michaelwoerister

-C remark: fix incorrect warning about requiring "--debuginfo" instead of "-C debuginfo=n"

Previously suggested "--debuginfo" does not actually work.
…ichaelwoerister

Add `aarch64-pc-windows-msvc` to deployed targets

Accidentally forgotten from rust-lang#54718!
@kennytm
Copy link
Member Author

kennytm commented Nov 7, 2018

@bors r+ p=15

@bors
Copy link
Contributor

bors commented Nov 7, 2018

📌 Commit 79cf95ba51a035309e6c258e9e35ef3585050ada has been approved by kennytm

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Nov 7, 2018
@bors
Copy link
Contributor

bors commented Nov 7, 2018

⌛ Testing commit 79cf95ba51a035309e6c258e9e35ef3585050ada with merge a8d2cd8203f90c0e6de438d9d4de6392f2f98800...

@bors
Copy link
Contributor

bors commented Nov 7, 2018

💔 Test failed - status-travis

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Nov 7, 2018
@rust-highfive
Copy link
Collaborator

The job wasm32-unknown 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:54:47] 
[00:54:47] ---- [ui] ui/extern/extern-const.rs stdout ----
[00:54:47] diff of stderr:
[00:54:47] 
[00:54:47] 4 LL |     const rust_dbg_static_mut: libc::c_int; //~ ERROR extern items cannot be `const`
[00:54:47] 5    |     ^^^^^ help: try using a static value: `static`
[00:54:47] - error: aborting due to previous error
[00:54:47] - error: aborting due to previous error
[00:54:47] + error[E0412]: cannot find type `c_int` in module `libc`
[00:54:47] +   --> $DIR/extern-const.rs:15:38
[00:54:47] +    |
[00:54:47] + LL |     const rust_dbg_static_mut: libc::c_int; //~ ERROR extern items cannot be `const`
[00:54:47] +    |                                      ^^^^^ not found in `libc`
[00:54:47] + help: possible candidate is found in another module, you can import it into scope
[00:54:47] +    |
[00:54:47] + LL | use std::os::raw::c_int;
[00:54:47] 8 
[00:54:47] + error: aborting due to 2 previous errors
[00:54:47] + 
[00:54:47] + For more information about this error, try `rustc --explain E0412`.
[00:54:47] + For more information about this error, try `rustc --explain E0412`.
[00:54:47] 9 
[00:54:47] 
[00:54:47] 
[00:54:47] The actual stderr differed from the expected stderr.
[00:54:47] Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/extern/extern-const/extern-const.stderr
[00:54:47] diff of fixed:
[00:54:47] 
[00:54:47] 10 #![feature(libc)]
[00:54:47] 11 extern crate libc;
[00:54:47] + use std::os::raw::c_int;
[00:54:47] + 
[00:54:47] + 
[00:54:47] 13 #[link(name = "rust_test_helpers", kind = "static")]
[00:54:47] 14 extern "C" {
[00:54:47] 15     static rust_dbg_static_mut: libc::c_int; //~ ERROR extern items cannot be `const`
[00:54:47] 
[00:54:47] The actual fixed differed from the expected fixed.
[00:54:47] The actual fixed differed from the expected fixed.
[00:54:47] Actual fixed saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/extern/extern-const/extern-const.fixed
[00:54:47] To update references, rerun the tests and pass the `--bless` flag
[00:54:47] To only update this specific test, also pass `--test-args extern/extern-const.rs`
[00:54:47] error: 2 errors occurred comparing output.
[00:54:47] status: exit code: 1
[00:54:47] status: exit code: 1
[00:54:47] command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/extern/extern-const.rs" "--target=wasm32-unknown-unknown" "--error-format" "json" "-Zui-testing" "-o" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/extern/extern-const/a.wasm" "-Crpath" "-O" "-Zunstable-options" "-Lnative=/checkout/obj/build/wasm32-unknown-unknown/native/rust-test-helpers" "-g" "-Z" "continue-parse-after-error" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/extern/extern-const/auxiliary" "-A" "unused"
[00:54:47] ------------------------------------------
[00:54:47] 
[00:54:47] ------------------------------------------
[00:54:47] stderr:
[00:54:47] stderr:
[00:54:47] ------------------------------------------
[00:54:47] {"message":"extern items cannot be `const`","code":null,"level":"error","spans":[{"file_name":"/checkout/src/test/ui/extern/extern-const.rs","byte_start":457,"byte_end":462,"line_start":15,"line_end":15,"column_start":5,"column_end":10,"is_primary":true,"text":[{"text":"    const rust_dbg_static_mut: libc::c_int; //~ ERROR extern items cannot be `const`","highlight_start":5,"highlight_end":10}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"try using a static value","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/ui/extern/extern-const.rs","byte_start":457,"byte_end":462,"line_start":15,"line_end":15,"column_start":5,"column_end":10,"is_primary":true,"text":[{"text":"    const rust_dbg_static_mut: libc::c_int; //~ ERROR extern items cannot be `const`","highlight_start":5,"highlight_end":10}],"label":null,"suggested_replacement":"static","suggestion_applicability":"MachineApplicable","expansion":null}],"children":[],"rendered":null}],"rendered":"error: extern items cannot be `const`\n  --> /checkout/src/test/ui/extern/extern-const.rs:15:5\n   |\nLL |     const rust_dbg_static_mut: libc::c_int; //~ ERROR extern items cannot be `const`\n   |     ^^^^^ help: try using a static value: `static`\n\n"}
[00:54:47] {"message":"cannot find type `c_int` in module `libc`","code":{"code":"E0412","explanation":"\nThe type name used is not in scope.\n\nErroneous code examples:\n\n```compile_fail,E0412\nimpl Something {} // error: type name `Something` is not in scope\n\n// or:\n\ntrait Foo {\n    fn bar(N); // error: type name `N` is not in scope\n}\n\n// or:\n\nfn foo(x: T) {} // type name `T` is not in scope\n```\n\nTo fix this error, please verify you didn't misspell the type name, you did\ndeclare it or imported it into the scope. Examples:\n\n```\nstruct Something;\n\nimpl Something {} // ok!\n\n// or:\n\ntrait Foo {\n    type N;\n\n    fn bar(_: Self::N); // ok!\n}\n\n// or:\n\nfn foo<T>(x: T) {} // ok!\n```\n\nAnother case that causes this error is when a type is imported into a parent\nmodule. To fix this, you can follow the suggestion and use File directly or\n`use super::File;` which will import the types from the parent namespace. An\nexample that causes this error is below:\n\n```compile_fail,E0412\nuse std::fs::File;\n\nmod foo {\n    fn some_function(f: File) {}\n}\n```\n\n```\nuse std::fs::File;\n\nmod foo {\n    // either\n    use super::File;\n    // or\n    // use std::fs::File;\n    fn foo(f: File) {}\n}\n# fn main() {} // don't insert it for us; that'll break imports\n```\n"},"level":"error","spans":[{"file_name":"/checkout/src/test/ui/extern/extern-const.rs","byte_start":490,"byte_end":495,"line_start":15,"line_end":15,"column_start":38,"column_end":43,"is_primary":true,"text":[{"text":"    const rust_dbg_static_mut: libc::c_int; //~ ERROR extern items cannot be `const`","highlight_start":38,"highlight_end":43}],"label":"not found in `libc`","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"possible candidate is found in another module, you can import it into scope","code":null,"level":"help","spans":[{"file_name":"/checkout/src/test/ui/extern/extern-const.rs","byte_start":387,"byte_end":387,"line_start":13,"line_end":13,"column_start":1,"column_end":1,"is_primary":true,"text":[{"text":"#[link(name = \"rust_test_helpers\", kind = \"static\")]","highlight_start":1,"highlight_end":1}],"label":null,"suggested_replacement":"use std::os::raw::c_int;\n\n","suggestion_applicability":"Unspecified","expansion":null}],"children":[],"rendered":null}],"rendered":"error[E0412]: cannot find type `c_int` in module `libc`\n  --> /checkout/src/test/ui/extern/extern-const.rs:15:38\n   |\nLL |     const rust_dbg_static_mut: libc::c_int; //~ ERROR extern items cannot be `const`\n   |                                      ^^^^^ not found in `libc`\nhelp: possible candidate is found in another module, you can import it into scope\n   |\nLL | use std::os::raw::c_int;\n   |\n\n"}
[00:54:47] {"message":"aborting due to 2 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 2 previous errors\n\n"}
[00:54:47] {"message":"For more information about this error, try `rustc --explain E0412`.","code":null,"level":"","spans":[],"children":[],"rendered":"For more information about this error, try `rustc --explain E0412`.\n"}
[00:54:47] ------------------------------------------
[00:54:47] 
[00:54:47] thread '[ui] ui/extern/extern-const.rs' panicked at 'explicit panic', tools/compiletest/src/runtest.rs:3284:9
[00:54:47] note: Run with `RUST_BACKTRACE=1` for a backtrace.
---
[00:54:47] thread 'main' panicked at 'Some tests failed', tools/compiletest/src/main.rs:503:22
[00:54:47] 
[00:54:47] 
[00:54:47] 
[00:54:47] 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/wasm32-unknown-unknown/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-wasm32-unknown-unknown" "--mode" "ui" "--target" "wasm32-unknown-unknown" "--host" "x86_64-unknown-linux-gnu" "--llvm-filecheck" "/checkout/obj/build/x86_64-unknown-linux-gnu/llvm/build/bin/FileCheck" "--nodejs" "/node-v9.2.0-linux-x64/bin/node" "--host-rustcflags" "-Crpath -O -Zunstable-options " "--target-rustcflags" "-Crpath -O -Zunstable-options  -Lnative=/checkout/obj/build/wasm32-unknown-unknown/native/rust-test-helpers" "--docck-python" "/usr/bin/python2.7" "--lldb-python" "/usr/bin/python2.7" "--gdb" "/usr/bin/gdb" "--llvm-version" "8.0.0svn\n" "--cc" "" "--cxx" "" "--cflags" "" "--llvm-components" "" "--llvm-cxxflags" "" "--adb-path" "adb" "--adb-test-dir" "/data/tmp/work" "--android-cross-path" "" "--color" "always"
[00:54:47] 
[00:54:47] 
[00:54:47] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap test --target wasm32-unknown-unknown src/test/run-make src/test/ui src/test/run-pass src/test/compile-fail src/test/mir-opt src/test/codegen-units src/libcore
[00:54:47] Build completed unsuccessfully in 0:52:03
---
travis_time:end:169d428e:start=1541595122978017233,finish=1541595122985108328,duration=7091095
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:2bc2e868
$ 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:22f8fee0
travis_time:start:22f8fee0
$ 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:08dfbb2a
$ 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)

Update lldb

This updates lldb to pick up some bug fixes, and makes one minor test
suite fix to account for this.
…=varkor

Use trait impl method span when type param mismatch is due to impl Trait

Fix rust-lang#55374.
refactor: use shorthand fields

refactor: use shorthand for single fields everywhere (excluding tests).
…r=oli-obk

do not print wrapping ranges like normal ranges in validity diagnostics
@kennytm kennytm changed the title Rollup of 15 pull requests Rollup of 14 pull requests Nov 7, 2018
@kennytm
Copy link
Member Author

kennytm commented Nov 7, 2018

@bors r+

Removed #55719 (causing error above)
Removed #55717 (already testing)
Added #55645.

@bors
Copy link
Contributor

bors commented Nov 7, 2018

📌 Commit 4e86576 has been approved by kennytm

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 7, 2018
@bors
Copy link
Contributor

bors commented Nov 7, 2018

⌛ Testing commit 4e86576 with merge 25a42b2...

bors added a commit that referenced this pull request Nov 7, 2018
Rollup of 14 pull requests

Successful merges:

 - #55377 (Slight copy-editing for `std::cell::Cell` docs)
 - #55441 (Remove unused re import in gdb_rust_pretty_printing)
 - #55453 (Choose predicates without inference variables over those with them)
 - #55495 (Don't print opt fuel messages to stdout because it breaks Rustbuild)
 - #55501 (Make `process_obligations`' computation of `completed` optional.)
 - #55510 (Fix feature gate only being checked on first repr attr.)
 - #55609 (Run name-anon-globals after LTO passes as well)
 - #55645 (do not print wrapping ranges like normal ranges in validity diagnostics)
 - #55688 (Standardised names and location of ui issue tests)
 - #55692 (-C remark: fix incorrect warning about requiring "--debuginfo" instead of "-C debuginfo=n")
 - #55702 (Add `aarch64-pc-windows-msvc` to deployed targets)
 - #55728 (Update lldb)
 - #55730 (Use trait impl method span when type param mismatch is due to impl Trait)
 - #55734 (refactor: use shorthand fields)
@bors
Copy link
Contributor

bors commented Nov 7, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: kennytm
Pushing 25a42b2 to master...

@bors bors merged commit 4e86576 into rust-lang:master Nov 7, 2018
alexreg pushed a commit to alexreg/rust that referenced this pull request Nov 7, 2018
Rollup of 14 pull requests

Successful merges:

 - rust-lang#55377 (Slight copy-editing for `std::cell::Cell` docs)
 - rust-lang#55441 (Remove unused re import in gdb_rust_pretty_printing)
 - rust-lang#55453 (Choose predicates without inference variables over those with them)
 - rust-lang#55495 (Don't print opt fuel messages to stdout because it breaks Rustbuild)
 - rust-lang#55501 (Make `process_obligations`' computation of `completed` optional.)
 - rust-lang#55510 (Fix feature gate only being checked on first repr attr.)
 - rust-lang#55609 (Run name-anon-globals after LTO passes as well)
 - rust-lang#55645 (do not print wrapping ranges like normal ranges in validity diagnostics)
 - rust-lang#55688 (Standardised names and location of ui issue tests)
 - rust-lang#55692 (-C remark: fix incorrect warning about requiring "--debuginfo" instead of "-C debuginfo=n")
 - rust-lang#55702 (Add `aarch64-pc-windows-msvc` to deployed targets)
 - rust-lang#55728 (Update lldb)
 - rust-lang#55730 (Use trait impl method span when type param mismatch is due to impl Trait)
 - rust-lang#55734 (refactor: use shorthand fields)
@Centril Centril added the rollup A PR which is a rollup label Oct 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet