We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
for
#![feature(macro_rules)] macro_rules! print_five_times( ($e:expr) => ( for i in range(0, 5u) { println!("{:u}: {}", i, $e); } )) fn f(i: &'static str) { print_five_times!(i); } fn main() { f("Hello, world!"); }
produces
0: 0 1: 1 2: 2 3: 3 4: 4
Renaming f's argument to x produces the expected
f
x
0: Hello, world! 1: Hello, world! 2: Hello, world! 3: Hello, world! 4: Hello, world!
Interestingly, so does
fn f(x: &'static str) { let i = x; print_five_times!(i); }
rustc 0.11.0-pre (81c0223 2014-05-29 16:41:42 -0700) host: x86_64-unknown-linux-gnu
The text was updated successfully, but these errors were encountered:
Closing as a dupe of either #9383 or #9384
Sorry, something went wrong.
No branches or pull requests
produces
Renaming
f
's argument tox
produces the expectedInterestingly, so does
rustc 0.11.0-pre (81c0223 2014-05-29 16:41:42 -0700)
host: x86_64-unknown-linux-gnu
The text was updated successfully, but these errors were encountered: