]> git.lizzy.rs Git - rust.git/commitdiff
correct the new graphs resulting from various tests
authorNiko Matsakis <niko@alum.mit.edu>
Tue, 2 May 2017 21:47:38 +0000 (17:47 -0400)
committerNiko Matsakis <niko@alum.mit.edu>
Wed, 3 May 2017 20:42:07 +0000 (16:42 -0400)
(Now that variances are not part of signature.)

src/test/compile-fail/dep-graph-struct-signature.rs
src/test/compile-fail/dep-graph-type-alias.rs

index 7ed8b95f88b002b2a0f3748b9d6ca6db3284f6e8..3f568194e23d8071fc9bd67c7fe05d1f2120d02f 100644 (file)
@@ -58,13 +58,15 @@ impl WillChange {
         fn method(&self, x: u32) { }
     }
 
-    #[rustc_then_this_would_need(ItemSignature)] //~ ERROR OK
     struct WillChanges {
+        #[rustc_then_this_would_need(ItemSignature)] //~ ERROR OK
         x: WillChange,
+        #[rustc_then_this_would_need(ItemSignature)] //~ ERROR OK
         y: WillChange
     }
 
-    #[rustc_then_this_would_need(ItemSignature)] //~ ERROR OK
+    // The fields change, not the type itself.
+    #[rustc_then_this_would_need(ItemSignature)] //~ ERROR no path
     fn indirect(x: WillChanges) { }
 }
 
index 4cc15e8b522ac7add81492663a36395c325d2c06..56636a00a313a26afb911c4cce8f3a32d517d709 100644 (file)
@@ -23,15 +23,21 @@ fn main() { }
 #[rustc_if_this_changed]
 type TypeAlias = u32;
 
-#[rustc_then_this_would_need(ItemSignature)] //~ ERROR OK
+// The type alias directly affects the type of the field,
+// not the enclosing struct:
+#[rustc_then_this_would_need(ItemSignature)] //~ ERROR no path
 struct Struct {
+    #[rustc_then_this_would_need(ItemSignature)] //~ ERROR OK
     x: TypeAlias,
     y: u32
 }
 
-#[rustc_then_this_would_need(ItemSignature)] //~ ERROR OK
+#[rustc_then_this_would_need(ItemSignature)] //~ ERROR no path
 enum Enum {
-    Variant1(TypeAlias),
+    Variant1 {
+        #[rustc_then_this_would_need(ItemSignature)] //~ ERROR OK
+        t: TypeAlias
+    },
     Variant2(i32)
 }