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

Show Trait instead of <Struct as Trait> in E0323 #38065

Merged
merged 1 commit into from
Dec 4, 2016

Conversation

estebank
Copy link
Contributor

For a given file

trait Foo {
    fn bar(&self);
}

pub struct FooConstForMethod;

impl Foo for FooConstForMethod {
    const bar: u64 = 1;
}

show

error[E0323]: item `bar` is an associated const, which doesn't match its trait `Foo`

instead of

error[E0323]: item `bar` is an associated const, which doesn't match its trait `<FooConstForMethod as Foo>`

Fix #37618

For a given file

```
trait Foo {
    fn bar(&self);
}

pub struct FooConstForMethod;

impl Foo for FooConstForMethod {
    const bar: u64 = 1;
}
```

show

```
error[E0323]: item `bar` is an associated const, which doesn't match its trait `Foo`
```

instead of

```
error[E0323]: item `bar` is an associated const, which doesn't match its trait `<FooConstForMethod as Foo>`
```
@rust-highfive
Copy link
Collaborator

r? @arielb1

(rust_highfive has picked a reviewer for you, use r? to override)

@estebank
Copy link
Contributor Author

/cc @nikomatsakis as per your comment in a previous PR

Not related to this PR, I think, but this text "<FooConstForMethod as Foo>" seems pretty funny to me; I expect to see just Foo... is there an open issue on that?

Now there is one and here's the fix.

@estebank
Copy link
Contributor Author

estebank commented Dec 1, 2016

r? @jonathandturner

@rust-highfive rust-highfive assigned sophiajt and unassigned arielb1 Dec 1, 2016
@sophiajt
Copy link
Contributor

sophiajt commented Dec 1, 2016

Yeah, looks cleaner to me.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Dec 1, 2016

📌 Commit 4226930 has been approved by jonathandturner

frewsxcv added a commit to frewsxcv/rust that referenced this pull request Dec 3, 2016
Show `Trait` instead of `<Struct as Trait>` in E0323

For a given file

```
trait Foo {
    fn bar(&self);
}

pub struct FooConstForMethod;

impl Foo for FooConstForMethod {
    const bar: u64 = 1;
}
```

show

```
error[E0323]: item `bar` is an associated const, which doesn't match its trait `Foo`
```

instead of

```
error[E0323]: item `bar` is an associated const, which doesn't match its trait `<FooConstForMethod as Foo>`
```

Fix rust-lang#37618
bors added a commit that referenced this pull request Dec 3, 2016
Rollup of 15 pull requests

- Successful merges: #37859, #37919, #38020, #38028, #38029, #38065, #38073, #38077, #38089, #38090, #38096, #38112, #38113, #38130, #38141
- Failed merges:
@bors bors merged commit 4226930 into rust-lang:master Dec 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants