Skip to content

Commit

Permalink
Auto merge of rust-lang#126528 - GuillaumeGomez:rollup-6zjs70e, r=Gui…
Browse files Browse the repository at this point in the history
…llaumeGomez

Rollup of 9 pull requests

Successful merges:

 - rust-lang#126229 (Bump windows-bindgen to 0.57)
 - rust-lang#126404 (Check that alias-relate terms are WF if reporting an error in alias-relate)
 - rust-lang#126410 (smir: merge identical Constant and ConstOperand types)
 - rust-lang#126478 (Migrate `run-make/codegen-options-parsing` to `rmake.rs`)
 - rust-lang#126496 (Make proof tree probing and `Candidate`/`CandidateSource` generic over interner)
 - rust-lang#126508 (Make uninitialized_error_reported a set of locals)
 - rust-lang#126517 (Migrate `run-make/dep-graph` to `rmake.rs`)
 - rust-lang#126525 (trait_selection: remove extra words)
 - rust-lang#126526 (tests/ui/lint: Move 19 tests to new `non-snake-case` subdir)

r? `@ghost`
`@rustbot` modify labels: rollup
  • Loading branch information
bors committed Jun 15, 2024
2 parents 92af831 + f788ea4 commit 3cf924b
Show file tree
Hide file tree
Showing 78 changed files with 424 additions and 850 deletions.
8 changes: 4 additions & 4 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6385,9 +6385,9 @@ dependencies = [

[[package]]
name = "windows-bindgen"
version = "0.56.0"
version = "0.57.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a28e3ea6330cf17fdcdce8bf08d0549ce93769dca9bedc6c39c36c8c0e17db46"
checksum = "1ccb96113d6277ba543c0f77e1c5494af8094bf9daf9b85acdc3f1b620e7c7b4"
dependencies = [
"proc-macro2",
"rayon",
Expand All @@ -6408,9 +6408,9 @@ dependencies = [

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

[[package]]
name = "windows-sys"
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,12 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
move_site_vec.iter().map(|move_site| move_site.moi).collect();

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

if !self.uninitialized_error_reported.insert(root_place) {
if !self.uninitialized_error_reported.insert(root_local) {
debug!(
"report_use_of_moved_or_uninitialized place: error about {:?} suppressed",
root_place
root_local
);
return;
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ struct MirBorrowckCtxt<'cx, 'tcx> {
fn_self_span_reported: FxIndexSet<Span>,
/// This field keeps track of errors reported in the checking of uninitialized variables,
/// so that we don't report seemingly duplicate errors.
uninitialized_error_reported: FxIndexSet<PlaceRef<'tcx>>,
uninitialized_error_reported: FxIndexSet<Local>,
/// This field keeps track of all the local variables that are declared mut and are mutated.
/// Used for the warning issued by an unused mutable local variable.
used_mut: FxIndexSet<Local>,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_borrowck/src/renumber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl<'a, 'tcx> MutVisitor<'tcx> for RegionRenumberer<'a, 'tcx> {
}

#[instrument(skip(self), level = "debug")]
fn visit_constant(&mut self, constant: &mut ConstOperand<'tcx>, location: Location) {
fn visit_const_operand(&mut self, constant: &mut ConstOperand<'tcx>, location: Location) {
let const_ = constant.const_;
constant.const_ = self.renumber_regions(const_, || RegionCtxt::Location(location));
debug!("constant: {:#?}", constant);
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_borrowck/src/type_check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,10 +301,10 @@ impl<'a, 'b, 'tcx> Visitor<'tcx> for TypeVerifier<'a, 'b, 'tcx> {
self.sanitize_place(place, location, context);
}

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

self.super_constant(constant, location);
self.super_const_operand(constant, location);
let ty = self.sanitize_type(constant, constant.const_.ty());

self.cx.infcx.tcx.for_each_free_region(&ty, |live_region| {
Expand Down
4 changes: 4 additions & 0 deletions compiler/rustc_infer/src/infer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,10 @@ impl<'tcx> ty::InferCtxtLike for InferCtxt<'tcx> {
{
self.resolve_vars_if_possible(value)
}

fn probe<T>(&self, probe: impl FnOnce() -> T) -> T {
self.probe(|_| probe())
}
}

/// See the `error_reporting` module for more details.
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_middle/src/mir/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1287,7 +1287,7 @@ fn use_verbose(ty: Ty<'_>, fn_def: bool) -> bool {
}

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

impl<'tcx> Visitor<'tcx> for CollectAllocIds {
fn visit_constant(&mut self, c: &ConstOperand<'tcx>, _: Location) {
fn visit_const_operand(&mut self, c: &ConstOperand<'tcx>, _: Location) {
match c.const_ {
Const::Ty(_, _) | Const::Unevaluated(..) => {}
Const::Val(val, _) => {
Expand Down
14 changes: 7 additions & 7 deletions compiler/rustc_middle/src/mir/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,12 @@ macro_rules! make_mir_visitor {

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

fn visit_ty_const(
Expand Down Expand Up @@ -597,7 +597,7 @@ macro_rules! make_mir_visitor {
}
InlineAsmOperand::Const { value }
| InlineAsmOperand::SymFn { value } => {
self.visit_constant(value, location);
self.visit_const_operand(value, location);
}
InlineAsmOperand::Out { place: None, .. }
| InlineAsmOperand::SymStatic { def_id: _ }
Expand Down Expand Up @@ -788,7 +788,7 @@ macro_rules! make_mir_visitor {
);
}
Operand::Constant(constant) => {
self.visit_constant(constant, location);
self.visit_const_operand(constant, location);
}
}
}
Expand Down Expand Up @@ -867,7 +867,7 @@ macro_rules! make_mir_visitor {
}
}
match value {
VarDebugInfoContents::Const(c) => self.visit_constant(c, location),
VarDebugInfoContents::Const(c) => self.visit_const_operand(c, location),
VarDebugInfoContents::Place(place) =>
self.visit_place(
place,
Expand All @@ -882,7 +882,7 @@ macro_rules! make_mir_visitor {
_scope: $(& $mutability)? SourceScope
) {}

fn super_constant(
fn super_const_operand(
&mut self,
constant: & $($mutability)? ConstOperand<'tcx>,
location: Location
Expand Down Expand Up @@ -1057,7 +1057,7 @@ macro_rules! super_body {

for const_ in &$($mutability)? $body.required_consts {
let location = Location::START;
$self.visit_constant(const_, location);
$self.visit_const_operand(const_, location);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_mir_transform/src/known_panics_lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -706,9 +706,9 @@ impl<'tcx> Visitor<'tcx> for ConstPropagator<'_, 'tcx> {
self.super_operand(operand, location);
}

fn visit_constant(&mut self, constant: &ConstOperand<'tcx>, location: Location) {
trace!("visit_constant: {:?}", constant);
self.super_constant(constant, location);
fn visit_const_operand(&mut self, constant: &ConstOperand<'tcx>, location: Location) {
trace!("visit_const_operand: {:?}", constant);
self.super_const_operand(constant, location);
self.eval_constant(constant);
}

Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/promote_consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ impl<'a, 'tcx> MutVisitor<'tcx> for Promoter<'a, 'tcx> {
}
}

fn visit_constant(&mut self, constant: &mut ConstOperand<'tcx>, _location: Location) {
fn visit_const_operand(&mut self, constant: &mut ConstOperand<'tcx>, _location: Location) {
if constant.const_.is_required_const() {
self.promoted.required_consts.push(*constant);
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_mir_transform/src/required_consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ impl<'a, 'tcx> RequiredConstsVisitor<'a, 'tcx> {
}

impl<'tcx> Visitor<'tcx> for RequiredConstsVisitor<'_, 'tcx> {
fn visit_constant(&mut self, constant: &ConstOperand<'tcx>, _: Location) {
fn visit_const_operand(&mut self, constant: &ConstOperand<'tcx>, _: Location) {
if constant.const_.is_required_const() {
self.required_consts.push(*constant);
}
Expand Down
4 changes: 2 additions & 2 deletions compiler/rustc_mir_transform/src/reveal_all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ impl<'tcx> MutVisitor<'tcx> for RevealAllVisitor<'tcx> {
}

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

#[inline]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_monomorphize/src/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirUsedCollector<'a, 'tcx> {
/// This does not walk the MIR of the constant as that is not needed for codegen, all we need is
/// to ensure that the constant evaluates successfully and walk the result.
#[instrument(skip(self), level = "debug")]
fn visit_constant(&mut self, constant: &mir::ConstOperand<'tcx>, location: Location) {
fn visit_const_operand(&mut self, constant: &mir::ConstOperand<'tcx>, location: Location) {
// No `super_constant` as we don't care about `visit_ty`/`visit_ty_const`.
let Some(val) = self.eval_constant(constant) else { return };
collect_const_value(self.tcx, val, self.used_items);
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_monomorphize/src/polymorphize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ impl<'a, 'tcx> Visitor<'tcx> for MarkUsedGenericParams<'a, 'tcx> {
self.super_local_decl(local, local_decl);
}

fn visit_constant(&mut self, ct: &mir::ConstOperand<'tcx>, location: Location) {
fn visit_const_operand(&mut self, ct: &mir::ConstOperand<'tcx>, location: Location) {
match ct.const_ {
mir::Const::Ty(_, c) => {
c.visit_with(self);
Expand Down
8 changes: 6 additions & 2 deletions compiler/rustc_smir/src/rustc_smir/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,11 @@ impl<'tcx> BodyBuilder<'tcx> {
}

impl<'tcx> MutVisitor<'tcx> for BodyBuilder<'tcx> {
fn visit_constant(&mut self, constant: &mut mir::ConstOperand<'tcx>, location: mir::Location) {
fn visit_const_operand(
&mut self,
constant: &mut mir::ConstOperand<'tcx>,
location: mir::Location,
) {
let const_ = constant.const_;
let val = match const_.eval(self.tcx, ty::ParamEnv::reveal_all(), constant.span) {
Ok(v) => v,
Expand All @@ -63,7 +67,7 @@ impl<'tcx> MutVisitor<'tcx> for BodyBuilder<'tcx> {
};
let ty = constant.ty();
constant.const_ = mir::Const::Val(val, ty);
self.super_constant(constant, location);
self.super_const_operand(constant, location);
}

fn tcx(&self) -> TyCtxt<'tcx> {
Expand Down
6 changes: 3 additions & 3 deletions compiler/rustc_smir/src/rustc_smir/convert/mir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,13 +328,13 @@ impl<'tcx> Stable<'tcx> for mir::Operand<'tcx> {
}

impl<'tcx> Stable<'tcx> for mir::ConstOperand<'tcx> {
type T = stable_mir::mir::Constant;
type T = stable_mir::mir::ConstOperand;

fn stable(&self, tables: &mut Tables<'_>) -> Self::T {
stable_mir::mir::Constant {
stable_mir::mir::ConstOperand {
span: self.span.stable(tables),
user_ty: self.user_ty.map(|u| u.as_usize()).or(None),
literal: self.const_.stable(tables),
const_: self.const_.stable(tables),
}
}
}
Expand Down
Loading

0 comments on commit 3cf924b

Please sign in to comment.