Skip to content

Commit 6ee60cc

Browse files
committed
---
yaml --- r: 161487 b: refs/heads/snap-stage3 c: adda9c1 h: refs/heads/master i: 161485: f2667c4 161483: da0bd79 161479: b506dbd 161471: a3d9f69 v: v3
1 parent 417c825 commit 6ee60cc

File tree

3 files changed

+2
-44
lines changed

3 files changed

+2
-44
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 4eb72d268f337a8f117c86a2ac1b98336cab9e9d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: db75f8aa91a8757725a84db2345236f887b2ffec
4+
refs/heads/snap-stage3: adda9c152096459bd9925114e7c742619939ac49
55
refs/heads/try: 0f0d21c1eb5c7be04d323e0b06faf252ad790af6
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/src/librustc/lint/builtin.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,7 @@ use self::MethodContext::*;
2828

2929
use metadata::csearch;
3030
use middle::def::*;
31-
use middle::infer;
3231
use middle::ty::{mod, Ty};
33-
use middle::typeck::astconv::ast_ty_to_ty;
3432
use middle::{def, pat_util, stability};
3533
use middle::const_eval::{eval_const_expr_partial, const_int, const_uint};
3634
use util::ppaux::{ty_to_string};
@@ -84,7 +82,7 @@ impl LintPass for UnusedCasts {
8482

8583
fn check_expr(&mut self, cx: &Context, e: &ast::Expr) {
8684
if let ast::ExprCast(ref expr, ref ty) = e.node {
87-
let t_t = ast_ty_to_ty(cx, &infer::new_infer_ctxt(cx.tcx), &**ty);
85+
let t_t = ty::expr_ty(cx.tcx, e);
8886
if ty::expr_ty(cx.tcx, &**expr) == t_t {
8987
cx.span_lint(UNUSED_TYPECASTS, ty.span, "unnecessary type cast");
9088
}

branches/snap-stage3/src/librustc/lint/context.rs

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,14 @@
2525
//! for all lint attributes.
2626
use self::TargetLint::*;
2727

28-
use middle::infer;
2928
use middle::privacy::ExportedItems;
30-
use middle::subst;
3129
use middle::ty::{mod, Ty};
32-
use middle::typeck::astconv::AstConv;
3330
use session::{early_error, Session};
3431
use lint::{Level, LevelSource, Lint, LintId, LintArray, LintPass, LintPassObject};
3532
use lint::{Default, CommandLine, Node, Allow, Warn, Deny, Forbid};
3633
use lint::builtin;
3734
use util::nodemap::FnvHashMap;
3835

39-
use std::rc::Rc;
4036
use std::cell::RefCell;
4137
use std::tuple::Tuple2;
4238
use std::mem;
@@ -541,42 +537,6 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
541537
}
542538
}
543539

544-
impl<'a, 'tcx> AstConv<'tcx> for Context<'a, 'tcx>{
545-
fn tcx<'a>(&'a self) -> &'a ty::ctxt<'tcx> { self.tcx }
546-
547-
fn get_item_ty(&self, id: ast::DefId) -> ty::Polytype<'tcx> {
548-
ty::lookup_item_type(self.tcx, id)
549-
}
550-
551-
fn get_trait_def(&self, id: ast::DefId) -> Rc<ty::TraitDef<'tcx>> {
552-
ty::lookup_trait_def(self.tcx, id)
553-
}
554-
555-
fn ty_infer(&self, _span: Span) -> Ty<'tcx> {
556-
infer::new_infer_ctxt(self.tcx).next_ty_var()
557-
}
558-
559-
fn associated_types_of_trait_are_valid(&self, _: Ty<'tcx>, _: ast::DefId)
560-
-> bool {
561-
// FIXME(pcwalton): This is wrong.
562-
true
563-
}
564-
565-
fn associated_type_binding(&self,
566-
_: Span,
567-
_: Option<Ty<'tcx>>,
568-
trait_id: ast::DefId,
569-
associated_type_id: ast::DefId)
570-
-> Ty<'tcx> {
571-
// FIXME(pcwalton): This is wrong.
572-
let trait_def = self.get_trait_def(trait_id);
573-
let index = ty::associated_type_parameter_index(self.tcx,
574-
&*trait_def,
575-
associated_type_id);
576-
ty::mk_param(self.tcx, subst::TypeSpace, index, associated_type_id)
577-
}
578-
}
579-
580540
impl<'a, 'tcx, 'v> Visitor<'v> for Context<'a, 'tcx> {
581541
fn visit_item(&mut self, it: &ast::Item) {
582542
self.with_lint_attrs(it.attrs.as_slice(), |cx| {

0 commit comments

Comments
 (0)