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

E0131 needs to be updated to new format #35257

Closed
sophiajt opened this issue Aug 3, 2016 · 10 comments
Closed

E0131 needs to be updated to new format #35257

sophiajt opened this issue Aug 3, 2016 · 10 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

Comments

@sophiajt
Copy link
Contributor

sophiajt commented Aug 3, 2016

From:

Error E0131 needs a span_label, updating it from:

error[E0131]: main function is not allowed to have type parameters
  --> src/test/compile-fail/E0131.rs:11:1
   |
11 | fn main<T>() { //~ ERROR E0131
   | ^

To:

error[E0131]: main function is not allowed to have type parameters
  --> src/test/compile-fail/E0131.rs:11:1
   |
11 | fn main<T>() { //~ ERROR E0131
   | ^ main cannot have type parameters

Bonus: underline the type parameters directly

error[E0131]: main function is not allowed to have type parameters
  --> src/test/compile-fail/E0131.rs:11:1
   |
11 | fn main<T>() { //~ ERROR E0131
   |        ^^^ main cannot have type parameters
@sophiajt sophiajt added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. A-diagnostics Area: Messages for errors, warnings, and lints E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Aug 3, 2016
@Limeth
Copy link

Limeth commented Aug 4, 2016

I am working on this one.

@Limeth
Copy link

Limeth commented Aug 4, 2016

I need some help, I cannot get the label to display in the compilation error. I've asked around in #rust-internals, nobody answered apart from @TheZoq2 who seems to be experiencing the same problem and is looking for a solution too.
This is my code, where it doesn't work: Limeth@56c54cf#diff-34daa37d4433b778139b9c3bb583756bR269
This is someone else's code, where it does work: https://github.com/rust-lang/rust/pull/35288/files#diff-1d1b0d29a2e8da97c6bfb6e364d920c7R3397
@jonathandturner @GuillaumeGomez

@GuillaumeGomez
Copy link
Member

GuillaumeGomez commented Aug 4, 2016

@Limeth: You can take a look to #35264. It's very similar to this one.

@Limeth
Copy link

Limeth commented Aug 4, 2016

@GuillaumeGomez You did? I thought you had taken E0132 instead.

E0131 🔒 @Limeth
E0132 🔒 @GuillaumeGomez

@GuillaumeGomez
Copy link
Member

@Limeth: Yes sorry, when I have read the description, I thought it was the one I did because they're very close. I updated my comment.

@Limeth Limeth mentioned this issue Aug 4, 2016
@leikahing
Copy link
Contributor

@Limeth are you not seeing the messages show up next to the span? If so, can you try running your rustc like this?

RUST_NEW_ERROR_FORMAT=true ./build/PLATFORM-HERe/stage1/bin/rustc src/test/compile-fail/E0131.rs

I ran into the same issue - the new formatting and span labels aren't enabled by default yet.

@TheZoq2
Copy link
Contributor

TheZoq2 commented Aug 4, 2016

That made it work for me @birryree

@Limeth
Copy link

Limeth commented Aug 4, 2016

Yes, that was the reason. Thank you, @birryree!

@Limeth
Copy link

Limeth commented Aug 4, 2016

We've implemented essentially the same thing with @GuillaumeGomez in two separate PRs. I am now waiting for his PR to get merged, so we both can use the same implementation.
#35264

@GuillaumeGomez
Copy link
Member

@Limeth: It should be merged in no time. Just hold on a bit more!

sophiajt pushed a commit to sophiajt/rust that referenced this issue Aug 7, 2016
E0131 updated to new format

Changes
```
error[E0131]: main function is not allowed to have type parameters
  --> src/test/compile-fail/E0131.rs:11:1
   |
11 | fn main<T>() { //~ ERROR E0131
   | ^
```
to
```
error[E0131]: main function is not allowed to have type parameters
  --> src/test/compile-fail/E0131.rs:11:1
   |
11 | fn main<T>() { //~ ERROR E0131
   |        ^^^ main cannot have type parameters
```
Fixes rust-lang#35257. Part of rust-lang#35233.
r? @jonathandturner
sophiajt pushed a commit to sophiajt/rust that referenced this issue Aug 7, 2016
E0131 updated to new format

Changes
```
error[E0131]: main function is not allowed to have type parameters
  --> src/test/compile-fail/E0131.rs:11:1
   |
11 | fn main<T>() { //~ ERROR E0131
   | ^
```
to
```
error[E0131]: main function is not allowed to have type parameters
  --> src/test/compile-fail/E0131.rs:11:1
   |
11 | fn main<T>() { //~ ERROR E0131
   |        ^^^ main cannot have type parameters
```
Fixes rust-lang#35257. Part of rust-lang#35233.
r? @jonathandturner
sophiajt pushed a commit to sophiajt/rust that referenced this issue Aug 7, 2016
E0131 updated to new format

Changes
```
error[E0131]: main function is not allowed to have type parameters
  --> src/test/compile-fail/E0131.rs:11:1
   |
11 | fn main<T>() { //~ ERROR E0131
   | ^
```
to
```
error[E0131]: main function is not allowed to have type parameters
  --> src/test/compile-fail/E0131.rs:11:1
   |
11 | fn main<T>() { //~ ERROR E0131
   |        ^^^ main cannot have type parameters
```
Fixes rust-lang#35257. Part of rust-lang#35233.
r? @jonathandturner
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 E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
Projects
None yet
Development

No branches or pull requests

5 participants