From 74b2e9979738ce413209aa4342fc35afe68c68de Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sun, 18 Nov 2012 14:14:40 -0800 Subject: Report errors better when failing to open files for sub-parsers --- src/libsyntax/parse/parser.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/libsyntax/parse/parser.rs') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 12ae135e525..9d71f83b28d 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -2959,6 +2959,7 @@ impl Parser { } fn parse_item_mod(outer_attrs: ~[ast::attribute]) -> item_info { + let id_span = self.span; let id = self.parse_ident(); if self.token == token::SEMI { self.bump(); @@ -2969,7 +2970,8 @@ impl Parser { }; let prefix = Path(self.sess.cm.span_to_filename(copy self.span)); let prefix = prefix.dir_path(); - let (m, attrs) = eval::eval_src_mod(eval_ctx, &prefix, id, outer_attrs); + let (m, attrs) = eval::eval_src_mod(eval_ctx, &prefix, id, + outer_attrs, id_span); (id, m, Some(move attrs)) } else { self.expect(token::LBRACE); -- cgit 1.4.1-3-g733a5