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