summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-11-12 07:31:08 +0000
committerbors <bors@rust-lang.org>2017-11-12 07:31:08 +0000
commitb087dedf3f85c4c90e27cb6e119b4da2712be5c9 (patch)
treed1f64b53857070ed6095261689772904933a1700 /src/libsyntax
parentc1aacdcb30db1cdd32c06fe90cbe38e0800b2502 (diff)
parent77cd993fd1582680cc01ce86d07e52b2e4b34fec (diff)
downloadrust-b087dedf3f85c4c90e27cb6e119b4da2712be5c9.tar.gz
rust-b087dedf3f85c4c90e27cb6e119b4da2712be5c9.zip
Auto merge of #45870 - mikeyhew:arbitrary_self_types, r=arielb1
Implement arbitrary_self_types

r? @arielb1
cc @nikomatsakis

Partial implementation of #44874.  Supports trait and struct methods with arbitrary self types, as long as the type derefs (transitively) to `Self`. Doesn't support raw-pointer `self` yet.

Methods with non-standard self types (i.e. anything other than `&self, &mut self, and Box<Self>`) are not object safe, because dynamic dispatch hasn't been implemented for them yet.

I believe this is also a (partial) fix for #27941.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/feature_gate.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index a69bf53ee14..b6cb3ac1308 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -409,6 +409,9 @@ declare_features! (
 
     // extern types
     (active, extern_types, "1.23.0", Some(43467)),
+
+    // Allow trait methods with arbitrary self types
+    (active, arbitrary_self_types, "1.23.0", Some(44874)),
 );
 
 declare_features! (