@@ -70,7 +70,7 @@ use smallvec::SmallVec;
7070use thin_vec:: ThinVec ;
7171use tracing:: { debug, instrument, trace} ;
7272
73- use crate :: errors :: { AssocTyParentheses , AssocTyParenthesesSub , MisplacedImplTrait } ;
73+ use crate :: diagnostics :: { AssocTyParentheses , AssocTyParenthesesSub , MisplacedImplTrait } ;
7474use crate :: item:: Owners ;
7575
7676macro_rules! arena_vec {
@@ -83,7 +83,7 @@ mod asm;
8383mod block;
8484mod contract;
8585mod delegation;
86- mod errors ;
86+ mod diagnostics ;
8787mod expr;
8888mod format;
8989mod index;
@@ -1145,17 +1145,21 @@ impl<'hir> LoweringContext<'_, 'hir> {
11451145 {
11461146 let err = match ( & data. inputs [ ..] , & data. output ) {
11471147 ( [ _, ..] , FnRetTy :: Default ( _) ) => {
1148- errors:: BadReturnTypeNotation :: Inputs { span : data. inputs_span }
1148+ diagnostics:: BadReturnTypeNotation :: Inputs {
1149+ span : data. inputs_span ,
1150+ }
11491151 }
11501152 ( [ ] , FnRetTy :: Default ( _) ) => {
1151- errors:: BadReturnTypeNotation :: NeedsDots { span : data. inputs_span }
1153+ diagnostics:: BadReturnTypeNotation :: NeedsDots {
1154+ span : data. inputs_span ,
1155+ }
11521156 }
11531157 // The case `T: Trait<method(..) -> Ret>` is handled in the parser.
11541158 ( _, FnRetTy :: Ty ( ty) ) => {
11551159 let span = data. inputs_span . shrink_to_hi ( ) . to ( ty. span ) ;
1156- errors :: BadReturnTypeNotation :: Output {
1160+ diagnostics :: BadReturnTypeNotation :: Output {
11571161 span,
1158- suggestion : errors :: RTNSuggestion {
1162+ suggestion : diagnostics :: RTNSuggestion {
11591163 output : span,
11601164 input : data. inputs_span ,
11611165 } ,
@@ -1226,7 +1230,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
12261230 _ => None ,
12271231 } ;
12281232
1229- let guar = self . dcx ( ) . emit_err ( errors :: MisplacedAssocTyBinding {
1233+ let guar = self . dcx ( ) . emit_err ( diagnostics :: MisplacedAssocTyBinding {
12301234 span : constraint. span ,
12311235 suggestion,
12321236 } ) ;
@@ -1529,7 +1533,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
15291533 ast:: GenericBound :: Use ( _, span) => Some ( span) ,
15301534 _ => None ,
15311535 } ) {
1532- self . tcx . dcx ( ) . emit_err ( errors :: NoPreciseCapturesOnApit { span } ) ;
1536+ self . tcx . dcx ( ) . emit_err ( diagnostics :: NoPreciseCapturesOnApit { span } ) ;
15331537 }
15341538
15351539 let def_id = self . local_def_id ( * def_node_id) ;
@@ -2123,7 +2127,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
21232127 . filter ( |_| match source {
21242128 hir:: GenericParamSource :: Generics => true ,
21252129 hir:: GenericParamSource :: Binder => {
2126- self . dcx ( ) . emit_err ( errors :: GenericParamDefaultInBinder {
2130+ self . dcx ( ) . emit_err ( diagnostics :: GenericParamDefaultInBinder {
21272131 span : param. span ( ) ,
21282132 } ) ;
21292133
@@ -2154,7 +2158,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
21542158 . filter ( |anon_const| match source {
21552159 hir:: GenericParamSource :: Generics => true ,
21562160 hir:: GenericParamSource :: Binder => {
2157- let err = errors:: GenericParamDefaultInBinder { span : param. span ( ) } ;
2161+ let err =
2162+ diagnostics:: GenericParamDefaultInBinder { span : param. span ( ) } ;
21582163 if expr:: WillCreateDefIdsVisitor
21592164 . visit_expr ( & anon_const. value )
21602165 . is_break ( )
0 commit comments