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 updated to new format #35417

Merged
merged 1 commit into from
Aug 7, 2016
Merged

E0131 updated to new format #35417

merged 1 commit into from
Aug 7, 2016

Conversation

Limeth
Copy link

@Limeth Limeth commented Aug 6, 2016

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 #35257. Part of #35233.
r? @jonathandturner

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @jonathandturner (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

"main function is not allowed to have type parameters");
return;
hir::ItemFn(_, _, _, _, ref generics, _) => {
let gen_span = generics.span();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if i can comment but:

if let Some(gen_span) = generics.span() {
// struct_span_err!..
}

No need for the return too I think

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't add it, it was there originally.

@sophiajt
Copy link
Contributor

sophiajt commented Aug 6, 2016

Thanks for the PR!

I put a code style comment in, which will help others read the code better.

One other thing: please include a unit test that tests for this new label. You can either update the src/test/compile-fail/E0131.rs test with the new NOTE (I show how in the blog post). Even better than that, though, is to add a new test in src/test/ui. Here you can actually test the new label span. If you look through the directory, specifically src/test/ui/codemap_tests you can see how it's done. Just a simple test and then a corresponding .stderr file. This is just a copy/paste from the compiler output.

@Limeth
Copy link
Author

Limeth commented Aug 6, 2016

Should be good to go, thanks for the patience!
edit: misclicked

@Limeth Limeth closed this Aug 6, 2016
@Limeth Limeth reopened this Aug 6, 2016
@sophiajt
Copy link
Contributor

sophiajt commented Aug 6, 2016

@Limeth - great, thanks for fixing it. One last thing, can you squash your 7 commits down to 1 commit?

@Limeth
Copy link
Author

Limeth commented Aug 6, 2016

Cloned a fresh repository, copied over the changes and compiled it again. Took a while, but here it is. I don't know if there is a faster way.

@sophiajt
Copy link
Contributor

sophiajt commented Aug 6, 2016

Phew, yeah, that's probably the hard way. The easier way is to do something like this. I tend to do it after I've done a rebase, so my changes are at the top, I do a git reset to the commit before my changes, then I can git commit -a -m "<my one commit comment>" all my changes together.

Thanks for squashing it.

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Aug 6, 2016

📌 Commit 5e06da2 has been approved by jonathandturner

sophiajt pushed a commit to sophiajt/rust that referenced this pull request 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 pull request 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 pull request 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
bors added a commit that referenced this pull request Aug 7, 2016
@bors bors merged commit 5e06da2 into rust-lang:master Aug 7, 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