Commit graph

100164 commits

Author SHA1 Message Date
Simon Sapin
ca1cfdab78 Uninitialized boxes: check for zero-size allocation based on Layout::size 2019-10-16 20:32:58 +02:00
Simon Sapin
23d3ff1b97 Fix zero-size uninitialized boxes
Requesting a zero-size allocation is not allowed,
return a dangling pointer instead.

CC https://github.com/rust-lang/rust/issues/63291#issuecomment-538692745
2019-10-06 23:48:55 +02:00
bors
421bd77f42 Auto merge of #64564 - jonas-schievink:cowardly-default, r=nikomatsakis
Deny specializing items not in the parent impl

Part of https://github.com/rust-lang/rust/issues/29661 (https://github.com/rust-lang/rfcs/pull/2532). At least sort of?

This was discussed in https://github.com/rust-lang/rust/pull/61812#discussion_r300504114 and is needed for that PR to make progress (fixing an unsoundness).

One annoyance with doing this is that it sometimes requires users to copy-paste a provided trait method into an impl just to mark it `default` (ie. there is no syntax to forward this impl method to the provided trait method).

cc @Centril and @arielb1
2019-10-06 16:32:46 +00:00
bors
9203ee7b56 Auto merge of #65089 - nnethercote:optimize-integral-pattern-matching, r=Mark-Simulacrum
Optimize integral pattern matching

Various improvements to integral pattern matching. Together they reduce instruction counts for `unicode_normalization-check-clean` by about 16%.

r? @Mark-Simulacrum
2019-10-06 12:50:47 +00:00
bors
0358617e3f Auto merge of #65043 - Aaron1011:fix/reexport-determinism, r=petrochenkov
Make re-export collection deterministic

Fixes https://github.com/rust-lang/rust/issues/65036

Previously, we were using an `FxHashMap` to collect module re-exports.
However, re-exports end up getting serialized into crate metadata, which
means that metadata generation was non-deterministic. This resulted in
spurious error messages changes (e.g. PR #64906) due to pretty-printing
implicitly depending on the order of re-exports when computing the
proper path to show to the user.

See #65042 for a long-term strategy to detect this kind of issue
2019-10-06 08:40:43 +00:00
bors
5a8fb7c24d Auto merge of #65152 - tmandry:rollup-btn4a01, r=tmandry
Rollup of 18 pull requests

This contains changes from all the successful runs that bors marked as timed out, plus a revert of #63649 which appears to be the immediate cause of the timeouts.

Successful merges:

 - #64708 (Stabilize `Option::as_deref` and `Option::as_deref_mut`)
 - #64728 (Stabilize UdpSocket::peer_addr)
 - #64765 (std: Reduce checks for `feature = "backtrace"`)
 - #64909 (When encountering chained operators use heuristics to recover from bad turbofish)
 - #65011 (Do not ICE when dereferencing non-Copy raw pointer)
 - #65064 (permit asyncawait-ondeck to be added by anyone)
 - #65066 ([const-prop] Fix ICE when trying to eval polymorphic promoted MIR)
 - #65100 (Replace GeneratorSubsts with SubstsRef)
 - #65105 (Split out some passes from librustc)
 - #65106 (Allow unused attributes to avoid incremental bug)
 - #65113 (Fix lonely backtick)
 - #65116 (Remove unneeded visit_statement definition)
 - #65118 (Update the documented default of -Z mutable-noalias)
 - #65123 (Account for macro invocation in `let mut $pat` diagnostic.)
 - #65124 (Replace some instances of `as *[const | mut] _` with `.cast()`)
 - #65126 (Fix typo on `now()` comments)
 - #65130 (lint: extern non-exhaustive types are improper)
 - #65151 (Revert #63649 - "Upgrade Emscripten targets to use upstream LLVM backend")

Failed merges:

r? @ghost
2019-10-06 04:59:16 +00:00
Tyler Mandry
69598dc3cf
Rollup merge of #65151 - tmandry:revert-emscripten-upgrade, r=tmandry
Revert #63649 - "Upgrade Emscripten targets to use upstream LLVM backend"

This change caused the runtime of the linux-asmjs builder to nearly double from 2+ hours to about 4 hours, which happens to be the bors timeout. (It made it in barely under 4 hours when it was merged.) This is causing timeouts on all new changes.

This reverts commit 7870050796, reversing
changes made to 2e7244807a.
2019-10-05 21:55:13 -07:00
Tyler Mandry
485f5c953d
Rollup merge of #65130 - davidtwco:rfc-2008-improper-ctypes, r=petrochenkov
lint: extern non-exhaustive types are improper

This PR makes the `improper_ctype` lint trigger for non-exhaustive types when those types aren't defined in the current crate, as per [this comment](https://github.com/rust-lang/rust/issues/44109#issuecomment-537583344).

cc @Centril
2019-10-05 21:55:11 -07:00
Tyler Mandry
d54082e5ad
Rollup merge of #65126 - BO41:time_typo, r=kennytm
Fix typo on `now()` comments

Fix typo, update words, and remove some redundant word.
Also rustfmt on the rest of the file (hope this is okay :)

revival of #61433

r? @kennytm
2019-10-05 21:55:10 -07:00
Tyler Mandry
42caed9bac
Rollup merge of #65124 - memoryruins:castaway, r=petrochenkov
Replace some instances of `as *[const | mut] _` with `.cast()`

While in `codegen_llvm`, noticed some places for the recent `pointer::cast` method.
2019-10-05 21:55:08 -07:00
Tyler Mandry
f5c8e12a7e
Rollup merge of #65123 - Centril:mac-invoc-in-mut-pat, r=estebank
Account for macro invocation in `let mut $pat` diagnostic.

Fixes https://github.com/rust-lang/rust/issues/65122.

r? @estebank
2019-10-05 21:55:07 -07:00
Tyler Mandry
a1eac17e70
Rollup merge of #65118 - cuviper:Zmutable-noalias-default, r=rkruppe
Update the documented default of -Z mutable-noalias

It has been fully disabled by default since #54639.
2019-10-05 21:55:06 -07:00
Tyler Mandry
2f4b47189d
Rollup merge of #65116 - spastorino:remove-unneeded-fn, r=oli-obk
Remove unneeded visit_statement definition

r? @oli-obk
2019-10-05 21:55:04 -07:00
Tyler Mandry
1ac1407fc6
Rollup merge of #65113 - Qwaz:master, r=jonas-schievink
Fix lonely backtick

That backtick won't be sad anymore
2019-10-05 21:55:03 -07:00
Tyler Mandry
f80656cf7c
Rollup merge of #65106 - Mark-Simulacrum:unused-attr-allow, r=Centril
Allow unused attributes to avoid incremental bug

cc #65023

This isn't labeled as fixing that issue because it's not really a fix, just a patch.
2019-10-05 21:55:01 -07:00
Tyler Mandry
2c8cbcca54
Rollup merge of #65105 - Mark-Simulacrum:split-librustc, r=nikomatsakis
Split out some passes from librustc

This is just moving them out to librustc_passes -- I've not measured compile time or run time. I don't expect any significant impact, but this seems prudent regardless.
2019-10-05 21:55:00 -07:00
Tyler Mandry
7739f173eb
Rollup merge of #65100 - csmoe:generator, r=nikomatsakis
Replace GeneratorSubsts with SubstsRef

Closes #42340
r? @nikomatsakis
2019-10-05 21:54:59 -07:00
Tyler Mandry
f14d374d3b
Rollup merge of #65066 - wesleywiser:fix_const_prop_ice_on_polymorphic_promoted_mir, r=oli-obk
[const-prop] Fix ICE when trying to eval polymorphic promoted MIR

Fixes #64908

r? @oli-obk
cc @nikomatsakis @pnkfelix
2019-10-05 21:54:57 -07:00
Tyler Mandry
df471c1176
Rollup merge of #65064 - rust-lang:permit-asyncawait-ondeck-by-anyone, r=nikomatsakis
permit asyncawait-ondeck to be added by anyone

Still debating if this is the right approach

but r? @pietroalbini to check the format
2019-10-05 21:54:56 -07:00
Tyler Mandry
2b225bab13
Rollup merge of #65011 - estebank:ice-o-matic, r=zackmdavis
Do not ICE when dereferencing non-Copy raw pointer

CC #52262. Confirmed to remove the unnecessary ICE, but without a repro case.
2019-10-05 21:54:54 -07:00
Tyler Mandry
c7d7e3730a
Rollup merge of #64909 - estebank:turbofish-reloaded, r=Centril
When encountering chained operators use heuristics to recover from bad turbofish
2019-10-05 21:54:52 -07:00
Tyler Mandry
ae2a720e92
Rollup merge of #64765 - alexcrichton:less-check-backtrace, r=sfackler
std: Reduce checks for `feature = "backtrace"`

This is a stylistic change to libstd to reduce the number of checks of
`feature = "backtrace"` now that we unconditionally depend on the
`backtrace` crate and rely on it having an empty implementation.
otherwise.
2019-10-05 21:54:51 -07:00
Tyler Mandry
019b5b5f96
Rollup merge of #64728 - messense:udp-peer-addr, r=dtolnay
Stabilize UdpSocket::peer_addr

Fixes #59127
2019-10-05 21:54:49 -07:00
Tyler Mandry
008526340a
Rollup merge of #64708 - SimonSapin:option-deref, r=Centril
Stabilize `Option::as_deref` and `Option::as_deref_mut`

The tracking issue https://github.com/rust-lang/rust/issues/50264 still has unresolved question for the corresponding `Result` methods.
2019-10-05 21:54:47 -07:00
Tyler Mandry
d16b7f705b Revert "Auto merge of #63649 - tlively:emscripten-upstream-upgrade, r=alexcrichton"
This reverts commit 7870050796, reversing
changes made to 2e7244807a.
2019-10-05 21:38:45 -07:00
Aaron Hill
add0a42034
Remove for_each_child_stable
Now that `Resolutions` has a deterministic iteration order, it's no
longer necessary to sort its entries before iterating over them
2019-10-05 16:34:38 -04:00
Aaron Hill
dd403e4ab0
Make re-export collection deterministic
Previously, we were using an `FxHashMap` to collect module re-exports.
However, re-exports end up getting serialized into crate metadata, which
means that metadata generation was non-deterministic. This resulted in
spurious error messages changes (e.g. PR #64906) due to pretty-printing
implicitly depending on the order of re-exports when computing the
proper path to show to the user.

See #65042 for a long-term strategy to detect this kind of issue
2019-10-05 15:57:48 -04:00
Jonas Schievink
47f89e7485 Rename the test 2019-10-05 15:33:26 +02:00
Jonas Schievink
33d23cdf04 Extend test and fix nits 2019-10-05 15:33:26 +02:00
Jonas Schievink
98f02b2362 Pacify tidy 2019-10-05 15:33:26 +02:00
Jonas Schievink
a0cf5315ef Test that we get the proper errors 2019-10-05 15:33:26 +02:00
Jonas Schievink
9aaef06cf6 Fix the bootstrap 2019-10-05 15:33:26 +02:00
Jonas Schievink
02f36e52a6 Hide the Iterator specialization behind a trait 2019-10-05 15:33:25 +02:00
Jonas Schievink
55277d4a6e Add comment to Type and OpaqueTy match 2019-10-05 15:33:25 +02:00
Jonas Schievink
2cd5030ef5 Deny specializing items not in the parent impl 2019-10-05 15:33:24 +02:00
David Wood
080aa86635
lint: extern non-exhaustive types are improper
This commit makes the `improper_ctype` lint trigger for non-exhaustive
types when those types aren't defined in the current crate.

Signed-off-by: David Wood <david@davidtw.co>
2019-10-05 14:06:51 +01:00
BO41
318ff305ea Fix typo on now() comments 2019-10-05 12:23:10 +02:00
memoryruins
173958ac80 Replaces some instances of as *[const | mut] _ with .cast() 2019-10-05 03:48:14 -04:00
Mazdak Farrokhzad
5f94a53d1a Account for macro invocation in let mut $pat diagnostic. 2019-10-05 04:34:26 +02:00
Josh Stone
8bb5c12c0b Update the documented default of -Z mutable-noalias
It has been fully disabled by default since #54639.
2019-10-04 16:53:18 -07:00
Santiago Pastorino
c5f80aa508
Remove unneeded visit_statement definition
visit_statement default definition does just this, there's no need to
redefine it.
2019-10-04 18:10:23 -03:00
bors
7870050796 Auto merge of #63649 - tlively:emscripten-upstream-upgrade, r=alexcrichton
Upgrade Emscripten targets to use upstream LLVM backend

 - Refactors the Emscripten target spec to share code with other wasm
   targets.
 - Replaces the incorrect wasm32 C call ABI with the old asmjs
   version, which is correct for both wasm32 and JS.
 - Updates the varargs ABI used by Emscripten and deletes the old one.
 - Removes the obsolete wasm32-experimental-emscripten target.
 - Temporarily makes Emscripten targets use panic=abort by default
   because supporting unwinding will require an LLVM patch.
2019-10-04 20:33:02 +00:00
Yechan Bae
d152d48727 Fix lonely backtick 2019-10-04 16:31:38 -04:00
Thomas Lively
4a4df29d6f Add ignore-asmjs to new test 2019-10-04 09:37:50 -07:00
Mark Rousskov
d0a6805b0e Allow unused attributes to avoid incremental bug 2019-10-04 11:11:58 -04:00
Mark Rousskov
7c3f65b3c4 middle::intrinsicck -> rustc_passes 2019-10-04 11:11:33 -04:00
Mark Rousskov
82bfd8eb0d middle::entry -> rustc_passes 2019-10-04 11:11:33 -04:00
Mark Rousskov
bb707824d0 middle::dead -> rustc_passes 2019-10-04 11:11:33 -04:00
Mark Rousskov
91a096a9b8 move middle::liveness to rustc_passes 2019-10-04 11:11:33 -04:00
Wesley Wiser
e9009c86d2 [const-prop] Fix ICE when trying to eval polymorphic promoted MIR 2019-10-04 10:23:03 -04:00