Skip to content

Commit 1f3bf23

Browse files
committed
Auto merge of rust-lang#134164 - jhpratt:rollup-s7z0vcc, r=jhpratt
Rollup of 8 pull requests Successful merges: - rust-lang#134079 (Add a note saying that `{u8,i8}::from_{be,le,ne}_bytes` is meaningless) - rust-lang#134105 (Validate self in host predicates correctly) - rust-lang#134136 (Exercise const trait interaction with default fields) - rust-lang#134139 ([AIX] keep profile-rt symbol alive) - rust-lang#134141 (Remove more traces of anonymous ADTs) - rust-lang#134142 (Rudimentary heuristic to insert parentheses when needed for RPIT overcaptures lint) - rust-lang#134158 (Rename `projection_def_id` to `item_def_id`) - rust-lang#134160 (Add vacation entry for myself in triagebot.toml) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 5a6036a + c384b28 commit 1f3bf23

File tree

29 files changed

+174
-72
lines changed

29 files changed

+174
-72
lines changed

compiler/rustc_codegen_ssa/src/back/linker.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1694,6 +1694,8 @@ impl<'a> Linker for AixLinker<'a> {
16941694

16951695
fn pgo_gen(&mut self) {
16961696
self.link_arg("-bdbg:namedsects:ss");
1697+
self.link_arg("-u");
1698+
self.link_arg("__llvm_profile_runtime");
16971699
}
16981700

16991701
fn control_flow_guard(&mut self) {}

compiler/rustc_hir/src/def.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use rustc_macros::{Decodable, Encodable, HashStable_Generic};
99
use rustc_span::Symbol;
1010
use rustc_span::def_id::{DefId, LocalDefId};
1111
use rustc_span::hygiene::MacroKind;
12-
use rustc_span::symbol::kw;
1312

1413
use crate::definitions::DefPathData;
1514
use crate::hir;
@@ -256,7 +255,6 @@ impl DefKind {
256255

257256
pub fn def_path_data(self, name: Symbol) -> DefPathData {
258257
match self {
259-
DefKind::Struct | DefKind::Union if name == kw::Empty => DefPathData::AnonAdt,
260258
DefKind::Mod
261259
| DefKind::Struct
262260
| DefKind::Union

compiler/rustc_hir/src/definitions.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,6 @@ pub enum DefPathData {
289289
/// An existential `impl Trait` type node.
290290
/// Argument position `impl Trait` have a `TypeNs` with their pretty-printed name.
291291
OpaqueTy,
292-
/// An anonymous struct or union type i.e. `struct { foo: Type }` or `union { bar: Type }`
293-
AnonAdt,
294292
}
295293

296294
impl Definitions {
@@ -415,7 +413,7 @@ impl DefPathData {
415413
TypeNs(name) | ValueNs(name) | MacroNs(name) | LifetimeNs(name) => Some(name),
416414

417415
Impl | ForeignMod | CrateRoot | Use | GlobalAsm | Closure | Ctor | AnonConst
418-
| OpaqueTy | AnonAdt => None,
416+
| OpaqueTy => None,
419417
}
420418
}
421419

@@ -438,7 +436,6 @@ impl DefPathData {
438436
Ctor => DefPathDataName::Anon { namespace: sym::constructor },
439437
AnonConst => DefPathDataName::Anon { namespace: sym::constant },
440438
OpaqueTy => DefPathDataName::Anon { namespace: sym::opaque },
441-
AnonAdt => DefPathDataName::Anon { namespace: sym::anon_adt },
442439
}
443440
}
444441
}

compiler/rustc_hir/src/hir.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2882,8 +2882,6 @@ pub enum TyKind<'hir> {
28822882
Never,
28832883
/// A tuple (`(A, B, C, D, ...)`).
28842884
Tup(&'hir [Ty<'hir>]),
2885-
/// An anonymous struct or union type i.e. `struct { foo: Type }` or `union { foo: Type }`
2886-
AnonAdt(ItemId),
28872885
/// A path to a type definition (`module::module::...::Type`), or an
28882886
/// associated type (e.g., `<Vec<T> as Trait>::Type` or `<T>::Target`).
28892887
///

compiler/rustc_hir/src/intravisit.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -904,9 +904,6 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v>) -> V::Resul
904904
}
905905
TyKind::Typeof(ref expression) => try_visit!(visitor.visit_anon_const(expression)),
906906
TyKind::Infer | TyKind::InferDelegation(..) | TyKind::Err(_) => {}
907-
TyKind::AnonAdt(item_id) => {
908-
try_visit!(visitor.visit_nested_item(item_id));
909-
}
910907
TyKind::Pat(ty, pat) => {
911908
try_visit!(visitor.visit_ty(ty));
912909
try_visit!(visitor.visit_pattern_type_pattern(pat));

compiler/rustc_hir_analysis/src/collect/predicates_of.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -711,12 +711,19 @@ pub(super) fn assert_only_contains_predicates_from<'tcx>(
711711
`{filter:?}` implied bounds: {clause:?}"
712712
);
713713
}
714+
ty::ClauseKind::HostEffect(host_effect_predicate) => {
715+
assert_eq!(
716+
host_effect_predicate.self_ty(),
717+
ty,
718+
"expected `Self` predicate when computing \
719+
`{filter:?}` implied bounds: {clause:?}"
720+
);
721+
}
714722

715723
ty::ClauseKind::RegionOutlives(_)
716724
| ty::ClauseKind::ConstArgHasType(_, _)
717725
| ty::ClauseKind::WellFormed(_)
718-
| ty::ClauseKind::ConstEvaluatable(_)
719-
| ty::ClauseKind::HostEffect(..) => {
726+
| ty::ClauseKind::ConstEvaluatable(_) => {
720727
bug!(
721728
"unexpected non-`Self` predicate when computing \
722729
`{filter:?}` implied bounds: {clause:?}"

compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_compatibility.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
203203
// corresponding `Projection` clause
204204
for def_ids in associated_types.values_mut() {
205205
for (projection_bound, span) in &projection_bounds {
206-
let def_id = projection_bound.projection_def_id();
206+
let def_id = projection_bound.item_def_id();
207207
def_ids.swap_remove(&def_id);
208208
if tcx.generics_require_sized_self(def_id) {
209209
tcx.emit_node_span_lint(
@@ -413,7 +413,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
413413
late_bound_in_projection_term,
414414
late_bound_in_term,
415415
|br_name| {
416-
let item_name = tcx.item_name(pred.projection_def_id());
416+
let item_name = tcx.item_name(pred.item_def_id());
417417
struct_span_code_err!(
418418
self.dcx(),
419419
span,

compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ use rustc_span::{DUMMY_SP, Span};
5050
use rustc_trait_selection::infer::InferCtxtExt;
5151
use rustc_trait_selection::traits::wf::object_region_bounds;
5252
use rustc_trait_selection::traits::{self, ObligationCtxt};
53-
use tracing::{debug, debug_span, instrument};
53+
use tracing::{debug, instrument};
5454

5555
use crate::bounds::Bounds;
5656
use crate::check::check_abi_fn_ptr;
@@ -2304,19 +2304,6 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
23042304
hir::TyKind::Tup(fields) => {
23052305
Ty::new_tup_from_iter(tcx, fields.iter().map(|t| self.lower_ty(t)))
23062306
}
2307-
hir::TyKind::AnonAdt(item_id) => {
2308-
let _guard = debug_span!("AnonAdt");
2309-
2310-
let did = item_id.owner_id.def_id;
2311-
let adt_def = tcx.adt_def(did);
2312-
2313-
let args = ty::GenericArgs::for_item(tcx, did.to_def_id(), |param, _| {
2314-
tcx.mk_param_from_def(param)
2315-
});
2316-
debug!(?args);
2317-
2318-
Ty::new_adt(tcx, adt_def, tcx.mk_args(args))
2319-
}
23202307
hir::TyKind::BareFn(bf) => {
23212308
require_c_abi_if_c_variadic(tcx, bf.decl, bf.abi, hir_ty.span);
23222309

compiler/rustc_hir_pretty/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ impl<'a> State<'a> {
330330
hir::TyKind::Infer | hir::TyKind::InferDelegation(..) => {
331331
self.word("_");
332332
}
333-
hir::TyKind::AnonAdt(..) => self.word("/* anonymous adt */"),
334333
hir::TyKind::Pat(ty, pat) => {
335334
self.print_type(ty);
336335
self.word(" is ");

compiler/rustc_hir_typeck/src/closure.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
454454
closure_kind: hir::ClosureKind,
455455
projection: ty::PolyProjectionPredicate<'tcx>,
456456
) -> Option<ExpectedSig<'tcx>> {
457-
let def_id = projection.projection_def_id();
457+
let def_id = projection.item_def_id();
458458

459459
// For now, we only do signature deduction based off of the `Fn` and `AsyncFn` traits,
460460
// for closures and async closures, respectively.

0 commit comments

Comments
 (0)