Skip to content

Implement use associated items of traits - #134754

Merged
bors merged 1 commit into
rust-lang:masterfrom
frank-king:feature/import_trait_associated_functions
Jan 17, 2025
Merged

Implement use associated items of traits#134754
bors merged 1 commit into
rust-lang:masterfrom
frank-king:feature/import_trait_associated_functions

Conversation

@frank-king

Copy link
Copy Markdown
Contributor

This PR implements #134691.

@rustbot

Copy link
Copy Markdown
Collaborator

r? @oli-obk

rustbot has assigned @oli-obk.
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

@rustbotrustbot 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 Dec 25, 2024
Comment threadcompiler/rustc_resolve/src/ident.rs Outdated
@rust-log-analyzer

This comment has been minimized.

@jieyouxu

Copy link
Copy Markdown
Member

cc @petrochenkov as this PR has some non-trivial resolve changes.

@frank-king
frank-kingforce-pushed the feature/import_trait_associated_functions branch from dc2bdee to 6905a19CompareDecember 25, 2024 08:20
@petrochenkovpetrochenkov self-assigned this Dec 25, 2024
Comment threadcompiler/rustc_resolve/src/errors.rs
@rust-log-analyzer

This comment has been minimized.

Comment threadcompiler/rustc_resolve/src/imports.rs Outdated
@frank-king
frank-kingforce-pushed the feature/import_trait_associated_functions branch 2 times, most recently from 8606eb3 to 72bc889CompareDecember 25, 2024 15:16
Comment threadcompiler/rustc_resolve/src/imports.rs Outdated
@frank-king
frank-kingforce-pushed the feature/import_trait_associated_functions branch 2 times, most recently from d79e0e1 to 2427364CompareJanuary 15, 2025 14:51
Comment threadcompiler/rustc_resolve/src/diagnostics.rs
Comment threadtests/ui/resolve/associated-fn-called-as-fn.rs Outdated
Comment threadcompiler/rustc_resolve/src/diagnostics.rs
@rustbotrustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 16, 2025
@frank-king
frank-kingforce-pushed the feature/import_trait_associated_functions branch from 39b3949 to e249e6cCompareJanuary 16, 2025 08:32
@rustbot

Copy link
Copy Markdown
Collaborator

Some changes occurred to the intrinsics. Make sure the CTFE / Miri interpreter
gets adapted for the changes, if necessary.

cc @rust-lang/miri, @rust-lang/wg-const-eval

Some changes occurred to the CTFE / Miri interpreter

cc @rust-lang/miri

Some changes occurred to the CTFE machinery

cc @rust-lang/wg-const-eval

The Miri subtree was changed

cc @rust-lang/miri

@frank-king
frank-kingforce-pushed the feature/import_trait_associated_functions branch from e249e6c to 5079accCompareJanuary 16, 2025 08:34
@oli-obk

Copy link
Copy Markdown
Contributor

@bors r+

@bors

bors commented Jan 16, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit 5079acc has been approved by oli-obk

It is now in the queue for this repository.

@borsbors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 16, 2025
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 16, 2025
…sociated_functions, r=oli-obk
Implement `use` associated items of traits
This PR implements rust-lang#134691.
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 16, 2025
…iaskrgr
Rollup of 7 pull requests
Successful merges:
- rust-lang#133720 ([cfg_match] Adjust syntax)
- rust-lang#134496 (Update documentation for Arc::from_raw, Arc::increment_strong_count, and Arc::decrement_strong_count to clarify allocator requirement)
- rust-lang#134754 (Implement `use` associated items of traits)
- rust-lang#135249 (Fix overflows in the implementation of `overflowing_literals` lint's help)
- rust-lang#135251 (Only treat plain literal patterns as short)
- rust-lang#135556 (Clarify note in `std::sync::LazyLock` example)
- rust-lang#135560 (Update `compiler-builtins` to 0.1.144)
r? `@ghost`
`@rustbot` modify labels: rollup
@matthiaskrgr

Copy link
Copy Markdown
Member

@bors r- #135576 (comment)

@borsbors added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 16, 2025
@fmease

Copy link
Copy Markdown
Member

Hmm, I'm pretty sure that failure is due to #135560 instead.

@bors r=oli-obk

@bors

bors commented Jan 16, 2025

Copy link
Copy Markdown
Collaborator

📌 Commit 5079acc has been approved by oli-obk

It is now in the queue for this repository.

@borsbors 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 16, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 16, 2025
…iaskrgr
Rollup of 7 pull requests
Successful merges:
- rust-lang#134754 (Implement `use` associated items of traits)
- rust-lang#135481 (coverage: Completely overhaul counter assignment, using node-flow graphs)
- rust-lang#135504 (Allow coercing safe-to-call target_feature functions to safe fn pointers)
- rust-lang#135561 (Update docs for `-Clink-dead-code` to discourage its use)
- rust-lang#135574 (ci: mirror ubuntu:22.04 to ghcr.io)
- rust-lang#135585 (resolve symlinks of LLVM tool binaries before copying them)
- rust-lang#135588 (Add license-metadata.json to rustc-src tarball.)
r? `@ghost`
`@rustbot` modify labels: rollup
@bors
bors merged commit 62d0f45 into rust-lang:masterJan 17, 2025
@rustbotrustbot added this to the 1.86.0 milestone Jan 17, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Jan 17, 2025
Rollup merge of rust-lang#134754 - frank-king:feature/import_trait_associated_functions, r=oli-obk
Implement `use` associated items of traits
This PR implements rust-lang#134691.
m-ou-se added a commit to m-ou-se/rust that referenced this pull request Apr 3, 2025
unstable book: document import_trait_associated_functions
Documents rust-lang#134691 which was implemented in rust-lang#134754
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 3, 2025
unstable book: document import_trait_associated_functions
Documents rust-lang#134691 which was implemented in rust-lang#134754
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Apr 3, 2025
Rollup merge of rust-lang#139149 - mejrs:itaf, r=ehuss
unstable book: document import_trait_associated_functions
Documents rust-lang#134691 which was implemented in rust-lang#134754
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request May 3, 2025
resolve: Support imports of associated types and glob imports from traits
Follow up to rust-lang#134754, part of rust-lang#134691.
This PR also closesrust-lang#138711 now.
Prohibiting `use Trait::AssocType;` at name resolution stage doesn't make sense, the name itself is perfectly resolveable.
It's a type checker's problem that the necessary generic args are not passed when the imported `AssocType` is used, so an error should be reported there.
And since we can import associated trait items now, glob imports from traits can also be allowed.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 3, 2025
Rollup merge of rust-lang#138712 - petrochenkov:impasst, r=fmease
resolve: Support imports of associated types and glob imports from traits
Follow up to rust-lang#134754, part of rust-lang#134691.
This PR also closesrust-lang#138711 now.
Prohibiting `use Trait::AssocType;` at name resolution stage doesn't make sense, the name itself is perfectly resolveable.
It's a type checker's problem that the necessary generic args are not passed when the imported `AssocType` is used, so an error should be reported there.
And since we can import associated trait items now, glob imports from traits can also be allowed.
@fmeasefmease added the F-import_trait_associated_functions `#![feature(import_trait_associated_functions)]` label Oct 22, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-import_trait_associated_functions`#![feature(import_trait_associated_functions)]`S-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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.

9 participants

@frank-king@rustbot@rust-log-analyzer@jieyouxu@oli-obk@bors@matthiaskrgr@fmease@petrochenkov