From 66057a7f7292c49eefae7cd386aa183201a49ca2 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sun, 30 Oct 2016 18:25:45 +0100 Subject: [PATCH] Fix invalid probe path --- src/librustc_typeck/check/method/probe.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/librustc_typeck/check/method/probe.rs b/src/librustc_typeck/check/method/probe.rs index 4a63c967920..cbd1345a57e 100644 --- a/src/librustc_typeck/check/method/probe.rs +++ b/src/librustc_typeck/check/method/probe.rs @@ -962,6 +962,12 @@ impl<'a, 'gcx, 'tcx> ProbeContext<'a, 'gcx, 'tcx> { for step in steps.iter() { match self.pick_step(step) { Some(Ok(mut elems)) => ret.append(&mut elems), + Some(Err(elem)) => { + match self.looking_for { + LookingFor::MethodName(_) => return Some(Err(elem)), + LookingFor::ReturnType(_) => {} + } + } _ => {} } }