@@ -879,7 +879,7 @@ impl<'a> LoweringContext<'a> {
879879 TyKind :: Slice ( ref ty) => hir:: TySlice ( self . lower_ty ( ty, itctx) ) ,
880880 TyKind :: Ptr ( ref mt) => hir:: TyPtr ( self . lower_mt ( mt, itctx) ) ,
881881 TyKind :: Rptr ( ref region, ref mt) => {
882- let span = t. span . with_hi ( t . span . lo ( ) ) ;
882+ let span = t. span . shrink_to_lo ( ) ;
883883 let lifetime = match * region {
884884 Some ( ref lt) => self . lower_lifetime ( lt) ,
885885 None => self . elided_lifetime ( span)
@@ -1355,17 +1355,11 @@ impl<'a> LoweringContext<'a> {
13551355 id : NodeId ,
13561356 p : & Path ,
13571357 name : Option < Name > ,
1358- param_mode : ParamMode ,
1359- defaults_to_global : bool )
1358+ param_mode : ParamMode )
13601359 -> hir:: Path {
1361- let mut segments = p. segments . iter ( ) ;
1362- if defaults_to_global && p. is_global ( ) {
1363- segments. next ( ) ;
1364- }
1365-
13661360 hir:: Path {
13671361 def : self . expect_full_def ( id) ,
1368- segments : segments. map ( |segment| {
1362+ segments : p . segments . iter ( ) . map ( |segment| {
13691363 self . lower_path_segment ( p. span , segment, param_mode, 0 ,
13701364 ParenthesizedGenericArgs :: Err ,
13711365 ImplTraitContext :: Disallowed )
@@ -1378,10 +1372,9 @@ impl<'a> LoweringContext<'a> {
13781372 fn lower_path ( & mut self ,
13791373 id : NodeId ,
13801374 p : & Path ,
1381- param_mode : ParamMode ,
1382- defaults_to_global : bool )
1375+ param_mode : ParamMode )
13831376 -> 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)
13851378 }
13861379
13871380 fn lower_path_segment ( & mut self ,
@@ -1904,7 +1897,7 @@ impl<'a> LoweringContext<'a> {
19041897 i : & ItemKind )
19051898 -> hir:: Item_ {
19061899 match * i {
1907- ItemKind :: ExternCrate ( string ) => hir:: ItemExternCrate ( string ) ,
1900+ ItemKind :: ExternCrate ( orig_name ) => hir:: ItemExternCrate ( orig_name ) ,
19081901 ItemKind :: Use ( ref use_tree) => {
19091902 // Start with an empty prefix
19101903 let prefix = Path {
@@ -2047,8 +2040,8 @@ impl<'a> LoweringContext<'a> {
20472040 let path = & tree. prefix ;
20482041
20492042 match tree. kind {
2050- UseTreeKind :: Simple ( ident ) => {
2051- * name = ident. name ;
2043+ UseTreeKind :: Simple ( rename ) => {
2044+ * name = tree . ident ( ) . name ;
20522045
20532046 // First apply the prefix to the path
20542047 let mut path = Path {
@@ -2064,12 +2057,12 @@ impl<'a> LoweringContext<'a> {
20642057 if path. segments . len ( ) > 1 &&
20652058 path. segments . last ( ) . unwrap ( ) . identifier . name == keywords:: SelfValue . name ( ) {
20662059 let _ = path. segments . pop ( ) ;
2067- if ident . name == keywords :: SelfValue . name ( ) {
2060+ if rename . is_none ( ) {
20682061 * name = path. segments . last ( ) . unwrap ( ) . identifier . name ;
20692062 }
20702063 }
20712064
2072- let path = P ( self . lower_path ( id, & path, ParamMode :: Explicit , true ) ) ;
2065+ let path = P ( self . lower_path ( id, & path, ParamMode :: Explicit ) ) ;
20732066 hir:: ItemUse ( path, hir:: UseKind :: Single )
20742067 }
20752068 UseTreeKind :: Glob => {
@@ -2080,7 +2073,7 @@ impl<'a> LoweringContext<'a> {
20802073 . cloned ( )
20812074 . collect ( ) ,
20822075 span : path. span ,
2083- } , ParamMode :: Explicit , true ) ) ;
2076+ } , ParamMode :: Explicit ) ) ;
20842077 hir:: ItemUse ( path, hir:: UseKind :: Glob )
20852078 }
20862079 UseTreeKind :: Nested ( ref trees) => {
@@ -2136,7 +2129,7 @@ impl<'a> LoweringContext<'a> {
21362129 // Privatize the degenerate import base, used only to check
21372130 // the stability of `use a::{};`, to avoid it showing up as
21382131 // 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 ) ) ;
21402133 * vis = hir:: Inherited ;
21412134 hir:: ItemUse ( path, hir:: UseKind :: ListStem )
21422135 }
@@ -3379,7 +3372,7 @@ impl<'a> LoweringContext<'a> {
33793372 VisibilityKind :: Crate ( ..) => hir:: Visibility :: Crate ,
33803373 VisibilityKind :: Restricted { ref path, id, .. } => {
33813374 hir:: Visibility :: Restricted {
3382- path : P ( self . lower_path ( id, path, ParamMode :: Explicit , true ) ) ,
3375+ path : P ( self . lower_path ( id, path, ParamMode :: Explicit ) ) ,
33833376 id : if let Some ( owner) = explicit_owner {
33843377 self . lower_node_id_with_owner ( id, owner) . node_id
33853378 } else {
0 commit comments