Commit Graph

66521 Commits

Author SHA1 Message Date
bors
adbce60d6f Auto merge of #43630 - Mark-Simulacrum:rustbuild-cleanups, r=alexcrichton
Rustbuild cleanups/fixes and improvements

Each commit is a standalone change, and can/should be reviewed separately.

This adds two new functionalities:

 - `--target` and `--host` can be passed without changing config.toml, and we'll respect the users' wishes, instead of requiring that all possible targets are passed.
   - Note that this means that `./x.py clean` won't be quite as wide-spread as before, since it limits itself to the configured hosts, not all hosts. This could be considered a feature as well.
 - `ignore-git` field in `config.toml` which tells Rustbuild to not attempt to load git hashes from `.git`.

This is a precursor to eventual further simplification of the configuration system, but I want to get this merged first so that later work can be made in individual PRs.

r? @alexcrichton
2017-08-13 05:24:49 +00:00
Mark Simulacrum
01641c7033 Build rustdoc with the native build triple 2017-08-13 08:58:49 +05:00
bors
0ed03e5490 Auto merge of #43348 - kennytm:fix-24658-doc-every-platform, r=alexcrichton
Expose all OS-specific modules in libstd doc.

1. Uses the special `--cfg dox` configuration passed by rustbuild when running `rustdoc`. Changes the `#[cfg(platform)]` into `#[cfg(any(dox, platform))]` so that platform-specific API are visible to rustdoc.

2. Since platform-specific implementations often won't compile correctly on other platforms, `rustdoc` is changed to apply `everybody_loops` to the functions during documentation and doc-test harness.

3. Since platform-specific code are documented on all platforms now, it could confuse users who found a useful API but is non-portable. Also, their examples will be doc-tested, so must be excluded when not testing on the native platform. An undocumented attribute `#[doc(cfg(...))]` is introduced to serve the above purposed.

Fixes #24658 (Does _not_ fully implement #1998).
2017-08-13 03:00:20 +00:00
Mark Simulacrum
82cdf1006e Cargotest needs only one rustdoc.exe to exist on Windows 2017-08-13 05:15:44 +05:00
Mark Simulacrum
657196830f Correct code to not run host-only tests. 2017-08-13 05:15:43 +05:00
Mark Simulacrum
cec68167fd Clean tools after building libstd/libtest/librustc.
This fixes the bug we previously had where we'd build a libtest tool
after building a libstd tool and clear out the libstd tool. Since we
clear out all tools for a given stage on invocations of CleanTools after
lib{std, test, rustc} change, we need to make sure that all tools built
with that stage will be built after the clearing is done.

The fix contained here technically isn't perfect; there is still an edge
case of compiling a libstd tool, then compiling libtest, which will
clear out the libstd tool and it won't ever get rebuilt within that
session of rustbuild. This is where the caching system used today shows
it's problems -- in effect, all tools depend on a global counter of the
stage being cleared out. We can implement such a counter in a future
patch to ensure that tools are rebuilt as needed, but it is deemed
unlikely that it will be required in practice, since most if not all
tools are built after the relevant stage's std/test/rustc are built,
though this is only an opinion and hasn't been verified.
2017-08-13 05:15:43 +05:00
Mark Simulacrum
facf5a91c4 Build rustdoc only at the top stage 2017-08-13 05:15:43 +05:00
Mark Simulacrum
ad4acbaadf Build rustdoc with the stageN compiler in N >= 2.
This permits proc macro crates to correctly work with rustdoc.
2017-08-13 05:15:43 +05:00
Mark Simulacrum
83b68125e7 Make the message for building rustdoc slightly nicer 2017-08-13 05:15:43 +05:00
Mark Simulacrum
40dea65ec2 Add ability to ignore git when building rust.
Some users of the build system change the git sha on every build due to
utilizing git to push changes to a remote server. This allows them to
simply configure that away instead of depending on custom patches to
rustbuild.
2017-08-13 05:15:43 +05:00
Mark Simulacrum
5290c6c8f1 Allow overriding build triple via flag.
We first check the configuration, then passed parameters (--build), then
fall back to the auto-detection that bootstrap.py does.

