]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoRemove useless help part
Guillaume Gomez [Mon, 14 Aug 2017 19:56:55 +0000 (21:56 +0200)]
Remove useless help part

6 years agoAuto merge of #43856 - sfackler:no-inline-debug, r=alexcrichton
bors [Mon, 14 Aug 2017 07:50:36 +0000 (07:50 +0000)]
Auto merge of #43856 - sfackler:no-inline-debug, r=alexcrichton

Don't inline debug methods

The inner methods aren't inlined, so this puts more pressure on LLVM for
literally no benefit.

Closes #43843

6 years agoAuto merge of #43844 - arielb1:literally-nonstandard, r=eddyb
bors [Mon, 14 Aug 2017 05:05:06 +0000 (05:05 +0000)]
Auto merge of #43844 - arielb1:literally-nonstandard, r=eddyb

ast_validation: forbid "nonstandard" literal patterns

Since #42886, macros can create "nonstandard" PatKind::Lit patterns,
that contain path expressions instead of the usual literal expr. These
can cause trouble, including ICEs.

We *could* map these nonstandard patterns to PatKind::Path patterns
during HIR lowering, but that would be much effort for little gain, and
I think is too risky for beta. So let's just forbid them during AST
validation.

Fixes #43250.

beta-nominating because regression.
r? @eddyb

6 years agoAuto merge of #43842 - bjorn3:no_llvm_cleanup, r=alexcrichton
bors [Mon, 14 Aug 2017 02:11:18 +0000 (02:11 +0000)]
Auto merge of #43842 - bjorn3:no_llvm_cleanup, r=alexcrichton

Cleanup for "Support compiling rustc without LLVM (try 2)"

This includes a small patch to allow running tests without llvm. Also check if you are not trying to compile a dylib.

cc #42932
r? @alexcrichton

6 years agoDon't inline debug methods
Steven Fackler [Mon, 14 Aug 2017 00:06:17 +0000 (17:06 -0700)]
Don't inline debug methods

The inner methods aren't inlined, so this puts more pressure on LLVM for
literally no benefit.

Closes #43843

6 years agoAuto merge of #43836 - taleks:issue-39827, r=arielb1
bors [Sun, 13 Aug 2017 23:33:18 +0000 (23:33 +0000)]
Auto merge of #43836 - taleks:issue-39827, r=arielb1

Fix for issue #39827

*Cause of the issue*

While preparing for `trans_intrinsic_call()` invoke arguments are processed with `trans_argument()` method which excludes zero-sized types from argument list (to be more correct - all arguments for which `ArgKind` is `Ignore` are filtered out). As result `volatile_store()` intrinsic gets one argument instead of expected address and value.

*How it is fixed*

Modification of the `trans_argument()` method may cause side effects, therefore change was implemented in `volatile_store()` intrinsic building code itself. Now it checks function signature and if it was specialised with zero-sized type, then emits `C_nil()` instead of accessing non-existing second argument.

6 years agoAuto merge of #43815 - alexcrichton:optimize-alloc, r=sfackler
bors [Sun, 13 Aug 2017 19:28:57 +0000 (19:28 +0000)]
Auto merge of #43815 - alexcrichton:optimize-alloc, r=sfackler

Optimize allocation paths in RawVec

Since the `Alloc` trait was introduced (https://github.com/rust-lang/rust/pull/42313) and it was integrated everywhere (https://github.com/rust-lang/rust/pull/42727) there's been some slowdowns and regressions that have slipped through. The intention of this PR is to try to tackle at least some of them, but they've been very difficult to quantify up to this point so it probably doesn't solve everything.

This PR primarily targets the `RawVec` type, specifically the `double` function. The codegen for this function is now much closer to what it was before #42313 landed as many runtime checks have been elided.

6 years agoFix error
bjorn3 [Sun, 13 Aug 2017 16:51:07 +0000 (18:51 +0200)]
Fix error

6 years agoast_validation: forbid "nonstandard" literal patterns
Ariel Ben-Yehuda [Sun, 13 Aug 2017 13:59:54 +0000 (16:59 +0300)]
ast_validation: forbid "nonstandard" literal patterns

Since #42886, macros can create "nonstandard" PatKind::Lit patterns,
that contain path expressions instead of the usual literal expr. These
can cause trouble, including ICEs.

We *could* map these nonstandard patterns to PatKind::Path patterns
during HIR lowering, but that would be much effort for little gain, and
I think is too risky for beta. So let's just forbid them during AST
validation.

Fixes #43250.

6 years agoUpdate driver.rs
bjorn3 [Sun, 13 Aug 2017 14:50:17 +0000 (16:50 +0200)]
Update driver.rs

6 years agoChange run-make ignore message
bjorn3 [Sun, 13 Aug 2017 14:49:09 +0000 (16:49 +0200)]
Change run-make ignore message

6 years agoChange a #[cfg()] to a cfg!()
bjorn3 [Sun, 13 Aug 2017 14:47:47 +0000 (16:47 +0200)]
Change a #[cfg()] to a cfg!()

6 years agoFix tidy errors
bjorn3 [Sun, 13 Aug 2017 13:56:35 +0000 (15:56 +0200)]
Fix tidy errors

6 years agoRemove some more cfg's
bjorn3 [Sun, 13 Aug 2017 10:30:54 +0000 (12:30 +0200)]
Remove some more cfg's

6 years agoAuto merge of #43839 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Sun, 13 Aug 2017 10:22:45 +0000 (10:22 +0000)]
Auto merge of #43839 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 8 pull requests

- Successful merges: #43782, #43803, #43814, #43819, #43821, #43822, #43824, #43833
- Failed merges:

6 years agoAddresses comments in PR #43836
Alexey Tarasov [Sun, 13 Aug 2017 09:28:04 +0000 (19:28 +1000)]
Addresses comments in PR #43836

- removes warnings introduced in changeset 0cd3587
- makes documentation more neat and grammatically correct

6 years agoRollup merge of #43833 - dtolnay:connect-timeout, r=sfackler
Guillaume Gomez [Sun, 13 Aug 2017 09:03:15 +0000 (11:03 +0200)]
Rollup merge of #43833 - dtolnay:connect-timeout, r=sfackler

Fix TcpStream::connect_timeout tracking issue number

Before: https://github.com/rust-lang/rust/pull/43709
After: https://github.com/rust-lang/rust/issues/43079

r? @sfackler

6 years agoRollup merge of #43824 - kennytm:fix-43232-hir-stats, r=petrochenkov
Guillaume Gomez [Sun, 13 Aug 2017 09:03:14 +0000 (11:03 +0200)]
Rollup merge of #43824 - kennytm:fix-43232-hir-stats, r=petrochenkov

Fix `-Z hir-stats` always panics.

Fix #43232.

6 years agoRollup merge of #43822 - topecongiro:missing-span-let, r=petrochenkov
Guillaume Gomez [Sun, 13 Aug 2017 09:03:13 +0000 (11:03 +0200)]
Rollup merge of #43822 - topecongiro:missing-span-let, r=petrochenkov

Include 'let' keyword to the span for ast::Local

Currently the span for `ast::Local` does not the include the `let` keyword. This PR fixes it.

6 years agoRollup merge of #43821 - NilSet:redox-dns, r=alexcrichton
Guillaume Gomez [Sun, 13 Aug 2017 09:03:12 +0000 (11:03 +0200)]
Rollup merge of #43821 - NilSet:redox-dns, r=alexcrichton

Handle DNS label compression in more places in Redox name resolution

6 years agoRollup merge of #43819 - frewsxcv:frewsxcv-include, r=QuietMisdreavus
Guillaume Gomez [Sun, 13 Aug 2017 09:03:11 +0000 (11:03 +0200)]
Rollup merge of #43819 - frewsxcv:frewsxcv-include, r=QuietMisdreavus

Improve doc examples for `include*` macros.

6 years agoRollup merge of #43814 - Eijebong:fix_typos2, r=petrochenkov
Guillaume Gomez [Sun, 13 Aug 2017 09:03:11 +0000 (11:03 +0200)]
Rollup merge of #43814 - Eijebong:fix_typos2, r=petrochenkov

Fix some typos

Follow up of #43794

If refined my script a little bit and found some more.

6 years agoRollup merge of #43803 - GuillaumeGomez:missing-links-doc, r=frewsxcv
Guillaume Gomez [Sun, 13 Aug 2017 09:03:10 +0000 (11:03 +0200)]
Rollup merge of #43803 - GuillaumeGomez:missing-links-doc, r=frewsxcv

Missing links doc

r? @rust-lang/docs

6 years agoRollup merge of #43782 - nrc:include, r=GuillaumeGomez
Guillaume Gomez [Sun, 13 Aug 2017 09:03:09 +0000 (11:03 +0200)]
Rollup merge of #43782 - nrc:include, r=GuillaumeGomez

Fix include! in doc tests

By making the path relative to the current file.

Fixes #43153

[breaking-change] - if you use `include!` inside a doc test, you'll need to change the path to be relative to the current file rather than relative to the working directory.

6 years agoAuto merge of #43813 - pengowen123:unused_result, r=estebank
bors [Sun, 13 Aug 2017 07:50:36 +0000 (07:50 +0000)]
Auto merge of #43813 - pengowen123:unused_result, r=estebank

Fix unused_result lint triggering when a function returns `()`, `!` or an empty enum

Also added a test to prevent this from happening again.

Fixes #43806

6 years agoAuto merge of #43630 - Mark-Simulacrum:rustbuild-cleanups, r=alexcrichton
bors [Sun, 13 Aug 2017 05:24:49 +0000 (05:24 +0000)]
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

6 years agoBuild rustdoc with the native build triple
Mark Simulacrum [Sun, 13 Aug 2017 03:58:49 +0000 (08:58 +0500)]
Build rustdoc with the native build triple

6 years agoAuto merge of #43348 - kennytm:fix-24658-doc-every-platform, r=alexcrichton
bors [Sun, 13 Aug 2017 03:00:20 +0000 (03:00 +0000)]
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).

6 years agoFix TcpStream::connect_timeout tracking issue number
David Tolnay [Sun, 13 Aug 2017 02:22:03 +0000 (19:22 -0700)]
Fix TcpStream::connect_timeout tracking issue number

6 years agoCargotest needs only one rustdoc.exe to exist on Windows
Mark Simulacrum [Sun, 13 Aug 2017 00:07:01 +0000 (05:07 +0500)]
Cargotest needs only one rustdoc.exe to exist on Windows

6 years agoCorrect code to not run host-only tests.
Mark Simulacrum [Thu, 10 Aug 2017 16:17:42 +0000 (21:17 +0500)]
Correct code to not run host-only tests.

6 years agoClean tools after building libstd/libtest/librustc.
Mark Simulacrum [Thu, 10 Aug 2017 05:12:35 +0000 (10:12 +0500)]
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.

6 years agoBuild rustdoc only at the top stage
Mark Simulacrum [Fri, 4 Aug 2017 22:13:01 +0000 (16:13 -0600)]
Build rustdoc only at the top stage

6 years agoBuild rustdoc with the stageN compiler in N >= 2.
Mark Simulacrum [Fri, 4 Aug 2017 01:08:20 +0000 (19:08 -0600)]
Build rustdoc with the stageN compiler in N >= 2.

This permits proc macro crates to correctly work with rustdoc.

6 years agoMake the message for building rustdoc slightly nicer
Mark Simulacrum [Thu, 3 Aug 2017 22:06:20 +0000 (16:06 -0600)]
Make the message for building rustdoc slightly nicer

6 years agoAdd ability to ignore git when building rust.
Mark Simulacrum [Thu, 3 Aug 2017 16:53:56 +0000 (10:53 -0600)]
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.

6 years agoAllow overriding build triple via flag.
Mark Simulacrum [Sun, 30 Jul 2017 04:45:49 +0000 (22:45 -0600)]
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.

6 years agoAllow specifiying targets and hosts not in the config file.
Mark Simulacrum [Sun, 30 Jul 2017 04:26:28 +0000 (22:26 -0600)]
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.

6 years agoUnify flags into config.
Mark Simulacrum [Sun, 30 Jul 2017 04:12:53 +0000 (22:12 -0600)]
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.

6 years agoAuto merge of #43736 - ollie27:rustdoc_impls_js, r=QuietMisdreavus
bors [Sat, 12 Aug 2017 22:09:34 +0000 (22:09 +0000)]
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

6 years agoAuto merge of #43724 - lukaramu:std-ops-docs, r=QuietMisdreavus
bors [Sat, 12 Aug 2017 19:40:49 +0000 (19:40 +0000)]
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!

6 years agostd: Unsafe-away runtime checks in `Vec`
Alex Crichton [Fri, 11 Aug 2017 23:00:09 +0000 (16:00 -0700)]
std: Unsafe-away runtime checks in `Vec`

The `RawVec` type has a number of invariants that it upholds throughout its
execution, and as a result many of the runtime checks imposed by using `Layout`
in a "raw" fashion aren't actually necessary. For example a `RawVec`'s capacity
is intended to always match the layout which "fits" the allocation, so we don't
need any runtime checks when retrieving the current `Layout` for a vector.
Consequently, this adds a safe `current_layout` function which internally uses
the `from_size_align_unchecked` function.

Along the same lines we know that most construction of new layouts will not
overflow. All allocations in `RawVec` are kept below `isize::MAX` and valid
alignments are also kept low enough that we're guaranteed that `Layout` for a
doubled vector will never overflow and will always succeed construction.
Consequently a few locations can use `from_size_align_unchecked` in addition
when constructing the *new* layout to allocate (or reallocate), which allows for
eliding some more runtime checks.

Overall this should significant improve performance for an important function,
`RawVec::double`. This commit removes four runtime jumps before `__rust_realloc`
is called, as well as one after it's called.

6 years agostd::ops docs: incorporated changes suggested in review
lukaramu [Tue, 8 Aug 2017 12:34:37 +0000 (14:34 +0200)]
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

6 years agoAuto merge of #43820 - sfackler:move-config-template, r=alexcrichton
bors [Sat, 12 Aug 2017 16:48:31 +0000 (16:48 +0000)]
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

6 years agoAdd missing link in fmt::format function
Guillaume Gomez [Fri, 11 Aug 2017 11:46:12 +0000 (13:46 +0200)]
Add missing link in fmt::format function

6 years agoAuto merge of #43823 - tchajed:fix-pr-link, r=frewsxcv
bors [Sat, 12 Aug 2017 14:24:40 +0000 (14:24 +0000)]
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.

6 years agoFix some typos
Bastien Orivel [Fri, 11 Aug 2017 18:34:14 +0000 (20:34 +0200)]
Fix some typos

6 years agoAuto merge of #43746 - eddyb:sound-thread-local, r=alexcrichton
bors [Sat, 12 Aug 2017 11:57:10 +0000 (11:57 +0000)]
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::thread::local::fast::Key`, `#[thread_local]` statics are now not required to implement `Sync`, as they are not shared between threads.

