Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd note for possible crate mismatches in type errors #28300
Conversation
Manishearth
added some commits
Sep 8, 2015
rust-highfive
assigned
eddyb
Sep 8, 2015
steveklabnik
reviewed
Sep 8, 2015
| self.tcx.sess.note("errrr0"); | ||
| report_path_match(exp_found.expected, exp_found.found); | ||
| }, | ||
| _ => () // FIXME(Manishearth) handle traits and stuff |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
So excited for this patch to land! The messages look good to me. |
eddyb
reviewed
Sep 8, 2015
| let report_path_match = |did1: DefId, did2: DefId| { | ||
| // Only external crates, if either is from a local | ||
| // module we could have false positives | ||
| if !(did1.is_local() || did2.is_local()) { |
This comment has been minimized.
This comment has been minimized.
eddyb
Sep 8, 2015
Member
You should check that the crates are different - for example:
fn main() {
let _ = [{struct Foo; Foo}, {struct Foo; Foo}];
}The error in the above code will see the path "main::Foo" for both of the two different types.
Manishearth
added some commits
Sep 8, 2015
eddyb
reviewed
Sep 8, 2015
| //~^^ NOTE Perhaps two different versions of crate `main` | ||
| a::try_bar(bar2); //~ ERROR mismatched types | ||
| //~^ HELP run | ||
| //~^^ NOTE Perhaps two different versions of crate `main` |
This comment has been minimized.
This comment has been minimized.
eddyb
Sep 8, 2015
Member
You'll want to look up the crate names from the crate numbers in the DefIds (and/or find the subset of the path which refers to the extern crate item).
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
added a commit
that referenced
this pull request
Sep 9, 2015
This comment has been minimized.
This comment has been minimized.
bors
merged commit c65d338
into
rust-lang:master
Sep 9, 2015
Manishearth
referenced this pull request
Sep 9, 2015
Open
Two different versions of a crate interacting leads to unhelpful error messages #22750
Manishearth
deleted the
Manishearth:crate_err
branch
Dec 2, 2016
xd009642
referenced this pull request
Jun 9, 2018
Open
E0599 message could be improved for crate version mismatches. #51458
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Manishearth commentedSep 8, 2015
Partially fixes #22750
I'll write a test for this when I figure out how to.
r? @eddyb
cc @steveklabnik