diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-06-16 13:45:48 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2023-06-16 13:47:42 +0000 |
| commit | 73c5c97de793c7202bcb0a3eb822c928309c14e5 (patch) | |
| tree | 305945cd3381e009e11e75d7cf052d2f877eba4c /compiler/rustc_expand/src | |
| parent | 99b334696fffe8c08d2e6a978862849d5a89f875 (diff) | |
| download | rust-73c5c97de793c7202bcb0a3eb822c928309c14e5.tar.gz rust-73c5c97de793c7202bcb0a3eb822c928309c14e5.zip | |
Add `SyntaxContext::is_root`
Diffstat (limited to 'compiler/rustc_expand/src')
| -rw-r--r-- | compiler/rustc_expand/src/mbe/quoted.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_expand/src/mbe/quoted.rs b/compiler/rustc_expand/src/mbe/quoted.rs index b2bdf9c7e6d..40bfa3715be 100644 --- a/compiler/rustc_expand/src/mbe/quoted.rs +++ b/compiler/rustc_expand/src/mbe/quoted.rs @@ -9,7 +9,7 @@ use rustc_session::parse::{feature_err, ParseSess}; use rustc_span::symbol::{kw, sym, Ident}; use rustc_span::edition::Edition; -use rustc_span::{Span, SyntaxContext}; +use rustc_span::Span; const VALID_FRAGMENT_NAMES_MSG: &str = "valid fragment specifiers are \ `ident`, `block`, `stmt`, `expr`, `pat`, `ty`, `lifetime`, \ @@ -72,7 +72,7 @@ pub(super) fn parse( // `SyntaxContext::root()` from a foreign crate will // have the edition of that crate (which we manually // retrieve via the `edition` parameter). - if span.ctxt() == SyntaxContext::root() { + if span.ctxt().is_root() { edition } else { span.edition() |
