From 3cbe8d0ca67e0fff43b9f8f094cc8dc6510186da Mon Sep 17 00:00:00 2001 From: Ary Borenszweig Date: Fri, 20 Dec 2024 16:49:42 -0300 Subject: [PATCH] Move test somewhere else --- compiler/noirc_frontend/src/tests.rs | 19 +++++++++++++++++++ compiler/noirc_frontend/src/tests/traits.rs | 19 ------------------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/compiler/noirc_frontend/src/tests.rs b/compiler/noirc_frontend/src/tests.rs index 3d908d1aa0c..f6467ab40c7 100644 --- a/compiler/noirc_frontend/src/tests.rs +++ b/compiler/noirc_frontend/src/tests.rs @@ -3918,3 +3918,22 @@ fn warns_on_nested_unsafe() { CompilationError::TypeError(TypeCheckError::NestedUnsafeBlock { .. }) )); } + +#[test] +fn mutable_self_call() { + let src = r#" + fn main() { + let mut bar = Bar {}; + let _ = bar.bar(); + } + + struct Bar {} + + impl Bar { + fn bar(&mut self) { + let _ = self; + } + } + "#; + assert_no_errors(src); +} diff --git a/compiler/noirc_frontend/src/tests/traits.rs b/compiler/noirc_frontend/src/tests/traits.rs index a8b1f2c328b..733c4c44ce6 100644 --- a/compiler/noirc_frontend/src/tests/traits.rs +++ b/compiler/noirc_frontend/src/tests/traits.rs @@ -975,22 +975,3 @@ fn errors_if_multiple_trait_methods_are_in_scope_for_method_call() { traits.sort(); assert_eq!(traits, vec!["private_mod::Foo", "private_mod::Foo2"]); } - -#[test] -fn mutable_call() { - let src = r#" - fn main() { - let mut bar = Bar {}; - let _ = bar.bar(); - } - - struct Bar {} - - impl Bar { - fn bar(&mut self) { - let _ = self; - } - } - "#; - assert_no_errors(src); -}