-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-grammarArea: The grammar of RustArea: The grammar of RustC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-langRelevant to the language teamRelevant to the language team
Description
macro_rules! impl_somethingable {
($Base: ty, $Block:ty) => {
impl<'a, T> Somethingable for $Block where T: $Base {
}
}
}
impl_somethingable!(ATrait, A);
<anon>:15:52: 15:60 error: each predicate in a `where` clause must have at least one bound in it
<anon>:15 impl<'a, T> Somethingable for $Block where T: $Base {
^~~~~~~~
<anon>:15:56: 15:60 error: expected one of `,` or `{`, found `ATrait`
<anon>:15 impl<'a, T> Somethingable for $Block where T: $Base {
^~~~
The solution is to use $ident
instead of $ty
, but this is non-obvious to the user, especially since it's perfectly ok to have ATrait
in that location.
Playpen: http://is.gd/AMUJDw
cc @huonw
apparentlymart
Metadata
Metadata
Assignees
Labels
A-grammarArea: The grammar of RustArea: The grammar of RustC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-langRelevant to the language teamRelevant to the language team