Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.

Commit a8aa8cc

Browse files
bobyangyffacebook-github-bot
authored andcommitted
Use Ty instead of TyS
Summary: Ty became an Intern of TyS use Ty type rust-lang/rust@e9a0c42 Reviewed By: ndmitchell Differential Revision: D35597415 fbshipit-source-id: eb1aa08e5efcc0336a9f8aac3fdd79502e833455
1 parent ae3681a commit a8aa8cc

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

gazebo_lint/src/clippy.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use rustc_infer::infer::TyCtxtInferExt;
2222
use rustc_lint::LateContext;
2323
use rustc_middle::{
2424
traits,
25-
ty::{subst::GenericArg, Ty, TyKind, TyS},
25+
ty::{subst::GenericArg, Ty, TyKind},
2626
};
2727
use rustc_span::{self, symbol::Symbol, Span};
2828
use rustc_trait_selection::traits::{
@@ -188,12 +188,7 @@ pub fn match_def_path(cx: &LateContext, did: DefId, syms: &[&str]) -> bool {
188188
}
189189

190190
/// Matches the given `ty` with generics to the given types and generic types
191-
pub fn match_ty_path(
192-
cx: &LateContext,
193-
ty: &TyS,
194-
ty_path: &[&str],
195-
generic_tys: &[&[&str]],
196-
) -> bool {
191+
pub fn match_ty_path(cx: &LateContext, ty: Ty, ty_path: &[&str], generic_tys: &[&[&str]]) -> bool {
197192
if let TyKind::Adt(ty, subst) = ty.kind() {
198193
if match_def_path(cx, ty.did, ty_path) {
199194
let mut i = 0;

gazebo_lint/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ fn check_use_dupe(cx: &LateContext, expr: &Expr) {
319319
// could also be a valid `dupe` call. So, try de-referencing the type once and
320320
// check for `Dupe` on `Foo` as well.
321321
if let TyKind::Ref(_, inner_ty, _) = cloned_type.kind() {
322-
cloned_type = inner_ty;
322+
cloned_type = *inner_ty;
323323
} else {
324324
break;
325325
}
@@ -353,7 +353,7 @@ fn check_use_duped(cx: &LateContext, expr: &Expr) {
353353
// could also be a valid `dupe` call. So, try de-referencing the type once and
354354
// check for `Dupe` on `Foo` as well.
355355
if let TyKind::Ref(_, inner_ty, _) = cloned_type.kind() {
356-
cloned_type = inner_ty;
356+
cloned_type = *inner_ty;
357357
} else {
358358
break;
359359
}
@@ -388,7 +388,7 @@ fn check_dupe_on_copy(cx: &LateContext, expr: &Expr) {
388388
// could also be a valid `dupe` call. So, try de-referencing the type once
389389
// and check for `Copy` on `Foo` as well.
390390
if let TyKind::Ref(_, inner_ty, _) = duped_type.kind() {
391-
duped_type = inner_ty;
391+
duped_type = *inner_ty;
392392
} else {
393393
break;
394394
}

0 commit comments

Comments
 (0)