forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#91933 - matthiaskrgr:rollup-cw9qolb, r=matthi…
…askrgr Rollup of 7 pull requests Successful merges: - rust-lang#89825 (Make split_inclusive() on an empty slice yield an empty output) - rust-lang#91239 (regression test for issue 87490) - rust-lang#91597 (Recover on invalid operators `<>` and `<=>`) - rust-lang#91774 (Fix typo for MutVisitor) - rust-lang#91786 (Return an error when `eval_rvalue_with_identities` fails) - rust-lang#91798 (Avoid suggest adding `self` in visibility spec) - rust-lang#91856 (Looser check for overflowing_binary_op) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
- Loading branch information
Showing
17 changed files
with
198 additions
and
63 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
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
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,9 @@ | ||
// run-pass | ||
// Tests equality between supertype and subtype of a function | ||
// See the issue #91636 | ||
fn foo(_a: &str) {} | ||
|
||
fn main() { | ||
let x = foo as fn(&'static str); | ||
let _ = x == foo; | ||
} |
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,10 @@ | ||
fn main() {} | ||
trait StreamOnce { | ||
type Position; | ||
} | ||
impl StreamOnce for &str { | ||
type Position = usize; | ||
} | ||
fn follow(_: &str) -> <&str as StreamOnce>::Position { | ||
String::new //~ ERROR mismatched types | ||
} |
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,14 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/issue-87490.rs:9:5 | ||
| | ||
LL | fn follow(_: &str) -> <&str as StreamOnce>::Position { | ||
| ------------------------------ expected `usize` because of return type | ||
LL | String::new | ||
| ^^^^^^^^^^^ expected `usize`, found fn item | ||
| | ||
= note: expected type `usize` | ||
found fn item `fn() -> String {String::new}` | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
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,12 @@ | ||
// Regression test for issue #91725. | ||
// | ||
// run-pass | ||
// compile-flags: -Zmir-opt-level=4 | ||
|
||
fn main() { | ||
let a = true; | ||
let _ = &a; | ||
let mut b = false; | ||
b |= a; | ||
assert!(b); | ||
} |
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,4 @@ | ||
fn main() { | ||
println!("{}", 1 <> 2); | ||
//~^ERROR invalid comparison operator `<>` | ||
} |
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,8 @@ | ||
error: invalid comparison operator `<>` | ||
--> $DIR/less-than-greater-than.rs:2:22 | ||
| | ||
LL | println!("{}", 1 <> 2); | ||
| ^^ help: `<>` is not a valid comparison operator, use `!=` | ||
|
||
error: aborting due to previous error | ||
|
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,4 @@ | ||
fn main() { | ||
println!("{}", 1 <=> 2); | ||
//~^ERROR invalid comparison operator `<=>` | ||
} |
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,8 @@ | ||
error: invalid comparison operator `<=>` | ||
--> $DIR/spaceship.rs:2:22 | ||
| | ||
LL | println!("{}", 1 <=> 2); | ||
| ^^^ `<=>` is not a valid comparison operator, use `std::cmp::Ordering` | ||
|
||
error: aborting due to previous error | ||
|
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,15 @@ | ||
struct X(i32); | ||
|
||
impl X { | ||
pub(crate) fn f() { | ||
self.0 | ||
//~^ ERROR expected value, found module `self` | ||
} | ||
|
||
pub fn g() { | ||
self.0 | ||
//~^ ERROR expected value, found module `self` | ||
} | ||
} | ||
|
||
fn main() {} |
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,29 @@ | ||
error[E0424]: expected value, found module `self` | ||
--> $DIR/suggest-add-self.rs:5:9 | ||
| | ||
LL | pub(crate) fn f() { | ||
| - this function doesn't have a `self` parameter | ||
LL | self.0 | ||
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter | ||
| | ||
help: add a `self` receiver parameter to make the associated `fn` a method | ||
| | ||
LL | pub(crate) fn f(&self) { | ||
| +++++ | ||
|
||
error[E0424]: expected value, found module `self` | ||
--> $DIR/suggest-add-self.rs:10:9 | ||
| | ||
LL | pub fn g() { | ||
| - this function doesn't have a `self` parameter | ||
LL | self.0 | ||
| ^^^^ `self` value is a keyword only available in methods with a `self` parameter | ||
| | ||
help: add a `self` receiver parameter to make the associated `fn` a method | ||
| | ||
LL | pub fn g(&self) { | ||
| +++++ | ||
|
||
error: aborting due to 2 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0424`. |