1. 17 8月, 2018 7 次提交
  2. 16 8月, 2018 33 次提交
    • B
      Auto merge of #53304 - dtolnay:extend, r=dtolnay · b5590423
      bors 提交于
      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
      b5590423
    • B
      Auto merge of #53256 - ollie27:writeln, r=KodrAus · 50503497
      bors 提交于
      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
      50503497
    • B
      Auto merge of #53173 - alexcrichton:win-arm64, r=sfackler · b837f5be
      bors 提交于
      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`
      b837f5be
    • B
      Auto merge of #53147 - ashtneoi:dont-suggest-ref, r=estebank · 142bb273
      bors 提交于
      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?
      142bb273
    • B
      Auto merge of #53295 - estebank:on-unimplemented, r=michaelwoerister · 996e26c2
      bors 提交于
      Various changes to `rustc_on_unimplemented`
      
      - Add `from_method` and `from_desugaring` to formatting options
      - Change wording of errors slightly
      996e26c2
    • A
      Split tests more and bless them again · 0023dd9b
      ashtneoi 提交于
      0023dd9b
    • A
      Move tests into their own directory · f335fb08
      ashtneoi 提交于
      f335fb08
    • B
      Auto merge of #53293 - petrochenkov:gramattr2, r=alexcrichton · fc323ba1
      bors 提交于
      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
      fc323ba1
    • B
      Auto merge of #53289 - ljedrz:improve_lexer, r=michaelwoerister · 6c712b14
      bors 提交于
      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`"
      6c712b14
    • A
      Start adding an `aarch64-pc-windows-msvc` target · fccc04d3
      Alex Crichton 提交于
      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`
      fccc04d3
    • A
      Re-bless test · f4229b81
      ashtneoi 提交于
      f4229b81
    • A
      Add files I forgot to commit earlier · 4c4e1ef2
      ashtneoi 提交于
      4c4e1ef2
    • A
      Change a method name and clarify a comment · 671d7e06
      ashtneoi 提交于
      671d7e06
    • A
      Bless tests · bd2b54c2
      ashtneoi 提交于
      bd2b54c2
    • A
      Test move-into-Fn/FnMut errors too · a5b008c4
      ashtneoi 提交于
      a5b008c4
    • A
      Fix compiletest JSON error message · 6a24abbb
      ashtneoi 提交于
      6a24abbb
    • A
      Allocate fewer Strings at a time · 3c3a7bad
      ashtneoi 提交于
      3c3a7bad
    • A
      Add another FIXME about suggestions · 81c27c6a
      ashtneoi 提交于
      81c27c6a
    • A
      Bless UI tests · 9a0020a8
      ashtneoi 提交于
      9a0020a8
    • A
      Remove incorrect space · d6dbdee7
      ashtneoi 提交于
      d6dbdee7
    • A
      Remove unnecessary comment · a583aa64
      ashtneoi 提交于
      Turns out I didn't read the original comment correctly and had some
      confusion about how MIR uses temporaries.
      a583aa64
    • A
      Test patterns in tuples · 0a82abc4
      ashtneoi 提交于
      0a82abc4
    • A
      Coalesce var-is-not-Copy notes per move · 6cf4e14a
      ashtneoi 提交于
      6cf4e14a
    • A
      Dedup suggestions · 20ae08bd
      ashtneoi 提交于
      20ae08bd
    • A
      Remove unnecessary underscore · 40b5118c
      ashtneoi 提交于
      40b5118c
    • A
      Change TODOs to FIXMEs · 8135372e
      ashtneoi 提交于
      8135372e
    • A
      Make move errors more consistent with typeck errors · 10aaba8d
      ashtneoi 提交于
      10aaba8d
    • A
      Make move error suggestions clearer · 701c74e0
      ashtneoi 提交于
      701c74e0
    • A
      Add backquotes around variable name · b05e9a7f
      ashtneoi 提交于
      b05e9a7f
    • A
      Fix move errors for index expressions · 8080bdf2
      ashtneoi 提交于
      The suggestion logic gave up too early, which kept it from suggesting
      borrowing index expressions.
      8080bdf2
    • A
      Test move errors for index expressions · 54ddb36c
      ashtneoi 提交于
      54ddb36c
    • A
      Accept whitespace between `&` and `mut` · 1e87908c
      ashtneoi 提交于
      1e87908c
    • A
      Add more TODOs · 3a5812bd
      ashtneoi 提交于
      3a5812bd