Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 6b2d3d5

Browse files
committedJul 1, 2022
update cfg(bootstrap)s
1 parent da957f6 commit 6b2d3d5

File tree

26 files changed

+84
-220
lines changed

26 files changed

+84
-220
lines changed
 

‎compiler/rustc_borrowck/src/borrowck_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ impl<'cx, 'tcx> crate::MirBorrowckCtxt<'cx, 'tcx> {
478478
struct_span_err!(self, span, E0716, "temporary value dropped while borrowed",)
479479
}
480480

481-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
481+
#[rustc_lint_diagnostics]
482482
fn struct_span_err_with_code<S: Into<MultiSpan>>(
483483
&self,
484484
sp: S,

‎compiler/rustc_errors/src/diagnostic.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ impl Diagnostic {
286286
///
287287
/// This span is *not* considered a ["primary span"][`MultiSpan`]; only
288288
/// the `Span` supplied when creating the diagnostic is primary.
289-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
289+
#[rustc_lint_diagnostics]
290290
pub fn span_label(&mut self, span: Span, label: impl Into<SubdiagnosticMessage>) -> &mut Self {
291291
self.span.push_span_label(span, self.subdiagnostic_message_to_diagnostic_message(label));
292292
self
@@ -405,7 +405,7 @@ impl Diagnostic {
405405
}
406406

407407
/// Add a note attached to this diagnostic.
408-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
408+
#[rustc_lint_diagnostics]
409409
pub fn note(&mut self, msg: impl Into<SubdiagnosticMessage>) -> &mut Self {
410410
self.sub(Level::Note, msg, MultiSpan::new(), None);
411411
self
@@ -428,7 +428,7 @@ impl Diagnostic {
428428

429429
/// Prints the span with a note above it.
430430
/// This is like [`Diagnostic::note()`], but it gets its own span.
431-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
431+
#[rustc_lint_diagnostics]
432432
pub fn span_note<S: Into<MultiSpan>>(
433433
&mut self,
434434
sp: S,
@@ -450,15 +450,15 @@ impl Diagnostic {
450450
}
451451

452452
/// Add a warning attached to this diagnostic.
453-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
453+
#[rustc_lint_diagnostics]
454454
pub fn warn(&mut self, msg: impl Into<SubdiagnosticMessage>) -> &mut Self {
455455
self.sub(Level::Warning(None), msg, MultiSpan::new(), None);
456456
self
457457
}
458458

459459
/// Prints the span with a warning above it.
460460
/// This is like [`Diagnostic::warn()`], but it gets its own span.
461-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
461+
#[rustc_lint_diagnostics]
462462
pub fn span_warn<S: Into<MultiSpan>>(
463463
&mut self,
464464
sp: S,
@@ -469,7 +469,7 @@ impl Diagnostic {
469469
}
470470

471471
/// Add a help message attached to this diagnostic.
472-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
472+
#[rustc_lint_diagnostics]
473473
pub fn help(&mut self, msg: impl Into<SubdiagnosticMessage>) -> &mut Self {
474474
self.sub(Level::Help, msg, MultiSpan::new(), None);
475475
self
@@ -483,7 +483,7 @@ impl Diagnostic {
483483

484484
/// Prints the span with some help above it.
485485
/// This is like [`Diagnostic::help()`], but it gets its own span.
486-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
486+
#[rustc_lint_diagnostics]
487487
pub fn span_help<S: Into<MultiSpan>>(
488488
&mut self,
489489
sp: S,

‎compiler/rustc_errors/src/lib.rs

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ impl Handler {
649649
/// Attempting to `.emit()` the builder will only emit if either:
650650
/// * `can_emit_warnings` is `true`
651651
/// * `is_force_warn` was set in `DiagnosticId::Lint`
652-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
652+
#[rustc_lint_diagnostics]
653653
pub fn struct_span_warn(
654654
&self,
655655
span: impl Into<MultiSpan>,
@@ -678,7 +678,7 @@ impl Handler {
678678
}
679679

680680
/// Construct a builder at the `Allow` level at the given `span` and with the `msg`.
681-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
681+
#[rustc_lint_diagnostics]
682682
pub fn struct_span_allow(
683683
&self,
684684
span: impl Into<MultiSpan>,
@@ -691,7 +691,7 @@ impl Handler {
691691

692692
/// Construct a builder at the `Warning` level at the given `span` and with the `msg`.
693693
/// Also include a code.
694-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
694+
#[rustc_lint_diagnostics]
695695
pub fn struct_span_warn_with_code(
696696
&self,
697697
span: impl Into<MultiSpan>,
@@ -708,7 +708,7 @@ impl Handler {
708708
/// Attempting to `.emit()` the builder will only emit if either:
709709
/// * `can_emit_warnings` is `true`
710710
/// * `is_force_warn` was set in `DiagnosticId::Lint`
711-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
711+
#[rustc_lint_diagnostics]
712712
pub fn struct_warn(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, ()> {
713713
DiagnosticBuilder::new(self, Level::Warning(None), msg)
714714
}
@@ -728,13 +728,13 @@ impl Handler {
728728
}
729729

730730
/// Construct a builder at the `Allow` level with the `msg`.
731-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
731+
#[rustc_lint_diagnostics]
732732
pub fn struct_allow(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, ()> {
733733
DiagnosticBuilder::new(self, Level::Allow, msg)
734734
}
735735

736736
/// Construct a builder at the `Expect` level with the `msg`.
737-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
737+
#[rustc_lint_diagnostics]
738738
pub fn struct_expect(
739739
&self,
740740
msg: impl Into<DiagnosticMessage>,
@@ -744,7 +744,7 @@ impl Handler {
744744
}
745745

746746
/// Construct a builder at the `Error` level at the given `span` and with the `msg`.
747-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
747+
#[rustc_lint_diagnostics]
748748
pub fn struct_span_err(
749749
&self,
750750
span: impl Into<MultiSpan>,
@@ -756,7 +756,7 @@ impl Handler {
756756
}
757757

758758
/// Construct a builder at the `Error` level at the given `span`, with the `msg`, and `code`.
759-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
759+
#[rustc_lint_diagnostics]
760760
pub fn struct_span_err_with_code(
761761
&self,
762762
span: impl Into<MultiSpan>,
@@ -770,7 +770,7 @@ impl Handler {
770770

771771
/// Construct a builder at the `Error` level with the `msg`.
772772
// FIXME: This method should be removed (every error should have an associated error code).
773-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
773+
#[rustc_lint_diagnostics]
774774
pub fn struct_err(
775775
&self,
776776
msg: impl Into<DiagnosticMessage>,
@@ -785,7 +785,7 @@ impl Handler {
785785
}
786786

787787
/// Construct a builder at the `Error` level with the `msg` and the `code`.
788-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
788+
#[rustc_lint_diagnostics]
789789
pub fn struct_err_with_code(
790790
&self,
791791
msg: impl Into<DiagnosticMessage>,
@@ -797,7 +797,7 @@ impl Handler {
797797
}
798798

799799
/// Construct a builder at the `Warn` level with the `msg` and the `code`.
800-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
800+
#[rustc_lint_diagnostics]
801801
pub fn struct_warn_with_code(
802802
&self,
803803
msg: impl Into<DiagnosticMessage>,
@@ -809,7 +809,7 @@ impl Handler {
809809
}
810810

811811
/// Construct a builder at the `Fatal` level at the given `span` and with the `msg`.
812-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
812+
#[rustc_lint_diagnostics]
813813
pub fn struct_span_fatal(
814814
&self,
815815
span: impl Into<MultiSpan>,
@@ -821,7 +821,7 @@ impl Handler {
821821
}
822822

823823
/// Construct a builder at the `Fatal` level at the given `span`, with the `msg`, and `code`.
824-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
824+
#[rustc_lint_diagnostics]
825825
pub fn struct_span_fatal_with_code(
826826
&self,
827827
span: impl Into<MultiSpan>,
@@ -834,33 +834,33 @@ impl Handler {
834834
}
835835

836836
/// Construct a builder at the `Error` level with the `msg`.
837-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
837+
#[rustc_lint_diagnostics]
838838
pub fn struct_fatal(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, !> {
839839
DiagnosticBuilder::new_fatal(self, msg)
840840
}
841841

842842
/// Construct a builder at the `Help` level with the `msg`.
843-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
843+
#[rustc_lint_diagnostics]
844844
pub fn struct_help(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, ()> {
845845
DiagnosticBuilder::new(self, Level::Help, msg)
846846
}
847847

848848
/// Construct a builder at the `Note` level with the `msg`.
849-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
849+
#[rustc_lint_diagnostics]
850850
pub fn struct_note_without_error(
851851
&self,
852852
msg: impl Into<DiagnosticMessage>,
853853
) -> DiagnosticBuilder<'_, ()> {
854854
DiagnosticBuilder::new(self, Level::Note, msg)
855855
}
856856

857-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
857+
#[rustc_lint_diagnostics]
858858
pub fn span_fatal(&self, span: impl Into<MultiSpan>, msg: impl Into<DiagnosticMessage>) -> ! {
859859
self.emit_diag_at_span(Diagnostic::new(Fatal, msg), span);
860860
FatalError.raise()
861861
}
862862

863-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
863+
#[rustc_lint_diagnostics]
864864
pub fn span_fatal_with_code(
865865
&self,
866866
span: impl Into<MultiSpan>,
@@ -871,7 +871,7 @@ impl Handler {
871871
FatalError.raise()
872872
}
873873

874-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
874+
#[rustc_lint_diagnostics]
875875
pub fn span_err(
876876
&self,
877877
span: impl Into<MultiSpan>,
@@ -880,7 +880,7 @@ impl Handler {
880880
self.emit_diag_at_span(Diagnostic::new(Error { lint: false }, msg), span).unwrap()
881881
}
882882

883-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
883+
#[rustc_lint_diagnostics]
884884
pub fn span_err_with_code(
885885
&self,
886886
span: impl Into<MultiSpan>,
@@ -893,12 +893,12 @@ impl Handler {
893893
);
894894
}
895895

896-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
896+
#[rustc_lint_diagnostics]
897897
pub fn span_warn(&self, span: impl Into<MultiSpan>, msg: impl Into<DiagnosticMessage>) {
898898
self.emit_diag_at_span(Diagnostic::new(Warning(None), msg), span);
899899
}
900900

901-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
901+
#[rustc_lint_diagnostics]
902902
pub fn span_warn_with_code(
903903
&self,
904904
span: impl Into<MultiSpan>,

‎compiler/rustc_expand/src/base.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ impl<'a> ExtCtxt<'a> {
10771077
self.current_expansion.id.expansion_cause()
10781078
}
10791079

1080-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
1080+
#[rustc_lint_diagnostics]
10811081
pub fn struct_span_err<S: Into<MultiSpan>>(
10821082
&self,
10831083
sp: S,
@@ -1102,11 +1102,11 @@ impl<'a> ExtCtxt<'a> {
11021102
///
11031103
/// Compilation will be stopped in the near future (at the end of
11041104
/// the macro expansion phase).
1105-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
1105+
#[rustc_lint_diagnostics]
11061106
pub fn span_err<S: Into<MultiSpan>>(&self, sp: S, msg: &str) {
11071107
self.sess.parse_sess.span_diagnostic.span_err(sp, msg);
11081108
}
1109-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
1109+
#[rustc_lint_diagnostics]
11101110
pub fn span_warn<S: Into<MultiSpan>>(&self, sp: S, msg: &str) {
11111111
self.sess.parse_sess.span_diagnostic.span_warn(sp, msg);
11121112
}

‎compiler/rustc_parse/src/parser/diagnostics.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ impl<'a> DerefMut for SnapshotParser<'a> {
357357
}
358358

359359
impl<'a> Parser<'a> {
360-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
360+
#[rustc_lint_diagnostics]
361361
pub(super) fn span_err<S: Into<MultiSpan>>(
362362
&self,
363363
sp: S,
@@ -366,7 +366,7 @@ impl<'a> Parser<'a> {
366366
err.span_err(sp, self.diagnostic())
367367
}
368368

369-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
369+
#[rustc_lint_diagnostics]
370370
pub fn struct_span_err<S: Into<MultiSpan>>(
371371
&self,
372372
sp: S,

‎compiler/rustc_resolve/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#![feature(let_chains)]
1414
#![feature(let_else)]
1515
#![feature(never_type)]
16-
#![cfg_attr(bootstrap, feature(nll))]
1716
#![recursion_limit = "256"]
1817
#![allow(rustdoc::private_intra_doc_links)]
1918
#![allow(rustc::potential_query_instability)]

‎compiler/rustc_session/src/config.rs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,49 +1102,6 @@ impl CrateCheckConfig {
11021102
.extend(atomic_values);
11031103

11041104
// Target specific values
1105-
#[cfg(bootstrap)]
1106-
{
1107-
for target in TARGETS
1108-
.iter()
1109-
.map(|target| Target::expect_builtin(&TargetTriple::from_triple(target)))
1110-
{
1111-
self.values_valid
1112-
.entry(sym::target_os)
1113-
.or_default()
1114-
.insert(Symbol::intern(&target.options.os));
1115-
self.values_valid
1116-
.entry(sym::target_family)
1117-
.or_default()
1118-
.extend(target.options.families.iter().map(|family| Symbol::intern(family)));
1119-
self.values_valid
1120-
.entry(sym::target_arch)
1121-
.or_default()
1122-
.insert(Symbol::intern(&target.arch));
1123-
self.values_valid
1124-
.entry(sym::target_endian)
1125-
.or_default()
1126-
.insert(Symbol::intern(&target.options.endian.as_str()));
1127-
self.values_valid
1128-
.entry(sym::target_env)
1129-
.or_default()
1130-
.insert(Symbol::intern(&target.options.env));
1131-
self.values_valid
1132-
.entry(sym::target_abi)
1133-
.or_default()
1134-
.insert(Symbol::intern(&target.options.abi));
1135-
self.values_valid
1136-
.entry(sym::target_vendor)
1137-
.or_default()
1138-
.insert(Symbol::intern(&target.options.vendor));
1139-
self.values_valid
1140-
.entry(sym::target_pointer_width)
1141-
.or_default()
1142-
.insert(sym::integer(target.pointer_width));
1143-
}
1144-
}
1145-
1146-
// Target specific values
1147-
#[cfg(not(bootstrap))]
11481105
{
11491106
const VALUES: [&Symbol; 8] = [
11501107
&sym::target_os,

‎compiler/rustc_session/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#![feature(once_cell)]
77
#![feature(option_get_or_insert_default)]
88
#![feature(rustc_attrs)]
9-
#![cfg_attr(not(bootstrap), feature(map_many_mut))]
9+
#![feature(map_many_mut)]
1010
#![recursion_limit = "256"]
1111
#![allow(rustc::potential_query_instability)]
1212

‎compiler/rustc_session/src/parse.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,15 +311,15 @@ impl ParseSess {
311311
self.create_warning(warning).emit()
312312
}
313313

314-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
314+
#[rustc_lint_diagnostics]
315315
pub fn struct_err(
316316
&self,
317317
msg: impl Into<DiagnosticMessage>,
318318
) -> DiagnosticBuilder<'_, ErrorGuaranteed> {
319319
self.span_diagnostic.struct_err(msg)
320320
}
321321

322-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
322+
#[rustc_lint_diagnostics]
323323
pub fn struct_warn(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, ()> {
324324
self.span_diagnostic.struct_warn(msg)
325325
}

‎compiler/rustc_session/src/session.rs

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -280,15 +280,15 @@ impl Session {
280280
self.crate_types.set(crate_types).expect("`crate_types` was initialized twice")
281281
}
282282

283-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
283+
#[rustc_lint_diagnostics]
284284
pub fn struct_span_warn<S: Into<MultiSpan>>(
285285
&self,
286286
sp: S,
287287
msg: impl Into<DiagnosticMessage>,
288288
) -> DiagnosticBuilder<'_, ()> {
289289
self.diagnostic().struct_span_warn(sp, msg)
290290
}
291-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
291+
#[rustc_lint_diagnostics]
292292
pub fn struct_span_warn_with_expectation<S: Into<MultiSpan>>(
293293
&self,
294294
sp: S,
@@ -297,7 +297,7 @@ impl Session {
297297
) -> DiagnosticBuilder<'_, ()> {
298298
self.diagnostic().struct_span_warn_with_expectation(sp, msg, id)
299299
}
300-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
300+
#[rustc_lint_diagnostics]
301301
pub fn struct_span_warn_with_code<S: Into<MultiSpan>>(
302302
&self,
303303
sp: S,
@@ -306,47 +306,47 @@ impl Session {
306306
) -> DiagnosticBuilder<'_, ()> {
307307
self.diagnostic().struct_span_warn_with_code(sp, msg, code)
308308
}
309-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
309+
#[rustc_lint_diagnostics]
310310
pub fn struct_warn(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, ()> {
311311
self.diagnostic().struct_warn(msg)
312312
}
313-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
313+
#[rustc_lint_diagnostics]
314314
pub fn struct_warn_with_expectation(
315315
&self,
316316
msg: impl Into<DiagnosticMessage>,
317317
id: lint::LintExpectationId,
318318
) -> DiagnosticBuilder<'_, ()> {
319319
self.diagnostic().struct_warn_with_expectation(msg, id)
320320
}
321-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
321+
#[rustc_lint_diagnostics]
322322
pub fn struct_span_allow<S: Into<MultiSpan>>(
323323
&self,
324324
sp: S,
325325
msg: impl Into<DiagnosticMessage>,
326326
) -> DiagnosticBuilder<'_, ()> {
327327
self.diagnostic().struct_span_allow(sp, msg)
328328
}
329-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
329+
#[rustc_lint_diagnostics]
330330
pub fn struct_allow(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, ()> {
331331
self.diagnostic().struct_allow(msg)
332332
}
333-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
333+
#[rustc_lint_diagnostics]
334334
pub fn struct_expect(
335335
&self,
336336
msg: impl Into<DiagnosticMessage>,
337337
id: lint::LintExpectationId,
338338
) -> DiagnosticBuilder<'_, ()> {
339339
self.diagnostic().struct_expect(msg, id)
340340
}
341-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
341+
#[rustc_lint_diagnostics]
342342
pub fn struct_span_err<S: Into<MultiSpan>>(
343343
&self,
344344
sp: S,
345345
msg: impl Into<DiagnosticMessage>,
346346
) -> DiagnosticBuilder<'_, ErrorGuaranteed> {
347347
self.diagnostic().struct_span_err(sp, msg)
348348
}
349-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
349+
#[rustc_lint_diagnostics]
350350
pub fn struct_span_err_with_code<S: Into<MultiSpan>>(
351351
&self,
352352
sp: S,
@@ -356,38 +356,38 @@ impl Session {
356356
self.diagnostic().struct_span_err_with_code(sp, msg, code)
357357
}
358358
// FIXME: This method should be removed (every error should have an associated error code).
359-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
359+
#[rustc_lint_diagnostics]
360360
pub fn struct_err(
361361
&self,
362362
msg: impl Into<DiagnosticMessage>,
363363
) -> DiagnosticBuilder<'_, ErrorGuaranteed> {
364364
self.parse_sess.struct_err(msg)
365365
}
366-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
366+
#[rustc_lint_diagnostics]
367367
pub fn struct_err_with_code(
368368
&self,
369369
msg: impl Into<DiagnosticMessage>,
370370
code: DiagnosticId,
371371
) -> DiagnosticBuilder<'_, ErrorGuaranteed> {
372372
self.diagnostic().struct_err_with_code(msg, code)
373373
}
374-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
374+
#[rustc_lint_diagnostics]
375375
pub fn struct_warn_with_code(
376376
&self,
377377
msg: impl Into<DiagnosticMessage>,
378378
code: DiagnosticId,
379379
) -> DiagnosticBuilder<'_, ()> {
380380
self.diagnostic().struct_warn_with_code(msg, code)
381381
}
382-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
382+
#[rustc_lint_diagnostics]
383383
pub fn struct_span_fatal<S: Into<MultiSpan>>(
384384
&self,
385385
sp: S,
386386
msg: impl Into<DiagnosticMessage>,
387387
) -> DiagnosticBuilder<'_, !> {
388388
self.diagnostic().struct_span_fatal(sp, msg)
389389
}
390-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
390+
#[rustc_lint_diagnostics]
391391
pub fn struct_span_fatal_with_code<S: Into<MultiSpan>>(
392392
&self,
393393
sp: S,
@@ -396,16 +396,16 @@ impl Session {
396396
) -> DiagnosticBuilder<'_, !> {
397397
self.diagnostic().struct_span_fatal_with_code(sp, msg, code)
398398
}
399-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
399+
#[rustc_lint_diagnostics]
400400
pub fn struct_fatal(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, !> {
401401
self.diagnostic().struct_fatal(msg)
402402
}
403403

404-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
404+
#[rustc_lint_diagnostics]
405405
pub fn span_fatal<S: Into<MultiSpan>>(&self, sp: S, msg: impl Into<DiagnosticMessage>) -> ! {
406406
self.diagnostic().span_fatal(sp, msg)
407407
}
408-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
408+
#[rustc_lint_diagnostics]
409409
pub fn span_fatal_with_code<S: Into<MultiSpan>>(
410410
&self,
411411
sp: S,
@@ -414,11 +414,11 @@ impl Session {
414414
) -> ! {
415415
self.diagnostic().span_fatal_with_code(sp, msg, code)
416416
}
417-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
417+
#[rustc_lint_diagnostics]
418418
pub fn fatal(&self, msg: impl Into<DiagnosticMessage>) -> ! {
419419
self.diagnostic().fatal(msg).raise()
420420
}
421-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
421+
#[rustc_lint_diagnostics]
422422
pub fn span_err_or_warn<S: Into<MultiSpan>>(
423423
&self,
424424
is_warning: bool,
@@ -431,15 +431,15 @@ impl Session {
431431
self.span_err(sp, msg);
432432
}
433433
}
434-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
434+
#[rustc_lint_diagnostics]
435435
pub fn span_err<S: Into<MultiSpan>>(
436436
&self,
437437
sp: S,
438438
msg: impl Into<DiagnosticMessage>,
439439
) -> ErrorGuaranteed {
440440
self.diagnostic().span_err(sp, msg)
441441
}
442-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
442+
#[rustc_lint_diagnostics]
443443
pub fn span_err_with_code<S: Into<MultiSpan>>(
444444
&self,
445445
sp: S,
@@ -448,7 +448,7 @@ impl Session {
448448
) {
449449
self.diagnostic().span_err_with_code(sp, msg, code)
450450
}
451-
#[cfg_attr(not(bootstrap), rustc_lint_diagnostics)]
451+
#[rustc_lint_diagnostics]
452452
pub fn err(&self, msg: impl Into<DiagnosticMessage>) -> ErrorGuaranteed {
453453
self.diagnostic().err(msg)
454454
}

‎library/alloc/src/boxed.rs

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ impl<T> Box<T> {
206206
/// ```
207207
/// let five = Box::new(5);
208208
/// ```
209-
#[cfg(all(not(no_global_oom_handling), not(bootstrap)))]
209+
#[cfg(all(not(no_global_oom_handling)))]
210210
#[inline(always)]
211211
#[stable(feature = "rust1", since = "1.0.0")]
212212
#[must_use]
@@ -215,23 +215,6 @@ impl<T> Box<T> {
215215
Box::new(x)
216216
}
217217

218-
/// Allocates memory on the heap and then places `x` into it.
219-
///
220-
/// This doesn't actually allocate if `T` is zero-sized.
221-
///
222-
/// # Examples
223-
///
224-
/// ```
225-
/// let five = Box::new(5);
226-
/// ```
227-
#[cfg(all(not(no_global_oom_handling), bootstrap))]
228-
#[inline(always)]
229-
#[stable(feature = "rust1", since = "1.0.0")]
230-
#[must_use]
231-
pub fn new(x: T) -> Self {
232-
box x
233-
}
234-
235218
/// Constructs a new box with uninitialized contents.
236219
///
237220
/// # Examples
@@ -296,7 +279,7 @@ impl<T> Box<T> {
296279
#[must_use]
297280
#[inline(always)]
298281
pub fn pin(x: T) -> Pin<Box<T>> {
299-
(#[cfg_attr(not(bootstrap), rustc_box)]
282+
(#[rustc_box]
300283
Box::new(x))
301284
.into()
302285
}
@@ -1255,7 +1238,7 @@ unsafe impl<#[may_dangle] T: ?Sized, A: Allocator> Drop for Box<T, A> {
12551238
impl<T: Default> Default for Box<T> {
12561239
/// Creates a `Box<T>`, with the `Default` value for T.
12571240
fn default() -> Self {
1258-
#[cfg_attr(not(bootstrap), rustc_box)]
1241+
#[rustc_box]
12591242
Box::new(T::default())
12601243
}
12611244
}
@@ -1628,7 +1611,7 @@ impl<T, const N: usize> From<[T; N]> for Box<[T]> {
16281611
/// println!("{boxed:?}");
16291612
/// ```
16301613
fn from(array: [T; N]) -> Box<[T]> {
1631-
#[cfg_attr(not(bootstrap), rustc_box)]
1614+
#[rustc_box]
16321615
Box::new(array)
16331616
}
16341617
}

‎library/alloc/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@
149149
#![feature(allocator_internals)]
150150
#![feature(allow_internal_unstable)]
151151
#![feature(associated_type_bounds)]
152-
#![cfg_attr(bootstrap, feature(box_syntax))]
153152
#![feature(cfg_sanitize)]
154153
#![feature(const_deref)]
155154
#![feature(const_mut_refs)]

‎library/alloc/src/macros.rs

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
/// be mindful of side effects.
3535
///
3636
/// [`Vec`]: crate::vec::Vec
37-
#[cfg(all(not(no_global_oom_handling), not(test), not(bootstrap)))]
37+
#[cfg(all(not(no_global_oom_handling), not(test)))]
3838
#[macro_export]
3939
#[stable(feature = "rust1", since = "1.0.0")]
4040
#[rustc_diagnostic_item = "vec_macro"]
@@ -54,24 +54,6 @@ macro_rules! vec {
5454
);
5555
}
5656

57-
/// Creates a `Vec` containing the arguments (bootstrap version).
58-
#[cfg(all(not(no_global_oom_handling), not(test), bootstrap))]
59-
#[macro_export]
60-
#[stable(feature = "rust1", since = "1.0.0")]
61-
#[rustc_diagnostic_item = "vec_macro"]
62-
#[allow_internal_unstable(box_syntax, liballoc_internals)]
63-
macro_rules! vec {
64-
() => (
65-
$crate::__rust_force_expr!($crate::vec::Vec::new())
66-
);
67-
($elem:expr; $n:expr) => (
68-
$crate::__rust_force_expr!($crate::vec::from_elem($elem, $n))
69-
);
70-
($($x:expr),+ $(,)?) => (
71-
$crate::__rust_force_expr!(<[_]>::into_vec(box [$($x),+]))
72-
);
73-
}
74-
7557
// HACK(japaric): with cfg(test) the inherent `[T]::into_vec` method, which is
7658
// required for this macro definition, is not available. Instead use the
7759
// `slice::into_vec` function which is only available with cfg(test)

‎library/alloc/src/vec/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3017,7 +3017,7 @@ impl<T, const N: usize> From<[T; N]> for Vec<T> {
30173017
#[cfg(not(test))]
30183018
fn from(s: [T; N]) -> Vec<T> {
30193019
<[T]>::into_vec(
3020-
#[cfg_attr(not(bootstrap), rustc_box)]
3020+
#[rustc_box]
30213021
Box::new(s),
30223022
)
30233023
}

‎library/core/src/clone.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ use crate::marker::Destruct;
106106
#[lang = "clone"]
107107
#[rustc_diagnostic_item = "Clone"]
108108
#[rustc_trivial_field_reads]
109-
#[cfg_attr(not(bootstrap), const_trait)]
109+
#[const_trait]
110110
pub trait Clone: Sized {
111111
/// Returns a copy of the value.
112112
///
@@ -129,7 +129,6 @@ pub trait Clone: Sized {
129129
/// allocations.
130130
#[inline]
131131
#[stable(feature = "rust1", since = "1.0.0")]
132-
#[cfg_attr(bootstrap, default_method_body_is_const)]
133132
fn clone_from(&mut self, source: &Self)
134133
where
135134
Self: ~const Destruct,

‎library/core/src/cmp.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ use self::Ordering::*;
214214
append_const_msg,
215215
)
216216
)]
217-
#[cfg_attr(not(bootstrap), const_trait)]
217+
#[const_trait]
218218
#[rustc_diagnostic_item = "PartialEq"]
219219
pub trait PartialEq<Rhs: ?Sized = Self> {
220220
/// This method tests for `self` and `other` values to be equal, and is used
@@ -227,7 +227,6 @@ pub trait PartialEq<Rhs: ?Sized = Self> {
227227
#[inline]
228228
#[must_use]
229229
#[stable(feature = "rust1", since = "1.0.0")]
230-
#[cfg_attr(bootstrap, default_method_body_is_const)]
231230
fn ne(&self, other: &Rhs) -> bool {
232231
!self.eq(other)
233232
}
@@ -1054,7 +1053,7 @@ impl PartialOrd for Ordering {
10541053
append_const_msg,
10551054
)
10561055
)]
1057-
#[cfg_attr(not(bootstrap), const_trait)]
1056+
#[const_trait]
10581057
#[rustc_diagnostic_item = "PartialOrd"]
10591058
pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
10601059
/// This method returns an ordering between `self` and `other` values if one exists.
@@ -1098,7 +1097,6 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
10981097
#[inline]
10991098
#[must_use]
11001099
#[stable(feature = "rust1", since = "1.0.0")]
1101-
#[cfg_attr(bootstrap, default_method_body_is_const)]
11021100
fn lt(&self, other: &Rhs) -> bool {
11031101
matches!(self.partial_cmp(other), Some(Less))
11041102
}
@@ -1118,7 +1116,6 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
11181116
#[inline]
11191117
#[must_use]
11201118
#[stable(feature = "rust1", since = "1.0.0")]
1121-
#[cfg_attr(bootstrap, default_method_body_is_const)]
11221119
fn le(&self, other: &Rhs) -> bool {
11231120
// Pattern `Some(Less | Eq)` optimizes worse than negating `None | Some(Greater)`.
11241121
// FIXME: The root cause was fixed upstream in LLVM with:
@@ -1141,7 +1138,6 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
11411138
#[inline]
11421139
#[must_use]
11431140
#[stable(feature = "rust1", since = "1.0.0")]
1144-
#[cfg_attr(bootstrap, default_method_body_is_const)]
11451141
fn gt(&self, other: &Rhs) -> bool {
11461142
matches!(self.partial_cmp(other), Some(Greater))
11471143
}
@@ -1161,7 +1157,6 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
11611157
#[inline]
11621158
#[must_use]
11631159
#[stable(feature = "rust1", since = "1.0.0")]
1164-
#[cfg_attr(bootstrap, default_method_body_is_const)]
11651160
fn ge(&self, other: &Rhs) -> bool {
11661161
matches!(self.partial_cmp(other), Some(Greater | Equal))
11671162
}

‎library/core/src/fmt/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2562,7 +2562,7 @@ macro_rules! tuple {
25622562

25632563
macro_rules! maybe_tuple_doc {
25642564
($a:ident @ #[$meta:meta] $item:item) => {
2565-
#[cfg_attr(not(bootstrap), doc(tuple_variadic))]
2565+
#[doc(tuple_variadic)]
25662566
#[doc = "This trait is implemented for tuples up to twelve items long."]
25672567
#[$meta]
25682568
$item

‎library/core/src/hash/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ mod impls {
900900

901901
macro_rules! maybe_tuple_doc {
902902
($a:ident @ #[$meta:meta] $item:item) => {
903-
#[cfg_attr(not(bootstrap), doc(tuple_variadic))]
903+
#[doc(tuple_variadic)]
904904
#[doc = "This trait is implemented for tuples up to twelve items long."]
905905
#[$meta]
906906
$item

‎library/core/src/primitive_docs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ impl<T> (T,) {}
996996
// Fake impl that's only really used for docs.
997997
#[cfg(doc)]
998998
#[stable(feature = "rust1", since = "1.0.0")]
999-
#[cfg_attr(not(bootstrap), doc(tuple_variadic))]
999+
#[doc(tuple_variadic)]
10001000
/// This trait is implemented on arbitrary-length tuples.
10011001
impl<T: Clone> Clone for (T,) {
10021002
fn clone(&self) -> Self {
@@ -1007,7 +1007,7 @@ impl<T: Clone> Clone for (T,) {
10071007
// Fake impl that's only really used for docs.
10081008
#[cfg(doc)]
10091009
#[stable(feature = "rust1", since = "1.0.0")]
1010-
#[cfg_attr(not(bootstrap), doc(tuple_variadic))]
1010+
#[doc(tuple_variadic)]
10111011
/// This trait is implemented on arbitrary-length tuples.
10121012
impl<T: Copy> Copy for (T,) {
10131013
// empty

‎library/core/src/ptr/mod.rs

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -492,27 +492,6 @@ pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) {
492492
unsafe { drop_in_place(to_drop) }
493493
}
494494

495-
/// Creates a null raw pointer.
496-
///
497-
/// # Examples
498-
///
499-
/// ```
500-
/// use std::ptr;
501-
///
502-
/// let p: *const i32 = ptr::null();
503-
/// assert!(p.is_null());
504-
/// ```
505-
#[inline(always)]
506-
#[must_use]
507-
#[stable(feature = "rust1", since = "1.0.0")]
508-
#[rustc_promotable]
509-
#[rustc_const_stable(feature = "const_ptr_null", since = "1.24.0")]
510-
#[rustc_diagnostic_item = "ptr_null"]
511-
#[cfg(bootstrap)]
512-
pub const fn null<T>() -> *const T {
513-
invalid(0)
514-
}
515-
516495
/// Creates a null raw pointer.
517496
///
518497
/// # Examples
@@ -530,32 +509,10 @@ pub const fn null<T>() -> *const T {
530509
#[rustc_const_stable(feature = "const_ptr_null", since = "1.24.0")]
531510
#[rustc_allow_const_fn_unstable(ptr_metadata)]
532511
#[rustc_diagnostic_item = "ptr_null"]
533-
#[cfg(not(bootstrap))]
534512
pub const fn null<T: ?Sized + Thin>() -> *const T {
535513
from_raw_parts(invalid(0), ())
536514
}
537515

538-
/// Creates a null mutable raw pointer.
539-
///
540-
/// # Examples
541-
///
542-
/// ```
543-
/// use std::ptr;
544-
///
545-
/// let p: *mut i32 = ptr::null_mut();
546-
/// assert!(p.is_null());
547-
/// ```
548-
#[inline(always)]
549-
#[must_use]
550-
#[stable(feature = "rust1", since = "1.0.0")]
551-
#[rustc_promotable]
552-
#[rustc_const_stable(feature = "const_ptr_null", since = "1.24.0")]
553-
#[rustc_diagnostic_item = "ptr_null_mut"]
554-
#[cfg(bootstrap)]
555-
pub const fn null_mut<T>() -> *mut T {
556-
invalid_mut(0)
557-
}
558-
559516
/// Creates an invalid pointer with the given address.
560517
///
561518
/// This is different from `addr as *const T`, which creates a pointer that picks up a previously
@@ -707,7 +664,6 @@ where
707664
#[rustc_const_stable(feature = "const_ptr_null", since = "1.24.0")]
708665
#[rustc_allow_const_fn_unstable(ptr_metadata)]
709666
#[rustc_diagnostic_item = "ptr_null_mut"]
710-
#[cfg(not(bootstrap))]
711667
pub const fn null_mut<T: ?Sized + Thin>() -> *mut T {
712668
from_raw_parts_mut(invalid_mut(0), ())
713669
}

‎library/core/src/tuple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ macro_rules! tuple_impls {
107107
// Otherwise, it hides the docs entirely.
108108
macro_rules! maybe_tuple_doc {
109109
($a:ident @ #[$meta:meta] $item:item) => {
110-
#[cfg_attr(not(bootstrap), doc(tuple_variadic))]
110+
#[doc(tuple_variadic)]
111111
#[doc = "This trait is implemented for tuples up to twelve items long."]
112112
#[$meta]
113113
$item

‎library/core/tests/ptr.rs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,14 @@ fn test_is_null() {
9696
let nmi: *mut dyn ToString = null_mut::<isize>();
9797
assert!(nmi.is_null());
9898

99-
#[cfg(not(bootstrap))]
100-
{
101-
extern "C" {
102-
type Extern;
103-
}
104-
let ec: *const Extern = null::<Extern>();
105-
assert!(ec.is_null());
106-
107-
let em: *mut Extern = null_mut::<Extern>();
108-
assert!(em.is_null());
99+
extern "C" {
100+
type Extern;
109101
}
102+
let ec: *const Extern = null::<Extern>();
103+
assert!(ec.is_null());
104+
105+
let em: *mut Extern = null_mut::<Extern>();
106+
assert!(em.is_null());
110107
}
111108

112109
#[test]

‎library/std/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,6 @@
249249
#![feature(needs_panic_runtime)]
250250
#![feature(negative_impls)]
251251
#![feature(never_type)]
252-
#![cfg_attr(bootstrap, feature(nll))]
253252
#![feature(platform_intrinsics)]
254253
#![feature(prelude_import)]
255254
#![feature(rustc_attrs)]

‎library/std/src/primitive_docs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ impl<T> (T,) {}
996996
// Fake impl that's only really used for docs.
997997
#[cfg(doc)]
998998
#[stable(feature = "rust1", since = "1.0.0")]
999-
#[cfg_attr(not(bootstrap), doc(tuple_variadic))]
999+
#[doc(tuple_variadic)]
10001000
/// This trait is implemented on arbitrary-length tuples.
10011001
impl<T: Clone> Clone for (T,) {
10021002
fn clone(&self) -> Self {
@@ -1007,7 +1007,7 @@ impl<T: Clone> Clone for (T,) {
10071007
// Fake impl that's only really used for docs.
10081008
#[cfg(doc)]
10091009
#[stable(feature = "rust1", since = "1.0.0")]
1010-
#[cfg_attr(not(bootstrap), doc(tuple_variadic))]
1010+
#[doc(tuple_variadic)]
10111011
/// This trait is implemented on arbitrary-length tuples.
10121012
impl<T: Copy> Copy for (T,) {
10131013
// empty

‎library/unwind/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![no_std]
22
#![unstable(feature = "panic_unwind", issue = "32837")]
33
#![feature(link_cfg)]
4-
#![cfg_attr(bootstrap, feature(native_link_modifiers_bundle))]
54
#![feature(staged_api)]
65
#![feature(c_unwind)]
76
#![feature(cfg_target_abi)]

‎src/librustdoc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#![feature(drain_filter)]
1212
#![feature(let_chains)]
1313
#![feature(let_else)]
14-
#![cfg_attr(bootstrap, feature(nll))]
1514
#![feature(test)]
1615
#![feature(never_type)]
1716
#![feature(once_cell)]

0 commit comments

Comments
 (0)
Please sign in to comment.