Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply deprecation lint to trait method overrides. #98991

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions compiler/rustc_passes/src/stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -760,8 +760,12 @@ impl<'tcx> Visitor<'tcx> for Checker<'tcx> {
let impl_item = self.tcx.associated_item(impl_item_ref.id.def_id);

if let Some(def_id) = impl_item.trait_item_def_id {
// Pass `None` to skip deprecation warnings.
self.tcx.check_stability(def_id, None, impl_item_ref.span, None);
self.tcx.check_stability(
def_id,
Some(impl_item_ref.id.hir_id()),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm is it possible that all calls take Some now and Option can be removed from around it?

impl_item_ref.span,
None,
);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions library/std/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,7 @@ impl Error for string::FromUtf16Error {

#[stable(feature = "str_parse_error2", since = "1.8.0")]
impl Error for Infallible {
#[allow(deprecated)]
fn description(&self) -> &str {
match *self {}
}
Expand Down