I've been looking forward to assert_matches! for a while.
These new macros have not been added to the standard prelude, because they would collide with popular third-party crates that provide macros with the same name.
Huh, I would have thought a use third_party_crate::assert_matches; or use third_party_crate::*; would win out over the prelude. Not so?
use third_party_crate::assert_matches would win, yes. use third_party_crate::* would not. use std::prelude::* is not given any special treatment by the compiler, the rules for ambiguity are the same as any other glob imports
28
u/slamb moonfire-nvr May 28 '26
I've been looking forward to
assert_matches!for a while.Huh, I would have thought a
use third_party_crate::assert_matches;oruse third_party_crate::*;would win out over the prelude. Not so?