// it ride, although it's really not great, and in fact could I
// think cause spurious errors. Really though this part should
// take place in the `fcx.infcx().probe` below.
- let steps = create_steps(fcx, span, self_ty);
+ let steps = match create_steps(fcx, span, self_ty) {
+ Some(steps) => steps,
+ None => return Err(NoMatch(Vec::new())),
+ };
// Create a list of simplified self types, if we can.
let mut simplified_steps = Vec::new();
fn create_steps<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
span: Span,
self_ty: Ty<'tcx>)
- -> Vec<CandidateStep<'tcx>> {
+ -> Option<Vec<CandidateStep<'tcx>>> {
let mut steps = Vec::new();
let (fully_dereferenced_ty, dereferences, _) =
adjustment: AutoUnsizeLength(dereferences, len),
});
}
- _ => {
- }
+ ty::ty_err => return None,
+ _ => (),
}
- return steps;
+ Some(steps)
}
impl<'a,'tcx> ProbeContext<'a,'tcx> {
--- /dev/null
+// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+struct Homura;
+
+fn akemi(homura: Homura) {
+ let Some(ref madoka) = Some(homura.kaname()); //~ ERROR does not implement any method
+ madoka.clone(); //~ ERROR the type of this value must be known
+}
+
+fn main() { }