Commit Graph

83885 Commits

Author SHA1 Message Date
Ralf Jung
018d128325 rename evaluator -> interpreter to make eddyb happy 2018-09-20 10:36:25 +02:00
Ralf Jung
169f7911e9 move CTFE engine snapshot state out of miri engine into CTFE machine instance 2018-09-20 10:12:21 +02:00
Philip Munksgaard
06b197582e Add documentation about the edition flag 2018-09-20 08:36:07 +02:00
Philip Munksgaard
b01e0e43d4 Add a documentation banner for edition specific code 2018-09-20 08:36:07 +02:00
Philip Munksgaard
ac8d8d71fa Add test for doctest edition support 2018-09-20 08:36:07 +02:00
Jack O'Connor
d0e59f563d add tests for copy_within 2018-09-20 02:35:32 -04:00
bors
992d1e4d3d Auto merge of #54241 - vi:suggest_with_applicability, r=estebank
Remove usages of span_suggestion without Applicability

Use `Applicability::Unspecified` for all of them instead.

Shall deprecations for the non-`_with_applicability` functions be added?

Shall clippy be addressed somehow?

r? @estebank
2018-09-20 06:34:22 +00:00
Jack O'Connor
b3ffd3344e define copy_within on slices
This is a safe wrapper around ptr::copy, for regions within a single
slice. Previously, safe in-place copying was only available as a side
effect of Vec::drain.
2018-09-20 00:57:05 -04:00
bors
d16f27f89a Auto merge of #54301 - alexcrichton:update-curl, r=Mark-Simulacrum
Update some `*-sys` dependencies of Cargo/RLS

This is intended to help solve #54206 on nightly where the RLS on MinGW is
having build issues with accidentally building a `curl` library which links to
pthread symbols on Windows (where it should use native mutex locking instead).
The build system for these `*-sys` crates have all been rewritten to be based on
`cc` to bypass native build systems and platform detection to make sure we
configure them correctly.
2018-09-20 02:51:56 +00:00
Sergio Benitez
adc2c04543 Make 'proc_macro::MultiSpan' public. 2018-09-19 19:22:21 -07:00
Alex Crichton
b1305c22e3 Update some *-sys dependencies of Cargo/RLS
This is intended to help solve #54206 on nightly where the RLS on MinGW is
having build issues with accidentally building a `curl` library which links to
pthread symbols on Windows (where it should use native mutex locking instead).
The build system for these `*-sys` crates have all been rewritten to be based on
`cc` to bypass native build systems and platform detection to make sure we
configure them correctly.
2018-09-19 18:17:58 -07:00
bors
1d33aedaa9 Auto merge of #54211 - nnethercote:keccak-Liveness-memory, r=nikomatsakis
Split `Liveness::users` into three.

This reduces memory usage on some benchmarks because no space is wasted
for padding. For a `check-clean` build of `keccak` it reduces `max-rss`
by 20%.

r? @nikomatsakis, but I want to do a perf run. Locally, I had these results:
- instructions: slight regression
- max-rss: big win on "Clean" builds
- faults: big win on "Clean" and "Nll" builds
- wall-time: small win on "Clean" and "Nll" builds

So I want to see how a different machine compares.
2018-09-20 00:16:46 +00:00
QuietMisdreavus
93321671ca add -Zui-testing to rustdoc 2018-09-19 18:39:39 -05:00
Nicholas Nethercote
99f05e800e Improve handling of type bounds in bit_set.rs.
Currently, `BitSet` doesn't actually know its own domain size; it just
knows how many words it contains. To improve things, this commit makes
the following changes.

- It changes `BitSet` and `SparseBitSet` to store their own domain size,
  and do more precise bounds and same-size checks with it. It also
  changes the signature of `BitSet::to_string()` (and puts it within
  `impl ToString`) now that the domain size need not be passed in from
  outside.

- It uses `derive(RustcDecodable, RustcEncodable)` for `BitSet`. This
  required adding code to handle `PhantomData` in `libserialize`.

- As a result, it removes the domain size from `HybridBitSet`, making a
  lot of that code nicer.

- Both set_up_to() and clear_above() were overly general, working with
  arbitrary sizes when they are only needed for the domain size. The
  commit removes the former, degeneralizes the latter, and removes the
  (overly general) tests.

