]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_passes/src/stability.rs
Rollup merge of #101425 - compiler-errors:point-at-ty-param, r=spastorino
[rust.git] / compiler / rustc_passes / src / stability.rs
index f884e04a9511254977a3a96cf40142e8129f98ed..a24b191aebfc17db2de53d27992b0ce5fc2e82c5 100644 (file)
@@ -832,7 +832,7 @@ fn visit_path(&mut self, path: &'tcx hir::Path<'tcx>, id: hir::HirId) {
                 // added, such as `core::intrinsics::transmute`
                 let parents = path.segments.iter().rev().skip(1);
                 for path_segment in parents {
-                    if let Some(def_id) = path_segment.res.as_ref().and_then(Res::opt_def_id) {
+                    if let Some(def_id) = path_segment.res.opt_def_id() {
                         // use `None` for id to prevent deprecation check
                         self.tcx.check_stability_allow_unstable(
                             def_id,