Commit Graph

102271 Commits

Author SHA1 Message Date
Mark Rousskov
8c29b74b15 Remove dead code for encoding/decoding lint IDs
This helps decouple the lint system from needing the implicit TLS TyCtxt
as well.
2019-11-12 13:04:31 -05:00
bors
4f03f4a989 Auto merge of #65608 - matthewjasper:mir-eval-order, r=pnkfelix
Fix MIR lowering evaluation order and soundness bug

* Fixes a soundness issue with built-in index operations
* Ensures correct evaluation order of assignment expressions where the RHS is a FRU or is a use of a local of reference type.
* Removes an unnecessary symbol to string conversion

closes #65909
closes #65910
2019-11-12 18:02:54 +00:00
Mark Rousskov
f696b21c5f Move self-profile infrastructure to data structures
The single dependency on queries (QueryName) can be fairly easily
abstracted via a trait and this further decouples Session from librustc
(the primary goal).
2019-11-12 12:48:04 -05:00
Josh Stone
bfa5e5f788 Fallback to the unmodified path in bindir_relative 2019-11-12 09:42:46 -08:00
Yuki Okushi
74d45afbf5 Add test for issue-63279 2019-11-13 00:37:00 +09:00
Yuki Okushi
412f0006f5 Add test for issue-52432 2019-11-13 00:36:38 +09:00
Yuki Okushi
bae9832f71 Add test for issue-40231 2019-11-13 00:36:20 +09:00
Yuki Okushi
ec45882b42 Add test for issue-30904 2019-11-13 00:35:57 +09:00
Nadrieril
e398d897b0 Move NonExhaustive checks to the relevant match branches 2019-11-12 15:02:00 +00:00
Nadrieril
357d53c4ce Introduce Constructor::NonExhaustive
It counts as an extra constructor for types that are not allowed to be
matched exhaustively.
2019-11-12 15:02:00 +00:00
Nadrieril
eb99c73e04 Match constructor first in Constructor methods
This makes it easier to add new non-standard constructors, and this also
ensures that we don't forget cases when adding a new constructor.
2019-11-12 15:02:00 +00:00
bors
5dda3ee931 Auto merge of #66318 - mati865:llvm-update, r=matthewjasper
Update LLVM submodule

Fixes https://github.com/rust-lang/rust/issues/66315
2019-11-12 12:55:02 +00:00
Mateusz Mikuła
5a1aa8def3 Update llvm submodule 2019-11-12 11:02:17 +01:00
bors
a19f93410d Auto merge of #66323 - JohnTitor:rollup-jl8xdk4, r=JohnTitor
Rollup of 11 pull requests

Successful merges:

 - #65965 (Clean up librustc_typeck error_codes file)
 - #66230 (remove vestigial comments referring to defunct numeric trait hierarchy)
 - #66241 (bump openssl version)
 - #66257 (Drop long-section-names linker workaround for windows-gnu)
 - #66263 (make the error message more readable)
 - #66267 (Add rustdoc doc)
 - #66276 (Move lock into CodeStats)
 - #66278 (Fix error message about exported symbols from proc-macro crates)
 - #66280 (Fix HashSet::union performance)
 - #66299 (support issue = "none" in unstable attributes )
 - #66309 (Tiny cleanup to size assertions)

Failed merges:

r? @ghost
2019-11-12 08:23:32 +00:00
Yuki Okushi
420f926306
Rollup merge of #66309 - petrochenkov:annoying, r=Mark-Simulacrum
Tiny cleanup to size assertions

The need to write `#[cfg(target_arch = "x86_64")]` twice mildly annoys me, the full paths look better in comparison.
2019-11-12 16:36:18 +09:00
Yuki Okushi
4134a4acf5
Rollup merge of #66299 - rossmacarthur:fix-41260-avoid-issue-0, r=varkor
support issue = "none" in unstable attributes

This works towards fixing #41260.

This PR allows the use of `issue = "none"` in unstable attributes and makes changes to internally store the issue number as an `Option<NonZeroU32>`. For example:

```rust
#[unstable(feature = "unstable_test_feature", issue = "none")]
fn unstable_issue_none() {}
```

It was not made optional because feedback seen here #60860 suggested that people might forget the issue field if it was optional.

I could not remove the current uses of `issue = "0"` (of which there are a lot) because the stage 0 compiler expects the old syntax. Once this is available in the stage 0 compiler we can replace all uses of `"0"` with `"none"` and no longer allow `"0"`. This is my first time contributing, so I'm not sure what the protocol is with two-part things like this, so some guidance would be appreciated.

r? @varkor
2019-11-12 16:36:16 +09:00
Yuki Okushi
6bdd1beca6
Rollup merge of #66280 - stepancheg:union, r=alexcrichton
Fix HashSet::union performance

Consider this example: small_set = 0..2, large_set = 0..1000.

To efficiently compute the union of these sets, we should
* take all elements of the larger set
* for each element of the smaller set check it is not in the larger set

This is exactly what this commit does.

This particular optimization was implemented a year ago, but the
author mistaken `<` and `>`.
2019-11-12 16:36:15 +09:00
Yuki Okushi
8e0265c268
Rollup merge of #66278 - LukasKalbertodt:fix-proc-macro-error, r=Centril
Fix error message about exported symbols from proc-macro crates

Someone forgot to update the error message after `#[proc_macro]` and
`#[proc_macro_attribute]` were stabilized.
2019-11-12 16:36:13 +09:00
Yuki Okushi
dfd11229b3
Rollup merge of #66276 - Mark-Simulacrum:sess-code-stats, r=nikomatsakis
Move lock into CodeStats

Prevent (theoretical) accidental too-long borrows by ensuring only encapsulated locking.
2019-11-12 16:36:12 +09:00
Yuki Okushi
cde5637394
Rollup merge of #66267 - GuillaumeGomez:add-rustdoc-doc, r=kinnison
Add rustdoc doc

r? @kinnison
2019-11-12 16:36:10 +09:00
Yuki Okushi
896484c71f
Rollup merge of #66263 - guanqun:make-error-explicit, r=alexcrichton
make the error message more readable

When I type it wrong e.g. `--stage --bless`, missing a number here, this change would make it more explicit what's going wrong here.
2019-11-12 16:36:08 +09:00
Yuki Okushi
7596d34ea1
Rollup merge of #66257 - mati865:long-section-names-no-more, r=alexcrichton
Drop long-section-names linker workaround for windows-gnu

If we can trust objdump Rust doesn't emit sections loaded at runtime longer than 8 characters on windows-gnu (but still does on linux-gnu), debug sections are not affected by that limit.
I've ran tests and built few crates using exactly the same mingw-w64 version as Rusts CI just fine using **x86_64** toolchain.

The motivation for this change is making LLD work (it doesn't support `--enable-long-section-names`) with this target without hacks.

Bit of history:
The behaviour of LD changed in Binutils 2.20 released on 2009-10-16 and `--enable-long-section-names` was added to return to the old non conformant behaviour. Looking at the comment I can only guess there was a bug fixed in newer versions.

This workaround was added in https://github.com/rust-lang/rust/pull/13315 half a decade ago.
2019-11-12 16:36:07 +09:00
Yuki Okushi
86df2f6737
Rollup merge of #66241 - lzutao:ssl, r=alexcrichton
bump openssl version

Fixes #65808

This PR updates `openssl` and `openssl-sys` to support newer versions of `libressl` in `rust` builds.
2019-11-12 16:36:05 +09:00
Yuki Okushi
e7d2fa4ca4
Rollup merge of #66230 - Axelderan:remove-vestigial-comments, r=alexcrichton
remove vestigial comments referring to defunct numeric trait hierarchy

I've been poking around the numeric trait hierarchy and also some of the actual numeric type implementations.

This is a small change but a matter of effective communication.  I looked for other related references and saw none.
2019-11-12 16:36:03 +09:00
Yuki Okushi
b850620d38
Rollup merge of #65965 - GuillaumeGomez:clean-up-librustc_typeck-error-codes, r=Mark-Simulacrum
Clean up librustc_typeck error_codes file

r? @Dylan-DPC
2019-11-12 16:36:01 +09:00
bors
e3d998492a Auto merge of #66129 - Nadrieril:refactor-slice-pat-usefulness, r=varkor
Refactor slice pattern usefulness checking

As a follow up to https://github.com/rust-lang/rust/pull/65874, this PR changes how variable-length slice patterns are handled in usefulness checking. The objectives are: cleaning up that code to make it easier to understand, and paving the way to handling fixed-length slices more cleverly too, for https://github.com/rust-lang/rust/issues/53820.

Before this, variable-length slice patterns were eagerly expanded into a union of fixed-length slices. Now they have their own special constructor, which allows expanding them a bit more lazily.
As a nice side-effect, this improves diagnostics.

This PR shows a slight performance improvement, mostly due to 149792b608. This will probably have to be reverted in some way when we implement or-patterns.
2019-11-12 04:44:30 +00:00
Lzu Tao
e8f3a9ffbe add Result::map_or 2019-11-12 03:22:04 +00:00
bors
e931f00f65 Auto merge of #66310 - Manishearth:clippyup, r=Manishearth
Update clippy

Fixes #66300

r? @ghost
2019-11-11 22:33:10 +00:00
Josh Stone
1aee3e4d08 Use a relative bindir for rustdoc to find rustc
In bootstrap, we set `RUSTC_INSTALL_BINDIR` to `config.bindir`, so
rustdoc can find rustc relative to the toolchain sysroot. However, if a
distro script like Fedora's `%configure` sets an absolute path, then
rustdoc's `sysroot.join(bin_path)` ignores that sysroot altogether.

That would be OK once the toolchain is actually installed, but it breaks
the in-tree doc tests during the build, since `/usr/bin/rustc` is still
the old version. So now we try to make `RUSTC_INSTALL_BINDIR` relative
to the sysroot prefix in the first place.
2019-11-11 14:22:23 -08:00
Matthew Jasper
4bf0685cca Evaluate borrow and struct expressions in into
This fixes some ordering problems around assignment expressions.
2019-11-11 22:06:54 +00:00
Matthew Jasper
7320818292 Fix soundness issue with index bounds checks
An expression like `x[1][{ x = y; 2}]` would perform the bounds check
for the inner index operation before evaluating the outer index. This
would allow out of bounds memory accesses.
2019-11-11 22:06:54 +00:00
Matthew Jasper
2ff89c5614 Avoid a string comparison in MIR construction 2019-11-11 21:47:39 +00:00
Aaron Hill
b4545a4ad6
Update 2019-11-11 15:14:38 -05:00
Aaron Hill
c0b972abfa
Return Ok(false) instead of throwing when handling a diverging intrinsic 2019-11-11 15:14:38 -05:00
Aaron Hill
68d9853985
Fix rebase fallout 2019-11-11 15:14:38 -05:00
Aaron Hill
2ed1e89706
Rename to 2019-11-11 15:14:38 -05:00
Aaron Hill
ee2dc4b728
Fix debug assertion 2019-11-11 15:14:38 -05:00
Aaron Hill
4ecb80d5d8
Remove trampoline, pass ret and unwind when handling intrinsics 2019-11-11 15:14:37 -05:00
Aaron Hill
607339f66a
Fix tidy 2019-11-11 15:14:37 -05:00
Aaron Hill
6eea0ffc65
Add more detailed codegen comment 2019-11-11 15:14:37 -05:00
Aaron Hill
23900770ab
Move to miri.rs and re-export it 2019-11-11 15:14:37 -05:00
Aaron Hill
72b555c160
Some code cleanup 2019-11-11 15:14:36 -05:00
Aaron Hill
c062afe73d
Make doc comment more accurate 2019-11-11 15:14:36 -05:00
Aaron Hill
dac30115dc
Change TODO to FIXME 2019-11-11 15:14:36 -05:00
Aaron Hill
d5c0acac4d
Add comment 2019-11-11 15:14:35 -05:00
Aaron Hill
b06c83c200
Add miri trampoline, fix handling of intrinsic return 2019-11-11 15:14:35 -05:00
Aaron Hill
5553476d49
Use proper intrinsic type 2019-11-11 15:14:35 -05:00
Aaron Hill
848e1d827e
More work on miri_start_panic 2019-11-11 15:14:35 -05:00
Aaron Hill
fe88fc03c5
Fix up intrinsic implementation 2019-11-11 15:14:34 -05:00
Aaron Hill
caf3cc1fc8
Add explicit Miri support to libpanic_unwind 2019-11-11 15:14:34 -05:00