Commit Graph

81714 Commits

Author SHA1 Message Date
kennytm
aefa307c1f
Rollup merge of #53047 - integer32llc:rustdoc-clicky-clicky, r=QuietMisdreavus
Make entire row of doc search results clickable

By adding empty `after` content that clears and is `display: block`.
Technique found here: https://stackoverflow.com/a/7817313/51683

Now any part of a documentation search result that is highlighted when
you hover over it should also be clickable.

NOTE: THE BELOW IMAGES ARE GIFS BUT I DIDN'T MAKE THEM LOOP, OPEN IN A NEW TAB TO SEE THEM SORRY SORRY

Here's what happens before this change: my mouse cursor is in the middle of the table cell, and the row is highlighted which makes it look like clicking should have an effect, but clicking doesn't do anything:

![rustdoc-clicky-clicky-before](https://user-images.githubusercontent.com/193874/43668604-d1e63392-974b-11e8-99f5-e7e11c9056e8.gif)

After this change, clicking in the middle of the cell works!

![rustdoc-clicky-clicky-after](https://user-images.githubusercontent.com/193874/43668616-e522fa08-974b-11e8-8409-3826d586d1f7.gif)

It even works nicely when the type is really long and wraps! (I created the type artificially because I couldn't find a long enough one in the wild)

![rustdoc-clicky-clicky-after-long](https://user-images.githubusercontent.com/193874/43668639-f962a75c-974b-11e8-9218-70bf068387a3.gif)
2018-08-04 14:36:02 +08:00
kennytm
e8060a4229
Rollup merge of #53041 - GuillaumeGomez:fix-code-css-rule, r=QuietMisdreavus
Fix invalid code css rule

Fixes #53017.

r? @QuietMisdreavus
2018-08-04 14:36:00 +08:00
kennytm
43410981ae
Rollup merge of #53024 - matklad:patch-1, r=alexcrichton
Specify reentrancy gurantees of `Once::call_once`

I don't think the docs are clear about what happens in the following code

```rust
static INIT: Once = ONCE_INIT;

INIT.call_once(|| INIT.call_once(|| println!("huh?")));
```

[Playground](https://play.rust-lang.org/?gist=15dde1f68a6ede263c7250c36977eade&version=stable&mode=debug&edition=2015)

Let's "specify" the behavior to make it clear that the current behavior (deadlock I think?) is not a strict guarantee.
2018-08-04 14:35:59 +08:00
kennytm
aeb2028481
Rollup merge of #53022 - RalfJung:volatile, r=alexcrichton
volatile operations docs: clarify that this does not help wrt. concurrency

Triggered by https://github.com/rust-lang/rust/pull/52391. Cc @stjepang @Amanieu

Should the intrinsics themselves also get more documentation? They generally do not seem to have much of that.
2018-08-04 14:35:58 +08:00
kennytm
7a23b5dec3
Rollup merge of #53003 - GuillaumeGomez:stabilize-rustdoc-options, r=QuietMisdreavus
Stabilize --color and --error-format options in rustdoc

Fixes #52980

cc @kennytm

r? @QuietMisdreavus
2018-08-04 14:35:56 +08:00
kennytm
d028b3ea33
Rollup merge of #53001 - petrochenkov:master, r=estebank
privacy: Fix an ICE in `path_is_private_type`

Fixes https://github.com/rust-lang/rust/issues/52879

(Untested.)
2018-08-04 14:35:55 +08:00
kennytm
035db4b004
Rollup merge of #52996 - cuviper:1.28-or_default, r=Mark-Simulacrum
RELEASES.md: fix the `hash_map::Entry::or_default` link

None
2018-08-04 14:35:54 +08:00
kennytm
59bfa8a884
Rollup merge of #52995 - cramertj:smaller-await, r=withoutboats
Remove unnecessary local in await! generator

This makes `async { await!(future::ready(())) }` 4 bytes instead of 16. [Playground example](http://play.rust-lang.org/?gist=54c075599b9ff390fe505c75d6b98feb&version=nightly&mode=debug&edition=2018)
2018-08-04 14:35:53 +08:00
kennytm
a365382826
Rollup merge of #52969 - Keruspe:local_rebuild, r=alexcrichton
rustbuild: fix local_rebuild

If we detect a local rebuild (e.g. bootstrap compiler is the same version as target compiler), we set stage to 1.
When trying to build e.g. UnstableBook, we use Mode::ToolBootstrap and stage is 1.
Just allow Mode::ToolBootstrap and stagge != 0 if we are in a local_rebuild

This fixes building current master using current beta (as master hasn't yet been bumped to 1.30).
This should be backported to beta too, as currently we cannot build beta using itself because of that.

r? @alexcrichton
2018-08-04 14:35:51 +08:00
kennytm
e82dab7c0e
Rollup merge of #52968 - zackmdavis:app-lint-cability, r=estebank
App-lint-cability

@eminence recently pointed out (rust-lang/cargo#5846) that it's
surprising that `cargo fix` (now shipping with Cargo itself!) doesn't
fix very common lint warnings, which is as good of a reminder as any
that we should finish #50723.

(Previously, we did this on the librustc and libsyntax crates in #50724. I filed cmr/this-week-in-rust#685 in hopes of recruiting new contributors to do the rest.)

r? @estebank
2018-08-04 14:35:50 +08:00
kennytm
96179cd8fe
Rollup merge of #52940 - kennytm:move-checktool-protection-week, r=alexcrichton
Align 6-week cycle check with beta promotion instead of stable release.

The regression check is to make beta promotion easier, so it makes more
sense to use the Tuesday of the release week (T-2) as the end point of the
regression prevention, instead of Thursday (T-0). But since the beta
promotion PR is sent at Tuesday evening at UTC, the protection should
include the whole Tuesday as well, meaning the 6-week cycle will start from
Wednesdays.

This will also move the start of the regression protection week one day
earlier.
2018-08-04 14:35:49 +08:00
bors
579adf8c72 Auto merge of #53035 - alexcrichton:debug-travis, r=kennytm
travis: Attempt to debug shutdowns

These snippets recommend by Travis support
2018-08-04 03:45:55 +00:00
bors
c11f2d286c Auto merge of #52927 - Mark-Simulacrum:cratestore-cleanup, r=alexcrichton
Crate store cleanup

Each commit mostly stands on its own.

Most of the diff is lifetime-related and uninteresting.
2018-08-04 01:44:25 +00:00
Carol (Nichols || Goulding)
d5dd37b00f
Make left column of rustdoc search results narrower
To make more room for the description of the item
2018-08-03 20:39:58 -04:00
Carol (Nichols || Goulding)
11ffeed1ed
Make entire row of doc search results clickable
By adding empty `after` content that clears and is `display: block`.
Technique found here: https://stackoverflow.com/a/7817313/51683

Now any part of a documentation search result that is highlighted when
you hover over it should also be clickable.
2018-08-03 18:29:49 -04:00
Felix S. Klock II
abd81c9ff5 An attempt to fix NLL migration mode so that reports region errors when necessary.
Namely, the code here was trying to be clever, and say "lets not
report diagnostics when we 'know' NLL will report an error about them
in the future."

The problem is that in migration mode, when no error was reported here,
the NLL error that we "knew" was coming was downgraded to a warning (!).

This fixes that by only doing the "clever" skipping of region error reporting
when we are not in migration mode.

Rather than make a separate test for issue 53026, I just took the test
that uncovered this in a first place, and extended it (via our
revisions system) to explicitly show all three modes in action:
ACT-borrowck, NLL, and NLL migration mode.

(Tto be honest I hope not to have to add such revisions to many tests.
Instead I hope to adopt some sort of new `compare-mode` for either
borrowck=migrate or for the 2018 edition as a whole.)
2018-08-04 00:12:15 +02:00
Matthew Jasper
12af36a5c4 Update tests for new spans for nll errors involving closures 2018-08-03 23:00:27 +01:00
Matthew Jasper
5639e2173b Tests for closure spans 2018-08-03 23:00:27 +01:00
Matthew Jasper
903851f785 Highlight closure spans for borrow and initialization errors 2018-08-03 23:00:27 +01:00
Guillaume Gomez
e2cda7dd82 Fix invalid code css rule 2018-08-03 23:30:16 +02:00
bors
3edb355b75 Auto merge of #53034 - Manishearth:clippyup, r=oli-obk
Update clippy

r? @kennytm @alexcrichton
2018-08-03 21:11:00 +00:00
Alex Crichton
801ba8c883 travis: Attempt to debug shutdowns
These snippets recommend by Travis support
2018-08-03 12:20:45 -07:00
bors
7e031b0907 Auto merge of #52973 - davidtwco:issue-52663-lifetimes-not-included-in-span, r=pnkfelix
NLL mentions lifetimes that are not included in printed span(s).

Part of #52663.

r? @pnkfelix
2018-08-03 17:46:13 +00:00
Mark Rousskov
6fdd6f65ca Move unused trait functions to inherent functions 2018-08-03 11:44:09 -06:00
Manish Goregaokar
cd70153e28 Update clippy 2018-08-03 10:16:07 -07:00
Mark Rousskov
5aec365cb9 Store concrete crate stores where possible 2018-08-03 11:09:49 -06:00
Mark Rousskov
eb0bc64265 Visibility is now a query 2018-08-03 11:09:36 -06:00
Mark Rousskov
cc1a6b99b0 Delete dummy crate store 2018-08-03 11:09:36 -06:00
Mark Rousskov
d4beecaed3 Move validate_crate_name to rustc_metadata 2018-08-03 11:09:02 -06:00
Scott McMurray
7398c3125b Fix the stage1 build 2018-08-03 08:52:30 -07:00
bors
59fa6bd6c1 Auto merge of #52712 - oli-obk:const_eval_cleanups, r=RalfJung
Reintroduce `Undef` and properly check constant value sizes

r? @RalfJung

cc @eddyb

basically all kinds of silent failures that never occurred are assertions now
2018-08-03 14:28:12 +00:00
Aleksey Kladov
a2f9aaf7a3
Fix trailnig WS 2018-08-03 16:50:30 +03:00
bors
88e0ff14a8 Auto merge of #52887 - yurydelendik:disable-lld-symbols, r=alexcrichton
Disable debug sections when optimization flags is set for LLD.

Currently LLD does not error when optimization is set and debugging information sections are present. (See discussion at https://reviews.llvm.org/D47901)

Using `--strip-debug` along with the `-O` option.
2018-08-03 12:22:17 +00:00
Aleksey Kladov
94de821002
Specify reentrancy gurantees of Once::call_once 2018-08-03 14:18:06 +03:00
Oliver Schneider
828aebfe3a Unify API of Scalar and ScalarMaybeUndef 2018-08-03 12:40:03 +02:00
Ralf Jung
71460d4d11 volatile operations docs: clarify that this does not help wrt. concurrency 2018-08-03 12:15:00 +02:00
Oliver Schneider
4819094031 Reintroduce alignment check 2018-08-03 11:28:06 +02:00
Oliver Schneider
21debc6984 Remove spurious whitespace 2018-08-03 11:24:36 +02:00
bors
e415b5ecc0 Auto merge of #52948 - davidtwco:issue-52633-later-loop-iteration, r=pnkfelix
NLL: Better Diagnostic When "Later" means "A Future Loop Iteration"

Part of #52663.

r? @pnkfelix
2018-08-03 09:22:11 +00:00
Oliver Schneider
26231e64b2 Remove some more unnecessary mut 2018-08-03 11:21:44 +02:00
Scott McMurray
ce9d469a70 Extract impl_header_lifetime_elision out of in_band_lifetimes 2018-08-03 00:08:44 -07:00
bors
4dae470513 Auto merge of #52925 - RalfJung:sanity_check, r=oli-obk
check_const: use the same ParamEnv as codegen for statics

Fixes at least part of https://github.com/rust-lang/rust/issues/52849 (my CTFE-stress benchmark). Note that I do not know what I am doing here, this is just based on hints from @oli-obk.

r? @oli-obk
2018-08-03 06:34:16 +00:00
Niko Matsakis
75504eeffa update error messages -- in some cases maybe we should investigate 2018-08-03 08:31:17 +02:00
Niko Matsakis
e79656c5b7 support X = &*Y reborrows 2018-08-03 08:15:55 +02:00
Tobias Bucher
a04b2cda0b Provide {to,from}_{ne,le,be}_bytes functions on integers
If one doesn't view integers as containers of bytes, converting them to
bytes necessarily needs the specfication of encoding.

I think Rust is a language that wants to be explicit. The `to_bytes`
function is basically the opposite of that – it converts an integer into
the native byte representation, but there's no mention (in the function
name) of it being very much platform dependent. Therefore, I think it
would be better to replace that method by three methods, the explicit
`to_ne_bytes` ("native endian") which does the same thing and
`to_{le,be}_bytes` which return the little- resp. big-endian encoding.
2018-08-03 07:55:10 +02:00
bors
7e8ca9f8bd Auto merge of #52919 - alexcrichton:update-cargo, r=Mark-Simulacrum
Update tool submodules, update feature unification strategy

* Bring in some fixes for `cargo fix`
* Update RLS/rustfmt to keep them compiling
* Update all tools to [depend on `rustc-workspace-hack`](https://github.com/rust-lang/rust/pull/52919#issuecomment-409802418)
* Change how we deal with feature unification amongst these builds.
2018-08-03 02:53:17 +00:00
Alex Crichton
0e034d162a Update Cargo submodule
Bring in some fixes for `cargo fix` notably
2018-08-02 18:09:19 -07:00
bors
1e3c45a7c3 Auto merge of #51657 - wesleywiser:wip_profiling, r=eddyb
Implement a self profiler

This is a work in progress implementation of #50780. I'd love feedback on the overall structure and code as well as some specific things:

- [The query categorization mechanism](https://github.com/rust-lang/rust/compare/master...wesleywiser:wip_profiling?expand=1#diff-19e0a69c10eff31eb2d16805e79f3437R101). This works but looks kind of ugly to me. Perhaps there's a better way?

- [The profiler assumes only one activity can run at a time](https://github.com/rust-lang/rust/compare/master...wesleywiser:wip_profiling?expand=1#diff-f8a403b2d88d873e4b27c097c614a236R177). This is obviously incompatible with the ongoing parallel queries.

- [The output code is just a bunch of `format!()`s](https://github.com/rust-lang/rust/compare/master...wesleywiser:wip_profiling?expand=1#diff-f8a403b2d88d873e4b27c097c614a236R91). Is there a better way to generate markdown or json in the compiler?

- [The query categorizations are likely wrong](https://github.com/rust-lang/rust/compare/master...wesleywiser:wip_profiling?expand=1#diff-19e0a69c10eff31eb2d16805e79f3437R101). I've marked what seemed obvious to me but I'm sure I got a lot of them wrong.

The overhead currently seems very low. Running `perf` on a sample compilation with profiling enabled reveals:
![image](https://user-images.githubusercontent.com/831192/41657821-9775efec-7462-11e8-9e5e-47ec94105d9d.png)
2018-08-03 00:50:09 +00:00
Wesley Wiser
2d3a0a9927 Generate self-profiler types with macros 2018-08-02 18:57:24 -04:00
Wesley Wiser
60c2e9a329 Fix tidy 2018-08-02 18:57:24 -04:00