1
Fork 0

Auto merge of #110249 - matthiaskrgr:rollup-7iig04q, r=matthiaskrgr

Rollup of 8 pull requests

Successful merges:

 - #110153 (Fix typos in compiler)
 - #110165 (rustdoc: use CSS `overscroll-behavior` instead of JavaScript)
 - #110175 (Symbol cleanups)
 - #110203 (Remove `..` from return type notation)
 - #110205 (rustdoc: make settings radio and checks thicker, less contrast)
 - #110222 (Improve the error message when forwarding a matched fragment to another macro)
 - #110237 (Split out a separate feature gate for impl trait in associated types)
 - #110241 (tidy: Issue an error when UI test limits are too high)

Failed merges:

 - #110218 (Remove `ToRegionVid`)

r? `@ghost`
`@rustbot` modify labels: rollup
This commit is contained in:
bors 2023-04-12 20:01:36 +00:00
commit 4087deaccd
177 changed files with 634 additions and 554 deletions

View file

@ -593,7 +593,7 @@ pub struct MultipleMutBorrows {
#[primary_span]
pub span: Span,
#[subdiagnostic]
pub occurences: Vec<Conflict>,
pub occurrences: Vec<Conflict>,
}
#[derive(Diagnostic)]
@ -602,7 +602,7 @@ pub struct AlreadyBorrowed {
#[primary_span]
pub span: Span,
#[subdiagnostic]
pub occurences: Vec<Conflict>,
pub occurrences: Vec<Conflict>,
}
#[derive(Diagnostic)]
@ -611,7 +611,7 @@ pub struct AlreadyMutBorrowed {
#[primary_span]
pub span: Span,
#[subdiagnostic]
pub occurences: Vec<Conflict>,
pub occurrences: Vec<Conflict>,
}
#[derive(Diagnostic)]
@ -620,7 +620,7 @@ pub struct MovedWhileBorrowed {
#[primary_span]
pub span: Span,
#[subdiagnostic]
pub occurences: Vec<Conflict>,
pub occurrences: Vec<Conflict>,
}
#[derive(Subdiagnostic)]

View file

@ -966,30 +966,30 @@ fn check_borrow_conflicts_in_at_patterns<'tcx>(cx: &MatchVisitor<'_, '_, 'tcx>,
let report_mut_ref = !conflicts_mut_ref.is_empty();
let report_move_conflict = !conflicts_move.is_empty();
let mut occurences = match mut_outer {
let mut occurrences = match mut_outer {
Mutability::Mut => vec![Conflict::Mut { span: pat.span, name }],
Mutability::Not => vec![Conflict::Ref { span: pat.span, name }],
};
occurences.extend(conflicts_mut_mut);
occurences.extend(conflicts_mut_ref);
occurences.extend(conflicts_move);
occurrences.extend(conflicts_mut_mut);
occurrences.extend(conflicts_mut_ref);
occurrences.extend(conflicts_move);
// Report errors if any.
if report_mut_mut {
// Report mutability conflicts for e.g. `ref mut x @ Some(ref mut y)`.
sess.emit_err(MultipleMutBorrows { span: pat.span, occurences });
sess.emit_err(MultipleMutBorrows { span: pat.span, occurrences });
} else if report_mut_ref {
// Report mutability conflicts for e.g. `ref x @ Some(ref mut y)` or the converse.
match mut_outer {
Mutability::Mut => {
sess.emit_err(AlreadyMutBorrowed { span: pat.span, occurences });
sess.emit_err(AlreadyMutBorrowed { span: pat.span, occurrences });
}
Mutability::Not => {
sess.emit_err(AlreadyBorrowed { span: pat.span, occurences });
sess.emit_err(AlreadyBorrowed { span: pat.span, occurrences });
}
};
} else if report_move_conflict {
// Report by-ref and by-move conflicts, e.g. `ref x @ y`.
sess.emit_err(MovedWhileBorrowed { span: pat.span, occurences });
sess.emit_err(MovedWhileBorrowed { span: pat.span, occurrences });
}
}