| Age | Commit message (Collapse) | Author | Lines |
|
[beta] properly run doctests in standalone markdown files with pulldown
This is a beta-specific fix for https://github.com/rust-lang/rust/issues/48327, since a different fix landed in nightly (https://github.com/rust-lang/rust/pull/48274) that is infeasible to backport.
The nature of the issue was that when running doctests on standalone Markdown files, rustdoc names the tests based on the headings in the files. Therefore, with the following `a.md`:
``````markdown
# My Cool Library
This is my cool library!
## Examples
Here's some cool code samples!
```rust
assert_eq!(2+2, 4);
```
``````
Running this file with `rustdoc --test a.md` would show a test named `a.md - my_cool_library::examples (line 9)`. So far, this works just fine between Hoedown and Pulldown. But it gets murkier when you introduce markup into your headings. Consider the following `b.md`:
``````markdown
# My Cool Library
This is my cool library!
## `libcool`
```rust
assert_eq!(2+2, 4);
```
``````
The code surrounding the different renderers handles this differently. Pulldown handles just the first `Text` event after seeing the header, so it names the test `b.md - my_cool_library::libcool (line 9)`. Hoedown, on the other hand, takes all the test within the heading, which Hoedown renders before handing to library code. Therefore, it will name the test `b.md - my_cool_library::_code_libcool__code_ (line 9)`. (Somewhere between rustdoc and libtest, the `</>` characters are replaced with underscores.)
This causes a problem with another piece of code: The one that checks for whether Pulldown detected a code block that Hoedown didn't. The test collector groups the "old tests" listing by the full test name, but it *inserts* with the Hoedown name, and *searches* for the Pulldown name! This creates a situation where when `b.md` from above is run, it can't find a matching test from the ones Hoedown extracted, so it discards it and emits a warning.
On nightly, this has been fixed by... ditching Hoedown entirely. This also removed the code that tracked the different test listings, and made it run the test anyway. Since backporting the Hoedown removal is infeasible (i'm personally relying on the change to ride the trains to give the stabilization enough time to complete), this instead chooses to group the test by the filename, instead of the full test name as before. This means that the test extractor finds the test properly, and properly runs the test.
|
|
|
|
|
|
Hide theme button under menu in mobile mode and fix top margin issue …
Fixes #48060.
r? @QuietMisdreavus
|
|
intra-doc-links: bail early for linky things
r? @QuietMisdreavus
|
|
rustdoc: Hide `-> ()` in cross crate inlined Fn* bounds
|
|
mobile too)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
r=QuietMisdreavus
Fix rendering issues on mobile
Fixes #47723
r? @QuietMisdreavus
|
|
|
|
Fix const evaluation ICE in rustdoc
Fixes #47860.
r? @eddyb
|
|
|
|
|
|
|
|
|
|
|
|
Highlight code on diagnostics when underlined
Highlight the label's span with the respective color:
<img width="692" alt="" src="https://user-images.githubusercontent.com/1606434/32411026-a1842482-c18d-11e7-9933-6510eefbad19.png">
Fix #42112.
|
|
rustdoc: Fix link title rendering with hoedown
The link title needs to be HTML escaped.
It was broken by #47046.
r? @QuietMisdreavus
|
|
The link title needs to be HTML escaped.
|
|
|
|
Building on the work of # 45684 this commit updates the compiler to
unconditionally load the `rustc_trans` crate at runtime instead of linking to it
at compile time. The end goal of this work is to implement # 46819 where rustc
will have multiple backends available to it to load.
This commit starts off by removing the `extern crate rustc_trans` from the
driver. This involved moving some miscellaneous functionality into the
`TransCrate` trait and also required an implementation of how to locate and load
the trans backend. This ended up being a little tricky because the sysroot isn't
always the right location (for example `--sysroot` arguments) so some extra code
was added as well to probe a directory relative to the current dll (the
rustc_driver dll).
Rustbuild has been updated accordingly as well to have a separate compilation
invocation for the `rustc_trans` crate and assembly it accordingly into the
sysroot. Finally, the distribution logic for the `rustc` package was also
updated to slurp up the trans backends folder.
A number of assorted fallout changes were included here as well to ensure tests
pass and such, and they should all be commented inline.
|
|
|
|
Fixes for intra-doc-links
Turn errors into warnings, also handle methods, trait items, and variants.
r? @killercup @QuietMisdreavus
|
|
Fix experimental text display on default theme
r? @QuietMisdreavus
|
|
Few fixes for multiple themes support feature
r? @QuietMisdreavus
Fixes #47695.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Immovable generators
This adds support for immovable generators which allow you to borrow local values inside generator across suspension points. These are declared using a `static` keyword:
```rust
let mut generator = static || {
let local = &Vec::new();
yield;
local.push(0i8);
};
generator.resume();
// ERROR moving the generator after it has resumed would invalidate the interior reference
// drop(generator);
```
Region inference is no longer affected by the types stored in generators so the regions inside should be similar to other code (and unaffected by the presence of `yield` expressions). The borrow checker is extended to pick up the slack so interior references still result in errors for movable generators. This fixes #44197, #45259 and #45093.
This PR depends on [PR #44917 (immovable types)](https://github.com/rust-lang/rust/pull/44917), I suggest potential reviewers ignore the first commit as it adds immovable types.
|
|
Rollup of 14 pull requests
- Successful merges: #47423, #47425, #47440, #47541, #47549, #47554, #47558, #47610, #47635, #47655, #47661, #47662, #47667, #47672
- Failed merges:
|
|
rustdoc: Show when traits are auto traits
|
|
Multiple themes for rustdoc
r? @QuietMisdreavus
|
|
|
|
across suspension points to borrowck. Fixes #44197, #45259 and #45093.
|
|
|
|
|
|
|