From 64d98f8ee037282c35007b64c2649055c56af1db Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:03 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- .../suggestions/issue-106443-sugg-clone-for-arg.rs | 23 ++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 tests/ui/suggestions/issue-106443-sugg-clone-for-arg.rs (limited to 'tests/ui/suggestions/issue-106443-sugg-clone-for-arg.rs') diff --git a/tests/ui/suggestions/issue-106443-sugg-clone-for-arg.rs b/tests/ui/suggestions/issue-106443-sugg-clone-for-arg.rs new file mode 100644 index 000000000..48efdb82c --- /dev/null +++ b/tests/ui/suggestions/issue-106443-sugg-clone-for-arg.rs @@ -0,0 +1,23 @@ +#[derive(Clone)] +struct S; + +// without Clone +struct T; + +fn foo(_: S) {} + +fn test1() { + let s = &S; + foo(s); //~ ERROR mismatched types +} + +fn bar(_: T) {} +fn test2() { + let t = &T; + bar(t); //~ ERROR mismatched types +} + +fn main() { + test1(); + test2(); +} -- cgit v1.2.3