-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accept
T
in assert!
where <T as Not<Output = bool>
in <=2021 ed…
…itions
- Loading branch information
Showing
8 changed files
with
77 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
error[E0600]: cannot apply unary operator `!` to type `&'static str` | ||
--> $DIR/issue-28308.rs:6:13 | ||
| | ||
LL | assert!("foo"); | ||
| ^^^^^ cannot apply unary operator `!` | ||
| | ||
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0600`. |
2 changes: 1 addition & 1 deletion
2
tests/ui/codemap_tests/issue-28308.stderr → ...emap_tests/issue-28308.edition2024.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
//@revisions: edition2024 edition2021 | ||
//@[edition2024] edition:2024 | ||
//@[edition2024] compile-flags: -Z unstable-options | ||
//@[edition2021] edition:2021 | ||
fn main() { | ||
assert!("foo"); | ||
//~^ ERROR mismatched types | ||
//[edition2024]~^ ERROR mismatched types | ||
//[edition2021]~^^ ERROR cannot apply unary operator `!` to type `&'static str` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
error[E0308]: mismatched types | ||
error[E0600]: cannot apply unary operator `!` to type `BytePos` | ||
--> $DIR/issue-14091-2.rs:15:13 | ||
| | ||
LL | assert!(x, x); | ||
| ^ expected `bool`, found `BytePos` | ||
| ^ cannot apply unary operator `!` | ||
| | ||
note: an implementation of `Not` might be missing for `BytePos` | ||
--> $DIR/issue-14091-2.rs:6:1 | ||
| | ||
LL | pub struct BytePos(pub u32); | ||
| ^^^^^^^^^^^^^^^^^^ must implement `Not` | ||
note: the trait `Not` must be implemented | ||
--> $SRC_DIR/core/src/ops/bit.rs:LL:COL | ||
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info) | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. | ||
For more information about this error, try `rustc --explain E0600`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters