Merge pull request #4609 from sonwow/keyword-super

Make `super` a keyword
This commit is contained in:
Tim Chevalier 2013-01-24 11:17:52 -08:00
commit f3ec278e46
4 changed files with 10 additions and 7 deletions

View File

@ -222,7 +222,7 @@ let log loop
match mod move mut match mod move mut
priv pub pure priv pub pure
ref return ref return
self static struct self static struct super
true trait type true trait type
unsafe use unsafe use
while while

View File

@ -1659,13 +1659,13 @@ fn subst(cx: ctxt,
} }
} }
// Performs substitutions on a set of substitutions (result = super(sub)) to // Performs substitutions on a set of substitutions (result = sup(sub)) to
// yield a new set of substitutions. This is used in trait inheritance. // yield a new set of substitutions. This is used in trait inheritance.
fn subst_substs(cx: ctxt, super: &substs, sub: &substs) -> substs { fn subst_substs(cx: ctxt, sup: &substs, sub: &substs) -> substs {
{ {
self_r: super.self_r, self_r: sup.self_r,
self_ty: super.self_ty.map(|typ| subst(cx, sub, *typ)), self_ty: sup.self_ty.map(|typ| subst(cx, sub, *typ)),
tps: super.tps.map(|typ| subst(cx, sub, *typ)) tps: sup.tps.map(|typ| subst(cx, sub, *typ))
} }
} }

View File

@ -493,7 +493,7 @@ fn strict_keyword_table() -> HashMap<~str, ()> {
~"once", ~"once",
~"priv", ~"pub", ~"pure", ~"priv", ~"pub", ~"pure",
~"ref", ~"return", ~"ref", ~"return",
~"struct", ~"struct", ~"super",
~"true", ~"trait", ~"type", ~"true", ~"trait", ~"type",
~"unsafe", ~"use", ~"unsafe", ~"use",
~"while" ~"while"

View File

@ -0,0 +1,3 @@
fn main() {
let super: int; //~ ERROR found `super` in ident position
}