1. 24 3月, 2021 1 次提交
    • K
      Add has_default to GenericParamDefKind::Const · e4e5db4e
      kadmin 提交于
      This currently creates a field which is always false on GenericParamDefKind for future use when
      consts are permitted to have defaults
      
      Update const_generics:default locations
      
      Previously just ignored them, now actually do something about them.
      
      Fix using type check instead of value
      
      Add parsing
      
      This adds all the necessary changes to lower const-generics defaults from parsing.
      
      Change P<Expr> to AnonConst
      
      This matches the arguments passed to instantiations of const generics, and makes it specific to
      just anonymous constants.
      
      Attempt to fix lowering bugs
      e4e5db4e
  2. 23 3月, 2021 19 次提交
  3. 22 3月, 2021 20 次提交
    • B
      Auto merge of #83376 - Dylan-DPC:rollup-s2fsjwj, r=Dylan-DPC · 2287a882
      bors 提交于
      Rollup of 7 pull requests
      
      Successful merges:
      
       - #82374 (Add license metadata for std dependencies)
       - #82683 (Document panicking cases for integer division and remainder)
       - #83272 (Clarify non-exact length in the Iterator::take documentation)
       - #83338 (Fix test for #82270)
       - #83351 (post-drop-elab check-const: explain why we still check qualifs)
       - #83367 (Improve error message for unassigned query provider)
       - #83372 (SplitInclusive is public API)
      
      Failed merges:
      
      r? `@ghost`
      `@rustbot` modify labels: rollup
      2287a882
    • D
      Rollup merge of #83372 - eggyal:split-inclusive, r=Mark-Simulacrum · ce067875
      Dylan DPC 提交于
      SplitInclusive is public API
      ce067875
    • D
      Rollup merge of #83367 - richkadel:query-err-msg, r=jyn514 · 014a4ee9
      Dylan DPC 提交于
      Improve error message for unassigned query provider
      
      Fixes: #83122
      
      r? `@jyn514`
      
      This implements the change we agreed on. Thanks!
      014a4ee9
    • D
      Rollup merge of #83351 - RalfJung:precise-const-drop, r=oli-obk · 1fdf7d18
      Dylan DPC 提交于
      post-drop-elab check-const: explain why we still check qualifs
      
      r? `@oli-obk`
      1fdf7d18
    • D
      Rollup merge of #83338 - asquared31415:asm-syntax-test-fix, r=Dylan-DPC · b759044d
      Dylan DPC 提交于
      Fix test for #82270
      
      Fixes a test in #82270 to require the arm llvm component
      b759044d
    • D
      Rollup merge of #83272 - kornelski:takedocs, r=dtolnay · f441c2a9
      Dylan DPC 提交于
      Clarify non-exact length in the Iterator::take documentation
      
      There's an example which demonstrates incomplete length case, but it'd be best to explain it right from the start.
      f441c2a9
    • D
      Rollup merge of #82683 - jturner314:int-div-rem-doc-panic, r=nikomatsakis · 83faac9d
      Dylan DPC 提交于
      Document panicking cases for integer division and remainder
      
      This PR documents the cases when integer division and remainder operations panic. These operations panic in two cases: division by zero and overflow.
      
      It's surprising that these operations always panic on overflow, unlike most other arithmetic operations, which panic on overflow only when `debug_assertions` is enabled. The panic on overflow for the remainder is also surprising because a return value of `0` would be reasonable in this case. ("Overflow" occurs only for `MIN % -1`.) Since the panics on overflow are somewhat surprising, they should be documented.
      
      I guess it's worth asking: is panic on overflow (even when `debug_assertions` is disabled) the intended behavior? If not, what's the best way forward?
      83faac9d
    • D
      Rollup merge of #82374 - clehner:licenses, r=joshtriplett · 7bf8f82f
      Dylan DPC 提交于
      Add license metadata for std dependencies
      
      These five crates are in the dependency tree of `std` but lack license metadata:
      - `alloc`
      - `core`
      - `panic_abort`
      - `panic_unwind`
      - `unwind`
      
      Querying the dependency tree of `std` is a useful thing to be able to do, since these crates will typically be linked into Rust binaries. Tools show the license fields missing, as seen in https://github.com/rust-lang/rust/issues/67014#issuecomment-782704534. This PR adds the license field for the five crates, based on the license of the `std` package and this repo as a whole. I also added the `repository` and `descriptions` fields, since those seem useful. For `description`, I copied text from top-level comments for the respective modules - except for `unwind` which has none.
      
      I also note that https://github.com/rust-lang/rust/pull/73530 attempted to add license metadata for all crates in this repo, but was rejected because there was question about some of them. I hope that this smaller change, focusing only on the runtime dependencies, will be easier to review.
      
      cc `@Mark-Simulacrum` `@Lokathor`
      7bf8f82f
    • B
      d04c3aa8
    • B
      Auto merge of #82680 - jturner314:div_euclid-docs, r=JohnTitor · 7f82ddb8
      bors 提交于
      Fix inequality in docs for div_euclid
      
      This commit fixes the statement of the inequality that the Euclidean remainder satisfies. (The remainder is guaranteed to be less than abs(rhs), not rhs.) It also rewords the documentation to make it a little easier to read.
      
      (You might wonder why I've written `abs(rhs)` instead of `rhs.abs()`. Two reasons: first, the `rem_euclid` docs use `abs(rhs)` instead of `rhs.abs()`, and second, the absolute value here is the mathematical absolute value, not the the `.abs()` operation which may overflow.)
      7f82ddb8
    • A
      SplitInclusive is public API · fe957350
      Alan Egerton 提交于
      fe957350
    • B
      Auto merge of #82855 - jyn514:no-temporaries, r=GuillaumeGomez · 2b8fbe6b
      bors 提交于
      Avoid temporary allocations in `render_assoc_item`
      
      `render_assoc_item` came up as very hot in a profile of rustdoc on
      `bevy`.  This avoids some temporary allocations just to calculate the
      length of the header.
      
      This should be a strict improvement, since all string formatting was
      done twice before.
      
      cc #82845
      2b8fbe6b
    • R
      Improve error message for unassigned query provider · 688c857c
      Rich Kadel 提交于
      Fixes: 83122
      688c857c
    • B
      Auto merge of #83360 - Dylan-DPC:rollup-17xulpv, r=Dylan-DPC · 142c8318
      bors 提交于
      Rollup of 9 pull requests
      
      Successful merges:
      
       - #80193 (stabilize `feature(osstring_ascii)`)
       - #80771 (Make NonNull::as_ref (and friends) return refs with unbound lifetimes)
       - #81607 (Implement TrustedLen and TrustedRandomAccess for Range<integer>, array::IntoIter, VecDequeue's iterators)
       - #82554 (Fix invalid slice access in String::retain)
       - #82686 (Move `std::sys::unix::platform` to `std::sys::unix::ext`)
       - #82771 (slice: Stabilize IterMut::as_slice.)
       - #83329 (Cleanup LLVM debuginfo module docs)
       - #83336 (Fix ICE with `use clippy::a::b;`)
       - #83350 (Download a more recent LLVM version if `src/version` is modified)
      
      Failed merges:
      
      r? `@ghost`
      `@rustbot` modify labels: rollup
      142c8318
    • D
      Rollup merge of #83350 - jyn514:llvm-version, r=Mark-Simulacrum · 790c2ad4
      Dylan DPC 提交于
      Download a more recent LLVM version if `src/version` is modified
      
      When bumping the bootstrap version, the name of the generated LLVM
      shared object file is changed, even though it's the same contents as
      before. If bootstrap tries to use an older version, it will get linking
      errors:
      
      ```
      Building rustdoc for stage1 (x86_64-unknown-linux-gnu)
         Compiling rustdoc-tool v0.0.0 (/home/joshua/rustc/src/tools/rustdoc)
      error: linking with `cc` failed: exit code: 1
        |
        = note: "cc" "-Wl,--as-needed" ... lots of args ...
        = note: /usr/bin/ld: cannot find -lLLVM-12-rust-1.53.0-nightly
                clang: error: linker command failed with exit code 1 (use -v to see invocation)
      
      error: could not compile `rustdoc-tool`
      ```
      
      Helps with https://github.com/rust-lang/rust/issues/81930.
      790c2ad4
    • D
      Rollup merge of #83336 - camelid:tool-mod-ice, r=petrochenkov · ea5ba76d
      Dylan DPC 提交于
      Fix ICE with `use clippy::a::b;`
      
      Fixes #83317.
      ea5ba76d
    • D
      Rollup merge of #83329 - camelid:debuginfo-doc-cleanup, r=davidtwco · 85f16fb4
      Dylan DPC 提交于
      Cleanup LLVM debuginfo module docs
      
      - Move debuginfo docs from `doc.rs` module to `doc.md` file
      - Cleanup LLVM debuginfo module docs
      85f16fb4
    • D
      Rollup merge of #82771 - emilio:iter-mut-as-slice, r=m-ou-se · 34285def
      Dylan DPC 提交于
      slice: Stabilize IterMut::as_slice.
      
      Much like #72584.
      
      As per #58957 there's no blocker for this, and I wanted to use this
      today :-)
      
      Closes #58957
      34285def
    • D
      Rollup merge of #82686 - CDirkx:unix-platform, r=m-ou-se · c66d66e8
      Dylan DPC 提交于
      Move `std::sys::unix::platform` to `std::sys::unix::ext`
      
      This moves the operating system dependent alias `platform` (`std::os::{linux, android, ...}`) from `std::sys::unix` to `std::sys::unix::ext` (a.k.a. `std::os::unix`), removing the need for compatibility code in `unix_ext` when documenting on another platform.
      
      This is also a step in making it possible to properly move `std::sys::unix::ext` to `std::os::unix`, as ideally `std::sys` should not depend on the rest of `std`.
      c66d66e8
    • D
      Rollup merge of #82554 - SkiFire13:fix-string-retain-unsoundness, r=m-ou-se · da143d38
      Dylan DPC 提交于
      Fix invalid slice access in String::retain
      
      As noted in #78499, the previous fix was technically still unsound because it accessed elements of a slice outside its bounds (even though they were still inside the same allocation). This PR addresses that concern by switching to a dropguard approach.
      da143d38