Skip to content

Commit b1f8e6f

Browse files
committed
Auto merge of #48399 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 12 pull requests - Successful merges: #47379, #47833, #48106, #48198, #48314, #48325, #48335, #48352, #48354, #48360, #48382, #48397 - Failed merges:
2 parents 27a046e + 24c17cb commit b1f8e6f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+2626
-232
lines changed

.mailmap

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ Herman J. Radtke III <herman@hermanradtke.com> Herman J. Radtke III <hermanradtk
9595
Ilyong Cho <ilyoan@gmail.com>
9696
Ivan Ivaschenko <defuz.net@gmail.com>
9797
J. J. Weber <jjweber@gmail.com>
98-
Jakub Bukaj <jakub@jakub.cc>
99-
Jakub Bukaj <jakub@jakub.cc> <jakubw@jakubw.net>
100-
Jakub Bukaj <jakub@jakub.cc> Jakub Bukaj <jakub.bukaj@yahoo.com>
98+
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <jakub@jakub.cc>
99+
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <jakubw@jakubw.net>
100+
Jakub Adam Wieczorek <jakub.adam.wieczorek@gmail.com> <jakub.bukaj@yahoo.com>
101101
James Deng <cnjamesdeng@gmail.com> <cnJamesDeng@gmail.com>
102102
James Miller <bladeon@gmail.com> <james@aatch.net>
103103
James Perry <james.austin.perry@gmail.com>

