Remove logic to suggest clone of function output by compiler-errors · Pull Request #128241 · rust-lang/rust
rustbot
added
S-waiting-on-review
labels
Jul 26, 2024
bors
added
S-waiting-on-bors
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.labels
Jul 27, 2024bors added a commit to rust-lang-ci/rust that referenced this pull request
Jul 27, 2024Rollup of 8 pull requests Successful merges: - rust-lang#125897 (from_ref, from_mut: clarify documentation) - rust-lang#128207 (improve error message when `global_asm!` uses `asm!` options) - rust-lang#128241 (Remove logic to suggest clone of function output) - rust-lang#128259 ([illumos/solaris] set MSG_NOSIGNAL while writing to sockets) - rust-lang#128262 (Delete `SimplifyArmIdentity` and `SimplifyBranchSame` tests) - rust-lang#128266 (update `rust.channel` default value documentation) - rust-lang#128267 (Add rustdoc GUI test to check title with and without search) - rust-lang#128271 (Disable jump threading of float equality) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Jul 27, 2024Rollup merge of rust-lang#128241 - compiler-errors:clone-sugg, r=jieyouxu Remove logic to suggest clone of function output I can't exactly tell, but I believe that this suggestion is operating off of a heuristic that the lifetime of a function's input is correlated with the lifetime of a function's output in such a way that cloning would fix an error. I don't think that actually manages to hit the bar of "actually provides useful suggestions" most of the time. Specifically, I've hit false-positives due to this suggestion *twice* when fixing ICEs in the compiler, so I don't think it's worthwhile having this logic around. Neither of the two affected UI tests are actually fixed by the suggestion.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request
Jul 31, 2024…=estebank Peel off explicit (or implicit) deref before suggesting clone on move error in borrowck, remove some hacks Also remove a heck of a lot of weird hacks in `suggest_cloning` that I don't think we should have around. I know this regresses tests, but I don't believe most of these suggestions were accurate, b/c: 1. They either produced type errors (e.g. turning `&x` into `x.clone()`) 2. They don't fix the issue 3. They fix the issue ostensibly, but introduce logic errors (e.g. cloning a `&mut Option<T>` to then `Option::take` out...) Most of the suggestions are still wrong, but they're not particularly *less* wrong IMO. Stacked on top of rust-lang#128241, which is an "obviously worth landing" subset of this PR. r? estebank
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Aug 1, 2024Rollup merge of rust-lang#128244 - compiler-errors:move-clone-sugg, r=estebank Peel off explicit (or implicit) deref before suggesting clone on move error in borrowck, remove some hacks Also remove a heck of a lot of weird hacks in `suggest_cloning` that I don't think we should have around. I know this regresses tests, but I don't believe most of these suggestions were accurate, b/c: 1. They either produced type errors (e.g. turning `&x` into `x.clone()`) 2. They don't fix the issue 3. They fix the issue ostensibly, but introduce logic errors (e.g. cloning a `&mut Option<T>` to then `Option::take` out...) Most of the suggestions are still wrong, but they're not particularly *less* wrong IMO. Stacked on top of rust-lang#128241, which is an "obviously worth landing" subset of this PR. r? estebank
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