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
Labels
A-resolve Area: Name resolution regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@briansmith
Copy link
Contributor

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.

@sfackler sfackler added regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. A-resolve Area: Name resolution labels Nov 28, 2015
@briansmith
Copy link
Contributor Author

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

@alexcrichton
Copy link
Member

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?

@alexcrichton alexcrichton added I-nominated T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 30, 2015
@nikomatsakis
Copy link
Contributor

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 added a commit to jseyfried/rust that referenced this issue Dec 1, 2015
@jseyfried
Copy link
Contributor

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

@jseyfried
Copy link
Contributor

cc @alexcrichton @nikomatsakis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name resolution regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants