Commit Graph

88145 Commits

Author SHA1 Message Date
Pietro Albini
6031f1302b
Rollup merge of #57403 - claudijd:tweak_code_of_conduct, r=alexcrichton
Make extern ref HTTPS

Basically, saw an HTTP link and noticed it could be HTTPS.  When visiting the link, the URL pattern changed on the site since last linking, so fixed that too!
2019-01-07 16:25:41 +01:00
Pietro Albini
bc38143ad2
Rollup merge of #57375 - stjepang:duration-constants, r=joshtriplett
Add duration constants

Add constants `SECOND`, `MILLISECOND`, `MICROSECOND`, and `NANOSECOND` to `core::time`.

This will make working with durations more ergonomic. Compare:

```rust
// Convenient, but deprecated function.
thread::sleep_ms(2000);

// The current canonical way to sleep for two seconds.
thread::sleep(Duration::from_secs(2));

// Sleeping using one of the new constants.
thread::sleep(2 * SECOND);
```
2019-01-07 16:25:40 +01:00
Pietro Albini
5cfc845884
Rollup merge of #57369 - petrhosek:llvm-libcxx, r=alexcrichton
Provide the option to use libc++ even on all platforms

This is the default on platforms which use libc++ as the default C++
library but this option allows using libc++ on others as well.
2019-01-07 16:25:38 +01:00
Pietro Albini
14fb35fa4f
Rollup merge of #57358 - euclio:docck-unicode, r=QuietMisdreavus
use utf-8 throughout htmldocck

This commit improves compatibility with Python 3, which already uses
Unicode throughout.

It also fixes a subtle incompatibility stemming from the use of
`entitydefs`, which contains replacement text _encoded in latin-1_ for
HTML entities. When using Python 3, this would cause `0xa0` to be
incorrectly added to the element tree.

This meant that there was a rustdoc test that would pass under Python 2
but fail under Python 3, due to an incorrect regex match against the
non-breaking space character. This commit triggers that failure in both
versions, and also fixes it.
2019-01-07 16:25:36 +01:00
Pietro Albini
e319f12cf4
Rollup merge of #57308 - Zoxc:controller-sync, r=michaelwoerister
Make CompileController thread-safe
2019-01-07 16:25:35 +01:00
Pietro Albini
c89b07aa52
Rollup merge of #57290 - mark-i-m:remove-outdated-comment, r=michaelwoerister
remove outdated comment

https://github.com/rust-lang/rust/issues/44234 was closed, apparently solved by #45353

r? @michaelwoerister
2019-01-07 16:25:33 +01:00
Jonathan Claudius
7316490fcb
Make extern ref HTTPS 2019-01-07 09:52:32 -05:00
bors
1f7c44cdb2 Auto merge of #57336 - ehuss:bump-stage0, r=alexcrichton
Bump stage0

Updates stage 0
From: rustc 1.32.0-beta.2 (a01e4761a 2018-12-08)
To:   rustc 1.32.0-beta.11 (e64fee6a3 2019-01-04)

Intended to pull in #57292 which will fix #57142.

The following is a list of PRs this also pulls in in case anyone is interested in seeing the changes:

#56930
#56961
#57236
#57305
2019-01-07 11:31:32 +00:00
Stjepan Glavina
8c902b6633 Specify the tracking issue 2019-01-07 11:39:22 +01:00
bors
474a3a9171 Auto merge of #57327 - akash-fortanix:aa/update-compiler_builtins, r=kennytm
Update compiler_builtins 0.1.2 -> 0.1.4

r? @alexcrichton
2019-01-07 08:55:49 +00:00
bors
0194bed710 Auto merge of #57394 - euclio:compiletest-optimization, r=Mark-Simulacrum
slightly optimize compiletest test collection

Save quite a few syscalls and avoiding pushing in a loop.
2019-01-07 06:17:37 +00:00
Andy Russell
2a9ad77d95
slightly optimize compiletest test collection
Save quite a few syscalls and avoiding pushing in a loop.
2019-01-06 23:23:20 -05:00
bors
a651777298 Auto merge of #57365 - sinkuu:unused, r=oli-obk
Remove unused code
2019-01-07 03:44:41 +00:00
bors
789a15a422 Auto merge of #57379 - petrochenkov:parsrecov, r=estebank
tests: Do not use `-Z parse-only`, continue compilation to test recovery

Make tests closer to reality!

The next step will be enabling `-Z continue-parse-after-error` by default and looking at the regressions.

A few instances of `-Z parse-only` are kept when it's appropriate, see e.g `ui/impl-trait/impl-trait-plus-priority.rs`, which tests mostly semantically wrong code and would generate too much useless noise if allowed to continue.
2019-01-07 01:05:45 +00:00
bors
d39dddf795 Auto merge of #57344 - petrochenkov:regreach, r=arielb1
privacy: Fix regression in impl reachability

Rollback to pre-https://github.com/rust-lang/rust/pull/56878 logic of determining reachability.
`reachability(impl Trait<Substs> for Type<Substs>) = reachability(Trait & Type)`, substs are ignored.

Fixes https://github.com/rust-lang/rust/issues/57264
2019-01-06 22:26:16 +00:00
Vadim Petrochenkov
1f64f60d5c tests: Do not use -Z parse-only, continue compilation to test recovery 2019-01-06 22:20:46 +03:00
akashfortanix
3033304936 Update compiler_builtins 0.1.2 -> 0.1.4 2019-01-06 22:15:34 +05:30
bors
b92552d557 Auto merge of #57272 - petrochenkov:featrecov, r=estebank
Make sure feature gate errors are recoverable (take 2)

Continuation of 15cefe4b2a.
Turns out I missed the most important part - the main feature gate checking pass.
2019-01-06 15:40:58 +00:00
bors
6b2c311718 Auto merge of #57121 - glaubitz:flock-fixes, r=nagisa
flock: Use fcntl constants directly from libc crate on Unix targets

Since the values for the fcntl constants can vary from architecture
to architecture, it is better to use the values defined in the libc
crate instead of assigning literals in the flock code which would
make the assumption that all architectures use the same values.

Fixes #57007
2019-01-06 13:05:11 +00:00
Stjepan Glavina
72ec5aa080 Re-export constants from core into std 2019-01-06 14:04:07 +01:00
Stjepan Glavina
7f7a2e9396 Add duration constants 2019-01-06 13:44:55 +01:00
Vadim Petrochenkov
37511771db Fix CI failures 2019-01-06 15:35:39 +03:00
Vadim Petrochenkov
10a00e120d Make sure feature gate errors are recoverable (take 2) 2019-01-06 14:58:17 +03:00
John Paul Adrian Glaubitz
1c4823e81c flock: Use fcntl constants directly from libc crate on Unix targets
Since the values for the fcntl constants can vary from architecture
to architecture, it is better to use the values defined in the libc
crate instead of assigning literals in the flock code which would
make the assumption that all architectures use the same values.

Fixes #57007
2019-01-06 11:58:13 +01:00
bors
e628196d41 Auto merge of #57291 - euclio:method-call-suggestion, r=estebank
use structured suggestion for method calls

Furthermore, don't suggest calling the method if it is part of a place
expression, as this is invalid syntax.

I'm thinking it might be worth putting a label on the method assignment span like "this is a method" and removing the span from the "methods are immutable" text so it isn't reported twice.

The suggestions in `src/test/ui/did_you_mean/issue-40396.stderr` are suboptimal. I could check if the containing expression is `BinOp`, but I'm not sure if that's general enough. Any ideas?

r? @estebank
2019-01-06 10:30:05 +00:00
John Paul Adrian Glaubitz
1e903c3e96 Update libc to 0.2.46 2019-01-06 11:01:42 +01:00
bors
af2c159cc3 Auto merge of #57287 - alexcrichton:fix-jemalloc, r=nikomatsakis
rustc: Fix regression where jemalloc isn't used

In #56986 the linkage of jemalloc to the compiler was switched from the
driver library to the rustc binary to ensure that only rustc itself uses
jemalloc. In doing so, however, it turns out jemalloc wasn't actually
linked in at all! None of the symbols were referenced so the static
library wasn't used. This means that jemalloc wasn't pulled in at all.

This commit performs a bit of a dance to reference jemalloc symbols,
attempting to pull it in despite LLVM's optimizations.

Closes #57115
2019-01-06 07:48:16 +00:00
Andy Russell
6fefcee73a
use utf-8 throughout htmldocck
This commit improves compatibility with Python 3, which already uses
Unicode throughout.

It also fixes a subtle incompatibility stemming from the use of
`entitydefs`, which contains replacement text _encoded in latin-1_ for
HTML entities. When using Python 3, this would cause `0xa0` to be
incorrectly added to the element tree.

This meant that there was a rustdoc test that would pass under Python 2
but fail under Python 3, due to an incorrect regex match against the
non-breaking space character. This commit triggers that failure in both
versions, and also fixes it.
2019-01-06 01:27:33 -05:00
Petr Hosek
7306b87f12 Provide the option to use libc++ even on all platforms
This is the default on platforms which use libc++ as the default C++
library but this option allows using libc++ on others as well.
2019-01-05 22:25:56 -08:00
bors
2d7c8e981d Auto merge of #57263 - ishitatsuyuki:bump-openssl, r=sfackler
Upgrade openssl and openssl-sys

Fix #57169
2019-01-06 05:08:59 +00:00
bors
3ad234f53b Auto merge of #57286 - alexcrichton:less-thin-2-2, r=nikomatsakis
bootstrap: Link LLVM as a dylib with ThinLTO (take 2)

