- 24 3月, 2021 2 次提交
-
-
由 Linus Färnstrand 提交于
-
由 Linus Färnstrand 提交于
-
- 23 3月, 2021 19 次提交
-
-
由 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`
-
由 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!
-
由 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 ```
-
由 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 -
由 Yuki Okushi 提交于
add rust-analyzer rustc_private option in librustdoc Cargo.toml This addition will allow to have code completion while hacking rustdoc with rust-analyzer. more info: https://rust-analyzer.github.io/manual.html#rust-analyzer.rustcSource r? `@jyn514`
-
由 Yuki Okushi 提交于
⬆ rust-analyzer -
由 Yuki Okushi 提交于
rename :pat2018 -> :pat2015 as requested by T-lang on zulip: https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/or.20patterns/near/231133873 No functional changes here... just renaming. r? `@nikomatsakis`
-
由 Yuki Okushi 提交于
rustdoc: Replace pair of `Option`s with an enum They are never both `None` or both `Some`, so it makes more sense to use an enum so that we "make impossible states impossible".
-
由 Yuki Okushi 提交于
Remove theme.js file Fixes #82616. The first commit moves the `theme.js` file into `main.js`, which requires to also run a small `.replace` on the `main.js` content. The second commit is just a small cleanup to centralize DOM ids. Since it removes a file from rustdoc output: cc `@rust-lang/docs-rs` cc `@jsha` r? `@jyn514`
-
由 Yuki Okushi 提交于
Update RELEASES.md for 1.51.0 ### [Rendered](https://github.com/rust-lang/rust/blob/relnotes-1.51.0/RELEASES.md) r? `@Mark-Simulacrum` cc `@rust-lang/release`
-
由 Yuki Okushi 提交于
Update Source Code Pro and include italics Fixes #65502. #65665, a similar PR to this was merged but reverted because of https://github.com/rust-lang/rust/pull/65665#issuecomment-556860510. The issue in that comment is the upstream issue https://github.com/adobe-fonts/source-code-pro/issues/217 which should now be fixed in the upstream since [2.032R-ro/1.052R-it/1.012R-VAR release](https://github.com/adobe-fonts/source-code-pro/releases/tag/2.032R-ro/1.052R-it/1.012R-VAR), so I think this can now be merged. A couple of notes from the original PR: * Since this PR changes the font set, I think docs.rs would have to be updated if this PR is merged. * The fonts have a double extension (.ttf.woff); this is to keep the names consistent with the upstream font release which does that to distinguish these from the .otf.woff files (Source Code Pro otf renders poorly on older Windows system apps).
-
由 Erik Desjardins 提交于
-
由 bors 提交于
Stabilize or_patterns (RFC 2535, 2530, 2175) closes #54883 This PR stabilizes the or_patterns feature in Rust 1.53. This is blocked on the following (in order): - [x] The crater run in https://github.com/rust-lang/rust/pull/78935#issuecomment-731564021 - [x] The resolution of the unresolved questions and a second crater run (https://github.com/rust-lang/rust/pull/78935#issuecomment-735412705) - It looks like we will need to pursue some sort of edition-based transition for `:pat`. - [x] Nomination and discussion by T-lang - [x] Implement new behavior for `:pat` based on consensus (https://github.com/rust-lang/rust/pull/80100). - [ ] An FCP on stabilization EDIT: Stabilization report is in https://github.com/rust-lang/rust/pull/79278#issuecomment-772815177
-
由 Nelson J Morais 提交于
-
由 Nelson J Morais 提交于
-
由 Augie Fackler 提交于
-
由 Laurențiu Nicola 提交于
-
由 mark 提交于
-
由 Aaron Hill 提交于
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 { location: Location { file: "refcell_test.rs", line: 6, col: 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 { location: Location { file: "refcell_test.rs", line: 16, col: 27 } }', refcell_test.rs:18:25 ```
-
- 22 3月, 2021 19 次提交
-
-
由 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
-
由 Dylan DPC 提交于
SplitInclusive is public API
-
由 Dylan DPC 提交于
Improve error message for unassigned query provider Fixes: #83122 r? `@jyn514` This implements the change we agreed on. Thanks!
-
由 Dylan DPC 提交于
post-drop-elab check-const: explain why we still check qualifs r? `@oli-obk`
-
由 Dylan DPC 提交于
Fix test for #82270 Fixes a test in #82270 to require the arm llvm component
-
由 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.
-
由 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?
-
由 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`
-
由 bors 提交于
Simplify encoder and decoder Extracted from https://github.com/rust-lang/rust/pull/83036 and https://github.com/rust-lang/rust/pull/82780.
-
由 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.)
-
由 Alan Egerton 提交于
-
由 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
-
由 Rich Kadel 提交于
Fixes: 83122
-
由 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
-
由 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.
-
由 Dylan DPC 提交于
Fix ICE with `use clippy::a::b;` Fixes #83317.
-
由 Dylan DPC 提交于
Cleanup LLVM debuginfo module docs - Move debuginfo docs from `doc.rs` module to `doc.md` file - Cleanup LLVM debuginfo module docs
-
由 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
-
由 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`.
-