1. 06 2月, 2018 2 次提交
    • B
      mir: Add TerminatorKind::FalseUnwind · bdc37aa0
      bobtwinkles 提交于
      Sometimes a simple goto misses the cleanup/unwind edges. Specifically, in the
      case of infinite loops such as those introduced by a loop statement without any
      other out edges. Analogous to TerminatorKind::FalseEdges; this new terminator
      kind is used when we want borrowck to consider an unwind path, but real control
      flow should never actually take it.
      bdc37aa0
    • B
      Fix comment in ExprKind::LogicalOp · 5ca88ae6
      bobtwinkles 提交于
      The comment previously implied that the true branch would result in the false
      block. Fortunately the implementation is correct.
      5ca88ae6
  2. 05 2月, 2018 9 次提交
    • B
      Auto merge of #47881 - oli-obk:miri_clippy, r=Manishearth · 6c04c410
      bors 提交于
      Update clippy and miri submodule
      
      r? @Manishearth
      
      cc @kennytm I needed to touch the miri submodule's Cargo.toml to make sure that clippy gets the newest compiletest_rs. This will not fix miri, but since I touched the miri submodule, will this PR fail?
      
      miri is unfixable until #46882 is merged
      6c04c410
    • O
      Update clippy and miri submodule · 70717f20
      Oliver Schneider 提交于
      70717f20
    • B
      Auto merge of #47920 - Aaron1011:nll-overflow, r=pnkfelix · b0a396bb
      bors 提交于
      Fix overflow when performing drop check calculations in NLL
      
      Clearing out the infcx's region constraints after processing each type
      ends up interacting badly with normalizing associated types. This commit
      keeps all region constraints intact until the end of
      TypeLivenessGenerator.add_drop_live_constraint, ensuring that normalized
      types are able to re-use existing inference variables.
      
      Fixes #47589
      b0a396bb
    • B
      Auto merge of #47873 - Aaron1011:final-ref-coerce, r=nikomatsakis · 07ea2604
      bors 提交于
      Fix ref-to-ptr coercions not working with NLL in certain cases
      
      Implicit coercions from references to pointers were lowered to slightly
      different Mir than explicit casts (e.g. 'foo as *mut T'). This resulted
      in certain uses of self-referential structs compiling correctly when an
      explicit cast was used, but not when the implicit coercion was used.
      
      To fix this, this commit adds an outer 'Use' expr when applying a
      raw-ptr-borrow adjustment. This makes the lowered Mir for coercions
      identical to that of explicit coercions, allowing the original code to
      compile regardless of how the raw ptr cast occurs.
      
      Fixes #47722
      07ea2604
    • B
      Auto merge of #47865 - Manishearth:cleanup-shim, r=nikomatsakis · dd29d3dd
      bors 提交于
      Cleanup the shim code
      
       - We now write directly to `RETURN_PLACE` instead of creating intermediates
       - `tuple_like_shim` takes an iterator (used by #47867)
       - `tuple_like_shim` no longer relies on it being the first thing to create blocks, and uses relative block indexing in a cleaner way (necessary for #47867)
       - All the shim builders take `dest, src` arguments instead of hardcoding RETURN_PLACE
      
      r? @EddyB
      dd29d3dd
    • B
      Auto merge of #47998 - kennytm:rollup, r=kennytm · e7e982ac
      bors 提交于
      Rollup of 10 pull requests
      
      - Successful merges: #47862, #47877, #47896, #47912, #47947, #47958, #47978, #47996, #47999, #47892
      - Failed merges:
      e7e982ac
    • K
      Rollup merge of #47892 - Badel2:const_type_id_of, r=oli-obk · e17ebdf3
      kennytm 提交于
      Turn `type_id` into a constant intrinsic
      
      https://github.com/rust-lang/rust/issues/27745
      
      The method `get_type_id` in `Any` is intended to support reflection. It's currently unstable in favor of using an associated constant instead. This PR makes the `type_id` intrinsic a constant intrinsic, the same as `size_of` and `align_of`, allowing `TypeId::of` to be a `const fn`, which will allow using an associated constant in `Any`.
      e17ebdf3
    • K
      Rollup merge of #47999 - jaystrictor:master, r=Mark-Simulacrum · 66d6c855
      kennytm 提交于
      Remove 'the this' in doc comments.
      66d6c855
    • K
      Rollup merge of #47996 - Zoxc:run-make-last, r=Mark-Simulacrum · adb5849b
      kennytm 提交于
      Run the `run-make` tests last, so more tests run on Windows when `make` is unavailable
      adb5849b
  3. 04 2月, 2018 16 次提交
    • K
      Rollup merge of #47978 - eddyb:iu, r=kennytm · 393cd892
      kennytm 提交于
      ui tests: diff from old (expected) to new (actual) instead of backwards.
      
      Previously `actual` was "old" and `expected` was "new" which resulted in `+` before `-`.
      AFAIK all diff tools put `-` before `+`, which made the previous behavior *very confusing*.
      
      r? @nikomatsakis
      393cd892
    • K
      Rollup merge of #47958 - frewsxcv:frewsxcv-try-clone, r=aidanhs · e58cff2a
      kennytm 提交于
      Clarify shared file handler behavior of File::try_clone.
      
      Fixes https://github.com/rust-lang/rust/issues/46578.
      e58cff2a
    • K
      Rollup merge of #47947 - goodmanjonathan:stabilize_match_beginning_vert, r=petrochenkov · 1439c2ac
      kennytm 提交于
      Stabilize feature(match_beginning_vert)
      
      With this feature stabilized, match expressions can optionally have a `|` at the beginning of each arm.
      
      Reference PR: rust-lang-nursery/reference#231
      
      Closes #44101
      1439c2ac
    • K
      Rollup merge of #47912 - cuviper:glibc-stack-guard, r=alexcrichton · 8b8c6ee7
      kennytm 提交于
      Use a range to identify SIGSEGV in stack guards
      
      Previously, the `guard::init()` and `guard::current()` functions were
      returning a `usize` address representing the top of the stack guard,
      respectively for the main thread and for spawned threads.  The `SIGSEGV`
      handler on `unix` targets checked if a fault was within one page below that
      address, if so reporting it as a stack overflow.
      
      Now `unix` targets report a `Range<usize>` representing the guard memory,
      so it can cover arbitrary guard sizes.  Non-`unix` targets which always
      return `None` for guards now do so with `Option<!>`, so they don't pay any
      overhead.
      
      For `linux-gnu` in particular, the previous guard upper-bound was
      `stackaddr + guardsize`, as the protected memory was *inside* the stack.
      This was a glibc bug, and starting from 2.27 they are moving the guard
      *past* the end of the stack.  However, there's no simple way for us to know
      where the guard page actually lies, so now we declare it as the whole range
      of `stackaddr ± guardsize`, and any fault therein will be called a stack
      overflow.  This fixes #47863.
      8b8c6ee7
    • K
      Rollup merge of #47896 -... · 349115ef
      kennytm 提交于
      Rollup merge of #47896 - zackmdavis:and_the_case_of_the_necessary_unnecessary_parens, r=nikomatsakis
      
      decline to lint technically-unnecessary parens in function or method arguments inside of nested macros
      
      In #46980 ("in which the unused-parens lint..." (14982db2)), the
      unused-parens lint was made to check function and method arguments,
      which it previously did not (seemingly due to oversight rather than
      willful design). However, in #47775 and discussion thereon,
      user–developers of Geal/nom and graphql-rust/juniper reported that the
      lint was seemingly erroneously triggering on certain complex macros in
      those projects. While this doesn't seem like a bug in the lint in the
      particular strict sense that the expanded code would, in fact, contain
      unncecessary parentheses, it also doesn't seem like the sort of thing
      macro authors should have to think about: the spirit of the
      unused-parens lint is to prevent needless clutter in code, not to give
      macro authors extra heartache in the handling of token trees.
      
      We propose the expediency of declining to lint unused parentheses in
      function or method args inside of nested expansions: we believe that
      this should eliminate the petty, troublesome lint warnings reported
      in the issue, without forgoing the benefits of the lint in simpler
      macros.
      
      It seemed like too much duplicated code for the `Call` and `MethodCall`
      match arms to duplicate the nested-macro check in addition to each
      having their own `for` loop, so this occasioned a slight refactor so
      that the function and method cases could share code—hopefully the
      overall intent is at least no less clear to the gentle reader.
      
      This is concerning #47775.
      349115ef
    • K
      Rollup merge of #47877 - spastorino:lifetime-bounds-in-copy, r=nikomatsakis · f3dc7560
      kennytm 提交于
      Do not ignore lifetime bounds in Copy impls
      
      cc #29149
      
      r? @nikomatsakis
      f3dc7560
    • K
      Rollup merge of #47862 - GuillaumeGomez:const-evaluation-ice, r=eddyb · 68698637
      kennytm 提交于
      Fix const evaluation ICE in rustdoc
      
      Fixes #47860.
      
      r? @EddyB
      68698637
    • J
      Remove 'the this' in doc comments. · f168700b
      Jay Strict 提交于
      f168700b
    • B
      Auto merge of #47834 - Mark-Simulacrum:no-cgu-release, r=alexcrichton · 0c6091fb
      bors 提交于
      Do not enable ThinLTO on stable, beta, or nightly builds.
      
      Fixes #45444
      0c6091fb
    • J
    • B
      Auto merge of #47991 - nrc:update, r=alexcrichton · 3986539d
      bors 提交于
      Update RLS and Rustfmt
      
      r? @alexcrichton
      3986539d
    • B
      Auto merge of #47915 - eddyb:layout-of, r=nikomatsakis · 9af374ab
      bors 提交于
      rustc: prefer ParamEnvAnd and LayoutCx over tuples for LayoutOf.
      
      This PR provides `tcx.layout_of(param_env.and(ty))` as the idiomatic replacement for the existing `(tcx, param_env).layout_of(ty)` and removes fragile (coherence-wise) layout-related tuple impls.
      
      r? @nikomatsakis
      9af374ab
    • N
      Update RLS and Rustfmt · cec82c1b
      Nick Cameron 提交于
      cec82c1b
    • M
      Disable ThinLTO for dist builds. · e1f04c04
      Mark Simulacrum 提交于
      Dist builds should always be as fast as we can make them, and since
      those run on CI we don't care quite as much for the build being somewhat
      slower. As such, we don't automatically enable ThinLTO on builds for the
      dist builders.
      e1f04c04
    • B
      Auto merge of #47845 - Zoxc:gen-fixes, r=nikomatsakis · 3d292b79
      bors 提交于
      Generator bugfixes
      
      r? @nikomatsakis
      3d292b79
    • C
  4. 03 2月, 2018 8 次提交
  5. 02 2月, 2018 5 次提交
    • K
      Rollup merge of #47951 - GuillaumeGomez:sidebar-hover, r=QuietMisdreavus Fix... · 8d1586df
      kennytm 提交于
      Rollup merge of #47951 - GuillaumeGomez:sidebar-hover, r=QuietMisdreavus Fix ugly hover in sidebar In the sidebar, the elements under `Structs`, `Enums`... have an ugly hover if they're not selected. This fixes it. r? @QuietMisdreavus
      8d1586df
    • K
      Rollup merge of #47942 - estebank:macro-spans, r=nikomatsakis Minimize weird... · 9d995d28
      kennytm 提交于
      Rollup merge of #47942 - estebank:macro-spans, r=nikomatsakis Minimize weird spans involving macro context Sometimes the parser attempts to synthesize spans from within a macro context with the span for the captured argument, leading to non-sensical spans with very bad output. Given that an incorrect span is worse than a partially incomplete span, when detecting this situation return only one of the spans without merging them. Fix #32072, #47778. CC #23480.
      9d995d28
    • K
      Rollup merge of #47919 - varkor:to_degrees-precision, r=rkruppe Use constant... · 7c6380cd
      kennytm 提交于
      Rollup merge of #47919 - varkor:to_degrees-precision, r=rkruppe Use constant for 180/π in to_degrees The current `f32|f64.to_degrees` implementation uses a division to calculate `180/π`, which causes a loss of precision. Using a constant is still not perfect (implementing a maximally-precise algorithm would come with a high performance cost), but improves precision with a minimal change. As per the discussion in #29944, this fixes #29944 (the costs of improving the precision further would not outweigh the gains).
      7c6380cd
    • K
      Rollup merge of #47916 - vmx:patch-2, r=kennytm Fix lang items box example... · 5edeff31
      kennytm 提交于
      Rollup merge of #47916 - vmx:patch-2, r=kennytm Fix lang items box example code The `exchange_free` lang item is gone in favour of `box_free` [1]. Some warnings are also fixed by this commit. [1]: https://github.com/rust-lang/rust/commit/ca115dd083a1fe1d2b4892c5e50e49eb83ff1f3
      5edeff31
    • K
      Rollup merge of #47914 - etaoins:improve-char-escape-in-lexer-msg,... · b4b73a1d
      kennytm 提交于
      Rollup merge of #47914 - etaoins:improve-char-escape-in-lexer-msg, r=petrochenkov Improve char escaping in lexer messages Currently ', " and \ are escaped as \', \" and \\ respectively. This leads to confusing messages such as `error: unknown start of token: \\` when encountering a single backslash. Fix by emitting printable ASCII characters directly. This will still escape \r, \n, \t and Unicode characters. Fixes #47902
      b4b73a1d