Merged
Conversation
…-arg-label, r=estebank Only point out a single function parameter if we have a single arg incompatibility Fixes rust-lang#99635
…triddle make `clean::Item::span` return `Option` instead of dummy span Fixes rust-lang#100283
…=GuillaumeGomez Rustdoc-Json: Add `Path` type for traits. Avoids using `Type` for trait fields, as a trait must always be a path, and not any other kind of type. ``@rustbot`` modify labels: +A-rustdoc-json +T-rustdoc Closes rust-lang#100106
Suggest the path separator when a dot is used on a trait Fixes rust-lang#100365. `@rustbot` label A-diagnostics r? diagnostics
…stab, r=estebank Enum variant ctor inherits the stability of the enum variant Fixes rust-lang#100399 Fixes rust-lang#100420 Context rust-lang#71481 for why enum variants don't need stability
…-after-impl-trait-items, r=compiler-errors Suggest removing a semicolon after impl/trait items fixes rust-lang#99822
Use an extensionless `x` script for non-Windows rust-lang#99992 added `x.sh` and `x.ps1`, but this broke my lazy `./xTAB` habit that used to get me to `./x.py`. If we rename `x.sh` to `x`, then I can adjust to `./xSPACE` for the same number of characters typed. r? `@jyn514`
…r-improvements, r=lcnr
Argument type error improvements
Motivated by this interesting code snippet:
```rust
#[derive(Copy, Clone)]
struct Wrapper<T>(T);
fn foo(_: fn(i32), _: Wrapper<i32>) {}
fn f(_: u32) {}
fn main() {
let w = Wrapper::<isize>(1isize);
foo(f, w);
}
```
Which currently errors like:
```
error[E0308]: arguments to this function are incorrect
--> src/main.rs:10:5
|
10 | foo(f, w);
| ^^^ - - expected `i32`, found `isize`
| |
| expected `i32`, found `u32`
|
= note: expected fn pointer `fn(i32)`
found fn item `fn(u32) {f}`
= note: expected struct `Wrapper<i32>`
found struct `Wrapper<isize>`
note: function defined here
--> src/main.rs:4:4
|
4 | fn foo(_: fn(i32), _: Wrapper<i32>) {}
| ^^^ ---------- ---------------
```
Specifically, that double `expected .. found ..` which is very difficult to correlate to the types in the arguments. Also, the fact that "expected `i32`, found `isize`" and the other argument mismatch label don't even really explain what's going on here.
After this PR:
```
error[E0308]: arguments to this function are incorrect
--> $DIR/two-mismatch-notes.rs:10:5
|
LL | foo(f, w);
| ^^^
|
note: expected fn pointer, found fn item
--> $DIR/two-mismatch-notes.rs:10:9
|
LL | foo(f, w);
| ^
= note: expected fn pointer `fn(i32)`
found fn item `fn(u32) {f}`
note: expected struct `Wrapper`, found a different struct `Wrapper`
--> $DIR/two-mismatch-notes.rs:10:12
|
LL | foo(f, w);
| ^
= note: expected struct `Wrapper<i32>`
found struct `Wrapper<isize>`
note: function defined here
--> $DIR/two-mismatch-notes.rs:4:4
|
LL | fn foo(_: fn(i32), _: Wrapper<i32>) {}
| ^^^ ---------- ---------------
error: aborting due to previous error
For more information about this error, try `rustc --explain E0308`.
```
Yeah, it's a bit verbose, but much clearer IMO.
---
Open to discussions about how this could be further improved. Motivated by `@jyn514's` [tweet](https://mobile.twitter.com/joshuayn514/status/1558042020601634816) here.
Contributor
Author
|
@bors r+ rollup=never p=8 |
Collaborator
Collaborator
Collaborator
|
☀️ Test successful - checks-actions |
Collaborator
|
📌 Perf builds for each rolled up PR: In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
This was referenced Aug 14, 2022
Collaborator
|
Finished benchmarking commit (2fbc08e): comparison url. Instruction count
Max RSS (memory usage)Results
CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
clean::Item::spanreturnOptioninstead of dummy span #100299 (makeclean::Item::spanreturnOptioninstead of dummy span)Pathtype for traits. #100335 (Rustdoc-Json: AddPathtype for traits.)xscript for non-Windows #100468 (Use an extensionlessxscript for non-Windows)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup