Skip to content

Commit 2268603

Browse files
committed
safe transmute: tweak Nfa::union to consume params by value
ref: #92268 (comment)
1 parent b78c3da commit 2268603

File tree

1 file changed

+2
-2
lines changed
  • compiler/rustc_transmute/src/layout

1 file changed

+2
-2
lines changed

compiler/rustc_transmute/src/layout/nfa.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ where
9292
let mut alts = alts.into_iter().map(Self::from_tree);
9393
let mut nfa = alts.next().ok_or(Uninhabited)??;
9494
for alt in alts {
95-
nfa = nfa.union(&alt?);
95+
nfa = nfa.union(alt?);
9696
}
9797
nfa
9898
}
@@ -136,7 +136,7 @@ where
136136
}
137137

138138
/// Compute the union of two `Nfa`s.
139-
pub(crate) fn union(&self, other: &Self) -> Self {
139+
pub(crate) fn union(self, other: Self) -> Self {
140140
let start = self.start;
141141
let accepting = self.accepting;
142142

0 commit comments

Comments
 (0)