diff options
| author | bors <bors@rust-lang.org> | 2021-03-07 20:23:23 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-03-07 20:23:23 +0000 |
| commit | 234781afe33d3f339b002f85f948046d8476cfc9 (patch) | |
| tree | e5830366b5a0deaa1da8e05565a5e181f222c393 /compiler/rustc_mir/src/transform/coverage/graph.rs | |
| parent | 66ec64ccf31883cd2c28d045912a76179c0c6ed2 (diff) | |
| parent | 408d4027d0c469be4ab442b8d0223565cdb09229 (diff) | |
| download | rust-234781afe33d3f339b002f85f948046d8476cfc9.tar.gz rust-234781afe33d3f339b002f85f948046d8476cfc9.zip | |
Auto merge of #82285 - nhwn:nonzero-debug, r=nagisa
Use u32 over Option<u32> in DebugLoc ~~Changes `Option<u32>` fields in `DebugLoc` to `Option<NonZeroU32>`. Since the respective fields (`line` and `col`) are guaranteed to be 1-based, this layout optimization is a freebie.~~ EDIT: Changes `Option<u32>` fields in `DebugLoc` to `u32`. As `@bugadani` pointed out, an `Option<NonZeroU32>` is probably an unnecessary layer of abstraction since the `None` variant is always used as `UNKNOWN_LINE_NUMBER` (which is just `0`). Also, `SourceInfo` in `metadata.rs` already uses a `u32` instead of an `Option<u32>` to encode the same information, so I think this change is warranted. Since `@jyn514` raised some concerns over measuring performance in a similar PR (#82255), does this need a perf run?
Diffstat (limited to 'compiler/rustc_mir/src/transform/coverage/graph.rs')
0 files changed, 0 insertions, 0 deletions
