@@ -1261,15 +1261,14 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
1261
1261
opt_ns : Option < Namespace > , // `None` indicates a module path in import
1262
1262
finalize : Option < Finalize > ,
1263
1263
) -> PathResult < ' a > {
1264
- let res = self . r . resolve_path_with_ribs (
1264
+ self . r . resolve_path_with_ribs (
1265
1265
path,
1266
1266
opt_ns,
1267
1267
& self . parent_scope ,
1268
1268
finalize,
1269
1269
Some ( & self . ribs ) ,
1270
1270
None ,
1271
- ) ;
1272
- res
1271
+ )
1273
1272
}
1274
1273
1275
1274
// AST resolution
@@ -3486,6 +3485,10 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
3486
3485
//
3487
3486
// Similar thing, for types, happens in `report_errors` above.
3488
3487
let report_errors_for_call = |this : & mut Self , parent_err : Spanned < ResolutionError < ' a > > | {
3488
+ if !source. is_call ( ) {
3489
+ return Some ( parent_err) ;
3490
+ }
3491
+
3489
3492
// Before we start looking for candidates, we have to get our hands
3490
3493
// on the type user is trying to perform invocation on; basically:
3491
3494
// we're transforming `HashMap::new` into just `HashMap`.
@@ -3726,6 +3729,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
3726
3729
"resolve_qpath(qself={:?}, path={:?}, ns={:?}, finalize={:?})" ,
3727
3730
qself, path, ns, finalize,
3728
3731
) ;
3732
+
3729
3733
if let Some ( qself) = qself {
3730
3734
if qself. position == 0 {
3731
3735
// This is a case like `<T>::B`, where there is no
0 commit comments