Skip to content

Rollup of 12 pull requests - #47734

Closed
GuillaumeGomez wants to merge 21 commits into
rust-lang:masterfrom
GuillaumeGomez:rollup
Closed

Rollup of 12 pull requests#47734
GuillaumeGomez wants to merge 21 commits into
rust-lang:masterfrom
GuillaumeGomez:rollup

Conversation

ritiekand others added 11 commits January 20, 2018 11:14
When encountering a method call for an ADT that doesn't have any
implementation of it, we search for traits that could be implemented
that do have that method. Filter out private non-local traits that would
not be able to be implemented.
This doesn't account for public traits that are in a private scope, but
works as a first approximation and is a more correct behavior than the
current one.
When the compiler driver panics it attempts to show a hint about using
`RUST_BACKTRACE`. However, the logic is currently reversed to the hint
is only shown if `RUST_BACKTRACE` is *already* set:
```shell
> RUST_BACKTRACE=1 rustc /dev/null --crate-type proc-macro
error: internal compiler error: unexpected panic
...
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'attempt to subtract with overflow', librustc_errors/emitter.rs:287:49
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
> RUST_BACKTRACE=0 rustc /dev/null --crate-type proc-macro
error: internal compiler error: unexpected panic
...
thread 'rustc' panicked at 'attempt to subtract with overflow', librustc_errors/emitter.rs:287:49
note: Run with `RUST_BACKTRACE=1` for a backtrace.
```
As the `panic` itself already has a working `RUST_BACKTRACE` hint just
remove the broken duplicate hint entirely.
Now that the Rust codebase depends on cc 1.0.4, there is no longer any
need to specify a compiler for CloudABI manually. Cargo will
automatically call into the right compiler executable.
As discussed in rust-lang#47699 the logic for determining if an expression needs
parenthesis when suggesting an `.into()` cast is incorrect. Two broken
examples from nightly are:
```
error[E0308]: mismatched types
--> main.rs:4:10
|
4 | test(foo as i8);
| ^^^^^^^^^ expected i32, found i8
help: you can cast an `i8` to `i32`, which will sign-extend the source value
|
4 | test(foo as i8.into());
|
```
```
error[E0308]: mismatched types
--> main.rs:4:10
|
4 | test(*foo);
| ^^^^ expected i32, found i8
help: you can cast an `i8` to `i32`, which will sign-extend the source value
|
4 | test(*foo.into());
|
```
As suggested by @petrochenkov switch the precedence check to
PREC_POSTFIX. This catches both `as` and unary operators. Fixesrust-lang#47699.
Just a routine update
@rust-highfive

Copy link
Copy Markdown
Contributor

Some changes occurred in HTML/CSS.

cc @GuillaumeGomez

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @eddyb

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

@GuillaumeGomez

Copy link
Copy Markdown
MemberAuthor

@bors: r+ p=1

@bors

bors commented Jan 25, 2018

Copy link
Copy Markdown
Collaborator

📌 Commit f972212 has been approved by GuillaumeGomez

@bors

bors commented Jan 25, 2018

Copy link
Copy Markdown
Collaborator

⌛ Testing commit f9722121a499c7804bdc4168df44688f03abc46a with merge dc3b339bab76b8a1c0fa20728743a3741cab9dd3...

@bors

bors commented Jan 25, 2018

Copy link
Copy Markdown
Collaborator

💔 Test failed - status-travis

@kennytm

kennytm commented Jan 25, 2018

Copy link
Copy Markdown
Member

A rustdoc JS test failed on i686-apple-darwin, should be legit.

Details
[02:28:06] FAILED
[02:28:06] ==> Result not found in 'others': '{"path":"std::i32","name":"from_unsigned"}'
[02:28:06] ==> Result not found in 'others': '{"path":"std::i128","name":"from_unsigned"}'
[02:28:06] Checking "from_u.js" ... Checking "macro-print.js" ... OK
[02:28:06] Checking "quoted.js" ... OK
[02:28:06] Checking "string-from_ut.js" ... OK
[02:28:06] Checking "struct-vec.js" ... OK
[02:28:06] [02:28:06] [02:28:06] command did not execute successfully: "/Users/travis/.nvm/versions/node/v6.11.4/bin/node" "src/tools/rustdoc-js/tester.js" "i686-apple-darwin"
[02:28:06] expected success, got: exit code: 1
[02:28:06] [02:28:06] [02:28:06] failed to run: /Users/travis/build/rust-lang/rust/build/bootstrap/debug/bootstrap test
[02:28:06] Build completed unsuccessfully in 1:06:50
[02:28:06] make: *** [check] Error 1

Edit: caused by #47675.

@GuillaumeGomez

Copy link
Copy Markdown
MemberAuthor

Ok, closing/reopening a new one.

…etrochenkov
On missing method do not suggest private traits
When encountering a method call for an ADT that doesn't have any
implementation of it, we search for traits that could be implemented
that do have that method. Filter out private non-local traits that would
not be able to be implemented.
This doesn't account for public traits that are in a private scope, but
works as a first approximation and is a more correct behavior than the
current one.
Fixrust-lang#45781.
…nikomatsakis
NLL test for mutating &mut references
As mentioned in rust-lang#46361.
cc @nikomatsakis?
…hint, r=estebank
Remove broken redundant backtrace hint
When the compiler driver panics it attempts to show a hint about using `RUST_BACKTRACE`. However, the logic is currently reversed to the hint is only shown if `RUST_BACKTRACE` is **already** set:
```shell
> RUST_BACKTRACE=1 rustc /dev/null --crate-type proc-macro
error: internal compiler error: unexpected panic
...
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'attempt to subtract with overflow', librustc_errors/emitter.rs:287:49
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
> RUST_BACKTRACE=0 rustc /dev/null --crate-type proc-macro
error: internal compiler error: unexpected panic
...
thread 'rustc' panicked at 'attempt to subtract with overflow', librustc_errors/emitter.rs:287:49
note: Run with `RUST_BACKTRACE=1` for a backtrace.
```
As the `panic` itself already has a working `RUST_BACKTRACE` hint just remove the broken duplicate hint entirely.
Remove workarounds for cc 1.0.3.
Now that the Rust codebase depends on cc 1.0.4, there is no longer any
need to specify a compiler for CloudABI manually. Cargo will
automatically call into the right compiler executable.
…nce, r=petrochenkov
Fix into() cast paren check precedence
As discussed in rust-lang#47699 the logic for determining if an expression needs parenthesis when suggesting an `.into()` cast is incorrect. Two broken examples from nightly are:
```
error[E0308]: mismatched types
--> main.rs:4:10
|
4 | test(foo as i8);
| ^^^^^^^^^ expected i32, found i8
help: you can cast an `i8` to `i32`, which will sign-extend the source value
|
4 | test(foo as i8.into());
|
```
```
error[E0308]: mismatched types
--> main.rs:4:10
|
4 | test(*foo);
| ^^^^ expected i32, found i8
help: you can cast an `i8` to `i32`, which will sign-extend the source value
|
4 | test(*foo.into());
|
```
As suggested by @petrochenkov switch the precedence check to `PREC_POSTFIX`. This catches both `as` and unary operators. Fixesrust-lang#47699.
r? @petrochenkov
…r=QuietMisdreavus
Fix experimental text display on default theme
r? @QuietMisdreavus
…s-span, r=petrochenkov
Fix spans in unused import lint for nested groups
This fixes an inconsistency for empty nested groups, and adds a test for all the possible cases of the lint.
```
warning: unused imports: `*`, `Foo`, `baz::{}`, `foobar::*`
--> test.rs:16:11
|
16 | use foo::{Foo, bar::{baz::{}, foobar::*}, *};
| ^^^ ^^^^^^^ ^^^^^^^^^ ^
|
= note: #[warn(unused_imports)] on by default
warning: unused import: `*`
--> test.rs:17:24
|
17 | use foo::bar::baz::{*, *};
| ^
warning: unused import: `use foo::{};`
--> test.rs:18:1
|
18 | use foo::{};
| ^^^^^^^^^^^^
```
cc rust-lang#44494
Update Cargo submodule to master
Just a routine update
@GuillaumeGomez
GuillaumeGomez deleted the rollup branch January 25, 2018 14:51
@CentrilCentril added the rollup A PR which is a rollup label Oct 24, 2019
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rollupA PR which is a rollup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

13 participants

@GuillaumeGomez@rust-highfive@bors@kennytm@eddyb@Centril@ritiek@estebank@etaoins@EdSchouten@evelynmitchell@emilyalbini@alexcrichton