Skip to content

Commit a10ae04

Browse files
committed
moved renamed docs formatted stderr | kinds-of-primitive-impl.rs
1 parent fead493 commit a10ae04

File tree

3 files changed

+33
-31
lines changed

3 files changed

+33
-31
lines changed

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

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
//! Test that inherent impl blocks cannot be defined for primitive types
2+
3+
impl u8 {
4+
//~^ error: cannot define inherent `impl` for primitive types
5+
pub const B: u8 = 0;
6+
}
7+
8+
impl str {
9+
//~^ error: cannot define inherent `impl` for primitive types
10+
fn foo() {}
11+
fn bar(self) {} //~ ERROR: size for values of type `str` cannot be known
12+
}
13+
14+
impl char {
15+
//~^ error: cannot define inherent `impl` for primitive types
16+
pub const B: u8 = 0;
17+
pub const C: u8 = 0;
18+
fn foo() {}
19+
fn bar(self) {}
20+
}
21+
22+
struct MyType;
23+
impl &MyType {
24+
//~^ error: cannot define inherent `impl` for primitive types
25+
pub fn for_ref(self) {}
26+
}
27+
28+
fn main() {}

tests/ui/kinds-of-primitive-impl.stderr renamed to tests/ui/type/inherent-impl-primitive-types-error.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
error[E0390]: cannot define inherent `impl` for primitive types
2-
--> $DIR/kinds-of-primitive-impl.rs:1:1
2+
--> $DIR/inherent-impl-primitive-types-error.rs:3:1
33
|
44
LL | impl u8 {
55
| ^^^^^^^
66
|
77
= help: consider using an extension trait instead
88

99
error[E0390]: cannot define inherent `impl` for primitive types
10-
--> $DIR/kinds-of-primitive-impl.rs:6:1
10+
--> $DIR/inherent-impl-primitive-types-error.rs:8:1
1111
|
1212
LL | impl str {
1313
| ^^^^^^^^
1414
|
1515
= help: consider using an extension trait instead
1616

1717
error[E0390]: cannot define inherent `impl` for primitive types
18-
--> $DIR/kinds-of-primitive-impl.rs:12:1
18+
--> $DIR/inherent-impl-primitive-types-error.rs:14:1
1919
|
2020
LL | impl char {
2121
| ^^^^^^^^^
2222
|
2323
= help: consider using an extension trait instead
2424

2525
error[E0390]: cannot define inherent `impl` for primitive types
26-
--> $DIR/kinds-of-primitive-impl.rs:21:1
26+
--> $DIR/inherent-impl-primitive-types-error.rs:23:1
2727
|
2828
LL | impl &MyType {
2929
| ^^^^^^^^^^^^
@@ -32,7 +32,7 @@ LL | impl &MyType {
3232
= note: you could also try moving the reference to uses of `MyType` (such as `self`) within the implementation
3333

3434
error[E0277]: the size for values of type `str` cannot be known at compilation time
35-
--> $DIR/kinds-of-primitive-impl.rs:9:12
35+
--> $DIR/inherent-impl-primitive-types-error.rs:11:12
3636
|
3737
LL | fn bar(self) {}
3838
| ^^^^ doesn't have a size known at compile-time

0 commit comments

Comments
 (0)