Merged
Conversation
also removes E0452 and splits `tests/rustdoc-ui/lints/renamed-lint-still-applies` into 2 tests this is because of delayed warn lint being lost on compiler aborting on error
Use fine grained component-wise span tracking in use trees This often produces nicer spans and even doesn't need a Span field anymore (not that I expect the unused field to affect any perf, but still neat).
…kin,Kivooeo renaming method is_impl_trait to is_opaque Completing one of the tasks mentioned in this issue: rust-lang/rust#154941 r? @WaffleLapkin
The regressions are documented in the PR comments. This reverts commit 2972b5e, reversing changes made to f908263.
Add suggestion to `.to_owned()` used on `Cow` when borrowing fixes rust-lang/rust#144792 supersedes rust-lang/rust#144925 with the review comments addressed the tests suggested from @Kivooeo from rust-lang/rust#144925 (comment) didn't work entirely, because these tests failed due to error `[E0308]` mismatched types, which actually already provides a suggestion, that actually makes the code compile: ``` $ cargo check error[E0308]: mismatched types --> src/main.rs:3:5 | 1 | fn test_cow_suggestion() -> String { | ------ expected `std::string::String` because of return type 2 | let os_string = std::ffi::OsString::from("test"); 3 | os_string.to_string_lossy().to_owned() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `String`, found `Cow<'_, str>` | = note: expected struct `std::string::String` found enum `std::borrow::Cow<'_, str>` help: try using a conversion method | 3 | os_string.to_string_lossy().to_owned().to_string() | ++++++++++++ ``` now this suggestion is of course not good or efficient code, but via clippy with `-Wclippy::nursery` lint group you can actually get to the correct code, so i don't think this is too much of an issue: <details> <summary>the clippy suggestions</summary> ``` $ cargo clippy -- -Wclippy::nursery warning: this `to_owned` call clones the `Cow<'_, str>` itself and does not cause its contents to become owned --> src/main.rs:3:5 | 3 | os_string.to_string_lossy().to_owned().to_string() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#suspicious_to_owned = note: `#[warn(clippy::suspicious_to_owned)]` on by default help: depending on intent, either make the `Cow` an `Owned` variant | 3 | os_string.to_string_lossy().into_owned().to_string() | ++ help: or clone the `Cow` itself | 3 - os_string.to_string_lossy().to_owned().to_string() 3 + os_string.to_string_lossy().clone().to_string() | $ # apply first suggestion $ cargo c -- -Wclippy::nursery warning: redundant clone --> src/main.rs:3:45 | 3 | os_string.to_string_lossy().into_owned().to_string() | ^^^^^^^^^^^^ help: remove this | note: this value is dropped without further use --> src/main.rs:3:5 | 3 | os_string.to_string_lossy().into_owned().to_string() | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/beta/index.html#redundant_clone = note: `-W clippy::redundant-clone` implied by `-W clippy::nursery` = help: to override `-W clippy::nursery` add `#[allow(clippy::redundant_clone)]` ``` </details> the actual error that we are looking for is error `[E0515]`, cannot return value referencing local variable, which was only present in the original issue due to automatic type inference assuming you want to return a cloned `Cow<'_, str>`, which is of course not possible. this is why i took the original test functions and turned them into closures, where it's less obvious that it's trying to return the wrong type. r? davidtwco (because you reviewed the last attempt) (also, let me know if i should squash this down to one commit and add myself as the co-contributor)
…uwer Rollup of 6 pull requests Successful merges: - rust-lang/rust#152901 (Introduce a `#[diagnostic::on_unknown]` attribute) - rust-lang/rust#155078 (Reject dangling attributes in where clauses) - rust-lang/rust#154449 (Invert dependency between `rustc_errors` and `rustc_abi`.) - rust-lang/rust#154646 (Add suggestion to `.to_owned()` used on `Cow` when borrowing) - rust-lang/rust#154993 (compiletest: pass -Zunstable-options for unpretty and no-codegen paths) - rust-lang/rust#155097 (Make `rustc_attr_parsing::SharedContext::emit_lint` take a `MultiSpan` instead of a `Span`)
…pratt,Urgau Semantic checks of `impl` restrictions This PR implements semantic checks for `impl` restrictions proposed in the [Restrictions RFC](https://rust-lang.github.io/rfcs/3323-restrictions.html) (Tracking Issue rust-lang/rust#105077), and linked to a [GSOC idea/proposal](https://github.com/rust-lang/google-summer-of-code/tree/142433eb3b104b2f32bae0b9dfafb78a0a2ac579?tab=readme-ov-file#implementing-impl-and-mut-restrictions). It lowers the resolved paths of `impl` restrictions from the AST to HIR and into `TraitDef`, and integrates the checks into the coherence phase by extending `check_impl`. As parsing (rust-lang/rust#152943) and path resolution (rust-lang/rust#153556) have already been implemented, this PR provides a working implementation of `impl` restrictions. r? @Urgau cc @jhpratt
update thin-vec With thin-vec v0.2.15 released, copy-pasted implementation of ExtractIf can be removed.
…mann Implement EII for statics This PR implements EII for statics. I've tried to mirror the implementation for functions in a few places, this causes some duplicate code but I'm also not really sure whether there's a clean way to merge the implementations. This does not implement defaults for static EIIs yet, I will do that in a followup PR
…uwer Rollup of 19 pull requests Successful merges: - rust-lang/rust#155162 (relnotes for 1.95) - rust-lang/rust#140763 (Change codegen of LLVM intrinsics to be name-based, and add llvm linkage support for `bf16(xN)` and `i1xN`) - rust-lang/rust#153604 (Fix thread::available_parallelism on WASI targets with threads) - rust-lang/rust#154193 (Implement EII for statics) - rust-lang/rust#154389 (Add more robust handling of nested query cycles) - rust-lang/rust#154435 (resolve: Some import resolution cleanups) - rust-lang/rust#155236 (Normalize individual predicate of `InstantiatedPredicates` inside `predicates_for_generics`) - rust-lang/rust#155243 (cg_ssa: transmute between scalable vectors) - rust-lang/rust#153941 (tests/debuginfo/basic-stepping.rs: Explain why all lines are not steppable) - rust-lang/rust#154587 (Add --verbose-run-make-subprocess-output flag to suppress verbose run-make output for passing tests) - rust-lang/rust#154624 (Make `DerefPure` dyn-incompatible) - rust-lang/rust#154929 (Add `const Default` impls for `LazyCell` and `LazyLock`) - rust-lang/rust#154944 (Small refactor of `arena_cache` query values) - rust-lang/rust#155055 (UI automation) - rust-lang/rust#155062 (Move tests from `tests/ui/issues/` to appropriate directories) - rust-lang/rust#155131 (Stabilize feature `uint_bit_width`) - rust-lang/rust#155147 (Stabilize feature `int_lowest_highest_one`) - rust-lang/rust#155174 (Improve emission of `UnknownDiagnosticAttribute` lint) - rust-lang/rust#155194 (Fix manpage version replacement and use verbose version)
Start using pattern types in libcore cc rust-lang/rust#135996 Replaces the innards of `NonNull` with `*const T is !null`. This does affect LLVM's optimizations, as now reading the field preserves the metadata that the field is not null, and transmuting to another type (e.g. just a raw pointer), will also preserve that information for optimizations. This can cause LLVM opts to do more work, but it's not guaranteed to produce better machine code. Once we also remove all uses of rustc_layout_scalar_range_start from rustc itself, we can remove the support for that attribute entirely and handle all such needs via pattern types
Post-attribute ports cleanup pt. 1 (again) This is a re-implementation of most (but not all) of rust-lang/rust#154808 The code is the same as in that PR, other than a few changes, I'll leave comments where I changed things. I did re-implement most of the commits rather than cherry-picking, so it's probably good to check the entire diff regardless r? @jdonszelmann
Collaborator
|
|
Lintcheck changes for 7a69763
This comment will be updated if you push new changes |
This was referenced Apr 16, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
r? @ghost
changelog: none