@@ -69,6 +69,7 @@ use util::nodemap::FnvHashSet;
6969use std:: slice;
7070use syntax:: { abi, ast, ast_util} ;
7171use syntax:: codemap:: { Span , Pos } ;
72+ use syntax:: feature_gate:: emit_feature_err;
7273use syntax:: parse:: token;
7374use syntax:: print:: pprust;
7475
@@ -791,12 +792,11 @@ fn create_substs_for_ast_trait_ref<'a,'tcx>(this: &AstConv<'tcx>,
791792 // For now, require that parenthetical notation be used
792793 // only with `Fn()` etc.
793794 if !this. tcx ( ) . sess . features . borrow ( ) . unboxed_closures && trait_def. paren_sugar {
794- span_err ! ( this. tcx( ) . sess, span, E0215 ,
795- "angle-bracket notation is not stable when \
796- used with the `Fn` family of traits, use parentheses") ;
797- fileline_help ! ( this. tcx( ) . sess, span,
798- "add `#![feature(unboxed_closures)]` to \
799- the crate attributes to enable") ;
795+ emit_feature_err ( & this. tcx ( ) . sess . parse_sess . span_diagnostic ,
796+ "unboxed_closures" , span,
797+ "\
798+ the precise format of `Fn`-family traits' type parameters is \
799+ subject to change. Use parenthetical notation (Fn(Foo, Bar) -> Baz) instead") ;
800800 }
801801
802802 convert_angle_bracketed_parameters ( this, rscope, span, & trait_def. generics , data)
@@ -805,12 +805,10 @@ fn create_substs_for_ast_trait_ref<'a,'tcx>(this: &AstConv<'tcx>,
805805 // For now, require that parenthetical notation be used
806806 // only with `Fn()` etc.
807807 if !this. tcx ( ) . sess . features . borrow ( ) . unboxed_closures && !trait_def. paren_sugar {
808- span_err ! ( this. tcx( ) . sess, span, E0216 ,
809- "parenthetical notation is only stable when \
810- used with the `Fn` family of traits") ;
811- fileline_help ! ( this. tcx( ) . sess, span,
812- "add `#![feature(unboxed_closures)]` to \
813- the crate attributes to enable") ;
808+ emit_feature_err ( & this. tcx ( ) . sess . parse_sess . span_diagnostic ,
809+ "unboxed_closures" , span,
810+ "\
811+ parenthetical notation is only stable when used with `Fn`-family traits") ;
814812 }
815813
816814 convert_parenthesized_parameters ( this, rscope, span, & trait_def. generics , data)
0 commit comments