Skip to content

Commit f560859

Browse files
committed
Auto merge of #160085 - mejrs:bye_lints, r=<try>
Remove various superfluous lint attributes try-job: dist-aarch64-linux
2 parents ce69831 + 9a17150 commit f560859

11 files changed

Lines changed: 21 additions & 22 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4355,6 +4355,7 @@ version = "0.0.0"
43554355
dependencies = [
43564356
"fluent-bundle",
43574357
"fluent-syntax",
4358+
"indexmap",
43584359
"proc-macro2",
43594360
"quote",
43604361
"syn",

compiler/rustc_const_eval/src/interpret/memory.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
641641
// Unlike all the other GC helpers where we check if an `AllocId` is found in the interpreter or
642642
// is live, here all the IDs in the map are for dead allocations so we don't
643643
// need to check for liveness.
644-
#[allow(rustc::potential_query_instability)] // Only used from Miri, not queries.
645644
self.memory.dead_alloc_map.retain(|id, _| reachable_allocs.contains(id));
646645
}
647646
}

compiler/rustc_macros/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ proc-macro = true
1010
# tidy-alphabetical-start
1111
fluent-bundle = "0.16"
1212
fluent-syntax = "0.12"
13+
indexmap = "2.4.0"
1314
proc-macro2 = "1"
1415
quote = "1"
1516
syn = { version = "2.0.9", features = ["full"] }

compiler/rustc_macros/src/diagnostics/message.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
use std::collections::{HashMap, HashSet};
1+
use std::collections::HashSet;
22

33
use fluent_bundle::FluentResource;
44
use fluent_syntax::ast::{Expression, InlineExpression, Pattern, PatternElement};
5+
use indexmap::IndexMap;
56
use proc_macro2::{Span, TokenStream};
67
use quote::quote;
78
use syn::ext::IdentExt;
@@ -17,9 +18,6 @@ pub(crate) struct Message {
1718
}
1819

1920
impl Message {
20-
// About `allow(rustc::potential_query_instability)`: The order of key/values of `fields` and
21-
// `field_map` doesn't matters.
22-
#[allow(rustc::potential_query_instability)]
2321
pub(crate) fn new(
2422
attr_span: Span,
2523
message_span: Span,
@@ -36,8 +34,8 @@ impl Message {
3634
panic!("Did not parse into a message")
3735
};
3836

39-
let mut fields: HashMap<String, (&syn::Ident, bool)> =
40-
HashMap::with_capacity(field_map.len());
37+
let mut fields: IndexMap<String, (&syn::Ident, bool)> =
38+
IndexMap::with_capacity(field_map.len());
4139
for (_, (ident, _)) in field_map {
4240
fields.insert(ident.unraw().to_string(), (ident, false));
4341
}

compiler/rustc_macros/src/diagnostics/subdiagnostic.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,6 @@ impl SubdiagnosticDerive {
9292

9393
let diag = &self.diag;
9494

95-
// FIXME(edition_2024): Fix the `keyword_idents_2024` lint to not trigger here?
96-
#[allow(keyword_idents_2024)]
9795
let ret = structure.gen_impl(quote! {
9896
gen impl rustc_errors::Subdiagnostic for @Self {
9997
fn add_to_diag<__G>(

compiler/rustc_macros/src/diagnostics/utils.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
use std::cell::RefCell;
2-
use std::collections::{BTreeSet, HashMap, HashSet};
2+
use std::collections::{BTreeSet, HashSet};
33
use std::fmt;
44
use std::str::FromStr;
55

6+
use indexmap::IndexMap;
67
use proc_macro::Span;
78
use proc_macro2::{Ident, TokenStream};
89
use quote::{ToTokens, format_ident, quote};
@@ -260,7 +261,7 @@ impl<T> SetOnce<T> for SpannedOption<T> {
260261
}
261262
}
262263

263-
pub(super) type FieldMap = HashMap<String, (syn::Ident, TokenStream)>;
264+
pub(super) type FieldMap = IndexMap<String, (syn::Ident, TokenStream)>;
264265

265266
/// In the strings in the attributes supplied to this macro, we want callers to be able to
266267
/// reference fields in the format string. For example:

compiler/rustc_macros/src/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
// tidy-alphabetical-start
2-
#![allow(rustc::default_hash_types)]
2+
#![allow(
3+
rustc::default_hash_types,
4+
reason = "we like performance but can't use `rustc_data_structures`"
5+
)]
6+
#![deny(
7+
rustc::potential_query_instability,
8+
reason = "macros shall produce deterministic output/errors"
9+
)]
310
#![feature(never_type)]
411
#![feature(proc_macro_diagnostic)]
512
#![feature(proc_macro_tracked_env)]

compiler/rustc_macros/src/print_attribute.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ pub(crate) fn print_attribute(input: Structure<'_>) -> TokenStream {
120120
}
121121
};
122122

123-
#[allow(keyword_idents_2024)]
124123
input.gen_impl(quote! {
125124
#[allow(unused)]
126125
gen impl PrintAttribute for @Self {

compiler/rustc_macros/src/symbols.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
//! CFG_RELEASE="0.0.0" cargo +nightly expand > /tmp/rustc_span.rs
2525
//! ```
2626
27-
use std::collections::HashMap;
28-
27+
use indexmap::IndexMap;
2928
use proc_macro2::{Span, TokenStream};
3029
use quote::quote;
3130
use syn::parse::{Parse, ParseStream, Result};
@@ -148,12 +147,12 @@ struct Predefined {
148147
}
149148

150149
struct Entries {
151-
map: HashMap<String, Predefined>,
150+
map: IndexMap<String, Predefined>,
152151
}
153152

154153
impl Entries {
155154
fn with_capacity(capacity: usize) -> Self {
156-
Entries { map: HashMap::with_capacity(capacity) }
155+
Entries { map: IndexMap::with_capacity(capacity) }
157156
}
158157

159158
fn insert(&mut self, span: Span, s: &str, errors: &mut Errors) -> u32 {

compiler/rustc_pattern_analysis/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//! [`rustc`] module.
44
55
// tidy-alphabetical-start
6-
#![allow(unused_crate_dependencies)]
6+
#![cfg_attr(test, allow(unused_crate_dependencies))] // Used for integration tests, not unit tests
77
// tidy-alphabetical-end
88

99
pub(crate) mod checks;

0 commit comments

Comments
 (0)