parent
fd88e2b729
commit
aef1a9c57b
@ -555,17 +555,13 @@ impl<'a> LookupContext<'a> {
|
||||
param_ty: param_ty) {
|
||||
debug!("push_inherent_candidates_from_param(param_ty={:?})",
|
||||
param_ty);
|
||||
self.push_inherent_candidates_from_bounds(
|
||||
rcvr_ty,
|
||||
self.fcx
|
||||
.inh
|
||||
.param_env
|
||||
.type_param_bounds
|
||||
.get(param_ty.idx)
|
||||
.trait_bounds
|
||||
.as_slice(),
|
||||
restrict_to,
|
||||
param_numbered(param_ty.idx));
|
||||
let i = param_ty.idx;
|
||||
match self.fcx.inh.param_env.type_param_bounds.as_slice().get(i) {
|
||||
Some(b) => self.push_inherent_candidates_from_bounds(
|
||||
rcvr_ty, b.trait_bounds.as_slice(), restrict_to,
|
||||
param_numbered(param_ty.idx)),
|
||||
None => {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
22
src/test/compile-fail/issue-7092.rs
Normal file
22
src/test/compile-fail/issue-7092.rs
Normal file
@ -0,0 +1,22 @@
|
||||
// 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.
|
||||
|
||||
enum Whatever {
|
||||
}
|
||||
|
||||
fn foo(x: Whatever) {
|
||||
match x {
|
||||
Some(field) => field.access(),
|
||||
//~^ ERROR: mismatched types: expected `Whatever` but found
|
||||
//~^^ ERROR: does not implement any method in scope named `access`
|
||||
}
|
||||
}
|
||||
|
||||
fn main(){}
|
Loading…
Reference in New Issue
Block a user