Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 6b12e7e

Browse files
committed
Auto merge of rust-lang#127837 - tgross35:rollup-bq4ffc3, r=tgross35
Rollup of 11 pull requests Successful merges: - rust-lang#125206 (Simplify environment variable examples) - rust-lang#126208 (Migrate `compiler-lookup-paths`, `dump-mono-stats` and `prune-link-args` `run-make` tests to `rmake` or `ui` format) - rust-lang#126271 (Skip fast path for dec2flt when optimize_for_size) - rust-lang#126776 (Clean up more comments near use declarations) - rust-lang#127444 (`impl Send + Sync` and override `count` for the `CStr::bytes` iterator) - rust-lang#127792 (std: Use `read_unaligned` for reads from DWARF) - rust-lang#127807 (Use futex.rs for Windows thread parking) - rust-lang#127810 (Rename `tcx` to `cx` in `rustc_type_ir`) - rust-lang#127816 (Update method name to reflect changes to its internals) - rust-lang#127833 (zkvm: add `#[forbid(unsafe_op_in_unsafe_fn)]` in `stdlib`) - rust-lang#127836 (std: Forbid unwrapped unsafe ops in xous and uefi modules) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 7d356eb + e6dcab8 commit 6b12e7e

File tree

79 files changed

+516
-376
lines changed

Some content is hidden

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

79 files changed

+516
-376
lines changed

Cargo.lock

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,6 @@ dependencies = [
228228
"backtrace",
229229
]
230230

