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 7 pull requests #73246

Merged
merged 20 commits into from
Jun 11, 2020
Merged

Rollup of 7 pull requests #73246

merged 20 commits into from
Jun 11, 2020

Conversation

Dylan-DPC-zz
Copy link

Successful merges:

Failed merges:

r? @ghost

euclio and others added 20 commits May 15, 2020 23:56
Clippy's tests were failing the build, but that failure was ignored in favor of
checking toolstate. This is the correct behavior for toolstate-checked tools,
but Clippy no longer updates its toolstate status as it should always build.
This is only really useful in debug messages, so I've switched to
calling `span_to_string` in any place that causes a `Span` to end up in
user-visible output.
Fixes rust-lang#69977

When we parse a chain of method calls like `foo.a().b().c()`, each
`MethodCallExpr` gets assigned a span that starts at the beginning of
the call chain (`foo`). While this is useful for diagnostics, it means
that `Location::caller` will return the same location for every call
in a call chain.

This PR makes us separately record the span of the function name and
arguments for a method call (e.g. `b()` in `foo.a().b().c()`). This
`Span` is passed through HIR lowering and MIR building to
`TerminatorKind::Call`, where it is used in preference to
`Terminator.source_info.span` when determining `Location::caller`.

This new span is also useful for diagnostics where we want to emphasize
a particular method call - for an example, see
rust-lang#72389 (comment)
…Dylan-DPC

remove extra space from crate-level doctest names

Before:

```
running 2 tests
test src/test/rustdoc-ui/doctest-output.rs - foo::bar (line 11) ... ok
test src/test/rustdoc-ui/doctest-output.rs -  (line 5) ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
```

After:

```
running 2 tests
test src/test/rustdoc-ui/doctest-output.rs - foo::bar (line 11) ... ok
test src/test/rustdoc-ui/doctest-output.rs - (line 5) ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
```
…r=matthewjasper

Show `SyntaxContext` in formatted `Span` debug output

This is only really useful in debug messages, so I've switched to
calling `span_to_string` in any place that causes a `Span` to end up in
user-visible output.
Try_run must only be used if toolstate is populated

Clippy's tests were failing the build, but that failure was ignored in favor of checking toolstate. This is the correct behavior for toolstate-checked tools, but Clippy no longer updates its toolstate status as it should always build.

The previous PR of this kind didn't catch this as I expected x.py failures to always lead to a non-successful build in CI, but that's not the case specifically for tool testing.
Handle assembler warnings properly

Previously all inline asm diagnostics were treated as errors, but LLVM sometimes emits warnings and notes as well.

Fixes rust-lang#73160

r? @petrochenkov
…atthewjasper

Track span of function in method calls, and use this in #[track_caller]

Fixes rust-lang#69977

When we parse a chain of method calls like `foo.a().b().c()`, each
`MethodCallExpr` gets assigned a span that starts at the beginning of
the call chain (`foo`). While this is useful for diagnostics, it means
that `Location::caller` will return the same location for every call
in a call chain.

This PR makes us separately record the span of the function name and
arguments for a method call (e.g. `b()` in `foo.a().b().c()`). This
`Span` is passed through HIR lowering and MIR building to
`TerminatorKind::Call`, where it is used in preference to
`Terminator.source_info.span` when determining `Location::caller`.

This new span is also useful for diagnostics where we want to emphasize
a particular method call - for an example, see
rust-lang#72389 (comment)
Suggest including unused asm arguments in a comment to avoid error

We require all arguments to an `asm!` to be used in the template string, just like format strings. However in some cases (e.g. `black_box`) it may be desirable to have `asm!` arguments that are not used in the template string.

Currently this is a hard error rather than a lint since `#[allow]` does not work on macros (rust-lang#63221), so this PR suggests using the unused arguments in an asm comment as a workaround.

r? @petrochenkov
@Dylan-DPC-zz
Copy link
Author

@bors r+ rollup=never p=7

@bors
Copy link
Contributor

bors commented Jun 11, 2020

📌 Commit 8650df5 has been approved by Dylan-DPC

@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 Jun 11, 2020
@bors
Copy link
Contributor

bors commented Jun 11, 2020

⌛ Testing commit 8650df5 with merge a37c32e...

@bors
Copy link
Contributor

bors commented Jun 11, 2020

☀️ Test successful - checks-azure
Approved by: Dylan-DPC
Pushing a37c32e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 11, 2020
@bors bors merged commit a37c32e into rust-lang:master Jun 11, 2020
@rust-highfive
Copy link
Collaborator

📣 Toolstate changed by #73246!

Tested on commit a37c32e.
Direct link to PR: #73246

🎉 rls on windows: build-fail → test-pass (cc @Xanewok).
🎉 rls on linux: build-fail → test-pass (cc @Xanewok).
🎉 rustfmt on windows: build-fail → test-pass (cc @topecongiro).
🎉 rustfmt on linux: build-fail → test-pass (cc @topecongiro).

rust-highfive added a commit to rust-lang-nursery/rust-toolstate that referenced this pull request Jun 11, 2020
Tested on commit rust-lang/rust@a37c32e.
Direct link to PR: <rust-lang/rust#73246>

🎉 rls on windows: build-fail → test-pass (cc @Xanewok).
🎉 rls on linux: build-fail → test-pass (cc @Xanewok).
🎉 rustfmt on windows: build-fail → test-pass (cc @topecongiro).
🎉 rustfmt on linux: build-fail → test-pass (cc @topecongiro).
@RalfJung
Copy link
Member

Something in this rollup broke Miri, it now ICEs with

thread 'rustc' panicked at 'internal error: entered unreachable code', /home/r/.rustup/toolchains/miri/lib/rustlib/src/rust/src/libstd/macros.rs:13:23
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

But for some reason its toolstate is still green.

@Xanewok @Mark-Simulacrum is it expected that this fixed rls/rustfmt toolstate without changing those tools? Given that this landed a change in the toolstate logic in bootstrap, maybe that logic is just wrong now and reports all tools as working?

@Xanewok
Copy link
Member

Xanewok commented Jun 12, 2020

Yes, it 'fixed' the toolstate but it's still broken as far as I can tell.

@Mark-Simulacrum
Copy link
Member

Very strange. I'll take a look, the change should have only affected clippy...

@Dylan-DPC-zz Dylan-DPC-zz deleted the rollup-xnm531f branch June 15, 2020 23:32
@cuviper cuviper added this to the 1.46 milestone May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. 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