File tree 3 files changed +40
-1
lines changed
3 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -977,7 +977,13 @@ impl<'a, 'tcx> CrateMetadata {
977
977
}
978
978
979
979
pub fn get_trait_of_item ( & self , id : DefIndex ) -> Option < DefId > {
980
- self . def_key ( id) . parent . and_then ( |parent_index| {
980
+ let def_key = self . def_key ( id) ;
981
+ match def_key. disambiguated_data . data {
982
+ DefPathData :: TypeNs ( ..) | DefPathData :: ValueNs ( ..) => ( ) ,
983
+ // Not an associated item
984
+ _ => return None ,
985
+ }
986
+ def_key. parent . and_then ( |parent_index| {
981
987
match self . entry ( parent_index) . kind {
982
988
EntryKind :: Trait ( _) => Some ( self . local_def_id ( parent_index) ) ,
983
989
_ => None ,
Original file line number Diff line number Diff line change
1
+ // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ #![ crate_type = "lib" ]
12
+ #![ crate_name = "issue48984aux" ]
13
+
14
+ pub trait Foo { type Item ; }
15
+
16
+ pub trait Bar : Foo < Item =[ u8 ; 1 ] > { }
Original file line number Diff line number Diff line change
1
+ // Copyright 2018 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ // aux-build:issue-48984-aux.rs
12
+ extern crate issue48984aux;
13
+ use issue48984aux:: Bar ;
14
+
15
+ fn do_thing < T : Bar > ( ) { }
16
+
17
+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments