1
Fork 0

Auto merge of #108324 - notriddle:notriddle/assoc-fn-method, r=compiler-errors,davidtwco,estebank,oli-obk

diagnostics: if AssocFn has self argument, describe as method

Discussed in https://rust-lang.zulipchat.com/#narrow/stream/147480-t-compiler.2Fwg-diagnostics/topic/.22associated.20function.22.20vs.20.22method.22/near/329265515

This commit also changes the tooltips on rustdoc intra-doc links targeting methods.

For anyone not sure why this is being done, see the Reference definitions of these terms in <https://doc.rust-lang.org/1.67.1/reference/items/associated-items.html#methods>

> Associated functions whose first parameter is named `self` are called methods and may be invoked using the [method call operator](https://doc.rust-lang.org/1.67.1/reference/expressions/method-call-expr.html), for example, `x.foo()`, as well as the usual function call notation.

In particular, while this means it's technically correct for rustc to refer to a method as an associated function (and there are a few cases where it'll still do so), rustc *must never* use the term "method" to refer to an associated function that does not have a `self` parameter.
This commit is contained in:
bors 2023-02-23 00:19:12 +00:00
commit 0978711950
160 changed files with 761 additions and 706 deletions

View file

@ -2135,7 +2135,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
) -> DiagnosticBuilder<'cx, ErrorGuaranteed> { ) -> DiagnosticBuilder<'cx, ErrorGuaranteed> {
let tcx = self.infcx.tcx; let tcx = self.infcx.tcx;
let (_, escapes_from) = tcx.article_and_description(self.mir_def_id().to_def_id()); let escapes_from = tcx.def_descr(self.mir_def_id().to_def_id());
let mut err = let mut err =
borrowck_errors::borrowed_data_escapes_closure(tcx, escape_span, escapes_from); borrowck_errors::borrowed_data_escapes_closure(tcx, escape_span, escapes_from);

View file

@ -660,10 +660,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
errci.outlived_fr, errci.outlived_fr,
); );
let (_, escapes_from) = self let escapes_from =
.infcx self.infcx.tcx.def_descr(self.regioncx.universal_regions().defining_ty.def_id());
.tcx
.article_and_description(self.regioncx.universal_regions().defining_ty.def_id());
// Revert to the normal error in these cases. // Revert to the normal error in these cases.
// Assignments aren't "escapes" in function items. // Assignments aren't "escapes" in function items.
@ -757,8 +755,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
.. ..
} = errci; } = errci;
let (_, mir_def_name) = let mir_def_name = self.infcx.tcx.def_descr(self.mir_def_id().to_def_id());
self.infcx.tcx.article_and_description(self.mir_def_id().to_def_id());
let err = LifetimeOutliveErr { span: *span }; let err = LifetimeOutliveErr { span: *span };
let mut diag = self.infcx.tcx.sess.create_err(err); let mut diag = self.infcx.tcx.sess.create_err(err);

View file

@ -124,6 +124,11 @@ pub enum DefKind {
} }
impl DefKind { impl DefKind {
/// Get an English description for the item's kind.
///
/// If you have access to `TyCtxt`, use `TyCtxt::def_descr` or
/// `TyCtxt::def_kind_descr` instead, because they give better
/// information for generators and associated functions.
pub fn descr(self, def_id: DefId) -> &'static str { pub fn descr(self, def_id: DefId) -> &'static str {
match self { match self {
DefKind::Fn => "function", DefKind::Fn => "function",
@ -166,6 +171,10 @@ impl DefKind {
} }
/// Gets an English article for the definition. /// Gets an English article for the definition.
///
/// If you have access to `TyCtxt`, use `TyCtxt::def_descr_article` or
/// `TyCtxt::def_kind_descr_article` instead, because they give better
/// information for generators and associated functions.
pub fn article(&self) -> &'static str { pub fn article(&self) -> &'static str {
match *self { match *self {
DefKind::AssocTy DefKind::AssocTy

View file

@ -304,10 +304,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
if let Some(did) = adt_did { if let Some(did) = adt_did {
err.span_label( err.span_label(
tcx.def_span(did), tcx.def_span(did),
format!( format!("associated item `{name}` not found for this {}", tcx.def_descr(did)),
"associated item `{name}` not found for this {}",
tcx.def_kind(did).descr(did)
),
); );
} }
}; };

View file

@ -1217,7 +1217,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
| (hir::def::DefKind::AssocConst, ty::TermKind::Const(_)) => (), | (hir::def::DefKind::AssocConst, ty::TermKind::Const(_)) => (),
(_, _) => { (_, _) => {
let got = if let Some(_) = term.ty() { "type" } else { "constant" }; let got = if let Some(_) = term.ty() { "type" } else { "constant" };
let expected = def_kind.descr(assoc_item_def_id); let expected = tcx.def_descr(assoc_item_def_id);
let mut err = tcx.sess.struct_span_err( let mut err = tcx.sess.struct_span_err(
binding.span, binding.span,
&format!("expected {expected} bound, found {got}"), &format!("expected {expected} bound, found {got}"),
@ -1552,7 +1552,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
i.bottom().1, i.bottom().1,
E0038, E0038,
"the {} `{}` cannot be made into an object", "the {} `{}` cannot be made into an object",
tcx.def_kind(def_id).descr(def_id), tcx.def_descr(def_id),
tcx.item_name(def_id), tcx.item_name(def_id),
); );
err.note( err.note(
@ -2174,7 +2174,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
"`{}` could{} refer to the {} defined here", "`{}` could{} refer to the {} defined here",
assoc_ident, assoc_ident,
also, also,
kind.descr(def_id) tcx.def_kind_descr(kind, def_id)
); );
lint.span_note(tcx.def_span(def_id), &note_msg); lint.span_note(tcx.def_span(def_id), &note_msg);
}; };
@ -2350,7 +2350,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
let kind = DefKind::AssocTy; let kind = DefKind::AssocTy;
if !tcx.visibility(item).is_accessible_from(def_scope, tcx) { if !tcx.visibility(item).is_accessible_from(def_scope, tcx) {
let kind = kind.descr(item); let kind = tcx.def_kind_descr(kind, item);
let msg = format!("{kind} `{name}` is private"); let msg = format!("{kind} `{name}` is private");
let def_span = tcx.def_span(item); let def_span = tcx.def_span(item);
tcx.sess tcx.sess

View file

@ -1461,7 +1461,7 @@ fn opaque_type_cycle_error(
span, span,
format!( format!(
"{} captures itself here", "{} captures itself here",
tcx.def_kind(closure_def_id).descr(closure_def_id) tcx.def_descr(closure_def_id)
), ),
); );
} }

View file

@ -71,7 +71,7 @@ fn ensure_drop_params_and_item_params_correspond<'tcx>(
let drop_impl_span = tcx.def_span(drop_impl_did); let drop_impl_span = tcx.def_span(drop_impl_did);
let item_span = tcx.def_span(self_type_did); let item_span = tcx.def_span(self_type_did);
let self_descr = tcx.def_kind(self_type_did).descr(self_type_did); let self_descr = tcx.def_descr(self_type_did);
let mut err = let mut err =
struct_span_err!(tcx.sess, drop_impl_span, E0366, "`Drop` impls cannot be specialized"); struct_span_err!(tcx.sess, drop_impl_span, E0366, "`Drop` impls cannot be specialized");
match arg { match arg {
@ -217,7 +217,7 @@ fn ensure_drop_predicates_are_implied_by_item_defn<'tcx>(
if !assumptions_in_impl_context.iter().copied().any(predicate_matches_closure) { if !assumptions_in_impl_context.iter().copied().any(predicate_matches_closure) {
let item_span = tcx.def_span(self_type_did); let item_span = tcx.def_span(self_type_did);
let self_descr = tcx.def_kind(self_type_did).descr(self_type_did.to_def_id()); let self_descr = tcx.def_descr(self_type_did.to_def_id());
let reported = struct_span_err!( let reported = struct_span_err!(
tcx.sess, tcx.sess,
predicate_sp, predicate_sp,

View file

@ -532,7 +532,7 @@ fn lint_auto_trait_impl<'tcx>(
}), }),
|lint| { |lint| {
let item_span = tcx.def_span(self_type_did); let item_span = tcx.def_span(self_type_did);
let self_descr = tcx.def_kind(self_type_did).descr(self_type_did); let self_descr = tcx.def_descr(self_type_did);
match arg { match arg {
ty::util::NotUniqueParam::DuplicateParam(arg) => { ty::util::NotUniqueParam::DuplicateParam(arg) => {
lint.note(&format!("`{}` is mentioned multiple times", arg)); lint.note(&format!("`{}` is mentioned multiple times", arg));

View file

@ -439,7 +439,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
fn create_error_message(&self) -> String { fn create_error_message(&self) -> String {
let def_path = self.tcx.def_path_str(self.def_id); let def_path = self.tcx.def_path_str(self.def_id);
let def_kind = self.tcx.def_kind(self.def_id).descr(self.def_id); let def_kind = self.tcx.def_descr(self.def_id);
let (quantifier, bound) = self.get_quantifier_and_bound(); let (quantifier, bound) = self.get_quantifier_and_bound();
let kind = self.kind(); let kind = self.kind();
let provided_lt_args = self.num_provided_lifetime_args(); let provided_lt_args = self.num_provided_lifetime_args();
@ -990,7 +990,7 @@ impl<'a, 'tcx> WrongNumberOfGenericArgs<'a, 'tcx> {
}; };
let msg = { let msg = {
let def_kind = self.tcx.def_kind(self.def_id).descr(self.def_id); let def_kind = self.tcx.def_descr(self.def_id);
let (quantifier, bound) = self.get_quantifier_and_bound(); let (quantifier, bound) = self.get_quantifier_and_bound();
let params = if bound == 0 { let params = if bound == 0 {

View file

@ -671,7 +671,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
&& !self.type_is_sized_modulo_regions(self.param_env, output_ty, callee_expr.span) && !self.type_is_sized_modulo_regions(self.param_env, output_ty, callee_expr.span)
{ {
let descr = match maybe_def { let descr = match maybe_def {
DefIdOrName::DefId(def_id) => self.tcx.def_kind(def_id).descr(def_id), DefIdOrName::DefId(def_id) => self.tcx.def_descr(def_id),
DefIdOrName::Name(name) => name, DefIdOrName::Name(name) => name,
}; };
err.span_label( err.span_label(

View file

@ -2448,7 +2448,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
return_ty: Option<Ty<'tcx>>, return_ty: Option<Ty<'tcx>>,
) { ) {
let struct_path = self.tcx().def_path_str(base_did); let struct_path = self.tcx().def_path_str(base_did);
let kind_name = self.tcx().def_kind(base_did).descr(base_did); let kind_name = self.tcx().def_descr(base_did);
let mut err = struct_span_err!( let mut err = struct_span_err!(
self.tcx().sess, self.tcx().sess,
field.span, field.span,

View file

@ -1938,8 +1938,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
spans.push_span_label(param.span, ""); spans.push_span_label(param.span, "");
} }
let def_kind = self.tcx.def_kind(def_id); err.span_note(spans, &format!("{} defined here", self.tcx.def_descr(def_id)));
err.span_note(spans, &format!("{} defined here", def_kind.descr(def_id)));
} else if let Some(hir::Node::Expr(e)) = self.tcx.hir().get_if_local(def_id) } else if let Some(hir::Node::Expr(e)) = self.tcx.hir().get_if_local(def_id)
&& let hir::ExprKind::Closure(hir::Closure { body, .. }) = &e.kind && let hir::ExprKind::Closure(hir::Closure { body, .. }) = &e.kind
{ {
@ -1952,10 +1951,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}; };
err.span_note(span, &format!("{} defined here", kind)); err.span_note(span, &format!("{} defined here", kind));
} else { } else {
let def_kind = self.tcx.def_kind(def_id);
err.span_note( err.span_note(
self.tcx.def_span(def_id), self.tcx.def_span(def_id),
&format!("{} defined here", def_kind.descr(def_id)), &format!("{} defined here", self.tcx.def_descr(def_id)),
); );
} }
} }

View file

@ -121,7 +121,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
DefIdOrName::DefId(def_id) => match self.tcx.def_kind(def_id) { DefIdOrName::DefId(def_id) => match self.tcx.def_kind(def_id) {
DefKind::Ctor(CtorOf::Struct, _) => "construct this tuple struct".to_string(), DefKind::Ctor(CtorOf::Struct, _) => "construct this tuple struct".to_string(),
DefKind::Ctor(CtorOf::Variant, _) => "construct this tuple variant".to_string(), DefKind::Ctor(CtorOf::Variant, _) => "construct this tuple variant".to_string(),
kind => format!("call this {}", kind.descr(def_id)), kind => format!("call this {}", self.tcx.def_kind_descr(kind, def_id)),
}, },
DefIdOrName::Name(name) => format!("call this {name}"), DefIdOrName::Name(name) => format!("call this {name}"),
}; };
@ -340,7 +340,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
CtorOf::Variant => "an enum variant", CtorOf::Variant => "an enum variant",
})); }));
} else { } else {
let descr = kind.descr(def_id); let descr = self.tcx.def_kind_descr(kind, def_id);
err.span_label(sp, format!("{descr} `{name}` defined here")); err.span_label(sp, format!("{descr} `{name}` defined here"));
} }
return true; return true;

View file

@ -1366,8 +1366,8 @@ impl<'tcx> Pick<'tcx> {
span, span,
format!( format!(
"{} {} with this name may be added to the standard library in the future", "{} {} with this name may be added to the standard library in the future",
def_kind.article(), tcx.def_kind_descr_article(def_kind, self.item.def_id),
def_kind.descr(self.item.def_id), tcx.def_kind_descr(def_kind, self.item.def_id),
), ),
|lint| { |lint| {
match (self.item.kind, self.item.container) { match (self.item.kind, self.item.container) {

View file

@ -160,7 +160,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
} }
MethodError::PrivateMatch(kind, def_id, out_of_scope_traits) => { MethodError::PrivateMatch(kind, def_id, out_of_scope_traits) => {
let kind = kind.descr(def_id); let kind = self.tcx.def_kind_descr(kind, def_id);
let mut err = struct_span_err!( let mut err = struct_span_err!(
self.tcx.sess, self.tcx.sess,
item_name.span, item_name.span,
@ -1062,8 +1062,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
span, span,
&format!( &format!(
"there is {} {} with a similar name", "there is {} {} with a similar name",
def_kind.article(), self.tcx.def_kind_descr_article(def_kind, similar_candidate.def_id),
def_kind.descr(similar_candidate.def_id), self.tcx.def_kind_descr(def_kind, similar_candidate.def_id)
), ),
similar_candidate.name, similar_candidate.name,
Applicability::MaybeIncorrect, Applicability::MaybeIncorrect,
@ -1172,7 +1172,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
path, path,
ty, ty,
item.kind, item.kind,
item.def_id, self.tcx.def_kind_descr(item.kind.as_def_kind(), item.def_id),
sugg_span, sugg_span,
idx, idx,
self.tcx.sess.source_map(), self.tcx.sess.source_map(),
@ -1208,7 +1208,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
path, path,
rcvr_ty, rcvr_ty,
item.kind, item.kind,
item.def_id, self.tcx.def_kind_descr(item.kind.as_def_kind(), item.def_id),
sugg_span, sugg_span,
idx, idx,
self.tcx.sess.source_map(), self.tcx.sess.source_map(),
@ -2853,7 +2853,7 @@ fn print_disambiguation_help<'tcx>(
trait_name: String, trait_name: String,
rcvr_ty: Ty<'_>, rcvr_ty: Ty<'_>,
kind: ty::AssocKind, kind: ty::AssocKind,
def_id: DefId, def_kind_descr: &'static str,
span: Span, span: Span,
candidate: Option<usize>, candidate: Option<usize>,
source_map: &source_map::SourceMap, source_map: &source_map::SourceMap,
@ -2886,7 +2886,7 @@ fn print_disambiguation_help<'tcx>(
span, span,
&format!( &format!(
"disambiguate the {} for {}", "disambiguate the {} for {}",
kind.as_def_kind().descr(def_id), def_kind_descr,
if let Some(candidate) = candidate { if let Some(candidate) = candidate {
format!("candidate #{}", candidate) format!("candidate #{}", candidate)
} else { } else {

View file

@ -122,7 +122,7 @@ impl InferenceDiagnosticsParentData {
tcx.def_key(parent_def_id).disambiguated_data.data.get_opt_name()?.to_string(); tcx.def_key(parent_def_id).disambiguated_data.data.get_opt_name()?.to_string();
Some(InferenceDiagnosticsParentData { Some(InferenceDiagnosticsParentData {
prefix: tcx.def_kind(parent_def_id).descr(parent_def_id), prefix: tcx.def_descr(parent_def_id),
name: parent_name, name: parent_name,
}) })
} }

View file

@ -255,7 +255,7 @@ fn late_report_deprecation(
let method_span = method_span.unwrap_or(span); let method_span = method_span.unwrap_or(span);
tcx.struct_span_lint_hir(lint, hir_id, method_span, message, |diag| { tcx.struct_span_lint_hir(lint, hir_id, method_span, message, |diag| {
if let hir::Node::Expr(_) = tcx.hir().get(hir_id) { if let hir::Node::Expr(_) = tcx.hir().get(hir_id) {
let kind = tcx.def_kind(def_id).descr(def_id); let kind = tcx.def_descr(def_id);
deprecation_suggestion(diag, kind, suggestion, method_span); deprecation_suggestion(diag, kind, suggestion, method_span);
} }
diag diag
@ -392,7 +392,7 @@ impl<'tcx> TyCtxt<'tcx> {
let lint = deprecation_lint(is_in_effect); let lint = deprecation_lint(is_in_effect);
if self.lint_level_at_node(lint, id).0 != Level::Allow { if self.lint_level_at_node(lint, id).0 != Level::Allow {
let def_path = with_no_trimmed_paths!(self.def_path_str(def_id)); let def_path = with_no_trimmed_paths!(self.def_path_str(def_id));
let def_kind = self.def_kind(def_id).descr(def_id); let def_kind = self.def_descr(def_id);
late_report_deprecation( late_report_deprecation(
self, self,

View file

@ -1200,13 +1200,8 @@ impl<'tcx> TyCtxt<'tcx> {
/// Returns a displayable description and article for the given `def_id` (e.g. `("a", "struct")`). /// Returns a displayable description and article for the given `def_id` (e.g. `("a", "struct")`).
pub fn article_and_description(self, def_id: DefId) -> (&'static str, &'static str) { pub fn article_and_description(self, def_id: DefId) -> (&'static str, &'static str) {
match self.def_kind(def_id) { let kind = self.def_kind(def_id);
DefKind::Generator => match self.generator_kind(def_id).unwrap() { (self.def_kind_descr_article(kind, def_id), self.def_kind_descr(kind, def_id))
rustc_hir::GeneratorKind::Async(..) => ("an", "async closure"),
rustc_hir::GeneratorKind::Gen => ("a", "generator"),
},
def_kind => (def_kind.article(), def_kind.descr(def_id)),
}
} }
pub fn type_length_limit(self) -> Limit { pub fn type_length_limit(self) -> Limit {

View file

@ -761,6 +761,40 @@ impl<'tcx> TyCtxt<'tcx> {
} }
(generator_layout, generator_saved_local_names) (generator_layout, generator_saved_local_names)
} }
/// Query and get an English description for the item's kind.
pub fn def_descr(self, def_id: DefId) -> &'static str {
self.def_kind_descr(self.def_kind(def_id), def_id)
}
/// Get an English description for the item's kind.
pub fn def_kind_descr(self, def_kind: DefKind, def_id: DefId) -> &'static str {
match def_kind {
DefKind::AssocFn if self.associated_item(def_id).fn_has_self_parameter => "method",
DefKind::Generator => match self.generator_kind(def_id).unwrap() {
rustc_hir::GeneratorKind::Async(..) => "async closure",
rustc_hir::GeneratorKind::Gen => "generator",
},
_ => def_kind.descr(def_id),
}
}
/// Gets an English article for the [`TyCtxt::def_descr`].
pub fn def_descr_article(self, def_id: DefId) -> &'static str {
self.def_kind_descr_article(self.def_kind(def_id), def_id)
}
/// Gets an English article for the [`TyCtxt::def_kind_descr`].
pub fn def_kind_descr_article(self, def_kind: DefKind, def_id: DefId) -> &'static str {
match def_kind {
DefKind::AssocFn if self.associated_item(def_id).fn_has_self_parameter => "a",
DefKind::Generator => match self.generator_kind(def_id).unwrap() {
rustc_hir::GeneratorKind::Async(..) => "an",
rustc_hir::GeneratorKind::Gen => "a",
},
_ => def_kind.article(),
}
}
} }
struct OpaqueTypeExpander<'tcx> { struct OpaqueTypeExpander<'tcx> {

View file

@ -694,7 +694,7 @@ impl<'tcx> DeadVisitor<'tcx> {
}) })
.collect(); .collect();
let descr = tcx.def_kind(first_id).descr(first_id.to_def_id()); let descr = tcx.def_descr(first_id.to_def_id());
let num = dead_codes.len(); let num = dead_codes.len();
let multiple = num > 6; let multiple = num > 6;
let name_list = names.into(); let name_list = names.into();
@ -706,7 +706,7 @@ impl<'tcx> DeadVisitor<'tcx> {
}; };
let parent_info = if let Some(parent_item) = parent_item { let parent_info = if let Some(parent_item) = parent_item {
let parent_descr = tcx.def_kind(parent_item).descr(parent_item.to_def_id()); let parent_descr = tcx.def_descr(parent_item.to_def_id());
Some(ParentInfo { Some(ParentInfo {
num, num,
descr, descr,

View file

@ -523,7 +523,7 @@ impl<'tcx> MissingStabilityAnnotations<'tcx> {
&& stab.is_none() && stab.is_none()
&& self.effective_visibilities.is_reachable(def_id) && self.effective_visibilities.is_reachable(def_id)
{ {
let descr = self.tcx.def_kind(def_id).descr(def_id.to_def_id()); let descr = self.tcx.def_descr(def_id.to_def_id());
self.tcx.sess.emit_err(errors::MissingStabilityAttr { span, descr }); self.tcx.sess.emit_err(errors::MissingStabilityAttr { span, descr });
} }
} }
@ -551,7 +551,7 @@ impl<'tcx> MissingStabilityAnnotations<'tcx> {
let is_reachable = self.effective_visibilities.is_reachable(def_id); let is_reachable = self.effective_visibilities.is_reachable(def_id);
if is_const && is_stable && missing_const_stability_attribute && is_reachable { if is_const && is_stable && missing_const_stability_attribute && is_reachable {
let descr = self.tcx.def_kind(def_id).descr(def_id.to_def_id()); let descr = self.tcx.def_descr(def_id.to_def_id());
self.tcx.sess.emit_err(errors::MissingConstStabAttr { span, descr }); self.tcx.sess.emit_err(errors::MissingConstStabAttr { span, descr });
} }
} }

View file

@ -1336,7 +1336,7 @@ impl<'tcx> Visitor<'tcx> for TypePrivacyVisitor<'tcx> {
hir::QPath::Resolved(_, path) => Some(self.tcx.def_path_str(path.res.def_id())), hir::QPath::Resolved(_, path) => Some(self.tcx.def_path_str(path.res.def_id())),
hir::QPath::TypeRelative(_, segment) => Some(segment.ident.to_string()), hir::QPath::TypeRelative(_, segment) => Some(segment.ident.to_string()),
}; };
let kind = kind.descr(def_id); let kind = self.tcx.def_descr(def_id);
let sess = self.tcx.sess; let sess = self.tcx.sess;
let _ = match name { let _ = match name {
Some(name) => { Some(name) => {

View file

@ -189,7 +189,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
} }
let container = match parent.kind { let container = match parent.kind {
ModuleKind::Def(kind, _, _) => kind.descr(parent.def_id()), ModuleKind::Def(kind, _, _) => self.tcx.def_kind_descr(kind, parent.def_id()),
ModuleKind::Block => "block", ModuleKind::Block => "block",
}; };
@ -1804,7 +1804,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
found("module") found("module")
} else { } else {
match binding.res() { match binding.res() {
Res::Def(kind, id) => found(kind.descr(id)), Res::Def(kind, id) => found(self.tcx.def_kind_descr(kind, id)),
_ => found(ns_to_try.descr()), _ => found(ns_to_try.descr()),
} }
} }

View file

@ -927,7 +927,10 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
DefKind::Ctor(CtorOf::Variant, _) => { DefKind::Ctor(CtorOf::Variant, _) => {
"use parentheses to construct this tuple variant".to_string() "use parentheses to construct this tuple variant".to_string()
} }
kind => format!("use parentheses to call this {}", kind.descr(def_id)), kind => format!(
"use parentheses to call this {}",
self.tcx.def_kind_descr(kind, def_id)
),
}, },
DefIdOrName::Name(name) => format!("use parentheses to call this {name}"), DefIdOrName::Name(name) => format!("use parentheses to call this {name}"),
}; };
@ -2139,7 +2142,7 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
err.note(&format!( err.note(&format!(
"{}s cannot be accessed directly on a `trait`, they can only be \ "{}s cannot be accessed directly on a `trait`, they can only be \
accessed through a specific `impl`", accessed through a specific `impl`",
assoc_item.kind.as_def_kind().descr(item_def_id) self.tcx.def_kind_descr(assoc_item.kind.as_def_kind(), item_def_id)
)); ));
err.span_suggestion( err.span_suggestion(
span, span,

View file

@ -775,7 +775,7 @@ pub(crate) fn link_tooltip(did: DefId, fragment: &Option<UrlFragment>, cx: &Cont
let fqp = fqp.iter().map(|sym| sym.as_str()).join("::"); let fqp = fqp.iter().map(|sym| sym.as_str()).join("::");
if let &Some(UrlFragment::Item(id)) = fragment { if let &Some(UrlFragment::Item(id)) = fragment {
let name = cx.tcx().item_name(id); let name = cx.tcx().item_name(id);
let descr = cx.tcx().def_kind(id).descr(id); let descr = cx.tcx().def_descr(id);
format!("{descr} {fqp}::{name}") format!("{descr} {fqp}::{name}")
} else { } else {
format!("{shortty} {fqp}") format!("{shortty} {fqp}")

View file

@ -51,13 +51,13 @@ LL | | fn foo_with_impl(&self) {}
LL | | } LL | | }
| |_^ | |_^
error: missing documentation for an associated function error: missing documentation for a method
--> $DIR/missing_doc_impl.rs:44:5 --> $DIR/missing_doc_impl.rs:44:5
| |
LL | fn foo(&self); LL | fn foo(&self);
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
error: missing documentation for an associated function error: missing documentation for a method
--> $DIR/missing_doc_impl.rs:45:5 --> $DIR/missing_doc_impl.rs:45:5
| |
LL | fn foo_with_impl(&self) {} LL | fn foo_with_impl(&self) {}

View file

@ -2,7 +2,9 @@
// @has - '//a/@href' 'struct.ThisType.html' // @has - '//a/@href' 'struct.ThisType.html'
// @has - '//a/@title' 'struct basic::ThisType' // @has - '//a/@title' 'struct basic::ThisType'
// @has - '//a/@href' 'struct.ThisType.html#method.this_method' // @has - '//a/@href' 'struct.ThisType.html#method.this_method'
// @has - '//a/@title' 'associated function basic::ThisType::this_method' // @has - '//a/@title' 'method basic::ThisType::this_method'
// @has - '//a/@href' 'struct.ThisType.html#method.this_assoc_fn'
// @has - '//a/@title' 'associated function basic::ThisType::this_assoc_fn'
// @has - '//a/@href' 'enum.ThisEnum.html' // @has - '//a/@href' 'enum.ThisEnum.html'
// @has - '//a/@title' 'enum basic::ThisEnum' // @has - '//a/@title' 'enum basic::ThisEnum'
// @has - '//a/@href' 'enum.ThisEnum.html#variant.ThisVariant' // @has - '//a/@href' 'enum.ThisEnum.html#variant.ThisVariant'
@ -10,7 +12,9 @@
// @has - '//a/@href' 'trait.ThisTrait.html' // @has - '//a/@href' 'trait.ThisTrait.html'
// @has - '//a/@title' 'trait basic::ThisTrait' // @has - '//a/@title' 'trait basic::ThisTrait'
// @has - '//a/@href' 'trait.ThisTrait.html#tymethod.this_associated_method' // @has - '//a/@href' 'trait.ThisTrait.html#tymethod.this_associated_method'
// @has - '//a/@title' 'associated function basic::ThisTrait::this_associated_method' // @has - '//a/@title' 'method basic::ThisTrait::this_associated_method'
// @has - '//a/@href' 'trait.ThisTrait.html#tymethod.this_associated_fn'
// @has - '//a/@title' 'associated function basic::ThisTrait::this_associated_fn'
// @has - '//a/@href' 'trait.ThisTrait.html#associatedtype.ThisAssociatedType' // @has - '//a/@href' 'trait.ThisTrait.html#associatedtype.ThisAssociatedType'
// @has - '//a/@title' 'associated type basic::ThisTrait::ThisAssociatedType' // @has - '//a/@title' 'associated type basic::ThisTrait::ThisAssociatedType'
// @has - '//a/@href' 'trait.ThisTrait.html#associatedconstant.THIS_ASSOCIATED_CONST' // @has - '//a/@href' 'trait.ThisTrait.html#associatedconstant.THIS_ASSOCIATED_CONST'
@ -37,11 +41,13 @@
//! //!
//! * [`ThisType`](ThisType) //! * [`ThisType`](ThisType)
//! * [`ThisType::this_method`](ThisType::this_method) //! * [`ThisType::this_method`](ThisType::this_method)
//! * [`ThisType::this_assoc_fn`](ThisType::this_assoc_fn)
//! * [`ThisEnum`](ThisEnum) //! * [`ThisEnum`](ThisEnum)
//! * [`ThisEnum::ThisVariant`](ThisEnum::ThisVariant) //! * [`ThisEnum::ThisVariant`](ThisEnum::ThisVariant)
//! * [`ThisEnum::ThisVariantCtor`](ThisEnum::ThisVariantCtor) //! * [`ThisEnum::ThisVariantCtor`](ThisEnum::ThisVariantCtor)
//! * [`ThisTrait`](ThisTrait) //! * [`ThisTrait`](ThisTrait)
//! * [`ThisTrait::this_associated_method`](ThisTrait::this_associated_method) //! * [`ThisTrait::this_associated_method`](ThisTrait::this_associated_method)
//! * [`ThisTrait::this_associated_fn`](ThisTrait::this_associated_fn)
//! * [`ThisTrait::ThisAssociatedType`](ThisTrait::ThisAssociatedType) //! * [`ThisTrait::ThisAssociatedType`](ThisTrait::ThisAssociatedType)
//! * [`ThisTrait::THIS_ASSOCIATED_CONST`](ThisTrait::THIS_ASSOCIATED_CONST) //! * [`ThisTrait::THIS_ASSOCIATED_CONST`](ThisTrait::THIS_ASSOCIATED_CONST)
//! * [`ThisAlias`](ThisAlias) //! * [`ThisAlias`](ThisAlias)
@ -68,13 +74,15 @@ macro_rules! this_macro {
pub struct ThisType; pub struct ThisType;
impl ThisType { impl ThisType {
pub fn this_method() {} pub fn this_assoc_fn() {}
pub fn this_method(self) {}
} }
pub enum ThisEnum { ThisVariant, ThisVariantCtor(u32), } pub enum ThisEnum { ThisVariant, ThisVariantCtor(u32), }
pub trait ThisTrait { pub trait ThisTrait {
type ThisAssociatedType; type ThisAssociatedType;
const THIS_ASSOCIATED_CONST: u8; const THIS_ASSOCIATED_CONST: u8;
fn this_associated_method(); fn this_associated_fn();
fn this_associated_method(&self);
} }
pub type ThisAlias = Result<(), ()>; pub type ThisAlias = Result<(), ()>;
pub union ThisUnion { this_field: usize, } pub union ThisUnion { this_field: usize, }

View file

@ -6,7 +6,7 @@ LL | qux.foo(a, b, c, d, e, f, g, h, i, j, k, l);
| | | |
| arguments to this method are incorrect | arguments to this method are incorrect
| |
note: associated function defined here note: method defined here
--> $DIR/too-long.rs:4:8 --> $DIR/too-long.rs:4:8
| |
LL | fn foo( LL | fn foo(

View file

@ -34,7 +34,7 @@ LL | fn f() { ModelT.chip_paint(Blue); }
| | | |
| arguments to this method are incorrect | arguments to this method are incorrect
| |
note: associated function defined here note: method defined here
--> $DIR/associated-type-projection-from-supertrait.rs:12:8 --> $DIR/associated-type-projection-from-supertrait.rs:12:8
| |
LL | fn chip_paint(&self, c: Self::Color) { } LL | fn chip_paint(&self, c: Self::Color) { }
@ -48,7 +48,7 @@ LL | fn g() { ModelU.chip_paint(Black); }
| | | |
| arguments to this method are incorrect | arguments to this method are incorrect
| |
note: associated function defined here note: method defined here
--> $DIR/associated-type-projection-from-supertrait.rs:12:8 --> $DIR/associated-type-projection-from-supertrait.rs:12:8
| |
LL | fn chip_paint(&self, c: Self::Color) { } LL | fn chip_paint(&self, c: Self::Color) { }

View file

@ -12,7 +12,7 @@ impl Struct {
pub async fn run_dummy_fn(&self) { pub async fn run_dummy_fn(&self) {
foo(|| self.bar()).await; foo(|| self.bar()).await;
//~^ ERROR closure may outlive the current function //~^ ERROR closure may outlive the current function
//~| ERROR borrowed data escapes outside of associated function //~| ERROR borrowed data escapes outside of method
} }
pub fn bar(&self) {} pub fn bar(&self) {}

View file

@ -16,18 +16,18 @@ help: to force the closure to take ownership of `self` (and any other referenced
LL | foo(move || self.bar()).await; LL | foo(move || self.bar()).await;
| ++++ | ++++
error[E0521]: borrowed data escapes outside of associated function error[E0521]: borrowed data escapes outside of method
--> $DIR/issue-62097.rs:13:9 --> $DIR/issue-62097.rs:13:9
| |
LL | pub async fn run_dummy_fn(&self) { LL | pub async fn run_dummy_fn(&self) {
| ----- | -----
| | | |
| `self` is a reference that is only valid in the associated function body | `self` is a reference that is only valid in the method body
| let's call the lifetime of this reference `'1` | let's call the lifetime of this reference `'1`
LL | foo(|| self.bar()).await; LL | foo(|| self.bar()).await;
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
| | | |
| `self` escapes the associated function body here | `self` escapes the method body here
| argument requires that `'1` must outlive `'static` | argument requires that `'1` must outlive `'static`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -1,10 +1,10 @@
error[E0521]: borrowed data escapes outside of associated function error[E0521]: borrowed data escapes outside of method
--> $DIR/issue-72312.rs:12:9 --> $DIR/issue-72312.rs:12:9
| |
LL | pub async fn start(&self) { LL | pub async fn start(&self) {
| ----- | -----
| | | |
| `self` is a reference that is only valid in the associated function body | `self` is a reference that is only valid in the method body
| let's call the lifetime of this reference `'1` | let's call the lifetime of this reference `'1`
... ...
LL | / require_static(async move { LL | / require_static(async move {
@ -15,7 +15,7 @@ LL | | &self;
LL | | }); LL | | });
| | ^ | | ^
| | | | | |
| |__________`self` escapes the associated function body here | |__________`self` escapes the method body here
| argument requires that `'1` must outlive `'static` | argument requires that `'1` must outlive `'static`
error: aborting due to previous error error: aborting due to previous error

View file

@ -12,7 +12,7 @@ impl StructA {
async fn foo(&self) { async fn foo(&self) {
let bar = self.b.bar().await; let bar = self.b.bar().await;
spawn_blocking(move || { spawn_blocking(move || {
//~^ ERROR borrowed data escapes outside of associated function //~^ ERROR borrowed data escapes outside of method
self.b; self.b;
//~^ ERROR cannot move out of `self.b`, as `self` is a captured variable in an `Fn` closure //~^ ERROR cannot move out of `self.b`, as `self` is a captured variable in an `Fn` closure
}) })

View file

@ -10,13 +10,13 @@ LL |
LL | self.b; LL | self.b;
| ^^^^^^ move occurs because `self.b` has type `StructB`, which does not implement the `Copy` trait | ^^^^^^ move occurs because `self.b` has type `StructB`, which does not implement the `Copy` trait
error[E0521]: borrowed data escapes outside of associated function error[E0521]: borrowed data escapes outside of method
--> $DIR/issue-103624.rs:14:9 --> $DIR/issue-103624.rs:14:9
| |
LL | async fn foo(&self) { LL | async fn foo(&self) {
| ----- | -----
| | | |
| `self` is a reference that is only valid in the associated function body | `self` is a reference that is only valid in the method body
| let's call the lifetime of this reference `'1` | let's call the lifetime of this reference `'1`
LL | let bar = self.b.bar().await; LL | let bar = self.b.bar().await;
LL | / spawn_blocking(move || { LL | / spawn_blocking(move || {
@ -26,7 +26,7 @@ LL | |
LL | | }) LL | | })
| | ^ | | ^
| | | | | |
| |__________`self` escapes the associated function body here | |__________`self` escapes the method body here
| argument requires that `'1` must outlive `'static` | argument requires that `'1` must outlive `'static`
error: aborting due to 2 previous errors error: aborting due to 2 previous errors

View file

@ -2,7 +2,7 @@ error[E0282]: type annotations needed
--> $DIR/issue-105608.rs:13:22 --> $DIR/issue-105608.rs:13:22
| |
LL | Combination::<0>.and::<_>().and::<_>(); LL | Combination::<0>.and::<_>().and::<_>();
| ^^^ cannot infer type of the type parameter `M` declared on the associated function `and` | ^^^ cannot infer type of the type parameter `M` declared on the method `and`
| |
help: consider specifying the generic argument help: consider specifying the generic argument
| |

View file

@ -2,7 +2,7 @@ error[E0282]: type annotations needed
--> $DIR/method-chain.rs:15:33 --> $DIR/method-chain.rs:15:33
| |
LL | Foo.bar().bar().bar().bar().baz(); LL | Foo.bar().bar().bar().bar().baz();
| ^^^ cannot infer the value of the const parameter `N` declared on the associated function `baz` | ^^^ cannot infer the value of the const parameter `N` declared on the method `baz`
| |
help: consider specifying the generic argument help: consider specifying the generic argument
| |

View file

@ -2,7 +2,7 @@ error[E0282]: type annotations needed
--> $DIR/uninferred-consts.rs:9:9 --> $DIR/uninferred-consts.rs:9:9
| |
LL | Foo.foo(); LL | Foo.foo();
| ^^^ cannot infer the value of the const parameter `A` declared on the associated function `foo` | ^^^ cannot infer the value of the const parameter `A` declared on the method `foo`
| |
help: consider specifying the generic arguments help: consider specifying the generic arguments
| |

View file

@ -4,7 +4,7 @@ struct S;
fn main() { fn main() {
let _: u32 = 5i32.try_into::<32>().unwrap(); let _: u32 = 5i32.try_into::<32>().unwrap();
//~^ ERROR this associated function takes //~^ ERROR this method takes
S.f::<0>(); S.f::<0>();
//~^ ERROR no method named `f` //~^ ERROR no method named `f`

View file

@ -1,4 +1,4 @@
error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied error[E0107]: this method takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/invalid-const-arg-for-type-param.rs:6:23 --> $DIR/invalid-const-arg-for-type-param.rs:6:23
| |
LL | let _: u32 = 5i32.try_into::<32>().unwrap(); LL | let _: u32 = 5i32.try_into::<32>().unwrap();

View file

@ -14,22 +14,22 @@ mod cross_crate {
let foo = MethodTester; let foo = MethodTester;
deprecated(); //~ ERROR use of deprecated function `deprecation_lint::deprecated` deprecated(); //~ ERROR use of deprecated function `deprecation_lint::deprecated`
foo.method_deprecated(); //~ ERROR use of deprecated associated function `deprecation_lint::MethodTester::method_deprecated` foo.method_deprecated(); //~ ERROR use of deprecated method `deprecation_lint::MethodTester::method_deprecated`
Foo::method_deprecated(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::MethodTester::method_deprecated` Foo::method_deprecated(&foo); //~ ERROR use of deprecated method `deprecation_lint::MethodTester::method_deprecated`
<Foo>::method_deprecated(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::MethodTester::method_deprecated` <Foo>::method_deprecated(&foo); //~ ERROR use of deprecated method `deprecation_lint::MethodTester::method_deprecated`
foo.trait_deprecated(); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated` foo.trait_deprecated(); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated`
Trait::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated` Trait::trait_deprecated(&foo); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated`
<Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated` <Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated`
<Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated` <Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated`
deprecated_text(); //~ ERROR use of deprecated function `deprecation_lint::deprecated_text`: text deprecated_text(); //~ ERROR use of deprecated function `deprecation_lint::deprecated_text`: text
foo.method_deprecated_text(); //~ ERROR use of deprecated associated function `deprecation_lint::MethodTester::method_deprecated_text`: text foo.method_deprecated_text(); //~ ERROR use of deprecated method `deprecation_lint::MethodTester::method_deprecated_text`: text
Foo::method_deprecated_text(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::MethodTester::method_deprecated_text`: text Foo::method_deprecated_text(&foo); //~ ERROR use of deprecated method `deprecation_lint::MethodTester::method_deprecated_text`: text
<Foo>::method_deprecated_text(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::MethodTester::method_deprecated_text`: text <Foo>::method_deprecated_text(&foo); //~ ERROR use of deprecated method `deprecation_lint::MethodTester::method_deprecated_text`: text
foo.trait_deprecated_text(); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text foo.trait_deprecated_text(); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text
Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text
<Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text <Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text
<Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text <Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text
let _ = DeprecatedStruct { //~ ERROR use of deprecated struct `deprecation_lint::DeprecatedStruct`: text let _ = DeprecatedStruct { //~ ERROR use of deprecated struct `deprecation_lint::DeprecatedStruct`: text
i: 0 //~ ERROR use of deprecated field `deprecation_lint::DeprecatedStruct::i`: text i: 0 //~ ERROR use of deprecated field `deprecation_lint::DeprecatedStruct::i`: text
@ -61,19 +61,19 @@ mod cross_crate {
} }
fn test_method_param<Foo: Trait>(foo: Foo) { fn test_method_param<Foo: Trait>(foo: Foo) {
foo.trait_deprecated(); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated` foo.trait_deprecated(); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated`
Trait::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated` Trait::trait_deprecated(&foo); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated`
<Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated` <Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated`
<Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated` <Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated`
foo.trait_deprecated_text(); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text foo.trait_deprecated_text(); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text
Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text
<Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text <Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text
<Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text <Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text
} }
fn test_method_object(foo: &Trait) { fn test_method_object(foo: &Trait) {
foo.trait_deprecated(); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated` foo.trait_deprecated(); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated`
foo.trait_deprecated_text(); //~ ERROR use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text foo.trait_deprecated_text(); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text
} }
struct S; struct S;
@ -243,22 +243,22 @@ mod this_crate {
let foo = MethodTester; let foo = MethodTester;
deprecated(); //~ ERROR use of deprecated function `this_crate::deprecated` deprecated(); //~ ERROR use of deprecated function `this_crate::deprecated`
foo.method_deprecated(); //~ ERROR use of deprecated associated function `this_crate::MethodTester::method_deprecated` foo.method_deprecated(); //~ ERROR use of deprecated method `this_crate::MethodTester::method_deprecated`
Foo::method_deprecated(&foo); //~ ERROR use of deprecated associated function `this_crate::MethodTester::method_deprecated` Foo::method_deprecated(&foo); //~ ERROR use of deprecated method `this_crate::MethodTester::method_deprecated`
<Foo>::method_deprecated(&foo); //~ ERROR use of deprecated associated function `this_crate::MethodTester::method_deprecated` <Foo>::method_deprecated(&foo); //~ ERROR use of deprecated method `this_crate::MethodTester::method_deprecated`
foo.trait_deprecated(); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated` foo.trait_deprecated(); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated`
Trait::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated` Trait::trait_deprecated(&foo); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated`
<Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated` <Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated`
<Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated` <Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated`
deprecated_text(); //~ ERROR use of deprecated function `this_crate::deprecated_text`: text deprecated_text(); //~ ERROR use of deprecated function `this_crate::deprecated_text`: text
foo.method_deprecated_text(); //~ ERROR use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text foo.method_deprecated_text(); //~ ERROR use of deprecated method `this_crate::MethodTester::method_deprecated_text`: text
Foo::method_deprecated_text(&foo); //~ ERROR use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text Foo::method_deprecated_text(&foo); //~ ERROR use of deprecated method `this_crate::MethodTester::method_deprecated_text`: text
<Foo>::method_deprecated_text(&foo); //~ ERROR use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text <Foo>::method_deprecated_text(&foo); //~ ERROR use of deprecated method `this_crate::MethodTester::method_deprecated_text`: text
foo.trait_deprecated_text(); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text foo.trait_deprecated_text(); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
<Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text <Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
<Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text <Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
// Future deprecations are only permitted with `#![feature(staged_api)]` // Future deprecations are only permitted with `#![feature(staged_api)]`
deprecated_future(); //~ ERROR use of deprecated function deprecated_future(); //~ ERROR use of deprecated function
@ -289,19 +289,19 @@ mod this_crate {
} }
fn test_method_param<Foo: Trait>(foo: Foo) { fn test_method_param<Foo: Trait>(foo: Foo) {
foo.trait_deprecated(); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated` foo.trait_deprecated(); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated`
Trait::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated` Trait::trait_deprecated(&foo); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated`
<Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated` <Foo>::trait_deprecated(&foo); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated`
<Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated` <Foo as Trait>::trait_deprecated(&foo); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated`
foo.trait_deprecated_text(); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text foo.trait_deprecated_text(); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text Trait::trait_deprecated_text(&foo); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
<Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text <Foo>::trait_deprecated_text(&foo); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
<Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text <Foo as Trait>::trait_deprecated_text(&foo); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
} }
fn test_method_object(foo: &Trait) { fn test_method_object(foo: &Trait) {
foo.trait_deprecated(); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated` foo.trait_deprecated(); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated`
foo.trait_deprecated_text(); //~ ERROR use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text foo.trait_deprecated_text(); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
} }
#[deprecated(since = "1.0.0", note = "text")] #[deprecated(since = "1.0.0", note = "text")]

View file

@ -10,13 +10,13 @@ note: the lint level is defined here
LL | #![deny(deprecated)] LL | #![deny(deprecated)]
| ^^^^^^^^^^ | ^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::Trait::trait_deprecated`: text error: use of deprecated method `deprecation_lint::Trait::trait_deprecated`: text
--> $DIR/deprecation-lint.rs:21:16 --> $DIR/deprecation-lint.rs:21:16
| |
LL | Trait::trait_deprecated(&foo); LL | Trait::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::Trait::trait_deprecated`: text error: use of deprecated method `deprecation_lint::Trait::trait_deprecated`: text
--> $DIR/deprecation-lint.rs:23:25 --> $DIR/deprecation-lint.rs:23:25
| |
LL | <Foo as Trait>::trait_deprecated(&foo); LL | <Foo as Trait>::trait_deprecated(&foo);
@ -28,13 +28,13 @@ error: use of deprecated function `deprecation_lint::deprecated_text`: text
LL | deprecated_text(); LL | deprecated_text();
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text error: use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text
--> $DIR/deprecation-lint.rs:30:16 --> $DIR/deprecation-lint.rs:30:16
| |
LL | ... Trait::trait_deprecated_text(&foo); LL | Trait::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text error: use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text
--> $DIR/deprecation-lint.rs:32:25 --> $DIR/deprecation-lint.rs:32:25
| |
LL | ... <Foo as Trait>::trait_deprecated_text(&foo); LL | ... <Foo as Trait>::trait_deprecated_text(&foo);
@ -100,25 +100,25 @@ error: use of deprecated function `deprecation_lint::deprecated_text`: text
LL | macro_test_arg!(macro_test_arg!(deprecated_text())); LL | macro_test_arg!(macro_test_arg!(deprecated_text()));
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::Trait::trait_deprecated`: text error: use of deprecated method `deprecation_lint::Trait::trait_deprecated`: text
--> $DIR/deprecation-lint.rs:65:16 --> $DIR/deprecation-lint.rs:65:16
| |
LL | Trait::trait_deprecated(&foo); LL | Trait::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::Trait::trait_deprecated`: text error: use of deprecated method `deprecation_lint::Trait::trait_deprecated`: text
--> $DIR/deprecation-lint.rs:67:25 --> $DIR/deprecation-lint.rs:67:25
| |
LL | <Foo as Trait>::trait_deprecated(&foo); LL | <Foo as Trait>::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text error: use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text
--> $DIR/deprecation-lint.rs:69:16 --> $DIR/deprecation-lint.rs:69:16
| |
LL | ... Trait::trait_deprecated_text(&foo); LL | Trait::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text error: use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text
--> $DIR/deprecation-lint.rs:71:25 --> $DIR/deprecation-lint.rs:71:25
| |
LL | ... <Foo as Trait>::trait_deprecated_text(&foo); LL | ... <Foo as Trait>::trait_deprecated_text(&foo);
@ -184,13 +184,13 @@ error: use of deprecated function `this_crate::deprecated`: text
LL | deprecated(); LL | deprecated();
| ^^^^^^^^^^ | ^^^^^^^^^^
error: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text error: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/deprecation-lint.rs:250:16 --> $DIR/deprecation-lint.rs:250:16
| |
LL | Trait::trait_deprecated(&foo); LL | Trait::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text error: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/deprecation-lint.rs:252:25 --> $DIR/deprecation-lint.rs:252:25
| |
LL | <Foo as Trait>::trait_deprecated(&foo); LL | <Foo as Trait>::trait_deprecated(&foo);
@ -202,16 +202,16 @@ error: use of deprecated function `this_crate::deprecated_text`: text
LL | deprecated_text(); LL | deprecated_text();
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text error: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/deprecation-lint.rs:259:16 --> $DIR/deprecation-lint.rs:259:16
| |
LL | Trait::trait_deprecated_text(&foo); LL | Trait::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text error: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/deprecation-lint.rs:261:25 --> $DIR/deprecation-lint.rs:261:25
| |
LL | ... <Foo as Trait>::trait_deprecated_text(&foo); LL | <Foo as Trait>::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated function `this_crate::deprecated_future`: text error: use of deprecated function `this_crate::deprecated_future`: text
@ -274,28 +274,28 @@ error: use of deprecated tuple struct `this_crate::nested::DeprecatedTupleStruct
LL | ... let _ = nested::DeprecatedTupleStruct (1); LL | ... let _ = nested::DeprecatedTupleStruct (1);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text error: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/deprecation-lint.rs:293:16 --> $DIR/deprecation-lint.rs:293:16
| |
LL | Trait::trait_deprecated(&foo); LL | Trait::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text error: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/deprecation-lint.rs:295:25 --> $DIR/deprecation-lint.rs:295:25
| |
LL | <Foo as Trait>::trait_deprecated(&foo); LL | <Foo as Trait>::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text error: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/deprecation-lint.rs:297:16 --> $DIR/deprecation-lint.rs:297:16
| |
LL | Trait::trait_deprecated_text(&foo); LL | Trait::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text error: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/deprecation-lint.rs:299:25 --> $DIR/deprecation-lint.rs:299:25
| |
LL | ... <Foo as Trait>::trait_deprecated_text(&foo); LL | <Foo as Trait>::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated function `this_crate::test_fn_closure_body::{closure#0}::bar` error: use of deprecated function `this_crate::test_fn_closure_body::{closure#0}::bar`
@ -352,64 +352,64 @@ error: use of deprecated tuple struct `this_crate2::Deprecated2`: text
LL | let Deprecated2 LL | let Deprecated2
| ^^^^^^^^^^^ | ^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::MethodTester::method_deprecated`: text error: use of deprecated method `deprecation_lint::MethodTester::method_deprecated`: text
--> $DIR/deprecation-lint.rs:17:13 --> $DIR/deprecation-lint.rs:17:13
| |
LL | foo.method_deprecated(); LL | foo.method_deprecated();
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::MethodTester::method_deprecated`: text error: use of deprecated method `deprecation_lint::MethodTester::method_deprecated`: text
--> $DIR/deprecation-lint.rs:18:14 --> $DIR/deprecation-lint.rs:18:14
| |
LL | Foo::method_deprecated(&foo); LL | Foo::method_deprecated(&foo);
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::MethodTester::method_deprecated`: text error: use of deprecated method `deprecation_lint::MethodTester::method_deprecated`: text
--> $DIR/deprecation-lint.rs:19:16 --> $DIR/deprecation-lint.rs:19:16
| |
LL | <Foo>::method_deprecated(&foo); LL | <Foo>::method_deprecated(&foo);
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::Trait::trait_deprecated`: text error: use of deprecated method `deprecation_lint::Trait::trait_deprecated`: text
--> $DIR/deprecation-lint.rs:20:13 --> $DIR/deprecation-lint.rs:20:13
| |
LL | foo.trait_deprecated(); LL | foo.trait_deprecated();
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::Trait::trait_deprecated`: text error: use of deprecated method `deprecation_lint::Trait::trait_deprecated`: text
--> $DIR/deprecation-lint.rs:22:16 --> $DIR/deprecation-lint.rs:22:16
| |
LL | <Foo>::trait_deprecated(&foo); LL | <Foo>::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::MethodTester::method_deprecated_text`: text error: use of deprecated method `deprecation_lint::MethodTester::method_deprecated_text`: text
--> $DIR/deprecation-lint.rs:26:13 --> $DIR/deprecation-lint.rs:26:13
| |
LL | ... foo.method_deprecated_text(); LL | foo.method_deprecated_text();
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::MethodTester::method_deprecated_text`: text error: use of deprecated method `deprecation_lint::MethodTester::method_deprecated_text`: text
--> $DIR/deprecation-lint.rs:27:14 --> $DIR/deprecation-lint.rs:27:14
| |
LL | ... Foo::method_deprecated_text(&foo); LL | Foo::method_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::MethodTester::method_deprecated_text`: text error: use of deprecated method `deprecation_lint::MethodTester::method_deprecated_text`: text
--> $DIR/deprecation-lint.rs:28:16 --> $DIR/deprecation-lint.rs:28:16
| |
LL | ... <Foo>::method_deprecated_text(&foo); LL | ... <Foo>::method_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text error: use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text
--> $DIR/deprecation-lint.rs:29:13 --> $DIR/deprecation-lint.rs:29:13
| |
LL | foo.trait_deprecated_text(); LL | foo.trait_deprecated_text();
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text error: use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text
--> $DIR/deprecation-lint.rs:31:16 --> $DIR/deprecation-lint.rs:31:16
| |
LL | ... <Foo>::trait_deprecated_text(&foo); LL | <Foo>::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated field `deprecation_lint::DeprecatedStruct::i`: text error: use of deprecated field `deprecation_lint::DeprecatedStruct::i`: text
@ -424,37 +424,37 @@ error: use of deprecated field `deprecation_lint::nested::DeprecatedStruct::i`:
LL | i: 0 LL | i: 0
| ^^^^ | ^^^^
error: use of deprecated associated function `deprecation_lint::Trait::trait_deprecated`: text error: use of deprecated method `deprecation_lint::Trait::trait_deprecated`: text
--> $DIR/deprecation-lint.rs:64:13 --> $DIR/deprecation-lint.rs:64:13
| |
LL | foo.trait_deprecated(); LL | foo.trait_deprecated();
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::Trait::trait_deprecated`: text error: use of deprecated method `deprecation_lint::Trait::trait_deprecated`: text
--> $DIR/deprecation-lint.rs:66:16 --> $DIR/deprecation-lint.rs:66:16
| |
LL | <Foo>::trait_deprecated(&foo); LL | <Foo>::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text error: use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text
--> $DIR/deprecation-lint.rs:68:13 --> $DIR/deprecation-lint.rs:68:13
| |
LL | foo.trait_deprecated_text(); LL | foo.trait_deprecated_text();
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text error: use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text
--> $DIR/deprecation-lint.rs:70:16 --> $DIR/deprecation-lint.rs:70:16
| |
LL | ... <Foo>::trait_deprecated_text(&foo); LL | <Foo>::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::Trait::trait_deprecated`: text error: use of deprecated method `deprecation_lint::Trait::trait_deprecated`: text
--> $DIR/deprecation-lint.rs:75:13 --> $DIR/deprecation-lint.rs:75:13
| |
LL | foo.trait_deprecated(); LL | foo.trait_deprecated();
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: use of deprecated associated function `deprecation_lint::Trait::trait_deprecated_text`: text error: use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text
--> $DIR/deprecation-lint.rs:76:13 --> $DIR/deprecation-lint.rs:76:13
| |
LL | foo.trait_deprecated_text(); LL | foo.trait_deprecated_text();
@ -544,61 +544,61 @@ error: use of deprecated field `deprecation_lint::Deprecated2::2`: text
LL | _) LL | _)
| ^ | ^
error: use of deprecated associated function `this_crate::MethodTester::method_deprecated`: text error: use of deprecated method `this_crate::MethodTester::method_deprecated`: text
--> $DIR/deprecation-lint.rs:246:13 --> $DIR/deprecation-lint.rs:246:13
| |
LL | foo.method_deprecated(); LL | foo.method_deprecated();
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::MethodTester::method_deprecated`: text error: use of deprecated method `this_crate::MethodTester::method_deprecated`: text
--> $DIR/deprecation-lint.rs:247:14 --> $DIR/deprecation-lint.rs:247:14
| |
LL | Foo::method_deprecated(&foo); LL | Foo::method_deprecated(&foo);
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::MethodTester::method_deprecated`: text error: use of deprecated method `this_crate::MethodTester::method_deprecated`: text
--> $DIR/deprecation-lint.rs:248:16 --> $DIR/deprecation-lint.rs:248:16
| |
LL | <Foo>::method_deprecated(&foo); LL | <Foo>::method_deprecated(&foo);
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text error: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/deprecation-lint.rs:249:13 --> $DIR/deprecation-lint.rs:249:13
| |
LL | foo.trait_deprecated(); LL | foo.trait_deprecated();
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text error: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/deprecation-lint.rs:251:16 --> $DIR/deprecation-lint.rs:251:16
| |
LL | <Foo>::trait_deprecated(&foo); LL | <Foo>::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text error: use of deprecated method `this_crate::MethodTester::method_deprecated_text`: text
--> $DIR/deprecation-lint.rs:255:13 --> $DIR/deprecation-lint.rs:255:13
| |
LL | ... foo.method_deprecated_text(); LL | foo.method_deprecated_text();
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text error: use of deprecated method `this_crate::MethodTester::method_deprecated_text`: text
--> $DIR/deprecation-lint.rs:256:14 --> $DIR/deprecation-lint.rs:256:14
| |
LL | ... Foo::method_deprecated_text(&foo); LL | Foo::method_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text error: use of deprecated method `this_crate::MethodTester::method_deprecated_text`: text
--> $DIR/deprecation-lint.rs:257:16 --> $DIR/deprecation-lint.rs:257:16
| |
LL | ... <Foo>::method_deprecated_text(&foo); LL | <Foo>::method_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text error: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/deprecation-lint.rs:258:13 --> $DIR/deprecation-lint.rs:258:13
| |
LL | foo.trait_deprecated_text(); LL | foo.trait_deprecated_text();
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text error: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/deprecation-lint.rs:260:16 --> $DIR/deprecation-lint.rs:260:16
| |
LL | <Foo>::trait_deprecated_text(&foo); LL | <Foo>::trait_deprecated_text(&foo);
@ -616,37 +616,37 @@ error: use of deprecated field `this_crate::nested::DeprecatedStruct::i`: text
LL | i: 0 LL | i: 0
| ^^^^ | ^^^^
error: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text error: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/deprecation-lint.rs:292:13 --> $DIR/deprecation-lint.rs:292:13
| |
LL | foo.trait_deprecated(); LL | foo.trait_deprecated();
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text error: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/deprecation-lint.rs:294:16 --> $DIR/deprecation-lint.rs:294:16
| |
LL | <Foo>::trait_deprecated(&foo); LL | <Foo>::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text error: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/deprecation-lint.rs:296:13 --> $DIR/deprecation-lint.rs:296:13
| |
LL | foo.trait_deprecated_text(); LL | foo.trait_deprecated_text();
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text error: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/deprecation-lint.rs:298:16 --> $DIR/deprecation-lint.rs:298:16
| |
LL | <Foo>::trait_deprecated_text(&foo); LL | <Foo>::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text error: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/deprecation-lint.rs:303:13 --> $DIR/deprecation-lint.rs:303:13
| |
LL | foo.trait_deprecated(); LL | foo.trait_deprecated();
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
error: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text error: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/deprecation-lint.rs:304:13 --> $DIR/deprecation-lint.rs:304:13
| |
LL | foo.trait_deprecated_text(); LL | foo.trait_deprecated_text();

View file

@ -3,7 +3,7 @@
#![deny(deprecated)] #![deny(deprecated)]
fn main() { fn main() {
let _foo = str::trim_start(" aoeu"); //~ ERROR use of deprecated associated function `core::str::<impl str>::trim_left`: superseded by `trim_start` [deprecated] let _foo = str::trim_start(" aoeu"); //~ ERROR use of deprecated method `core::str::<impl str>::trim_left`: superseded by `trim_start` [deprecated]
let _bar = " aoeu".trim_start(); //~ ERROR use of deprecated associated function `core::str::<impl str>::trim_left`: superseded by `trim_start` [deprecated] let _bar = " aoeu".trim_start(); //~ ERROR use of deprecated method `core::str::<impl str>::trim_left`: superseded by `trim_start` [deprecated]
} }

View file

@ -3,7 +3,7 @@
#![deny(deprecated)] #![deny(deprecated)]
fn main() { fn main() {
let _foo = str::trim_left(" aoeu"); //~ ERROR use of deprecated associated function `core::str::<impl str>::trim_left`: superseded by `trim_start` [deprecated] let _foo = str::trim_left(" aoeu"); //~ ERROR use of deprecated method `core::str::<impl str>::trim_left`: superseded by `trim_start` [deprecated]
let _bar = " aoeu".trim_left(); //~ ERROR use of deprecated associated function `core::str::<impl str>::trim_left`: superseded by `trim_start` [deprecated] let _bar = " aoeu".trim_left(); //~ ERROR use of deprecated method `core::str::<impl str>::trim_left`: superseded by `trim_start` [deprecated]
} }

View file

@ -1,4 +1,4 @@
error: use of deprecated associated function `core::str::<impl str>::trim_left`: superseded by `trim_start` error: use of deprecated method `core::str::<impl str>::trim_left`: superseded by `trim_start`
--> $DIR/issue-84637-deprecated-associated-function.rs:6:21 --> $DIR/issue-84637-deprecated-associated-function.rs:6:21
| |
LL | let _foo = str::trim_left(" aoeu"); LL | let _foo = str::trim_left(" aoeu");
@ -9,18 +9,18 @@ note: the lint level is defined here
| |
LL | #![deny(deprecated)] LL | #![deny(deprecated)]
| ^^^^^^^^^^ | ^^^^^^^^^^
help: replace the use of the deprecated associated function help: replace the use of the deprecated method
| |
LL | let _foo = str::trim_start(" aoeu"); LL | let _foo = str::trim_start(" aoeu");
| ~~~~~~~~~~ | ~~~~~~~~~~
error: use of deprecated associated function `core::str::<impl str>::trim_left`: superseded by `trim_start` error: use of deprecated method `core::str::<impl str>::trim_left`: superseded by `trim_start`
--> $DIR/issue-84637-deprecated-associated-function.rs:8:26 --> $DIR/issue-84637-deprecated-associated-function.rs:8:26
| |
LL | let _bar = " aoeu".trim_left(); LL | let _bar = " aoeu".trim_left();
| ^^^^^^^^^ | ^^^^^^^^^
| |
help: replace the use of the deprecated associated function help: replace the use of the deprecated method
| |
LL | let _bar = " aoeu".trim_start(); LL | let _bar = " aoeu".trim_start();
| ~~~~~~~~~~ | ~~~~~~~~~~

View file

@ -14,13 +14,13 @@ help: replace the use of the deprecated function
LL | bar::replacement(); LL | bar::replacement();
| ~~~~~~~~~~~ | ~~~~~~~~~~~
error: use of deprecated associated function `Foo::deprecated`: replaced by `replacement` error: use of deprecated method `Foo::deprecated`: replaced by `replacement`
--> $DIR/suggestion.rs:40:9 --> $DIR/suggestion.rs:40:9
| |
LL | foo.deprecated(); LL | foo.deprecated();
| ^^^^^^^^^^ | ^^^^^^^^^^
| |
help: replace the use of the deprecated associated function help: replace the use of the deprecated method
| |
LL | foo.replacement(); LL | foo.replacement();
| ~~~~~~~~~~~ | ~~~~~~~~~~~

View file

@ -8,5 +8,5 @@ mod inner {
fn main() { fn main() {
let foo = inner::Foo; let foo = inner::Foo;
foo.method(); //~ ERROR associated function `method` is private [E0624] foo.method(); //~ ERROR method `method` is private [E0624]
} }

View file

@ -1,11 +1,11 @@
error[E0624]: associated function `method` is private error[E0624]: method `method` is private
--> $DIR/E0624.rs:11:9 --> $DIR/E0624.rs:11:9
| |
LL | fn method(&self) {} LL | fn method(&self) {}
| ---------------- private associated function defined here | ---------------- private method defined here
... ...
LL | foo.method(); LL | foo.method();
| ^^^^^^ private associated function | ^^^^^^ private method
error: aborting due to previous error error: aborting due to previous error

View file

@ -79,38 +79,38 @@ LL | r.unstable_undeclared();
= note: see issue #38412 <https://github.com/rust-lang/rust/issues/38412> for more information = note: see issue #38412 <https://github.com/rust-lang/rust/issues/38412> for more information
= help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable = help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable
error[E0624]: associated function `pub_crate` is private error[E0624]: method `pub_crate` is private
--> $DIR/explore-issue-38412.rs:48:7 --> $DIR/explore-issue-38412.rs:48:7
| |
LL | r.pub_crate(); LL | r.pub_crate();
| ^^^^^^^^^ private associated function | ^^^^^^^^^ private method
| |
::: $DIR/auxiliary/pub-and-stability.rs:114:9 ::: $DIR/auxiliary/pub-and-stability.rs:114:9
| |
LL | pub(crate) fn pub_crate(&self) -> i32 { self.d_priv } LL | pub(crate) fn pub_crate(&self) -> i32 { self.d_priv }
| ------------------------------------- private associated function defined here | ------------------------------------- private method defined here
error[E0624]: associated function `pub_mod` is private error[E0624]: method `pub_mod` is private
--> $DIR/explore-issue-38412.rs:49:7 --> $DIR/explore-issue-38412.rs:49:7
| |
LL | r.pub_mod(); LL | r.pub_mod();
| ^^^^^^^ private associated function | ^^^^^^^ private method
| |
::: $DIR/auxiliary/pub-and-stability.rs:116:9 ::: $DIR/auxiliary/pub-and-stability.rs:116:9
| |
LL | pub(in m) fn pub_mod(&self) -> i32 { self.d_priv } LL | pub(in m) fn pub_mod(&self) -> i32 { self.d_priv }
| ---------------------------------- private associated function defined here | ---------------------------------- private method defined here
error[E0624]: associated function `private` is private error[E0624]: method `private` is private
--> $DIR/explore-issue-38412.rs:50:7 --> $DIR/explore-issue-38412.rs:50:7
| |
LL | r.private(); LL | r.private();
| ^^^^^^^ private associated function | ^^^^^^^ private method
| |
::: $DIR/auxiliary/pub-and-stability.rs:118:9 ::: $DIR/auxiliary/pub-and-stability.rs:118:9
| |
LL | fn private(&self) -> i32 { self.d_priv } LL | fn private(&self) -> i32 { self.d_priv }
| ------------------------ private associated function defined here | ------------------------ private method defined here
error[E0658]: use of unstable library feature 'unstable_undeclared' error[E0658]: use of unstable library feature 'unstable_undeclared'
--> $DIR/explore-issue-38412.rs:55:7 --> $DIR/explore-issue-38412.rs:55:7
@ -130,38 +130,38 @@ LL | t.unstable_undeclared();
= note: see issue #38412 <https://github.com/rust-lang/rust/issues/38412> for more information = note: see issue #38412 <https://github.com/rust-lang/rust/issues/38412> for more information
= help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable = help: add `#![feature(unstable_undeclared)]` to the crate attributes to enable
error[E0624]: associated function `pub_crate` is private error[E0624]: method `pub_crate` is private
--> $DIR/explore-issue-38412.rs:61:7 --> $DIR/explore-issue-38412.rs:61:7
| |
LL | t.pub_crate(); LL | t.pub_crate();
| ^^^^^^^^^ private associated function | ^^^^^^^^^ private method
| |
::: $DIR/auxiliary/pub-and-stability.rs:129:9 ::: $DIR/auxiliary/pub-and-stability.rs:129:9
| |
LL | pub(crate) fn pub_crate(&self) -> i32 { self.0 } LL | pub(crate) fn pub_crate(&self) -> i32 { self.0 }
| ------------------------------------- private associated function defined here | ------------------------------------- private method defined here
error[E0624]: associated function `pub_mod` is private error[E0624]: method `pub_mod` is private
--> $DIR/explore-issue-38412.rs:62:7 --> $DIR/explore-issue-38412.rs:62:7
| |
LL | t.pub_mod(); LL | t.pub_mod();
| ^^^^^^^ private associated function | ^^^^^^^ private method
| |
::: $DIR/auxiliary/pub-and-stability.rs:130:9 ::: $DIR/auxiliary/pub-and-stability.rs:130:9
| |
LL | pub(in m) fn pub_mod(&self) -> i32 { self.0 } LL | pub(in m) fn pub_mod(&self) -> i32 { self.0 }
| ---------------------------------- private associated function defined here | ---------------------------------- private method defined here
error[E0624]: associated function `private` is private error[E0624]: method `private` is private
--> $DIR/explore-issue-38412.rs:63:7 --> $DIR/explore-issue-38412.rs:63:7
| |
LL | t.private(); LL | t.private();
| ^^^^^^^ private associated function | ^^^^^^^ private method
| |
::: $DIR/auxiliary/pub-and-stability.rs:131:9 ::: $DIR/auxiliary/pub-and-stability.rs:131:9
| |
LL | fn private(&self) -> i32 { self.0 } LL | fn private(&self) -> i32 { self.0 }
| ------------------------ private associated function defined here | ------------------------ private method defined here
error: aborting due to 19 previous errors error: aborting due to 19 previous errors

View file

@ -7,7 +7,7 @@ LL | |
LL | | }); LL | | });
| |______- an argument is missing | |______- an argument is missing
| |
note: associated function defined here note: method defined here
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL --> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
help: provide the argument help: provide the argument
| |

View file

@ -4,7 +4,7 @@ error[E0061]: this method takes 1 argument but 0 arguments were supplied
LL | Pin::new(&mut b).resume(); LL | Pin::new(&mut b).resume();
| ^^^^^^-- an argument of type `()` is missing | ^^^^^^-- an argument of type `()` is missing
| |
note: associated function defined here note: method defined here
--> $SRC_DIR/core/src/ops/generator.rs:LL:COL --> $SRC_DIR/core/src/ops/generator.rs:LL:COL
help: provide the argument help: provide the argument
| |

View file

@ -14,16 +14,16 @@ use inference_unstable_itertools::IpuItertools;
fn main() { fn main() {
assert_eq!('x'.ipu_flatten(), 1); assert_eq!('x'.ipu_flatten(), 1);
//~^ WARN an associated function with this name may be added to the standard library in the future //~^ WARN a method with this name may be added to the standard library in the future
//~| WARN once this associated item is added to the standard library, the ambiguity may cause an //~| WARN once this associated item is added to the standard library, the ambiguity may cause an
assert_eq!('x'.ipu_by_value_vs_by_ref(), 1); assert_eq!('x'.ipu_by_value_vs_by_ref(), 1);
//~^ WARN an associated function with this name may be added to the standard library in the future //~^ WARN a method with this name may be added to the standard library in the future
//~| WARN once this associated item is added to the standard library, the ambiguity may cause an //~| WARN once this associated item is added to the standard library, the ambiguity may cause an
assert_eq!('x'.ipu_by_ref_vs_by_ref_mut(), 1); assert_eq!('x'.ipu_by_ref_vs_by_ref_mut(), 1);
//~^ WARN an associated function with this name may be added to the standard library in the future //~^ WARN a method with this name may be added to the standard library in the future
//~| WARN once this associated item is added to the standard library, the ambiguity may cause an //~| WARN once this associated item is added to the standard library, the ambiguity may cause an
assert_eq!((&mut 'x' as *mut char).ipu_by_mut_ptr_vs_by_const_ptr(), 1); assert_eq!((&mut 'x' as *mut char).ipu_by_mut_ptr_vs_by_const_ptr(), 1);
//~^ WARN an associated function with this name may be added to the standard library in the future //~^ WARN a method with this name may be added to the standard library in the future
//~| WARN once this associated item is added to the standard library, the ambiguity may cause an //~| WARN once this associated item is added to the standard library, the ambiguity may cause an
assert_eq!(char::C, 1); assert_eq!(char::C, 1);
//~^ WARN an associated constant with this name may be added to the standard library in the future //~^ WARN an associated constant with this name may be added to the standard library in the future

View file

@ -1,4 +1,4 @@
warning: an associated function with this name may be added to the standard library in the future warning: a method with this name may be added to the standard library in the future
--> $DIR/inference_unstable.rs:16:20 --> $DIR/inference_unstable.rs:16:20
| |
LL | assert_eq!('x'.ipu_flatten(), 1); LL | assert_eq!('x'.ipu_flatten(), 1);
@ -10,7 +10,7 @@ LL | assert_eq!('x'.ipu_flatten(), 1);
= help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_flatten` = help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_flatten`
= note: `#[warn(unstable_name_collisions)]` on by default = note: `#[warn(unstable_name_collisions)]` on by default
warning: an associated function with this name may be added to the standard library in the future warning: a method with this name may be added to the standard library in the future
--> $DIR/inference_unstable.rs:19:20 --> $DIR/inference_unstable.rs:19:20
| |
LL | assert_eq!('x'.ipu_by_value_vs_by_ref(), 1); LL | assert_eq!('x'.ipu_by_value_vs_by_ref(), 1);
@ -21,7 +21,7 @@ LL | assert_eq!('x'.ipu_by_value_vs_by_ref(), 1);
= help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_by_value_vs_by_ref(...)` to keep using the current method = help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_by_value_vs_by_ref(...)` to keep using the current method
= help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_by_value_vs_by_ref` = help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_by_value_vs_by_ref`
warning: an associated function with this name may be added to the standard library in the future warning: a method with this name may be added to the standard library in the future
--> $DIR/inference_unstable.rs:22:20 --> $DIR/inference_unstable.rs:22:20
| |
LL | assert_eq!('x'.ipu_by_ref_vs_by_ref_mut(), 1); LL | assert_eq!('x'.ipu_by_ref_vs_by_ref_mut(), 1);
@ -32,7 +32,7 @@ LL | assert_eq!('x'.ipu_by_ref_vs_by_ref_mut(), 1);
= help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_by_ref_vs_by_ref_mut(...)` to keep using the current method = help: call with fully qualified syntax `inference_unstable_itertools::IpuItertools::ipu_by_ref_vs_by_ref_mut(...)` to keep using the current method
= help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_by_ref_vs_by_ref_mut` = help: add `#![feature(ipu_flatten)]` to the crate attributes to enable `inference_unstable_iterator::IpuIterator::ipu_by_ref_vs_by_ref_mut`
warning: an associated function with this name may be added to the standard library in the future warning: a method with this name may be added to the standard library in the future
--> $DIR/inference_unstable.rs:25:40 --> $DIR/inference_unstable.rs:25:40
| |
LL | assert_eq!((&mut 'x' as *mut char).ipu_by_mut_ptr_vs_by_const_ptr(), 1); LL | assert_eq!((&mut 'x' as *mut char).ipu_by_mut_ptr_vs_by_const_ptr(), 1);

View file

@ -6,11 +6,11 @@ LL | assert_eq!('x'.ipu_flatten(), 0);
| |
= note: candidate #1 is defined in an impl of the trait `IpuIterator` for the type `char` = note: candidate #1 is defined in an impl of the trait `IpuIterator` for the type `char`
= note: candidate #2 is defined in an impl of the trait `IpuItertools` for the type `char` = note: candidate #2 is defined in an impl of the trait `IpuItertools` for the type `char`
help: disambiguate the associated function for candidate #1 help: disambiguate the method for candidate #1
| |
LL | assert_eq!(IpuIterator::ipu_flatten(&'x'), 0); LL | assert_eq!(IpuIterator::ipu_flatten(&'x'), 0);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2 help: disambiguate the method for candidate #2
| |
LL | assert_eq!(IpuItertools::ipu_flatten(&'x'), 0); LL | assert_eq!(IpuItertools::ipu_flatten(&'x'), 0);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -4,7 +4,7 @@ error[E0283]: type annotations needed
LL | .get(&"key".into()) LL | .get(&"key".into())
| ^^^ ------------- type must be known at this point | ^^^ ------------- type must be known at this point
| | | |
| cannot infer type of the type parameter `Q` declared on the associated function `get` | cannot infer type of the type parameter `Q` declared on the method `get`
| |
= note: multiple `impl`s satisfying `String: Borrow<_>` found in the following crates: `alloc`, `core`: = note: multiple `impl`s satisfying `String: Borrow<_>` found in the following crates: `alloc`, `core`:
- impl Borrow<str> for String; - impl Borrow<str> for String;

View file

@ -2,7 +2,7 @@ error[E0282]: type annotations needed
--> $DIR/question-mark-type-infer.rs:10:21 --> $DIR/question-mark-type-infer.rs:10:21
| |
LL | l.iter().map(f).collect()? LL | l.iter().map(f).collect()?
| ^^^^^^^ cannot infer type of the type parameter `B` declared on the associated function `collect` | ^^^^^^^ cannot infer type of the type parameter `B` declared on the method `collect`
| |
help: consider specifying the generic argument help: consider specifying the generic argument
| |

View file

@ -10,7 +10,7 @@ LL | c.read_to(v);
| |
= note: expected mutable reference `&mut [u8]` = note: expected mutable reference `&mut [u8]`
found struct `Vec<_>` found struct `Vec<_>`
note: associated function defined here note: method defined here
--> $DIR/issue-11374.rs:13:12 --> $DIR/issue-11374.rs:13:12
| |
LL | pub fn read_to(&mut self, vec: &mut [u8]) { LL | pub fn read_to(&mut self, vec: &mut [u8]) {

View file

@ -1,4 +1,4 @@
error: use of deprecated associated function `Foo::foo`: text error: use of deprecated method `Foo::foo`: text
--> $DIR/issue-17337.rs:16:6 --> $DIR/issue-17337.rs:16:6
| |
LL | .foo(); LL | .foo();

View file

@ -14,7 +14,7 @@ note: candidate #2 is defined in the trait `T`
| |
LL | fn foo(&self); LL | fn foo(&self);
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #2 help: disambiguate the method for candidate #2
| |
LL | T::foo(&x); LL | T::foo(&x);
| ~~~~~~~~~~ | ~~~~~~~~~~

View file

@ -8,7 +8,7 @@ mod B {
use crate1::A::Foo; use crate1::A::Foo;
fn bar(f: Foo) { fn bar(f: Foo) {
Foo::foo(&f); Foo::foo(&f);
//~^ ERROR: associated function `foo` is private //~^ ERROR: method `foo` is private
} }
} }

View file

@ -1,13 +1,13 @@
error[E0624]: associated function `foo` is private error[E0624]: method `foo` is private
--> $DIR/issue-21202.rs:10:14 --> $DIR/issue-21202.rs:10:14
| |
LL | Foo::foo(&f); LL | Foo::foo(&f);
| ^^^ private associated function | ^^^ private method
| |
::: $DIR/auxiliary/issue-21202.rs:4:9 ::: $DIR/auxiliary/issue-21202.rs:4:9
| |
LL | fn foo(&self) { } LL | fn foo(&self) { }
| ------------- private associated function defined here | ------------- private method defined here
error: aborting due to previous error error: aborting due to previous error

View file

@ -2,7 +2,7 @@ error[E0282]: type annotations needed
--> $DIR/issue-23041.rs:6:7 --> $DIR/issue-23041.rs:6:7
| |
LL | b.downcast_ref::<fn(_)->_>(); LL | b.downcast_ref::<fn(_)->_>();
| ^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the associated function `downcast_ref` | ^^^^^^^^^^^^ cannot infer type of the type parameter `T` declared on the method `downcast_ref`
| |
help: consider specifying the generic argument help: consider specifying the generic argument
| |

View file

@ -14,11 +14,11 @@ note: candidate #2 is defined in an impl of the trait `Add` for the type `isize`
| |
LL | fn to_int(&self) -> isize { *self } LL | fn to_int(&self) -> isize { *self }
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #1 help: disambiguate the method for candidate #1
| |
LL | ToPrimitive::to_int(&self) + other.to_int() LL | ToPrimitive::to_int(&self) + other.to_int()
| ~~~~~~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2 help: disambiguate the method for candidate #2
| |
LL | Add::to_int(&self) + other.to_int() LL | Add::to_int(&self) + other.to_int()
| ~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~

View file

@ -20,9 +20,9 @@ fn main() {
let _woohoo = (Box::new(my_struct)).priv_field; let _woohoo = (Box::new(my_struct)).priv_field;
//~^ ERROR field `priv_field` of struct `MyStruct` is private //~^ ERROR field `priv_field` of struct `MyStruct` is private
(&my_struct).happyfun(); //~ ERROR associated function `happyfun` is private (&my_struct).happyfun(); //~ ERROR method `happyfun` is private
(Box::new(my_struct)).happyfun(); //~ ERROR associated function `happyfun` is private (Box::new(my_struct)).happyfun(); //~ ERROR method `happyfun` is private
let nope = my_struct.priv_field; let nope = my_struct.priv_field;
//~^ ERROR field `priv_field` of struct `MyStruct` is private //~^ ERROR field `priv_field` of struct `MyStruct` is private
} }

View file

@ -10,23 +10,23 @@ error[E0616]: field `priv_field` of struct `MyStruct` is private
LL | let _woohoo = (Box::new(my_struct)).priv_field; LL | let _woohoo = (Box::new(my_struct)).priv_field;
| ^^^^^^^^^^ private field | ^^^^^^^^^^ private field
error[E0624]: associated function `happyfun` is private error[E0624]: method `happyfun` is private
--> $DIR/issue-3763.rs:23:18 --> $DIR/issue-3763.rs:23:18
| |
LL | fn happyfun(&self) {} LL | fn happyfun(&self) {}
| ------------------ private associated function defined here | ------------------ private method defined here
... ...
LL | (&my_struct).happyfun(); LL | (&my_struct).happyfun();
| ^^^^^^^^ private associated function | ^^^^^^^^ private method
error[E0624]: associated function `happyfun` is private error[E0624]: method `happyfun` is private
--> $DIR/issue-3763.rs:25:27 --> $DIR/issue-3763.rs:25:27
| |
LL | fn happyfun(&self) {} LL | fn happyfun(&self) {}
| ------------------ private associated function defined here | ------------------ private method defined here
... ...
LL | (Box::new(my_struct)).happyfun(); LL | (Box::new(my_struct)).happyfun();
| ^^^^^^^^ private associated function | ^^^^^^^^ private method
error[E0616]: field `priv_field` of struct `MyStruct` is private error[E0616]: field `priv_field` of struct `MyStruct` is private
--> $DIR/issue-3763.rs:26:26 --> $DIR/issue-3763.rs:26:26

View file

@ -8,7 +8,7 @@ LL | b"".starts_with(stringify!(foo))
| |
= note: expected reference `&[u8]` = note: expected reference `&[u8]`
found reference `&'static str` found reference `&'static str`
note: associated function defined here note: method defined here
--> $SRC_DIR/core/src/slice/mod.rs:LL:COL --> $SRC_DIR/core/src/slice/mod.rs:LL:COL
= note: this error originates in the macro `stringify` (in Nightly builds, run with -Z macro-backtrace for more info) = note: this error originates in the macro `stringify` (in Nightly builds, run with -Z macro-backtrace for more info)

View file

@ -9,7 +9,7 @@ impl Borked {
fn run_wild<T>(b: &Borked) { fn run_wild<T>(b: &Borked) {
b.a::<'_, T>(); b.a::<'_, T>();
//~^ ERROR cannot specify lifetime arguments explicitly if late bound lifetime parameters are present //~^ ERROR cannot specify lifetime arguments explicitly if late bound lifetime parameters are present
//~| ERROR this associated function takes 0 generic arguments but 1 generic argument //~| ERROR this method takes 0 generic arguments but 1 generic argument
//~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! //~| WARN this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
} }

View file

@ -16,7 +16,7 @@ LL | #![deny(warnings)]
| ^^^^^^^^ | ^^^^^^^^
= note: `#[deny(late_bound_lifetime_arguments)]` implied by `#[deny(warnings)]` = note: `#[deny(late_bound_lifetime_arguments)]` implied by `#[deny(warnings)]`
error[E0107]: this associated function takes 0 generic arguments but 1 generic argument was supplied error[E0107]: this method takes 0 generic arguments but 1 generic argument was supplied
--> $DIR/issue-60622.rs:10:7 --> $DIR/issue-60622.rs:10:7
| |
LL | b.a::<'_, T>(); LL | b.a::<'_, T>();
@ -24,7 +24,7 @@ LL | b.a::<'_, T>();
| | | |
| expected 0 generic arguments | expected 0 generic arguments
| |
note: associated function defined here, with 0 generic parameters note: method defined here, with 0 generic parameters
--> $DIR/issue-60622.rs:6:8 --> $DIR/issue-60622.rs:6:8
| |
LL | fn a(&self) {} LL | fn a(&self) {}

View file

@ -14,11 +14,11 @@ note: candidate #2 is defined in an impl of the trait `await` for the type `r#fn
| |
LL | fn r#struct(&self) { LL | fn r#struct(&self) {
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #1 help: disambiguate the method for candidate #1
| |
LL | async::r#struct(&r#fn {}); LL | async::r#struct(&r#fn {});
| ~~~~~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2 help: disambiguate the method for candidate #2
| |
LL | await::r#struct(&r#fn {}); LL | await::r#struct(&r#fn {});
| ~~~~~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -14,11 +14,11 @@ note: candidate #2 is defined in an impl of the trait `r#await` for the type `r#
| |
LL | fn r#struct(&self) { LL | fn r#struct(&self) {
| ^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #1 help: disambiguate the method for candidate #1
| |
LL | r#async::r#struct(&r#fn {}); LL | r#async::r#struct(&r#fn {});
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2 help: disambiguate the method for candidate #2
| |
LL | r#await::r#struct(&r#fn {}); LL | r#await::r#struct(&r#fn {});
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~~~~~~~~~

View file

@ -2,7 +2,7 @@ error[E0284]: type annotations needed
--> $DIR/issue-69455.rs:29:41 --> $DIR/issue-69455.rs:29:41
| |
LL | println!("{}", 23u64.test(xs.iter().sum())); LL | println!("{}", 23u64.test(xs.iter().sum()));
| ---- ^^^ cannot infer type of the type parameter `S` declared on the associated function `sum` | ---- ^^^ cannot infer type of the type parameter `S` declared on the method `sum`
| | | |
| type must be known at this point | type must be known at this point
| |
@ -16,7 +16,7 @@ error[E0283]: type annotations needed
--> $DIR/issue-69455.rs:29:41 --> $DIR/issue-69455.rs:29:41
| |
LL | println!("{}", 23u64.test(xs.iter().sum())); LL | println!("{}", 23u64.test(xs.iter().sum()));
| ---- ^^^ cannot infer type of the type parameter `S` declared on the associated function `sum` | ---- ^^^ cannot infer type of the type parameter `S` declared on the method `sum`
| | | |
| required by a bound introduced by this call | required by a bound introduced by this call
| |

View file

@ -7,7 +7,7 @@ LL | fn foo<'a>(&self, x: &'a i32) -> &i32 {
| lifetime `'a` defined here | lifetime `'a` defined here
LL | LL |
LL | x LL | x
| ^ associated function was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a` | ^ method was supposed to return data with lifetime `'1` but it is returning data with lifetime `'a`
error: aborting due to previous error error: aborting due to previous error

View file

@ -7,7 +7,7 @@ LL | fn foo<'a>(&self, x: &'a Foo) -> &'a Foo {
| lifetime `'a` defined here | lifetime `'a` defined here
LL | LL |
LL | if true { x } else { self } LL | if true { x } else { self }
| ^^^^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1` | ^^^^ method was supposed to return data with lifetime `'a` but it is returning data with lifetime `'1`
error: aborting due to previous error error: aborting due to previous error

View file

@ -6,7 +6,7 @@ LL | fn foo<'a>(&self, x: &i32) -> &i32 {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | x LL | x
| ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
| |
help: consider introducing a named lifetime parameter and update trait if needed help: consider introducing a named lifetime parameter and update trait if needed
| |

View file

@ -6,7 +6,7 @@ LL | fn foo<'a>(&self, x: &Foo) -> &Foo {
| | | |
| let's call the lifetime of this reference `'2` | let's call the lifetime of this reference `'2`
LL | if true { x } else { self } LL | if true { x } else { self }
| ^ associated function was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1` | ^ method was supposed to return data with lifetime `'2` but it is returning data with lifetime `'1`
| |
help: consider introducing a named lifetime parameter and update trait if needed help: consider introducing a named lifetime parameter and update trait if needed
| |

View file

@ -11,8 +11,8 @@ struct Foo {
struct Bar; struct Bar;
impl Bar { impl Bar {
fn a(&self) -> i32 { 5 } //~ WARNING: associated function `a` is never used fn a(&self) -> i32 { 5 } //~ WARNING: method `a` is never used
pub fn b(&self) -> i32 { 6 } //~ WARNING: associated function `b` is never used pub fn b(&self) -> i32 { 6 } //~ WARNING: method `b` is never used
} }
pub(crate) struct Foo1 { pub(crate) struct Foo1 {
@ -23,8 +23,8 @@ pub(crate) struct Foo1 {
pub(crate) struct Bar1; pub(crate) struct Bar1;
impl Bar1 { impl Bar1 {
fn a(&self) -> i32 { 5 } //~ WARNING: associated function `a` is never used fn a(&self) -> i32 { 5 } //~ WARNING: method `a` is never used
pub fn b(&self) -> i32 { 6 } //~ WARNING: associated function `b` is never used pub fn b(&self) -> i32 { 6 } //~ WARNING: method `b` is never used
} }
pub(crate) struct Foo2 { pub(crate) struct Foo2 {
@ -35,8 +35,8 @@ pub(crate) struct Foo2 {
pub(crate) struct Bar2; pub(crate) struct Bar2;
impl Bar2 { impl Bar2 {
fn a(&self) -> i32 { 5 } //~ WARNING: associated function `a` is never used fn a(&self) -> i32 { 5 } //~ WARNING: method `a` is never used
pub fn b(&self) -> i32 { 6 } //~ WARNING: associated function `b` is never used pub fn b(&self) -> i32 { 6 } //~ WARNING: method `b` is never used
} }

View file

@ -34,37 +34,37 @@ LL | a: i32,
LL | pub b: i32, LL | pub b: i32,
| ^ | ^
warning: associated function `a` is never used warning: method `a` is never used
--> $DIR/issue-85255.rs:14:8 --> $DIR/issue-85255.rs:14:8
| |
LL | fn a(&self) -> i32 { 5 } LL | fn a(&self) -> i32 { 5 }
| ^ | ^
warning: associated function `b` is never used warning: method `b` is never used
--> $DIR/issue-85255.rs:15:12 --> $DIR/issue-85255.rs:15:12
| |
LL | pub fn b(&self) -> i32 { 6 } LL | pub fn b(&self) -> i32 { 6 }
| ^ | ^
warning: associated function `a` is never used warning: method `a` is never used
--> $DIR/issue-85255.rs:26:8 --> $DIR/issue-85255.rs:26:8
| |
LL | fn a(&self) -> i32 { 5 } LL | fn a(&self) -> i32 { 5 }
| ^ | ^
warning: associated function `b` is never used warning: method `b` is never used
--> $DIR/issue-85255.rs:27:12 --> $DIR/issue-85255.rs:27:12
| |
LL | pub fn b(&self) -> i32 { 6 } LL | pub fn b(&self) -> i32 { 6 }
| ^ | ^
warning: associated function `a` is never used warning: method `a` is never used
--> $DIR/issue-85255.rs:38:8 --> $DIR/issue-85255.rs:38:8
| |
LL | fn a(&self) -> i32 { 5 } LL | fn a(&self) -> i32 { 5 }
| ^ | ^
warning: associated function `b` is never used warning: method `b` is never used
--> $DIR/issue-85255.rs:39:12 --> $DIR/issue-85255.rs:39:12
| |
LL | pub fn b(&self) -> i32 { 6 } LL | pub fn b(&self) -> i32 { 6 }

View file

@ -13,7 +13,7 @@ extern "C" {
struct Foo; //~ ERROR: struct `Foo` is never constructed struct Foo; //~ ERROR: struct `Foo` is never constructed
impl Foo { impl Foo {
fn foo(&self) { //~ ERROR: associated function `foo` is never used fn foo(&self) { //~ ERROR: method `foo` is never used
bar() bar()
} }
} }

View file

@ -34,7 +34,7 @@ error: function `blah` is never used
LL | fn blah() {} LL | fn blah() {}
| ^^^^ | ^^^^
error: associated function `foo` is never used error: method `foo` is never used
--> $DIR/lint-dead-code-3.rs:16:8 --> $DIR/lint-dead-code-3.rs:16:8
| |
LL | fn foo(&self) { LL | fn foo(&self) {

View file

@ -50,8 +50,10 @@ trait B {
} }
pub trait C { //~ ERROR: missing documentation for a trait pub trait C { //~ ERROR: missing documentation for a trait
fn foo(&self); //~ ERROR: missing documentation for an associated function fn foo(&self); //~ ERROR: missing documentation for a method
fn foo_with_impl(&self) {} //~ ERROR: missing documentation for an associated function fn foo_with_impl(&self) {} //~ ERROR: missing documentation for a method
fn foo_no_self(); //~ ERROR: missing documentation for an associated function
fn foo_no_self_with_impl() {} //~ ERROR: missing documentation for an associated function
} }
#[allow(missing_docs)] #[allow(missing_docs)]

View file

@ -40,101 +40,113 @@ error: missing documentation for a trait
LL | pub trait C { LL | pub trait C {
| ^^^^^^^^^^^ | ^^^^^^^^^^^
error: missing documentation for an associated function error: missing documentation for a method
--> $DIR/lint-missing-doc.rs:53:5 --> $DIR/lint-missing-doc.rs:53:5
| |
LL | fn foo(&self); LL | fn foo(&self);
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
error: missing documentation for an associated function error: missing documentation for a method
--> $DIR/lint-missing-doc.rs:54:5 --> $DIR/lint-missing-doc.rs:54:5
| |
LL | fn foo_with_impl(&self) {} LL | fn foo_with_impl(&self) {}
| ^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^
error: missing documentation for an associated function
--> $DIR/lint-missing-doc.rs:55:5
|
LL | fn foo_no_self();
| ^^^^^^^^^^^^^^^^^
error: missing documentation for an associated function
--> $DIR/lint-missing-doc.rs:56:5
|
LL | fn foo_no_self_with_impl() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: missing documentation for an associated type error: missing documentation for an associated type
--> $DIR/lint-missing-doc.rs:64:5 --> $DIR/lint-missing-doc.rs:66:5
| |
LL | type AssociatedType; LL | type AssociatedType;
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: missing documentation for an associated type error: missing documentation for an associated type
--> $DIR/lint-missing-doc.rs:65:5 --> $DIR/lint-missing-doc.rs:67:5
| |
LL | type AssociatedTypeDef = Self; LL | type AssociatedTypeDef = Self;
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error: missing documentation for an associated function error: missing documentation for an associated function
--> $DIR/lint-missing-doc.rs:81:5 --> $DIR/lint-missing-doc.rs:83:5
| |
LL | pub fn foo() {} LL | pub fn foo() {}
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
error: missing documentation for an enum error: missing documentation for an enum
--> $DIR/lint-missing-doc.rs:118:1 --> $DIR/lint-missing-doc.rs:120:1
| |
LL | pub enum PubBaz { LL | pub enum PubBaz {
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
error: missing documentation for a variant error: missing documentation for a variant
--> $DIR/lint-missing-doc.rs:119:5 --> $DIR/lint-missing-doc.rs:121:5
| |
LL | PubBazA { LL | PubBazA {
| ^^^^^^^ | ^^^^^^^
error: missing documentation for a struct field error: missing documentation for a struct field
--> $DIR/lint-missing-doc.rs:120:9 --> $DIR/lint-missing-doc.rs:122:9
| |
LL | a: isize, LL | a: isize,
| ^^^^^^^^ | ^^^^^^^^
error: missing documentation for a constant error: missing documentation for a constant
--> $DIR/lint-missing-doc.rs:151:1 --> $DIR/lint-missing-doc.rs:153:1
| |
LL | pub const FOO4: u32 = 0; LL | pub const FOO4: u32 = 0;
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
error: missing documentation for a static error: missing documentation for a static
--> $DIR/lint-missing-doc.rs:161:1 --> $DIR/lint-missing-doc.rs:163:1
| |
LL | pub static BAR4: u32 = 0; LL | pub static BAR4: u32 = 0;
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
error: missing documentation for a function error: missing documentation for a function
--> $DIR/lint-missing-doc.rs:167:5 --> $DIR/lint-missing-doc.rs:169:5
| |
LL | pub fn undocumented1() {} LL | pub fn undocumented1() {}
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error: missing documentation for a function error: missing documentation for a function
--> $DIR/lint-missing-doc.rs:168:5 --> $DIR/lint-missing-doc.rs:170:5
| |
LL | pub fn undocumented2() {} LL | pub fn undocumented2() {}
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
error: missing documentation for a function error: missing documentation for a function
--> $DIR/lint-missing-doc.rs:174:9 --> $DIR/lint-missing-doc.rs:176:9
| |
LL | pub fn also_undocumented1() {} LL | pub fn also_undocumented1() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: missing documentation for a function error: missing documentation for a function
--> $DIR/lint-missing-doc.rs:189:5 --> $DIR/lint-missing-doc.rs:191:5
| |
LL | pub fn extern_fn_undocumented(f: f32) -> f32; LL | pub fn extern_fn_undocumented(f: f32) -> f32;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: missing documentation for a static error: missing documentation for a static
--> $DIR/lint-missing-doc.rs:194:5 --> $DIR/lint-missing-doc.rs:196:5
| |
LL | pub static EXTERN_STATIC_UNDOCUMENTED: u8; LL | pub static EXTERN_STATIC_UNDOCUMENTED: u8;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: missing documentation for a foreign type error: missing documentation for a foreign type
--> $DIR/lint-missing-doc.rs:199:5 --> $DIR/lint-missing-doc.rs:201:5
| |
LL | pub type ExternTyUndocumented; LL | pub type ExternTyUndocumented;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 22 previous errors error: aborting due to 24 previous errors

View file

@ -22,40 +22,40 @@ mod cross_crate {
let foo = MethodTester; let foo = MethodTester;
deprecated(); //~ WARN use of deprecated function `lint_stability::deprecated` deprecated(); //~ WARN use of deprecated function `lint_stability::deprecated`
foo.method_deprecated(); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated` foo.method_deprecated(); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated`
Foo::method_deprecated(&foo); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated` Foo::method_deprecated(&foo); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated`
<Foo>::method_deprecated(&foo); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated` <Foo>::method_deprecated(&foo); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated`
foo.trait_deprecated(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated` foo.trait_deprecated(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated`
Trait::trait_deprecated(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated` Trait::trait_deprecated(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated`
<Foo>::trait_deprecated(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated` <Foo>::trait_deprecated(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated`
<Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated` <Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated`
deprecated_text(); //~ WARN use of deprecated function `lint_stability::deprecated_text`: text deprecated_text(); //~ WARN use of deprecated function `lint_stability::deprecated_text`: text
foo.method_deprecated_text(); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated_text`: text foo.method_deprecated_text(); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated_text`: text
Foo::method_deprecated_text(&foo); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated_text`: text Foo::method_deprecated_text(&foo); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated_text`: text
<Foo>::method_deprecated_text(&foo); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated_text`: text <Foo>::method_deprecated_text(&foo); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated_text`: text
foo.trait_deprecated_text(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text foo.trait_deprecated_text(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
<Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text <Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
<Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text <Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
deprecated_unstable(); //~ WARN use of deprecated function `lint_stability::deprecated_unstable` deprecated_unstable(); //~ WARN use of deprecated function `lint_stability::deprecated_unstable`
foo.method_deprecated_unstable(); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable` foo.method_deprecated_unstable(); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable`
Foo::method_deprecated_unstable(&foo); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable` Foo::method_deprecated_unstable(&foo); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable`
<Foo>::method_deprecated_unstable(&foo); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable` <Foo>::method_deprecated_unstable(&foo); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable`
foo.trait_deprecated_unstable(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable` foo.trait_deprecated_unstable(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`
Trait::trait_deprecated_unstable(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable` Trait::trait_deprecated_unstable(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`
<Foo>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable` <Foo>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`
<Foo as Trait>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable` <Foo as Trait>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`
deprecated_unstable_text(); //~ WARN use of deprecated function `lint_stability::deprecated_unstable_text`: text deprecated_unstable_text(); //~ WARN use of deprecated function `lint_stability::deprecated_unstable_text`: text
foo.method_deprecated_unstable_text(); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable_text`: text foo.method_deprecated_unstable_text(); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable_text`: text
Foo::method_deprecated_unstable_text(&foo); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable_text`: text Foo::method_deprecated_unstable_text(&foo); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable_text`: text
<Foo>::method_deprecated_unstable_text(&foo); //~ WARN use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable_text`: text <Foo>::method_deprecated_unstable_text(&foo); //~ WARN use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable_text`: text
foo.trait_deprecated_unstable_text(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text foo.trait_deprecated_unstable_text(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
Trait::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text Trait::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
<Foo>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text <Foo>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
<Foo as Trait>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text <Foo as Trait>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
unstable(); unstable();
foo.method_unstable(); foo.method_unstable();
@ -141,22 +141,22 @@ mod cross_crate {
} }
fn test_method_param<Foo: Trait>(foo: Foo) { fn test_method_param<Foo: Trait>(foo: Foo) {
foo.trait_deprecated(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated` foo.trait_deprecated(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated`
Trait::trait_deprecated(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated` Trait::trait_deprecated(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated`
<Foo>::trait_deprecated(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated` <Foo>::trait_deprecated(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated`
<Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated` <Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated`
foo.trait_deprecated_text(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text foo.trait_deprecated_text(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
<Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text <Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
<Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text <Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
foo.trait_deprecated_unstable(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable` foo.trait_deprecated_unstable(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`
Trait::trait_deprecated_unstable(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable` Trait::trait_deprecated_unstable(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`
<Foo>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable` <Foo>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`
<Foo as Trait>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable` <Foo as Trait>::trait_deprecated_unstable(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`
foo.trait_deprecated_unstable_text(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text foo.trait_deprecated_unstable_text(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
Trait::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text Trait::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
<Foo>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text <Foo>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
<Foo as Trait>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text <Foo as Trait>::trait_deprecated_unstable_text(&foo); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
foo.trait_unstable(); foo.trait_unstable();
Trait::trait_unstable(&foo); Trait::trait_unstable(&foo);
<Foo>::trait_unstable(&foo); <Foo>::trait_unstable(&foo);
@ -172,10 +172,10 @@ mod cross_crate {
} }
fn test_method_object(foo: &dyn Trait) { fn test_method_object(foo: &dyn Trait) {
foo.trait_deprecated(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated` foo.trait_deprecated(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated`
foo.trait_deprecated_text(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text foo.trait_deprecated_text(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
foo.trait_deprecated_unstable(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable` foo.trait_deprecated_unstable(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`
foo.trait_deprecated_unstable_text(); //~ WARN use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text foo.trait_deprecated_unstable_text(); //~ WARN use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
foo.trait_unstable(); foo.trait_unstable();
foo.trait_unstable_text(); foo.trait_unstable_text();
foo.trait_stable(); foo.trait_stable();
@ -328,22 +328,22 @@ mod this_crate {
let foo = MethodTester; let foo = MethodTester;
deprecated(); //~ WARN use of deprecated function `this_crate::deprecated` deprecated(); //~ WARN use of deprecated function `this_crate::deprecated`
foo.method_deprecated(); //~ WARN use of deprecated associated function `this_crate::MethodTester::method_deprecated` foo.method_deprecated(); //~ WARN use of deprecated method `this_crate::MethodTester::method_deprecated`
Foo::method_deprecated(&foo); //~ WARN use of deprecated associated function `this_crate::MethodTester::method_deprecated` Foo::method_deprecated(&foo); //~ WARN use of deprecated method `this_crate::MethodTester::method_deprecated`
<Foo>::method_deprecated(&foo); //~ WARN use of deprecated associated function `this_crate::MethodTester::method_deprecated` <Foo>::method_deprecated(&foo); //~ WARN use of deprecated method `this_crate::MethodTester::method_deprecated`
foo.trait_deprecated(); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated` foo.trait_deprecated(); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated`
Trait::trait_deprecated(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated` Trait::trait_deprecated(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated`
<Foo>::trait_deprecated(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated` <Foo>::trait_deprecated(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated`
<Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated` <Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated`
deprecated_text(); //~ WARN use of deprecated function `this_crate::deprecated_text`: text deprecated_text(); //~ WARN use of deprecated function `this_crate::deprecated_text`: text
foo.method_deprecated_text(); //~ WARN use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text foo.method_deprecated_text(); //~ WARN use of deprecated method `this_crate::MethodTester::method_deprecated_text`: text
Foo::method_deprecated_text(&foo); //~ WARN use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text Foo::method_deprecated_text(&foo); //~ WARN use of deprecated method `this_crate::MethodTester::method_deprecated_text`: text
<Foo>::method_deprecated_text(&foo); //~ WARN use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text <Foo>::method_deprecated_text(&foo); //~ WARN use of deprecated method `this_crate::MethodTester::method_deprecated_text`: text
foo.trait_deprecated_text(); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text foo.trait_deprecated_text(); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
<Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text <Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
<Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text <Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
unstable(); unstable();
foo.method_unstable(); foo.method_unstable();
@ -402,14 +402,14 @@ mod this_crate {
} }
fn test_method_param<Foo: Trait>(foo: Foo) { fn test_method_param<Foo: Trait>(foo: Foo) {
foo.trait_deprecated(); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated` foo.trait_deprecated(); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated`
Trait::trait_deprecated(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated` Trait::trait_deprecated(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated`
<Foo>::trait_deprecated(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated` <Foo>::trait_deprecated(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated`
<Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated` <Foo as Trait>::trait_deprecated(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated`
foo.trait_deprecated_text(); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text foo.trait_deprecated_text(); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text Trait::trait_deprecated_text(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
<Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text <Foo>::trait_deprecated_text(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
<Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text <Foo as Trait>::trait_deprecated_text(&foo); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
foo.trait_unstable(); foo.trait_unstable();
Trait::trait_unstable(&foo); Trait::trait_unstable(&foo);
<Foo>::trait_unstable(&foo); <Foo>::trait_unstable(&foo);
@ -425,8 +425,8 @@ mod this_crate {
} }
fn test_method_object(foo: &dyn Trait) { fn test_method_object(foo: &dyn Trait) {
foo.trait_deprecated(); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated` foo.trait_deprecated(); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated`
foo.trait_deprecated_text(); //~ WARN use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text foo.trait_deprecated_text(); //~ WARN use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
foo.trait_unstable(); foo.trait_unstable();
foo.trait_unstable_text(); foo.trait_unstable_text();
foo.trait_stable(); foo.trait_stable();

View file

@ -10,13 +10,13 @@ note: the lint level is defined here
LL | #![warn(deprecated)] LL | #![warn(deprecated)]
| ^^^^^^^^^^ | ^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:29:16 --> $DIR/lint-stability-deprecated.rs:29:16
| |
LL | Trait::trait_deprecated(&foo); LL | Trait::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:31:25 --> $DIR/lint-stability-deprecated.rs:31:25
| |
LL | <Foo as Trait>::trait_deprecated(&foo); LL | <Foo as Trait>::trait_deprecated(&foo);
@ -28,16 +28,16 @@ warning: use of deprecated function `lint_stability::deprecated_text`: text
LL | deprecated_text(); LL | deprecated_text();
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:38:16 --> $DIR/lint-stability-deprecated.rs:38:16
| |
LL | ... Trait::trait_deprecated_text(&foo); LL | Trait::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:40:25 --> $DIR/lint-stability-deprecated.rs:40:25
| |
LL | ... <Foo as Trait>::trait_deprecated_text(&foo); LL | <Foo as Trait>::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated function `lint_stability::deprecated_unstable`: text warning: use of deprecated function `lint_stability::deprecated_unstable`: text
@ -46,13 +46,13 @@ warning: use of deprecated function `lint_stability::deprecated_unstable`: text
LL | deprecated_unstable(); LL | deprecated_unstable();
| ^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:47:16 --> $DIR/lint-stability-deprecated.rs:47:16
| |
LL | ... Trait::trait_deprecated_unstable(&foo); LL | Trait::trait_deprecated_unstable(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:49:25 --> $DIR/lint-stability-deprecated.rs:49:25
| |
LL | ... <Foo as Trait>::trait_deprecated_unstable(&foo); LL | ... <Foo as Trait>::trait_deprecated_unstable(&foo);
@ -64,13 +64,13 @@ warning: use of deprecated function `lint_stability::deprecated_unstable_text`:
LL | deprecated_unstable_text(); LL | deprecated_unstable_text();
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:56:16 --> $DIR/lint-stability-deprecated.rs:56:16
| |
LL | ... Trait::trait_deprecated_unstable_text(&foo); LL | ... Trait::trait_deprecated_unstable_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:58:25 --> $DIR/lint-stability-deprecated.rs:58:25
| |
LL | ... <Foo as Trait>::trait_deprecated_unstable_text(&foo); LL | ... <Foo as Trait>::trait_deprecated_unstable_text(&foo);
@ -142,49 +142,49 @@ warning: use of deprecated function `lint_stability::deprecated_text`: text
LL | macro_test_arg!(macro_test_arg!(deprecated_text())); LL | macro_test_arg!(macro_test_arg!(deprecated_text()));
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:145:16 --> $DIR/lint-stability-deprecated.rs:145:16
| |
LL | Trait::trait_deprecated(&foo); LL | Trait::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:147:25 --> $DIR/lint-stability-deprecated.rs:147:25
| |
LL | <Foo as Trait>::trait_deprecated(&foo); LL | <Foo as Trait>::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:149:16 --> $DIR/lint-stability-deprecated.rs:149:16
| |
LL | ... Trait::trait_deprecated_text(&foo); LL | Trait::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:151:25 --> $DIR/lint-stability-deprecated.rs:151:25
| |
LL | ... <Foo as Trait>::trait_deprecated_text(&foo); LL | <Foo as Trait>::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:153:16 --> $DIR/lint-stability-deprecated.rs:153:16
| |
LL | ... Trait::trait_deprecated_unstable(&foo); LL | Trait::trait_deprecated_unstable(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:155:25 --> $DIR/lint-stability-deprecated.rs:155:25
| |
LL | ... <Foo as Trait>::trait_deprecated_unstable(&foo); LL | ... <Foo as Trait>::trait_deprecated_unstable(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:157:16 --> $DIR/lint-stability-deprecated.rs:157:16
| |
LL | ... Trait::trait_deprecated_unstable_text(&foo); LL | ... Trait::trait_deprecated_unstable_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:159:25 --> $DIR/lint-stability-deprecated.rs:159:25
| |
LL | ... <Foo as Trait>::trait_deprecated_unstable_text(&foo); LL | ... <Foo as Trait>::trait_deprecated_unstable_text(&foo);
@ -214,13 +214,13 @@ warning: use of deprecated function `this_crate::deprecated`: text
LL | deprecated(); LL | deprecated();
| ^^^^^^^^^^ | ^^^^^^^^^^
warning: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text warning: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:335:16 --> $DIR/lint-stability-deprecated.rs:335:16
| |
LL | Trait::trait_deprecated(&foo); LL | Trait::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text warning: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:337:25 --> $DIR/lint-stability-deprecated.rs:337:25
| |
LL | <Foo as Trait>::trait_deprecated(&foo); LL | <Foo as Trait>::trait_deprecated(&foo);
@ -232,16 +232,16 @@ warning: use of deprecated function `this_crate::deprecated_text`: text
LL | deprecated_text(); LL | deprecated_text();
| ^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text warning: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:344:16 --> $DIR/lint-stability-deprecated.rs:344:16
| |
LL | Trait::trait_deprecated_text(&foo); LL | Trait::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text warning: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:346:25 --> $DIR/lint-stability-deprecated.rs:346:25
| |
LL | ... <Foo as Trait>::trait_deprecated_text(&foo); LL | <Foo as Trait>::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated struct `this_crate::DeprecatedStruct`: text warning: use of deprecated struct `this_crate::DeprecatedStruct`: text
@ -268,28 +268,28 @@ warning: use of deprecated tuple struct `this_crate::DeprecatedTupleStruct`: tex
LL | let _ = DeprecatedTupleStruct (1); LL | let _ = DeprecatedTupleStruct (1);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text warning: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:406:16 --> $DIR/lint-stability-deprecated.rs:406:16
| |
LL | Trait::trait_deprecated(&foo); LL | Trait::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text warning: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:408:25 --> $DIR/lint-stability-deprecated.rs:408:25
| |
LL | <Foo as Trait>::trait_deprecated(&foo); LL | <Foo as Trait>::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text warning: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:410:16 --> $DIR/lint-stability-deprecated.rs:410:16
| |
LL | Trait::trait_deprecated_text(&foo); LL | Trait::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text warning: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:412:25 --> $DIR/lint-stability-deprecated.rs:412:25
| |
LL | ... <Foo as Trait>::trait_deprecated_text(&foo); LL | <Foo as Trait>::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated function `this_crate::test_fn_body::fn_in_body`: text warning: use of deprecated function `this_crate::test_fn_body::fn_in_body`: text
@ -328,121 +328,121 @@ warning: use of deprecated associated type `lint_stability::TraitWithAssociatedT
LL | TypeDeprecated = u16, LL | TypeDeprecated = u16,
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated`: text warning: use of deprecated method `lint_stability::MethodTester::method_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:25:13 --> $DIR/lint-stability-deprecated.rs:25:13
| |
LL | foo.method_deprecated(); LL | foo.method_deprecated();
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated`: text warning: use of deprecated method `lint_stability::MethodTester::method_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:26:14 --> $DIR/lint-stability-deprecated.rs:26:14
| |
LL | Foo::method_deprecated(&foo); LL | Foo::method_deprecated(&foo);
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated`: text warning: use of deprecated method `lint_stability::MethodTester::method_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:27:16 --> $DIR/lint-stability-deprecated.rs:27:16
| |
LL | <Foo>::method_deprecated(&foo); LL | <Foo>::method_deprecated(&foo);
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:28:13 --> $DIR/lint-stability-deprecated.rs:28:13
| |
LL | foo.trait_deprecated(); LL | foo.trait_deprecated();
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:30:16 --> $DIR/lint-stability-deprecated.rs:30:16
| |
LL | <Foo>::trait_deprecated(&foo); LL | <Foo>::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated_text`: text warning: use of deprecated method `lint_stability::MethodTester::method_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:34:13 --> $DIR/lint-stability-deprecated.rs:34:13
| |
LL | ... foo.method_deprecated_text(); LL | foo.method_deprecated_text();
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated_text`: text warning: use of deprecated method `lint_stability::MethodTester::method_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:35:14 --> $DIR/lint-stability-deprecated.rs:35:14
| |
LL | ... Foo::method_deprecated_text(&foo); LL | Foo::method_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated_text`: text warning: use of deprecated method `lint_stability::MethodTester::method_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:36:16 --> $DIR/lint-stability-deprecated.rs:36:16
| |
LL | ... <Foo>::method_deprecated_text(&foo); LL | <Foo>::method_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:37:13 --> $DIR/lint-stability-deprecated.rs:37:13
| |
LL | foo.trait_deprecated_text(); LL | foo.trait_deprecated_text();
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:39:16 --> $DIR/lint-stability-deprecated.rs:39:16
| |
LL | ... <Foo>::trait_deprecated_text(&foo); LL | <Foo>::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable`: text warning: use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:43:13 --> $DIR/lint-stability-deprecated.rs:43:13
| |
LL | ... foo.method_deprecated_unstable(); LL | foo.method_deprecated_unstable();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable`: text warning: use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:44:14 --> $DIR/lint-stability-deprecated.rs:44:14
| |
LL | ... Foo::method_deprecated_unstable(&foo); LL | Foo::method_deprecated_unstable(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable`: text warning: use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:45:16 --> $DIR/lint-stability-deprecated.rs:45:16
| |
LL | ... <Foo>::method_deprecated_unstable(&foo); LL | ... <Foo>::method_deprecated_unstable(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:46:13 --> $DIR/lint-stability-deprecated.rs:46:13
| |
LL | foo.trait_deprecated_unstable(); LL | foo.trait_deprecated_unstable();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:48:16 --> $DIR/lint-stability-deprecated.rs:48:16
| |
LL | ... <Foo>::trait_deprecated_unstable(&foo); LL | <Foo>::trait_deprecated_unstable(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable_text`: text warning: use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:52:13 --> $DIR/lint-stability-deprecated.rs:52:13
| |
LL | ... foo.method_deprecated_unstable_text(); LL | ... foo.method_deprecated_unstable_text();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable_text`: text warning: use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:53:14 --> $DIR/lint-stability-deprecated.rs:53:14
| |
LL | ... Foo::method_deprecated_unstable_text(&foo); LL | ... Foo::method_deprecated_unstable_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::MethodTester::method_deprecated_unstable_text`: text warning: use of deprecated method `lint_stability::MethodTester::method_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:54:16 --> $DIR/lint-stability-deprecated.rs:54:16
| |
LL | ... <Foo>::method_deprecated_unstable_text(&foo); LL | ... <Foo>::method_deprecated_unstable_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:55:13 --> $DIR/lint-stability-deprecated.rs:55:13
| |
LL | ... foo.trait_deprecated_unstable_text(); LL | ... foo.trait_deprecated_unstable_text();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:57:16 --> $DIR/lint-stability-deprecated.rs:57:16
| |
LL | ... <Foo>::trait_deprecated_unstable_text(&foo); LL | ... <Foo>::trait_deprecated_unstable_text(&foo);
@ -460,133 +460,133 @@ warning: use of deprecated field `lint_stability::DeprecatedUnstableStruct::i`:
LL | i: 0 LL | i: 0
| ^^^^ | ^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:144:13 --> $DIR/lint-stability-deprecated.rs:144:13
| |
LL | foo.trait_deprecated(); LL | foo.trait_deprecated();
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:146:16 --> $DIR/lint-stability-deprecated.rs:146:16
| |
LL | <Foo>::trait_deprecated(&foo); LL | <Foo>::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:148:13 --> $DIR/lint-stability-deprecated.rs:148:13
| |
LL | foo.trait_deprecated_text(); LL | foo.trait_deprecated_text();
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:150:16 --> $DIR/lint-stability-deprecated.rs:150:16
| |
LL | ... <Foo>::trait_deprecated_text(&foo); LL | <Foo>::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:152:13 --> $DIR/lint-stability-deprecated.rs:152:13
| |
LL | foo.trait_deprecated_unstable(); LL | foo.trait_deprecated_unstable();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:154:16 --> $DIR/lint-stability-deprecated.rs:154:16
| |
LL | ... <Foo>::trait_deprecated_unstable(&foo); LL | <Foo>::trait_deprecated_unstable(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:156:13 --> $DIR/lint-stability-deprecated.rs:156:13
| |
LL | ... foo.trait_deprecated_unstable_text(); LL | ... foo.trait_deprecated_unstable_text();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:158:16 --> $DIR/lint-stability-deprecated.rs:158:16
| |
LL | ... <Foo>::trait_deprecated_unstable_text(&foo); LL | ... <Foo>::trait_deprecated_unstable_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:175:13 --> $DIR/lint-stability-deprecated.rs:175:13
| |
LL | foo.trait_deprecated(); LL | foo.trait_deprecated();
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_text`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:176:13 --> $DIR/lint-stability-deprecated.rs:176:13
| |
LL | foo.trait_deprecated_text(); LL | foo.trait_deprecated_text();
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable`: text
--> $DIR/lint-stability-deprecated.rs:177:13 --> $DIR/lint-stability-deprecated.rs:177:13
| |
LL | foo.trait_deprecated_unstable(); LL | foo.trait_deprecated_unstable();
| ^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `lint_stability::Trait::trait_deprecated_unstable_text`: text warning: use of deprecated method `lint_stability::Trait::trait_deprecated_unstable_text`: text
--> $DIR/lint-stability-deprecated.rs:178:13 --> $DIR/lint-stability-deprecated.rs:178:13
| |
LL | ... foo.trait_deprecated_unstable_text(); LL | ... foo.trait_deprecated_unstable_text();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::MethodTester::method_deprecated`: text warning: use of deprecated method `this_crate::MethodTester::method_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:331:13 --> $DIR/lint-stability-deprecated.rs:331:13
| |
LL | foo.method_deprecated(); LL | foo.method_deprecated();
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::MethodTester::method_deprecated`: text warning: use of deprecated method `this_crate::MethodTester::method_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:332:14 --> $DIR/lint-stability-deprecated.rs:332:14
| |
LL | Foo::method_deprecated(&foo); LL | Foo::method_deprecated(&foo);
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::MethodTester::method_deprecated`: text warning: use of deprecated method `this_crate::MethodTester::method_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:333:16 --> $DIR/lint-stability-deprecated.rs:333:16
| |
LL | <Foo>::method_deprecated(&foo); LL | <Foo>::method_deprecated(&foo);
| ^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text warning: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:334:13 --> $DIR/lint-stability-deprecated.rs:334:13
| |
LL | foo.trait_deprecated(); LL | foo.trait_deprecated();
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text warning: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:336:16 --> $DIR/lint-stability-deprecated.rs:336:16
| |
LL | <Foo>::trait_deprecated(&foo); LL | <Foo>::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text warning: use of deprecated method `this_crate::MethodTester::method_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:340:13 --> $DIR/lint-stability-deprecated.rs:340:13
| |
LL | ... foo.method_deprecated_text(); LL | foo.method_deprecated_text();
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text warning: use of deprecated method `this_crate::MethodTester::method_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:341:14 --> $DIR/lint-stability-deprecated.rs:341:14
| |
LL | ... Foo::method_deprecated_text(&foo); LL | Foo::method_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::MethodTester::method_deprecated_text`: text warning: use of deprecated method `this_crate::MethodTester::method_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:342:16 --> $DIR/lint-stability-deprecated.rs:342:16
| |
LL | ... <Foo>::method_deprecated_text(&foo); LL | <Foo>::method_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text warning: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:343:13 --> $DIR/lint-stability-deprecated.rs:343:13
| |
LL | foo.trait_deprecated_text(); LL | foo.trait_deprecated_text();
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text warning: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:345:16 --> $DIR/lint-stability-deprecated.rs:345:16
| |
LL | <Foo>::trait_deprecated_text(&foo); LL | <Foo>::trait_deprecated_text(&foo);
@ -598,37 +598,37 @@ warning: use of deprecated field `this_crate::DeprecatedStruct::i`: text
LL | i: 0 LL | i: 0
| ^^^^ | ^^^^
warning: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text warning: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:405:13 --> $DIR/lint-stability-deprecated.rs:405:13
| |
LL | foo.trait_deprecated(); LL | foo.trait_deprecated();
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text warning: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:407:16 --> $DIR/lint-stability-deprecated.rs:407:16
| |
LL | <Foo>::trait_deprecated(&foo); LL | <Foo>::trait_deprecated(&foo);
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text warning: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:409:13 --> $DIR/lint-stability-deprecated.rs:409:13
| |
LL | foo.trait_deprecated_text(); LL | foo.trait_deprecated_text();
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text warning: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:411:16 --> $DIR/lint-stability-deprecated.rs:411:16
| |
LL | <Foo>::trait_deprecated_text(&foo); LL | <Foo>::trait_deprecated_text(&foo);
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::Trait::trait_deprecated`: text warning: use of deprecated method `this_crate::Trait::trait_deprecated`: text
--> $DIR/lint-stability-deprecated.rs:428:13 --> $DIR/lint-stability-deprecated.rs:428:13
| |
LL | foo.trait_deprecated(); LL | foo.trait_deprecated();
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
warning: use of deprecated associated function `this_crate::Trait::trait_deprecated_text`: text warning: use of deprecated method `this_crate::Trait::trait_deprecated_text`: text
--> $DIR/lint-stability-deprecated.rs:429:13 --> $DIR/lint-stability-deprecated.rs:429:13
| |
LL | foo.trait_deprecated_text(); LL | foo.trait_deprecated_text();

View file

@ -6,7 +6,7 @@ LL | impl<'b> S<'b> {
LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 { LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 {
| -- lifetime `'a` defined here | -- lifetime `'a` defined here
LL | match self.0 { ref mut x => x } LL | match self.0 { ref mut x => x }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ associated function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ method was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
| |
= help: consider adding the following bound: `'a: 'b` = help: consider adding the following bound: `'a: 'b`
= note: requirement occurs because of a mutable reference to `&i32` = note: requirement occurs because of a mutable reference to `&i32`

View file

@ -7,7 +7,7 @@ LL | fn bar<'a>(&'a mut self) -> &'a mut &'a i32 {
| -- lifetime `'a` defined here | -- lifetime `'a` defined here
LL | let ref mut x = self.0; LL | let ref mut x = self.0;
LL | x LL | x
| ^ associated function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` | ^ method was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
| |
= help: consider adding the following bound: `'a: 'b` = help: consider adding the following bound: `'a: 'b`
= note: requirement occurs because of a mutable reference to `&i32` = note: requirement occurs because of a mutable reference to `&i32`

View file

@ -27,7 +27,7 @@ LL | 1.query::<dyn ToString>("")
| |
= note: expected trait object `dyn ToString` = note: expected trait object `dyn ToString`
found reference `&'static str` found reference `&'static str`
note: associated function defined here note: method defined here
--> $DIR/issue-61525.rs:2:8 --> $DIR/issue-61525.rs:2:8
| |
LL | fn query<Q>(self, q: Q); LL | fn query<Q>(self, q: Q);

View file

@ -10,11 +10,11 @@ note: candidate #2 is defined in an impl of the trait `Me2` for the type `usize`
| |
LL | impl Me2 for usize { fn me(&self) -> usize { *self } } LL | impl Me2 for usize { fn me(&self) -> usize { *self } }
| ^^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #1 help: disambiguate the method for candidate #1
| |
LL | fn main() { Me::me(&1_usize); } LL | fn main() { Me::me(&1_usize); }
| ~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2 help: disambiguate the method for candidate #2
| |
LL | fn main() { Me2::me(&1_usize); } LL | fn main() { Me2::me(&1_usize); }
| ~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~

View file

@ -14,11 +14,11 @@ note: candidate #2 is defined in the trait `B`
| |
LL | trait B { fn foo(&self); } LL | trait B { fn foo(&self); }
| ^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #1 help: disambiguate the method for candidate #1
| |
LL | A::foo(t); LL | A::foo(t);
| ~~~~~~~~~ | ~~~~~~~~~
help: disambiguate the associated function for candidate #2 help: disambiguate the method for candidate #2
| |
LL | B::foo(t); LL | B::foo(t);
| ~~~~~~~~~ | ~~~~~~~~~

View file

@ -14,11 +14,11 @@ note: candidate #2 is defined in an impl of the trait `B` for the type `AB`
| |
LL | fn foo(self) {} LL | fn foo(self) {}
| ^^^^^^^^^^^^ | ^^^^^^^^^^^^
help: disambiguate the associated function for candidate #1 help: disambiguate the method for candidate #1
| |
LL | A::foo(AB {}); LL | A::foo(AB {});
| ~~~~~~~~~~~~~ | ~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2 help: disambiguate the method for candidate #2
| |
LL | B::foo(AB {}); LL | B::foo(AB {});
| ~~~~~~~~~~~~~ | ~~~~~~~~~~~~~

View file

@ -14,11 +14,11 @@ note: candidate #2 is defined in an impl of the trait `Bar` for the type `usize`
| |
LL | trait Bar { fn method(&self) {} } LL | trait Bar { fn method(&self) {} }
| ^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #1 help: disambiguate the method for candidate #1
| |
LL | Foo::method(&1_usize); LL | Foo::method(&1_usize);
| ~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #2 help: disambiguate the method for candidate #2
| |
LL | Bar::method(&1_usize); LL | Bar::method(&1_usize);
| ~~~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~~~

View file

@ -7,7 +7,7 @@ LL | x.zero(0)
| unexpected argument of type `{integer}` | unexpected argument of type `{integer}`
| help: remove the extra argument | help: remove the extra argument
| |
note: associated function defined here note: method defined here
--> $DIR/method-call-err-msg.rs:5:8 --> $DIR/method-call-err-msg.rs:5:8
| |
LL | fn zero(self) -> Foo { self } LL | fn zero(self) -> Foo { self }
@ -19,7 +19,7 @@ error[E0061]: this method takes 1 argument but 0 arguments were supplied
LL | .one() LL | .one()
| ^^^-- an argument of type `isize` is missing | ^^^-- an argument of type `isize` is missing
| |
note: associated function defined here note: method defined here
--> $DIR/method-call-err-msg.rs:6:8 --> $DIR/method-call-err-msg.rs:6:8
| |
LL | fn one(self, _: isize) -> Foo { self } LL | fn one(self, _: isize) -> Foo { self }
@ -35,7 +35,7 @@ error[E0061]: this method takes 2 arguments but 1 argument was supplied
LL | .two(0); LL | .two(0);
| ^^^--- an argument of type `isize` is missing | ^^^--- an argument of type `isize` is missing
| |
note: associated function defined here note: method defined here
--> $DIR/method-call-err-msg.rs:7:8 --> $DIR/method-call-err-msg.rs:7:8
| |
LL | fn two(self, _: isize, _: isize) -> Foo { self } LL | fn two(self, _: isize, _: isize) -> Foo { self }
@ -72,7 +72,7 @@ error[E0061]: this method takes 3 arguments but 0 arguments were supplied
LL | y.three::<usize>(); LL | y.three::<usize>();
| ^^^^^^^^^^^^^^-- three arguments of type `usize`, `usize`, and `usize` are missing | ^^^^^^^^^^^^^^-- three arguments of type `usize`, `usize`, and `usize` are missing
| |
note: associated function defined here note: method defined here
--> $DIR/method-call-err-msg.rs:8:8 --> $DIR/method-call-err-msg.rs:8:8
| |
LL | fn three<T>(self, _: T, _: T, _: T) -> Foo { self } LL | fn three<T>(self, _: T, _: T, _: T) -> Foo { self }

View file

@ -14,9 +14,9 @@ impl S {
fn method_call() { fn method_call() {
S.early(); // OK S.early(); // OK
S.early::<'static>(); S.early::<'static>();
//~^ ERROR this associated function takes 2 lifetime arguments but 1 lifetime argument //~^ ERROR this method takes 2 lifetime arguments but 1 lifetime argument
S.early::<'static, 'static, 'static>(); S.early::<'static, 'static, 'static>();
//~^ ERROR this associated function takes 2 lifetime arguments but 3 lifetime arguments were supplied //~^ ERROR this method takes 2 lifetime arguments but 3 lifetime arguments were supplied
let _: &u8 = S.life_and_type::<'static>(); let _: &u8 = S.life_and_type::<'static>();
S.life_and_type::<u8>(); S.life_and_type::<u8>();
S.life_and_type::<'static, u8>(); S.life_and_type::<'static, u8>();
@ -61,9 +61,9 @@ fn ufcs() {
S::early(S); // OK S::early(S); // OK
S::early::<'static>(S); S::early::<'static>(S);
//~^ ERROR this associated function takes 2 lifetime arguments but 1 lifetime argument //~^ ERROR this method takes 2 lifetime arguments but 1 lifetime argument
S::early::<'static, 'static, 'static>(S); S::early::<'static, 'static, 'static>(S);
//~^ ERROR this associated function takes 2 lifetime arguments but 3 lifetime arguments were supplied //~^ ERROR this method takes 2 lifetime arguments but 3 lifetime arguments were supplied
let _: &u8 = S::life_and_type::<'static>(S); let _: &u8 = S::life_and_type::<'static>(S);
S::life_and_type::<u8>(S); S::life_and_type::<u8>(S);
S::life_and_type::<'static, u8>(S); S::life_and_type::<'static, u8>(S);

View file

@ -1,4 +1,4 @@
error[E0107]: this associated function takes 2 lifetime arguments but 1 lifetime argument was supplied error[E0107]: this method takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/method-call-lifetime-args-fail.rs:16:7 --> $DIR/method-call-lifetime-args-fail.rs:16:7
| |
LL | S.early::<'static>(); LL | S.early::<'static>();
@ -6,7 +6,7 @@ LL | S.early::<'static>();
| | | |
| expected 2 lifetime arguments | expected 2 lifetime arguments
| |
note: associated function defined here, with 2 lifetime parameters: `'a`, `'b` note: method defined here, with 2 lifetime parameters: `'a`, `'b`
--> $DIR/method-call-lifetime-args-fail.rs:6:8 --> $DIR/method-call-lifetime-args-fail.rs:6:8
| |
LL | fn early<'a, 'b>(self) -> (&'a u8, &'b u8) { loop {} } LL | fn early<'a, 'b>(self) -> (&'a u8, &'b u8) { loop {} }
@ -16,7 +16,7 @@ help: add missing lifetime argument
LL | S.early::<'static, 'static>(); LL | S.early::<'static, 'static>();
| +++++++++ | +++++++++
error[E0107]: this associated function takes 2 lifetime arguments but 3 lifetime arguments were supplied error[E0107]: this method takes 2 lifetime arguments but 3 lifetime arguments were supplied
--> $DIR/method-call-lifetime-args-fail.rs:18:7 --> $DIR/method-call-lifetime-args-fail.rs:18:7
| |
LL | S.early::<'static, 'static, 'static>(); LL | S.early::<'static, 'static, 'static>();
@ -24,7 +24,7 @@ LL | S.early::<'static, 'static, 'static>();
| | | |
| expected 2 lifetime arguments | expected 2 lifetime arguments
| |
note: associated function defined here, with 2 lifetime parameters: `'a`, `'b` note: method defined here, with 2 lifetime parameters: `'a`, `'b`
--> $DIR/method-call-lifetime-args-fail.rs:6:8 --> $DIR/method-call-lifetime-args-fail.rs:6:8
| |
LL | fn early<'a, 'b>(self) -> (&'a u8, &'b u8) { loop {} } LL | fn early<'a, 'b>(self) -> (&'a u8, &'b u8) { loop {} }
@ -198,7 +198,7 @@ note: the late bound lifetime parameter is introduced here
LL | fn late_unused_early<'a, 'b>(self) -> &'b u8 { loop {} } LL | fn late_unused_early<'a, 'b>(self) -> &'b u8 { loop {} }
| ^^ | ^^
error[E0107]: this associated function takes 2 lifetime arguments but 1 lifetime argument was supplied error[E0107]: this method takes 2 lifetime arguments but 1 lifetime argument was supplied
--> $DIR/method-call-lifetime-args-fail.rs:63:8 --> $DIR/method-call-lifetime-args-fail.rs:63:8
| |
LL | S::early::<'static>(S); LL | S::early::<'static>(S);
@ -206,7 +206,7 @@ LL | S::early::<'static>(S);
| | | |
| expected 2 lifetime arguments | expected 2 lifetime arguments
| |
note: associated function defined here, with 2 lifetime parameters: `'a`, `'b` note: method defined here, with 2 lifetime parameters: `'a`, `'b`
--> $DIR/method-call-lifetime-args-fail.rs:6:8 --> $DIR/method-call-lifetime-args-fail.rs:6:8
| |
LL | fn early<'a, 'b>(self) -> (&'a u8, &'b u8) { loop {} } LL | fn early<'a, 'b>(self) -> (&'a u8, &'b u8) { loop {} }
@ -216,7 +216,7 @@ help: add missing lifetime argument
LL | S::early::<'static, 'static>(S); LL | S::early::<'static, 'static>(S);
| +++++++++ | +++++++++
error[E0107]: this associated function takes 2 lifetime arguments but 3 lifetime arguments were supplied error[E0107]: this method takes 2 lifetime arguments but 3 lifetime arguments were supplied
--> $DIR/method-call-lifetime-args-fail.rs:65:8 --> $DIR/method-call-lifetime-args-fail.rs:65:8
| |
LL | S::early::<'static, 'static, 'static>(S); LL | S::early::<'static, 'static, 'static>(S);
@ -224,7 +224,7 @@ LL | S::early::<'static, 'static, 'static>(S);
| | | |
| expected 2 lifetime arguments | expected 2 lifetime arguments
| |
note: associated function defined here, with 2 lifetime parameters: `'a`, `'b` note: method defined here, with 2 lifetime parameters: `'a`, `'b`
--> $DIR/method-call-lifetime-args-fail.rs:6:8 --> $DIR/method-call-lifetime-args-fail.rs:6:8
| |
LL | fn early<'a, 'b>(self) -> (&'a u8, &'b u8) { loop {} } LL | fn early<'a, 'b>(self) -> (&'a u8, &'b u8) { loop {} }

View file

@ -44,15 +44,15 @@ note: candidate #3 is defined in the trait `FinalFoo`
| |
LL | fn foo(&self) -> u8; LL | fn foo(&self) -> u8;
| ^^^^^^^^^^^^^^^^^^^^ | ^^^^^^^^^^^^^^^^^^^^
help: disambiguate the associated function for candidate #1 help: disambiguate the method for candidate #1
| |
LL | let z = X::foo(x); LL | let z = X::foo(x);
| ~~~~~~~~~ | ~~~~~~~~~
help: disambiguate the associated function for candidate #2 help: disambiguate the method for candidate #2
| |
LL | let z = NuisanceFoo::foo(x); LL | let z = NuisanceFoo::foo(x);
| ~~~~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~~~~
help: disambiguate the associated function for candidate #3 help: disambiguate the method for candidate #3
| |
LL | let z = FinalFoo::foo(x); LL | let z = FinalFoo::foo(x);
| ~~~~~~~~~~~~~~~~ | ~~~~~~~~~~~~~~~~

View file

@ -8,7 +8,7 @@ LL | Foo::bar(x);
| | help: consider borrowing here: `&x` | | help: consider borrowing here: `&x`
| arguments to this function are incorrect | arguments to this function are incorrect
| |
note: associated function defined here note: method defined here
--> $DIR/method-self-arg-1.rs:6:8 --> $DIR/method-self-arg-1.rs:6:8
| |
LL | fn bar(&self) {} LL | fn bar(&self) {}
@ -24,7 +24,7 @@ LL | Foo::bar(&42);
| |
= note: expected reference `&Foo` = note: expected reference `&Foo`
found reference `&{integer}` found reference `&{integer}`
note: associated function defined here note: method defined here
--> $DIR/method-self-arg-1.rs:6:8 --> $DIR/method-self-arg-1.rs:6:8
| |
LL | fn bar(&self) {} LL | fn bar(&self) {}

View file

@ -73,7 +73,7 @@ LL | impl<'a> Bar<'a> {
LL | pub fn get<'b>(&self) -> &'b usize { LL | pub fn get<'b>(&self) -> &'b usize {
| -- lifetime `'b` defined here | -- lifetime `'b` defined here
LL | self.x LL | self.x
| ^^^^^^ associated function was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a` | ^^^^^^ method was supposed to return data with lifetime `'b` but it is returning data with lifetime `'a`
| |
= help: consider adding the following bound: `'a: 'b` = help: consider adding the following bound: `'a: 'b`
@ -85,7 +85,7 @@ LL | impl<'a> Baz<'a> {
LL | fn get<'b>(&'b self) -> &'a i32 { LL | fn get<'b>(&'b self) -> &'a i32 {
| -- lifetime `'b` defined here | -- lifetime `'b` defined here
LL | self.x LL | self.x
| ^^^^^^ associated function was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b` | ^^^^^^ method was supposed to return data with lifetime `'a` but it is returning data with lifetime `'b`
| |
= help: consider adding the following bound: `'b: 'a` = help: consider adding the following bound: `'b: 'a`

View file

@ -106,7 +106,7 @@ mod foo {
//~^ ERROR: associated function `bar` is private //~^ ERROR: associated function `bar` is private
::bar::baz::A.foo2(); //~ ERROR: module `baz` is private ::bar::baz::A.foo2(); //~ ERROR: module `baz` is private
::bar::baz::A.bar2(); //~ ERROR: module `baz` is private ::bar::baz::A.bar2(); //~ ERROR: module `baz` is private
//~^ ERROR: associated function `bar2` is private //~^ ERROR: method `bar2` is private
let _: isize = let _: isize =
::bar::B::foo(); //~ ERROR: trait `B` is private ::bar::B::foo(); //~ ERROR: trait `B` is private

View file

@ -190,14 +190,14 @@ LL | fn bar() {}
LL | ::bar::baz::A::bar(); LL | ::bar::baz::A::bar();
| ^^^ private associated function | ^^^ private associated function
error[E0624]: associated function `bar2` is private error[E0624]: method `bar2` is private
--> $DIR/privacy1.rs:108:23 --> $DIR/privacy1.rs:108:23
| |
LL | fn bar2(&self) {} LL | fn bar2(&self) {}
| -------------- private associated function defined here | -------------- private method defined here
... ...
LL | ::bar::baz::A.bar2(); LL | ::bar::baz::A.bar2();
| ^^^^ private associated function | ^^^^ private method
error: aborting due to 18 previous errors error: aborting due to 18 previous errors

View file

@ -17,5 +17,5 @@ fn f() {
fn main() { fn main() {
let s = a::Foo { x: 1 }; let s = a::Foo { x: 1 };
s.bar(); s.bar();
s.foo(); //~ ERROR associated function `foo` is private s.foo(); //~ ERROR method `foo` is private
} }

View file

@ -1,11 +1,11 @@
error[E0624]: associated function `foo` is private error[E0624]: method `foo` is private
--> $DIR/private-impl-method.rs:20:7 --> $DIR/private-impl-method.rs:20:7
| |
LL | fn foo(&self) {} LL | fn foo(&self) {}
| ------------- private associated function defined here | ------------- private method defined here
... ...
LL | s.foo(); LL | s.foo();
| ^^^ private associated function | ^^^ private method
error: aborting due to previous error error: aborting due to previous error

View file

@ -4,5 +4,5 @@ use cci_class_5::kitties::cat;
fn main() { fn main() {
let nyan : cat = cat(52, 99); let nyan : cat = cat(52, 99);
nyan.nap(); //~ ERROR associated function `nap` is private nyan.nap(); //~ ERROR method `nap` is private
} }

Some files were not shown because too many files have changed in this diff Show more