6 years agoFix `-Z hir-stats` always panics (fix #43232).
kennytm [Sat, 12 Aug 2017 11:15:01 +0000 (19:15 +0800)]
Fix `-Z hir-stats` always panics (fix #43232).

6 years agoUpdate GitHub pull request documentation link
Tej Chajed [Sat, 12 Aug 2017 11:28:29 +0000 (12:28 +0100)]
Update GitHub pull request documentation link

6 years agoCheck #[thread_local] statics correctly in the compiler.
Eduard-Mihai Burtescu [Tue, 8 Aug 2017 15:22:51 +0000 (18:22 +0300)]
Check #[thread_local] statics correctly in the compiler.

6 years agoAuto merge of #43812 - steveklabnik:rustdoc-doc-tests, r=QuietMisdreavus
bors [Sat, 12 Aug 2017 09:34:13 +0000 (09:34 +0000)]
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

6 years agoInclude 'let' keyword to the span for ast::Local
topecongiro [Sat, 12 Aug 2017 09:00:57 +0000 (18:00 +0900)]
Include 'let' keyword to the span for ast::Local

6 years agoLess cfg's
bjorn3 [Sat, 12 Aug 2017 08:48:57 +0000 (10:48 +0200)]
Less cfg's

6 years agoFollow up commit for the issue 39827
Alexey Tarasov [Sat, 12 Aug 2017 08:43:59 +0000 (18:43 +1000)]
Follow up commit for the issue 39827

 - updates documentation on volatile memory intrinsics, now the case of
   zero-sized types is mentioned explicitly.

Volatile memory operations which doesn't affect memory at all are omitted
in LLVM backend, e.g. if number of elements is zero or type used in
generic specialisation is zero-sized, then LLVM intrinsic or related code
is not generated. This was not explicitly documented before in Rust
documentation and potentially could cause issues.

6 years agoFixes issue 39827: ICE in volatile_store intrinsic
Alexey Tarasov [Sat, 12 Aug 2017 08:42:44 +0000 (18:42 +1000)]
Fixes issue 39827: ICE in volatile_store intrinsic

- adds handling of zero-sized types for volatile_store.
- adds type size checks and warnigns for other volatile intrinsics.
- adds a test to check warnings emitting.

Cause of the issue

While preparing for trans_intrinsic_call() invoke arguments are
processed with trans_argument() method which excludes zero-sized types
from argument list (to be more correct - all arguments for which
ArgKind is Ignore are filtered out). As result volatile_store() intrinsic
gets one argument instead of expected address and value.

How it is fixed

Modification of the trans_argument() method may cause side effects,
therefore change was implemented in volatile_store() intrinsic building
code itself. Now it checks function signature and if it was specialised
with zero-sized type, then emits C_nil() instead of accessing
non-existing second argument.

Additionally warnings are added for all volatile operations which are
specialised with zero-sized arguments. In fact, those operations are omitted
in LLVM backend if no memory affected at all, e.g. number of elements
is zero or type is zero-sized. This was not explicitly documented before
and could lead to potential issues if developer expects volatile behaviour,
but type has degraded to zero-sized.

6 years agosyntax: #[allow_internal_unsafe] bypasses the unsafe_code lint in macros.
Eduard-Mihai Burtescu [Tue, 8 Aug 2017 15:21:20 +0000 (18:21 +0300)]
syntax: #[allow_internal_unsafe] bypasses the unsafe_code lint in macros.

6 years agoAuto merge of #43794 - Eijebong:fix_typos, r=lukaramu,steveklanik,imperio
bors [Sat, 12 Aug 2017 05:52:19 +0000 (05:52 +0000)]
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.

6 years agoMove config.toml.example to the root dir
Steven Fackler [Sat, 12 Aug 2017 05:24:25 +0000 (22:24 -0700)]
Move config.toml.example to the root dir

It's way more discoverable here.

6 years agoHandle DNS label compression in more places
Thomas Levy [Sat, 12 Aug 2017 05:13:57 +0000 (22:13 -0700)]
Handle DNS label compression in more places

6 years agoDon't trigger unused_result on functions returning empty enums
Owen Sanchez [Sat, 12 Aug 2017 04:52:16 +0000 (21:52 -0700)]
Don't trigger unused_result on functions returning empty enums

6 years agoAdd complete doc example for `include_str!`.
Corey Farwell [Sat, 12 Aug 2017 04:25:49 +0000 (00:25 -0400)]
Add complete doc example for `include_str!`.

6 years agoAdd complete doc example for `include_bytes!`.
Corey Farwell [Sat, 12 Aug 2017 04:22:49 +0000 (00:22 -0400)]
Add complete doc example for `include_bytes!`.

6 years agoDemonstrate `include!` with Rust code, not just a string slice literal.
Corey Farwell [Sat, 12 Aug 2017 03:45:48 +0000 (23:45 -0400)]
Demonstrate `include!` with Rust code, not just a string slice literal.

6 years agoFix error during cross-platform documentation.
kennytm [Fri, 11 Aug 2017 01:01:46 +0000 (09:01 +0800)]
Fix error during cross-platform documentation.

6 years agoAuto merge of #43792 - steveklabnik:rustdoc-directives, r=frewsxcv
bors [Sat, 12 Aug 2017 03:22:09 +0000 (03:22 +0000)]
Auto merge of #43792 - steveklabnik:rustdoc-directives, r=frewsxcv

Document the doc attribute

cc #42322

6 years agoAuto merge of #43772 - arielb1:nonfree-block, r=nagisa
bors [Sat, 12 Aug 2017 00:54:38 +0000 (00:54 +0000)]
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

6 years agostd: Tag OOM functions as `#[cold]`
Alex Crichton [Fri, 11 Aug 2017 22:59:11 +0000 (15:59 -0700)]
std: Tag OOM functions as `#[cold]`

This was forgotten from #42727 by accident, but these functions are rarely
called and codegen can be improved in LLVM with the `#[cold]` tag.

6 years agostd: Tag `AllocErr` functions as `#[inline]`
Alex Crichton [Fri, 11 Aug 2017 22:58:26 +0000 (15:58 -0700)]
std: Tag `AllocErr` functions as `#[inline]`

None of these require a significant amount of code and using `#[inline]` will
allow constructors to get inlined, improving codegen at allocation callsites.

6 years agoAuto merge of #43766 - michaelwoerister:trans-scheduler-touch-up, r=alexcrichton
bors [Fri, 11 Aug 2017 22:23:10 +0000 (22:23 +0000)]
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

6 years agorustdoc doc tests
steveklabnik [Fri, 11 Aug 2017 20:43:38 +0000 (16:43 -0400)]
rustdoc doc tests

6 years agoFix unused_result lint triggering when a function returns `()` or `!`
Owen Sanchez [Fri, 11 Aug 2017 20:43:33 +0000 (13:43 -0700)]
Fix unused_result lint triggering when a function returns `()` or `!`

Add a test for this case

6 years agoaddress review feedback
steveklabnik [Fri, 11 Aug 2017 20:24:18 +0000 (16:24 -0400)]
address review feedback

6 years agoAuto merge of #43750 - tbu-:pr_fn_unreachable, r=sfackler
bors [Fri, 11 Aug 2017 19:43:44 +0000 (19:43 +0000)]
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.

6 years agoAuto merge of #42932 - bjorn3:no_llvm_try2, r=eddyb
bors [Fri, 11 Aug 2017 15:45:10 +0000 (15:45 +0000)]
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

6 years agoAuto merge of #43748 - RalfJung:mir-validate2, r=arielb1
bors [Fri, 11 Aug 2017 13:04:59 +0000 (13:04 +0000)]
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.

6 years agoRemove some unused dependencies from rustc_trans_utils
bjorn3 [Fri, 11 Aug 2017 09:08:01 +0000 (11:08 +0200)]
Remove some unused dependencies from rustc_trans_utils

6 years agoIt now completely compiles without LLVM!!!
bjorn3 [Fri, 11 Aug 2017 08:35:01 +0000 (10:35 +0200)]
It now completely compiles without LLVM!!!

6 years agoActually make rustc_driver compile without llvm
bjorn3 [Sat, 5 Aug 2017 14:55:23 +0000 (16:55 +0200)]
Actually make rustc_driver compile without llvm

6 years agoAdd (a lot of) missing links in fmt module docs
Guillaume Gomez [Fri, 11 Aug 2017 11:43:31 +0000 (13:43 +0200)]
Add (a lot of) missing links in fmt module docs

6 years agoAuto merge of #43800 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Fri, 11 Aug 2017 09:37:52 +0000 (09:37 +0000)]
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:

6 years agoMake librustc_driver work without librustc_trans
bjorn3 [Thu, 20 Jul 2017 12:56:53 +0000 (14:56 +0200)]
Make librustc_driver work without librustc_trans

6 years agoBuild support for no llvm
bjorn3 [Sun, 18 Jun 2017 14:00:10 +0000 (16:00 +0200)]
Build support for no llvm

6 years agoRollup merge of #43795 - GuillaumeGomez:improve-variants-doc-style, r=QuietMisdreavus
Guillaume Gomez [Fri, 11 Aug 2017 08:20:33 +0000 (10:20 +0200)]
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).

6 years agoRollup merge of #43793 - j-browne:master, r=steveklabnik
Guillaume Gomez [Fri, 11 Aug 2017 08:20:32 +0000 (10:20 +0200)]
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.

6 years agoRollup merge of #43791 - GuillaumeGomez:file-docs, r=QuietMisdreavus
Guillaume Gomez [Fri, 11 Aug 2017 08:20:31 +0000 (10:20 +0200)]
Rollup merge of #43791 - GuillaumeGomez:file-docs, r=QuietMisdreavus

File docs

r? @rust-lang/docs

6 years agoRollup merge of #43783 - prisme60:prisme60-typo, r=Mark-Simulacrum
Guillaume Gomez [Fri, 11 Aug 2017 08:20:30 +0000 (10:20 +0200)]
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.

6 years agoRollup merge of #43779 - mattico:fix-unicode-typo, r=aidanhs
Guillaume Gomez [Fri, 11 Aug 2017 08:20:29 +0000 (10:20 +0200)]
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

6 years agoRollup merge of #43773 - ubsan:patch-1, r=eddyb
Guillaume Gomez [Fri, 11 Aug 2017 08:20:28 +0000 (10:20 +0200)]
Rollup merge of #43773 - ubsan:patch-1, r=eddyb

fix a typo

(this should not have been merged with this typo)

6 years agoRollup merge of #43760 - ollie27:rustdoc_search_css, r=GuillaumeGomez
Guillaume Gomez [Fri, 11 Aug 2017 08:20:27 +0000 (10:20 +0200)]
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

6 years agoRollup merge of #43752 - arshiamufti:union-test, r=estebank
Guillaume Gomez [Fri, 11 Aug 2017 08:20:26 +0000 (10:20 +0200)]
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`.

6 years agoRollup merge of #43747 - GuillaumeGomez:fix-css, r=QuietMisdreavus
Guillaume Gomez [Fri, 11 Aug 2017 08:20:25 +0000 (10:20 +0200)]
Rollup merge of #43747 - GuillaumeGomez:fix-css, r=QuietMisdreavus

Improve headers linking

r? @QuietMisdreavus

6 years agoRollup merge of #43744 - MaloJaffre:stage1-test, r=Mark-Simulacrum
Guillaume Gomez [Fri, 11 Aug 2017 08:20:24 +0000 (10:20 +0200)]
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`.

6 years agoRollup merge of #43741 - Gankro:fix-assert, r=eddyb
Guillaume Gomez [Fri, 11 Aug 2017 08:20:23 +0000 (10:20 +0200)]
Rollup merge of #43741 - Gankro:fix-assert, r=eddyb

fix assertion - trait object pointers don't have infinite fields

r? @eddyb

6 years agoRollup merge of #43739 - ibabushkin:master, r=eddyb
Guillaume Gomez [Fri, 11 Aug 2017 08:20:22 +0000 (10:20 +0200)]
Rollup merge of #43739 - ibabushkin:master, r=eddyb

Encode proper module spans in crate metadata.

The spans previously encoded only span the first token after the opening
brace, up to the closing brace of inline `mod` declarations. Thus, when
examining exports from an external crate, the spans don't include the
header of inline `mod` declarations.

r? @eddyb

6 years agoRollup merge of #43721 - natboehm:patch-1, r=steveklabnik
Guillaume Gomez [Fri, 11 Aug 2017 08:20:21 +0000 (10:20 +0200)]
Rollup merge of #43721 - natboehm:patch-1, r=steveklabnik

Provide more explanation for Deref in String docs

While working on a different project I encountered a point of confusion where using `&String` to dereference a `String` into `&str` did not compile. I found the explanation of [String Deref](https://doc.rust-lang.org/std/string/struct.String.html#deref), thought that it matched what I was trying to do, and was confused as to why my program did not compile when the docs stated that it would work with 'any function which takes a `&str`'. At the bottom it is mentioned that this will 'generally' work, unless `String` is needed, but I found this statement confusing based on the previous claim of 'any'. Looking further into the docs I was able to find the function `as_str()` that works instead.

I thought it might be helpful to mention here deref coercion, an instance in which using `&String` does not work, to explain why it does not work, then direct users to a different option that should work in this instance. A user casually skimming the page will likely come to this explanation first, then find `as_str()` later, but be no the wiser as to what potentially went wrong.

r? @steveklabnik

6 years agoRollup merge of #43715 - ollie27:docs_long_link, r=QuietMisdreavus
Guillaume Gomez [Fri, 11 Aug 2017 08:20:20 +0000 (10:20 +0200)]
Rollup merge of #43715 - ollie27:docs_long_link, r=QuietMisdreavus

Stop using URL shortener in docs

tidy will no longer complain about long lines containing links so there
is no reason to use a URL shortener here.

6 years agoRollup merge of #43712 - oli-obk:cfg, r=arielb1
Guillaume Gomez [Fri, 11 Aug 2017 08:20:19 +0000 (10:20 +0200)]
Rollup merge of #43712 - oli-obk:cfg, r=arielb1

Reexport all SyntaxExtension variants

This was previously done very inconsistently and made matches look weird since some variants had the `SyntaxExtension::` prefix while others didn't.

6 years agoRollup merge of #43650 - RalfJung:mir-validate, r=arielb1
Guillaume Gomez [Fri, 11 Aug 2017 08:20:18 +0000 (10:20 +0200)]
Rollup merge of #43650 - RalfJung:mir-validate, r=arielb1

test MIR validation statements in closures

r? @nikomatsakis

6 years agoRollup merge of #43632 - ruuda:allow-long-relative-urls, r=Mark-Simulacrum
Guillaume Gomez [Fri, 11 Aug 2017 08:20:17 +0000 (10:20 +0200)]
Rollup merge of #43632 - ruuda:allow-long-relative-urls, r=Mark-Simulacrum

Detect relative urls in tidy check

This came up in #43631: there can be long relative urls in Markdown comments, that do not start with `http://` or `https://`, so the tidy check will not detect them as urls and complain about the line length. This PR adds detection of relative urls starting with `../`.