Commit Graph

82473 Commits

Author SHA1 Message Date
varkor
07064de9a7 No longer return value_constructors for all_constructors 2018-08-16 20:09:05 +01:00
varkor
d27c21c016 Refactor for less allocation 2018-08-16 20:09:05 +01:00
varkor
6c21a0322c Refactor after miri api changes 2018-08-16 20:09:05 +01:00
varkor
732d638483 Replace ... with ..= in suggestions
As ... is "(silently) deprecated". Presumably this means we should be giving correct, up-to-date suggestions, though.
2018-08-16 20:09:05 +01:00
varkor
1aa749469b Introduce signed_bias method
The epitome of simplicity!
2018-08-16 20:09:05 +01:00
varkor
72cc4bd33b Inline encode and decode methods 2018-08-16 20:09:05 +01:00
varkor
be12b242ce Fix print_miri_value for signed integers 2018-08-16 20:09:05 +01:00
varkor
97a032ebb4 Simplify bitwise operations 2018-08-16 20:09:05 +01:00
varkor
c388c11a60 Special-case (RangeEnd::Included, Ordering::Equal) in lower_pattern_unadjusted 2018-08-16 20:09:05 +01:00
varkor
effb3d05a0 Improve the comments 2018-08-16 20:09:05 +01:00
varkor
a9f2c5a7b2 Fix sign conversion arithmetic errors 2018-08-16 20:09:05 +01:00
varkor
f4af3b015f Refactor to remove explicit integer type matching 2018-08-16 20:09:05 +01:00
varkor
838997236e Add singleton patterns to test 2018-08-16 20:09:05 +01:00
varkor
a553fa7244 Fix integer overflow 2018-08-16 20:09:05 +01:00
varkor
7695bd0be9 Use bit operators for min_max_ty 2018-08-16 20:09:04 +01:00
varkor
c00fd8f58c Refactor interval conditions 2018-08-16 20:09:04 +01:00
varkor
7f72030421 Fix range splitting 2018-08-16 20:09:04 +01:00
varkor
a20cb1084a Require just the Unicode Scalar Values to be matched for a char 2018-08-16 20:09:04 +01:00
varkor
9778a81e92 Improve macros with reduced repetition 2018-08-16 20:09:04 +01:00
varkor
7476ba4c8a Add semi-exhaustive tests for exhaustiveness 2018-08-16 20:09:04 +01:00
varkor
121fa8d499 Fix handling of signed integers 2018-08-16 20:09:04 +01:00
varkor
b8702a0b1d Add feature gate test 2018-08-16 20:09:04 +01:00
varkor
ed5a4d5e60 Add feature gate and refactor 2018-08-16 20:09:04 +01:00
varkor
384db4f0cf Add support for all integer types 2018-08-16 20:09:04 +01:00
varkor
b3d2baff94 Give correct suggestions 2018-08-16 20:09:04 +01:00
varkor
e3357d9984 Implement interval checking 2018-08-16 20:09:04 +01:00
Josh Stone
f4e8d57b6a std: stop backtracing when the frames are full 2018-08-16 11:28:42 -07:00
bors
b2028828db Auto merge of #53433 - kennytm:rollup, r=kennytm
Rollup of 10 pull requests

Successful merges:

 - #52946 (Documented impl From on line 367 of libserialize/json.rs)
 - #53234 (Remove Travis shutdown debug scripts, and remove CI-specific DNS settings)
 - #53313 (Two small improvements)
 - #53360 (Addressed #51602)
 - #53364 (Warn if the user tries to use GATs)
 - #53373 (Tweak unclosed delimiter parser error)
 - #53377 (std: Use target_pointer_width for BACKTRACE_ELF_SIZE)
 - #53395 (Use #[non_exhaustive] on internal enums)
 - #53399 (Tidy: ignore non-Markdown files when linting for the Unstable Book)
 - #53412 (syntax_ext: remove leftover span_err_if_not_stage0 macro.)
2018-08-16 17:53:29 +00:00
Alex Crichton
ed39cc074a wasm: Remove --strip-debug argument to LLD
Originally added in #52887 this commit disables passing `--strip-debug` to LLD
when optimized. This bring back the original bug of emitting broken debuginfo
but currently it *also* strips the `name` section which makes it very difficult
to inspect the final binary. A real fix is happening at
https://reviews.llvm.org/D50729 and we can reevaluate once we've updated LLD to
have that commit.
2018-08-16 10:17:06 -07:00
kennytm
a68e61a9f2
Rollup merge of #53234 - kennytm:debug-9696, r=alexcrichton
Remove Travis shutdown debug scripts, and remove CI-specific DNS settings

Since the cause of the host shutdown (travis-ci/travis-ci#4924) is found, we could revert the shutdown debug attempts to shorten the logs.

Additionally, we're pretty sure a custom DNS (added in  will not help travis-ci/travis-ci#9696, so reverting that part of #51420 to reduce CI-specific settings.
2018-08-17 00:54:45 +08:00
kennytm
1cb13b296d
Rollup merge of #53412 - eddyb:stage-who, r=alexcrichton
syntax_ext: remove leftover span_err_if_not_stage0 macro.

I believe this is the right fix for #53380, although I'm not sure what happened.
My guess is this copy of the macro was accidentally missed when others were removed?

cc @matthewjasper @varkor (please do not put this in a rollup, in case it fails)
2018-08-17 00:13:29 +08:00
kennytm
ae3ebf0316
Rollup merge of #53399 - varkor:ignore-non-md-unstable_book, r=nikomatsakis
Tidy: ignore non-Markdown files when linting for the Unstable Book

Previously, any file would be assumed a `.md`, which is annoying when files like `.DS_STORE` slip in and then cause tidy errors.
2018-08-17 00:13:27 +08:00
kennytm
6e98ed9650
Rollup merge of #53395 - varkor:__Nonexhaustive-to-non_exhaustive, r=shepmaster
Use #[non_exhaustive] on internal enums

This replaces `__Nonexhaustive` variants (and variants thereof)  with `#[non_exhaustive]`. These were mostly unstable previously, with the exception of the `cloudabi` enums and `Level` in proc_macro: these were `#[doc(hidden)]`, so clearly intended not to be used directly. It should be safe to replace all of these.
2018-08-17 00:13:26 +08:00
kennytm
0c9e0e33b4
Rollup merge of #53377 - cuviper:pointer-elf_size, r=alexcrichton
std: Use target_pointer_width for BACKTRACE_ELF_SIZE

The former code used `target.contains("64")` to detect Elf64 targets,
but this is inaccurate in a few cases:

- `s390x-unknown-linux-gnu` is 64-bit
- `sparcv9-sun-solaris` is 64-bit
- `x86_64-unknown-linux-gnux32` is 32-bit

Instead the `std` build script can use `CARGO_CFG_TARGET_POINTER_WIDTH`
to reliably detect 64-bit targets for libbacktrace.

Also update to backtrace-sys 0.1.24 for alexcrichton/backtrace-rs#122.
2018-08-17 00:13:25 +08:00
kennytm
098d80d44a
Rollup merge of #53373 - estebank:unclosed, r=petrochenkov
Tweak unclosed delimiter parser error
2018-08-17 00:13:24 +08:00
kennytm
4968eea639
Rollup merge of #53364 - varkor:gat-warn-broken, r=pnkfelix
Warn if the user tries to use GATs

GATs are currently broken, but still accessible behind a feature gate. This leads to people attempting to use them and then immediately encountering ICEs (or other broken behaviour). Here, we emit a warning if the user tries to use any feature associated with GATs, hopefully making it obvious that ICEs and the like are expected. For the meantime, this seems better than continually getting reported errors (for example: [here](https://github.com/rust-lang/rust/issues?q=is%3Aissue+gat+is%3Aclosed) and [here](https://github.com/rust-lang/rust/issues?utf8=%E2%9C%93&q=is%3Aissue+generic_associated_types+is%3Aclosed)).
2018-08-17 00:13:23 +08:00
kennytm
1cda84bfdb
Rollup merge of #53360 - PramodBisht:issue/51602, r=estebank
Addressed #51602

Fixed #51602
r? @estebank

here I have addressed the case where `in` was not expected right after `if` block. Speaking of `type ascription` I am not sure if this the best approach which I have implemented. Plus I think one more test case can be added to test `type-ascription` case, though I don't have any at this point of time. I will ping you again if all existing testcases pass.
2018-08-17 00:13:21 +08:00
kennytm
e6068828bd
Rollup merge of #53313 - llogiq:two-small-improvements, r=estebank
Two small improvements

In `librustc_apfloat/ieee.rs`, use the iterator.[r]find methods to simplify the code. In `libserialize/json.rs`, make use of the fact that `Vec.last` on an empty `Vec` returns `None` to simplify the code to a single match.
2018-08-17 00:13:20 +08:00
kennytm
07ce2a3518
Rollup merge of #52946 - Ajacmac:doc-impl-from, r=GuillaumeGomez
Documented impl From on line 367 of libserialize/json.rs

This is for the impl From mentioned in #51430 assigned to @skade .

Hopefully I didn't miss anything/get anything wrong. I looked over another PR for another part of this same issue to see what the proper formatting was, etc.

Thanks!
2018-08-17 00:13:19 +08:00
bors
b5590423e6 Auto merge of #53304 - dtolnay:extend, r=dtolnay
TokenStream::extend

Two new insta-stable impls in libproc_macro:

```rust
impl Extend<TokenTree> for TokenStream
impl Extend<TokenStream> for TokenStream
```

`proc_macro::TokenStream` already implements `FromIterator<TokenTree>` and `FromIterator<TokenStream>` so I elected to support the same input types for `Extend`.

**This commit reduces compile time of Serde derives by 60% (takes less than half as long to compile)** as measured by building our test suite:

```console
$ git clone https://github.com/serde-rs/serde
$ cd serde/test_suite
$ cargo check --tests --features proc-macro2/nightly
$ rm -f ../target/debug/deps/libtest_*.rmeta
$ time cargo check --tests --features proc-macro2/nightly
Before: 20.8 seconds
After: 8.6 seconds
```

r? @alexcrichton
2018-08-16 15:44:30 +00:00
Ralf Jung
e7b65bd457 enable more tests on stage1 again 2018-08-16 16:30:54 +02:00
bors
5050349749 Auto merge of #53256 - ollie27:writeln, r=KodrAus
Don't accept non-string literals for the format string in writeln

This is to improve diagnostics.

`println` and `eprintln` were already fixed by #52394.

Fixes #30143
2018-08-16 13:29:40 +00:00
Guillaume Gomez
985da801b0 Generate blanket implementations for reexported items as well 2018-08-16 15:14:11 +02:00
kennytm
b75f1bade0
Revert "Use public DNS server instead of 169.254.169.254 on CI."
This reverts commit 32e8bda4e3.
2018-08-16 20:06:55 +08:00
kennytm
53837db001
Revert "Auto merge of #53035 - alexcrichton:debug-travis, r=kennytm"
This reverts commit 579adf8c72, reversing
changes made to c11f2d286c.
2018-08-16 20:05:16 +08:00
kennytm
42efd270f9
Revert "Auto merge of #53134 - alexcrichton:tweak-travis, r=Mark-Simulacrum"
This reverts commit f9b9b6e078, reversing
changes made to 45a9d410f9.
2018-08-16 20:05:15 +08:00
bors
b837f5be70 Auto merge of #53173 - alexcrichton:win-arm64, r=sfackler
Start adding an `aarch64-pc-windows-msvc` target

This commit adds the necessary definitions for target specs and such as well as
the necessary support in libstd to compile basic `aarch64-pc-windows-msvc`
binaries. The target is not currently built on CI, but it can be built locally
with:

    ./configure --target=aarch64-pc-windows-msvc --set rust.lld
    ./x.py build src/libstd --target aarch64-pc-windows-msvc

Currently this fails to build `libtest` due to a linker bug (seemingly in LLD?)
which hasn't been investigate yet. Otherwise though with libstd you can build a
hello world program (linked with LLD). I've not tried to execute it yet, but it
at least links!

Full support for this target is still a long road ahead, but this is hopefully a
good stepping stone to get started.

Points of note about this target are:

* Currently defaults to `panic=abort` as support is still landing in LLVM for
  SEH on AArch64.
* Currently defaults to LLD as a linker as I was able to get farther with it
  than I was with `link.exe`
2018-08-16 11:18:12 +00:00
Niv Kaminer
03530fa5e6 add example for moving out of pointer 2018-08-16 13:56:08 +03:00
bors
142bb27373 Auto merge of #53147 - ashtneoi:dont-suggest-ref, r=estebank
For move errors, suggest match ergonomics instead of `ref`

Partially fixes issue #52423. Also makes errors and suggestions more consistent between move-from-place and move-from-value errors.

Limitations:
- Only the first pattern in a match arm can have a "consider removing this borrow operator" suggestion.
- Suggestions don't always compile as-is (see the TODOs in the test for details).

Sorry for the really long test. I wanted to make sure I handled every case I could think of, and it turned out there were a lot of them.

Questions:
- Is there any particular applicability I should set on those suggestions?
- Are the notes about the `Copy` trait excessive?
2018-08-16 08:45:32 +00:00
Nicholas Nethercote
5745597e61 Speed up NLL with HybridIdxSetBuf.
`HybridIdxSetBuf` is a sparse-when-small but dense-when-large index set
that is very efficient for sets that (a) have few elements, (b) have
large `universe_size` values, and (c) are cleared frequently. Which
makes it perfect for the `gen_set` and `kill_set` sets used by the new
borrow checker.

This patch reduces the execution time of the five slowest NLL benchmarks
by 55%, 21%, 16%, 10% and 9%. It also reduces the max-rss of three
benchmarks by 53%, 33%, and 9%.
2018-08-16 17:52:36 +10:00