Fixes #39673.
2017-08-13 05:15:43 +05:00
Mark Simulacrum
84d9a6ee8c Allow specifiying targets and hosts not in the config file.
We no longer care about the source of this information, so there is no
reason to restrict users.
2017-08-13 05:15:43 +05:00
Mark Simulacrum
44ffb61623 Unify flags into config.
This introduces a slight change in behavior, where we unilaterally
respect the --host and --target parameters passed for all sanity
checking and runtime configuration.
2017-08-13 05:15:43 +05:00
bors
14fb329e0a Auto merge of #43736 - ollie27:rustdoc_impls_js, r=QuietMisdreavus
rustdoc: Don't add external impls to implementors js

Otherwise impls from not documented crates appear.

Fixes #43701
2017-08-12 22:09:34 +00:00
bors
f774bced50 Auto merge of #43724 - lukaramu:std-ops-docs, r=QuietMisdreavus
Improve std::ops docs

Fixes #29365. (This fixes all but one point from @steveklabnik's list, but that point was referring to examples of implementing range traits, but there are no range traits in std::ops.)

The main changes are quite a bit of copyediting, adding more "real" examples for some of the traits, incorporating some guidance from the API docs, more linking (cross-docs and to the book & reference), cleaning up examples, moving things around, and so on. Refer to the commit messages for more details.

Note: I decided to link to the second edition of the book since I think it's more appropriate now for the sections I linked, if this is not okay, please say so!
2017-08-12 19:40:49 +00:00
lukaramu
6bdba82ba1 std::ops docs: incorporated changes suggested in review
* fixed link typos and copy-paster errors
* rewrote Fn* explanations
* `RHS = Self` -> `RHS` is `Self` (added that to all applicable places as
  well)
* fixed up some links
* s/MutDeref/DerefMut
* removed remaining superfluous `fn main()`s
* fixed some minor phrasings and factual errors and inaccuracies

std::ops docs: Fix phrasing and factual errors/inaccuracies
2017-08-12 19:53:04 +02:00
bors
0269acbb10 Auto merge of #43820 - sfackler:move-config-template, r=alexcrichton
Move config.toml.example to the root dir

It's way more discoverable here.

r? @alexcrichton
2017-08-12 16:48:31 +00:00
bors
045ca8b43b Auto merge of #43823 - tchajed:fix-pr-link, r=frewsxcv
Update GitHub pull request documentation link

It looks like the GitHub documentation has been re-organized so that the "fork and pull" model isn't explained alongside the PR process in one convenient link any more.
2017-08-12 14:24:40 +00:00
bors
4564933538 Auto merge of #43746 - eddyb:sound-thread-local, r=alexcrichton
Check #[thread_local] statics correctly in the compiler.

Fixes #43733 by introducing `#[allow_internal_unsafe]` analogous to `#[allow_internal_unstable]`, for letting a macro expand to `unsafe` blocks and functions even in `#![forbid(unsafe_code)]` crates.

Fixes #17954 by not letting references to `#[thread_local]` statics escape the function they're taken in - we can't just use a magical lifetime because Rust has *lifetime parametrism*, so if we added the often-proposed `'thread` lifetime, we'd have no way to check it in generic code.
To avoid potential edge cases in the compiler, the lifetime is actually that of a temporary at the same position, i.e. `&TLS_STATIC` has the same lifetime `&non_const_fn()` would.

Referring to `#[thread_local]` `static`s at compile-time is banned now (as per PR discussion).

Additionally, to remove `unsafe impl Sync` from `std:🧵:local::fast::Key`, `#[thread_local]` statics are now not required to implement `Sync`, as they are not shared between threads.
2017-08-12 11:57:10 +00:00
Tej Chajed
a746129bdb
Update GitHub pull request documentation link 2017-08-12 12:34:49 +01:00
Eduard-Mihai Burtescu
92892d3beb Check #[thread_local] statics correctly in the compiler. 2017-08-12 12:58:07 +03:00
bors
59f6b8338e Auto merge of #43812 - steveklabnik:rustdoc-doc-tests, r=QuietMisdreavus
rustdoc doc tests

This is mostly adapted from the book v1's chapter.

cc https://github.com/rust-lang/rust/issues/42322

r? @rust-lang/docs
2017-08-12 09:34:13 +00:00
Eduard-Mihai Burtescu
8a4facc3c3 syntax: #[allow_internal_unsafe] bypasses the unsafe_code lint in macros. 2017-08-12 09:14:50 +03:00
bors
bffc973da8 Auto merge of #43794 - Eijebong:fix_typos, r=lukaramu,steveklanik,imperio
Fix some typos

I wrote a really naive script and found those typos in the documentation.
2017-08-12 05:52:19 +00:00
Steven Fackler
1126a85e87 Move config.toml.example to the root dir
It's way more discoverable here.
2017-08-11 22:24:25 -07:00
kennytm
3093bb85f9
Fix error during cross-platform documentation. 2017-08-12 12:07:39 +08:00
bors
2fa5340318 Auto merge of #43792 - steveklabnik:rustdoc-directives, r=frewsxcv
Document the doc attribute

cc #42322
2017-08-12 03:22:09 +00:00
bors
b8266a90b9 Auto merge of #43772 - arielb1:nonfree-block, r=nagisa
For box expressions, use NZ drop instead of a free block

This falls naturally out of making drop elaboration work with `box`
expressions, which is probably required for sane MIR borrow-checking.
This is a pure refactoring with no intentional functional effects.

r? @nagisa
2017-08-12 00:54:38 +00:00
bors
8da3ff3fcc Auto merge of #43766 - michaelwoerister:trans-scheduler-touch-up, r=alexcrichton
Improve LLVM/trans scheduling a bit

Currently it's possible that the main thread is waiting on LLVM threads to finish work while its implicit token is going to waste. This PR let's the main thread take over, so one of the running LLVM threads can free its token earlier.

r? @alexcrichton
2017-08-11 22:23:10 +00:00
steveklabnik
035d4ea2ca rustdoc doc tests 2017-08-11 16:43:38 -04:00
steveklabnik
1e4aaea431 address review feedback 2017-08-11 16:24:18 -04:00
bors
a7e0d3a81f Auto merge of #43750 - tbu-:pr_fn_unreachable, r=sfackler
Put `intrinsics::unreachable` on a possible path to stabilization

Mark it with the `unreachable` feature and put it into the `mem` module.
This is a pretty straight-forward API that can already be simulated in
stable Rust by using `transmute` to create an uninhabited enum that can
be matched.
2017-08-11 19:43:44 +00:00
bors
edd82ee9f0 Auto merge of #42932 - bjorn3:no_llvm_try2, r=eddyb
Support compiling rustc without LLVM (try 2)

Now doesn't change rustc_driver.

Supersedes #42752
2017-08-11 15:45:10 +00:00
bors
38bdbb7cf9 Auto merge of #43748 - RalfJung:mir-validate2, r=arielb1
AddValidation: handle Call terminators into blocks that have multiple incoming edges

The old code was just wrong: It would add validation on paths that don't even come from the call, and it would add multiple validations if multiple calls end return to the same block.
2017-08-11 13:04:59 +00:00
bjorn3
e5399961c6
Remove some unused dependencies from rustc_trans_utils 2017-08-11 14:00:09 +02:00
bjorn3
b8d5c74c99
It now completely compiles without LLVM!!! 2017-08-11 14:00:07 +02:00
bjorn3
b7314c7caf
Actually make rustc_driver compile without llvm 2017-08-11 14:00:05 +02:00
bors
59675d29eb Auto merge of #43800 - GuillaumeGomez:rollup, r=GuillaumeGomez
Rollup of 18 pull requests

