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 10 pull requests #58426

Closed
wants to merge 36 commits into from
Closed

Rollup of 10 pull requests #58426

wants to merge 36 commits into from

Conversation

Centril
Copy link
Contributor

@Centril Centril commented Feb 13, 2019

Successful merges:

Failed merges:

r? @ghost

estebank and others added 30 commits February 5, 2019 15:17
Instead of inlining the same logic into every number formatting implementation,
pull it out into a function that each of the number formatting impls call into.
The generic `F` in `with_padding` was causing a bunch of stuff to get inlined
that otherwise needn't be, blowing up code size.
This makes the capitalisation consistent and provides more context (especially for missing top-level attributes).
Removes some unsafe *and* saves almost half a kilobyte of code size.
This commit modifies name resolution error reporting so that if a name
is in scope and has been imported then we do not suggest importing it.

This can occur when we add a label about constructors not being visible
due to private fields. In these cases, we know that the struct/variant
has been imported and we should silence any suggestions to import the
struct/variant.
This clarifies why FP-units are disabled on UEFI targets, as well as
why we must opt into the NXCOMPAT feature.

I did find some time to investigate why GRUB and friends disable FP on
UEFI. The specification explicitly allows using MMX/SSE/AVX, but as it
turns out it does not mandate enabling the instruction sets explicitly.
Hence, any use of these instructions will trigger CPU exceptions,
unless an application explicitly enables them (which is not an option,
as these are global flags that better be controlled by the
kernel/firmware).

Furthermore, UEFI systems are allowed to mark any non-code page as
non-executable. Hence, we must make sure to never place code on the
stack or heap. So we better pass /NXCOMPAT to the linker for it to
complain if it ever places code in non-code pages.

Lastly, this fixes some typos in related comments.
…r=GuillaumeGomez

Ignore future deprecations in #[deprecated]

The future deprecation warnings should only apply to `#[rustc_deprecated]` as they take into account rustc's version. Fixes rust-lang#57952.

I've also slightly modified rustdoc's display of future deprecation notices to make it more consistent, so I'm assigning a rustdoc team member for review to make sure this is okay.

r? @GuillaumeGomez
On return type `impl Trait` for block with no expr point at last semi

Partial solution, doesn't actually validate that the last statement in the function body can satisfy the trait bound, but it's a good incremental improvement over the status quo.

```
error[E0277]: the trait bound `(): Bar` is not satisfied
  --> $DIR/impl-trait-return-trailing-semicolon.rs:3:13
   |
LL | fn foo() -> impl Bar {
   |             ^^^^^^^^ the trait `Bar` is not implemented for `()`
LL |     5;
   |      - consider removing this semicolon
   |
   = note: the return type of a function must have a statically known size
```

Partially addresses rust-lang#54771.
…k-Simulacrum

Cut down on number formating code size

r? @alexcrichton
…evel, r=davidtwco

Improve the error messages for missing stability attributes

This makes the capitalisation consistent and provides more context (especially for missing top-level attributes).
…leywiser

Fix ICE and invalid filenames in MIR printing code

* Don't panic when printing MIR for associated constants
* Don't use `<` and `>` in filenames, since they aren't allowed on Windows.

r? @eddyb

cc @RalfJung
Only suggest imports if not imported.

Fixes rust-lang#42944 and fixes rust-lang#53430.

This commit modifies name resolution error reporting so that if a name
is in scope and has been imported then we do not suggest importing it.

This can occur when we add a label about constructors not being visible
due to private fields. In these cases, we know that the struct/variant
has been imported and we should silence any suggestions to import the
struct/variant.

r? @estebank
Fix rustc_driver swallowing errors when compilation is stopped

r? @oli-obk
target/uefi: clarify documentation

This clarifies why FP-units are disabled on UEFI targets, as well as
why we must opt into the NXCOMPAT feature.

I did find some time to investigate why GRUB and friends disable FP on
UEFI. The specification explicitly allows using MMX/SSE/AVX, but as it
turns out it does not mandate enabling the instruction sets explicitly.
Hence, any use of these instructions will trigger CPU exceptions,
unless an application explicitly enables them (which is not an option,
as these are global flags that better be controlled by the
kernel/firmware).

Furthermore, UEFI systems are allowed to mark any non-code page as
non-executable. Hence, we must make sure to never place code on the
stack or heap. So we better pass /NXCOMPAT to the linker for it to
complain if it ever places code in non-code pages.

Lastly, this fixes some typos in related comments.

r? @alexcrichton
@Centril
Copy link
Contributor Author

Centril commented Feb 13, 2019

@bors r+ p=10

@bors
Copy link
Contributor

bors commented Feb 13, 2019

📌 Commit 01533d4 has been approved by Centril

@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 Feb 13, 2019
@rust-highfive
Copy link
Collaborator

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

Click to expand the log.
travis_time:end:006e59b7:start=1550067918292459754,finish=1550068179125410797,duration=260832951043
$ git checkout -qf FETCH_HEAD
travis_fold:end:git.checkout

Encrypted environment variables have been removed for security reasons.
See https://docs.travis-ci.com/user/pull-requests/#pull-requests-and-security-restrictions
$ export SCCACHE_BUCKET=rust-lang-ci-sccache2
$ export SCCACHE_REGION=us-west-1
Setting environment variables from .travis.yml
$ export IMAGE=x86_64-gnu-llvm-6.0
---
[00:12:25]    Compiling syntax_ext v0.0.0 (/checkout/src/libsyntax_ext)
[00:12:55] error[E0308]: mismatched types
[00:12:55]    --> src/librustc/traits/error_reporting.rs:651:74
[00:12:55]     |
[00:12:55] 651 |                         let parent_node = self.tcx.hir().get_parent_node(obligation.cause.body_id);
[00:12:55]     |                                                                          ^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `syntax::ast::NodeId`, found struct `hir::HirId`
[00:12:55]     = note: expected type `syntax::ast::NodeId`
[00:12:55]                found type `hir::HirId`
[00:12:55] 
[00:13:03] error: aborting due to previous error
---
[00:13:03] command did not execute successfully: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "build" "--target" "x86_64-unknown-linux-gnu" "-j" "4" "--release" "--locked" "--color" "always" "--features" "" "--manifest-path" "/checkout/src/rustc/Cargo.toml" "--message-format" "json"
[00:13:03] expected success, got: exit code: 101
[00:13:03] failed to run: /checkout/obj/build/bootstrap/debug/bootstrap build
[00:13:03] Build completed unsuccessfully in 0:04:15
[00:13:03] make: *** [all] Error 1
[00:13:03] Makefile:18: recipe for target 'all' failed
The command "stamp sh -x -c "$RUN_SCRIPT"" exited with 2.
travis_time:start:24171912
$ date && (curl -fs --head https://google.com | grep ^Date: | sed 's/Date: //g' || true)
Wed Feb 13 14:42:51 UTC 2019
---
travis_time:end:06a5d5bb:start=1550068973113858684,finish=1550068973118859580,duration=5000896
travis_fold:end:after_failure.3
travis_fold:start:after_failure.4
travis_time:start:33940de6
$ 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:0124f486
travis_time:start:0124f486
$ 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:1b0fbeca
$ 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)

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.

Compiler panics during incremental recompilation, while using an associated constant as array size