1. 11 8月, 2017 7 次提交
  2. 10 8月, 2017 17 次提交
    • A
      Fix cross-crate global allocators on windows · 56a07539
      Aidan Hobson Sayers 提交于
      56a07539
    • B
      Auto merge of #43720 - pornel:staticconst, r=petrochenkov · b6179602
      bors 提交于
      Hint correct extern constant syntax
      
      Error message for `extern "C" { const …}` is terse, and the right syntax is hard to guess given unfortunate difference between meaning of `static` in C and Rust.
      
      I've added a hint for the right syntax.
      b6179602
    • K
      Reword error hint · cabc9be9
      Kornel 提交于
      cabc9be9
    • B
      Auto merge of #43522 - alexcrichton:rewrite-lints, r=michaelwoerister · 2400ebfe
      bors 提交于
      rustc: Rearchitect lints to be emitted more eagerly
      
      In preparation for incremental compilation this commit refactors the lint
      handling infrastructure in the compiler to be more "eager" and overall more
      incremental-friendly. Many passes of the compiler can emit lints at various
      points but before this commit all lints were buffered in a table to be emitted
      at the very end of compilation. This commit changes these lints to be emitted
      immediately during compilation using pre-calculated lint level-related data
      structures.
      
      Linting today is split into two phases, one set of "early" lints run on the
      `syntax::ast` and a "late" set of lints run on the HIR. This commit moves the
      "early" lints to running as late as possible in compilation, just before HIR
      lowering. This notably means that we're catching resolve-related lints just
      before HIR lowering. The early linting remains a pass very similar to how it was
      before, maintaining context of the current lint level as it walks the tree.
      
      Post-HIR, however, linting is structured as a method on the `TyCtxt` which
      transitively executes a query to calculate lint levels. Each request to lint on
      a `TyCtxt` will query the entire crate's 'lint level data structure' and then go
      from there about whether the lint should be emitted or not.
      
      The query depends on the entire HIR crate but should be very quick to calculate
      (just a quick walk of the HIR) and the red-green system should notice that the
      lint level data structure rarely changes, and should hopefully preserve
      incrementality.
      
      Overall this resulted in a pretty big change to the test suite now that lints
      are emitted much earlier in compilation (on-demand vs only at the end). This in
      turn necessitated the addition of many `#![allow(warnings)]` directives
      throughout the compile-fail test suite and a number of updates to the UI test
      suite.
      
      Closes https://github.com/rust-lang/rust/issues/42511
      2400ebfe
    • B
      Auto merge of #43582 - ivanbakel:unused_mut_ref, r=arielb1 · d21ec9b4
      bors 提交于
      Fixed mutable vars being marked used when they weren't
      
      #### NB : bootstrapping is slow on my machine, even with `keep-stage` - fixes for occurances in the current codebase are <s>in the pipeline</s> done. This PR is being put up for review of the fix of the issue.
      
      Fixes #43526, Fixes #30280, Fixes #25049
      
      ### Issue
      Whenever the compiler detected a mutable deref being used mutably, it marked an associated value as being used mutably as well. In the case of derefencing local variables which were mutable references, this incorrectly marked the reference itself being used mutably, instead of its contents - with the consequence of making the following code emit no warnings
      ```
      fn do_thing<T>(mut arg : &mut T) {
          ... // don't touch arg - just deref it to access the T
      }
      ```
      
      ### Fix
      Make dereferences not be counted as a mutable use, but only when they're on borrows on local variables.
      #### Why not on things other than local variables?
        * Whenever you capture a variable in a closure, it gets turned into a hidden reference - when you use it in the closure, it gets dereferenced. If the closure uses the variable mutably, that is actually a mutable use of the thing being dereffed to, so it has to be counted.
        * If you deref a mutable `Box` to access the contents mutably, you are using the `Box` mutably - so it has to be counted.
      d21ec9b4
    • B
      Auto merge of #43737 - GuillaumeGomez:duplicate-method, r=eddyb · 2ac5f7d2
      bors 提交于
      Improve error message when duplicate names for type and trait method
      
      Fixes #43626.
      2ac5f7d2
    • B
      Auto merge of #43735 - est31:master, r=alexcrichton · 16268a88
      bors 提交于
      Avoid calling the column!() macro in panic
      
      Closes #43057
      
      This "fix" adds a new macro called `__rust_unstable_column` and to use it instead of the `column` macro inside panic. The new macro can be shadowed as well as `column` can, but its very likely that there is no code that does this in practice.
      
      There is no real way to make "unstable" macros that are usable by stable macros, so we do the next best thing and prefix the macro with `__rust_unstable` to make sure people recognize it is unstable.
      
      r? @alexcrichton
      16268a88
    • B
      Auto merge of #43730 - nrc:driver-shim, r=eddyb · 57e720d2
      bors 提交于
      Make the driver API a little more useful for a tools shim
      
      Example use case: https://github.com/nrc/rls-rustc
      57e720d2
    • I
      Updated cargo submodule to fix compile error · 8f78d453
      Isaac van Bakel 提交于
      8f78d453
    • E
      Add a feature gate · 5cf9f633
      est31 提交于
      @alexcrichton figured out a way how to do it :)
      5cf9f633
    • V
      a965beef
    • B
      Auto merge of #43627 - Aaronepower:master, r=alexcrichton · 875bcf5c
      bors 提交于
      Updated release notes for 1.20
      
      [Rendered](https://github.com/Aaronepower/rust/blob/master/RELEASES.md)
      875bcf5c
    • N
    • B
      Auto merge of #43484 - estebank:point-to-return, r=arielb1 · f1424995
      bors 提交于
      Point at return type always when type mismatch against it
      
      Before this, the diagnostic errors would only point at the return type
      when changing it would be a possible solution to a type error. Add a
      label to the return type without a suggestion to change in order to make
      the source of the expected type obvious.
      
      Follow up to #42850, fixes #25133, fixes #41897.
      f1424995
    • E
      Readd backticks around () · 9bd62a46
      Esteban Küber 提交于
      9bd62a46
    • B
      Auto merge of #43732 - kennytm:pass-wrapper-warning, r=arielb1 · 33d71944
      bors 提交于
      Fix covered-switch-default warnings in PassWrapper
      
      (See #39063 for explanation)
      33d71944
    • A
      rustc: Rearchitect lints to be emitted more eagerly · 0374e6aa
      Alex Crichton 提交于
      In preparation for incremental compilation this commit refactors the lint
      handling infrastructure in the compiler to be more "eager" and overall more
      incremental-friendly. Many passes of the compiler can emit lints at various
      points but before this commit all lints were buffered in a table to be emitted
      at the very end of compilation. This commit changes these lints to be emitted
      immediately during compilation using pre-calculated lint level-related data
      structures.
      
      Linting today is split into two phases, one set of "early" lints run on the
      `syntax::ast` and a "late" set of lints run on the HIR. This commit moves the
      "early" lints to running as late as possible in compilation, just before HIR
      lowering. This notably means that we're catching resolve-related lints just
      before HIR lowering. The early linting remains a pass very similar to how it was
      before, maintaining context of the current lint level as it walks the tree.
      
      Post-HIR, however, linting is structured as a method on the `TyCtxt` which
      transitively executes a query to calculate lint levels. Each request to lint on
      a `TyCtxt` will query the entire crate's 'lint level data structure' and then go
      from there about whether the lint should be emitted or not.
      
      The query depends on the entire HIR crate but should be very quick to calculate
      (just a quick walk of the HIR) and the red-green system should notice that the
      lint level data structure rarely changes, and should hopefully preserve
      incrementality.
      
      Overall this resulted in a pretty big change to the test suite now that lints
      are emitted much earlier in compilation (on-demand vs only at the end). This in
      turn necessitated the addition of many `#![allow(warnings)]` directives
      throughout the compile-fail test suite and a number of updates to the UI test
      suite.
      0374e6aa
  3. 09 8月, 2017 16 次提交