@@ -768,15 +768,13 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
768
768
& mut self ,
769
769
path : & [ Segment ] ,
770
770
opt_ns : Option < Namespace > , // `None` indicates a module path in import
771
- record_used : bool ,
772
771
path_span : Span ,
773
772
crate_lint : CrateLint ,
774
773
) -> PathResult < ' a > {
775
774
self . r . resolve_path_with_ribs (
776
775
path,
777
776
opt_ns,
778
777
& self . parent_scope ,
779
- record_used,
780
778
path_span,
781
779
crate_lint,
782
780
Some ( & self . ribs ) ,
@@ -1253,18 +1251,9 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
1253
1251
PathSource :: Trait ( AliasPossibility :: No ) ,
1254
1252
CrateLint :: SimplePath ( trait_ref. ref_id ) ,
1255
1253
) ;
1256
- let res = res. base_res ( ) ;
1257
- if res != Res :: Err {
1258
- if let PathResult :: Module ( ModuleOrUniformRoot :: Module ( module) ) = self . resolve_path (
1259
- & path,
1260
- Some ( TypeNS ) ,
1261
- true ,
1262
- trait_ref. path . span ,
1263
- CrateLint :: SimplePath ( trait_ref. ref_id ) ,
1264
- ) {
1265
- new_id = Some ( res. def_id ( ) ) ;
1266
- new_val = Some ( ( module, trait_ref. clone ( ) ) ) ;
1267
- }
1254
+ if let Some ( def_id) = res. base_res ( ) . opt_def_id ( ) {
1255
+ new_id = Some ( def_id) ;
1256
+ new_val = Some ( ( self . r . expect_module ( def_id) , trait_ref. clone ( ) ) ) ;
1268
1257
}
1269
1258
}
1270
1259
let original_trait_ref = replace ( & mut self . current_trait_ref , new_val) ;
@@ -2026,6 +2015,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
2026
2015
None
2027
2016
} ;
2028
2017
2018
+ assert_ne ! ( crate_lint, CrateLint :: No ) ;
2029
2019
let partial_res = match self . resolve_qpath_anywhere (
2030
2020
id,
2031
2021
qself,
@@ -2060,7 +2050,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
2060
2050
std_path. push ( Segment :: from_ident ( Ident :: with_dummy_span ( sym:: std) ) ) ;
2061
2051
std_path. extend ( path) ;
2062
2052
if let PathResult :: Module ( _) | PathResult :: NonModule ( _) =
2063
- self . resolve_path ( & std_path, Some ( ns) , false , span, CrateLint :: No )
2053
+ self . resolve_path ( & std_path, Some ( ns) , span, CrateLint :: No )
2064
2054
{
2065
2055
// Check if we wrote `str::from_utf8` instead of `std::str::from_utf8`
2066
2056
let item_span =
@@ -2228,7 +2218,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
2228
2218
) ) ) ;
2229
2219
}
2230
2220
2231
- let result = match self . resolve_path ( & path, Some ( ns) , true , span, crate_lint) {
2221
+ let result = match self . resolve_path ( & path, Some ( ns) , span, crate_lint) {
2232
2222
PathResult :: NonModule ( path_res) => path_res,
2233
2223
PathResult :: Module ( ModuleOrUniformRoot :: Module ( module) ) if !module. is_normal ( ) => {
2234
2224
PartialRes :: new ( module. res ( ) . unwrap ( ) )
@@ -2268,13 +2258,7 @@ impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> {
2268
2258
&& path[ 0 ] . ident . name != kw:: DollarCrate
2269
2259
{
2270
2260
let unqualified_result = {
2271
- match self . resolve_path (
2272
- & [ * path. last ( ) . unwrap ( ) ] ,
2273
- Some ( ns) ,
2274
- false ,
2275
- span,
2276
- CrateLint :: No ,
2277
- ) {
2261
+ match self . resolve_path ( & [ * path. last ( ) . unwrap ( ) ] , Some ( ns) , span, CrateLint :: No ) {
2278
2262
PathResult :: NonModule ( path_res) => path_res. base_res ( ) ,
2279
2263
PathResult :: Module ( ModuleOrUniformRoot :: Module ( module) ) => {
2280
2264
module. res ( ) . unwrap ( )
0 commit comments