Skip to content

Commit 2a752c2

Browse files
committed
Add tidy-alphabetical-start/end around feature lists and, in some cases, allow/warn/deny lists
1 parent cbb48a5 commit 2a752c2

File tree

79 files changed

+527
-356
lines changed

Some content is hidden

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

79 files changed

+527
-356
lines changed

Diff for: compiler/rustc_arena/src/lib.rs

+10-7
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,23 @@
1111
html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
1212
test(no_crate_inject, attr(deny(warnings)))
1313
)]
14+
// tidy-alphabetical-start
15+
#![deny(rustc::diagnostic_outside_of_impl)]
16+
#![deny(rustc::untranslatable_diagnostic)]
17+
#![deny(unsafe_op_in_unsafe_fn)]
18+
#![feature(decl_macro)]
1419
#![feature(dropck_eyepatch)]
15-
#![feature(new_uninit)]
1620
#![feature(maybe_uninit_slice)]
1721
#![feature(min_specialization)]
18-
#![feature(decl_macro)]
22+
#![feature(new_uninit)]
1923
#![feature(pointer_byte_offsets)]
2024
#![feature(rustc_attrs)]
21-
#![cfg_attr(test, feature(test))]
2225
#![feature(strict_provenance)]
23-
#![deny(unsafe_op_in_unsafe_fn)]
24-
#![deny(rustc::untranslatable_diagnostic)]
25-
#![deny(rustc::diagnostic_outside_of_impl)]
26+
// tidy-alphabetical-end
2627
#![cfg_attr(not(bootstrap), allow(internal_features))]
27-
#![allow(clippy::mut_from_ref)] // Arena allocators are one of the places where this pattern is fine.
28+
#![cfg_attr(test, feature(test))]
29+
// Arena allocators are one of the places where this pattern is fine.
30+
#![allow(clippy::mut_from_ref)]
2831

2932
use smallvec::SmallVec;
3033

Diff for: compiler/rustc_ast/src/lib.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/",
99
test(attr(deny(warnings)))
1010
)]
11+
// tidy-alphabetical-start
12+
#![deny(rustc::diagnostic_outside_of_impl)]
13+
#![deny(rustc::untranslatable_diagnostic)]
1114
#![feature(associated_type_bounds)]
1215
#![feature(box_patterns)]
1316
#![feature(const_trait_impl)]
@@ -16,9 +19,8 @@
1619
#![feature(min_specialization)]
1720
#![feature(negative_impls)]
1821
#![feature(stmt_expr_attributes)]
22+
// tidy-alphabetical-end
1923
#![recursion_limit = "256"]
20-
#![deny(rustc::untranslatable_diagnostic)]
21-
#![deny(rustc::diagnostic_outside_of_impl)]
2224

2325
#[macro_use]
2426
extern crate rustc_macros;

Diff for: compiler/rustc_ast_lowering/src/lib.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@
3030
//! get confused if the spans from leaf AST nodes occur in multiple places
3131
//! in the HIR, especially for multiple identifiers.
3232
33+
// tidy-alphabetical-start
34+
#![deny(rustc::diagnostic_outside_of_impl)]
35+
#![deny(rustc::untranslatable_diagnostic)]
3336
#![feature(box_patterns)]
3437
#![feature(let_chains)]
3538
#![feature(never_type)]
39+
// tidy-alphabetical-end
3640
#![recursion_limit = "256"]
37-
#![deny(rustc::untranslatable_diagnostic)]
38-
#![deny(rustc::diagnostic_outside_of_impl)]
3941

4042
#[macro_use]
4143
extern crate tracing;

Diff for: compiler/rustc_ast_passes/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
//!
55
//! The crate also contains other misc AST visitors, e.g. `node_count` and `show_span`.
66
7+
// tidy-alphabetical-start
78
#![feature(box_patterns)]
89
#![feature(if_let_guard)]
910
#![feature(iter_is_partitioned)]
1011
#![feature(let_chains)]
12+
// tidy-alphabetical-end
1113
#![recursion_limit = "256"]
1214
#![deny(rustc::untranslatable_diagnostic)]
1315
#![deny(rustc::diagnostic_outside_of_impl)]

Diff for: compiler/rustc_ast_pretty/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
#![deny(rustc::untranslatable_diagnostic)]
1+
// tidy-alphabetical-start
22
#![deny(rustc::diagnostic_outside_of_impl)]
3+
#![deny(rustc::untranslatable_diagnostic)]
34
#![feature(associated_type_bounds)]
45
#![feature(box_patterns)]
56
#![feature(with_negative_coherence)]
7+
// tidy-alphabetical-end
68
#![recursion_limit = "256"]
79

810
mod helpers;

Diff for: compiler/rustc_attr/src/lib.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@
44
//! The goal is to move the definition of `MetaItem` and things that don't need to be in `syntax`
55
//! to this crate.
66
7-
#![feature(let_chains)]
8-
#![deny(rustc::untranslatable_diagnostic)]
7+
// tidy-alphabetical-start
98
#![deny(rustc::diagnostic_outside_of_impl)]
9+
#![deny(rustc::untranslatable_diagnostic)]
10+
#![feature(let_chains)]
11+
// tidy-alphabetical-end
1012

1113
#[macro_use]
1214
extern crate rustc_macros;

Diff for: compiler/rustc_borrowck/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
//! This query borrow-checks the MIR to (further) ensure it is not broken.
22
3+
// tidy-alphabetical-start
34
#![feature(associated_type_bounds)]
45
#![feature(box_patterns)]
6+
#![feature(lazy_cell)]
57
#![feature(let_chains)]
68
#![feature(min_specialization)]
79
#![feature(never_type)]
8-
#![feature(lazy_cell)]
910
#![feature(rustc_attrs)]
1011
#![feature(stmt_expr_attributes)]
1112
#![feature(trusted_step)]
1213
#![feature(try_blocks)]
14+
// tidy-alphabetical-end
1315
#![recursion_limit = "256"]
1416
#![cfg_attr(not(bootstrap), allow(internal_features))]
1517

Diff for: compiler/rustc_builtin_macros/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
//! injecting code into the crate before it is lowered to HIR.
33
44
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
5+
// tidy-alphabetical-start
56
#![feature(array_windows)]
67
#![feature(box_patterns)]
78
#![feature(decl_macro)]
@@ -11,6 +12,7 @@
1112
#![feature(lint_reasons)]
1213
#![feature(proc_macro_internals)]
1314
#![feature(proc_macro_quote)]
15+
// tidy-alphabetical-end
1416
#![recursion_limit = "256"]
1517

1618
extern crate proc_macro;

Diff for: compiler/rustc_codegen_cranelift/src/lib.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
#![feature(rustc_private)]
21
// Note: please avoid adding other feature gates where possible
2+
#![feature(rustc_private)]
3+
// tidy-alphabetical-start
34
#![warn(rust_2018_idioms)]
4-
#![warn(unused_lifetimes)]
55
#![warn(unreachable_pub)]
6+
#![warn(unused_lifetimes)]
7+
// tidy-alphabetical-end
68

79
extern crate jobserver;
810
#[macro_use]

Diff for: compiler/rustc_codegen_gcc/src/lib.rs

+13-11
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,22 @@
66
* TODO(antoyo): remove the patches.
77
*/
88

9-
#![feature(
10-
rustc_private,
11-
decl_macro,
12-
associated_type_bounds,
13-
never_type,
14-
trusted_len,
15-
hash_raw_entry
16-
)]
9+
// tidy-alphabetical-start
1710
#![allow(broken_intra_doc_links)]
18-
#![recursion_limit="256"]
11+
#![deny(rustc::diagnostic_outside_of_impl)]
12+
#![deny(rustc::untranslatable_diagnostic)]
1913
#![warn(rust_2018_idioms)]
2014
#![warn(unused_lifetimes)]
21-
#![deny(rustc::untranslatable_diagnostic)]
22-
#![deny(rustc::diagnostic_outside_of_impl)]
15+
// tidy-alphabetical-end
16+
// tidy-alphabetical-start
17+
#![feature(associated_type_bounds)]
18+
#![feature(decl_macro)]
19+
#![feature(hash_raw_entry)]
20+
#![feature(never_type)]
21+
#![feature(rustc_private)]
22+
#![feature(trusted_len)]
23+
// tidy-alphabetical-end
24+
#![recursion_limit="256"]
2325

2426
extern crate rustc_apfloat;
2527
extern crate rustc_ast;

