Rollup of 5 pull requests#155611
Conversation
The `Flags` trait has two methods: `flags` and `outer_exclusive_binder`. Multiple types impl this trait and then also have duplicate inherent methods with the same names; these are all marked with "Think about removing this" comments. This is left over from things being moved into `rustc_type_ir`. This commit removes those inherent methods. This requires adding `use Flags` to a number of files.
When a function returns `impl Trait`, all branches must return the same
concrete type. Previously, the compiler showed:
expected `First` because of return type
This was misleading, as it suggested the return type was `First`, rather
than any single type implementing the trait.
Update the diagnostic to:
expected a single type implementing `Value` because of return type
Also highlight the first return expression to make it clearer why
subsequent returns do not match.
Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>
…and not the old one
…ebank
Improve E0308 error message for `impl Trait` return mismatches
When a function returns `impl Trait`, all branches must return the same concrete type. Previously, the compiler showed:
expected `First` because of return type
This was misleading, as it suggested the return type was `First`, rather than any single type implementing the trait.
Update the diagnostic to:
expected a single type implementing `Value` because of return type
Also highlight the first return expression to make it clearer why subsequent returns do not match.
Fix incorrect `let` to `const` suggestion for pattern bindings
When a variable from a pattern binding was referenced inside a `const {}` block, the compiler incorrectly suggested replacing `let` with `const`. This was reported in rust-lang#152831 for `if let`, but also applies to `while let` and `let ... else`.
…r=nikomatsakis Remove duplicated `Flags` methods. The `Flags` trait has two methods: `flags` and `outer_exclusive_binder`. Multiple types impl this trait and then also have duplicate inherent methods with the same names; these are all marked with "Think about removing this" comments. This is left over from things being moved into `rustc_type_ir`. This commit removes those inherent methods. This requires adding `use Flags` to a number of files. r? @lcnr
…=oli-obk Use per-parent disambiguators everywhere This PR addressing the following concerns about per-parent disambiguators (rust-lang#153955): - DisambiguatorState is removed, PerParentDisambiguatorState is now used everywhere, - Steals were removed from every per-parent disambiguator in resolver, - It adds `parent` field in `PerParentDisambiguatorState` in `#[cfg(debug_assertions)]` for asserting that per-parent disambiguator corresponds to the same `LocalDefId` which is passed into `create_def`, - ~Removes `Disambiguator` trait replacing it with `Disambiguator` enum, with this change we no longer expose `next` method (as trait should be public otherwise the warning will be emitted). It may affect perf in a negative way though.~ ~Those changes should not fix perf issues that were [reported](rust-lang#153955 (comment)), perf run that was attempted [before](rust-lang#153955 (comment)) showed much better results. Performance can be probably fixed by removing per-parent disambiguators replacing them with a single one as it was before, then it will be passed to AST -> HIR lowering and modified. For delayed owners we can store ~followup disambiguators as it was in the beginning of the rust-lang#153955~ per-parent disambiguators. This solution should save achievements from rust-lang#153955 (removed `DefPathData` variants). However, I would prefer to keep per-parent disambiguators as it seems a better architectural solution for me.~ r? @petrochenkov cc @oli-obk
…d, r=JonathanBrouwer Remove AttributeLintKind variants - part 5 Part of rust-lang#153099. r? @JonathanBrouwer
|
@bors r+ rollup=never p=5 |
This comment has been minimized.
This comment has been minimized.
|
📌 Perf builds for each rolled up PR:
previous master: 9ec5d5f32e 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 9ec5d5f (parent) -> f9988fe (this PR) Test differencesShow 60 test diffsStage 1
Stage 2
Additionally, 56 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 f9988fefd3add01f414f52b414308e7872622fee --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 (f9988fe): 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)Results (primary 1.5%, secondary 1.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.1%, secondary -0.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis perf run didn't have relevant results for this metric. Bootstrap: 489.594s -> 490.294s (0.14%) |
Successful merges:
impl Traitreturn mismatches #155546 (Improve E0308 error message forimpl Traitreturn mismatches)lettoconstsuggestion for pattern bindings #152834 (Fix incorrectlettoconstsuggestion for pattern bindings)Flagsmethods. #155425 (Remove duplicatedFlagsmethods.)AttributeLintKindvariants - part 5 #155590 (Remove AttributeLintKind variants - part 5)r? @ghost
Create a similar rollup