]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agoMake test robust to NLL, in sense of ensuring borrows extend to something approximati...
Felix S. Klock II [Thu, 8 Nov 2018 23:10:19 +0000 (00:10 +0100)]
Make test robust to NLL, in sense of ensuring borrows extend to something approximating lexical scope.

5 years agoAuto merge of #55532 - pnkfelix:rustc_error-survey, r=nikomatsakis
bors [Thu, 8 Nov 2018 09:38:49 +0000 (09:38 +0000)]
Auto merge of #55532 - pnkfelix:rustc_error-survey, r=nikomatsakis

#[rustc_error] survey

Fix #55505

5 years agoAuto merge of #55366 - Amanieu:stable_layout, r=Amanieu
bors [Thu, 8 Nov 2018 06:52:27 +0000 (06:52 +0000)]
Auto merge of #55366 - Amanieu:stable_layout, r=Amanieu

Add tracking issue for Layout methods (and some API changes)

These methods are already useful when used with the stable global allocator API (stabilized in #51241).

```rust
pub fn align_to(&self, align: usize) -> Result<Layout, LayoutErr>;
pub fn padding_needed_for(&self, align: usize) -> usize;
pub fn repeat(&self, n: usize) -> Result<(Layout, usize), LayoutErr>;
pub fn extend(&self, next: Layout) -> Result<(Layout, usize), LayoutErr>;
pub fn repeat_packed(&self, n: usize) -> Result<Layout, LayoutErr>;
pub fn extend_packed(&self, next: Layout) -> Result<Layout, LayoutErr>;
pub fn array<T>(n: usize) -> Result<Layout, LayoutErr>;
```

cc #32838

r? @SimonSapin

5 years agoAuto merge of #55187 - malbarbo:fix-manifest, r=alexcrichton
bors [Thu, 8 Nov 2018 01:10:10 +0000 (01:10 +0000)]
Auto merge of #55187 - malbarbo:fix-manifest, r=alexcrichton

Remove targets from the manifest that are not built on travis

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

5 years agoRemove targets from the manifest that are not built on travis
Marco A L Barbosa [Thu, 18 Oct 2018 20:27:08 +0000 (17:27 -0300)]
Remove targets from the manifest that are not built on travis

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

5 years agoAuto merge of #55746 - kennytm:rollup, r=kennytm
bors [Wed, 7 Nov 2018 17:14:34 +0000 (17:14 +0000)]
Auto merge of #55746 - kennytm:rollup, r=kennytm

Rollup of 14 pull requests

Successful merges:

 - #55377 (Slight copy-editing for `std::cell::Cell` docs)
 - #55441 (Remove unused re import in gdb_rust_pretty_printing)
 - #55453 (Choose predicates without inference variables over those with them)
 - #55495 (Don't print opt fuel messages to stdout because it breaks Rustbuild)
 - #55501 (Make `process_obligations`' computation of `completed` optional.)
 - #55510 (Fix feature gate only being checked on first repr attr.)
 - #55609 (Run name-anon-globals after LTO passes as well)
 - #55645 (do not print wrapping ranges like normal ranges in validity diagnostics)
 - #55688 (Standardised names and location of ui issue tests)
 - #55692 (-C remark: fix incorrect warning about requiring "--debuginfo" instead of "-C debuginfo=n")
 - #55702 (Add `aarch64-pc-windows-msvc` to deployed targets)
 - #55728 (Update lldb)
 - #55730 (Use trait impl method span when type param mismatch is due to impl Trait)
 - #55734 (refactor: use shorthand fields)

5 years agowork around deviation in diagnostic output for opt-level=0 by forcing `-O`.
Felix S. Klock II [Wed, 7 Nov 2018 14:58:59 +0000 (15:58 +0100)]
work around deviation in diagnostic output for opt-level=0 by forcing `-O`.

5 years agoUpdate output of `lint-type-overflow2.stderr` to reflect its output from `rustc -O`.
Felix S. Klock II [Wed, 7 Nov 2018 14:47:49 +0000 (15:47 +0100)]
Update output of `lint-type-overflow2.stderr` to reflect its output from `rustc -O`.

(The fact that output differs under `opt-level=0` is an instance of #55757.)

5 years agoRollup merge of #55645 - RalfJung:validity-range-inclusive, r=oli-obk
kennytm [Wed, 7 Nov 2018 13:28:19 +0000 (21:28 +0800)]
Rollup merge of #55645 - RalfJung:validity-range-inclusive, r=oli-obk

do not print wrapping ranges like normal ranges in validity diagnostics

5 years agoRollup merge of #55734 - teresy:shorthand-fields, r=davidtwco
kennytm [Wed, 7 Nov 2018 10:02:05 +0000 (18:02 +0800)]
Rollup merge of #55734 - teresy:shorthand-fields, r=davidtwco

refactor: use shorthand fields

refactor: use shorthand for single fields everywhere (excluding tests).

5 years agoRollup merge of #55730 - estebank:impl-trait-arg-mismatch, r=varkor
kennytm [Wed, 7 Nov 2018 10:02:04 +0000 (18:02 +0800)]
Rollup merge of #55730 - estebank:impl-trait-arg-mismatch, r=varkor

Use trait impl method span when type param mismatch is due to impl Trait

Fix #55374.

5 years agoRollup merge of #55728 - tromey:update-lldb, r=alexcrichton
kennytm [Wed, 7 Nov 2018 10:02:03 +0000 (18:02 +0800)]
Rollup merge of #55728 - tromey:update-lldb, r=alexcrichton

Update lldb

This updates lldb to pick up some bug fixes, and makes one minor test
suite fix to account for this.

5 years agotest diagnostics for more ranges
Ralf Jung [Sat, 3 Nov 2018 13:10:34 +0000 (14:10 +0100)]
test diagnostics for more ranges

5 years agopretty-print scalar range that only has an upper bound
Ralf Jung [Sat, 3 Nov 2018 12:21:09 +0000 (13:21 +0100)]
pretty-print scalar range that only has an upper bound

5 years agodo not print wrapping ranges like normal ranges in diagnostics
Ralf Jung [Sat, 3 Nov 2018 11:44:10 +0000 (12:44 +0100)]
do not print wrapping ranges like normal ranges in diagnostics

5 years agoRemoved `#[rustc_error]` from tests that are all `// compile-pass`.
Felix S. Klock II [Wed, 31 Oct 2018 12:08:01 +0000 (13:08 +0100)]
Removed `#[rustc_error]` from tests that are all `// compile-pass`.

I also added `// skip-codegen` to each one, to address potential concerns
that this change would otherwise slow down our test suite spending time
generating code for files that are really just meant to be checks of
compiler diagnostics.

(However, I will say: My preference is to not use `// skip-codegen` if
one can avoid it. We can use all the testing of how we drive LLVM that
we can get...)

(Updated post rebase.)

5 years agoReplaced use of `#[rustc_error]` with `// skip-codegen`.
Felix S. Klock II [Wed, 31 Oct 2018 11:24:01 +0000 (12:24 +0100)]
Replaced use of `#[rustc_error]` with `// skip-codegen`.

This test specifically notes that it does not want to invoke the
linker, due to the way it (IMO weakly) exercises the `#[link=...]`
attribute.

In any case, removing the the `#[rustc_error]` here uncovered an
"invalid windows subsystem" error that was previously not included in
the transcript of diagnostic output. So that's a step forward, (right?).

5 years agoremove `#[rustc_error]` from ui/ tests that remain compile-fail tests.
Felix S. Klock II [Tue, 30 Oct 2018 23:18:11 +0000 (00:18 +0100)]
remove `#[rustc_error]` from ui/ tests that remain compile-fail tests.

5 years agoRollup merge of #55702 - alexcrichton:arm64-msvc-deploy, r=michaelwoerister
kennytm [Wed, 7 Nov 2018 10:01:58 +0000 (18:01 +0800)]
Rollup merge of #55702 - alexcrichton:arm64-msvc-deploy, r=michaelwoerister

Add `aarch64-pc-windows-msvc` to deployed targets

Accidentally forgotten from #54718!

5 years agoRollup merge of #55692 - matthiaskrgr:remark_debuginfo_hint, r=michaelwoerister
kennytm [Wed, 7 Nov 2018 10:01:57 +0000 (18:01 +0800)]
Rollup merge of #55692 - matthiaskrgr:remark_debuginfo_hint, r=michaelwoerister

-C remark: fix incorrect warning about requiring "--debuginfo" instead of "-C debuginfo=n"

Previously suggested "--debuginfo" does not actually work.

5 years agoRollup merge of #55688 - alexreg:move-issue-tests, r=estebank
kennytm [Wed, 7 Nov 2018 10:01:56 +0000 (18:01 +0800)]
Rollup merge of #55688 - alexreg:move-issue-tests, r=estebank

Standardised names and location of ui issue tests

None

5 years agoRollup merge of #55609 - nikic:fix-51947, r=nagisa
kennytm [Wed, 7 Nov 2018 10:01:54 +0000 (18:01 +0800)]
Rollup merge of #55609 - nikic:fix-51947, r=nagisa

Run name-anon-globals after LTO passes as well

If we're going to emit bitcode (through ThinLTOBuffer), then we need to ensure that anon globals are named. This was already done after optimization passes, but also has to happen after LTO passes, as we always emit the final result in a ThinLTO-compatible manner.

I added the test as `run-make`. The important bit is that we emit bitcode in some way (e.g. `--crate-type rlib` or `--emit=llvm-bc`). Please tell me if there is a better way to test for that.

Fixes #51947

5 years agoRollup merge of #55510 - bitshifter:repr-feature-gate-fix, r=petrochenkov
kennytm [Wed, 7 Nov 2018 10:01:53 +0000 (18:01 +0800)]
Rollup merge of #55510 - bitshifter:repr-feature-gate-fix, r=petrochenkov

Fix feature gate only being checked on first repr attr.

Reported in https://github.com/rust-lang/rust/issues/33158#issuecomment-412185357.

5 years agoRollup merge of #55501 - nnethercote:DoCompleted, r=pnkfelix
kennytm [Wed, 7 Nov 2018 10:01:51 +0000 (18:01 +0800)]
Rollup merge of #55501 - nnethercote:DoCompleted, r=pnkfelix

Make `process_obligations`' computation of `completed` optional.

It's only used in tests.

This reduces instruction counts on several benchmarks by 0.5--1%.

5 years agoRollup merge of #55495 - wesleywiser:opt_fuel_rustbuild, r=nikomatsakis
kennytm [Wed, 7 Nov 2018 10:01:50 +0000 (18:01 +0800)]
Rollup merge of #55495 - wesleywiser:opt_fuel_rustbuild, r=nikomatsakis

Don't print opt fuel messages to stdout because it breaks Rustbuild

Rustbuild passes `--message-format json` to the compiler invocations
which causes JSON to be emitted on stdout. Printing optimization fuel
messages to stdout breaks the json and causes Rustbuild to fail.

Work around this by emitting optimization fuel related messages on
stderr instead.

5 years agoRollup merge of #55453 - Aaron1011:fix/rustdoc-lifetime, r=pnkfelix
kennytm [Wed, 7 Nov 2018 10:01:48 +0000 (18:01 +0800)]
Rollup merge of #55453 - Aaron1011:fix/rustdoc-lifetime, r=pnkfelix

Choose predicates without inference variables over those with them

Fixes #54705

When constructing synthetic auto trait impls, we may come across
multiple predicates involving the same type, trait, and substitutions.
Since we can only display one of these, we pick the one with the 'most
strict' lifetime paramters. This ensures that the impl we render the
user is actually valid (that is, a struct matching that impl will
actually implement the auto trait in question).

This commit exapnds the definition of 'more strict' to take into account
inference variables. We always choose a predicate without inference
variables over a predicate with inference variables.

5 years agoRollup merge of #55441 - xfix:patch-12, r=aturon
kennytm [Wed, 7 Nov 2018 10:01:47 +0000 (18:01 +0800)]
Rollup merge of #55441 - xfix:patch-12, r=aturon

Remove unused re import in gdb_rust_pretty_printing

5 years agoRollup merge of #55377 - goffrie:patch-2, r=joshtriplett
kennytm [Wed, 7 Nov 2018 10:01:45 +0000 (18:01 +0800)]
Rollup merge of #55377 - goffrie:patch-2, r=joshtriplett

Slight copy-editing for `std::cell::Cell` docs

Hopefully this is a bit more precise and also more correct English.

5 years agoAuto merge of #55549 - RalfJung:miri-visitor, r=oli-obk
bors [Wed, 7 Nov 2018 09:14:12 +0000 (09:14 +0000)]
Auto merge of #55549 - RalfJung:miri-visitor, r=oli-obk

Value visitors for miri

Generalize the traversal part of validation to a `ValueVisitor`.

~~This includes https://github.com/rust-lang/rust/pull/55316, [click here](https://github.com/RalfJung/rust/compare/retagging...RalfJung:miri-visitor) for just the new commits.~~

5 years agoAuto merge of #55262 - oli-obk:dangling_alloc_id_ice, r=RalfJung
bors [Tue, 6 Nov 2018 23:36:13 +0000 (23:36 +0000)]
Auto merge of #55262 - oli-obk:dangling_alloc_id_ice, r=RalfJung

Change the ICE from #55223 to a hard error

cc @SimonSapin

r? @RalfJung

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

5 years agoAdd a tracking issue for extra Layout methods
Amanieu d'Antras [Thu, 25 Oct 2018 22:48:27 +0000 (23:48 +0100)]
Add a tracking issue for extra Layout methods

5 years agorefactor: use shorthand fields
teresy [Tue, 6 Nov 2018 20:05:44 +0000 (15:05 -0500)]
refactor: use shorthand fields

5 years agoUse trait impl method span when type param mismatch is due to impl Trait
Esteban Küber [Tue, 6 Nov 2018 19:24:48 +0000 (11:24 -0800)]
Use trait impl method span when type param mismatch is due to impl Trait

5 years agoAuto merge of #53996 - sekineh:thumb-run, r=japaric
bors [Tue, 6 Nov 2018 18:58:31 +0000 (18:58 +0000)]
Auto merge of #53996 - sekineh:thumb-run, r=japaric

[CI] Run a `thumbv7m-none-eabi` binary using `qemu-system-arm` [IRR-2018-embedded]

## What's included?

- Run a `thumbv7m-none-eabi` binary using `qemu-system-arm`
- We are using `cortex-m-rt = "=0.5.4"` which does not use `proc_macro`.
(reason: stage2 build of rustc does not work well with `proc_macro` in `run-make` phase.)
- We are using GNU LD for now.

## Blocker

All resolved.
- ~[Waiting] `#[panic_handler]` is not available in stable.~
  - [Merged] https://github.com/rust-lang/rust/pull/53619
- ~[Waiting] https://github.com/japaric/lm3s6965evb: does not compile on stable.~
  - [OK] dependent crate ~`panic-abort`~ `panic-halt`: already moved to use `#[panic_handler]`.

## Update

`#[panic_handler]` will be stabilized in Rust 1.30.

CC @kennytm @jamesmunns @nerdyvaishali

5 years agoUpdate lldb
Tom Tromey [Thu, 1 Nov 2018 20:22:55 +0000 (14:22 -0600)]
Update lldb

This updates lldb to pick up some bug fixes, and makes one minor test
suite fix to account for this.

5 years agoRun name-anon-globals after LTO passes as well
Nikita Popov [Fri, 2 Nov 2018 12:22:48 +0000 (13:22 +0100)]
Run name-anon-globals after LTO passes as well

If we're going to emit bitcode (through ThinLTOBuffer), then we
need to ensure that anon globals are named. This was already done
after optimization passes, but also has to happen after LTO passes,
as we always emit the final result in a ThinLTO-compatible manner.

Fixes #51947.

5 years agoAPI changes as discussed in the comments
Amanieu d'Antras [Tue, 30 Oct 2018 21:36:43 +0000 (21:36 +0000)]
API changes as discussed in the comments

5 years agoAdd a comment about how Layout::extend matches the C struct layout
Amanieu d'Antras [Sat, 27 Oct 2018 21:38:37 +0000 (22:38 +0100)]
Add a comment about how Layout::extend matches the C struct layout

5 years agoAdd explcit `--error-format` options to tests of print-fuel to sidestep compiletests...
Felix S. Klock II [Tue, 6 Nov 2018 16:07:17 +0000 (17:07 +0100)]
Add explcit `--error-format` options to tests of print-fuel to sidestep compiletests presumption of JSON.

As a driveby, rename the stdout files to stderr, which should have been part of the earlier commit.

5 years agoAuto merge of #55610 - gnzlbg:update_stdsimd, r=alexcrichton
bors [Tue, 6 Nov 2018 13:08:17 +0000 (13:08 +0000)]
Auto merge of #55610 - gnzlbg:update_stdsimd, r=alexcrichton

[breaking change] update stdsimd

r? @alexcrichton

5 years agoAuto merge of #55710 - kennytm:rollup, r=kennytm
bors [Tue, 6 Nov 2018 09:20:31 +0000 (09:20 +0000)]
Auto merge of #55710 - kennytm:rollup, r=kennytm

Rollup of 11 pull requests

Successful merges:

 - #55490 (resolve: Fix ICE in macro import error recovery)
 - #55597 (std: Enable usage of `thread_local!` through imports)
 - #55601 (Fix tracking issue numbers for some unstable features)
 - #55621 (Add precision for create_dir function)
 - #55644 (ci: Add Dockerfile for dist-powerpcspe-linux)
 - #55664 (Make "all possible cases" help message uniform with existing help messages)
 - #55689 (miri: binary_op_val -> binary_op_imm)
 - #55694 (Fixes #31076)
 - #55696 (NLL Diagnostic Review 3: Missing errors for borrows of union fields)
 - #55700 (Update ui tests with respect to NLL)
 - #55703 (Update `configure --help` (via configure.py) to reflect decoupling of debug+optimize)

5 years agoRollup merge of #55703 - pnkfelix:update-configure-help-to-reflect-pr-54811, r=Mark...
kennytm [Tue, 6 Nov 2018 07:21:12 +0000 (15:21 +0800)]
Rollup merge of #55703 - pnkfelix:update-configure-help-to-reflect-pr-54811, r=Mark-Simulacrum

Update `configure --help` (via configure.py) to reflect decoupling of debug+optimize

This should have been part of PR #54811 (my bad).

5 years agoRollup merge of #55700 - pnkfelix:issue-55533-update-ui-tests-wrt-nll, r=davidtwco
kennytm [Tue, 6 Nov 2018 07:21:11 +0000 (15:21 +0800)]
Rollup merge of #55700 - pnkfelix:issue-55533-update-ui-tests-wrt-nll, r=davidtwco

Update ui tests with respect to NLL

Fix #55533

5 years agoRollup merge of #55696 - davidtwco:issue-55675, r=pnkfelix
kennytm [Tue, 6 Nov 2018 07:21:10 +0000 (15:21 +0800)]
Rollup merge of #55696 - davidtwco:issue-55675, r=pnkfelix

NLL Diagnostic Review 3: Missing errors for borrows of union fields

Fixes #55675.

This PR modifies a test to make it more robust (it also fixes indentation on a doc comment, but that's not the point of the PR). See the linked issue for details.

r? @pnkfelix

5 years agoRollup merge of #55694 - jsirs:issue-31076, r=oli-obk
kennytm [Tue, 6 Nov 2018 07:21:09 +0000 (15:21 +0800)]
Rollup merge of #55694 - jsirs:issue-31076, r=oli-obk

Fixes #31076

5 years agoRollup merge of #55689 - RalfJung:miri-immediate, r=oli-obk
kennytm [Tue, 6 Nov 2018 07:21:07 +0000 (15:21 +0800)]
Rollup merge of #55689 - RalfJung:miri-immediate, r=oli-obk

miri: binary_op_val -> binary_op_imm

Seems like this was overlooked during the value -> immediate rename.

r? @oli-obk

5 years agoRollup merge of #55664 - varkor:all-possible-cases-message, r=zackmdavis
kennytm [Tue, 6 Nov 2018 07:21:06 +0000 (15:21 +0800)]
Rollup merge of #55664 - varkor:all-possible-cases-message, r=zackmdavis

Make "all possible cases" help message uniform with existing help messages

Specifically no capitalisation or trailing full stops.

5 years agoRollup merge of #55644 - glaubitz:powerpcspe-linux, r=alexcrichton
kennytm [Tue, 6 Nov 2018 07:21:05 +0000 (15:21 +0800)]
Rollup merge of #55644 - glaubitz:powerpcspe-linux, r=alexcrichton

ci: Add Dockerfile for dist-powerpcspe-linux

This adds the Dockerfile for cross-building Rust for the powerpcspe target. It's currently disabled.

5 years agoRollup merge of #55621 - GuillaumeGomez:create-dir, r=QuietMisdreavus
kennytm [Tue, 6 Nov 2018 07:21:02 +0000 (15:21 +0800)]
Rollup merge of #55621 - GuillaumeGomez:create-dir, r=QuietMisdreavus

Add precision for create_dir function

Took me a while to find the other equivalent so it seems to be necessary.

r? @QuietMisdreavus

5 years agoRollup merge of #55601 - petrochenkov:featissue, r=pnkfelix
kennytm [Tue, 6 Nov 2018 07:21:01 +0000 (15:21 +0800)]
Rollup merge of #55601 - petrochenkov:featissue, r=pnkfelix

Fix tracking issue numbers for some unstable features

And also remove deprecated unstable `#[panic_implementation]` attribute that was superseded by stable `#[panic_handler]` and doesn't have an open tracking issue.

5 years agoRollup merge of #55597 - alexcrichton:thread-local-inner, r=KodrAus
kennytm [Tue, 6 Nov 2018 07:20:59 +0000 (15:20 +0800)]
Rollup merge of #55597 - alexcrichton:thread-local-inner, r=KodrAus

std: Enable usage of `thread_local!` through imports

The `thread_local!` macro delegated to an internal macro but it didn't
do so in a macros-and-the-module-system compatible fashion, meaning if a
`#![no_std]` crate imported `std` and tried to use `thread_local!` it
would fail due to missing a lookup of an internal macro.

This commit switches the macro to instead use `$crate` to invoke other
macros, ensuring that it'll work when `thread_local!` is imported alone.

5 years agoRollup merge of #55490 - petrochenkov:resolveice, r=eddyb
kennytm [Tue, 6 Nov 2018 07:20:57 +0000 (15:20 +0800)]
Rollup merge of #55490 - petrochenkov:resolveice, r=eddyb

resolve: Fix ICE in macro import error recovery

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

5 years agoAuto merge of #55518 - alexcrichton:smaller-wasm, r=sfackler
bors [Tue, 6 Nov 2018 04:04:33 +0000 (04:04 +0000)]
Auto merge of #55518 - alexcrichton:smaller-wasm, r=sfackler

std: Improve codegen size of accessing TLS

Some code in the TLS implementation in libstd stores `Some(val)` into an
`&mut Option<T>` (effectively) and then pulls out `&T`, but it currently
uses `.unwrap()` which can codegen into a panic even though it can never
panic. With sufficient optimizations enabled (like LTO) the compiler can
see through this but this commit helps it along in normal mode
(`--release` with Cargo by default) to avoid codegen'ing the panic path.

This ends up improving the optimized codegen on wasm by ensuring that a
call to panic pulling in more file size doesn't stick around.

5 years agoMoved and renamed ui issue tests.
Alexander Regueiro [Mon, 5 Nov 2018 04:00:03 +0000 (04:00 +0000)]
Moved and renamed ui issue tests.

5 years agoAuto merge of #55106 - petrhosek:fuchsia-lld, r=alexcrichton
bors [Tue, 6 Nov 2018 01:20:58 +0000 (01:20 +0000)]
Auto merge of #55106 - petrhosek:fuchsia-lld, r=alexcrichton

Use lld directly for Fuchsia target

Fuchsia already uses lld as the default linker, so there's no reason
to always invoke it through Clang, instead we can simply invoke lld
directly and pass the set of flags that matches Clang.

5 years agoUse lld directly for Fuchsia target
Petr Hosek [Tue, 16 Oct 2018 00:27:07 +0000 (17:27 -0700)]
Use lld directly for Fuchsia target

Fuchsia already uses lld as the default linker, so there's no reason
to always invoke it through Clang, instead we can simply invoke lld
directly and pass the set of flags that matches Clang.

5 years agoAuto merge of #54922 - murarth:rc-ub-fix, r=alexcrichton
bors [Mon, 5 Nov 2018 22:20:25 +0000 (22:20 +0000)]
Auto merge of #54922 - murarth:rc-ub-fix, r=alexcrichton

Fix undefined behavior in Rc/Arc allocation

Manually calculate allocation layout for `Rc`/`Arc` to avoid undefined behavior

Closes #54908

5 years agoAuto merge of #55410 - nagisa:atomic-align, r=pnkfelix
bors [Mon, 5 Nov 2018 19:29:57 +0000 (19:29 +0000)]
Auto merge of #55410 - nagisa:atomic-align, r=pnkfelix

Correct alignment of atomic types and (re)add Atomic{I,U}128

This is a updated https://github.com/rust-lang/rust/pull/53514 to also make atomic types `repr(C)` as per comment in https://github.com/rust-lang/rust/pull/53514#issuecomment-431042767.

Fixes #39590
Closes #53514

r? @pnkfelix

5 years agoFix undefined behavior in Rc/Arc allocation
Murarth [Mon, 8 Oct 2018 23:52:48 +0000 (16:52 -0700)]
Fix undefined behavior in Rc/Arc allocation

Manually calculate allocation layout for `Rc`/`Arc` to avoid undefined behavior

5 years agoThis should have been part of PR #54811 (my bad).
Felix S. Klock II [Mon, 5 Nov 2018 17:06:23 +0000 (18:06 +0100)]
This should have been part of PR #54811 (my bad).

5 years agoDo not Atomic{I,U}128 in stage0
Simonas Kazlauskas [Mon, 5 Nov 2018 13:46:13 +0000 (15:46 +0200)]
Do not Atomic{I,U}128 in stage0

5 years agoAuto merge of #55451 - estebank:arg-doc, r=pnkfelix
bors [Mon, 5 Nov 2018 16:36:18 +0000 (16:36 +0000)]
Auto merge of #55451 - estebank:arg-doc, r=pnkfelix

Custom diagnostic when trying to doc comment argument

When writing

```
pub fn f(
    /// Comment
    id: u8,
) {}
```

Produce a targeted diagnostic

```
error: documentation comments cannot be applied to method arguments
  --> $DIR/fn-arg-doc-comment.rs:2:5
   |
LL |     /// Comment
   |     ^^^^^^^^^^^ doc comments are not allowed here
```

Fix #54801.

5 years agoAdd `aarch64-pc-windows-msvc` to deployed targets
Alex Crichton [Mon, 5 Nov 2018 15:54:38 +0000 (07:54 -0800)]
Add `aarch64-pc-windows-msvc` to deployed targets

Accidentally forgotten from #54718!

5 years agoFor feature-gate-nll test, turn off testing modes that externally enable NLL.
Felix S. Klock II [Mon, 5 Nov 2018 15:37:18 +0000 (16:37 +0100)]
For feature-gate-nll test, turn off testing modes that externally enable NLL.

5 years agoadd call to tcx.sess.delay_span_bug
jsirs [Mon, 5 Nov 2018 15:30:01 +0000 (17:30 +0200)]
add call to tcx.sess.delay_span_bug

add call to tcx.sess.delay_span_bug before returning none to make sure error is presented to user

5 years agoMake `ui/borrowck/borrowck-overloaded-call.rs` robust w.r.t. NLL.
Felix S. Klock II [Mon, 5 Nov 2018 15:29:41 +0000 (16:29 +0100)]
Make `ui/borrowck/borrowck-overloaded-call.rs` robust w.r.t. NLL.

5 years agoUse `// revisions` in the dropck-eyepatch tests instead of relying on compare-mode...
Felix S. Klock II [Mon, 5 Nov 2018 15:19:51 +0000 (16:19 +0100)]
Use `// revisions` in the dropck-eyepatch tests instead of relying on compare-mode=nll.

NLL has increased precision in its analysis of drop order, and we want
the test annotations to deliberately reflect this by having fewer
ERROR annotations for NLL than for AST-borrowck. The best way to get
this effect is via `// revisions`.

As a drive-by, also added uses of all the borrows just to make it
clear that NLL isn't somehow sidestepping things by using shorter
borrows than you might have otherwise expected. (Of course, the added
uses do not make all that much difference since the relevant types all
declare `impl Drop` and thus those drops have implicit uses anyway.)

5 years agoUpdate `ui/borrowck/borrowck-closures-mut-of-imm.rs` robust w.r.t. NLL.
Felix S. Klock II [Mon, 5 Nov 2018 14:25:11 +0000 (15:25 +0100)]
Update `ui/borrowck/borrowck-closures-mut-of-imm.rs` robust w.r.t. NLL.

5 years agoAdd `ui/borrowck/borrowck-closures-mut-of-mut.rs`.
Felix S. Klock II [Mon, 5 Nov 2018 14:24:25 +0000 (15:24 +0100)]
Add `ui/borrowck/borrowck-closures-mut-of-mut.rs`.

This is a variant of `ui/borrowck/borrowck-closures-mut-of-imm.rs`
that I used to help identify what changes I needed to make to the
latter file in order to recover its instances of E0524 under NLL.

(Basically this test includes the changes you'd need to make to
`ui/borrowck/borrowck-closures-mut-of-imm.rs` in order to get rid of
occurrences of E0596. And then I realized that one needs to add
invocations of the closures in order to properly extend the mutable
reborrows in a manner such that NLL will roughly match AST-borrowck.)

5 years agoRemoved overlapping_spans.{rs,stderr,nll.stderr}.
Felix S. Klock II [Mon, 5 Nov 2018 13:55:30 +0000 (14:55 +0100)]
Removed overlapping_spans.{rs,stderr,nll.stderr}.

This is based on the feedback from estebank:

"""
I believe that test can be removed outright. It'd be impossible for a
new change to go through that breaks this kind of output without it
being picked up by multiple other `stderr` tests. This is an artifact
of the transition period to the "new" output style.
"""

see: https://github.com/rust-lang/rust/issues/52663#issuecomment-422155551

5 years agoMake `ui/binop-move-semantics.rs` robust w.r.t. NLL.
Felix S. Klock II [Mon, 5 Nov 2018 13:48:35 +0000 (14:48 +0100)]
Make `ui/binop-move-semantics.rs` robust w.r.t. NLL.

5 years agoRemove `println!`'s from `ui/issues/issue-52126-assign-op-invariance.rs`
Felix S. Klock II [Mon, 5 Nov 2018 13:44:14 +0000 (14:44 +0100)]
Remove `println!`'s from `ui/issues/issue-52126-assign-op-invariance.rs`

This is not strictly necessary to make this test "more robust with
respect to NLL"; its just an attempt to narrow the scope of the test
and focus on its core.

5 years agoMake `ui/unop-move-semantics.rs` robust w.r.t. NLL.
Felix S. Klock II [Mon, 5 Nov 2018 13:36:58 +0000 (14:36 +0100)]
Make `ui/unop-move-semantics.rs` robust w.r.t. NLL.

5 years agoMake `ui/borrowck/borrowck-unboxed-closures.rs` robust w.r.t. NLL.
Felix S. Klock II [Mon, 5 Nov 2018 13:32:00 +0000 (14:32 +0100)]
Make `ui/borrowck/borrowck-unboxed-closures.rs` robust w.r.t. NLL.

5 years agoMake `ui/borrowck/borrowck-reborrow-from-mut.rs` robust w.r.t. NLL.
Felix S. Klock II [Mon, 5 Nov 2018 13:05:23 +0000 (14:05 +0100)]
Make `ui/borrowck/borrowck-reborrow-from-mut.rs` robust w.r.t. NLL.

5 years agoMake `ui/borrowck/borrowck-overloaded-index-move-index.rs` robust w.r.t. NLL.
Felix S. Klock II [Mon, 5 Nov 2018 12:55:00 +0000 (13:55 +0100)]
Make `ui/borrowck/borrowck-overloaded-index-move-index.rs` robust w.r.t. NLL.

5 years agoMake `ui/issues/issue-17263.rs` robust w.r.t. NLL.
Felix S. Klock II [Mon, 5 Nov 2018 12:49:58 +0000 (13:49 +0100)]
Make `ui/issues/issue-17263.rs` robust w.r.t. NLL.

5 years agoMake `ui/span/borrowck-borrow-overloaded-auto-deref-mut.rs` robust w.r.t. NLL.
Felix S. Klock II [Mon, 5 Nov 2018 12:07:51 +0000 (13:07 +0100)]
Make `ui/span/borrowck-borrow-overloaded-auto-deref-mut.rs` robust w.r.t. NLL.

5 years agoSwitch to using revisions in borrowck-lend-flow-loop.rs
Felix S. Klock II [Mon, 5 Nov 2018 11:59:40 +0000 (12:59 +0100)]
Switch to using revisions in borrowck-lend-flow-loop.rs

Most of the time we want to robustify tests, but in this case this
test is deliberately encoding artifacts of AST-borrowck.  So instead
of adding artificial uses that would obscure the aspects of
AST-borrowck that are being tests, we instead use revisions and then
mark the cases that apply to NLL as well as AST-borrowck.

5 years agoadd method to obtain the ptr offset of a Scalar
Ralf Jung [Mon, 5 Nov 2018 14:11:28 +0000 (15:11 +0100)]
add method to obtain the ptr offset of a Scalar

5 years agoadd test for i32, fix incorrect location
jsirs [Mon, 5 Nov 2018 13:57:07 +0000 (15:57 +0200)]
add test for i32, fix incorrect location

5 years agoupdate test to include concrete type (i32)
jsirs [Mon, 5 Nov 2018 13:54:10 +0000 (15:54 +0200)]
update test to include concrete type (i32)

5 years agowalk_value: more tracing
Ralf Jung [Mon, 5 Nov 2018 13:34:43 +0000 (14:34 +0100)]
walk_value: more tracing

5 years agoself.associated_item can return none
jsirs [Mon, 5 Nov 2018 12:37:36 +0000 (14:37 +0200)]
self.associated_item can return none

self.associated_item can return none, replace unwrap with '?' and bubble up None value instead of panicking

5 years agoAdd test
jsirs [Mon, 5 Nov 2018 12:33:43 +0000 (14:33 +0200)]
Add test

Add test for incompleately implemented add trait, see issue #31076

5 years ago-C remark: fix incorrect warning about requiring "--debuginfo" instead of "-C debugin...
Matthias Krüger [Mon, 5 Nov 2018 11:08:35 +0000 (12:08 +0100)]
-C remark: fix incorrect warning about requiring "--debuginfo" instead of "-C debuginfo=n"

5 years agoAuto merge of #55515 - QuietMisdreavus:rustdoc-config, r=GuillaumeGomez
bors [Mon, 5 Nov 2018 09:48:46 +0000 (09:48 +0000)]
Auto merge of #55515 - QuietMisdreavus:rustdoc-config, r=GuillaumeGomez

rustdoc: refactor: centralize all command-line argument parsing

This is something i've wanted to do for a while, since we keep having to add new arguments to places like `rust_input` or `core::run_core` whenever we add a new CLI flag or the like. Those functions have inflated up to 11-19, and in some cases hiding away the locations where some CLI flags were being parsed, obscuring their use. Now, we have a central place where all command-line configuration occurs, including argument validation.

One note about the design: i grouped together all the arguments that `html::render::run` needed, so that i could pass them on from compilation in one lump instead of trying to thread through individual items or clone the entire blob ahead of time.

One other thing this adds is that rustdoc also now recognizes all the `-Z` options that rustc does, since we were manually grabbing a few previously. Now we parse a full `DebuggingOptions` struct and hand it directly to rustc when scraping docs.

5 years agoproide ptr_wrapping_offset on Scalars
Ralf Jung [Sun, 4 Nov 2018 11:45:21 +0000 (12:45 +0100)]
proide ptr_wrapping_offset on Scalars

5 years agomake ValueVisitor mut-polymorphic
Ralf Jung [Fri, 2 Nov 2018 13:06:43 +0000 (14:06 +0100)]
make ValueVisitor mut-polymorphic

5 years agomachine hooks for ptr (de)ref also need layout, and then they do not need the size
Ralf Jung [Fri, 2 Nov 2018 12:17:06 +0000 (13:17 +0100)]
machine hooks for ptr (de)ref also need layout, and then they do not need the size

5 years agoFIXME
Ralf Jung [Fri, 2 Nov 2018 10:24:36 +0000 (11:24 +0100)]
FIXME

5 years agovisit_aggregate with an iterator; fix some comment typos
Ralf Jung [Fri, 2 Nov 2018 09:52:07 +0000 (10:52 +0100)]
visit_aggregate with an iterator; fix some comment typos

5 years agothe visitor can already load the value for visit_primitive
Ralf Jung [Fri, 2 Nov 2018 09:01:22 +0000 (10:01 +0100)]
the visitor can already load the value for visit_primitive

5 years agoall values can convert to operators
Ralf Jung [Fri, 2 Nov 2018 08:52:17 +0000 (09:52 +0100)]
all values can convert to operators

5 years agofinally this actually looks like a visitor
Ralf Jung [Fri, 2 Nov 2018 08:33:26 +0000 (09:33 +0100)]
finally this actually looks like a visitor

5 years agouse more traditional walk_array/visit_array instead of the handle_array hook
Ralf Jung [Fri, 2 Nov 2018 07:17:40 +0000 (08:17 +0100)]
use more traditional walk_array/visit_array instead of the handle_array hook

5 years agoconverting a VisitorValue to a MemPlace must not mutate anything
Ralf Jung [Thu, 1 Nov 2018 21:27:55 +0000 (22:27 +0100)]
converting a VisitorValue to a MemPlace must not mutate anything

5 years agoAlso test for undef in enum discriminant
Ralf Jung [Thu, 1 Nov 2018 13:41:36 +0000 (14:41 +0100)]
Also test for undef in enum discriminant

The error message is sub-par, but fixing that requries moving ScalarMaybeUndef
to librustc which would conflict badly with another PR that is in flight.

5 years agofix validation error on non-integer enum discriminants
Ralf Jung [Thu, 1 Nov 2018 13:14:51 +0000 (14:14 +0100)]
fix validation error on non-integer enum discriminants

5 years agolet the Value handle enum projections, so the visitor does not have to care
Ralf Jung [Thu, 1 Nov 2018 12:53:21 +0000 (13:53 +0100)]
let the Value handle enum projections, so the visitor does not have to care