diff options
| author | Philipp Krones <hello@philkrones.com> | 2025-02-27 21:40:02 +0100 |
|---|---|---|
| committer | Philipp Krones <hello@philkrones.com> | 2025-02-27 21:51:42 +0100 |
| commit | 02e812af4d936a0984802bb76bb3e423e2fb94a5 (patch) | |
| tree | 196fe8bde7074c1a5fa2b0af4a74892c51c8188c /tests/ui/mem_replace_no_std.fixed | |
| parent | 17bda0c0febb8c51fb14a6856d365eab86fc6162 (diff) | |
| parent | 15180d4eb9dcff9441a8c3ff3382804123c5b0a1 (diff) | |
Merge remote-tracking branch 'upstream/master' into rustup
Diffstat (limited to 'tests/ui/mem_replace_no_std.fixed')
| -rw-r--r-- | tests/ui/mem_replace_no_std.fixed | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/ui/mem_replace_no_std.fixed b/tests/ui/mem_replace_no_std.fixed index 60f523c8ef1..669450e59d8 100644 --- a/tests/ui/mem_replace_no_std.fixed +++ b/tests/ui/mem_replace_no_std.fixed @@ -21,16 +21,20 @@ fn panic(info: &PanicInfo) -> ! { fn replace_option_with_none() { let mut an_option = Some(1); let _ = an_option.take(); + //~^ mem_replace_option_with_none let an_option = &mut Some(1); let _ = an_option.take(); + //~^ mem_replace_option_with_none } fn replace_with_default() { let mut refstr = "hello"; let _ = core::mem::take(&mut refstr); + //~^ mem_replace_with_default let mut slice: &[i32] = &[1, 2, 3]; let _ = core::mem::take(&mut slice); + //~^ mem_replace_with_default } // lint is disabled for primitives because in this case `take` @@ -74,8 +78,11 @@ fn issue9824() { // replace option with none let _ = f.0.take(); + //~^ mem_replace_option_with_none let _ = (*f).take(); + //~^ mem_replace_option_with_none let _ = b.opt.take(); + //~^ mem_replace_option_with_none // replace with default let _ = mem::replace(&mut b.val, u8::default()); } |
