summary refs log tree commit diff
path: root/src/test/incremental
diff options
context:
space:
mode:
authorNiko Matsakis <niko@alum.mit.edu>2017-11-22 12:06:19 -0500
committerNiko Matsakis <niko@alum.mit.edu>2017-11-22 12:44:10 -0500
commitd3e0c33dbeaaa10f17e867ac62bb268167fda942 (patch)
treedcb9a4fb7ada94d78f5df4ee62c81555f9b3e432 /src/test/incremental
parent78ccbba3e296e8dbbb8cae3a70ec6adc7087dade (diff)
downloadrust-d3e0c33dbeaaa10f17e867ac62bb268167fda942.tar.gz
rust-d3e0c33dbeaaa10f17e867ac62bb268167fda942.zip
modify inherent impls test to indicate `TypeckTables` do not change
I also added some comments explaining what is going on. In short, the
changes in question do not, in fact, affect the`TypeckTables` in any
semantic way. However, altering the order of lowering can cause it
appear to affect the `TypeckTables`: if we lower generics before the
body, then the `HirId` for things in the body will be affected. In
this case, we are now lowering the generics etc
*after* the body, so the hash no longer changes. This seems good.
Diffstat (limited to 'src/test/incremental')
-rw-r--r--src/test/incremental/hashes/inherent_impls.rs44
1 files changed, 40 insertions, 4 deletions
diff --git a/src/test/incremental/hashes/inherent_impls.rs b/src/test/incremental/hashes/inherent_impls.rs
index f9e8fb026ca..403ea905681 100644
--- a/src/test/incremental/hashes/inherent_impls.rs
+++ b/src/test/incremental/hashes/inherent_impls.rs
@@ -370,7 +370,16 @@ impl Foo {
 #[rustc_metadata_clean(cfg="cfail2")]
 #[rustc_metadata_clean(cfg="cfail3")]
 impl Foo {
-    #[rustc_clean(cfg="cfail2", except="Hir,HirBody,TypeckTables")]
+    // Warning: Note that `TypeckTables` are coming up clean here.
+    // The addition or removal of lifetime parameters that don't
+    // appear in the arguments or fn body in any way does not, in
+    // fact, affect the `TypeckTables` in any semantic way (at least
+    // as of this writing). **However,** altering the order of
+    // lowering **can** cause it appear to affect the `TypeckTables`:
+    // if we lower generics before the body, then the `HirId` for
+    // things in the body will be affected. So if you start to see
+    // `TypeckTables` appear dirty, that might be the cause. -nmatsakis
+    #[rustc_clean(cfg="cfail2", except="Hir,HirBody")]
     #[rustc_clean(cfg="cfail3")]
     #[rustc_metadata_clean(cfg="cfail2")]
     #[rustc_metadata_clean(cfg="cfail3")]
@@ -391,9 +400,18 @@ impl Foo {
 #[rustc_metadata_clean(cfg="cfail2")]
 #[rustc_metadata_clean(cfg="cfail3")]
 impl Foo {
+    // Warning: Note that `TypeckTables` are coming up clean here.
+    // The addition or removal of type parameters that don't appear in
+    // the arguments or fn body in any way does not, in fact, affect
+    // the `TypeckTables` in any semantic way (at least as of this
+    // writing). **However,** altering the order of lowering **can**
+    // cause it appear to affect the `TypeckTables`: if we lower
+    // generics before the body, then the `HirId` for things in the
+    // body will be affected. So if you start to see `TypeckTables`
+    // appear dirty, that might be the cause. -nmatsakis
     #[rustc_clean(
         cfg="cfail2",
-        except="Hir,HirBody,GenericsOfItem,PredicatesOfItem,TypeOfItem,TypeckTables",
+        except="Hir,HirBody,GenericsOfItem,PredicatesOfItem,TypeOfItem",
     )]
     #[rustc_clean(cfg="cfail3")]
     #[rustc_metadata_dirty(cfg="cfail2")]
@@ -439,8 +457,17 @@ impl Foo {
 #[rustc_metadata_clean(cfg="cfail2")]
 #[rustc_metadata_clean(cfg="cfail3")]
 impl Foo {
+    // Warning: Note that `TypeckTables` are coming up clean here.
+    // The addition or removal of bounds that don't appear in the
+    // arguments or fn body in any way does not, in fact, affect the
+    // `TypeckTables` in any semantic way (at least as of this
+    // writing). **However,** altering the order of lowering **can**
+    // cause it appear to affect the `TypeckTables`: if we lower
+    // generics before the body, then the `HirId` for things in the
+    // body will be affected. So if you start to see `TypeckTables`
+    // appear dirty, that might be the cause. -nmatsakis
     #[rustc_clean(cfg="cfail2", except="Hir,HirBody,GenericsOfItem,PredicatesOfItem,\
-                                        TypeOfItem,TypeckTables")]
+                                        TypeOfItem")]
     #[rustc_clean(cfg="cfail3")]
     #[rustc_metadata_dirty(cfg="cfail2")]
     #[rustc_metadata_clean(cfg="cfail3")]
@@ -461,7 +488,16 @@ impl Foo {
 #[rustc_metadata_clean(cfg="cfail2")]
 #[rustc_metadata_clean(cfg="cfail3")]
 impl Foo {
-    #[rustc_clean(cfg="cfail2", except="Hir,HirBody,PredicatesOfItem,TypeckTables")]
+    // Warning: Note that `TypeckTables` are coming up clean here.
+    // The addition or removal of bounds that don't appear in the
+    // arguments or fn body in any way does not, in fact, affect the
+    // `TypeckTables` in any semantic way (at least as of this
+    // writing). **However,** altering the order of lowering **can**
+    // cause it appear to affect the `TypeckTables`: if we lower
+    // generics before the body, then the `HirId` for things in the
+    // body will be affected. So if you start to see `TypeckTables`
+    // appear dirty, that might be the cause. -nmatsakis
+    #[rustc_clean(cfg="cfail2", except="Hir,HirBody,PredicatesOfItem")]
     #[rustc_clean(cfg="cfail3")]
     #[rustc_metadata_dirty(cfg="cfail2")]
     #[rustc_metadata_clean(cfg="cfail3")]