-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Rollup of 4 pull requests #140702
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 4 pull requests #140702
Conversation
The new logic for determining whether to peel references will depend on whether smart pointers need to be peeled before matching.
And also: - Document test intent. - Move under `link-native-libs/` instead.
…ustdoc Unify sidebar buttons to use the same image Part of rust-lang#139832. The source sidebar looks like this with the new image:  You can test it [here](https://rustdoc.crud.net/imperio/sidebar-images/src/foo/foo.rs.html). r? `@notriddle`
…i-obk add a test for issue rust-lang#81317 closes rust-lang#81317
`deref_patterns`: let string and byte string literal patterns peel references and smart pointers before matching This follows up on rust-lang#140028. Together, they allow using string and byte string literal patterns to match on smart pointers when `deref_patterns` is enabled. In particular, string literals can now match on `String`, subsuming the functionality of the `string_deref_patterns` feature. More generally, this works by letting literals peel references (and smart pointers) before matching, similar to most other patterns, providing an answer to rust-lang#44849. Though it's only partially implemented at this point: this doesn't yet let named const patterns peel before matching. The peeling logic is general enough to support named consts, but the typing rules for named const patterns would need adjustments to feel consistent (e.g. arrays would need rules to be usable as slices, and `const STR: &'static str` wouldn't be able to match on a `String` unless a rule was added to let it be used where a `str` is expected, similar to what rust-lang#140028 did for literals). This also allows string and byte string patterns to match on mutable references, following up on rust-lang#140028 (comment). Rather than forward the mutability of the scrutinee to literal patterns, I've opted to peel `&mut`s from the scrutinee. From a design point of view, this makes the behavior consistent with what would be expected from deref coercions using the methodology in the next paragraph. From a diagnostics point of view, this avoids labeling string and byte string patterns as "mutable references", which I think could be confusing. See [`byte-string-type-errors.rs`](https://github.com/rust-lang/rust/compare/master...dianne:rust:lit-deref-pats-p2?expand=1#diff-4a0dd9b164b67c706751f3c0b5762ddab08bcef05a91972beb0190c6c1cd3706) for how the diagnostics look. At a high level, the peeling logic implemented here tries to mimic how deref coercions work for expressions: we peel references (and smart pointers) from the scrutinee until the pattern can match against it, and no more. This is primarily tested by [`const-pats-do-not-mislead-inference.rs`](https://github.com/rust-lang/rust/compare/master...dianne:rust:lit-deref-pats-p2?expand=1#diff-19afc05b8aae9a30fe4a3a8c0bc2ab2c56b58755a45cdf5c12be0d5e83c4739d). To illustrate the connection, I wasn't sure if this made sense to include in the test file, but I've translated those tests to make sure they give the same inference results as deref coercions: [(playground)](https://play.rust-lang.org/?version=stable&mode=debug&edition=2024&gist=1869744cb9cdfed71a686990aadf9fe1). In each case, a reference to the scrutinee is coerced to have the type of the pattern (under a reference). Tracking issue for deref patterns: rust-lang#87121 r? `@oli-obk` cc `@Nadrieril`
Don't ignore compiler stderr in `lib-defaults.rs` Closes rust-lang#54222. - Don't ignore compiler stderr. - Document test intent. - Move under `tests/ui/link-native-libs/` instead. This was previously discussed on https://web.archive.org/web/20181028094402/https://botbot.me/mozilla/rust-tools/2017-02-21/?page=1. try-job: armhf-gnu try-job: test-various try-job: x86_64-msvc-1 try-job: i686-msvc-1 try-job: x86_64-mingw-1 try-job: aarch64-apple try-job: x86_64-apple-1
@bors r+ p=4 rollup=never |
☀️ Test successful - checks-actions |
📌 Perf builds for each rolled up PR:
previous master: f5d3fe273b In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing f5d3fe2 (parent) -> 1a95cc6 (this PR) Test differencesShow 14 test diffsStage 1
Stage 2
Additionally, 4 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 1a95cc6f9d950992ba27746e45caf40118581cb1 --output-dir test-dashboard And then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
Finished benchmarking commit (1a95cc6): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary -0.4%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary 0.5%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 770.498s -> 769.964s (-0.07%) |
Successful merges:
deref_patterns
: let string and byte string literal patterns peel references and smart pointers before matching #140658 (deref_patterns
: let string and byte string literal patterns peel references and smart pointers before matching)lib-defaults.rs
#140681 (Don't ignore compiler stderr inlib-defaults.rs
)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup