|
25 | 25 | //! for all lint attributes.
|
26 | 26 | use self::TargetLint::*;
|
27 | 27 |
|
28 |
| -use middle::infer; |
29 | 28 | use middle::privacy::ExportedItems;
|
30 |
| -use middle::subst; |
31 | 29 | use middle::ty::{mod, Ty};
|
32 |
| -use middle::typeck::astconv::AstConv; |
33 | 30 | use session::{early_error, Session};
|
34 | 31 | use lint::{Level, LevelSource, Lint, LintId, LintArray, LintPass, LintPassObject};
|
35 | 32 | use lint::{Default, CommandLine, Node, Allow, Warn, Deny, Forbid};
|
36 | 33 | use lint::builtin;
|
37 | 34 | use util::nodemap::FnvHashMap;
|
38 | 35 |
|
39 |
| -use std::rc::Rc; |
40 | 36 | use std::cell::RefCell;
|
41 | 37 | use std::tuple::Tuple2;
|
42 | 38 | use std::mem;
|
@@ -541,42 +537,6 @@ impl<'a, 'tcx> Context<'a, 'tcx> {
|
541 | 537 | }
|
542 | 538 | }
|
543 | 539 |
|
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 |
| - |
580 | 540 | impl<'a, 'tcx, 'v> Visitor<'v> for Context<'a, 'tcx> {
|
581 | 541 | fn visit_item(&mut self, it: &ast::Item) {
|
582 | 542 | self.with_lint_attrs(it.attrs.as_slice(), |cx| {
|
|
0 commit comments