-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-decl-macros-1-2Area: Declarative macros 1.2Area: Declarative macros 1.2A-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regions
Description
I would expect the following to not compile (Playground):
trait Trait {}
macro_rules! impl_trait_for {
($name:path) => { impl<'tcx> Trait for $name {} }
}
impl_trait_for!(Option<i32>);
impl_trait_for!(Option<&'tcx i32>);
The lifetime 'tcx
is bound in the macro, and used in a macro argument. This violates hygiene.
I am sure this has already been reported but I cannot find an issue that matches...
Metadata
Metadata
Assignees
Labels
A-decl-macros-1-2Area: Declarative macros 1.2Area: Declarative macros 1.2A-lifetimesArea: Lifetimes / regionsArea: Lifetimes / regions