1
Fork 0

Bless all pretty printer tests and ui tests

This commit is contained in:
David Tolnay 2022-01-21 01:34:06 -08:00
parent 8ac05b9766
commit 402f322940
No known key found for this signature in database
GPG key ID: F9BA143B95FF6D82
19 changed files with 210 additions and 234 deletions

View file

@ -17,8 +17,8 @@ pub fn bar() ({
let _: [(); (1 as usize)] = ([(() as ())] as [(); 1]); let _: [(); (1 as usize)] = ([(() as ())] as [(); 1]);
let _ = let _ =
(((&([(1 as i32), (2 as i32), (3 as i32)] as [i32; 3]) (((&([(1 as i32), (2 as i32), (3 as i32)] as [i32; 3]) as
as &[i32; 3]) as *const _ as *const [i32; 3]) as &[i32; 3]) as *const _ as *const [i32; 3]) as
*const [i32; (3 as usize)] as *const [i32; 3]); *const [i32; (3 as usize)] as *const [i32; 3]);
@ -35,20 +35,10 @@ pub fn bar() ({
for<'r> fn(Arguments<'r>) -> String {format})(((::core::fmt::Arguments::new_v1 for<'r> fn(Arguments<'r>) -> String {format})(((::core::fmt::Arguments::new_v1
as as
fn(&[&'static str], &[ArgumentV1]) -> Arguments {Arguments::new_v1})((&([("test" fn(&[&'static str], &[ArgumentV1]) -> Arguments {Arguments::new_v1})((&([("test"
as as &str)] as [&str; 1]) as
&str)]
as
[&str; 1])
as
&[&str; 1]), &[&str; 1]),
(&([] (&([] as [ArgumentV1; 0]) as &[ArgumentV1; 0])) as
as Arguments)) as String);
[ArgumentV1; 0])
as
&[ArgumentV1; 0]))
as
Arguments))
as String);
(res as String) (res as String)
} as String); } as String);
} as ()) } as ())
@ -62,17 +52,7 @@ pub fn id<T>(x: T) -> T ({ (x as T) } as T)
pub fn use_id() ({ pub fn use_id() ({
let _ = let _ =
((id::<[i32; (3 as usize)]> as ((id::<[i32; (3 as usize)]> as
fn([i32; 3]) -> [i32; 3] {id::<[i32; 3]>})(([(1 fn([i32; 3]) -> [i32; 3] {id::<[i32; 3]>})(([(1 as i32),
as (2 as i32), (3 as i32)] as [i32; 3])) as [i32; 3]);
i32),
(2
as
i32),
(3
as
i32)]
as
[i32; 3]))
as [i32; 3]);
} as ()) } as ())
fn main() ({ } as ()) fn main() ({ } as ())

View file

@ -12,8 +12,6 @@ pub fn main() ({
()) else if (let Some(a) = ()) else if (let Some(a) =
((Some as ((Some as
fn(i32) -> Option<i32> {Option::<i32>::Some})((3 fn(i32) -> Option<i32> {Option::<i32>::Some})((3
as as i32)) as Option<i32>) as bool) ({ } as ())
i32)) as ())
as Option<i32>) as bool)
({ } as ()) as ())
} as ()) } as ())

View file

@ -8,11 +8,11 @@ struct Foo < #[cfg(FALSE)] A, B >
#[cfg(FALSE)] struct Bar ; #[cfg(not(FALSE))] struct Inner ; #[cfg(FALSE)] struct Bar ; #[cfg(not(FALSE))] struct Inner ;
#[cfg(FALSE)] let a = 25 ; match true #[cfg(FALSE)] let a = 25 ; match true
{ {
#[cfg(FALSE)] true => {}, #[cfg(FALSE)] true => {}, #[cfg_attr(not(FALSE), allow(warnings))]
#[cfg_attr(not(FALSE), allow(warnings))] false => {}, _ => {} false => {}, _ => {}
} ; #[print_helper(should_be_removed)] fn removed_fn() } ; #[print_helper(should_be_removed)] fn removed_fn()
{ #! [cfg(FALSE)] } #[print_helper(c)] #[cfg(not(FALSE))] fn { #! [cfg(FALSE)] } #[print_helper(c)] #[cfg(not(FALSE))] fn kept_fn()
kept_fn() { #! [cfg(not(FALSE))] let my_val = true ; } enum TupleEnum { #! [cfg(not(FALSE))] let my_val = true ; } enum TupleEnum
{ {
Foo(#[cfg(FALSE)] u8, #[cfg(FALSE)] bool, #[cfg(not(FALSE))] i32, Foo(#[cfg(FALSE)] u8, #[cfg(FALSE)] bool, #[cfg(not(FALSE))] i32,
#[cfg(FALSE)] String, u8) #[cfg(FALSE)] String, u8)

View file

@ -29,9 +29,7 @@ fn main() {
"\"world\"".parse::<crate::TokenStream>().unwrap().into_iter(); "\"world\"".parse::<crate::TokenStream>().unwrap().into_iter();
if let (Some(crate::TokenTree::Literal(mut lit)), if let (Some(crate::TokenTree::Literal(mut lit)),
None) = None) =
(iter.next(), (iter.next(), iter.next()) {
iter.next())
{
lit.set_span(crate::Span::recover_proc_macro_span(2)); lit.set_span(crate::Span::recover_proc_macro_span(2));
lit lit
} else { } else {