Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only export items marked as pub in the root module #148

Merged
merged 3 commits into from
Oct 11, 2020
Merged

Conversation

udoprog
Copy link
Collaborator

@udoprog udoprog commented Oct 11, 2020

This is the final module change for now, and it's a pretty big one.

Previously, Rune programs could look like this:

fn main() {
    println!("Hello World!");
}

Now this will no longer work, since main is not exported. Exports are instead determined by root level items which are marked with pub. This include re-exports. So to make the above work you'd have to do:

pub fn main() {
    println!("Hello World!");
}

But you could also do:

mod inner {
    fn func() {
        println!("Hello World!");
    }
}

pub use self::inner::func as main;

@udoprog udoprog added the enhancement New feature or request label Oct 11, 2020
@udoprog udoprog merged commit fabeac4 into master Oct 11, 2020
@udoprog udoprog deleted the export-pub branch October 11, 2020 19:12
@udoprog udoprog added the changelog Issue has been added to the changelog label Oct 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog Issue has been added to the changelog enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant