Skip to content

Preserve ambiguous glob lint for subtrait method picks - #157968

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
kevin-valerio:fix/issue-157965-ambiguous-glob-subtrait
Aug 30, 2026
Merged

Preserve ambiguous glob lint for subtrait method picks#157968
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
kevin-valerio:fix/issue-157965-ambiguous-glob-subtrait

Conversation

@kevin-valerio

Copy link
Copy Markdown
Contributor

Fixes #157965

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 16, 2026
@rustbot

This comment was marked as outdated.

@Enselic

Enselic commented Aug 5, 2026

Copy link
Copy Markdown
Member

The fix does not look unreasonable. Maybe someone familiar with the code can easily determine if this is the right fix. The changed code was added in #149058, so I'd like to CC PR author @LorrensP-2158466 and PR reviewer @petrochenkov.

@LorrensP-2158466 LorrensP-2158466 left a comment

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.

Looks correct to me.

View changes since this review

Comment thread compiler/rustc_hir_typeck/src/method/probe.rs
Comment thread tests/ui/supertrait-shadowing/ambiguous-glob-imported-subtrait.rs
@fmease fmease assigned fmease and unassigned dingxiangfei2009 Aug 23, 2026
Comment thread compiler/rustc_hir_typeck/src/method/probe.rs
@fmease
fmease force-pushed the fix/issue-157965-ambiguous-glob-subtrait branch from 62c5646 to d44d827 Compare August 29, 2026 17:29
@rustbot

rustbot commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main 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.

@fmease fmease left a comment

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.

Thanks! I did apply some small changes myself:

  1. rebased past #152225
  2. dropped #![allow(dead_code, unused_imports)] from the test since compiletest implicitly adds -Aunused
  3. dropped //@ check-fail from the test since it's the default mode
  4. dropped //@ normalize-stderr: "error: aborting due to 1 previous error\n\n" -> "error: aborting due to 1 previous error\n" from the test since there's no need whatsoever to normalize away the extra newline
  5. added // issue: <https://github.com/rust-lang/rust/issues/157965> to the test

@bors r+ rollup

View changes since this review

@rust-bors

rust-bors Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

📌 Commit d44d827 has been approved by fmease

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 29, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 29, 2026
…iguous-glob-subtrait, r=fmease

Preserve ambiguous glob lint for subtrait method picks

Fixes rust-lang#157965
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 29, 2026
…iguous-glob-subtrait, r=fmease

Preserve ambiguous glob lint for subtrait method picks

Fixes rust-lang#157965
rust-bors Bot pushed a commit that referenced this pull request Aug 29, 2026
Rollup of 7 pull requests

Successful merges:

 - #160941 (Enforce safety comments on `alloc`)
 - #161975 (Abort instead of unwinding out of an inconsistent BTreeMap::split_off)
 - #157968 (Preserve ambiguous glob lint for subtrait method picks)
 - #161514 (rework handling of doc attributes on macro calls)
 - #161944 (rustdoc: Take into account edition information for keyword highlighting)
 - #161974 (remove rustc_never_type_options attr remnants)
 - #161978 (Move rustdoc ui doctests into the right testsuite)

Failed merges:

 - #161702 (Use `drop_guard` in some places in {core,alloc,std})
@rust-bors
rust-bors Bot merged commit adc233a into rust-lang:main Aug 30, 2026
13 checks passed
@rustbot rustbot added this to the 1.100.0 milestone Aug 30, 2026
rust-bors Bot pushed a commit that referenced this pull request Aug 30, 2026
Rollup merge of #157968 - kevin-valerio:fix/issue-157965-ambiguous-glob-subtrait, r=fmease

Preserve ambiguous glob lint for subtrait method picks

Fixes #157965
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

supertrait_item_shadowing misses #![deny(ambiguous_glob_imported_traits)] during method lookup

6 participants