]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoAuto merge of #53115 - davidtwco:issue-52739, r=nikomatsakis
bors [Mon, 6 Aug 2018 19:15:05 +0000 (19:15 +0000)]
Auto merge of #53115 - davidtwco:issue-52739, r=nikomatsakis

Disable some nice region errors in NLL mode.

Fixes #52739. cc #52742.

r? @nikomatsakis

5 years agoDisable some nice region errors in NLL mode.
David Wood [Mon, 6 Aug 2018 16:33:05 +0000 (18:33 +0200)]
Disable some nice region errors in NLL mode.

5 years agoAuto merge of #52644 - varkor:lib-feature-gate-2, r=withoutboats
bors [Mon, 6 Aug 2018 16:58:27 +0000 (16:58 +0000)]
Auto merge of #52644 - varkor:lib-feature-gate-2, r=withoutboats

Add errors for unknown, stable and duplicate feature attributes

- Adds an error for unknown (lang and lib) features.
- Extends the lint for unnecessary feature attributes for stable features to libs features (this already exists for lang features).
- Adds an error for duplicate (lang and lib) features.

```rust
#![feature(fake_feature)] //~ ERROR unknown feature `fake_feature`

#![feature(i128_type)] //~ WARNING the feature `i128_type` has been stable since 1.26.0

#![feature(non_exhaustive)]
#![feature(non_exhaustive)] //~ ERROR duplicate `non_exhaustive` feature attribute
```

Fixes #52053, fixes #53032 and address some of the problems noted in #44232 (though not unused features).

There are a few outstanding problems, that I haven't narrowed down yet:
- [x] Stability attributes on macros do not seem to be taken into account.
- [x] Stability attributes behind `cfg` attributes are not taken into account.
- [x] There are failing incremental tests.

5 years agoSpecial-case "test" feature
varkor [Mon, 6 Aug 2018 15:46:08 +0000 (16:46 +0100)]
Special-case "test" feature

5 years agoAuto merge of #52990 - Aaron1011:fix/rustdoc-auto-trait-static, r=eddyb
bors [Mon, 6 Aug 2018 14:07:22 +0000 (14:07 +0000)]
Auto merge of #52990 - Aaron1011:fix/rustdoc-auto-trait-static, r=eddyb

Fix ICE when rustdoc encounters certain usages of HRTBs

Fixes #51236

Under certain circumstances, `AutoTraitFinder` could end up computing a `ParamEnv` involving two trait predicates that differed only in the region parameters involved. One of these parameters would be a HRTB, while the other would be a normal region parameter.

When this `ParamEnv` was later passed to `SelectionContext`, an `Ambiguity` error would occur, since the erased versions of these predicates would be identical. To solve the issue, we de-duplicate our list of predicates as we build it up. Whenever we encounter two predicates that differ only in their assignment of region parameters (a HRTB vs a normal lifetime parameter), we pick the HRTB. This corresponds to selecting a 'stricter' bound to display in the generated documentation: we're requiring that a particular type works for all possible lifetime parameters if it's going to implement a particular auto trait.

5 years agoAuto merge of #53045 - pnkfelix:issue-53026-migrate-never-looser-than-ast-borrowck...
bors [Mon, 6 Aug 2018 12:00:12 +0000 (12:00 +0000)]
Auto merge of #53045 - pnkfelix:issue-53026-migrate-never-looser-than-ast-borrowck, r=estebank

Fix NLL migration mode so that reports region errors when necessary.

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 (!).

Thus causing #53026

(I hope it is the only instance of such a scenario, but we will see.)

Anyway, this PR fixes that by only doing the "clever" skipping of region error reporting when we are not in migration mode. As noted in the FIXME, I'm not really thrilled with this band-aid, but it is small enough to be back-ported easily if that is necessary.

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: AST-borrowck, NLL, and NLL migration mode.

(To 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.)

Fix #53026

5 years agoAuto merge of #52332 - zackmdavis:dead_code_lint_should_say_2_electric_boogaloo,...
bors [Mon, 6 Aug 2018 07:02:11 +0000 (07:02 +0000)]
Auto merge of #52332 - zackmdavis:dead_code_lint_should_say_2_electric_boogaloo, r=pnkfelix

dead-code lint: say "constructed" for structs

Respectively.

