Skip to content

Commit 4029050

Browse files
cfg-step code
1 parent 137d591 commit 4029050

File tree

12 files changed

+52
-62
lines changed

12 files changed

+52
-62
lines changed

compiler/rustc_ast/src/visit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ pub trait Visitor<'ast>: Sized {
251251
macro_rules! walk_list {
252252
($visitor: expr, $method: ident, $list: expr $(, $($extra_args: expr),* )?) => {
253253
{
254-
#[cfg_attr(not(bootstrap), allow(for_loops_over_fallibles))]
254+
#[allow(for_loops_over_fallibles)]
255255
for elem in $list {
256256
$visitor.$method(elem $(, $($extra_args,)* )?)
257257
}

compiler/rustc_errors/src/diagnostic.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ impl<'source> Into<FluentValue<'source>> for DiagnosticArgValue<'source> {
5555

5656
/// Trait implemented by error types. This should not be implemented manually. Instead, use
5757
/// `#[derive(Subdiagnostic)]` -- see [rustc_macros::Subdiagnostic].
58-
#[cfg_attr(bootstrap, rustc_diagnostic_item = "AddSubdiagnostic")]
59-
#[cfg_attr(not(bootstrap), rustc_diagnostic_item = "AddToDiagnostic")]
58+
#[rustc_diagnostic_item = "AddToDiagnostic"]
6059
pub trait AddToDiagnostic
6160
where
6261
Self: Sized,

compiler/rustc_errors/src/diagnostic_builder.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ use std::thread::panicking;
1616

1717
/// Trait implemented by error types. This should not be implemented manually. Instead, use
1818
/// `#[derive(Diagnostic)]` -- see [rustc_macros::Diagnostic].
19-
#[cfg_attr(bootstrap, rustc_diagnostic_item = "SessionDiagnostic")]
20-
#[cfg_attr(not(bootstrap), rustc_diagnostic_item = "IntoDiagnostic")]
19+
#[rustc_diagnostic_item = "IntoDiagnostic"]
2120
pub trait IntoDiagnostic<'a, T: EmissionGuarantee = ErrorGuaranteed> {
2221
/// Write out as a diagnostic out of `Handler`.
2322
#[must_use]

compiler/rustc_middle/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@
4343
#![feature(type_alias_impl_trait)]
4444
#![feature(associated_type_bounds)]
4545
#![feature(rustc_attrs)]
46-
#![cfg_attr(bootstrap, feature(half_open_range_patterns))]
4746
#![feature(control_flow_enum)]
4847
#![feature(associated_type_defaults)]
4948
#![feature(trusted_step)]

library/alloc/src/alloc.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,16 @@ extern "Rust" {
2828
// The rustc fork of LLVM 14 and earlier also special-cases these function names to be able to optimize them
2929
// like `malloc`, `realloc`, and `free`, respectively.
3030
#[rustc_allocator]
31-
#[cfg_attr(not(bootstrap), rustc_nounwind)]
32-
#[cfg_attr(bootstrap, rustc_allocator_nounwind)]
31+
#[rustc_nounwind]
3332
fn __rust_alloc(size: usize, align: usize) -> *mut u8;
3433
#[rustc_deallocator]
35-
#[cfg_attr(not(bootstrap), rustc_nounwind)]
36-
#[cfg_attr(bootstrap, rustc_allocator_nounwind)]
34+
#[rustc_nounwind]
3735
fn __rust_dealloc(ptr: *mut u8, size: usize, align: usize);
3836
#[rustc_reallocator]
39-
#[cfg_attr(not(bootstrap), rustc_nounwind)]
40-
#[cfg_attr(bootstrap, rustc_allocator_nounwind)]
37+
#[rustc_nounwind]
4138
fn __rust_realloc(ptr: *mut u8, old_size: usize, align: usize, new_size: usize) -> *mut u8;
4239
#[rustc_allocator_zeroed]
43-
#[cfg_attr(not(bootstrap), rustc_nounwind)]
44-
#[cfg_attr(bootstrap, rustc_allocator_nounwind)]
40+
#[rustc_nounwind]
4541
fn __rust_alloc_zeroed(size: usize, align: usize) -> *mut u8;
4642
}
4743

library/core/src/default.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
/// ```
100100
#[cfg_attr(not(test), rustc_diagnostic_item = "Default")]
101101
#[stable(feature = "rust1", since = "1.0.0")]
102-
#[cfg_attr(not(bootstrap), const_trait)]
102+
#[const_trait]
103103
pub trait Default: Sized {
104104
/// Returns the "default value" for a type.
105105
///

0 commit comments

Comments
 (0)