Skip to content

Commit

Permalink
TODO: TyKind lost Debug formatting. How to handle these cases?
Browse files Browse the repository at this point in the history
  • Loading branch information
flip1995 committed Mar 15, 2019
1 parent 8eadbfd commit f66374d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion clippy_lints/src/eta_reduction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ fn get_type_name(cx: &LateContext<'_, '_>, kind: &ty::TyKind<'_>) -> String {
match kind {
ty::Adt(t, _) => cx.tcx.def_path_str(t.did),
ty::Ref(_, r, _) => get_type_name(cx, &r.sty),
_ => kind.to_string(),
_ => unimplemented!(), //kind.to_string(),
}
}

Expand Down
12 changes: 7 additions & 5 deletions clippy_lints/src/transmute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,11 +346,13 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Transmute {
&format!("transmute from a `{}` to a `char`", from_ty),
|db| {
let arg = sugg::Sugg::hir(cx, &args[0], "..");
let arg = if let ty::Int(_) = from_ty.sty {
arg.as_ty(ty::Uint(ast::UintTy::U32))
} else {
arg
};
unimplemented!();
// FIXME
// let arg = if let ty::Int(_) = from_ty.sty {
// arg.as_ty(ty::Uint(ast::UintTy::U32))
// } else {
// arg
// };
db.span_suggestion(
e.span,
"consider using",
Expand Down

0 comments on commit f66374d

Please sign in to comment.