mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 15:01:51 +00:00
Rustup to rustc 1.13.0-nightly (a23064af5
2016-08-27)
This commit is contained in:
parent
e338f6a4f0
commit
189c5e5cfc
@ -107,7 +107,7 @@ fn check_hash_peq<'a, 'tcx: 'a>(cx: &LateContext<'a, 'tcx>, span: Span, trait_re
|
||||
|
||||
// Only care about `impl PartialEq<Foo> for Foo`
|
||||
// For `impl PartialEq<B> for A, input_types is [A, B]
|
||||
if trait_ref.input_types()[1] == ty {
|
||||
if trait_ref.substs.type_at(1) == ty {
|
||||
let mess = if peq_is_automatically_derived {
|
||||
"you are implementing `Hash` explicitly but have derived `PartialEq`"
|
||||
} else {
|
||||
|
@ -144,7 +144,7 @@ impl<'a, 'tcx: 'a+'gcx, 'gcx: 'a> Delegate<'tcx> for EscapeDelegate<'a, 'tcx, 'g
|
||||
}
|
||||
|
||||
}
|
||||
fn borrow(&mut self, borrow_id: NodeId, _: Span, cmt: cmt<'tcx>, _: ty::Region, _: ty::BorrowKind,
|
||||
fn borrow(&mut self, borrow_id: NodeId, _: Span, cmt: cmt<'tcx>, _: &ty::Region, _: ty::BorrowKind,
|
||||
loan_cause: LoanCause) {
|
||||
|
||||
if let Categorization::Local(lid) = cmt.cat {
|
||||
|
@ -1083,12 +1083,12 @@ fn get_error_type<'a>(cx: &LateContext, ty: ty::Ty<'a>) -> Option<ty::Ty<'a>> {
|
||||
if !match_type(cx, ty, &paths::RESULT) {
|
||||
return None;
|
||||
}
|
||||
|
||||
if let ty::TyEnum(_, substs) = ty.sty {
|
||||
if let Some(err_ty) = substs.types.get(1) {
|
||||
return Some(err_ty);
|
||||
}
|
||||
substs.types().nth(1)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
None
|
||||
}
|
||||
|
||||
/// This checks whether a given type is known to implement Debug.
|
||||
|
@ -59,7 +59,7 @@ impl LateLintPass for MutexAtomic {
|
||||
let ty = cx.tcx.expr_ty(expr);
|
||||
if let ty::TyStruct(_, subst) = ty.sty {
|
||||
if match_type(cx, ty, &paths::MUTEX) {
|
||||
let mutex_param = &subst.types[0].sty;
|
||||
let mutex_param = &subst.type_at(0).sty;
|
||||
if let Some(atomic_name) = get_atomic_name(mutex_param) {
|
||||
let msg = format!("Consider using an {} instead of a Mutex here. If you just want the locking \
|
||||
behaviour and not the internal type, consider using Mutex<()>.",
|
||||
|
@ -279,7 +279,7 @@ pub fn implements_trait<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: ty::Ty<'tcx>,
|
||||
trait_id,
|
||||
0,
|
||||
ty,
|
||||
ty_params);
|
||||
&ty_params);
|
||||
|
||||
traits::SelectionContext::new(&infcx).evaluate_obligation_conservatively(&obligation)
|
||||
})
|
||||
|
@ -89,7 +89,7 @@ fn check_vec_macro(cx: &LateContext, vec_args: &higher::VecArgs, span: Span) {
|
||||
/// Return the item type of the vector (ie. the `T` in `Vec<T>`).
|
||||
fn vec_type(ty: ty::Ty) -> ty::Ty {
|
||||
if let ty::TyStruct(_, substs) = ty.sty {
|
||||
substs.types[0]
|
||||
substs.type_at(0)
|
||||
} else {
|
||||
panic!("The type of `vec!` is a not a struct?");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user