Rollup of 17 pull requests - #163043
Rollup of 17 pull requests#163043
Conversation
rust-analyzer has a query for this, so we want to use it there. I don't know if using a query for this will be a perf win for rustc, but rust-analyzer already has this query for other reasons, so it feels a waste to not use it.
…or the long removed type ascription
Previously we would trigger on
1. `unsafe { 1, 2, 3 }` and suggest `[ { 1, 2, 3 ]` (sic!)
2. `'label: { 1, 2, 3 }` and suggest `[: { 1, 2, 3 ]` (sic!)
3. `X::<{ 1, 2, 3 }>` and suggest `X::<[ 1, 2, 3]>` (wrong)
4. `|| -> i32 { 1, 2, 3 }` and suggest `|| -> i32 [ 1, 2, 3 ]` (wrong)
5. `await { 1, 2, 3 }` and suggest `await [ 1, 2, 3 ]` (wrong)
Moreover, stop looking for identifiers after the `{` as that case can no
longer be reached anyway as `maybe_recover_bad_struct_literal_path`
will always snatch it first.
When in a method trying to access `Self` on its own, suggest `self`.
When in any assoc fn trying to access `Self()`, suggest `Self { fields }` or using an enum variant. When enum has no variants, mention it.
``` error[E0061]: this method takes 0 arguments but 1 argument was supplied --> $DIR/shadowed-intrinsic-method.rs:18:7 | LL | a.borrow(()); | ^^^^^^ -- unexpected argument of type `()` | note: the `borrow` call is resolved to the method in `std::borrow::Borrow`, shadowing the method of the same name on the inherent impl for `A` --> $DIR/shadowed-intrinsic-method.rs:18:7 | LL | use std::borrow::Borrow; | ------------------- `std::borrow::Borrow` imported here ... LL | a.borrow(()); | ^^^^^^ refers to `std::borrow::Borrow::borrow` note: method defined here --> $SRC_DIR/core/src/borrow.rs:LL:COL help: you might have meant to call the other method; you can use the fully-qualified path to call it explicitly | LL - a.borrow(()); LL + A::borrow(&mut a, ()); | help: remove the extra argument | LL - a.borrow(()); LL + a.borrow(); | ``` Account for inherent methods Tweak wording on "other methods available" note Handle correct gramar in the face of a single other option, or many.
…ified path on ambiguous assoc item
Use ModId more for visibility checks from TypeckRootCtxt. This just simplifies things a bit and adds consistency.
We generally expect Visibility to have ModId or LocalModId, so it seems good to restrict the impls as such. There is just one error path needing adjustment to check that we actually have a ModId. It should be okay since, if it is not a module, an error will be emitted elsewhere.
Especially in adjust_ident_and_get_scope and is_accessible_from.
…leExt * First pass at windows::fs::FileExt.seek_read_exact() * First pass at windows::fs::FileExt.seek_write_all() * Fix function signature in seek_read_exact(), duh * First pass at tests for .seek_read_exact(), seek_write_all() * Whitespace fix * Use hypothetical seek_read_exact_seek_write_all feature also for .seek_read_exact() * Tracking issues 162868 * Oops, fix seek_write_all() doc example, was using write_all_at() still * Add mocked test for windows FileExt trait * Spelling fixes * Expand test for windows FileExt trait to include almost all scenarios * Split three tests out of file_test_windows_fileext_trait() * Remove old versions of those 3 tests * Split remaining file_test_windows_fileext_trait() into case 4, 5 * More test cleanup, always test expected_offset where possible * Test read first for consistency * Use same doctsring examples as seek_read(), seek_write() * Missing period * Oops: actually call _exact(), _all() methods in case 2, 3 * Add missing seek_read_exact_seek_write_all feature flags in doc examples
…limiter, r=jackh726 Make let-else respect macro_rules expr metavariable grouping Fixes rust-lang#147899
Better account for `Self` that might be a typo of `self`
When in a method trying to access `Self` on its own, suggest `self`. When in any assoc fn trying to access `Self()`, suggest `Self { fields }` or using an enum variant. When enum has no variants, mention it.
Fix rust-lang#91525.
…op, r=jackh726 fix const_item_mutation lint to use needs_drop instead of has_dtor Description: The const_item_mutation lint was only checking if the outer type has a direct Drop impl (has_dtor). But if a field inside the type has a Drop impl, that drop logic can also observe the mutation — so the warning should be suppressed in that case too. This fixes a false positive where the lint would warn on code like: ```O.inner.val = 42;``` even when Inner has a Drop impl that prints the value — meaning the mutation IS observable and the warning is wrong. Fix: replace has_dtor check with needs_drop, which checks the whole type including all fields inside it.
… r=jackh726 Provide a `supertrait_def_ids()` function in rustc_type_ir's interner rust-analyzer has a query for this, so we want to use it there. I don't know if using a query for this will be a perf win for rustc, but rust-analyzer already has this query for other reasons, so it feels a waste to not use it. r? types
…-145558, r=jackh726 Do not suppress the fn item uniqueness note for late bound lifetimes Fixes rust-lang#145558 `same_type_modulo_infer` compared the bound regions by identity, so the note was suppressed for late bound lifetimes and anonymizing the binders fixes it.
post GH comment on types nominations This feature is cool, we want it for types nominations, as seen in https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/a.20.23zulip-stream.20topic.20was.20opened.20to.20discuss.20this.20issue r? @Mark-Simulacrum
This comment has been minimized.
This comment has been minimized.
Rollup of 17 pull requests Successful merges: - #158515 (Make let-else respect macro_rules expr metavariable grouping) - #160028 (Better account for `Self` that might be a typo of `self`) - #160097 (fix const_item_mutation lint to use needs_drop instead of has_dtor) - #161435 (Provide a `supertrait_def_ids()` function in rustc_type_ir's interner) - #161894 (Do not suppress the fn item uniqueness note for late bound lifetimes) - #162990 (post GH comment on types nominations) - #153662 (Suggest fully qualified path on method name collision) - #154665 (add safety section for mem::zeroed) - #159787 (Prefer ModId in more places) - #162700 ( Remove incorrect parse error recovery code that mistakes `as` casts for the long removed type ascription) - #162705 (Trigger "C array" parse error recovery in far fewer cases) - #162875 (Add .seek_read_exact(), .seek_write_all() to std::os::windows::fs::FileExt) - #162988 (recover `true` and `false` in type position as `bool`) - #162995 (Constify `impl FromStr for NonZero<T>`) - #163006 (Use `end_point` for trailing brace in `let...else` diagnostics) - #163007 (add Dir::try_clone) - #163039 (Use verbose suggestion for parenthetical `Fn` notation and fully-qualified path on ambiguous assoc item)
|
The job Click to see the possible cause of the failure (guessed by this bot) |
|
💔 Test for 585d413 failed: CI. Failed job:
|
|
Seems suspicious failure @bors retry |
|
Trying commonly failed jobs |
This comment has been minimized.
This comment has been minimized.
Rollup of 17 pull requests try-job: dist-various-1 try-job: test-various try-job: test-x86_64-gnu-aux try-job: test-x86_64-gnu-llvm-21-3 try-job: test-x86_64-msvc-1 try-job: test-aarch64-apple-1 try-job: test-aarch64-apple-2 try-job: test-x86_64-mingw-1 try-job: test-i686-msvc try-job: test-armhf-gnu
This comment has been minimized.
This comment has been minimized.
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 feaadee (parent) -> fc7358c (this PR) Test differencesShow 1271 test diffsStage 1
Stage 2
Additionally, 1248 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 fc7358c9223bbf6b30741438fc8588dad7e4671c --output-dir test-dashboardAnd 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 (fc7358c): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)This perf run didn't have relevant results for this metric. CyclesResults (primary -2.2%, secondary 2.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary -0.1%, secondary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 502.551s -> 500.549s (-0.40%) |
|
📌 Perf builds for each rolled up PR:
parent commit: feaadeeaca In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
Successful merges:
Selfthat might be a typo ofself#160028 (Better account forSelfthat might be a typo ofself)supertrait_def_ids()function in rustc_type_ir's interner #161435 (Provide asupertrait_def_ids()function in rustc_type_ir's interner)ascasts for the long removed type ascription #162700 ( Remove incorrect parse error recovery code that mistakesascasts for the long removed type ascription)trueandfalsein type position asbool#162988 (recovertrueandfalsein type position asbool)impl FromStr for NonZero<T>#162995 (Constifyimpl FromStr for NonZero<T>)end_pointfor trailing brace inlet...elsediagnostics #163006 (Useend_pointfor trailing brace inlet...elsediagnostics)Fnnotation and fully-qualified path on ambiguous assoc item #163039 (Use verbose suggestion for parentheticalFnnotation and fully-qualified path on ambiguous assoc item)r? @ghost
Create a similar rollup