Skip to content

Commit 772c576

Browse files
committed
parse pinned local variable declarations
1 parent f8a913b commit 772c576

File tree

50 files changed

+450
-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

+450
-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
@@ -93,3 +93,12 @@ pub enum Pinnedness {
9393
Not,
9494
Pinned,
9595
}
96+
97+
impl Pinnedness {
98+
pub fn is_pin(self) -> bool {
99+
matches!(self, Self::Pinned)
100+
}
101+
pub fn is_not(self) -> bool {
102+
matches!(self, Self::Not)
103+
}
104+
}

compiler/rustc_ast_lowering/src/item.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,9 @@ impl<'hir> LoweringContext<'_, 'hir> {
12831283
// Check if this is a binding pattern, if so, we can optimize and avoid adding a
12841284
// `let <pat> = __argN;` statement. In this case, we do not rename the parameter.
12851285
let (ident, is_simple_parameter) = match parameter.pat.kind {
1286-
hir::PatKind::Binding(hir::BindingMode(ByRef::No, _), _, ident, _) => (ident, true),
1286+
hir::PatKind::Binding(hir::BindingMode(ByRef::No, _, _), _, ident, _) => {
1287+
(ident, true)
1288+
}
12871289
// For `ref mut` or wildcard arguments, we can't reuse the binding, but
12881290
// we can keep the same name for the parameter.
12891291
// 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
@@ -1628,7 +1628,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
16281628
implicit_self: decl.inputs.get(0).map_or(hir::ImplicitSelfKind::None, |arg| {
16291629
let is_mutable_pat = matches!(
16301630
arg.pat.kind,
1631-
PatKind::Ident(hir::BindingMode(_, Mutability::Mut), ..)
1631+
PatKind::Ident(hir::BindingMode(_, _, Mutability::Mut), ..)
16321632
);
16331633

16341634
match &arg.ty.kind {

compiler/rustc_ast_pretty/src/pprust/state.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -1620,7 +1620,10 @@ impl<'a> State<'a> {
16201620
match &pat.kind {
16211621
PatKind::Wild => self.word("_"),
16221622
PatKind::Never => self.word("!"),
1623-
PatKind::Ident(BindingMode(by_ref, mutbl), ident, sub) => {
1623+
PatKind::Ident(BindingMode(by_ref, pin, mutbl), ident, sub) => {
1624+
if pin.is_pin() {
1625+
self.word_nbsp("pin");
1626+
}
16241627
if mutbl.is_mut() {
16251628
self.word_nbsp("mut");
16261629
}

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: _,
@@ -732,7 +732,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
732732
debug!("local_decl: {:?}", local_decl);
733733
let pat_span = match *local_decl.local_info() {
734734
LocalInfo::User(BindingForm::Var(mir::VarBindingForm {
735-
binding_mode: BindingMode(ByRef::No, Mutability::Not),
735+
binding_mode: BindingMode(ByRef::No, _, Mutability::Not),
736736
opt_ty_info: _,
737737
opt_match_place: _,
738738
pat_span,
@@ -1144,7 +1144,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
11441144
}
11451145

11461146
LocalInfo::User(mir::BindingForm::Var(mir::VarBindingForm {
1147-
binding_mode: BindingMode(ByRef::No, _),
1147+
binding_mode: BindingMode(ByRef::No, _, _),
11481148
opt_ty_info,
11491149
..
11501150
})) => {
@@ -1223,7 +1223,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
12231223
}
12241224

12251225
LocalInfo::User(mir::BindingForm::Var(mir::VarBindingForm {
1226-
binding_mode: BindingMode(ByRef::Yes(_), _),
1226+
binding_mode: BindingMode(ByRef::Yes(_), _, _),
12271227
..
12281228
})) => {
12291229
let pattern_span: Span = local_decl.source_info.span;
@@ -1438,7 +1438,7 @@ fn mut_borrow_of_mutable_ref(local_decl: &LocalDecl<'_>, local_name: Option<Symb
14381438
match *local_decl.local_info() {
14391439
// Check if mutably borrowing a mutable reference.
14401440
LocalInfo::User(mir::BindingForm::Var(mir::VarBindingForm {
1441-
binding_mode: BindingMode(ByRef::No, Mutability::Not),
1441+
binding_mode: BindingMode(ByRef::No, _, Mutability::Not),
14421442
..
14431443
})) => matches!(local_decl.ty.kind(), ty::Ref(_, _, hir::Mutability::Mut)),
14441444
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
@@ -1914,7 +1914,10 @@ impl<'a> State<'a> {
19141914
match pat.kind {
19151915
PatKind::Wild => self.word("_"),
19161916
PatKind::Never => self.word("!"),
1917-
PatKind::Binding(BindingMode(by_ref, mutbl), _, ident, sub) => {
1917+
PatKind::Binding(BindingMode(by_ref, pin, mutbl), _, ident, sub) => {
1918+
if pin.is_pin() {
1919+
self.word_nbsp("pin");
1920+
}
19181921
if mutbl.is_mut() {
19191922
self.word_nbsp("mut");
19201923
}

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;
@@ -824,7 +824,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
824824

825825
// Determine the binding mode...
826826
let bm = match user_bind_annot {
827-
BindingMode(ByRef::No, Mutability::Mut) if let ByRef::Yes(def_br_mutbl) = def_br => {
827+
BindingMode(ByRef::No, pin, Mutability::Mut)
828+
if let ByRef::Yes(def_br_mutbl) = def_br =>
829+
{
828830
// Only mention the experimental `mut_ref` feature if if we're in edition 2024 and
829831
// using other experimental matching features compatible with it.
830832
if pat.span.at_least_rust_2024()
@@ -841,7 +843,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
841843
.emit();
842844
}
843845

844-
BindingMode(def_br, Mutability::Mut)
846+
BindingMode(def_br, pin, Mutability::Mut)
845847
} else {
846848
// `mut` resets the binding mode on edition <= 2021
847849
self.add_rust_2024_migration_desugared_pat(
@@ -850,11 +852,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
850852
't', // last char of `mut`
851853
def_br_mutbl,
852854
);
853-
BindingMode(ByRef::No, Mutability::Mut)
855+
BindingMode(ByRef::No, pin, Mutability::Mut)
854856
}
855857
}
856-
BindingMode(ByRef::No, mutbl) => BindingMode(def_br, mutbl),
857-
BindingMode(ByRef::Yes(user_br_mutbl), _) => {
858+
BindingMode(ByRef::No, pin, mutbl) => BindingMode(def_br, pin, mutbl),
859+
BindingMode(ByRef::Yes(user_br_mutbl), _, _) => {
858860
if let ByRef::Yes(def_br_mutbl) = def_br {
859861
// `ref`/`ref mut` overrides the binding mode on edition <= 2021
860862
self.add_rust_2024_migration_desugared_pat(
@@ -1079,7 +1081,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10791081
if let PatKind::Ref(the_ref, _) = i.kind
10801082
&& let PatKind::Binding(mt, _, ident, _) = the_ref.kind
10811083
{
1082-
let BindingMode(_, mtblty) = mt;
1084+
let BindingMode(_, _, mtblty) = mt;
10831085
err.span_suggestion_verbose(
10841086
i.span,
10851087
format!("consider removing `&{mutability}` from the pattern"),
@@ -2872,8 +2874,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
28722874
// If the user-provided binding modifier doesn't match the default binding mode, we'll
28732875
// need to suggest reference patterns, which can affect other bindings.
28742876
// For simplicity, we opt to suggest making the pattern fully explicit.
2875-
info.suggest_eliding_modes &=
2876-
user_bind_annot == BindingMode(ByRef::Yes(def_br_mutbl), Mutability::Not);
2877+
info.suggest_eliding_modes &= user_bind_annot
2878+
== BindingMode(ByRef::Yes(def_br_mutbl), Pinnedness::Not, Mutability::Not);
28772879
"binding modifier"
28782880
} else {
28792881
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
@@ -1094,7 +1094,7 @@ impl<'tcx> LocalDecl<'tcx> {
10941094
self.local_info(),
10951095
LocalInfo::User(
10961096
BindingForm::Var(VarBindingForm {
1097-
binding_mode: BindingMode(ByRef::No, _),
1097+
binding_mode: BindingMode(ByRef::No, _, _),
10981098
opt_ty_info: _,
10991099
opt_match_place: _,
11001100
pat_span: _,
@@ -1111,7 +1111,7 @@ impl<'tcx> LocalDecl<'tcx> {
11111111
self.local_info(),
11121112
LocalInfo::User(
11131113
BindingForm::Var(VarBindingForm {
1114-
binding_mode: BindingMode(ByRef::No, _),
1114+
binding_mode: BindingMode(ByRef::No, _, _),
11151115
opt_ty_info: _,
11161116
opt_match_place: _,
11171117
pat_span: _,

compiler/rustc_middle/src/thir.rs

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

compiler/rustc_middle/src/ty/typeck_results.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ impl<'tcx> TypeckResults<'tcx> {
454454
let mut has_ref_mut = false;
455455
pat.walk(|pat| {
456456
if let hir::PatKind::Binding(_, id, _, _) = pat.kind
457-
&& let Some(BindingMode(ByRef::Yes(Mutability::Mut), _)) =
457+
&& let Some(BindingMode(ByRef::Yes(Mutability::Mut), _, _)) =
458458
self.pat_binding_modes().get(id)
459459
{
460460
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
..
@@ -2772,7 +2774,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
27722774
let tcx = self.tcx;
27732775
let debug_source_info = SourceInfo { span: source_info.span, scope: visibility_scope };
27742776
let local = LocalDecl {
2775-
mutability: mode.1,
2777+
mutability: mode.2,
27762778
ty: var_ty,
27772779
user_ty: if user_ty.is_empty() { None } else { Some(Box::new(user_ty)) },
27782780
source_info,

compiler/rustc_mir_build/src/builder/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
953953
// Don't introduce extra copies for simple bindings
954954
PatKind::Binding {
955955
var,
956-
mode: BindingMode(ByRef::No, mutability),
956+
mode: BindingMode(ByRef::No, pin, mutability),
957957
subpattern: None,
958958
..
959959
} => {
@@ -963,7 +963,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
963963
if let Some(kind) = param.self_kind {
964964
LocalInfo::User(BindingForm::ImplicitSelf(kind))
965965
} else {
966-
let binding_mode = BindingMode(ByRef::No, mutability);
966+
let binding_mode = BindingMode(ByRef::No, pin, mutability);
967967
LocalInfo::User(BindingForm::Var(VarBindingForm {
968968
binding_mode,
969969
opt_ty_info: param.ty_span,

compiler/rustc_mir_build/src/check_unsafety.rs

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

0 commit comments

Comments
 (0)