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

Document deprecation of anon params #105

Merged
merged 2 commits into from
Sep 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
- [`dyn Trait` for trait objects](rust-2018/trait-system/dyn-trait-for-trait-objects.md)
- [More container types support trait objects](rust-2018/trait-system/more-container-types-support-trait-objects.md)
- [Associated constants](rust-2018/trait-system/associated-constants.md)
- [No more anonymous parameters](rust-2018/trait-system/no-anon-params.md)
- [Slice patterns](rust-2018/slice-patterns.md)
- [Ownership and lifetimes](rust-2018/ownership-and-lifetimes/index.md)
- [Default `match` bindings](rust-2018/ownership-and-lifetimes/default-match-bindings.md)
Expand Down
20 changes: 20 additions & 0 deletions src/rust-2018/trait-system/no-anon-params.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# No more anonymous trait parameters

In accordance with RFC [#1685](https://github.com/rust-lang/rfcs/pull/1685),
parameters in trait method declarations are no longer allowed to be anonymous.

For example, in the 2015 edition, this was allowed:
```rust
trait Foo {
fn foo(&self, u8);
}
```

In the 2018 edition, all parameters must be given an argument name (even if it's just
`_`):

```rust
trait Foo {
fn foo(&self, baz: u8);
}
```