Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4355,6 +4355,7 @@ version = "0.0.0"
dependencies = [
"fluent-bundle",
"fluent-syntax",
"indexmap",
"proc-macro2",
"quote",
"syn",
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_const_eval/src/interpret/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,6 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
// Unlike all the other GC helpers where we check if an `AllocId` is found in the interpreter or
// is live, here all the IDs in the map are for dead allocations so we don't
// need to check for liveness.
#[allow(rustc::potential_query_instability)] // Only used from Miri, not queries.

@mejrs mejrs Jul 28, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this was missed in #120931

View changes since the review

self.memory.dead_alloc_map.retain(|id, _| reachable_allocs.contains(id));
}
}
Expand Down
1 change: 1 addition & 0 deletions compiler/rustc_macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ proc-macro = true
# tidy-alphabetical-start
fluent-bundle = "0.16"
fluent-syntax = "0.12"
indexmap = "2.4.0"
proc-macro2 = "1"
quote = "1"
syn = { version = "2.0.9", features = ["full"] }
Expand Down
10 changes: 4 additions & 6 deletions compiler/rustc_macros/src/diagnostics/message.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use std::collections::{HashMap, HashSet};
use std::collections::HashSet;

use fluent_bundle::FluentResource;
use fluent_syntax::ast::{Expression, InlineExpression, Pattern, PatternElement};
use indexmap::IndexMap;
use proc_macro2::{Span, TokenStream};
use quote::quote;
use syn::ext::IdentExt;
Expand All @@ -17,9 +18,6 @@ pub(crate) struct Message {
}

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

let mut fields: HashMap<String, (&syn::Ident, bool)> =
HashMap::with_capacity(field_map.len());
let mut fields: IndexMap<String, (&syn::Ident, bool)> =
IndexMap::with_capacity(field_map.len());
for (_, (ident, _)) in field_map {
fields.insert(ident.unraw().to_string(), (ident, false));
}
Expand Down
2 changes: 0 additions & 2 deletions compiler/rustc_macros/src/diagnostics/subdiagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,6 @@ impl SubdiagnosticDerive {

let diag = &self.diag;

// FIXME(edition_2024): Fix the `keyword_idents_2024` lint to not trigger here?
#[allow(keyword_idents_2024)]
let ret = structure.gen_impl(quote! {
gen impl rustc_errors::Subdiagnostic for @Self {
fn add_to_diag<__G>(
Expand Down
5 changes: 3 additions & 2 deletions compiler/rustc_macros/src/diagnostics/utils.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use std::cell::RefCell;
use std::collections::{BTreeSet, HashMap, HashSet};
use std::collections::{BTreeSet, HashSet};
use std::fmt;
use std::str::FromStr;

use indexmap::IndexMap;
use proc_macro::Span;
use proc_macro2::{Ident, TokenStream};
use quote::{ToTokens, format_ident, quote};
Expand Down Expand Up @@ -260,7 +261,7 @@ impl<T> SetOnce<T> for SpannedOption<T> {
}
}

pub(super) type FieldMap = HashMap<String, (syn::Ident, TokenStream)>;
pub(super) type FieldMap = IndexMap<String, (syn::Ident, TokenStream)>;

/// In the strings in the attributes supplied to this macro, we want callers to be able to
/// reference fields in the format string. For example:
Expand Down
9 changes: 8 additions & 1 deletion compiler/rustc_macros/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
// tidy-alphabetical-start
#![allow(rustc::default_hash_types)]
#![allow(
rustc::default_hash_types,
reason = "we like performance but can't use `rustc_data_structures`"
)]
#![deny(
Comment thread
mu001999 marked this conversation as resolved.
rustc::potential_query_instability,
reason = "macros shall produce deterministic output/errors"
)]
#![feature(never_type)]
#![feature(proc_macro_diagnostic)]
#![feature(proc_macro_tracked_env)]
Expand Down
1 change: 0 additions & 1 deletion compiler/rustc_macros/src/print_attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ pub(crate) fn print_attribute(input: Structure<'_>) -> TokenStream {
}
};

#[allow(keyword_idents_2024)]
input.gen_impl(quote! {
#[allow(unused)]
gen impl PrintAttribute for @Self {
Expand Down
7 changes: 3 additions & 4 deletions compiler/rustc_macros/src/symbols.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@
//! CFG_RELEASE="0.0.0" cargo +nightly expand > /tmp/rustc_span.rs
//! ```

use std::collections::HashMap;

use indexmap::IndexMap;
use proc_macro2::{Span, TokenStream};
use quote::quote;
use syn::parse::{Parse, ParseStream, Result};
Expand Down Expand Up @@ -148,12 +147,12 @@ struct Predefined {
}

struct Entries {
map: HashMap<String, Predefined>,
map: IndexMap<String, Predefined>,
}

impl Entries {
fn with_capacity(capacity: usize) -> Self {
Entries { map: HashMap::with_capacity(capacity) }
Entries { map: IndexMap::with_capacity(capacity) }
}

fn insert(&mut self, span: Span, s: &str, errors: &mut Errors) -> u32 {
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_pattern_analysis/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! [`rustc`] module.

// tidy-alphabetical-start
#![allow(unused_crate_dependencies)]
#![cfg_attr(test, allow(unused_crate_dependencies))] // Used for integration tests, not unit tests
// tidy-alphabetical-end

pub(crate) mod checks;
Expand Down
4 changes: 0 additions & 4 deletions compiler/rustc_session/src/config/sigpipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,17 @@
///
/// Note that `SIG_IGN` has been the Rust default since 2014. See
/// <https://github.com/rust-lang/rust/issues/62569>.
#[allow(dead_code)]
pub const DEFAULT: u8 = 0;

/// Do not touch `SIGPIPE`. Use whatever the parent process uses.
#[allow(dead_code)]
pub const INHERIT: u8 = 1;

/// Change `SIGPIPE` to `SIG_IGN` so that failed writes results in `EPIPE`
/// that are eventually converted to `ErrorKind::BrokenPipe`.
#[allow(dead_code)]
pub const SIG_IGN: u8 = 2;

/// Change `SIGPIPE` to `SIG_DFL` so that the process is killed when trying
/// to write to a closed pipe. This is usually the desired behavior for CLI
/// apps that produce textual output that you want to pipe to other programs
/// such as `head -n 1`.
#[allow(dead_code)]
pub const SIG_DFL: u8 = 3;
Loading