Tags: adetaylor/rust
Tags
Arbitrary self types v2: stabilize in miri
Attempt at considering Ref<'lt> lifetimes too
Lifetime elision: do not recurse into self types. To ensure that these two cases behave consistently: struct Foo<T>(T); impl<'a> Foo<&'a ()> { fn call_me(self: &Self) -> &() { self.0 } fn call_me2(self: &Foo<&'a ()>) -> &() { self.0 } }
Receiver trait with target: support NotNull Receiver. This commit allows us to support Receivers which are types that may have methods implemented upon them in future. In the event of a conflict between SmartPtr::SomeMethod and Pointee::Method, favor Pointee::Method because it was probably added first. Emit a warning (yet to do). The rationale here is that we want to be able to support struct Foo; impl Foo { fn method(self: NotNull<Foo>) { } } while reserving the right to add future methods to NotNull. To do that, we have to ensure that any future methods added to NotNull do not shadow methods added to Foo. This works by switching some existing hard errors into warnings; where we previously had two possible method candidates we will now pick the "innermost" candidate. This doesn't currently quite work as it produces problems with generics.
Un-hard-code pointer support. This moves pointer receiver support so it's no longer hard-coded into the compiler (in wfcheck.rs) but is instead simply an implementation of the Receiver trait within core.
PreviousNext