-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.Category: This is a bug.
Description
Minor papercut:
macro_rules! m {
($e: expr) => (stringify!($e))
}
fn main() {
println!("{:?}", stringify!(1 +1));
println!("{:?}", m!(1 +1));
println!("{:?}", stringify!(0xff));
println!("{:?}", m!(0xff));
println!("{:?}", stringify!(1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001));
println!("{:?}", m!(1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001));
}
"1 + 1"
"1 + 1"
"0xff"
"255"
"1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
"1.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001"
0xff
is converted into 255
while 1.000....1
isn't (the delta from 1.0 is clearly smaller than IEEE854 double's machine epsilon)
May or may not be related to #28415
Metadata
Metadata
Assignees
Labels
A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.Category: This is a bug.