@@ -5,7 +5,7 @@ use rustc_pattern_analysis::usefulness::{PlaceValidity, UsefulnessReport};
55use rustc_pattern_analysis:: { MatchArm , PatCx , PrivateUninhabitedField } ;
66
77/// Sets up `tracing` for easier debugging. Tries to look like the `rustc` setup.
8- pub fn init_tracing ( ) {
8+ fn init_tracing ( ) {
99 use tracing_subscriber:: Layer ;
1010 use tracing_subscriber:: layer:: SubscriberExt ;
1111 use tracing_subscriber:: util:: SubscriberInitExt ;
@@ -24,7 +24,7 @@ pub fn init_tracing() {
2424/// A simple set of types.
2525#[ allow( dead_code) ]
2626#[ derive( Debug , Copy , Clone , PartialEq , Eq ) ]
27- pub enum Ty {
27+ pub ( super ) enum Ty {
2828 /// Booleans
2929 Bool ,
3030 /// 8-bit unsigned integers
@@ -41,7 +41,7 @@ pub enum Ty {
4141
4242/// The important logic.
4343impl Ty {
44- pub fn sub_tys ( & self , ctor : & Constructor < Cx > ) -> Vec < Self > {
44+ pub ( super ) fn sub_tys ( & self , ctor : & Constructor < Cx > ) -> Vec < Self > {
4545 use Constructor :: * ;
4646 match ( ctor, * self ) {
4747 ( Struct , Ty :: Tuple ( tys) ) => tys. iter ( ) . copied ( ) . collect ( ) ,
@@ -63,7 +63,7 @@ impl Ty {
6363 }
6464 }
6565
66- pub fn ctor_set ( & self ) -> ConstructorSet < Cx > {
66+ fn ctor_set ( & self ) -> ConstructorSet < Cx > {
6767 match * self {
6868 Ty :: Bool => ConstructorSet :: Bool ,
6969 Ty :: U8 => ConstructorSet :: Integers {
@@ -104,7 +104,7 @@ impl Ty {
104104 }
105105 }
106106
107- pub fn write_variant_name (
107+ fn write_variant_name (
108108 & self ,
109109 f : & mut std:: fmt:: Formatter < ' _ > ,
110110 ctor : & Constructor < Cx > ,
@@ -120,7 +120,7 @@ impl Ty {
120120}
121121
122122/// Compute usefulness in our simple context (and set up tracing for easier debugging).
123- pub fn compute_match_usefulness < ' p > (
123+ pub ( super ) fn compute_match_usefulness < ' p > (
124124 arms : & [ MatchArm < ' p , Cx > ] ,
125125 ty : Ty ,
126126 scrut_validity : PlaceValidity ,
@@ -137,7 +137,7 @@ pub fn compute_match_usefulness<'p>(
137137}
138138
139139#[ derive( Debug ) ]
140- pub struct Cx ;
140+ pub ( super ) struct Cx ;
141141
142142/// The context for pattern analysis. Forwards anything interesting to `Ty` methods.
143143impl PatCx for Cx {
0 commit comments