]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #43968 - petrochenkov:span2, r=michaelwoerister
authorbors <bors@rust-lang.org>
Wed, 30 Aug 2017 11:08:26 +0000 (11:08 +0000)
committerbors <bors@rust-lang.org>
Wed, 30 Aug 2017 11:08:26 +0000 (11:08 +0000)
Make fields of `Span` private

I actually tried to intern spans and benchmark the result<sup>*</sup>, and this was a prerequisite.
This kind of encapsulation will be a prerequisite for any other attempt to compress span's representation, so I decided to submit this change alone.

The issue https://github.com/rust-lang/rust/issues/43088 seems relevant, but it looks like `SpanId` won't be able to reuse this interface, unless the tables are global (like interner that I tried) and are not a part of HIR.
r? @michaelwoerister anyway

<sup>*</sup> Interning means 2-3 times more space is required for a single span, but duplicates are free. In practice it turned out that duplicates are not *that* common, so more memory was wasted by interning rather than saved.

1  2 
src/librustc_errors/lib.rs
src/librustc_typeck/check/mod.rs

Simple merge
Simple merge