You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, before I complain 😄 I want to give the obligatory resounding THANK YOU for creating such an amazing tool. I rely on rust-analyzer almost every day, and it is simply an invaluable aid to my job. Now for the bug:
The most recent version of rust-analyzer fails when passing messages + formatting args to assert_eq!(..):
❯ rust-analyzer --version
rust-analyzer a0fa522
// main.rsfnmain(){let x = 1;let y = 3;assert_eq!(1,3,"The values are not equal: {} != {}", x, y);}
The error message given is: [rust-analyzer macro-error] [E] could not resolve macro `$crate::format_args` . Now $crate::format_args is in the assert_eq! definition for more than two arguments:
macro_rules! assert_eq {($left:expr, $right:expr) => ({// .. snip ..});($left:expr, $right:expr,) => ({
$crate::assert_eq!($left, $right)});($left:expr, $right:expr, $($arg:tt)+) => ({match(&($left),&($right)){(left_val, right_val) => {if !(*left_val == *right_val){// The reborrows below are intentional. Without them, the stack slot for the// borrow is initialized even before the values are compared, leading to a// noticeable slow down.
panic!(r#"assertion failed: `(left == right)` left: `{:?}`, right: `{:?}`: {}"#,&*left_val,&*right_val,
$crate::format_args!($($arg)+))}}}});}
Here's a screenshot of the error message in context with the code (below). It seems that the spans for the error message are wonky as well:
The text was updated successfully, but these errors were encountered:
jrop
changed the title
`could not resolve macro $crate::format_args when passing more than two arguments to assert_eq!(left, right, "there was an error {}, {}", x, y)`
"could not resolve macro $crate::format_args" when passing more than two arguments to assert_eq!(left, right, "there was an error {}, {}", x, y)Dec 9, 2020
Now, before I complain 😄 I want to give the obligatory resounding THANK YOU for creating such an amazing tool. I rely on rust-analyzer almost every day, and it is simply an invaluable aid to my job. Now for the bug:
The most recent version of rust-analyzer fails when passing messages + formatting args to
assert_eq!(..)
:The error message given is:
[rust-analyzer macro-error] [E] could not resolve macro `$crate::format_args`
. Now$crate::format_args
is in theassert_eq!
definition for more than two arguments:Here's a screenshot of the error message in context with the code (below). It seems that the spans for the error message are wonky as well:
The text was updated successfully, but these errors were encountered: