-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
migration failure: -W keyword-idents misfires on dyn Trait in a macro expansion #6359
Comments
ExpHP
changed the title
migration failure: -W keyword-idents misfires on usage of
migration failure: -W keyword-idents misfires on usage of dyn Trait in a macro
Nov 28, 2018
dyn Trait
in a macro
ExpHP
changed the title
migration failure: -W keyword-idents misfires on usage of dyn Trait in a macro
migration failure: -W keyword-idents misfires on dyn Trait in a macro expansion
Nov 28, 2018
It also fails on pub trait PotentialBuilder: DynCloneDetail {}
pub trait DynCloneDetail {
fn box_clone(&self) -> Box<dyn PotentialBuilder>;
fn _as_ref_dyn(&self) -> &dyn PotentialBuilder;
}
#[macro_export]
macro_rules! impl_dyn_clone_detail {
(impl[$($bnd:tt)*] DynCloneDetail for $Type:ty { ... }) => {
impl<$($bnd)*> DynCloneDetail for $Type {
fn box_clone(&self) -> Box<PotentialBuilder> {
Box::new(<$Type as Clone>::clone(self))
}
fn _as_ref_dyn(&self) -> &PotentialBuilder { self }
}
};
}
impl PotentialBuilder for Box<dyn PotentialBuilder> {}
impl Clone for Box<dyn PotentialBuilder> {
fn clone(&self) -> Self { self.box_clone() }
}
impl_dyn_clone_detail!{
impl[] DynCloneDetail for Box<dyn PotentialBuilder> { ... }
}
fn main() {}
|
Thanks for the report! I've moved this over to rust-lang/rust#56327 as this is a bug in rustc, and we can track it from there |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This code is valid in both edition 2015 and 2018, but
cargo fix --edition
tries to fix it and fails.Cargo.toml
src/main.rs
Command & output
The text was updated successfully, but these errors were encountered: