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

Small tweaks to errors for chained comparisons #21079

Merged
merged 2 commits into from
Jan 24, 2015

Conversation

huonw
Copy link
Member

@huonw huonw commented Jan 13, 2015

First commit is mindless groundwork for the second one, to make the spans (arguably) nicer.

before

require-parens-for-chained-comparison.rs:14:20: 14:22 error: Chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:14     false == false == false;
                                                               ^~
require-parens-for-chained-comparison.rs:17:16: 17:17 error: Chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:17     false == 0 < 2;
                                                           ^
require-parens-for-chained-comparison.rs:20:8: 20:9 error: Chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:20     f<X>();
                                                   ^
require-parens-for-chained-comparison.rs:20:8: 20:9 help: Use ::< instead of < if you meant to specify type arguments.
require-parens-for-chained-comparison.rs:20     f<X>();
                                                   ^

after

require-parens-for-chained-comparison.rs:14:11: 14:22 error: chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:14     false == false == false;
                                                      ^~~~~~~~~~~
require-parens-for-chained-comparison.rs:17:11: 17:17 error: chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:17     false == 0 < 2;
                                                      ^~~~~~
require-parens-for-chained-comparison.rs:20:6: 20:9 error: chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:20     f<X>();
                                                 ^~~
require-parens-for-chained-comparison.rs:20:6: 20:9 help: use `::<...>` instead of `<...>` if you meant to specify type arguments
require-parens-for-chained-comparison.rs:20     f<X>();
                                                 ^~~

@rust-highfive
Copy link
Contributor

r? @pnkfelix

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

@huonw huonw force-pushed the chained-cmp-tweaks branch from 23fdf73 to 4aaa50d Compare January 13, 2015 05:44
@nrc
Copy link
Member

nrc commented Jan 13, 2015

testing, sorry for the noise:

r? @nick29581

@nrc
Copy link
Member

nrc commented Jan 13, 2015

r? @nick29581

@rust-highfive rust-highfive assigned nrc and unassigned pnkfelix Jan 13, 2015
@nrc
Copy link
Member

nrc commented Jan 13, 2015

\o/ it worked, now back to felix: r? @pnkfelix

@rust-highfive rust-highfive assigned pnkfelix and unassigned nrc Jan 13, 2015
@Manishearth
Copy link
Member

❤️

Forgetting the :: is a common beginner mistake

@pnkfelix
Copy link
Member

@bors: r+ 4aaa50d

@frewsxcv
Copy link
Member

Needs a rebase

huonw added 2 commits January 25, 2015 00:33
Lower case and give a more precise span: from operator to operator, not
just the last one.
@huonw huonw force-pushed the chained-cmp-tweaks branch from 4aaa50d to ec790d6 Compare January 24, 2015 13:35
@huonw
Copy link
Member Author

huonw commented Jan 24, 2015

@bors: r=pnkfelix ec790d6

@bors
Copy link
Collaborator

bors commented Jan 24, 2015

⌛ Testing commit ec790d6 with merge 76fbb35...

bors added a commit that referenced this pull request Jan 24, 2015
First commit is mindless groundwork for the second one, to make the spans (arguably) nicer.

### before

```
require-parens-for-chained-comparison.rs:14:20: 14:22 error: Chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:14     false == false == false;
                                                               ^~
require-parens-for-chained-comparison.rs:17:16: 17:17 error: Chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:17     false == 0 < 2;
                                                           ^
require-parens-for-chained-comparison.rs:20:8: 20:9 error: Chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:20     f<X>();
                                                   ^
require-parens-for-chained-comparison.rs:20:8: 20:9 help: Use ::< instead of < if you meant to specify type arguments.
require-parens-for-chained-comparison.rs:20     f<X>();
                                                   ^
```

### after

```
require-parens-for-chained-comparison.rs:14:11: 14:22 error: chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:14     false == false == false;
                                                      ^~~~~~~~~~~
require-parens-for-chained-comparison.rs:17:11: 17:17 error: chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:17     false == 0 < 2;
                                                      ^~~~~~
require-parens-for-chained-comparison.rs:20:6: 20:9 error: chained comparison operators require parentheses
require-parens-for-chained-comparison.rs:20     f<X>();
                                                 ^~~
require-parens-for-chained-comparison.rs:20:6: 20:9 help: use `::<...>` instead of `<...>` if you meant to specify type arguments
require-parens-for-chained-comparison.rs:20     f<X>();
                                                 ^~~
```
@bors bors merged commit ec790d6 into rust-lang:master Jan 24, 2015
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.

7 participants