Updating errors in vec-add.rs
This commit is contained in:
parent
f21fbc23d2
commit
bb572b4234
1 changed files with 29 additions and 19 deletions
|
|
@ -6,23 +6,23 @@ fn add(i: [int], m: [mut int], c: [const int]) {
|
|||
|
||||
add(i + [3],
|
||||
m + [3],
|
||||
c + [3]);
|
||||
[3]);
|
||||
|
||||
add(i + [mut 3],
|
||||
m + [mut 3],
|
||||
c + [mut 3]);
|
||||
[mut 3]);
|
||||
|
||||
add(i + i,
|
||||
m + i,
|
||||
c + i);
|
||||
i);
|
||||
|
||||
add(i + m,
|
||||
m + m,
|
||||
c + m);
|
||||
m);
|
||||
|
||||
add(i + c,
|
||||
m + c,
|
||||
c + c);
|
||||
c);
|
||||
|
||||
add(m + [3], //! ERROR mismatched types
|
||||
m + [3],
|
||||
|
|
@ -33,8 +33,10 @@ fn add(i: [int], m: [mut int], c: [const int]) {
|
|||
i + [3]);
|
||||
|
||||
add(c + [3], //! ERROR mismatched types
|
||||
c + [3], //! ERROR mismatched types
|
||||
c + [3]);
|
||||
//!^ ERROR binary operation + cannot be applied
|
||||
c + [3], //! ERROR binary operation + cannot be applied
|
||||
//!^ mismatched types
|
||||
[3]);
|
||||
|
||||
add(m + [mut 3], //! ERROR mismatched types
|
||||
m + [mut 3],
|
||||
|
|
@ -44,9 +46,11 @@ fn add(i: [int], m: [mut int], c: [const int]) {
|
|||
i + [mut 3], //! ERROR mismatched types
|
||||
i + [mut 3]);
|
||||
|
||||
add(c + [mut 3], //! ERROR mismatched types
|
||||
c + [mut 3], //! ERROR mismatched types
|
||||
c + [mut 3]);
|
||||
add(c + [mut 3], //! ERROR binary operation + cannot be applied
|
||||
//!^ mismatched types
|
||||
c + [mut 3], //! ERROR binary operation + cannot be applied
|
||||
//!^ mismatched types
|
||||
[mut 3]);
|
||||
|
||||
add(m + i, //! ERROR mismatched types
|
||||
m + i,
|
||||
|
|
@ -56,9 +60,11 @@ fn add(i: [int], m: [mut int], c: [const int]) {
|
|||
i + i, //! ERROR mismatched types
|
||||
i + i);
|
||||
|
||||
add(c + i, //! ERROR mismatched types
|
||||
c + i, //! ERROR mismatched types
|
||||
c + i);
|
||||
add(c + i, //! ERROR binary operation + cannot be applied
|
||||
//!^ ERROR mismatched types
|
||||
c + i, //! ERROR binary operation + cannot be applied
|
||||
//!^ ERROR mismatched types
|
||||
i);
|
||||
|
||||
add(m + m, //! ERROR mismatched types
|
||||
m + m,
|
||||
|
|
@ -68,9 +74,11 @@ fn add(i: [int], m: [mut int], c: [const int]) {
|
|||
i + m, //! ERROR mismatched types
|
||||
i + m);
|
||||
|
||||
add(c + m, //! ERROR mismatched types
|
||||
c + m, //! ERROR mismatched types
|
||||
c + m);
|
||||
add(c + m, //! ERROR binary operation + cannot be applied
|
||||
//!^ ERROR mismatched types
|
||||
c + m, //! ERROR binary operation + cannot be applied
|
||||
//!^ ERROR mismatched types
|
||||
m);
|
||||
|
||||
add(m + c, //! ERROR mismatched types
|
||||
m + c,
|
||||
|
|
@ -80,9 +88,11 @@ fn add(i: [int], m: [mut int], c: [const int]) {
|
|||
i + c, //! ERROR mismatched types
|
||||
i + c);
|
||||
|
||||
add(c + c, //! ERROR mismatched types
|
||||
c + c, //! ERROR mismatched types
|
||||
c + c);
|
||||
add(c + c, //! ERROR binary operation + cannot be applied
|
||||
//!^ ERROR mismatched types
|
||||
c + c, //! ERROR binary operation + cannot be applied
|
||||
//!^ ERROR mismatched types
|
||||
c);
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue