]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAuto merge of #49981 - nox:fix-signed-niches, r=eddyb
bors [Wed, 18 Apr 2018 12:22:11 +0000 (12:22 +0000)]
Auto merge of #49981 - nox:fix-signed-niches, r=eddyb

Properly handle ranges of signed enums using both extremums (fixes #49973)

Fixes #49973.

6 years agoAuto merge of #49349 - Zoxc:sync-errors, r=michaelwoerister
bors [Wed, 18 Apr 2018 08:29:14 +0000 (08:29 +0000)]
Auto merge of #49349 - Zoxc:sync-errors, r=michaelwoerister

Make Handler more thread-safe

The use of `code_emitted` to suppress extended explanations is not thread safe. I'm not sure why we keep the documentation for errors outside `diagnostics.rs` anyway. It would be better to add a `teach` method to `DiagnosticsBuilder`, so instead of:
```
if self.tcx.sess.teach(&err.get_code().unwrap()) {
    err.note("...");
}
```
we'd use `err.teach("...")`

cc @estebank

r? @michaelwoerister

6 years agoAuto merge of #49972 - Mark-Simulacrum:remove-build, r=alexcrichton
bors [Wed, 18 Apr 2018 05:54:21 +0000 (05:54 +0000)]
Auto merge of #49972 - Mark-Simulacrum:remove-build, r=alexcrichton

Remove uses of Build across Builder steps

This is purely a code cleanup; there should be no functional changes.

r? @alexcrichton

6 years agoAuto merge of #49969 - mark-i-m:allocator_fmt, r=estebank
bors [Wed, 18 Apr 2018 03:35:55 +0000 (03:35 +0000)]
Auto merge of #49969 - mark-i-m:allocator_fmt, r=estebank

Various rustfmt and commenting changes

These are factored out of #49320

There aren't actually any changes in functionality, just rustfmt and doccomments.

6 years agoRemove uses of Build across Builder steps
Mark Simulacrum [Sat, 14 Apr 2018 23:27:57 +0000 (17:27 -0600)]
Remove uses of Build across Builder steps

6 years agoAuto merge of #49950 - Zoxc:default-span, r=estebank
bors [Wed, 18 Apr 2018 01:04:04 +0000 (01:04 +0000)]
Auto merge of #49950 - Zoxc:default-span, r=estebank

Improve query cycle error message

r? @michaelwoerister

6 years agoAuto merge of #50036 - nrc:update, r=alexcrichton
bors [Tue, 17 Apr 2018 21:56:50 +0000 (21:56 +0000)]
Auto merge of #50036 - nrc:update, r=alexcrichton

Update Rustfmt

Fixes RLS and Rustfmt and enables a new nightly

r? @alexcrichton

6 years agoUpdate Rustfmt
Nick Cameron [Tue, 17 Apr 2018 20:21:19 +0000 (08:21 +1200)]
Update Rustfmt

6 years agoAuto merge of #49904 - michaelwoerister:no-debug-attr, r=alexcrichton
bors [Tue, 17 Apr 2018 19:26:25 +0000 (19:26 +0000)]
Auto merge of #49904 - michaelwoerister:no-debug-attr, r=alexcrichton

Work around LLVM debuginfo problem in librustc_driver.

Works around a problem (https://github.com/rust-lang/rust/issues/48910) with global variable debuginfo generation for `rustc_driver::get_trans::LOAD` by applying `#[no_debug]` to it (which just disables debuginfo generation for that variable). This way we can build the compiler with debuginfo again.

Since the problem is also present in beta, this workaround might have to be backported.

r? @alexcrichton

6 years agoAuto merge of #50033 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Tue, 17 Apr 2018 16:51:55 +0000 (16:51 +0000)]
Auto merge of #50033 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 4 pull requests

Successful merges:

 - #49699 (Removed 'proc' from the reserved keywords list)
 - #49966 (Multiple query search)
 - #50013 (Remove no longer necessary comparison to Vec::splice.)
 - #50032 (rustdoc: Don't include private paths in all.html)

Failed merges:

6 years agoRollup merge of #50032 - ollie27:rustdoc_all_private, r=GuillaumeGomez
Guillaume Gomez [Tue, 17 Apr 2018 16:43:17 +0000 (18:43 +0200)]
Rollup merge of #50032 - ollie27:rustdoc_all_private, r=GuillaumeGomez

rustdoc: Don't include private paths in all.html

For example the `std` [`all.html`](https://doc.rust-lang.org/nightly/std/all.html) includes references to the `coresimd` module which is a private implementation detail.

r? @GuillaumeGomez

6 years agoRollup merge of #50013 - frewsxcv:frewsxcv-ssplice, r=GuillaumeGomez
Guillaume Gomez [Tue, 17 Apr 2018 16:43:16 +0000 (18:43 +0200)]
Rollup merge of #50013 - frewsxcv:frewsxcv-ssplice, r=GuillaumeGomez

Remove no longer necessary comparison to Vec::splice.

`String::replace_range` was previously called `String::splice`, so this
note was necessary to differentiate it from the `Vec` method. Now that
it's renamed, this note no longer seems necessary.

6 years agoRollup merge of #49966 - GuillaumeGomez:comma-search, r=QuietMisdreavus
Guillaume Gomez [Tue, 17 Apr 2018 16:43:15 +0000 (18:43 +0200)]
Rollup merge of #49966 - GuillaumeGomez:comma-search, r=QuietMisdreavus

Multiple query search

Part of #49757.

r? @QuietMisdreavus

6 years agoRollup merge of #49699 - zesterer:master, r=joshtriplett
Guillaume Gomez [Tue, 17 Apr 2018 16:43:13 +0000 (18:43 +0200)]
Rollup merge of #49699 - zesterer:master, r=joshtriplett

Removed 'proc' from the reserved keywords list

Remove 'proc' from the reserved keywords list.

'proc' is a very useful identifier name for a lot of things. It's especially useful when dealing with processes, operating system internals, and kernel development.

6 years agoTurn some comments into doccomments
Mark Mansi [Sat, 14 Apr 2018 01:05:01 +0000 (20:05 -0500)]
Turn some comments into doccomments

6 years agorun rustfmt on rustc_driver/driver.rs
Mark Mansi [Sat, 14 Apr 2018 01:04:38 +0000 (20:04 -0500)]
run rustfmt on rustc_driver/driver.rs

6 years agoRun rustfmt
Mark Mansi [Fri, 13 Apr 2018 20:58:16 +0000 (15:58 -0500)]
Run rustfmt

6 years agoMake one_time_diagnostics thread-safe
John Kåre Alsaker [Sun, 1 Apr 2018 06:22:40 +0000 (08:22 +0200)]
Make one_time_diagnostics thread-safe

6 years agoMake Handler more thread-safe
John Kåre Alsaker [Sat, 3 Mar 2018 05:20:26 +0000 (06:20 +0100)]
Make Handler more thread-safe

6 years agoAuto merge of #49836 - nikomatsakis:nll-facts-prep, r=pnkfelix
bors [Tue, 17 Apr 2018 14:23:57 +0000 (14:23 +0000)]
Auto merge of #49836 - nikomatsakis:nll-facts-prep, r=pnkfelix

prep work for using timely dataflow with NLL

Two major changes:

**Two-phase borrows are overhauled.** We no longer have two bits per borrow. Instead, we track -- for each borrow -- an (optional) "activation point". Then, for each point P where the borrow is in scope, we check where P falls relative to the activation point. If P is between the reservation point and the activation point, then this is the "reservation" phase of the borrow, else the borrow is considered active. This is simpler and means that the dataflow doesn't have to care about 2-phase at all, at last not yet.

**We no longer support using the MIR borrow checker without NLL.** It is going to be increasingly untenable to support lexical mode as we go forward, I think, and also of increasingly little value. This also exposed a few bugs in NLL mode due to increased testing.

r? @pnkfelix
cc @bobtwinkles

6 years agoClean up attribute handling in create_function_debug_context().
Michael Woerister [Thu, 12 Apr 2018 12:52:43 +0000 (14:52 +0200)]
Clean up attribute handling in create_function_debug_context().

6 years agoUse #[no_debug] to work around LLVM problem with rustc_driver::get_trans::LOAD.
Michael Woerister [Thu, 12 Apr 2018 12:53:50 +0000 (14:53 +0200)]
Use #[no_debug] to work around LLVM problem with rustc_driver::get_trans::LOAD.

6 years agoSupport #[no_debug] for global variables.
Michael Woerister [Thu, 12 Apr 2018 12:52:09 +0000 (14:52 +0200)]
Support #[no_debug] for global variables.

6 years agoAdd #[no_debug] to trans_fn_attrs() query.
Michael Woerister [Thu, 12 Apr 2018 12:51:10 +0000 (14:51 +0200)]
Add #[no_debug] to trans_fn_attrs() query.

6 years agoAuto merge of #49626 - fanzier:chalk-lowering, r=scalexm
bors [Tue, 17 Apr 2018 11:31:19 +0000 (11:31 +0000)]
Auto merge of #49626 - fanzier:chalk-lowering, r=scalexm

Implement Chalk lowering rule Normalize-From-Impl

This extends the Chalk lowering pass with the "Normalize-From-Impl" rule for generating program clauses from a trait definition as part of #49177.

r? @nikomatsakis

6 years agoAuto merge of #49542 - GuillaumeGomez:intra-link-resolution-error, r=GuillaumeGomez
bors [Tue, 17 Apr 2018 09:02:03 +0000 (09:02 +0000)]
Auto merge of #49542 - GuillaumeGomez:intra-link-resolution-error, r=GuillaumeGomez

Add warning if a resolution failed

r? @QuietMisdreavus

6 years agoAuto merge of #49882 - Zoxc:sync-misc2, r=michaelwoerister
bors [Tue, 17 Apr 2018 06:46:31 +0000 (06:46 +0000)]
Auto merge of #49882 - Zoxc:sync-misc2, r=michaelwoerister

More thread-safety changes

r? @michaelwoerister

6 years agoAuto merge of #49664 - alexcrichton:stable-simd, r=BurntSushi
bors [Tue, 17 Apr 2018 03:57:22 +0000 (03:57 +0000)]
Auto merge of #49664 - alexcrichton:stable-simd, r=BurntSushi

Stabilize x86/x86_64 SIMD

This commit stabilizes the SIMD in Rust for the x86/x86_64 platforms. Notably
this commit is stabilizing:

* The `std::arch::{x86, x86_64}` modules and the intrinsics contained inside.
* The `is_x86_feature_detected!` macro in the standard library
* The `#[target_feature(enable = "...")]` attribute
* The `#[cfg(target_feature = "...")]` matcher

Stabilization of the module and intrinsics were primarily done in
rust-lang-nursery/stdsimd#414 and the two attribute stabilizations are done in
this commit. The standard library is also tweaked a bit with the new way that
stdsimd is integrated.

Note that other architectures like `std::arch::arm` are not stabilized as part
of this commit, they will likely stabilize in the future after they've been
implemented and fleshed out. Similarly the `std::simd` module is also not being
stabilized in this commit, only `std::arch`. Finally, nothing related to `__m64`
is stabilized in this commit either (MMX), only SSE and up types and intrinsics
are stabilized.

Closes #29717
Closes #44839
Closes #48556

6 years agoAuto merge of #50012 - Zoxc:msvc-fix, r=Mark-Simulacrum
bors [Tue, 17 Apr 2018 01:41:43 +0000 (01:41 +0000)]
Auto merge of #50012 - Zoxc:msvc-fix, r=Mark-Simulacrum

Don't look for cc/cxx when testing with bogus targets

This fixes test builds on Windows.

r? @Mark-Simulacrum

6 years agoRemove no longer necessary comparison to Vec::splice.
Corey Farwell [Tue, 17 Apr 2018 01:23:06 +0000 (10:23 +0900)]
Remove no longer necessary comparison to Vec::splice.

`String::replace_range` was previously called `String::splice`, so this
note was necessary to differentiate it from the `Vec` method. Now that
it's renamed, this note no longer seems necessary.

6 years agoDon't look for cc/cxx when testing with bogus targets
John Kåre Alsaker [Mon, 16 Apr 2018 23:59:00 +0000 (01:59 +0200)]
Don't look for cc/cxx when testing with bogus targets

6 years agoAuto merge of #49488 - alexcrichton:small-wasm-panic, r=sfackler
bors [Mon, 16 Apr 2018 23:19:41 +0000 (23:19 +0000)]
Auto merge of #49488 - alexcrichton:small-wasm-panic, r=sfackler

std: Minimize size of panicking on wasm

This commit applies a few code size optimizations for the wasm target to
the standard library, namely around panics. We notably know that in most
configurations it's impossible for us to print anything in
wasm32-unknown-unknown so we can skip larger portions of panicking that
are otherwise simply informative. This allows us to get quite a nice
size reduction.

Finally we can also tweak where the allocation happens for the
`Box<Any>` that we panic with. By only allocating once unwinding starts
we can reduce the size of a panicking wasm module from 44k to 350 bytes.

6 years agoRemove unwanted auto-linking and update
Guillaume Gomez [Sun, 15 Apr 2018 14:17:18 +0000 (16:17 +0200)]
Remove unwanted auto-linking and update

6 years agoFix empty tests
Guillaume Gomez [Sun, 15 Apr 2018 11:05:14 +0000 (13:05 +0200)]
Fix empty tests

6 years agoFix nits
Guillaume Gomez [Sat, 7 Apr 2018 16:41:16 +0000 (18:41 +0200)]
Fix nits

6 years agoAdd rustdoc-ui test suite
Guillaume Gomez [Sun, 1 Apr 2018 19:06:35 +0000 (21:06 +0200)]
Add rustdoc-ui test suite

6 years agoAdd error-format and color-config options to rustdoc
Guillaume Gomez [Sat, 31 Mar 2018 22:09:00 +0000 (00:09 +0200)]
Add error-format and color-config options to rustdoc

6 years agoAdd warning if a resolution failed
Guillaume Gomez [Sat, 31 Mar 2018 12:49:56 +0000 (14:49 +0200)]
Add warning if a resolution failed

6 years agoUpdate tests
John Kåre Alsaker [Sun, 15 Apr 2018 21:21:00 +0000 (23:21 +0200)]
Update tests

6 years agoImprove query cycle error message
John Kåre Alsaker [Fri, 13 Apr 2018 20:20:10 +0000 (22:20 +0200)]
Improve query cycle error message

6 years agoCall default_span lazily when query cycles occur instead of in the hot path for queries
John Kåre Alsaker [Fri, 13 Apr 2018 17:22:22 +0000 (19:22 +0200)]
Call default_span lazily when query cycles occur instead of in the hot path for queries

6 years agoSeparately gate each target_feature feature
Alex Crichton [Thu, 5 Apr 2018 15:02:11 +0000 (08:02 -0700)]
Separately gate each target_feature feature

Use an explicit whitelist for what features are actually stable and can be
enabled.

6 years agoAuto merge of #50003 - kennytm:rollup, r=kennytm
bors [Mon, 16 Apr 2018 20:35:57 +0000 (20:35 +0000)]
Auto merge of #50003 - kennytm:rollup, r=kennytm

Rollup of 8 pull requests

Successful merges:

 - #49555 (Inline most of the code paths for conversions with boxed slices)
 - #49606 (Prevent broken pipes causing ICEs)
 - #49646 (Use box syntax instead of Box::new in Mutex::remutex on Windows)
 - #49647 (Remove `underscore_lifetimes` and `match_default_bindings` from active feature list)
 - #49931 (Fix incorrect span in `&mut` suggestion)
 - #49959 (rustbuild: allow building tools with debuginfo)
 - #49965 (Remove warning about f64->f32 cast being potential UB)
 - #49994 (Remove unnecessary indentation in rustdoc book codeblock.)

Failed merges:

6 years agoRollup merge of #49647 - kennytm:duplicated-features, r=aturon
kennytm [Mon, 16 Apr 2018 19:34:55 +0000 (03:34 +0800)]
Rollup merge of #49647 - kennytm:duplicated-features, r=aturon

Remove `underscore_lifetimes` and `match_default_bindings` from active feature list

These are already stabilized in 1.26.

6 years agoRollup merge of #49994 - frewsxcv:frewsxcv-doc-tests, r=QuietMisdreavus
kennytm [Mon, 16 Apr 2018 17:51:05 +0000 (01:51 +0800)]
Rollup merge of #49994 - frewsxcv:frewsxcv-doc-tests, r=QuietMisdreavus

Remove unnecessary indentation in rustdoc book codeblock.

None

6 years agoRollup merge of #49965 - nikic:fix-49622, r=rkruppe
kennytm [Mon, 16 Apr 2018 17:51:04 +0000 (01:51 +0800)]
Rollup merge of #49965 - nikic:fix-49622, r=rkruppe

Remove warning about f64->f32 cast being potential UB

As discussed in #15536, the LLVM documentation incorrect described overflowing f64->f32 casts as being undefined behavior. LLVM never treated them as such, and the documentation has been adjusted in https://reviews.llvm.org/rL329065. As such, this warning can now be removed.

Closes #49622.

---

I could not find any existing test checking for this warning. Should I be adding a test for the absence of the warning instead?

6 years agoRollup merge of #49959 - cuviper:debuginfo-tools, r=Mark-Simulacrum
kennytm [Mon, 16 Apr 2018 17:51:02 +0000 (01:51 +0800)]
Rollup merge of #49959 - cuviper:debuginfo-tools, r=Mark-Simulacrum

rustbuild: allow building tools with debuginfo

Debugging information for the extended tools is currently disabled for
concerns about the size.  This patch adds `--enable-debuginfo-tools` to
let one opt into having that debuginfo.

This is useful for debugging the tools in distro packages.  We always
strip debuginfo into separate packages anyway, so the extra size is not
a concern in regular use.

6 years agoRollup merge of #49931 - csmoe:end_span, r=estebank
kennytm [Mon, 16 Apr 2018 17:51:01 +0000 (01:51 +0800)]
Rollup merge of #49931 - csmoe:end_span, r=estebank

Fix incorrect span in `&mut` suggestion

Fixes #49859

6 years agoRemove `underscore_lifetimes` and `match_default_bindings` from active feature list
kennytm [Wed, 4 Apr 2018 10:43:00 +0000 (18:43 +0800)]
Remove `underscore_lifetimes` and `match_default_bindings` from active feature list

These are already stabilized in 1.26.

6 years agoRollup merge of #49646 - glandium:uninitialized-box, r=alexcrichton
kennytm [Mon, 16 Apr 2018 17:50:59 +0000 (01:50 +0800)]
Rollup merge of #49646 - glandium:uninitialized-box, r=alexcrichton

Use box syntax instead of Box::new in Mutex::remutex on Windows

The Box::new(mem::uninitialized()) pattern actually actively copies
uninitialized bytes from the stack into the box, which is a waste of
time. Using the box syntax instead avoids the useless copy.

6 years agoRollup merge of #49606 - varkor:pipe-repair, r=alexcrichton
kennytm [Mon, 16 Apr 2018 17:50:58 +0000 (01:50 +0800)]
Rollup merge of #49606 - varkor:pipe-repair, r=alexcrichton

Prevent broken pipes causing ICEs

As the private `std::io::print_to` panics if there is an I/O error, which is used by `println!`, the compiler would ICE if one attempted to use a broken pipe (e.g. `rustc --help | false`). This introduces a new (private) macro `try_println!` which allows us to avoid this.

As a side note, it seems this macro might be useful publicly (and actually there seems to be [a crate specifically for this purpose](https://crates.io/crates/try_print/)), though that can probably be left for a future discussion.

One slight alternative approach would be to simply early exit without an error (i.e. exit code `0`), which [this comment](https://github.com/rust-lang/rust/issues/34376#issuecomment-377822526) suggests is the usual approach. I've opted not to take that approach initially, because I think it's more helpful to know when there is a broken pipe.

Fixes #34376.

6 years agoRollup merge of #49555 - nox:inline-into-boxed, r=alexcrichton
kennytm [Mon, 16 Apr 2018 17:50:56 +0000 (01:50 +0800)]
Rollup merge of #49555 - nox:inline-into-boxed, r=alexcrichton

Inline most of the code paths for conversions with boxed slices

This helps with the specific problem described in #49541, obviously without making any large change to how inlining works in the general case.

Everything involved in the conversions is made `#[inline]`, except for the `<Vec<T>>::into_boxed_slice` entry point which is made `#[inline(always)]` after checking that duplicating the function mentioned in the issue prevented its inlining if I only annotate it with
`#[inline]`.

For the record, that function was:

```rust
pub fn foo() -> Box<[u8]> {
    vec![0].into_boxed_slice()
}
```

To help the inliner's job, we also hoist a `self.capacity() != self.len` check in `<Vec<T>>::shrink_to_fit` and mark it as `#[inline]` too.

6 years agoAuto merge of #49130 - smmalis37:range, r=alexcrichton
bors [Mon, 16 Apr 2018 16:07:10 +0000 (16:07 +0000)]
Auto merge of #49130 - smmalis37:range, r=alexcrichton

Move Range*::contains to a single default impl on RangeBounds

Per the ongoing discussion in #32311.

This is my first PR to Rust (woo!), so I don't know if this requires an amendment to the original range_contains RFC, or not, or if we can just do a psuedo-RFC here. While this may no longer follow the explicit decision made in that RFC, I believe this better follows its spirit by adding the new contains method to all Ranges. It also allows users to be generic over all ranges and use this method without writing it themselves (my personal desired use case).

This also somewhat answers the unanswered question about Wrapping ranges in the above issue by instead just punting it to the question of what those types should return for start() & end(), or if they should implement RangeArgument at all. Those types could also implement their own contains method without implementing this trait, in which case the question remains the same.

This does add a new contains method to types that already implemented RangeArgument but not contains. These types are RangeFull, (Bound<T>, Bound<T>), (Bound<&'a T>, Bound<&'a T>). No tests have been added for these types yet. No inherent method has been added either.

r? @alexcrichton

6 years agoStabilize x86/x86_64 SIMD
Alex Crichton [Tue, 3 Apr 2018 18:11:49 +0000 (11:11 -0700)]
Stabilize x86/x86_64 SIMD

This commit stabilizes the SIMD in Rust for the x86/x86_64 platforms. Notably
this commit is stabilizing:

* The `std::arch::{x86, x86_64}` modules and the intrinsics contained inside.
* The `is_x86_feature_detected!` macro in the standard library
* The `#[target_feature(enable = "...")]` attribute
* The `#[cfg(target_feature = "...")]` matcher

Stabilization of the module and intrinsics were primarily done in
rust-lang-nursery/stdsimd#414 and the two attribute stabilizations are done in
this commit. The standard library is also tweaked a bit with the new way that
stdsimd is integrated.

Note that other architectures like `std::arch::arm` are not stabilized as part
of this commit, they will likely stabilize in the future after they've been
implemented and fleshed out. Similarly the `std::simd` module is also not being
stabilized in this commit, only `std::arch`. Finally, nothing related to `__m64`
is stabilized in this commit either (MMX), only SSE and up types and intrinsics
are stabilized.

Closes #29717
Closes #44839
Closes #48556

6 years agoAuto merge of #48945 - clarcharr:iter_exhaust, r=Kimundi
bors [Mon, 16 Apr 2018 13:21:56 +0000 (13:21 +0000)]
Auto merge of #48945 - clarcharr:iter_exhaust, r=Kimundi

Replace manual iterator exhaust with for_each(drop)

This originally added a dedicated method, `Iterator::exhaust`, and has since been replaced with `for_each(drop)`, which is more idiomatic.

<del>This is just shorthand for `for _ in &mut self {}` or `while let Some(_) = self.next() {}`. This states the intent a lot more clearly than the identical code: run the iterator to completion.

<del>At least personally, my eyes tend to gloss over `for _ in &mut self {}` without fully paying attention to what it does; having a `Drop` implementation akin to:

<del>`for _ in &mut self {}; unsafe { free(self.ptr); }`</del>

<del>Is not as clear as:

<del>`self.exhaust(); unsafe { free(self.ptr); }`

<del>Additionally, I've seen debate over whether `while let Some(_) = self.next() {}` or `for _ in &mut self {}` is more clear, whereas `self.exhaust()` is clearer than both.

6 years agoAuto merge of #49433 - varkor:metadata-skip-mir-opt, r=michaelwoerister
bors [Mon, 16 Apr 2018 10:30:57 +0000 (10:30 +0000)]
Auto merge of #49433 - varkor:metadata-skip-mir-opt, r=michaelwoerister

Skip MIR encoding for cargo check

Resolves #48662.

r? @michaelwoerister

6 years agoAuto merge of #49963 - llogiq:stabilize-13226, r=kennytm
bors [Mon, 16 Apr 2018 07:44:25 +0000 (07:44 +0000)]
Auto merge of #49963 - llogiq:stabilize-13226, r=kennytm

stabilize fetch_nand

This closes #13226 and makes `Atomic*.fetch_nand` stable.

6 years agoRemove unnecessary indentation in rustdoc book codeblock.
Corey Farwell [Mon, 16 Apr 2018 07:25:57 +0000 (16:25 +0900)]
Remove unnecessary indentation in rustdoc book codeblock.

6 years agoAuto merge of #49956 - QuietMisdreavus:rustdoc-codegen, r=GuillaumeGomez
bors [Mon, 16 Apr 2018 05:00:14 +0000 (05:00 +0000)]
Auto merge of #49956 - QuietMisdreavus:rustdoc-codegen, r=GuillaumeGomez

rustdoc: port the -C option from rustc

Blocked on https://github.com/rust-lang/rust/pull/49864. The included test won't work without those changes, so this PR includes those commits as well.

When documenting items that require certain target features, it helps to be able to force those target features into existence. Rather than include a flag just to parse those features, i instead decided to port the `-C` flag from rustc in its entirety. It takes the same parameters, because it runs through the same parsing function. This has the added benefit of being able to control the codegen of doctests as well.

One concern i have with the flag is that i set it to stable here. My rationale is that it is a direct port of functionality on rustc that is currently stable, used only in mechanisms that it is originally used for. If needed, i can set it back to be unstable.

6 years agoAuto merge of #49847 - sinkuu:save_analysis_implicit_extern, r=petrochenkov
bors [Mon, 16 Apr 2018 02:34:32 +0000 (02:34 +0000)]
Auto merge of #49847 - sinkuu:save_analysis_implicit_extern, r=petrochenkov

Fix save-analysis generation with extern_in_paths/extern_absolute_paths

Fixes #48742.

6 years agoUse locks for Session.lint_store and Session.buffered_lints
John Kåre Alsaker [Fri, 13 Apr 2018 17:33:31 +0000 (19:33 +0200)]
Use locks for Session.lint_store and Session.buffered_lints

6 years agoAuto merge of #49719 - mark-i-m:no_sep, r=petrochenkov
bors [Mon, 16 Apr 2018 00:06:10 +0000 (00:06 +0000)]
Auto merge of #49719 - mark-i-m:no_sep, r=petrochenkov

Update `?` repetition disambiguation.

**Do not merge** (yet)

This is a test implementation of some ideas from discussion in https://github.com/rust-lang/rust/issues/48075 . This PR
- disallows `?` repetition from taking a separator, since the separator is never used.
- disallows the use of `?` as a separator. This allows patterns like `$(a)?+` to match `+` and `a+` rather than `a?a?a`. This is a _breaking change_, but maybe that's ok? Perhaps a crater run is the right approach?

cc @durka @alexreg @nikomatsakis

6 years agoRebase and fix conflicts.
Fabian Zaiser [Sun, 15 Apr 2018 21:49:41 +0000 (23:49 +0200)]
Rebase and fix conflicts.

6 years agoStop duplicating where clauses from impl's.
Fabian Zaiser [Wed, 11 Apr 2018 19:20:25 +0000 (21:20 +0200)]
Stop duplicating where clauses from impl's.

6 years agoRebase and update code.
Fabian Zaiser [Wed, 11 Apr 2018 12:27:00 +0000 (14:27 +0200)]
Rebase and update code.

6 years agoImprove function name.
Fabian Zaiser [Sat, 7 Apr 2018 00:04:28 +0000 (02:04 +0200)]
Improve function name.

6 years agoImplement Chalk lowering rule Normalize-From-Impl
Fabian Zaiser [Tue, 3 Apr 2018 15:53:13 +0000 (17:53 +0200)]
Implement Chalk lowering rule Normalize-From-Impl

6 years agoAuto merge of #49947 - oli-obk:turing_complete_const_eval, r=nagisa
bors [Sun, 15 Apr 2018 21:18:37 +0000 (21:18 +0000)]
Auto merge of #49947 - oli-obk:turing_complete_const_eval, r=nagisa

Don't abort const eval due to long running evals, just warn

one check-box of #49930

r? @nagisa (https://github.com/rust-lang/rfcs/pull/2344#issuecomment-368246665)

6 years agoTweaks to intern_ty
John Kåre Alsaker [Fri, 13 Apr 2018 17:33:21 +0000 (19:33 +0200)]
Tweaks to intern_ty

6 years agoMake use of thread-safe arenas
John Kåre Alsaker [Sun, 15 Apr 2018 14:01:38 +0000 (16:01 +0200)]
Make use of thread-safe arenas

6 years agoMake arenas thread safe
John Kåre Alsaker [Sun, 3 Dec 2017 12:49:46 +0000 (13:49 +0100)]
Make arenas thread safe

6 years agoAdd misc timings
John Kåre Alsaker [Thu, 15 Mar 2018 09:17:04 +0000 (10:17 +0100)]
Add misc timings

6 years agoMake layout_depth thread-safe
John Kåre Alsaker [Fri, 6 Apr 2018 12:53:11 +0000 (14:53 +0200)]
Make layout_depth thread-safe

6 years agoCheck generated save-analysis, instead of `bug!()`ing
Shotaro Yamada [Sun, 15 Apr 2018 11:47:45 +0000 (20:47 +0900)]
Check generated save-analysis, instead of `bug!()`ing

Injected crates don't have extern info. Let's skip them.

6 years agoAuto merge of #49833 - oli-obk:incremental_miri_regression, r=michaelwoerister
bors [Sun, 15 Apr 2018 12:32:13 +0000 (12:32 +0000)]
Auto merge of #49833 - oli-obk:incremental_miri_regression, r=michaelwoerister

Don't recurse into allocations, use a global table instead

r? @michaelwoerister

fixes #49663

6 years agoProperly handle ranges of signed enums using both extremums (fixes #49973)
Anthony Ramine [Sun, 15 Apr 2018 11:38:00 +0000 (13:38 +0200)]
Properly handle ranges of signed enums using both extremums (fixes #49973)

6 years agoAdd a tracking issue for making the warning a lint
Oliver Schneider [Sun, 15 Apr 2018 11:28:15 +0000 (13:28 +0200)]
Add a tracking issue for making the warning a lint

6 years agos/`use_mir`/`use_mir_borrowck`/
Niko Matsakis [Tue, 10 Apr 2018 13:11:31 +0000 (09:11 -0400)]
s/`use_mir`/`use_mir_borrowck`/

6 years agoremove -Znll -- borrowck=mir implies nll now
Niko Matsakis [Mon, 9 Apr 2018 09:28:00 +0000 (05:28 -0400)]
remove -Znll -- borrowck=mir implies nll now

6 years agodon't expose the `borrows` field
Niko Matsakis [Sat, 7 Apr 2018 12:20:24 +0000 (08:20 -0400)]
don't expose the `borrows` field

6 years agojust use an iterator
Niko Matsakis [Sat, 7 Apr 2018 12:08:27 +0000 (08:08 -0400)]
just use an iterator

6 years agostop using `borrows` for anything but iterating over live data
Niko Matsakis [Sat, 7 Apr 2018 12:01:21 +0000 (08:01 -0400)]
stop using `borrows` for anything but iterating over live data

6 years agothread borrow-set around more
Niko Matsakis [Sat, 7 Apr 2018 11:11:01 +0000 (07:11 -0400)]
thread borrow-set around more

6 years agoremove `ReserveOrActivateIndex`
Niko Matsakis [Sat, 7 Apr 2018 09:53:44 +0000 (05:53 -0400)]
remove `ReserveOrActivateIndex`

6 years agouse the `activations_at_location` map to check activations
Niko Matsakis [Sat, 7 Apr 2018 09:43:36 +0000 (05:43 -0400)]
use the `activations_at_location` map to check activations

Not gen bits

6 years agodetermine whether a borrow is active based solely on the location
Niko Matsakis [Sat, 7 Apr 2018 00:48:13 +0000 (20:48 -0400)]
determine whether a borrow is active based solely on the location

6 years agoadd useful debug
Niko Matsakis [Fri, 6 Apr 2018 22:03:23 +0000 (18:03 -0400)]
add useful debug

6 years agoencapsulate ReserveOrActivateIndex into the borrows dataflow
Niko Matsakis [Fri, 6 Apr 2018 21:03:14 +0000 (17:03 -0400)]
encapsulate ReserveOrActivateIndex into the borrows dataflow

6 years agoconstruct the `BorrowSet` outside of `borrows`
Niko Matsakis [Fri, 6 Apr 2018 19:57:21 +0000 (15:57 -0400)]
construct the `BorrowSet` outside of `borrows`

6 years agoextract code to build borrow-set into `borrow_check::borrow_set`
Niko Matsakis [Fri, 6 Apr 2018 19:53:49 +0000 (15:53 -0400)]
extract code to build borrow-set into `borrow_check::borrow_set`

Also:

- Extract common helper functions into a helper trait.
- Kill a bit of dead code.

6 years agorelocate `BorrowData` etc into `borrow_check::borrow_set`
Niko Matsakis [Fri, 6 Apr 2018 19:18:01 +0000 (15:18 -0400)]
relocate `BorrowData` etc into `borrow_check::borrow_set`

6 years agogather activation locations for 2-phase borrows in 1 pass
Niko Matsakis [Fri, 6 Apr 2018 15:50:17 +0000 (11:50 -0400)]
gather activation locations for 2-phase borrows in 1 pass

6 years agoremove `assigned_map` (appears to be dead code)
Niko Matsakis [Fri, 6 Apr 2018 15:12:27 +0000 (11:12 -0400)]
remove `assigned_map` (appears to be dead code)

6 years agoAuto merge of #49885 - spastorino:fn_ref_unsound, r=nikomatsakis
bors [Sun, 15 Apr 2018 09:14:43 +0000 (09:14 +0000)]
Auto merge of #49885 - spastorino:fn_ref_unsound, r=nikomatsakis

Fix unsoundness bug in functions input references

Fixes #48803

r? @nikomatsakis

6 years agoRemove #[inline(always)] on Vec::into_boxed_slice
Anthony Ramine [Sun, 15 Apr 2018 08:34:57 +0000 (10:34 +0200)]
Remove #[inline(always)] on Vec::into_boxed_slice

6 years agoAuto merge of #49884 - alexcrichton:less-unwrap, r=Mark-Simulacrum
bors [Sun, 15 Apr 2018 06:33:48 +0000 (06:33 +0000)]
Auto merge of #49884 - alexcrichton:less-unwrap, r=Mark-Simulacrum

core: Remove panics from some `Layout` methods

`Layout` is often used at the core of allocation APIs and is as a result pretty
sensitive to codegen in various circumstances. I was profiling `-C opt-level=z`
with a wasm project recently and noticed that the `unwrap()` wasn't removed
inside of `Layout`, causing the program to be much larger than it otherwise
would be. If inlining were more aggressive LLVM would have figured out that the
panic could be eliminated, but in general the methods here can't panic in the
first place!

As a result this commit makes the following tweaks:

* Removes `unwrap()` and replaces it with `unsafe` in `Layout::new` and
  `Layout::for_value`. For posterity though a debug assertion was left behind.
* Removes an `unwrap()` in favor of `?` in the `repeat` method. The comment
  indicating that the function call couldn't panic wasn't quite right in that if
  `alloc_size` becomes too large and if `align` is high enough it could indeed
  cause a panic.

This'll hopefully mean that panics never get introduced into code in the first
place, ensuring that `opt-level=z` is closer to `opt-level=s` in this regard.

6 years agoAuto merge of #49881 - varkor:partialord-opt, r=Manishearth
bors [Sun, 15 Apr 2018 03:54:15 +0000 (03:54 +0000)]
Auto merge of #49881 - varkor:partialord-opt, r=Manishearth

Fix derive(PartialOrd) and optimise final field operation

```rust
// Before (`lt` on 2-field struct)
self.f1 < other.f1 || (!(other.f1 < self.f1) &&
(self.f2 < other.f2 || (!(other.f2 < self.f2) &&
(false)
))
)

// After
self.f1 < other.f1 || (!(other.f1 < self.f1) &&
self.f2 < other.f2
)

// Before (`le` on 2-field struct)
self.f1 < other.f1 || (!(other.f1 < self.f1) &&
(self.f2 < other.f2 || (!(other.f2 < self.f2) &&
(true)
))
)

// After
self.f1 < other.f1 || (self.f1 == other.f1 &&
self.f2 <= other.f2
)
```

(The big diff is mainly because of a past faulty rustfmt application that I corrected 😒)

Fixes #49650 and fixes #49505.

6 years agoAuto merge of #48173 - GuillaumeGomez:error-codes-libsyntax_ext, r=estebank
bors [Sun, 15 Apr 2018 01:26:11 +0000 (01:26 +0000)]
Auto merge of #48173 - GuillaumeGomez:error-codes-libsyntax_ext, r=estebank

Add error codes for libsyntax_ext

I intend to add error codes for `libsyntax_ext` as well. However, they cannot be used at stage 0 directly so I thought it might be possible to enable them at the stage 1 only so we can have access to the macros. However, the error code registration seems to not work this way. Currently I get the following error:

```
error: used diagnostic code E0660 not registered
  --> libsyntax_ext/asm.rs:93:25
   |
93 |                         span_err!(cx, sp, E0660, "malformed inline assembly");
   |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: used diagnostic code E0661 not registered
   --> libsyntax_ext/asm.rs:151:33
    |
151 | /                                 span_err!(cx, sp, E0661,
152 | |                                           "output operand constraint lacks '=' or '+'");
    | |________________________________________________________________________________________^
    |
    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

error: aborting due to 2 previous errors

error: Could not compile `syntax_ext`.
```

If anyone has an idea, I'd gladly take it. I'm trying to figure this out on my side as well. I also opened this PR to know if it was worth it to continue (maybe we don't want this?).

Anyway, any answer for both questions is very welcome!

cc @rust-lang/compiler

6 years agoAuto merge of #49850 - alexcrichton:moreinline, r=sfackler
bors [Sat, 14 Apr 2018 20:22:19 +0000 (20:22 +0000)]
Auto merge of #49850 - alexcrichton:moreinline, r=sfackler

core: Inline `From<AllocErr> for CollectionAllocErr`

This shows up in allocations of vectors and such, so no need for it to not be
inlined!

6 years agoignore stage1 testing
Guillaume Gomez [Fri, 13 Apr 2018 21:22:01 +0000 (23:22 +0200)]
ignore stage1 testing