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

Add note for possible crate mismatches in type errors #28300

Merged
merged 6 commits into from Sep 9, 2015

Conversation

Projects
None yet
4 participants
@Manishearth
Member

Manishearth commented Sep 8, 2015

Partially fixes #22750

I'll write a test for this when I figure out how to.

r? @eddyb

cc @steveklabnik

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.

@steveklabnik

steveklabnik Sep 8, 2015

Member

IIRC all FIXMEs should have an associated issue

This comment has been minimized.

@Manishearth

Manishearth Sep 8, 2015

Member

fixed, it's the same bug (since this is only a partial fix)

@steveklabnik

This comment has been minimized.

Member

steveklabnik commented Sep 8, 2015

So excited for this patch to land!

The messages look good to me.

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.

@eddyb

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

//~^^ 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.

@eddyb

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.

@Manishearth
@eddyb

This comment has been minimized.

Member

eddyb commented Sep 8, 2015

@bors r+

@bors

This comment has been minimized.

Contributor

bors commented Sep 8, 2015

📌 Commit c65d338 has been approved by eddyb

@bors

This comment has been minimized.

Contributor

bors commented Sep 9, 2015

⌛️ Testing commit c65d338 with merge 7c8ae60...

bors added a commit that referenced this pull request Sep 9, 2015

Auto merge of #28300 - Manishearth:crate_err, r=eddyb
Partially fixes #22750

I'll write a test for this when I figure out how to.

r? @eddyb

cc @steveklabnik

@bors bors merged commit c65d338 into rust-lang:master Sep 9, 2015

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details

@bors bors referenced this pull request Sep 9, 2015

Merged

Begin splitting middle::ty #28274

@Manishearth Manishearth deleted the Manishearth:crate_err branch Dec 2, 2016

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