Skip to content

Commit 3cf924b

Browse files
committed
Auto merge of #126528 - GuillaumeGomez:rollup-6zjs70e, r=GuillaumeGomez
Rollup of 9 pull requests Successful merges: - #126229 (Bump windows-bindgen to 0.57) - #126404 (Check that alias-relate terms are WF if reporting an error in alias-relate) - #126410 (smir: merge identical Constant and ConstOperand types) - #126478 (Migrate `run-make/codegen-options-parsing` to `rmake.rs`) - #126496 (Make proof tree probing and `Candidate`/`CandidateSource` generic over interner) - #126508 (Make uninitialized_error_reported a set of locals) - #126517 (Migrate `run-make/dep-graph` to `rmake.rs`) - #126525 (trait_selection: remove extra words) - #126526 (tests/ui/lint: Move 19 tests to new `non-snake-case` subdir) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 92af831 + f788ea4 commit 3cf924b

File tree

78 files changed

+424
-850
lines changed

Some content is hidden

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

78 files changed

+424
-850
lines changed

Cargo.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -6385,9 +6385,9 @@ dependencies = [
63856385

63866386
[[package]]
63876387
name = "windows-bindgen"
6388-
version = "0.56.0"
6388+
version = "0.57.0"
63896389
source = "registry+https://github.com/rust-lang/crates.io-index"
6390-
checksum = "a28e3ea6330cf17fdcdce8bf08d0549ce93769dca9bedc6c39c36c8c0e17db46"
6390+
checksum = "1ccb96113d6277ba543c0f77e1c5494af8094bf9daf9b85acdc3f1b620e7c7b4"
63916391
dependencies = [
63926392
"proc-macro2",
63936393
"rayon",
@@ -6408,9 +6408,9 @@ dependencies = [
64086408

64096409
[[package]]
64106410
name = "windows-metadata"
6411-
version = "0.56.0"
6411+
version = "0.57.0"
64126412
source = "registry+https://github.com/rust-lang/crates.io-index"
6413-
checksum = "3993f7827fff10c454e3a24847075598c7c08108304b8b07943c2c73d78f3b34"
6413+
checksum = "8308d076825b9d9e5abc64f8113e96d02b2aeeba869b20fdd65c7e70cda13dfc"
64146414

64156415
[[package]]
64166416
name = "windows-sys"

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
100100
move_site_vec.iter().map(|move_site| move_site.moi).collect();
101101

102102
if move_out_indices.is_empty() {
103-
let root_place = PlaceRef { projection: &[], ..used_place };
103+
let root_local = used_place.local;
104104

105-
if !self.uninitialized_error_reported.insert(root_place) {
105+
if !self.uninitialized_error_reported.insert(root_local) {
106106
debug!(
107107
"report_use_of_moved_or_uninitialized place: error about {:?} suppressed",
108-
root_place
108+
root_local
109109
);
110110
return;
111111
}

compiler/rustc_borrowck/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,7 @@ struct MirBorrowckCtxt<'cx, 'tcx> {
566566
fn_self_span_reported: FxIndexSet<Span>,
567567
/// This field keeps track of errors reported in the checking of uninitialized variables,
568568
/// so that we don't report seemingly duplicate errors.
569-
uninitialized_error_reported: FxIndexSet<PlaceRef<'tcx>>,
569+
uninitialized_error_reported: FxIndexSet<Local>,
570570
/// This field keeps track of all the local variables that are declared mut and are mutated.
571571
/// Used for the warning issued by an unused mutable local variable.
572572
used_mut: FxIndexSet<Local>,

compiler/rustc_borrowck/src/renumber.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ impl<'a, 'tcx> MutVisitor<'tcx> for RegionRenumberer<'a, 'tcx> {
113113
}
114114

115115
#[instrument(skip(self), level = "debug")]
116-
fn visit_constant(&mut self, constant: &mut ConstOperand<'tcx>, location: Location) {
116+
fn visit_const_operand(&mut self, constant: &mut ConstOperand<'tcx>, location: Location) {
117117
let const_ = constant.const_;
118118
constant.const_ = self.renumber_regions(const_, || RegionCtxt::Location(location));
119119
debug!("constant: {:#?}", constant);

compiler/rustc_borrowck/src/type_check/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,10 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
301301
self.sanitize_place(place, location, context);
302302
}
303303

304-
fn visit_constant(&mut self, constant: &ConstOperand<'tcx>, location: Location) {
305-
debug!(?constant, ?location, "visit_constant");
304+
fn visit_const_operand(&mut self, constant: &ConstOperand<'tcx>, location: Location) {
305+
debug!(?constant, ?location, "visit_const_operand");
306306

307-
self.super_constant(constant, location);
307+
self.super_const_operand(constant, location);
308308
let ty = self.sanitize_type(constant, constant.const_.ty());
309309

310310
self.cx.infcx.tcx.for_each_free_region(&ty, |live_region| {

compiler/rustc_infer/src/infer/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -471,6 +471,10 @@ impl<'tcx> ty::InferCtxtLike for InferCtxt<'tcx> {
471471
{
472472
self.resolve_vars_if_possible(value)
473473
}
474+
475+
fn probe<T>(&self, probe: impl FnOnce() -> T) -> T {
476+
self.probe(|_| probe())
477+
}
474478
}
475479

476480
/// See the `error_reporting` module for more details.

compiler/rustc_middle/src/mir/pretty.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,7 @@ fn use_verbose(ty: Ty<'_>, fn_def: bool) -> bool {
12871287
}
12881288

12891289
impl<'tcx> Visitor<'tcx> for ExtraComments<'tcx> {
1290-
fn visit_constant(&mut self, constant: &ConstOperand<'tcx>, _location: Location) {
1290+
fn visit_const_operand(&mut self, constant: &ConstOperand<'tcx>, _location: Location) {
12911291
let ConstOperand { span, user_ty, const_ } = constant;
12921292
if use_verbose(const_.ty(), true) {
12931293
self.push("mir::ConstOperand");
@@ -1415,7 +1415,7 @@ pub fn write_allocations<'tcx>(
14151415
struct CollectAllocIds(BTreeSet<AllocId>);
14161416

14171417
impl<'tcx> Visitor<'tcx> for CollectAllocIds {
1418-
fn visit_constant(&mut self, c: &ConstOperand<'tcx>, _: Location) {
1418+
fn visit_const_operand(&mut self, c: &ConstOperand<'tcx>, _: Location) {
14191419
match c.const_ {
14201420
Const::Ty(_, _) | Const::Unevaluated(..) => {}
14211421
Const::Val(val, _) => {

compiler/rustc_middle/src/mir/visit.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -184,12 +184,12 @@ macro_rules! make_mir_visitor {
184184

185185
/// This is called for every constant in the MIR body and every `required_consts`
186186
/// (i.e., including consts that have been dead-code-eliminated).
187-
fn visit_constant(
187+
fn visit_const_operand(
188188
&mut self,
189189
constant: & $($mutability)? ConstOperand<'tcx>,
190190
location: Location,
191191
) {
192-
self.super_constant(constant, location);
192+
self.super_const_operand(constant, location);
193193
}
194194

195195
fn visit_ty_const(
@@ -597,7 +597,7 @@ macro_rules! make_mir_visitor {
597597
}
598598
InlineAsmOperand::Const { value }
599599
| InlineAsmOperand::SymFn { value } => {
600-
self.visit_constant(value, location);
600+
self.visit_const_operand(value, location);
601601
}
602602
InlineAsmOperand::Out { place: None, .. }
603603
| InlineAsmOperand::SymStatic { def_id: _ }
@@ -788,7 +788,7 @@ macro_rules! make_mir_visitor {
788788
);
789789
}
790790
Operand::Constant(constant) => {
791-
self.visit_constant(constant, location);
791+
self.visit_const_operand(constant, location);
792792
}
793793
}
794794
}
@@ -867,7 +867,7 @@ macro_rules! make_mir_visitor {
867867
}
868868
}
869869
match value {
870-
VarDebugInfoContents::Const(c) => self.visit_constant(c, location),
870+
VarDebugInfoContents::Const(c) => self.visit_const_operand(c, location),
871871
VarDebugInfoContents::Place(place) =>
872872
self.visit_place(
873873
place,
@@ -882,7 +882,7 @@ macro_rules! make_mir_visitor {
882882
_scope: $(& $mutability)? SourceScope
883883
) {}
884884

885-
fn super_constant(
885+
fn super_const_operand(
886886
&mut self,
887887
constant: & $($mutability)? ConstOperand<'tcx>,
888888
location: Location
@@ -1057,7 +1057,7 @@ macro_rules! super_body {
10571057

10581058
for const_ in &$($mutability)? $body.required_consts {
10591059
let location = Location::START;
1060-
$self.visit_constant(const_, location);
1060+
$self.visit_const_operand(const_, location);
10611061
}
10621062
}
10631063
}

compiler/rustc_mir_transform/src/known_panics_lint.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -706,9 +706,9 @@ impl<'tcx> Visitor<'tcx> for ConstPropagator<'_, 'tcx> {
706706
self.super_operand(operand, location);
707707
}
708708

709-
fn visit_constant(&mut self, constant: &ConstOperand<'tcx>, location: Location) {
710-
trace!("visit_constant: {:?}", constant);
711-
self.super_constant(constant, location);
709+
fn visit_const_operand(&mut self, constant: &ConstOperand<'tcx>, location: Location) {
710+
trace!("visit_const_operand: {:?}", constant);
711+
self.super_const_operand(constant, location);
712712
self.eval_constant(constant);
713713
}
714714

compiler/rustc_mir_transform/src/promote_consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -956,7 +956,7 @@ impl<'a, 'tcx> MutVisitor<'tcx> for Promoter<'a, 'tcx> {
956956
}
957957
}
958958

959-
fn visit_constant(&mut self, constant: &mut ConstOperand<'tcx>, _location: Location) {
959+
fn visit_const_operand(&mut self, constant: &mut ConstOperand<'tcx>, _location: Location) {
960960
if constant.const_.is_required_const() {
961961
self.promoted.required_consts.push(*constant);
962962
}

compiler/rustc_mir_transform/src/required_consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ impl<'a, 'tcx> RequiredConstsVisitor<'a, 'tcx> {
1212
}
1313

1414
impl<'tcx> Visitor<'tcx> for RequiredConstsVisitor<'_, 'tcx> {
15-
fn visit_constant(&mut self, constant: &ConstOperand<'tcx>, _: Location) {
15+
fn visit_const_operand(&mut self, constant: &ConstOperand<'tcx>, _: Location) {
1616
if constant.const_.is_required_const() {
1717
self.required_consts.push(*constant);
1818
}

compiler/rustc_mir_transform/src/reveal_all.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ impl<'tcx> MutVisitor<'tcx> for RevealAllVisitor<'tcx> {
4949
}
5050

5151
#[inline]
52-
fn visit_constant(&mut self, constant: &mut ConstOperand<'tcx>, location: Location) {
52+
fn visit_const_operand(&mut self, constant: &mut ConstOperand<'tcx>, location: Location) {
5353
// We have to use `try_normalize_erasing_regions` here, since it's
5454
// possible that we visit impossible-to-satisfy where clauses here,
5555
// see #91745
5656
if let Ok(c) = self.tcx.try_normalize_erasing_regions(self.param_env, constant.const_) {
5757
constant.const_ = c;
5858
}
59-
self.super_constant(constant, location);
59+
self.super_const_operand(constant, location);
6060
}
6161

6262
#[inline]

compiler/rustc_monomorphize/src/collector.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirUsedCollector<'a, 'tcx> {
799799
/// This does not walk the MIR of the constant as that is not needed for codegen, all we need is
800800
/// to ensure that the constant evaluates successfully and walk the result.
801801
#[instrument(skip(self), level = "debug")]
802-
fn visit_constant(&mut self, constant: &mir::ConstOperand<'tcx>, location: Location) {
802+
fn visit_const_operand(&mut self, constant: &mir::ConstOperand<'tcx>, location: Location) {
803803
// No `super_constant` as we don't care about `visit_ty`/`visit_ty_const`.
804804
let Some(val) = self.eval_constant(constant) else { return };
805805
collect_const_value(self.tcx, val, self.used_items);

compiler/rustc_monomorphize/src/polymorphize.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkUsedGenericParams<'a, 'tcx> {
261261
self.super_local_decl(local, local_decl);
262262
}
263263

264-
fn visit_constant(&mut self, ct: &mir::ConstOperand<'tcx>, location: Location) {
264+
fn visit_const_operand(&mut self, ct: &mir::ConstOperand<'tcx>, location: Location) {
265265
match ct.const_ {
266266
mir::Const::Ty(_, c) => {
267267
c.visit_with(self);

compiler/rustc_smir/src/rustc_smir/builder.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ impl<'tcx> BodyBuilder<'tcx> {
5252
}
5353

5454
impl<'tcx> MutVisitor<'tcx> for BodyBuilder<'tcx> {
55-
fn visit_constant(&mut self, constant: &mut mir::ConstOperand<'tcx>, location: mir::Location) {
55+
fn visit_const_operand(
56+
&mut self,
57+
constant: &mut mir::ConstOperand<'tcx>,
58+
location: mir::Location,
59+
) {
5660
let const_ = constant.const_;
5761
let val = match const_.eval(self.tcx, ty::ParamEnv::reveal_all(), constant.span) {
5862
Ok(v) => v,
@@ -63,7 +67,7 @@ impl<'tcx> MutVisitor<'tcx> for BodyBuilder<'tcx> {
6367
};
6468
let ty = constant.ty();
6569
constant.const_ = mir::Const::Val(val, ty);
66-
self.super_constant(constant, location);
70+
self.super_const_operand(constant, location);
6771
}
6872

6973
fn tcx(&self) -> TyCtxt<'tcx> {

compiler/rustc_smir/src/rustc_smir/convert/mir.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -328,13 +328,13 @@ impl<'tcx> Stable<'tcx> for mir::Operand<'tcx> {
328328
}
329329

330330
impl<'tcx> Stable<'tcx> for mir::ConstOperand<'tcx> {
331-
type T = stable_mir::mir::Constant;
331+
type T = stable_mir::mir::ConstOperand;
332332

333333
fn stable(&self, tables: &mut Tables<'_>) -> Self::T {
334-
stable_mir::mir::Constant {
334+
stable_mir::mir::ConstOperand {
335335
span: self.span.stable(tables),
336336
user_ty: self.user_ty.map(|u| u.as_usize()).or(None),
337-
literal: self.const_.stable(tables),
337+
const_: self.const_.stable(tables),
338338
}
339339
}
340340
}

0 commit comments

Comments
 (0)