1
Fork 0

review comments: tweak prefix strings

This commit is contained in:
Esteban Küber 2019-11-14 14:08:08 -08:00
parent 83ffda5216
commit b2e6aef073
130 changed files with 407 additions and 407 deletions

View file

@ -252,7 +252,7 @@ impl<'tcx> ty::TyS<'tcx> {
match self.kind { match self.kind {
ty::Infer(_) | ty::Error | ty::Bool | ty::Char | ty::Int(_) | ty::Infer(_) | ty::Error | ty::Bool | ty::Char | ty::Int(_) |
ty::Uint(_) | ty::Float(_) | ty::Str | ty::Never => "type".into(), ty::Uint(_) | ty::Float(_) | ty::Str | ty::Never => "type".into(),
ty::Tuple(ref tys) if tys.is_empty() => "type".into(), ty::Tuple(ref tys) if tys.is_empty() => "unit type".into(),
ty::Adt(def, _) => def.descr().into(), ty::Adt(def, _) => def.descr().into(),
ty::Foreign(_) => "extern type".into(), ty::Foreign(_) => "extern type".into(),
ty::Array(..) => "array".into(), ty::Array(..) => "array".into(),
@ -264,13 +264,13 @@ impl<'tcx> ty::TyS<'tcx> {
}.into(), }.into(),
ty::FnDef(..) => "fn item".into(), ty::FnDef(..) => "fn item".into(),
ty::FnPtr(_) => "fn pointer".into(), ty::FnPtr(_) => "fn pointer".into(),
ty::Dynamic(..) => "trait".into(), ty::Dynamic(..) => "trait object".into(),
ty::Closure(..) => "closure".into(), ty::Closure(..) => "closure".into(),
ty::Generator(..) => "generator".into(), ty::Generator(..) => "generator".into(),
ty::GeneratorWitness(..) => "generator witness".into(), ty::GeneratorWitness(..) => "generator witness".into(),
ty::Tuple(..) => "tuple".into(), ty::Tuple(..) => "tuple".into(),
ty::Placeholder(..) => "placeholder type".into(), ty::Placeholder(..) => "higher-ranked type".into(),
ty::Bound(..) => "bound type".into(), ty::Bound(..) => "bound type variable".into(),
ty::Projection(_) => "associated type".into(), ty::Projection(_) => "associated type".into(),
ty::UnnormalizedProjection(_) => "associated type".into(), ty::UnnormalizedProjection(_) => "associated type".into(),
ty::Param(_) => "type parameter".into(), ty::Param(_) => "type parameter".into(),

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | fn main() { let i: (); i = f(()); } LL | fn main() { let i: (); i = f(()); }
| ^^ expected isize, found () | ^^ expected isize, found ()
| |
= note: expected type `isize` = note: expected type `isize`
found type `()` found unit type `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -16,8 +16,8 @@ error[E0308]: mismatched types
LL | |_: [_; break]| {} LL | |_: [_; break]| {}
| ^^^^^^^^^^^^^^^^^^ expected (), found closure | ^^^^^^^^^^^^^^^^^^ expected (), found closure
| |
= note: expected type `()` = note: expected unit type `()`
found closure `[closure@$DIR/array-break-length.rs:3:9: 3:27]` found closure `[closure@$DIR/array-break-length.rs:3:9: 3:27]`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/array-break-length.rs:8:9 --> $DIR/array-break-length.rs:8:9
@ -25,8 +25,8 @@ error[E0308]: mismatched types
LL | |_: [_; continue]| {} LL | |_: [_; continue]| {}
| ^^^^^^^^^^^^^^^^^^^^^ expected (), found closure | ^^^^^^^^^^^^^^^^^^^^^ expected (), found closure
| |
= note: expected type `()` = note: expected unit type `()`
found closure `[closure@$DIR/array-break-length.rs:8:9: 8:30]` found closure `[closure@$DIR/array-break-length.rs:8:9: 8:30]`
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View file

@ -7,8 +7,8 @@ LL | fn visit() {}
LL | <() as Visit>::visit(); LL | <() as Visit>::visit();
| ^^^^^^^^^^^^^^^^^^^^ expected (), found &() | ^^^^^^^^^^^^^^^^^^^^ expected (), found &()
| |
= note: expected type `()` = note: expected unit type `()`
found reference `&()` found reference `&()`
= note: required because of the requirements on the impl of `Visit` for `()` = note: required because of the requirements on the impl of `Visit` for `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -9,8 +9,8 @@ LL | impl Bar for Foo {
LL | type Ok = (); LL | type Ok = ();
| ^^^^^^^^^^^^^ expected u32, found () | ^^^^^^^^^^^^^ expected u32, found ()
| |
= note: expected type `u32` = note: expected type `u32`
found type `()` found unit type `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -26,8 +26,8 @@ LL | fn return_targets_async_block_not_fn() -> u8 {
| | | |
| implicitly returns `()` as its body has no tail or `return` expression | implicitly returns `()` as its body has no tail or `return` expression
| |
= note: expected type `u8` = note: expected type `u8`
found type `()` found unit type `()`
error[E0271]: type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == ()` error[E0271]: type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == ()`
--> $DIR/async-block-control-flow-static-semantics.rs:18:39 --> $DIR/async-block-control-flow-static-semantics.rs:18:39
@ -35,8 +35,8 @@ error[E0271]: type mismatch resolving `<impl std::future::Future as std::future:
LL | let _: &dyn Future<Output = ()> = &block; LL | let _: &dyn Future<Output = ()> = &block;
| ^^^^^^ expected (), found u8 | ^^^^^^ expected (), found u8
| |
= note: expected type `()` = note: expected unit type `()`
found type `u8` found type `u8`
= note: required for the cast to the object type `dyn std::future::Future<Output = ()>` = note: required for the cast to the object type `dyn std::future::Future<Output = ()>`
error[E0308]: mismatched types error[E0308]: mismatched types
@ -52,8 +52,8 @@ LL | |
LL | | } LL | | }
| |_^ expected u8, found () | |_^ expected u8, found ()
| |
= note: expected type `u8` = note: expected type `u8`
found type `()` found unit type `()`
error[E0271]: type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == ()` error[E0271]: type mismatch resolving `<impl std::future::Future as std::future::Future>::Output == ()`
--> $DIR/async-block-control-flow-static-semantics.rs:27:39 --> $DIR/async-block-control-flow-static-semantics.rs:27:39
@ -61,8 +61,8 @@ error[E0271]: type mismatch resolving `<impl std::future::Future as std::future:
LL | let _: &dyn Future<Output = ()> = &block; LL | let _: &dyn Future<Output = ()> = &block;
| ^^^^^^ expected (), found u8 | ^^^^^^ expected (), found u8
| |
= note: expected type `()` = note: expected unit type `()`
found type `u8` found type `u8`
= note: required for the cast to the object type `dyn std::future::Future<Output = ()>` = note: required for the cast to the object type `dyn std::future::Future<Output = ()>`
error[E0308]: mismatched types error[E0308]: mismatched types
@ -73,8 +73,8 @@ LL | fn rethrow_targets_async_block_not_fn() -> Result<u8, MyErr> {
| | | |
| implicitly returns `()` as its body has no tail or `return` expression | implicitly returns `()` as its body has no tail or `return` expression
| |
= note: expected enum `std::result::Result<u8, MyErr>` = note: expected enum `std::result::Result<u8, MyErr>`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/async-block-control-flow-static-semantics.rs:57:50 --> $DIR/async-block-control-flow-static-semantics.rs:57:50
@ -84,8 +84,8 @@ LL | fn rethrow_targets_async_block_not_async_fn() -> Result<u8, MyErr> {
| | | |
| implicitly returns `()` as its body has no tail or `return` expression | implicitly returns `()` as its body has no tail or `return` expression
| |
= note: expected enum `std::result::Result<u8, MyErr>` = note: expected enum `std::result::Result<u8, MyErr>`
found type `()` found unit type `()`
error: aborting due to 8 previous errors error: aborting due to 8 previous errors

View file

@ -9,8 +9,8 @@ LL | | foo();
LL | | }; LL | | };
| |_____^ expected i32, found () | |_____^ expected i32, found ()
| |
= note: expected type `i32` = note: expected type `i32`
found type `()` found unit type `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | true LL | true
| ^^^^ expected (), found bool | ^^^^ expected (), found bool
| |
= note: expected type `()` = note: expected unit type `()`
found type `bool` found type `bool`
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,8 +6,8 @@ LL | fn drop(&mut self) {
LL | true LL | true
| ^^^^ expected (), found bool | ^^^^ expected (), found bool
| |
= note: expected type `()` = note: expected unit type `()`
found type `bool` found type `bool`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,7 +1,7 @@
fn main() { fn main() {
while true { //~ WARN denote infinite loops with while true { //~ WARN denote infinite loops with
true //~ ERROR mismatched types true //~ ERROR mismatched types
//~| expected type `()` //~| expected unit type `()`
//~| found type `bool` //~| found type `bool`
//~| expected (), found bool //~| expected (), found bool
} }

View file

@ -12,8 +12,8 @@ error[E0308]: mismatched types
LL | true LL | true
| ^^^^ expected (), found bool | ^^^^ expected (), found bool
| |
= note: expected type `()` = note: expected unit type `()`
found type `bool` found type `bool`
error: aborting due to previous error error: aborting due to previous error

View file

@ -10,7 +10,7 @@ LL | "bla".to_string();
| - help: consider removing this semicolon | - help: consider removing this semicolon
| |
= note: expected struct `std::string::String` = note: expected struct `std::string::String`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/consider-removing-last-semi.rs:6:11 --> $DIR/consider-removing-last-semi.rs:6:11
@ -24,7 +24,7 @@ LL | "removeme".to_string();
| - help: consider removing this semicolon | - help: consider removing this semicolon
| |
= note: expected struct `std::string::String` = note: expected struct `std::string::String`
found type `()` found unit type `()`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -9,8 +9,8 @@ LL | fn blah() -> i32 {
LL | ; LL | ;
| - help: consider removing this semicolon | - help: consider removing this semicolon
| |
= note: expected type `i32` = note: expected type `i32`
found type `()` found unit type `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -10,7 +10,7 @@ LL | ;
| - help: consider removing this semicolon | - help: consider removing this semicolon
| |
= note: expected struct `std::string::String` = note: expected struct `std::string::String`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/issue-13428.rs:11:13 --> $DIR/issue-13428.rs:11:13
@ -24,7 +24,7 @@ LL | ;
| - help: consider removing this semicolon | - help: consider removing this semicolon
| |
= note: expected struct `std::string::String` = note: expected struct `std::string::String`
found type `()` found unit type `()`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -7,7 +7,7 @@ mod a {
Enum::EnumStructVariant { x: 1, y: 2, z: 3 } Enum::EnumStructVariant { x: 1, y: 2, z: 3 }
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected (), found enum `a::Enum` //~| expected (), found enum `a::Enum`
//~| expected type `()` //~| expected unit type `()`
//~| found enum `a::Enum` //~| found enum `a::Enum`
} }
} }
@ -22,7 +22,7 @@ mod b {
a::Enum::EnumStructVariant { x, y, z } => { a::Enum::EnumStructVariant { x, y, z } => {
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected (), found enum `a::Enum` //~| expected (), found enum `a::Enum`
//~| expected type `()` //~| expected unit type `()`
//~| found enum `a::Enum` //~| found enum `a::Enum`
} }
} }

View file

@ -6,8 +6,8 @@ LL | pub fn get_enum_struct_variant() -> () {
LL | Enum::EnumStructVariant { x: 1, y: 2, z: 3 } LL | Enum::EnumStructVariant { x: 1, y: 2, z: 3 }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum`
| |
= note: expected type `()` = note: expected unit type `()`
found enum `a::Enum` found enum `a::Enum`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/issue-13624.rs:22:9 --> $DIR/issue-13624.rs:22:9
@ -17,8 +17,8 @@ LL | match enum_struct_variant {
LL | a::Enum::EnumStructVariant { x, y, z } => { LL | a::Enum::EnumStructVariant { x, y, z } => {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found enum `a::Enum`
| |
= note: expected type `()` = note: expected unit type `()`
found enum `a::Enum` found enum `a::Enum`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -6,8 +6,8 @@ LL | fn foo(x: i32) {
LL | |y| x + y LL | |y| x + y
| ^^^^^^^^^ expected (), found closure | ^^^^^^^^^ expected (), found closure
| |
= note: expected type `()` = note: expected unit type `()`
found closure `[closure@$DIR/issue-20862.rs:2:5: 2:14 x:_]` found closure `[closure@$DIR/issue-20862.rs:2:5: 2:14 x:_]`
error[E0618]: expected function, found `()` error[E0618]: expected function, found `()`
--> $DIR/issue-20862.rs:7:13 --> $DIR/issue-20862.rs:7:13

View file

@ -17,8 +17,8 @@ LL | let b = Bob + 3.5;
LL | b + 3 LL | b + 3
| ^^^^^ expected (), found struct `Bob` | ^^^^^ expected (), found struct `Bob`
| |
= note: expected type `()` = note: expected unit type `()`
found struct `Bob` found struct `Bob`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -1,7 +1,7 @@
fn main() { fn main() {
&panic!() &panic!()
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected type `()` //~| expected unit type `()`
//~| found reference `&_` //~| found reference `&_`
//~| expected (), found reference //~| expected (), found reference
} }

View file

@ -9,8 +9,8 @@ LL | &panic!()
| expected (), found reference | expected (), found reference
| help: consider removing the borrow: `panic!()` | help: consider removing the borrow: `panic!()`
| |
= note: expected type `()` = note: expected unit type `()`
found reference `&_` found reference `&_`
error: aborting due to previous error error: aborting due to previous error

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | foo() LL | foo()
| ^^^^^ expected (), found usize | ^^^^^ expected (), found usize
| |
= note: expected type `()` = note: expected unit type `()`
found type `usize` found type `usize`
help: try adding a semicolon help: try adding a semicolon
| |
LL | foo(); LL | foo();

View file

@ -7,8 +7,8 @@ LL | | 'a: while break 'a {};
LL | | }; LL | | };
| |_________^ expected !, found () | |_________^ expected !, found ()
| |
= note: expected type `!` = note: expected type `!`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/break-while-condition.rs:16:13 --> $DIR/break-while-condition.rs:16:13
@ -18,8 +18,8 @@ LL | | break
LL | | } LL | | }
| |_____________^ expected !, found () | |_____________^ expected !, found ()
| |
= note: expected type `!` = note: expected type `!`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/break-while-condition.rs:24:13 --> $DIR/break-while-condition.rs:24:13
@ -29,8 +29,8 @@ LL | | return
LL | | } LL | | }
| |_____________^ expected !, found () | |_____________^ expected !, found ()
| |
= note: expected type `!` = note: expected type `!`
found type `()` found unit type `()`
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View file

@ -12,8 +12,8 @@ LL | fn foo() {
LL | "bar boo" LL | "bar boo"
| ^^^^^^^^^^^^^^^^^^^^ expected (), found reference | ^^^^^^^^^^^^^^^^^^^^ expected (), found reference
| |
= note: expected type `()` = note: expected unit type `()`
found reference `&'static str` found reference `&'static str`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -8,8 +8,8 @@ LL | fn plus_one(x: i32) -> i32 {
LL | x + 1; LL | x + 1;
| - help: consider removing this semicolon | - help: consider removing this semicolon
| |
= note: expected type `i32` = note: expected type `i32`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/coercion-missing-tail-expected-type.rs:7:13 --> $DIR/coercion-missing-tail-expected-type.rs:7:13
@ -21,8 +21,8 @@ LL | fn foo() -> Result<u8, u64> {
LL | Ok(1); LL | Ok(1);
| - help: consider removing this semicolon | - help: consider removing this semicolon
| |
= note: expected enum `std::result::Result<u8, u64>` = note: expected enum `std::result::Result<u8, u64>`
found type `()` found unit type `()`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -31,16 +31,16 @@ fn main() {
// n > m // n > m
let &&x = &1isize as &dyn T; let &&x = &1isize as &dyn T;
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected trait `dyn T` //~| expected trait object `dyn T`
//~| found reference `&_` //~| found reference `&_`
//~| expected trait T, found reference //~| expected trait T, found reference
let &&&x = &(&1isize as &dyn T); let &&&x = &(&1isize as &dyn T);
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected trait `dyn T` //~| expected trait object `dyn T`
//~| found reference `&_` //~| found reference `&_`
//~| expected trait T, found reference //~| expected trait T, found reference
let box box x = box 1isize as Box<dyn T>; let box box x = box 1isize as Box<dyn T>;
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected trait `dyn T` //~| expected trait object `dyn T`
//~| found struct `std::boxed::Box<_>` //~| found struct `std::boxed::Box<_>`
} }

View file

@ -25,8 +25,8 @@ LL | let &&x = &1isize as &dyn T;
| expected trait T, found reference | expected trait T, found reference
| help: you can probably remove the explicit borrow: `x` | help: you can probably remove the explicit borrow: `x`
| |
= note: expected trait `dyn T` = note: expected trait object `dyn T`
found reference `&_` found reference `&_`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/destructure-trait-ref.rs:37:11 --> $DIR/destructure-trait-ref.rs:37:11
@ -37,8 +37,8 @@ LL | let &&&x = &(&1isize as &dyn T);
| expected trait T, found reference | expected trait T, found reference
| help: you can probably remove the explicit borrow: `x` | help: you can probably remove the explicit borrow: `x`
| |
= note: expected trait `dyn T` = note: expected trait object `dyn T`
found reference `&_` found reference `&_`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/destructure-trait-ref.rs:42:13 --> $DIR/destructure-trait-ref.rs:42:13
@ -46,8 +46,8 @@ error[E0308]: mismatched types
LL | let box box x = box 1isize as Box<dyn T>; LL | let box box x = box 1isize as Box<dyn T>;
| ^^^^^ expected trait T, found struct `std::boxed::Box` | ^^^^^ expected trait T, found struct `std::boxed::Box`
| |
= note: expected trait `dyn T` = note: expected trait object `dyn T`
found struct `std::boxed::Box<_>` found struct `std::boxed::Box<_>`
error: aborting due to 6 previous errors error: aborting due to 6 previous errors

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | &panic!() LL | &panic!()
| ^^^^^^^^^ expected (), found reference | ^^^^^^^^^ expected (), found reference
| |
= note: expected type `()` = note: expected unit type `()`
found reference `&_` found reference `&_`
help: try adding a return type help: try adding a return type
| |
LL | fn g() -> &_ { LL | fn g() -> &_ {

View file

@ -33,7 +33,7 @@ pub fn main() {
f5.2 = Bar1 {f: 36}; f5.2 = Bar1 {f: 36};
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected trait ToBar, found struct `Bar1` //~| expected trait ToBar, found struct `Bar1`
//~| expected trait `dyn ToBar` //~| expected trait object `dyn ToBar`
//~| found struct `Bar1` //~| found struct `Bar1`
//~| ERROR the size for values of type //~| ERROR the size for values of type
} }

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | f5.2 = Bar1 {f: 36}; LL | f5.2 = Bar1 {f: 36};
| ^^^^^^^^^^^^ expected trait ToBar, found struct `Bar1` | ^^^^^^^^^^^^ expected trait ToBar, found struct `Bar1`
| |
= note: expected trait `dyn ToBar` = note: expected trait object `dyn ToBar`
found struct `Bar1` found struct `Bar1`
error[E0277]: the size for values of type `dyn ToBar` cannot be known at compilation time error[E0277]: the size for values of type `dyn ToBar` cannot be known at compilation time
--> $DIR/dst-bad-assign-3.rs:33:5 --> $DIR/dst-bad-assign-3.rs:33:5

View file

@ -35,7 +35,7 @@ pub fn main() {
f5.ptr = Bar1 {f: 36}; f5.ptr = Bar1 {f: 36};
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected trait ToBar, found struct `Bar1` //~| expected trait ToBar, found struct `Bar1`
//~| expected trait `dyn ToBar` //~| expected trait object `dyn ToBar`
//~| found struct `Bar1` //~| found struct `Bar1`
//~| ERROR the size for values of type //~| ERROR the size for values of type
} }

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | f5.ptr = Bar1 {f: 36}; LL | f5.ptr = Bar1 {f: 36};
| ^^^^^^^^^^^^ expected trait ToBar, found struct `Bar1` | ^^^^^^^^^^^^ expected trait ToBar, found struct `Bar1`
| |
= note: expected trait `dyn ToBar` = note: expected trait object `dyn ToBar`
found struct `Bar1` found struct `Bar1`
error[E0277]: the size for values of type `dyn ToBar` cannot be known at compilation time error[E0277]: the size for values of type `dyn ToBar` cannot be known at compilation time
--> $DIR/dst-bad-assign.rs:35:5 --> $DIR/dst-bad-assign.rs:35:5

View file

@ -16,8 +16,8 @@ error[E0308]: mismatched types
LL | some_other_func() = 4; LL | some_other_func() = 4;
| ^ expected (), found integer | ^ expected (), found integer
| |
= note: expected type `()` = note: expected unit type `()`
found type `{integer}` found type `{integer}`
error[E0070]: invalid left-hand side expression error[E0070]: invalid left-hand side expression
--> $DIR/E0070.rs:8:5 --> $DIR/E0070.rs:8:5

View file

@ -5,15 +5,15 @@ fn needs_fn<F>(x: F) where F: Fn(isize) -> isize {}
fn main() { fn main() {
let _: () = (box |_: isize| {}) as Box<dyn FnOnce(isize)>; let _: () = (box |_: isize| {}) as Box<dyn FnOnce(isize)>;
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected type `()` //~| expected unit type `()`
//~| found struct `std::boxed::Box<dyn std::ops::FnOnce(isize)>` //~| found struct `std::boxed::Box<dyn std::ops::FnOnce(isize)>`
let _: () = (box |_: isize, isize| {}) as Box<dyn Fn(isize, isize)>; let _: () = (box |_: isize, isize| {}) as Box<dyn Fn(isize, isize)>;
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected type `()` //~| expected unit type `()`
//~| found struct `std::boxed::Box<dyn std::ops::Fn(isize, isize)>` //~| found struct `std::boxed::Box<dyn std::ops::Fn(isize, isize)>`
let _: () = (box || -> isize { unimplemented!() }) as Box<dyn FnMut() -> isize>; let _: () = (box || -> isize { unimplemented!() }) as Box<dyn FnMut() -> isize>;
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected type `()` //~| expected unit type `()`
//~| found struct `std::boxed::Box<dyn std::ops::FnMut() -> isize>` //~| found struct `std::boxed::Box<dyn std::ops::FnMut() -> isize>`
needs_fn(1); needs_fn(1);

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | let _: () = (box |_: isize| {}) as Box<dyn FnOnce(isize)>; LL | let _: () = (box |_: isize| {}) as Box<dyn FnOnce(isize)>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box`
| |
= note: expected type `()` = note: expected unit type `()`
found struct `std::boxed::Box<dyn std::ops::FnOnce(isize)>` found struct `std::boxed::Box<dyn std::ops::FnOnce(isize)>`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/fn-trait-formatting.rs:10:17 --> $DIR/fn-trait-formatting.rs:10:17
@ -13,8 +13,8 @@ error[E0308]: mismatched types
LL | let _: () = (box |_: isize, isize| {}) as Box<dyn Fn(isize, isize)>; LL | let _: () = (box |_: isize, isize| {}) as Box<dyn Fn(isize, isize)>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box`
| |
= note: expected type `()` = note: expected unit type `()`
found struct `std::boxed::Box<dyn std::ops::Fn(isize, isize)>` found struct `std::boxed::Box<dyn std::ops::Fn(isize, isize)>`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/fn-trait-formatting.rs:14:17 --> $DIR/fn-trait-formatting.rs:14:17
@ -22,8 +22,8 @@ error[E0308]: mismatched types
LL | let _: () = (box || -> isize { unimplemented!() }) as Box<dyn FnMut() -> isize>; LL | let _: () = (box || -> isize { unimplemented!() }) as Box<dyn FnMut() -> isize>;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `std::boxed::Box`
| |
= note: expected type `()` = note: expected unit type `()`
found struct `std::boxed::Box<dyn std::ops::FnMut() -> isize>` found struct `std::boxed::Box<dyn std::ops::FnMut() -> isize>`
error[E0277]: expected a `std::ops::Fn<(isize,)>` closure, found `{integer}` error[E0277]: expected a `std::ops::Fn<(isize,)>` closure, found `{integer}`
--> $DIR/fn-trait-formatting.rs:19:14 --> $DIR/fn-trait-formatting.rs:19:14

View file

@ -14,38 +14,38 @@ fn main() {
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected struct `Foo`, found () //~| expected struct `Foo`, found ()
//~| expected struct `Foo<isize>` //~| expected struct `Foo<isize>`
//~| found type `()` //~| found unit type `()`
// ...even when they're present, but the same types as the defaults. // ...even when they're present, but the same types as the defaults.
let _: Foo<isize, B, C> = (); let _: Foo<isize, B, C> = ();
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected struct `Foo`, found () //~| expected struct `Foo`, found ()
//~| expected struct `Foo<isize>` //~| expected struct `Foo<isize>`
//~| found type `()` //~| found unit type `()`
// Including cases where the default is using previous type params. // Including cases where the default is using previous type params.
let _: HashMap<String, isize> = (); let _: HashMap<String, isize> = ();
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected struct `HashMap`, found () //~| expected struct `HashMap`, found ()
//~| expected struct `HashMap<std::string::String, isize>` //~| expected struct `HashMap<std::string::String, isize>`
//~| found type `()` //~| found unit type `()`
let _: HashMap<String, isize, Hash<String>> = (); let _: HashMap<String, isize, Hash<String>> = ();
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected struct `HashMap`, found () //~| expected struct `HashMap`, found ()
//~| expected struct `HashMap<std::string::String, isize>` //~| expected struct `HashMap<std::string::String, isize>`
//~| found type `()` //~| found unit type `()`
// But not when there's a different type in between. // But not when there's a different type in between.
let _: Foo<A, isize, C> = (); let _: Foo<A, isize, C> = ();
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected struct `Foo`, found () //~| expected struct `Foo`, found ()
//~| expected struct `Foo<A, isize>` //~| expected struct `Foo<A, isize>`
//~| found type `()` //~| found unit type `()`
// And don't print <> at all when there's just defaults. // And don't print <> at all when there's just defaults.
let _: Foo<A, B, C> = (); let _: Foo<A, B, C> = ();
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected struct `Foo`, found () //~| expected struct `Foo`, found ()
//~| expected struct `Foo` //~| expected struct `Foo`
//~| found type `()` //~| found unit type `()`
} }

View file

@ -5,7 +5,7 @@ LL | let _: Foo<isize> = ();
| ^^ expected struct `Foo`, found () | ^^ expected struct `Foo`, found ()
| |
= note: expected struct `Foo<isize>` = note: expected struct `Foo<isize>`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/generic-type-params-name-repr.rs:20:31 --> $DIR/generic-type-params-name-repr.rs:20:31
@ -14,7 +14,7 @@ LL | let _: Foo<isize, B, C> = ();
| ^^ expected struct `Foo`, found () | ^^ expected struct `Foo`, found ()
| |
= note: expected struct `Foo<isize>` = note: expected struct `Foo<isize>`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/generic-type-params-name-repr.rs:27:37 --> $DIR/generic-type-params-name-repr.rs:27:37
@ -23,7 +23,7 @@ LL | let _: HashMap<String, isize> = ();
| ^^ expected struct `HashMap`, found () | ^^ expected struct `HashMap`, found ()
| |
= note: expected struct `HashMap<std::string::String, isize>` = note: expected struct `HashMap<std::string::String, isize>`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/generic-type-params-name-repr.rs:32:51 --> $DIR/generic-type-params-name-repr.rs:32:51
@ -32,7 +32,7 @@ LL | let _: HashMap<String, isize, Hash<String>> = ();
| ^^ expected struct `HashMap`, found () | ^^ expected struct `HashMap`, found ()
| |
= note: expected struct `HashMap<std::string::String, isize>` = note: expected struct `HashMap<std::string::String, isize>`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/generic-type-params-name-repr.rs:39:31 --> $DIR/generic-type-params-name-repr.rs:39:31
@ -41,7 +41,7 @@ LL | let _: Foo<A, isize, C> = ();
| ^^ expected struct `Foo`, found () | ^^ expected struct `Foo`, found ()
| |
= note: expected struct `Foo<A, isize>` = note: expected struct `Foo<A, isize>`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/generic-type-params-name-repr.rs:46:27 --> $DIR/generic-type-params-name-repr.rs:46:27
@ -50,7 +50,7 @@ LL | let _: Foo<A, B, C> = ();
| ^^ expected struct `Foo`, found () | ^^ expected struct `Foo`, found ()
| |
= note: expected struct `Foo` = note: expected struct `Foo`
found type `()` found unit type `()`
error: aborting due to 6 previous errors error: aborting due to 6 previous errors

View file

@ -60,8 +60,8 @@ LL | | 6u32;
LL | | }; LL | | };
| |_____- if and else have incompatible types | |_____- if and else have incompatible types
| |
= note: expected type `u32` = note: expected type `u32`
found type `()` found unit type `()`
error[E0308]: if and else have incompatible types error[E0308]: if and else have incompatible types
--> $DIR/if-else-type-mismatch.rs:25:9 --> $DIR/if-else-type-mismatch.rs:25:9
@ -92,8 +92,8 @@ LL | | 10u32;
LL | | }; LL | | };
| |_____- if and else have incompatible types | |_____- if and else have incompatible types
| |
= note: expected type `i32` = note: expected type `i32`
found type `()` found unit type `()`
error[E0308]: if and else have incompatible types error[E0308]: if and else have incompatible types
--> $DIR/if-else-type-mismatch.rs:37:9 --> $DIR/if-else-type-mismatch.rs:37:9
@ -122,8 +122,8 @@ LL | |
LL | | }; LL | | };
| |_____^ expected i32, found () | |_____^ expected i32, found ()
| |
= note: expected type `i32` = note: expected type `i32`
found type `()` found unit type `()`
error: aborting due to 8 previous errors error: aborting due to 8 previous errors

View file

@ -8,8 +8,8 @@ LL | | return 3;
LL | | } LL | | }
| |_____^ expected usize, found () | |_____^ expected usize, found ()
| |
= note: expected type `usize` = note: expected type `usize`
found type `()` found unit type `()`
= note: `if` expressions without `else` evaluate to `()` = note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type = help: consider adding an `else` block that evaluates to the expected type
@ -24,8 +24,8 @@ LL | | return 3;
LL | | }; LL | | };
| |_____^ expected usize, found () | |_____^ expected usize, found ()
| |
= note: expected type `usize` = note: expected type `usize`
found type `()` found unit type `()`
= note: `if` expressions without `else` evaluate to `()` = note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type = help: consider adding an `else` block that evaluates to the expected type
@ -39,8 +39,8 @@ LL | | 3
LL | | } LL | | }
| |_____^ expected usize, found () | |_____^ expected usize, found ()
| |
= note: expected type `usize` = note: expected type `usize`
found type `()` found unit type `()`
= note: `if` expressions without `else` evaluate to `()` = note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type = help: consider adding an `else` block that evaluates to the expected type
@ -54,8 +54,8 @@ LL | | return 3;
LL | | } LL | | }
| |_____^ expected usize, found () | |_____^ expected usize, found ()
| |
= note: expected type `usize` = note: expected type `usize`
found type `()` found unit type `()`
= note: `if` expressions without `else` evaluate to `()` = note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type = help: consider adding an `else` block that evaluates to the expected type
@ -70,8 +70,8 @@ LL | | return 3;
LL | | }; LL | | };
| |_____^ expected usize, found () | |_____^ expected usize, found ()
| |
= note: expected type `usize` = note: expected type `usize`
found type `()` found unit type `()`
= note: `if` expressions without `else` evaluate to `()` = note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type = help: consider adding an `else` block that evaluates to the expected type
@ -85,8 +85,8 @@ LL | | 3
LL | | } LL | | }
| |_____^ expected usize, found () | |_____^ expected usize, found ()
| |
= note: expected type `usize` = note: expected type `usize`
found type `()` found unit type `()`
= note: `if` expressions without `else` evaluate to `()` = note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type = help: consider adding an `else` block that evaluates to the expected type

View file

@ -1,7 +1,7 @@
fn main() { fn main() {
let a = if true { true }; let a = if true { true };
//~^ ERROR if may be missing an else clause [E0317] //~^ ERROR if may be missing an else clause [E0317]
//~| expected type `()` //~| expected unit type `()`
//~| found type `bool` //~| found type `bool`
//~| expected (), found bool //~| expected (), found bool
println!("{}", a); println!("{}", a);

View file

@ -7,8 +7,8 @@ LL | let a = if true { true };
| | found here | | found here
| expected (), found bool | expected (), found bool
| |
= note: expected type `()` = note: expected unit type `()`
found type `bool` found type `bool`
= note: `if` expressions without `else` evaluate to `()` = note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type = help: consider adding an `else` block that evaluates to the expected type

View file

@ -16,8 +16,8 @@ LL | | _ => true
LL | | } LL | | }
| |_____- `match` arms have incompatible types | |_____- `match` arms have incompatible types
| |
= note: expected type `bool` = note: expected type `bool`
found type `()` found unit type `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -7,7 +7,7 @@ fn main() {
match () { match () {
Slice { data: data, len: len } => (), Slice { data: data, len: len } => (),
//~^ ERROR mismatched types //~^ ERROR mismatched types
//~| expected type `()` //~| expected unit type `()`
//~| found struct `Slice<_>` //~| found struct `Slice<_>`
//~| expected (), found struct `Slice` //~| expected (), found struct `Slice`
_ => unreachable!() _ => unreachable!()

View file

@ -6,8 +6,8 @@ LL | match () {
LL | Slice { data: data, len: len } => (), LL | Slice { data: data, len: len } => (),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `Slice` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `Slice`
| |
= note: expected type `()` = note: expected unit type `()`
found struct `Slice<_>` found struct `Slice<_>`
error: aborting due to previous error error: aborting due to previous error

View file

@ -1,7 +1,7 @@
fn f<'r>(p: &'r mut fn(p: &mut ())) { fn f<'r>(p: &'r mut fn(p: &mut ())) {
(*p)(()) //~ ERROR mismatched types (*p)(()) //~ ERROR mismatched types
//~| expected mutable reference `&mut ()` //~| expected mutable reference `&mut ()`
//~| found type `()` //~| found unit type `()`
//~| expected &mut (), found () //~| expected &mut (), found ()
} }

View file

@ -8,7 +8,7 @@ LL | (*p)(())
| help: consider mutably borrowing here: `&mut ()` | help: consider mutably borrowing here: `&mut ()`
| |
= note: expected mutable reference `&mut ()` = note: expected mutable reference `&mut ()`
found type `()` found unit type `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -13,8 +13,8 @@ LL | | _ => None
LL | | } LL | | }
| |_____- `match` arms have incompatible types | |_____- `match` arms have incompatible types
| |
= note: expected type `RoomDirection` = note: expected enum `RoomDirection`
found type `std::option::Option<_>` found enum `std::option::Option<_>`
error: aborting due to previous error error: aborting due to previous error

View file

@ -3,7 +3,7 @@
fn main() { fn main() {
if let Some(homura) = Some("madoka") { //~ ERROR missing an else clause if let Some(homura) = Some("madoka") { //~ ERROR missing an else clause
//~| expected type `()` //~| expected unit type `()`
//~| found type `{integer}` //~| found type `{integer}`
//~| expected (), found integer //~| expected (), found integer
765 765

View file

@ -10,8 +10,8 @@ LL | | 765
LL | | }; LL | | };
| |_____^ expected (), found integer | |_____^ expected (), found integer
| |
= note: expected type `()` = note: expected unit type `()`
found type `{integer}` found type `{integer}`
= note: `if` expressions without `else` evaluate to `()` = note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type = help: consider adding an `else` block that evaluates to the expected type

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | let _: () = foo::Foo.bar(); LL | let _: () = foo::Foo.bar();
| ^^^^^^^^^^^^^^ expected (), found bool | ^^^^^^^^^^^^^^ expected (), found bool
| |
= note: expected type `()` = note: expected unit type `()`
found type `bool` found type `bool`
error: aborting due to previous error error: aborting due to previous error

View file

@ -17,8 +17,8 @@ LL | loop { break };
| expected i32, found () | expected i32, found ()
| help: give it a value of the expected type: `break 42` | help: give it a value of the expected type: `break 42`
| |
= note: expected type `i32` = note: expected type `i32`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/issue-27042.rs:8:9 --> $DIR/issue-27042.rs:8:9
@ -28,8 +28,8 @@ LL | |
LL | | while true { break }; // but here we cite the whole loop LL | | while true { break }; // but here we cite the whole loop
| |____________________________^ expected i32, found () | |____________________________^ expected i32, found ()
| |
= note: expected type `i32` = note: expected type `i32`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/issue-27042.rs:12:9 --> $DIR/issue-27042.rs:12:9
@ -38,8 +38,8 @@ LL | / 'c:
LL | | for _ in None { break }; // but here we cite the whole loop LL | | for _ in None { break }; // but here we cite the whole loop
| |_______________________________^ expected i32, found () | |_______________________________^ expected i32, found ()
| |
= note: expected type `i32` = note: expected type `i32`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/issue-27042.rs:15:9 --> $DIR/issue-27042.rs:15:9
@ -48,8 +48,8 @@ LL | / 'd:
LL | | while let Some(_) = None { break }; LL | | while let Some(_) = None { break };
| |__________________________________________^ expected i32, found () | |__________________________________________^ expected i32, found ()
| |
= note: expected type `i32` = note: expected type `i32`
found type `()` found unit type `()`
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View file

@ -7,7 +7,7 @@ LL | pub fn f<'a, T: Tr<'a>>() -> <T as Tr<'a>>::Out {}
| implicitly returns `()` as its body has no tail or `return` expression | implicitly returns `()` as its body has no tail or `return` expression
| |
= note: expected associated type `<T as Tr<'a>>::Out` = note: expected associated type `<T as Tr<'a>>::Out`
found type `()` found unit type `()`
= note: consider constraining the associated type `<T as Tr<'a>>::Out` to `()` or calling a method that returns `<T as Tr<'a>>::Out` = note: consider constraining the associated type `<T as Tr<'a>>::Out` to `()` or calling a method that returns `<T as Tr<'a>>::Out`
= note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html = note: for more information, visit https://doc.rust-lang.org/book/ch19-03-advanced-traits.html

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | let empty_struct::XEmpty2 = (); LL | let empty_struct::XEmpty2 = ();
| ^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `empty_struct::XEmpty2` | ^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `empty_struct::XEmpty2`
| |
= note: expected type `()` = note: expected unit type `()`
found struct `empty_struct::XEmpty2` found struct `empty_struct::XEmpty2`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/issue-37026.rs:7:9 --> $DIR/issue-37026.rs:7:9
@ -13,8 +13,8 @@ error[E0308]: mismatched types
LL | let empty_struct::XEmpty6(..) = (); LL | let empty_struct::XEmpty6(..) = ();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `empty_struct::XEmpty6` | ^^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found struct `empty_struct::XEmpty6`
| |
= note: expected type `()` = note: expected unit type `()`
found struct `empty_struct::XEmpty6` found struct `empty_struct::XEmpty6`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | let x: () = 0; LL | let x: () = 0;
| ^ expected (), found integer | ^ expected (), found integer
| |
= note: expected type `()` = note: expected unit type `()`
found type `{integer}` found type `{integer}`
error: aborting due to previous error error: aborting due to previous error

View file

@ -8,7 +8,7 @@ LL | <() as Visit>::visit();
| ^^^^^^^^^^^^^^^^^^^^ expected &(), found () | ^^^^^^^^^^^^^^^^^^^^ expected &(), found ()
| |
= note: expected reference `&()` = note: expected reference `&()`
found type `()` found unit type `()`
= note: required because of the requirements on the impl of `Visit` for `()` = note: required because of the requirements on the impl of `Visit` for `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -4,8 +4,8 @@ error[E0326]: implemented const `CONST` has an incompatible type for trait
LL | const CONST: () = (); LL | const CONST: () = ();
| ^^ expected u32, found () | ^^ expected u32, found ()
| |
= note: expected type `u32` = note: expected type `u32`
found type `()` found unit type `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -3,7 +3,7 @@ fn main() {
0 0
} else if false { } else if false {
//~^ ERROR if may be missing an else clause //~^ ERROR if may be missing an else clause
//~| expected type `()` //~| expected unit type `()`
//~| found type `{integer}` //~| found type `{integer}`
//~| expected (), found integer //~| expected (), found integer
1 1

View file

@ -12,8 +12,8 @@ LL | | 1
LL | | }; LL | | };
| |_____^ expected (), found integer | |_____^ expected (), found integer
| |
= note: expected type `()` = note: expected unit type `()`
found type `{integer}` found type `{integer}`
= note: `if` expressions without `else` evaluate to `()` = note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type = help: consider adding an `else` block that evaluates to the expected type

View file

@ -21,8 +21,8 @@ LL |
LL | break true; LL | break true;
| - help: consider removing this semicolon | - help: consider removing this semicolon
| |
= note: expected type `bool` = note: expected type `bool`
found type `()` found unit type `()`
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View file

@ -6,8 +6,8 @@ LL | fn საჭმელად_გემრიელი_სადილი ( )
| | | |
| implicitly returns `()` as its body has no tail or `return` expression | implicitly returns `()` as its body has no tail or `return` expression
| |
= note: expected type `isize` = note: expected type `isize`
found type `()` found unit type `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -7,8 +7,8 @@ LL | fn main() { test(Ok(())); }
| expected enum `std::option::Option`, found () | expected enum `std::option::Option`, found ()
| help: try using a variant of the expected enum: `Some(())` | help: try using a variant of the expected enum: `Some(())`
| |
= note: expected enum `std::option::Option<()>` = note: expected enum `std::option::Option<()>`
found type `()` found unit type `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | () < std::mem::size_of::<_>(); LL | () < std::mem::size_of::<_>();
| ^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found usize | ^^^^^^^^^^^^^^^^^^^^^^^^ expected (), found usize
| |
= note: expected type `()` = note: expected unit type `()`
found type `usize` found type `usize`
error[E0282]: type annotations needed error[E0282]: type annotations needed
--> $DIR/issue-47486.rs:3:11 --> $DIR/issue-47486.rs:3:11

View file

@ -31,8 +31,8 @@ LL | Drop = assert_eq!(1, 1)
| expected (), found isize | expected (), found isize
| found here | found here
| |
= note: expected type `()` = note: expected unit type `()`
found type `isize` found type `isize`
= note: `if` expressions without `else` evaluate to `()` = note: `if` expressions without `else` evaluate to `()`
= help: consider adding an `else` block that evaluates to the expected type = help: consider adding an `else` block that evaluates to the expected type
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

View file

@ -10,8 +10,8 @@ error[E0308]: mismatched types
LL | |y: Vec<[(); for x in 0..2 {}]>| {}; LL | |y: Vec<[(); for x in 0..2 {}]>| {};
| ^^^^^^^^^^^^^^^^ expected usize, found () | ^^^^^^^^^^^^^^^^ expected usize, found ()
| |
= note: expected type `usize` = note: expected type `usize`
found type `()` found unit type `()`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -8,8 +8,8 @@ LL | fn foo(b: bool) -> Result<bool,String> {
LL | Err("bar".to_string()); LL | Err("bar".to_string());
| - help: consider removing this semicolon | - help: consider removing this semicolon
| |
= note: expected enum `std::result::Result<bool, std::string::String>` = note: expected enum `std::result::Result<bool, std::string::String>`
found type `()` found unit type `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -76,7 +76,7 @@ let x: i32 = \"I am not a number!\";
// type `i32` assigned to variable `x` // type `i32` assigned to variable `x`
``` ```
"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf-multifile-aux.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String`
found type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types found unit type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf-multifile-aux.rs:25:22: error[E0308]: mismatched types
"} "}
{"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors
"} "}

View file

@ -76,7 +76,7 @@ let x: i32 = \"I am not a number!\";
// type `i32` assigned to variable `x` // type `i32` assigned to variable `x`
``` ```
"},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String` "},"level":"error","spans":[{"file_name":"$DIR/json-bom-plus-crlf.rs","byte_start":801,"byte_end":809,"line_start":25,"line_end":26,"column_start":22,"column_end":6,"is_primary":true,"text":[{"text":" let s : String = (","highlight_start":22,"highlight_end":23},{"text":" ); // Error spanning the newline.","highlight_start":1,"highlight_end":6}],"label":"expected struct `std::string::String`, found ()","suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"expected struct `std::string::String`
found type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:25:22: error[E0308]: mismatched types found unit type `()`","code":null,"level":"note","spans":[],"children":[],"rendered":null}],"rendered":"$DIR/json-bom-plus-crlf.rs:25:22: error[E0308]: mismatched types
"} "}
{"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors {"message":"aborting due to 4 previous errors","code":null,"level":"error","spans":[],"children":[],"rendered":"error: aborting due to 4 previous errors
"} "}

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | fn main() { println!("{}", force(|| {})); } LL | fn main() { println!("{}", force(|| {})); }
| ^^ expected isize, found () | ^^ expected isize, found ()
| |
= note: expected type `isize` = note: expected type `isize`
found type `()` found unit type `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,8 +6,8 @@ LL | fn f(a: isize) -> isize { if god_exists(a) { return 5; }; }
| | | |
| implicitly returns `()` as its body has no tail or `return` expression | implicitly returns `()` as its body has no tail or `return` expression
| |
= note: expected type `isize` = note: expected type `isize`
found type `()` found unit type `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -7,8 +7,8 @@ LL | |
LL | | }); LL | | });
| |_____^ expected bool, found () | |_____^ expected bool, found ()
| |
= note: expected type `bool` = note: expected type `bool`
found type `()` found unit type `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,8 +6,8 @@ LL | fn f() -> isize {
| | | |
| implicitly returns `()` as its body has no tail or `return` expression | implicitly returns `()` as its body has no tail or `return` expression
| |
= note: expected type `isize` = note: expected type `isize`
found type `()` found unit type `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -10,8 +10,8 @@ LL | macro_rules! test { () => { fn foo() -> i32 { 1; } } }
LL | test!(); LL | test!();
| -------- in this macro invocation | -------- in this macro invocation
| |
= note: expected type `i32` = note: expected type `i32`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/liveness-return-last-stmt-semi.rs:7:19 --> $DIR/liveness-return-last-stmt-semi.rs:7:19
@ -21,8 +21,8 @@ LL | fn no_return() -> i32 {}
| | | |
| implicitly returns `()` as its body has no tail or `return` expression | implicitly returns `()` as its body has no tail or `return` expression
| |
= note: expected type `i32` = note: expected type `i32`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/liveness-return-last-stmt-semi.rs:9:19 --> $DIR/liveness-return-last-stmt-semi.rs:9:19
@ -34,8 +34,8 @@ LL | fn bar(x: u32) -> u32 {
LL | x * 2; LL | x * 2;
| - help: consider removing this semicolon | - help: consider removing this semicolon
| |
= note: expected type `u32` = note: expected type `u32`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/liveness-return-last-stmt-semi.rs:13:19 --> $DIR/liveness-return-last-stmt-semi.rs:13:19
@ -45,8 +45,8 @@ LL | fn baz(x: u64) -> u32 {
| | | |
| implicitly returns `()` as its body has no tail or `return` expression | implicitly returns `()` as its body has no tail or `return` expression
| |
= note: expected type `u32` = note: expected type `u32`
found type `()` found unit type `()`
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View file

@ -100,8 +100,8 @@ error[E0308]: mismatched types
LL | let val: ! = loop { break break; }; LL | let val: ! = loop { break break; };
| ^^^^^ expected !, found () | ^^^^^ expected !, found ()
| |
= note: expected type `!` = note: expected type `!`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/loop-break-value.rs:11:19 --> $DIR/loop-break-value.rs:11:19
@ -136,8 +136,8 @@ error[E0308]: mismatched types
LL | break 'c 123; LL | break 'c 123;
| ^^^ expected (), found integer | ^^^ expected (), found integer
| |
= note: expected type `()` = note: expected unit type `()`
found type `{integer}` found type `{integer}`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/loop-break-value.rs:80:15 --> $DIR/loop-break-value.rs:80:15
@ -145,8 +145,8 @@ error[E0308]: mismatched types
LL | break (break, break); LL | break (break, break);
| ^^^^^^^^^^^^^^ expected (), found tuple | ^^^^^^^^^^^^^^ expected (), found tuple
| |
= note: expected type `()` = note: expected unit type `()`
found tuple `(!, !)` found tuple `(!, !)`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/loop-break-value.rs:85:15 --> $DIR/loop-break-value.rs:85:15
@ -154,8 +154,8 @@ error[E0308]: mismatched types
LL | break 2; LL | break 2;
| ^ expected (), found integer | ^ expected (), found integer
| |
= note: expected type `()` = note: expected unit type `()`
found type `{integer}` found type `{integer}`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/loop-break-value.rs:90:9 --> $DIR/loop-break-value.rs:90:9
@ -166,8 +166,8 @@ LL | break;
| expected integer, found () | expected integer, found ()
| help: give it a value of the expected type: `break value` | help: give it a value of the expected type: `break value`
| |
= note: expected type `{integer}` = note: expected type `{integer}`
found type `()` found unit type `()`
error: aborting due to 16 previous errors error: aborting due to 16 previous errors

View file

@ -7,8 +7,8 @@ LL | let _: i32 = loop { break };
| expected i32, found () | expected i32, found ()
| help: give it a value of the expected type: `break 42` | help: give it a value of the expected type: `break 42`
| |
= note: expected type `i32` = note: expected type `i32`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/loop-labeled-break-value.rs:6:37 --> $DIR/loop-labeled-break-value.rs:6:37
@ -19,8 +19,8 @@ LL | let _: i32 = 'inner: loop { break 'inner };
| expected i32, found () | expected i32, found ()
| help: give it a value of the expected type: `break 'inner 42` | help: give it a value of the expected type: `break 'inner 42`
| |
= note: expected type `i32` = note: expected type `i32`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/loop-labeled-break-value.rs:9:45 --> $DIR/loop-labeled-break-value.rs:9:45
@ -31,8 +31,8 @@ LL | let _: i32 = 'inner2: loop { loop { break 'inner2 } };
| expected i32, found () | expected i32, found ()
| help: give it a value of the expected type: `break 'inner2 42` | help: give it a value of the expected type: `break 'inner2 42`
| |
= note: expected type `i32` = note: expected type `i32`
found type `()` found unit type `()`
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View file

@ -7,8 +7,8 @@ LL | let x: i32 = loop { break };
| expected i32, found () | expected i32, found ()
| help: give it a value of the expected type: `break 42` | help: give it a value of the expected type: `break 42`
| |
= note: expected type `i32` = note: expected type `i32`
found type `()` found unit type `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -62,8 +62,8 @@ LL | |
LL | | }; LL | | };
| |_____- `match` arms have incompatible types | |_____- `match` arms have incompatible types
| |
= note: expected type `u32` = note: expected type `u32`
found type `()` found unit type `()`
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | let _seetype: () = z; LL | let _seetype: () = z;
| ^ expected (), found u32 | ^ expected (), found u32
| |
= note: expected type `()` = note: expected unit type `()`
found type `u32` found type `u32`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:102:24 --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:102:24
@ -13,8 +13,8 @@ error[E0308]: mismatched types
LL | let _seetype: () = z; LL | let _seetype: () = z;
| ^ expected (), found u64 | ^ expected (), found u64
| |
= note: expected type `()` = note: expected unit type `()`
found type `u64` found type `u64`
error[E0034]: multiple applicable items in scope error[E0034]: multiple applicable items in scope
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:120:15 --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:120:15
@ -47,8 +47,8 @@ error[E0308]: mismatched types
LL | let _seetype: () = z; LL | let _seetype: () = z;
| ^ expected (), found u8 | ^ expected (), found u8
| |
= note: expected type `()` = note: expected unit type `()`
found type `u8` found type `u8`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:155:24 --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:155:24
@ -56,8 +56,8 @@ error[E0308]: mismatched types
LL | let _seetype: () = z; LL | let _seetype: () = z;
| ^ expected (), found u32 | ^ expected (), found u32
| |
= note: expected type `()` = note: expected unit type `()`
found type `u32` found type `u32`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:172:24 --> $DIR/method-deref-to-same-trait-object-with-separate-params.rs:172:24
@ -65,8 +65,8 @@ error[E0308]: mismatched types
LL | let _seetype: () = z; LL | let _seetype: () = z;
| ^ expected (), found u32 | ^ expected (), found u32
| |
= note: expected type `()` = note: expected unit type `()`
found type `u32` found type `u32`
error: aborting due to 6 previous errors error: aborting due to 6 previous errors

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | let x: () = 0; LL | let x: () = 0;
| ^ expected (), found integer | ^ expected (), found integer
| |
= note: expected type `()` = note: expected unit type `()`
found type `{integer}` found type `{integer}`
error: aborting due to previous error error: aborting due to previous error

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | x LL | x
| ^ expected (), found integer | ^ expected (), found integer
| |
= note: expected type `()` = note: expected unit type `()`
found type `{integer}` found type `{integer}`
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,8 +6,8 @@ LL | fn function(t: &mut dyn Trait) {
LL | t as *mut dyn Trait LL | t as *mut dyn Trait
| ^^^^^^^^^^^^^^^^^^^ expected (), found *-ptr | ^^^^^^^^^^^^^^^^^^^ expected (), found *-ptr
| |
= note: expected type `()` = note: expected unit type `()`
found raw pointer `*mut dyn Trait` found raw pointer `*mut dyn Trait`
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,8 +6,8 @@ LL | let x: u32 = (
LL | | ); LL | | );
| |_____^ expected u32, found () | |_____^ expected u32, found ()
| |
= note: expected type `u32` = note: expected type `u32`
found type `()` found unit type `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,8 +6,8 @@ LL | fn f() -> isize { }
| | | |
| implicitly returns `()` as its body has no tail or `return` expression | implicitly returns `()` as its body has no tail or `return` expression
| |
= note: expected type `isize` = note: expected type `isize`
found type `()` found unit type `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -12,8 +12,8 @@ error[E0308]: mismatched types
LL | let () = 0; LL | let () = 0;
| ^^ expected integer, found () | ^^ expected integer, found ()
| |
= note: expected type `{integer}` = note: expected type `{integer}`
found type `()` found unit type `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | fn main() { let i: isize; i = f(); } LL | fn main() { let i: isize; i = f(); }
| ^^^ expected isize, found () | ^^^ expected isize, found ()
| |
= note: expected type `isize` = note: expected type `isize`
found type `()` found unit type `()`
error: aborting due to previous error error: aborting due to previous error

View file

@ -49,8 +49,8 @@ error[E0308]: mismatched types
LL | {2} + {2} LL | {2} + {2}
| ^ expected (), found integer | ^ expected (), found integer
| |
= note: expected type `()` = note: expected unit type `()`
found type `{integer}` found type `{integer}`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/expr-as-stmt.rs:12:6 --> $DIR/expr-as-stmt.rs:12:6
@ -58,8 +58,8 @@ error[E0308]: mismatched types
LL | {2} + 2 LL | {2} + 2
| ^ expected (), found integer | ^ expected (), found integer
| |
= note: expected type `()` = note: expected unit type `()`
found type `{integer}` found type `{integer}`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/expr-as-stmt.rs:18:7 --> $DIR/expr-as-stmt.rs:18:7
@ -67,8 +67,8 @@ error[E0308]: mismatched types
LL | { 42 } + foo; LL | { 42 } + foo;
| ^^ expected (), found integer | ^^ expected (), found integer
| |
= note: expected type `()` = note: expected unit type `()`
found type `{integer}` found type `{integer}`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/expr-as-stmt.rs:24:7 --> $DIR/expr-as-stmt.rs:24:7
@ -76,8 +76,8 @@ error[E0308]: mismatched types
LL | { 3 } * 3 LL | { 3 } * 3
| ^ expected (), found integer | ^ expected (), found integer
| |
= note: expected type `()` = note: expected unit type `()`
found type `{integer}` found type `{integer}`
error[E0614]: type `{integer}` cannot be dereferenced error[E0614]: type `{integer}` cannot be dereferenced
--> $DIR/expr-as-stmt.rs:24:11 --> $DIR/expr-as-stmt.rs:24:11

View file

@ -12,8 +12,8 @@ LL | fn f(*, a: u8) -> u8 {}
| | | |
| implicitly returns `()` as its body has no tail or `return` expression | implicitly returns `()` as its body has no tail or `return` expression
| |
= note: expected type `u8` = note: expected type `u8`
found type `()` found unit type `()`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -21,8 +21,8 @@ LL | fn f() -> isize { fn f() -> isize {} pub f<
| | | |
| implicitly returns `()` as its body has no tail or `return` expression | implicitly returns `()` as its body has no tail or `return` expression
| |
= note: expected type `isize` = note: expected type `isize`
found type `()` found unit type `()`
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View file

@ -41,8 +41,8 @@ LL | fn v() -> isize {
| | | |
| implicitly returns `()` as its body has no tail or `return` expression | implicitly returns `()` as its body has no tail or `return` expression
| |
= note: expected type `isize` = note: expected type `isize`
found type `()` found unit type `()`
error: aborting due to 6 previous errors error: aborting due to 6 previous errors

View file

@ -36,8 +36,8 @@ error[E0308]: mismatched types
LL | const RECOVERY_WITNESS: () = 0; LL | const RECOVERY_WITNESS: () = 0;
| ^ expected (), found integer | ^ expected (), found integer
| |
= note: expected type `()` = note: expected unit type `()`
found type `{integer}` found type `{integer}`
error: aborting due to 5 previous errors error: aborting due to 5 previous errors

View file

@ -19,8 +19,8 @@ error[E0308]: mismatched types
LL | const RECOVERY_WITNESS: () = 0; LL | const RECOVERY_WITNESS: () = 0;
| ^ expected (), found integer | ^ expected (), found integer
| |
= note: expected type `()` = note: expected unit type `()`
found type `{integer}` found type `{integer}`
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View file

@ -10,8 +10,8 @@ error[E0308]: mismatched types
LL | const RECOVERY_WITNESS: () = 0; LL | const RECOVERY_WITNESS: () = 0;
| ^ expected (), found integer | ^ expected (), found integer
| |
= note: expected type `()` = note: expected unit type `()`
found type `{integer}` found type `{integer}`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -19,8 +19,8 @@ error[E0308]: mismatched types
LL | const RECOVERY_WITNESS: () = 0; LL | const RECOVERY_WITNESS: () = 0;
| ^ expected (), found integer | ^ expected (), found integer
| |
= note: expected type `()` = note: expected unit type `()`
found type `{integer}` found type `{integer}`
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View file

@ -19,8 +19,8 @@ error[E0308]: mismatched types
LL | const RECOVERY_WITNESS: () = 0; LL | const RECOVERY_WITNESS: () = 0;
| ^ expected (), found integer | ^ expected (), found integer
| |
= note: expected type `()` = note: expected unit type `()`
found type `{integer}` found type `{integer}`
error: aborting due to 3 previous errors error: aborting due to 3 previous errors

View file

@ -15,8 +15,8 @@ error[E0308]: mismatched types
LL | let x: usize = (); LL | let x: usize = ();
| ^^ expected usize, found () | ^^ expected usize, found ()
| |
= note: expected type `usize` = note: expected type `usize`
found type `()` found unit type `()`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -22,8 +22,8 @@ error[E0308]: mismatched types
LL | let _: usize = () LL | let _: usize = ()
| ^^ expected usize, found () | ^^ expected usize, found ()
| |
= note: expected type `usize` = note: expected type `usize`
found type `()` found unit type `()`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/recover-missing-semi.rs:9:20 --> $DIR/recover-missing-semi.rs:9:20
@ -31,8 +31,8 @@ error[E0308]: mismatched types
LL | let _: usize = () LL | let _: usize = ()
| ^^ expected usize, found () | ^^ expected usize, found ()
| |
= note: expected type `usize` = note: expected type `usize`
found type `()` found unit type `()`
error: aborting due to 4 previous errors error: aborting due to 4 previous errors

View file

@ -15,8 +15,8 @@ error[E0308]: mismatched types
LL | (..) => {} LL | (..) => {}
| ^^^^ expected u8, found () | ^^^^ expected u8, found ()
| |
= note: expected type `u8` = note: expected type `u8`
found type `()` found unit type `()`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -9,8 +9,8 @@ LL | std::cell::Cell::new(0)
| | | |
| expected (), found struct `std::cell::Cell` | expected (), found struct `std::cell::Cell`
| |
= note: expected type `()` = note: expected unit type `()`
found struct `std::cell::Cell<{integer}>` found struct `std::cell::Cell<{integer}>`
error: aborting due to previous error error: aborting due to previous error

View file

@ -49,8 +49,8 @@ LL | extern "C" fn baz() {
LL | 0 LL | 0
| ^ expected (), found integer | ^ expected (), found integer
| |
= note: expected type `()` = note: expected unit type `()`
found type `{integer}` found type `{integer}`
error[E0308]: mismatched types error[E0308]: mismatched types
--> $DIR/span-preservation.rs:49:5 --> $DIR/span-preservation.rs:49:5

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | let _: fn(&mut &isize, &mut &isize) = a; LL | let _: fn(&mut &isize, &mut &isize) = a;
| ^ expected concrete lifetime, found bound lifetime parameter | ^ expected concrete lifetime, found bound lifetime parameter
| |
= note: expected type `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)` = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
found type `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}`
error: aborting due to previous error error: aborting due to previous error

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a; LL | let _: fn(&mut &isize, &mut &isize, &mut &isize) = a;
| ^ expected concrete lifetime, found bound lifetime parameter | ^ expected concrete lifetime, found bound lifetime parameter
| |
= note: expected type `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)` = note: expected fn pointer `for<'r, 's, 't0, 't1, 't2, 't3> fn(&'r mut &'s isize, &'t0 mut &'t1 isize, &'t2 mut &'t3 isize)`
found type `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize) {a::<'_, '_, '_>}` found fn item `for<'r, 's, 't0> fn(&'r mut &isize, &'s mut &isize, &'t0 mut &isize) {a::<'_, '_, '_>}`
error: aborting due to previous error error: aborting due to previous error

View file

@ -4,8 +4,8 @@ error[E0308]: mismatched types
LL | let _: fn(&mut &isize, &mut &isize) = a; LL | let _: fn(&mut &isize, &mut &isize) = a;
| ^ expected concrete lifetime, found bound lifetime parameter | ^ expected concrete lifetime, found bound lifetime parameter
| |
= note: expected type `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)` = note: expected fn pointer `for<'r, 's, 't0, 't1> fn(&'r mut &'s isize, &'t0 mut &'t1 isize)`
found type `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}` found fn item `for<'r, 's> fn(&'r mut &isize, &'s mut &isize) {a::<'_, '_>}`
error: aborting due to previous error error: aborting due to previous error

Some files were not shown because too many files have changed in this diff Show more