Properly check associated consts for infer placeholders#112506
Merged
bors merged 1 commit intorust-lang:masterfrom Jun 14, 2023
Merged
Properly check associated consts for infer placeholders#112506bors merged 1 commit intorust-lang:masterfrom
bors merged 1 commit intorust-lang:masterfrom
Conversation
Collaborator
|
r? @b-naber (rustbot has picked a reviewer for you, use r? to override) |
lukas-code
reviewed
Jun 10, 2023
955922a to
2b40268
Compare
b-naber
reviewed
Jun 14, 2023
| { | ||
| // Account for `const C: _;`. | ||
| let mut visitor = HirPlaceholderCollector::default(); | ||
| visitor.visit_trait_item(trait_item); |
Contributor
There was a problem hiding this comment.
Can you explain why we only want to call visit_trait_item if !tcx.sess.diagnostic().has_stashed_diagnostic(ty.span, StashKey::ItemNoType) holds, please?
Contributor
Author
There was a problem hiding this comment.
Because if there is a stashed diagnostic then we will already be emitting an error, and visiting this item will provide a redundant/useless error.
Contributor
|
@bors r+ rollup |
Collaborator
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 14, 2023
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#98202 (Implement `TryFrom<&OsStr>` for `&str`) - rust-lang#107619 (Specify behavior of HashSet::insert) - rust-lang#109814 (Stabilize String::leak) - rust-lang#111974 (Update runtime guarantee for `select_nth_unstable`) - rust-lang#112109 (Don't print unsupported split-debuginfo modes with `-Zunstable-options`) - rust-lang#112506 (Properly check associated consts for infer placeholders) r? `@ghost` `@rustbot` modify labels: rollup
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.
We only reported an error if it was in a "suggestable" position (according to
is_suggestable_infer_ty) -- this isn't correct for infer tys that can show up in other places in the constant's type, like behind a dyn trait.fixes #112491