diff --git a/doc/rust.md b/doc/rust.md index 697c395bc82..d4ec308df86 100644 --- a/doc/rust.md +++ b/doc/rust.md @@ -222,7 +222,7 @@ let log loop match mod move mut priv pub pure ref return -self static struct +self static struct super true trait type unsafe use while diff --git a/src/librustc/middle/ty.rs b/src/librustc/middle/ty.rs index 5607e55d490..c8282579586 100644 --- a/src/librustc/middle/ty.rs +++ b/src/librustc/middle/ty.rs @@ -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. -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_ty: super.self_ty.map(|typ| subst(cx, sub, *typ)), - tps: super.tps.map(|typ| subst(cx, sub, *typ)) + self_r: sup.self_r, + self_ty: sup.self_ty.map(|typ| subst(cx, sub, *typ)), + tps: sup.tps.map(|typ| subst(cx, sub, *typ)) } } diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs index 2136499f8f0..a8c0c074588 100644 --- a/src/libsyntax/parse/token.rs +++ b/src/libsyntax/parse/token.rs @@ -493,7 +493,7 @@ fn strict_keyword_table() -> HashMap<~str, ()> { ~"once", ~"priv", ~"pub", ~"pure", ~"ref", ~"return", - ~"struct", + ~"struct", ~"super", ~"true", ~"trait", ~"type", ~"unsafe", ~"use", ~"while" diff --git a/src/test/compile-fail/keyword-super.rs b/src/test/compile-fail/keyword-super.rs new file mode 100644 index 00000000000..3c9c403e83d --- /dev/null +++ b/src/test/compile-fail/keyword-super.rs @@ -0,0 +1,3 @@ +fn main() { + let super: int; //~ ERROR found `super` in ident position +}