-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rollup of 12 pull requests #104207
Closed
Closed
Rollup of 12 pull requests #104207
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Changed `creates a temporary which is freed while still in use` to `creates a temporary value which is freed while still in use`
These have been bugging me for a while. - `literal_text`: `src` is also used and is shorter and better. - `first_char`: used even when "first" doesn't make sense; `c` is shorter and better. - `curr`: `c` is shorter and better. - `unescaped_char`: `result` is also used and is shorter and better. - `second_char`: these have a single use and can be elided.
There is some subtlety here.
It's passed to numerous places where we just need an `is_byte` bool. Passing the bool avoids the need for some assertions. Also rename `is_bytes()` as `is_byte()`, to better match `Mode::Byte`, `Mode::ByteStr`, and `Mode::RawByteStr`.
There are three kinds of "byte" literals: byte literals, byte string literals, and raw byte string literals. None are allowed to have non-ASCII chars in them. Two `EscapeError` variants exist for when that constraint is violated. - `NonAsciiCharInByte`: used for byte literals and byte string literals. - `NonAsciiCharInByteString`: used for raw byte string literals. As a result, the messages for raw byte string literals use different wording, without good reason. Also, byte string literals are incorrectly described as "byte constants" in some error messages. This commit eliminates `NonAsciiCharInByteString` so the three cases are handled similarly, and described correctly. The `mode` is enough to distinguish them. Note: Some existing error messages mention "byte constants" and some mention "byte literals". I went with the latter here, because it's a more correct name, as used by the Reference.
Remove a low-value comment, remove a duplicate comment, and correct a third comment.
It deals with eight cases: ints, floats, and the six quoted types (char/byte/strings). For ints and floats we have an early return, and the other six types fall through to the code at the end, which makes the function hard to read. This commit rearranges things to avoid the early returns.
It has a single callsite, and is fairly small. The `Float` match arm already has base-specific checking inline, so this makes things more consistent.
It's easy to just use `unescape_literal` + `byte_from_char`.
The `usize` isn't needed in the error case.
…dant with the main span
Previously, rustdoc would unconditionally report the version that *rustc* was compiled with. That showed things like `nightly-2022-10-30`, which wasn't right, since this was a `dev` build compiled from source. Fix it by changing `rustc_driver::version` to a macro expanded at invocation time.
Co-authored-by: David Wood <agile.lion3441@fuligin.ink>
…nostics, r=davidtwco Migrate rustc_codegen_llvm to SessionDiagnostics WIP: Port current implementation of diagnostics to the new SessionDiagnostics. Part of rust-lang#100717 `@rustbot` label +A-translation
Add context to compiler error message Changed `creates a temporary which is freed while still in use` to `creates a temporary value which is freed while still in use`.
Add support for custom mir This implements rust-lang/compiler-team#564 . Details about the design, motivation, etc. can be found in there. r? `@oli-obk`
Stabilize integer logarithms Stabilizes feature `int_log`. I've also made the functions const stable, because they don't depend on any unstable const features. `rustc_allow_const_fn_unstable` is just there for `Option::expect`, which could be replaced with a `match` and `panic!`. cc ```@rust-lang/wg-const-eval``` closes rust-lang#70887 (tracking issue) ~~blocked on FCP finishing: rust-lang#70887 (comment) FCP finished: rust-lang#70887 (comment)
…cottmcm Add documentation examples for `pointer::mask` The examples are somewhat convoluted, but I don't know how to make this better :(
…=matklad Unescaping cleanups Some code improvements, and some error message improvements. Best reviewed one commit at a time. r? `````@matklad`````
…scription-for-as-simd-mut, r=scottmcm rustdoc: Add mutable to the description Add mutable the description to differentiate [as_simd](https://github.com/rust-lang/rust/blob/master/library/core/src/slice/mod.rs#L3654) from [as_simd_mut](https://github.com/rust-lang/rust/blob/master/library/core/src/slice/mod.rs#L3654).
…r=fee1-dead Const Compare for Tuples Makes the impls for Tuples of ~const `PartialEq` types also `PartialEq`, impls for Tuples of ~const `PartialOrd` types also `PartialOrd`, for Tuples of ~const `Ord` types also `Ord`. behind the `#![feature(const_cmp)]` gate. ~~Do not merge before rust-lang#104113 is merged because I want to use this feature to clean up the new test that I added there.~~ r? ```@fee1-dead```
…ble-trait, r=GuillaumeGomez rustdoc: use javascript to layout notable traits popups Fixes rust-lang#102576 Preview: https://notriddle.com/notriddle-rustdoc-demos/102576-js-notable-trait/std/iter/trait.Iterator.html#method.step_by ## Before ![image](https://user-images.githubusercontent.com/1593513/200432713-23aa8d49-ba2b-469f-9eab-089e0c174039.png) ## After ![image](https://user-images.githubusercontent.com/1593513/200432735-edd5b53d-e99d-4fc5-9410-8a79e0efdc9d.png)
Cleanups in autoderef impl Just something I noticed. Turns out the `overloaded_span` is not actually used separately from the main span, so I merged them.
Update books ## nomicon 1 commits in 9c73283775466d22208a0b28afcab44db4c0cc10..05532356e7a4dbea2330aabb77611f5179493bb8 2022-09-30 07:31:22 +0900 to 2022-11-05 08:13:14 +0900 - Fix typos and grammatical errors (rust-lang/nomicon#384) ## reference 1 commits in 4ea7c5def38ac81df33a9e48e5637a82a5ac404d..9f0cc13ffcd27c1fbe1ab766a9491e15ddcf4d19 2022-10-25 15:14:36 -0700 to 2022-10-31 04:09:16 -0700 - Add a comma (rust-lang/reference#1289) ## book 12 commits in aa5ee485bd6bd80d205da7c82fcdd776f92fdd51..3f64052c048c6def93b94a2b514ee88bba918744 2022-10-20 16:49:55 -0400 to 2022-11-03 22:13:58 -0400 - Upgrade to Rust 1.65 - Upgrade to Rust 1.64 - Upgrade to Rust 1.63 - New ideas for the issue template to try - Clarify that the conditional expression is the one under discussion - Updates from copyedit of ch6 - Made Option<T> error explanation more clear - Update ch06-01-defining-an-enum - Upgrade mdbook - Clarify that user1 can't be used as a whole instance. Fixes rust-lang/book#2978. - Fix plural and incorrect phrase. Fixes rust-lang/book#3359. - Updates from copyedit of ch5 ## rust-by-example 4 commits in 03491f33375c5a2a1661c7fa4be671fe95ce1249..2b15c0abf2bada6e00553814336bc3e2d8399097 2022-10-21 07:30:08 -0300 to 2022-10-31 08:30:13 -0300 - Remove --edition from src/crates/using_lib.md (rust-lang/rust-by-example#1635) - upgrade upload-artifact - Clarify Fn in fn/closures/input_parameters.md (rust-lang/rust-by-example#1634) - fix: erroneous white spaces in types/cast.md ## rustc-dev-guide 12 commits in 51a37ad..d0dc6c9 2022-10-25 10:18:58 -0700 to 2022-11-07 16:49:22 +0200 - trans -> codegen - Remove implementation details - Update some more things and improve wording - Update query.md - replace tabs with spaces (rust-lang/rustc-dev-guide#1504) - align code blocks with their paragraphs - Fixes some typos (rust-lang/rustc-dev-guide#1502) - UPDATE - mention of Diagnostic derive on enums - trans -> codegen (rust-lang/rustc-dev-guide#1500) - add note for err annotation formatting - Remove `--bless` from pre-push hook suggestion - Update for highfive transition.
Fix `rustdoc --version` when used with download-rustc Previously, rustdoc would unconditionally report the version that *rustc* was compiled with. That showed things like `nightly-2022-10-30`, which wasn't right, since this was a `dev` build compiled from source. Fix it by changing `rustc_driver::version` to a macro expanded at invocation time. cc rust-lang#103206 (comment)
rustbot
added
A-translation
Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
rollup
A PR which is a rollup
labels
Nov 9, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-translation
Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic
rollup
A PR which is a rollup
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Successful merges:
pointer::mask
#103694 (Add documentation examples forpointer::mask
)rustdoc --version
when used with download-rustc #104184 (Fixrustdoc --version
when used with download-rustc)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup