@@ -498,7 +498,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
498
498
_ => Err ( Determinacy :: Determined ) ,
499
499
} ,
500
500
Scope :: CrateRoot => {
501
- let root_ident = Ident :: new ( kw :: PathRoot , ident. span ) ;
501
+ let root_ident = Ident :: new ( sym :: path_root , ident. span ) ;
502
502
let root_module = this. resolve_crate_root ( root_ident) ;
503
503
let binding = this. resolve_ident_in_module (
504
504
ModuleOrUniformRoot :: Module ( root_module) ,
@@ -1485,19 +1485,19 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
1485
1485
module = Some ( ModuleOrUniformRoot :: Module ( self_mod) ) ;
1486
1486
continue ;
1487
1487
}
1488
- if name == kw :: PathRoot && ident. span . at_least_rust_2018 ( ) {
1488
+ if name == sym :: path_root && ident. span . at_least_rust_2018 ( ) {
1489
1489
module = Some ( ModuleOrUniformRoot :: ExternPrelude ) ;
1490
1490
continue ;
1491
1491
}
1492
- if name == kw :: PathRoot
1492
+ if name == sym :: path_root
1493
1493
&& ident. span . is_rust_2015 ( )
1494
1494
&& self . tcx . sess . at_least_rust_2018 ( )
1495
1495
{
1496
1496
// `::a::b` from 2015 macro on 2018 global edition
1497
1497
module = Some ( ModuleOrUniformRoot :: CrateRootAndExternPrelude ) ;
1498
1498
continue ;
1499
1499
}
1500
- if name == kw :: PathRoot || name == kw:: Crate || name == kw:: DollarCrate {
1500
+ if name == sym :: path_root || name == kw:: Crate || name == kw:: DollarCrate {
1501
1501
// `::a::b`, `crate::a::b` or `$crate::a::b`
1502
1502
let crate_root = self . resolve_crate_root ( ident) ;
1503
1503
if let Some ( res) = crate_root. res ( ) {
@@ -1512,12 +1512,12 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
1512
1512
// Report special messages for path segment keywords in wrong positions.
1513
1513
if ident. is_path_segment_keyword ( ) && segment_idx != 0 {
1514
1514
return PathResult :: failed ( ident, false , finalize. is_some ( ) , module, || {
1515
- let name_str = if name == kw :: PathRoot {
1515
+ let name_str = if name == sym :: path_root {
1516
1516
"crate root" . to_string ( )
1517
1517
} else {
1518
1518
format ! ( "`{name}`" )
1519
1519
} ;
1520
- let label = if segment_idx == 1 && path[ 0 ] . ident . name == kw :: PathRoot {
1520
+ let label = if segment_idx == 1 && path[ 0 ] . ident . name == sym :: path_root {
1521
1521
format ! ( "global paths cannot start with {name_str}" )
1522
1522
} else {
1523
1523
format ! ( "{name_str} in paths can only be used in start position" )
0 commit comments