about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2016-10-30 18:25:45 +0100
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2016-12-20 11:37:15 +0100
commit66057a7f7292c49eefae7cd386aa183201a49ca2 (patch)
treef6b722456430856b00e143cbfb17029221a627c0 /src
parentc11fe553df269d6f47b4c48f5c47c08efdd373dc (diff)
downloadrust-66057a7f7292c49eefae7cd386aa183201a49ca2.tar.gz
rust-66057a7f7292c49eefae7cd386aa183201a49ca2.zip
Fix invalid probe path
Diffstat (limited to 'src')
-rw-r--r--src/librustc_typeck/check/method/probe.rs6
1 files changed, 6 insertions, 0 deletions
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(_) => {}
+                    }
+                }
                 _ => {}
             }
         }