Commit Graph

82159 Commits

Author SHA1 Message Date
varkor
bfc8ce36f8 Add a test for integer products 2018-08-16 20:09:05 +01:00
varkor
5959a358e4 Move logic from push_wild_constructor to apply_constructor 2018-08-16 20:09:05 +01:00
varkor
4aa929cf8b Move witnesses inside push_wild_constructor 2018-08-16 20:09:05 +01:00
varkor
bfc0807b28 Add some comments 2018-08-16 20:09:05 +01:00
varkor
af366b0eb8 Refactor condition 2018-08-16 20:09:05 +01:00
varkor
25ba9118ff Add guarded arms to tests 2018-08-16 20:09:05 +01:00
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
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
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
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
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
bors
996e26c23f Auto merge of #53295 - estebank:on-unimplemented, r=michaelwoerister
Various changes to `rustc_on_unimplemented`

- Add `from_method` and `from_desugaring` to formatting options
- Change wording of errors slightly
2018-08-16 06:34:13 +00:00
ashtneoi
0023dd9ba1 Split tests more and bless them again 2018-08-15 22:36:19 -07:00
ashtneoi
f335fb08c2 Move tests into their own directory 2018-08-15 22:35:56 -07:00
bors
fc323ba160 Auto merge of #53293 - petrochenkov:gramattr2, r=alexcrichton
syntax: Enforce attribute grammar in the parser

Also fix feature-gating for `unrestricted_attribute_tokens` that was introduced in https://github.com/rust-lang/rust/pull/53270, but was actually broken.

cc https://github.com/rust-lang/rust/pull/50911
2018-08-16 04:16:12 +00:00
bors
6c712b1492 Auto merge of #53289 - ljedrz:improve_lexer, r=michaelwoerister
A few cleanups and minor improvements for the lexer

- improve readability by adjusting the formatting of some function signatures and adding some newlines
- reorder some functions for easier reading
- remove redundant `'static` in `const`s
- remove some explicit `return`s
- read directly to a `String` in `gather_comments_and_literals`
- change `unwrap_or!` (macro) to `unwrap_or` (function)
- move an `assert!`ion from `try_next_token` (called in a loop) to `try_real_token` after all calls to `try_next_token`
- `#[inline]` some one-liner functions
- assign directly from an `if-else` expression
- refactor a `match` to `map_or`
- add a `token::is_irrelevant` function to detect tokens that are not "`real`"
2018-08-16 01:08:13 +00:00
Alex Crichton
fccc04d3e7 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-15 17:20:13 -07:00
ashtneoi
f4229b81b5 Re-bless test 2018-08-15 15:25:53 -07:00
ashtneoi
4c4e1ef2c5 Add files I forgot to commit earlier 2018-08-15 15:14:21 -07:00
ashtneoi
671d7e064f Change a method name and clarify a comment 2018-08-15 15:14:21 -07:00
ashtneoi
bd2b54c23c Bless tests 2018-08-15 15:14:21 -07:00
ashtneoi
a5b008c450 Test move-into-Fn/FnMut errors too 2018-08-15 15:14:21 -07:00
ashtneoi
6a24abbbc5 Fix compiletest JSON error message 2018-08-15 15:14:21 -07:00
ashtneoi
3c3a7bad49 Allocate fewer Strings at a time 2018-08-15 15:14:21 -07:00
ashtneoi
81c27c6af7 Add another FIXME about suggestions 2018-08-15 15:14:21 -07:00