Skip to content

Commit 794c124

Browse files
committed
Auto merge of rust-lang#137397 - matthiaskrgr:rollup-ls2pilo, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - rust-lang#132876 (rustdoc book: acknowledge --document-hidden-items) - rust-lang#136148 (Optionally add type names to `TypeId`s.) - rust-lang#136609 (libcore/net: `IpAddr::as_octets()`) - rust-lang#137336 (Stabilise `os_str_display`) - rust-lang#137350 (Move methods from Map to TyCtxt, part 3.) - rust-lang#137353 (Implement `read_buf` for WASI stdin) - rust-lang#137361 (Refactor `OperandRef::extract_field` to prep for MCP838) - rust-lang#137367 (Do not exempt nonexistent platforms from platform policy) - rust-lang#137374 (Stacker now handles miri using a noop impl itself) - rust-lang#137392 (remove few unused fields) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 71e06b9 + cfc2d11 commit 794c124

File tree

126 files changed

+422
-351
lines changed

Some content is hidden

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

126 files changed

+422
-351
lines changed

Cargo.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -2751,9 +2751,9 @@ dependencies = [
27512751

27522752
[[package]]
27532753
name = "psm"
2754-
version = "0.1.24"
2754+
version = "0.1.25"
27552755
source = "registry+https://github.com/rust-lang/crates.io-index"
2756-
checksum = "200b9ff220857e53e184257720a14553b2f4aa02577d2ed9842d45d4b9654810"
2756+
checksum = "f58e5423e24c18cc840e1c98370b3993c6649cd1678b4d24318bcf0a083cbe88"
27572757
dependencies = [
27582758
"cc",
27592759
]
@@ -4947,9 +4947,9 @@ dependencies = [
49474947

49484948
[[package]]
49494949
name = "stacker"
4950-
version = "0.1.17"
4950+
version = "0.1.18"
49514951
source = "registry+https://github.com/rust-lang/crates.io-index"
4952-
checksum = "799c883d55abdb5e98af1a7b3f23b9b6de8ecada0ecac058672d7635eb48ca7b"
4952+
checksum = "1d08feb8f695b465baed819b03c128dc23f57a694510ab1f06c77f763975685e"
49534953
dependencies = [
49544954
"cc",
49554955
"cfg-if",

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+7-11
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,6 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
386386
}
387387
}
388388
let tcx = self.infcx.tcx;
389-
let hir = self.infcx.tcx.hir();
390389
if let Some(body) = tcx.hir_maybe_body_owned_by(self.mir_def_id()) {
391390
let expr = body.value;
392391
let place = &self.move_data.move_paths[mpi].place;
@@ -402,7 +401,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
402401
if let Some(span) = span
403402
&& let Some(expr) = finder.expr
404403
{
405-
for (_, expr) in hir.parent_iter(expr.hir_id) {
404+
for (_, expr) in tcx.hir_parent_iter(expr.hir_id) {
406405
if let hir::Node::Expr(expr) = expr {
407406
if expr.span.contains(span) {
408407
// If the let binding occurs within the same loop, then that
@@ -969,7 +968,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
969968
let mut parent = None;
970969
// The top-most loop where the moved expression could be moved to a new binding.
971970
let mut outer_most_loop: Option<&hir::Expr<'_>> = None;
972-
for (_, node) in tcx.hir().parent_iter(expr.hir_id) {
971+
for (_, node) in tcx.hir_parent_iter(expr.hir_id) {
973972
let e = match node {
974973
hir::Node::Expr(e) => e,
975974
hir::Node::LetStmt(hir::LetStmt { els: Some(els), .. }) => {
@@ -1021,8 +1020,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
10211020
}
10221021
}
10231022
let loop_count: usize = tcx
1024-
.hir()
1025-
.parent_iter(expr.hir_id)
1023+
.hir_parent_iter(expr.hir_id)
10261024
.map(|(_, node)| match node {
10271025
hir::Node::Expr(hir::Expr { kind: hir::ExprKind::Loop(..), .. }) => 1,
10281026
_ => 0,
@@ -1048,8 +1046,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
10481046
.collect::<Vec<Span>>();
10491047
// All of the spans for the loops above the expression with the move error.
10501048
let loop_spans: Vec<_> = tcx
1051-
.hir()
1052-
.parent_iter(expr.hir_id)
1049+
.hir_parent_iter(expr.hir_id)
10531050
.filter_map(|(_, node)| match node {
10541051
hir::Node::Expr(hir::Expr { span, kind: hir::ExprKind::Loop(..), .. }) => {
10551052
Some(*span)
@@ -1334,7 +1331,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
13341331
}
13351332

13361333
fn in_move_closure(&self, expr: &hir::Expr<'_>) -> bool {
1337-
for (_, node) in self.infcx.tcx.hir().parent_iter(expr.hir_id) {
1334+
for (_, node) in self.infcx.tcx.hir_parent_iter(expr.hir_id) {
13381335
if let hir::Node::Expr(hir::Expr { kind: hir::ExprKind::Closure(closure), .. }) = node
13391336
&& let hir::CaptureBy::Value { .. } = closure.capture_clause
13401337
{
@@ -2118,7 +2115,6 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
21182115
issued_span: Span,
21192116
) {
21202117
let tcx = self.infcx.tcx;
2121-
let hir = tcx.hir();
21222118

21232119
let has_split_at_mut = |ty: Ty<'tcx>| {
21242120
let ty = ty.peel_refs();
@@ -2171,7 +2167,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
21712167
return;
21722168
};
21732169

2174-
let Some(object) = hir.parent_id_iter(index1.hir_id).find_map(|id| {
2170+
let Some(object) = tcx.hir_parent_id_iter(index1.hir_id).find_map(|id| {
21752171
if let hir::Node::Expr(expr) = tcx.hir_node(id)
21762172
&& let hir::ExprKind::Index(obj, ..) = expr.kind
21772173
{
@@ -2189,7 +2185,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
21892185
return;
21902186
};
21912187

2192-
let Some(swap_call) = hir.parent_id_iter(object.hir_id).find_map(|id| {
2188+
let Some(swap_call) = tcx.hir_parent_id_iter(object.hir_id).find_map(|id| {
21932189
if let hir::Node::Expr(call) = tcx.hir_node(id)
21942190
&& let hir::ExprKind::Call(callee, ..) = call.kind
21952191
&& let hir::ExprKind::Path(qpath) = callee.kind

compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl<'tcx> BorrowExplanation<'tcx> {
117117
let local_decl = &body.local_decls[dropped_local];
118118

119119
if let &LocalInfo::IfThenRescopeTemp { if_then } = local_decl.local_info()
120-
&& let Some((_, hir::Node::Expr(expr))) = tcx.hir().parent_iter(if_then).next()
120+
&& let Some((_, hir::Node::Expr(expr))) = tcx.hir_parent_iter(if_then).next()
121121
&& let hir::ExprKind::If(cond, conseq, alt) = expr.kind
122122
&& let hir::ExprKind::Let(&hir::LetExpr {
123123
span: _,
@@ -522,7 +522,7 @@ fn suggest_rewrite_if_let<G: EmissionGuarantee>(
522522
);
523523
if expr.span.can_be_used_for_suggestions() && conseq.span.can_be_used_for_suggestions() {
524524
let needs_block = if let Some(hir::Node::Expr(expr)) =
525-
alt.and_then(|alt| tcx.hir().parent_iter(alt.hir_id).next()).map(|(_, node)| node)
525+
alt.and_then(|alt| tcx.hir_parent_iter(alt.hir_id).next()).map(|(_, node)| node)
526526
{
527527
matches!(expr.kind, hir::ExprKind::If(..))
528528
} else {

compiler/rustc_borrowck/src/diagnostics/move_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
388388

389389
// Search for an appropriate place for the structured `.clone()` suggestion to be applied.
390390
// If we encounter a statement before the borrow error, we insert a statement there.
391-
for (_, node) in tcx.hir().parent_iter(closure_expr.hir_id) {
391+
for (_, node) in tcx.hir_parent_iter(closure_expr.hir_id) {
392392
if let Node::Stmt(stmt) = node {
393393
let padding = tcx
394394
.sess

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
404404
pat.kind
405405
{
406406
if upvar_ident.name == kw::SelfLower {
407-
for (_, node) in self.infcx.tcx.hir().parent_iter(upvar_hir_id) {
407+
for (_, node) in self.infcx.tcx.hir_parent_iter(upvar_hir_id) {
408408
if let Some(fn_decl) = node.fn_decl() {
409409
if !matches!(
410410
fn_decl.implicit_self,
@@ -934,7 +934,6 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
934934
err.span_label(sp, format!("cannot {act}"));
935935

936936
let tcx = self.infcx.tcx;
937-
let hir = tcx.hir();
938937
let closure_id = self.mir_hir_id();
939938
let closure_span = tcx.def_span(self.mir_def_id());
940939
let fn_call_id = tcx.parent_hir_id(closure_id);
@@ -1017,10 +1016,10 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
10171016
}
10181017
}
10191018

1020-
if look_at_return && hir.get_fn_id_for_return_block(closure_id).is_some() {
1019+
if look_at_return && tcx.hir_get_fn_id_for_return_block(closure_id).is_some() {
10211020
// ...otherwise we are probably in the tail expression of the function, point at the
10221021
// return type.
1023-
match tcx.hir_node_by_def_id(hir.get_parent_item(fn_call_id).def_id) {
1022+
match tcx.hir_node_by_def_id(tcx.hir_get_parent_item(fn_call_id).def_id) {
10241023
hir::Node::Item(hir::Item {
10251024
ident, kind: hir::ItemKind::Fn { sig, .. }, ..
10261025
})

compiler/rustc_borrowck/src/diagnostics/region_name.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,6 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
671671
#[instrument(level = "trace", skip(self))]
672672
fn give_name_if_anonymous_region_appears_in_output(&self, fr: RegionVid) -> Option<RegionName> {
673673
let tcx = self.infcx.tcx;
674-
let hir = tcx.hir();
675674

676675
let return_ty = self.regioncx.universal_regions().unnormalized_output_ty;
677676
debug!("give_name_if_anonymous_region_appears_in_output: return_ty = {:?}", return_ty);
@@ -711,7 +710,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
711710
hir::CoroutineSource::Fn,
712711
)) => {
713712
let parent_item =
714-
tcx.hir_node_by_def_id(hir.get_parent_item(mir_hir_id).def_id);
713+
tcx.hir_node_by_def_id(tcx.hir_get_parent_item(mir_hir_id).def_id);
715714
let output = &parent_item
716715
.fn_decl()
717716
.expect("coroutine lowered from async fn should be in fn")
@@ -741,7 +740,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
741740
hir::CoroutineSource::Fn,
742741
)) => {
743742
let parent_item =
744-
tcx.hir_node_by_def_id(hir.get_parent_item(mir_hir_id).def_id);
743+
tcx.hir_node_by_def_id(tcx.hir_get_parent_item(mir_hir_id).def_id);
745744
let output = &parent_item
746745
.fn_decl()
747746
.expect("coroutine lowered from gen fn should be in fn")
@@ -768,7 +767,7 @@ impl<'tcx> MirBorrowckCtxt<'_, '_, 'tcx> {
768767
hir::CoroutineSource::Fn,
769768
)) => {
770769
let parent_item =
771-
tcx.hir_node_by_def_id(hir.get_parent_item(mir_hir_id).def_id);
770+
tcx.hir_node_by_def_id(tcx.hir_get_parent_item(mir_hir_id).def_id);
772771
let output = &parent_item
773772
.fn_decl()
774773
.expect("coroutine lowered from async gen fn should be in fn")

compiler/rustc_codegen_ssa/src/mir/operand.rs

+24-22
Original file line numberDiff line numberDiff line change
@@ -358,19 +358,33 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
358358
let field = self.layout.field(bx.cx(), i);
359359
let offset = self.layout.fields.offset(i);
360360

361-
let val = if field.is_zst() {
362-
OperandValue::ZeroSized
363-
} else if field.size == self.layout.size {
364-
assert_eq!(offset.bytes(), 0);
365-
if let Some(field_val) = fx.codegen_transmute_operand(bx, *self, field) {
366-
field_val
367-
} else {
368-
// we have to go through memory for things like
361+
if !bx.is_backend_ref(self.layout) && bx.is_backend_ref(field) {
362+
if let BackendRepr::Vector { count, .. } = self.layout.backend_repr
363+
&& let BackendRepr::Memory { sized: true } = field.backend_repr
364+
&& count.is_power_of_two()
365+
{
366+
assert_eq!(field.size, self.layout.size);
367+
// This is being deprecated, but for now stdarch still needs it for
369368
// Newtype vector of array, e.g. #[repr(simd)] struct S([i32; 4]);
370369
let place = PlaceRef::alloca(bx, field);
371370
self.val.store(bx, place.val.with_type(self.layout));
372-
bx.load_operand(place).val
371+
return bx.load_operand(place);
372+
} else {
373+
// Part of https://github.com/rust-lang/compiler-team/issues/838
374+
bug!("Non-ref type {self:?} cannot project to ref field type {field:?}");
373375
}
376+
}
377+
378+
let val = if field.is_zst() {
379+
OperandValue::ZeroSized
380+
} else if field.size == self.layout.size {
381+
assert_eq!(offset.bytes(), 0);
382+
fx.codegen_transmute_operand(bx, *self, field).unwrap_or_else(|| {
383+
bug!(
384+
"Expected `codegen_transmute_operand` to handle equal-size \
385+
field {i:?} projection from {self:?} to {field:?}"
386+
)
387+
})
374388
} else {
375389
let (in_scalar, imm) = match (self.val, self.layout.backend_repr) {
376390
// Extract a scalar component from a pair.
@@ -385,11 +399,6 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
385399
}
386400
}
387401

388-
// `#[repr(simd)]` types are also immediate.
389-
(OperandValue::Immediate(llval), BackendRepr::Vector { .. }) => {
390-
(None, bx.extract_element(llval, bx.cx().const_usize(i as u64)))
391-
}
392-
393402
_ => {
394403
span_bug!(fx.mir.span, "OperandRef::extract_field({:?}): not applicable", self)
395404
}
@@ -415,14 +424,7 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
415424
imm
416425
}
417426
}
418-
BackendRepr::Memory { sized: true } => {
419-
span_bug!(
420-
fx.mir.span,
421-
"Projecting into a simd type with padding doesn't work; \
422-
See <https://github.com/rust-lang/rust/issues/137108>",
423-
);
424-
}
425-
BackendRepr::ScalarPair(_, _) | BackendRepr::Memory { sized: false } => bug!(),
427+
BackendRepr::ScalarPair(_, _) | BackendRepr::Memory { .. } => bug!(),
426428
})
427429
};
428430

compiler/rustc_data_structures/src/stack.rs

-12
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,6 @@ const STACK_PER_RECURSION: usize = 16 * 1024 * 1024; // 16MB
1717
///
1818
/// Should not be sprinkled around carelessly, as it causes a little bit of overhead.
1919
#[inline]
20-
#[cfg(not(miri))]
2120
pub fn ensure_sufficient_stack<R>(f: impl FnOnce() -> R) -> R {
2221
stacker::maybe_grow(RED_ZONE, STACK_PER_RECURSION, f)
2322
}
24-
25-
/// Grows the stack on demand to prevent stack overflow. Call this in strategic locations
26-
/// to "break up" recursive calls. E.g. almost any call to `visit_expr` or equivalent can benefit
27-
/// from this.
28-
///
29-
/// Should not be sprinkled around carelessly, as it causes a little bit of overhead.
30-
#[cfg(miri)]
31-
#[inline]
32-
pub fn ensure_sufficient_stack<R>(f: impl FnOnce() -> R) -> R {
33-
f()
34-
}

compiler/rustc_hir_analysis/src/check/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ fn best_definition_site_of_opaque<'tcx>(
482482
None
483483
}
484484
hir::OpaqueTyOrigin::TyAlias { in_assoc_ty: false, .. } => {
485-
let scope = tcx.hir().get_defining_scope(tcx.local_def_id_to_hir_id(opaque_def_id));
485+
let scope = tcx.hir_get_defining_scope(tcx.local_def_id_to_hir_id(opaque_def_id));
486486
let found = if scope == hir::CRATE_HIR_ID {
487487
tcx.hir_walk_toplevel_module(&mut locator)
488488
} else {

compiler/rustc_hir_analysis/src/check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ fn get_owner_return_paths(
127127
def_id: LocalDefId,
128128
) -> Option<(LocalDefId, ReturnsVisitor<'_>)> {
129129
let hir_id = tcx.local_def_id_to_hir_id(def_id);
130-
let parent_id = tcx.hir().get_parent_item(hir_id).def_id;
130+
let parent_id = tcx.hir_get_parent_item(hir_id).def_id;
131131
tcx.hir_node_by_def_id(parent_id).body_id().map(|body_id| {
132132
let body = tcx.hir_body(body_id);
133133
let mut visitor = ReturnsVisitor::default();

compiler/rustc_hir_analysis/src/check/wfcheck.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ fn could_be_self(trait_def_id: LocalDefId, ty: &hir::Ty<'_>) -> bool {
853853
/// In such cases, suggest using `Self` instead.
854854
fn check_dyn_incompatible_self_trait_by_name(tcx: TyCtxt<'_>, item: &hir::TraitItem<'_>) {
855855
let (trait_name, trait_def_id) =
856-
match tcx.hir_node_by_def_id(tcx.hir().get_parent_item(item.hir_id()).def_id) {
856+
match tcx.hir_node_by_def_id(tcx.hir_get_parent_item(item.hir_id()).def_id) {
857857
hir::Node::Item(item) => match item.kind {
858858
hir::ItemKind::Trait(..) => (item.ident, item.owner_id),
859859
_ => return,

compiler/rustc_hir_analysis/src/collect.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,7 @@ impl<'tcx> HirTyLowerer<'tcx> for ItemCtxt<'tcx> {
469469
let item = self
470470
.tcx
471471
.hir()
472-
.expect_item(self.tcx.hir().get_parent_item(self.hir_id()).def_id);
472+
.expect_item(self.tcx.hir_get_parent_item(self.hir_id()).def_id);
473473
match &item.kind {
474474
hir::ItemKind::Enum(_, generics)
475475
| hir::ItemKind::Struct(_, generics)
@@ -1349,7 +1349,7 @@ fn fn_sig(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<'_, ty::PolyFn
13491349
}
13501350

13511351
Ctor(data) | Variant(hir::Variant { data, .. }) if data.ctor().is_some() => {
1352-
let adt_def_id = tcx.hir().get_parent_item(hir_id).def_id.to_def_id();
1352+
let adt_def_id = tcx.hir_get_parent_item(hir_id).def_id.to_def_id();
13531353
let ty = tcx.type_of(adt_def_id).instantiate_identity();
13541354
let inputs = data.fields().iter().map(|f| tcx.type_of(f.def_id).instantiate_identity());
13551355
// constructors for structs with `layout_scalar_valid_range` are unsafe to call

compiler/rustc_hir_analysis/src/collect/generics_of.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Generics {
7171
| Node::Variant(_)
7272
| Node::Ctor(..)
7373
| Node::Field(_) => {
74-
let parent_id = tcx.hir().get_parent_item(hir_id);
74+
let parent_id = tcx.hir_get_parent_item(hir_id);
7575
Some(parent_id.to_def_id())
7676
}
7777
// FIXME(#43408) always enable this once `lazy_normalization` is
@@ -90,12 +90,12 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::Generics {
9090
let parent_did = if let DefKind::AnonConst = tcx.def_kind(parent_did) {
9191
parent_did
9292
} else {
93-
tcx.hir().get_parent_item(hir_id).to_def_id()
93+
tcx.hir_get_parent_item(hir_id).to_def_id()
9494
};
9595
debug!(?parent_did);
9696

9797
let mut in_param_ty = false;
98-
for (_parent, node) in tcx.hir().parent_iter(hir_id) {
98+
for (_parent, node) in tcx.hir_parent_iter(hir_id) {
9999
if let Some(generics) = node.generics() {
100100
let mut visitor = AnonConstInParamTyDetector { in_param_ty: false, ct: hir_id };
101101

compiler/rustc_hir_analysis/src/collect/predicates_of.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -382,8 +382,7 @@ fn const_evaluatable_predicates_of<'tcx>(
382382
fn is_const_param_default(tcx: TyCtxt<'_>, def: LocalDefId) -> bool {
383383
let hir_id = tcx.local_def_id_to_hir_id(def);
384384
let (_, parent_node) = tcx
385-
.hir()
386-
.parent_iter(hir_id)
385+
.hir_parent_iter(hir_id)
387386
.skip_while(|(_, n)| matches!(n, Node::ConstArg(..)))
388387
.next()
389388
.unwrap();

compiler/rustc_hir_analysis/src/collect/type_of.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ fn anon_const_type_of<'tcx>(icx: &ItemCtxt<'tcx>, def_id: LocalDefId) -> Ty<'tcx
107107
}
108108
}
109109
Node::Variant(Variant { disr_expr: Some(ref e), .. }) if e.hir_id == hir_id => {
110-
tcx.adt_def(tcx.hir().get_parent_item(hir_id)).repr().discr_type().to_ty(tcx)
110+
tcx.adt_def(tcx.hir_get_parent_item(hir_id)).repr().discr_type().to_ty(tcx)
111111
}
112112
// Sort of affects the type system, but only for the purpose of diagnostics
113113
// so no need for ConstArg.
@@ -257,7 +257,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<'_
257257
}
258258
}
259259
ImplItemKind::Type(ty) => {
260-
if tcx.impl_trait_ref(tcx.hir().get_parent_item(hir_id)).is_none() {
260+
if tcx.impl_trait_ref(tcx.hir_get_parent_item(hir_id)).is_none() {
261261
check_feature_inherent_assoc_ty(tcx, item.span);
262262
}
263263

@@ -341,7 +341,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<'_
341341

342342
Node::Ctor(def) | Node::Variant(Variant { data: def, .. }) => match def {
343343
VariantData::Unit(..) | VariantData::Struct { .. } => {
344-
tcx.type_of(tcx.hir().get_parent_item(hir_id)).instantiate_identity()
344+
tcx.type_of(tcx.hir_get_parent_item(hir_id)).instantiate_identity()
345345
}
346346
VariantData::Tuple(_, _, ctor) => {
347347
let args = ty::GenericArgs::identity_for_item(tcx, def_id);

0 commit comments

Comments
 (0)