Skip to content

Commit db476e7

Browse files
author
Nick Hamann
committed
---
yaml --- r: 209306 b: refs/heads/auto c: 50b802a h: refs/heads/master v: v3
1 parent ef171eb commit db476e7

File tree

2 files changed

+43
-3
lines changed

2 files changed

+43
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 35d979d8f8bb63b6063e30954c7c71ddf863b380
13+
refs/heads/auto: 50b802ade0d9aecf3a781c98c8f051b3714db3ea
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/librustc_typeck/diagnostics.rs

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,48 @@ it has been disabled for now.
443443
[iss20126]: https://github.com/rust-lang/rust/issues/20126
444444
"##,
445445

446+
E0185: r##"
447+
An associated function for a trait was defined to be static, but an
448+
implementation of the trait declared the same function to be a method (i.e. to
449+
take a `self` parameter).
450+
451+
Here's an example of this error:
452+
453+
```
454+
trait Foo {
455+
fn foo();
456+
}
457+
458+
struct Bar;
459+
460+
impl Foo for Bar {
461+
// error, method `foo` has a `&self` declaration in the impl, but not in
462+
// the trait
463+
fn foo(&self) {}
464+
}
465+
"##,
466+
467+
E0186: r##"
468+
An associated function for a trait was defined to be a method (i.e. to take a
469+
`self` parameter), but an implementation of the trait declared the same function
470+
to be static.
471+
472+
Here's an example of this error:
473+
474+
```
475+
trait Foo {
476+
fn foo(&self);
477+
}
478+
479+
struct Bar;
480+
481+
impl Foo for Bar {
482+
// error, method `foo` has a `&self` declaration in the trait, but not in
483+
// the impl
484+
fn foo() {}
485+
}
486+
"##,
487+
446488
E0197: r##"
447489
Inherent implementations (one that do not implement a trait but provide
448490
methods associated with a type) are always safe because they are not
@@ -828,8 +870,6 @@ register_diagnostics! {
828870
E0174, // explicit use of unboxed closure methods are experimental
829871
E0182,
830872
E0183,
831-
E0185,
832-
E0186,
833873
E0187, // can't infer the kind of the closure
834874
E0188, // types differ in mutability
835875
E0189, // can only cast a boxed pointer to a boxed object

0 commit comments

Comments
 (0)