Commit Graph

101071 Commits

Author SHA1 Message Date
Mark Rousskov
47a443c50d Duplicate lint specifications are always bug!
Replace early_error and sess.err with bug!, in all cases. If the
compiler we're running with, including plugins, is registering something
twice, that's a (compiler/plugin) programmer error -- we should not try
to be nice at the cost of developer ergononomics (hiding the stacktrace
of the second registration is bad).

This also is basically a static bug in ~all cases so it should not be a
detriment to users, including with plugins.
2019-10-17 19:16:40 -04:00
Dan Gohman
b25e3238c7 Don't add argc and argv arguments to main on WASI.
Add a target setting to allow targets to specify whether the generated
`main` function should be passed `argc` and `argv` arguments. Set it
to false on wasm32-wasi, since WASI's `args::args()` calls into the
WASI APIs itself. This will allow the WASI toolchain to avoid linking
and running command-line argument initialization code when the arguments
aren't actually needed.
2019-10-17 16:16:35 -07:00
Tshepang Lekhonkhobe
c9b27d1236 doc: make BitSet intro more short
Also, add a link to the growable type
2019-10-18 01:16:30 +02:00
Stein Somers
56974329d1 BTreeSet symmetric_difference & union optimized, cleaned 2019-10-18 00:11:32 +02:00
Ralf Jung
c0b7e769a0 example for padding any format 2019-10-17 23:02:09 +02:00
Niko Matsakis
54879949f1
Update triagebot.toml
Co-Authored-By: Mark Rousskov <mark.simulacrum@gmail.com>
2019-10-17 16:53:47 -04:00
Ralf Jung
4e6efe4811 reorder fmt docs for more clarity 2019-10-17 21:22:46 +02:00
bors
fa0f7d0080 Auto merge of #65495 - Centril:rollup-tguwjt5, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #65237 (Move debug_map assertions after check for err)
 - #65316 (make File::try_clone produce non-inheritable handles on Windows)
 - #65319 (InterpCx: make memory field public)
 - #65461 (Don't recommend ONCE_INIT in std::sync::Once)
 - #65465 (Move syntax::ext to a syntax_expand and refactor some attribute logic)
 - #65475 (add example for type_name)
 - #65478 (fmt::Write is about string slices, not byte slices)
 - #65486 (doc: fix typo in OsStrExt and OsStringExt)

Failed merges:

r? @ghost
2019-10-17 18:53:10 +00:00
Igor Matuszewski
ad6ce46986 save-analysis: Add a relevant test case 2019-10-17 20:49:06 +02:00
Igor Matuszewski
5fe88abed0 save-analysis: Nest tables when processing impl items 2019-10-17 20:48:00 +02:00
Niko Matsakis
a4d94925c7
add option to ping llvm ice-breakers to triagebot 2019-10-17 14:15:59 -04:00
Lucas Henry
a1387e352f Replaced pretty-json error-format with only json 2019-10-17 19:52:29 +02:00
Lucas Henry
46a44668b2 Replaced pretty-json error-format with only json 2019-10-17 19:52:29 +02:00
Lucas Henry
43b5dcaabb Replaced warn attribute by deny 2019-10-17 19:52:06 +02:00
Ralf Jung
868a77263a more consistency and clarification 2019-10-17 19:51:42 +02:00
Ralf Jung
470e9d2789 Rc: value -> allocation 2019-10-17 19:37:05 +02:00
Lucas Henry
b9bca18002 Replaced warn attibute by deny 2019-10-17 19:15:42 +02:00
Igor Aleksanov
cb5733de86 Improve code style 2019-10-17 19:37:01 +03:00
Igor Aleksanov
85628e8063 Add more explaining comments to the code 2019-10-17 19:10:35 +03:00
Igor Aleksanov
ddc6a5fd0e Split options parsing into several functions 2019-10-17 19:10:17 +03:00
Igor Aleksanov
12397e9dd5 Make enum usage explicit and fix tests 2019-10-17 17:47:03 +03:00
bors
b04338087e Auto merge of #64595 - Mark-Simulacrum:trivial-query, r=pnkfelix
Optimize dropck

