]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Remove unneeded clones untill we have an arena allocator for these tmps
authorPhilip Herron <herron.philip@googlemail.com>
Mon, 19 May 2025 16:42:17 +0000 (17:42 +0100)
committerPhilip Herron <philip.herron@embecosm.com>
Mon, 26 May 2025 18:09:21 +0000 (18:09 +0000)
commit894e6951cfdd4868a396bde68ac01f0ad28326f0
tree62a020f5a50c421b44fe51574cf9b33daa84f4aa
parent457b3d1e29ce72bda6ac74a7c761decd657aab12
gccrs: Remove unneeded clones untill we have an arena allocator for these tmps

Cloning inference variables is very expensive because it means we are indirectly
creating an implicit new inference variable added to the reference chain.

gcc/rust/ChangeLog:

* checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::check_base_type_privacy):
no need for unreachable here
* typecheck/rust-unify.cc (UnifyRules::commit): dont clone infer vars
(UnifyRules::expect_inference_variable): likewise

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc
gcc/rust/typecheck/rust-unify.cc