- Successful merges: #43176, #43632, #43650, #43712, #43715, #43721, #43739, #43741, #43744, #43747, #43752, #43760, #43773, #43779, #43783, #43791, #43793, #43795
- Failed merges:
2017-08-11 09:37:52 +00:00
bjorn3
b43c02b0aa
Make librustc_driver work without librustc_trans 2017-08-11 10:38:31 +02:00
bjorn3
e152a1620b
Build support for no llvm 2017-08-11 10:38:29 +02:00
Guillaume Gomez
742bba0ebf Rollup merge of #43795 - GuillaumeGomez:improve-variants-doc-style, r=QuietMisdreavus
Improve enum variants display

r? @rust-lang/docs

Before:

<img width="1440" alt="screen shot 2017-08-11 at 00 22 54" src="https://user-images.githubusercontent.com/3050060/29194776-728ce0e2-7e2b-11e7-8299-8300cc0c168b.png">

After:

<img width="1440" alt="screen shot 2017-08-11 at 00 22 57" src="https://user-images.githubusercontent.com/3050060/29194783-78867558-7e2b-11e7-9226-1327fd20163a.png">

(The doc of the variant is more aligned with the "[-]" now).
2017-08-11 10:20:33 +02:00
Guillaume Gomez
77904aad52 Rollup merge of #43793 - j-browne:master, r=steveklabnik
Fix broken links in Arc documentation

Some link references had ticks, when they should not have had them.
2017-08-11 10:20:32 +02:00
Guillaume Gomez
4f5f3faa7d Rollup merge of #43791 - GuillaumeGomez:file-docs, r=QuietMisdreavus
File docs

r? @rust-lang/docs
2017-08-11 10:20:31 +02:00
Guillaume Gomez
3e6e26246e Rollup merge of #43783 - prisme60:prisme60-typo, r=Mark-Simulacrum
Fix typo corersponding -> corresponding

I was reading the documentation of __Struct std::os::unix::net::UnixListener__ when I saw a typo inside.
2017-08-11 10:20:30 +02:00
Guillaume Gomez
6af7b9d4b0 Rollup merge of #43779 - mattico:fix-unicode-typo, r=aidanhs
Fix typo in unicode char definition

Reference: http://www.fileformat.info/info/unicode/char/16ed/index.htm
2017-08-11 10:20:29 +02:00
Guillaume Gomez
7fa572e6a5 Rollup merge of #43773 - ubsan:patch-1, r=eddyb
fix a typo

(this should not have been merged with this typo)
2017-08-11 10:20:28 +02:00
Guillaume Gomez
6fac8dc141 Rollup merge of #43760 - ollie27:rustdoc_search_css, r=GuillaumeGomez
rustdoc: Fix broken CSS in search results

The layout is currently broken for struct/union fields and enum variants
in the search results when searching from a struct, union or enum page.

Some examples:
https://doc.rust-lang.org/nightly/std/ops/struct.RangeInclusive.html?search=start
https://doc.rust-lang.org/nightly/std/option/enum.Option.html?search=some

 #34477 was an incomplete fix
2017-08-11 10:20:27 +02:00
Guillaume Gomez
35947cfbc4 Rollup merge of #43752 - arshiamufti:union-test, r=estebank
Add IRC's `!union union` as a test, addresses #43553

This pull request adds a new test, `union` to `weird-exprs.rs`.
2017-08-11 10:20:26 +02:00
Guillaume Gomez
42b06817e6 Rollup merge of #43747 - GuillaumeGomez:fix-css, r=QuietMisdreavus
Improve headers linking

r? @QuietMisdreavus
2017-08-11 10:20:25 +02:00
Guillaume Gomez
2ad3baa2b3 Rollup merge of #43744 - MaloJaffre:stage1-test, r=Mark-Simulacrum
Ignore tests that fail on stage1

That makes `./x.py test --stage 1` work on `x86_64-unknown-linux-gnu`.
2017-08-11 10:20:24 +02:00