From 226860304603f63440e9d097cd09dce45160bfbb Mon Sep 17 00:00:00 2001 From: Jack Wrenn Date: Thu, 21 Jul 2022 18:22:04 +0000 Subject: [PATCH] safe transmute: tweak `Nfa::union` to consume params by value ref: https://github.com/rust-lang/rust/pull/92268#discussion_r925274516 --- compiler/rustc_transmute/src/layout/nfa.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/rustc_transmute/src/layout/nfa.rs b/compiler/rustc_transmute/src/layout/nfa.rs index 817e426ba27..3b2548e7aed 100644 --- a/compiler/rustc_transmute/src/layout/nfa.rs +++ b/compiler/rustc_transmute/src/layout/nfa.rs @@ -92,7 +92,7 @@ where let mut alts = alts.into_iter().map(Self::from_tree); let mut nfa = alts.next().ok_or(Uninhabited)??; for alt in alts { - nfa = nfa.union(&alt?); + nfa = nfa.union(alt?); } nfa } @@ -136,7 +136,7 @@ where } /// Compute the union of two `Nfa`s. - pub(crate) fn union(&self, other: &Self) -> Self { + pub(crate) fn union(self, other: Self) -> Self { let start = self.start; let accepting = self.accepting;