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

Remove need for extern crate in 2018 Edition crates #150

Open
sunjay opened this issue Dec 9, 2018 · 3 comments
Open

Remove need for extern crate in 2018 Edition crates #150

sunjay opened this issue Dec 9, 2018 · 3 comments

Comments

@sunjay
Copy link

sunjay commented Dec 9, 2018

The Rust 2018 edition removes the need for extern crate, but I still find myself needing to add it to my test files in order to get compiletest working. Is there a way to remove those?

@laumann
Copy link
Collaborator

laumann commented Dec 9, 2018 via email

@sunjay
Copy link
Author

sunjay commented Dec 24, 2018

Hi, sorry for the delay. My code is finally public and I can share it now. If you remove the extern crate lines from my compile tests, the tests fail to compile.

Project is here: https://github.com/sunjay/component_group

@dtolnay
Copy link
Contributor

dtolnay commented Jan 13, 2019

Here is how I set up 2018 edition ui tests in tt-call:

#[test]
fn ui() {
    let mut config = compiletest::Config {
        mode: compiletest::common::Mode::Ui,
        src_base: std::path::PathBuf::from("cases"),
        target_rustcflags: Some(String::from(
            "\
             --edition=2018 \
             -Z unstable-options \
             --extern tt_call \
             ",
        )),
        ..Default::default()
    };

    config.link_deps();
    config.clean_rmeta();

    compiletest::run_tests(&config);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants