diff options
| author | bors <bors@rust-lang.org> | 2019-05-23 01:50:55 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-05-23 01:50:55 +0000 |
| commit | 15ccaf77911d9261d0c254be8a3e878db84792c6 (patch) | |
| tree | e79e46b214341921d8bd56d2b302b84fff00f4df /src/librustc_codegen_ssa | |
| parent | 11f01bfb9f79b569aee6ac724eea59c7105a7f19 (diff) | |
| parent | a1885cdba38a63448ceec02f951ddc0844d0ff38 (diff) | |
| download | rust-15ccaf77911d9261d0c254be8a3e878db84792c6.tar.gz rust-15ccaf77911d9261d0c254be8a3e878db84792c6.zip | |
Auto merge of #60740 - petrochenkov:kw, r=nnethercote
Simplify use of keyword symbols They mirror non-keyword symbols now (see https://github.com/rust-lang/rust/pull/60630). `keywords::MyKeyword.name()` -> `kw::MyKeyword` `keywords::MyKeyword.ident()` -> `Ident::with_empty_ctxt(kw::MyKeyword)` (not common) `keywords::Invalid.ident()` -> `Ident::invalid()` (more common) Keywords are simply `Symbol` constants now, the `Keyword` struct is eliminated. This means `kw::MyKeyword` can now be used in `match` in particular.
Diffstat (limited to 'src/librustc_codegen_ssa')
| -rw-r--r-- | src/librustc_codegen_ssa/mir/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_codegen_ssa/mir/mod.rs b/src/librustc_codegen_ssa/mir/mod.rs index 060d7d18625..fed12c9a29f 100644 --- a/src/librustc_codegen_ssa/mir/mod.rs +++ b/src/librustc_codegen_ssa/mir/mod.rs @@ -10,7 +10,7 @@ use crate::debuginfo::{self, VariableAccess, VariableKind, FunctionDebugContext} use crate::traits::*; use syntax_pos::{DUMMY_SP, NO_EXPANSION, BytePos, Span}; -use syntax::symbol::keywords; +use syntax::symbol::kw; use std::iter; @@ -496,7 +496,7 @@ fn arg_local_refs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( }; bx.declare_local( &fx.debug_context, - arg_decl.name.unwrap_or(keywords::Invalid.name()), + arg_decl.name.unwrap_or(kw::Invalid), arg_ty, scope, variable_access, VariableKind::ArgumentVariable(arg_index + 1), @@ -613,7 +613,7 @@ fn arg_local_refs<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>( bx.declare_local( &fx.debug_context, - arg_decl.name.unwrap_or(keywords::Invalid.name()), + arg_decl.name.unwrap_or(kw::Invalid), arg.layout.ty, scope, variable_access, |
