2012-12-10 19:32:48 -06:00
|
|
|
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2012-06-29 18:26:56 -05:00
|
|
|
fn wants_box(x: @[uint]) { }
|
|
|
|
fn wants_uniq(x: ~[uint]) { }
|
2012-10-09 23:28:04 -05:00
|
|
|
fn wants_three(x: [uint * 3]) { }
|
2012-04-14 20:45:03 -05:00
|
|
|
|
2012-06-29 18:26:56 -05:00
|
|
|
fn has_box(x: @[uint]) {
|
2012-04-14 20:45:03 -05:00
|
|
|
wants_box(x);
|
2012-06-30 06:23:59 -05:00
|
|
|
wants_uniq(x); //~ ERROR [] storage differs: expected ~ but found @
|
|
|
|
wants_three(x); //~ ERROR [] storage differs: expected 3 but found @
|
2012-04-14 20:45:03 -05:00
|
|
|
}
|
|
|
|
|
2012-06-29 18:26:56 -05:00
|
|
|
fn has_uniq(x: ~[uint]) {
|
2012-06-30 06:23:59 -05:00
|
|
|
wants_box(x); //~ ERROR [] storage differs: expected @ but found ~
|
2012-04-14 20:45:03 -05:00
|
|
|
wants_uniq(x);
|
2012-06-30 06:23:59 -05:00
|
|
|
wants_three(x); //~ ERROR [] storage differs: expected 3 but found ~
|
2012-04-14 20:45:03 -05:00
|
|
|
}
|
|
|
|
|
2012-10-09 23:28:04 -05:00
|
|
|
fn has_three(x: [uint * 3]) {
|
2012-06-30 06:23:59 -05:00
|
|
|
wants_box(x); //~ ERROR [] storage differs: expected @ but found 3
|
|
|
|
wants_uniq(x); //~ ERROR [] storage differs: expected ~ but found 3
|
2012-04-14 20:45:03 -05:00
|
|
|
wants_three(x);
|
|
|
|
}
|
|
|
|
|
2012-10-09 23:28:04 -05:00
|
|
|
fn has_four(x: [uint * 4]) {
|
2012-06-30 06:23:59 -05:00
|
|
|
wants_box(x); //~ ERROR [] storage differs: expected @ but found 4
|
|
|
|
wants_uniq(x); //~ ERROR [] storage differs: expected ~ but found 4
|
|
|
|
wants_three(x); //~ ERROR [] storage differs: expected 3 but found 4
|
2012-04-14 20:45:03 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
}
|