-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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 #124497 - rytheo:move-std-tests-to-library, r=workingju…
…bilee Move some stdlib tests from `tests/ui` to `library/std/tests` Related to #99417
- Loading branch information
Showing
11 changed files
with
97 additions
and
89 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#[derive(PartialEq, Debug)] | ||
struct Bar; | ||
#[derive(Debug)] | ||
struct Baz; | ||
#[derive(Debug)] | ||
struct Foo; | ||
#[derive(Debug)] | ||
struct Fu; | ||
|
||
impl PartialEq for Baz { | ||
fn eq(&self, _: &Baz) -> bool { | ||
true | ||
} | ||
} | ||
|
||
impl PartialEq<Fu> for Foo { | ||
fn eq(&self, _: &Fu) -> bool { | ||
true | ||
} | ||
} | ||
|
||
impl PartialEq<Foo> for Fu { | ||
fn eq(&self, _: &Foo) -> bool { | ||
true | ||
} | ||
} | ||
|
||
impl PartialEq<Bar> for Foo { | ||
fn eq(&self, _: &Bar) -> bool { | ||
false | ||
} | ||
} | ||
|
||
impl PartialEq<Foo> for Bar { | ||
fn eq(&self, _: &Foo) -> bool { | ||
false | ||
} | ||
} | ||
|
||
#[test] | ||
fn eq_multidispatch() { | ||
assert!(Bar != Foo); | ||
assert!(Foo != Bar); | ||
|
||
assert_eq!(Bar, Bar); | ||
|
||
assert_eq!(Baz, Baz); | ||
|
||
assert_eq!(Foo, Fu); | ||
assert_eq!(Fu, 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
10 changes: 5 additions & 5 deletions
10
...log-knows-the-names-of-variants-in-std.rs → ...log-knows-the-names-of-variants-in-std.rs
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
5 changes: 2 additions & 3 deletions
5
tests/ui/stdlib-unit-tests/seq-compare.rs → library/std/tests/seq-compare.rs
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
5 changes: 2 additions & 3 deletions
5
...s/ui/std/slice-from-array-issue-113238.rs → ...td/tests/slice-from-array-issue-113238.rs
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,8 @@ | ||
//@ check-pass | ||
|
||
// This intends to use the unsizing coercion from array to slice, but it only | ||
// works if we resolve `<&[u8]>::from` as the reflexive `From<T> for T`. In | ||
// #113238, we found that gimli had added its own `From<EndianSlice> for &[u8]` | ||
// that affected all `std/backtrace` users. | ||
fn main() { | ||
#[test] | ||
fn slice_from_array() { | ||
let _ = <&[u8]>::from(&[]); | ||
} |
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
6 changes: 3 additions & 3 deletions
6
.../ui/stdlib-unit-tests/volatile-fat-ptr.rs → library/std/tests/volatile-fat-ptr.rs
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 was deleted.
Oops, something went wrong.