error: expected one of `,` or `>`, found `&&`
- --> $DIR/disallowed-positions.rs:242:14
+ --> $DIR/disallowed-positions.rs:239:14
|
LL | true && let 1 = 1
- | ^^ expected one of `,` or `>` here
+ | ^^ expected one of `,` or `>`
error: `let` expressions are not supported here
--> $DIR/disallowed-positions.rs:32:9
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:224:17
+ --> $DIR/disallowed-positions.rs:223:17
|
LL | true && let 1 = 1
| ^^^^^^^^^
= note: as well as when nested within `&&` and parenthesis in those conditions
error: `let` expressions are not supported here
- --> $DIR/disallowed-positions.rs:230:17
+ --> $DIR/disallowed-positions.rs:228:17
|
LL | true && let 1 = 1
| ^^^^^^^^^
LL | #![feature(let_chains)] // Avoid inflating `.stderr` with overzealous gates in this test.
| ^^^^^^^^^^
+error[E0658]: `match` is not allowed in a `const`
+ --> $DIR/disallowed-positions.rs:218:17
+ |
+LL | true && let 1 = 1
+ | ^^^^^^^^^
+ |
+ = note: for more information, see https://github.com/rust-lang/rust/issues/49146
+ = help: add `#![feature(const_if_match)]` to the crate attributes to enable
+
+error[E0658]: `match` is not allowed in a `const`
+ --> $DIR/disallowed-positions.rs:223:17
+ |
+LL | true && let 1 = 1
+ | ^^^^^^^^^
+ |
+ = note: for more information, see https://github.com/rust-lang/rust/issues/49146
+ = help: add `#![feature(const_if_match)]` to the crate attributes to enable
+
+error[E0658]: `match` is not allowed in a `const`
+ --> $DIR/disallowed-positions.rs:228:17
+ |
+LL | true && let 1 = 1
+ | ^^^^^^^^^
+ |
+ = note: for more information, see https://github.com/rust-lang/rust/issues/49146
+ = help: add `#![feature(const_if_match)]` to the crate attributes to enable
+
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:32:8
|
LL | if &let 0 = 0 {}
| ^^^^^^^^^^
| |
- | expected bool, found &bool
+ | expected `bool`, found `&bool`
| help: consider removing the borrow: `let 0 = 0`
- |
- = note: expected type `bool`
- found type `&bool`
error[E0614]: type `bool` cannot be dereferenced
--> $DIR/disallowed-positions.rs:36:8
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
--> $DIR/disallowed-positions.rs:46:8
|
-LL | if (let 0 = 0)? {}
- | ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
+LL | / fn nested_within_if_expr() {
+LL | | if &let 0 = 0 {}
+LL | |
+LL | |
+... |
+LL | | if (let 0 = 0)? {}
+ | | ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
+... |
+LL | | if let true = let true = true {}
+LL | | }
+ | |_- this function should return `Result` or `Option` to accept `?`
|
= help: the trait `std::ops::Try` is not implemented for `()`
= note: required by `std::ops::Try::from_error`
LL | if x = let 0 = 0 {}
| ^^^^^^^^^^^^^
| |
- | expected bool, found ()
+ | expected `bool`, found `()`
| help: try comparing for equality: `x == let 0 = 0`
- |
- = note: expected type `bool`
- found type `()`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:59:8
|
LL | if true..(let 0 = 0) {}
- | ^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
|
= note: expected type `bool`
- found type `std::ops::Range<bool>`
+ found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:61:8
|
LL | if ..(let 0 = 0) {}
- | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeTo`
+ | ^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::RangeTo`
|
= note: expected type `bool`
- found type `std::ops::RangeTo<bool>`
+ found struct `std::ops::RangeTo<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:63:8
|
LL | if (let 0 = 0).. {}
- | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeFrom`
+ | ^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::RangeFrom`
|
= note: expected type `bool`
- found type `std::ops::RangeFrom<bool>`
+ found struct `std::ops::RangeFrom<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:67:12
LL | if let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
| |
- | expected bool, found struct `std::ops::Range`
+ | expected `bool`, found struct `std::ops::Range`
|
= note: expected type `bool`
- found type `std::ops::Range<_>`
+ found struct `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:67:8
|
LL | if let Range { start: _, end: _ } = true..true && false {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
|
= note: expected type `bool`
- found type `std::ops::Range<bool>`
+ found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:71:12
LL | if let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
| |
- | expected bool, found struct `std::ops::Range`
+ | expected `bool`, found struct `std::ops::Range`
|
= note: expected type `bool`
- found type `std::ops::Range<_>`
+ found struct `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:71:8
|
LL | if let Range { start: _, end: _ } = true..true || false {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
|
= note: expected type `bool`
- found type `std::ops::Range<bool>`
+ found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:78:12
LL | if let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range`
|
- = note: expected type `fn() -> bool`
- found type `std::ops::Range<_>`
+ = note: expected fn pointer `fn() -> bool`
+ found struct `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:78:41
|
LL | if let Range { start: F, end } = F..|| true {}
- | ^^^^^^^ expected bool, found closure
+ | ^^^^^^^ expected `bool`, found closure
|
= note: expected type `bool`
- found type `[closure@$DIR/disallowed-positions.rs:78:41: 78:48]`
+ found closure `[closure@$DIR/disallowed-positions.rs:78:41: 78:48]`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:78:8
|
LL | if let Range { start: F, end } = F..|| true {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
|
= note: expected type `bool`
- found type `std::ops::Range<bool>`
+ found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:86:12
LL | if let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this match expression has type `bool`
| |
- | expected bool, found struct `std::ops::Range`
+ | expected `bool`, found struct `std::ops::Range`
|
= note: expected type `bool`
- found type `std::ops::Range<_>`
+ found struct `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:86:44
|
LL | if let Range { start: true, end } = t..&&false {}
- | ^^^^^^^ expected bool, found &&bool
- |
- = note: expected type `bool`
- found type `&&bool`
+ | ^^^^^^^ expected `bool`, found `&&bool`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:86:8
|
LL | if let Range { start: true, end } = t..&&false {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
|
= note: expected type `bool`
- found type `std::ops::Range<bool>`
+ found struct `std::ops::Range<bool>`
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
--> $DIR/disallowed-positions.rs:42:20
LL | while &let 0 = 0 {}
| ^^^^^^^^^^
| |
- | expected bool, found &bool
+ | expected `bool`, found `&bool`
| help: consider removing the borrow: `let 0 = 0`
- |
- = note: expected type `bool`
- found type `&bool`
error[E0614]: type `bool` cannot be dereferenced
--> $DIR/disallowed-positions.rs:100:11
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
--> $DIR/disallowed-positions.rs:110:11
|
-LL | while (let 0 = 0)? {}
- | ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
+LL | / fn nested_within_while_expr() {
+LL | | while &let 0 = 0 {}
+LL | |
+LL | |
+... |
+LL | | while (let 0 = 0)? {}
+ | | ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
+... |
+LL | | while let true = let true = true {}
+LL | | }
+ | |_- this function should return `Result` or `Option` to accept `?`
|
= help: the trait `std::ops::Try` is not implemented for `()`
= note: required by `std::ops::Try::from_error`
LL | while x = let 0 = 0 {}
| ^^^^^^^^^^^^^
| |
- | expected bool, found ()
+ | expected `bool`, found `()`
| help: try comparing for equality: `x == let 0 = 0`
- |
- = note: expected type `bool`
- found type `()`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:123:11
|
LL | while true..(let 0 = 0) {}
- | ^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
|
= note: expected type `bool`
- found type `std::ops::Range<bool>`
+ found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:125:11
|
LL | while ..(let 0 = 0) {}
- | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeTo`
+ | ^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::RangeTo`
|
= note: expected type `bool`
- found type `std::ops::RangeTo<bool>`
+ found struct `std::ops::RangeTo<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:127:11
|
LL | while (let 0 = 0).. {}
- | ^^^^^^^^^^^^^ expected bool, found struct `std::ops::RangeFrom`
+ | ^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::RangeFrom`
|
= note: expected type `bool`
- found type `std::ops::RangeFrom<bool>`
+ found struct `std::ops::RangeFrom<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:131:15
LL | while let Range { start: _, end: _ } = true..true && false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
| |
- | expected bool, found struct `std::ops::Range`
+ | expected `bool`, found struct `std::ops::Range`
|
= note: expected type `bool`
- found type `std::ops::Range<_>`
+ found struct `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:131:11
|
LL | while let Range { start: _, end: _ } = true..true && false {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
|
= note: expected type `bool`
- found type `std::ops::Range<bool>`
+ found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:135:15
LL | while let Range { start: _, end: _ } = true..true || false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
| |
- | expected bool, found struct `std::ops::Range`
+ | expected `bool`, found struct `std::ops::Range`
|
= note: expected type `bool`
- found type `std::ops::Range<_>`
+ found struct `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:135:11
|
LL | while let Range { start: _, end: _ } = true..true || false {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
|
= note: expected type `bool`
- found type `std::ops::Range<bool>`
+ found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:142:15
LL | while let Range { start: F, end } = F..|| true {}
| ^^^^^^^^^^^^^^^^^^^^^^^ expected fn pointer, found struct `std::ops::Range`
|
- = note: expected type `fn() -> bool`
- found type `std::ops::Range<_>`
+ = note: expected fn pointer `fn() -> bool`
+ found struct `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:142:44
|
LL | while let Range { start: F, end } = F..|| true {}
- | ^^^^^^^ expected bool, found closure
+ | ^^^^^^^ expected `bool`, found closure
|
= note: expected type `bool`
- found type `[closure@$DIR/disallowed-positions.rs:142:44: 142:51]`
+ found closure `[closure@$DIR/disallowed-positions.rs:142:44: 142:51]`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:142:11
|
LL | while let Range { start: F, end } = F..|| true {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
|
= note: expected type `bool`
- found type `std::ops::Range<bool>`
+ found struct `std::ops::Range<bool>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:150:15
LL | while let Range { start: true, end } = t..&&false {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ - this match expression has type `bool`
| |
- | expected bool, found struct `std::ops::Range`
+ | expected `bool`, found struct `std::ops::Range`
|
= note: expected type `bool`
- found type `std::ops::Range<_>`
+ found struct `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:150:47
|
LL | while let Range { start: true, end } = t..&&false {}
- | ^^^^^^^ expected bool, found &&bool
- |
- = note: expected type `bool`
- found type `&&bool`
+ | ^^^^^^^ expected `bool`, found `&&bool`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:150:11
|
LL | while let Range { start: true, end } = t..&&false {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bool, found struct `std::ops::Range`
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected `bool`, found struct `std::ops::Range`
|
= note: expected type `bool`
- found type `std::ops::Range<bool>`
+ found struct `std::ops::Range<bool>`
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
--> $DIR/disallowed-positions.rs:106:23
error[E0277]: the `?` operator can only be used in a function that returns `Result` or `Option` (or another type that implements `std::ops::Try`)
--> $DIR/disallowed-positions.rs:183:5
|
-LL | (let 0 = 0)?;
- | ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
+LL | / fn outside_if_and_while_expr() {
+LL | | &let 0 = 0;
+LL | |
+LL | | !let 0 = 0;
+... |
+LL | | (let 0 = 0)?;
+ | | ^^^^^^^^^^^^ cannot use the `?` operator in a function that returns `()`
+... |
+LL | |
+LL | | }
+ | |_- this function should return `Result` or `Option` to accept `?`
|
= help: the trait `std::ops::Try` is not implemented for `()`
= note: required by `std::ops::Try::from_error`
LL | (let Range { start: _, end: _ } = true..true || false);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ ---- this match expression has type `bool`
| |
- | expected bool, found struct `std::ops::Range`
+ | expected `bool`, found struct `std::ops::Range`
|
= note: expected type `bool`
- found type `std::ops::Range<_>`
+ found struct `std::ops::Range<_>`
error[E0308]: mismatched types
--> $DIR/disallowed-positions.rs:207:5
| - help: try adding a return type: `-> &bool`
...
LL | &let 0 = 0
- | ^^^^^^^^^^ expected (), found &bool
- |
- = note: expected type `()`
- found type `&bool`
+ | ^^^^^^^^^^ expected `()`, found `&bool`
error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
--> $DIR/disallowed-positions.rs:179:17
= help: the trait `std::ops::Try` is not implemented for `{integer}`
= note: required by `std::ops::Try::into_result`
-error[E0019]: constant contains unimplemented expression type
- --> $DIR/disallowed-positions.rs:218:25
- |
-LL | true && let 1 = 1
- | ^
-
-error[E0019]: constant contains unimplemented expression type
- --> $DIR/disallowed-positions.rs:218:21
- |
-LL | true && let 1 = 1
- | ^
-
-error[E0019]: constant contains unimplemented expression type
- --> $DIR/disallowed-positions.rs:224:25
- |
-LL | true && let 1 = 1
- | ^
-
-error[E0019]: constant contains unimplemented expression type
- --> $DIR/disallowed-positions.rs:224:21
- |
-LL | true && let 1 = 1
- | ^
-
-error[E0019]: constant contains unimplemented expression type
- --> $DIR/disallowed-positions.rs:230:25
- |
-LL | true && let 1 = 1
- | ^
-
-error[E0019]: constant contains unimplemented expression type
- --> $DIR/disallowed-positions.rs:230:21
- |
-LL | true && let 1 = 1
- | ^
-
-error: aborting due to 109 previous errors
+error: aborting due to 106 previous errors
-Some errors have detailed explanations: E0019, E0277, E0308, E0600, E0614.
-For more information about an error, try `rustc --explain E0019`.
+Some errors have detailed explanations: E0277, E0308, E0600, E0614, E0658.
+For more information about an error, try `rustc --explain E0277`.