@@ -4,7 +4,7 @@ use rustc_ast::token::Delimiter;
44use rustc_ast:: tokenstream:: { DelimSpan , WithTokens } ;
55use rustc_ast:: { AttrItem , Attribute , LitKind , ast, token} ;
66use rustc_attr_ir:: target:: Target ;
7- use rustc_attr_ir:: { AttrPath , CfgEntry , RustcVersion } ;
7+ use rustc_attr_ir:: { AttrErrorGuaranteed , AttrPath , CfgEntry , RustcVersion } ;
88use rustc_errors:: { Applicability , Diagnostic , PResult , msg} ;
99use rustc_feature:: { Features , GatedCfg , find_gated_cfg} ;
1010use rustc_lint_defs:: builtin:: UNEXPECTED_CFGS ;
@@ -14,7 +14,7 @@ use rustc_session::Session;
1414use rustc_session:: config:: ExpectedValues ;
1515use rustc_session:: diagnostics:: feature_err;
1616use rustc_session:: parse:: ParseSess ;
17- use rustc_span:: { ErrorGuaranteed , Span , Symbol , sym} ;
17+ use rustc_span:: { Span , Symbol , sym} ;
1818use thin_vec:: ThinVec ;
1919
2020use crate :: attributes:: AttributeSafety ;
@@ -79,7 +79,7 @@ pub fn parse_cfg(cx: &mut AcceptContext<'_, '_>, args: &ArgParser) -> Option<Cfg
7979pub fn parse_cfg_entry (
8080 cx : & mut AcceptContext < ' _ , ' _ > ,
8181 item : & MetaItemOrLitParser ,
82- ) -> Result < CfgEntry , ErrorGuaranteed > {
82+ ) -> Result < CfgEntry , AttrErrorGuaranteed > {
8383 Ok ( match item {
8484 MetaItemOrLitParser :: MetaItemParser ( meta) => match meta. args ( ) {
8585 ArgParser :: List ( list) => match meta. path ( ) . word_sym ( ) {
@@ -126,7 +126,7 @@ fn parse_cfg_entry_version(
126126 cx : & mut AcceptContext < ' _ , ' _ > ,
127127 list : & MetaItemListParser ,
128128 meta_span : Span ,
129- ) -> Result < CfgEntry , ErrorGuaranteed > {
129+ ) -> Result < CfgEntry , AttrErrorGuaranteed > {
130130 try_gate_cfg ( sym:: version, meta_span, cx. sess ( ) , cx. features_option ( ) ) ;
131131 let Some ( version) = list. as_single ( ) else {
132132 return Err ( cx. emit_err ( diagnostics:: ExpectedSingleVersionLiteral { span : list. span } ) ) ;
@@ -150,7 +150,7 @@ fn parse_cfg_entry_target(
150150 cx : & mut AcceptContext < ' _ , ' _ > ,
151151 list : & MetaItemListParser ,
152152 meta_span : Span ,
153- ) -> Result < CfgEntry , ErrorGuaranteed > {
153+ ) -> Result < CfgEntry , AttrErrorGuaranteed > {
154154 if let Some ( features) = cx. features_option ( )
155155 && !features. cfg_target_compact ( )
156156 {
@@ -188,7 +188,7 @@ pub(crate) fn parse_name_value(
188188 value : Option < & NameValueParser > ,
189189 span : Span ,
190190 cx : & mut AcceptContext < ' _ , ' _ > ,
191- ) -> Result < CfgEntry , ErrorGuaranteed > {
191+ ) -> Result < CfgEntry , AttrErrorGuaranteed > {
192192 try_gate_cfg ( name, span, cx. sess ( ) , cx. features_option ( ) ) ;
193193
194194 let value = match value {
@@ -408,8 +408,8 @@ fn parse_cfg_attr_internal<'a>(
408408 parse_cfg_entry,
409409 & CFG_ATTR_TEMPLATE ,
410410 )
411- . map_err ( |_err : ErrorGuaranteed | {
412- // We have an `ErrorGuaranteed ` so this delayed bug cannot fail, but we need a `Diag` for the `PResult` so we make one anyways
411+ . map_err ( |_err : AttrErrorGuaranteed | {
412+ // We have an `AttrErrorGuaranteed ` so this delayed bug cannot fail, but we need a `Diag` for the `PResult` so we make one anyways
413413 let mut diag = sess. dcx ( ) . struct_err (
414414 "cfg_entry parsing failing with `ShouldEmit::ErrorsAndLints` should emit a error." ,
415415 ) ;
0 commit comments