Skip to content

Implement in-band lifetime bindings #46051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Nov 23, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.
  • Loading branch information
nikomatsakis committed Nov 22, 2017
commit d3e0c33dbeaaa10f17e867ac62bb268167fda942
44 changes: 40 additions & 4 deletions src/test/incremental/hashes/inherent_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand All @@ -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")]
Expand Down Expand Up @@ -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")]
Expand All @@ -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")]
Expand Down