Skip to content

Commit 0e059c2

Browse files
committed
An attempt at rebasing on upstream
1 parent 4680f89 commit 0e059c2

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
lines changed

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
379379
self.body.source.def_id().expect_local(),
380380
type_test_span,
381381
Some(origin),
382-
generic_kind,
382+
self.name_regions(self.infcx.tcx, generic_kind),
383383
lower_bound_region,
384384
));
385385
}

compiler/rustc_borrowck/src/member_constraints.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::hash::Hash;
22
use std::ops::Index;
33

4-
use rustc_data_structures::captures::Captures;
54
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
65
use rustc_index::{IndexSlice, IndexVec};
76
use rustc_middle::ty::{self, Ty};

compiler/rustc_borrowck/src/nll.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ use crate::borrow_set::BorrowSet;
2828
use crate::consumers::ConsumerOptions;
2929
use crate::diagnostics::{BorrowckDiagnosticsBuffer, RegionErrors};
3030
use crate::eliminate_placeholders::rewrite_higher_kinded_outlives_as_constraints;
31+
use crate::polonius::PoloniusDiagnosticsContext;
3132
use crate::polonius::legacy::{
3233
PoloniusFacts, PoloniusFactsExt, PoloniusLocationTable, PoloniusOutput,
3334
};
34-
use crate::polonius::{LocalizedOutlivesConstraintSet, PoloniusDiagnosticsContext};
3535
use crate::region_infer::RegionInferenceContext;
3636
use crate::type_check::{self, MirTypeckRegionConstraints, MirTypeckResults};
3737
use crate::universal_regions::UniversalRegions;

compiler/rustc_borrowck/src/region_infer/mod.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,16 +1786,14 @@ impl<'tcx> RegionInferenceContext<'tcx> {
17861786
// FIXME: the performance of this is Not Great, and the logic
17871787
// should be folded into the search itself if possible.
17881788
for constraint in path.iter() {
1789-
let ConstraintCategory::IllegalPlaceholder(culprit_from, culprit_to) =
1790-
constraint.category
1791-
else {
1789+
let ConstraintCategory::IllegalPlaceholder(cl_fr, culprit) = constraint.category else {
17921790
continue;
17931791
};
17941792

1795-
debug!("{culprit_from:?}: {culprit_to:?} is the reason {from:?}: 'static!");
1793+
debug!("{culprit:?} is the reason {from:?}: 'static!");
17961794
// FIXME: think: this may be for transitive reasons and
17971795
// we may have to do this arbitrarily many times. Or may we?
1798-
return self.find_constraint_path_to(culprit_from, |r| r == culprit_to, false).unwrap();
1796+
return self.find_constraint_path_to(cl_fr, |r| r == culprit, false).unwrap();
17991797
}
18001798

18011799
// No funny business; just return the path!

compiler/rustc_middle/src/mir/query.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ use rustc_index::bit_set::BitMatrix;
1010
use rustc_index::{Idx, IndexVec};
1111
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
1212
use rustc_span::{Span, Symbol};
13-
use rustc_type_ir::RegionVid;
13+
//use rustc_type_ir::RegionVid;
1414
use smallvec::SmallVec;
1515

1616
use super::{ConstValue, SourceInfo};
1717
use crate::ty::fold::fold_regions;
18-
use crate::ty::{self, CoroutineArgsExt, OpaqueHiddenType, Ty, TyCtxt};
18+
use crate::ty::{self, CoroutineArgsExt, OpaqueHiddenType, RegionVid, Ty, TyCtxt};
1919

2020
rustc_index::newtype_index! {
2121
#[derive(HashStable)]
@@ -238,7 +238,14 @@ pub enum ConstraintCategory<'tcx> {
238238
/// An internal constraint derived from an illegal placeholder relation
239239
/// to this region. The arguments are a source -> drain of a path
240240
/// that caused the problem, used when reporting errors.
241-
IllegalPlaceholder(RegionVid, RegionVid),
241+
IllegalPlaceholder(
242+
#[type_foldable(identity)]
243+
#[type_visitable(ignore)]
244+
RegionVid,
245+
#[type_foldable(identity)]
246+
#[type_visitable(ignore)]
247+
RegionVid,
248+
),
242249
}
243250

244251
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]

0 commit comments

Comments
 (0)