From eb0f9ce09a1b16f5f4880d1ba40778dcf3c37dd0 Mon Sep 17 00:00:00 2001 From: Mark Mansi Date: Tue, 18 Sep 2018 12:53:23 -0500 Subject: [PATCH 1/4] add note about breaking change --- src/items/associated-items.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/items/associated-items.md b/src/items/associated-items.md index 9b9903759..707524385 100644 --- a/src/items/associated-items.md +++ b/src/items/associated-items.md @@ -134,6 +134,11 @@ let circle_shape = Circle::new(); let bounding_box = circle_shape.bounding_box(); ``` +> NOTE: Until the 2018 edition, it was possible to declare trait methods with +> anonymous parameters (e.g. `fn foo(u8)`). This was deprecated and disallowed +> in the 2018 edition. All parameters must have an argument name. See [RFC +> 1685](https://github.com/rust-lang/rfcs/pull/1685). + ## Associated Types *Associated types* are [type aliases] associated with another type. Associated From 6d90e656fb0e8e49fafc3e8be83f8925fb14fce8 Mon Sep 17 00:00:00 2001 From: "Havvy (Ryan Scheel)" Date: Thu, 20 Sep 2018 15:38:04 -0700 Subject: [PATCH 2/4] Note -> Edition Difference --- src/items/associated-items.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/items/associated-items.md b/src/items/associated-items.md index 707524385..941af1c8e 100644 --- a/src/items/associated-items.md +++ b/src/items/associated-items.md @@ -134,10 +134,10 @@ let circle_shape = Circle::new(); let bounding_box = circle_shape.bounding_box(); ``` -> NOTE: Until the 2018 edition, it was possible to declare trait methods with -> anonymous parameters (e.g. `fn foo(u8)`). This was deprecated and disallowed -> in the 2018 edition. All parameters must have an argument name. See [RFC -> 1685](https://github.com/rust-lang/rfcs/pull/1685). +> **Edition Differences**: Until the 2018 edition, it was possible to declare +> trait methods with anonymous parameters (e.g. `fn foo(u8)`). This was +> deprecated and disallowed in the 2018 edition. All parameters must have an +> argument name. See [RFC 1685](https://github.com/rust-lang/rfcs/pull/1685). ## Associated Types From b5131cc1353b98675d93d62b94d64af04d1d904d Mon Sep 17 00:00:00 2001 From: "Havvy (Ryan Scheel)" Date: Thu, 20 Sep 2018 15:40:22 -0700 Subject: [PATCH 3/4] Condense edition difference block. Remove RFC link --- src/items/associated-items.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/items/associated-items.md b/src/items/associated-items.md index 941af1c8e..2f76436e6 100644 --- a/src/items/associated-items.md +++ b/src/items/associated-items.md @@ -134,10 +134,9 @@ let circle_shape = Circle::new(); let bounding_box = circle_shape.bounding_box(); ``` -> **Edition Differences**: Until the 2018 edition, it was possible to declare -> trait methods with anonymous parameters (e.g. `fn foo(u8)`). This was -> deprecated and disallowed in the 2018 edition. All parameters must have an -> argument name. See [RFC 1685](https://github.com/rust-lang/rfcs/pull/1685). +> **Edition Differences**: In the 2015 edition, it is possible to declare trait +> methods with anonymous parameters (e.g. `fn foo(u8)`). This is deprecated and +> an error as of the 2018 edition. All parameters must have an argument name. ## Associated Types From 9d70cc630db0fe56296f4e195badf396f4b64e62 Mon Sep 17 00:00:00 2001 From: "Havvy (Ryan Scheel)" Date: Thu, 20 Sep 2018 15:44:00 -0700 Subject: [PATCH 4/4] Add Edition Differences to conventions section --- src/introduction.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/introduction.md b/src/introduction.md index 7a874c33d..585d51134 100644 --- a/src/introduction.md +++ b/src/introduction.md @@ -79,6 +79,12 @@ information. These conventions are documented here. An *example term* is an example of a term beind defined. +* Differences in the language by which edition the crate is compiled under are + in a blockquote that start with the words "Edition Differences:" in **bold**. + + > **Edition Differences**: In the 2015 edition, this syntax is valid that is + > disallowed as of the 2018 edition. + * Notes that contain useful information about the state of the book or point out useful, but mostly out of scope, information are in blockquotes that start with the word "Note:" in **bold**.