1. 23 1月, 2018 18 次提交
    • K
      Rollup merge of #47667 - GuillaumeGomez:fix-quoted-search, r=QuietMisdreavus · 97358644
      kennytm 提交于
      Fix quoted search
      
      r? @QuietMisdreavus
      97358644
    • K
      Rollup merge of #47662 - spastorino:add_test_to_nll, r=nikomatsakis · 4cc2f968
      kennytm 提交于
      Add dynamic-drop test to nll tests also
      
      r? @nikomatsakis
      
      Fixes #47585
      4cc2f968
    • K
      Rollup merge of #47661 - bjorn3:refactor_driver, r=michaelwoerister · 6dcaa0af
      kennytm 提交于
      Inline some rustc_driver function
      6dcaa0af
    • K
      Rollup merge of #47655 - etaoins:fix-spurious-warning-on-empty-proc-macro-crate, r=alexcrichton · 117eb681
      kennytm 提交于
      Fix spurious warning on empty proc macro crates
      
      While attempting to reproduce rust-lang/rust#47086 I noticed the following warning:
      
      ```shell
      > rustc /dev/null --crate-type proc-macro
      warning: unused variable: `registrar`
       --> /dev/null:0:1
      ```
      
      As there are no macros to register the automatically generated registrar function for the crate has no body. As a result its `registrar` argument is unused triggering the above warning.
      
      The warning is confusing and not easily actionable by the developer. It could also be triggered legitimately by e.g. having all of the macros in a crate #[cfg]'ed out.
      
      Fix by naming the generated argument `_registrar` inside `mk_registrar()`. This suppresses the unused variable warning.
      117eb681
    • K
      Rollup merge of #47635 - Zoxc:remove-attr, r=michaelwoerister · 9d26a25b
      kennytm 提交于
      Remove the IGNORED_ATTR_NAMES thread local
      9d26a25b
    • K
      Rollup merge of #47610 - cuviper:captured-dwarf, r=eddyb · cb0a8bf7
      kennytm 提交于
      LLVM5: Update DW_OP_plus to DW_OP_plus_uconst
      
      LLVM <= 4.0 used a non-standard interpretation of `DW_OP_plus`.  In the
      DWARF standard, this adds two items on the expressions stack.  LLVM's
      behavior was more like DWARF's `DW_OP_plus_uconst` -- adding a constant
      that follows the op.  The patch series starting with [D33892] switched
      to the standard DWARF interpretation, so we need to follow.
      
      [D33892]: https://reviews.llvm.org/D33892
      
      Fixes #47464
      r? @EddyB
      cb0a8bf7
    • K
      Rollup merge of #47558 - spastorino:rustc_args, r=nikomatsakis · 52f8d2dc
      kennytm 提交于
      Add rustc-args option to test runner
      
      r? @nikomatsakis
      52f8d2dc
    • K
      Rollup merge of #47554 - EdSchouten:cloudabi-jemalloc, r=nikomatsakis · 60b987d0
      kennytm 提交于
      Make liballoc_jemalloc work on CloudABI.
      
      The automated builds for CloudABI in dist-various-2 don't use
      --disable-jemalloc, even though my original container image did. Instead
      of setting that flag, let's go the extra mile of making jemalloc work.
      CloudABI's C library already uses jemalloc and now exposes the API
      extensions used by us.
      
      This makes the CloudABI dist work out of the box.
      60b987d0
    • K
      Rollup merge of #47549 - Manishearth:29723-regression, r=nikomatsakis · 658ccae6
      kennytm 提交于
      Add regression test for #29723
      
      cc #29723
      
      r? @nikomatsakis
      658ccae6
    • K
      Rollup merge of #47541 - psumbera:master, r=eddyb · 82981a77
      kennytm 提交于
      Fixes sparc64 cabi fixes.
      
      Argument up to 16 bytes size is provided in registers.
      Return value up to 32 bytes size is stored in registers.
      
      Fixes: #46679
      
      ---
      
      Firefox now (almost) build on sparc. Original rust issue seems to be gone. Note that I'm not rust expert and the fix was suggested in bug.
      82981a77
    • K
      Rollup merge of #47440 - mark-i-m:zunpretty, r=nikomatsakis · 150f2bac
      kennytm 提交于
      Change the --unpretty flag to -Z unpretty
      
      First PR 😄 !
      
      -Z unpretty no longer requires -Z unstable-options.
      
      Also, I mildly changed the syntax of the flag to match the other -Z flags. All uses of the flag take the form `unpretty=something` where something can either `string` or `string=string` (see the help messages of the CLI).
      
      Fix #47395
      
      r? @nikomatsakis EDIT: apparently rust-highfive doesn't see edits...
      150f2bac
    • K
      Rollup merge of #47425 - EdSchouten:immutable-tls, r=nikomatsakis · 0c9b3ec5
      kennytm 提交于
      Properly pass down immutability info for thread-locals.
      
      For thread-locals we call into cat_rvalue_node() to create a CMT
      (Category, Mutability, Type) that always has McDeclared. This is
      incorrect for thread-locals that don't have the 'mut' keyword; we should
      use McImmutable there.
      
      Extend cat_rvalue_node() to have an additional mutability parameter. Fix
      up all the callers to make use of that function. Also extend one of the
      existing unit tests to cover this.
      
      Fixes: #47053
      0c9b3ec5
    • K
      Rollup merge of #47423 - est31:rustbook_checking, r=alexcrichton · 116fb72d
      kennytm 提交于
      Check for deadlinks from the summary during book generation
      
      Previously, any deadlinks from a book's SUMMARY.md wouldn't
      cause any errors or warnings or similar but mdbook would simply
      create a page with blank content.
      
      This has kept bug #47394 hidden. It should have been detected
      back in the PR when those wrongly named files got added to the
      book.
      
      PR #47414 was one component of the solution. This change
      is a second line of defense for the unstable book and a first
      line of defense for any other book.
      
      We also update mdbook to the most recent version.
      116fb72d
    • B
      Auto merge of #47373 - wesleywiser:incr_cache_hashing, r=michaelwoerister · 47a8eb7c
      bors 提交于
      [Incremental] Cache hashes for AdDef and ty::Slice<T>
      
      r? @michaelwoerister
      47a8eb7c
    • G
      Fix quoted search · 7cc3cb29
      Guillaume Gomez 提交于
      7cc3cb29
    • B
      Auto merge of #47507 - alexcrichton:rerun-bat-scripts, r=michaelwoerister · ae920dcc
      bors 提交于
      rustc: Lower link args to `@`-files on Windows more
      
      When spawning a linker rustc has historically been known to blow OS limits for
      the command line being too large, notably on Windows. This is especially true of
      incremental compilation where there can be dozens of object files per
      compilation. The compiler currently has logic for detecting a failure to spawn
      and instead passing arguments via a file instead, but this failure detection
      only triggers if a process actually fails to spawn.
      
      Unfortunately on Windows we've got something else to worry about which is
      `cmd.exe`. The compiler may be running a linker through `cmd.exe` where
      `cmd.exe` has a limit of 8192 on the command line vs 32k on `CreateProcess`.
      Moreso rustc actually succeeds in spawning `cmd.exe` today, it's just that after
      it's running `cmd.exe` fails to spawn its child, which rustc doesn't currently
      detect.
      
      Consequently this commit updates the logic for the spawning the linker on
      Windows to instead have a heuristic to see if we need to pass arguments via a
      file. This heuristic is an overly pessimistic and "inaccurate" calculation which
      just calls `len` on a bunch of `OsString` instances (where `len` is not
      precisely the length in u16 elements). This number, when exceeding the 6k
      threshold, will force rustc to always pass arguments through a file.
      
      This strategy should avoid us trying to parse the output on Windows of the
      linker to see if it successfully spawned yet failed to actually sub-spawn the
      linker. We may just be passing arguments through files a little more commonly
      now...
      
      The motivation for this commit was a recent bug in Gecko [1] when beta testing,
      notably when incremental compilation was enabled it blew out the limit on
      `cmd.exe`. This commit will also fix #46999 as well though as emscripten uses a
      bat script as well (and we're blowing the limit there).
      
      [1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1430886
      
      Closes #46999
      ae920dcc
    • S
      Add dynamic-drop test to nll tests also · 90aef18c
      Santiago Pastorino 提交于
      90aef18c
    • B
      Inline some rustc_driver function · c3fabcea
      bjorn3 提交于
      c3fabcea
  2. 22 1月, 2018 16 次提交
    • B
      Auto merge of #47353 - nikomatsakis:nll-issue-47189, r=pnkfelix+nmatsakis · fdc18b30
      bors 提交于
      renumber regions in generators
      
      This fixes #47189, but I think we still have to double check various things around how to treat generators in MIR type check + borrow check (e.g., what borrows should be invalidated by a `Suspend`? What consistency properties should type check be enforcing anyway around the "interior" type?)
      
      Also fixes #47587 thanks to @spastorino's commit.
      
      r? @pnkfelix
      fdc18b30
    • R
      Fix spurious warning on empty proc macro crates · e1bffbdf
      Ryan Cumming 提交于
      While attempting to reproduce rust-lang/rust#47086 I noticed the
      following warning:
      
      ```shell
      > rustc /dev/null --crate-type proc-macro
      warning: unused variable: `registrar`
       --> /dev/null:0:1
      ```
      
      As there are no macros to register the automatically generated registrar
      function for the crate has no body. As a result its `registrar` argument
      is unused triggering the above warning.
      
      The warning is confusing and not easily actionable by the developer. It
      could also be triggered legitimately by e.g. having all of the macros in
      a crate #[cfg]'ed out.
      
      Fix by naming the generated argument `_registrar` inside
      `mk_registrar()`. This suppresses the unused variable warning.
      e1bffbdf
    • B
      Auto merge of #47158 - rkruppe:repr-transparent, r=eddyb · b887317d
      bors 提交于
      Implement repr(transparent)
      
      r? @EddyB for the functional changes. The bulk of the PR is error messages and docs, might be good to have a doc person look over those.
      
      cc #43036
      cc @nox
      b887317d
    • B
      Auto merge of #47144 - estebank:moved-closure-arg, r=nikomatsakis · bc072ed0
      bors 提交于
      Custom error when moving arg outside of its closure
      
      When given the following code:
      
      ```rust
      fn give_any<F: for<'r> FnOnce(&'r ())>(f: F) {
          f(&());
      }
      
      fn main() {
          let mut x = None;
          give_any(|y| x = Some(y));
      }
      ```
      
      provide a custom error:
      
      ```
      error: borrowed data cannot be moved outside of its closure
       --> file.rs:7:27
        |
      6 |     let mut x = None;
        |         ----- borrowed data cannot be moved into here...
      7 |     give_any(|y| x = Some(y));
        |              ---          ^ cannot be moved outside of its closure
        |              |
        |              ...because it cannot outlive this closure
      ```
      
      instead of the generic lifetime error:
      
      ```
      error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
       --> file.rs:7:27
        |
      7 |     give_any(|y| x = Some(y));
        |                           ^
        |
      note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 7:14...
       --> file.rs:7:14
        |
      7 |     give_any(|y| x = Some(y));
        |              ^^^^^^^^^^^^^^^
      note: ...so that expression is assignable (expected &(), found &())
       --> file.rs:7:27
        |
      7 |     give_any(|y| x = Some(y));
        |                           ^
      note: but, the lifetime must be valid for the block suffix following statement 0 at 6:5...
       --> file.rs:6:5
        |
      6 | /     let mut x = None;
      7 | |     give_any(|y| x = Some(y));
      8 | | }
        | |_^
      note: ...so that variable is valid at time of its declaration
       --> file.rs:6:9
        |
      6 |     let mut x = None;
        |         ^^^^^
      ```
      
      Fix #45983.
      bc072ed0
    • A
      rustc: Lower link args to `@`-files on Windows more · 66366f96
      Alex Crichton 提交于
      When spawning a linker rustc has historically been known to blow OS limits for
      the command line being too large, notably on Windows. This is especially true of
      incremental compilation where there can be dozens of object files per
      compilation. The compiler currently has logic for detecting a failure to spawn
      and instead passing arguments via a file instead, but this failure detection
      only triggers if a process actually fails to spawn.
      
      Unfortunately on Windows we've got something else to worry about which is
      `cmd.exe`. The compiler may be running a linker through `cmd.exe` where
      `cmd.exe` has a limit of 8192 on the command line vs 32k on `CreateProcess`.
      Moreso rustc actually succeeds in spawning `cmd.exe` today, it's just that after
      it's running `cmd.exe` fails to spawn its child, which rustc doesn't currently
      detect.
      
      Consequently this commit updates the logic for the spawning the linker on
      Windows to instead have a heuristic to see if we need to pass arguments via a
      file. This heuristic is an overly pessimistic and "inaccurate" calculation which
      just calls `len` on a bunch of `OsString` instances (where `len` is not
      precisely the length in u16 elements). This number, when exceeding the 6k
      threshold, will force rustc to always pass arguments through a file.
      
      This strategy should avoid us trying to parse the output on Windows of the
      linker to see if it successfully spawned yet failed to actually sub-spawn the
      linker. We may just be passing arguments through files a little more commonly
      now...
      
      The motivation for this commit was a recent bug in Gecko [1] when beta testing,
      notably when incremental compilation was enabled it blew out the limit on
      `cmd.exe`. This commit will also fix #46999 as well though as emscripten uses a
      bat script as well (and we're blowing the limit there).
      
      [1]: https://bugzilla.mozilla.org/show_bug.cgi?id=1430886
      
      Closes #46999
      66366f96
    • B
      Auto merge of #47644 - GuillaumeGomez:rollup, r=GuillaumeGomez · ff2a7c85
      bors 提交于
      Rollup of 9 pull requests
      
      - Successful merges: #47247, #47334, #47512, #47582, #47595, #47625, #47632, #47633, #47637
      - Failed merges:
      ff2a7c85
    • G
      Rollup merge of #47637 - russmack:fix-mailmap-dupes, r=steveklabnik · dcbf0bf5
      Guillaume Gomez 提交于
      Fix mailmap duplicates, Carol and Brian.
      
      This fix corrects the .mailmap file so that Carol (Nichols || Goulding) appears only once, and Brian Anderson also appears only once.
      dcbf0bf5
    • G
      Rollup merge of #47633 - pietroalbini:fix-ice-use-self, r=nagisa · 05f77ac5
      Guillaume Gomez 提交于
      Fix ICE with `use self;`
      
      Closes #47623
      05f77ac5
    • G
      Rollup merge of #47632 - sdroege:exact-chunks-docs-broken-links, r=kennytm · 6e6ab1e9
      Guillaume Gomez 提交于
      Fix broken links to other slice functions in chunks/chunks_mut/exact_…
      
      …chunk/exact_chunks_mut docs
      
      See https://github.com/rust-lang/rust/pull/47126#discussion_r162780492
      6e6ab1e9
    • G
      Rollup merge of #47625 - astraw:btreeset-doctest-fix, r=kennytm · 50e38365
      Guillaume Gomez 提交于
      fix doctests for BTreeSet to use BTreeSet (not BTreeMap)
      
      This fixes #47624
      50e38365
    • G
      Rollup merge of #47595 - PieterPenninckx:master, r=shepmaster · c354bb81
      Guillaume Gomez 提交于
      Small improvements to the documentation of VecDeque.
      
      Some small improvements to the documentation of `VecDeque`.
      c354bb81
    • G
      Rollup merge of #47582 - alexcrichton:auto-beta, r=kennytm · 35221d8d
      Guillaume Gomez 提交于
      Automaticaly calculate beta prerelease numbers
      
      This is a forward-port of:
      
      * 9426dda8
      * cbfb9858
      
      from the beta branch which is used to automatically calculate the beta number
      based on the number of merges to the beta branch so far.
      35221d8d
    • G
      Rollup merge of #47512 - GuillaumeGomez:e0659, r=petrochenkov · a1c3449a
      Guillaume Gomez 提交于
      Add E0659 for ambiguous names
      
      Still on the tracks of the "no error without error code" road.
      a1c3449a
    • G
      Rollup merge of #47334 - etaoins:only-call-res-init-on-gnu-unix, r=alexcrichton · ab54a9c7
      Guillaume Gomez 提交于
      Only link res_init() on GNU/*nix
      
      To workaround a bug in glibc <= 2.26 lookup_host() calls res_init() based on the glibc version detected at runtime. While this avoids calling res_init() on platforms where it's not required we will still end up linking against the symbol.
      
      This causes an issue on macOS where res_init() is implemented in a separate library (libresolv.9.dylib) from the main libc. While this is harmless for standalone programs it becomes a problem if Rust code is statically linked against another program. If the linked program doesn't already specify -lresolv it will cause the link to fail. This is captured in issue #46797
      
      Fix this by hooking in to the glibc workaround in `cvt_gai` and only activating it for the "gnu" environment on Unix This should include all glibc platforms while excluding musl, windows-gnu, macOS, FreeBSD, etc.
      
      This has the side benefit of removing the #[cfg] in sys_common; only unix.rs has code related to the workaround now.
      
      Before this commit:
      ```shell
      > cat main.rs
      use std::net::ToSocketAddrs;
      
      #[no_mangle]
      pub extern "C" fn resolve_test() -> () {
          let addr_list = ("google.com.au", 0).to_socket_addrs().unwrap();
          println!("{:?}", addr_list);
      }
      > rustc --crate-type=staticlib main.rs
      > clang libmain.a test.c -o combined
      Undefined symbols for architecture x86_64:
        "_res_9_init", referenced from:
            std::net::lookup_host::h93c17fe9ad38464a in libmain.a(std-826c8d3b356e180c.std0.rcgu.o)
      ld: symbol(s) not found for architecture x86_64
      clang-5.0: error: linker command failed with exit code 1 (use -v to see invocation)
      ```
      
      Afterwards:
      ```shell
      > rustc --crate-type=staticlib main.rs
      > clang libmain.a test.c -o combined
      > ./combined
      IntoIter([V4(172.217.25.131:0)])
      ```
      
      Fixes  #46797
      ab54a9c7
    • G
      Rollup merge of #47247 - estebank:suggest-cast, r=petrochenkov · 6bb1b0dd
      Guillaume Gomez 提交于
      Suggest casting on numeric type error
      
      Re #47168.
      6bb1b0dd
    • B
      Auto merge of #47116 - estebank:non-accessible-ctor, r=petrochenkov · 97520ccb
      bors 提交于
      Tweaks to invalid ctor messages
      
       - Do not suggest using a constructor that isn't accessible
       - Suggest the appropriate syntax (`()`/`{}` as appropriate)
       - Add note when trying to use `Self` as a ctor
      
      CC #22488, fix #47085.
      97520ccb
  3. 21 1月, 2018 6 次提交