@@ -44,7 +44,6 @@ use crate::binding::scope::FlowStyle;
4444use crate :: binding:: scope:: LoopExit ;
4545use crate :: binding:: scope:: Scope ;
4646use crate :: config:: error_kind:: ErrorKind ;
47- use crate :: deprecation:: format_deprecation;
4847use crate :: error:: context:: ErrorInfo ;
4948use crate :: export:: definitions:: MutableCaptureKind ;
5049use crate :: export:: exports:: Export ;
@@ -1002,10 +1001,7 @@ impl<'a> BindingsBuilder<'a> {
10021001 ..
10031002 } ) ) = exported. get_hashed ( name)
10041003 {
1005- let msg = format_deprecation (
1006- format ! ( "`{name}` is deprecated" ) ,
1007- Some ( deprecation) ,
1008- ) ;
1004+ let msg = deprecation. as_error_message ( format ! ( "`{name}` is deprecated" ) ) ;
10091005 self . error_multiline ( x. range , ErrorInfo :: Kind ( ErrorKind :: Deprecated ) , msg) ;
10101006 }
10111007 let val = if exported. contains_key_hashed ( name) {
@@ -1052,10 +1048,8 @@ impl<'a> BindingsBuilder<'a> {
10521048 ..
10531049 } ) ) = exported. get ( & x. name . id )
10541050 {
1055- let msg = format_deprecation (
1056- format ! ( "`{}` is deprecated" , x. name) ,
1057- Some ( deprecation) ,
1058- ) ;
1051+ let msg =
1052+ deprecation. as_error_message ( format ! ( "`{}` is deprecated" , x. name) ) ;
10591053 self . error_multiline ( x. range , ErrorInfo :: Kind ( ErrorKind :: Deprecated ) , msg) ;
10601054 }
10611055 Binding :: Import ( m, x. name . id . clone ( ) , original_name_range)
0 commit comments