-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Skip suggest impl or dyn when poly trait is not a real trait #139200
Merged
Merged
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
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
HIR ty lowering was modified cc @fmease |
compiler-errors
approved these changes
Apr 1, 2025
@bors r+ rollup |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 2, 2025
Rollup of 14 pull requests Successful merges: - rust-lang#135295 (Check empty SIMD vector in inline asm) - rust-lang#138003 (Add the new `amx` target features and the `movrs` target feature) - rust-lang#138823 (rustc_target: RISC-V: add base `I`-related important extensions) - rust-lang#138913 (Remove even more instances of `@ts-expect-error` from search.js) - rust-lang#138941 (Do not mix normalized and unnormalized caller bounds when constructing param-env for `receiver_is_dispatchable`) - rust-lang#139060 (replace commit placeholder in vendor status with actual commit) - rust-lang#139102 (coverage: Avoid splitting spans during span extraction/refinement) - rust-lang#139191 (small opaque type/borrowck cleanup) - rust-lang#139200 (Skip suggest impl or dyn when poly trait is not a real trait) - rust-lang#139208 (fix dead link netbsd.md) - rust-lang#139210 (chore: remove redundant backtick) - rust-lang#139212 (Update mdbook to 0.4.48) - rust-lang#139214 (Tell rustfmt to use the 2024 edition in ./x.py fmt) - rust-lang#139225 (move autodiff from EnzymeAD/Enzyme to our rust-lang/Enzyme soft-fork) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Apr 2, 2025
Rollup merge of rust-lang#139200 - xizheyin:issue-139174, r=compiler-errors Skip suggest impl or dyn when poly trait is not a real trait Fixes rust-lang#139174 When `poly_trait_ref` is not a real trait, we should stop suggesting `impl` and `dyn` to avoid false positives. 3 cases were added to the ui test. https://github.com/rust-lang/rust/blob/0b45675cfcec57f30a3794e1a1e18423aa9cf200/compiler/rustc_hir_analysis/src/hir_ty_lowering/lint.rs#L88-L93 In the first commit, I submitted the test and passed it. In the second commit, I modified the code and we can see the changes in the test. r? compiler
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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.
Fixes #139174
When
poly_trait_ref
is not a real trait, we should stop suggestingimpl
anddyn
to avoid false positives. 3 cases were added to the ui test.rust/compiler/rustc_hir_analysis/src/hir_ty_lowering/lint.rs
Lines 88 to 93 in 0b45675
In the first commit, I submitted the test and passed it. In the second commit, I modified the code and we can see the changes in the test.
r? compiler