Fix incorrect mutable suggestion information for binding in ref pattern like: let &b = a; #115595
Fix incorrect mutable suggestion information for binding in ref pattern like: let &b = a; #115595bors merged 1 commit intorust-lang:masterfrom
let &b = a; #115595Conversation
There was a problem hiding this comment.
Probably not in scope for this PR, but we really should put a HirId in here.
There was a problem hiding this comment.
Probably not in scope for this PR, but we really should put a
HirIdin here.
Thanks very much, since this will cause multiple changes when using LocalDecl, I thought I could submit another pr to support this.
|
@bors r+ |
Fix incorrect mutable suggestion information for binding in ref pattern like: `let &b = a;` fixes rust-lang#114896 I find we have to get pat_span but not local_decl.source_info.span for suggestion. In `let &b = a;` pat_span is &b. I think check `let &b = a` in hir to make sure it is hir::Node::Local(hir::Local {pat: hir::Pat{kind: hir::PatKind::Ref(....... can distinguish it from other situation, but I'm not sure. If my processing method is not accurate, please guide me to modify it, thank you. r? `@davidtwco`
Rollup of 7 pull requests Successful merges: - rust-lang#115308 (suggest iter_mut() where trying to modify elements from .iter()) - rust-lang#115595 (Fix incorrect mutable suggestion information for binding in ref pattern like: `let &b = a;` ) - rust-lang#115702 (Update mailmap) - rust-lang#115708 (fix homogeneous_aggregate not ignoring some ZST) - rust-lang#115739 (Call `LateLintPass::check_attribute` from `with_lint_attrs`) - rust-lang#115743 (Point out if a local trait has no implementations) - rust-lang#115744 (Improve diagnostic for generic params from outer items (E0401)) r? `@ghost` `@rustbot` modify labels: rollup
|
☀️ Test successful - checks-actions |
|
Finished benchmarking commit (3ebb562): comparison URL. Overall result: no relevant changes - no action needed@rustbot label: -perf-regression Instruction countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)ResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResultsThis is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 629.05s -> 629.503s (0.07%) |
fixes #114896
I find we have to get pat_span but not local_decl.source_info.span for suggestion. In
let &b = a;pat_span is &b. I think checklet &b = ain hir to make sure it is hir::Node::Local(hir::Local {pat: hir::Pat{kind: hir::PatKind::Ref(....... can distinguish it from other situation, but I'm not sure.If my processing method is not accurate, please guide me to modify it, thank you.
r? @davidtwco