Skip to content

Tracking Issue for RFC 3591: useing a function from a trait #134691

Open
@clubby789

Description

@clubby789
Contributor

This is a tracking issue for the RFC "Add support for use Trait::func" (rust-lang/rfcs#3591).
The feature gate for the issue is #![feature(import_trait_associated_functions)].

About tracking issues

Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.

Steps

Unresolved Questions

Implementation history

Activity

added
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
on Dec 23, 2024
added
B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.
T-langRelevant to the language team
on Dec 23, 2024
crumblingstatue

crumblingstatue commented on Dec 23, 2024

@crumblingstatue
Contributor

Might be worth noting that there is an orthogonal implementation of using a trait function through the unstable fn_delegation feature.

#![feature(fn_delegation)]

reuse Default::default;

fn main() {
    let s: i32 = default();
    dbg!(s);
}

Although my understanding is that this is just some kind of experiment, and will not be stabilized?
Might be worth taking a look at the implementation though.

added 2 commits that reference this issue on Jan 16, 2025

Rollup merge of rust-lang#134754 - frank-king:feature/import_trait_as…

7dce295

Rollup merge of rust-lang#134754 - frank-king:feature/import_trait_as…

62d0f45
added a commit that references this issue on Jan 17, 2025
added a commit that references this issue on Apr 3, 2025

Rollup merge of rust-lang#139149 - mejrs:itaf, r=ehuss

2f34cdd
added a commit that references this issue on Apr 3, 2025

Rollup merge of rust-lang#139149 - mejrs:itaf, r=ehuss

ee56188
added a commit that references this issue on Apr 3, 2025
joshtriplett

joshtriplett commented on Apr 29, 2025

@joshtriplett
Member

We were discussing this feature in a @rust-lang/libs-api meeting. We were wondering if the infrastructure that enables this feature would make it straightforward to provide a (separate) feature allowing use of an inherent function or associated constant/type from a concrete type.

10 remaining items

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.T-langRelevant to the language team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @joshtriplett@crumblingstatue@obsgolem@petrochenkov@clubby789

        Issue actions

          Tracking Issue for RFC 3591: `use`ing a function from a trait · Issue #134691 · rust-lang/rust