Skip to content

Commit 1930483

Browse files
committedApr 24, 2016
Auto merge of #33179 - Manishearth:breaking-batch, r=Manishearth
Batch up breaking libsyntax changes Contains: - #33125 - #33041 - #33157 cc #31645
·
1.87.01.10.0
2 parents 91aea5c + a31658d commit 1930483

File tree

129 files changed

+885
-911
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+885
-911
lines changed
 

‎src/etc/generate-keyword-tests.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,17 @@
3434
// option. This file may not be copied, modified, or distributed
3535
// except according to those terms.
3636
37+
// compile-flags: -Z parse-only
38+
3739
// This file was auto-generated using 'src/etc/generate-keyword-tests.py %s'
3840
3941
fn main() {
40-
let %s = "foo"; //~ error: ident
42+
let %s = "foo"; //~ error: expected pattern, found keyword `%s`
4143
}
4244
"""
4345

4446
test_dir = os.path.abspath(
45-
os.path.join(os.path.dirname(__file__), '../test/compile-fail')
47+
os.path.join(os.path.dirname(__file__), '../test/parse-fail')
4648
)
4749

4850
for kw in sys.argv[1:]:
@@ -53,7 +55,7 @@
5355
os.chmod(test_file, stat.S_IWUSR)
5456

5557
with open(test_file, 'wt') as f:
56-
f.write(template % (datetime.datetime.now().year, kw, kw))
58+
f.write(template % (datetime.datetime.now().year, kw, kw, kw))
5759

5860
# mark file read-only
5961
os.chmod(test_file, stat.S_IRUSR | stat.S_IRGRP | stat.S_IROTH)

‎src/librustc/hir/fold.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use syntax::attr::ThinAttributesExt;
1818
use hir;
1919
use syntax::codemap::{respan, Span, Spanned};
2020
use syntax::ptr::P;
21-
use syntax::parse::token;
21+
use syntax::parse::token::keywords;
2222
use syntax::util::move_map::MoveMap;
2323

2424
pub trait Folder : Sized {
@@ -867,7 +867,7 @@ pub fn noop_fold_crate<T: Folder>(Crate { module, attrs, config, span,
867867
let config = folder.fold_meta_items(config);
868868

869869
let crate_mod = folder.fold_item(hir::Item {
870-
name: token::special_idents::invalid.name,
870+
name: keywords::Invalid.name(),
871871
attrs: attrs,
872872
id: DUMMY_NODE_ID,
873873
vis: hir::Public,
@@ -1060,10 +1060,11 @@ pub fn noop_fold_expr<T: Folder>(Expr { id, node, span, attrs }: Expr, folder: &
10601060
arms.move_map(|x| folder.fold_arm(x)),
10611061
source)
10621062
}
1063-
ExprClosure(capture_clause, decl, body) => {
1063+
ExprClosure(capture_clause, decl, body, fn_decl_span) => {
10641064
ExprClosure(capture_clause,
10651065
folder.fold_fn_decl(decl),
1066-
folder.fold_block(body))
1066+
folder.fold_block(body),
1067+
folder.new_span(fn_decl_span))
10671068
}
10681069
ExprBlock(blk) => ExprBlock(folder.fold_block(blk)),
10691070
ExprAssign(el, er) => {

0 commit comments

Comments
 (0)
Please sign in to comment.