Skip to content

Commit 96c8f2b

Browse files
committed
auto merge of #19071 : huonw/rust/col2column, r=nikomatsakis
This macro is very rarely used, so there is no need (and it is better) for it to avoid the abbreviation. Closes rust-lang/rfcs#467.
2 parents 394269d + 3f3b2d6 commit 96c8f2b

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/libstd/macros.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -557,17 +557,17 @@ pub mod builtin {
557557
/// A macro which expands to the column number on which it was invoked.
558558
///
559559
/// The expanded expression has type `uint`, and the returned column is not
560-
/// the invocation of the `col!()` macro itself, but rather the first macro
561-
/// invocation leading up to the invocation of the `col!()` macro.
560+
/// the invocation of the `column!()` macro itself, but rather the first macro
561+
/// invocation leading up to the invocation of the `column!()` macro.
562562
///
563563
/// # Example
564564
///
565565
/// ```
566-
/// let current_col = col!();
566+
/// let current_col = column!();
567567
/// println!("defined on column: {}", current_col);
568568
/// ```
569569
#[macro_export]
570-
macro_rules! col( () => ({ /* compiler built-in */ }) )
570+
macro_rules! column( () => ({ /* compiler built-in */ }) )
571571

572572
/// A macro which expands to the file name from which it was invoked.
573573
///

src/libsyntax/ext/base.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,9 @@ fn initial_syntax_expander_table(ecfg: &expand::ExpansionConfig) -> SyntaxEnv {
413413
syntax_expanders.insert(intern("line"),
414414
builtin_normal_expander(
415415
ext::source_util::expand_line));
416-
syntax_expanders.insert(intern("col"),
416+
syntax_expanders.insert(intern("column"),
417417
builtin_normal_expander(
418-
ext::source_util::expand_col));
418+
ext::source_util::expand_column));
419419
syntax_expanders.insert(intern("file"),
420420
builtin_normal_expander(
421421
ext::source_util::expand_file));

src/libsyntax/ext/source_util.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@ pub fn expand_line(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
3838
base::MacExpr::new(cx.expr_uint(topmost, loc.line))
3939
}
4040

41-
/* col!(): expands to the current column number */
42-
pub fn expand_col(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
41+
/* column!(): expands to the current column number */
42+
pub fn expand_column(cx: &mut ExtCtxt, sp: Span, tts: &[ast::TokenTree])
4343
-> Box<base::MacResult+'static> {
44-
base::check_zero_tts(cx, sp, tts, "col!");
44+
base::check_zero_tts(cx, sp, tts, "column!");
4545

4646
let topmost = cx.original_span_in_file();
4747
let loc = cx.codemap().lookup_char_pos(topmost.lo);

src/test/run-pass/syntax-extension-source-utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ macro_rules! indirect_line( () => ( line!() ) )
2525

2626
pub fn main() {
2727
assert_eq!(line!(), 27);
28-
//assert!((col!() == 11));
28+
//assert!((column!() == 11));
2929
assert_eq!(indirect_line!(), 29);
3030
assert!((file!().ends_with("syntax-extension-source-utils.rs")));
3131
assert_eq!(stringify!((2*3) + 5).to_string(), "( 2 * 3 ) + 5".to_string());

0 commit comments

Comments
 (0)