mozilla/rust — Issue #1893: Exports on individual items
Author: pcwalton
Created: 2012-02-23 20:43:37+00:00
State: open
Labels: B-RFC

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 f;
export f;

We would have:

pub import f;

(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.