(index<- )        ./libsyntax/ext/fmt.rs

    git branch:    * master           5200215 auto merge of #14035 : alexcrichton/rust/experimental, r=huonw
    modified:    Fri May  9 13:02:28 2014
  1  // Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
  2  // file at the top-level directory of this distribution and at
  3  // http://rust-lang.org/COPYRIGHT.
  4  //
  5  // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
  6  // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
  7  // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
  8  // option. This file may not be copied, modified, or distributed
  9  // except according to those terms.
 10  
 11  /// Deprecated fmt! syntax extension
 12  
 13  use ast;
 14  use codemap::Span;
 15  use ext::base;
 16  use ext::build::AstBuilder;
 17  
 18  
 19  pub fn expand_syntax_ext(ecx: &mut base::ExtCtxt,
 20                           spSpan,
 21                           _tts: &[ast::TokenTree])
 22                           -> Box<base::MacResult> {
 23      ecx.span_err(sp, "`fmt!` is deprecated, use `format!` instead");
 24      ecx.parse_sess.span_diagnostic.span_note(sp,
 25          "see http://static.rust-lang.org/doc/master/std/fmt/index.html \
 26           for documentation");
 27  
 28      base::MacExpr::new(ecx.expr_uint(sp, 2))
 29  }