Skip to content

Commit c588e40

Browse files
committed
auto merge of #17866 : jgallagher/rust/reserve-inheritance-keywords, r=huonw
Closes #17862
2 parents eb2240a + 3db9070 commit c588e40

File tree

7 files changed

+48
-6
lines changed

7 files changed

+48
-6
lines changed

src/etc/vim/syntax/rust.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ syn match rustMacroRepeatCount ".\?[*+]" contained
5454
syn match rustMacroVariable "$\w\+"
5555

5656
" Reserved (but not yet used) keywords {{{2
57-
syn keyword rustReservedKeyword alignof be do offsetof priv pure sizeof typeof unsized yield
57+
syn keyword rustReservedKeyword alignof be do offsetof priv pure sizeof typeof unsized yield abstract final override
5858

5959
" Built-in types {{{2
6060
syn keyword rustType int uint float char bool u8 u16 u32 u64 f32

src/librustc/middle/trans/reflect.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -436,20 +436,20 @@ pub fn emit_calls_to_trait_visit_ty<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
436436
visitor_trait_id: DefId)
437437
-> Block<'blk, 'tcx> {
438438
let fcx = bcx.fcx;
439-
let final = fcx.new_temp_block("final");
439+
let final_bcx = fcx.new_temp_block("final");
440440
let tydesc_ty = ty::get_tydesc_ty(bcx.tcx()).unwrap();
441441
let tydesc_ty = type_of(bcx.ccx(), tydesc_ty);
442442
let visitor_items = ty::trait_items(bcx.tcx(), visitor_trait_id);
443443
let mut r = Reflector {
444444
visitor_val: visitor_val,
445445
visitor_items: visitor_items.as_slice(),
446-
final_bcx: final,
446+
final_bcx: final_bcx,
447447
tydesc_ty: tydesc_ty,
448448
bcx: bcx
449449
};
450450
r.visit_ty(t);
451-
Br(r.bcx, final.llbb);
452-
return final;
451+
Br(r.bcx, final_bcx.llbb);
452+
return final_bcx;
453453
}
454454

455455
pub fn ast_fn_style_constant(fn_style: ast::FnStyle) -> uint {

src/libstd/io/timer.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,7 @@ mod test {
308308
}
309309

310310
#[test]
311-
fn override() {
311+
fn test_override() {
312312
let mut timer = Timer::new().unwrap();
313313
let orx = timer.oneshot(Duration::milliseconds(100));
314314
let prx = timer.periodic(Duration::milliseconds(100));

src/libsyntax/parse/token.rs

+3
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,9 @@ declare_special_idents_and_keywords! {
520520
(54, Unsized, "unsized");
521521
(55, Yield, "yield");
522522
(56, Do, "do");
523+
(57, Abstract, "abstract");
524+
(58, Final, "final");
525+
(59, Override, "override");
523526
}
524527
}
525528

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2014 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+
fn main() {
12+
let abstract = (); //~ ERROR `abstract` is a reserved keyword
13+
}
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2014 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+
fn main() {
12+
let final = (); //~ ERROR `final` is a reserved keyword
13+
}
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright 2014 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+
fn main() {
12+
let override = (); //~ ERROR `override` is a reserved keyword
13+
}

0 commit comments

Comments
 (0)