]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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 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 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 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 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

4 years agoAdd more detailed codegen comment
Aaron Hill [Mon, 4 Nov 2019 21:10:02 +0000 (16:10 -0500)]
Add more detailed codegen comment

4 years agoMove to miri.rs and re-export it
Aaron Hill [Mon, 4 Nov 2019 20:34:19 +0000 (15:34 -0500)]
Move  to miri.rs and re-export it

4 years agoSome code cleanup
Aaron Hill [Mon, 4 Nov 2019 20:00:41 +0000 (15:00 -0500)]
Some code cleanup

4 years agoMake doc comment more accurate
Aaron Hill [Mon, 4 Nov 2019 18:49:50 +0000 (13:49 -0500)]
Make doc comment more accurate

4 years agoChange TODO to FIXME
Aaron Hill [Wed, 30 Oct 2019 18:40:21 +0000 (14:40 -0400)]
Change TODO to FIXME

4 years agoAdd comment
Aaron Hill [Wed, 30 Oct 2019 01:09:51 +0000 (21:09 -0400)]
Add comment

4 years agoAdd miri trampoline, fix handling of intrinsic return
Aaron Hill [Wed, 30 Oct 2019 01:03:30 +0000 (21:03 -0400)]
Add miri trampoline, fix handling of intrinsic return

4 years agoUse proper intrinsic type
Aaron Hill [Tue, 29 Oct 2019 22:48:29 +0000 (18:48 -0400)]
Use proper intrinsic type

4 years agoMore work on miri_start_panic
Aaron Hill [Tue, 29 Oct 2019 22:23:36 +0000 (18:23 -0400)]
More work on miri_start_panic

4 years agoFix up intrinsic implementation
Aaron Hill [Tue, 29 Oct 2019 21:31:54 +0000 (17:31 -0400)]
Fix up intrinsic implementation

4 years agoAdd explicit Miri support to libpanic_unwind
Aaron Hill [Tue, 29 Oct 2019 02:44:30 +0000 (22:44 -0400)]
Add explicit Miri support to libpanic_unwind

4 years agoDon't attempt to get cwd when printing backtrace under Miri
Aaron Hill [Tue, 29 Oct 2019 02:23:41 +0000 (22:23 -0400)]
Don't attempt to get cwd when printing backtrace under Miri

This allows Miri to print backtraces in isolation mode

4 years agoFix unwinding logic
Aaron Hill [Tue, 29 Oct 2019 01:37:58 +0000 (21:37 -0400)]
Fix unwinding logic

4 years agoSome cleanup
Aaron Hill [Mon, 28 Oct 2019 23:09:54 +0000 (19:09 -0400)]
Some cleanup

4 years agoAdd doc comment
Aaron Hill [Mon, 21 Oct 2019 01:40:38 +0000 (21:40 -0400)]
Add doc comment

4 years agoA few minor tweaks
Aaron Hill [Mon, 21 Oct 2019 01:31:43 +0000 (21:31 -0400)]
A few minor tweaks

4 years agoavoid the loop in unwinding stack popping
Ralf Jung [Sun, 20 Oct 2019 16:51:25 +0000 (18:51 +0200)]
avoid the loop in unwinding stack popping

4 years agoMore fixes for rustc changes
Aaron Hill [Wed, 9 Oct 2019 21:33:41 +0000 (17:33 -0400)]
More fixes for rustc changes

4 years agoRemove old intrinsic check
Aaron Hill [Thu, 26 Sep 2019 17:45:26 +0000 (13:45 -0400)]
Remove old intrinsic check

4 years agoFix incorrect unwrap of dest
Aaron Hill [Thu, 26 Sep 2019 17:11:56 +0000 (13:11 -0400)]
Fix incorrect unwrap of dest

4 years agoFormatting improvements
Aaron Hill [Thu, 19 Sep 2019 17:47:59 +0000 (13:47 -0400)]
Formatting improvements

Co-Authored-By: Oliver Scherer <github35764891676564198441@oli-obk.de>
4 years agoAdd hooks for Miri panic unwinding
Aaron Hill [Wed, 17 Apr 2019 01:04:54 +0000 (21:04 -0400)]
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

4 years agoUpdate clippy
Manish Goregaokar [Mon, 11 Nov 2019 19:41:10 +0000 (11:41 -0800)]
Update clippy

4 years agoTiny cleanup to size assertions
Vadim Petrochenkov [Mon, 11 Nov 2019 19:18:35 +0000 (22:18 +0300)]
Tiny cleanup to size assertions

4 years agoAuto merge of #65933 - crgl:vec-deque-truncate, r=alexcrichton
bors [Mon, 11 Nov 2019 19:20:54 +0000 (19:20 +0000)]
Auto merge of #65933 - crgl:vec-deque-truncate, r=alexcrichton

Use ptr::drop_in_place for VecDeque::truncate and VecDeque::clear

This commit allows `VecDeque::truncate` to take advantage of its (largely) contiguous memory layout and is consistent with the change in #64432 for `Vec`. As with the change to `Vec::truncate`, this changes both:

- the drop order, from back-to-front to front-to-back
- the behavior when dropping an element panics

For consistency, it also changes the behavior when dropping an element panics for `VecDeque::clear`.

These changes in behavior can be observed. This example ([playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=d0b1f2edc123437a2f704cbe8d93d828))
```rust
use std::collections::VecDeque;

fn main() {
    struct Bomb(usize);
    impl Drop for Bomb {
        fn drop(&mut self) {
            panic!(format!("{}", self.0));
        }
    }
    let mut v = VecDeque::from(vec![Bomb(0), Bomb(1)]);
    std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {
        v.truncate(0);
    }));
    std::mem::forget(v);
}
```
panics printing `1` today and succeeds. `v.clear()` panics printing `0` today and succeeds. With the change, `v.clear()`, `v.truncate(0)`, and dropping the `VecDeque` all panic printing `0` first and then abort with a double-panic printing `1`.

The motivation for this was making `VecDeque::truncate` more efficient since it was used in the implementation of `VecDeque::clone_from` (#65069), but it also makes behavior more consistent within the `VecDeque` and with `Vec` if that change is accepted (this probably doesn't make sense to merge if not).

This might need a crater run and an FCP as well.

4 years agosupport issue = "none" in unstable attributes
Ross MacArthur [Mon, 11 Nov 2019 17:33:30 +0000 (19:33 +0200)]
support issue = "none" in unstable attributes

- Use `Option<NonZeroU32>` to represent issue numbers.

4 years agoAuto merge of #66252 - cjgillot:trees, r=oli-obk
bors [Mon, 11 Nov 2019 14:05:43 +0000 (14:05 +0000)]
Auto merge of #66252 - cjgillot:trees, r=oli-obk

Merge repeated definitions

Step forward on #66149

I may need further context to understand the need for a separate crate.

Also, please tell me if you think of other definitions to merge.

4 years agoAuto merge of #66213 - tmiasko:mandatory-error-warn, r=petrochenkov
bors [Mon, 11 Nov 2019 09:40:33 +0000 (09:40 +0000)]
Auto merge of #66213 - tmiasko:mandatory-error-warn, r=petrochenkov

Make error and warning annotations mandatory in UI tests

This change makes error and warning annotations mandatory in UI tests.
The only exception are tests that use error patterns to match compiler
output and don't have any annotations.

Fixes #55596.

4 years agoFix error message about exported symbols from proc-macro crates
Lukas Kalbertodt [Sun, 10 Nov 2019 18:20:00 +0000 (19:20 +0100)]
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 agoAuto merge of #66207 - Manishearth:clippyup, r=Centril
bors [Mon, 11 Nov 2019 06:29:15 +0000 (06:29 +0000)]
Auto merge of #66207 - Manishearth:clippyup, r=Centril

Update clippy

Fixes #66150

r? @ghost

4 years agoUpdate clippy
Manish Goregaokar [Fri, 8 Nov 2019 03:15:13 +0000 (19:15 -0800)]
Update clippy

4 years agoAuto merge of #66250 - oli-obk:no_fields_in_empty_unions, r=eddyb
bors [Mon, 11 Nov 2019 02:52:49 +0000 (02:52 +0000)]
Auto merge of #66250 - oli-obk:no_fields_in_empty_unions, r=eddyb

Undo an assert causing an ICE until we fix the underlying problem

r? @eddyb

fixes #65462

4 years agoFix HashSet::union performance
Stepan Koltsov [Sun, 10 Nov 2019 23:47:23 +0000 (23:47 +0000)]
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 agoAdd rustdoc doc page for lints
Guillaume Gomez [Sun, 10 Nov 2019 11:13:26 +0000 (12:13 +0100)]
Add rustdoc doc page for lints

4 years agoAdd rustdoc doc page on how to write documentation
Guillaume Gomez [Sun, 10 Nov 2019 09:24:24 +0000 (10:24 +0100)]
Add rustdoc doc page on how to write documentation

4 years agoAuto merge of #66161 - mark-i-m:fix-rustc-guide, r=ehuss
bors [Sun, 10 Nov 2019 21:55:00 +0000 (21:55 +0000)]
Auto merge of #66161 - mark-i-m:fix-rustc-guide, r=ehuss

Update rustc-guide

r? @ehuss

fix #66144

4 years agoMake error and warning annotations mandatory in UI tests
Tomasz Miąsko [Wed, 6 Nov 2019 00:00:00 +0000 (00:00 +0000)]
Make error and warning annotations mandatory in UI tests

This change makes error and warning annotations mandatory in UI tests.
The only exception are tests that use error patterns to match compiler
output and don't have any annotations.

4 years agoAdd warning annotations to rustdoc-ui tests
Tomasz Miąsko [Fri, 8 Nov 2019 00:00:00 +0000 (00:00 +0000)]
Add warning annotations to rustdoc-ui tests

4 years agoAdd warning annotations to ignore-stage1 ui-fulldeps tests
Tomasz Miąsko [Fri, 8 Nov 2019 00:00:00 +0000 (00:00 +0000)]
Add warning annotations to ignore-stage1 ui-fulldeps tests

4 years agoMove lock into CodeStats
Mark Rousskov [Sun, 10 Nov 2019 16:48:47 +0000 (11:48 -0500)]
Move lock into CodeStats

Prevent accidental too-long borrows by ensuring only encapsulated
locking.

4 years agoAuto merge of #66070 - petrochenkov:regattr, r=matthewjasper
bors [Sun, 10 Nov 2019 15:53:35 +0000 (15:53 +0000)]
Auto merge of #66070 - petrochenkov:regattr, r=matthewjasper

Support registering inert attributes and attribute tools using crate-level attributes

And remove `#[feature(custom_attribute)]`.
(`rustc_plugin::Registry::register_attribute` is not removed yet, I'll do it in a follow up PR.)

```rust
#![register_attr(my_attr)]
#![register_tool(my_tool)]

#[my_attr] // OK
#[my_tool::anything] // OK
fn main() {}
```

---
Some tools (`rustfmt` and `clippy`) used in tool attributes are hardcoded in the compiler.
We need some way to introduce them without hardcoding as well.

This PR introduces a way to do it with a crate level attribute.
The previous attempt to introduce them through command line (https://github.com/rust-lang/rust/pull/57921) met some resistance.

This probably needs to go through an RFC before stabilization.
However, I'd prefer to land *this* PR without an RFC to able to remove `#[feature(custom_attribute)]` and `Registry::register_attribute` while also providing a replacement.

---
`register_attr` is a direct replacement for `#![feature(custom_attribute)]` (https://github.com/rust-lang/rust/issues/29642), except it doesn't rely on implicit fallback from unresolved attributes to custom attributes (which was always hacky and is the primary reason for the removal of `custom_attribute`) and requires registering the attribute explicitly.
It's not clear whether it should go through stabilization or not.
It's quite possible that all the uses should migrate to `#![register_tool]` (https://github.com/rust-lang/rust/issues/66079) instead.

---

Details:
- The naming is `register_attr`/`register_tool` rather than some `register_attributes` (plural, no abbreviation) for consistency with already existing attributes like `cfg_attr`, or `feature`, etc.
---
Previous attempt: https://github.com/rust-lang/rust/pull/57921
cc https://github.com/rust-lang/rust/issues/44690
Tracking issues: #66079 (`register_tool`), #66080 (`register_attr`)
Closes https://github.com/rust-lang/rust/issues/29642

4 years agoClean up librustc_typeck error_codes file
Guillaume Gomez [Wed, 30 Oct 2019 14:50:18 +0000 (15:50 +0100)]
Clean up librustc_typeck error_codes file

4 years agoAuto merge of #65324 - Centril:organize-syntax, r=petrochenkov
bors [Sun, 10 Nov 2019 12:18:53 +0000 (12:18 +0000)]
Auto merge of #65324 - Centril:organize-syntax, r=petrochenkov

Split libsyntax apart

In this PR the general idea is to separate the AST, parser, and friends by a more data / logic structure (tho not fully realized!) by separating out the parser and macro expansion code from libsyntax. Specifically have now three crates instead of one (libsyntax):

- libsyntax:

   - concrete syntax tree (`syntax::ast`)

   - definition of tokens and token-streams (`syntax::{token, tokenstream}`) -- used by `syntax::ast`

   - visitors (`syntax::visit`, `syntax::mut_visit`)

   - shared definitions between `libsyntax_expand`

   - feature gating (`syntax::feature_gate`) -- we could possibly move this out to its own crater later.

   - attribute and meta item utilities, including used-marking (`syntax::attr`)

   - pretty printer (`syntax::print`) -- this should possibly be moved out later. For now I've reduced down the dependencies to a single essential one which could be broken via `ParseSess`. This entails that e.g. `Debug` impls for `Path` cannot reference the pretty printer.

   - definition of `ParseSess` (`syntax::sess`) -- this is used by `syntax::{attr, print, feature_gate}` and is a common definition used by the parser and other things like librustc.

   - the `syntax::source_map` -- this includes definitions used by `syntax::ast` and other things but could ostensibly be moved `syntax_pos` since that is more related to this module.

   - a smattering of misc utilities not sufficiently important to itemize -- some of these could be moved to where they are used (often a single place) but I wanted to limit the scope of this PR.

- librustc_parse:

   - parser (`rustc_parse::parser`) -- reading a file and such are defined in the crate root tho.

   - lexer (`rustc_parse::lexer`)

   - validation of meta grammar (post-expansion) in (`rustc_parse::validate_attr`)

- libsyntax_expand -- this defines the infra for macro expansion and conditional compilation but this is not libsyntax_ext; we might want to merge them later but currently libsyntax_expand is depended on by librustc_metadata which libsyntax_ext is not.

   - conditional compilation (`syntax_expand::config`) -- moved from `syntax::config` to here

   - the bulk of this crate is made up of the old `syntax::ext`

r? @estebank

4 years agoFix tidy.
Camille GILLOT [Sat, 9 Nov 2019 18:22:30 +0000 (19:22 +0100)]
Fix tidy.

4 years agoMerge hir::ImplPolarity into ast::ImplPolarity.
Camille GILLOT [Sat, 9 Nov 2019 17:38:35 +0000 (18:38 +0100)]
Merge hir::ImplPolarity into ast::ImplPolarity.

4 years agoMerge hir::IsAuto into ast::IsAuto.
Camille GILLOT [Sat, 9 Nov 2019 17:28:03 +0000 (18:28 +0100)]
Merge hir::IsAuto into ast::IsAuto.

4 years agoMerge hir::CaptureClause into ast::CaptureBy.
Camille GILLOT [Sat, 9 Nov 2019 17:23:11 +0000 (18:23 +0100)]
Merge hir::CaptureClause into ast::CaptureBy.

4 years agoMerge hir::GeneratorMovability into ast::Movability.
Camille GILLOT [Sat, 9 Nov 2019 17:06:57 +0000 (18:06 +0100)]
Merge hir::GeneratorMovability into ast::Movability.

4 years agoMerge hir::Unsafety into ast::Unsafety.
Camille GILLOT [Sat, 9 Nov 2019 17:01:12 +0000 (18:01 +0100)]
Merge hir::Unsafety into ast::Unsafety.

4 years agoMerge hir::Constness into ast::Constness.
Camille GILLOT [Sat, 9 Nov 2019 16:54:28 +0000 (17:54 +0100)]
Merge hir::Constness into ast::Constness.

4 years agoMerge hir::Mutability into ast::Mutability.
Camille GILLOT [Sat, 9 Nov 2019 16:44:11 +0000 (17:44 +0100)]
Merge hir::Mutability into ast::Mutability.

4 years agotidy
Nadrieril [Sun, 10 Nov 2019 10:56:06 +0000 (10:56 +0000)]
tidy

4 years agoUndo an assert causing an ICE until we fix the problem properly
Oliver Scherer [Sun, 10 Nov 2019 10:15:34 +0000 (11:15 +0100)]
Undo an assert causing an ICE until we fix the problem properly

4 years agoInline constructor_sub_pattern_tys
Nadrieril [Thu, 7 Nov 2019 12:04:19 +0000 (12:04 +0000)]
Inline constructor_sub_pattern_tys

It was only used at a single location

4 years agoAuto merge of #66072 - Mark-Simulacrum:next-node-id, r=nikomatsakis
bors [Sun, 10 Nov 2019 07:46:58 +0000 (07:46 +0000)]
Auto merge of #66072 - Mark-Simulacrum:next-node-id, r=nikomatsakis

Move next node ID to Resolver

This moves the `next_node_id` method(s) and related tracking information to the resolver. By doing so, we also remove the OneThread and Cell on next_node_id in Session in this move, which means that the new code is simpler and less "interesting" as it doesn't tie itself to a single thread.

This required moving some of the pretty-printing logic around, but this was just copying the code without any semantic changes, so it's just a second commit instead of a separate PR; I can polish it up a bit more if desired.

4 years agomake the error message more readable
Guanqun Lu [Sun, 10 Nov 2019 07:41:04 +0000 (15:41 +0800)]
make the error message more readable

4 years agomove syntax::parse -> librustc_parse
Mazdak Farrokhzad [Tue, 15 Oct 2019 20:48:13 +0000 (22:48 +0200)]
move syntax::parse -> librustc_parse

also move MACRO_ARGUMENTS -> librustc_parse

4 years agoAuto merge of #66259 - JohnTitor:rollup-x9nk1e2, r=JohnTitor
bors [Sun, 10 Nov 2019 02:15:28 +0000 (02:15 +0000)]
Auto merge of #66259 - JohnTitor:rollup-x9nk1e2, r=JohnTitor

Rollup of 7 pull requests

Successful merges:

 - #65719 (Refactor sync::Once)
 - #65831 (Don't cast directly from &[T; N] to *const T)
 - #66048 (Correct error in documentation for Ipv4Addr method)
 - #66058 (Correct deprecated `is_global` IPv6 documentation)
 - #66216 ([mir-opt] Handle return place in ConstProp and improve SimplifyLocals pass)
 - #66217 (invalid_value lint: use diagnostic items)
 - #66235 (rustc_metadata: don't let LLVM confuse rmeta blobs for COFF object files.)

Failed merges:

r? @ghost

4 years agomove config.rs to libsyntax_expand
Mazdak Farrokhzad [Thu, 10 Oct 2019 08:26:10 +0000 (10:26 +0200)]
move config.rs to libsyntax_expand

4 years agoRollup merge of #66235 - eddyb:coff-syrup, r=nagisa
Yuki Okushi [Sun, 10 Nov 2019 00:27:20 +0000 (09:27 +0900)]
Rollup merge of #66235 - eddyb:coff-syrup, r=nagisa

rustc_metadata: don't let LLVM confuse rmeta blobs for COFF object files.

This has likely been a silent issue since 1.10 but only caused trouble recently (see https://github.com/rust-lang/rust/issues/65536#issuecomment-552018224), when recent changes to the `rmeta` schema introduced more opportunities for COFF parse errors.

To prevent any undesired interactions with old compilers, I've renamed the file inside `rlib`s from `rust.metadata.bin` to `lib.rmeta` (not strongly attached to it, suggestions welcome).

Fixes #65536.

<hr/>

Before:
```
$ llvm-objdump -all-headers build/*/stage1-std/*/release/deps/libcore-*.rmeta

build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libcore-6b9e8b5a59b79a1d.rmeta: file format COFF-<unknown arch>

architecture: unknown
start address: 0x00000000

Sections:
Idx Name          Size     VMA          Type

SYMBOL TABLE:
```

After:
```
$ llvm-objdump -all-headers build/*/stage1-std/*/release/deps/libcore-*.rmeta

llvm-objdump: error: 'build/x86_64-unknown-linux-gnu/stage1-std/x86_64-unknown-linux-gnu/release/deps/libcore-6b9e8b5a59b79a1d.rmeta':
    The file was not recognized as a valid object file
```

4 years agoRollup merge of #66217 - RalfJung:diagnostic-items, r=Centril
Yuki Okushi [Sun, 10 Nov 2019 00:27:19 +0000 (09:27 +0900)]
Rollup merge of #66217 - RalfJung:diagnostic-items, r=Centril

invalid_value lint: use diagnostic items

This adjusts the invalid_value lint to use diagnostic items.

@Centril @oli-obk For some reason, this fails to recognize `transmute` -- somehow the diagnostic item is not found. Any idea why?

r? @Centril

Cc https://github.com/rust-lang/rust/issues/66075

4 years agoRollup merge of #66216 - wesleywiser:const_prop_codegen_improvements, r=oli-obk
Yuki Okushi [Sun, 10 Nov 2019 00:27:17 +0000 (09:27 +0900)]
Rollup merge of #66216 - wesleywiser:const_prop_codegen_improvements, r=oli-obk

[mir-opt] Handle return place in ConstProp and improve SimplifyLocals pass

Temporarily rebased on top of #66074. The top 2 commits are new.

r? @oli-obk

4 years agoRollup merge of #66058 - mjptree:patch-2, r=kennytm
Yuki Okushi [Sun, 10 Nov 2019 00:27:15 +0000 (09:27 +0900)]
Rollup merge of #66058 - mjptree:patch-2, r=kennytm

Correct deprecated `is_global` IPv6 documentation

This method does currently not return false for the `site_local` unicast address space. The documentation of the `is_unicast_global` method on lines 1352 - 1382 suggests that this is intentional as the site-local prefix must no longer be supported in new implementations, thus the documentation can safely be updated to reflect that information.
If not so,  either the `is_unicast_global` method should be updated to exclude the unicast site-local address space, or the `is_global` method itself.

4 years agoRollup merge of #66048 - mjptree:patch-1, r=Dylan-DPC
Yuki Okushi [Sun, 10 Nov 2019 00:27:13 +0000 (09:27 +0900)]
Rollup merge of #66048 - mjptree:patch-1, r=Dylan-DPC

Correct error in documentation for Ipv4Addr method

Correct statement in doctests on line 539 of `is_global` method of the `Ipv4Addr` object, which falsely attributed the tests to the broadcast address.