Skip to content

Commit

Permalink
Auto merge of rust-lang#101228 - nnethercote:simplify-hir-PathSegment…
Browse files Browse the repository at this point in the history
…, r=petrochenkov

Simplify `hir::PathSegment`

r? `@petrochenkov`
  • Loading branch information
bors committed Sep 5, 2022
2 parents 9ae3292 + 25f6f18 commit 5ea9977
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/operators/op_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ fn in_impl<'tcx>(
if let ItemKind::Impl(item) = &item.kind;
if let Some(of_trait) = &item.of_trait;
if let Some(seg) = of_trait.path.segments.last();
if let Some(Res::Def(_, trait_id)) = seg.res;
if let Res::Def(_, trait_id) = seg.res;
if trait_id == bin_op;
if let Some(generic_args) = seg.args;
if let Some(GenericArg::Type(other_ty)) = generic_args.args.last();
Expand Down
3 changes: 1 addition & 2 deletions clippy_lints/src/ref_option_ref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ impl<'tcx> LateLintPass<'tcx> for RefOptionRef {
if mut_ty.mutbl == Mutability::Not;
if let TyKind::Path(ref qpath) = &mut_ty.ty.kind;
let last = last_path_segment(qpath);
if let Some(res) = last.res;
if let Some(def_id) = res.opt_def_id();
if let Some(def_id) = last.res.opt_def_id();

if cx.tcx.is_diagnostic_item(sym::Option, def_id);
if let Some(params) = last_path_segment(qpath).args ;
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/trait_bounds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
if !bound_predicate.span.from_expansion();
if let TyKind::Path(QPath::Resolved(_, Path { segments, .. })) = bound_predicate.bounded_ty.kind;
if let Some(PathSegment {
res: Some(Res::SelfTy{ trait_: Some(def_id), alias_to: _ }), ..
res: Res::SelfTy{ trait_: Some(def_id), alias_to: _ }, ..
}) = segments.first();
if let Some(
Node::Item(
Expand Down

0 comments on commit 5ea9977

Please sign in to comment.