Commit Graph

81050 Commits

Author SHA1 Message Date
Felix S. Klock II
9f05f29e56 Incorporate edition flag testing into tests of -Z borrowck=migrate. 2018-07-26 14:59:00 +02:00
Felix S. Klock II
94a2972d3f compiletest: Add support for ignoring certain tests under --compare-mode=... 2018-07-26 14:51:36 +02:00
Felix S. Klock II
4b2e553dac integrate the edition code.
As a driveby change, I made `#![feature(nll)]` *always* take
precedence over `-Z borrowck`.  The main effect this had is that it
means tests with `#![feature(nll)]` will ignore uses of `-Z
borrowck=compare`. This affected only one test as far as I can tell,
and I think that test used `-Z borrowck=compare` only as a historical
accident.
2018-07-26 14:51:32 +02:00
Felix S. Klock II
1a59dafe11 Bug fix: #![feature(nll)] takes precedence over -Z borrowck=migrate.
(Includes test illustrating desired behavior; compare its diagnostic
output to that of the file `borrowck-migreate-to-nll.rs`.)
2018-07-26 13:17:55 +02:00
Felix S. Klock II
f808405328 Test for -Z borrowck=migrate.
Note that this test is carefully crafted to *try* to not segfault
during its run.  Howver, it really is representing unsound code that
should be rejected after we manage to remove the AST-borrowck entirely
from the compiler.
2018-07-26 13:17:55 +02:00
Felix S. Klock II
91dc3e5b56 Add scary warnings to errors-downgraded-to-warnings in borrowck=migrate.
Also convert an ICE that became reachable code under borrowck=migrate
into a normally reported error (which is then downgraded to a
warning). This actually has a nice side benefit of providing a
somewhat more useful error message, at least in the particular case of
the example from issue #27282.
2018-07-26 13:17:55 +02:00
Felix S. Klock II
3460115157 Allow elaborate_drops to progress under errors that come up during borrowck=migrate. 2018-07-26 13:17:55 +02:00
Felix S. Klock II
ff2f9e0234 Add migrate to list of values for -Z borrowck=... 2018-07-26 13:17:55 +02:00
Felix S. Klock II
a23e8a726c Add -Z borrowck=migrate flag, use it to link NLL up to AST-borrowck. 2018-07-26 13:17:55 +02:00
Felix S. Klock II
655894baf9 Add flag indicating whether AST borrowck query signalled any error. 2018-07-26 13:17:55 +02:00
bors
fefe81605d Auto merge of #52561 - ljedrz:fixme_cc_271, r=alexcrichton
Remove obsolete armv5te vars from the dist-various-1 Dockerfile

The [related cc issue](https://github.com/alexcrichton/cc-rs/issues/271) is closed and its changes are in force.
2018-07-25 09:45:06 +00:00
bors
1398572403 Auto merge of #52680 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 7 pull requests

Successful merges:

 - #52391 (Add unaligned volatile intrinsics)
 - #52402 (impl PartialEq+Eq for BuildHasherDefault)
 - #52645 (Allow declaring existential types inside blocks)
 - #52656 (Stablize Redox Unix Sockets)
 - #52658 (Prefer `Option::map`/etc over `match` wherever it improves clarity)
 - #52668 (clarify pointer offset function safety concerns)
 - #52677 (Release notes: add some missing 1.28 libs stabilization)

Failed merges:

r? @ghost
2018-07-25 00:31:58 +00:00
Mark Rousskov
1deaed9e5e
Rollup merge of #52677 - SimonSapin:relnotes, r=Mark-Simulacrum
Release notes: add some missing 1.28 libs stabilization

Some URLs are not valid yet unless you add `beta/`, but they should be when 1.28 is released.
2018-07-24 16:43:51 -06:00
Mark Rousskov
4bb8c31f10
Rollup merge of #52668 - RalfJung:ptr-doc, r=cramertj
clarify pointer offset function safety concerns
2018-07-24 16:43:50 -06:00
Mark Rousskov
c7a178ea5f
Rollup merge of #52658 - Wallacoloo:topics/use-option-methods, r=cramertj
Prefer `Option::map`/etc over `match` wherever it improves clarity

This isn't intended to change behavior anywhere. A lot of times statements like `match x { None => None, Some(y) => [...] }` can be rewritten using `Option::map` or `Option::and_then` in a way that preserves or improves clarity, so that's what I've done here.

I think it's particularly valuable to keep things in `libcore` and `libstd` pretty/idiomatic since it's not uncommon to follow the `[src]` links when browsing the rust-lang.org docs for std/core. If there's any concern about pushing style-based changes though, I'll happily back out the non-std/core commits here.
2018-07-24 16:43:49 -06:00
Mark Rousskov
28f8cb585a
Rollup merge of #52656 - jD91mZM2:stablize-uds, r=alexcrichton
Stablize Redox Unix Sockets

I don't know if I did this correctly, but I basically spammed the `#[stable]` attribute everywhere :^)
2018-07-24 16:43:48 -06:00
Mark Rousskov
f930017e10
Rollup merge of #52645 - oli-obk:existential_in_fn_body, r=dtolnay
Allow declaring existential types inside blocks

fixes #52631

r? @dtolnay
2018-07-24 16:43:46 -06:00
Mark Rousskov
dab595e96a
Rollup merge of #52402 - crepererum:build_hasher_eq, r=sfackler
impl PartialEq+Eq for BuildHasherDefault

`BuildHasherDefault`is only one way of implementing `BuildHasher`. Clearly, every `BuildHasherDefault` for the same type `H` is identical, since it just uses `Default<H>` to construct `H`. In general, this is not true for every `BuildHasher`, so I think it is helpful to implement `PartialEq` and `Eq`.
2018-07-24 16:43:45 -06:00
Mark Rousskov
06ba69d043
Rollup merge of #52391 - Amanieu:volatile_unaligned, r=alexcrichton
Add unaligned volatile intrinsics

Surprisingly enough, it turns out that unaligned volatile loads are actually useful for certain (very niche) types of lock-free code. I included unaligned volatile stores for completeness, but I currently do not know of any use cases for them.

These are only exposed as intrinsics for now. If they turn out to be useful in practice, we can work towards stabilizing them.

r? @alexcrichton
2018-07-24 16:43:44 -06:00
bors
46804ef0ce Auto merge of #52257 - steveklabnik:refactor-rustdoc, r=QuietMisdreavus
Refactor rustdoc

This is based on https://github.com/rust-lang/rust/pull/52194 and so shouldn't be merged until it gets merged.

Now that plugin functionality has been removed, let's kill PluginManager. Additionally, rustdoc now follows the standard cargo layout instead of dumping everything at the top level.

r? @rust-lang/rustdoc
2018-07-24 22:25:42 +00:00
steveklabnik
0bf2a06bc0 remove zombie code 2018-07-24 16:44:52 -04:00
steveklabnik
86d2ba4f59 remove pluginmanager 2018-07-24 16:44:52 -04:00
Simon Sapin
3cce003f15 Release notes: add some missing 1.28 libs stabilization 2018-07-24 22:35:15 +02:00
bors
487e961c6a Auto merge of #52181 - QuietMisdreavus:panicked-tester, r=GuillaumeGomez
rustdoc: set panic output before starting compiler thread pool

When the compiler was updated to run on a thread pool, rustdoc's processing of compiler/doctest stderr/stdout was moved into each compiler thread. However, this caused output of the test to be lost if the test failed at *runtime* instead of compile time. This change sets up the `set_panic` call and output bomb before starting the compiler thread pool, so that the `Drop` call that writes back to the test's stdout happens after the test runs, not just after it compiles.

Fixes https://github.com/rust-lang/rust/issues/51162
2018-07-24 19:34:11 +00:00
Ralf Jung
fb08915622 clarify offset function safety concerns 2018-07-24 18:23:10 +02:00
QuietMisdreavus
76e33b4eb4 force the doctest rustc thread to share the name of the test 2018-07-24 10:35:55 -05:00
bors
f498e4ec1b Auto merge of #51587 - mark-i-m:at_most_once_rep_2018, r=alexcrichton
2018 edition `?` Kleene operator

This is my first attempt at implementing the migration lint + 2018 behavior as discussed in #48075

r? @nikomatsakis
2018-07-24 15:11:56 +00:00
bors
6a3db033ad Auto merge of #52597 - oli-obk:promotion_simplify, r=nagisa
Promoteds are statics and statics have a place, not just a value

r? @eddyb

This makes everything around promoteds a little simpler
2018-07-24 13:10:06 +00:00
bors
a1e6bcb208 Auto merge of #52189 - cuviper:static-box-leak, r=bluss
doc: Clarify the lifetime returned by `Box::leak`

`Box::leak` mentions that it can return a `'static` reference, but it
wasn't immediately clear to me why it doesn't always do so.  This is
because of the `T: 'a` constraint needed to form a valid reference, and
in general we want to be more flexible than requiring `T: 'static`.
This patch tries to clarify the relationship between `T` and `'a`.
2018-07-24 10:46:21 +00:00
bors
a2af8667b1 Auto merge of #52646 - ljedrz:single_char_pattern, r=michaelwoerister
Change single char str patterns to chars

A `char` is faster.
2018-07-24 08:24:11 +00:00
Oliver Schneider
2e33a557de Allow declaring existential types inside blocks 2018-07-24 10:07:45 +02:00
Colin Wallace
cbe5f1c420 libsyntax_ext: Prefer Option::map over match where applicable 2018-07-23 22:06:45 -07:00
Colin Wallace
10d82137b3 librustc: Prefer Option::map/etc over match where applicable 2018-07-23 22:05:45 -07:00
Colin Wallace
727bd7de7e libcore: Prefer Option::map over match where applicable 2018-07-23 22:04:33 -07:00
Colin Wallace
4f3ab4986e libstd: Prefer Option::map/etc over match where applicable 2018-07-23 22:00:51 -07:00
jD91mZM2
1581971635
Stablize Redox Unix Sockets 2018-07-24 06:25:29 +02:00
bors
baba5007bf Auto merge of #52655 - kennytm:rollup, r=kennytm
Rollup of 10 pull requests

Successful merges:

 - #52538 (Remove obsolete flags in the i586_musl Dockerfile)
 - #52548 (Cursor: update docs to clarify Cursor only works with in-memory buffers)
 - #52605 (Do not suggest using `to_owned()` on `&str += &str`)
 - #52621 (Fix color detection for Windows msys terminals.)
 - #52622 (Use MultiSpan in E0707 and E709)
 - #52627 (Compile rustc before building tests for rustdoc)
 - #52637 (Don't use NonNull::dangling as sentinel value in Rc, Arc)
 - #52640 (Forget Waker when cloning LocalWaker)
 - #52641 (Simplify 2 functions in rustc_mir/dataflow)
 - #52642 (Replace a few expect+format combos with unwrap_or_else+panic)

Failed merges:

r? @ghost
2018-07-24 03:01:11 +00:00
mark
10ee0f68a6 Allow by default, fix tests 2018-07-23 21:55:51 -05:00
mark
6cb09ccf9f dump lints _after_ parsing macros 2018-07-23 21:55:51 -05:00
mark
b206aedb1b make it a migration lint 2018-07-23 21:55:51 -05:00
mark
5d872727e0 Fix test and errors 2018-07-23 21:54:43 -05:00
mark
63c2d06a0d update nightly book 2018-07-23 21:54:43 -05:00
mark
8eb4941e30 Implement 2015 vs 2018 ? kleene op + test 2018-07-23 21:54:43 -05:00
mark
2a7ae04a68 Extend ParseSess to support buffering lints 2018-07-23 21:54:43 -05:00
kennytm
3efc612a93
Rollup merge of #52642 - ljedrz:expect_fun_call, r=Mark-Simulacrum
Replace a few expect+format combos with unwrap_or_else+panic

That way the error strings won't be created if the related errors are not triggered.
2018-07-24 09:50:00 +08:00
kennytm
378ef99eb3
Rollup merge of #52641 - ljedrz:mir_dataflow_misc, r=cramertj
Simplify 2 functions in rustc_mir/dataflow

- `graphviz::outgoing`: the `enumerate` only provides indices; use a range instead
- `DataflowState::interpret_set`: change a push loop to an iterator and remove the `each_bit` helper function
2018-07-24 09:49:59 +08:00
kennytm
b3c9fe2537
Rollup merge of #52640 - Thomasdezeeuw:fix-localwaker-clone, r=cramertj
Forget Waker when cloning LocalWaker

Since NonNull is Copy the inner field of the cloned Waker was copied for
use in the new LocalWaker, however this left Waker to be dropped. Which
means that when cloning LocalWaker would also erroneously call drop_raw.

This change forgets the Waker, rather then dropping it, leaving the
inner field to be used by the returned LocalWaker.

Closes #52629.
2018-07-24 09:49:58 +08:00
kennytm
3af372ad57
Rollup merge of #52637 - RalfJung:rc, r=joshtriplett
Don't use NonNull::dangling as sentinel value in Rc, Arc

Instead, rely on alignment and use usize::MAX as sentinel.

Cc #52508

r? @joshtriplett
2018-07-24 09:49:56 +08:00
kennytm
4084f0ee8a
Rollup merge of #52627 - Mark-Simulacrum:rustdoc-test-correct, r=alexcrichton
Compile rustc before building tests for rustdoc

r? @alexcrichton
2018-07-24 09:49:55 +08:00
kennytm
291a62064c
Rollup merge of #52622 - estebank:lifetime-multispan, r=nikomatsakis
Use MultiSpan in E0707 and E709
2018-07-24 09:49:54 +08:00