From 497397ab4b66e40f3a772544a1bb9842869cf118 Mon Sep 17 00:00:00 2001 From: Michael Hewson Date: Thu, 2 Nov 2017 07:58:21 -0400 Subject: initial implementation of arbitrary_self_types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the feature is enabled, allow method `self` types to be any type that auto-derefs to `self`. - Currently, this supports inherent methods as well as trait methods. The plan AFAIK is to only allow this for trait methods, so I guess it won’t stay this way - Dynamic dispatch isn’t implemented yet, so the compiler will ICE if you define a trait method that takes `self: Rc` and try to call it on an `Rc`. I will probably just make those methods non-object-safe initially. --- src/libsyntax/feature_gate.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/libsyntax') 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! ( -- cgit 1.4.1-3-g733a5