-
Notifications
You must be signed in to change notification settings - Fork 13k
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 11 pull requests #82235
Merged
Merged
Rollup of 11 pull requests #82235
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
Ironically, the overflowing_literals handler for binary or hex already had this message! You would think it would be the other way around :)
In the backend we may want to remove certain temporary files, but in certain other situations these files might not be produced in the first place. We don't exactly care about that, and the intent is really that these files are gone after a certain point in the backend. Here we unify the backend file removing calls to use `ensure_removed` which will attempt to delete a file, but will not fail if it does not exist (anymore). The tradeoff to this approach is, of course, that we may miss instances were we are attempting to remove files at wrong paths due to some bug – compilation would silently succeed but the temporary files would remain there somewhere.
Co-authored-by: Mara <m-ou.se@m-ou.se>
Remove unused const
It can be useful to do some computation in `assert!` format arguments, in order to get better error messages. For example: ```rust assert!( some_condition, "The state is invalid. Details: {}", expensive_call_to_get_debugging_info(), ); ``` It seems like `assert!` only evaluates the format arguments if the assertion fails, which is useful but doesn't appear to be documented anywhere. This PR documents the behavior and adds some tests.
Also don't convert to u8 buffers and back when we are only creating strings.
…nce-error, r=lcnr Add 'consider using' message to overflowing_literals Fixes rust-lang#79744. Ironically, the `overflowing_literals` handler for binary or hex already had this message! You would think it would be the other way around :) cc ```@scottmcm```
To digit simplification I found out the other day that all the ascii digits have the first four bits as one would hope them to. (Eg. char `2` ends `0b0010`). There are two bits to indicate it's in the digit range ( `0b0011_0000`). If it is a true digit then all the higher bits aside from these two will be 0 (as ascii is the lowest part of the unicode u32 spectrum). So XORing with `0b11_0000` should mean we either get the number 0-9 or alternativly we get a larger number in the u32 space. If we get something that's not 0-9 then it will be discarded as it will be greater than the radix. The code seems so fast though that there's quite a lot of noise in the benchmarks so it's not that easy to prove conclusively that it's faster as well as less instructions. The non-fast path I was toying with as well wondering if we could do this as then we'd only have one return and less instructions still: ``` match self { 'a'..='z' => self as u32 - 'a' as u32 + 10, 'A'..='Z' => self as u32 - 'A' as u32 + 10, _ => { radix = 10; self as u32 ^ ASCII_DIGIT_MASK}, } ``` Here's the [godbolt](https://godbolt.org/z/883c9n). ( H/T to ``@byteshadow`` for pointing out xor was what I needed)
…rochenkov Don't fail to remove files if they are missing In the backend we may want to remove certain temporary files, but in certain other situations these files might not be produced in the first place. We don't exactly care about that, and the intent is really that these files are gone after a certain point in the backend. Here we unify the backend file removing calls to use `ensure_removed` which will attempt to delete a file, but will not fail if it does not exist (anymore). The tradeoff to this approach is, of course, that we may miss instances were we are attempting to remove files at wrong paths due to some bug – compilation would silently succeed but the temporary files would remain there somewhere.
…r, r=lcnr Fix ICE: Use delay_span_bug for mismatched subst/hir arg Fixes rust-lang#82126.
…expressions, r=sfackler Document that `assert!` format arguments are evaluated lazily It can be useful to do some computation in `assert!` format arguments, in order to get better error messages. For example: ```rust assert!( some_condition, "The state is invalid. Details: {}", expensive_call_to_get_debugging_info(), ); ``` It seems like `assert!` only evaluates the format arguments if the assertion fails, which is useful but doesn't appear to be documented anywhere. This PR documents the behavior and adds some tests.
Replace File::create and write_all with fs::write Also don't convert to u8 buffers and back when we are only creating strings.
Add caveat to Path::display() about lossiness It's worth calling out that this API may do a lossy display. r? ```@m-ou-se```
…r=sfackler Use internal iteration in Iterator::is_sorted_by
Update books ## nomicon 1 commits in bbf06ad39d1f45654047e9596b750cc6e6d1b693..adca786547d08fe676b2fc7a6f08c2ed5280ca38 2021-01-22 07:07:31 -0800 to 2021-02-16 16:34:20 +0900 - Merge pull request rust-lang/nomicon#254 from mdaverde/ml/adds-compiler-err-lifetimes ## reference 9 commits in f02b09eb6e8af340ad1256a54adb7aae2ff3163e..361367c126290ac17cb4089f8d38fd8b2ac43f98 2021-01-22 01:53:02 -0800 to 2021-02-15 09:58:13 -0800 - Define turbofish in the glossary (rust-lang/reference#964) - Remove enum variant expr (rust-lang/reference#963) - One sentence is one line src/expressions/* (rust-lang/reference#962) - Referencify bool type (rust-lang/reference#940) - Fix typo in type cast expression table (rust-lang/reference#959) - Define rust (rust-lang/reference#953) - Remove "Memory Ownership" chapter (rust-lang/reference#952) - Added setting nightly as a requirement for running tests (rust-lang/reference#955) - Refactored build steps for better readability (rust-lang/reference#936) ## book 13 commits in e724bd826580ff95df48a8533af7dec1080693d4..db5e8a5105aa22979490dce30e33b68d8645761d 2021-01-20 08:19:49 -0600 to 2021-02-12 16:58:20 -0500 - Update to Rust 1.50 - Fix issue rust-lang/book#2574 - Improve the explanation about the behaviour of `read_line`. (rust-lang/book#2575) - closures: replace "is called" with "is defined" (rust-lang/book#2556) - Minor clarification: types -> values in ch16-04 (rust-lang/book#2587) - fixed hidden code listing (rust-lang/book#2610) - Merge remote-tracking branch 'origin/pr/2604' - (rust-lang/book#2601) - Merge remote-tracking branch 'origin/pr/2589' - Fix text wrapping - Some small rewordings I noticed while rereading just now - (rust-lang/book#2592) - Removed 'of' between type alias in Ch 19-04. (rust-lang/book#2581) - Merge remote-tracking branch 'origin/pr/2554' ## rust-by-example 2 commits in f633769acef68574427a6fae6c06f13bc2199573..551cc4bc8394feccea6acd21f86d9a4e1d2271a0 2021-01-13 20:58:25 -0300 to 2021-02-03 17:12:37 -0300 - remove // (rust-lang/rust-by-example#1409) - Update arc.md (rust-lang/rust-by-example#1406) ## edition-guide 3 commits in b91a9a881ee007c12e74e844460ec407cf07a50f..1da3c411f17adb1ba5de1683bb6acee83362b54a 2020-11-02 11:02:03 -0600 to 2021-02-16 16:46:40 -0800 - Update link for no_std. (rust-lang/edition-guide#231) - Add git link to the source. (rust-lang/edition-guide#228) - Update musl libc link (rust-lang/edition-guide#230) ## embedded-book 1 commits in ceec19e873be87c6ee5666b030c6bb612f889a96..4cf7981696a85c3e633076c6401611bd3f6346c4 2021-01-03 13:13:10 +0000 to 2021-02-11 10:55:22 +0000 - Fix installing dateutil since it is now a dependency of the GHP import script (rust-embedded/book#282)
rustdoc: treat edition 2021 as unstable This ensures that `--edition=2021` requires `-Z unstable-options` in rustdoc.
…543, r=GuillaumeGomez Add long explanation for E0543 Helps with rust-lang#61137
@bors: r+ p=11 |
📌 Commit 03477e9 has been approved by |
bors
added
the
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
label
Feb 17, 2021
☀️ Test successful - checks-actions |
A job failed! Check out the build log: (web) (plain) Click to see the possible cause of the failure (guessed by this bot)
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
merged-by-bors
This PR was explicitly merged by bors.
rollup
A PR which is a rollup
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
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:
assert!
format arguments are evaluated lazily #82169 (Document thatassert!
format arguments are evaluated lazily)Failed merges:
r? @ghost
@rustbot modify labels: rollup
Create a similar rollup