This does two things: caches the `trivial_dropck` check by making it a query, and shifts around the implementation of the primary dropck itself to avoid allocating many small vectors.
2019-10-17 14:42:24 +00:00
Igor Aleksanov
c951882c73 Extract ConsoleTestState 2019-10-17 17:38:44 +03:00
Igor Aleksanov
4d5052203d Split libtest into several smaller modules 2019-10-17 17:38:44 +03:00
Simon Sapin
71b0049ad6 Plugins deprecation: don’t suggest simply removing the attribute
Building Servo with a recent Nightly produces:

```rust
warning: use of deprecated attribute `plugin`: compiler plugins are deprecated. See https://github.com/rust-lang/rust/issues/29597
  --> components/script/lib.rs:14:1
   |
14 | #![plugin(script_plugins)]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove this attribute
   |
   = note: `#[warn(deprecated)]` on by default
```

First, linking to https://github.com/rust-lang/rust/issues/29597 is not ideal
since there is pretty much no discussion there of the deprecation
and what can be used instead.
This PR changes the link to the deprecation PR which does have more discussion.

Second, the “remove this attribute” suggestion is rather unhelpful.
Just because a feature is deprecated doesn’t mean that simply removing its use
without a replacement is acceptable.

In the case of custom lint, there is no replacement available.
Prefixing a message with “help:” when telling users that they’re screwed
honestly feels disrespectful.

This PR also changes the message to be more factual.
2019-10-17 14:25:40 +02:00
Guillaume Gomez
f647c06120 Update ui tests 2019-10-17 14:19:27 +02:00
Guillaume Gomez
4cd92768ee Add long error explanation for E0584 2019-10-17 14:19:27 +02:00
Christian Holler (:decoder)
a2feb9c6cc Avoid injecting sanitizer runtimes into staticlibs (#64629). 2019-10-17 14:09:49 +02:00
Trevor Spiteri
83e97c6ac1 properly document panics in div_euclid and rem_euclid 2019-10-17 13:53:57 +02:00
Mazdak Farrokhzad
060aedd385
Rollup merge of #65486 - mathstuf:osstr-doc-typo, r=TimNN
doc: fix typo in OsStrExt and OsStringExt
2019-10-17 13:46:15 +02:00
Mazdak Farrokhzad
4f84bd4bc5
Rollup merge of #65478 - RalfJung:write, r=jonas-schievink
fmt::Write is about string slices, not byte slices

No idea why the docs talk about bytes, maybe a copy-paste error?
2019-10-17 13:46:13 +02:00
Mazdak Farrokhzad
5bf5d6dc73
Rollup merge of #65475 - lzutao:eg_type_name, r=Centril
add example for type_name

So users of this function could at least expect what its output for current compiler version.
2019-10-17 13:46:12 +02:00
Mazdak Farrokhzad
accc6e7e4a
Rollup merge of #65465 - Centril:split-syntax-1, r=petrochenkov
Move syntax::ext to a syntax_expand and refactor some attribute logic

Part of https://github.com/rust-lang/rust/pull/65324.

r? @petrochenkov
2019-10-17 13:46:11 +02:00
Mazdak Farrokhzad
55f2ac2483
Rollup merge of #65461 - Kampfkarren:patch-1, r=Centril
Don't recommend ONCE_INIT in std::sync::Once

ONCE_INIT is deprecated, and so suggesting it as not only being on par with, but before `Once::new` is a bad idea.
2019-10-17 13:46:09 +02:00
Mazdak Farrokhzad
60ac3335fd
Rollup merge of #65319 - RalfJung:memory, r=Centril
InterpCx: make memory field public

I made this field private forever ago because I thought sealing things might be nice. But with the `memory_mut` getter it doesn't actually seal anything, and it's not like we need to invalidate caches on writes to memory or so. And moreover, having to use the getters leads to some annoying borrow checking interactions.

So, let's just make it public (again).

r? @oli-obk
2019-10-17 13:46:06 +02:00
Mazdak Farrokhzad
10b580a1d1
Rollup merge of #65316 - oconnor663:noninheritable, r=alexcrichton
make File::try_clone produce non-inheritable handles on Windows

~**NOT READY FOR REVIEW.** This PR is currently mainly to trigger CI so that I can see what happens. (Is there a better way to trigger CI?) I don't know whether this change makes sense yet.~ (Edit: @Mark-Simulacrum clarified that CI doesn't currently run on Windows.)

---

File handles shouldn't be inheritable in general.
`std::process::Command` takes care of making them inheritable when child
processes are spawned, and the `CREATE_PROCESS_LOCK` protects against
races in that section on Windows. But `File::try_clone` has been
creating inheritable file descriptors outside of that lock, which could
be leaking into other child processes unintentionally.

See also https://github.com/rust-lang/rust/pull/31069#discussion_r334117665.
2019-10-17 13:46:04 +02:00
Mazdak Farrokhzad
0059411cae
Rollup merge of #65237 - KodrAus:fix/map-entry-err, r=sfackler
Move debug_map assertions after check for err

Fixes #65231

We have some assertions in `DebugMap` to catch broken implementations of `Debug` that produce malformed entries. These checks don't make sense if formatting fails partway through. This PR moves those assertions to within the `and_then` closures along with the other formatting logic, so they're only checked if the map hasn't failed to format an entry already.
2019-10-17 13:46:03 +02:00
Oliver Scherer
bb5a652361 Rebase fallout 2019-10-17 13:28:14 +02:00
bors
ea45150837 Auto merge of #59953 - eddyb:soa-metadata, r=michaelwoerister
rustc_metadata: replace Entry table with one table for each of its fields (AoS -> SoA).

In https://github.com/rust-lang/rust/pull/59789#issuecomment-481958212 I noticed that for many cross-crate queries (e.g. `predicates_of(def_id)`), we were deserializing the `rustc_metadata::schema::Entry` for `def_id` *only* to read one field (i.e. `predicates`).

But there are several such queries, and `Entry` is not particularly small (in terms of number of fields, the encoding itself is quite compact), so there is a large (and unnecessary) constant factor.

This PR replaces the (random-access) array¹ of `Entry` structures ("AoS"), with many separate arrays¹, one for each field that used to be in `Entry` ("SoA"), resulting in the ability to read individual fields separately, with negligible time overhead (in thoery), and some size overhead (as these arrays are not sparse).

In a way, the new approach is closer to incremental on-disk caches, which store each query's cached results separately, but it would take significantly more work to unify the two.

For stage1 `libcore`'s metadata blob, the size overhead is `8.44%`, and I have another commit (~~not initially included because I want to do perf runs with both~~ **EDIT**: added it now) that brings it down to `5.88%`.

¹(in the source, these arrays are called "tables", but perhaps they could use a better name)
2019-10-17 10:45:09 +00:00
Mateusz Mikuła
6de4924b6c Update emscripten functions declarations 2019-10-17 12:09:11 +02:00
Guillaume Gomez
21d9258909 Update ui tests 2019-10-17 11:30:42 +02:00
Guillaume Gomez
d1db077e06 Add long error explanation for E0575 2019-10-17 11:30:41 +02:00
Guanqun Lu
c716be6874 show up some extra info when t!() fails 2019-10-17 17:01:49 +08:00
bors
a16dca337d Auto merge of #65251 - tlively:emscripten-upstream-upgrade, r=tlively
Upgrade Emscripten targets to use upstream LLVM backend

 - Compatible with Emscripten 1.38.46-upstream or later upstream.
 - Refactors the Emscripten target spec to share code with other wasm
   targets.
 - Replaces the old incorrect wasm32 C call ABI with the correct one,
   preserving the old one as wasm32_bindgen_compat for wasm-bindgen
   compatibility.
 - Updates the varargs ABI used by Emscripten and deletes the old one.
 - Removes the obsolete wasm32-experimental-emscripten target.
 - Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649.

r? @alexcrichton
2019-10-17 06:47:18 +00:00
Thomas Lively
c0aa7cb2b5 Remove PR runs, enable wasm32 CI, and move asmjs to disabled 2019-10-16 21:18:34 -07:00
John Kåre Alsaker
42c0236ed0 Use a sharded dep node to dep node index map 2019-10-17 04:58:10 +02:00
Ben Boeckel
fb6d5e6b1f doc: fix typo in OsStrExt and OsStringExt 2019-10-16 22:22:19 -04:00
bors
7e498005a1 Auto merge of #65234 - GuillaumeGomez:long-err-explanation-E0573, r=kinnison
Add long error explanation for E0573

Part of #61137.
2019-10-17 02:04:49 +00:00
Dylan MacKenzie
af691de9c1 Suppress validation mismatch ICE in the presence of mut borrows 2019-10-16 18:01:26 -07:00
Dylan MacKenzie
22a0856641 Enable drain_filter 2019-10-16 18:01:01 -07:00