1 A method was called on a raw pointer whose inner type wasn't completely known.
3 For example, you may have done something like:
8 let bar = foo as *const _;
14 Here, the type of `bar` isn't known; it could be a pointer to anything. Instead,
15 specify a type for the pointer (preferably something that makes sense for the
16 thing you're pointing to):
20 let bar = foo as *const i32;
26 Even though `is_null()` exists as a method on any raw pointer, Rust shows this
27 error because Rust allows for `self` to have arbitrary types (behind the
28 arbitrary_self_types feature flag).
30 This means that someone can specify such a function:
32 ```ignore (cannot-doctest-feature-doesnt-exist-yet)
34 fn is_null(self: *const Self) -> bool {
40 and now when you call `.is_null()` on a raw pointer to `Foo`, there's ambiguity.
42 Given that we don't know what type the pointer is, and there's potential
43 ambiguity for some types, we disallow calling methods on raw pointers when