-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #22172 - eddyb:almost-there, r=nikomatsakis
Adds `<module::Type>::method` support and makes `module::Type::method` a shorthand for it. This is most of #16293, except that chaining multiple associated types is not yet supported. It also fixes #22563 as `impl`s are no longer treated as modules in resolve. Unfortunately, this is still a *[breaking-change]*: * If you used a global path to a primitive type, i.e. `::bool`, `::i32` etc. - that was a bug I had to fix. Solution: remove the leading `::`. * If you passed explicit `impl`-side type parameters to an inherent method, e.g.: ```rust struct Foo<T>(T); impl<A, B> Foo<(A, B)> { fn pair(a: A, b: B) -> Foo<(A, B)> { Foo((a, b)) } } Foo::<A, B>::pair(a, b) // Now that is sugar for: <Foo<A, B>>::pair(a, b) // Which isn't valid because `Foo` has only one type parameter. // Solution: replace with: Foo::<(A, B)>::pair(a, b) // And, if possible, remove the explicit type param entirely: Foo::pair(a, b) ``` * If you used the `QPath`-related `AstBuilder` methods @hugwijst added in #21943. The methods still exist, but `QPath` was replaced by `QSelf`, with the actual path stored separately. Solution: unpack the pair returned by `cx.qpath` to get the two arguments for `cx.expr_qpath`.
- Loading branch information
Showing
111 changed files
with
2,363 additions
and
2,648 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.