]> git.lizzy.rs Git - rust.git/commitdiff
Add more exhaustive tests for borrow_box
authorscott-linder <scott.b.linder@wmich.edu>
Thu, 2 Feb 2017 15:55:27 +0000 (10:55 -0500)
committerscott-linder <scott.b.linder@wmich.edu>
Sun, 11 Jun 2017 16:19:11 +0000 (12:19 -0400)
tests/compile-fail/borrow_box.rs

index 54dee4f901611288f785c17d56fa330b42c2c13c..9c1c36e6475a366fd51da862bd12dd4210e63cc0 100644 (file)
@@ -4,11 +4,22 @@
 #![deny(clippy)]
 #![allow(boxed_local)]
 #![allow(blacklisted_name)]
+#![allow(unused_variables)]
+#![allow(dead_code)]
 
-pub fn test(foo: &Box<bool>) { //~ ERROR you seem to be trying to use `&Box<T>`
+pub fn test1(foo: &Box<bool>) { //~ ERROR you seem to be trying to use `&Box<T>`
     println!("{:?}", foo)
 }
 
+pub fn test2() {
+    let foo: &Box<bool>; //~ ERROR you seem to be trying to use `&Box<T>`
+}
+
+struct Test3<'a> {
+    foo: &'a Box<bool> //~ ERROR you seem to be trying to use `&Box<T>`
+}
+
 fn main(){
-    test(&Box::new(false));
+    test1(&Box::new(false));
+    test2();
 }