1. 02 9月, 2021 13 次提交
    • B
      Auto merge of #88530 - bjorn3:shrink_session, r=cjgillot · fcce6441
      bors 提交于
      Shrink Session a bit
      
      Remove a couple of unnecessary fields from `Session` and remove a `Lock<T>` for a field that is never mutated anyway.
      fcce6441
    • B
      Add explanation for ctfe_backtrace lock · 74c7f126
      bjorn3 提交于
      74c7f126
    • B
      Use in_incr_comp_dir_sess in cg_clif · b86a2ee0
      bjorn3 提交于
      b86a2ee0
    • B
      Remove print_fuel_crate field of Session · c9abc7e2
      bjorn3 提交于
      c9abc7e2
    • B
      Remove optimization_fuel_crate from Session · 5464b2e7
      bjorn3 提交于
      5464b2e7
    • B
      Auto merge of #88516 - matthiaskrgr:clippy_perf_end_august, r=jyn514,GuillaumeGomez · 64929313
      bors 提交于
      some low hanging clippy::perf fixes
      64929313
    • B
      Auto merge of #87114 - cjgillot:abilint, r=estebank · b27ccbc7
      bors 提交于
      Lint missing Abi in ast validation instead of lowering.
      b27ccbc7
    • B
      Auto merge of #83342 - Count-Count:win-console-incomplete-utf8, r=m-ou-se · cc9bb152
      bors 提交于
      Allow writing of incomplete UTF-8 sequences to the Windows console via stdout/stderr
      
      # Problem
      Writes of just an incomplete UTF-8 byte sequence (e.g. `b"\xC3"` or `b"\xF0\x9F"`)  to stdout/stderr with a Windows console attached error with `io::ErrorKind::InvalidData, "Windows stdio in console mode does not support writing non-UTF-8 byte sequences"` even though further writes could complete the codepoint. This is currently a rare occurence since the [linewritershim](https://github.com/rust-lang/rust/blob/2c56ea38b045624dc8b42ec948fc169eaff1206a/library/std/src/io/buffered/linewritershim.rs) implementation flushes complete lines immediately and buffers up to 1024 bytes for incomplete lines. It can still happen as described in #83258.
      
      The problem will become more pronounced once the developer can switch stdout/stderr from line-buffered to block-buffered or immediate when the changes in the "Switchable buffering for Stdout" pull request (#78515) get merged.
      
      # Patch description
      If there is at least one valid UTF-8 codepoint all valid UTF-8 is passed through to the extracted `write_valid_utf8_to_console()` fn. The new code only comes into play if `write()` is being passed a short byte slice comprising an incomplete UTF-8 codepoint. In this case up to three bytes are buffered in the `IncompleteUtf8` struct associated with `Stdout` / `Stderr`. The bytes are accepted one at a time. As soon as an error can be detected `io::ErrorKind::InvalidData, "Windows stdio in console mode does not support writing non-UTF-8 byte sequences"` is returned. Once a complete UTF-8 codepoint is received it is passed to the `write_valid_utf8_to_console()` and the buffer length is set to zero.
      
      Calling `flush()` will neither error nor write anything if an incomplete codepoint is present in the buffer.
      
      # Tests
      Currently there are no Windows-specific tests for console writing code at all. Writing (regression) tests for this problem is a bit challenging since unit tests and UI tests don't run in a console and suddenly popping up another console window might be surprising to developers running the testsuite and it might not work at all in CI builds. To just test the new functionality in unit tests the code would need to be refactored. Some guidance on how to proceed would be appreciated.
      
      # Public API changes
      * `std::str::verifications::utf8_char_width()` would be exposed as `std::str::utf8_char_width()` behind the "str_internals" feature gate.
      
      # Related issues
      * Fixes #83258.
      * PR #78515 will exacerbate the problem.
      
      # Open questions
      * Add tests?
      * Squash into one commit with better commit message?
      cc9bb152
    • B
      Auto merge of #88522 - camelid:box-paren-output, r=jyn514 · e3c71f1e
      bors 提交于
      rustdoc: Box `GenericArgs::Parenthesized.output`
      
      Split out from #88379.
      
      This reduces the size of `GenericArgs` from 104 bytes to 56 bytes,
      essentially reducing it by half.
      
      `GenericArgs` is one of the fields of `PathSegment`, so this should
      reduce the amount of memory allocated for `PathSegment`s in the cases
      where the generics are not for a `Fn`, `FnMut`, or `FnOnce` trait.
      
      r? `@jyn514`
      e3c71f1e
    • B
      Auto merge of #88490 - GuillaumeGomez:associated-types-implementors-display, r=camelid,Manishearth · 767edcf6
      bors 提交于
      Display associated types of implementors
      
      Fixes #86631.
      
      Contrary to before, it doesn't display methods. I also had to "resurrect" the `auto-hide-trait-implementations` setting. :3
      
      Only question at this point: should I move the `render_impl` boolean arguments into one struct? We're starting to have quite a lot of them...
      
      cc `@cynecx`
      r? `@camelid`
      767edcf6
    • G
      Remove implementors setting · 92dae39b
      Guillaume Gomez 提交于
      92dae39b
    • B
      Auto merge of #88563 - ehuss:update-cargo-books, r=ehuss · 50171c31
      bors 提交于
      Update cargo, books
      
      ## nomicon
      
      2 commits in 0c7e5bd1428e7838252bb57b7f0fbfda4ec82f02..fe6227eb3c8533200c52dffa42ef1b6f2f02c40e
      2021-08-04 10:18:22 -0700 to 2021-08-31 05:42:38 +0900
      - update lifetime-elision to show what elided code under `rust_2018_idi… (rust-lang/nomicon#306)
      - Change code for `into_iter` on the `RawVec` section for consistency/soundness (rust-lang/nomicon#302)
      
      ## cargo
      
      8 commits in f559c109cc79fe413a8535fb620a5a58b3823d94..18751dd3f238d94d384a7fe967abfac06cbfe0b9
      2021-08-26 22:54:55 +0000 to 2021-09-01 14:26:00 +0000
      - print the full destination path when no track duplicates (rust-lang/cargo#9850)
      - Stabilize 2021 edition (rust-lang/cargo#9800)
      - Stabilize patch-in-config (and prefer config over manifest) (rust-lang/cargo#9839)
      - Adding the cargo doc --examples subcommand (rust-lang/cargo#9808)
      - Make library created with `cargo new` clippy happy (rust-lang/cargo#9796)
      - Swap out some outdated repo urls in documentation (rust-lang/cargo#9862)
      - Change `cargo fix --edition` to only fix edition lints. (rust-lang/cargo#9846)
      - Show desc of well known subcommands (fmt, clippy) in cargo --list (rust-lang/cargo#9848)
      
      ## reference
      
      1 commits in da6ea9b03f74cae0a292f40315723d7a3a973637..0e5ed7a4bec065f0cc18c35d1c904639e095314d
      2021-08-19 21:28:10 -0700 to 2021-08-29 17:33:21 +0900
      - expressions.md: Attempt fixing broken grammar in Mutability paragraph (rust-lang/reference#1084)
      
      ## book
      
      1 commits in 687e21bde2ea10c261f79fa14797c5137425098d..fcb5e0ea68112d85a1d29a7a7335978ef2a02181
      2021-08-18 20:48:38 -0400 to 2021-08-31 21:26:19 -0400
      - Improve the reading of the code (rust-lang/book#2845)
      
      ## rustc-dev-guide
      
      7 commits in cf0e151b7925a40f13fbc6573c6f97d5f94c7c17..95f1acf9a39d6f402f654e917e2c1dfdb779c5fc
      2021-08-22 11:47:02 -0300 to 2021-08-31 12:38:30 -0500
      - Add link to `Span`
      - Add rustc-source to suggested rust-analyzer config (rust-lang/rustc-dev-guide#1189)
      - Fix typo, clarify backtick wording, and use inline code
      - Trailing date comments in a line inside of a paragraph caused beginning of a new paragraph. (rust-lang/rustc-dev-guide#1196)
      - Fix warning "Renderer command uses a path relative to the renderer output directory ..." (rust-lang/rustc-dev-guide#1194)
      - Fix a code block containing ```rust
      - date-check: Recognize capitalized 'Date' as well
      
      ## edition-guide
      
      1 commits in 3710b0cae783d0bcd2b42452a63b081473f5970a..2d9b1b9da706de24650fdc5c3b0182f55c82115d
      2021-07-26 11:34:46 -0700 to 2021-08-31 10:44:09 +0200
      - Update for 2021 stabilization (rust-lang/edition-guide#266)
      
      ## embedded-book
      
      1 commits in 4f9fcaa30d11ba52b641e6fd5206536d65838af9..c3a51e23859554369e6bbb5128dcef0e4f159fb5
      2021-08-06 17:43:12 +0000 to 2021-08-26 07:04:58 +0000
      - Make glossary more linkable and add more detail  (rust-embedded/book#299)
      50171c31
    • E
      Update cargo, books · bea37908
      Eric Huss 提交于
      bea37908
  2. 01 9月, 2021 27 次提交
    • B
      Auto merge of #88269 - prconrad:doctest-persist-binaries, r=jyn514 · ad3407f4
      bors 提交于
      Doctest persist full binaries when persisting
      
      Tested by adding an extra debug to echo the whole compiler line. Trimmed significantly:
      
      Persisted but not running -> full compile so we get binaries (new behavior).
      ```
      $ rustdoc -Zunstable-options --test --persist-doctests doctests --no-run --extern t=libt.rlib t.rs
      
      DEBUG rustdoc::doctest run_test compiler "rustc" "--crate-type" "bin" "--edition" "2015" "-o" "doctests/t_rs_8_0/rust_out" "--extern" "t=libt.rlib" "-Ccodegen-units=1" "-Z" "unstable-options" "--target" "x86_64-unknown-linux-gnu" "--color" "always"
      DEBUG rustdoc::doctest run_test compiler "rustc" "--crate-type" "bin" "--edition" "2015" "-o" "doctests/t_rs_2_0/rust_out" "--extern" "t=libt.rlib" "-Ccodegen-units=1" "-Z" "unstable-options" "--target" "x86_64-unknown-linux-gnu" "--color" "always"
      test t.rs - foople (line 2) - compile ... ok
      test t.rs - florp (line 8) - compile ... ok
      ```
      
      Persisted and running -> full compile.
      ```
      $ rustdoc -Zunstable-options --test --persist-doctests doctests --extern t=libt.rlib t.rs
      
      DEBUG rustdoc::doctest run_test compiler "rustc" "--crate-type" "bin" "--edition" "2015" "-o" "doctests/t_rs_8_0/rust_out" "--extern" "t=libt.rlib" "-Ccodegen-units=1" "-Z" "unstable-options" "--target" "x86_64-unknown-linux-gnu" "--color" "always"
      DEBUG rustdoc::doctest run_test compiler "rustc" "--crate-type" "bin" "--edition" "2015" "-o" "doctests/t_rs_2_0/rust_out" "--extern" "t=libt.rlib" "-Ccodegen-units=1" "-Z" "unstable-options" "--target" "x86_64-unknown-linux-gnu" "--color" "always"
      
      ```
      
      Running but not persisted -> full compile only
      ```
      $ rustdoc --test --extern t=libt.rlib t.rs
      
      DEBUG rustdoc::doctest run_test compiler "rustc" "--crate-type" "bin" "--edition" "2015" "-o" "/tmp/rustdoctestixWAUI/rust_out" "--extern" "t=libt.rlib" "-Ccodegen-units=1" "--target" "x86_64-unknown-linux-gnu" "--color" "always"
      DEBUG rustdoc::doctest run_test compiler "rustc" "--crate-type" "bin" "--edition" "2015" "-o" "/tmp/rustdoctestKEaJQu/rust_out" "--extern" "t=libt.rlib" "-Ccodegen-units=1" "--target" "x86_64-unknown-linux-gnu" "--color" "always"
      
      ```
      
      Not running and not persisting -> save time and only run metadata.
      ```
      RUSTDOC_LOG=rustdoc=debug,std::test=debug rustdoc -Zunstable-options --no-run --test --extern t=libt.rlib t.rs
      
      DEBUG rustdoc::doctest run_test compiler "rustc" "--crate-type" "bin" "--edition" "2015" "-o" "/tmp/rustdoctest8twt2c/rust_out" "--extern" "t=libt.rlib" "-Ccodegen-units=1" "-Z" "unstable-options" "--emit=metadata" "--target" "x86_64-unknown-linux-gnu" "--color" "always"
      DEBUG rustdoc::doctest run_test compiler "rustc" "--crate-type" "bin" "--edition" "2015" "-o" "/tmp/rustdoctest3miSqv/rust_out" "--extern" "t=libt.rlib" "-Ccodegen-units=1" "-Z" "unstable-options" "--emit=metadata" "--target" "x86_64-unknown-linux-gnu" "--color" "always"
      ```
      
      I can't see any infrastructure for automating this sort of test. Am I missing it?
      ad3407f4
    • B
      Auto merge of #88395 - ricky26:llvm-submodule, r=nikic · 00ce1665
      bors 提交于
      Update LLVM submodule
      
      This will capture the two M68k bugfixes to help with #88321.
      00ce1665
    • B
      Auto merge of #88556 - m-ou-se:rollup-q636wyd, r=m-ou-se · 3ed6c1d2
      bors 提交于
      Rollup of 9 pull requests
      
      Successful merges:
      
       - #86376 (Emit specific warning to clarify that `#[no_mangle]` should not be applied on foreign statics or functions)
       - #88040 (BTree: remove Ord bound from new)
       - #88053 (Fix the flock fallback implementation)
       - #88350 (add support for clobbering xer, cr, and cr[0-7] for asm! on OpenPower/PowerPC)
       - #88410 (Remove bolding on associated constants)
       - #88525 (fix(rustc_typeck): produce better errors for dyn auto trait)
       - #88542 (Use the return value of readdir_r() instead of errno)
       - #88548 (Stabilize `Iterator::intersperse()`)
       - #88551 (Stabilize `UnsafeCell::raw_get()`)
      
      Failed merges:
      
      r? `@ghost`
      `@rustbot` modify labels: rollup
      3ed6c1d2
    • G
      Clean render_impl arguments · fba4149b
      Guillaume Gomez 提交于
      fba4149b
    • G
      d7159bdb
    • M
      Rollup merge of #88551 - inquisitivecrystal:unsafe_cell_raw_get, r=m-ou-se · d3135296
      Mara Bos 提交于
      Stabilize `UnsafeCell::raw_get()`
      
      This PR stabilizes the associated function `UnsafeCell::raw_get()`. The FCP has [already completed](https://github.com/rust-lang/rust/issues/66358#issuecomment-899095068). While there was some discussion about the naming after the close of the FCP, it looks like people have agreed on this name. Still, it would probably be best if a `libs-api` member had a look at this and stated whether more discussion is needed.
      
      While I was at it, I added some tests for `UnsafeCell`, because there were barely any.
      
      Closes #66358.
      d3135296
    • M
      Rollup merge of #88548 - inquisitivecrystal:intersperse, r=m-ou-se · f436b6d0
      Mara Bos 提交于
      Stabilize `Iterator::intersperse()`
      
      This PR stabilizes the methods `Iterator::intersperse()` and `Iterator::intersperse_with()`. The FCP has [already completed](https://github.com/rust-lang/rust/issues/79524#issuecomment-909663616).
      
      Closes #79524.
      f436b6d0
    • M
      Rollup merge of #88542 - tavianator:readdir_r-errno, r=jyn514 · 59588a9a
      Mara Bos 提交于
      Use the return value of readdir_r() instead of errno
      
      POSIX says:
      
      > If successful, the readdir_r() function shall return zero; otherwise,
      > an error number shall be returned to indicate the error.
      
      But we were previously using errno instead of the return value.  This
      led to issue #86649.
      59588a9a
    • M
      Rollup merge of #88525 - notriddle:notriddle/coherence-dyn-auto-trait, r=petrochenkov · bbc94ed3
      Mara Bos 提交于
      fix(rustc_typeck): produce better errors for dyn auto trait
      
      Fixes #85026
      bbc94ed3
    • M
      Rollup merge of #88410 - camelid:fix-assoc-bold, r=GuillaumeGomez · 75b2ae5e
      Mara Bos 提交于
      Remove bolding on associated constants
      
      Associated types don't get bolded, so it looks off to have one kind
      bolded and one not.
      75b2ae5e
    • M
      Rollup merge of #88350 - programmerjake:add-ppc-cr-xer-clobbers, r=Amanieu · 494c563f
      Mara Bos 提交于
      add support for clobbering xer, cr, and cr[0-7] for asm! on OpenPower/PowerPC
      
      Fixes #88315
      494c563f
    • M
      Rollup merge of #88053 - bjorn3:fix_flock_fallback_impl, r=cjgillot · 8fd53e30
      Mara Bos 提交于
      Fix the flock fallback implementation
      8fd53e30
    • M
      Rollup merge of #88040 - nbdd0121:btreemap, r=m-ou-se · 5878780e
      Mara Bos 提交于
      BTree: remove Ord bound from new
      
      `K: Ord` bound is unnecessary on `BTree{Map,Set}::new` and their `Default` impl. No elements exist so there are nothing to compare anyway, so I don't think "future proof" would be a blocker here. This is analogous to `HashMap::new` not having a `K: Eq + Hash` bound.
      
      #79245 originally does this and for some reason drops the change to `new` and `Default`. I can see why changes to other methods like `entry` or `symmetric_difference` need to be careful but I couldn't find out any reason not to do it on `new`.
      
      Removing the bound also makes the stabilisation of `const fn new` not depending on const trait bounds.
      
      cc `@steffahn` who suggests me to make this PR.
      
      r? `@dtolnay`
      5878780e
    • M
      Rollup merge of #86376 - asquared31415:extern-no-mangle-84204, r=Mark-Simulacrum · dcefd687
      Mara Bos 提交于
      Emit specific warning to clarify that `#[no_mangle]` should not be applied on foreign statics or functions
      
      Foreign statics and foreign functions should not have `#[no_mangle]` applied, as it does nothing to the name and has some extra hidden behavior that is normally unwanted.  There was an existing warning for this, but it says the attribute is only allowed on "statics or functions", which to the user can be confusing.
      
      This PR adds a specific version of the unused `#[no_mangle]` warning that explains that the target is a *foreign* static or function and that they do not need the attribute.
      
      Fixes #78989
      dcefd687
    • B
      Auto merge of #88272 - willcrichton:mutable-sparse-matrix, r=ecstatic-morse · 608b5e1c
      bors 提交于
      Add bit removal methods to SparseBitMatrix and factor *BitSet relational methods into more extensible trait
      
      I need the ability to clear the bits out of a row from `SparseBitMatrix`. Currently, all the mutating methods only allow insertion of bits, and there is no way to get access to the underlying data.
      
      One approach is simply to make `ensure_row` public, since it grants `&mut` access to the underlying `HybridBitSet`. This PR adds the `pub` modifier. However, presumably this method was private for a reason, so I'm open to other designs. I would prefer general mutable access to the rows, because that way I can add many mutating operations (`clear`, `intersect`, etc.) without filing a PR each time :-)
      
      r? `@ecstatic-morse`
      608b5e1c
    • B
      Auto merge of #88121 - camelid:better-recursive-alias-error, r=estebank · c4f26b15
      bors 提交于
      Improve errors for recursive type aliases
      
      Fixes #17539.
      c4f26b15
    • N
      Remove unhelpful `expect()` message · 280e1678
      Noah Lev 提交于
      280e1678
    • N
      Box `GenericArgs::Parenthesized.output` · 2d1240e6
      Noah Lev 提交于
      This reduces the size of `GenericArgs` from 104 bytes to 56 bytes,
      essentially reducing it by half.
      
      `GenericArgs` is one of the fields of `PathSegment`, so this should
      reduce the amount of memory allocated for `PathSegment`s in the cases
      where the generics are not for a `Fn`, `FnMut`, or `FnOnce` trait.
      
      I also added `static_assert_size!`s to `GenericArgs` and `PathSegment`
      to ensure they don't increase in size unexpectedly.
      2d1240e6
    • B
      Auto merge of #87688 - camsteffen:let-else, r=cjgillot · c2a40884
      bors 提交于
      Introduce `let...else`
      
      Tracking issue: #87335
      
      The trickiest part for me was enforcing the diverging else block with clear diagnostics. Perhaps the obvious solution is to expand to `let _: ! = ..`, but I decided against this because, when a "mismatched type" error is found in typeck, there is no way to trace where in the HIR the expected type originated, AFAICT. In order to pass down this information, I believe we should introduce `Expectation::LetElseNever(HirId)` or maybe add `HirId` to `Expectation::HasType`, but I left that as a future enhancement. For now, I simply assert that the block is `!` with a custom `ObligationCauseCode`, and I think this is clear enough, at least to start. The downside here is that the error points at the entire block rather than the specific expression with the wrong type. I left a todo to this effect.
      
      Overall, I believe this PR is feature-complete with regard to the RFC.
      c2a40884
    • I
      Add a few tests for `UnsafeCell` · 227e004d
      inquisitivecrystal 提交于
      227e004d
    • B
      Auto merge of #88533 - oli-obk:tait_🧊, r=spastorino · a3956106
      bors 提交于
      Concrete regions can show up in mir borrowck if the originated from there
      
      We used to not encounter them here, because we took regions from typeck's opaque type resolution by renumbering them. We don't do that anymore. Instead mir borrock does all the logic, and it can handle concrete regions just fine, as long as it created them itself.
      
      fixes #83190 which was introduced by #87287
      
      r? `@spastorino`
      a3956106
    • P
      cfe2d30b
    • I
      Stabilize `Iterator::intersperse()` · 06dd4c03
      inquisitivecrystal 提交于
      06dd4c03
    • I
      Stabilize `UnsafeCell::raw_get()` · 753dac16
      inquisitivecrystal 提交于
      753dac16
    • B
      Auto merge of #88506 - Mark-Simulacrum:fix-rlibs, r=ehuss · 29ef6cf1
      bors 提交于
      Fix loading large rlibs
      
      Bumps object crate to permit parsing archives with 64-bit table entries. These
      are primarily encountered when there's more than 4GB of archive data.
      
      cc https://github.com/gimli-rs/object/issues/365
      
      Helps with https://github.com/rust-lang/rust/issues/88351, but will also need a beta backport
      
      r? `@ehuss` (mostly for the test)
      29ef6cf1
    • C
      Lint Abi in ast validation. · 8d7d488d
      Camille GILLOT 提交于
      8d7d488d
    • M
      some low hanging clippy::perf fixes · 7f2df9ad
      Matthias Krüger 提交于
      7f2df9ad