rust/src/librustc_metadata
bors 8dd715ee5e Auto merge of #51895 - nikomatsakis:move-self-trait-predicate-to-items, r=scalexm
Move self trait predicate to items

This is a "reimagination" of @tmandry's PR #50183. The main effect is described in this comment from one of the commits:

---

Before we had the following results for `predicates_of`:

```rust
trait Foo { // predicates_of: Self: Foo
  fn bar(); // predicates_of: Self: Foo (inherited from trait)
}
```

Now we have removed the `Self: Foo` from the trait. However, we still
add it to the trait ITEM. This is because when people do things like
`<T as Foo>::bar()`, they still need to prove that `T: Foo`, and
having it in the `predicates_of` seems to be the cleanest way to
ensure that happens right now (otherwise, we'd need special case code
in various places):

```rust
trait Foo { // predicates_of: []
  fn bar(); // predicates_of: Self: Foo
}
```

However, we sometimes want to get the list of *just* the predicates
truly defined on a trait item (e.g., for chalk, but also for a few
other bits of code). For that, we define `predicates_defined_on`,
which does not contain the `Self: Foo` predicate yet, and we plumb
that through metadata and so forth.

---

I'm assigning @eddyb as the main reviewer, but I thought I might delegate to scalexm for this one in any case. I also want to post an alternative that I'll leave in the comments; it occurred to me as I was writing. =)

r? @eddyb
cc @scalexm @tmandry @leodasvacas
2018-07-04 09:33:33 +00:00
..
Cargo.toml Rename rustc_back::target to rustc_target::spec. 2018-04-26 16:39:44 +03:00
build.rs rustc: Add some build scripts for librustc crates 2017-07-22 22:04:13 -07:00
creader.rs expansion: Give names to some fields of `SyntaxExtension` 2018-06-30 01:53:32 +03:00
cstore.rs Make metadata decoding use AllocDecodingState/Session. 2018-06-01 09:32:24 +02:00
cstore_impl.rs Auto merge of #51895 - nikomatsakis:move-self-trait-predicate-to-items, r=scalexm 2018-07-04 09:33:33 +00:00
decoder.rs introduce `predicates_defined_on` for traits 2018-07-02 11:33:24 -04:00
diagnostics.rs Rename trans to codegen everywhere. 2018-05-17 15:08:30 +03:00
dynamic_lib.rs rustc: Load the `rustc_trans` crate at runtime 2018-01-27 19:16:21 -08:00
encoder.rs Auto merge of #51895 - nikomatsakis:move-self-trait-predicate-to-items, r=scalexm 2018-07-04 09:33:33 +00:00
foreign_modules.rs rustc: Add a `#[wasm_import_module]` attribute 2018-03-22 13:16:38 -07:00
index.rs Make opaque::Encoder append-only and make it infallible 2018-06-27 11:43:15 +02:00
index_builder.rs Replace uses of DepGraph.in_ignore with DepGraph.with_ignore 2018-01-09 18:35:50 +01:00
isolated_encoder.rs Remove HIR inlining 2018-04-19 20:33:18 -04:00
lib.rs Bootstrap from 1.28.0-beta.3 2018-06-30 13:17:49 -07:00
link_args.rs rustc_target: move in syntax::abi and flip dependency. 2018-04-26 17:49:16 +03:00
locator.rs Rename rustc_back::target to rustc_target::spec. 2018-04-26 16:39:44 +03:00
native_libs.rs rustc_target: move in syntax::abi and flip dependency. 2018-04-26 17:49:16 +03:00
schema.rs introduce `predicates_defined_on` for traits 2018-07-02 11:33:24 -04:00