1. 20 2月, 2021 18 次提交
  2. 19 2月, 2021 19 次提交
    • B
      Auto merge of #82281 - Dylan-DPC:rollup-raob2tu, r=Dylan-DPC · 8599bff5
      bors 提交于
      Rollup of 10 pull requests
      
      Successful merges:
      
       - #79747 (Add explanations and suggestions to `irrefutable_let_patterns` lint)
       - #81496 (name async generators something more human friendly in type error diagnostic)
       - #81873 (Add Mutex::unlock)
       - #82093 (Add tests for Atomic*::fetch_{min,max})
       - #82238 (ast: Keep expansion status for out-of-line module items)
       - #82245 (Do not ICE when evaluating locals' types of invalid `yield`)
       - #82259 (Fix popping singleton paths in when generating E0433)
       - #82261 (rustdoc: Support argument files)
       - #82274 (libtest: Fix unwrap panic on duplicate TestDesc)
       - #82275 (Update cargo)
      
      Failed merges:
      
      r? `@ghost`
      `@rustbot` modify labels: rollup
      8599bff5
    • D
      Rollup merge of #82275 - ehuss:update-cargo, r=ehuss · 979b00ba
      Dylan DPC 提交于
      Update cargo
      
      8 commits in ab64d1393b5b77c66b6534ef5023a1b89ee7bf64..bf5a5d5e5d3ae842a63bfce6d070dfd438cf6070
      2021-02-10 00:19:10 +0000 to 2021-02-18 15:49:14 +0000
      - Propagate `lto=off` harder (rust-lang/cargo#9182)
      - refactor: make deref intentions more straightforward (rust-lang/cargo#9183)
      - Update link for no_std attribute. (rust-lang/cargo#9174)
      - Remove mention of --message-format taking multiple values (rust-lang/cargo#9173)
      - Emit warning on env variable case mismatch (rust-lang/cargo#9169)
      - Implement Rustdoc versioning checks (rust-lang/cargo#8640)
      - Bump to 0.53.0, update changelog (rust-lang/cargo#9168)
      - Prevent testsuite from loading config out of sandbox. (rust-lang/cargo#9164)
      979b00ba
    • D
      Rollup merge of #82274 - andersk:test-unwrap, r=Mark-Simulacrum · 36a348bd
      Dylan DPC 提交于
      libtest: Fix unwrap panic on duplicate TestDesc
      
      It is possible for different tests to collide to the same `TestDesc` when macros are involved. That is a bug, but it didn’t cause a panic until #81367. For now, change the code to ignore this problem.
      
      Fixes #81852.
      
      This will need to be applied to `beta` too.
      36a348bd
    • D
      Rollup merge of #82261 - ojeda:rustdoc-argfile, r=jyn514 · d9bc16cf
      Dylan DPC 提交于
      rustdoc: Support argument files
      
      Factors out the `rustc_driver` logic that handles argument files so that rustdoc supports them as well, e.g.:
      
          rustdoc `@argfile`
      
      This is needed to be able to generate docs for projects that already use argument files when compiling them, e.g. projects that pass a huge number of `--cfg` arguments.
      
      The feature was stabilized for `rustc` in #66172.
      d9bc16cf
    • D
      Rollup merge of #82259 - osa1:issue82156, r=petrochenkov · cc01bbe8
      Dylan DPC 提交于
      Fix popping singleton paths in when generating E0433
      
      Fixes #82156
      
      ---
      
      This was introduced with #72923, so pinging `@Patryk27` for reviews.
      cc01bbe8
    • D
      Rollup merge of #82245 - estebank:issue-78653, r=matthewjasper · c2445466
      Dylan DPC 提交于
      Do not ICE when evaluating locals' types of invalid `yield`
      
      When a `yield` is outside of a generator, check its value regardless to
      avoid an ICE while trying to get all locals' types in writeback.
      
      Fix #78653.
      c2445466
    • D
      Rollup merge of #82238 - petrochenkov:nocratemod, r=Aaron1011 · 30f39fee
      Dylan DPC 提交于
      ast: Keep expansion status for out-of-line module items
      
      I.e. whether a module `mod foo;` is already loaded from a file or not.
      This is a pre-requisite to correctly treating inner attributes on such modules (https://github.com/rust-lang/rust/issues/81661).
      
      With this change AST structures for `mod` items diverge even more for AST structure for the crate root, which previously used `ast::Mod`.
      Therefore this PR removes `ast::Mod` from `ast::Crate` in the first commit, these two things are sufficiently different from each other, at least at syntactic level.
      Customization points for visiting a "`mod` item or crate root" were also removed from AST visitors (`fn visit_mod`).
      `ast::Mod` itself was refactored away in the second commit in favor of `ItemKind::Mod(Unsafe, ModKind)`.
      30f39fee
    • D
      Rollup merge of #82093 - bjorn3:more_atomic_tests, r=kennytm · f8b61d85
      Dylan DPC 提交于
      Add tests for Atomic*::fetch_{min,max}
      
      This ensures that all atomic operations except for fences are tested. This has been useful to test my work on using atomic instructions for atomic operations in cg_clif instead of a global lock.
      f8b61d85
    • D
    • D
      Rollup merge of #81496 - guswynn:expected_async_block, r=oli-obk · f468fd1d
      Dylan DPC 提交于
      name async generators something more human friendly in type error diagnostic
      
      fixes #81457
      
      Some details:
      
      1. I opted to load the generator kind from the hir in TyCategory. I also use 1 impl in the hir for the descr
      2. I named both the source of the future, in addition to the general type (`future`), not sure what is preferred
      3. I am not sure what is required to make sure "generator" is not referred to anywhere. A brief `rg "\"generator\"" showed me that most diagnostics correctly distinguish from generators and async generator, but the `descr` of `DefKind` is pretty general (not sure how thats used)
      4. should the descr impl of AsyncGeneratorKind use its display impl instead of copying the string?
      f468fd1d
    • D
      Rollup merge of #79747 - camelid:irrefut-lint-link, r=varkor · 94ab4078
      Dylan DPC 提交于
      Add explanations and suggestions to `irrefutable_let_patterns` lint
      
      Fixes #79716.
      94ab4078
    • M
      rustdoc: Support argument files · 755b3fc7
      Miguel Ojeda 提交于
      Factors out the `rustc_driver` logic that handles argument files
      so that rustdoc supports them as well, e.g.:
      
          rustdoc @argfile
      
      This is needed to be able to generate docs for projects that
      already use argument files when compiling them, e.g. projects
      that pass a huge number of `--cfg` arguments.
      
      The feature was stabilized for `rustc` in #66172.
      Signed-off-by: NMiguel Ojeda <ojeda@kernel.org>
      755b3fc7
    • C
      5d2a2a1c
    • E
      Update cargo · 34a94d38
      Eric Huss 提交于
      34a94d38
    • A
      libtest: Fix unwrap panic on duplicate TestDesc. · 1605af01
      Anders Kaseorg 提交于
      It is possible for different tests to collide to the same TestDesc
      when macros are involved.  That is a bug, but it didn’t cause a panic
      until #81367.  For now, change the code to ignore this problem.
      
      Fixes #81852.
      Signed-off-by: NAnders Kaseorg <andersk@mit.edu>
      1605af01
    • B
      Auto merge of #82263 - Dylan-DPC:rollup-cypm2uw, r=Dylan-DPC · 0148b971
      bors 提交于
      Rollup of 10 pull requests
      
      Successful merges:
      
       - #81546 ([libtest] Run the test synchronously when hitting thread limit)
       - #82066 (Ensure valid TraitRefs are created for GATs)
       - #82112 (const_generics: Dont evaluate array length const when handling yet another error )
       - #82194 (In some limited cases, suggest `where` bounds for non-type params)
       - #82215 (Replace if-let and while-let with `if let` and `while let`)
       - #82218 (Make sure pdbs are copied along with exe and dlls when bootstrapping)
       - #82236 (avoid converting types into themselves (clippy::useless_conversion))
       - #82246 (Add long explanation for E0549)
       - #82248 (Optimize counting digits in line numbers during error reporting)
       - #82256 (Print -Ztime-passes (and misc stats/logs) on stderr, not stdout.)
      
      Failed merges:
      
      r? `@ghost`
      `@rustbot` modify labels: rollup
      0148b971
    • M
      add Mutex::unlock · e92e5fd7
      mark 提交于
      e92e5fd7
    • G
      ignore file length · 3e7ea401
      Gus Wynn 提交于
      3e7ea401
    • Ö
      Fix popping singleton paths in when generating E0433 · 9889e444
      Ömer Sinan Ağacan 提交于
      Fixes #82156
      9889e444
  3. 18 2月, 2021 3 次提交
    • D
      Rollup merge of #82256 - eddyb:time-passes-stderr, r=varkor · efdcb430
      Dylan DPC 提交于
      Print -Ztime-passes (and misc stats/logs) on stderr, not stdout.
      
      I've tried not to change anything that looked similar to `rustc --print`, where people might use automation, and/or any "bulk" prints, such as dumping an entire Graphviz (`dot`) graph on stdout.
      
      The reason I want `-Ztime-passes` to be on stderr like debug logging is I can get a complete (and correctly interleaved) view just by looking at stderr, which is merely a convenience when running `rustc`/Cargo directly, but even more important when it's nested in a build script, as Cargo will split the build script output into stdout (named `output`) and `stderr`.
      efdcb430
    • D
      Rollup merge of #82248 - nhwn:optimize-counting-digits, r=varkor · 555db2da
      Dylan DPC 提交于
      Optimize counting digits in line numbers during error reporting
      
      Replaces `.to_string().len()` with simple loop and integer division, which avoids an unnecessary allocation.
      
      Although I couldn't figure out how to directly profile `rustc`'s error reporting, I ran a microbenchmark on my machine (2.9 GHz Dual-Core Intel Core i5) on the two strategies for `0..100_000`, and the results seem promising:
      ```
      test to_string_len ... bench:  12,124,792 ns/iter (+/- 700,652)
      test while_loop    ... bench:      30,333 ns/iter (+/- 562)
      ```
      The x86_64 disassembly reduces integer division to a multiplication + shift, so I don't think there's any problems with using integer division.
      
      For more (micro)optimization, it would be nice if we could avoid the initial check to see if the line number is nonzero, but I don't think `self.get_max_line_num(span, children)` _guarantees_ a nonzero line number.
      555db2da
    • D
      Rollup merge of #82246 - jesusprubio:add-long-explanation-e0549, r=GuillaumeGomez · 5ca94cd0
      Dylan DPC 提交于
      Add long explanation for E0549
      
      Helps with #61137
      5ca94cd0