mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
Check for both StmtKind::MacCall
and ExprKind::MacCall
This commit is contained in:
parent
096277e989
commit
1d6e847674
@ -1194,7 +1194,7 @@ impl Expr {
|
|||||||
///
|
///
|
||||||
/// Does not ensure that the path resolves to a const param, the caller should check this.
|
/// Does not ensure that the path resolves to a const param, the caller should check this.
|
||||||
pub fn is_potential_trivial_const_arg(&self, strip_identity_block: bool) -> bool {
|
pub fn is_potential_trivial_const_arg(&self, strip_identity_block: bool) -> bool {
|
||||||
let this = if strip_identity_block { self.maybe_unwrap_block().1 } else { self };
|
let this = if strip_identity_block { self.maybe_unwrap_block() } else { self };
|
||||||
|
|
||||||
if let ExprKind::Path(None, path) = &this.kind
|
if let ExprKind::Path(None, path) = &this.kind
|
||||||
&& path.is_potential_trivial_const_arg()
|
&& path.is_potential_trivial_const_arg()
|
||||||
@ -1206,14 +1206,41 @@ impl Expr {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Returns an expression with (when possible) *one* outter brace removed
|
/// Returns an expression with (when possible) *one* outter brace removed
|
||||||
pub fn maybe_unwrap_block(&self) -> (bool, &Expr) {
|
pub fn maybe_unwrap_block(&self) -> &Expr {
|
||||||
if let ExprKind::Block(block, None) = &self.kind
|
if let ExprKind::Block(block, None) = &self.kind
|
||||||
&& let [stmt] = block.stmts.as_slice()
|
&& let [stmt] = block.stmts.as_slice()
|
||||||
&& let StmtKind::Expr(expr) = &stmt.kind
|
&& let StmtKind::Expr(expr) = &stmt.kind
|
||||||
{
|
{
|
||||||
(true, expr)
|
expr
|
||||||
} else {
|
} else {
|
||||||
(false, self)
|
self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Determines whether this expression is a macro call optionally wrapped in braces . If
|
||||||
|
/// `already_stripped_block` is set then we do not attempt to peel off a layer of braces.
|
||||||
|
///
|
||||||
|
/// Returns the [`NodeId`] of the macro call and whether a layer of braces has been peeled
|
||||||
|
/// either before, or part of, this function.
|
||||||
|
pub fn optionally_braced_mac_call(
|
||||||
|
&self,
|
||||||
|
already_stripped_block: bool,
|
||||||
|
) -> Option<(bool, NodeId)> {
|
||||||
|
match &self.kind {
|
||||||
|
ExprKind::Block(block, None)
|
||||||
|
if let [stmt] = &*block.stmts
|
||||||
|
&& !already_stripped_block =>
|
||||||
|
{
|
||||||
|
match &stmt.kind {
|
||||||
|
StmtKind::MacCall(_) => Some((true, stmt.id)),
|
||||||
|
StmtKind::Expr(expr) if let ExprKind::MacCall(_) = &expr.kind => {
|
||||||
|
Some((true, expr.id))
|
||||||
|
}
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ExprKind::MacCall(_) => Some((already_stripped_block, self.id)),
|
||||||
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -130,18 +130,16 @@ impl<'a, 'ra, 'tcx> DefCollector<'a, 'ra, 'tcx> {
|
|||||||
&self,
|
&self,
|
||||||
anon_const: &'a AnonConst,
|
anon_const: &'a AnonConst,
|
||||||
) -> Option<(PendingAnonConstInfo, NodeId)> {
|
) -> Option<(PendingAnonConstInfo, NodeId)> {
|
||||||
let (block_was_stripped, expr) = anon_const.value.maybe_unwrap_block();
|
anon_const.value.optionally_braced_mac_call(false).map(|(block_was_stripped, id)| {
|
||||||
match expr {
|
(
|
||||||
Expr { kind: ExprKind::MacCall(..), id, .. } => Some((
|
|
||||||
PendingAnonConstInfo {
|
PendingAnonConstInfo {
|
||||||
id: anon_const.id,
|
id: anon_const.id,
|
||||||
span: anon_const.value.span,
|
span: anon_const.value.span,
|
||||||
block_was_stripped,
|
block_was_stripped,
|
||||||
},
|
},
|
||||||
*id,
|
id,
|
||||||
)),
|
)
|
||||||
_ => None,
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Determines whether the expression `const_arg_sub_expr` is a simple macro call, sometimes
|
/// Determines whether the expression `const_arg_sub_expr` is a simple macro call, sometimes
|
||||||
@ -161,18 +159,11 @@ impl<'a, 'ra, 'tcx> DefCollector<'a, 'ra, 'tcx> {
|
|||||||
panic!("Checking expr is trivial macro call without having entered anon const: `{const_arg_sub_expr:?}`"),
|
panic!("Checking expr is trivial macro call without having entered anon const: `{const_arg_sub_expr:?}`"),
|
||||||
);
|
);
|
||||||
|
|
||||||
let (block_was_stripped, expr) = if pending_anon.block_was_stripped {
|
const_arg_sub_expr.optionally_braced_mac_call(pending_anon.block_was_stripped).map(
|
||||||
(true, const_arg_sub_expr)
|
|(block_was_stripped, id)| {
|
||||||
} else {
|
(PendingAnonConstInfo { block_was_stripped, ..pending_anon }, id)
|
||||||
const_arg_sub_expr.maybe_unwrap_block()
|
},
|
||||||
};
|
)
|
||||||
|
|
||||||
match expr {
|
|
||||||
Expr { kind: ExprKind::MacCall(..), id, .. } => {
|
|
||||||
Some((PendingAnonConstInfo { block_was_stripped, ..pending_anon }, *id))
|
|
||||||
}
|
|
||||||
_ => None,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
//@ known-bug: #131915
|
|
||||||
|
|
||||||
macro_rules! y {
|
|
||||||
( $($matcher:tt)*) => {
|
|
||||||
x
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
const _: A<
|
|
||||||
{
|
|
||||||
y! { test.tou8 }
|
|
||||||
},
|
|
||||||
>;
|
|
@ -0,0 +1,20 @@
|
|||||||
|
// Regression test for #131915 where we did not handle macro calls as
|
||||||
|
// statements correctly when determining if a const argument should
|
||||||
|
// have a `DefId` created or not.
|
||||||
|
|
||||||
|
macro_rules! y {
|
||||||
|
( $($matcher:tt)*) => {
|
||||||
|
x
|
||||||
|
//~^ ERROR: cannot find value `x` in this scope
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
const _: A<
|
||||||
|
//~^ ERROR: free constant item without body
|
||||||
|
//~| ERROR: cannot find type `A` in this scope
|
||||||
|
{
|
||||||
|
y! { test.tou8 }
|
||||||
|
},
|
||||||
|
>;
|
||||||
|
|
||||||
|
fn main() {}
|
@ -0,0 +1,39 @@
|
|||||||
|
error: free constant item without body
|
||||||
|
--> $DIR/const_arg_trivial_macro_expansion-2.rs:12:1
|
||||||
|
|
|
||||||
|
LL | / const _: A<
|
||||||
|
LL | |
|
||||||
|
LL | |
|
||||||
|
LL | | {
|
||||||
|
LL | | y! { test.tou8 }
|
||||||
|
LL | | },
|
||||||
|
LL | | >;
|
||||||
|
| | ^ help: provide a definition for the constant: `= <expr>;`
|
||||||
|
| |__|
|
||||||
|
|
|
||||||
|
|
||||||
|
error[E0412]: cannot find type `A` in this scope
|
||||||
|
--> $DIR/const_arg_trivial_macro_expansion-2.rs:12:10
|
||||||
|
|
|
||||||
|
LL | const _: A<
|
||||||
|
| ^ not found in this scope
|
||||||
|
|
||||||
|
error[E0425]: cannot find value `x` in this scope
|
||||||
|
--> $DIR/const_arg_trivial_macro_expansion-2.rs:7:9
|
||||||
|
|
|
||||||
|
LL | x
|
||||||
|
| ^ not found in this scope
|
||||||
|
...
|
||||||
|
LL | y! { test.tou8 }
|
||||||
|
| ---------------- in this macro invocation
|
||||||
|
|
|
||||||
|
= note: this error originates in the macro `y` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
help: you might be missing a const parameter
|
||||||
|
|
|
||||||
|
LL | const _<const x: /* Type */>: A<
|
||||||
|
| +++++++++++++++++++++
|
||||||
|
|
||||||
|
error: aborting due to 3 previous errors
|
||||||
|
|
||||||
|
Some errors have detailed explanations: E0412, E0425.
|
||||||
|
For more information about an error, try `rustc --explain E0412`.
|
@ -0,0 +1,366 @@
|
|||||||
|
//@ known-bug: #132647
|
||||||
|
//@ dont-check-compiler-stderr
|
||||||
|
#![allow(unused_braces)]
|
||||||
|
|
||||||
|
// FIXME(bootstrap): This isn't a known bug, we just don't want to write any error annotations.
|
||||||
|
// this is hard because macro expansion errors have their span be inside the *definition* of the
|
||||||
|
// macro rather than the line *invoking* it. This means we would wind up with hundreds of error
|
||||||
|
// annotations on the macro definitions below rather than on any of the actual lines
|
||||||
|
// that act as a "test".
|
||||||
|
//
|
||||||
|
// It's also made more complicated by the fact that compiletest generates "extra" expected
|
||||||
|
// notes to give an assertable macro backtrace as otherwise there would *nothing* to annotate
|
||||||
|
// on the actual test lines. All of these extra notes result in needing to write hundreds of
|
||||||
|
// unnecessary notes on almost every line in this file.
|
||||||
|
//
|
||||||
|
// Even though this is marked `known-bug` it should still fail if this test starts ICEing which
|
||||||
|
// is "enough" in this case.
|
||||||
|
|
||||||
|
// Test that we correctly create definitions for anon consts even when
|
||||||
|
// the trivial-ness of the expression is obscured by macro expansions.
|
||||||
|
//
|
||||||
|
// Acts as a regression test for: #131915 130321 128016
|
||||||
|
|
||||||
|
// macros expanding to idents
|
||||||
|
|
||||||
|
macro_rules! unbraced_ident {
|
||||||
|
() => {
|
||||||
|
ident
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
macro_rules! braced_ident {
|
||||||
|
() => {{ ident }};
|
||||||
|
}
|
||||||
|
|
||||||
|
macro_rules! unbraced_unbraced_ident {
|
||||||
|
() => {
|
||||||
|
unbraced_ident!()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
macro_rules! braced_unbraced_ident {
|
||||||
|
() => {{ unbraced_ident!() }};
|
||||||
|
}
|
||||||
|
|
||||||
|
macro_rules! unbraced_braced_ident {
|
||||||
|
() => {
|
||||||
|
braced_ident!()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
macro_rules! braced_braced_ident {
|
||||||
|
() => {{ braced_ident!() }};
|
||||||
|
}
|
||||||
|
|
||||||
|
// macros expanding to complex expr
|
||||||
|
|
||||||
|
macro_rules! unbraced_expr {
|
||||||
|
() => {
|
||||||
|
ident.other
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
macro_rules! braced_expr {
|
||||||
|
() => {{ ident.otherent }};
|
||||||
|
}
|
||||||
|
|
||||||
|
macro_rules! unbraced_unbraced_expr {
|
||||||
|
() => {
|
||||||
|
unbraced_expr!()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
macro_rules! braced_unbraced_expr {
|
||||||
|
() => {{ unbraced_expr!() }};
|
||||||
|
}
|
||||||
|
|
||||||
|
macro_rules! unbraced_braced_expr {
|
||||||
|
() => {
|
||||||
|
braced_expr!()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
macro_rules! braced_braced_expr {
|
||||||
|
() => {{ braced_expr!() }};
|
||||||
|
}
|
||||||
|
|
||||||
|
#[rustfmt::skip]
|
||||||
|
mod array_paren_call {
|
||||||
|
// Arrays where the expanded result is a `Res::Err`
|
||||||
|
fn array_0() -> [(); unbraced_unbraced_ident!()] { loop {} }
|
||||||
|
fn array_1() -> [(); braced_unbraced_ident!()] { loop {} }
|
||||||
|
fn array_2() -> [(); unbraced_braced_ident!()] { loop {} }
|
||||||
|
fn array_3() -> [(); braced_braced_ident!()] { loop {} }
|
||||||
|
fn array_4() -> [(); { unbraced_unbraced_ident!() }] { loop {} }
|
||||||
|
fn array_5() -> [(); { braced_unbraced_ident!() }] { loop {} }
|
||||||
|
fn array_6() -> [(); { unbraced_braced_ident!() }] { loop {} }
|
||||||
|
fn array_7() -> [(); { braced_braced_ident!() }] { loop {} }
|
||||||
|
fn array_8() -> [(); unbraced_ident!()] { loop {} }
|
||||||
|
fn array_9() -> [(); braced_ident!()] { loop {} }
|
||||||
|
fn array_10() -> [(); { unbraced_ident!() }] { loop {} }
|
||||||
|
fn array_11() -> [(); { braced_ident!() }] { loop {} }
|
||||||
|
|
||||||
|
// Arrays where the expanded result is a `Res::ConstParam`
|
||||||
|
fn array_12<const ident: usize>() -> [(); unbraced_unbraced_ident!()] { loop {} }
|
||||||
|
fn array_13<const ident: usize>() -> [(); braced_unbraced_ident!()] { loop {} }
|
||||||
|
fn array_14<const ident: usize>() -> [(); unbraced_braced_ident!()] { loop {} }
|
||||||
|
fn array_15<const ident: usize>() -> [(); braced_braced_ident!()] { loop {} }
|
||||||
|
fn array_16<const ident: usize>() -> [(); { unbraced_unbraced_ident!() }] { loop {} }
|
||||||
|
fn array_17<const ident: usize>() -> [(); { braced_unbraced_ident!() }] { loop {} }
|
||||||
|
fn array_18<const ident: usize>() -> [(); { unbraced_braced_ident!() }] { loop {} }
|
||||||
|
fn array_19<const ident: usize>() -> [(); { braced_braced_ident!() }] { loop {} }
|
||||||
|
fn array_20<const ident: usize>() -> [(); unbraced_ident!()] { loop {} }
|
||||||
|
fn array_21<const ident: usize>() -> [(); braced_ident!()] { loop {} }
|
||||||
|
fn array_22<const ident: usize>() -> [(); { unbraced_ident!() }] { loop {} }
|
||||||
|
fn array_23<const ident: usize>() -> [(); { braced_ident!() }] { loop {} }
|
||||||
|
|
||||||
|
// Arrays where the expanded result is a complex expr
|
||||||
|
fn array_24() -> [(); unbraced_unbraced_expr!()] { loop {} }
|
||||||
|
fn array_25() -> [(); braced_unbraced_expr!()] { loop {} }
|
||||||
|
fn array_26() -> [(); unbraced_braced_expr!()] { loop {} }
|
||||||
|
fn array_27() -> [(); braced_braced_expr!()] { loop {} }
|
||||||
|
fn array_28() -> [(); { unbraced_unbraced_expr!() }] { loop {} }
|
||||||
|
fn array_29() -> [(); { braced_unbraced_expr!() }] { loop {} }
|
||||||
|
fn array_30() -> [(); { unbraced_braced_expr!() }] { loop {} }
|
||||||
|
fn array_31() -> [(); { braced_braced_expr!() }] { loop {} }
|
||||||
|
fn array_32() -> [(); unbraced_expr!()] { loop {} }
|
||||||
|
fn array_33() -> [(); braced_expr!()] { loop {} }
|
||||||
|
fn array_34() -> [(); { unbraced_expr!() }] { loop {} }
|
||||||
|
fn array_35() -> [(); { braced_expr!() }] { loop {} }
|
||||||
|
}
|
||||||
|
|
||||||
|
#[rustfmt::skip]
|
||||||
|
mod array_brace_call {
|
||||||
|
// Arrays where the expanded result is a `Res::Err`
|
||||||
|
fn array_0() -> [(); unbraced_unbraced_ident!{}] { loop {} }
|
||||||
|
fn array_1() -> [(); braced_unbraced_ident!{}] { loop {} }
|
||||||
|
fn array_2() -> [(); unbraced_braced_ident!{}] { loop {} }
|
||||||
|
fn array_3() -> [(); braced_braced_ident!{}] { loop {} }
|
||||||
|
fn array_4() -> [(); { unbraced_unbraced_ident!{} }] { loop {} }
|
||||||
|
fn array_5() -> [(); { braced_unbraced_ident!{} }] { loop {} }
|
||||||
|
fn array_6() -> [(); { unbraced_braced_ident!{} }] { loop {} }
|
||||||
|
fn array_7() -> [(); { braced_braced_ident!{} }] { loop {} }
|
||||||
|
fn array_8() -> [(); unbraced_ident!{}] { loop {} }
|
||||||
|
fn array_9() -> [(); braced_ident!{}] { loop {} }
|
||||||
|
fn array_10() -> [(); { unbraced_ident!{} }] { loop {} }
|
||||||
|
fn array_11() -> [(); { braced_ident!{} }] { loop {} }
|
||||||
|
|
||||||
|
// Arrays where the expanded result is a `Res::ConstParam`
|
||||||
|
fn array_12<const ident: usize>() -> [(); unbraced_unbraced_ident!{}] { loop {} }
|
||||||
|
fn array_13<const ident: usize>() -> [(); braced_unbraced_ident!{}] { loop {} }
|
||||||
|
fn array_14<const ident: usize>() -> [(); unbraced_braced_ident!{}] { loop {} }
|
||||||
|
fn array_15<const ident: usize>() -> [(); braced_braced_ident!{}] { loop {} }
|
||||||
|
fn array_16<const ident: usize>() -> [(); { unbraced_unbraced_ident!{} }] { loop {} }
|
||||||
|
fn array_17<const ident: usize>() -> [(); { braced_unbraced_ident!{} }] { loop {} }
|
||||||
|
fn array_18<const ident: usize>() -> [(); { unbraced_braced_ident!{} }] { loop {} }
|
||||||
|
fn array_19<const ident: usize>() -> [(); { braced_braced_ident!{} }] { loop {} }
|
||||||
|
fn array_20<const ident: usize>() -> [(); unbraced_ident!{}] { loop {} }
|
||||||
|
fn array_21<const ident: usize>() -> [(); braced_ident!{}] { loop {} }
|
||||||
|
fn array_22<const ident: usize>() -> [(); { unbraced_ident!{} }] { loop {} }
|
||||||
|
fn array_23<const ident: usize>() -> [(); { braced_ident!{} }] { loop {} }
|
||||||
|
|
||||||
|
// Arrays where the expanded result is a complex expr
|
||||||
|
fn array_24() -> [(); unbraced_unbraced_expr!{}] { loop {} }
|
||||||
|
fn array_25() -> [(); braced_unbraced_expr!{}] { loop {} }
|
||||||
|
fn array_26() -> [(); unbraced_braced_expr!{}] { loop {} }
|
||||||
|
fn array_27() -> [(); braced_braced_expr!{}] { loop {} }
|
||||||
|
fn array_28() -> [(); { unbraced_unbraced_expr!{} }] { loop {} }
|
||||||
|
fn array_29() -> [(); { braced_unbraced_expr!{} }] { loop {} }
|
||||||
|
fn array_30() -> [(); { unbraced_braced_expr!{} }] { loop {} }
|
||||||
|
fn array_31() -> [(); { braced_braced_expr!{} }] { loop {} }
|
||||||
|
fn array_32() -> [(); unbraced_expr!{}] { loop {} }
|
||||||
|
fn array_33() -> [(); braced_expr!{}] { loop {} }
|
||||||
|
fn array_34() -> [(); { unbraced_expr!{} }] { loop {} }
|
||||||
|
fn array_35() -> [(); { braced_expr!{} }] { loop {} }
|
||||||
|
}
|
||||||
|
|
||||||
|
#[rustfmt::skip]
|
||||||
|
mod array_square_call {
|
||||||
|
// Arrays where the expanded result is a `Res::Err`
|
||||||
|
fn array_0() -> [(); unbraced_unbraced_ident![]] { loop {} }
|
||||||
|
fn array_1() -> [(); braced_unbraced_ident![]] { loop {} }
|
||||||
|
fn array_2() -> [(); unbraced_braced_ident![]] { loop {} }
|
||||||
|
fn array_3() -> [(); braced_braced_ident![]] { loop {} }
|
||||||
|
fn array_4() -> [(); { unbraced_unbraced_ident![] }] { loop {} }
|
||||||
|
fn array_5() -> [(); { braced_unbraced_ident![] }] { loop {} }
|
||||||
|
fn array_6() -> [(); { unbraced_braced_ident![] }] { loop {} }
|
||||||
|
fn array_7() -> [(); { braced_braced_ident![] }] { loop {} }
|
||||||
|
fn array_8() -> [(); unbraced_ident![]] { loop {} }
|
||||||
|
fn array_9() -> [(); braced_ident![]] { loop {} }
|
||||||
|
fn array_10() -> [(); { unbraced_ident![] }] { loop {} }
|
||||||
|
fn array_11() -> [(); { braced_ident![] }] { loop {} }
|
||||||
|
|
||||||
|
// Arrays where the expanded result is a `Res::ConstParam`
|
||||||
|
fn array_12<const ident: usize>() -> [(); unbraced_unbraced_ident![]] { loop {} }
|
||||||
|
fn array_13<const ident: usize>() -> [(); braced_unbraced_ident![]] { loop {} }
|
||||||
|
fn array_14<const ident: usize>() -> [(); unbraced_braced_ident![]] { loop {} }
|
||||||
|
fn array_15<const ident: usize>() -> [(); braced_braced_ident![]] { loop {} }
|
||||||
|
fn array_16<const ident: usize>() -> [(); { unbraced_unbraced_ident![] }] { loop {} }
|
||||||
|
fn array_17<const ident: usize>() -> [(); { braced_unbraced_ident![] }] { loop {} }
|
||||||
|
fn array_18<const ident: usize>() -> [(); { unbraced_braced_ident![] }] { loop {} }
|
||||||
|
fn array_19<const ident: usize>() -> [(); { braced_braced_ident![] }] { loop {} }
|
||||||
|
fn array_20<const ident: usize>() -> [(); unbraced_ident![]] { loop {} }
|
||||||
|
fn array_21<const ident: usize>() -> [(); braced_ident![]] { loop {} }
|
||||||
|
fn array_22<const ident: usize>() -> [(); { unbraced_ident![] }] { loop {} }
|
||||||
|
fn array_23<const ident: usize>() -> [(); { braced_ident![] }] { loop {} }
|
||||||
|
|
||||||
|
// Arrays where the expanded result is a complex expr
|
||||||
|
fn array_24() -> [(); unbraced_unbraced_expr![]] { loop {} }
|
||||||
|
fn array_25() -> [(); braced_unbraced_expr![]] { loop {} }
|
||||||
|
fn array_26() -> [(); unbraced_braced_expr![]] { loop {} }
|
||||||
|
fn array_27() -> [(); braced_braced_expr![]] { loop {} }
|
||||||
|
fn array_28() -> [(); { unbraced_unbraced_expr![] }] { loop {} }
|
||||||
|
fn array_29() -> [(); { braced_unbraced_expr![] }] { loop {} }
|
||||||
|
fn array_30() -> [(); { unbraced_braced_expr![] }] { loop {} }
|
||||||
|
fn array_31() -> [(); { braced_braced_expr![] }] { loop {} }
|
||||||
|
fn array_32() -> [(); unbraced_expr![]] { loop {} }
|
||||||
|
fn array_33() -> [(); braced_expr![]] { loop {} }
|
||||||
|
fn array_34() -> [(); { unbraced_expr![] }] { loop {} }
|
||||||
|
fn array_35() -> [(); { braced_expr![] }] { loop {} }
|
||||||
|
}
|
||||||
|
|
||||||
|
struct Foo<const N: usize>;
|
||||||
|
|
||||||
|
#[rustfmt::skip]
|
||||||
|
mod adt_paren_call {
|
||||||
|
use super::Foo;
|
||||||
|
|
||||||
|
// An ADT where the expanded result is a `Res::Err`
|
||||||
|
fn adt_0() -> Foo<unbraced_unbraced_ident!()> { loop {} }
|
||||||
|
fn adt_1() -> Foo<braced_unbraced_ident!()> { loop {} }
|
||||||
|
fn adt_2() -> Foo<unbraced_braced_ident!()> { loop {} }
|
||||||
|
fn adt_3() -> Foo<braced_braced_ident!()> { loop {} }
|
||||||
|
fn adt_4() -> Foo<{ unbraced_unbraced_ident!() }> { loop {} }
|
||||||
|
fn adt_5() -> Foo<{ braced_unbraced_ident!() }> { loop {} }
|
||||||
|
fn adt_6() -> Foo<{ unbraced_braced_ident!() }> { loop {} }
|
||||||
|
fn adt_7() -> Foo<{ braced_braced_ident!() }> { loop {} }
|
||||||
|
fn adt_8() -> Foo<unbraced_ident!()> { loop {} }
|
||||||
|
fn adt_9() -> Foo<braced_ident!()> { loop {} }
|
||||||
|
fn adt_10() -> Foo<{ unbraced_ident!() }> { loop {} }
|
||||||
|
fn adt_11() -> Foo<{ braced_ident!() }> { loop {} }
|
||||||
|
|
||||||
|
// An ADT where the expanded result is a `Res::ConstParam`
|
||||||
|
fn adt_12<const ident: usize>() -> Foo<unbraced_unbraced_ident!()> { loop {} }
|
||||||
|
fn adt_13<const ident: usize>() -> Foo<braced_unbraced_ident!()> { loop {} }
|
||||||
|
fn adt_14<const ident: usize>() -> Foo<unbraced_braced_ident!()> { loop {} }
|
||||||
|
fn adt_15<const ident: usize>() -> Foo<braced_braced_ident!()> { loop {} }
|
||||||
|
fn adt_16<const ident: usize>() -> Foo<{ unbraced_unbraced_ident!() }> { loop {} }
|
||||||
|
fn adt_17<const ident: usize>() -> Foo<{ braced_unbraced_ident!() }> { loop {} }
|
||||||
|
fn adt_18<const ident: usize>() -> Foo<{ unbraced_braced_ident!() }> { loop {} }
|
||||||
|
fn adt_19<const ident: usize>() -> Foo<{ braced_braced_ident!() }> { loop {} }
|
||||||
|
fn adt_20<const ident: usize>() -> Foo<unbraced_ident!()> { loop {} }
|
||||||
|
fn adt_21<const ident: usize>() -> Foo<braced_ident!()> { loop {} }
|
||||||
|
fn adt_22<const ident: usize>() -> Foo<{ unbraced_ident!() }> { loop {} }
|
||||||
|
fn adt_23<const ident: usize>() -> Foo<{ braced_ident!() }> { loop {} }
|
||||||
|
|
||||||
|
// An ADT where the expanded result is a complex expr
|
||||||
|
fn array_24() -> Foo<unbraced_unbraced_expr!()> { loop {} }
|
||||||
|
fn array_25() -> Foo<braced_unbraced_expr!()> { loop {} }
|
||||||
|
fn array_26() -> Foo<unbraced_braced_expr!()> { loop {} }
|
||||||
|
fn array_27() -> Foo<braced_braced_expr!()> { loop {} }
|
||||||
|
fn array_28() -> Foo<{ unbraced_unbraced_expr!() }> { loop {} }
|
||||||
|
fn array_29() -> Foo<{ braced_unbraced_expr!() }> { loop {} }
|
||||||
|
fn array_30() -> Foo<{ unbraced_braced_expr!() }> { loop {} }
|
||||||
|
fn array_31() -> Foo<{ braced_braced_expr!() }> { loop {} }
|
||||||
|
fn array_32() -> Foo<unbraced_expr!()> { loop {} }
|
||||||
|
fn array_33() -> Foo<braced_expr!()> { loop {} }
|
||||||
|
fn array_34() -> Foo<{ unbraced_expr!() }> { loop {} }
|
||||||
|
fn array_35() -> Foo<{ braced_expr!() }> { loop {} }
|
||||||
|
}
|
||||||
|
|
||||||
|
#[rustfmt::skip]
|
||||||
|
mod adt_brace_call {
|
||||||
|
use super::Foo;
|
||||||
|
|
||||||
|
// An ADT where the expanded result is a `Res::Err`
|
||||||
|
fn adt_0() -> Foo<unbraced_unbraced_ident!{}> { loop {} }
|
||||||
|
fn adt_1() -> Foo<braced_unbraced_ident!{}> { loop {} }
|
||||||
|
fn adt_2() -> Foo<unbraced_braced_ident!{}> { loop {} }
|
||||||
|
fn adt_3() -> Foo<braced_braced_ident!{}> { loop {} }
|
||||||
|
fn adt_4() -> Foo<{ unbraced_unbraced_ident!{} }> { loop {} }
|
||||||
|
fn adt_5() -> Foo<{ braced_unbraced_ident!{} }> { loop {} }
|
||||||
|
fn adt_6() -> Foo<{ unbraced_braced_ident!{} }> { loop {} }
|
||||||
|
fn adt_7() -> Foo<{ braced_braced_ident!{} }> { loop {} }
|
||||||
|
fn adt_8() -> Foo<unbraced_ident!{}> { loop {} }
|
||||||
|
fn adt_9() -> Foo<braced_ident!{}> { loop {} }
|
||||||
|
fn adt_10() -> Foo<{ unbraced_ident!{} }> { loop {} }
|
||||||
|
fn adt_11() -> Foo<{ braced_ident!{} }> { loop {} }
|
||||||
|
|
||||||
|
// An ADT where the expanded result is a `Res::ConstParam`
|
||||||
|
fn adt_12<const ident: usize>() -> Foo<unbraced_unbraced_ident!{}> { loop {} }
|
||||||
|
fn adt_13<const ident: usize>() -> Foo<braced_unbraced_ident!{}> { loop {} }
|
||||||
|
fn adt_14<const ident: usize>() -> Foo<unbraced_braced_ident!{}> { loop {} }
|
||||||
|
fn adt_15<const ident: usize>() -> Foo<braced_braced_ident!{}> { loop {} }
|
||||||
|
fn adt_16<const ident: usize>() -> Foo<{ unbraced_unbraced_ident!{} }> { loop {} }
|
||||||
|
fn adt_17<const ident: usize>() -> Foo<{ braced_unbraced_ident!{} }> { loop {} }
|
||||||
|
fn adt_18<const ident: usize>() -> Foo<{ unbraced_braced_ident!{} }> { loop {} }
|
||||||
|
fn adt_19<const ident: usize>() -> Foo<{ braced_braced_ident!{} }> { loop {} }
|
||||||
|
fn adt_20<const ident: usize>() -> Foo<unbraced_ident!{}> { loop {} }
|
||||||
|
fn adt_21<const ident: usize>() -> Foo<braced_ident!{}> { loop {} }
|
||||||
|
fn adt_22<const ident: usize>() -> Foo<{ unbraced_ident!{} }> { loop {} }
|
||||||
|
fn adt_23<const ident: usize>() -> Foo<{ braced_ident!{} }> { loop {} }
|
||||||
|
|
||||||
|
// An ADT where the expanded result is a complex expr
|
||||||
|
fn array_24() -> Foo<unbraced_unbraced_expr!{}> { loop {} }
|
||||||
|
fn array_25() -> Foo<braced_unbraced_expr!{}> { loop {} }
|
||||||
|
fn array_26() -> Foo<unbraced_braced_expr!{}> { loop {} }
|
||||||
|
fn array_27() -> Foo<braced_braced_expr!{}> { loop {} }
|
||||||
|
fn array_28() -> Foo<{ unbraced_unbraced_expr!{} }> { loop {} }
|
||||||
|
fn array_29() -> Foo<{ braced_unbraced_expr!{} }> { loop {} }
|
||||||
|
fn array_30() -> Foo<{ unbraced_braced_expr!{} }> { loop {} }
|
||||||
|
fn array_31() -> Foo<{ braced_braced_expr!{} }> { loop {} }
|
||||||
|
fn array_32() -> Foo<unbraced_expr!{}> { loop {} }
|
||||||
|
fn array_33() -> Foo<braced_expr!{}> { loop {} }
|
||||||
|
fn array_34() -> Foo<{ unbraced_expr!{} }> { loop {} }
|
||||||
|
fn array_35() -> Foo<{ braced_expr!{} }> { loop {} }
|
||||||
|
}
|
||||||
|
|
||||||
|
#[rustfmt::skip]
|
||||||
|
mod adt_square_call {
|
||||||
|
use super::Foo;
|
||||||
|
|
||||||
|
// An ADT where the expanded result is a `Res::Err`
|
||||||
|
fn adt_0() -> Foo<unbraced_unbraced_ident![]> { loop {} }
|
||||||
|
fn adt_1() -> Foo<braced_unbraced_ident![]> { loop {} }
|
||||||
|
fn adt_2() -> Foo<unbraced_braced_ident![]> { loop {} }
|
||||||
|
fn adt_3() -> Foo<braced_braced_ident![]> { loop {} }
|
||||||
|
fn adt_4() -> Foo<{ unbraced_unbraced_ident![] }> { loop {} }
|
||||||
|
fn adt_5() -> Foo<{ braced_unbraced_ident![] }> { loop {} }
|
||||||
|
fn adt_6() -> Foo<{ unbraced_braced_ident![] }> { loop {} }
|
||||||
|
fn adt_7() -> Foo<{ braced_braced_ident![] }> { loop {} }
|
||||||
|
fn adt_8() -> Foo<unbraced_ident![]> { loop {} }
|
||||||
|
fn adt_9() -> Foo<braced_ident![]> { loop {} }
|
||||||
|
fn adt_10() -> Foo<{ unbraced_ident![] }> { loop {} }
|
||||||
|
fn adt_11() -> Foo<{ braced_ident![] }> { loop {} }
|
||||||
|
|
||||||
|
// An ADT where the expanded result is a `Res::ConstParam`
|
||||||
|
fn adt_12<const ident: usize>() -> Foo<unbraced_unbraced_ident![]> { loop {} }
|
||||||
|
fn adt_13<const ident: usize>() -> Foo<braced_unbraced_ident![]> { loop {} }
|
||||||
|
fn adt_14<const ident: usize>() -> Foo<unbraced_braced_ident![]> { loop {} }
|
||||||
|
fn adt_15<const ident: usize>() -> Foo<braced_braced_ident![]> { loop {} }
|
||||||
|
fn adt_16<const ident: usize>() -> Foo<{ unbraced_unbraced_ident![] }> { loop {} }
|
||||||
|
fn adt_17<const ident: usize>() -> Foo<{ braced_unbraced_ident![] }> { loop {} }
|
||||||
|
fn adt_18<const ident: usize>() -> Foo<{ unbraced_braced_ident![] }> { loop {} }
|
||||||
|
fn adt_19<const ident: usize>() -> Foo<{ braced_braced_ident![] }> { loop {} }
|
||||||
|
fn adt_20<const ident: usize>() -> Foo<unbraced_ident![]> { loop {} }
|
||||||
|
fn adt_21<const ident: usize>() -> Foo<braced_ident![]> { loop {} }
|
||||||
|
fn adt_22<const ident: usize>() -> Foo<{ unbraced_ident![] }> { loop {} }
|
||||||
|
fn adt_23<const ident: usize>() -> Foo<{ braced_ident![] }> { loop {} }
|
||||||
|
|
||||||
|
// An ADT where the expanded result is a complex expr
|
||||||
|
fn array_24() -> Foo<unbraced_unbraced_expr![]> { loop {} }
|
||||||
|
fn array_25() -> Foo<braced_unbraced_expr![]> { loop {} }
|
||||||
|
fn array_26() -> Foo<unbraced_braced_expr![]> { loop {} }
|
||||||
|
fn array_27() -> Foo<braced_braced_expr![]> { loop {} }
|
||||||
|
fn array_28() -> Foo<{ unbraced_unbraced_expr![] }> { loop {} }
|
||||||
|
fn array_29() -> Foo<{ braced_unbraced_expr![] }> { loop {} }
|
||||||
|
fn array_30() -> Foo<{ unbraced_braced_expr![] }> { loop {} }
|
||||||
|
fn array_31() -> Foo<{ braced_braced_expr![] }> { loop {} }
|
||||||
|
fn array_32() -> Foo<unbraced_expr![]> { loop {} }
|
||||||
|
fn array_33() -> Foo<braced_expr![]> { loop {} }
|
||||||
|
fn array_34() -> Foo<{ unbraced_expr![] }> { loop {} }
|
||||||
|
fn array_35() -> Foo<{ braced_expr![] }> { loop {} }
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
Loading…
Reference in New Issue
Block a user