Skip to content

Commit 47df7c5

Browse files
committed
parse pinned local variable declarations
1 parent 6dce9f8 commit 47df7c5

File tree

50 files changed

+449
-93
lines changed

Some content is hidden

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

50 files changed

+449
-93
lines changed

compiler/rustc_ast/src/ast.rs

+23-10
Original file line numberDiff line numberDiff line change
@@ -720,18 +720,22 @@ impl ByRef {
720720
/// Used for both the explicit binding annotations given in the HIR for a binding
721721
/// and the final binding mode that we infer after type inference/match ergonomics.
722722
/// `.0` is the by-reference mode (`ref`, `ref mut`, or by value),
723-
/// `.1` is the mutability of the binding.
723+
/// `.1` is the pinnedness of the binding,
724+
/// `.2` is the mutability of the binding.
724725
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
725726
#[derive(Encodable, Decodable, HashStable_Generic)]
726-
pub struct BindingMode(pub ByRef, pub Mutability);
727+
pub struct BindingMode(pub ByRef, pub Pinnedness, pub Mutability);
727728

728729
impl BindingMode {
729-
pub const NONE: Self = Self(ByRef::No, Mutability::Not);
730-
pub const REF: Self = Self(ByRef::Yes(Mutability::Not), Mutability::Not);
731-
pub const MUT: Self = Self(ByRef::No, Mutability::Mut);
732-
pub const REF_MUT: Self = Self(ByRef::Yes(Mutability::Mut), Mutability::Not);
733-
pub const MUT_REF: Self = Self(ByRef::Yes(Mutability::Not), Mutability::Mut);
734-
pub const MUT_REF_MUT: Self = Self(ByRef::Yes(Mutability::Mut), Mutability::Mut);
730+
pub const NONE: Self = Self(ByRef::No, Pinnedness::Not, Mutability::Not);
731+
pub const REF: Self = Self(ByRef::Yes(Mutability::Not), Pinnedness::Not, Mutability::Not);
732+
pub const MUT: Self = Self(ByRef::No, Pinnedness::Not, Mutability::Mut);
733+
pub const REF_MUT: Self = Self(ByRef::Yes(Mutability::Mut), Pinnedness::Not, Mutability::Not);
734+
pub const MUT_REF: Self = Self(ByRef::Yes(Mutability::Not), Pinnedness::Not, Mutability::Mut);
735+
pub const MUT_REF_MUT: Self =
736+
Self(ByRef::Yes(Mutability::Mut), Pinnedness::Not, Mutability::Mut);
737+
pub const PIN_CONST: Self = Self(ByRef::No, Pinnedness::Pinned, Mutability::Not);
738+
pub const PIN_MUT: Self = Self(ByRef::No, Pinnedness::Pinned, Mutability::Mut);
735739

736740
pub fn prefix_str(self) -> &'static str {
737741
match self {
@@ -741,6 +745,9 @@ impl BindingMode {
741745
Self::REF_MUT => "ref mut ",
742746
Self::MUT_REF => "mut ref ",
743747
Self::MUT_REF_MUT => "mut ref mut ",
748+
Self::PIN_CONST => "pin const ",
749+
Self::PIN_MUT => "pin mut ",
750+
Self(_, Pinnedness::Pinned, _) => panic!("unsupported pinned binding mode"),
744751
}
745752
}
746753
}
@@ -2604,7 +2611,9 @@ pub type ExplicitSelf = Spanned<SelfKind>;
26042611
impl Param {
26052612
/// Attempts to cast parameter to `ExplicitSelf`.
26062613
pub fn to_self(&self) -> Option<ExplicitSelf> {
2607-
if let PatKind::Ident(BindingMode(ByRef::No, mutbl), ident, _) = self.pat.kind {
2614+
if let PatKind::Ident(BindingMode(ByRef::No, Pinnedness::Not, mutbl), ident, _) =
2615+
self.pat.kind
2616+
{
26082617
if ident.name == kw::SelfLower {
26092618
return match self.ty.kind {
26102619
TyKind::ImplicitSelf => Some(respan(self.pat.span, SelfKind::Value(mutbl))),
@@ -2659,7 +2668,11 @@ impl Param {
26592668
attrs,
26602669
pat: P(Pat {
26612670
id: DUMMY_NODE_ID,
2662-
kind: PatKind::Ident(BindingMode(ByRef::No, mutbl), eself_ident, None),
2671+
kind: PatKind::Ident(
2672+
BindingMode(ByRef::No, Pinnedness::Not, mutbl),
2673+
eself_ident,
2674+
None,
2675+
),
26632676
span,
26642677
tokens: None,
26652678
}),

compiler/rustc_ast_ir/src/lib.rs

+9
Original file line numberDiff line numberDiff line change
@@ -86,3 +86,12 @@ pub enum Pinnedness {
8686
Not,
8787
Pinned,
8888
}
89+
90+
impl Pinnedness {
91+
pub fn is_pin(self) -> bool {
92+
matches!(self, Self::Pinned)
93+
}
94+
pub fn is_not(self) -> bool {
95+
matches!(self, Self::Not)
96+
}
97+
}

compiler/rustc_ast_lowering/src/item.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1278,7 +1278,9 @@ impl<'hir> LoweringContext<'_, 'hir> {
12781278
// Check if this is a binding pattern, if so, we can optimize and avoid adding a
12791279
// `let <pat> = __argN;` statement. In this case, we do not rename the parameter.
12801280
let (ident, is_simple_parameter) = match parameter.pat.kind {
1281-
hir::PatKind::Binding(hir::BindingMode(ByRef::No, _), _, ident, _) => (ident, true),
1281+
hir::PatKind::Binding(hir::BindingMode(ByRef::No, _, _), _, ident, _) => {
1282+
(ident, true)
1283+
}
12821284
// For `ref mut` or wildcard arguments, we can't reuse the binding, but
12831285
// we can keep the same name for the parameter.
12841286
// This lets rustdoc render it correctly in documentation.

compiler/rustc_ast_lowering/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1629,7 +1629,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
16291629
implicit_self: decl.inputs.get(0).map_or(hir::ImplicitSelfKind::None, |arg| {
16301630
let is_mutable_pat = matches!(
16311631
arg.pat.kind,
1632-
PatKind::Ident(hir::BindingMode(_, Mutability::Mut), ..)
1632+
PatKind::Ident(hir::BindingMode(_, _, Mutability::Mut), ..)
16331633
);
16341634

16351635
match &arg.ty.kind {

compiler/rustc_ast_pretty/src/pprust/state.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1616,7 +1616,10 @@ impl<'a> State<'a> {
16161616
match &pat.kind {
16171617
PatKind::Wild => self.word("_"),
16181618
PatKind::Never => self.word("!"),
1619-
PatKind::Ident(BindingMode(by_ref, mutbl), ident, sub) => {
1619+
PatKind::Ident(BindingMode(by_ref, pin, mutbl), ident, sub) => {
1620+
if pin.is_pin() {
1621+
self.word_nbsp("pin");
1622+
}
16201623
if mutbl.is_mut() {
16211624
self.word_nbsp("mut");
16221625
}

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
305305
{
306306
match *decl.local_info() {
307307
LocalInfo::User(BindingForm::Var(mir::VarBindingForm {
308-
binding_mode: BindingMode(ByRef::No, Mutability::Not),
308+
binding_mode: BindingMode(ByRef::No, _, Mutability::Not),
309309
opt_ty_info: Some(sp),
310310
opt_match_place: _,
311311
pat_span: _,
@@ -733,7 +733,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
733733
debug!("local_decl: {:?}", local_decl);
734734
let pat_span = match *local_decl.local_info() {
735735
LocalInfo::User(BindingForm::Var(mir::VarBindingForm {
736-
binding_mode: BindingMode(ByRef::No, Mutability::Not),
736+
binding_mode: BindingMode(ByRef::No, _, Mutability::Not),
737737
opt_ty_info: _,
738738
opt_match_place: _,
739739
pat_span,
@@ -1147,7 +1147,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
11471147
}
11481148

11491149
LocalInfo::User(mir::BindingForm::Var(mir::VarBindingForm {
1150-
binding_mode: BindingMode(ByRef::No, _),
1150+
binding_mode: BindingMode(ByRef::No, _, _),
11511151
opt_ty_info,
11521152
..
11531153
})) => {
@@ -1226,7 +1226,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
12261226
}
12271227

12281228
LocalInfo::User(mir::BindingForm::Var(mir::VarBindingForm {
1229-
binding_mode: BindingMode(ByRef::Yes(_), _),
1229+
binding_mode: BindingMode(ByRef::Yes(_), _, _),
12301230
..
12311231
})) => {
12321232
let pattern_span: Span = local_decl.source_info.span;
@@ -1441,7 +1441,7 @@ fn mut_borrow_of_mutable_ref(local_decl: &LocalDecl<'_>, local_name: Option<Symb
14411441
match *local_decl.local_info() {
14421442
// Check if mutably borrowing a mutable reference.
14431443
LocalInfo::User(mir::BindingForm::Var(mir::VarBindingForm {
1444-
binding_mode: BindingMode(ByRef::No, Mutability::Not),
1444+
binding_mode: BindingMode(ByRef::No, _, Mutability::Not),
14451445
..
14461446
})) => matches!(local_decl.ty.kind(), ty::Ref(_, _, hir::Mutability::Mut)),
14471447
LocalInfo::User(mir::BindingForm::ImplicitSelf(kind)) => {

compiler/rustc_builtin_macros/src/deriving/generic/mod.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ pub(crate) use SubstructureFields::*;
183183
use rustc_ast::ptr::P;
184184
use rustc_ast::{
185185
self as ast, AnonConst, BindingMode, ByRef, EnumDef, Expr, GenericArg, GenericParamKind,
186-
Generics, Mutability, PatKind, VariantData,
186+
Generics, Mutability, PatKind, Pinnedness, VariantData,
187187
};
188188
use rustc_attr_parsing as attr;
189189
use rustc_expand::base::{Annotatable, ExtCtxt};
@@ -1470,7 +1470,11 @@ impl<'a> TraitDef<'a> {
14701470
struct_field.ident,
14711471
cx.pat(
14721472
path.span,
1473-
PatKind::Ident(BindingMode(by_ref, Mutability::Not), path, None),
1473+
PatKind::Ident(
1474+
BindingMode(by_ref, Pinnedness::Not, Mutability::Not),
1475+
path,
1476+
None,
1477+
),
14741478
),
14751479
)
14761480
});

compiler/rustc_hir/src/hir.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_ast::{
1111
};
1212
pub use rustc_ast::{
1313
BinOp, BinOpKind, BindingMode, BorrowKind, BoundConstness, BoundPolarity, ByRef, CaptureBy,
14-
ImplPolarity, IsAuto, Movability, Mutability, UnOp, UnsafeBinderCastKind,
14+
ImplPolarity, IsAuto, Movability, Mutability, Pinnedness, UnOp, UnsafeBinderCastKind,
1515
};
1616
use rustc_data_structures::fingerprint::Fingerprint;
1717
use rustc_data_structures::sorted_map::SortedMap;

compiler/rustc_hir/src/pat_util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ impl hir::Pat<'_> {
9595

9696
pub fn simple_ident(&self) -> Option<Ident> {
9797
match self.kind {
98-
PatKind::Binding(BindingMode(ByRef::No, _), _, ident, None) => Some(ident),
98+
PatKind::Binding(BindingMode(ByRef::No, _, _), _, ident, None) => Some(ident),
9999
_ => None,
100100
}
101101
}

compiler/rustc_hir_analysis/src/check/region.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -681,7 +681,7 @@ fn resolve_local<'tcx>(
681681
// & expression, and its lifetime would be extended to the end of the block (due
682682
// to a different rule, not the below code).
683683
match pat.kind {
684-
PatKind::Binding(hir::BindingMode(hir::ByRef::Yes(_), _), ..) => true,
684+
PatKind::Binding(hir::BindingMode(hir::ByRef::Yes(_), _, _), ..) => true,
685685

686686
PatKind::Struct(_, field_pats, _) => field_pats.iter().any(|fp| is_binding_pat(fp.pat)),
687687

@@ -700,7 +700,7 @@ fn resolve_local<'tcx>(
700700
}
701701

702702
PatKind::Ref(_, _)
703-
| PatKind::Binding(hir::BindingMode(hir::ByRef::No, _), ..)
703+
| PatKind::Binding(hir::BindingMode(hir::ByRef::No, _, _), ..)
704704
| PatKind::Wild
705705
| PatKind::Never
706706
| PatKind::Expr(_)

compiler/rustc_hir_pretty/src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1913,7 +1913,10 @@ impl<'a> State<'a> {
19131913
match pat.kind {
19141914
PatKind::Wild => self.word("_"),
19151915
PatKind::Never => self.word("!"),
1916-
PatKind::Binding(BindingMode(by_ref, mutbl), _, ident, sub) => {
1916+
PatKind::Binding(BindingMode(by_ref, pin, mutbl), _, ident, sub) => {
1917+
if pin.is_pin() {
1918+
self.word_nbsp("pin");
1919+
}
19171920
if mutbl.is_mut() {
19181921
self.word_nbsp("mut");
19191922
}

compiler/rustc_hir_typeck/src/pat.rs

+11-9
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use rustc_hir::def::{CtorKind, DefKind, Res};
1212
use rustc_hir::pat_util::EnumerateAndAdjustIterator;
1313
use rustc_hir::{
1414
self as hir, BindingMode, ByRef, ExprKind, HirId, LangItem, Mutability, Pat, PatExpr,
15-
PatExprKind, PatKind, expr_needs_parens,
15+
PatExprKind, PatKind, Pinnedness, expr_needs_parens,
1616
};
1717
use rustc_infer::infer;
1818
use rustc_middle::traits::PatternOriginExpr;
@@ -812,7 +812,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
812812

813813
// Determine the binding mode...
814814
let bm = match user_bind_annot {
815-
BindingMode(ByRef::No, Mutability::Mut) if let ByRef::Yes(def_br_mutbl) = def_br => {
815+
BindingMode(ByRef::No, pin, Mutability::Mut)
816+
if let ByRef::Yes(def_br_mutbl) = def_br =>
817+
{
816818
// Only mention the experimental `mut_ref` feature if if we're in edition 2024 and
817819
// using other experimental matching features compatible with it.
818820
if pat.span.at_least_rust_2024()
@@ -829,7 +831,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
829831
.emit();
830832
}
831833

832-
BindingMode(def_br, Mutability::Mut)
834+
BindingMode(def_br, pin, Mutability::Mut)
833835
} else {
834836
// `mut` resets the binding mode on edition <= 2021
835837
self.add_rust_2024_migration_desugared_pat(
@@ -838,11 +840,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
838840
ident.span,
839841
def_br_mutbl,
840842
);
841-
BindingMode(ByRef::No, Mutability::Mut)
843+
BindingMode(ByRef::No, pin, Mutability::Mut)
842844
}
843845
}
844-
BindingMode(ByRef::No, mutbl) => BindingMode(def_br, mutbl),
845-
BindingMode(ByRef::Yes(_), _) => {
846+
BindingMode(ByRef::No, pin, mutbl) => BindingMode(def_br, pin, mutbl),
847+
BindingMode(ByRef::Yes(_), _, _) => {
846848
if let ByRef::Yes(def_br_mutbl) = def_br {
847849
// `ref`/`ref mut` overrides the binding mode on edition <= 2021
848850
self.add_rust_2024_migration_desugared_pat(
@@ -1064,7 +1066,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10641066
if let PatKind::Ref(the_ref, _) = i.kind
10651067
&& let PatKind::Binding(mt, _, ident, _) = the_ref.kind
10661068
{
1067-
let BindingMode(_, mtblty) = mt;
1069+
let BindingMode(_, _, mtblty) = mt;
10681070
err.span_suggestion_verbose(
10691071
i.span,
10701072
format!("consider removing `&{mutability}` from the pattern"),
@@ -2820,8 +2822,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
28202822
// If the user-provided binding modifier doesn't match the default binding mode, we'll
28212823
// need to suggest reference patterns, which can affect other bindings.
28222824
// For simplicity, we opt to suggest making the pattern fully explicit.
2823-
info.suggest_eliding_modes &=
2824-
user_bind_annot == BindingMode(ByRef::Yes(def_br_mutbl), Mutability::Not);
2825+
info.suggest_eliding_modes &= user_bind_annot
2826+
== BindingMode(ByRef::Yes(def_br_mutbl), Pinnedness::Not, Mutability::Not);
28252827
"binding modifier"
28262828
} else {
28272829
info.bad_ref_pats |= true;

compiler/rustc_hir_typeck/src/upvar.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
276276
else {
277277
bug!();
278278
};
279-
let hir::PatKind::Binding(hir::BindingMode(hir::ByRef::No, _), _, _, _) = pat.kind
279+
let hir::PatKind::Binding(hir::BindingMode(hir::ByRef::No, _, _), _, _, _) =
280+
pat.kind
280281
else {
281282
// Complex pattern, skip the non-upvar local.
282283
continue;
@@ -1802,7 +1803,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
18021803

18031804
let bm = *typeck_results.pat_binding_modes().get(var_hir_id).expect("missing binding mode");
18041805

1805-
let mut is_mutbl = bm.1;
1806+
let mut is_mutbl = bm.2;
18061807

18071808
for pointer_ty in place.deref_tys() {
18081809
match self.structurally_resolve_type(self.tcx.hir().span(var_hir_id), pointer_ty).kind()

compiler/rustc_middle/src/mir/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ impl<'tcx> LocalDecl<'tcx> {
11221122
self.local_info(),
11231123
LocalInfo::User(
11241124
BindingForm::Var(VarBindingForm {
1125-
binding_mode: BindingMode(ByRef::No, _),
1125+
binding_mode: BindingMode(ByRef::No, _, _),
11261126
opt_ty_info: _,
11271127
opt_match_place: _,
11281128
pat_span: _,
@@ -1139,7 +1139,7 @@ impl<'tcx> LocalDecl<'tcx> {
11391139
self.local_info(),
11401140
LocalInfo::User(
11411141
BindingForm::Var(VarBindingForm {
1142-
binding_mode: BindingMode(ByRef::No, _),
1142+
binding_mode: BindingMode(ByRef::No, _, _),
11431143
opt_ty_info: _,
11441144
opt_match_place: _,
11451145
pat_span: _,

compiler/rustc_middle/src/thir.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ impl<'tcx> Pat<'tcx> {
634634
pub fn simple_ident(&self) -> Option<Symbol> {
635635
match self.kind {
636636
PatKind::Binding {
637-
name, mode: BindingMode(ByRef::No, _), subpattern: None, ..
637+
name, mode: BindingMode(ByRef::No, _, _), subpattern: None, ..
638638
} => Some(name),
639639
_ => None,
640640
}

compiler/rustc_middle/src/ty/typeck_results.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ impl<'tcx> TypeckResults<'tcx> {
456456
let mut has_ref_mut = false;
457457
pat.walk(|pat| {
458458
if let hir::PatKind::Binding(_, id, _, _) = pat.kind
459-
&& let Some(BindingMode(ByRef::Yes(Mutability::Mut), _)) =
459+
&& let Some(BindingMode(ByRef::Yes(Mutability::Mut), _, _)) =
460460
self.pat_binding_modes().get(id)
461461
{
462462
has_ref_mut = true;

compiler/rustc_mir_build/src/builder/matches/mod.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
594594
) -> BlockAnd<()> {
595595
match irrefutable_pat.kind {
596596
// Optimize the case of `let x = ...` to write directly into `x`
597-
PatKind::Binding { mode: BindingMode(ByRef::No, _), var, subpattern: None, .. } => {
597+
PatKind::Binding {
598+
mode: BindingMode(ByRef::No, _, _), var, subpattern: None, ..
599+
} => {
598600
let place = self.storage_live_binding(
599601
block,
600602
var,
@@ -618,7 +620,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
618620
ref subpattern,
619621
ascription: thir::Ascription { ref annotation, variance: _ },
620622
} if let PatKind::Binding {
621-
mode: BindingMode(ByRef::No, _),
623+
mode: BindingMode(ByRef::No, _, _),
622624
var,
623625
subpattern: None,
624626
..
@@ -2776,7 +2778,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
27762778
let tcx = self.tcx;
27772779
let debug_source_info = SourceInfo { span: source_info.span, scope: visibility_scope };
27782780
let local = LocalDecl {
2779-
mutability: mode.1,
2781+
mutability: mode.2,
27802782
ty: var_ty,
27812783
user_ty: if user_ty.is_empty() { None } else { Some(Box::new(user_ty)) },
27822784
source_info,

compiler/rustc_mir_build/src/builder/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -962,7 +962,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
962962
// Don't introduce extra copies for simple bindings
963963
PatKind::Binding {
964964
var,
965-
mode: BindingMode(ByRef::No, mutability),
965+
mode: BindingMode(ByRef::No, pin, mutability),
966966
subpattern: None,
967967
..
968968
} => {
@@ -972,7 +972,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
972972
if let Some(kind) = param.self_kind {
973973
LocalInfo::User(BindingForm::ImplicitSelf(kind))
974974
} else {
975-
let binding_mode = BindingMode(ByRef::No, mutability);
975+
let binding_mode = BindingMode(ByRef::No, pin, mutability);
976976
LocalInfo::User(BindingForm::Var(VarBindingForm {
977977
binding_mode,
978978
opt_ty_info: param.ty_span,

compiler/rustc_mir_build/src/check_unsafety.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ impl<'a, 'tcx> Visitor<'a, 'tcx> for UnsafetyVisitor<'a, 'tcx> {
373373
}
374374
visit::walk_pat(self, pat);
375375
}
376-
PatKind::Binding { mode: BindingMode(ByRef::Yes(rm), _), ty, .. } => {
376+
PatKind::Binding { mode: BindingMode(ByRef::Yes(rm), _, _), ty, .. } => {
377377
if self.inside_adt {
378378
let ty::Ref(_, ty, _) = ty.kind() else {
379379
span_bug!(

0 commit comments

Comments
 (0)