@@ -614,11 +614,9 @@ fn ast_path_to_trait_ref<'a,'tcx>(
614
614
615
615
let ( regions, types, assoc_bindings) = match path. segments . last ( ) . unwrap ( ) . parameters {
616
616
ast:: AngleBracketedParameters ( ref data) => {
617
- // For now, require that parenthetical notation be used
617
+ // For now, require that parenthetical5D notation be used
618
618
// 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 {
622
620
span_err ! ( this. tcx( ) . sess, path. span, E0215 ,
623
621
"angle-bracket notation is not stable when \
624
622
used with the `Fn` family of traits, use parentheses") ;
@@ -632,9 +630,7 @@ fn ast_path_to_trait_ref<'a,'tcx>(
632
630
ast:: ParenthesizedParameters ( ref data) => {
633
631
// For now, require that parenthetical notation be used
634
632
// 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 {
638
634
span_err ! ( this. tcx( ) . sess, path. span, E0216 ,
639
635
"parenthetical notation is only stable when \
640
636
used with the `Fn` family of traits") ;
0 commit comments