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 c48d946

Browse files
authoredJun 12, 2024
Unrolled build for rust-lang#126301
Rollup merge of rust-lang#126301 - nnethercote:sort-crate-attributes, r=davidtwco Use `tidy` to sort crate attributes for all compiler crates. We already do this for a number of crates, e.g. `rustc_middle`, `rustc_span`, `rustc_metadata`, `rustc_span`, `rustc_errors`. For the ones we don't, in many cases the attributes are a mess. - There is no consistency about order of attribute kinds (e.g. `allow`/`deny`/`feature`). - Within attribute kind groups (e.g. the `feature` attributes), sometimes the order is alphabetical, and sometimes there is no particular order. - Sometimes the attributes of a particular kind aren't even grouped all together, e.g. there might be a `feature`, then an `allow`, then another `feature`. This commit extends the existing sorting to all compiler crates, increasing consistency. If any new attribute line is added there is now only one place it can go -- no need for arbitrary decisions. Exceptions: - `rustc_log`, `rustc_next_trait_solver` and `rustc_type_ir_macros`, because they have no crate attributes. - `rustc_codegen_gcc`, because it's quasi-external to rustc (e.g. it's ignored in `rustfmt.toml`). r? `@davidtwco`
2 parents 02c7a59 + 75b164d commit c48d946

File tree

58 files changed

+219
-100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+219
-100
lines changed
 

‎compiler/rustc_feature/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@
1111
//! even if it is stabilized or removed, *do not remove it*. Instead, move the
1212
//! symbol to the `accepted` or `removed` modules respectively.
1313
14+
// tidy-alphabetical-start
1415
#![allow(internal_features)]
15-
#![feature(rustdoc_internals)]
1616
#![doc(rust_logo)]
17+
#![feature(rustdoc_internals)]
18+
// tidy-alphabetical-end
1719

1820
mod accepted;
1921
mod builtin_attrs;

‎compiler/rustc_fluent_macro/src/lib.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
// tidy-alphabetical-start
2+
#![allow(internal_features)]
3+
#![allow(rustc::default_hash_types)]
14
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
25
#![doc(rust_logo)]
3-
#![allow(internal_features)]
4-
#![feature(rustdoc_internals)]
56
#![feature(proc_macro_diagnostic)]
67
#![feature(proc_macro_span)]
7-
#![allow(rustc::default_hash_types)]
8+
#![feature(rustdoc_internals)]
9+
// tidy-alphabetical-end
810

911
use proc_macro::TokenStream;
1012

‎compiler/rustc_fs_util/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
// tidy-alphabetical-start
12
use std::ffi::CString;
23
use std::fs;
34
use std::io;
45
use std::path::{absolute, Path, PathBuf};
6+
// tidy-alphabetical-end
57

68
// Unfortunately, on windows, it looks like msvcrt.dll is silently translating
79
// verbatim paths under the hood to non-verbatim paths! This manifests itself as
There was a problem loading the remainder of the diff.

0 commit comments

Comments
 (0)
Failed to load comments.