rust/src/librustdoc
bors d2e2ad559e Auto merge of #40570 - nikomatsakis:inference-subtype-through-obligation, r=arielb1
Handle subtyping in inference through obligations

We currently store subtyping relations in the `TypeVariables` structure as a kind of special case. This branch uses normal obligations to propagate subtyping, thus converting our inference variables into normal fallback. It also does a few other things:

- Removes the (unstable, outdated) support for custom type inference fallback.
    - It's not clear how we want this to work, but we know that we don't want it to work the way it currently does.
    - The existing support was also just getting in my way.
- Fixes #30225, which was caused by the trait caching code pretending type variables were normal unification variables, when indeed they were not (but now are).

There is one fishy part of these changes: when computing the LUB/GLB of a "bivariant" type parameter, I currently return the `a` value. Bivariant type parameters are only allowed in a very particular situation, where the type parameter is only used as an associated type output, like this:

```rust
pub struct Foo<A, B>
    where A: Fn() -> B
{
    data: A
}
```

In principle, if one had `T=Foo<A, &'a u32>` and `U=Foo<A, &'b u32>` and (e.g.) `A: for<'a> Fn() -> &'a u32`, then I think that computing the LUB of `T` and `U` might do the wrong thing. Probably the right behavior is just to create a fresh type variable. However, that particular example would not compile (because the where-clause is illegal; `'a` does not appear in any input type). I was not able to make an example that *would* compile and demonstrate this shortcoming, and handling the LUB/GLB was mildly inconvenient, so I left it as is. I am considering whether to revisit this or what.

I have started a crater run to test the impact of these changes.
2017-04-13 00:28:11 +00:00
..
clean just panic in rustdoc if we encounter a subtype predicate 2017-04-11 20:32:48 -04:00
html Rollup merge of #41173 - GuillaumeGomez:fix-rustdoc-code-block-parsing, r=steveklabnik 2017-04-11 18:36:13 -04:00
passes Fix hard break issue 2017-03-31 12:16:03 -06:00
Cargo.toml Update to last pulldown version 2017-03-28 11:38:56 -06:00
core.rs convert privacy access levels into a query 2017-03-23 19:10:45 -04:00
doctree.rs rustc: move function arguments into hir::Body. 2016-12-28 11:29:19 +02:00
externalfiles.rs Remove unnecessary pub function classifier. 2016-10-09 00:17:50 -04:00
fold.rs Remove redundant 'Variant' in variant names, stop reexporting. 2016-10-02 21:58:23 -04:00
lib.rs Update to last pulldown version 2017-03-28 11:38:56 -06:00
markdown.rs rustdoc: Use pulldown-cmark for Markdown HTML rendering 2017-04-06 13:09:20 +01:00
plugins.rs Update usages of 'OSX' (and other old names) to 'macOS'. 2017-03-12 14:59:04 -04:00
test.rs Refactor Attribute to use Path and TokenStream instead of MetaItem. 2017-03-14 04:03:43 +00:00
visit_ast.rs Rustdoc: memoize pub use-reexported macros so they don't appear twice in docs 2017-03-28 12:39:46 -07:00
visit_lib.rs rustc: introduce a query system for type information in ty::maps. 2017-02-25 17:07:59 +02:00