-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Compare assert and assert_ng when there is a type error, and you’ll see assert_ng isn’t faring well.
assert_ng:
a.rs:12:5: 12:25 error: mismatched types: expected `int`, found `&int` (expected int, found &-ptr)
a.rs:12 assert_ng!(a == &a);
^~~~~~~~~~~~~~~~~~~~
a.rs:1:1: 14:1 note: in expansion of assert_ng!
a.rs:12:5: 12:25 note: expansion site
assert:
a.rs:13:18: 13:20 error: mismatched types: expected `int`, found `&int` (expected int, found &-ptr)
a.rs:13 assert!(a == &a);
^~
<std macros>:1:1: 12:2 note: in expansion of assert!
a.rs:13:5: 13:22 note: expansion site
Using quote_expr just isn’t going to cut it for getting it perfect; it’s going to need a manually constructed AST with spans carefully arranged in some way to get the correspondence correct.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels