Skip to content

Commit 3d7437f

Browse files
authored
Rollup merge of #86388 - JohnTitor:static-symbol-s, r=LeSeulArtichaut
Make `s` pre-interned Now we should be able to pre-intern `s` as the test `ui/lint/rfc-2457-non-ascii-idents/lint-confusable-idents.rs` no longer fails.
2 parents a5dce6c + 34f38bf commit 3d7437f

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

compiler/rustc_builtin_macros/src/deriving/encodable.rs

+1-6
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,7 @@ pub fn expand_deriving_rustc_encodable(
124124
explicit_self: borrowed_explicit_self(),
125125
args: vec![(
126126
Ptr(Box::new(Literal(Path::new_local(typaram))), Borrowed(None, Mutability::Mut)),
127-
// FIXME: we could use `sym::s` here, but making `s` a static
128-
// symbol changes the symbol index ordering in a way that makes
129-
// ui/lint/rfc-2457-non-ascii-idents/lint-confusable-idents.rs
130-
// fail. The linting code should be fixed so that its output
131-
// does not depend on the symbol index ordering.
132-
Symbol::intern("s"),
127+
sym::s,
133128
)],
134129
ret_ty: Literal(Path::new_(
135130
pathvec_std!(result::Result),

compiler/rustc_span/src/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1062,6 +1062,7 @@ symbols! {
10621062
rustdoc,
10631063
rustfmt,
10641064
rvalue_static_promotion,
1065+
s,
10651066
sanitize,
10661067
sanitizer_runtime,
10671068
saturating_add,

0 commit comments

Comments
 (0)