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

duplicate definition should report location of the definition #2391

Closed
erickt opened this Issue May 17, 2012 · 4 comments

Comments

Projects
None yet
4 participants
@erickt
Contributor

erickt commented May 17, 2012

I'm running into this error:

./request.rs:1:7: 1:29 error: duplicate definition of type request
./request.rs:1 import mre::request::request;
                      ^~~~~~~~~~~~~~~~~~~~~~

even though I only import mre::request::request once in that file. Perhaps I'm running into a compiler bug, or maybe I just don't quite understand the import rules. So, it would be helpful if the duplicate definition error also reported where rust first found the definition.

@catamorphism

This comment has been minimized.

Show comment
Hide comment
@catamorphism

catamorphism May 17, 2012

Contributor

#2386 is related.

Contributor

catamorphism commented May 17, 2012

#2386 is related.

@nikomatsakis

This comment has been minimized.

Show comment
Hide comment
@nikomatsakis

nikomatsakis May 18, 2012

Contributor

I agree, it should print more details. @erickt likely the problem is an import in an outer scope. Why this is considered an error and not a shadow, I am not precisely sure, but I have seen it happen.

Contributor

nikomatsakis commented May 18, 2012

I agree, it should print more details. @erickt likely the problem is an import in an outer scope. Why this is considered an error and not a shadow, I am not precisely sure, but I have seen it happen.

@gwillen

This comment has been minimized.

Show comment
Hide comment
@gwillen

gwillen Jul 13, 2012

Contributor

I was going to file a bug suggesting that duplicate definition should report more information; specifically, if the duplicate definition is in an impl, rather than just "to_str", I'd like to see "impl to_str of to_str for @t".

But giving me the location would also be good.

Contributor

gwillen commented Jul 13, 2012

I was going to file a bug suggesting that duplicate definition should report more information; specifically, if the duplicate definition is in an impl, rather than just "to_str", I'd like to see "impl to_str of to_str for @t".

But giving me the location would also be good.

@catamorphism

This comment has been minimized.

Show comment
Hide comment
@catamorphism

catamorphism May 22, 2013

Contributor

The error message reports the first definition's span now.

Contributor

catamorphism commented May 22, 2013

The error message reports the first definition's span now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment