1. 28 1月, 2018 5 次提交
    • B
      Auto merge of #47767 - estebank:as-suggestion, r=petrochenkov · 7046a406
      bors 提交于
      Correctly format `extern crate` conflict resolution help
      
      Closes #45799. Follow up to @Cldfire's #45820.
      
      If the `extern` statement that will have a suggestion ends on a `;`, synthesize a new span that doesn't include it.
      7046a406
    • B
      Auto merge of #47671 - alexcrichton:trans-c-api-only, r=Mark-Simulacrum · 87990a11
      bors 提交于
      rustc: Load the `rustc_trans` crate at runtime
      
      Building on the work of #45684 this commit updates the compiler to
      unconditionally load the `rustc_trans` crate at runtime instead of linking to it
      at compile time. The end goal of this work is to implement #46819 where rustc
      will have multiple backends available to it to load.
      
      This commit starts off by removing the `extern crate rustc_trans` from the
      driver. This involved moving some miscellaneous functionality into the
      `TransCrate` trait and also required an implementation of how to locate and load
      the trans backend. This ended up being a little tricky because the sysroot isn't
      always the right location (for example `--sysroot` arguments) so some extra code
      was added as well to probe a directory relative to the current dll (the
      rustc_driver dll).
      
      Rustbuild has been updated accordingly as well to have a separate compilation
      invocation for the `rustc_trans` crate and assembly it accordingly into the
      sysroot. Finally, the distribution logic for the `rustc` package was also
      updated to slurp up the trans backends folder.
      
      A number of assorted fallout changes were included here as well to ensure tests
      pass and such, and they should all be commented inline.
      87990a11
    • A
      rustc: Load the `rustc_trans` crate at runtime · 884715c6
      Alex Crichton 提交于
      Building on the work of # 45684 this commit updates the compiler to
      unconditionally load the `rustc_trans` crate at runtime instead of linking to it
      at compile time. The end goal of this work is to implement # 46819 where rustc
      will have multiple backends available to it to load.
      
      This commit starts off by removing the `extern crate rustc_trans` from the
      driver. This involved moving some miscellaneous functionality into the
      `TransCrate` trait and also required an implementation of how to locate and load
      the trans backend. This ended up being a little tricky because the sysroot isn't
      always the right location (for example `--sysroot` arguments) so some extra code
      was added as well to probe a directory relative to the current dll (the
      rustc_driver dll).
      
      Rustbuild has been updated accordingly as well to have a separate compilation
      invocation for the `rustc_trans` crate and assembly it accordingly into the
      sysroot. Finally, the distribution logic for the `rustc` package was also
      updated to slurp up the trans backends folder.
      
      A number of assorted fallout changes were included here as well to ensure tests
      pass and such, and they should all be commented inline.
      884715c6
    • B
      Auto merge of #47746 - varkor:never-type-ice, r=nikomatsakis · 6beb06ee
      bors 提交于
      Fix never-type rvalue ICE
      
      This fixes #43061.
      r? @nikomatsakis
      
      A small post-mortem as a follow-up to our investigations in https://github.com/rust-lang/rust/pull/47291:
      The problem as I understand it is that when `NeverToAny` coercions are made, the expression/statement that is coerced may be enclosed in a block. In our case, the statement `x;` was being transformed to something like: `NeverToAny( {x;} )`. Then, `NeverToAny` is transformed into an expression:
      https://github.com/rust-lang/rust/blob/000fbbc9b8f88adc6a417f1caef41161f104250f/src/librustc_mir/build/expr/into.rs#L52-L59
      Which ends up calling `ast_block_stmts` on the block `{x;}`, which triggers this condition:
      https://github.com/rust-lang/rust/blob/000fbbc9b8f88adc6a417f1caef41161f104250f/src/librustc_mir/build/block.rs#L141-L147
      In our case, there is no return expression, so `push_assign_unit` is called. But the block has already been recorded as _diverging_, meaning the result of the block will be assigned to a location of type `!`, rather than `()`. This causes the MIR error.
      I'm assuming the `NeverToAny` coercion code is doing what it's supposed to (there don't seem to be any other problems), so fixing the issue simply consists of checking that the destination for the return value actually _is_ supposed to be a unit. (If no return value is given, the only other possible type for the return value is `!`, which can just be ignored, as it will be unreachable anyway.)
      
      I checked the other cases of `push_assign_unit`, and it didn't look like they could be affected by the divergence issue (blocks are kind of special-cased in this regard as far as I can tell), so this should be sufficient to fix the issue.
      6beb06ee
    • B
      Auto merge of #47420 - davidtwco:issue-46885, r=estebank · 7d6e5b9d
      bors 提交于
      Fix off-by-one spans in MIR borrowck errors
      
      Fixes #46885.
      
      r? @nikomatsakis
      7d6e5b9d
  2. 27 1月, 2018 27 次提交
  3. 26 1月, 2018 8 次提交