Diff for: compiler/rustc_codegen_llvm/src/lib.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55
//! This API is completely unstable and subject to change.
66
77
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
8+
// tidy-alphabetical-start
9+
#![allow(rustc::potential_query_instability)]
10+
#![deny(rustc::diagnostic_outside_of_impl)]
11+
#![deny(rustc::untranslatable_diagnostic)]
812
#![feature(extern_types)]
913
#![feature(hash_raw_entry)]
14+
#![feature(impl_trait_in_assoc_type)]
1015
#![feature(iter_intersperse)]
1116
#![feature(let_chains)]
1217
#![feature(never_type)]
13-
#![feature(impl_trait_in_assoc_type)]
18+
// tidy-alphabetical-end
1419
#![recursion_limit = "256"]
15-
#![allow(rustc::potential_query_instability)]
16-
#![deny(rustc::untranslatable_diagnostic)]
17-
#![deny(rustc::diagnostic_outside_of_impl)]
1820

1921
#[macro_use]
2022
extern crate rustc_macros;

Diff for: compiler/rustc_codegen_ssa/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
2+
// tidy-alphabetical-start
3+
#![allow(rustc::potential_query_instability)]
24
#![feature(associated_type_bounds)]
35
#![feature(box_patterns)]
46
#![feature(if_let_guard)]
@@ -7,8 +9,8 @@
79
#![feature(never_type)]
810
#![feature(strict_provenance)]
911
#![feature(try_blocks)]
12+
// tidy-alphabetical-end
1013
#![recursion_limit = "256"]
11-
#![allow(rustc::potential_query_instability)]
1214

1315
//! This crate contains codegen code that is used by all codegen backends (LLVM and others).
1416
//! The backend-agnostic functions of this crate use functions defined in various traits that

Diff for: compiler/rustc_const_eval/src/lib.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,25 @@ Rust MIR: a lowered representation of Rust.
44
55
*/
66

7+
// tidy-alphabetical-start
78
#![deny(rustc::untranslatable_diagnostic)]
89
#![feature(assert_matches)]
910
#![feature(box_patterns)]
1011
#![feature(decl_macro)]
1112
#![feature(exact_size_is_empty)]
13+
#![feature(if_let_guard)]
1214
#![feature(let_chains)]
1315
#![feature(map_try_insert)]
1416
#![feature(min_specialization)]
15-
#![feature(slice_ptr_get)]
16-
#![feature(option_get_or_insert_default)]
1717
#![feature(never_type)]
18+
#![feature(option_get_or_insert_default)]
19+
#![feature(slice_ptr_get)]
1820
#![feature(trait_alias)]
1921
#![feature(trusted_len)]
2022
#![feature(trusted_step)]
2123
#![feature(try_blocks)]
2224
#![feature(yeet_expr)]
23-
#![feature(if_let_guard)]
25+
// tidy-alphabetical-end
2426
#![recursion_limit = "256"]
2527

2628
#[macro_use]

Diff for: compiler/rustc_data_structures/src/lib.rs

+17-15
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,40 @@
77
//! This API is completely unstable and subject to change.
88
99
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
10+
// tidy-alphabetical-start
11+
#![allow(rustc::default_hash_types)]
12+
#![allow(rustc::potential_query_instability)]
13+
#![deny(rustc::diagnostic_outside_of_impl)]
14+
#![deny(rustc::untranslatable_diagnostic)]
15+
#![deny(unsafe_op_in_unsafe_fn)]
16+
#![feature(allocator_api)]
1017
#![feature(array_windows)]
1118
#![feature(associated_type_bounds)]
1219
#![feature(auto_traits)]
1320
#![feature(cell_leak)]
1421
#![feature(core_intrinsics)]
1522
#![feature(extend_one)]
23+
#![feature(get_mut_unchecked)]
1624
#![feature(hash_raw_entry)]
1725
#![feature(hasher_prefixfree_extras)]
26+
#![feature(lazy_cell)]
27+
#![feature(lint_reasons)]
28+
#![feature(macro_metavar_expr)]
1829
#![feature(maybe_uninit_uninit_array)]
1930
#![feature(min_specialization)]
31+
#![feature(negative_impls)]
2032
#![feature(never_type)]
21-
#![feature(type_alias_impl_trait)]
2233
#![feature(new_uninit)]
23-
#![feature(lazy_cell)]
34+
#![feature(ptr_alignment_type)]
2435
#![feature(rustc_attrs)]
25-
#![feature(negative_impls)]
36+
#![feature(strict_provenance)]
2637
#![feature(test)]
2738
#![feature(thread_id_value)]
28-
#![feature(vec_into_raw_parts)]
29-
#![feature(allocator_api)]
30-
#![feature(get_mut_unchecked)]
31-
#![feature(lint_reasons)]
39+
#![feature(type_alias_impl_trait)]
3240
#![feature(unwrap_infallible)]
33-
#![feature(strict_provenance)]
34-
#![feature(ptr_alignment_type)]
35-
#![feature(macro_metavar_expr)]
36-
#![allow(rustc::default_hash_types)]
37-
#![allow(rustc::potential_query_instability)]
38-
#![deny(rustc::untranslatable_diagnostic)]
39-
#![deny(rustc::diagnostic_outside_of_impl)]
41+
#![feature(vec_into_raw_parts)]
42+
// tidy-alphabetical-end
4043
#![cfg_attr(not(bootstrap), allow(internal_features))]
41-
#![deny(unsafe_op_in_unsafe_fn)]
4244

