diff options
| author | Matthias Krüger <476013+matthiaskrgr@users.noreply.github.com> | 2025-03-10 15:57:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-10 15:57:22 +0100 |
| commit | 44ec67fffbe9f7846d00cf8a0d457cfc681fea08 (patch) | |
| tree | b95874b3300e1579fca2f78dfd200eb55ea1361c /compiler/rustc_pattern_analysis/tests/common | |
| parent | 2abeceeb97f180bec3a331b240160c240285dd89 (diff) | |
| parent | 063ef18fdc10cb0eb49e1af855e1a8e807e73eed (diff) | |
| download | rust-44ec67fffbe9f7846d00cf8a0d457cfc681fea08.tar.gz rust-44ec67fffbe9f7846d00cf8a0d457cfc681fea08.zip | |
Rollup merge of #138306 - jieyouxu:revert-workspace-lints, r=Noratrieb
Revert "Use workspace lints for crates in `compiler/` #138084" Revert <https://github.com/rust-lang/rust/pull/138084> to buy time to consider options that avoids breaking downstream usages of cargo on distributed `rustc-src` artifacts, where such cargo invocations fail due to inability to inherit `lints` from workspace root manifest's `workspace.lints` (this is only valid for the source rust-lang/rust workspace, but not really the distributed `rustc-src` artifacts). The problem is that the `rustc-src` component doesn't include the root `Cargo.toml` manifest. This breakage was reported in https://github.com/rust-lang/rust/issues/138304. This reverts commit 48caf81484b50dca5a5cebb614899a3df81ca898, reversing changes made to c6662879b27f5161e95f39395e3c9513a7b97028. cc `@RalfJung` r? `@nnethercote` (sorry, I didn't consider this being a thing 💀)
Diffstat (limited to 'compiler/rustc_pattern_analysis/tests/common')
| -rw-r--r-- | compiler/rustc_pattern_analysis/tests/common/mod.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/compiler/rustc_pattern_analysis/tests/common/mod.rs b/compiler/rustc_pattern_analysis/tests/common/mod.rs index 8980b644f59..365bc2d863f 100644 --- a/compiler/rustc_pattern_analysis/tests/common/mod.rs +++ b/compiler/rustc_pattern_analysis/tests/common/mod.rs @@ -5,7 +5,7 @@ use rustc_pattern_analysis::usefulness::{PlaceValidity, UsefulnessReport}; use rustc_pattern_analysis::{MatchArm, PatCx, PrivateUninhabitedField}; /// Sets up `tracing` for easier debugging. Tries to look like the `rustc` setup. -fn init_tracing() { +pub fn init_tracing() { use tracing_subscriber::Layer; use tracing_subscriber::layer::SubscriberExt; use tracing_subscriber::util::SubscriberInitExt; @@ -24,7 +24,7 @@ fn init_tracing() { /// A simple set of types. #[allow(dead_code)] #[derive(Debug, Copy, Clone, PartialEq, Eq)] -pub(super) enum Ty { +pub enum Ty { /// Booleans Bool, /// 8-bit unsigned integers @@ -41,7 +41,7 @@ pub(super) enum Ty { /// The important logic. impl Ty { - pub(super) fn sub_tys(&self, ctor: &Constructor<Cx>) -> Vec<Self> { + pub fn sub_tys(&self, ctor: &Constructor<Cx>) -> Vec<Self> { use Constructor::*; match (ctor, *self) { (Struct, Ty::Tuple(tys)) => tys.iter().copied().collect(), @@ -63,7 +63,7 @@ impl Ty { } } - fn ctor_set(&self) -> ConstructorSet<Cx> { + pub fn ctor_set(&self) -> ConstructorSet<Cx> { match *self { Ty::Bool => ConstructorSet::Bool, Ty::U8 => ConstructorSet::Integers { @@ -104,7 +104,7 @@ impl Ty { } } - fn write_variant_name( + pub fn write_variant_name( &self, f: &mut std::fmt::Formatter<'_>, ctor: &Constructor<Cx>, @@ -120,7 +120,7 @@ impl Ty { } /// Compute usefulness in our simple context (and set up tracing for easier debugging). -pub(super) fn compute_match_usefulness<'p>( +pub fn compute_match_usefulness<'p>( arms: &[MatchArm<'p, Cx>], ty: Ty, scrut_validity: PlaceValidity, @@ -137,7 +137,7 @@ pub(super) fn compute_match_usefulness<'p>( } #[derive(Debug)] -pub(super) struct Cx; +pub struct Cx; /// The context for pattern analysis. Forwards anything interesting to `Ty` methods. impl PatCx for Cx { |
