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

Error messages don't follow style convention of Trait<Type = T> #40641

Closed
clarfonthey opened this issue Mar 18, 2017 · 4 comments
Closed

Error messages don't follow style convention of Trait<Type = T> #40641

clarfonthey opened this issue Mar 18, 2017 · 4 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one.

Comments

@clarfonthey
Copy link
Contributor

clarfonthey commented Mar 18, 2017

Currently, rustfmt modifies these statements to include a space around the equal sign, but error messages don't do this. I'd appreciate if this were changed to follow rustfmt because I use Fira Code which converts =< into a ligature for , and statements like the below format awkwardly:

std::ops::Index<std::ops::RangeFrom<usize>, Output=<T as strlike::StrLike>::Data>

@GuillaumeGomez
Copy link
Member

Fixing it.

@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Mar 20, 2017

Actually that'd be nice to have an error code to starting working on (so that I can get a start point to fix others as well).

@GuillaumeGomez
Copy link
Member

I did it first in rustdoc.

frewsxcv added a commit to frewsxcv/rust that referenced this issue Mar 22, 2017
…ype-formatting, r=frewsxcv

Add whitespace around "=" in assoc items

Part of rust-lang#40641.

r? @rust-lang/docs

Before:

<img width="1440" alt="screen shot 2017-03-20 at 22 42 34" src="https://cloud.githubusercontent.com/assets/3050060/24123102/89181d8c-0dbe-11e7-897c-841497cf7001.png">

After:

<img width="1440" alt="screen shot 2017-03-20 at 22 42 36" src="https://cloud.githubusercontent.com/assets/3050060/24123118/8dec176e-0dbe-11e7-9759-cabbd062a4c2.png">
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Mar 22, 2017
…ype-formatting, r=frewsxcv

Add whitespace around "=" in assoc items

Part of rust-lang#40641.

r? @rust-lang/docs

Before:

<img width="1440" alt="screen shot 2017-03-20 at 22 42 34" src="https://cloud.githubusercontent.com/assets/3050060/24123102/89181d8c-0dbe-11e7-897c-841497cf7001.png">

After:

<img width="1440" alt="screen shot 2017-03-20 at 22 42 36" src="https://cloud.githubusercontent.com/assets/3050060/24123118/8dec176e-0dbe-11e7-9759-cabbd062a4c2.png">
frewsxcv added a commit to frewsxcv/rust that referenced this issue Mar 22, 2017
…ype-formatting, r=frewsxcv

Add whitespace around "=" in assoc items

Part of rust-lang#40641.

r? @rust-lang/docs

Before:

<img width="1440" alt="screen shot 2017-03-20 at 22 42 34" src="https://cloud.githubusercontent.com/assets/3050060/24123102/89181d8c-0dbe-11e7-897c-841497cf7001.png">

After:

<img width="1440" alt="screen shot 2017-03-20 at 22 42 36" src="https://cloud.githubusercontent.com/assets/3050060/24123118/8dec176e-0dbe-11e7-9759-cabbd062a4c2.png">
@Mark-Simulacrum Mark-Simulacrum added the A-diagnostics Area: Messages for errors, warnings, and lints label Jun 13, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-enhancement Category: An issue proposing an enhancement or a PR with one. label Jul 26, 2017
@clarfonthey
Copy link
Contributor Author

So I actually don't remember what specific errors this was for, but on the latest nightly:

trait Test {
    type Assoc;
}
impl<T> Test for [T] {
    type Assoc = T;
}
fn test<T: Test<Assoc = u8>>(iter: &T) {}

fn main() {
    test(&[0i32][..])
}

I get:

...
error[E0271]: type mismatch resolving `<[i32] as Test>::Assoc == u8`
...

So I'm going to close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints C-enhancement Category: An issue proposing an enhancement or a PR with one.
Projects
None yet
Development

No branches or pull requests

3 participants