- let mut err = self.struct_span_err(sp, "unexpected `self` parameter in function");
- if is_trait_item {
- err.span_label(sp, "must be the first associated function parameter");
- } else {
- err.span_label(sp, "not valid as function parameter");
- err.note("`self` is only valid as the first parameter of an associated function");
- }
- err.emit();
+ self.struct_span_err(sp, "unexpected `self` parameter in function")
+ .span_label(sp, "must be the first parameter of an associated function")
+ .emit();