Skip to content

Commit

Permalink
Handle some FIXMEs before rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisvittal committed Nov 4, 2017
1 parent 906a83d commit ec5623c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
11 changes: 1 addition & 10 deletions src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -871,15 +871,7 @@ impl<'a> LoweringContext<'a> {
n
});
self.lower_path_segment(p.span, segment, param_mode, num_lifetimes,
parenthesized_generic_args,
// FIXME(cvittal): changing this currently causes tests
// run-pass/impl-trait/xcrate.rs and
// run-pass/impl-trait/example-calendar.rs to fail.
// Probably need to tighten this up.
// NOTE 2017-10-29, this also causes the test
// compile-fail/impl-trait/disallowed.rs to not emit a
// required error
itctx)
parenthesized_generic_args, itctx)
}).collect(),
span: p.span,
});
Expand Down Expand Up @@ -1146,7 +1138,6 @@ impl<'a> LoweringContext<'a> {
}

let itctx = ImplTraitContext::Universal(self.resolver.definitions().local_def_id(tp.id));
// FIXME(cdv) UNIVERSAL
let mut bounds = self.lower_bounds(&tp.bounds, itctx);
if !add_bounds.is_empty() {
bounds = bounds.into_iter().chain(
Expand Down
12 changes: 4 additions & 8 deletions src/librustc_typeck/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -898,8 +898,7 @@ fn generics_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
let mut allow_defaults = false;

let no_generics = hir::Generics::empty();
// FIXME Rename this
let (ast_generics, fake_defs) = match node {
let (ast_generics, opt_inputs) = match node {
NodeTraitItem(item) => {
match item.node {
TraitItemKind::Method(ref sig, _) => (&sig.generics, Some(&sig.decl.inputs)),
Expand Down Expand Up @@ -1019,7 +1018,7 @@ fn generics_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,

let mut it_tys = ImplTraitUniversalVisitor { items: Vec::new() };

fake_defs.map(|it| {
opt_inputs.map(|it| {
for t in it.iter() {
it_tys.visit_ty(t);
}
Expand Down Expand Up @@ -1399,8 +1398,7 @@ fn explicit_predicates_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,

let icx = ItemCtxt::new(tcx, def_id);
let no_generics = hir::Generics::empty();
// FIXME Better name
let (ast_generics, fake_defs) = match node {
let (ast_generics, opt_inputs) = match node {
NodeTraitItem(item) => {
match item.node {
TraitItemKind::Method(ref sig, _) => (&sig.generics, Some(&sig.decl.inputs)),
Expand Down Expand Up @@ -1591,10 +1589,8 @@ fn explicit_predicates_of<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
}))
}

// Add predicates from argument position impl trait
// FIXME: Is this correct?
let mut it_tys = ImplTraitUniversalVisitor { items: Vec::new() };
fake_defs.map(|it| {
opt_inputs.map(|it| {
for t in it.iter() {
it_tys.visit_ty(t);
}
Expand Down

0 comments on commit ec5623c

Please sign in to comment.