@@ -69,6 +69,7 @@ use util::nodemap::FnvHashSet;
69
69
use std:: slice;
70
70
use syntax:: { abi, ast, ast_util} ;
71
71
use syntax:: codemap:: { Span , Pos } ;
72
+ use syntax:: feature_gate:: emit_feature_err;
72
73
use syntax:: parse:: token;
73
74
use syntax:: print:: pprust;
74
75
@@ -791,12 +792,11 @@ fn create_substs_for_ast_trait_ref<'a,'tcx>(this: &AstConv<'tcx>,
791
792
// For now, require that parenthetical notation be used
792
793
// only with `Fn()` etc.
793
794
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") ;
800
800
}
801
801
802
802
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>,
805
805
// For now, require that parenthetical notation be used
806
806
// only with `Fn()` etc.
807
807
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") ;
814
812
}
815
813
816
814
convert_parenthesized_parameters ( this, rscope, span, & trait_def. generics , data)
0 commit comments