Rollup merge of #138084 - nnethercote:workspace-lints, r=jieyouxu

Use workspace lints for crates in `compiler/`

This is nicer and hopefully less error prone than specifying lints via bootstrap.

r? ``@jieyouxu``
This commit is contained in:
Matthias Krüger 2025-03-09 10:34:50 +01:00 committed by GitHub
commit 48caf81484
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
144 changed files with 252 additions and 90 deletions

View file

@ -54,3 +54,6 @@ memmap2 = "0.2.1"
[target.'cfg(not(target_has_atomic = "64"))'.dependencies]
portable-atomic = "1.5.1"
[lints]
workspace = true

View file

@ -3,7 +3,7 @@ use std::cmp::max;
use super::*;
use crate::fx::FxHashMap;
pub struct TestGraph {
pub(super) struct TestGraph {
num_nodes: usize,
start_node: usize,
successors: FxHashMap<usize, Vec<usize>>,
@ -11,7 +11,7 @@ pub struct TestGraph {
}
impl TestGraph {
pub fn new(start_node: usize, edges: &[(usize, usize)]) -> Self {
pub(super) fn new(start_node: usize, edges: &[(usize, usize)]) -> Self {
let mut graph = TestGraph {
num_nodes: start_node + 1,
start_node,

View file

@ -313,7 +313,7 @@ pub struct Error<O, E> {
mod helper {
use super::*;
pub type ObligationTreeIdGenerator = impl Iterator<Item = ObligationTreeId>;
pub(super) type ObligationTreeIdGenerator = impl Iterator<Item = ObligationTreeId>;
impl<O: ForestObligation> ObligationForest<O> {
pub fn new() -> ObligationForest<O> {
ObligationForest {

View file

@ -88,7 +88,7 @@ mod mode {
// Whether thread safety might be enabled.
#[inline]
pub fn might_be_dyn_thread_safe() -> bool {
pub(super) fn might_be_dyn_thread_safe() -> bool {
DYN_THREAD_SAFE_MODE.load(Ordering::Relaxed) != DYN_NOT_THREAD_SAFE
}

View file

@ -46,7 +46,7 @@ pub fn parallel_guard<R>(f: impl FnOnce(&ParallelGuard) -> R) -> R {
ret
}
pub fn serial_join<A, B, RA, RB>(oper_a: A, oper_b: B) -> (RA, RB)
fn serial_join<A, B, RA, RB>(oper_a: A, oper_b: B) -> (RA, RB)
where
A: FnOnce() -> RA,
B: FnOnce() -> RB,

View file

@ -7,7 +7,7 @@ use crate::stable_hasher::{HashStable, StableHasher};
/// A tag type used in [`TaggedRef`] tests.
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub enum Tag2 {
enum Tag2 {
B00 = 0b00,
B01 = 0b01,
B10 = 0b10,