Skip to content

Commit 687a68d

Browse files
committedJun 15, 2024·
Auto merge of rust-lang#126514 - matthiaskrgr:rollup-pnwi8ns, r=matthiaskrgr
Rollup of 9 pull requests Successful merges: - rust-lang#126354 (Use `Variance` glob imported variants everywhere) - rust-lang#126367 (Point out failing never obligation for `DEPENDENCY_ON_UNIT_NEVER_TYPE_FALLBACK`) - rust-lang#126469 (MIR Shl/Shr: the offset can be computed with rem_euclid) - rust-lang#126471 (Use a consistent way to filter out bounds instead of splitting it into three places) - rust-lang#126472 (build `libcxx-version` only when it doesn't exist) - rust-lang#126497 (delegation: Fix hygiene for `self`) - rust-lang#126501 (make bors ignore comments in PR template) - rust-lang#126509 (std: suggest OnceLock over Once) - rust-lang#126512 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 1d1356d + 92ad0b1 commit 687a68d

File tree

67 files changed

+1813
-330
lines changed

Some content is hidden

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

67 files changed

+1813
-330
lines changed
 

‎.github/pull_request_template.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<!-- homu-ignore:start -->
12
<!--
23
If this PR is related to an unstable feature or an otherwise tracked effort,
34
please link to the relevant tracking issue here. If you don't know of a related
@@ -7,4 +8,5 @@ This PR will get automatically assigned to a reviewer. In case you would like
78
a specific user to review your work, you can assign it to them by using
89
910
r​? <reviewer name>
10-
-->
11+
-->
12+
<!-- homu-ignore:end -->

‎compiler/rustc_borrowck/src/type_check/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
328328
if let Some(annotation_index) = constant.user_ty {
329329
if let Err(terr) = self.cx.relate_type_and_user_type(
330330
constant.const_.ty(),
331-
ty::Variance::Invariant,
331+
ty::Invariant,
332332
&UserTypeProjection { base: annotation_index, projs: vec![] },
333333
locations,
334334
ConstraintCategory::Boring,
@@ -451,7 +451,7 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
451451

452452
if let Err(terr) = self.cx.relate_type_and_user_type(
453453
ty,
454-
ty::Variance::Invariant,
454+
ty::Invariant,
455455
user_ty,
456456
Locations::All(*span),
457457
ConstraintCategory::TypeAnnotation,
@@ -1095,7 +1095,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
10951095
) -> Result<(), NoSolution> {
10961096
// Use this order of parameters because the sup type is usually the
10971097
// "expected" type in diagnostics.
1098-
self.relate_types(sup, ty::Variance::Contravariant, sub, locations, category)
1098+
self.relate_types(sup, ty::Contravariant, sub, locations, category)
10991099
}
11001100

11011101
#[instrument(skip(self, category), level = "debug")]
@@ -1106,7 +1106,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
11061106
locations: Locations,
11071107
category: ConstraintCategory<'tcx>,
11081108
) -> Result<(), NoSolution> {
1109-
self.relate_types(expected, ty::Variance::Invariant, found, locations, category)
1109+
self.relate_types(expected, ty::Invariant, found, locations, category)
11101110
}
11111111

11121112
#[instrument(skip(self), level = "debug")]
@@ -1146,7 +1146,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
11461146
trace!(?curr_projected_ty);
11471147

11481148
let ty = curr_projected_ty.ty;
1149-
self.relate_types(ty, v.xform(ty::Variance::Contravariant), a, locations, category)?;
1149+
self.relate_types(ty, v.xform(ty::Contravariant), a, locations, category)?;
11501150

11511151
Ok(())
11521152
}
@@ -1248,7 +1248,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
12481248
if let Some(annotation_index) = self.rvalue_user_ty(rv) {
12491249
if let Err(terr) = self.relate_type_and_user_type(
12501250
rv_ty,
1251-
ty::Variance::Invariant,
1251+
ty::Invariant,
12521252
&UserTypeProjection { base: annotation_index, projs: vec![] },
12531253
location.to_locations(),
12541254
ConstraintCategory::Boring,

0 commit comments

Comments
 (0)