4345
#[macro_use]
4446
extern crate tracing;

Diff for: compiler/rustc_error_messages/src/lib.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
#![feature(let_chains)]
1+
// tidy-alphabetical-start
2+
#![deny(rustc::diagnostic_outside_of_impl)]
3+
#![deny(rustc::untranslatable_diagnostic)]
24
#![feature(lazy_cell)]
5+
#![feature(let_chains)]
36
#![feature(rustc_attrs)]
47
#![feature(type_alias_impl_trait)]
5-
#![deny(rustc::untranslatable_diagnostic)]
6-
#![deny(rustc::diagnostic_outside_of_impl)]
8+
// tidy-alphabetical-end
79
#![cfg_attr(not(bootstrap), allow(internal_features))]
810

911
#[macro_use]

Diff for: compiler/rustc_errors/src/lib.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@
33
//! This module contains the code for creating and emitting diagnostics.
44
55
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
6+
// tidy-alphabetical-start
7+
#![allow(incomplete_features)]
68
#![feature(array_windows)]
9+
#![feature(box_patterns)]
10+
#![feature(error_reporter)]
711
#![feature(extract_if)]
812
#![feature(if_let_guard)]
913
#![feature(let_chains)]
1014
#![feature(never_type)]
1115
#![feature(result_option_inspect)]
1216
#![feature(rustc_attrs)]
13-
#![feature(yeet_expr)]
1417
#![feature(try_blocks)]
15-
#![feature(box_patterns)]
16-
#![feature(error_reporter)]
17-
#![allow(incomplete_features)]
18+
#![feature(yeet_expr)]
19+
// tidy-alphabetical-end
1820
#![cfg_attr(not(bootstrap), allow(internal_features))]
1921

2022
#[macro_use]

Diff for: compiler/rustc_expand/src/lib.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// tidy-alphabetical-start
2+
#![deny(rustc::untranslatable_diagnostic)]
13
#![feature(array_windows)]
24
#![feature(associated_type_bounds)]
35
#![feature(associated_type_defaults)]
@@ -9,8 +11,8 @@
911
#![feature(proc_macro_span)]
1012
#![feature(rustc_attrs)]
1113
#![feature(try_blocks)]
14+
// tidy-alphabetical-end
1215
#![recursion_limit = "256"]
13-
#![deny(rustc::untranslatable_diagnostic)]
1416
#![cfg_attr(not(bootstrap), allow(internal_features))]
1517

1618
#[macro_use]

Diff for: compiler/rustc_feature/src/lib.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@
1010
//! For the purpose of future feature-tracking, once a feature gate is added,
1111
//! even if it is stabilized or removed, *do not remove it*. Instead, move the
1212
//! symbol to the `accepted` or `removed` modules respectively.
13-
14-
#![feature(lazy_cell)]
15-
#![deny(rustc::untranslatable_diagnostic)]
13+
// tidy-alphabetical-start
1614
#![deny(rustc::diagnostic_outside_of_impl)]
15+
#![deny(rustc::untranslatable_diagnostic)]
16+
#![feature(lazy_cell)]
17+
// tidy-alphabetical-end
1718

1819
mod accepted;
1920
mod active;

0 commit comments

Comments
 (0)