@@ -345,8 +345,9 @@ your mileage may vary. - nmatsakis
345345### Where can where clauses appear?
346346
347347Where clauses can be added to anything that can be parameterized with
348- type/lifetime parameters: ` impl ` declarations, ` fn ` declarations, and
349- ` trait ` and ` struct ` definitions. They appear as follows:
348+ type/lifetime parameters with the exception of trait method
349+ definitions: ` impl ` declarations, ` fn ` declarations, and ` trait ` and
350+ ` struct ` definitions. They appear as follows:
350351
351352 impl Foo<A,B>
352353 where ...
@@ -356,6 +357,13 @@ type/lifetime parameters: `impl` declarations, `fn` declarations, and
356357 where ...
357358 { }
358359
360+ impl Foo<A,B> for C
361+ {
362+ fn foo<A,B> -> C
363+ where ...
364+ { }
365+ }
366+
359367 fn foo<A,B> -> C
360368 where ...
361369 { }
@@ -367,10 +375,15 @@ type/lifetime parameters: `impl` declarations, `fn` declarations, and
367375 trait Foo<A,B> : C
368376 where ...
369377 { }
370-
371- While in the motivation I mentioned the possibility of embedding where
372- clauses into object types, I do not propose that as part of this
373- RFC. That would come with some sort of associated items RFC.
378+
379+ #### Where clauses cannot (yet) appear on trait methods
380+
381+ Note that trait method definitions were specifically excluded from the
382+ list above. The reason is that including where clauses on a trait
383+ method raises interesting questions for what it means to implement the
384+ trait. Using where clauses it becomes possible to define methods that
385+ do not necessarily apply to all implementations. We intend to enable
386+ this feature but it merits a second RFC to delve into the details.
374387
375388### Where clause grammar
376389
0 commit comments