When building a distributed compiler on Linux where we use ThinLTO to
create the LLVM shared object this commit switches the compiler to
dynamically linking that LLVM artifact instead of statically linking to
LLVM. The primary goal here is to reduce CI compile times, avoiding two+
ThinLTO builds of all of LLVM. By linking dynamically to LLVM we'll
reuse the one ThinLTO step done by LLVM's build itself.

Lots of discussion about this change can be found [here] and down. A
perf run will show whether this is worth it or not!

[here]: https://github.com/rust-lang/rust/pull/53245#issuecomment-417015334

---

This PR previously landed in https://github.com/rust-lang/rust/pull/56944, caused https://github.com/rust-lang/rust/issues/57111, and was reverted in https://github.com/rust-lang/rust/pull/57116. I've added one more commit here which should fix the breakage that we saw.
2019-01-06 02:26:20 +00:00
Tatsuyuki Ishi
9740c5ec79 Upgrade openssl and openssl-sys 2019-01-06 11:11:59 +09:00
Shotaro Yamada
75ac204f3f Remove unused code 2019-01-06 10:08:11 +09:00
Vadim Petrochenkov
fb00313c0d Address review comments 2019-01-06 03:31:43 +03:00
bors
ad9068f874 Auto merge of #57230 - estebank:return-mismatch, r=varkor
Modify mismatched type error for functions with no return

Fix #50009.

```
error[E0308]: mismatched types
  --> $DIR/coercion-missing-tail-expected-type.rs:3:24
   |
LL | fn plus_one(x: i32) -> i32 { //~ ERROR mismatched types
   |    --------            ^^^ expected i32, found ()
   |    |
   |    this function's body doesn't return
LL |     x + 1;
   |          - help: consider removing this semicolon
   |
   = note: expected type `i32`
              found type `()`
```

instead of

```
error[E0308]: mismatched types
  --> $DIR/coercion-missing-tail-expected-type.rs:3:28
   |
LL |   fn plus_one(x: i32) -> i32 { //~ ERROR mismatched types
   |  ____________________________^
LL | |     x + 1;
   | |          - help: consider removing this semicolon
LL | | }
   | |_^ expected i32, found ()
   |
   = note: expected type `i32`
              found type `()`
```
2019-01-05 22:25:47 +00:00
Vadim Petrochenkov
9503c56ff7 privacy: Mark everything in a header of a reachable impl as reachable 2019-01-05 23:46:19 +03:00
Vadim Petrochenkov
67713f5b7f privacy: Fix regression in impl reachability 2019-01-05 23:46:19 +03:00
bors
68fe5182c9 Auto merge of #57354 - kennytm:rollup, r=kennytm
Rollup of 17 pull requests

Successful merges:

 - #57219 (Remove some unused code)
 - #57229 (Fix #56806 by using `delay_span_bug` in object safety layout sanity checks)
 - #57233 (Rename and fix nolink-with-link-args test)
 - #57238 (Fix backtraces for inlined functions on Windows)
 - #57249 (Fix broken links to second edition TRPL.)
 - #57267 (src/jemalloc is gone, remove its mention from COPYRIGHT)
 - #57273 (Update the stdsimd submodule)
 - #57278 (Add Clippy to config.toml.example)
 - #57295 (Fix 'be be' constructs)
 - #57311 (VaList::copy should not require a mutable ref)
 - #57312 (`const fn` is no longer coming soon (const keyword docs))
 - #57313 (Improve Box<T> -> Pin<Box<T>> conversion)
 - #57314 (Fix repeated word typos)
 - #57326 (Doc rewording, use the same name `writer`)
 - #57338 (rustdoc: force binary filename for compiled doctests)
 - #57342 (librustc_mir: Make qualify_min_const_fn module public)
 - #57343 (Calculate privacy access only via query)

Failed merges:

 - #57340 (Use correct tracking issue for c_variadic)

r? @ghost
2019-01-05 17:39:59 +00:00
kennytm
d9885c41de
Rollup merge of #57343 - Xanewok:querify-access-levels, r=nikomatsakis
Calculate privacy access only via query

Initially converted to query in a9f6babcda and then changed to respect dependencies 8281e883dd.

I did this as an effort to prune `CrateAnalysis` from librustc_save_analysis, with the only thing remaining being the glob map (`name` is unused, existing `crate_name` is exposed in the compiler passes, instead).

Since calculating the glob map is opt-in, it'd be great if we could calculate that on-demand. However, it seems that it'd require converting resolution to queries, which I'm not sure how to do yet.

In an effort to get rid of `CrateAnalysis` altogether, could we try unconditionally calculating the glob_map in the resolver, thus completely removing `CrateAnalysis` struct, and doing a perf run?

r? @nikomatsakis

