]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/must_use_candidates.fixed
iterate List by value
[rust.git] / tests / ui / must_use_candidates.fixed
index dded5321af83f953fc29d36a3e482898d2f90d5f..9556f6f82cc6313d39125487819635ce0b0eed7f 100644 (file)
@@ -1,6 +1,6 @@
 // run-rustfix
 #![feature(never_type)]
-#![allow(unused_mut)]
+#![allow(unused_mut, clippy::redundant_allocation)]
 #![warn(clippy::must_use_candidate)]
 use std::rc::Rc;
 use std::sync::atomic::{AtomicBool, Ordering};
@@ -28,7 +28,7 @@ pub trait MyPureTrait {
 }
 
 impl MyPureTrait for MyPure {
-    #[must_use] fn trait_impl_pure(&self, i: u32) -> u32 {
+    fn trait_impl_pure(&self, i: u32) -> u32 {
         i
     }
 }
@@ -83,6 +83,11 @@ pub unsafe fn mutates_static() -> usize {
     COUNTER
 }
 
+#[no_mangle]
+pub fn unmangled(i: bool) -> bool {
+    !i
+}
+
 fn main() {
     assert_eq!(1, pure(1));
 }