about summary refs log tree commit diff
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2025-02-28 17:30:25 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2025-02-28 17:31:31 +1100
commitb0530c9361603f9317a598c4854f8ab3469a9d40 (patch)
tree72b77138eaaafa6d6231a96c718efc832b35d361
parent785e21d382ed83121cb3751c1fd05147c2eb41f2 (diff)
downloadrust-b0530c9361603f9317a598c4854f8ab3469a9d40.tar.gz
rust-b0530c9361603f9317a598c4854f8ab3469a9d40.zip
Remove `allow(dead_code)` attributes.
By either removing the function, or change the attribute to something
more precise.
-rw-r--r--compiler/rustc_transmute/src/layout/dfa.rs11
-rw-r--r--compiler/rustc_transmute/src/layout/nfa.rs5
2 files changed, 1 insertions, 15 deletions
diff --git a/compiler/rustc_transmute/src/layout/dfa.rs b/compiler/rustc_transmute/src/layout/dfa.rs
index a70dc034e63..a29baade42f 100644
--- a/compiler/rustc_transmute/src/layout/dfa.rs
+++ b/compiler/rustc_transmute/src/layout/dfa.rs
@@ -38,7 +38,7 @@ impl<R> Transitions<R>
 where
     R: Ref,
 {
-    #[allow(dead_code)]
+    #[cfg(test)]
     fn insert(&mut self, transition: Transition<R>, state: State) {
         match transition {
             Transition::Byte(b) => {
@@ -86,15 +86,6 @@ impl<R> Dfa<R>
 where
     R: Ref,
 {
-    #[allow(dead_code)]
-    pub(crate) fn unit() -> Self {
-        let transitions: Map<State, Transitions<R>> = Map::default();
-        let start = State::new();
-        let accepting = start;
-
-        Self { transitions, start, accepting }
-    }
-
     #[cfg(test)]
     pub(crate) fn bool() -> Self {
         let mut transitions: Map<State, Transitions<R>> = Map::default();
diff --git a/compiler/rustc_transmute/src/layout/nfa.rs b/compiler/rustc_transmute/src/layout/nfa.rs
index 3b49c59fa68..9c21fd94f03 100644
--- a/compiler/rustc_transmute/src/layout/nfa.rs
+++ b/compiler/rustc_transmute/src/layout/nfa.rs
@@ -159,11 +159,6 @@ where
         }
         Self { transitions, start, accepting }
     }
-
-    #[allow(dead_code)]
-    pub(crate) fn edges_from(&self, start: State) -> Option<&Map<Transition<R>, Set<State>>> {
-        self.transitions.get(&start)
-    }
 }
 
 impl State {