Skip to content

Commit 7ea82bd

Browse files
committed
Move lint to the correct place.
1 parent a5e274b commit 7ea82bd

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

text/3519-arbitrary-self-types-v2.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,7 @@ The existing branches in the compiler for "arbitrary self types" already emit ex
307307
}
308308
```
309309
We don't know a use-case for this. There are several cases where this can result in misleading diagnostics. (For instance, if such a method is called with an incorrect type (for example `smart_ptr.a::<&Foo>()` instead of `smart_ptr.a::<Foo>()`). We could attempt to find and fix all those cases. However, we feel that generic receiver types might risk subtle interactions with method resolutions and other parts of the language. We think it is a safer choice to generate an error on any declaration of a generic `self` type.
310-
- As noted in [#compiler-changes-deshadowing](the section about compiler changes for deshadowing) we will downgrade an existing error to a warning if there are multiple
311-
method candidates found, if one of those candidates is further along the chain of `Receiver`s than the others.
312-
- As also noted in [#compiler-changes-deshadowing](the section about compiler changes for deshadowing), we will produce a new warning if a method in an inner type is chosen in preference to a method in an outer type ("inner" = further along the `Receiver` chain) and the inner type is either `self: &T` or `self: &mut T` and we're choosing it in preference to `self: T` or `self: &T` in the outer type. An example warning might be:
313-
310+
- As noted in [#compiler-changes-deshadowing](the section about compiler changes for deshadowing) we will downgrade an existing error to a warning if there are multiple method candidates found, if one of those candidates is further along the chain of `Receiver`s than the others. An example warning might be:
314311
```
315312
warning[W0666]: ambiguous function call
316313
--> src/main.rs:13:4
@@ -337,6 +334,7 @@ The existing branches in the compiler for "arbitrary self types" already emit ex
337334
= help: call as a function not a method:
338335
~ Weak::retrograde(orbit_weak)
339336
```
337+
- As also noted in [#compiler-changes-deshadowing](the section about compiler changes for deshadowing), we will produce a new warning if a method in an inner type is chosen in preference to a method in an outer type ("inner" = further along the `Receiver` chain) and the inner type is either `self: &T` or `self: &mut T` and we're choosing it in preference to `self: T` or `self: &T` in the outer type. (The warning would be very similar to the above.)
340338

341339
# Drawbacks
342340
[drawbacks]: #drawbacks

0 commit comments

Comments
 (0)