Make suggestion of changing mutability of arguments broader#81990
Merged
bors merged 1 commit intorust-lang:masterfrom Feb 12, 2021
Merged
Make suggestion of changing mutability of arguments broader#81990bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Contributor
|
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
6f74c7d to
e03f097
Compare
estebank
approved these changes
Feb 11, 2021
Contributor
estebank
left a comment
There was a problem hiding this comment.
I'm delighted that the change was this small :)
Comment on lines
+28
to
+30
| = note: the following trait bounds were not satisfied: | ||
| `&T: std::io::Read` | ||
| which is required by `BufReader<&T>: BufRead` |
Contributor
There was a problem hiding this comment.
As a separate issue, it'd be nice if we mentioned that BufReader<&mut T> would satisfy the trait bounds.
Contributor
|
@bors r+ rollup |
Collaborator
|
📌 Commit e03f097 has been approved by |
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Feb 12, 2021
…estebank Make suggestion of changing mutability of arguments broader Fix rust-lang#81421 Previously rustc tries to emit the suggestion of changing mutablity unless `!trait_ref.has_infer_types_or_consts() && self.predicate_can_apply(obligation.param_env, trait_ref)` and this led to some false negatives to occur.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 12, 2021
Rollup of 16 pull requests Successful merges: - rust-lang#79983 (fix indefinite article in cell.rs) - rust-lang#81831 (Don't display `mut` in arguments for functions documentation) - rust-lang#81947 (Relax ItemCtxt::to_ty lifetime) - rust-lang#81954 (RELEASES.md 1.50: Group platform support notes together) - rust-lang#81955 (bootstrap: Locate llvm-dwp based on llvm-config bindir) - rust-lang#81959 (Fix assosiated typo) - rust-lang#81964 (Fix documentation not showing on localStorage error) - rust-lang#81968 (bootstrap: fix wrong docs installation path) - rust-lang#81990 (Make suggestion of changing mutability of arguments broader) - rust-lang#81994 (Improve long explanation for E0542 and E0546) - rust-lang#81997 (dist: include src/build_helper as part of the crate graph for rustc-dev) - rust-lang#82003 (Stack probes: fix error message) - rust-lang#82004 (clean up clean::Static struct) - rust-lang#82011 (Fix private intra-doc warnings on associated items) - rust-lang#82013 (Tell user how to fix CI file being not up to date) - rust-lang#82017 (Fix typo in mod.rs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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.
Fix #81421
Previously rustc tries to emit the suggestion of changing mutablity unless
!trait_ref.has_infer_types_or_consts() && self.predicate_can_apply(obligation.param_env, trait_ref)and this led to some false negatives to occur.