-
Notifications
You must be signed in to change notification settings - Fork 13k
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 5 pull requests #99948
Merged
Merged
Rollup of 5 pull requests #99948
Conversation
This file contains 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
This also fixes the argument names in `report_closure_arg_mismatch` (confusing expected/found)
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
…, r=cjgillot change maybe_body_owned_by to take local def id Issue rust-lang#96341 r? `@cjgillot`
…ompiler-errors Improve type mismatch w/ function signatures This PR makes use of `note: expected/found` (instead of labeling types in labels) in type mismatch with function signatures. Pros: it's easier to compare the signatures, cons: the error is a little more verbose now. This is especially nice when - The signatures differ in a small subset of parameters (same parameters are elided) - The difference is in details, for example `isize` vs `usize` (there is a better chance that the types align) Also this PR fixes the inconsistency in variable names in the edited code (`expected` and `found`). A zulip thread from which this pr started: [[link]](https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/Type.20error.20regression.3F.2E.2E.2E/near/289756602). An example diagnostic: <table> <tr> <th>this pr</th> <th>nightly</th> </tr> <tr> <td> ```text error[E0631]: type mismatch in function arguments --> ./t.rs:4:12 | 4 | expect(&f); | ------ ^^ expected due to this | | | required by a bound introduced by this call ... 10 | fn f(_: isize, _: u8, _: Vec<u32>) {} | ---------------------------------- found signature defined here | = note: expected function signature `fn(usize, _, Vec<u64>) -> _` found function signature `fn(isize, _, Vec<u32>) -> _` note: required because of the requirements on the impl of `Trait` for `fn(isize, u8, Vec<u32>) {f}` --> ./t.rs:8:9 | 8 | impl<F> Trait for F where F: Fn(usize, u8, Vec<u64>) -> u8 {} | ^^^^^ ^ = note: required for the cast from `fn(isize, u8, Vec<u32>) {f}` to the object type `dyn Trait` ``` </td> <td> ```text error[E0631]: type mismatch in function arguments --> ./t.rs:4:12 | 4 | expect(&f); | ------ ^^ expected signature of `fn(usize, u8, Vec<u64>) -> _` | | | required by a bound introduced by this call ... 10 | fn f(_: isize, _: u8, _: Vec<u32>) {} | ---------------------------------- found signature of `fn(isize, u8, Vec<u32>) -> _` | note: required because of the requirements on the impl of `Trait` for `fn(isize, u8, Vec<u32>) {f}` --> ./t.rs:8:9 | 8 | impl<F> Trait for F where F: Fn(usize, u8, Vec<u64>) -> u8 {} | ^^^^^ ^ = note: required for the cast to the object type `dyn Trait` ``` </td> </tr> </table> <details><summary>code</summary> <p> ```rust fn main() { fn expect(_: &dyn Trait) {} expect(&f); } trait Trait {} impl<F> Trait for F where F: Fn(usize, u8, Vec<u64>) -> u8 {} fn f(_: isize, _: u8, _: Vec<u32>) {} ``` </p> </details> r? `@compiler-errors`
…t-cast, r=davidtwco don't call type ascription "cast" Noticed in rust-lang#99885
remove some manual hash stable impls
Add diagnostic when using public instead of pub Forwarding from rust-lang#99706 I accidentally broke something(??) in git and the commits in that PR are absolutely not what I did in that branch Anyways, this is the PR for this now. Adding tests again in a minute. cc `@davidtwco`
rustbot
added
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
rollup
A PR which is a rollup
labels
Jul 30, 2022
@bors r+ rollup=never p=5 |
bors
added
the
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
label
Jul 30, 2022
☀️ Test successful - checks-actions |
This was referenced Jul 30, 2022
Finished benchmarking commit (038f9e6): comparison url. Instruction count
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResults
If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression Footnotes |
flip1995
pushed a commit
to flip1995/rust
that referenced
this pull request
Aug 11, 2022
Rollup of 5 pull requests Successful merges: - rust-lang#99311 (change maybe_body_owned_by to take local def id) - rust-lang#99862 (Improve type mismatch w/ function signatures) - rust-lang#99895 (don't call type ascription "cast") - rust-lang#99900 (remove some manual hash stable impls) - rust-lang#99903 (Add diagnostic when using public instead of pub) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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.
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.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
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:
Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup