Skip to content

Commit 83255f5

Browse files
committed
Include ErrorGuaranteed in StableSince::Err.
1 parent 439803d commit 83255f5

File tree

8 files changed

+13
-13
lines changed

8 files changed

+13
-13
lines changed

compiler/rustc_attr_data_structures/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ use rustc_ast::token::CommentKind;
2424
use rustc_ast::{AttrStyle, IntTy, UintTy};
2525
use rustc_ast_pretty::pp::Printer;
2626
use rustc_span::hygiene::Transparency;
27-
use rustc_span::{Span, Symbol};
27+
use rustc_span::{ErrorGuaranteed, Span, Symbol};
2828
pub use stability::*;
2929
use thin_vec::ThinVec;
3030
pub use version::*;
@@ -170,7 +170,7 @@ macro_rules! print_tup {
170170
}
171171

172172
print_tup!(A B C D E F G H);
173-
print_skip!(Span, ());
173+
print_skip!(Span, (), ErrorGuaranteed);
174174
print_disp!(u16, bool, NonZero<u32>);
175175
print_debug!(Symbol, UintTy, IntTy, Align, AttrStyle, CommentKind, Transparency);
176176

compiler/rustc_attr_data_structures/src/stability.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use std::num::NonZero;
22

33
use rustc_macros::{Decodable, Encodable, HashStable_Generic, PrintAttribute};
4-
use rustc_span::{Symbol, sym};
4+
use rustc_span::{ErrorGuaranteed, Symbol, sym};
55

66
use crate::{PrintAttribute, RustcVersion};
77

@@ -153,7 +153,7 @@ pub enum StableSince {
153153
/// Stabilized in the upcoming version, whatever number that is.
154154
Current,
155155
/// Failed to parse a stabilization version.
156-
Err,
156+
Err(ErrorGuaranteed),
157157
}
158158

159159
impl StabilityLevel {

compiler/rustc_attr_parsing/src/attributes/stability.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -292,12 +292,12 @@ pub(crate) fn parse_stability<S: Stage>(
292292
} else if let Some(version) = parse_version(since) {
293293
StableSince::Version(version)
294294
} else {
295-
cx.emit_err(session_diagnostics::InvalidSince { span: cx.attr_span });
296-
StableSince::Err
295+
let err = cx.emit_err(session_diagnostics::InvalidSince { span: cx.attr_span });
296+
StableSince::Err(err)
297297
}
298298
} else {
299-
cx.emit_err(session_diagnostics::MissingSince { span: cx.attr_span });
300-
StableSince::Err
299+
let err = cx.emit_err(session_diagnostics::MissingSince { span: cx.attr_span });
300+
StableSince::Err(err)
301301
};
302302

303303
match feature {

compiler/rustc_passes/src/lib_features.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl<'tcx> LibFeatureCollector<'tcx> {
4444
StabilityLevel::Stable { since, .. } => FeatureStability::AcceptedSince(match since {
4545
StableSince::Version(v) => Symbol::intern(&v.to_string()),
4646
StableSince::Current => sym::env_CFG_RELEASE,
47-
StableSince::Err => return None,
47+
StableSince::Err(_) => return None,
4848
}),
4949
};
5050

compiler/rustc_passes/src/stability.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ impl<'tcx> MissingStabilityAnnotations<'tcx> {
421421
.emit_err(errors::CannotStabilizeDeprecated { span, item_sp });
422422
}
423423
}
424-
StableSince::Err => {
424+
StableSince::Err(_) => {
425425
// An error already reported. Assume the unparseable stabilization
426426
// version is older than the deprecation version.
427427
}

src/librustdoc/html/render/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1110,7 +1110,7 @@ fn since_to_string(since: &StableSince) -> Option<String> {
11101110
match since {
11111111
StableSince::Version(since) => Some(since.to_string()),
11121112
StableSince::Current => Some(RustcVersion::CURRENT.to_string()),
1113-
StableSince::Err => None,
1113+
StableSince::Err(_) => None,
11141114
}
11151115
}
11161116

src/tools/clippy/clippy_lints/src/std_instead_of_core.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ fn is_stable(cx: &LateContext<'_>, mut def_id: DefId, msrv: Msrv) -> bool {
249249
let stable = match since {
250250
StableSince::Version(v) => msrv.meets(cx, v),
251251
StableSince::Current => msrv.current(cx).is_none(),
252-
StableSince::Err => false,
252+
StableSince::Err(_) => false,
253253
};
254254

255255
if !stable {

src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ pub fn is_stable_const_fn(cx: &LateContext<'_>, def_id: DefId, msrv: Msrv) -> bo
432432
let const_stab_rust_version = match since {
433433
StableSince::Version(version) => version,
434434
StableSince::Current => RustcVersion::CURRENT,
435-
StableSince::Err => return false,
435+
StableSince::Err(_) => return false,
436436
};
437437

438438
msrv.meets(cx, const_stab_rust_version)

0 commit comments

Comments
 (0)