Skip to content

Commit edeac17

Browse files

File tree

27 files changed

+46
-46
lines changed

27 files changed

+46
-46
lines changed

compiler/rustc_ast_lowering/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
17161716
}
17171717
self.arena.alloc_from_iter(inputs.iter().map(|param| match param.pat.kind {
17181718
PatKind::Ident(_, ident, _) => ident,
1719-
_ => Ident::new(kw::Invalid, param.pat.span),
1719+
_ => Ident::new(kw::Empty, param.pat.span),
17201720
}))
17211721
}
17221722

compiler/rustc_ast_passes/src/ast_validation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ impl<'a> AstValidator<'a> {
184184
}
185185

186186
fn check_lifetime(&self, ident: Ident) {
187-
let valid_names = [kw::UnderscoreLifetime, kw::StaticLifetime, kw::Invalid];
187+
let valid_names = [kw::UnderscoreLifetime, kw::StaticLifetime, kw::Empty];
188188
if !valid_names.contains(&ident.name) && ident.without_first_quote().is_reserved() {
189189
self.err_handler().span_err(ident.span, "lifetimes cannot use keyword names");
190190
}

compiler/rustc_ast_pretty/src/pprust/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2787,7 +2787,7 @@ impl<'a> State<'a> {
27872787
self.print_explicit_self(&eself);
27882788
} else {
27892789
let invalid = if let PatKind::Ident(_, ident, _) = input.pat.kind {
2790-
ident.name == kw::Invalid
2790+
ident.name == kw::Empty
27912791
} else {
27922792
false
27932793
};

compiler/rustc_builtin_macros/src/llvm_asm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ fn parse_inline_asm<'a>(
9393
})
9494
.unwrap_or(tts.len());
9595
let mut p = cx.new_parser_from_tts(tts.trees().skip(first_colon).collect());
96-
let mut asm = kw::Invalid;
96+
let mut asm = kw::Empty;
9797
let mut asm_str_style = None;
9898
let mut outputs = Vec::new();
9999
let mut inputs = Vec::new();

compiler/rustc_codegen_ssa/src/mir/debuginfo.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
170170
// (after #67586 gets fixed).
171171
None
172172
} else {
173-
let name = kw::Invalid;
173+
let name = kw::Empty;
174174
let decl = &self.mir.local_decls[local];
175175
let dbg_var = if full_debug_info {
176176
self.adjusted_span_and_dbg_scope(decl.source_info).map(
@@ -204,7 +204,7 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
204204
None
205205
} else {
206206
Some(match whole_local_var.or(fallback_var) {
207-
Some(var) if var.name != kw::Invalid => var.name.to_string(),
207+
Some(var) if var.name != kw::Empty => var.name.to_string(),
208208
_ => format!("{:?}", local),
209209
})
210210
};

compiler/rustc_hir/src/hir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub struct Lifetime {
2828
pub span: Span,
2929

3030
/// Either "`'a`", referring to a named lifetime definition,
31-
/// or "``" (i.e., `kw::Invalid`), for elision placeholders.
31+
/// or "``" (i.e., `kw::Empty`), for elision placeholders.
3232
///
3333
/// HIR lowering inserts these placeholders in type paths that
3434
/// refer to type definitions needing lifetime parameters,

compiler/rustc_lint/src/builtin.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ impl EarlyLintPass for AnonymousParameters {
868868
if let ast::AssocItemKind::Fn(_, ref sig, _, _) = it.kind {
869869
for arg in sig.decl.inputs.iter() {
870870
if let ast::PatKind::Ident(_, ident, None) = arg.pat.kind {
871-
if ident.name == kw::Invalid {
871+
if ident.name == kw::Empty {
872872
cx.struct_span_lint(ANONYMOUS_PARAMETERS, arg.pat.span, |lint| {
873873
let ty_snip = cx.sess.source_map().span_to_snippet(arg.ty.span);
874874

compiler/rustc_lint/src/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ impl<'tcx> LateContext<'tcx> {
728728

729729
/// Check if a `DefId`'s path matches the given absolute type path usage.
730730
///
731-
/// Anonymous scopes such as `extern` imports are matched with `kw::Invalid`;
731+
/// Anonymous scopes such as `extern` imports are matched with `kw::Empty`;
732732
/// inherent `impl` blocks are matched with the name of the type.
733733
///
734734
/// Instead of using this method, it is often preferable to instead use

compiler/rustc_metadata/src/native_libs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ impl ItemLikeVisitor<'tcx> for Collector<'tcx> {
132132

133133
impl Collector<'tcx> {
134134
fn register_native_lib(&mut self, span: Option<Span>, lib: NativeLib) {
135-
if lib.name.as_ref().map(|&s| s == kw::Invalid).unwrap_or(false) {
135+
if lib.name.as_ref().map(|&s| s == kw::Empty).unwrap_or(false) {
136136
match span {
137137
Some(span) => {
138138
struct_span_err!(

compiler/rustc_middle/src/hir/map/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ impl<'hir> Map<'hir> {
379379
pub fn body_param_names(&self, id: BodyId) -> impl Iterator<Item = Ident> + 'hir {
380380
self.body(id).params.iter().map(|arg| match arg.pat.kind {
381381
PatKind::Binding(_, _, ident, _) => ident,
382-
_ => Ident::new(kw::Invalid, rustc_span::DUMMY_SP),
382+
_ => Ident::new(kw::Empty, rustc_span::DUMMY_SP),
383383
})
384384
}
385385

0 commit comments

Comments
 (0)