@@ -614,11 +614,9 @@ fn ast_path_to_trait_ref<'a,'tcx>(
614614
615615 let ( regions, types, assoc_bindings) = match path. segments . last ( ) . unwrap ( ) . parameters {
616616 ast:: AngleBracketedParameters ( ref data) => {
617- // For now, require that parenthetical notation be used
617+ // For now, require that parenthetical5D notation be used
618618 // only with `Fn()` etc.
619- if !this. tcx ( ) . sess . features . borrow ( ) . unboxed_closures &&
620- this. tcx ( ) . lang_items . fn_trait_kind ( trait_def_id) . is_some ( )
621- {
619+ if !this. tcx ( ) . sess . features . borrow ( ) . unboxed_closures && trait_def. paren_sugar {
622620 span_err ! ( this. tcx( ) . sess, path. span, E0215 ,
623621 "angle-bracket notation is not stable when \
624622 used with the `Fn` family of traits, use parentheses") ;
@@ -632,9 +630,7 @@ fn ast_path_to_trait_ref<'a,'tcx>(
632630 ast:: ParenthesizedParameters ( ref data) => {
633631 // For now, require that parenthetical notation be used
634632 // only with `Fn()` etc.
635- if !this. tcx ( ) . sess . features . borrow ( ) . unboxed_closures &&
636- this. tcx ( ) . lang_items . fn_trait_kind ( trait_def_id) . is_none ( )
637- {
633+ if !this. tcx ( ) . sess . features . borrow ( ) . unboxed_closures && !trait_def. paren_sugar {
638634 span_err ! ( this. tcx( ) . sess, path. span, E0216 ,
639635 "parenthetical notation is only stable when \
640636 used with the `Fn` family of traits") ;
0 commit comments