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