1. 25 3月, 2021 1 次提交
  2. 24 3月, 2021 31 次提交
  3. 23 3月, 2021 8 次提交
    • B
      Auto merge of #83177 - erikdesjardins:zstassign, r=oli-obk · 79e5814f
      bors 提交于
      Remove assignments to ZST places instead of marking ZST return place as unused
      
      partially reverts #83118
      
      requested by `@tmiasko` in https://github.com/rust-lang/rust/pull/83118#issuecomment-799692574
      
      r? `@oli-obk`
      79e5814f
    • I
      Expose str::SplitInclusive in alloc and therefore in std · 52dc0718
      Ian Jackson 提交于
      This seems to have been omitted from the beginning when this feature
      was first introduced in 86bf9629.
      
      Most users won't need to name this type which is probably why this
      wasn't noticed in the meantime.
      Signed-off-by: NIan Jackson <ijackson@chiark.greenend.org.uk>
      52dc0718
    • R
      Slight visual improvements to warning boxes in the docs · 4fa187f8
      r00ster91 提交于
      4fa187f8
    • B
      Auto merge of #83260 - durin42:llvm-update, r=nagisa · 4eb0bc73
      bors 提交于
      rustc: changes to allow an llvm update
      
      This lets LLVM be built using 2b5f3f446f36, which is only a few weeks old. The next change in LLVM (5de2d189e6ad) breaks rustc again by removing a function that's exposed into the Rust code, but I'll file a bug about that separately.
      
      Please scrutinize the `thinLTOResolvePrevailingInIndex` call, as I'm not at all sure an empty config is right.
      
      I'm also suspicious that a specific alignment could be specified in the call to CreateAtomicCmpXchg, but I don't know enough to figure that out.
      
      Thanks!
      4eb0bc73
    • B
      Auto merge of #82271 - Aaron1011:debug-refcell, r=m-ou-se · 9b6339e4
      bors 提交于
      Add `debug-refcell` feature to libcore
      
      See https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/Attaching.20backtraces.20to.20RefCell/near/226273614
      for some background discussion
      
      This PR adds a new off-by-default feature `debug-refcell` to libcore.
      When enabled, this feature stores additional debugging information in
      `RefCell`. This information is included in the panic message when
      `borrow()` or `borrow_mut()` panics, to make it easier to track down the
      source of the issue.
      
      Currently, we store the caller location for the earliest active borrow.
      This has a number of advantages:
      * There is only a constant amount of overhead per `RefCell`
      * We don't need any heap memory, so it can easily be implemented in core
      * Since we are storing the *earliest* active borrow, we don't need any
        extra logic in the `Drop` implementation for `Ref` and `RefMut`
      
      Limitations:
      * We only store the caller location, not a full `Backtrace`. Until
        we get support for `Backtrace` in libcore, this is the best tha we can
      do.
      * The captured location is only displayed when `borrow()` or
        `borrow_mut()` panics. If a crate calls `try_borrow().unwrap()`
        or `try_borrow_mut().unwrap()`, this extra information will be lost.
      
      To make testing easier, I've enabled the `debug-refcell` feature by
      default. I'm not sure how to write a test for this feature - we would
      need to rebuild core from the test framework, and create a separate
      sysroot.
      
      Since this feature will be off-by-default, users will need to use
      `xargo` or `cargo -Z build-std` to enable this feature. For users using
      a prebuilt standard library, this feature will be disabled with zero
      overhead.
      
      I've created a simple test program:
      
      ```rust
      use std::cell::RefCell;
      
      fn main() {
          let _ = std::panic::catch_unwind(|| {
              let val = RefCell::new(true);
              let _first = val.borrow();
              let _second = val.borrow();
              let _third = val.borrow_mut();
          });
      
          let _ = std::panic::catch_unwind(|| {
              let val  = RefCell::new(true);
              let first = val.borrow_mut();
              drop(first);
      
              let _second = val.borrow_mut();
      
              let _thid = val.borrow();
          });
      }
      ```
      
      which produces the following output:
      
      ```
      thread 'main' panicked at 'already borrowed: BorrowMutError at refcell_test.rs:6:26', refcell_test.rs:8:26
      note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
      thread 'main' panicked at 'already mutably borrowed: BorrowError at refcell_test.rs:16:27', refcell_test.rs:18:25
      ```
      9b6339e4
    • C
      Don't push the crate name onto the `Cache.stack` · c9ae3597
      Camelid 提交于
      Now that we record the crate's name in its `clean::Item`, pushing the
      crate name onto the `stack` causes duplicate paths. E.g., the URL
      generated for the path `::foo::bar::baz` would be something like
      
          ../foo/foo/bar/baz
      
      With this commit, the URL is corrected to
      
          ../foo/bar/baz
      c9ae3597
    • B
      Auto merge of #83398 - JohnTitor:rollup-om80krv, r=JohnTitor · 2bd94f4a
      bors 提交于
      Rollup of 7 pull requests
      
      Successful merges:
      
       - #80705 (Update Source Code Pro and include italics)
       - #81917 (Update RELEASES.md for 1.51.0)
       - #82732 (Remove theme.js file)
       - #83356 (rustdoc: Replace pair of `Option`s with an enum)
       - #83384 (rename :pat2018 -> :pat2015)
       - #83385 ( rust-analyzer)
       - #83389 (add rust-analyzer rustc_private option in librustdoc Cargo.toml)
      
      Failed merges:
      
      r? `@ghost`
      `@rustbot` modify labels: rollup
      2bd94f4a
    • C
      rustdoc: Record crate name instead of using `None` · 72a180e1
      Camelid 提交于
      72a180e1