mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
199 lines
4.6 KiB
Plaintext
199 lines
4.6 KiB
Plaintext
error[E0308]: mismatched types
|
|
--> $DIR/deref-suggestion.rs:8:9
|
|
|
|
|
LL | foo(s);
|
|
| --- ^- help: try using a conversion method: `.to_string()`
|
|
| | |
|
|
| | expected `String`, found `&String`
|
|
| arguments to this function are incorrect
|
|
|
|
|
note: function defined here
|
|
--> $DIR/deref-suggestion.rs:5:4
|
|
|
|
|
LL | fn foo(_: String) {}
|
|
| ^^^ ---------
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/deref-suggestion.rs:14:10
|
|
|
|
|
LL | foo3(u);
|
|
| ---- ^ expected `u32`, found `&u32`
|
|
| |
|
|
| arguments to this function are incorrect
|
|
|
|
|
note: function defined here
|
|
--> $DIR/deref-suggestion.rs:12:4
|
|
|
|
|
LL | fn foo3(_: u32) {}
|
|
| ^^^^ ------
|
|
help: consider dereferencing the borrow
|
|
|
|
|
LL | foo3(*u);
|
|
| +
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/deref-suggestion.rs:30:9
|
|
|
|
|
LL | foo(&"aaa".to_owned());
|
|
| --- ^^^^^^^^^^^^^^^^^ expected `String`, found `&String`
|
|
| |
|
|
| arguments to this function are incorrect
|
|
|
|
|
note: function defined here
|
|
--> $DIR/deref-suggestion.rs:5:4
|
|
|
|
|
LL | fn foo(_: String) {}
|
|
| ^^^ ---------
|
|
help: consider removing the borrow
|
|
|
|
|
LL - foo(&"aaa".to_owned());
|
|
LL + foo("aaa".to_owned());
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/deref-suggestion.rs:32:9
|
|
|
|
|
LL | foo(&mut "aaa".to_owned());
|
|
| --- ^^^^^^^^^^^^^^^^^^^^^ expected `String`, found `&mut String`
|
|
| |
|
|
| arguments to this function are incorrect
|
|
|
|
|
note: function defined here
|
|
--> $DIR/deref-suggestion.rs:5:4
|
|
|
|
|
LL | fn foo(_: String) {}
|
|
| ^^^ ---------
|
|
help: consider removing the borrow
|
|
|
|
|
LL - foo(&mut "aaa".to_owned());
|
|
LL + foo("aaa".to_owned());
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/deref-suggestion.rs:34:10
|
|
|
|
|
LL | foo3(borrow!(0));
|
|
| ---- ^^^^^^^^^^ expected `u32`, found `&{integer}`
|
|
| |
|
|
| arguments to this function are incorrect
|
|
|
|
|
note: function defined here
|
|
--> $DIR/deref-suggestion.rs:12:4
|
|
|
|
|
LL | fn foo3(_: u32) {}
|
|
| ^^^^ ------
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/deref-suggestion.rs:37:22
|
|
|
|
|
LL | assert_eq!(3i32, &3i32);
|
|
| ^^^^^ expected `i32`, found `&i32`
|
|
|
|
|
help: consider removing the borrow
|
|
|
|
|
LL - assert_eq!(3i32, &3i32);
|
|
LL + assert_eq!(3i32, 3i32);
|
|
|
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/deref-suggestion.rs:40:17
|
|
|
|
|
LL | let s = S { u };
|
|
| ^ expected `&u32`, found integer
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
LL | let s = S { u: &u };
|
|
| ++++
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/deref-suggestion.rs:42:20
|
|
|
|
|
LL | let s = S { u: u };
|
|
| ^ expected `&u32`, found integer
|
|
|
|
|
help: consider borrowing here
|
|
|
|
|
LL | let s = S { u: &u };
|
|
| +
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/deref-suggestion.rs:45:17
|
|
|
|
|
LL | let r = R { i };
|
|
| ^ expected `u32`, found `&{integer}`
|
|
|
|
|
help: consider dereferencing the borrow
|
|
|
|
|
LL | let r = R { i: *i };
|
|
| ++++
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/deref-suggestion.rs:47:20
|
|
|
|
|
LL | let r = R { i: i };
|
|
| ^ expected `u32`, found `&{integer}`
|
|
|
|
|
help: consider dereferencing the borrow
|
|
|
|
|
LL | let r = R { i: *i };
|
|
| +
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/deref-suggestion.rs:56:9
|
|
|
|
|
LL | b
|
|
| ^ expected `i32`, found `&{integer}`
|
|
|
|
|
help: consider dereferencing the borrow
|
|
|
|
|
LL | *b
|
|
| +
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/deref-suggestion.rs:64:9
|
|
|
|
|
LL | b
|
|
| ^ expected `i32`, found `&{integer}`
|
|
|
|
|
help: consider dereferencing the borrow
|
|
|
|
|
LL | *b
|
|
| +
|
|
|
|
error[E0308]: `if` and `else` have incompatible types
|
|
--> $DIR/deref-suggestion.rs:69:12
|
|
|
|
|
LL | let val = if true {
|
|
| ________________-
|
|
LL | | *a
|
|
| | -- expected because of this
|
|
LL | | } else if true {
|
|
| | ____________^
|
|
LL | ||
|
|
LL | || b
|
|
LL | || } else {
|
|
LL | || &0
|
|
LL | || };
|
|
| || ^
|
|
| ||_____|
|
|
| |_____`if` and `else` have incompatible types
|
|
| expected `i32`, found `&{integer}`
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/deref-suggestion.rs:81:15
|
|
|
|
|
LL | if foo == bar {
|
|
| --- ^^^ expected `Foo`, found `&Foo`
|
|
| |
|
|
| expected because this is `Foo`
|
|
|
|
|
help: consider dereferencing the borrow
|
|
|
|
|
LL | if foo == *bar {
|
|
| +
|
|
|
|
error: aborting due to 14 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|