summaryrefslogtreecommitdiffstats
path: root/src/test/ui/mismatched_types/ref-pat-suggestions.fixed
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/mismatched_types/ref-pat-suggestions.fixed
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/mismatched_types/ref-pat-suggestions.fixed')
-rw-r--r--src/test/ui/mismatched_types/ref-pat-suggestions.fixed37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/test/ui/mismatched_types/ref-pat-suggestions.fixed b/src/test/ui/mismatched_types/ref-pat-suggestions.fixed
new file mode 100644
index 000000000..d50acd1ac
--- /dev/null
+++ b/src/test/ui/mismatched_types/ref-pat-suggestions.fixed
@@ -0,0 +1,37 @@
+// run-rustfix
+
+fn _f0(_a: &u32) {} //~ ERROR mismatched types
+fn _f1(_a: &mut u32) {} //~ ERROR mismatched types
+fn _f2(&_a: &u32) {} //~ ERROR mismatched types
+fn _f3(&mut _a: &mut u32) {} //~ ERROR mismatched types
+fn _f4(&_a: &u32) {} //~ ERROR mismatched types
+fn _f5(&mut _a: &mut u32) {} //~ ERROR mismatched types
+
+fn main() {
+ let _: fn(u32) = |_a| (); //~ ERROR mismatched types
+ let _: fn(u32) = |_a| (); //~ ERROR mismatched types
+ let _: fn(&u32) = |&_a| (); //~ ERROR mismatched types
+ let _: fn(&mut u32) = |&mut _a| (); //~ ERROR mismatched types
+ let _: fn(&u32) = |&_a| (); //~ ERROR mismatched types
+ let _: fn(&mut u32) = |&mut _a| (); //~ ERROR mismatched types
+
+ let _ = |_a: &u32| (); //~ ERROR mismatched types
+ let _ = |_a: &mut u32| (); //~ ERROR mismatched types
+ let _ = |&_a: &u32| (); //~ ERROR mismatched types
+ let _ = |&mut _a: &mut u32| (); //~ ERROR mismatched types
+ let _ = |&_a: &u32| (); //~ ERROR mismatched types
+ let _ = |&mut _a: &mut u32| (); //~ ERROR mismatched types
+
+ #[allow(unused_mut)]
+ {
+ struct S(u8);
+
+ let mut _a = 0; //~ ERROR mismatched types
+ let S(_b) = S(0); //~ ERROR mismatched types
+ let (_c,) = (0,); //~ ERROR mismatched types
+
+ match 0 {
+ _d => {} //~ ERROR mismatched types
+ }
+ }
+}