Commit Graph

83980 Commits

Author SHA1 Message Date
Ralf Jung
c16336a014 move loop detector constants to the module that uses them; make lifetime order in ConstPropagator consistent with Memory 2018-09-20 11:57:45 +02:00
bors
f7f4c500b4 Auto merge of #54255 - spastorino:use-of-moved-value-error, r=nikomatsakis
Inspect parents paths when checking for moves

Closes #52669
2018-09-20 09:02:46 +00:00
Ralf Jung
b1453dda0f make some things a bit more private 2018-09-20 10:36:25 +02:00
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
Scott McMurray
3932249249 Add marker_trait_attr to the unstable book 2018-09-19 22:41:07 -07:00
Scott McMurray
d5b562d4fc Improve error checking and reporting
- Check for valid attributes more reliably
- Don't bloat the error index for boring errors
- Do use real error codes for the interesting ones
2018-09-19 22:31:30 -07:00
Scott McMurray
2187e7a2c3 Enforce that #[marker] traits cannot have associated items 2018-09-19 22:31:30 -07:00
Scott McMurray
7cee7eee72 Require that marker impls are empty, but allow them to overlap 2018-09-19 22:31:30 -07:00
Scott McMurray
6149a83c0b Parse, feature-gate, and validate the #[marker] attribute 2018-09-19 22:31:30 -07:00
Scott McMurray
62c6e4e145 Add an is_marker flag to TraitDef 2018-09-19 22:31:30 -07: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
Guillaume Gomez
2099b3c75c Reduce code block sides padding 2018-09-19 22:59:35 +02: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
Ralf Jung
adcc0d2168 clarify swap 2018-09-18 21:14:31 +02: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