cc @petrochenkov do you have any idea how/if at all could we querify the resolver? I've stumbled upon a comment that's ~3? years old at the moment, so I'm guessing things might have changed and it actually may be feasible now. fe0c10019d/src/librustc_driver/driver.rs (L589-L593)
2019-01-05 23:57:06 +08:00
kennytm
06c07f93c0
Rollup merge of #57342 - phansch:make_public, r=Centril
librustc_mir: Make qualify_min_const_fn module public

Trying to write a `const_fn` lint for Clippy. @oli-obk suggested
[here][link] to use the `is_min_const_fn` function from the
`qualify_min_const_fn` module. However, the module is currently private
and this commit makes it public.

I lack any historical knowledge of the development of the `const_fn`
feature, so I'm not sure if it was private on purpose or not. fwiw, all
modules are already public except `qualify_min_const_fn`.

r? @oli-obk

[link]: https://github.com/rust-lang/rust-clippy/issues/2440#issuecomment-446109978
2019-01-05 23:57:04 +08:00
kennytm
284a419b73
Rollup merge of #57338 - QuietMisdreavus:doctest-file-name, r=GuillaumeGomez
rustdoc: force binary filename for compiled doctests

Fixes https://github.com/rust-lang/rust/issues/57317, needed for https://github.com/rust-lang/rust-by-example/issues/1137

Right now, when building a doctest, rustdoc provides the compiler an output directory (a temp dir) but lets the compiler name the executable. If the doctest needs to be executed, it then tries to run a binary named `rust_out` from that directory. For the most part, this works fine. However, if the doctest sets its own crate name, the compiler uses that name for the output binary instead. This causes rustdoc to try to execute a nonexistent binary, causing the test to fail.

This PR changes the paths rustdoc gives to the compiler when building doctests to force the output *filename* instead of just the *directory*.
2019-01-05 23:57:02 +08:00
kennytm
a3afdd41bc
Rollup merge of #57326 - king6cong:doc, r=rkruppe
Doc rewording, use the same name `writer`

None
2019-01-05 23:57:01 +08:00
kennytm
ab55ecf4ba
Rollup merge of #57314 - wiktorkuchta:master, r=Centril
Fix repeated word typos

Inspired by #57295 (I skipped 'be be' because of it) and my [PR in another repo
](https://github.com/e-maxx-eng/e-maxx-eng/pull/389)
Not a stupid `sed`, I actually tried to fix case by case.
2019-01-05 23:56:59 +08:00
kennytm
676b0b0cc4
Rollup merge of #57313 - Nemo157:box-to-pin, r=cramertj
Improve Box<T> -> Pin<Box<T>> conversion

I found the `From` trait conversion for this very hard to find, having a named function for it is much more discoverable. Also fixes #56256 as I need that in the place I'm using this.

Has a placeholder tracking issue, will file an issue once I get feedback.
2019-01-05 23:56:58 +08:00
kennytm
e1a1ab0836
Rollup merge of #57312 - Mendess2526:master, r=Centril
`const fn` is no longer coming soon (const keyword docs)

The `const` keyword [documentation](https://doc.rust-lang.org/std/keyword.const.html) mentions that `const fn`s are coming soon, but they have already been added.
2019-01-05 23:56:56 +08:00
kennytm
dfc1037757
Rollup merge of #57311 - dlrobertson:fix_valist_copy, r=KodrAus
VaList::copy should not require a mutable ref

`VaList::copy` does not need to take a mutable reference. The `va_copy`
intrinsic takes a immutable reference.
2019-01-05 23:56:55 +08:00
kennytm
952af5e898
Rollup merge of #57295 - d-e-s-o:topic/be-be, r=zackmdavis
Fix 'be be' constructs

I noticed a duplicated "be" somewhere in the code. A search for it
manifested a couple more locations with the same problem. This change
removes one of the "be"s.
2019-01-05 23:56:53 +08:00
kennytm
f11f85812f
Rollup merge of #57278 - mati865:config_clippy, r=alexcrichton
Add Clippy to config.toml.example

Omitted in https://github.com/rust-lang/rust/pull/51122

The order is based on ec194646fe/src/bootstrap/install.rs (L212)
2019-01-05 23:56:52 +08:00
kennytm
85ddc4d150
Rollup merge of #57273 - alexcrichton:update-stdsimd, r=nikomatsakis
Update the stdsimd submodule

Add a new cmpxchg16b intrinsics for x86_64 and some corrections for ARM/AArch64
2019-01-05 23:56:51 +08:00
kennytm
69d3c1a188
Rollup merge of #57267 - rust-lang:SimonSapin-patch-1, r=varkor
src/jemalloc is gone, remove its mention from COPYRIGHT

The `src/jemalloc` submodule was removed in 61e89446ef / https://github.com/rust-lang/rust/pull/55238.
2019-01-05 23:56:49 +08:00