- 01 10月, 2021 3 次提交
-
-
由 Noah Lev 提交于
The change to `impl Clean<Path> for hir::TraitRef<'_>` was necessary to fix a test failure for `src/test/rustdoc/trait-alias-mention.rs`. Here's why: The old code path was through `impl Clean<Type> for hir::TraitRef<'_>`, which called `resolve_type`, which in turn called `register_res`. Now, because `PolyTrait` uses a `Path` instead of a `Type`, the impl of `Clean<Path>` was being run, which did not call `register_res`, causing the trait alias to not be recorded in the `external_paths` cache.
-
由 Noah Lev 提交于
It should only ever be a `ResolvedPath`, so this (a) enforces that, and (b) reduces the size of `Impl`. I had to update a test because the order of the rendered auto trait impl bounds changed. I think the order changed because rustdoc sorts auto trait bounds using their `Debug` output.
-
由 Noah Lev 提交于
-
- 30 9月, 2021 24 次提交
-
-
由 bors 提交于
Avoid spurious "previous iteration of loop" errors Only follow backwards edges during `get_moved_indexes` if the move path is definitely initialized at loop entry. Otherwise, the error occurred prior to the loop, so we ignore the backwards edges to avoid generating misleading "value moved here, in previous iteration of loop" errors. This patch also slightly improves the analysis of inits, including `NonPanicPathOnly` initializations (which are ignored by `drop_flag_effects::for_location_inits`). This is required for the definite initialization analysis, but may also help find certain skipped reinits in rare cases. Patch passes all non-ignored src/test/ui testcases. Fixes #72649.
-
由 bors 提交于
Constify ?-operator for Result and Option Try to make `?`-operator usable in `const fn` with `Result` and `Option`, see #74935 . Note that the try-operator itself was constified in #87237. TODO * [x] Add tests for const T -> T conversions * [x] cleanup commits * [x] Remove `#![allow(incomplete_features)]` * [?] Await decision in #86808 - I'm not sure * [x] Await support for parsing `~const` in bootstrapping compiler * [x] Tracking issue(s)? - #88674
-
由 bors 提交于
Don't anonymize bound region names during typeck Once this anonymization has performed, we have no way of recovering the original names during NLL borrow checking. Keeping the original names allows error messages in full NLL mode to contain the original bound region names. As a result, the typeck results may contain types that differ only in the names used for their bound regions. However, anonimization of bound regions does not guarantee that all distinct types are unqual (e.g. not subtypes of each other). For example, `for<'a> fn(&'a u32, &'a u32)` and `for<'b, 'c> fn(&'b u32, &'c u32)` are subtypes of each other, as explained here: https://github.com/rust-lang/rust/blob/63cc2bb3d07d6c726dfcdc5f95cbe5ed4760641a/compiler/rustc_infer/src/infer/nll_relate/mod.rs#L682-L690 Therefore, any code handling types with higher-ranked regions already needs to handle the case where two distinct `Ty`s are 'actually' equal.
-
由 bors 提交于
Rollup of 13 pull requests Successful merges: - #87428 (Fix union keyword highlighting in rustdoc HTML sources) - #88412 (Remove ignore-tidy-undocumented-unsafe from core::slice::sort) - #89098 (Fix generics where bounds order) - #89232 (Improve help for recursion limit errors) - #89294 (
⬆ rust-analyzer) - #89297 (Remove Never variant from clean::Type enum) - #89311 (Add unit assignment to MIR for `asm!()`) - #89313 (PassWrapper: handle function rename from upstream D36850) - #89315 (Clarify that `CString::from_vec_unchecked` appends 0 byte.) - #89335 (Optimize is_sorted for Range and RangeInclusive) - #89366 (rustdoc: Remove lazy_static dependency) - #89377 (Update cargo) - #89378 (Update books) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup -
由 Eric Huss 提交于
Update books ## nomicon 1 commits in fe6227eb3c8533200c52dffa42ef1b6f2f02c40e..2747c4bb2cbc0639b733793ddb0bf4e9daa2634e 2021-08-31 05:42:38 +0900 to 2021-09-19 17:33:32 +0900 - Clarify a bit of wording (rust-lang/nomicon#310) ## reference 2 commits in 0e5ed7a4bec065f0cc18c35d1c904639e095314d..13747275bd14c2d2b453100498532f9ae5504769 2021-08-29 17:33:21 +0900 to 2021-09-24 17:44:04 +0900 - (rust-lang/reference#1087) - Document RangeFrom patterns (rust-lang/reference#900) ## book 4 commits in fcb5e0ea68112d85a1d29a7a7335978ef2a02181..eb1282ec444db94055fa9531b6f3f803e86bb382 2021-08-31 21:26:19 -0400 to 2021-09-16 21:17:09 -0400 - Rust 1.55 (rust-lang/book#2890) - Chapter 3.3: Remove unused variable (rust-lang/book#2877) - Appendix (operators and symbols): remove extra space (rust-lang/book#2876) - Chapter 17.1: add missing comma (rust-lang/book#2867) ## rust-by-example 2 commits in 9d4132b56c4999cd3ce1aeca5f1b2f2cb0d11c24..28aca4a36962c709bce301c03114b5589381dfb8 2021-09-14 06:56:00 -0300 to 2021-09-25 08:19:51 -0300 - fix formatting (rust-lang/rust-by-example#1463) - involving === verb, involved === adjective (rust-lang/rust-by-example#1461) ## rustc-dev-guide 7 commits in 9198465b6ca8bed669df0cbb67c0e6d0b140803c..d1f03cbaa39d9164f5fe4b9b93762668142e0dad 2021-09-12 11:50:44 -0500 to 2021-09-24 12:00:29 +0900 - Fix a typo on closure.md (rust-lang/rustc-dev-guide#1218) - const generics update - s/--blessed/--bless/ - Make indentation consistent in example vscode config file - Suggests `--edition=2018` argument when using stage0/bin/rustfmt directly - `ty::Unevaluated`: dealing with unused substs (rust-lang/rustc-dev-guide#1190) - Parallel codegen (rust-lang/rustc-dev-guide#1206)
-
由 Eric Huss 提交于
Update cargo 5 commits in 0121d66aa2ef5ffa9735f86c2b56f5fdc5a837a6..d56b42c549dbb7e7d0f712c51b39400260d114d4 2021-09-22 16:08:27 +0000 to 2021-09-27 13:44:18 +0000 - Allow `cargo update --precise` with metadata. (rust-lang/cargo#9945) - Support path_in_vcs as part of cargo_vcs_metadata (rust-lang/cargo#9866) - Doc about InstallTracker files and `install.root` (rust-lang/cargo#9948) - Add some clarity on the license/license-file warning. (rust-lang/cargo#9941) - Fix the problem that help cannot be displayed properly (rust-lang/cargo#9933)
-
由 Eric Huss 提交于
rustdoc: Remove lazy_static dependency The macro was used in only one place and there are equivalents in the std, so it seemed weird to keep it around... I think running a perf check would be a good idea though, just in case. r? ``@jyn514``
-
由 Eric Huss 提交于
Optimize is_sorted for Range and RangeInclusive The [`Step`] trait guarantees that `Range<impl Step>` yields items in sorted order. We can override `Iterator::is_sorted` based on this guarantee, as we already do for `Iterator::min` and `max`. Thank you to ``@fiveseven-lambda`` who pointed this out [on the Rust Users Forum](https://users.rust-lang.org/t/is-sorted-method-in-impl-iterator-for-range/64717). [`Step`]: https://doc.rust-lang.org/stable/std/iter/trait.Step.html
-
由 Eric Huss 提交于
Clarify that `CString::from_vec_unchecked` appends 0 byte.
-
由 Eric Huss 提交于
PassWrapper: handle function rename from upstream D36850 thinLTOResolvePrevailingInModule became thinLTOFinalizeInModule and gained the ability to propagate noRecurse and noUnwind function attributes. I ran codegen tests with it both on and off, as the upstream patch uses it in both modes, and the tests pass both ways. Given that, it seemed reasonable to go ahead and let the propagation be enabled in rustc, and see what happens. See https://reviews.llvm.org/D36850 for more examples of how the new version of the function gets used. r? ``@nikic`` cc ``@nagisa``
-
由 Eric Huss 提交于
Add unit assignment to MIR for `asm!()` Fixes #89305. `ExprKind::LlvmInlineAsm` gets a `push_assign_unit()` here: https://github.com/rust-lang/rust/blob/2b6ed3b675475abc01ce7e68bb75b457f0c85684/compiler/rustc_mir_build/src/build/expr/into.rs#L475-L479 The same should probably happen for `ExprKind::InlineAsm`, which fixes the "use of possibly-uninitialized variable" error described in #89305.
-
由 Eric Huss 提交于
Remove Never variant from clean::Type enum Fixes #89287. r? ``@camelid``
-
由 Eric Huss 提交于
⬆ rust-analyzer -
由 Eric Huss 提交于
Improve help for recursion limit errors - Tweak help message and suggested limit (handle `0` case). - Add test for #75602 (it was already fixed, maybe can be resolved too). Fixes #76424
-
由 Eric Huss 提交于
Fix generics where bounds order Fixes #88809. Like said on the above issue, the issue is that we were expecting `Symbol` comparisons to be string-based but they are integer-based (because `Symbol` is an integer), messing up the bounds order. To fix it, I simply stored into a `FxIndexMap` instead. r? ``@jyn514``
-
由 Eric Huss 提交于
Remove ignore-tidy-undocumented-unsafe from core::slice::sort Write down the missing safety arguments to be able to remove `ignore-tidy-undocumented-unsafe` from `core::slice::sort`. Helps with #66219 ``@rustbot`` label C-cleanup T-libs
-
由 Eric Huss 提交于
Fix union keyword highlighting in rustdoc HTML sources I followed this logic: if I find an ident "union", I check if it followed by another ident or not. If it's the case, then I consider this is a keyword because it's declaring a union type. To do so I created a new Iterator which allows to peek the next items without moving the current iterator position. This is part of https://github.com/rust-lang/rust/issues/85016. If the fix makes sense, I'll extend it to other weak keywords (the issue only mentions they exist but https://doc.rust-lang.org/nightly/reference/keywords.html#weak-keywords only talks about `dyn` and `'static` so not sure if there is anything else to be done?). cc `@notriddle` (you're one of the last ones who worked on this part of rustdoc so here you go
😉 ) r? `@jyn514` -
由 bors 提交于
Use larger span for adjustment THIR expressions Currently, we use a relatively 'small' span for THIR expressions generated by an 'adjustment' (e.g. an autoderef, autoborrow, unsizing). As a result, if a borrow generated by an adustment ends up causing a borrowcheck error, for example: ```rust let mut my_var = String::new(); let my_ref = &my_var my_var.push('a'); my_ref; ``` then the span for the mutable borrow may end up referring to only the base expression (e.g. `my_var`), rather than the method call which triggered the mutable borrow (e.g. `my_var.push('a')`) Due to a quirk of the MIR borrowck implementation, this doesn't always get exposed in migration mode, but it does in many cases. This commit makes THIR building consistently use 'larger' spans for adjustment expressions. These spans are recoded when we first create the adjustment during typecheck. For example, an autoref adjustment triggered by a method call will record the span of the entire method call. The intent of this change it make it clearer to users when it's the specific way in which a variable is used (for example, in a method call) that produdes a borrowcheck error. For example, an error message claiming that a 'mutable borrow occurs here' might be confusing if it just points at a usage of a variable (e.g. `my_var`), when no `&mut` is in sight. Pointing at the entire expression should help to emphasize that the method call itself is responsible for the mutable borrow. In several cases, this makes the `#![feature(nll)]` diagnostic output match up exactly with the default (migration mode) output. As a result, several `.nll.stderr` files end up getting removed entirely.
-
由 bors 提交于
Fix Windows LLVM issue. GitHub image 20210928.2 added LLVM 12.0.1 to the stock image. However, the `lldb` executable doesn't work, it fails with: > C:/Program Files/LLVM/bin/lldb.exe: error while loading shared libraries: ?: cannot open shared object file: No such file or directory We probably don't want to start testing LLDB on windows anyways (at least not without intent). The hacky solution for now is to just delete the system LLVM.
-
由 Eric Huss 提交于
-
由 Eric Huss 提交于
-
由 Eric Huss 提交于
-
由 Guillaume Gomez 提交于
-
由 bors 提交于
Restructure std::rt These changes should reduce binary size slightly while at the same slightly improving performance of startup, thread spawning and `std::thread::current()`. I haven't verified if the compiler is able to optimize some of these cases already, but at least for some others the compiler is unable to do these optimizations as they slightly change behavior in cases where program startup would crash anyway by omitting a backtrace and panic location. I can remove 6f6bb167 if preferred.
-
- 29 9月, 2021 13 次提交
-
-
由 Guillaume Gomez 提交于
-
由 bors 提交于
Rollup of 8 pull requests Successful merges: - #87260 (Libgccjit codegen) - #89212 (x.py: run `rustup toolchain link` in setup) - #89233 (Hide `<...> defined here` note if the source is not available) - #89235 (make junit output more consistent with default format) - #89255 (Fix incorrect disambiguation suggestion for associated items) - #89276 (Fix the population of the `union.impls` field) - #89283 (Add regression test for issue #83564) - #89318 (rustc_session: Remove lint store from `Session`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
-
由 bors 提交于
Update Clippy Delayed Clippy sync r? `@Manishearth`
-
由 bors 提交于
Add an intermediate representation to exhaustiveness checking The exhaustiveness checking algorithm keeps deconstructing patterns into a `Constructor` and some `Fields`, but does so a bit all over the place. This PR introduces a new representation for patterns that already has that information, so we only compute it once at the start. I find this makes code easier to follow. In particular `DeconstructedPat::specialize` is a lot simpler than what happened before, and more closely matches the description of the algorithm. I'm also hoping this could help for the project of librarifying exhaustiveness for rust_analyzer since it decouples the algorithm from `rustc_middle::Pat`.
-
由 Ross MacArthur 提交于
-
由 Matt Brubeck 提交于
The `Step` trait guarantees that `Range<impl Step>` yields items in sorted order. We can override the `Iterator::is_sorted` method based on this guarantee, as we already do for `Iterator::min` and `max`.
-
由 Guillaume Gomez 提交于
rustc_session: Remove lint store from `Session` It was added in https://github.com/rust-lang/rust/pull/75534, but after the cleanup in https://github.com/rust-lang/rust/pull/87070 it's no longer necessary.
-
由 Guillaume Gomez 提交于
Add regression test for issue #83564 cc #83564 r? ``@davidtwco``
-
由 Guillaume Gomez 提交于
Fix the population of the `union.impls` field This pull-request fix the population of the `union.impls` field that was forgot when the `Union` type was introduce as a split from the `Struct` type https://github.com/rust-lang/rust/pull/81500. ``@rustbot`` label +T-rustdoc +A-rustdoc-json
-
由 Guillaume Gomez 提交于
Fix incorrect disambiguation suggestion for associated items Fixes #88806. I have not added a new test case, because the erroneous behavior is already present in existing test cases.
-
由 Guillaume Gomez 提交于
make junit output more consistent with default format The default format of libtest includes new-lines between each section to ensure the label output from cargo is on it's own line <pre><font color="#A1B56C"><b>❯</b></font> <font color="#A1B56C">cargo</font><font color="#D8D8D8"> </font><font color="#A1B56C">test</font> <font color="#A1B56C"><b> Compiling</b></font> test-test v0.1.0 (/home/jlusby/tmp/test-test) <font color="#A1B56C"><b> Finished</b></font> test [unoptimized + debuginfo] target(s) in 0.59s <font color="#A1B56C"><b> Running</b></font> unittests (target/debug/deps/test_test-639f369234319c09) running 1 test test tests::it_works ... <font color="#A1B56C">ok</font> test result: <font color="#A1B56C">ok</font>. 1 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s <font color="#A1B56C"><b> Doc-tests</b></font> test-test running 0 tests test result: <font color="#A1B56C">ok</font>. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s </pre> But when the junit outputter was added to libtest these newlines were omitted, resulting in some "fun" output when run via cargo. Note the `Doc-tests` text at the end of the first line of xml. <pre><font color="#A1B56C"><b>❯</b></font> <font color="#A1B56C">cargo</font><font color="#D8D8D8"> </font><font color="#A1B56C">test</font><font color="#D8D8D8"> </font><font color="#A1B56C">--</font><font color="#D8D8D8"> </font><font color="#A1B56C">-Zunstable-options</font><font color="#D8D8D8"> </font><font color="#A1B56C">--format</font><font color="#D8D8D8"> </font><font color="#A1B56C">junit</font> <font color="#A1B56C"><b> Finished</b></font> test [unoptimized + debuginfo] target(s) in 0.00s <font color="#A1B56C"><b> Running</b></font> unittests (target/debug/deps/test_test-639f369234319c09) <?xml version="1.0" encoding="UTF-8"?><testsuites><testsuite name="test" package="test" id="0" errors="0" failures="0" tests="1" skipped="0" ><testcase classname="tests" name="it_works" time="0"/><system-out/><system-err/></testsuite></testsuites><font color="#A1B56C"><b> Doc-tests</b></font> test-test <?xml version="1.0" encoding="UTF-8"?><testsuites><testsuite name="test" package="test" id="0" errors="0" failures="0" tests="0" skipped="0" ><system-out/><system-err/></testsuite></testsuites> </pre> After this PR the junit output includes the same style of newlines as the pretty format <pre><font color="#A1B56C"><b>❯</b></font> <font color="#A1B56C">cargo</font><font color="#D8D8D8"> </font><font color="#A1B56C">test</font><font color="#D8D8D8"> </font><font color="#A1B56C">--</font><font color="#D8D8D8"> </font><font color="#A1B56C">-Zunstable-options</font><font color="#D8D8D8"> </font><font color="#A1B56C">--format</font><font color="#D8D8D8"> </font><font color="#A1B56C">junit</font> <font color="#A1B56C"><b> Compiling</b></font> test-test v0.1.0 (/home/jlusby/tmp/test-test) <font color="#A1B56C"><b> Finished</b></font> test [unoptimized + debuginfo] target(s) in 0.39s <font color="#A1B56C"><b> Running</b></font> unittests (target/debug/deps/test_test-42c2320bb9450c69) <?xml version="1.0" encoding="UTF-8"?><testsuites><testsuite name="test" package="test" id="0" errors="0" failures="0" tests="1" skipped="0" ><testcase classname="tests" name="it_works" time="0"/><system-out/><system-err/></testsuite></testsuites> <font color="#A1B56C"><b> Doc-tests</b></font> test-test <?xml version="1.0" encoding="UTF-8"?><testsuites><testsuite name="test" package="test" id="0" errors="0" failures="0" tests="0" skipped="0" ><system-out/><system-err/></testsuite></testsuites> </pre>
-
由 Guillaume Gomez 提交于
Hide `<...> defined here` note if the source is not available Fixes #89159. Similar to #87088. r? ``@estebank``
-
由 Guillaume Gomez 提交于
x.py: run `rustup toolchain link` in setup Addresses #89206 r? ``@jyn514``
-