-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Make suggestion of changing mutability of arguments broader #81990
Conversation
r? @estebank (rust-highfive has picked a reviewer for you, use r? to override) |
6f74c7d
to
e03f097
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm delighted that the change was this small :)
= note: the following trait bounds were not satisfied: | ||
`&T: std::io::Read` | ||
which is required by `BufReader<&T>: BufRead` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a separate issue, it'd be nice if we mentioned that BufReader<&mut T>
would satisfy the trait bounds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #82086
@bors r+ rollup |
📌 Commit e03f097 has been approved by |
…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.
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
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.