rust/src/librustdoc
bors 857ef6e272 Auto merge of #23606 - quantheory:associated_const, r=nikomatsakis
Closes #17841.

The majority of the work should be done, e.g. trait and inherent impls, different forms of UFCS syntax, defaults, and cross-crate usage. It's probably enough to replace the constants in `f32`, `i8`, and so on, or close to good enough.

There is still some significant functionality missing from this commit:

 - ~~Associated consts can't be used in match patterns at all. This is simply because I haven't updated the relevant bits in the parser or `resolve`, but it's *probably* not hard to get working.~~
 - Since you can't select an impl for trait-associated consts until partway through type-checking, there are some problems with code that assumes that you can check constants earlier. Associated consts that are not in inherent impls cause ICEs if you try to use them in array sizes or match ranges. For similar reasons, `check_static_recursion` doesn't check them properly, so the stack goes ka-blooey if you use an associated constant that's recursively defined. That's a bit trickier to solve; I'm not entirely sure what the best approach is yet.
 - Dealing with consts associated with type parameters will raise some new issues (e.g. if you have a `T: Int` type parameter and want to use `<T>::ZERO`). See rust-lang/rfcs#865.
 - ~~Unused associated consts don't seem to trigger the `dead_code` lint when they should. Probably easy to fix.~~

Also, this is the first time I've been spelunking in rustc to such a large extent, so I've probably done some silly things in a couple of places.
2015-04-27 16:45:21 +00:00
..
clean Get associated consts working in match patterns. 2015-04-23 21:02:29 -06:00
html Auto merge of #23606 - quantheory:associated_const, r=nikomatsakis 2015-04-27 16:45:21 +00:00
core.rs rustdoc: Inline methods inhereted through Deref 2015-04-16 13:28:15 -07:00
doctree.rs rustdoc: Fix cross-crate macro source links 2015-04-16 09:44:33 -07:00
externalfiles.rs Add generic conversion traits 2015-03-23 15:01:45 -07:00
flock.rs Test fixes and rebase conflicts, round 2 2015-03-31 15:56:33 -07:00
fold.rs rustdoc: Run external traits through filters 2015-04-07 17:54:33 -07:00
lib.rs implement rfc 1054: split_whitespace() fn, deprecate words() 2015-04-21 15:31:51 -04:00
markdown.rs Positive case of len() -> is_empty() 2015-04-14 20:26:03 -07:00
passes.rs Structural changes for associated constants 2015-04-23 21:02:25 -06:00
plugins.rs Test fixes and rebase conflicts, round 2 2015-03-27 13:43:42 -07:00
test.rs Auto merge of #24597 - bombless:doc, r=steveklabnik 2015-04-20 15:23:52 +00:00
visit_ast.rs rustdoc: Fix cross-crate macro source links 2015-04-16 09:44:33 -07:00