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

Regression: a module named `std` has already been imported in this module [E0252] #30089

Closed
briansmith opened this Issue Nov 28, 2015 · 5 comments

Comments

Projects
None yet
5 participants
@briansmith
Copy link

briansmith commented Nov 28, 2015

See https://travis-ci.org/briansmith/ring/jobs/91080822

Relevant build output:

src/file_test.rs:17:5: 17:8 error: a module named `std` has already been imported in this module [E0252]
src/file_test.rs:17 use std;
                        ^~~
src/file_test.rs:17:5: 17:8 help: run `rustc --explain E0252` to see a detailed explanation
src/file_test.rs:16:1: 16:14 note: previous import of `std` here
src/file_test.rs:16 use super::*;

This code built fine on Nightly last week. It still build correctly on Beta and Release; see https://travis-ci.org/briansmith/ring/builds/91080819.

The code in question is:

use rustc_serialize::hex::FromHex;
use super::*;
use std;
use std::io::BufRead;

You can try it by cloning https://github.com/briansmith/ring, revision ee3ff646962e4a4933eaabb50c76f196521fd592.

@briansmith

This comment has been minimized.

Copy link
Author

briansmith commented Nov 28, 2015

Replacing the use super::*; with use super::digest; worked around the issue.

@alexcrichton

This comment has been minimized.

Copy link
Member

alexcrichton commented Nov 30, 2015

Minimized:

mod foo {        
    use std;     
    use super::*;
}                
fn main() {}                

Happened between 2ba4460 (2015-11-23 nightly) and a9d15a6 (2015-11-24 nightly), the cluprit of which is likely #29530.

cc @nikomatsakis, @jseyfried, perhaps something leaked in by accident? Either that or perhaps that's the wrong PR?

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Nov 30, 2015

Yes, seems very likely that this is caused by that PR. @jseyfried, please let me know if you have time to look into this. I fear I do not have cycles to spare to find a more tailored fix, so otherwise we may want to just pull the PR and rebase it. That said, the problem is presumably some interaction with the injection of the standard prelude, and I guess the (implicit) extern crate that is added there?

@jseyfried jseyfried referenced this issue Dec 1, 2015

Merged

Fixes #30089 #30133

jseyfried added a commit to jseyfried/rust that referenced this issue Dec 1, 2015

@jseyfried

This comment has been minimized.

Copy link
Contributor

jseyfried commented Dec 1, 2015

#29530 caused it, sorry about that. I explained and fixed the regression in PR #30133.

@jseyfried

This comment has been minimized.

Copy link
Contributor

jseyfried commented Dec 2, 2015

@bors bors closed this in 4da9694 Dec 2, 2015

mitaa added a commit to mitaa/rust that referenced this issue Dec 2, 2015

mitaa added a commit to mitaa/rust that referenced this issue Dec 2, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.