Commit Graph

77238 Commits

Author SHA1 Message Date
Guillaume Gomez
ac0f99c03f Some JS improvements 2018-04-25 09:01:32 +02:00
bors
38e251ba37 Auto merge of #50079 - NickAtAccuPS:android_abstract_socket, r=sfackler
Android abstract unix domain sockets AddressKind correction

The prior check causes abstract unix domain sockets to return AddressKind::Unnamed instead of AddressKind::Abstract on Android.

Other than the immediately proceeding comment "macOS seems to return a len of 16 and a zeroed sun_path for unnamed addresses" the check as-implemented does not seem to have alternative explanation. I couldn't find an alternative explanation while stepping though git blame. I suspect the AddressKind::Unnamed nonzero check should instead be if macos, length 16, and zeroed array. @sfackler could you comment on this, the code as-is is the same from your initial addition of abstract uds support.
2018-04-24 14:15:56 +00:00
bors
2a6200a5c8 Auto merge of #49911 - rcoh:master, r=nikomatsakis
Don't allow #[should_panic] with non-() tests

Adds (removes) support for `#[should_panic]` when the test is non-`()`
2018-04-24 10:44:22 +00:00
bors
898c9f7d71 Auto merge of #49837 - nikomatsakis:chalkify-engine, r=scalexm
work towards chalkify-ing the engine

This work towards creating a "all program clauses needed for this goal" query

r? @scalexm
2018-04-24 08:32:52 +00:00
bors
52ed3d8761 Auto merge of #50191 - kennytm:rollup, r=kennytm
Rollup of 11 pull requests

Successful merges:

 - #49461 (std: Child::kill() returns error if process has already exited)
 - #49727 (Add Cell::update)
 - #49812 (Fix revision support for UI tests.)
 - #49829 (Add doc links to `std::os` extension traits)
 - #49906 (Stabilize `std::hint::unreachable_unchecked`.)
 - #49970 (Deprecate Read::chars and char::decode_utf8)
 - #49985 (don't see issue #0)
 - #50118 (fix search bar bug)
 - #50139 (encourage descriptive issue titles)
 - #50174 (Use FxHashMap in syntax_pos::symbol::Interner::intern.)
 - #50185 (core: Fix overflow in `int::mod_euc` when `self < 0 && rhs == MIN`)

Failed merges:
2018-04-24 05:43:32 +00:00
kennytm
893774e119
Rollup merge of #50185 - dmizuk:mod_euc-fix-overflow, r=kennytm
core: Fix overflow in `int::mod_euc` when `self < 0 && rhs == MIN`

This commit removes usage of `abs`, which overflows when `self == MIN`.
2018-04-24 11:57:11 +08:00
kennytm
8d0c5da7e8
Rollup merge of #50174 - nnethercote:FxHashMap-Interner, r=michaelwoerister
Use FxHashMap in syntax_pos::symbol::Interner::intern.

Because it's faster than HashMap.

This change reduces the time taken for a few of the rustc-perf
benchmarks, mostly the small ones, by up to 5%.
```
coercions
        avg: -1.3%      min: -5.5%      max: -0.0%
helloworld-check
        avg: -2.3%      min: -3.5%      max: -1.8%
deeply-nested-check
        avg: -1.4%      min: -3.2%      max: -0.5%
tuple-stress-opt
        avg: -0.7%      min: -2.0%      max: -0.1%
unify-linearly-check
        avg: -1.2%      min: -1.9%      max: -0.6%
coercions-check
        avg: -0.8%      min: -1.3%      max: -0.4%
unused-warnings-check
        avg: -1.0%      min: -1.3%      max: -0.8%
deeply-nested-opt
        avg: -0.5%      min: -1.2%      max: -0.2%
deeply-nested
        avg: -0.7%      min: -1.2%      max: -0.4%
helloworld
        avg: -0.8%      min: -1.1%      max: -0.7%
tuple-stress-check
        avg: -0.5%      min: -1.0%      max: -0.1%
unused-warnings
        avg: -0.8%      min: -1.0%      max: -0.7%
unused-warnings-opt
        avg: -0.8%      min: -1.0%      max: -0.7%
coercions-opt
        avg: -0.5%      min: -1.0%      max: -0.1%
helloworld-opt
        avg: -0.7%      min: -1.0%      max: -0.6%
```
2018-04-24 11:57:10 +08:00
kennytm
8545ecdb59
Rollup merge of #50139 - nivkner:docs, r=steveklabnik
encourage descriptive issue titles

