- 13 12月, 2020 9 次提交
-
-
由 Yuki Okushi 提交于
Remove deprecated linked_list_extras methods. https://github.com/rust-lang/rust/issues/27794#issuecomment-667524201: > I'd say give it about 2 weeks then remove them. It's been 18 weeks. Time to remove them. :) Closes #27794.
-
由 Yuki Okushi 提交于
Link loop/for keyword Even though the reference already have all of these, I am just adding related keywords in the see also to let others easily click on the related keyword.
-
由 Yuki Okushi 提交于
std::iter: document iteration over `&T` and `&mut T` A colleague of mine is new to Rust, and mentioned that it was “slightly confusing” to figure out what `&mut` does in iterating over `&mut foo`: ```rust for value in &mut self.my_vec { // ... } ``` My colleague had read the `std::iter` docs and not found the answer there. There is a brief section at the top about “the three forms of iteration”, which mentions `iter_mut`, but it doesn’t cover the purpose of `&mut coll` for a collection `coll`. This patch adds an explanatory section to the docs. I opted to create a new section so that it can appear after the note that `impl<I: Iterator> IntoIterator for I`, and it’s nice for the existing “three forms of iteration” to appear near the top. Test Plan: Ran `./x.py doc library/core`, and the result looked good, including links. Manually copy-pasted the two doctests into the playground and ran them. wchargin-branch: doc-iter-by-reference
-
由 bors 提交于
Remove incorrect assert Fixes an assertion failure when resolving `::std` (or any other crate that uses the `::` style, see https://github.com/rust-lang/rust/pull/79809/files#r541776478, https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Perf.20failing). Unblocks https://github.com/rust-lang/rustc-perf/pull/806. r? `@ghost` - this is a trivial fix and breaking rustc-perf so I'm going to approve it unilaterally. cc `@Mark-Simulacrum` `@Eric-Arellano`
-
由 Joshua Nelson 提交于
-
由 bors 提交于
[rustdoc] Calculate span information on demand instead of storing it ahead of time This brings `size_of<clean::types::Span>()` down from over 100 bytes (!!) to only 12, the same as rustc. It brings `Item` down even more, from `784` to `680`. ~~TODO: I need to figure out how to do this for the JSON backend too. That uses `From` impls everywhere, which don't allow passing in the `Session` as an argument. `@P1n3appl3,` `@tmandry,` maybe one of you have ideas?~~ Figured it out, fortunately only two functions needed to be changed. I like the `convert_x()` format better than `From` everywhere but I'm open to feedback. Helps with #79103
-
由 bors 提交于
tidy: Re-enable check for inline unit tests It regressed in https://github.com/rust-lang/rust/pull/73265 and compiler crates are no longer checked.
-
由 Vadim Petrochenkov 提交于
With https://github.com/rust-lang/rust/pull/69838 inner modules are never touched in the outer module is unconfigured.
-
由 Vadim Petrochenkov 提交于
-
- 12 12月, 2020 14 次提交
-
-
由 bors 提交于
Don't abort rustdoc tests if `tidy` isn't installed Follow-up to https://github.com/rust-lang/rust/pull/78752. Before: ``` Check compiletest suite=rustdoc mode=rustdoc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) running 396 tests ..................................................2020-11-23T12:12:37.735649Z ERROR compiletest::runtest: fatal error, panic: "failed to run tidy - is it installed? - No such file or directory (os error 2)" F................................................. 100/396 .................................................................................................... 200/396 .................................................................................................... 300/396 ...............................i...............2020-11-23T12:15:00.271271Z ERROR compiletest::runtest: fatal error, panic: "failed to run tidy - is it installed? - No such file or directory (os error 2)" F................................................ ``` After: ``` Check compiletest suite=rustdoc mode=rustdoc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) running 4 tests .FFF failures: ---- [rustdoc] rustdoc/fn-pointer-arg-name.rs stdout ---- error: htmldocck failed! status: exit code: 1 command: "/usr/bin/python" "/home/joshua/rustc/src/etc/htmldocck.py" "/home/joshua/rustc/build/x86_64-unknown-linux-gnu/test/rustdoc/fn-pointer-arg-name" "/home/joshua/rustc/src/test/rustdoc/fn-pointer-arg-name.rs" stdout: ------------------------------------------ ------------------------------------------ stderr: ------------------------------------------ 4: `@has` check failed `XPATH PATTERN` did not match // `@has` - '//*[`@class="rust` fn"]' 'pub fn f(callback: fn(len: usize, foo: u32))' Encountered 1 errors ------------------------------------------ info: generating a diff against nightly rustdoc failed to run tidy - is it installed? - Permission denied (os error 13) failed to run tidy - is it installed? - Permission denied (os error 13) # a diff without running `tidy` ``` r? `@GuillaumeGomez`
-
由 Joshua Nelson 提交于
- Use a tuple struct instead of a single field - Enforce calling `source_callsite()` by making the inner span private - Rename `empty` to `dummy`
-
由 Joshua Nelson 提交于
These are always static and never autogenerated, so the diffs aren't useful.
-
由 Joshua Nelson 提交于
-
由 Joshua Nelson 提交于
Before: ``` Check compiletest suite=rustdoc mode=rustdoc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) running 396 tests ..................................................2020-11-23T12:12:37.735649Z ERROR compiletest::runtest: fatal error, panic: "failed to run tidy - is it installed? - No such file or directory (os error 2)" F................................................. 100/396 .................................................................................................... 200/396 .................................................................................................... 300/396 ...............................i...............2020-11-23T12:15:00.271271Z ERROR compiletest::runtest: fatal error, panic: "failed to run tidy - is it installed? - No such file or directory (os error 2)" F................................................ ``` After: ``` Check compiletest suite=rustdoc mode=rustdoc (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu) running 4 tests .FFF failures: ---- [rustdoc] rustdoc/fn-pointer-arg-name.rs stdout ---- error: htmldocck failed! status: exit code: 1 command: "/usr/bin/python" "/home/joshua/rustc/src/etc/htmldocck.py" "/home/joshua/rustc/build/x86_64-unknown-linux-gnu/test/rustdoc/fn-pointer-arg-name" "/home/joshua/rustc/src/test/rustdoc/fn-pointer-arg-name.rs" stdout: ------------------------------------------ ------------------------------------------ stderr: ------------------------------------------ 4: @has check failed `XPATH PATTERN` did not match // @has - '//*[@class="rust fn"]' 'pub fn f(callback: fn(len: usize, foo: u32))' Encountered 1 errors ------------------------------------------ info: generating a diff against nightly rustdoc failed to run tidy - is it installed? - Permission denied (os error 13) failed to run tidy - is it installed? - Permission denied (os error 13) # a diff without running `tidy` ```
-
由 bors 提交于
Create `rustc_type_ir` Decided to start small
😄 This PR creates a `rustc_type_ir` crate as part of the WG-Traits plan to create a shared type library. ~~There already exists a `rustc_ty` crate, so I named the new crate `rustc_ty_library`. However I think it would make sense to rename the current `rustc_ty` to something else (e.g. `rustc_ty_passes`) to free the name for this new crate.~~ r? `@jackh726` -
由 bors 提交于
update Miri Fixes https://github.com/rust-lang/rust/issues/79897 Cc `@rust-lang/miri` r? `@ghost`
-
由 Joshua Nelson 提交于
This was simpler than expected.
-
由 Joshua Nelson 提交于
This should *vastly* reduce memory usage.
-
由 Joshua Nelson 提交于
-
由 bors 提交于
make redundant StorageLive UB The interesting behavior of StorageLive in loops (https://github.com/rust-lang/rust/issues/42371) has been fixed, so we can now finally make it a hard error to mark a local as live that is already live. :) r? `@oli-obk` Fixes https://github.com/rust-lang/rust/issues/42371
-
由 bors 提交于
Capture precise paths in THIR and MIR This PR allows THIR and MIR to use the result of the new capture analysis to actually capture precise paths To achieve we: - Writeback min capture results to TypeckResults - Move handling upvars to PlaceBuilder in mir_build - Lower precise paths in THIR build by reading min_captures - Search for ancestors in min_capture when trying to build a MIR place which starts off of an upvar Closes: https://github.com/rust-lang/project-rfc-2229/issues/10 Partly implements: rust-lang/project-rfc-2229#18 Work that remains (not in this PR): - [ ] [Known bugs when feature gate is enabled](https://github.com/rust-lang/project-rfc-2229/projects/1?card_filter_query=label%3Abug) - [ ] Use min_capure_map for - [ ] Liveness analysis - [ ] rustc_mir/interpret/validity.rs - [ ] regionck - [ ] rust-lang/project-rfc-2229#8 - [ ] remove closure_captures and upvar_capture_map r? `@ghost`
-
由 bors 提交于
Apply `doc(cfg)` from parent items while collecting trait impls Because trait impls bypass the standard `clean` hierarchy they do not participate in the `propagate_doc_cfg` pass, so instead we need to pre-collect all possible `doc(cfg)` attributes that will apply to them when cleaning. fixes #79201
-
由 Ralf Jung 提交于
-
- 11 12月, 2020 17 次提交
-
-
由 bors 提交于
Improve wording of `flatten()` docs
-
由 bors 提交于
CTFE: tweak abort-on-uninhabited message Having an "aborted execution:" makes it more consistent with the `Abort` terminator saying "the program aborted execution". Right now, at least one of the two errors will look weird in Miri. r? `@oli-obk`
-
由 Ralf Jung 提交于
-
由 bors 提交于
Use `def_path_hash_to_def_id` when re-using a `RawDefId` Fixes #79890 Previously, we just copied a `RawDefId` from the 'old' map to the 'new' map. However, the `RawDefId` for a given `DefPathHash` may be different in the current compilation session. Using `def_path_hash_to_def_id` ensures that the `RawDefId` we use is valid in the current session.
-
由 Aman Arora 提交于
-
由 bors 提交于
Windows TLS: ManuallyDrop instead of mem::forget The Windows TLS implementation still used `mem::forget` instead of `ManuallyDrop`, leading to the usual problem of "using" the `Box` when it should not be used any more.
-
由 bors 提交于
Rollup of 11 pull requests Successful merges: - #77027 (Improve documentation for `std::{f32,f64}::mul_add`) - #79375 (Make the kernel_copy tests more robust/concurrent.) - #79639 (Add long explanation for E0212) - #79698 (Add tracking issue template for library features.) - #79809 (Dogfood `str_split_once()`) - #79851 (Clarify the 'default is only allowed on...' error) - #79858 (Update const-fn doc in unstable-book) - #79860 (Clarify that String::split_at takes a byte index.) - #79871 (Fix small typo in `wrapping_shl` documentation) - #79896 (Make search results tab and help button focusable with keyboard) - #79917 (Use Symbol for inline asm register class names) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 Tyler Mandry 提交于
Use Symbol for inline asm register class names This takes care of one "FIXME": // FIXME: use direct symbol comparison for register class names Instead of using string literals, this uses Symbol for register class names. This is part of work I am doing to improve how Symbol interning works.
-
由 Tyler Mandry 提交于
Make search results tab and help button focusable with keyboard Fixes https://github.com/rust-lang/rust/issues/79859. I replaced the element with `button` tag, which allows to focus them (and "click" on them using "enter") using only the keyboard. cc ``@sersorrel`` r? ``@Manishearth``
-
由 Tyler Mandry 提交于
Fix small typo in `wrapping_shl` documentation Fixes a small typo in the documentation.
-
由 Tyler Mandry 提交于
Clarify that String::split_at takes a byte index. To someone skimming through the `String` docs and only reads the first line, the person could interpret "index" to be "char index". Later on in the docs it clarifies, but by adding "byte" it removes that ambiguity.
-
由 Tyler Mandry 提交于
Update const-fn doc in unstable-book Fix #79691 I couldn't find suitable examples. It seems that `const_fn` feature-gate used only following place. https://github.com/rust-lang/rust/blob/810324d1f31eb8d75e8f0044df720652986ef133/compiler/rustc_ast_passes/src/feature_gate.rs#L560-L562 And example like following emits [E0379](https://doc.rust-lang.org/error-index.html#E0379). ```rust #![feature(const_fn)] trait Foo { const fn bar() -> Self; } ``` Any other suitable example exists, please let me know.
-
由 Tyler Mandry 提交于
Clarify the 'default is only allowed on...' error Code like impl Foo { default fn foo() {} } will trigger the error error: `default` is only allowed on items in `impl` definitions --> src/lib.rs:5:5 | 5 | default fn foo() {} | -------^^^^^^^^^ | | | `default` because of this but that's very confusing! I *did* put it on an item in an impl! So this commit changes the message to error: `default` is only allowed on items in trait impls --> src/lib.rs:5:5 | 5 | default fn foo() {} | -------^^^^^^^^^ | | | `default` because of this
-
由 Tyler Mandry 提交于
Dogfood `str_split_once()` Part of https://github.com/rust-lang/rust/issues/74773. Beyond increased clarity, this fixes some instances of a common confusion with how `splitn(2)` behaves: the first element will always be `Some()`, regardless of the delimiter, and even if the value is empty. Given this code: ```rust fn main() { let val = "..."; let mut iter = val.splitn(2, '='); println!("Input: {:?}, first: {:?}, second: {:?}", val, iter.next(), iter.next()); } ``` We get: ``` Input: "no_delimiter", first: Some("no_delimiter"), second: None Input: "k=v", first: Some("k"), second: Some("v") Input: "=", first: Some(""), second: Some("") ``` Using `str_split_once()` makes more clear what happens when the delimiter is not found.
-
由 Tyler Mandry 提交于
Add tracking issue template for library features. This adds a issue template for a library tracking issue. There's already a template for tracking issues, but it's mostly geared towards compiler/language features. A separate template makes it a bit easier to make sure it matches with the process we use for library changes. Main differences: - Added a note about how small library features can be added without RFC, and removed the parts that assume there's an RFC. - Merged the 'Steps' and 'History' sections: Library features are often small enough that there's no multiple steps planned ahead of time. - Removed the section about avoiding large discussions and opening separate issues for problems with the feature. Library features are usually focussed enough that the discussion about a feature is best kept together in the tracking issue. - Removed links to the rustc-dev-guide, which are specific to changes in the compiler and language.
-
由 Tyler Mandry 提交于
Add long explanation for E0212 Helps with #61137
-
由 Tyler Mandry 提交于
Make the kernel_copy tests more robust/concurrent. These tests write to the same filenames in /tmp and in some cases these files don't get cleaned up properly. This caused issues for us when different users run the tests on the same system, e.g.: ``` ---- sys::unix::kernel_copy::tests::bench_file_to_file_copy stdout ---- thread 'sys::unix::kernel_copy::tests::bench_file_to_file_copy' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }', library/std/src/sys/unix/kernel_copy/tests.rs:71:10 ---- sys::unix::kernel_copy::tests::bench_file_to_socket_copy stdout ---- thread 'sys::unix::kernel_copy::tests::bench_file_to_socket_copy' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }', library/std/src/sys/unix/kernel_copy/tests.rs
💯 10 ``` Use `std::sys_common::io__test::tmpdir()` to solve this. CC ``@the8472.``
-