about summary refs log tree commit diff
path: root/src/libsyntax/diagnostics
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2017-08-30 11:08:26 +0000
committerbors <bors@rust-lang.org>2017-08-30 11:08:26 +0000
commitca9cf3594ab25d2809ac576dfc9defb8e87b45b8 (patch)
treec9445d8732ffdea1b395e9e2c0da993574db2e0a /src/libsyntax/diagnostics
parentc66e7fa8dee0b6b2b5439e2bd527ab66c9fbde13 (diff)
parenta0c32641fd8bff11b657bfb87d9ade5487d336ae (diff)
downloadrust-ca9cf3594ab25d2809ac576dfc9defb8e87b45b8.tar.gz
rust-ca9cf3594ab25d2809ac576dfc9defb8e87b45b8.zip
Auto merge of #43968 - petrochenkov:span2, r=michaelwoerister
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.
Diffstat (limited to 'src/libsyntax/diagnostics')
-rw-r--r--src/libsyntax/diagnostics/metadata.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsyntax/diagnostics/metadata.rs b/src/libsyntax/diagnostics/metadata.rs
index 5bbd18bd9ee..daa7112235f 100644
--- a/src/libsyntax/diagnostics/metadata.rs
+++ b/src/libsyntax/diagnostics/metadata.rs
@@ -47,7 +47,7 @@ pub struct ErrorLocation {
 impl ErrorLocation {
     /// Create an error location from a span.
     pub fn from_span(ecx: &ExtCtxt, sp: Span) -> ErrorLocation {
-        let loc = ecx.codemap().lookup_char_pos_adj(sp.lo);
+        let loc = ecx.codemap().lookup_char_pos_adj(sp.lo());
         ErrorLocation {
             filename: loc.filename,
             line: loc.line