This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error: Expected <..> generic parameter. | |
--> tests/ui/anyiter_paren.rs:4:23 | |
| | |
4 | pub fn any_str_len(s: AnyIter(AnyString)) -> usize { | |
| ^^^^^^^^^^^^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[test] | |
fn ui() { | |
let t = trybuild::TestCases::new(); | |
t.compile_fail("tests/ui/*.rs"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use anyinput::anyinput; | |
#[anyinput] | |
pub fn any_str_len(s: AnyIter(AnyString)) -> usize { | |
s.len() | |
} | |
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use anyinput::anyinput; | |
#[test] | |
fn one_input() { | |
#[anyinput] | |
pub fn any_str_len(s: AnyString) -> usize { | |
s.len() | |
} | |
assert!(any_str_len("123") == 3); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#[test] | |
#[should_panic( | |
expected = "proc-macro-error API cannot be used outside of `entry_point` invocation, perhaps you forgot to annotate your #[proc_macro] function with `#[proc_macro_error]" | |
)] | |
fn one_bad_input_3() { | |
let before = quote! { | |
pub fn any_str_len(s: AnyIter(AnyString)) { | |
s.len() | |
} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn create_maybe_sub_type(args: &PathArguments, span_range: &SpanRange) -> Option<Type> { | |
match args { | |
PathArguments::None => None, | |
PathArguments::AngleBracketed(ref args) => { | |
let arg = first_and_only(args.args.iter()).unwrap_or_else(|| { | |
abort!(span_range, "Expected at exactly one generic parameter.") | |
}); | |
if let GenericArgument::Type(sub_type2) = arg { | |
Some(sub_type2.clone()) | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
error: Expected <..> generic parameter. | |
--> tests/ui/anyiter_paren.rs:4:23 | |
| | |
4 | pub fn any_str_len(s: AnyIter(AnyString)) -> usize { | |
| ^^^^^^^^^^^^^^^^^^ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stmt #0: println ! ("hello world") ; | |
stmt #1: println ! ("hello solar system") ; | |
stmt #2: println ! ("hello galaxy") ; | |
stmt #3: { println ! ("hello solar system") ; println ! ("hello universe") ; } | |
item_fn_new: fn hello () { println ! ("hello world") ; { println ! ("hello solar system") ; println ! ("hello universe") ; } } | |
count: 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn count_statements() { | |
let mut stmt_counter = StmtCounter { count: 0 }; | |
let item_fn_old: ItemFn = parse_quote! { | |
fn hello() { | |
println!("hello world"); | |
{ | |
println!("hello solar system"); | |
println!("hello galaxy"); | |
} | |
} |
NewerOlder