diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-04-01 18:38:00 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-01 18:38:00 +0100 |
commit | 0a41412ced3784363580ddaef089605250d6398e (patch) | |
tree | ddc82aaaf8e35fa652feb04400fd31bc9af4749e /crates/ra_hir_ty/src/infer | |
parent | f39b51d025c080682a35706ffcb86c2aeb28044b (diff) | |
parent | d0b6b2ee2f4a447f4c3827f87ebaf5216de6f226 (diff) |
Merge #3806
3806: lower bool literal value r=flodiebold a=JoshMcguigan
Following up on #3805, this PR adds the literal value to `ast::LiteralKind` so when we lower we can use the actual value from the source code rather than the default value for the type. Ultimately I plan to use this for exhaustiveness checking in #3706.
I didn't include this in the previous PR because I wasn't sure if it made sense to add this information to `ast::LiteralKind` or provide some other mechanism to get this from `ast::Literal`.
For now I've only implemented this for boolean literals, but I think it could be easily extended to other types. A possible exception to this are string literals, since we may not want to clone around an owned string to hold onto in `ast::LiteralKind`, and it'd be nice to avoid adding a generic lifetime as well. Perhaps we won't ever care about the actual value of a string literal?
Co-authored-by: Josh Mcguigan <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src/infer')
0 files changed, 0 insertions, 0 deletions