diff options
| author | Michael Goulet <michael@errs.io> | 2025-01-06 03:25:45 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2025-01-08 16:02:44 +0000 |
| commit | c55eefe8bc51f302cfc89d375198ca7211d4709b (patch) | |
| tree | 40024a316d1007e00dd46abd862919d604cc563d /compiler/rustc_borrowck/src/diagnostics/mod.rs | |
| parent | 4a099b29cdb6a7841019406f0f2b5035a1fd9a08 (diff) | |
| download | rust-c55eefe8bc51f302cfc89d375198ca7211d4709b.tar.gz rust-c55eefe8bc51f302cfc89d375198ca7211d4709b.zip | |
Try to explain borrow for tail expr temporary drop order change in 2024
Diffstat (limited to 'compiler/rustc_borrowck/src/diagnostics/mod.rs')
| -rw-r--r-- | compiler/rustc_borrowck/src/diagnostics/mod.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/compiler/rustc_borrowck/src/diagnostics/mod.rs b/compiler/rustc_borrowck/src/diagnostics/mod.rs index 0286ea6cd9d..d9d9ea75994 100644 --- a/compiler/rustc_borrowck/src/diagnostics/mod.rs +++ b/compiler/rustc_borrowck/src/diagnostics/mod.rs @@ -4,7 +4,7 @@ use std::collections::BTreeMap; use rustc_abi::{FieldIdx, VariantIdx}; use rustc_data_structures::fx::FxIndexMap; -use rustc_errors::{Applicability, Diag, MultiSpan}; +use rustc_errors::{Applicability, Diag, EmissionGuarantee, MultiSpan}; use rustc_hir::def::{CtorKind, Namespace}; use rustc_hir::{self as hir, CoroutineKind, LangItem}; use rustc_index::IndexSlice; @@ -626,9 +626,9 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { /// Add a note to region errors and borrow explanations when higher-ranked regions in predicates /// implicitly introduce an "outlives `'static`" constraint. - fn add_placeholder_from_predicate_note( + fn add_placeholder_from_predicate_note<G: EmissionGuarantee>( &self, - err: &mut Diag<'_>, + err: &mut Diag<'_, G>, path: &[OutlivesConstraint<'tcx>], ) { let predicate_span = path.iter().find_map(|constraint| { @@ -651,9 +651,9 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { /// Add a label to region errors and borrow explanations when outlives constraints arise from /// proving a type implements `Sized` or `Copy`. - fn add_sized_or_copy_bound_info( + fn add_sized_or_copy_bound_info<G: EmissionGuarantee>( &self, - err: &mut Diag<'_>, + err: &mut Diag<'_, G>, blamed_category: ConstraintCategory<'tcx>, path: &[OutlivesConstraint<'tcx>], ) { @@ -1042,6 +1042,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { kind, }; } + normal_ret } |
