]> git.lizzy.rs Git - rust.git/commitdiff
Remove all `union` stuffs
authormcarton <cartonmartin+git@gmail.com>
Tue, 30 Aug 2016 15:26:57 +0000 (17:26 +0200)
committermcarton <cartonmartin+git@gmail.com>
Wed, 31 Aug 2016 16:22:36 +0000 (18:22 +0200)
The rustc's PR wasn't merged. Hopefully this commit can simply be reverted when it's time.

clippy_lints/src/derive.rs
clippy_lints/src/len_zero.rs
clippy_lints/src/missing_doc.rs
tests/compile-fail/derive.rs
tests/compile-fail/no_effect.rs

index 17d17a445afd53e09b4751e941a4678f054fe69c..2311df424562023e2b467f235f7622af1f633d60 100644 (file)
@@ -141,7 +141,7 @@ fn check_copy_clone<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, item: &Item, trait_ref
         }
 
         match ty.sty {
-            TypeVariants::TyUnion(..) => return,
+            //FIXME:unions: TypeVariants::TyUnion(..) => return,
 
             // Some types are not Clone by default but could be cloned “by hand” if necessary
             TypeVariants::TyEnum(def, substs) |
index d43e31c6a3db9a8903542ac62523da8502191c96..9b18eed93ee9163024582a2114172f5c5d081473 100644 (file)
@@ -209,8 +209,8 @@ fn has_is_empty_impl(cx: &LateContext, id: &DefId) -> bool {
         }
         ty::TyProjection(_) => ty.ty_to_def_id().map_or(false, |id| has_is_empty_impl(cx, &id)),
         ty::TyEnum(id, _) |
-        ty::TyStruct(id, _) |
-        ty::TyUnion(id, _) => has_is_empty_impl(cx, &id.did),
+        ty::TyStruct(id, _) /*FIXME:unions: |
+        ty::TyUnion(id, _)*/ => has_is_empty_impl(cx, &id.did),
         ty::TyArray(..) | ty::TyStr => true,
         _ => false,
     }
index 454f591756bb5d878f171636f7c9e229d6f5b7a3..bd6354ad93235a37e8d14b44a20ed2cdcd7fdedb 100644 (file)
@@ -123,7 +123,7 @@ fn check_item(&mut self, cx: &LateContext, it: &hir::Item) {
             hir::ItemStruct(..) => "a struct",
             hir::ItemTrait(..) => "a trait",
             hir::ItemTy(..) => "a type alias",
-            hir::ItemUnion(..) => "a union",
+            //FIXME:unions: hir::ItemUnion(..) => "a union",
             hir::ItemDefaultImpl(..) |
             hir::ItemExternCrate(..) |
             hir::ItemForeignMod(..) |
index cf4467f30a59271abe40ea019cf4efdf1890db6f..39d9dde288195fd93fbe87acd974abbb33ae1201 100644 (file)
@@ -1,7 +1,7 @@
 #![feature(plugin)]
 #![plugin(clippy)]
 
-#![feature(untagged_unions)]
+//FIXME:unions: #![feature(untagged_unions)]
 
 #![deny(warnings)]
 #![allow(dead_code)]
@@ -47,6 +47,7 @@ impl Clone for Qux {
     fn clone(&self) -> Self { Qux }
 }
 
+/* FIXME:unions
 // looks like unions don't support deriving Clone for now
 #[derive(Copy)]
 union Union {
@@ -60,6 +61,7 @@ fn clone(&self) -> Self {
         }
     }
 }
+*/
 
 // See #666
 #[derive(Copy)]
index 6616f7bdc86c03a4ee2a0f95fdc2521056768068..39b59a599073e45230e53a8afcc3ef90e4ec8133 100644 (file)
@@ -4,7 +4,7 @@
 #![deny(no_effect, unnecessary_operation)]
 #![allow(dead_code)]
 #![allow(path_statements)]
-#![feature(untagged_unions)]
+//FIXME:unions #![feature(untagged_unions)]
 
 struct Unit;
 struct Tuple(i32);
@@ -16,10 +16,12 @@ enum Enum {
     Struct { field: i32 },
 }
 
+/*FIXME:unions:
 union Union {
     a: u8,
     b: f64,
 }
+*/
 
 fn get_number() -> i32 { 0 }
 fn get_struct() -> Struct { Struct { field: 0 } }
@@ -36,7 +38,7 @@ fn main() {
     Tuple(0); //~ERROR statement with no effect
     Struct { field: 0 }; //~ERROR statement with no effect
     Struct { ..s }; //~ERROR statement with no effect
-    Union { a: 0 }; //~ERROR statement with no effect
+    //FIXME:unions: Union { a: 0 }; // /**FIXME*~***/ ERROR statement with no effect
     Enum::Tuple(0); //~ERROR statement with no effect
     Enum::Struct { field: 0 }; //~ERROR statement with no effect
     5 + 6; //~ERROR statement with no effect