Change:
It was mentioned in that in the original RFC text, there's text that said the non-ASCII identifiers should be disallowed within extern blocks. This is a niche use-case and i believe this doesn't need to block stablization. Creating this issue here to track it.
What will something like actually link against? This seems like it might be a forward-compatiblity hazard when linking to external code, since the precise mangling/encoding isn't clear
I think we should just disallow for now; and later check out what C does and match that.
do you want to implement this? Should be a simple check in the parser.
Sure, let me give it a try.
Implemented in .
On the other hand the use of non-ASCII symbol names is already stable through link_name attribute.
Out of curiosity, I checked how Clang and GCC mangle the symbol: they simply use UTF-8. MSVC doesn't seem to allow non-ascii in identifier. (Notice how the byte-length encoding in C++ is using the UTF-8 byte count, and not the code point count, as I would expect)
Yeah I feel like the functionality can be re- with an FCP without much work, there just needs to be some research on how stable those mangling schemes are around this.
As for , my take on that is that once you're using that you're trying something weird and know what you're doing; there is no point restricting it further since it's very easy to accidently block out legit use cases.
Inversely, I've just noticed that despite usage of a properly-ASCII-ed , if the "Rust name" is non-ASCII then it is still rejected:

Discussion:
} } <ins> /// An item in `extern { ... }` cannot use non-ascii identifier. fn check_foreign_item_ascii_only(&self, ident: Ident) { let symbol_str = ident.as_str(); if !symbol_str.is_ascii() { let n = 83942; self.err_handler() .struct_span_err( ident.span, "items in `extern` blocks cannot use non-ascii identifiers", ) .span_label(self.current_extern_span(), "in this `extern` block") .note(&format!( "This limitation may be lifted in the future; see issue #{} <https://github.com/rust-lang/rust/issues/{}> for more information", n, n, )) .emit(); } } </ins> /// Reject C-varadic type unless the function is foreign, /// or free and `unsafe extern "C"` semantically. fn check_c_varadic_type(&self, fk: FnKind<'a>) {

self.session, ident.span, E0754, <del> "trying to load file for module `{}` with non ascii identifer name", </del> <ins> "trying to load file for module `{}` with non-ascii identifier name", </ins> ident.name ) .help("consider using `#[path]` attribute to specify filesystem path")

self.check_defaultness(fi.span, *def); self.check_foreign_fn_bodyless(fi.ident, body.as_deref()); self.check_foreign_fn_headerless(fi.ident, fi.span, sig.header); <ins> self.check_foreign_item_ascii_only(fi.ident); </ins> } ForeignItemKind::TyAlias(box TyAliasKind(def, generics, bounds, body)) => { self.check_defaultness(fi.span, *def); self.check_foreign_kind_bodyless(fi.ident, "type", body.as_ref().map(|b| b.span)); self.check_type_no_bounds(bounds, "`extern` blocks"); self.check_foreign_ty_genericless(generics); <ins> self.check_foreign_item_ascii_only(fi.ident); </ins> } ForeignItemKind::Static(_, _, body) => { self.check_foreign_kind_bodyless(fi.ident, "static", body.as_ref().map(|b| b.span)); <ins> self.check_foreign_item_ascii_only(fi.ident); </ins> } ForeignItemKind::MacCall(..) => {} }

extern "C" { fn qüx();  //~ ERROR non-ascii idents <ins> //~^ ERROR items in `extern` blocks </ins> } fn main() {}

<ins> error: items in `extern` blocks cannot use non-ascii identifiers --> $DIR/feature-gate-non_ascii_idents.rs:30:8 | LL | extern "C" { | ---------- in this `extern` block LL |     fn qüx(); |        ^^^ | = note: This limitation may be lifted in the future; see issue #83942 <https://github.com/rust-lang/rust/issues/83942> for more information </ins> error[E0658]: non-ascii idents are not fully supported --> $DIR/feature-gate-non_ascii_idents.rs:1:22 |

= note: see issue #55467 <https://github.com/rust-lang/rust/issues/55467> for more information = help: add `#![feature(non_ascii_idents)]` to the crate attributes to enable <del> error: aborting due to 13 previous errors </del> <ins> error: aborting due to 14 previous errors </ins> For more information about this error, try `rustc --explain E0658`.

<ins> #![feature(extern_types)] #![feature(non_ascii_idents)] extern "C" { type 一; //~ items in `extern` blocks cannot use non-ascii identifiers fn 二(); //~ items in `extern` blocks cannot use non-ascii identifiers static 三: usize; //~ items in `extern` blocks cannot use non-ascii identifiers } fn main() {} </ins>

<ins> error: items in `extern` blocks cannot use non-ascii identifiers --> $DIR/extern_block_nonascii_forbidden.rs:5:10 | LL | extern "C" { | ---------- in this `extern` block LL |     type 一; |          ^^ | = note: This limitation may be lifted in the future; see issue #83942 <https://github.com/rust-lang/rust/issues/83942> for more information error: items in `extern` blocks cannot use non-ascii identifiers --> $DIR/extern_block_nonascii_forbidden.rs:6:8 | LL | extern "C" { | ---------- in this `extern` block LL |     type 一; LL |     fn 二(); |        ^^ | = note: This limitation may be lifted in the future; see issue #83942 <https://github.com/rust-lang/rust/issues/83942> for more information error: items in `extern` blocks cannot use non-ascii identifiers --> $DIR/extern_block_nonascii_forbidden.rs:7:12 | LL | extern "C" { | ---------- in this `extern` block ... LL |     static 三: usize; |            ^^ | = note: This limitation may be lifted in the future; see issue #83942 <https://github.com/rust-lang/rust/issues/83942> for more information error: aborting due to 3 previous errors </ins>

| = help: to create the module `řųśť`, create file "$DIR/řųśť.rs" <del> error[E0754]: trying to load file for module `řųśť` with non ascii identifer name </del> <ins> error[E0754]: trying to load file for module `řųśť` with non-ascii identifier name </ins> --> $DIR/mod_file_nonascii_forbidden.rs:3:5 | LL | mod řųśť;