1
Fork 0

Make column macro output 1 based and document it

This commit is contained in:
est31 2017-12-24 02:20:06 +01:00
parent 1699293083
commit e5c3aac0b4
2 changed files with 13 additions and 7 deletions

View file

@ -49,7 +49,7 @@ pub fn expand_column(cx: &mut ExtCtxt, sp: Span, tts: &[tokenstream::TokenTree])
let topmost = cx.expansion_cause().unwrap_or(sp);
let loc = cx.codemap().lookup_char_pos(topmost.lo());
base::MacEager::expr(cx.expr_u32(topmost, loc.col.to_usize() as u32))
base::MacEager::expr(cx.expr_u32(topmost, loc.col.to_usize() as u32 + 1))
}
/* __rust_unstable_column!(): expands to the current column number */