-
Notifications
You must be signed in to change notification settings - Fork 223
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Centrally handle Rust toolchain attr defaults
Summary: This reverts the Rust parts from D41714656 (f171bf1) and implements it better a different way. Advantages of the new approach: 1. No more "falsiness". The default value kicks in only if a value was not passed by the code that instantiated the toolchain, or if `None` was passed. (As far as I can tell there is no way to tell these cases apart, but that seems fine.) Previously we had been doing e.g. `toolchain_info.rustc_flags or []`, which will silently accept a toolchain constructed with inappropriate falsey values like `rustc_flags = False` or `rustc_flags = ""`. 2. A consistent central place for the default values. No more needing to scatter `or []` to every location that a particular attribute is referenced. 3. A central place to observe which attributes have not yet been given a default value, and discuss what those default values should be. Other than #1 above, this diff does not intentionally change any behavior. Reviewed By: zertosh Differential Revision: D41752388 fbshipit-source-id: 47e8b290cc596528a7a3c5b3a68195083725f8bd
- Loading branch information
1 parent
eb11457
commit f8afac6
Showing
3 changed files
with
37 additions
and
28 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