Skip to content

fix: don't complete .await on receivers of unknown type#22486

Open
ada4a wants to merge 3 commits into
rust-lang:masterfrom
ada4a:22478-spurious-await
Open

fix: don't complete .await on receivers of unknown type#22486
ada4a wants to merge 3 commits into
rust-lang:masterfrom
ada4a:22478-spurious-await

Conversation

@ada4a

@ada4a ada4a commented May 29, 2026

Copy link
Copy Markdown
Contributor

Fixes #22478

This also happens to improve syntax highlighting in presence of error types, and therefore fixes #22487

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 29, 2026
@ada4a ada4a marked this pull request as draft May 29, 2026 16:25
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 29, 2026
Comment thread crates/hir-ty/src/traits.rs Outdated
env: ParamEnvAndCrate<'db>,
trait_: TraitId,
) -> bool {
if ty.is_ty_error() {

@ChayimFriedman2 ChayimFriedman2 May 30, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should come in implements_trait_unique_with_infcx().

View changes since the review

Comment thread crates/hir/src/lib.rs Outdated
Comment thread crates/ide-completion/src/completions/dot.rs Outdated
@ada4a ada4a force-pushed the 22478-spurious-await branch from 21a8536 to fd4b9ff Compare June 1, 2026 19:26
@ada4a ada4a marked this pull request as ready for review June 1, 2026 19:26
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 1, 2026
@ada4a ada4a force-pushed the 22478-spurious-await branch from fd4b9ff to dac2dfe Compare June 1, 2026 19:29
@ada4a ada4a force-pushed the 22478-spurious-await branch from dac2dfe to 0f3c0ec Compare June 1, 2026 19:40
@rustbot

rustbot commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@rustbot

rustbot commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

☔ The latest upstream changes (possibly #22448) made this pull request unmergeable. Please resolve the merge conflicts.

}

#[test]
fn no_await_on_error_type() {

@Veykril Veykril Jun 6, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets move this test into crates\ide-completion\src\tests\expression.rs (at one point I tried getting rid of the unit tests in the completions directory, grouping them by "location" instead, but I never managed to finish that.

View changes since the review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

callable token modifier emitted on locals of unknown type .await completion shown in a non-async function when the receiver is of unknown type

4 participants