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

Misleading resolve error with multiple imports #2914

Closed
brson opened this issue Jul 14, 2012 · 2 comments
Closed

Misleading resolve error with multiple imports #2914

brson opened this issue Jul 14, 2012 · 2 comments
Labels
A-resolve Area: Name resolution
Milestone

Comments

@brson
Copy link
Contributor

brson commented Jul 14, 2012

When there is a single import statement that imports multiple idents, and one of them is not found, then the resulting error points to the use site, not the import site.

import http_parser::{http_parser, http_parser_settings, http_parser_execute}; // http_parser_execute is not in the http_parser module

....

http_parser_execute(addr_of(self.parser));
./parser.rs:68:12: 68:31 error: unresolved name: http_parser_execute
./parser.rs:68             http_parser_execute(addr_of(self.parser),
@burg
Copy link

burg commented Sep 5, 2012

This seems to be fixed, but now the error doesn't specify which imported ident is missing, and there may be duplicates for the same missing symbol. I suppose these should be squashed.

/Users/burg/repos/servo/src/rust-http-client/connection.rs:2:7: 2:59 error: failed to resolve import
/Users/burg/repos/servo/src/rust-http-client/connection.rs:2 import std::net::tcp::{tcp_err_data, tcp_connect_err_data};
                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/burg/repos/servo/src/rust-http-client/connection.rs:2:7: 2:59 error: failed to resolve import
/Users/burg/repos/servo/src/rust-http-client/connection.rs:2 import std::net::tcp::{tcp_err_data, tcp_connect_err_data};
                                                                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Dretch pushed a commit to Dretch/rust that referenced this issue Dec 29, 2012
which import it actually was. This makes debugging imports
like: use aa::{x, y, z} easier (for issue rust-lang#2914).
catamorphism added a commit that referenced this issue Dec 30, 2012
@pnkfelix
Copy link
Member

This seems fixed to me. (If you encounter counter-evidence, please reopen, but also throw in the counter-example for us to use for regression test.)

bors pushed a commit to rust-lang-ci/rust that referenced this issue May 15, 2021
RalfJung pushed a commit to RalfJung/rust that referenced this issue Jun 3, 2023
add unchecked_shl test

rust-lang#112238  made me realize that we have a test for add,sub,mul,shr but not shl. Add the missing test. Also name the existing tests more consistently.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-resolve Area: Name resolution
Projects
None yet
Development

No branches or pull requests

3 participants