Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
148 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// ignore-tidy-linelength | ||
|
||
|
||
impl u8 { | ||
//~^ error: only a single inherent implementation marked with `#[lang = "u8"]` is allowed for the `u8` primitive | ||
pub const B: u8 = 0; | ||
} | ||
|
||
impl str { | ||
//~^ error: only a single inherent implementation marked with `#[lang = "str"]` is allowed for the `str` primitive | ||
fn foo() {} | ||
fn bar(self) {} | ||
} | ||
|
||
impl char { | ||
//~^ error: only a single inherent implementation marked with `#[lang = "char"]` is allowed for the `char` primitive | ||
pub const B: u8 = 0; | ||
pub const C: u8 = 0; | ||
fn foo() {} | ||
fn bar(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,65 @@ | ||
error[E0390]: only a single inherent implementation marked with `#[lang = "u8"]` is allowed for the `u8` primitive | ||
--> $DIR/kinds-of-primitive-impl.rs:4:1 | ||
| | ||
LL | / impl u8 { | ||
LL | | | ||
LL | | pub const B: u8 = 0; | ||
LL | | } | ||
| |_^ | ||
| | ||
help: consider using a trait to implement this constant | ||
--> $DIR/kinds-of-primitive-impl.rs:4:1 | ||
| | ||
LL | / impl u8 { | ||
LL | | | ||
LL | | pub const B: u8 = 0; | ||
LL | | } | ||
| |_^ | ||
|
||
error[E0390]: only a single inherent implementation marked with `#[lang = "str"]` is allowed for the `str` primitive | ||
--> $DIR/kinds-of-primitive-impl.rs:9:1 | ||
| | ||
LL | / impl str { | ||
LL | | | ||
LL | | fn foo() {} | ||
LL | | fn bar(self) {} | ||
LL | | } | ||
| |_^ | ||
| | ||
help: consider using a trait to implement these methods | ||
--> $DIR/kinds-of-primitive-impl.rs:9:1 | ||
| | ||
LL | / impl str { | ||
LL | | | ||
LL | | fn foo() {} | ||
LL | | fn bar(self) {} | ||
LL | | } | ||
| |_^ | ||
|
||
error[E0390]: only a single inherent implementation marked with `#[lang = "char"]` is allowed for the `char` primitive | ||
--> $DIR/kinds-of-primitive-impl.rs:15:1 | ||
| | ||
LL | / impl char { | ||
LL | | | ||
LL | | pub const B: u8 = 0; | ||
LL | | pub const C: u8 = 0; | ||
LL | | fn foo() {} | ||
LL | | fn bar(self) {} | ||
LL | | } | ||
| |_^ | ||
| | ||
help: consider using a trait to implement these associated items | ||
--> $DIR/kinds-of-primitive-impl.rs:15:1 | ||
| | ||
LL | / impl char { | ||
LL | | | ||
LL | | pub const B: u8 = 0; | ||
LL | | pub const C: u8 = 0; | ||
LL | | fn foo() {} | ||
LL | | fn bar(self) {} | ||
LL | | } | ||
| |_^ | ||
|
||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0390`. |
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