This is a sequel to November 2017's #46103 / 1a9dc2e9. It had been
reported (more than once—at least #19140, #44083, and #44565) that the
"never used" language was confusing for enum variants that were "used"
as match patterns, so the wording was changed to say never "constructed"
specifically for enum variants. More recently, the same issue was raised
for structs (#52325). It seems consistent to say "constructed" here,
too, for the same reasons.

~~While we're here, we can also use more specific word "called" for unused
functions and methods. (We declined to do this in #46103, but the
rationale given in the commit message doesn't actually make sense.)~~

This resolves #52325.

5 years agoAuto merge of #53002 - QuietMisdreavus:brother-may-i-have-some-loops, r=pnkfelix
bors [Mon, 6 Aug 2018 01:53:58 +0000 (01:53 +0000)]
Auto merge of #53002 - QuietMisdreavus:brother-may-i-have-some-loops, r=pnkfelix

make `everybody_loops` preserve item declarations

First half of https://github.com/rust-lang/rust/issues/52545.

`everybody_loops` is used by rustdoc to ensure we don't contain erroneous references to platform APIs if one of its uses is pulled in by `#[doc(cfg)]`. However, you can also implement traits for public types inside of functions. This is used by Diesel (probably others, but they were the example that was reported) to get around a recent macro hygiene fix, which has caused their crate to fail to document. While this won't make the traits show up in documentation (that step comes later), it will at least allow files to be generated.

5 years agoAuto merge of #52997 - llogiq:tiny-list-opt, r=varkor
bors [Sun, 5 Aug 2018 22:41:07 +0000 (22:41 +0000)]
Auto merge of #52997 - llogiq:tiny-list-opt, r=varkor

data_structures: make TinyList more readable and optimize remove(_)

also add benchmarks

Before:

```
test tiny_list::test::bench_insert_empty             ... bench:           1 ns/iter (+/- 0)
test tiny_list::test::bench_insert_one               ... bench:          16 ns/iter (+/- 0)
test tiny_list::test::bench_remove_empty             ... bench:           2 ns/iter (+/- 0)
test tiny_list::test::bench_remove_one               ... bench:           6 ns/iter (+/- 0)
test tiny_list::test::bench_remove_unknown           ... bench:           4 ns/iter (+/- 0)
```

After:

```
test tiny_list::test::bench_insert_empty             ... bench:           1 ns/iter (+/- 0)
test tiny_list::test::bench_insert_one               ... bench:          16 ns/iter (+/- 0)
test tiny_list::test::bench_remove_empty             ... bench:           0 ns/iter (+/- 0)
test tiny_list::test::bench_remove_one               ... bench:           3 ns/iter (+/- 0)
test tiny_list::test::bench_remove_unknown           ... bench:           2 ns/iter (+/- 0)
```

5 years agoFix WASM tests
varkor [Sun, 5 Aug 2018 21:48:49 +0000 (22:48 +0100)]
Fix WASM tests

5 years agoFix diagnostic_list error
varkor [Sun, 5 Aug 2018 16:43:30 +0000 (17:43 +0100)]
Fix diagnostic_list error

5 years agoAuto merge of #52800 - QuietMisdreavus:do-not-pass-go, r=GuillaumeGomez
bors [Sun, 5 Aug 2018 18:45:01 +0000 (18:45 +0000)]
Auto merge of #52800 - QuietMisdreavus:do-not-pass-go, r=GuillaumeGomez

rustdoc: refactor how passes are structured, and turn intra-doc-link collection into a pass

This builds on https://github.com/rust-lang/rust/pull/52751 and should not be merged until that finally finishes the bors queue

Part 2 of my passes refactor. This introduces the concept of an "early pass", which is run right before exiting the compiler context. This is important for passes that may want to ask the compiler about things. For example, i took out the intra-doc-link collection and turned it into a early pass. I also made the `strip-hidden`, `strip-private` and `strip-priv-imports` passes occur as early passes, so that intra-doc-link collection wouldn't run on docs that weren't getting printed.

Fixes https://github.com/rust-lang/rust/issues/51684, technically https://github.com/rust-lang/rust/issues/51468 too but that version of `h2` hits a legit intra-link error after that `>_>`

r? @rust-lang/rustdoc

5 years agoFix failure on msvc
varkor [Sun, 5 Aug 2018 14:55:18 +0000 (15:55 +0100)]
Fix failure on msvc

5 years agoChange feature edition error into a warning
varkor [Fri, 3 Aug 2018 20:12:57 +0000 (21:12 +0100)]
Change feature edition error into a warning

5 years agoFix 2018 edition tests
varkor [Thu, 2 Aug 2018 18:33:24 +0000 (19:33 +0100)]
Fix 2018 edition tests

5 years agoRemove references to unknown feature `io`
varkor [Thu, 2 Aug 2018 16:36:08 +0000 (17:36 +0100)]
Remove references to unknown feature `io`

5 years agoAdd an error when declaring features that are stable in the current Rust edition
varkor [Thu, 2 Aug 2018 16:31:54 +0000 (17:31 +0100)]
Add an error when declaring features that are stable in the current Rust edition

5 years agoRemove bad features after rebase
varkor [Thu, 2 Aug 2018 14:53:18 +0000 (15:53 +0100)]
Remove bad features after rebase

5 years agoImprove query efficiency
varkor [Thu, 26 Jul 2018 23:06:57 +0000 (00:06 +0100)]
Improve query efficiency

5 years agoFix outdated handling of GetLangItems
varkor [Thu, 26 Jul 2018 22:44:36 +0000 (23:44 +0100)]
Fix outdated handling of GetLangItems

5 years agoFix stage 2 tests
varkor [Wed, 25 Jul 2018 13:27:27 +0000 (14:27 +0100)]
Fix stage 2 tests

5 years agoFix rustdoc test
varkor [Tue, 24 Jul 2018 22:32:20 +0000 (23:32 +0100)]
Fix rustdoc test

5 years agoFix run-pass-fulldeps tests
varkor [Tue, 24 Jul 2018 17:24:12 +0000 (18:24 +0100)]
Fix run-pass-fulldeps tests

5 years agoFix incremental tests
varkor [Tue, 24 Jul 2018 12:37:41 +0000 (13:37 +0100)]
Fix incremental tests

5 years agoAdd special support for libc
varkor [Mon, 23 Jul 2018 23:56:00 +0000 (00:56 +0100)]
Add special support for libc

5 years agoAdd support for feature attributes on macros
varkor [Mon, 23 Jul 2018 21:37:57 +0000 (22:37 +0100)]
Add support for feature attributes on macros

5 years agoConvert unknown_features lint into an error
varkor [Mon, 23 Jul 2018 20:05:39 +0000 (21:05 +0100)]
Convert unknown_features lint into an error

5 years agoTurn the duplicate feature lint into an error
varkor [Mon, 23 Jul 2018 16:34:04 +0000 (17:34 +0100)]
Turn the duplicate feature lint into an error

5 years agoRemove unnecessary feature attributes that sneaked in
varkor [Mon, 23 Jul 2018 13:53:39 +0000 (14:53 +0100)]
Remove unnecessary feature attributes that sneaked in

5 years agoRemove obsolete tests in tidy
varkor [Mon, 23 Jul 2018 13:12:35 +0000 (14:12 +0100)]
Remove obsolete tests in tidy

These have been replaced by more reliable checks in the compiler itself.

5 years agoRemove panic-runtime opt-out
varkor [Mon, 23 Jul 2018 12:50:35 +0000 (13:50 +0100)]
Remove panic-runtime opt-out

5 years agoAdd a test for feature attribute consistency
varkor [Mon, 23 Jul 2018 12:49:51 +0000 (13:49 +0100)]
Add a test for feature attribute consistency

Note that this doesn't test consistency of some properties, like `reason`.

5 years agoAdd test for duplicate features
varkor [Mon, 23 Jul 2018 12:08:18 +0000 (13:08 +0100)]
Add test for duplicate features

5 years agoAdd a test for unknown features
varkor [Mon, 23 Jul 2018 12:06:32 +0000 (13:06 +0100)]
Add a test for unknown features

5 years agoFix test/ui
varkor [Mon, 23 Jul 2018 11:23:40 +0000 (12:23 +0100)]
Fix test/ui

5 years agoFix test/compile-fail
varkor [Mon, 23 Jul 2018 11:22:23 +0000 (12:22 +0100)]
Fix test/compile-fail

5 years agoFix test/run-pass
varkor [Mon, 23 Jul 2018 02:14:42 +0000 (03:14 +0100)]
Fix test/run-pass

5 years agoFix test/run-fail
varkor [Mon, 23 Jul 2018 02:14:22 +0000 (03:14 +0100)]
Fix test/run-fail

5 years agoFix test/debuginfo
varkor [Mon, 23 Jul 2018 02:14:09 +0000 (03:14 +0100)]
Fix test/debuginfo

5 years agoGet around tidy bug
varkor [Mon, 23 Jul 2018 01:20:50 +0000 (02:20 +0100)]
Get around tidy bug

5 years agoAdd duplicity lint for lang features
varkor [Mon, 23 Jul 2018 01:03:01 +0000 (02:03 +0100)]
Add duplicity lint for lang features

5 years agoAdd a lint for duplicate feature attributes
varkor [Mon, 23 Jul 2018 00:22:01 +0000 (01:22 +0100)]
Add a lint for duplicate feature attributes

5 years agoTrigger stable feature lint for lib features
varkor [Mon, 23 Jul 2018 00:21:35 +0000 (01:21 +0100)]
Trigger stable feature lint for lib features

5 years agoAdd error for inconsistent stability `since` value
varkor [Mon, 23 Jul 2018 00:21:03 +0000 (01:21 +0100)]
Add error for inconsistent stability `since` value

5 years agoAdd lint for unknown feature attributes
varkor [Mon, 23 Jul 2018 00:20:33 +0000 (01:20 +0100)]
Add lint for unknown feature attributes

5 years agoCorrect invalid feature attributes
varkor [Mon, 23 Jul 2018 00:16:28 +0000 (01:16 +0100)]
Correct invalid feature attributes

5 years agoRemove unnecessary or invalid feature attributes
varkor [Mon, 23 Jul 2018 00:14:41 +0000 (01:14 +0100)]
Remove unnecessary or invalid feature attributes

5 years agoAuto merge of #52983 - alexcrichton:update-llvm, r=kennytm
bors [Sun, 5 Aug 2018 14:51:16 +0000 (14:51 +0000)]
Auto merge of #52983 - alexcrichton:update-llvm, r=kennytm

Update LLVM submodule to 7.0

This commit updates the following submodules to LLVM's [recently branched][1]
7.0 release branch:

* src/llvm
* src/tools/lld
* src/libcompiler_builtins/compiler-rt

[1]: https://lists.llvm.org/pipermail/llvm-dev/2018-August/125004.html

Closes #52970

5 years agoAuto merge of #52959 - matthewjasper:closure-spans, r=pnkfelix
bors [Sun, 5 Aug 2018 09:17:24 +0000 (09:17 +0000)]
Auto merge of #52959 - matthewjasper:closure-spans, r=pnkfelix

[NLL] Use smaller spans for errors involving closure captures

Closes #51170
Closes #46599

Error messages involving closures now point to the captured variable/closure args.

r? @pnkfelix

5 years agoAuto merge of #52991 - nikomatsakis:nll-escaping-into-return, r=pnkfelix
bors [Sun, 5 Aug 2018 07:06:11 +0000 (07:06 +0000)]
Auto merge of #52991 - nikomatsakis:nll-escaping-into-return, r=pnkfelix

avoid computing liveness for locals that escape into statics

Fixes #52713

I poked at this on the plane and I think it's working -- but I want to do a bit more investigation and double check. The idea is to identify those local variables where the entire value will "escape" into the return -- for them, we don't need to compute liveness, since we know that the outlives relations from the return type will force those regions to be equal to free regions. This should help with html5ever in particular.

- [x] test performance
- [x] verify correctness
- [x] add comments

r? @pnkfelix
cc @lqd

5 years agoremove unused tcx argument
Niko Matsakis [Sun, 5 Aug 2018 05:42:18 +0000 (07:42 +0200)]
remove unused tcx argument

5 years agofix exit-code test so the lint fires again
QuietMisdreavus [Fri, 3 Aug 2018 23:17:45 +0000 (18:17 -0500)]
fix exit-code test so the lint fires again

5 years agoonly abort after all early passes have run
QuietMisdreavus [Sat, 28 Jul 2018 05:06:51 +0000 (00:06 -0500)]
only abort after all early passes have run

5 years agodon't process intra-links on extern-crate items
QuietMisdreavus [Sat, 28 Jul 2018 04:46:27 +0000 (23:46 -0500)]
don't process intra-links on extern-crate items

5 years agoadd tests for new intra-doc-link behavior
QuietMisdreavus [Sat, 28 Jul 2018 04:18:17 +0000 (23:18 -0500)]
add tests for new intra-doc-link behavior

5 years agoturn intra-doc-link collection into an early pass
QuietMisdreavus [Sat, 28 Jul 2018 02:19:36 +0000 (21:19 -0500)]
turn intra-doc-link collection into an early pass

5 years agoAuto merge of #53078 - alexcrichton:update-cargo, r=Mark-Simulacrum
bors [Sun, 5 Aug 2018 03:20:13 +0000 (03:20 +0000)]
Auto merge of #53078 - alexcrichton:update-cargo, r=Mark-Simulacrum

Update cargo to fix Rust 2018 build scripts

5 years agoUpdate cargo to fix Rust 2018 build scripts
Alex Crichton [Sun, 5 Aug 2018 00:40:46 +0000 (17:40 -0700)]
Update cargo to fix Rust 2018 build scripts

5 years agoUpdate LLVM submodule to 7.0
Alex Crichton [Thu, 2 Aug 2018 14:09:13 +0000 (07:09 -0700)]
Update LLVM submodule to 7.0

This commit updates the following submodules to LLVM's [recently branched][1]
7.0 release branch:

* src/llvm
* src/tools/lld
* src/libcompiler_builtins/compiler-rt

[1]: https://lists.llvm.org/pipermail/llvm-dev/2018-August/125004.html

Closes #52970

5 years agointroduce "early passes" an convert a few over
QuietMisdreavus [Fri, 27 Jul 2018 15:22:16 +0000 (10:22 -0500)]
introduce "early passes" an convert a few over

5 years agostrongly-typed passes
QuietMisdreavus [Fri, 27 Jul 2018 14:11:19 +0000 (09:11 -0500)]
strongly-typed passes

5 years agoAuto merge of #53057 - nrc:update, r=kennytm
bors [Sat, 4 Aug 2018 23:21:01 +0000 (23:21 +0000)]
Auto merge of #53057 - nrc:update, r=kennytm

Update rustfmt, RLS, Clippy

r? @kennytm

Fixes RLS build and updates RLS and Rustfmt to their 1.0 RCs

5 years agoUpdate rustfmt and RLS
Nick Cameron [Sat, 4 Aug 2018 07:29:15 +0000 (19:29 +1200)]
Update rustfmt and RLS

5 years agoAuto merge of #52827 - GuillaumeGomez:generic-impls, r=QuietMisdreavus
bors [Sat, 4 Aug 2018 21:20:26 +0000 (21:20 +0000)]
Auto merge of #52827 - GuillaumeGomez:generic-impls, r=QuietMisdreavus

rustdoc: clean up generic impls

r? @QuietMisdreavus

5 years agoAuto merge of #52758 - Mark-Simulacrum:session-cleanup, r=pnkfelix
bors [Sat, 4 Aug 2018 18:22:39 +0000 (18:22 +0000)]
Auto merge of #52758 - Mark-Simulacrum:session-cleanup, r=pnkfelix

Cleanup for librustc::session

Some rather straightforward cleanup. Each commit mostly stands alone.

5 years agoAuto merge of #53056 - kennytm:rollup, r=kennytm
bors [Sat, 4 Aug 2018 16:12:39 +0000 (16:12 +0000)]
Auto merge of #53056 - kennytm:rollup, r=kennytm

Rollup of 14 pull requests

Successful merges:

 - #51919 (Provide `{to,from}_{ne,le,be}_bytes` functions on integers)
 - #52940 (Align 6-week cycle check with beta promotion instead of stable release.)
 - #52968 (App-lint-cability)
 - #52969 (rustbuild: fix local_rebuild)
 - #52995 (Remove unnecessary local in await! generator)
 - #52996 (RELEASES.md: fix the `hash_map::Entry::or_default` link)
 - #53001 (privacy: Fix an ICE in `path_is_private_type`)
 - #53003 (Stabilize --color and --error-format options in rustdoc)
 - #53022 (volatile operations docs: clarify that this does not help wrt. concurrency)
 - #53024 (Specify reentrancy gurantees of `Once::call_once`)
 - #53041 (Fix invalid code css rule)
 - #53047 (Make entire row of doc search results clickable)
 - #53050 (Make left column of rustdoc search results narrower)
 - #53062 (Remove redundant field names in structs)

5 years agoRollup merge of #53062 - ljedrz:redundant_field_names, r=Mark-Simulacrum
kennytm [Sat, 4 Aug 2018 15:09:12 +0000 (23:09 +0800)]
Rollup merge of #53062 - ljedrz:redundant_field_names, r=Mark-Simulacrum

Remove redundant field names in structs

5 years agoRemove redundant field names in structs
ljedrz [Sat, 4 Aug 2018 12:58:20 +0000 (14:58 +0200)]
Remove redundant field names in structs

5 years agoUse diagnostic API on Session
Mark Rousskov [Thu, 26 Jul 2018 22:18:06 +0000 (16:18 -0600)]
Use diagnostic API on Session

5 years agoMove share_generics getter onto options directly
Mark Rousskov [Thu, 26 Jul 2018 19:20:47 +0000 (13:20 -0600)]
Move share_generics getter onto options directly

5 years agoMove basic_options to impl of Default
Mark Rousskov [Thu, 26 Jul 2018 18:36:11 +0000 (12:36 -0600)]
Move basic_options to impl of Default

5 years agoSimplify some handling of target_pointer_width
Mark Rousskov [Thu, 26 Jul 2018 18:22:10 +0000 (12:22 -0600)]
Simplify some handling of target_pointer_width

5 years agoNormalize DebugInfoLevel to standard style
Mark Rousskov [Thu, 26 Jul 2018 17:41:10 +0000 (11:41 -0600)]
Normalize DebugInfoLevel to standard style

5 years agoNormalize EntryFnType variants to standard style
Mark Rousskov [Thu, 26 Jul 2018 17:29:45 +0000 (11:29 -0600)]
Normalize EntryFnType variants to standard style

5 years agoNormalize variants of Passes to standard style
Mark Rousskov [Thu, 26 Jul 2018 17:22:14 +0000 (11:22 -0600)]
Normalize variants of Passes to standard style

5 years agoNormalize variants of CrateType to standard style
Mark Rousskov [Thu, 26 Jul 2018 17:13:11 +0000 (11:13 -0600)]
Normalize variants of CrateType to standard style

This is a clippy-breaking change.

5 years agoPrivatize some exports from code_stats
Mark Rousskov [Thu, 26 Jul 2018 16:52:38 +0000 (10:52 -0600)]
Privatize some exports from code_stats

5 years agoUpdate to master
Guillaume Gomez [Sat, 4 Aug 2018 09:40:56 +0000 (11:40 +0200)]
Update to master

5 years agoRollup merge of #53050 - carols10cents:rustdoc-moar-room, r=GuillaumeGomez
kennytm [Sat, 4 Aug 2018 09:20:10 +0000 (17:20 +0800)]
Rollup merge of #53050 - carols10cents:rustdoc-moar-room, r=GuillaumeGomez

Make left column of rustdoc search results narrower

To make more room for the description of the item

The description often has useful text that helps disambiguate between search results, but very little of it is shown.

As a side effect, this breaks the alignment between the search results and the "In Return Types" tab, which tends to line up above the description-- up until I started investigating this, I thought "In Names"/"In Parameters"/"In Return Types" were column headers and I just never saw search results that had info for the "In Parameters" middle column! Now, with the two columns of search results each taking up about a half, they look more like tabs than column headers.

Types that are long still wrap and look good-- I made some artificially long types in the following screenshots.

Before screenshot:

<img width="1258" alt="screen shot 2018-08-03 at 8 32 35 pm" src="https://user-images.githubusercontent.com/193874/43670805-56e3b3b4-975e-11e8-9296-600837d03de2.png">

After screenshot:

<img width="1239" alt="screen shot 2018-08-03 at 8 31 17 pm" src="https://user-images.githubusercontent.com/193874/43670810-6591f9ac-975e-11e8-9e12-4ea9ab1e5806.png">

5 years agoRollup merge of #51919 - tbu-:pr_num_to_from_bytes2, r=SimonSapin
kennytm [Sat, 4 Aug 2018 09:19:38 +0000 (17:19 +0800)]
Rollup merge of #51919 - tbu-:pr_num_to_from_bytes2, r=SimonSapin

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.

5 years agoRemove FinderTrait and move its functions into DocContext
Guillaume Gomez [Fri, 3 Aug 2018 20:13:05 +0000 (22:13 +0200)]
Remove FinderTrait and move its functions into DocContext

5 years agoImprove functions naming
Guillaume Gomez [Tue, 31 Jul 2018 20:40:55 +0000 (22:40 +0200)]
Improve functions naming

5 years agoFix dyn objects
Guillaume Gomez [Sun, 29 Jul 2018 17:32:07 +0000 (19:32 +0200)]
Fix dyn objects

5 years agoStrengthen tests
Guillaume Gomez [Sun, 29 Jul 2018 14:47:31 +0000 (16:47 +0200)]
Strengthen tests

5 years agoFix primitive blanket impls not showing up
Guillaume Gomez [Sun, 29 Jul 2018 14:30:39 +0000 (16:30 +0200)]
Fix primitive blanket impls not showing up

5 years agoClean generic impls code
Guillaume Gomez [Sun, 29 Jul 2018 13:39:51 +0000 (15:39 +0200)]
Clean generic impls code

5 years agomore comments and justify correctness
Niko Matsakis [Sat, 4 Aug 2018 07:30:24 +0000 (09:30 +0200)]
more comments and justify correctness

5 years agogeneralize the Deref case and simplify the code
Niko Matsakis [Sat, 4 Aug 2018 07:26:30 +0000 (09:26 +0200)]
generalize the Deref case and simplify the code

5 years agoadd a comment explaining the idea
Niko Matsakis [Sat, 4 Aug 2018 07:26:20 +0000 (09:26 +0200)]
add a comment explaining the idea

5 years agoChange tracking issue from #49792 to #51919
Tobias Bucher [Sat, 4 Aug 2018 06:36:54 +0000 (08:36 +0200)]
Change tracking issue from #49792 to #51919

The old issue has already been in FCP, a new issue was opened for the
new API.

5 years agoRollup merge of #53047 - integer32llc:rustdoc-clicky-clicky, r=QuietMisdreavus
kennytm [Sat, 4 Aug 2018 06:36:02 +0000 (14:36 +0800)]
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)

5 years agoRollup merge of #53041 - GuillaumeGomez:fix-code-css-rule, r=QuietMisdreavus
kennytm [Sat, 4 Aug 2018 06:36:00 +0000 (14:36 +0800)]
Rollup merge of #53041 - GuillaumeGomez:fix-code-css-rule, r=QuietMisdreavus

Fix invalid code css rule

Fixes #53017.

r? @QuietMisdreavus

5 years agoRollup merge of #53024 - matklad:patch-1, r=alexcrichton
kennytm [Sat, 4 Aug 2018 06:35:59 +0000 (14:35 +0800)]
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.

5 years agoRollup merge of #53022 - RalfJung:volatile, r=alexcrichton
kennytm [Sat, 4 Aug 2018 06:35:58 +0000 (14:35 +0800)]
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.

5 years agoRollup merge of #53003 - GuillaumeGomez:stabilize-rustdoc-options, r=QuietMisdreavus
kennytm [Sat, 4 Aug 2018 06:35:56 +0000 (14:35 +0800)]
Rollup merge of #53003 - GuillaumeGomez:stabilize-rustdoc-options, r=QuietMisdreavus

Stabilize --color and --error-format options in rustdoc

Fixes #52980

cc @kennytm

r? @QuietMisdreavus

5 years agoRollup merge of #53001 - petrochenkov:master, r=estebank
kennytm [Sat, 4 Aug 2018 06:35:55 +0000 (14:35 +0800)]
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.)

5 years agoRollup merge of #52996 - cuviper:1.28-or_default, r=Mark-Simulacrum
kennytm [Sat, 4 Aug 2018 06:35:54 +0000 (14:35 +0800)]
Rollup merge of #52996 - cuviper:1.28-or_default, r=Mark-Simulacrum

RELEASES.md: fix the `hash_map::Entry::or_default` link

None

5 years agoRollup merge of #52995 - cramertj:smaller-await, r=withoutboats
kennytm [Sat, 4 Aug 2018 06:35:53 +0000 (14:35 +0800)]
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)

5 years agoRollup merge of #52969 - Keruspe:local_rebuild, r=alexcrichton
kennytm [Sat, 4 Aug 2018 06:35:51 +0000 (14:35 +0800)]
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

5 years agoRollup merge of #52968 - zackmdavis:app-lint-cability, r=estebank
kennytm [Sat, 4 Aug 2018 06:35:50 +0000 (14:35 +0800)]
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