Skip to content

Don't call extern_crate when local crate name is the same as a dependency and we have a trait error #130275

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

compiler-errors
Copy link
Member

#124944 implemented logic to point out when a trait bound failure involves a trait and type who come from identically named but different crates. This logic calls the extern_crate query which is not valid on LOCAL_CRATE cnum, so let's filter that out eagerly.

Fixes #130272
Fixes #129184

@compiler-errors compiler-errors changed the title Don't call extern_crate when local crate name is the same as a dependency and we have a trait error Don't call extern_crate when local crate name is the same as a dependency and we have a trait error Sep 12, 2024
@rustbot
Copy link
Collaborator

rustbot commented Sep 12, 2024

r? @lcnr

rustbot has assigned @lcnr.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@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 Sep 12, 2024
@lcnr
Copy link
Contributor

lcnr commented Sep 17, 2024

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Sep 17, 2024

📌 Commit 9d5d03b has been approved by lcnr

It is now in the queue for this repository.

@bors bors 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 Sep 17, 2024
fee1-dead added a commit to fee1-dead-contrib/rust that referenced this pull request Sep 17, 2024
Don't call `extern_crate` when local crate name is the same as a dependency and we have a trait error

rust-lang#124944 implemented logic to point out when a trait bound failure involves a *trait* and *type* who come from identically named but different crates. This logic calls the `extern_crate` query which is not valid on `LOCAL_CRATE` cnum, so let's filter that out eagerly.

Fixes rust-lang#130272
Fixes rust-lang#129184
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 17, 2024
…fee1-dead

Rollup of 8 pull requests

Successful merges:

 - rust-lang#128961 (Fix rust-lang#128930: Print documentation of CLI options missing their arg)
 - rust-lang#129073 (Relate receiver invariantly in method probe for `Mode::Path`)
 - rust-lang#129674 (Add new_cyclic_in for Rc and Arc)
 - rust-lang#130201 (Encode `coroutine_by_move_body_def_id` in crate metadata)
 - rust-lang#130275 (Don't call `extern_crate` when local crate name is the same as a dependency and we have a trait error)
 - rust-lang#130440 (Don't ICE in `opaque_hidden_inferred_bound` lint for RPITIT in trait with no default method body)
 - rust-lang#130454 (tests: allow trunc/select instructions to be missing)
 - rust-lang#130458 (`rustc_codegen_ssa` cleanups)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 17, 2024
…iaskrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#128535 (Format `std::env::consts` docstrings with markdown backticks)
 - rust-lang#128961 (Fix rust-lang#128930: Print documentation of CLI options missing their arg)
 - rust-lang#129988 (Use `Vec` in `rustc_interface::Config::locale_resources`)
 - rust-lang#130201 (Encode `coroutine_by_move_body_def_id` in crate metadata)
 - rust-lang#130275 (Don't call `extern_crate` when local crate name is the same as a dependency and we have a trait error)
 - rust-lang#130314 (Use the same precedence for all macro-like exprs)
 - rust-lang#130440 (Don't ICE in `opaque_hidden_inferred_bound` lint for RPITIT in trait with no default method body)
 - rust-lang#130458 (`rustc_codegen_ssa` cleanups)
 - rust-lang#130469 (Mark `where_clauses_object_safety` as removed)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 62f2ec9 into rust-lang:master Sep 17, 2024
6 checks passed
@rustbot rustbot added this to the 1.83.0 milestone Sep 17, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Sep 17, 2024
Rollup merge of rust-lang#130275 - compiler-errors:extern-crate, r=lcnr

Don't call `extern_crate` when local crate name is the same as a dependency and we have a trait error

rust-lang#124944 implemented logic to point out when a trait bound failure involves a *trait* and *type* who come from identically named but different crates. This logic calls the `extern_crate` query which is not valid on `LOCAL_CRATE` cnum, so let's filter that out eagerly.

Fixes rust-lang#130272
Fixes rust-lang#129184
@fmease
Copy link
Member

fmease commented Sep 19, 2024

Nominating for beta backport to fix 3 stable-to-beta regressions (reported here: #130573)

@fmease fmease added the beta-nominated Nominated for backporting to the compiler in the beta channel. label Sep 19, 2024
@apiraino
Copy link
Contributor

Beta backport accepted as per compiler team on Zulip. A backport PR will be authored by the release team at the end of the current development cycle.

@rustbot label +beta-accepted

@rustbot rustbot added the beta-accepted Accepted for backporting to the compiler in the beta channel. label Sep 26, 2024
@cuviper cuviper mentioned this pull request Sep 26, 2024
@cuviper cuviper modified the milestones: 1.83.0, 1.82.0 Sep 26, 2024
@cuviper cuviper removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Sep 26, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 27, 2024
[beta] backports

- Use equality when relating formal and expected type in arg checking rust-lang#129317
- Don't call `extern_crate` when local crate name is the same as a dependency and we have a trait error rust-lang#130275
- bootstrap: Set the dylib path when building books with rustdoc rust-lang#130536

r? cuviper
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 27, 2024
[beta] backports

- Use equality when relating formal and expected type in arg checking rust-lang#129317
- Don't call `extern_crate` when local crate name is the same as a dependency and we have a trait error rust-lang#130275
- bootstrap: Set the dylib path when building books with rustdoc rust-lang#130536

r? cuviper
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
beta-accepted Accepted for backporting to the compiler in the beta channel. 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.

ICE report as requested; no ICE on stable ICE: tcx.extern_crate(DefId(0:3 ~ example_panic[331c]::Test)) is not supported for this key
7 participants