1
Fork 0

s/alt/match/... again.

This commit is contained in:
Niko Matsakis 2012-08-06 16:16:08 -07:00
parent 4a216a000a
commit 0308884416
3 changed files with 8 additions and 8 deletions

View file

@ -1,5 +1,5 @@
fn matcher(x: option<int>) { fn matcher(x: option<int>) {
alt x { match x {
ref some(i) => {} //~ ERROR expected identifier, found enum pattern ref some(i) => {} //~ ERROR expected identifier, found enum pattern
none => {} none => {}
} }

View file

@ -3,28 +3,28 @@ enum opts {
} }
fn matcher1(x: opts) { fn matcher1(x: opts) {
alt x { match x {
a(ref i) | b(copy i) => {} //~ ERROR variable `i` is bound with different mode in pattern #2 than in pattern #1 a(ref i) | b(copy i) => {} //~ ERROR variable `i` is bound with different mode in pattern #2 than in pattern #1
c(_) => {} c(_) => {}
} }
} }
fn matcher2(x: opts) { fn matcher2(x: opts) {
alt x { match x {
a(ref i) | b(i) => {} //~ ERROR variable `i` is bound with different mode in pattern #2 than in pattern #1 a(ref i) | b(i) => {} //~ ERROR variable `i` is bound with different mode in pattern #2 than in pattern #1
c(_) => {} c(_) => {}
} }
} }
fn matcher3(x: opts) { fn matcher3(x: opts) {
alt x { match x {
a(ref mut i) | b(ref const i) => {} //~ ERROR variable `i` is bound with different mode in pattern #2 than in pattern #1 a(ref mut i) | b(ref const i) => {} //~ ERROR variable `i` is bound with different mode in pattern #2 than in pattern #1
c(_) => {} c(_) => {}
} }
} }
fn matcher4(x: opts) { fn matcher4(x: opts) {
alt x { match x {
a(ref mut i) | b(ref i) => {} //~ ERROR variable `i` is bound with different mode in pattern #2 than in pattern #1 a(ref mut i) | b(ref i) => {} //~ ERROR variable `i` is bound with different mode in pattern #2 than in pattern #1
c(_) => {} c(_) => {}
} }
@ -32,10 +32,10 @@ fn matcher4(x: opts) {
fn matcher5(x: opts) { fn matcher5(x: opts) {
alt x { match x {
a(ref i) | b(ref i) => {} a(ref i) | b(ref i) => {}
c(_) => {} c(_) => {}
} }
} }
fn main() {} fn main() {}

View file

@ -1,6 +1,6 @@
fn main() { fn main() {
let y = 1; let y = 1;
alt y { match y {
a | b => {} //~ ERROR variable `a` from pattern #1 is not bound in pattern #2 a | b => {} //~ ERROR variable `a` from pattern #1 is not bound in pattern #2
//~^ ERROR variable `b` from pattern #2 is not bound in pattern #1 //~^ ERROR variable `b` from pattern #2 is not bound in pattern #1
} }