This commit is contained in:
flip1995 2019-03-16 15:39:02 +01:00
parent 180e07e99e
commit 4832a853c7
No known key found for this signature in database
GPG Key ID: 693086869D506637
2 changed files with 4 additions and 3 deletions

View File

@ -147,7 +147,7 @@ fn get_ufcs_type_name(
}) })
} }
fn match_borrow_depth(lhs: &ty::Ty<'_>, rhs: &ty::Ty<'_>) -> bool { fn match_borrow_depth(lhs: ty::Ty<'_>, rhs: ty::Ty<'_>) -> bool {
match (&lhs.sty, &rhs.sty) { match (&lhs.sty, &rhs.sty) {
(ty::Ref(_, t1, _), ty::Ref(_, t2, _)) => match_borrow_depth(&t1, &t2), (ty::Ref(_, t1, _), ty::Ref(_, t2, _)) => match_borrow_depth(&t1, &t2),
(l, r) => match (l, r) { (l, r) => match (l, r) {
@ -157,7 +157,7 @@ fn match_borrow_depth(lhs: &ty::Ty<'_>, rhs: &ty::Ty<'_>) -> bool {
} }
} }
fn match_types(lhs: &ty::Ty<'_>, rhs: &ty::Ty<'_>) -> bool { fn match_types(lhs: ty::Ty<'_>, rhs: ty::Ty<'_>) -> bool {
match (&lhs.sty, &rhs.sty) { match (&lhs.sty, &rhs.sty) {
(ty::Bool, ty::Bool) (ty::Bool, ty::Bool)
| (ty::Char, ty::Char) | (ty::Char, ty::Char)
@ -172,7 +172,7 @@ fn match_types(lhs: &ty::Ty<'_>, rhs: &ty::Ty<'_>) -> bool {
} }
} }
fn get_type_name(cx: &LateContext<'_, '_>, ty: &ty::Ty<'_>) -> String { fn get_type_name(cx: &LateContext<'_, '_>, ty: ty::Ty<'_>) -> String {
match ty.sty { match ty.sty {
ty::Adt(t, _) => cx.tcx.def_path_str(t.did), ty::Adt(t, _) => cx.tcx.def_path_str(t.did),
ty::Ref(_, r, _) => get_type_name(cx, &r), ty::Ref(_, r, _) => get_type_name(cx, &r),

View File

@ -104,6 +104,7 @@ pub struct AbsolutePathPrinter<'a, 'tcx> {
use rustc::ty::print::Printer; use rustc::ty::print::Printer;
#[allow(clippy::diverging_sub_expression)]
impl<'tcx> Printer<'tcx, 'tcx> for AbsolutePathPrinter<'_, 'tcx> { impl<'tcx> Printer<'tcx, 'tcx> for AbsolutePathPrinter<'_, 'tcx> {
type Error = !; type Error = !;