Skip to content

RFC: Exports on individual items (pub and priv) #1893

Closed
@pcwalton

Description

@pcwalton

Instead of export lists, we could have exports on individual items.

So, instead of:

fn foo() { ... }
export foo;

We would have:

pub fn foo() { ... }

And instead of:

import foo::bar;
export bar;

We would have:

pub import foo::bar;

(Here I changed export to pub to better match classes and to avoid exceeding the 5-character limit, but I'm ok either way.)

This change would help avoid the pain of managing export lists and should make libraries easier to write. Often people look at the definitions of items and want to know then and there whether the item is public or not.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions