rust/tests/ui/issues/issue-67535.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

23 lines
620 B
Rust
Raw Normal View History

2023-01-02 02:08:02 +00:00
fn main() {}
impl std::ops::AddAssign for () {
//~^ ERROR only traits defined in the current crate can be implemented for arbitrary types
fn add_assign(&self, other: ()) -> () {
()
}
}
impl std::ops::AddAssign for [(); 1] {
//~^ ERROR only traits defined in the current crate can be implemented for arbitrary types
fn add_assign(&self, other: [(); 1]) -> [(); 1] {
[()]
}
}
impl std::ops::AddAssign for &[u8] {
//~^ ERROR only traits defined in the current crate can be implemented for arbitrary types
fn add_assign(&self, other: &[u8]) -> &[u8] {
self
}
}