]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoGet `FnSig` by `HirId`
Dylan MacKenzie [Wed, 6 Nov 2019 19:43:33 +0000 (11:43 -0800)]
Get `FnSig` by `HirId`

4 years agoAdd E0744 for control flow in consts
Dylan MacKenzie [Wed, 6 Nov 2019 19:41:27 +0000 (11:41 -0800)]
Add E0744 for control flow in consts

4 years agocompiletest: Avoid double negation in ignore condition
Tomasz Miąsko [Wed, 13 Nov 2019 00:00:00 +0000 (00:00 +0000)]
compiletest: Avoid double negation in ignore condition

4 years agocompiletest: Obtain timestamps for common inputs only once
Tomasz Miąsko [Mon, 11 Nov 2019 00:00:00 +0000 (00:00 +0000)]
compiletest: Obtain timestamps for common inputs only once

Obtain timestamps for common inputs (e.g., libraries in run-lib path, or
sources in `src/tool/compiletest/`) only once and reuse the result,
instead of repeating the work for each test case.

No functional changes intended.

4 years agoRevert "Auto merge of #65134 - davidtwco:issue-19834-improper-ctypes-in-extern-C...
Robin Kruppe [Wed, 13 Nov 2019 16:00:47 +0000 (17:00 +0100)]
Revert "Auto merge of #65134 - davidtwco:issue-19834-improper-ctypes-in-extern-C-fn, r=rkruppe"

This reverts commit 3f0e16473de5ec010f44290a8c3ea1d90e0ad7a2, reversing
changes made to 61a551b4939ec1d5596e585351038b8fbd0124ba.

4 years agoAvoid using same code
Yuki Okushi [Wed, 13 Nov 2019 14:22:48 +0000 (23:22 +0900)]
Avoid using same code

4 years agoFix broken links in Ipv4Addr::is_benchmarking docs
Benjamin Sago [Wed, 13 Nov 2019 15:09:40 +0000 (15:09 +0000)]
Fix broken links in Ipv4Addr::is_benchmarking docs

4 years agoAuto merge of #66366 - JohnTitor:rollup-xlc1bj2, r=JohnTitor
bors [Wed, 13 Nov 2019 13:16:53 +0000 (13:16 +0000)]
Auto merge of #66366 - JohnTitor:rollup-xlc1bj2, r=JohnTitor

Rollup of 14 pull requests

Successful merges:

 - #65932 (download .tar.xz if python3 is used)
 - #66094 (Fix documentation for `Iterator::count()`.)
 - #66166 (rename cfg(rustdoc) into cfg(doc))
 - #66186 (Add long error explanation for E0623)
 - #66227 (docs: Fix link to BufWriter::flush)
 - #66248 (add raw ptr variant of UnsafeCell::get)
 - #66292 (add Result::map_or)
 - #66297 (Add a callback that allows compiler consumers to override queries.)
 - #66317 (Use a relative bindir for rustdoc to find rustc)
 - #66330 (Improve non-exhaustiveness handling in usefulness checking)
 - #66331 (Add some tests for fixed ICEs)
 - #66334 (Move Session fields to CrateStore)
 - #66335 (Move self-profile infrastructure to data structures)
 - #66337 (Remove dead code for encoding/decoding lint IDs)

Failed merges:

r? @ghost

4 years agoRollup merge of #66337 - Mark-Simulacrum:no-decode-lint-id, r=Dylan-DPC
Yuki Okushi [Wed, 13 Nov 2019 13:09:31 +0000 (22:09 +0900)]
Rollup merge of #66337 - Mark-Simulacrum:no-decode-lint-id, r=Dylan-DPC

Remove dead code for encoding/decoding lint IDs

This helps decouple the lint system from needing the implicit TLS TyCtxt
as well.

4 years agoRollup merge of #66335 - Mark-Simulacrum:self-profile-to-data, r=michaelwoerister
Yuki Okushi [Wed, 13 Nov 2019 13:09:29 +0000 (22:09 +0900)]
Rollup merge of #66335 - Mark-Simulacrum:self-profile-to-data, r=michaelwoerister

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).

This is intended as a precursor to moving Session out of librustc, but since that involves lots of smaller steps that move around code I'm splitting it up into separate PRs.

4 years agoRollup merge of #66334 - Mark-Simulacrum:sess-cstore, r=petrochenkov
Yuki Okushi [Wed, 13 Nov 2019 13:09:28 +0000 (22:09 +0900)]
Rollup merge of #66334 - Mark-Simulacrum:sess-cstore, r=petrochenkov

Move Session fields to CrateStore

`allocator_kind` and `injected_panic_runtime` are both query-like, this moves them out of Session and into CrateStore, avoiding the `Once` they previously had by clearing separating initialization and de-initialization.

4 years agoRollup merge of #66331 - JohnTitor:add-tests, r=Centril
Yuki Okushi [Wed, 13 Nov 2019 13:09:26 +0000 (22:09 +0900)]
Rollup merge of #66331 - JohnTitor:add-tests, r=Centril

Add some tests for fixed ICEs

Closes #30904 (fixed between nightly-2019-07-14 and nightly-2019-07-31)
Closes #40231 (example 1 is fixed in 1.32.0, example 2 is fixed in 1.38.0)
Closes #52432 (fixed in rustc 1.40.0-beta.1 (76b40532a 2019-11-05))
Closes #63279 (fixed in rustc 1.40.0-nightly (246be7e1a 2019-10-25))

r? @Centril

4 years agoRollup merge of #66330 - Nadrieril:nonexhaustive-constructor, r=varkor
Yuki Okushi [Wed, 13 Nov 2019 13:09:25 +0000 (22:09 +0900)]
Rollup merge of #66330 - Nadrieril:nonexhaustive-constructor, r=varkor

Improve non-exhaustiveness handling in usefulness checking

The comments around code paths for the `non_exhaustive` feature mention stuff like "we act as if the type had an extra unmatcheable constructor". So I thought I'd make this explicit by defining a special constructor that does exactly this.
This makes those code paths a bit more legible and less prone to error.

4 years agoRollup merge of #66317 - cuviper:bindir_relative, r=Mark-Simulacrum
Yuki Okushi [Wed, 13 Nov 2019 13:09:23 +0000 (22:09 +0900)]
Rollup merge of #66317 - cuviper:bindir_relative, r=Mark-Simulacrum

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.

r? @Mark-Simulacrum

4 years agoRollup merge of #66297 - vakaras:edit-queries, r=oli-obk
Yuki Okushi [Wed, 13 Nov 2019 13:09:22 +0000 (22:09 +0900)]
Rollup merge of #66297 - vakaras:edit-queries, r=oli-obk

Add a callback that allows compiler consumers to override queries.

This pull request adds an additional callback that allows compiler consumers such as Prusti and MIRAI to override queries. My hope is that in this way it will be possible to get access to the internal compiler information (e.g. borrow checker) without major changes to the compiler.

This pull request is work in progress because I am still testing if I can get the information which I need.

cc @nikomatsakis

r? @oli-obk

4 years agoRollup merge of #66292 - lzutao:result-map_or, r=SimonSapin
Yuki Okushi [Wed, 13 Nov 2019 13:09:20 +0000 (22:09 +0900)]
Rollup merge of #66292 - lzutao:result-map_or, r=SimonSapin

add Result::map_or

This PR adds this API to make it consistent with `Option::map_or`.

```rust
impl<T, E> Result<T, E> {
    pub fn map_or<U, F: FnOnce(T) -> U>(self, default: U, f: F) -> U {
        match self {
            Ok(t) => f(t),
            Err(_) => default,
        }
    }
}
```

This API is very small. We already has a similar API for `Option::map_or`.

4 years agoRollup merge of #66248 - RalfJung:unsafe_cell_raw_get, r=SimonSapin
Yuki Okushi [Wed, 13 Nov 2019 13:09:19 +0000 (22:09 +0900)]
Rollup merge of #66248 - RalfJung:unsafe_cell_raw_get, r=SimonSapin

add raw ptr variant of UnsafeCell::get

This has come up recently in https://github.com/rust-lang/rust/pull/66051 (Cc @Centril @pitdicker) as well as in discussion with @nikomatsakis and in unrelated discussion with @withoutboats.

4 years agoRollup merge of #66227 - bryanburgers:bufwriter-docs-fix-flush-link, r=Dylan-DPC
Yuki Okushi [Wed, 13 Nov 2019 13:09:17 +0000 (22:09 +0900)]
Rollup merge of #66227 - bryanburgers:bufwriter-docs-fix-flush-link, r=Dylan-DPC

docs: Fix link to BufWriter::flush

One of the links in the docs was being rendered as a literal
open-bracket followed by a single quote, instead of being transformed
into a link. Fix it to match the link earlier in the same paragraph.

4 years agoRollup merge of #66186 - GuillaumeGomez:long-err-explanation-E0623, r=Dylan-DPC
Yuki Okushi [Wed, 13 Nov 2019 13:09:15 +0000 (22:09 +0900)]
Rollup merge of #66186 - GuillaumeGomez:long-err-explanation-E0623, r=Dylan-DPC

Add long error explanation for E0623

Part of #61137.

r? @Dylan-DPC

4 years agoRollup merge of #66166 - GuillaumeGomez:rename-rustdoc-to-doc, r=QuietMisdreavus
Yuki Okushi [Wed, 13 Nov 2019 13:09:13 +0000 (22:09 +0900)]
Rollup merge of #66166 - GuillaumeGomez:rename-rustdoc-to-doc, r=QuietMisdreavus

rename cfg(rustdoc) into cfg(doc)

Needed by https://github.com/rust-lang/rust/pull/61351

r? @QuietMisdreavus

4 years agoRollup merge of #66094 - ArturKovacs:fix-count-doc, r=Dylan-DPC
Yuki Okushi [Wed, 13 Nov 2019 13:09:11 +0000 (22:09 +0900)]
Rollup merge of #66094 - ArturKovacs:fix-count-doc, r=Dylan-DPC

Fix documentation for `Iterator::count()`.

The documentation of std::core::Iterator::count() stated that the number returned is the number of times `next` is called on the iterator. However this is not true as the number of times `next` is called is exactly one plus the number returned by `count()`.

4 years agoRollup merge of #65932 - guanqun:download-xz, r=alexcrichton
Yuki Okushi [Wed, 13 Nov 2019 13:09:10 +0000 (22:09 +0900)]
Rollup merge of #65932 - guanqun:download-xz, r=alexcrichton

download .tar.xz if python3 is used

fixes https://github.com/rust-lang/rust/issues/65757

4 years agoImprove error message in make_tests
Philip Munksgaard [Wed, 13 Nov 2019 11:44:43 +0000 (12:44 +0100)]
Improve error message in make_tests

We should use expect instead of unwrap.

This commit is based on https://github.com/laumann/compiletest-rs/pull/58. Thanks to @colin-kiegel.

4 years agoparser: don't use `unreachable!()` in `fn unexpected`.
Mazdak Farrokhzad [Wed, 13 Nov 2019 11:05:37 +0000 (12:05 +0100)]
parser: don't use `unreachable!()` in `fn unexpected`.

4 years agoDoc: Fix link to Exten in Vec::set_len
Elichai Turkel [Wed, 13 Nov 2019 10:53:24 +0000 (12:53 +0200)]
Doc: Fix link to Exten in Vec::set_len

4 years agomake things ugly
Ralf Jung [Wed, 13 Nov 2019 08:31:08 +0000 (09:31 +0100)]
make things ugly

4 years agoexpand docs
Ralf Jung [Wed, 13 Nov 2019 08:11:09 +0000 (09:11 +0100)]
expand docs

4 years agoclarify why we can do the ptr cast
Ralf Jung [Wed, 13 Nov 2019 08:07:52 +0000 (09:07 +0100)]
clarify why we can do the ptr cast

4 years agoTrailing full stop
Ralf Jung [Wed, 13 Nov 2019 08:05:57 +0000 (09:05 +0100)]
Trailing full stop

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
4 years agoAuto merge of #65637 - ssomers:master, r=scottmcm
bors [Wed, 13 Nov 2019 03:48:42 +0000 (03:48 +0000)]
Auto merge of #65637 - ssomers:master, r=scottmcm

proposal for BTreeMap/Set min/max, #62924

- Which pair of names: #62924 lists the existing possibilities min/max, first/last, (EDIT) front/back, peek(/peek_back?). Iterators have next/next_back or next/last. I'm slightly in favour of first/last because min/max might suggest they search over the entire map, and front/back pretends they are only about position.
- Return key only instead of pair like iterator does?
- If not, then keep the _key_value suffix? ~~Also provide variant with mutable value? But there is no such variant for get_key_value.~~
- Look for and upgrade more usages of `.iter().next()` and such in the libraries? I only upgraded the ones I contributed myself, all very recently.

4 years agotidy up!
Dylan DPC [Wed, 13 Nov 2019 01:16:01 +0000 (02:16 +0100)]
tidy up!

4 years agoUpdate error_codes.rs
Dylan DPC [Wed, 13 Nov 2019 00:50:12 +0000 (01:50 +0100)]
Update error_codes.rs

4 years agoUpdate error_codes.rs
Dylan DPC [Wed, 13 Nov 2019 00:47:25 +0000 (01:47 +0100)]
Update error_codes.rs

4 years agoAuto merge of #66156 - Mark-Simulacrum:stage0-step, r=pietroalbini
bors [Wed, 13 Nov 2019 00:42:19 +0000 (00:42 +0000)]
Auto merge of #66156 - Mark-Simulacrum:stage0-step, r=pietroalbini

Stage0 step

r? @pietroalbini

4 years agoTweak non-char/numeric in range pattern diagnostic
Yuki Okushi [Tue, 12 Nov 2019 23:27:53 +0000 (08:27 +0900)]
Tweak non-char/numeric in range pattern diagnostic

4 years agoexpand source_util macros with def-site context
Andy Russell [Tue, 12 Nov 2019 22:48:33 +0000 (17:48 -0500)]
expand source_util macros with def-site context

4 years agoRemove no longer needed mutability
Mark Rousskov [Tue, 12 Nov 2019 21:37:22 +0000 (16:37 -0500)]
Remove no longer needed mutability

4 years agoCompiletest bump to stage0 bootstrap libtest
Mark Rousskov [Wed, 6 Nov 2019 20:17:02 +0000 (15:17 -0500)]
Compiletest bump to stage0 bootstrap libtest

4 years agoHopefully fix rustdoc build
Mark Rousskov [Tue, 5 Nov 2019 16:16:46 +0000 (11:16 -0500)]
Hopefully fix rustdoc build

It's super unclear why this broke when we switched to beta but not
previously -- but at least it's hopefully fixed now.

4 years agoSnap cfgs
Mark Rousskov [Wed, 6 Nov 2019 13:09:55 +0000 (08:09 -0500)]
Snap cfgs

4 years agoBump version to 1.41
Mark Rousskov [Wed, 6 Nov 2019 13:01:56 +0000 (08:01 -0500)]
Bump version to 1.41

4 years agoAuto merge of #60026 - Aaron1011:feature/miri-unwind, r=RalfJung,oli-obk
bors [Tue, 12 Nov 2019 21:27:04 +0000 (21:27 +0000)]
Auto merge of #60026 - Aaron1011:feature/miri-unwind, r=RalfJung,oli-obk

Add hooks for Miri panic unwinding

This commits adds in some additional hooks to allow Miri to properly
handle panic unwinding. None of this should have any impact on CTFE mode

This supports https://github.com/rust-lang/miri/pull/693

4 years agoBless mir-dump test.
Camille GILLOT [Tue, 12 Nov 2019 21:02:55 +0000 (22:02 +0100)]
Bless mir-dump test.

4 years agoBless symbol-names.
Camille GILLOT [Tue, 12 Nov 2019 19:09:31 +0000 (20:09 +0100)]
Bless symbol-names.

4 years agoCentril review.
Camille GILLOT [Sat, 9 Nov 2019 10:43:32 +0000 (11:43 +0100)]
Centril review.

4 years agoFix tidy.
Camille GILLOT [Sat, 9 Nov 2019 10:30:51 +0000 (11:30 +0100)]
Fix tidy.

4 years agoRemove cruft.
Camille GILLOT [Fri, 8 Nov 2019 23:06:37 +0000 (00:06 +0100)]
Remove cruft.

4 years agoRename in librustdoc.
Camille GILLOT [Fri, 8 Nov 2019 22:19:55 +0000 (23:19 +0100)]
Rename in librustdoc.

4 years agoRename in librustc_codegen_llvm.
Camille GILLOT [Fri, 8 Nov 2019 22:19:46 +0000 (23:19 +0100)]
Rename in librustc_codegen_llvm.

4 years agoRename in librustc_codegen_ssa.
Camille GILLOT [Fri, 8 Nov 2019 22:12:26 +0000 (23:12 +0100)]
Rename in librustc_codegen_ssa.

4 years agoRename in librustc_codegen_utils.
Camille GILLOT [Fri, 8 Nov 2019 22:12:17 +0000 (23:12 +0100)]
Rename in librustc_codegen_utils.

4 years agoRename in librustc_mir.
Camille GILLOT [Fri, 8 Nov 2019 22:11:51 +0000 (23:11 +0100)]
Rename in librustc_mir.

4 years agoRename in librustc_typecheck.
Camille GILLOT [Fri, 8 Nov 2019 22:11:43 +0000 (23:11 +0100)]
Rename in librustc_typecheck.

4 years agoRename in librustc_traits.
Camille GILLOT [Fri, 8 Nov 2019 22:11:31 +0000 (23:11 +0100)]
Rename in librustc_traits.

4 years agoRefactor pretty_print_const.
Camille GILLOT [Fri, 8 Nov 2019 20:55:19 +0000 (21:55 +0100)]
Refactor pretty_print_const.

4 years agoCreate intermediate enum ty::ConstKind.
Camille GILLOT [Fri, 8 Nov 2019 20:32:56 +0000 (21:32 +0100)]
Create intermediate enum ty::ConstKind.

4 years agoFix mdbook-linkcheck license checks.
Eric Huss [Tue, 12 Nov 2019 18:45:33 +0000 (10:45 -0800)]
Fix mdbook-linkcheck license checks.

4 years agoUpdate mdbook.
Eric Huss [Tue, 12 Nov 2019 18:14:48 +0000 (10:14 -0800)]
Update mdbook.

4 years agoRegister queries with self profiler in rustc_interface
Mark Rousskov [Tue, 12 Nov 2019 16:44:01 +0000 (11:44 -0500)]
Register queries with self profiler in rustc_interface

4 years agoRemove dead code for encoding/decoding lint IDs
Mark Rousskov [Tue, 12 Nov 2019 16:20:01 +0000 (11:20 -0500)]
Remove dead code for encoding/decoding lint IDs

This helps decouple the lint system from needing the implicit TLS TyCtxt
as well.

4 years agoAuto merge of #65608 - matthewjasper:mir-eval-order, r=pnkfelix
bors [Tue, 12 Nov 2019 18:02:54 +0000 (18:02 +0000)]
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

4 years agoMove self-profile infrastructure to data structures
Mark Rousskov [Mon, 11 Nov 2019 22:15:36 +0000 (17:15 -0500)]
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).

4 years agoFallback to the unmodified path in bindir_relative
Josh Stone [Tue, 12 Nov 2019 17:42:46 +0000 (09:42 -0800)]
Fallback to the unmodified path in bindir_relative

4 years agoAdd test for issue-63279
Yuki Okushi [Tue, 12 Nov 2019 15:37:00 +0000 (00:37 +0900)]
Add test for issue-63279

4 years agoAdd test for issue-52432
Yuki Okushi [Tue, 12 Nov 2019 15:36:38 +0000 (00:36 +0900)]
Add test for issue-52432

4 years agoAdd test for issue-40231
Yuki Okushi [Tue, 12 Nov 2019 15:36:20 +0000 (00:36 +0900)]
Add test for issue-40231

4 years agoAdd test for issue-30904
Yuki Okushi [Tue, 12 Nov 2019 15:35:57 +0000 (00:35 +0900)]
Add test for issue-30904

4 years agoMove NonExhaustive checks to the relevant match branches
Nadrieril [Tue, 12 Nov 2019 14:51:59 +0000 (14:51 +0000)]
Move NonExhaustive checks to the relevant match branches

4 years agoIntroduce Constructor::NonExhaustive
Nadrieril [Tue, 12 Nov 2019 12:44:00 +0000 (12:44 +0000)]
Introduce Constructor::NonExhaustive

It counts as an extra constructor for types that are not allowed to be
matched exhaustively.

4 years agoMatch constructor first in Constructor methods
Nadrieril [Tue, 12 Nov 2019 10:36:56 +0000 (10:36 +0000)]
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.

4 years agoAuto merge of #66318 - mati865:llvm-update, r=matthewjasper
bors [Tue, 12 Nov 2019 12:55:02 +0000 (12:55 +0000)]
Auto merge of #66318 - mati865:llvm-update, r=matthewjasper

Update LLVM submodule

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

4 years agocheck-consts remove cannot mutate statics in initializer of another static error
Santiago Pastorino [Tue, 12 Nov 2019 12:20:44 +0000 (13:20 +0100)]
check-consts remove cannot mutate statics in initializer of another static error

4 years agoqualify-const remove cannot mutate statics in initializer of another static error
Santiago Pastorino [Mon, 11 Nov 2019 18:11:24 +0000 (19:11 +0100)]
qualify-const remove cannot mutate statics in initializer of another static error

4 years agoUpdate llvm submodule
Mateusz Mikuła [Tue, 12 Nov 2019 10:02:17 +0000 (11:02 +0100)]
Update llvm submodule

4 years agoAuto merge of #66323 - JohnTitor:rollup-jl8xdk4, r=JohnTitor
bors [Tue, 12 Nov 2019 08:23:32 +0000 (08:23 +0000)]
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

4 years agoRollup merge of #66309 - petrochenkov:annoying, r=Mark-Simulacrum
Yuki Okushi [Tue, 12 Nov 2019 07:36:18 +0000 (16:36 +0900)]
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.

4 years agoRollup merge of #66299 - rossmacarthur:fix-41260-avoid-issue-0, r=varkor
Yuki Okushi [Tue, 12 Nov 2019 07:36:16 +0000 (16:36 +0900)]
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

4 years agoRollup merge of #66280 - stepancheg:union, r=alexcrichton
Yuki Okushi [Tue, 12 Nov 2019 07:36:15 +0000 (16:36 +0900)]
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 `>`.

4 years agoRollup merge of #66278 - LukasKalbertodt:fix-proc-macro-error, r=Centril
Yuki Okushi [Tue, 12 Nov 2019 07:36:13 +0000 (16:36 +0900)]
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.

4 years agoRollup merge of #66276 - Mark-Simulacrum:sess-code-stats, r=nikomatsakis
Yuki Okushi [Tue, 12 Nov 2019 07:36:12 +0000 (16:36 +0900)]
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.

4 years agoRollup merge of #66267 - GuillaumeGomez:add-rustdoc-doc, r=kinnison
Yuki Okushi [Tue, 12 Nov 2019 07:36:10 +0000 (16:36 +0900)]
Rollup merge of #66267 - GuillaumeGomez:add-rustdoc-doc, r=kinnison

Add rustdoc doc

r? @kinnison

4 years agoRollup merge of #66263 - guanqun:make-error-explicit, r=alexcrichton
Yuki Okushi [Tue, 12 Nov 2019 07:36:08 +0000 (16:36 +0900)]
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.

4 years agoRollup merge of #66257 - mati865:long-section-names-no-more, r=alexcrichton
Yuki Okushi [Tue, 12 Nov 2019 07:36:07 +0000 (16:36 +0900)]
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.

4 years agoRollup merge of #66241 - lzutao:ssl, r=alexcrichton
Yuki Okushi [Tue, 12 Nov 2019 07:36:05 +0000 (16:36 +0900)]
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.

4 years agoRollup merge of #66230 - Axelderan:remove-vestigial-comments, r=alexcrichton
Yuki Okushi [Tue, 12 Nov 2019 07:36:03 +0000 (16:36 +0900)]
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.

4 years agoRollup merge of #65965 - GuillaumeGomez:clean-up-librustc_typeck-error-codes, r=Mark...
Yuki Okushi [Tue, 12 Nov 2019 07:36:01 +0000 (16:36 +0900)]
Rollup merge of #65965 - GuillaumeGomez:clean-up-librustc_typeck-error-codes, r=Mark-Simulacrum

Clean up librustc_typeck error_codes file

r? @Dylan-DPC

4 years agoAuto merge of #66129 - Nadrieril:refactor-slice-pat-usefulness, r=varkor
bors [Tue, 12 Nov 2019 04:44:30 +0000 (04:44 +0000)]
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 https://github.com/rust-lang/rust/pull/66129/commits/149792b6080f40875c0072aae378a0eb31d23df0. This will probably have to be reverted in some way when we implement or-patterns.

4 years agoadd Result::map_or
Lzu Tao [Mon, 11 Nov 2019 13:25:19 +0000 (13:25 +0000)]
add Result::map_or

4 years agoAuto merge of #66310 - Manishearth:clippyup, r=Manishearth
bors [Mon, 11 Nov 2019 22:33:10 +0000 (22:33 +0000)]
Auto merge of #66310 - Manishearth:clippyup, r=Manishearth

Update clippy

Fixes #66300

r? @ghost

4 years agoUse a relative bindir for rustdoc to find rustc
Josh Stone [Mon, 11 Nov 2019 22:22:23 +0000 (14:22 -0800)]
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.

4 years agoEvaluate borrow and struct expressions in `into`
Matthew Jasper [Sat, 19 Oct 2019 20:01:36 +0000 (21:01 +0100)]
Evaluate borrow and struct expressions in `into`

This fixes some ordering problems around assignment expressions.

4 years agoFix soundness issue with index bounds checks
Matthew Jasper [Sat, 19 Oct 2019 20:00:21 +0000 (21:00 +0100)]
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.

4 years agoAvoid a string comparison in MIR construction
Matthew Jasper [Sun, 26 May 2019 09:00:34 +0000 (10:00 +0100)]
Avoid a string comparison in MIR construction

4 years agoUpdate
Aaron Hill [Sat, 9 Nov 2019 16:02:15 +0000 (11:02 -0500)]
Update

4 years agoReturn Ok(false) instead of throwing when handling a diverging intrinsic
Aaron Hill [Wed, 6 Nov 2019 19:13:57 +0000 (14:13 -0500)]
Return Ok(false) instead of throwing when handling a diverging intrinsic

4 years agoFix rebase fallout
Aaron Hill [Wed, 6 Nov 2019 18:47:40 +0000 (13:47 -0500)]
Fix rebase fallout

4 years agoRename to
Aaron Hill [Wed, 6 Nov 2019 18:20:08 +0000 (13:20 -0500)]
Rename  to

4 years agoFix debug assertion
Aaron Hill [Tue, 5 Nov 2019 05:22:49 +0000 (00:22 -0500)]
Fix debug assertion

4 years agoRemove trampoline, pass `ret` and `unwind` when handling intrinsics
Aaron Hill [Tue, 5 Nov 2019 05:06:05 +0000 (00:06 -0500)]
Remove trampoline, pass `ret` and `unwind` when handling intrinsics

4 years agoFix tidy
Aaron Hill [Mon, 4 Nov 2019 21:10:35 +0000 (16:10 -0500)]
Fix tidy