Move coerce_container_to_any to suspicious#16689
Move coerce_container_to_any to suspicious#16689Ralith wants to merge 1 commit intorust-lang:masterfrom
coerce_container_to_any to suspicious#16689Conversation
|
r? @dswij rustbot has assigned @dswij. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
I would prefer to see more tests before this lint becomes warning-by-default. In particular, tests where part of the expression comes from macros, or embedded inside macro, etc., to make sure that the suggested fix can always be applied. For example, the following code will trigger the lint while it should probably not: macro_rules! mac {
($n:ident, $e:expr) => { let $n: &dyn Any = $e; };
}
let x: Box<dyn Any> = Box::new(());
mac!(ref_x, &x); |
|
Shouldn't it? If I saw such code in the wild I'd strongly expect the intended syntax to be |
|
If the macro is external, having a message such as "error: coercing |
changelog: [
coerce_container_to_any]: move from nursery to suspiciousMotivated by organic demand on bsky.