mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 11:48:30 +00:00
Merge pull request #4609 from sonwow/keyword-super
Make `super` a keyword
This commit is contained in:
commit
f3ec278e46
@ -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
|
||||||
|
@ -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))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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"
|
||||||
|
3
src/test/compile-fail/keyword-super.rs
Normal file
3
src/test/compile-fail/keyword-super.rs
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
fn main() {
|
||||||
|
let super: int; //~ ERROR found `super` in ident position
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user