@@ -879,7 +879,7 @@ impl<'a> LoweringContext<'a> {
879
879
TyKind :: Slice ( ref ty) => hir:: TySlice ( self . lower_ty ( ty, itctx) ) ,
880
880
TyKind :: Ptr ( ref mt) => hir:: TyPtr ( self . lower_mt ( mt, itctx) ) ,
881
881
TyKind :: Rptr ( ref region, ref mt) => {
882
- let span = t. span . with_hi ( t . span . lo ( ) ) ;
882
+ let span = t. span . shrink_to_lo ( ) ;
883
883
let lifetime = match * region {
884
884
Some ( ref lt) => self . lower_lifetime ( lt) ,
885
885
None => self . elided_lifetime ( span)
@@ -1355,17 +1355,11 @@ impl<'a> LoweringContext<'a> {
1355
1355
id : NodeId ,
1356
1356
p : & Path ,
1357
1357
name : Option < Name > ,
1358
- param_mode : ParamMode ,
1359
- defaults_to_global : bool )
1358
+ param_mode : ParamMode )
1360
1359
-> hir:: Path {
1361
- let mut segments = p. segments . iter ( ) ;
1362
- if defaults_to_global && p. is_global ( ) {
1363
- segments. next ( ) ;
1364
- }
1365
-
1366
1360
hir:: Path {
1367
1361
def : self . expect_full_def ( id) ,
1368
- segments : segments. map ( |segment| {
1362
+ segments : p . segments . iter ( ) . map ( |segment| {
1369
1363
self . lower_path_segment ( p. span , segment, param_mode, 0 ,
1370
1364
ParenthesizedGenericArgs :: Err ,
1371
1365
ImplTraitContext :: Disallowed )
@@ -1378,10 +1372,9 @@ impl<'a> LoweringContext<'a> {
1378
1372
fn lower_path ( & mut self ,
1379
1373
id : NodeId ,
1380
1374
p : & Path ,
1381
- param_mode : ParamMode ,
1382
- defaults_to_global : bool )
1375
+ param_mode : ParamMode )
1383
1376
-> hir:: Path {
1384
- self . lower_path_extra ( id, p, None , param_mode, defaults_to_global )
1377
+ self . lower_path_extra ( id, p, None , param_mode)
1385
1378
}
1386
1379
1387
1380
fn lower_path_segment ( & mut self ,
@@ -1904,7 +1897,7 @@ impl<'a> LoweringContext<'a> {
1904
1897
i : & ItemKind )
1905
1898
-> hir:: Item_ {
1906
1899
match * i {
1907
- ItemKind :: ExternCrate ( string ) => hir:: ItemExternCrate ( string ) ,
1900
+ ItemKind :: ExternCrate ( orig_name ) => hir:: ItemExternCrate ( orig_name ) ,
1908
1901
ItemKind :: Use ( ref use_tree) => {
1909
1902
// Start with an empty prefix
1910
1903
let prefix = Path {
@@ -2047,8 +2040,8 @@ impl<'a> LoweringContext<'a> {
2047
2040
let path = & tree. prefix ;
2048
2041
2049
2042
match tree. kind {
2050
- UseTreeKind :: Simple ( ident ) => {
2051
- * name = ident. name ;
2043
+ UseTreeKind :: Simple ( rename ) => {
2044
+ * name = tree . ident ( ) . name ;
2052
2045
2053
2046
// First apply the prefix to the path
2054
2047
let mut path = Path {
@@ -2064,12 +2057,12 @@ impl<'a> LoweringContext<'a> {
2064
2057
if path. segments . len ( ) > 1 &&
2065
2058
path. segments . last ( ) . unwrap ( ) . identifier . name == keywords:: SelfValue . name ( ) {
2066
2059
let _ = path. segments . pop ( ) ;
2067
- if ident . name == keywords :: SelfValue . name ( ) {
2060
+ if rename . is_none ( ) {
2068
2061
* name = path. segments . last ( ) . unwrap ( ) . identifier . name ;
2069
2062
}
2070
2063
}
2071
2064
2072
- let path = P ( self . lower_path ( id, & path, ParamMode :: Explicit , true ) ) ;
2065
+ let path = P ( self . lower_path ( id, & path, ParamMode :: Explicit ) ) ;
2073
2066
hir:: ItemUse ( path, hir:: UseKind :: Single )
2074
2067
}
2075
2068
UseTreeKind :: Glob => {
@@ -2080,7 +2073,7 @@ impl<'a> LoweringContext<'a> {
2080
2073
. cloned ( )
2081
2074
. collect ( ) ,
2082
2075
span : path. span ,
2083
- } , ParamMode :: Explicit , true ) ) ;
2076
+ } , ParamMode :: Explicit ) ) ;
2084
2077
hir:: ItemUse ( path, hir:: UseKind :: Glob )
2085
2078
}
2086
2079
UseTreeKind :: Nested ( ref trees) => {
@@ -2136,7 +2129,7 @@ impl<'a> LoweringContext<'a> {
2136
2129
// Privatize the degenerate import base, used only to check
2137
2130
// the stability of `use a::{};`, to avoid it showing up as
2138
2131
// a re-export by accident when `pub`, e.g. in documentation.
2139
- let path = P ( self . lower_path ( id, & prefix, ParamMode :: Explicit , true ) ) ;
2132
+ let path = P ( self . lower_path ( id, & prefix, ParamMode :: Explicit ) ) ;
2140
2133
* vis = hir:: Inherited ;
2141
2134
hir:: ItemUse ( path, hir:: UseKind :: ListStem )
2142
2135
}
@@ -3379,7 +3372,7 @@ impl<'a> LoweringContext<'a> {
3379
3372
VisibilityKind :: Crate ( ..) => hir:: Visibility :: Crate ,
3380
3373
VisibilityKind :: Restricted { ref path, id, .. } => {
3381
3374
hir:: Visibility :: Restricted {
3382
- path : P ( self . lower_path ( id, path, ParamMode :: Explicit , true ) ) ,
3375
+ path : P ( self . lower_path ( id, path, ParamMode :: Explicit ) ) ,
3383
3376
id : if let Some ( owner) = explicit_owner {
3384
3377
self . lower_node_id_with_owner ( id, owner) . node_id
3385
3378
} else {
0 commit comments