- Changes `GrowableBitSet::grow()` to `ensure()`, fixing a bug where a
  (1-based) domain size was confused with a (0-based) element index.

- Changes `BitMatrix` to store its row count, and do more precise bounds
  checks with it.

- Changes `ty_params` in `select.rs` from a `BitSet` to a
  `GrowableBitSet` because it repeatedly failed the new, more precise
  bounds checks. (Changing the type was simpler than computing an
  accurate domain size.)

- Various other minor improvements.
2018-09-20 08:52:41 +10:00
Taylor Cramer
1b00f0b9fa Remove spawning from task::Context 2018-09-19 15:01:19 -07:00
Santiago Pastorino
ae42e537db
Add regression test for thread local static mut borrows 2018-09-19 17:54:24 -03:00
Matthew Jasper
bd0895d7d0 Update ui tests 2018-09-19 20:50:09 +01:00
Matthew Jasper
994dc4bd1e Classify outlives constraints when type checking
The MIR/NLL type checker is in a much better position to classify
constraints and already has to classify into boring and interesting.
Adds spans to Locations::All for error reporting
Adds more constraint categories
2018-09-19 20:50:09 +01:00
Matthew Jasper
6e425219f1 Don't claim that locals in a function are declared outside of the
function body
2018-09-19 19:52:55 +01:00
Matthew Jasper
fcd0cd0ade Don't try to use a path to a type alias as a path to the adt it aliases 2018-09-19 19:52:55 +01:00
Matthew Jasper
b210b3168a Make the span of the MIR return place point to the return type 2018-09-19 19:52:55 +01:00
bors
20dc0c5070 Auto merge of #54174 - parched:park, r=alexcrichton
Fix `thread` `park`/`unpark` synchronization

Previously the code below would not be guaranteed to exit when the
second unpark took the `return, // already unparked` path because there
was no write to synchronize with a read in `park`.

EDIT: doesn't actually require third thread
```
use std::sync::atomic::{AtomicBool, Ordering};
use std:🧵:{current, spawn, park};

static FLAG: AtomicBool = AtomicBool::new(false);

fn main() {
    let thread_0 = current();
    spawn(move || {
        thread_0.unpark();
        FLAG.store(true, Ordering::Relaxed);
        thread_0.unpark();
    });

    while !FLAG.load(Ordering::Relaxed) {
        park();
    }
}
```

I have some other ideas on how to improve the performance of `park` and `unpark` using fences, avoiding any atomic RMW when the state is already `NOTIFIED`, and also how to avoid calling `notify_one` without the mutex locked. But I need to write some micro benchmarks first, so I'll submit those changes at a later date if they prove to be faster.

Fixes https://github.com/rust-lang/rust/issues/53366 I hope.
2018-09-19 17:08:28 +00:00
Tom Tromey
e2ff97a14d Pass --batch to gdb
In one of my travis builds, I was surprised to find that the gdb
pager was in use and caused travis to time out.  Adding `--batch`
to the gdb invocation will disable the pager.  Note that the
`-ex q` is retained, to make sure gdb exits with status 0, just in
case `set -e` is in effect somehow.
2018-09-19 09:46:22 -06:00
Artyom Pavlov
fd7565b076
Added tracking issue, fixed check, 1.30 -> 1.31 2018-09-19 18:40:33 +03:00
Philip Munksgaard
c996c4d316 Add support for running doc test in specific edition 2018-09-19 14:32:09 +02:00
bors
4f3ff5a97b Auto merge of #54101 - osa1:issue_54099, r=nikomatsakis
Fix camel case type warning for types with trailing underscores

Fixes #54099
2018-09-19 09:20:36 +00:00
Felix S. Klock II
c9cf499330 Address following error from rustdoc tests:
error[E0106]: missing lifetime specifier
 --> /checkout/obj/build/x86_64-unknown-linux-gnu/test/error-index.md:11424:23
  |
9 | fn demo(s: &mut S) -> &mut String { let p = &mut *(*s).data; p }
  |                       ^ expected lifetime parameter
  |
  = help: this function's return type contains a borrowed value, but the signature does not say which one of `s`'s 2 lifetimes it is borrowed from
2018-09-19 10:31:42 +02:00
Eduard-Mihai Burtescu
046482e95e rustc: future-proof error reporting for polymorphic constants in types. 2018-09-19 11:07:43 +03:00
bors
1e21c9a297 Auto merge of #53877 - withoutboats:compositional-pin, r=aturon
Update to a new pinning API.

~~Blocked on #53843 because of method resolution problems with new pin type.~~

@r? @cramertj

cc @RalfJung @pythonesque anyone interested in #49150
2018-09-19 06:56:19 +00:00
bors
ff6422d7a3 Auto merge of #54318 - nnethercote:use-HybridBitSet-in-SparseBitMatrix, r=pnkfelix
Use `HybridBitSet` in `SparseBitMatrix`.

This fixes most of the remaining NLL memory regression.

r? @pnkfelix, because you reviewed #54286.
cc @nikomatsakis, because NLL
cc @Mark-Simulacrum, because this removes `array_vec.rs`
cc @lqd, because this massively improves `unic-ucd-name`, and probably other public crates
2018-09-19 02:37:37 +00:00
bors
8f376771cf Auto merge of #53995 - davidtwco:issue-53807, r=nikomatsakis
NLL: Deduplicate errors for incorrect move in loop

Fixes #53807.

r? @nikomatsakis
2018-09-19 00:01:51 +00:00
Erich Cordoba
3d662639f6 Remove unneeded clone() from tests
The expected.clone() calls were not needed for the tests. This is
just to keep consistency between the test cases.
2018-09-18 18:32:29 -05:00
Taylor Cramer
574bca7262 Cleanup Deref impls and add ?Sized bound to &mut T impls 2018-09-18 15:42:51 -07:00
steveklabnik
e3d0d0f5ed Update The Book to latest
Let's check out https://github.com/rust-lang/book/pull/1505 on nightly
2018-09-18 16:52:47 -04:00
memoryruins
73fdc81b39 Use expr's span 2018-09-18 15:35:04 -04:00
memoryruins
dff1bc1260 Set diagnostic applicability based on array length 2018-09-18 14:41:34 -04:00
James Duley
a3b87058e7 Expand synchronization comments in park/unpark 2018-09-18 18:06:16 +01:00
Michael Woerister
ca197323b9 incr.comp.: Allow for more fine-grained testing of CGU reuse and use it to test incremental ThinLTO. 2018-09-18 16:33:24 +02:00
Marc-Antoine Perennou
2a45057e17 rustbuild: drop color handling
Let cargo handle that for us

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
2018-09-18 15:02:03 +02:00
Rémy Rakic
e90c942477 Update mir-opt test suite 2018-09-18 14:36:37 +02:00
Remy Rakic
75b94e24bf Create a helper function to retrieve the FakeReadClause at a location 2018-09-18 14:36:37 +02:00
Remy Rakic
ae6479c13b Move comments for fake reads where the causes are defined 2018-09-18 14:36:37 +02:00
Remy Rakic
ab236dfc86 Update NLL 3-point error message for fake reads in optimized let patterns 2018-09-18 14:36:37 +02:00
Remy Rakic
f5e310530a Refactor 'ReadForMatch' into 'FakeRead' and add the cause of the fake read 2018-09-18 14:36:37 +02:00
Remy Rakic
52b5362990 Explain the fake read injection better 2018-09-18 14:34:51 +02:00
Remy Rakic
c3c7a5bafe inject fake read in binding pattern with ascription 2018-09-18 14:34:51 +02:00
Remy Rakic
7216012878 Inject fake read in binding pattern 2018-09-18 14:34:51 +02:00
David Wood
88ca3412e2
Switched from FxHashMap to BTreeMap to preserve ordering when iterating. 2018-09-18 13:55:27 +02:00
David Wood
783bad4295
De-duplicate moved variable errors.
By introducing a new map that tracks the errors reported and the
`Place`s that spawned those errors against the move out that the error
was referring to, we are able to silence duplicate errors by emitting
only the error which corresponds to the most specific `Place` (that which
other `Place`s which reported errors are prefixes of).

This generally is an improvement, however there is a case -
`liveness-move-in-while` - where the output regresses.
2018-09-18 13:51:41 +02:00
David Wood
874e08bdd8
Log when buffering a diagnostic.
This is useful in debugging when and where errors are emitted in
logs.
2018-09-18 13:45:24 +02:00