231-
[[package]]
232-
name = "ar"
233-
version = "0.9.0"
234-
source = "registry+https://github.com/rust-lang/crates.io-index"
235-
checksum = "d67af77d68a931ecd5cbd8a3b5987d63a1d1d1278f7f6a60ae33db485cdebb69"
236-
237231
[[package]]
238232
name = "ar_archive_writer"
239233
version = "0.3.0"
@@ -3451,7 +3445,6 @@ dependencies = [
34513445
name = "run_make_support"
34523446
version = "0.2.0"
34533447
dependencies = [
3454-
"ar",
34553448
"bstr",
34563449
"build_helper",
34573450
"gimli 0.31.0",

compiler/rustc_borrowck/src/type_check/relate_tys.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ impl<'me, 'bccx, 'tcx> NllTypeRelating<'me, 'bccx, 'tcx> {
309309
}
310310

311311
impl<'bccx, 'tcx> TypeRelation<TyCtxt<'tcx>> for NllTypeRelating<'_, 'bccx, 'tcx> {
312-
fn tcx(&self) -> TyCtxt<'tcx> {
312+
fn cx(&self) -> TyCtxt<'tcx> {
313313
self.type_checker.infcx.tcx
314314
}
315315

@@ -370,7 +370,7 @@ impl<'bccx, 'tcx> TypeRelation<TyCtxt<'tcx>> for NllTypeRelating<'_, 'bccx, 'tcx
370370
// shouldn't ever fail. Instead, it unconditionally emits an
371371
// alias-relate goal.
372372
assert!(!self.type_checker.infcx.next_trait_solver());
373-
self.tcx().dcx().span_delayed_bug(
373+
self.cx().dcx().span_delayed_bug(
374374
self.span(),
375375
"failure to relate an opaque to itself should result in an error later on",
376376
);
@@ -540,7 +540,7 @@ impl<'bccx, 'tcx> PredicateEmittingRelation<InferCtxt<'tcx>> for NllTypeRelating
540540
&mut self,
541541
obligations: impl IntoIterator<Item: ty::Upcast<TyCtxt<'tcx>, ty::Predicate<'tcx>>>,
542542
) {
543-
let tcx = self.tcx();
543+
let tcx = self.cx();
544544
let param_env = self.param_env();
545545
self.register_goals(
546546
obligations.into_iter().map(|to_pred| Goal::new(tcx, param_env, to_pred)),
@@ -559,7 +559,7 @@ impl<'bccx, 'tcx> PredicateEmittingRelation<InferCtxt<'tcx>> for NllTypeRelating
559559
.into_iter()
560560
.map(|goal| {
561561
Obligation::new(
562-
self.tcx(),
562+
self.cx(),
563563
ObligationCause::dummy_with_span(self.span()),
564564
goal.param_env,
565565
goal.predicate,

compiler/rustc_const_eval/src/interpret/validity.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ use super::{
3434
Pointer, Projectable, Scalar, ValueVisitor,
3535
};
3636

37-
// for the validation errors
3837
use super::InterpError::UndefinedBehavior as Ub;
3938
use super::InterpError::Unsupported as Unsup;
4039
use super::UndefinedBehaviorInfo::*;

compiler/rustc_infer/src/error_reporting/infer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1930,7 +1930,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
19301930
struct SameTypeModuloInfer<'a, 'tcx>(&'a InferCtxt<'tcx>);
19311931

19321932
impl<'tcx> TypeRelation<TyCtxt<'tcx>> for SameTypeModuloInfer<'_, 'tcx> {
1933-
fn tcx(&self) -> TyCtxt<'tcx> {
1933+
fn cx(&self) -> TyCtxt<'tcx> {
19341934
self.0.tcx
19351935
}
19361936

compiler/rustc_infer/src/infer/outlives/test_type_match.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for MatchAgainstHigherRankedOutlives<'tcx>
137137
"MatchAgainstHigherRankedOutlives"
138138
}
139139

140-
fn tcx(&self) -> TyCtxt<'tcx> {
140+
fn cx(&self) -> TyCtxt<'tcx> {
141141
self.tcx
142142
}
143143

compiler/rustc_infer/src/infer/relate/generalize.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ impl<'tcx> Generalizer<'_, 'tcx> {
372372

373373
let is_nested_alias = mem::replace(&mut self.in_alias, true);
374374
let result = match self.relate(alias, alias) {
375-
Ok(alias) => Ok(alias.to_ty(self.tcx())),
375+
Ok(alias) => Ok(alias.to_ty(self.cx())),
376376
Err(e) => {
377377
if is_nested_alias {
378378
return Err(e);
@@ -397,7 +397,7 @@ impl<'tcx> Generalizer<'_, 'tcx> {
397397
}
398398

399399
impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Generalizer<'_, 'tcx> {
400-
fn tcx(&self) -> TyCtxt<'tcx> {
400+
fn cx(&self) -> TyCtxt<'tcx> {
401401
self.infcx.tcx
402402
}
403403

@@ -417,7 +417,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Generalizer<'_, 'tcx> {
417417
// (e.g., #41849).
418418
relate::relate_args_invariantly(self, a_arg, b_arg)
419419
} else {
420-
let tcx = self.tcx();
420+
let tcx = self.cx();
421421
let opt_variances = tcx.variances_of(item_def_id);
422422
relate::relate_args_with_variances(
423423
self,
@@ -525,7 +525,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Generalizer<'_, 'tcx> {
525525
}
526526

527527
debug!("replacing original vid={:?} with new={:?}", vid, new_var_id);
528-
Ok(Ty::new_var(self.tcx(), new_var_id))
528+
Ok(Ty::new_var(self.cx(), new_var_id))
529529
}
530530
}
531531
}
@@ -654,7 +654,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Generalizer<'_, 'tcx> {
654654
{
655655
variable_table.union(vid, new_var_id);
656656
}
657-
Ok(ty::Const::new_var(self.tcx(), new_var_id))
657+
Ok(ty::Const::new_var(self.cx(), new_var_id))
658658
}
659659
}
660660
}
@@ -672,7 +672,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Generalizer<'_, 'tcx> {
672672
args,
673673
args,
674674
)?;
675-
Ok(ty::Const::new_unevaluated(self.tcx(), ty::UnevaluatedConst { def, args }))
675+
Ok(ty::Const::new_unevaluated(self.cx(), ty::UnevaluatedConst { def, args }))
676676
}
677677
ty::ConstKind::Placeholder(placeholder) => {
678678
if self.for_universe.can_name(placeholder.universe) {

compiler/rustc_infer/src/infer/relate/glb.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Glb<'_, '_, 'tcx> {
2727
"Glb"
2828
}
2929

30-
fn tcx(&self) -> TyCtxt<'tcx> {
30+
fn cx(&self) -> TyCtxt<'tcx> {
3131
self.fields.tcx()
3232
}
3333

@@ -61,7 +61,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Glb<'_, '_, 'tcx> {
6161
let origin = SubregionOrigin::Subtype(Box::new(self.fields.trace.clone()));
6262
// GLB(&'static u8, &'a u8) == &RegionLUB('static, 'a) u8 == &'static u8
6363
Ok(self.fields.infcx.inner.borrow_mut().unwrap_region_constraints().lub_regions(
64-
self.tcx(),
64+
self.cx(),
6565
origin,
6666
a,
6767
b,

compiler/rustc_infer/src/infer/relate/lub.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Lub<'_, '_, 'tcx> {
2727
"Lub"
2828
}
2929

30-
fn tcx(&self) -> TyCtxt<'tcx> {
30+
fn cx(&self) -> TyCtxt<'tcx> {
3131
self.fields.tcx()
3232
}
3333

@@ -61,7 +61,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for Lub<'_, '_, 'tcx> {
6161
let origin = SubregionOrigin::Subtype(Box::new(self.fields.trace.clone()));
6262
// LUB(&'static u8, &'a u8) == &RegionGLB('static, 'a) u8 == &'a u8
6363
Ok(self.fields.infcx.inner.borrow_mut().unwrap_region_constraints().glb_regions(
64-
self.tcx(),
64+
self.cx(),
6565
origin,
6666
a,
6767
b,

compiler/rustc_infer/src/infer/relate/type_relating.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for TypeRelating<'_, '_, 'tcx> {
3232
"TypeRelating"
3333
}
3434

35-
fn tcx(&self) -> TyCtxt<'tcx> {
35+
fn cx(&self) -> TyCtxt<'tcx> {
3636
self.fields.infcx.tcx
3737
}
3838

@@ -48,7 +48,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for TypeRelating<'_, '_, 'tcx> {
4848
// (e.g., #41849).
4949
relate_args_invariantly(self, a_arg, b_arg)
5050
} else {
51-
let tcx = self.tcx();
51+
let tcx = self.cx();
5252
let opt_variances = tcx.variances_of(item_def_id);
5353
relate_args_with_variances(self, item_def_id, opt_variances, a_arg, b_arg, false)
5454
}
@@ -88,7 +88,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for TypeRelating<'_, '_, 'tcx> {
8888
// can't make progress on `A <: B` if both A and B are
8989
// type variables, so record an obligation.
9090
self.fields.goals.push(Goal::new(
91-
self.tcx(),
91+
self.cx(),
9292
self.fields.param_env,
9393
ty::Binder::dummy(ty::PredicateKind::Subtype(ty::SubtypePredicate {
9494
a_is_expected: true,
@@ -101,7 +101,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for TypeRelating<'_, '_, 'tcx> {
101101
// can't make progress on `B <: A` if both A and B are
102102
// type variables, so record an obligation.
103103
self.fields.goals.push(Goal::new(
104-
self.tcx(),
104+
self.cx(),
105105
self.fields.param_env,
106106
ty::Binder::dummy(ty::PredicateKind::Subtype(ty::SubtypePredicate {
107107
a_is_expected: false,
@@ -134,7 +134,7 @@ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for TypeRelating<'_, '_, 'tcx> {
134134

135135
(&ty::Error(e), _) | (_, &ty::Error(e)) => {
136136
infcx.set_tainted_by_errors(e);
137-
return Ok(Ty::new_error(self.tcx(), e));
137+
return Ok(Ty::new_error(self.cx(), e));
138138
}
139139

140140
(

compiler/rustc_lint/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ use types::*;
120120
use unit_bindings::*;
121121
use unused::*;
122122

123-
/// Useful for other parts of the compiler / Clippy.
124123
pub use builtin::{MissingDoc, SoftLints};
125124
pub use context::{CheckLintNameResult, FindLintError, LintStore};
126125
pub use context::{EarlyContext, LateContext, LintContext};

0 commit comments

Comments
 (0)