diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-11-29 18:42:40 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2022-11-29 18:42:40 +1100 |
| commit | d1b61a31c5d28075f7c5a7f376315350672e2d93 (patch) | |
| tree | 80d33b474309b32e3b82ba42ae51144b6b9dce99 /compiler/rustc_ast/src/util | |
| parent | ac7a7499df4c21de001475d8acf8bf43ee46498d (diff) | |
| download | rust-d1b61a31c5d28075f7c5a7f376315350672e2d93.tar.gz rust-d1b61a31c5d28075f7c5a7f376315350672e2d93.zip | |
Inline and remove `MetaItemLit::from_lit_kind`.
It has a single call site.
Diffstat (limited to 'compiler/rustc_ast/src/util')
| -rw-r--r-- | compiler/rustc_ast/src/util/literal.rs | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/compiler/rustc_ast/src/util/literal.rs b/compiler/rustc_ast/src/util/literal.rs index 42cba07fcef..14ee4d48120 100644 --- a/compiler/rustc_ast/src/util/literal.rs +++ b/compiler/rustc_ast/src/util/literal.rs @@ -207,13 +207,6 @@ impl MetaItemLit { .and_then(|token_lit| MetaItemLit::from_token_lit(token_lit, token.span).ok()) } - /// Attempts to create a meta item literal from a `LitKind`. - /// This function is used when the original token doesn't exist (e.g. the literal is created - /// by an AST-based macro) or unavailable (e.g. from HIR pretty-printing). - pub fn from_lit_kind(kind: LitKind, span: Span) -> MetaItemLit { - MetaItemLit { token_lit: kind.to_token_lit(), kind, span } - } - /// Losslessly convert a meta item literal into a token. pub fn to_token(&self) -> Token { let kind = match self.token_lit.kind { |