There are two sides to avoiding duplicate issues, searching for existing ones, and making sure existing ones can be searched for. This addresses the later.

r? @steveklabnik
2018-04-24 11:57:09 +08:00
kennytm
05ef5bcb53
Rollup merge of #50118 - GuillaumeGomez:search-bar-bug, r=QuietMisdreavus
fix search bar bug

Fixes #50064.

r? @QuietMisdreavus
2018-04-24 11:57:08 +08:00
kennytm
7c552a299d
Rollup merge of #49985 - zackmdavis:0, r=estebank
don't see issue #0

The unstable-feature attribute requires an issue (neglecting it is
E0547), which gets used in the error messages. Unfortunately, there are
some cases where "0" is apparently used a placeholder where no issue
exists, directing the user to see the (nonexistent) issue #0. (It would
have been better to either let `issue` be optional—compare to how issue
is an `Option<u32>` in the feature-gate declarations in
libsyntax/feature-gate.rs—or actually require that an issue be created.)
Rather than endeavoring to change how `#[unstable]` works at this time
(given competing contributor and reviewer priorities), this simple patch
proposes the less-ambitious solution of just not adding the "(see
issue)" note when the number is zero.

Resolves #49983.
2018-04-24 11:57:07 +08:00
kennytm
6b1ed8e4af
Rollup merge of #49970 - SimonSapin:deprecate, r=sfackler
Deprecate Read::chars and char::decode_utf8

Per FCP:

* https://github.com/rust-lang/rust/issues/27802#issuecomment-377537778
* https://github.com/rust-lang/rust/issues/33906#issuecomment-377534308
2018-04-24 11:57:05 +08:00
kennytm
f28f5aa0b2
Rollup merge of #49906 - kennytm:stable-unreachable, r=sfackler
Stabilize `std::hint::unreachable_unchecked`.

Closes #43751.
2018-04-24 11:57:04 +08:00
kennytm
2701c175a5
Rollup merge of #49829 - ecstatic-morse:os-docs, r=steveklabnik
Add doc links to `std::os` extension traits

Addresses a small subset of #29367.

This adds documentation links to the original type for various OS-specific extension traits, and uses a common sentence for introducing such traits (which now consistently ends in a period).
2018-04-24 11:57:03 +08:00
kennytm
b9dbf8e2c4
Rollup merge of #49812 - ehuss:ui-test-revisions, r=nikomatsakis
Fix revision support for UI tests.

Fixes #48878
2018-04-24 11:57:02 +08:00
kennytm
91cc872987
Rollup merge of #49727 - stjepang:cell-update, r=SimonSapin
Add Cell::update

This commit adds a new method `Cell::update`, which applies a function to the value inside the cell.

Previously discussed in: https://github.com/rust-lang/rfcs/issues/2171

### Motivation

Updating `Cell`s is currently a bit verbose. Here are several real examples (taken from rustc and crossbeam):

```rust
self.print_fuel.set(self.print_fuel.get() + 1);

self.diverges.set(self.diverges.get() | Diverges::Always);

let guard_count = self.guard_count.get();
self.guard_count.set(guard_count.checked_add(1).unwrap());
if guard_count == 0 {
    // ...
}
```

With the addition of the new method `Cell::update`, this code can be simplified to:

```rust
self.print_fuel.update(|x| x + 1);

self.diverges.update(|x| x | Diverges::Always);

if self.guard_count.update(|x| x.checked_add(1).unwrap()) == 1 {
    // ...
}
```

### Unresolved questions

1. Should we return the old value instead of the new value (like in `fetch_add` and `fetch_update`)?
2. Should the return type simply be `()`?
3. Naming: `update` vs `modify` vs `mutate` etc.

cc @SimonSapin
2018-04-24 11:57:00 +08:00
kennytm
cefdd6d5e9
Rollup merge of #49461 - andreastt:child-kill-exited, r=Mark-Simulacrum
std: Child::kill() returns error if process has already exited

This patch makes it clear in std::process::Child::kill()'s API
documentation that an error is returned if the child process has
already cleanly exited.  This is implied by the example, but not
called out explicitly.
2018-04-24 11:56:59 +08:00
bors
f305b025cf Auto merge of #48999 - GuillaumeGomez:add-repeat-on-slice, r=Kimundi
Add repeat method on slice

Fixes #48784.
2018-04-24 03:31:11 +00:00
bors
a1286f6835 Auto merge of #48989 - ExpHP:path-prefix, r=dtolnay
Make signature of Path::strip_prefix accept non-references

I did this a while back but didn't submit a PR. Might as well see what happens.

Fixes #48390.

**Note: This has the potential to cause regressions in type inference.**  However, in order for code to break, it would need to be relying on the signature to determine that a type is `&_`, while still being able to figure out what the `_` is.  I'm having a hard time imagining such a scenario in real code.
2018-04-24 01:15:36 +00:00
bors
725c9b0ede Auto merge of #49779 - oli-obk:const_err_regression, r=eddyb
Don't report compile-time errors for promoteds

Fixes the regression part of #49760, the missing warnings still are missing

r? @eddyb
2018-04-23 22:58:00 +00:00
Guillaume Gomez
f33af5c4de fix search bar bug 2018-04-23 23:55:36 +02:00
bors
0135bf647c Auto merge of #49368 - matthewjasper:feature-gate-where-clause, r=nikomatsakis
Feature gate where clauses on associated types

Fixes #49365. Requires crater: these have been usable since 1.24.
2018-04-23 19:29:25 +00:00
Stjepan Glavina
29e9de85d6 Assign the tracking issue 2018-04-23 20:34:49 +02:00
Daiki Mizukami
104c64dc36 core: Minor cleanup 2018-04-24 03:32:40 +09:00
Stjepan Glavina
1c0db245e0 Clarify the docs for Cell::update 2018-04-23 20:23:04 +02:00
Niko Matsakis
2c5fbe2058 sort strings on output 2018-04-23 13:28:15 -04:00
Niko Matsakis
7fa3c8f445 eliminate the Lrc of a slice and just return the slice
Also, introduce `Clauses` and `Goals` type alises for readability.
2018-04-23 13:28:14 -04:00
Niko Matsakis
294cae22ee first draft of program_clauses_for_env
This computes the transitive closure of traits that appear in the
environment and then appends their clauses. It needs some work, but
it's in the right direction.
2018-04-23 13:28:14 -04:00
Niko Matsakis
7173fd78c6 in unit tests, use note to dump multiple program clauses
(rather than issuing multiple errors)

Also, reorder so that the annotations are considered "used" when the
lint runs.
2018-04-23 13:28:14 -04:00
Niko Matsakis
94639ca406 rustfmt lowering.rs 2018-04-23 13:28:14 -04:00
Niko Matsakis
09bd6f3ee7 introduce new DefPathData variants for traits, assoc types 2018-04-23 13:28:14 -04:00
Niko Matsakis
cfbf62f7df add Goal::CannotProve and extract ProgramClause struct 2018-04-23 13:28:14 -04:00
Niko Matsakis
c8a52850cf create a QueryRegionConstraint type
Chalk wants to be able to pass these constraints around. Also, the
form we were using in our existing queries was not as general as we
are going to need.
2018-04-23 13:28:14 -04:00
Niko Matsakis
3aa1085cfc add a -Zchalk command-line option 2018-04-23 13:28:13 -04:00
Daiki Mizukami
fbb1c280bf core: Fix overflow in int::mod_euc when self < 0 && rhs == MIN 2018-04-24 01:53:40 +09:00
Russell Cohen
14e5e0e9c9 Don't allow #[should_panic] with non-() tests 2018-04-23 07:13:29 -07:00
bors
4640615ce7 Auto merge of #49372 - Phlosioneer:inherent-impl-default-error-message, r=nagisa
Better error message when trying to write default impls

Previously, if you tried to write this (using the specialization
feature flag):

default impl PartialEq<MyType> {
...
}

The compiler would give you the mysterious warning "inherent impls
cannot be default". What it really means is that you're trying to
write an impl for a Structure or *Trait Object*, and that cannot
be "default". However, one of the ways to encounter this error
(as shown by the above example) is when you forget to write "for
MyType".

This PR adds a help message that reads "maybe missing a `for`
keyword?" This is useful, actionable advice that will help any user
identify their mistake, and doesn't get in the way or mislead any
user that really meant to use the "default" keyword for this weird
purpose. In particular, this help message will be useful for any
users who don't know the "inherent impl" terminology, and/or users
who forget that inherent impls CAN be written for traits (they apply
to the trait objects). Both of these are somewhat confusing, seldom-
used concepts; a one-line error message without any error number for
longer explanation is NOT the place to introduce these ideas.

I wasn't quite sure what grammar / wording to use. I'm open to suggestions. CC @rust-lang/docs (I hope I'm doing that notation right)

(Apparently not. :( )
2018-04-23 10:40:08 +00:00
Nicholas Nethercote
f7d4c976a2 Use FxHashMap in syntax_pos::symbol::Interner::intern.
Because it's faster than HashMap.

This change reduces the time taken for a few of the rustc-perf
benchmarks, mostly the small ones, by up to 5%.
2018-04-23 19:15:31 +10:00
Oliver Schneider
bb367c4720
always optimize test
The error messages differ between optimized and nonoptimized mode
2018-04-23 11:12:33 +02:00
bors
1fac3ca9c4 Auto merge of #50129 - wesleywiser:clean_up1, r=michaelwoerister
Clean up `IsolatedEncoder::encode_info_for_impl_item()` a bit

Suggested in the [comments of #49991](4a77d35c1e (r183048939))
2018-04-23 08:26:23 +00:00
bors
f5cf1a8419 Auto merge of #50171 - mattico:update-mdbook, r=Mark-Simulacrum
Update MDBook

Updates MDBook to get some CSS fixes.

#50147, updated to resolve licensing issue.

r? @Mark-Simulacrum
2018-04-23 04:23:42 +00:00
bors
2c57826b92 Auto merge of #48946 - PramodBisht:issues/48636, r=estebank
Doc comments present after a particular syntax error cause an unhelpful error message to be output.

fixed: #48636

r? @estebank
2018-04-23 01:36:51 +00:00
Matt Ickstadt
0ab516fdfc Update MDBook 2018-04-22 20:35:22 -05:00
bors
e02868793b Auto merge of #50144 - sfackler:oom-lang-item, r=alexcrichton
Replace {Alloc,GlobalAlloc}::oom with a lang item.

The decision of what to do after an allocation fails is orthogonal to the decision of how to allocate the memory, so this PR splits them apart. `Alloc::oom` and `GlobalAlloc::oom` have been removed, and a lang item has been added:

```rust
#[lang = "oom"]
fn oom() -> !;
```

It is specifically a weak lang item, like panic_fmt, except that it is required when you depend on liballoc rather than libcore. libstd provides an implementation that aborts with the message `fatal runtime error: memory allocation failed`, matching the current behavior.

The new implementation is also significantly simpler - it's "just another weak lang item". [RFC 2070](https://github.com/rust-lang/rfcs/blob/master/text/2070-panic-implementation.md) specifies a path towards stabilizing panic_fmt, so any complexities around stable weak lang item definition are already being solved.

To bootstrap, oom silently aborts in stage0. alloc_system no longer has a bunch of code to print to stderr, and alloc_jemalloc no longer depends on alloc_system to pull in that code.

One fun note: System's GlobalAlloc implementation didn't override the default implementation of oom, so it currently aborts silently!

r? @alexcrichton
2018-04-22 19:38:32 +00:00
Steven Fackler
5969712c3f Remove unused AllocatorTy::Bang 2018-04-22 10:08:49 -07:00
Steven Fackler
9e8f683476 Remove Alloc::oom 2018-04-22 10:08:49 -07:00
Steven Fackler
e513c1bd31 Replace GlobalAlloc::oom with a lang item 2018-04-22 10:08:17 -07:00
bors
ff48277add Auto merge of #50152 - petrochenkov:nooverhyg, r=alexcrichton
parser: Do not override syntactic context for dummy spans

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

e2afefd80b seemingly did everything right, but uncovered a preexisting bug.
2018-04-22 16:58:12 +00:00
bors
8887396513 Auto merge of #50135 - matklad:update-cargo, r=kennytm
Update Cargo

Some noteble changes:

 * ~~regression fix: https://github.com/rust-lang/cargo/pull/5390~~
  * ~~potentially breaking bug-fix: https://github.com/rust-lang/cargo/pull/5389~~
  * ~~Cargo now caches the result of `rustc -vV`. It checks `rustc` binary
    mtime and rustup toolchain settings, so it should probably "just work"
    with rustbuild.~~

potentially breaking bug-fix: https://github.com/rust-lang/cargo/pull/5390
2018-04-22 13:23:49 +00:00
bors
28193e873c Auto merge of #49954 - GuillaumeGomez:doc-settings, r=ollie27,QuietMisdreavus
Add rustdoc settings menu

Fixes #18167.

r? @QuietMisdreavus
2018-04-22 11:04:41 +00:00
bors
0cbd310fa7 Auto merge of #50123 - kennytm:do-not-test-rls-if-build-failed, r=alexcrichton
Do not test RLS/Rustfmt if build failed
2018-04-22 08:48:32 +00:00