src/Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/libcore/cmp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ impl Ordering {
343343
/// v.sort_by_key(|&num| (num > 3, Reverse(num)));
344344
/// assert_eq!(v, vec![3, 2, 1, 6, 5, 4]);
345345
/// ```
346-
#[derive(PartialEq, Eq, Debug)]
346+
#[derive(PartialEq, Eq, Debug, Copy, Clone)]
347347
#[stable(feature = "reverse_cmp_key", since = "1.19.0")]
348348
pub struct Reverse<T>(#[stable(feature = "reverse_cmp_key", since = "1.19.0")] pub T);
349349

src/libcore/iter/iterator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ pub trait Iterator {
168168
/// This function might panic if the iterator has more than [`usize::MAX`]
169169
/// elements.
170170
///
171-
/// [`usize::MAX`]: ../../std/isize/constant.MAX.html
171+
/// [`usize::MAX`]: ../../std/usize/constant.MAX.html
172172
///
173173
/// # Examples
174174
///

src/libcore/num/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ Basic usage:
12091209
```
12101210
", $Feature, "let x: ", stringify!($SelfT), " = 2; // or any other integer type
12111211
1212-
assert_eq!(x.pow(4), 16);",
1212+
assert_eq!(x.pow(5), 32);",
12131213
$EndFeature, "
12141214
```"),
12151215
#[stable(feature = "rust1", since = "1.0.0")]
@@ -2364,7 +2364,7 @@ assert_eq!(0x10", stringify!($SelfT), ".overflowing_shr(132), (0x1, true));", $E
23642364
Basic usage:
23652365
23662366
```
2367-
", $Feature, "assert_eq!(2", stringify!($SelfT), ".pow(4), 16);", $EndFeature, "
2367+
", $Feature, "assert_eq!(2", stringify!($SelfT), ".pow(5), 32);", $EndFeature, "
23682368
```"),
23692369
#[stable(feature = "rust1", since = "1.0.0")]
23702370
#[inline]

src/librustc/hir/map/definitions.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ impl DefPathTable {
7272
index
7373
}
7474

75+
pub fn next_id(&self, address_space: DefIndexAddressSpace) -> DefIndex {
76+
DefIndex::from_array_index(self.index_to_key[address_space.index()].len(), address_space)
77+
}
78+
7579
#[inline(always)]
7680
pub fn def_key(&self, index: DefIndex) -> DefKey {
7781
self.index_to_key[index.address_space().index()]

src/librustc/infer/mod.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ pub struct InferCtxt<'a, 'gcx: 'a+'tcx, 'tcx: 'a> {
180180
// for each body-id in this map, which will process the
181181
// obligations within. This is expected to be done 'late enough'
182182
// that all type inference variables have been bound and so forth.
183-
region_obligations: RefCell<Vec<(ast::NodeId, RegionObligation<'tcx>)>>,
183+
pub region_obligations: RefCell<Vec<(ast::NodeId, RegionObligation<'tcx>)>>,
184184
}
185185

186186
/// A map returned by `skolemize_late_bound_regions()` indicating the skolemized
@@ -1555,11 +1555,20 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
15551555
InferOk { value, obligations }
15561556
}
15571557

1558-
fn borrow_region_constraints(&self) -> RefMut<'_, RegionConstraintCollector<'tcx>> {
1558+
pub fn borrow_region_constraints(&self) -> RefMut<'_, RegionConstraintCollector<'tcx>> {
15591559
RefMut::map(
15601560
self.region_constraints.borrow_mut(),
15611561
|c| c.as_mut().expect("region constraints already solved"))
15621562
}
1563+
1564+
/// Clears the selection, evaluation, and projection cachesThis is useful when
1565+
/// repeatedly attemping to select an Obligation while changing only
1566+
/// its ParamEnv, since FulfillmentContext doesn't use 'probe'
1567+
pub fn clear_caches(&self) {
1568+
self.selection_cache.clear();
1569+
self.evaluation_cache.clear();
1570+
self.projection_cache.borrow_mut().clear();
1571+
}
15631572
}
15641573

15651574
impl<'a, 'gcx, 'tcx> TypeTrace<'tcx> {

src/librustc/infer/region_constraints/mod.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ pub type VarOrigins = IndexVec<RegionVid, RegionVariableOrigin>;
8282
/// Describes constraints between the region variables and other
8383
/// regions, as well as other conditions that must be verified, or
8484
/// assumptions that can be made.
85-
#[derive(Debug, Default)]
85+
#[derive(Debug, Default, Clone)]
8686
pub struct RegionConstraintData<'tcx> {
8787
/// Constraints of the form `A <= B`, where either `A` or `B` can
8888
/// be a region variable (or neither, as it happens).
@@ -142,7 +142,7 @@ pub enum Constraint<'tcx> {
142142
/// outlive `RS`. Therefore verify that `R <= RS[i]` for some
143143
/// `i`. Inference variables may be involved (but this verification
144144
/// step doesn't influence inference).
145-
#[derive(Debug)]
145+
#[derive(Debug, Clone)]
146146
pub struct Verify<'tcx> {
147147
pub kind: GenericKind<'tcx>,
148148
pub origin: SubregionOrigin<'tcx>,
@@ -159,7 +159,7 @@ pub enum GenericKind<'tcx> {
159159
/// When we introduce a verification step, we wish to test that a
160160
/// particular region (let's call it `'min`) meets some bound.
161161
/// The bound is described the by the following grammar:
162-
#[derive(Debug)]
162+
#[derive(Debug, Clone)]
163163
pub enum VerifyBound<'tcx> {
164164
/// B = exists {R} --> some 'r in {R} must outlive 'min
165165
///
@@ -288,6 +288,10 @@ impl<'tcx> RegionConstraintCollector<'tcx> {
288288
&self.var_origins
289289
}
290290

291+
pub fn region_constraint_data(&self) -> &RegionConstraintData<'tcx> {
292+
&self.data
293+
}
294+
291295
/// Once all the constraints have been gathered, extract out the final data.
292296
///
293297
/// Not legal during a snapshot.

src/librustc/traits/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ use syntax_pos::{Span, DUMMY_SP};
3232
pub use self::coherence::{orphan_check, overlapping_impls, OrphanCheckErr, OverlapResult};
3333
pub use self::fulfill::FulfillmentContext;
3434
pub use self::project::MismatchedProjectionTypes;
35-
pub use self::project::{normalize, normalize_projection_type, Normalized};
36-
pub use self::project::{ProjectionCache, ProjectionCacheSnapshot, Reveal};
35+
pub use self::project::{normalize, normalize_projection_type, poly_project_and_unify_type};
36+
pub use self::project::{ProjectionCache, ProjectionCacheSnapshot, Reveal, Normalized};
3737
pub use self::object_safety::ObjectSafetyViolation;
3838
pub use self::object_safety::MethodViolationCode;
3939
pub use self::on_unimplemented::{OnUnimplementedDirective, OnUnimplementedNote};

src/librustc/traits/project.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1596,6 +1596,10 @@ impl<'tcx> ProjectionCache<'tcx> {
15961596
}
15971597
}
15981598

1599+
pub fn clear(&mut self) {
1600+
self.map.clear();
1601+
}
1602+
15991603
pub fn snapshot(&mut self) -> ProjectionCacheSnapshot {
16001604
ProjectionCacheSnapshot { snapshot: self.map.snapshot() }
16011605
}

0 commit comments

Comments
 (0)