]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_expand/build.rs
Auto merge of #67850 - GuillaumeGomez:err-codes-checkup, r=Mark-Simulacrum
[rust.git] / src / librustc_expand / build.rs
index 799781a89631d609e1d10e51ba94a42d40ec7140..bd3d6b589d00acfb210de183690e5f1f95fdae5d 100644 (file)
@@ -6,7 +6,7 @@
 use syntax::attr;
 use syntax::ptr::P;
 
-use rustc_span::{Pos, Span};
+use rustc_span::Span;
 
 impl<'a> ExtCtxt<'a> {
     pub fn path(&self, span: Span, strs: Vec<ast::Ident>) -> ast::Path {
@@ -110,7 +110,7 @@ pub fn typaram(
     }
 
     pub fn trait_ref(&self, path: ast::Path) -> ast::TraitRef {
-        ast::TraitRef { path, ref_id: ast::DUMMY_NODE_ID }
+        ast::TraitRef { path, constness: None, ref_id: ast::DUMMY_NODE_ID }
     }
 
     pub fn poly_trait_ref(&self, span: Span, path: ast::Path) -> ast::PolyTraitRef {
@@ -350,16 +350,10 @@ pub fn expr_tuple(&self, sp: Span, exprs: Vec<P<ast::Expr>>) -> P<ast::Expr> {
     }
 
     pub fn expr_fail(&self, span: Span, msg: Symbol) -> P<ast::Expr> {
-        let loc = self.source_map().lookup_char_pos(span.lo());
-        let expr_file = self.expr_str(span, Symbol::intern(&loc.file.name.to_string()));
-        let expr_line = self.expr_u32(span, loc.line as u32);
-        let expr_col = self.expr_u32(span, loc.col.to_usize() as u32 + 1);
-        let expr_loc_tuple = self.expr_tuple(span, vec![expr_file, expr_line, expr_col]);
-        let expr_loc_ptr = self.expr_addr_of(span, expr_loc_tuple);
         self.expr_call_global(
             span,
             [sym::std, sym::rt, sym::begin_panic].iter().map(|s| Ident::new(*s, span)).collect(),
-            vec![self.expr_str(span, msg), expr_loc_ptr],
+            vec![self.expr_str(span, msg)],
         )
     }