1. 26 11月, 2020 9 次提交
    • J
      Rollup merge of #79362 - cjgillot:relou, r=oli-obk · 85c11de2
      Jonas Schievink 提交于
      Lower patterns before using the bound variable
      
      So as to avoid having to lower patterns twice.
      85c11de2
    • J
      Rollup merge of #79000 - sivadeilra:user/ardavis/lev_distance, r=wesleywiser · 6fcd5890
      Jonas Schievink 提交于
      Move lev_distance to rustc_ast, make non-generic
      
      rustc_ast currently has a few dependencies on rustc_lexer. Ideally, an AST
      would not have any dependency its lexer, for minimizing
      design-time dependencies. Breaking this dependency would also have practical
      benefits, since modifying rustc_lexer would not trigger a rebuild of rustc_ast.
      
      This commit does not remove the rustc_ast --> rustc_lexer dependency,
      but it does remove one of the sources of this dependency, which is the
      code that handles fuzzy matching between symbol names for making suggestions
      in diagnostics. Since that code depends only on Symbol, it is easy to move
      it to rustc_span. It might even be best to move it to a separate crate,
      since other tools such as Cargo use the same algorithm, and have simply
      contain a duplicate of the code.
      
      This changes the signature of find_best_match_for_name so that it is no
      longer generic over its input. I checked the optimized binaries, and this
      function was duplicated for nearly every call site, because most call sites
      used short-lived iterator chains, generic over Map and such. But there's
      no good reason for a function like this to be generic, since all it does
      is immediately convert the generic input (the Iterator impl) to a concrete
      Vec<Symbol>. This has all of the costs of generics (duplicated method bodies)
      with no benefit.
      
      Changing find_best_match_for_name to be non-generic removed about 10KB of
      code from the optimized binary. I know it's a drop in the bucket, but we have
      to start reducing binary size, and beginning to tame over-use of generics
      is part of that.
      6fcd5890
    • J
      Rollup merge of #77758 - Stupremee:turbofish-help-for-const, r=varkor · 9b2117d1
      Jonas Schievink 提交于
      suggest turbofish syntax for uninferred const arguments
      
      When not providing a const generic value, and it can not be inferred, the following suggestion is suggested:
      ![image](https://user-images.githubusercontent.com/39732259/95616180-af127b80-0a69-11eb-8877-551c815f9627.png)
      
      Resolves #76737
      
      r? ``@varkor``
      9b2117d1
    • B
      Auto merge of #79435 - Mark-Simulacrum:fix-powerpc, r=Mark-Simulacrum · 0d965164
      bors 提交于
      Mirror centos vault to S3
      0d965164
    • M
      Mirror centos vault to S3 · 457329a7
      Mark Rousskov 提交于
      457329a7
    • B
      Auto merge of #79411 - tmiasko:naked-params, r=Amanieu · b48cafd9
      bors 提交于
      Validate use of parameters in naked functions
      
      * Reject use of parameters inside naked function body.
      * Reject use of patterns inside function parameters, to emphasize role
        of parameters a signature declaration (mirroring existing behaviour
        for function declarations) and avoid generating code introducing
        specified bindings.
      
      Closes issues below by considering input to be ill-formed.
      
      Closes #75922.
      Closes #77848.
      Closes #79350.
      b48cafd9
    • B
      Auto merge of #79326 - Aaron1011:fix/builtin-macro-stmt, r=petrochenkov · 192c7dbb
      bors 提交于
      Always invoke statement attributes on the statement itself
      
      This is preparation for PR #78296, which will require us to handle
      statement items in addition to normal items.
      192c7dbb
    • A
      baefba80
    • B
      Auto merge of #79216 - Aaron1011:opt-on-disk-cache, r=pnkfelix · db79d2f6
      bors 提交于
      Only create `OnDiskCache` in incremental compilation mode
      
      This lets us skip doing useless work when we're not in incremental
      compilation mode.
      db79d2f6
  2. 25 11月, 2020 17 次提交
    • B
      Auto merge of #79400 - camelid:rustdoc-summary_opts, r=GuillaumeGomez · 36018a4d
      bors 提交于
      Add `summary_opts()` for Markdown summary rendering options
      
      We have a similar function `opts()` that is for rendering the main body
      of the documentation, but until now we just constructed the options for
      rendering summaries on the fly. This is a problem if/when we change the
      enabled options since the different places can get out-of-sync.
      36018a4d
    • B
      Auto merge of #79397 - camelid:polonious-incr-comp, r=jonas-schievink · 20dcbf0d
      bors 提交于
      TRACK '-Z polonius' flag
      
      Fixes #79316.
      
      r? `@jonas-schievink`
      20dcbf0d
    • B
      Auto merge of #79388 - tmiasko:naked-def-only, r=lcnr · 773ddbad
      bors 提交于
      Validate that `#[naked]` is applied to a function definition
      773ddbad
    • B
      Auto merge of #79336 - camelid:rename-feature-oibit-to-auto, r=oli-obk · ec039bd0
      bors 提交于
      Rename `optin_builtin_traits` to `auto_traits`
      
      They were originally called "opt-in, built-in traits" (OIBITs), but
      people realized that the name was too confusing and a mouthful, and so
      they were renamed to just "auto traits". The feature flag's name wasn't
      updated, though, so that's what this PR does.
      
      There are some other spots in the compiler that still refer to OIBITs,
      but I don't think changing those now is worth it since they are internal
      and not particularly relevant to this PR.
      
      Also see <https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/opt-in.2C.20built-in.20traits.20(auto.20traits).20feature.20name>.
      
      r? `@oli-obk` (feel free to re-assign if you're not the right reviewer for this)
      ec039bd0
    • B
      Auto merge of #77491 - lukaslueg:peek_mut, r=m-ou-se · b387f62d
      bors 提交于
      Proposal to add Peekable::peek_mut
      
      A "peekable" iterator has a `peek()`-method which provides an immutable reference to the next item. We currently do not have a method to modify that item, which we could easily add via a `peek_mut()`. See the test for a use-case (alike to my original use case), where a "pristine" iterator is passed on after modifying its state via `peek_mut()`.
      
      If there is interest in this, I can expand on the tests and docs.
      b387f62d
    • C
      TRACK '-Z polonius' flag · c4caf5ad
      Camelid 提交于
      c4caf5ad
    • C
      Add `summary_opts()` for Markdown summary rendering options · 50c2739b
      Camelid 提交于
      We have a similar function `opts()` that is for rendering the main body
      of the documentation, but until now we just constructed the options for
      rendering summaries on the fly. This is a problem if/when we change the
      enabled options since the different places can get out-of-sync.
      50c2739b
    • B
      Auto merge of #76688 - yokodake:patch-2, r=kodrAus · 3f7ccb4c
      bors 提交于
      Document unsafety in core::slice::memchr
      
      Contributes to #66219
      
      Note sure if that's good enough, especially for the `align_to` call.
      The docs only mention transmuting and I don't think that everything related to reference lifetimes and state validity mentioned in the [nomicon](https://doc.rust-lang.org/nomicon/transmutes.html) are relevant here.
      3f7ccb4c
    • C
      Use the name "auto traits" everywhere in the compiler · 82dc99ba
      Camelid 提交于
      Goodbye, OIBIT!
      82dc99ba
    • A
      Move lev_distance to rustc_ast, make non-generic · 5481c1bd
      Arlie Davis 提交于
      rustc_ast currently has a few dependencies on rustc_lexer. Ideally, an AST
      would not have any dependency its lexer, for minimizing unnecessarily
      design-time dependencies. Breaking this dependency would also have practical
      benefits, since modifying rustc_lexer would not trigger a rebuild of rustc_ast.
      
      This commit does not remove the rustc_ast --> rustc_lexer dependency,
      but it does remove one of the sources of this dependency, which is the
      code that handles fuzzy matching between symbol names for making suggestions
      in diagnostics. Since that code depends only on Symbol, it is easy to move
      it to rustc_span. It might even be best to move it to a separate crate,
      since other tools such as Cargo use the same algorithm, and have simply
      contain a duplicate of the code.
      
      This changes the signature of find_best_match_for_name so that it is no
      longer generic over its input. I checked the optimized binaries, and this
      function was duplicated at nearly every call site, because most call sites
      used short-lived iterator chains, generic over Map and such. But there's
      no good reason for a function like this to be generic, since all it does
      is immediately convert the generic input (the Iterator impl) to a concrete
      Vec<Symbol>. This has all of the costs of generics (duplicated method bodies)
      with no benefit.
      
      Changing find_best_match_for_name to be non-generic removed about 10KB of
      code from the optimized binary. I know it's a drop in the bucket, but we have
      to start reducing binary size, and beginning to tame over-use of generics
      is part of that.
      5481c1bd
    • T
      Validate use of parameters in naked functions · 22d34312
      Tomasz Miąsko 提交于
      * Reject use of parameters inside naked function body.
      * Reject use of patterns inside function parameters, to emphasize role
        of parameters a signature declaration (mirroring existing behaviour
        for function declarations) and avoid generating code introducing
        specified bindings.
      22d34312
    • A
      Invoke attributes on the statement for statement items · 9c9f4065
      Aaron Hill 提交于
      9c9f4065
    • B
      Auto merge of #78548 - camelid:driver-tty, r=oli-obk · 1c389ffe
      bors 提交于
      driver: Only output ANSI logging if connected to a terminal
      
      Fixes #78435.
      
      See #78435 for more.
      
      Cc `@RalfJung` `@oli-obk`
      1c389ffe
    • A
      Handle `Annotatable::Stmt` in some builtin macros · e9546bdb
      Aaron Hill 提交于
      This is preparation for PR #78296, which will require us to handle
      statement items in addition to normal items.
      e9546bdb
    • B
      Auto merge of #79384 - ehuss:update-cargo, r=ehuss · 74459930
      bors 提交于
      Update cargo
      
      10 commits in 2af662e22177a839763ac8fb70d245a680b15214..bfca1cd22bf514d5f2b6c1089b0ded0ba7dfaa6e
      2020-11-12 19:04:56 +0000 to 2020-11-24 16:33:21 +0000
      - Shrink the progress bar, to give more space after it. (rust-lang/cargo#8892)
      - Add some comments to the toml code (rust-lang/cargo#8887)
      - Start searching git config at new path (rust-lang/cargo#8886)
      - Fix documentation for CARGO_PRIMARY_PACKAGE. (rust-lang/cargo#8891)
      - Bump to 0.51.0, update changelog (rust-lang/cargo#8894)
      - Publish target's "doc" setting when emitting metadata (rust-lang/cargo#8869)
      - Relaxes expectation of `cargo test` tests to accept test execution time (rust-lang/cargo#8884)
      - Finish implementation of `-Zextra-link-arg`. (rust-lang/cargo#8441)
      - Reproducible crate builds (rust-lang/cargo#8864)
      - Allow resolver="1" to explicitly use the old resolver behavior. (rust-lang/cargo#8857)
      74459930
    • E
      Update cargo · c46e8964
      Eric Huss 提交于
      c46e8964
    • B
      Auto merge of #79335 - jyn514:doctree-crate, r=GuillaumeGomez · 25a69100
      bors 提交于
      Get rid of doctree::{ExternalCrate, ForeignItem, Trait, Function}
      
      Closes #79314, closes #79331, closes #79332. Follow-up to #79264 and #79312, continues breaking up #78082.
      
      r? `@GuillaumeGomez`
      25a69100
  3. 24 11月, 2020 14 次提交