rust/tests/ui/kinds-of-primitive-impl.rs

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

27 lines
511 B
Rust
Raw Normal View History

2020-12-06 14:30:07 -06:00
impl u8 {
2022-03-15 10:32:52 -05:00
//~^ error: cannot define inherent `impl` for primitive types
2020-12-06 14:30:07 -06:00
pub const B: u8 = 0;
}
impl str {
2022-03-15 10:32:52 -05:00
//~^ error: cannot define inherent `impl` for primitive types
2020-12-06 14:30:07 -06:00
fn foo() {}
fn bar(self) {}
}
impl char {
2022-03-15 10:32:52 -05:00
//~^ error: cannot define inherent `impl` for primitive types
2020-12-06 14:30:07 -06:00
pub const B: u8 = 0;
pub const C: u8 = 0;
fn foo() {}
fn bar(self) {}
}
struct MyType;
impl &MyType {
//~^ error: cannot define inherent `impl` for primitive types
pub fn for_ref(self) {}
}
2020-12-06 14:30:07 -06:00
fn main() {}