Skip to content

Add E0327, E0395 and E0396 error explanations #26542

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

Merged
merged 3 commits into from
Jun 25, 2015

Conversation

GuillaumeGomez
Copy link
Member

No description provided.

@GuillaumeGomez
Copy link
Member Author

r? @Manishearth

@rust-highfive
Copy link
Contributor

r? @alexcrichton

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

@GuillaumeGomez GuillaumeGomez changed the title Add E0395 error explanation Add E0395 and E0396 error explanations Jun 24, 2015
@GuillaumeGomez
Copy link
Member Author

Part of #24407.
cc @michaelsproul

// error: raw pointers cannot be compared in statics!
```

To fix this error, please not assign this value to a constant expression.
Copy link
Contributor

Choose a reason for hiding this comment

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

s/please not/please do not/

@GuillaumeGomez
Copy link
Member Author

Updated!

// error: raw pointers cannot be compared in statics!
```

To fix this error, please do not assign this value to a constant
Copy link
Member

Choose a reason for hiding this comment

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

This is not the fix.

Avoid recommending catchall fixes like this, since they're not applicable to all situations (but the language makes them sound like it)

Mention common causes and suggest fixes for those instead.

@GuillaumeGomez GuillaumeGomez force-pushed the patch-2 branch 2 times, most recently from e724c5c to 5bc4557 Compare June 24, 2015 18:51
@GuillaumeGomez
Copy link
Member Author

@Manishearth: Updated. Does the new message seem good to you ?

@GuillaumeGomez GuillaumeGomez changed the title Add E0395 and E0396 error explanations Add E0327, E0395 and E0396 error explanations Jun 24, 2015
@GuillaumeGomez
Copy link
Member Author

cc @nagisa

@nagisa
Copy link
Member

nagisa commented Jun 24, 2015

Looks OK at a glance.

@GuillaumeGomez
Copy link
Member Author

r+ ?

@@ -1457,6 +1457,42 @@ impl Foo for Bar {
```
"##,

E0327: r##"
You cannot use a method instead of a constant expression as a pattern. Example
Copy link
Member

Choose a reason for hiding this comment

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

Technically, "You cannot use associated items other than constant items as patterns. This includes method items". (methods aren't the only associated items)

@Manishearth
Copy link
Member

r=me post squash

@GuillaumeGomez
Copy link
Member Author

@Manishearth: Yes, sure. Thanks for your help!

@GuillaumeGomez
Copy link
Member Author

@Manishearth: Squashed !

@Manishearth
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Jun 25, 2015

📌 Commit 7b4eb1a has been approved by Manishearth

@bors
Copy link
Collaborator

bors commented Jun 25, 2015

⌛ Testing commit 7b4eb1a with merge 70b2f47...

@bors bors merged commit 7b4eb1a into rust-lang:master Jun 25, 2015
@GuillaumeGomez GuillaumeGomez deleted the patch-2 branch June 26, 2015 10:39
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