Rollup merge of #123462 - fmease:rn-mod-sep-to-path-sep, r=nnethercote
Cleanup: Rename `ModSep` to `PathSep` `::` is usually referred to as the *path separator* (citation needed). The existing name `ModSep` for *module separator* is a bit misleading since it in fact separates the segments of arbitrary path segments, not only ones resolving to modules. Let me just give a shout-out to associated items (`T::Assoc`, `<Ty as Trait>::function`) and enum variants (`Option::None`). Motivation: Reduce friction for new contributors, prevent potential confusion. cc `@petrochenkov` r? nnethercote or compiler
This commit is contained in:
commit
c5665990c5
13 changed files with 44 additions and 42 deletions
|
@ -109,7 +109,7 @@ macro_rules! maybe_recover_from_interpolated_ty_qpath {
|
|||
($self: expr, $allow_qpath_recovery: expr) => {
|
||||
if $allow_qpath_recovery
|
||||
&& $self.may_recover()
|
||||
&& $self.look_ahead(1, |t| t == &token::ModSep)
|
||||
&& $self.look_ahead(1, |t| t == &token::PathSep)
|
||||
&& let token::Interpolated(nt) = &$self.token.kind
|
||||
&& let token::NtTy(ty) = &nt.0
|
||||
{
|
||||
|
@ -1532,7 +1532,7 @@ impl<'a> Parser<'a> {
|
|||
|
||||
/// `::{` or `::*`
|
||||
fn is_import_coupler(&mut self) -> bool {
|
||||
self.check(&token::ModSep)
|
||||
self.check(&token::PathSep)
|
||||
&& self.look_ahead(1, |t| {
|
||||
*t == token::OpenDelim(Delimiter::Brace) || *t == token::BinOp(token::Star)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue