]> git.lizzy.rs Git - rust.git/log
rust.git
4 years agoRollup merge of #64499 - nnethercote:use-Symbol-in-two-more-functions, r=petrochenkov
Mazdak Farrokhzad [Mon, 16 Sep 2019 15:09:44 +0000 (17:09 +0200)]
Rollup merge of #64499 - nnethercote:use-Symbol-in-two-more-functions, r=petrochenkov

Use `Symbol` in two more functions.

r? @petrochenkov

4 years agoRollup merge of #64497 - nnethercote:fix-64339, r=petrochenkov
Mazdak Farrokhzad [Mon, 16 Sep 2019 15:09:43 +0000 (17:09 +0200)]
Rollup merge of #64497 - nnethercote:fix-64339, r=petrochenkov

Don't print the "total" `-Ztime-passes` output if `--prints=...` is also given

Fixes #64339.

4 years agoRollup merge of #64467 - Mark-Simulacrum:hide-cfg-failures, r=estebank
Mazdak Farrokhzad [Mon, 16 Sep 2019 15:09:41 +0000 (17:09 +0200)]
Rollup merge of #64467 - Mark-Simulacrum:hide-cfg-failures, r=estebank

Hide diagnostics emitted during --cfg parsing

The early error is more than sufficient for fixing the problem.

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

4 years agoRollup merge of #64451 - RalfJung:miri-manifest, r=pietroalbini
Mazdak Farrokhzad [Mon, 16 Sep 2019 15:09:40 +0000 (17:09 +0200)]
Rollup merge of #64451 - RalfJung:miri-manifest, r=pietroalbini

when Miri tests are not passing, do not add Miri component

This makes build-manifest query the toolstate repo at https://github.com/rust-lang-nursery/rust-toolstate to figure out if the tests of the Miri component are passing. If they are not, we remove the component from the manifest, to avoid shipping a broken Miri.

I tested this locally by running build-manifest and making sure that it correctly detects the toolstate of 02785dabad07d19b8c76a7f86763801d5d3497ff as broken.

r? @pietroalbini
Cc @kennytm @alexcrichton

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

4 years agoRollup merge of #64446 - ehuss:fix-sanitizer-build, r=alexcrichton
Mazdak Farrokhzad [Mon, 16 Sep 2019 15:09:38 +0000 (17:09 +0200)]
Rollup merge of #64446 - ehuss:fix-sanitizer-build, r=alexcrichton

Fix build script sanitizer check.

#64166 changed the way the sanitizer build scripts work. However, they were changed so that they switch between new-style to old-style cargo fingerprints. This trips up on https://github.com/rust-lang/cargo/issues/6779.

It also causes rustbuild to panic.  If you build stage1 std (with sanitizers off), and then enable sanitizers, it panics.  (This is because the build scripts don't declare that they need to re-run.)

This PR will trip https://github.com/rust-lang/cargo/issues/6779 again, unfortunately. I've been having way too many unexplained rebuilds in rust-lang/rust recently, but at least I'll know why this time.

This doesn't fix all problems with the build scripts, but arguably they should be fixed in cargo. For example, the build scripts change which rerun-if statements they declare between runs which triggers https://github.com/rust-lang/cargo/issues/7362.

The test for this is:
1. Turn off sanitizers (which is the default)
2. `./x.py build --stage=1 src/libstd`
3. `./x.py build --stage=1 src/libstd` again should be a null build.
4. Enable sanitizers.
5. `./x.py build --stage=1 src/libstd` should rebuild with sanitizers enabled.
6. `./x.py build --stage=1 src/libstd` again should be a null build. This actually rebuilds due to https://github.com/rust-lang/cargo/issues/7362 because the rerun-if directives changed between step 3 and 5. A 3rd attempt should be a null build.

4 years agoRollup merge of #64444 - RalfJung:no-backtrace, r=alexcrichton
Mazdak Farrokhzad [Mon, 16 Sep 2019 15:09:37 +0000 (17:09 +0200)]
Rollup merge of #64444 - RalfJung:no-backtrace, r=alexcrichton

fix building libstd without backtrace feature

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

r? @alexcrichton

4 years agoRollup merge of #64119 - pietroalbini:validate-toolstate-maintainers, r=kennytm
Mazdak Farrokhzad [Mon, 16 Sep 2019 15:09:35 +0000 (17:09 +0200)]
Rollup merge of #64119 - pietroalbini:validate-toolstate-maintainers, r=kennytm

ci: ensure all tool maintainers are assignable on issues

GitHub only allows people explicitly listed as collaborators on the repository or who commented on the issue/PR to be assignees, failing to create the issue if non-assignable people are assigned.

This adds an extra check on CI to make sure all the people listed as tool maintainers can be assigned to toolstate issues. The check won't be executed on PR builds due to the lack of a valid token.

r? @kennytm

4 years agoRollup merge of #64028 - Centril:stabilize-alloc-new-2, r=alexcrichton
Mazdak Farrokhzad [Mon, 16 Sep 2019 15:09:34 +0000 (17:09 +0200)]
Rollup merge of #64028 - Centril:stabilize-alloc-new-2, r=alexcrichton

Stabilize `Vec::new` and `String::new` as `const fn`s

Closes https://github.com/rust-lang/rust/issues/64022.

r? @oli-obk

4 years agoRollup merge of #63955 - RalfJung:intern, r=oli-obk
Mazdak Farrokhzad [Mon, 16 Sep 2019 15:09:33 +0000 (17:09 +0200)]
Rollup merge of #63955 - RalfJung:intern, r=oli-obk

Make sure interned constants are immutable

This makes sure that interning for constants (not statics) creates only immutable allocations.

Previously, the "main" allocation of `const FOO: Cell<i32> = Cell::new(0);` was marked as mutable, but I don't think we want that. It can be only copied, not written to.

Also, "leftover" allocations (behind raw pointers etc) were left mutable. I don't think we want to support that. I tried asserting that these are all already immutable (to double-check our static checks), but that failed in this one:
```rust
const NON_NULL_PTR2: NonNull<u8> = unsafe { mem::transmute(&0) };
```
Seems like maybe we want more precise mutability annotation inside Miri for locals (like `&0` here) so that this would actually become immutable to begin with?

I also factored `intern_shallow` out of the visitor so that we don't have to construct a visitor when we do not plan to visit anything. That confused me at first.

4 years agoConst-stabilize `String::new`.
Mazdak Farrokhzad [Thu, 29 Aug 2019 10:36:07 +0000 (12:36 +0200)]
Const-stabilize `String::new`.

4 years agoConst-stabilize `Vec::new`.
Mazdak Farrokhzad [Thu, 29 Aug 2019 09:32:38 +0000 (11:32 +0200)]
Const-stabilize `Vec::new`.

4 years agoavoid #[cfg] in favor of cfg!
Ralf Jung [Mon, 16 Sep 2019 14:37:44 +0000 (16:37 +0200)]
avoid #[cfg] in favor of cfg!

4 years agoci: remove projektir from toolstate notifications
Pietro Albini [Mon, 9 Sep 2019 14:03:57 +0000 (16:03 +0200)]
ci: remove projektir from toolstate notifications

They don't contribute to rust-by-example anymore.

4 years agoci: convert maintainer list in publish_toolstate to a set
Pietro Albini [Wed, 4 Sep 2019 08:21:23 +0000 (10:21 +0200)]
ci: convert maintainer list in publish_toolstate to a set

4 years agoci: address publish_toolstate review comments
Pietro Albini [Wed, 4 Sep 2019 08:08:54 +0000 (10:08 +0200)]
ci: address publish_toolstate review comments

4 years agoci: rename Gankro to Gankra in toolstate
Pietro Albini [Tue, 3 Sep 2019 10:04:22 +0000 (12:04 +0200)]
ci: rename Gankro to Gankra in toolstate

4 years agoci: ensure all tool maintainers are assignable on issues
Pietro Albini [Tue, 3 Sep 2019 09:33:29 +0000 (11:33 +0200)]
ci: ensure all tool maintainers are assignable on issues

GitHub only allows people explicitly listed as collaborators on the
repository or who commented on the issue/PR to be assignees, failing to
create the issue if non-assignable people are assigned.

This adds an extra check on CI to make sure all the people listed as
tool maintainers can be assigned to toolstate issues. The check won't be
executed on PR builds due to the lack of a valid token.

4 years agoAuto merge of #64383 - pcpthm:btreeset-size-hint, r=dtolnay
bors [Mon, 16 Sep 2019 05:16:19 +0000 (05:16 +0000)]
Auto merge of #64383 - pcpthm:btreeset-size-hint, r=dtolnay

Improve BTreeSet::Intersection::size_hint

A comment on `IntersectionInner` mentions `small_iter` should be smaller than `other_iter` but this condition is broken while iterating because those two iterators can be consumed at a different rate. I added a test to demonstrate this situation.
<del>I made `small_iter.len() < other_iter.len()` always true by swapping two iterators when that condition became false. This change affects the return value of `size_hint`. The previous result was also correct but this new version always returns smaller upper bound than the previous version.</del>
I changed `size_hint` to taking minimum of both lengths of iterators and renamed fields to `a` and `b` to match `Union` iterator.

4 years agoUse `Symbol` in two more functions.
Nicholas Nethercote [Mon, 16 Sep 2019 05:00:28 +0000 (15:00 +1000)]
Use `Symbol` in two more functions.

4 years agoImprove BTreeSet::Intersection::size_hint
pcpthm [Mon, 16 Sep 2019 04:37:52 +0000 (04:37 +0000)]
Improve BTreeSet::Intersection::size_hint
The commented invariant that an iterator is smaller than other iterator
was violated after next is called and two iterators are consumed at
different rates.

4 years agoDon't print the "total" `-Ztime-passes` output if `--prints=...` is also given.
Nicholas Nethercote [Mon, 16 Sep 2019 03:27:38 +0000 (13:27 +1000)]
Don't print the "total" `-Ztime-passes` output if `--prints=...` is also given.

Fixes #64339.

4 years agoAuto merge of #64487 - Xanewok:update-rls, r=jonas-schievink
bors [Mon, 16 Sep 2019 00:15:45 +0000 (00:15 +0000)]
Auto merge of #64487 - Xanewok:update-rls, r=jonas-schievink

Update RLS

Fixes the toolstate.

Closes #64480

r? @jonas-schievink

4 years agoHide diagnostics emitted during --cfg parsing
Mark Rousskov [Sat, 14 Sep 2019 20:17:57 +0000 (16:17 -0400)]
Hide diagnostics emitted during --cfg parsing

The early error is more than sufficient for fixing the problem.

4 years agoAuto merge of #64491 - Centril:rollup-21wkl69, r=Centril
bors [Sun, 15 Sep 2019 20:06:49 +0000 (20:06 +0000)]
Auto merge of #64491 - Centril:rollup-21wkl69, r=Centril

Rollup of 3 pull requests

Successful merges:

 - #63872 (Document platform-specific behavior of the iterator returned by std::fs::read_dir)
 - #64250 (save-analysis: Nest typeck tables when processing functions/methods)
 - #64472 (Don't mark expression with attributes as not needing parentheses)

Failed merges:

r? @ghost

4 years agoRollup merge of #64472 - Mark-Simulacrum:unused-parens-attr, r=varkor
Mazdak Farrokhzad [Sun, 15 Sep 2019 17:36:01 +0000 (19:36 +0200)]
Rollup merge of #64472 - Mark-Simulacrum:unused-parens-attr, r=varkor

Don't mark expression with attributes as not needing parentheses

This is not perfectly correct as `#[attr] (5)` will still not lint, but it does seem good enough, in particular as the parentheses in that case are not unambiguously incorrect; I might personally prefer to see them for clarity.

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

4 years agoRollup merge of #64250 - Xanewok:save-analysis-assoc-nested, r=varkor
Mazdak Farrokhzad [Sun, 15 Sep 2019 17:35:59 +0000 (19:35 +0200)]
Rollup merge of #64250 - Xanewok:save-analysis-assoc-nested, r=varkor

save-analysis: Nest typeck tables when processing functions/methods

Fixes an issue where we did not nest tables correctly when resolving
associated types in formal argument/return type positions.

This was the minimized reproduction case that I tested the fix on:
```rust
pub trait Trait {
    type Assoc;
}

pub struct A;

pub fn func() {
    fn _inner1<U: Trait>(_: U::Assoc) {}
    fn _inner2<U: Trait>() -> U::Assoc { unimplemented!() }

    impl A {
        fn _inner1<U: Trait>(self, _: U::Assoc) {}
        fn _inner2<U: Trait>(self) -> U::Assoc { unimplemented!() }
    }
}
```
using `debug_assertions`-enabled rustc and by additionally passing `-Zsave-analysis`.

Unfortunately the original assertion fired is a *debug* one and from what I can tell we don't run the tests with these on, so I'm not adding a test here. If I missed it and there is a way to run tests with these on, I'd love to add a test case for this.

Closes #63663
Closes #50328
Closes #43982

4 years agoRollup merge of #63872 - marmistrz:readdir, r=jonas-schievink
Mazdak Farrokhzad [Sun, 15 Sep 2019 17:35:58 +0000 (19:35 +0200)]
Rollup merge of #63872 - marmistrz:readdir, r=jonas-schievink

Document platform-specific behavior of the iterator returned by std::fs::read_dir

4 years agoAuto merge of #64474 - Mark-Simulacrum:permit-err-overlap, r=matthewjasper
bors [Sun, 15 Sep 2019 16:21:34 +0000 (16:21 +0000)]
Auto merge of #64474 - Mark-Simulacrum:permit-err-overlap, r=matthewjasper

Permit impls referencing errors to overlap

Fixes #43400; previously this would emit an overlapping impls error, but no longer does.

4 years agoUpdate RLS
Igor Matuszewski [Sun, 15 Sep 2019 14:00:01 +0000 (16:00 +0200)]
Update RLS

4 years agoPermit impls referencing errors to overlap
Mark Rousskov [Sat, 14 Sep 2019 23:26:49 +0000 (19:26 -0400)]
Permit impls referencing errors to overlap

4 years agoupdate intern classification comment
Ralf Jung [Wed, 28 Aug 2019 07:54:30 +0000 (09:54 +0200)]
update intern classification comment

4 years agoexplain ty == None
Ralf Jung [Wed, 28 Aug 2019 07:44:48 +0000 (09:44 +0200)]
explain ty == None

4 years agoassert that nobody asks for mutable constants
Ralf Jung [Wed, 28 Aug 2019 06:31:51 +0000 (08:31 +0200)]
assert that nobody asks for mutable constants

4 years agonote a FIXME
Ralf Jung [Tue, 27 Aug 2019 19:24:30 +0000 (21:24 +0200)]
note a FIXME

4 years agorelocations -> allocations
Ralf Jung [Tue, 27 Aug 2019 19:15:55 +0000 (21:15 +0200)]
relocations -> allocations

4 years agoAuto merge of #64483 - petrochenkov:expectattr2, r=Centril
bors [Sun, 15 Sep 2019 12:24:32 +0000 (12:24 +0000)]
Auto merge of #64483 - petrochenkov:expectattr2, r=Centril

resolve: Tweak some "cannot find" wording for macros

4 years agodrop redundant ParamEnv, and avoid constructing InternVisitor without visiting
Ralf Jung [Tue, 27 Aug 2019 19:13:05 +0000 (21:13 +0200)]
drop redundant ParamEnv, and avoid constructing InternVisitor without visiting

4 years agoall memory behind a constant must be immutable
Ralf Jung [Tue, 27 Aug 2019 18:59:34 +0000 (20:59 +0200)]
all memory behind a constant must be immutable

4 years agoconst interning: move mutability computation into intern_shallow, and always intern...
Ralf Jung [Tue, 27 Aug 2019 17:54:54 +0000 (19:54 +0200)]
const interning: move mutability computation into intern_shallow, and always intern constants as immutable

4 years agoresolve: Remove `!` from "cannot find" diagnostics for macros
Vadim Petrochenkov [Sun, 15 Sep 2019 10:12:14 +0000 (13:12 +0300)]
resolve: Remove `!` from "cannot find" diagnostics for macros

4 years agoresolve: Tweak "cannot find" wording for attributes
Vadim Petrochenkov [Sun, 15 Sep 2019 09:55:18 +0000 (12:55 +0300)]
resolve: Tweak "cannot find" wording for attributes

4 years agoAuto merge of #64469 - matthewjasper:increase-hygiene-use, r=petrochenkov
bors [Sun, 15 Sep 2019 08:17:57 +0000 (08:17 +0000)]
Auto merge of #64469 - matthewjasper:increase-hygiene-use, r=petrochenkov

Cleanup handling of hygiene for built-in macros

This makes most identifiers generated by built-in macros use def-site hygiene, not only the ones that previously used gensyms.

* `ExtCtxt::ident_of` now takes a `Span` and is preferred to `Ident::{from_str, from_str_and_span}`
* Remove `Span::with_legacy_ctxt`
    * `assert` now uses call-site hygiene because it needs to resolve `panic` unhygienically.
    * `concat_idents` now uses call-site hygiene because it wouldn't be very useful with def-site hygiene.
    * everything else is moved to def-site hygiene

r? @petrochenkov

4 years agoRemove `with_legacy_ctxt`
Matthew Jasper [Sat, 14 Sep 2019 20:17:11 +0000 (21:17 +0100)]
Remove `with_legacy_ctxt`

4 years agoGive more `Idents` spans
Matthew Jasper [Sat, 14 Sep 2019 20:16:51 +0000 (21:16 +0100)]
Give more `Idents` spans

4 years agoAvoid some unnecessary `&str` to `Ident` conversions
Matthew Jasper [Sat, 14 Sep 2019 20:14:03 +0000 (21:14 +0100)]
Avoid some unnecessary `&str` to `Ident` conversions

4 years agoPrefer `Symbol` to `Ident` when there's no sensible `Span`
Matthew Jasper [Sat, 14 Sep 2019 20:10:12 +0000 (21:10 +0100)]
Prefer `Symbol` to `Ident` when there's no sensible `Span`

4 years agoAuto merge of #64478 - Centril:rollup-bnt51w1, r=Centril
bors [Sun, 15 Sep 2019 03:59:08 +0000 (03:59 +0000)]
Auto merge of #64478 - Centril:rollup-bnt51w1, r=Centril

Rollup of 5 pull requests

Successful merges:

 - #64457 (def_collector: Do not ICE on attributes on unnamed fields)
 - #64463 (resolve: Tweak some expected/found wording)
 - #64471 (Warn on no_start, crate_id attribute use)
 - #64473 (Use try_fold instead of manually carrying an accumulator)
 - #64475 (simplify the initialization)

Failed merges:

r? @ghost

4 years agoRollup merge of #64475 - guanqun:use-same-name, r=Centril
Mazdak Farrokhzad [Sun, 15 Sep 2019 00:29:49 +0000 (02:29 +0200)]
Rollup merge of #64475 - guanqun:use-same-name, r=Centril

simplify the initialization

4 years agoRollup merge of #64473 - spastorino:use-try-fold, r=Centril
Mazdak Farrokhzad [Sun, 15 Sep 2019 00:29:47 +0000 (02:29 +0200)]
Rollup merge of #64473 - spastorino:use-try-fold, r=Centril

Use try_fold instead of manually carrying an accumulator

r? @RalfJung

4 years agoRollup merge of #64471 - Mark-Simulacrum:warn-depr-attr, r=Centril
Mazdak Farrokhzad [Sun, 15 Sep 2019 00:29:46 +0000 (02:29 +0200)]
Rollup merge of #64471 - Mark-Simulacrum:warn-depr-attr, r=Centril

Warn on no_start, crate_id attribute use

These attributes are now deprecated; they don't have any use anymore.

`no_start` stopped being applicable in 3ee916e50bd86768cb2a9141f9b2c52d2601b412 as part of #18967. Ideally we would've removed it pre-1.0, but since that didn't happen let's at least mark it deprecated.

`crate_id` was renamed to `crate_name` in 50ee1ec1b4f107122d8037ac7b0b312afa6eb0ac as part of #15319. Ideally we would've followed that up with a removal of crate_id itself as well, but that didn't happen; this PR finally marks it as deprecated at least.

Fixes https://github.com/rust-lang/rust/issues/43142 and resolves https://github.com/rust-lang/rust/issues/43144.

4 years agoRollup merge of #64463 - petrochenkov:expectattr, r=Centril
Mazdak Farrokhzad [Sun, 15 Sep 2019 00:29:44 +0000 (02:29 +0200)]
Rollup merge of #64463 - petrochenkov:expectattr, r=Centril

resolve: Tweak some expected/found wording

4 years agoRollup merge of #64457 - petrochenkov:macunfield, r=matthewjasper
Mazdak Farrokhzad [Sun, 15 Sep 2019 00:29:43 +0000 (02:29 +0200)]
Rollup merge of #64457 - petrochenkov:macunfield, r=matthewjasper

def_collector: Do not ICE on attributes on unnamed fields

The primary issue here is that the expansion infra needs to visit a field in isolation, and fields don't know their own indices during expansion, so they have to be kept in some other place (e.g. `struct Definitions`).

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

4 years agoAuto merge of #60584 - jonas-schievink:ice-panic-hook, r=oli-obk
bors [Sun, 15 Sep 2019 00:10:08 +0000 (00:10 +0000)]
Auto merge of #60584 - jonas-schievink:ice-panic-hook, r=oli-obk

Use `panic::set_hook` to print the ICE message

This allows custom frontends and backends to override the hook with their own, for example to point people to a different issue tracker.

ICE messages are printed in a slightly different order now. Nightly prints:

```
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0658.
For more information about an error, try `rustc --explain E0277`.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.36.0-nightly (08bfe1612 2019-05-02) running on x86_64-unknown-linux-gnu
```

After this PR, rustc prints:

```
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', src/libcore/option.rs:347:21
note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.36.0-dev running on x86_64-unknown-linux-gnu

error: aborting due to 2 previous errors

Some errors have detailed explanations: E0277, E0658.
For more information about an error, try `rustc --explain E0277`.
```

4 years agoWarn on no_start, crate_id attribute use
Mark Rousskov [Sat, 14 Sep 2019 21:53:14 +0000 (17:53 -0400)]
Warn on no_start, crate_id attribute use

These attributes are now deprecated; they don't have any use anymore.

4 years agosimply the initialization
Guanqun Lu [Tue, 10 Sep 2019 14:18:24 +0000 (22:18 +0800)]
simply the initialization

4 years agoUse try_fold instead of manually carrying an accumulator
Santiago Pastorino [Sat, 14 Sep 2019 22:51:40 +0000 (19:51 -0300)]
Use try_fold instead of manually carrying an accumulator

4 years agoDon't mark expression with attributes as not needing parentheses
Mark Rousskov [Sat, 14 Sep 2019 22:41:46 +0000 (18:41 -0400)]
Don't mark expression with attributes as not needing parentheses

This is not perfectly correct as `#[attr] (5)` will still not lint, but
it does seem good enough, in particular as the parentheses in that case
are not unambiguously incorrect.

4 years agosave-analysis: Process bounds in impl trait only in argument position
Igor Matuszewski [Sat, 14 Sep 2019 22:42:18 +0000 (00:42 +0200)]
save-analysis: Process bounds in impl trait only in argument position

4 years agosave-analysis: Deduplicate lookup_{d,r}ef_id functions
Igor Matuszewski [Sat, 14 Sep 2019 18:53:42 +0000 (20:53 +0200)]
save-analysis: Deduplicate lookup_{d,r}ef_id functions

4 years agoTry to fix the test output normalization
Jonas Schievink [Sat, 14 Sep 2019 21:02:22 +0000 (23:02 +0200)]
Try to fix the test output normalization

4 years agoAuto merge of #64466 - Centril:rollup-s3nlb9e, r=Centril
bors [Sat, 14 Sep 2019 20:16:54 +0000 (20:16 +0000)]
Auto merge of #64466 - Centril:rollup-s3nlb9e, r=Centril

Rollup of 4 pull requests

Successful merges:

 - #61797 (Stabilise weak_ptr_eq)
 - #64290 (Provide a span if main function is not present in crate)
 - #64406 (Ban non-extern rust intrinsics)
 - #64462 (feature_gate: Remove dead code from attribute checking)

Failed merges:

r? @ghost

4 years agoRollup merge of #64462 - petrochenkov:remattr, r=Centril
Mazdak Farrokhzad [Sat, 14 Sep 2019 20:16:07 +0000 (22:16 +0200)]
Rollup merge of #64462 - petrochenkov:remattr, r=Centril

feature_gate: Remove dead code from attribute checking

https://github.com/rust-lang/rust/pull/63468 is merged, so all attributes go through name resolution now, so we can remove code that previously performed some checks for attributes not going through resolution.

4 years agoRollup merge of #64406 - Mark-Simulacrum:error-unknown-intrinsic, r=Centril
Mazdak Farrokhzad [Sat, 14 Sep 2019 20:16:06 +0000 (22:16 +0200)]
Rollup merge of #64406 - Mark-Simulacrum:error-unknown-intrinsic, r=Centril

Ban non-extern rust intrinsics

Intrinsics can only be defined by the compiler.

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

4 years agoRollup merge of #64290 - Mark-Simulacrum:span-no-main, r=estebank
Mazdak Farrokhzad [Sat, 14 Sep 2019 20:16:05 +0000 (22:16 +0200)]
Rollup merge of #64290 - Mark-Simulacrum:span-no-main, r=estebank

Provide a span if main function is not present in crate

Unfortunately, the diagnostic machinery does not cope well with an empty
span which can happen if the crate is empty, in which case we merely set
a spanless note.

Tests are already updated for this change, so a dedicated test is not added.

Resolves #36561.

4 years agoRollup merge of #61797 - Thomasdezeeuw:stablise-weak_ptr_eq, r=RalfJung
Mazdak Farrokhzad [Sat, 14 Sep 2019 20:16:03 +0000 (22:16 +0200)]
Rollup merge of #61797 - Thomasdezeeuw:stablise-weak_ptr_eq, r=RalfJung

Stabilise weak_ptr_eq

Implemented in #55987.

Closes #55981.

4 years agoresolve: Tweak some expected/found wording
Vadim Petrochenkov [Sat, 14 Sep 2019 19:36:58 +0000 (22:36 +0300)]
resolve: Tweak some expected/found wording

4 years agofeature_gate: Eliminate `check::Context`
Vadim Petrochenkov [Sat, 14 Sep 2019 18:54:16 +0000 (21:54 +0300)]
feature_gate: Eliminate `check::Context`

Use `PostExpansionVisitor` directly instead

4 years agofeature_gate: Merge various attribute gating functions
Vadim Petrochenkov [Sat, 14 Sep 2019 18:29:59 +0000 (21:29 +0300)]
feature_gate: Merge various attribute gating functions

4 years agofeature_gate: Remove dead code from attribute checking
Vadim Petrochenkov [Sat, 14 Sep 2019 16:36:41 +0000 (19:36 +0300)]
feature_gate: Remove dead code from attribute checking

Same checks are performed during name resolution, and all attributes go through name resolution now

4 years agoBan non-extern rust intrinsics
Mark Rousskov [Thu, 12 Sep 2019 14:46:49 +0000 (10:46 -0400)]
Ban non-extern rust intrinsics

Intrinsics can only be defined by the compiler.

4 years agoProvide a span if main function is not present in crate
Mark Rousskov [Sun, 8 Sep 2019 17:06:49 +0000 (13:06 -0400)]
Provide a span if main function is not present in crate

Unfortunately, the diagnotic machinery does not cope well with an empty
span which can happen if the crate is empty, in which case we merely set
a spanless note.

4 years agoAuto merge of #64456 - Centril:rollup-ytqdwaq, r=Centril
bors [Sat, 14 Sep 2019 14:43:32 +0000 (14:43 +0000)]
Auto merge of #64456 - Centril:rollup-ytqdwaq, r=Centril

Rollup of 17 pull requests

Successful merges:

 - #63846 (Added table containing the system calls used by Instant and SystemTime.)
 - #64116 (Fix minor typo in docs.)
 - #64203 (A few cosmetic improvements to code & comments in liballoc and libcore)
 - #64302 (Shrink `ObligationCauseCode`)
 - #64372 (use randSecure and randABytes)
 - #64374 (Box `DiagnosticBuilder`.)
 - #64375 (Fast path for vec.clear/truncate )
 - #64378 (Fix inconsistent link formatting.)
 - #64384 (Trim rustc-workspace-hack)
 - #64393 ( declare EnvKey before use to fix build error)
 - #64420 (Inline `mark_neighbours_as_waiting_from`.)
 - #64422 (Remove raw string literal quotes from error index descriptions)
 - #64423 (Add self to .mailmap)
 - #64425 (typo fix)
 - #64431 (fn ptr is structural match)
 - #64435 (codegen: use "_N" (like for other locals) instead of "argN", for argument names.)
 - #64439 (fix #64430, confusing `owned_box` error message in no_std build)

Failed merges:

r? @ghost

4 years agoRollup merge of #64439 - 12101111:fix-owned-box, r=Centril
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:42 +0000 (16:42 +0200)]
Rollup merge of #64439 - 12101111:fix-owned-box, r=Centril

fix #64430, confusing `owned_box` error message in no_std build

Fixes #64430

4 years agoRollup merge of #64435 - eddyb:arguments-against-arg, r=rkruppe
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:40 +0000 (16:42 +0200)]
Rollup merge of #64435 - eddyb:arguments-against-arg, r=rkruppe

codegen: use "_N" (like for other locals) instead of "argN", for argument names.

Based on #64408 (second commit is new), fixing something I mentioned in #64408 (which turned to be an immediate blocker for unifying relevant codepaths).

Closes #64408 (by containing it).

r? @rkruppe

4 years agoRollup merge of #64431 - pnkfelix:issue-63479-fnptr-is-structural-match, r=varkor
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:39 +0000 (16:42 +0200)]
Rollup merge of #64431 - pnkfelix:issue-63479-fnptr-is-structural-match, r=varkor

fn ptr is structural match

Make fn ptr always structural match, regardless of whether the formal parameter types or return type are.

Fix #63479.

4 years agoRollup merge of #64425 - guanqun:typo-fix, r=matthewjasper
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:38 +0000 (16:42 +0200)]
Rollup merge of #64425 - guanqun:typo-fix, r=matthewjasper

typo fix

4 years agoRollup merge of #64423 - ollie27:mailmap, r=Mark-Simulacrum
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:36 +0000 (16:42 +0200)]
Rollup merge of #64423 - ollie27:mailmap, r=Mark-Simulacrum

Add self to .mailmap

4 years agoRollup merge of #64422 - ollie27:error_index_generator_stringify, r=Mark-Simulacrum
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:35 +0000 (16:42 +0200)]
Rollup merge of #64422 - ollie27:error_index_generator_stringify, r=Mark-Simulacrum

Remove raw string literal quotes from error index descriptions

The error index has unnecessary `r##"` and `"##` around the descriptions from #63721. Removing the `stringify` call removes them.

r? @Mark-Simulacrum

4 years agoRollup merge of #64420 - nnethercote:inline-mark_neighbours_as_waiting_from, r=Mark...
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:33 +0000 (16:42 +0200)]
Rollup merge of #64420 - nnethercote:inline-mark_neighbours_as_waiting_from, r=Mark-Simulacrum

Inline `mark_neighbours_as_waiting_from`.

This function is very hot, doesn't get inlined because it's recursive,
and the function calls are significant.

This commit splits it into inlined and uninlined variants, and uses the
inlined variant for the hot call site. This wins several percent on a
few benchmarks.

r? @nikomatsakis

4 years agoRollup merge of #64393 - Wind-River:master_002_envKey, r=alexcrichton
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:32 +0000 (16:42 +0200)]
Rollup merge of #64393 - Wind-River:master_002_envKey, r=alexcrichton

 declare EnvKey before use to fix build error

r? @alexcrichton

4 years agoRollup merge of #64384 - mati865:tools_hack, r=alexcrichton
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:31 +0000 (16:42 +0200)]
Rollup merge of #64384 - mati865:tools_hack, r=alexcrichton

Trim rustc-workspace-hack

Those dependencies seem no longer necessary.
`./x.py test` and `x86_64-gnu-tools` container passed locally so I think this won't hurt.

4 years agoRollup merge of #64378 - Rosto75:master, r=jonas-schievink
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:29 +0000 (16:42 +0200)]
Rollup merge of #64378 - Rosto75:master, r=jonas-schievink

Fix inconsistent link formatting.

4 years agoRollup merge of #64375 - kornelski:vecdrop, r=rkruppe
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:28 +0000 (16:42 +0200)]
Rollup merge of #64375 - kornelski:vecdrop, r=rkruppe

Fast path for vec.clear/truncate

For trivial types like `u8`, `vec.truncate()`/`vec.clear()` relies on the optimizer to remove the loop. This means more work in debug builds, and more work for the optimizer.

Avoiding this busywork is exactly what `mem::needs_drop::<T>()` is for.

4 years agoRollup merge of #64374 - nnethercote:box-DiagnosticBuilder, r=zackmdavis
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:26 +0000 (16:42 +0200)]
Rollup merge of #64374 - nnethercote:box-DiagnosticBuilder, r=zackmdavis

Box `DiagnosticBuilder`.

It's a large type -- 176 bytes on 64-bit. And it's passed around and
returned from a lot of functions, including within `PResult`.

This commit boxes it, which reduces memory traffic. In particular,
`PResult` shrinks to 16 bytes in the best case; this reduces instruction
counts by up to 2% on various workloads. The commit touches a lot of
lines but it's almost all trivial plumbing changes.

4 years agoRollup merge of #64372 - Wind-River:master, r=alexcrichton
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:25 +0000 (16:42 +0200)]
Rollup merge of #64372 - Wind-River:master, r=alexcrichton

use randSecure and randABytes

r? @alexcrichton

cc @n-salim

4 years agoRollup merge of #64302 - nnethercote:shrink-ObligationCauseCode, r=zackmdavis
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:23 +0000 (16:42 +0200)]
Rollup merge of #64302 - nnethercote:shrink-ObligationCauseCode, r=zackmdavis

Shrink `ObligationCauseCode`

These commits reduce the size of `ObligationCauseCode` from 56 bytes to 32 bytes on 64-bit. This reduces instruction counts on various benchmarks by up to 1%, due to less `memcpy`ing.

4 years agoRollup merge of #64203 - alexreg:rush-pr-2, r=centril
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:22 +0000 (16:42 +0200)]
Rollup merge of #64203 - alexreg:rush-pr-2, r=centril

A few cosmetic improvements to code & comments in liballoc and libcore

Factored out from hacking on rustc for work on the REPL.

r? @Centril

4 years agoRollup merge of #64116 - ZeGentzy:patch-1, r=oli-obk
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:20 +0000 (16:42 +0200)]
Rollup merge of #64116 - ZeGentzy:patch-1, r=oli-obk

Fix minor typo in docs.

This comment is prolly refering to the comment in [const_eval_raw_provider](https://github.com/rust-lang/rust/pull/64116/files#diff-e0b58bb6712edaa8595ad7237542c958R616), not itself.

4 years agoRollup merge of #63846 - DevQps:32626-document-time-system-calls, r=rkruppe
Mazdak Farrokhzad [Sat, 14 Sep 2019 14:42:19 +0000 (16:42 +0200)]
Rollup merge of #63846 - DevQps:32626-document-time-system-calls, r=rkruppe

Added table containing the system calls used by Instant and SystemTime.

# Description
See #32626 for a discussion on documenting system calls used by Instant and SystemTime.

## Changes
- Added a table containing the system calls used by each platform.

EDIT: If I can format this table better (due to the large links) please let me know.
I'd also be happy to learn a quick command to generate the docs on my host machine! Currently I am using: `python x.py doc --stage 0 src/libstd` but that gives me some `unrecognized intrinsic` errors. Advice is always welcome :)

closes #32626

4 years agodef_collector: Factor out common field handling code
Vadim Petrochenkov [Sat, 14 Sep 2019 14:36:27 +0000 (17:36 +0300)]
def_collector: Factor out common field handling code

4 years agodef_collector: Do not ICE on attributes on unnamed fields
Vadim Petrochenkov [Sat, 14 Sep 2019 10:56:44 +0000 (13:56 +0300)]
def_collector: Do not ICE on attributes on unnamed fields

4 years agoUpdate src/liballoc/raw_vec.rs
Alexander Regueiro [Sat, 14 Sep 2019 14:26:50 +0000 (15:26 +0100)]
Update src/liballoc/raw_vec.rs

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
4 years agobuild-manifest: when Miri tests are not passing, do not add Miri component
Ralf Jung [Sat, 14 Sep 2019 10:57:39 +0000 (12:57 +0200)]
build-manifest: when Miri tests are not passing, do not add Miri component

4 years agowhen BUILD_MANIFEST_DISABLE_SIGNING is set, we don't need gpg-password-file
Ralf Jung [Sat, 14 Sep 2019 10:49:04 +0000 (12:49 +0200)]
when BUILD_MANIFEST_DISABLE_SIGNING is set, we don't need gpg-password-file

4 years agorename the crate, not the feature
Ralf Jung [Sat, 14 Sep 2019 10:12:32 +0000 (12:12 +0200)]
rename the crate, not the feature

4 years agostd: always depend on backtrace, but only enable its features on demand
Ralf Jung [Sat, 14 Sep 2019 08:23:10 +0000 (10:23 +0200)]
std: always depend on backtrace, but only enable its features on demand

4 years agoAuto merge of #64080 - estebank:parse-format-comma, r=zackmdavis
bors [Sat, 14 Sep 2019 06:10:08 +0000 (06:10 +0000)]
Auto merge of #64080 - estebank:parse-format-comma, r=zackmdavis

Be accurate on `format!` parse error expectations

Fix https://github.com/rust-lang/rust/issues/57277.

4 years agoFix build script sanitizer check.
Eric Huss [Sat, 14 Sep 2019 03:59:46 +0000 (20:59 -0700)]
Fix build script sanitizer check.

4 years agoUpdate value.rs
Hal Gentz [Sat, 14 Sep 2019 02:37:38 +0000 (20:37 -0600)]
Update value.rs

4 years agoadd trailing newline
12101111 [Fri, 13 Sep 2019 19:23:58 +0000 (03:23 +0800)]
add trailing newline