[rust-dev] Removing codemap::spanned<T>

Michael Woerister michaelwoerister at gmail.com
Mon Jul 15 00:39:50 PDT 2013

On 13.07.2013 18:25, Patrick Walton wrote:
> On 7/13/13 7:27 AM, Michael Woerister wrote:
>> So, I thought it might be a good idea if I tried to remove the
>> spanned<T> struct altogether and added the span field directly to the
>> types that are wrapped at the moment. If needed, I would also add a
>> Spanned trait that allows to abstract over anything having a span.
>> Because this would affect quite a bit of the codebase (albeit not
>> semantically) I thought, I'd better ask beforehand if you people think
>> this is a good idea. Or maybe I am missing a reason for keeping the
>> spanned<T> struct around?
> I might prefer to just use a compressed side table for memory usage 
> reasons. Can we measure how much space the spans are taking up in the 
> AST?
> Patrick
> _______________________________________________
> Rust-dev mailing list
> Rust-dev at mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev

Thinking about it, side table or not, the spanned<T> struct would go 
away in its current form anyway, right? So it should be a step in the 
right direction, to gradually remove its usages. Since spanned<T> 
affects how nodes using it are accessed in general (because of the .node 
indirection),  this would also affect parts of the code that don't use 
spanning information. My motivation for removing spanned<T> is that code 
using any type wrapped in it would become cleaner. Implementing a side 
table approach would then be a consequent step, building on the removal 
of spanned<T>.


More information about the Rust-dev mailing list