summary refs log tree commit diff
path: root/src/librustdoc
AgeCommit message (Collapse)AuthorLines
2017-04-23rustc: make the const-eval cache polymorphic.Eduard-Mihai Burtescu-1/+1
2017-04-22Fix line displayGuillaume Gomez-12/+8
2017-04-22Fix testsGuillaume Gomez-4/+5
2017-04-22Re-enable hoedown by defaultGuillaume Gomez-86/+382
2017-04-20Fix line display for hoedownGuillaume Gomez-9/+37
2017-04-17Rollup merge of #41310 - eddyb:demand-const-eval, r=nikomatsakisCorey Farwell-3/+1
[on-demand] Turn monomorphic_const_eval into a proper query, not just a cache. The error definitions and reporting logic, alongside with `eval_length` were moved to `librustc`. Both local and cross-crate constant evaluation is on-demand now, but the latter is only used for `enum` discriminants, to replace the manual insertion into the cache which was done when decoding variants. r? @nikomatsakis
2017-04-17Rollup merge of #41290 - GuillaumeGomez:put-back-hoedown, r=steveklabnikCorey Farwell-7/+252
Hoedown big comeback! ```bash > cargo +local test Compiling libc v0.2.20 Compiling sysinfo v0.3.4 (file:///Users/imperio/rust/sysinfo) Finished dev [unoptimized + debuginfo] target(s) in 3.2 secs Running target/debug/deps/disk_list-dbd70897f1f7e080 running 1 test test test_disks ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured Running target/debug/deps/sysinfo-8ad11103abdf5941 running 0 tests test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured Doc-tests sysinfo WARNING: src/sysinfo.rs - (line 45) test will be run in the next rustdoc version. If it's not supposed to, please update your documentation and make it compliant to common mark specifications. WARNING: src/sysinfo.rs - (line 48) test will be run in the next rustdoc version. If it's not supposed to, please update your documentation and make it compliant to common mark specifications. running 1 test test src/sysinfo.rs - (line 14) ... ok test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured ``` r? @rust-lang/docs
2017-04-17Rollup merge of #41280 - QuietMisdreavus:rustdoc-toc, r=GuillaumeGomezCorey Farwell-4/+225
rustdoc: add a list of headings to the sidebar It's another misdreavus rustdoc PR, which means it's time for Bikeshed City once again! `:3` In an effort to aid navigation in long documentation pages, this PR adds a listing of headings to the sidebars of pages where such headings exist. For example, for structs, links to their fields, inherent methods, and trait implementations are available where applicable. Examples: * Modules/Crate roots ![image](https://cloud.githubusercontent.com/assets/5217170/25019930/1000fa3a-2052-11e7-98ff-ddf5af18b3e6.png) * Enums ![image](https://cloud.githubusercontent.com/assets/5217170/25019954/33497f9e-2052-11e7-88cf-df46f1b3b8a3.png) * Primitives ![image](https://cloud.githubusercontent.com/assets/5217170/25019978/4820bbc6-2052-11e7-8b5a-96a864eb2a5b.png) * Traits ![image](https://cloud.githubusercontent.com/assets/5217170/25020093/bd1bc9f2-2052-11e7-9cd1-00a0ad8007bc.png) * Structs ![image](https://cloud.githubusercontent.com/assets/5217170/25020145/d75206b0-2052-11e7-88cc-9e9525084775.png) Open questions: * Right now, these kinds of pages (and also unions) are the only pages that will receive the name header - pages for functions, constants, macros, etc, won't have the corresponding name in their sidebar. Should I print the name regardless and only add table-of-contents links for pages that have them? This would make them match, for example, a struct with no public fields, no methods, and no trait implementations. The latter would still have a "Struct MyStruct" line above the module contents, with no header links to speak of, whereas a function wouldn't even have "Function my\_function". * This is only a header listing, but there has been requests to include a more-complete listing of fields/methods/traits/etc, for example in #41123.
2017-04-17Hoedown big comeback!Guillaume Gomez-7/+252
2017-04-17rustdoc: add a list of headings to the sidebarQuietMisdreavus-4/+225
2017-04-16rustc: expose monomorphic const_eval through on-demand.Eduard-Mihai Burtescu-3/+1
2017-04-14Rollup merge of #41249 - GuillaumeGomez:rustdoc-render, r=steveklabnik,frewsxcvCorey Farwell-42/+75
Fix invalid associated type rendering in rustdoc Fixes #41036. r? @rust-lang/docs
2017-04-14Rollup merge of #41172 - Aaron1011:rustdoc-overflow, r=frewsxcvCorey Farwell-0/+8
Fix rustdoc infinitely recursing when an external crate reexports itself Previously, rustdoc's LibEmbargoVisitor unconditionally visited the child modules of an external crate. If a module re-exported its parent via `pub use super::*`, rustdoc would re-walk the parent, leading to infinite recursion. This commit makes LibEmbargoVisitor store already visited modules in an FxHashSet, ensuring that each module is only walked once. Fixes #40936
2017-04-14Rollup merge of #40702 - mrhota:global_asm, r=nagisaCorey Farwell-0/+1
Implement global_asm!() (RFC 1548) This is a first attempt. ~~One (potential) problem I haven't solved is how to handle multiple usages of `global_asm!` in a module/crate. It looks like `LLVMSetModuleInlineAsm` overwrites module asm, and `LLVMAppendModuleInlineAsm` is not provided in LLVM C headers 😦~~ I can provide more detail as needed, but honestly, there's not a lot going on here. r? @eddyb CC @Amanieu @jackpot51 Tracking issue: #35119
2017-04-13Auto merge of #40570 - nikomatsakis:inference-subtype-through-obligation, ↵bors-1/+9
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-12First attempt at global_asm! macroA.J. Gardner-0/+1
2017-04-12Fix invalid associated type rendering in rustdocGuillaume Gomez-42/+75
2017-04-11just panic in rustdoc if we encounter a subtype predicateNiko Matsakis-7/+4
These are not user expressible anyhow.
2017-04-11add Subtype predicateNiko Matsakis-0/+11
2017-04-11Rollup merge of #41173 - GuillaumeGomez:fix-rustdoc-code-block-parsing, ↵Corey Farwell-9/+17
r=steveklabnik Fix block code headers parsing Fixes #41167. r? @rust-lang/docs
2017-04-11Remove strings fulfilled with whitespaces in code block headersGuillaume Gomez-6/+7
2017-04-09Fix block code headers parsingGuillaume Gomez-8/+15
2017-04-09Fix rustdoc infinitely recursing when an external crate reexports itselfAaron Hill-0/+8
Previously, rustdoc's LibEmbargoVisitor unconditionally visited the child modules of an external crate. If a module re-exported its parent via 'pub use super::*', rustdoc would re-walk the parent, leading to infinite recursion. This commit makes LibEmbargoVisitor store already visited modules in an FxHashSet, ensuring that each module is only walked once. Fixes #40936
2017-04-09merge with master to pick up pulldown switchQuietMisdreavus-571/+622
2017-04-08Auto merge of #40887 - estebank:ty-placeholder, r=petrochenkovbors-1/+1
Introduce `TyErr` independent from `TyInfer` Add a `TyErr` type to represent unknown types in places where parse errors have happened, while still able to build the AST. Initially only used to represent incorrectly written fn arguments and avoid "expected X parameters, found Y" errors when called with the appropriate amount of parameters. We cannot use `TyInfer` for this as `_` is not allowed as a valid argument type. Example output: ```rust error: expected one of `:` or `@`, found `,` --> file.rs:12:9 | 12 | fn bar(x, y: usize) {} | ^ error[E0061]: this function takes 2 parameters but 3 parameters were supplied --> file.rs:19:9 | 12 | fn bar(x, y) {} | --------------- defined here ... 19 | bar(1, 2, 3); | ^^^^^^^ expected 2 parameters ``` Fix #34264.
2017-04-07Merge branch 'master' into ty-placeholderEsteban Küber-340/+292
2017-04-07Rollup merge of #41131 - euclio:collapse-animation, r=GuillaumeGomezCorey Farwell-4/+11
rustdoc: collapse docblock before showing label The animation for collapsing descriptions is currently pretty jarring, as the label starts fading in as the description is collapsing. This causes the description to jump down a line (and sometimes change indentation) while animating. This PR modifies this behavior to collapse the block entirely before starting to fade in the collapse button label. While this PR works well for descriptions of structs, traits, etc., it still does not look ideal for attributes. I'd appreciate any suggestions for improving that animation. Perhaps we want to optimize for the single-attribute case, and try not to collapse the attribute list entirely before fading in the label?
2017-04-06rustdoc: collapse docblock before showing labelAndy Russell-4/+11
2017-04-06rustdoc: move the space at the end of where clausesQuietMisdreavus-3/+11
...so that we don't indent the next line by one extra space
2017-04-06rustdoc: where clause adjustment to fix testsQuietMisdreavus-6/+9
- add spaces to output so stripping lines and breaking spaces renders the same - add commas to where clauses in rustdoc tests to match the new output
2017-04-06rustdoc: Use pulldown-cmark for Markdown HTML renderingOliver Middleton-470/+274
Instead of rendering all of the HTML in rustdoc this relies on pulldown-cmark's `push_html` to do most of the work. A few iterator adapters are used to make rustdoc specific modifications to the output. This also fixes MarkdownHtml and link titles in plain_summary_line.
2017-04-05style: space between struct name and opening braceQuietMisdreavus-2/+2
2017-04-04rustdoc: don't add a space before `{` on traits with where clausesQuietMisdreavus-3/+8
cc #41025
2017-04-04rustdoc: properly indent fn signatures in traitsQuietMisdreavus-30/+48
2017-04-04Handle ordered lists as wellGuillaume Gomez-4/+12
2017-04-02Auto merge of #40919 - GuillaumeGomez:fix-new-rustdoc, r=frewsxcv,steveklabnikbors-31/+171
Add support for image, rules and footnotes Part of #40912. r? @rust-lang/docs PS: the footnotes are waiting for https://github.com/google/pulldown-cmark/pull/21 to be merged to be fully working.
2017-04-02Introduce `TyErr` independent from `TyInfer`Esteban Küber-1/+1
Add a `TyErr` type to represent unknown types in places where parse errors have happened, while still able to build the AST. Initially only used to represent incorrectly written fn arguments and avoid "expected X parameters, found Y" errors when called with the appropriate amount of parameters. We cannot use `TyInfer` for this as `_` is not allowed as a valid argument type. Example output: ```rust error: expected one of `:` or `@`, found `,` --> file.rs:12:9 | 12 | fn bar(x, y: usize) {} | ^ error[E0061]: this function takes 2 parameters but 3 parameters were supplied --> file.rs:19:9 | 12 | fn bar(x, y) {} | --------------- defined here ... 19 | bar(1, 2, 3); | ^^^^^^^ expected 2 parameters ```
2017-04-01Force footnote references to be sorted by idGuillaume Gomez-4/+6
2017-03-31rustdoc: fix alignment of fn arguments when on multiple linesQuietMisdreavus-1/+1
2017-03-31rustdoc: format where clauses like rust-lang-nursery/fmt-rfcs#38QuietMisdreavus-81/+55
2017-03-31Fix hard break issueGuillaume Gomez-3/+46
2017-03-31Rollup merge of #40888 - wesleywiser:rustdoc_src_sidebar, r=GuillaumeGomezCorey Farwell-5/+9
Make the rustdoc sidebar white on `src` pages Fixes #40724
2017-03-30Fix multiple footnotes and improve testingGuillaume Gomez-21/+33
2017-03-29Add support for image, rules and footnotesGuillaume Gomez-28/+111
2017-03-29Rollup merge of #40814 - abonander:issue_39436, r=jseyfriedCorey Farwell-2/+20
Rustdoc: memoize `pub use`-reexported macros so they don't appear twice in docs Closes #39436 Preserves existing behavior for `#[macro_reexport]`. `pub use`'d macros are shown as reexports unless inlined, and also correctly obey `#[doc(hidden)]`. r? @jseyfried cc @SergioBenitez
2017-03-29Auto merge of #40338 - GuillaumeGomez:pulldown-switch, r=frewsxcv,steveklabnikbors-487/+515
Replace hoedown with pull in rustdoc cc @rust-lang/docs
2017-03-28Make the rustdoc sidebar white on `src` pagesWesley Wiser-5/+9
Fixes #40724
2017-03-28rustdoc: format fns like format rfc 39QuietMisdreavus-20/+16
2017-03-28Rustdoc: memoize `pub use`-reexported macros so they don't appear twice in docsAustin Bonander-2/+20
2017-03-28Improve function namingGuillaume Gomez-23/+22