Skip to content
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

Rollup of 9 pull requests #121234

Closed
wants to merge 20 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
81c068a
install tools documentations
onur-ozkan Feb 14, 2024
e4a15d4
don't use entire sysroot binary path for rustc tarballs
onur-ozkan Feb 14, 2024
0925ff8
use build.rustc config and skip-stage0-validation flag
onur-ozkan Feb 14, 2024
b80fc5d
errors: only eagerly translate subdiagnostics
davidtwco Feb 14, 2024
7c2db70
Don't use mem::zeroed in vec::IntoIter
saethlin Feb 11, 2024
c370403
Add more checks for `unnamed_field` during HIR analysis
clubby789 Feb 16, 2024
ede9923
Make `CodegenBackend::join_codegen` infallible.
nnethercote Feb 16, 2024
228441d
Use fulfillment in next trait solver coherence
compiler-errors Feb 16, 2024
dae22a5
Fix `cfg(target_abi = "sim")` on i386-apple-ios
madsmtm Feb 17, 2024
d801985
Fix comment
madsmtm Feb 17, 2024
3ec7d0a
create stamp file for clippy in `Config::download_clippy`
onur-ozkan Feb 17, 2024
d163d54
Rollup merge of #120952 - saethlin:vec-into-iter, r=the8472
matthiaskrgr Feb 17, 2024
a3aef2e
Rollup merge of #121079 - onur-ozkan:install-conflicts, r=albertlarsan68
matthiaskrgr Feb 17, 2024
e89fc18
Rollup merge of #121085 - davidtwco:always-eager-diagnostics, r=nneth…
matthiaskrgr Feb 17, 2024
7f3cf08
Rollup merge of #121091 - onur-ozkan:bypass-stage0-download-in-tests,…
matthiaskrgr Feb 17, 2024
7436a6a
Rollup merge of #121193 - compiler-errors:coherence-fulfillment, r=lcnr
matthiaskrgr Feb 17, 2024
f4f2a75
Rollup merge of #121198 - clubby789:unnamed-fields-hir-checks, r=comp…
matthiaskrgr Feb 17, 2024
b865d9b
Rollup merge of #121209 - nnethercote:infallible-join_codegen, r=bjorn3
matthiaskrgr Feb 17, 2024
b331e6f
Rollup merge of #121210 - madsmtm:fix-target-abi-i386-apple-ios, r=wo…
matthiaskrgr Feb 17, 2024
ad71ae1
Rollup merge of #121228 - onur-ozkan:fix-clippy-stamp-bug, r=albertla…
matthiaskrgr Feb 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 54 additions & 35 deletions compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
seen_spans.insert(move_span);
}

use_spans.var_path_only_subdiag(&mut err, desired_action);
use_spans.var_path_only_subdiag(self.dcx(), &mut err, desired_action);

if !is_loop_move {
err.span_label(
Expand Down Expand Up @@ -291,18 +291,24 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
if needs_note {
if let Some(local) = place.as_local() {
let span = self.body.local_decls[local].source_info.span;
err.subdiagnostic(crate::session_diagnostics::TypeNoCopy::Label {
is_partial_move,
ty,
place: &note_msg,
span,
});
err.subdiagnostic(
self.dcx(),
crate::session_diagnostics::TypeNoCopy::Label {
is_partial_move,
ty,
place: &note_msg,
span,
},
);
} else {
err.subdiagnostic(crate::session_diagnostics::TypeNoCopy::Note {
is_partial_move,
ty,
place: &note_msg,
});
err.subdiagnostic(
self.dcx(),
crate::session_diagnostics::TypeNoCopy::Note {
is_partial_move,
ty,
place: &note_msg,
},
);
};
}

Expand Down Expand Up @@ -557,7 +563,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
E0381,
"{used} binding {desc}{isnt_initialized}"
);
use_spans.var_path_only_subdiag(&mut err, desired_action);
use_spans.var_path_only_subdiag(self.dcx(), &mut err, desired_action);

if let InitializationRequiringAction::PartialAssignment
| InitializationRequiringAction::Assignment = desired_action
Expand Down Expand Up @@ -848,9 +854,13 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
&value_msg,
);

borrow_spans.var_path_only_subdiag(&mut err, crate::InitializationRequiringAction::Borrow);
borrow_spans.var_path_only_subdiag(
self.dcx(),
&mut err,
crate::InitializationRequiringAction::Borrow,
);

move_spans.var_subdiag(None, &mut err, None, |kind, var_span| {
move_spans.var_subdiag(self.dcx(), &mut err, None, |kind, var_span| {
use crate::session_diagnostics::CaptureVarCause::*;
match kind {
hir::ClosureKind::Coroutine(_) => MoveUseInCoroutine { var_span },
Expand Down Expand Up @@ -895,7 +905,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
borrow_span,
&self.describe_any_place(borrow.borrowed_place.as_ref()),
);
borrow_spans.var_subdiag(None, &mut err, Some(borrow.kind), |kind, var_span| {
borrow_spans.var_subdiag(self.dcx(), &mut err, Some(borrow.kind), |kind, var_span| {
use crate::session_diagnostics::CaptureVarCause::*;
let place = &borrow.borrowed_place;
let desc_place = self.describe_any_place(place.as_ref());
Expand Down Expand Up @@ -1043,7 +1053,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
"mutably borrow",
);
borrow_spans.var_subdiag(
None,
self.dcx(),
&mut err,
Some(BorrowKind::Mut { kind: MutBorrowKind::ClosureCapture }),
|kind, var_span| {
Expand Down Expand Up @@ -1131,22 +1141,31 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
};

if issued_spans == borrow_spans {
borrow_spans.var_subdiag(None, &mut err, Some(gen_borrow_kind), |kind, var_span| {
use crate::session_diagnostics::CaptureVarCause::*;
match kind {
hir::ClosureKind::Coroutine(_) => BorrowUsePlaceCoroutine {
place: desc_place,
var_span,
is_single_var: false,
},
hir::ClosureKind::Closure | hir::ClosureKind::CoroutineClosure(_) => {
BorrowUsePlaceClosure { place: desc_place, var_span, is_single_var: false }
borrow_spans.var_subdiag(
self.dcx(),
&mut err,
Some(gen_borrow_kind),
|kind, var_span| {
use crate::session_diagnostics::CaptureVarCause::*;
match kind {
hir::ClosureKind::Coroutine(_) => BorrowUsePlaceCoroutine {
place: desc_place,
var_span,
is_single_var: false,
},
hir::ClosureKind::Closure | hir::ClosureKind::CoroutineClosure(_) => {
BorrowUsePlaceClosure {
place: desc_place,
var_span,
is_single_var: false,
}
}
}
}
});
},
);
} else {
issued_spans.var_subdiag(
Some(self.dcx()),
self.dcx(),
&mut err,
Some(issued_borrow.kind),
|kind, var_span| {
Expand All @@ -1165,7 +1184,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
);

borrow_spans.var_subdiag(
Some(self.dcx()),
self.dcx(),
&mut err,
Some(gen_borrow_kind),
|kind, var_span| {
Expand Down Expand Up @@ -2217,7 +2236,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
err.span_label(borrow_span, "borrowed value does not live long enough");
err.span_label(drop_span, format!("`{name}` dropped here while still borrowed"));

borrow_spans.args_subdiag(&mut err, |args_span| {
borrow_spans.args_subdiag(self.dcx(), &mut err, |args_span| {
crate::session_diagnostics::CaptureArgLabel::Capture {
is_within: borrow_spans.for_coroutine(),
args_span,
Expand Down Expand Up @@ -2476,7 +2495,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
None,
);

borrow_spans.args_subdiag(&mut err, |args_span| {
borrow_spans.args_subdiag(self.dcx(), &mut err, |args_span| {
crate::session_diagnostics::CaptureArgLabel::Capture {
is_within: borrow_spans.for_coroutine(),
args_span,
Expand Down Expand Up @@ -2935,7 +2954,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
"assign",
);

loan_spans.var_subdiag(None, &mut err, Some(loan.kind), |kind, var_span| {
loan_spans.var_subdiag(self.dcx(), &mut err, Some(loan.kind), |kind, var_span| {
use crate::session_diagnostics::CaptureVarCause::*;
match kind {
hir::ClosureKind::Coroutine(_) => BorrowUseInCoroutine { var_span },
Expand All @@ -2953,7 +2972,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {

let mut err = self.cannot_assign_to_borrowed(span, loan_span, &descr_place);

loan_spans.var_subdiag(None, &mut err, Some(loan.kind), |kind, var_span| {
loan_spans.var_subdiag(self.dcx(), &mut err, Some(loan.kind), |kind, var_span| {
use crate::session_diagnostics::CaptureVarCause::*;
match kind {
hir::ClosureKind::Coroutine(_) => BorrowUseInCoroutine { var_span },
Expand Down
Loading
Loading