Skip to content

Commit f3ec278

Browse files
committed
Merge pull request #4609 from sonwow/keyword-super
Make `super` a keyword
2 parents 25f9fa0 + 4b2aa28 commit f3ec278

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

doc/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ let log loop
222222
match mod move mut
223223
priv pub pure
224224
ref return
225-
self static struct
225+
self static struct super
226226
true trait type
227227
unsafe use
228228
while

src/librustc/middle/ty.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1659,13 +1659,13 @@ fn subst(cx: ctxt,
16591659
}
16601660
}
16611661
1662-
// Performs substitutions on a set of substitutions (result = super(sub)) to
1662+
// Performs substitutions on a set of substitutions (result = sup(sub)) to
16631663
// yield a new set of substitutions. This is used in trait inheritance.
1664-
fn subst_substs(cx: ctxt, super: &substs, sub: &substs) -> substs {
1664+
fn subst_substs(cx: ctxt, sup: &substs, sub: &substs) -> substs {
16651665
{
1666-
self_r: super.self_r,
1667-
self_ty: super.self_ty.map(|typ| subst(cx, sub, *typ)),
1668-
tps: super.tps.map(|typ| subst(cx, sub, *typ))
1666+
self_r: sup.self_r,
1667+
self_ty: sup.self_ty.map(|typ| subst(cx, sub, *typ)),
1668+
tps: sup.tps.map(|typ| subst(cx, sub, *typ))
16691669
}
16701670
}
16711671

src/libsyntax/parse/token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ fn strict_keyword_table() -> HashMap<~str, ()> {
493493
~"once",
494494
~"priv", ~"pub", ~"pure",
495495
~"ref", ~"return",
496-
~"struct",
496+
~"struct", ~"super",
497497
~"true", ~"trait", ~"type",
498498
~"unsafe", ~"use",
499499
~"while"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
let super: int; //~ ERROR found `super` in ident position
3+
}

0 commit comments

Comments
 (0)