-
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.
Change the return type of
Ty::kind
from &TyKind
to TyKind
.
This is valid because `TyKind` impls `Copy`, and makes `Ty` consistent with `Predicate` and `Region`, both of which have `kind` methods that return a non-reference. The change removes more than one thousand `&` and `*` sigils, while requiring the addition of just five! It's clearly moving with the grain of the existing code. Almost all of the removed sigils fit one of the following three patterns. - Remove the dereference in the match expression: `match *ty.kind() { ... }` -> `match ty.kind() { ... }` - Remove the dereference in the match pattern: `match ty.kind() { &ty::Foo(foo) => { ... foo ... }` -> `match ty.kind() { ty::Foo(foo) => { ... foo ... }` - Remove the derefernce in the match arm: `match ty.kind() { ty::Foo(foo) => { ... *foo ... }` -> `match ty.kind() { ty::Foo(foo) => { ... foo ... }` A couple of other methods had their signatures changed. - `TypeErrCtxt::cmp_fn_sig`: `&` removed from two args. - `EncodableWithShorthand::variant`: `&` removed from return type.
- Loading branch information
1 parent
e9c965d
commit fa2b1a9
Showing
314 changed files
with
1,076 additions
and
1,111 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
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.