Auto merge of #124650 - oli-obk:pattern_types_syntax, r=nnethercote · rust-lang/rust@7717a30 (original) (raw)

`@@ -876,6 +876,9 @@ pub struct OwnerNodes<'tcx> {

`

876

876

`pub nodes: IndexVec<ItemLocalId, ParentedNode<'tcx>>,

`

877

877

`/// Content of local bodies.

`

878

878

`pub bodies: SortedMap<ItemLocalId, &'tcx Body<'tcx>>,

`

``

879

`+

/// Whether the body contains inline constants that are created for the query system during typeck

`

``

880

`+

/// of the body.

`

``

881

`+

pub has_inline_consts: bool,

`

879

882

`}

`

880

883

``

881

884

`impl<'tcx> OwnerNodes<'tcx> {

`

`@@ -1592,14 +1595,6 @@ pub struct AnonConst {

`

1592

1595

`pub span: Span,

`

1593

1596

`}

`

1594

1597

``

1595

``

`` -

/// An inline constant expression const { something }.

``

1596

``

`-

#[derive(Copy, Clone, Debug, HashStable_Generic)]

`

1597

``

`-

pub struct ConstBlock {

`

1598

``

`-

pub hir_id: HirId,

`

1599

``

`-

pub def_id: LocalDefId,

`

1600

``

`-

pub body: BodyId,

`

1601

``

`-

}

`

1602

``

-

1603

1598

`/// An expression.

`

1604

1599

`#[derive(Debug, Clone, Copy, HashStable_Generic)]

`

1605

1600

`pub struct Expr<'hir> {

`

`@@ -1886,7 +1881,7 @@ pub fn is_range_literal(expr: &Expr<'_>) -> bool {

`

1886

1881

`#[derive(Debug, Clone, Copy, HashStable_Generic)]

`

1887

1882

`pub enum ExprKind<'hir> {

`

1888

1883

`` /// Allow anonymous constants from an inline const block

``

1889

``

`-

ConstBlock(ConstBlock),

`

``

1884

`+

ConstBlock(&'hir Expr<'hir>),

`

1890

1885

`` /// An array (e.g., [a, b, c, d]).

``

1891

1886

`Array(&'hir [Expr<'hir>]),

`

1892

1887

`/// A function call.

`

`@@ -3609,7 +3604,6 @@ pub enum Node<'hir> {

`

3609

3604

`Variant(&'hir Variant<'hir>),

`

3610

3605

`Field(&'hir FieldDef<'hir>),

`

3611

3606

`AnonConst(&'hir AnonConst),

`

3612

``

`-

ConstBlock(&'hir ConstBlock),

`

3613

3607

`Expr(&'hir Expr<'hir>),

`

3614

3608

`ExprField(&'hir ExprField<'hir>),

`

3615

3609

`Stmt(&'hir Stmt<'hir>),

`

`@@ -3670,7 +3664,6 @@ impl<'hir> Node<'hir> {

`

3670

3664

`Node::PreciseCapturingNonLifetimeArg(a) => Some(a.ident),

`

3671

3665

`Node::Param(..)

`

3672

3666

` | Node::AnonConst(..)

`

3673

``

`-

| Node::ConstBlock(..)

`

3674

3667

` | Node::Expr(..)

`

3675

3668

` | Node::Stmt(..)

`

3676

3669

` | Node::Block(..)

`

`@@ -3768,7 +3761,6 @@ impl<'hir> Node<'hir> {

`

3768

3761

`}

`

3769

3762

``

3770

3763

`Node::AnonConst(constant) => Some((constant.def_id, constant.body)),

`

3771

``

`-

Node::ConstBlock(constant) => Some((constant.def_id, constant.body)),

`

3772

3764

``

3773

3765

` _ => None,

`

3774

3766

`}

`

`@@ -3837,7 +3829,6 @@ impl<'hir> Node<'hir> {

`

3837

3829

` expect_variant, &'hir Variant<'hir>, Node::Variant(n), n;

`

3838

3830

` expect_field, &'hir FieldDef<'hir>, Node::Field(n), n;

`

3839

3831

` expect_anon_const, &'hir AnonConst, Node::AnonConst(n), n;

`

3840

``

`-

expect_inline_const, &'hir ConstBlock, Node::ConstBlock(n), n;

`

3841

3832

` expect_expr, &'hir Expr<'hir>, Node::Expr(n), n;

`

3842

3833

` expect_expr_field, &'hir ExprField<'hir>, Node::ExprField(n), n;

`

3843

3834

` expect_stmt, &'hir Stmt<'hir>, Node::Stmt(n), n;

`