Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "clippy"
version = "0.0.53"
version = "0.0.54"
authors = [
"Manish Goregaokar <[email protected]>",
"Andre Bogus <[email protected]>",
3 changes: 2 additions & 1 deletion src/escape.rs
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ use rustc::lint::*;
use rustc::middle::expr_use_visitor::*;
use rustc::middle::infer;
use rustc::middle::mem_categorization::{cmt, Categorization};
use rustc::middle::traits::ProjectionMode;
use rustc::middle::ty::adjustment::AutoAdjustment;
use rustc::middle::ty;
use rustc::util::nodemap::NodeSet;
@@ -54,7 +55,7 @@ impl LintPass for EscapePass {
impl LateLintPass for EscapePass {
fn check_fn(&mut self, cx: &LateContext, _: visit::FnKind, decl: &FnDecl, body: &Block, _: Span, id: NodeId) {
let param_env = ty::ParameterEnvironment::for_item(cx.tcx, id);
let infcx = infer::new_infer_ctxt(cx.tcx, &cx.tcx.tables, Some(param_env));
let infcx = infer::new_infer_ctxt(cx.tcx, &cx.tcx.tables, Some(param_env), ProjectionMode::Any);
let mut v = EscapeDelegate {
cx: cx,
set: NodeSet(),
5 changes: 3 additions & 2 deletions src/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ use reexport::*;
use rustc::front::map::Node;
use rustc::lint::{LintContext, LateContext, Level, Lint};
use rustc::middle::def_id::DefId;
use rustc::middle::traits::ProjectionMode;
use rustc::middle::{cstore, def, infer, ty, traits};
use rustc::session::Session;
use rustc_front::hir::*;
@@ -269,7 +270,7 @@ pub fn implements_trait<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: ty::Ty<'tcx>,
-> bool {
cx.tcx.populate_implementations_for_trait_if_necessary(trait_id);

let infcx = infer::new_infer_ctxt(cx.tcx, &cx.tcx.tables, None);
let infcx = infer::new_infer_ctxt(cx.tcx, &cx.tcx.tables, None, ProjectionMode::Any);
let obligation = traits::predicate_for_trait_def(cx.tcx,
traits::ObligationCause::dummy(),
trait_id,
@@ -753,6 +754,6 @@ pub fn return_ty(fun: ty::Ty) -> Option<ty::Ty> {
// FIXME: this works correctly for lifetimes bounds (`for <'a> Foo<'a>` == `for <'b> Foo<'b>` but
// not for type parameters.
pub fn same_tys<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, a: ty::Ty<'tcx>, b: ty::Ty<'tcx>) -> bool {
let infcx = infer::new_infer_ctxt(cx.tcx, &cx.tcx.tables, None);
let infcx = infer::new_infer_ctxt(cx.tcx, &cx.tcx.tables, None, ProjectionMode::Any);
infcx.can_equate(&cx.tcx.erase_regions(&a), &cx.tcx.erase_regions(&b)).is_ok()
}
1 change: 1 addition & 0 deletions tests/compile-fail/derive.rs
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@

#![deny(warnings)]
#![allow(dead_code)]
#![allow(unused_variables)] // Temporary fix for rustc false positive. To be removed.

use std::hash::{Hash, Hasher};