Skip to content

Commit 23e0c24

Browse files
authored
Rollup merge of rust-lang#36429 - durka:patch-30, r=nagisa
fix "X is not a member of trait Y" span labels Fixes rust-lang#36428.
2 parents 7494bc7 + 0a62676 commit 23e0c24

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/librustc_resolve/lib.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ fn resolve_struct_error<'b, 'a: 'b, 'c>(resolver: &'b Resolver<'a>,
247247
"method `{}` is not a member of trait `{}`",
248248
method,
249249
trait_);
250-
err.span_label(span, &format!("not a member of `{}`", trait_));
250+
err.span_label(span, &format!("not a member of trait `{}`", trait_));
251251
err
252252
}
253253
ResolutionError::TypeNotMemberOfTrait(type_, trait_) => {
@@ -257,7 +257,7 @@ fn resolve_struct_error<'b, 'a: 'b, 'c>(resolver: &'b Resolver<'a>,
257257
"type `{}` is not a member of trait `{}`",
258258
type_,
259259
trait_);
260-
err.span_label(span, &format!("not a member of trait `Foo`"));
260+
err.span_label(span, &format!("not a member of trait `{}`", trait_));
261261
err
262262
}
263263
ResolutionError::ConstNotMemberOfTrait(const_, trait_) => {
@@ -267,7 +267,7 @@ fn resolve_struct_error<'b, 'a: 'b, 'c>(resolver: &'b Resolver<'a>,
267267
"const `{}` is not a member of trait `{}`",
268268
const_,
269269
trait_);
270-
err.span_label(span, &format!("not a member of trait `Foo`"));
270+
err.span_label(span, &format!("not a member of trait `{}`", trait_));
271271
err
272272
}
273273
ResolutionError::VariableNotBoundInPattern(variable_name, from, to) => {

src/test/compile-fail/E0407.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ impl Foo for Bar {
1818
fn a() {}
1919
fn b() {}
2020
//~^ ERROR E0407
21-
//~| NOTE not a member of `Foo`
21+
//~| NOTE not a member of trait `Foo`
2222
}
2323

2424
fn main() {

src/test/compile-fail/E0438.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111
#![feature(associated_consts)]
1212

13-
trait Foo {}
13+
trait Bar {}
1414

15-
impl Foo for i32 {
15+
impl Bar for i32 {
1616
const BAR: bool = true; //~ ERROR E0438
17-
//~| NOTE not a member of trait `Foo`
17+
//~| NOTE not a member of trait `Bar`
1818
}
1919

2020
fn main () {

0 commit comments

Comments
 (0)