Skip to content

allow use self with globs #1290

Closed
Closed
@mdinger

Description

@mdinger

Importing all the subnames of a module is easily done with globs but if you also want to import the module, then you need 2 separate lines to do so:

use my_mod::*;
use my_mod;

Without globs it's not an issues:

use my_mod::{self, foo, bar, baz};

It would be convenient to allow globs to import the module on the same line as well. Here are some possible syntaxes which (I think) could be understandable:

use my_mod::{self, *};
use my_mod::+;

+ is mainly because * and + are common with globs. + typically means one or more while * is any number of elements so they aren't exactly similar but it doesn't seem too unusual.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-langRelevant to the language team, which will review and decide on the RFC.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions