Rollup merge of #81713 - estebank:unstable-assoc-item-lint, r=oli-obk

Account for associated consts in the "unstable assoc item name colission" lint

Fix #81663.
This commit is contained in:
Dylan DPC 2021-02-25 14:33:53 +01:00 committed by GitHub
commit c5629131fa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 67 additions and 23 deletions

View file

@ -353,12 +353,12 @@ pub fn struct_lint_level<'s, 'd>(
it will become a hard error";
let explanation = if lint_id == LintId::of(builtin::UNSTABLE_NAME_COLLISIONS) {
"once this method is added to the standard library, \
the ambiguity may cause an error or change in behavior!"
"once this associated item is added to the standard library, the ambiguity may \
cause an error or change in behavior!"
.to_owned()
} else if lint_id == LintId::of(builtin::MUTABLE_BORROW_RESERVATION_CONFLICT) {
"this borrowing pattern was not meant to be accepted, \
and may become a hard error in the future"
"this borrowing pattern was not meant to be accepted, and may become a hard error \
in the future"
.to_owned()
} else if let Some(edition) = future_incompatible.edition {
format!("{} in the {} edition!", STANDARD_MESSAGE, edition)