Bless all pretty printer tests and ui tests
This commit is contained in:
parent
8ac05b9766
commit
402f322940
19 changed files with 210 additions and 234 deletions
|
@ -28,67 +28,67 @@ fn syntax() {
|
|||
let _ = #[attr] (x as Y);
|
||||
let _ =
|
||||
#[attr] while true {
|
||||
#![attr]
|
||||
};
|
||||
#![attr]
|
||||
};
|
||||
let _ =
|
||||
#[attr] while let Some(false) = true {
|
||||
#![attr]
|
||||
};
|
||||
#![attr]
|
||||
};
|
||||
let _ =
|
||||
#[attr] for x in y {
|
||||
#![attr]
|
||||
};
|
||||
#![attr]
|
||||
};
|
||||
let _ =
|
||||
#[attr] loop {
|
||||
#![attr]
|
||||
};
|
||||
#![attr]
|
||||
};
|
||||
let _ =
|
||||
#[attr] match true {
|
||||
#![attr]
|
||||
#[attr]
|
||||
_ => false,
|
||||
};
|
||||
#![attr]
|
||||
#[attr]
|
||||
_ => false,
|
||||
};
|
||||
let _ = #[attr] || #[attr] foo;
|
||||
let _ = #[attr] move || #[attr] foo;
|
||||
let _ =
|
||||
#[attr] ||
|
||||
#[attr] {
|
||||
#![attr]
|
||||
foo
|
||||
};
|
||||
#[attr] {
|
||||
#![attr]
|
||||
foo
|
||||
};
|
||||
let _ =
|
||||
#[attr] move ||
|
||||
#[attr] {
|
||||
#![attr]
|
||||
foo
|
||||
};
|
||||
#[attr] {
|
||||
#![attr]
|
||||
foo
|
||||
};
|
||||
let _ =
|
||||
#[attr] ||
|
||||
{
|
||||
#![attr]
|
||||
foo
|
||||
};
|
||||
{
|
||||
#![attr]
|
||||
foo
|
||||
};
|
||||
let _ =
|
||||
#[attr] move ||
|
||||
{
|
||||
#![attr]
|
||||
foo
|
||||
};
|
||||
{
|
||||
#![attr]
|
||||
foo
|
||||
};
|
||||
let _ =
|
||||
#[attr] {
|
||||
#![attr]
|
||||
};
|
||||
#![attr]
|
||||
};
|
||||
let _ =
|
||||
#[attr] {
|
||||
#![attr]
|
||||
let _ = ();
|
||||
};
|
||||
#![attr]
|
||||
let _ = ();
|
||||
};
|
||||
let _ =
|
||||
#[attr] {
|
||||
#![attr]
|
||||
let _ = ();
|
||||
foo
|
||||
};
|
||||
#![attr]
|
||||
let _ = ();
|
||||
foo
|
||||
};
|
||||
let _ = #[attr] x = y;
|
||||
let _ = #[attr] (x = y);
|
||||
let _ = #[attr] x += y;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
// pp-exact
|
||||
fn f() {} /*
|
||||
The next line should not be indented.
|
||||
The next line should not be indented.
|
||||
|
||||
That one. It shouldn't have been indented.
|
||||
*/
|
||||
That one. It shouldn't have been indented.
|
||||
*/
|
||||
|
|
|
@ -93,9 +93,9 @@ fn main() {
|
|||
// Taken from https://www.unicode.org/Public/UNIDATA/PropList.txt
|
||||
let chars =
|
||||
['\x0A', '\x0B', '\x0C', '\x0D', '\x20', '\u{85}', '\u{A0}',
|
||||
'\u{1680}', '\u{2000}', '\u{2001}', '\u{2002}', '\u{2003}',
|
||||
'\u{2004}', '\u{2005}', '\u{2006}', '\u{2007}', '\u{2008}',
|
||||
'\u{2009}', '\u{200A}', '\u{2028}', '\u{2029}', '\u{202F}',
|
||||
'\u{205F}', '\u{3000}'];
|
||||
'\u{1680}', '\u{2000}', '\u{2001}', '\u{2002}', '\u{2003}',
|
||||
'\u{2004}', '\u{2005}', '\u{2006}', '\u{2007}', '\u{2008}',
|
||||
'\u{2009}', '\u{200A}', '\u{2028}', '\u{2029}', '\u{202F}',
|
||||
'\u{205F}', '\u{3000}'];
|
||||
for c in &chars { let ws = c.is_whitespace(); println!("{} {}", c, ws); }
|
||||
}
|
||||
|
|
|
@ -17,9 +17,9 @@ mac! {
|
|||
|
||||
mac! {
|
||||
a(aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
|
||||
aaaaaaaa aaaaaaaa) a
|
||||
aaaaaaaa aaaaaaaa) a
|
||||
[aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
|
||||
aaaaaaaa aaaaaaaa] a
|
||||
aaaaaaaa aaaaaaaa] a
|
||||
{
|
||||
aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
|
||||
aaaaaaaa aaaaaaaa aaaaaaaa
|
||||
|
@ -27,22 +27,22 @@ mac! {
|
|||
}
|
||||
|
||||
mac!(aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
|
||||
aaaaaaaa aaaaaaaa);
|
||||
aaaaaaaa aaaaaaaa);
|
||||
mac![aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
|
||||
aaaaaaaa aaaaaaaa];
|
||||
aaaaaaaa aaaaaaaa];
|
||||
mac! {
|
||||
aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
|
||||
aaaaaaaa aaaaaaaa
|
||||
}
|
||||
|
||||
#[rustc_dummy(aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
|
||||
aaaaaaaa aaaaaaaa aaaaaaaa)]
|
||||
aaaaaaaa aaaaaaaa aaaaaaaa)]
|
||||
#[rustc_dummy[aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
|
||||
aaaaaaaa aaaaaaaa aaaaaaaa]]
|
||||
aaaaaaaa aaaaaaaa aaaaaaaa]]
|
||||
#[rustc_dummy {
|
||||
aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
|
||||
aaaaaaaa aaaaaaaa
|
||||
}]
|
||||
aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa
|
||||
aaaaaaaa aaaaaaaa
|
||||
}]
|
||||
#[rustc_dummy =
|
||||
"aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa"]
|
||||
"aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa aaaaaaaa"]
|
||||
fn main() {}
|
||||
|
|
|
@ -11,15 +11,15 @@ extern crate std;
|
|||
pub fn foo(_: [i32; (3 as usize)]) ({ } as ())
|
||||
|
||||
pub fn bar() ({
|
||||
const FOO: usize = ((5 as usize) - (4 as usize) as usize);
|
||||
let _: [(); (FOO as usize)] = ([(() as ())] as [(); 1]);
|
||||
const FOO: usize = ((5 as usize) - (4 as usize) as usize);
|
||||
let _: [(); (FOO as usize)] = ([(() as ())] as [(); 1]);
|
||||
|
||||
let _: [(); (1 as usize)] = ([(() as ())] as [(); 1]);
|
||||
let _: [(); (1 as usize)] = ([(() as ())] as [(); 1]);
|
||||
|
||||
let _ =
|
||||
(((&([(1 as i32), (2 as i32), (3 as i32)] as [i32; 3])
|
||||
as &[i32; 3]) as *const _ as *const [i32; 3]) as
|
||||
*const [i32; (3 as usize)] as *const [i32; 3]);
|
||||
let _ =
|
||||
(((&([(1 as i32), (2 as i32), (3 as i32)] as [i32; 3]) as
|
||||
&[i32; 3]) as *const _ as *const [i32; 3]) as
|
||||
*const [i32; (3 as usize)] as *const [i32; 3]);
|
||||
|
||||
|
||||
|
||||
|
@ -29,29 +29,19 @@ pub fn bar() ({
|
|||
|
||||
|
||||
|
||||
({
|
||||
let res =
|
||||
((::alloc::fmt::format as
|
||||
for<'r> fn(Arguments<'r>) -> String {format})(((::core::fmt::Arguments::new_v1
|
||||
as
|
||||
fn(&[&'static str], &[ArgumentV1]) -> Arguments {Arguments::new_v1})((&([("test"
|
||||
as
|
||||
&str)]
|
||||
as
|
||||
[&str; 1])
|
||||
as
|
||||
&[&str; 1]),
|
||||
(&([]
|
||||
as
|
||||
[ArgumentV1; 0])
|
||||
as
|
||||
&[ArgumentV1; 0]))
|
||||
as
|
||||
Arguments))
|
||||
as String);
|
||||
(res as String)
|
||||
} as String);
|
||||
} as ())
|
||||
({
|
||||
let res =
|
||||
((::alloc::fmt::format as
|
||||
for<'r> fn(Arguments<'r>) -> String {format})(((::core::fmt::Arguments::new_v1
|
||||
as
|
||||
fn(&[&'static str], &[ArgumentV1]) -> Arguments {Arguments::new_v1})((&([("test"
|
||||
as &str)] as [&str; 1]) as
|
||||
&[&str; 1]),
|
||||
(&([] as [ArgumentV1; 0]) as &[ArgumentV1; 0])) as
|
||||
Arguments)) as String);
|
||||
(res as String)
|
||||
} as String);
|
||||
} as ())
|
||||
pub type Foo = [i32; (3 as usize)];
|
||||
pub struct Bar {
|
||||
pub x: [i32; (3 as usize)],
|
||||
|
@ -60,19 +50,9 @@ pub struct TupleBar([i32; (4 as usize)]);
|
|||
pub enum Baz { BazVariant([i32; (5 as usize)]), }
|
||||
pub fn id<T>(x: T) -> T ({ (x as T) } as T)
|
||||
pub fn use_id() ({
|
||||
let _ =
|
||||
((id::<[i32; (3 as usize)]> as
|
||||
fn([i32; 3]) -> [i32; 3] {id::<[i32; 3]>})(([(1
|
||||
as
|
||||
i32),
|
||||
(2
|
||||
as
|
||||
i32),
|
||||
(3
|
||||
as
|
||||
i32)]
|
||||
as
|
||||
[i32; 3]))
|
||||
as [i32; 3]);
|
||||
} as ())
|
||||
let _ =
|
||||
((id::<[i32; (3 as usize)]> as
|
||||
fn([i32; 3]) -> [i32; 3] {id::<[i32; 3]>})(([(1 as i32),
|
||||
(2 as i32), (3 as i32)] as [i32; 3])) as [i32; 3]);
|
||||
} as ())
|
||||
fn main() ({ } as ())
|
||||
|
|
|
@ -9,8 +9,8 @@ struct C {
|
|||
#[allow()]
|
||||
const C: C =
|
||||
C{
|
||||
#[cfg(debug_assertions)]
|
||||
field: 0,
|
||||
#[cfg(debug_assertions)]
|
||||
field: 0,
|
||||
|
||||
#[cfg(not(debug_assertions))]
|
||||
field: 1,};
|
||||
#[cfg(not(debug_assertions))]
|
||||
field: 1,};
|
||||
|
|
|
@ -12,8 +12,8 @@ macro_rules! matcher_brackets {
|
|||
|
||||
macro_rules! all_fragments {
|
||||
($b : block, $e : expr, $i : ident, $it : item, $l : lifetime, $lit :
|
||||
literal, $m : meta, $p : pat, $pth : path, $s : stmt, $tt : tt, $ty : ty,
|
||||
$vis : vis) => {} ;
|
||||
literal, $m : meta, $p : pat, $pth : path, $s : stmt, $tt : tt, $ty : ty,
|
||||
$vis : vis) => {} ;
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
|
@ -5,10 +5,10 @@ fn main() {
|
|||
let _y =
|
||||
match x {
|
||||
Some(_) =>
|
||||
["some(_)".to_string(), "not".to_string(), "SO".to_string(),
|
||||
"long".to_string(), "string".to_string()],
|
||||
["some(_)".to_string(), "not".to_string(), "SO".to_string(),
|
||||
"long".to_string(), "string".to_string()],
|
||||
None =>
|
||||
["none".to_string(), "a".to_string(), "a".to_string(),
|
||||
"a".to_string(), "a".to_string()],
|
||||
["none".to_string(), "a".to_string(), "a".to_string(),
|
||||
"a".to_string(), "a".to_string()],
|
||||
};
|
||||
}
|
||||
|
|
|
@ -48,9 +48,9 @@ fn _4() {
|
|||
|
||||
let _ =
|
||||
#[rustc_dummy] match () {
|
||||
#![rustc_dummy]
|
||||
() => (),
|
||||
};
|
||||
#![rustc_dummy]
|
||||
() => (),
|
||||
};
|
||||
}
|
||||
|
||||
fn _5() {
|
||||
|
@ -156,56 +156,56 @@ fn _11() {
|
|||
let _ = #[rustc_dummy] 0 as usize;
|
||||
let _ =
|
||||
#[rustc_dummy] while false {
|
||||
#![rustc_dummy]
|
||||
};
|
||||
#![rustc_dummy]
|
||||
};
|
||||
let _ =
|
||||
#[rustc_dummy] while let None = Some(()) {
|
||||
#![rustc_dummy]
|
||||
};
|
||||
#![rustc_dummy]
|
||||
};
|
||||
let _ =
|
||||
#[rustc_dummy] for _ in 0..0 {
|
||||
#![rustc_dummy]
|
||||
};
|
||||
#![rustc_dummy]
|
||||
};
|
||||
let _ =
|
||||
#[rustc_dummy] loop {
|
||||
#![rustc_dummy]
|
||||
};
|
||||
#![rustc_dummy]
|
||||
};
|
||||
let _ =
|
||||
#[rustc_dummy] match false {
|
||||
#![rustc_dummy]
|
||||
_ => (),
|
||||
};
|
||||
#![rustc_dummy]
|
||||
_ => (),
|
||||
};
|
||||
let _ = #[rustc_dummy] || #[rustc_dummy] ();
|
||||
let _ = #[rustc_dummy] move || #[rustc_dummy] ();
|
||||
let _ =
|
||||
#[rustc_dummy] ||
|
||||
{
|
||||
#![rustc_dummy]
|
||||
#[rustc_dummy]
|
||||
()
|
||||
};
|
||||
{
|
||||
#![rustc_dummy]
|
||||
#[rustc_dummy]
|
||||
()
|
||||
};
|
||||
let _ =
|
||||
#[rustc_dummy] move ||
|
||||
{
|
||||
#![rustc_dummy]
|
||||
#[rustc_dummy]
|
||||
()
|
||||
};
|
||||
{
|
||||
#![rustc_dummy]
|
||||
#[rustc_dummy]
|
||||
()
|
||||
};
|
||||
let _ =
|
||||
#[rustc_dummy] {
|
||||
#![rustc_dummy]
|
||||
};
|
||||
#![rustc_dummy]
|
||||
};
|
||||
let _ =
|
||||
#[rustc_dummy] {
|
||||
#![rustc_dummy]
|
||||
let _ = ();
|
||||
};
|
||||
#![rustc_dummy]
|
||||
let _ = ();
|
||||
};
|
||||
let _ =
|
||||
#[rustc_dummy] {
|
||||
#![rustc_dummy]
|
||||
let _ = ();
|
||||
()
|
||||
};
|
||||
#![rustc_dummy]
|
||||
let _ = ();
|
||||
()
|
||||
};
|
||||
let mut x = 0;
|
||||
let _ = #[rustc_dummy] x = 15;
|
||||
let _ = #[rustc_dummy] x += 15;
|
||||
|
|
|
@ -4,26 +4,26 @@
|
|||
fn main() {
|
||||
let _v1 =
|
||||
[
|
||||
// Comment
|
||||
0,
|
||||
// Comment
|
||||
1,
|
||||
// Comment
|
||||
2];
|
||||
// Comment
|
||||
0,
|
||||
// Comment
|
||||
1,
|
||||
// Comment
|
||||
2];
|
||||
let _v2 =
|
||||
[0, // Comment
|
||||
1, // Comment
|
||||
2]; // Comment
|
||||
1, // Comment
|
||||
2]; // Comment
|
||||
let _v3 =
|
||||
[
|
||||
/* Comment */
|
||||
0,
|
||||
/* Comment */
|
||||
1,
|
||||
/* Comment */
|
||||
2];
|
||||
/* Comment */
|
||||
0,
|
||||
/* Comment */
|
||||
1,
|
||||
/* Comment */
|
||||
2];
|
||||
let _v4 =
|
||||
[0, /* Comment */
|
||||
1, /* Comment */
|
||||
2]; /* Comment */
|
||||
1, /* Comment */
|
||||
2]; /* Comment */
|
||||
}
|
||||
|
|
|
@ -16,11 +16,11 @@ LL | bug!();
|
|||
= note: this error originates in the macro `bug` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: unexpected token: `{
|
||||
let res =
|
||||
::alloc::fmt::format(::core::fmt::Arguments::new_v1(&[""],
|
||||
&[::core::fmt::ArgumentV1::new_display(&"u8")]));
|
||||
res
|
||||
}.as_str()`
|
||||
let res =
|
||||
::alloc::fmt::format(::core::fmt::Arguments::new_v1(&[""],
|
||||
&[::core::fmt::ArgumentV1::new_display(&"u8")]));
|
||||
res
|
||||
}.as_str()`
|
||||
--> $DIR/key-value-expansion.rs:48:23
|
||||
|
|
||||
LL | doc_comment! {format!("{coor}", coor = stringify!($t1)).as_str()}
|
||||
|
|
|
@ -15,4 +15,4 @@ trait Foo<const KIND : bool = true> {}
|
|||
fn foo<const SIZE : usize = 5>() {}
|
||||
|
||||
struct Range<const FROM : usize = 0, const LEN : usize = 0, const TO : usize =
|
||||
FROM>;
|
||||
FROM>;
|
||||
|
|
|
@ -7,13 +7,11 @@ extern crate std;
|
|||
// check-pass
|
||||
|
||||
pub fn main() ({
|
||||
(if (true as bool)
|
||||
({ } as
|
||||
()) else if (let Some(a) =
|
||||
((Some as
|
||||
fn(i32) -> Option<i32> {Option::<i32>::Some})((3
|
||||
as
|
||||
i32))
|
||||
as Option<i32>) as bool)
|
||||
({ } as ()) as ())
|
||||
} as ())
|
||||
(if (true as bool)
|
||||
({ } as
|
||||
()) else if (let Some(a) =
|
||||
((Some as
|
||||
fn(i32) -> Option<i32> {Option::<i32>::Some})((3
|
||||
as i32)) as Option<i32>) as bool) ({ } as ())
|
||||
as ())
|
||||
} as ())
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
PRINT-ATTR INPUT (DISPLAY): impl Foo <
|
||||
[u8 ;
|
||||
{
|
||||
#! [rustc_dummy(cursed_inner)] #! [allow(unused)] struct Inner
|
||||
{ field : [u8 ; { #! [rustc_dummy(another_cursed_inner)] 1 }] } 0
|
||||
}] > { #! [rustc_dummy(evaluated_attr)] fn bar() {} }
|
||||
{
|
||||
#! [rustc_dummy(cursed_inner)] #! [allow(unused)] struct Inner
|
||||
{ field : [u8 ; { #! [rustc_dummy(another_cursed_inner)] 1 }] } 0
|
||||
}] > { #! [rustc_dummy(evaluated_attr)] fn bar() {} }
|
||||
PRINT-ATTR INPUT (DEBUG): TokenStream [
|
||||
Ident {
|
||||
ident: "impl",
|
||||
|
|
|
@ -4,23 +4,23 @@ struct Foo < #[cfg(FALSE)] A, B >
|
|||
#[cfg(FALSE)] first : String, #[cfg_attr(FALSE, deny(warnings))] second :
|
||||
bool, third :
|
||||
[u8 ;
|
||||
{
|
||||
#[cfg(FALSE)] struct Bar ; #[cfg(not(FALSE))] struct Inner ;
|
||||
#[cfg(FALSE)] let a = 25 ; match true
|
||||
{
|
||||
#[cfg(FALSE)] true => {},
|
||||
#[cfg_attr(not(FALSE), allow(warnings))] false => {}, _ => {}
|
||||
} ; #[print_helper(should_be_removed)] fn removed_fn()
|
||||
{ #! [cfg(FALSE)] } #[print_helper(c)] #[cfg(not(FALSE))] fn
|
||||
kept_fn() { #! [cfg(not(FALSE))] let my_val = true ; } enum TupleEnum
|
||||
{
|
||||
Foo(#[cfg(FALSE)] u8, #[cfg(FALSE)] bool, #[cfg(not(FALSE))] i32,
|
||||
#[cfg(FALSE)] String, u8)
|
||||
} struct
|
||||
TupleStruct(#[cfg(FALSE)] String, #[cfg(not(FALSE))] i32,
|
||||
#[cfg(FALSE)] bool, u8) ; fn plain_removed_fn()
|
||||
{ #! [cfg_attr(not(FALSE), cfg(FALSE))] } 0
|
||||
}], #[print_helper(d)] fourth : B
|
||||
{
|
||||
#[cfg(FALSE)] struct Bar ; #[cfg(not(FALSE))] struct Inner ;
|
||||
#[cfg(FALSE)] let a = 25 ; match true
|
||||
{
|
||||
#[cfg(FALSE)] true => {}, #[cfg_attr(not(FALSE), allow(warnings))]
|
||||
false => {}, _ => {}
|
||||
} ; #[print_helper(should_be_removed)] fn removed_fn()
|
||||
{ #! [cfg(FALSE)] } #[print_helper(c)] #[cfg(not(FALSE))] fn kept_fn()
|
||||
{ #! [cfg(not(FALSE))] let my_val = true ; } enum TupleEnum
|
||||
{
|
||||
Foo(#[cfg(FALSE)] u8, #[cfg(FALSE)] bool, #[cfg(not(FALSE))] i32,
|
||||
#[cfg(FALSE)] String, u8)
|
||||
} struct
|
||||
TupleStruct(#[cfg(FALSE)] String, #[cfg(not(FALSE))] i32,
|
||||
#[cfg(FALSE)] bool, u8) ; fn plain_removed_fn()
|
||||
{ #! [cfg_attr(not(FALSE), cfg(FALSE))] } 0
|
||||
}], #[print_helper(d)] fourth : B
|
||||
}
|
||||
PRINT-ATTR INPUT (DEBUG): TokenStream [
|
||||
Punct {
|
||||
|
@ -1276,14 +1276,14 @@ PRINT-DERIVE INPUT (DISPLAY): #[print_helper(a)] #[allow(dead_code)] #[print_hel
|
|||
{
|
||||
second : bool, third :
|
||||
[u8 ;
|
||||
{
|
||||
#[cfg(not(FALSE))] struct Inner ; match true
|
||||
{ #[allow(warnings)] false => {}, _ => {} } ; #[print_helper(c)]
|
||||
#[cfg(not(FALSE))] fn kept_fn()
|
||||
{ #! [cfg(not(FALSE))] let my_val = true ; } enum TupleEnum
|
||||
{ Foo(#[cfg(not(FALSE))] i32, u8) } struct
|
||||
TupleStruct(#[cfg(not(FALSE))] i32, u8) ; 0
|
||||
}], #[print_helper(d)] fourth : B
|
||||
{
|
||||
#[cfg(not(FALSE))] struct Inner ; match true
|
||||
{ #[allow(warnings)] false => {}, _ => {} } ; #[print_helper(c)]
|
||||
#[cfg(not(FALSE))] fn kept_fn()
|
||||
{ #! [cfg(not(FALSE))] let my_val = true ; } enum TupleEnum
|
||||
{ Foo(#[cfg(not(FALSE))] i32, u8) } struct
|
||||
TupleStruct(#[cfg(not(FALSE))] i32, u8) ; 0
|
||||
}], #[print_helper(d)] fourth : B
|
||||
}
|
||||
PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
||||
Punct {
|
||||
|
|
|
@ -2,10 +2,10 @@ PRINT-DERIVE INPUT (DISPLAY): struct Foo
|
|||
{
|
||||
val :
|
||||
[bool ;
|
||||
{
|
||||
let a = #[rustc_dummy(first)] #[rustc_dummy(second)]
|
||||
{ #! [allow(unused)] 30 } ; 0
|
||||
}]
|
||||
{
|
||||
let a = #[rustc_dummy(first)] #[rustc_dummy(second)]
|
||||
{ #! [allow(unused)] 30 } ; 0
|
||||
}]
|
||||
}
|
||||
PRINT-DERIVE INPUT (DEBUG): TokenStream [
|
||||
Ident {
|
||||
|
|
|
@ -19,29 +19,27 @@ extern crate proc_macro;
|
|||
|
||||
fn main() {
|
||||
[crate::TokenStream::from(crate::TokenTree::Ident(crate::Ident::new("let",
|
||||
crate::Span::recover_proc_macro_span(0)))),
|
||||
crate::TokenStream::from(crate::TokenTree::Ident(crate::Ident::new("hello",
|
||||
crate::Span::recover_proc_macro_span(1)))),
|
||||
crate::TokenStream::from(crate::TokenTree::Punct(crate::Punct::new('\u{3d}',
|
||||
crate::Spacing::Alone))),
|
||||
crate::TokenStream::from(crate::TokenTree::Literal({
|
||||
let mut iter =
|
||||
"\"world\"".parse::<crate::TokenStream>().unwrap().into_iter();
|
||||
if let (Some(crate::TokenTree::Literal(mut lit)),
|
||||
None) =
|
||||
(iter.next(),
|
||||
iter.next())
|
||||
{
|
||||
lit.set_span(crate::Span::recover_proc_macro_span(2));
|
||||
lit
|
||||
} else {
|
||||
{
|
||||
::core::panicking::panic("internal error: entered unreachable code")
|
||||
}
|
||||
}
|
||||
})),
|
||||
crate::TokenStream::from(crate::TokenTree::Punct(crate::Punct::new('\u{3b}',
|
||||
crate::Spacing::Alone)))].iter().cloned().collect::<crate::TokenStream>()
|
||||
crate::Span::recover_proc_macro_span(0)))),
|
||||
crate::TokenStream::from(crate::TokenTree::Ident(crate::Ident::new("hello",
|
||||
crate::Span::recover_proc_macro_span(1)))),
|
||||
crate::TokenStream::from(crate::TokenTree::Punct(crate::Punct::new('\u{3d}',
|
||||
crate::Spacing::Alone))),
|
||||
crate::TokenStream::from(crate::TokenTree::Literal({
|
||||
let mut iter =
|
||||
"\"world\"".parse::<crate::TokenStream>().unwrap().into_iter();
|
||||
if let (Some(crate::TokenTree::Literal(mut lit)),
|
||||
None) =
|
||||
(iter.next(), iter.next()) {
|
||||
lit.set_span(crate::Span::recover_proc_macro_span(2));
|
||||
lit
|
||||
} else {
|
||||
{
|
||||
::core::panicking::panic("internal error: entered unreachable code")
|
||||
}
|
||||
}
|
||||
})),
|
||||
crate::TokenStream::from(crate::TokenTree::Punct(crate::Punct::new('\u{3b}',
|
||||
crate::Spacing::Alone)))].iter().cloned().collect::<crate::TokenStream>()
|
||||
}
|
||||
const _: () =
|
||||
{
|
||||
|
|
|
@ -37,7 +37,7 @@ checker!(rename_params, r#"impl Foo
|
|||
fn hello(#[angery(true)] a : i32, #[a2] b : i32, #[what = "how"] c : u32)
|
||||
{} fn
|
||||
hello2(#[a1] #[a2] a : i32, #[what = "how"] b : i32, #[angery(true)] c :
|
||||
u32) {} fn
|
||||
u32) {} fn
|
||||
hello_self(#[a1] #[a2] & self, #[a1] #[a2] a : i32, #[what = "how"] b :
|
||||
i32, #[angery(true)] c : u32) {}
|
||||
i32, #[angery(true)] c : u32) {}
|
||||
}"#);
|
||||
|
|
|
@ -10,5 +10,5 @@ extern crate std;
|
|||
trait Animal { }
|
||||
|
||||
fn main() {
|
||||
pub type ServeFut = /*impl Trait*/;
|
||||
}
|
||||
pub type ServeFut = /*impl Trait*/;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue