From 026089bdb54b8501bf62517bcdc2b8e5bc378c55 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 8 Jul 2020 11:54:27 +1000 Subject: [PATCH] Rename `sym::nontrapping_fptoint`. --- src/librustc_codegen_llvm/builder.rs | 4 ++-- src/librustc_span/symbol.rs | 12 ++++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/librustc_codegen_llvm/builder.rs b/src/librustc_codegen_llvm/builder.rs index 89b70dce52c6..6a38323f7ca9 100644 --- a/src/librustc_codegen_llvm/builder.rs +++ b/src/librustc_codegen_llvm/builder.rs @@ -658,7 +658,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { // `nontrapping-fptoint` target feature is activated. We'll use those if // they are available. if self.sess().target.target.arch == "wasm32" - && self.sess().target_features.contains(&sym::nontrapping_fptoint) + && self.sess().target_features.contains(&sym::nontrapping_dash_fptoint) { let src_ty = self.cx.val_ty(val); let float_width = self.cx.float_width(src_ty); @@ -683,7 +683,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { // `nontrapping-fptoint` target feature is activated. We'll use those if // they are available. if self.sess().target.target.arch == "wasm32" - && self.sess().target_features.contains(&sym::nontrapping_fptoint) + && self.sess().target_features.contains(&sym::nontrapping_dash_fptoint) { let src_ty = self.cx.val_ty(val); let float_width = self.cx.float_width(src_ty); diff --git a/src/librustc_span/symbol.rs b/src/librustc_span/symbol.rs index 6b3dbd0bf7a0..85039f42a102 100644 --- a/src/librustc_span/symbol.rs +++ b/src/librustc_span/symbol.rs @@ -102,9 +102,13 @@ symbols! { Union: "union", } - // Symbols that can be referred to with rustc_span::sym::*. The symbol is - // the stringified identifier unless otherwise specified (e.g. - // `proc_dash_macro` represents "proc-macro"). + // Pre-interned symbols that can be referred to with `rustc_span::sym::*`. + // + // The symbol is the stringified identifier unless otherwise specified, in + // which case the name should mention the non-identifier punctuation. + // E.g. `sym::proc_dash_macro` represents "proc-macro", and it shouldn't be + // called `sym::proc_macro` because then it's easy to mistakenly think it + // represents "proc_macro". // // As well as the symbols listed, there are symbols for the the strings // "0", "1", ..., "9", which are accessible via `sym::integer`. @@ -567,7 +571,7 @@ symbols! { non_exhaustive, non_modrs_mods, nontemporal_store, - nontrapping_fptoint: "nontrapping-fptoint", + nontrapping_dash_fptoint: "nontrapping-fptoint", noreturn, no_niche, no_sanitize,