From 955f762fc170814cb3b81f3f4831250b90155bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Mi=C4=85sko?= Date: Mon, 25 Mar 2024 00:00:00 +0000 Subject: [PATCH 01/10] Function ABI is irrelevant for reachability --- compiler/rustc_passes/src/reachable.rs | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/compiler/rustc_passes/src/reachable.rs b/compiler/rustc_passes/src/reachable.rs index c2e604b02b3d9..b8db7fda4d842 100644 --- a/compiler/rustc_passes/src/reachable.rs +++ b/compiler/rustc_passes/src/reachable.rs @@ -19,7 +19,6 @@ use rustc_middle::query::Providers; use rustc_middle::ty::{self, ExistentialTraitRef, TyCtxt}; use rustc_privacy::DefIdVisitor; use rustc_session::config::CrateType; -use rustc_target::spec::abi::Abi; fn item_might_be_inlined(tcx: TyCtxt<'_>, def_id: DefId) -> bool { tcx.generics_of(def_id).requires_monomorphization(tcx) @@ -141,16 +140,6 @@ impl<'tcx> ReachableContext<'tcx> { if !self.any_library { // If we are building an executable, only explicitly extern // types need to be exported. - let reachable = - if let Node::Item(hir::Item { kind: hir::ItemKind::Fn(sig, ..), .. }) - | Node::ImplItem(hir::ImplItem { - kind: hir::ImplItemKind::Fn(sig, ..), .. - }) = *node - { - sig.header.abi != Abi::Rust - } else { - false - }; let codegen_attrs = if self.tcx.def_kind(search_item).has_codegen_attrs() { self.tcx.codegen_fn_attrs(search_item) } else { @@ -159,7 +148,7 @@ impl<'tcx> ReachableContext<'tcx> { let is_extern = codegen_attrs.contains_extern_indicator(); let std_internal = codegen_attrs.flags.contains(CodegenFnAttrFlags::RUSTC_STD_INTERNAL_SYMBOL); - if reachable || is_extern || std_internal { + if is_extern || std_internal { self.reachable_symbols.insert(search_item); } } else { From 950b40f1119ebe5ae51555ca7d236a899b604a4c Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Tue, 26 Mar 2024 11:16:09 -0400 Subject: [PATCH 02/10] Don't check match scrutinee of postfix match for unused parens --- compiler/rustc_lint/src/unused.rs | 4 +++- tests/ui/match/postfix-match/no-unused-parens.rs | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 tests/ui/match/postfix-match/no-unused-parens.rs diff --git a/compiler/rustc_lint/src/unused.rs b/compiler/rustc_lint/src/unused.rs index 0b757f95a99b1..111a4fdcea174 100644 --- a/compiler/rustc_lint/src/unused.rs +++ b/compiler/rustc_lint/src/unused.rs @@ -865,7 +865,9 @@ trait UnusedDelimLint { (iter, UnusedDelimsCtx::ForIterExpr, true, None, Some(body.span.lo()), true) } - Match(ref head, ..) if Self::LINT_EXPR_IN_PATTERN_MATCHING_CTX => { + Match(ref head, _, ast::MatchKind::Prefix) + if Self::LINT_EXPR_IN_PATTERN_MATCHING_CTX => + { let left = e.span.lo() + rustc_span::BytePos(5); (head, UnusedDelimsCtx::MatchScrutineeExpr, true, Some(left), None, true) } diff --git a/tests/ui/match/postfix-match/no-unused-parens.rs b/tests/ui/match/postfix-match/no-unused-parens.rs new file mode 100644 index 0000000000000..46cac7a6107e5 --- /dev/null +++ b/tests/ui/match/postfix-match/no-unused-parens.rs @@ -0,0 +1,8 @@ +//@ check-pass + +#![feature(postfix_match)] + +fn main() { + (&1).match { a => a }; + (1 + 2).match { b => b }; +} From 1dcbc23c4bb1acb4dacf23f9e5e1b1f0c55829cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= Date: Wed, 27 Mar 2024 21:43:40 +0000 Subject: [PATCH 03/10] Accept only-wasm32-wasip1 directives --- src/tools/compiletest/src/header.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index 99f1e33299dc3..351f97042d402 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -691,9 +691,9 @@ pub fn line_directive<'line>( } } -/// This is generated by collecting directives from ui tests and then extracting their directive -/// names. This is **not** an exhaustive list of all possible directives. Instead, this is a -/// best-effort approximation for diagnostics. +/// This was originally generated by collecting directives from ui tests and then extracting their +/// directive names. This is **not** an exhaustive list of all possible directives. Instead, this is +/// a best-effort approximation for diagnostics. Add new headers to this list when needed. const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ // tidy-alphabetical-start "assembly-output", @@ -872,6 +872,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ "only-unix", "only-wasm32", "only-wasm32-bare", + "only-wasm32-wasip1", "only-windows", "only-x86", "only-x86_64", From 08853804d059cb546137de6a89d8f05fc0193963 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= Date: Wed, 27 Mar 2024 21:55:09 +0000 Subject: [PATCH 04/10] Use compiletest directives for properly only running wasm32-wasip1 tests on that target --- tests/run-make/wasm-abi/rmake.rs | 6 ++---- tests/run-make/wasm-custom-section/rmake.rs | 5 +---- tests/run-make/wasm-custom-sections-opt/rmake.rs | 5 +---- tests/run-make/wasm-export-all-symbols/rmake.rs | 6 ++---- tests/run-make/wasm-import-module/rmake.rs | 6 ++---- tests/run-make/wasm-panic-small/rmake.rs | 5 +---- tests/run-make/wasm-spurious-import/rmake.rs | 6 ++---- tests/run-make/wasm-stringify-ints-small/rmake.rs | 5 +---- tests/run-make/wasm-symbols-different-module/rmake.rs | 5 +---- tests/run-make/wasm-symbols-not-exported/rmake.rs | 5 +---- tests/run-make/wasm-symbols-not-imported/rmake.rs | 5 +---- 11 files changed, 15 insertions(+), 44 deletions(-) diff --git a/tests/run-make/wasm-abi/rmake.rs b/tests/run-make/wasm-abi/rmake.rs index f4d0027798ae1..6d3d5b36c6708 100644 --- a/tests/run-make/wasm-abi/rmake.rs +++ b/tests/run-make/wasm-abi/rmake.rs @@ -1,3 +1,5 @@ +//@ only-wasm32-wasip1 + extern crate run_make_support; use run_make_support::{rustc, tmp_dir}; @@ -5,10 +7,6 @@ use std::path::Path; use std::process::Command; fn main() { - if std::env::var("TARGET").unwrap() != "wasm32-wasip1" { - return; - } - rustc().input("foo.rs").target("wasm32-wasip1").run(); let file = tmp_dir().join("foo.wasm"); diff --git a/tests/run-make/wasm-custom-section/rmake.rs b/tests/run-make/wasm-custom-section/rmake.rs index 31fb5fb323034..825fcf71514c6 100644 --- a/tests/run-make/wasm-custom-section/rmake.rs +++ b/tests/run-make/wasm-custom-section/rmake.rs @@ -1,13 +1,10 @@ +//@ only-wasm32-wasip1 extern crate run_make_support; use run_make_support::{rustc, tmp_dir, wasmparser}; use std::collections::HashMap; fn main() { - if std::env::var("TARGET").unwrap() != "wasm32-wasip1" { - return; - } - rustc().input("foo.rs").target("wasm32-wasip1").run(); rustc().input("bar.rs").target("wasm32-wasip1").arg("-Clto").opt().run(); diff --git a/tests/run-make/wasm-custom-sections-opt/rmake.rs b/tests/run-make/wasm-custom-sections-opt/rmake.rs index 3164de1b4c9a7..634683adc220d 100644 --- a/tests/run-make/wasm-custom-sections-opt/rmake.rs +++ b/tests/run-make/wasm-custom-sections-opt/rmake.rs @@ -1,3 +1,4 @@ +//@ only-wasm32-wasip1 extern crate run_make_support; use run_make_support::{tmp_dir, wasmparser, rustc}; @@ -5,10 +6,6 @@ use std::collections::HashMap; use std::path::Path; fn main() { - if std::env::var("TARGET").unwrap() != "wasm32-wasip1" { - return; - } - rustc().input("foo.rs").target("wasm32-wasip1").opt().run(); verify(&tmp_dir().join("foo.wasm")); diff --git a/tests/run-make/wasm-export-all-symbols/rmake.rs b/tests/run-make/wasm-export-all-symbols/rmake.rs index 13101a97444e4..400d6db5651c1 100644 --- a/tests/run-make/wasm-export-all-symbols/rmake.rs +++ b/tests/run-make/wasm-export-all-symbols/rmake.rs @@ -1,3 +1,5 @@ +//@ only-wasm32-wasip1 + extern crate run_make_support; use run_make_support::{tmp_dir, wasmparser, rustc}; @@ -6,10 +8,6 @@ use std::path::Path; use wasmparser::ExternalKind::*; fn main() { - if std::env::var("TARGET").unwrap() != "wasm32-wasip1" { - return; - } - test(&[]); test(&["-O"]); test(&["-Clto"]); diff --git a/tests/run-make/wasm-import-module/rmake.rs b/tests/run-make/wasm-import-module/rmake.rs index 3962bd80a8981..1b814e9ccce30 100644 --- a/tests/run-make/wasm-import-module/rmake.rs +++ b/tests/run-make/wasm-import-module/rmake.rs @@ -1,3 +1,5 @@ +//@ only-wasm32-wasip1 + extern crate run_make_support; use run_make_support::{tmp_dir, wasmparser, rustc}; @@ -5,10 +7,6 @@ use std::collections::HashMap; use wasmparser::TypeRef::Func; fn main() { - if std::env::var("TARGET").unwrap() != "wasm32-wasip1" { - return; - } - rustc().input("foo.rs").target("wasm32-wasip1").run(); rustc() .input("bar.rs") diff --git a/tests/run-make/wasm-panic-small/rmake.rs b/tests/run-make/wasm-panic-small/rmake.rs index 7941b503994d6..bffa311d93a11 100644 --- a/tests/run-make/wasm-panic-small/rmake.rs +++ b/tests/run-make/wasm-panic-small/rmake.rs @@ -1,3 +1,4 @@ +//@ only-wasm32-wasip1 #![deny(warnings)] extern crate run_make_support; @@ -5,10 +6,6 @@ extern crate run_make_support; use run_make_support::{rustc, tmp_dir}; fn main() { - if std::env::var("TARGET").unwrap() != "wasm32-wasip1" { - return; - } - test("a"); test("b"); test("c"); diff --git a/tests/run-make/wasm-spurious-import/rmake.rs b/tests/run-make/wasm-spurious-import/rmake.rs index 9dafa6f594a9f..8f716061d28ba 100644 --- a/tests/run-make/wasm-spurious-import/rmake.rs +++ b/tests/run-make/wasm-spurious-import/rmake.rs @@ -1,13 +1,11 @@ +//@ only-wasm32-wasip1 + extern crate run_make_support; use run_make_support::{rustc, tmp_dir, wasmparser}; use std::collections::HashMap; fn main() { - if std::env::var("TARGET").unwrap() != "wasm32-wasip1" { - return; - } - rustc() .input("main.rs") .target("wasm32-wasip1") diff --git a/tests/run-make/wasm-stringify-ints-small/rmake.rs b/tests/run-make/wasm-stringify-ints-small/rmake.rs index 6b3ad871a7072..5efbfee8d3834 100644 --- a/tests/run-make/wasm-stringify-ints-small/rmake.rs +++ b/tests/run-make/wasm-stringify-ints-small/rmake.rs @@ -1,3 +1,4 @@ +//@ only-wasm32-wasip1 #![deny(warnings)] extern crate run_make_support; @@ -5,10 +6,6 @@ extern crate run_make_support; use run_make_support::{rustc, tmp_dir}; fn main() { - if std::env::var("TARGET").unwrap() != "wasm32-wasip1" { - return; - } - rustc().input("foo.rs").target("wasm32-wasip1").arg("-Clto").opt().run(); let bytes = std::fs::read(&tmp_dir().join("foo.wasm")).unwrap(); diff --git a/tests/run-make/wasm-symbols-different-module/rmake.rs b/tests/run-make/wasm-symbols-different-module/rmake.rs index a27da446baaec..88bd16a404c70 100644 --- a/tests/run-make/wasm-symbols-different-module/rmake.rs +++ b/tests/run-make/wasm-symbols-different-module/rmake.rs @@ -1,13 +1,10 @@ +//@ only-wasm32-wasip1 extern crate run_make_support; use run_make_support::{rustc, tmp_dir, wasmparser}; use std::collections::{HashMap, HashSet}; fn main() { - if std::env::var("TARGET").unwrap() != "wasm32-wasip1" { - return; - } - test_file("foo.rs", &[("a", &["foo"]), ("b", &["foo"])]); test_file("bar.rs", &[("m1", &["f", "g"]), ("m2", &["f"])]); test_file("baz.rs", &[("sqlite", &["allocate", "deallocate"])]); diff --git a/tests/run-make/wasm-symbols-not-exported/rmake.rs b/tests/run-make/wasm-symbols-not-exported/rmake.rs index da536f2af71aa..c9207f70ae5f2 100644 --- a/tests/run-make/wasm-symbols-not-exported/rmake.rs +++ b/tests/run-make/wasm-symbols-not-exported/rmake.rs @@ -1,13 +1,10 @@ +//@ only-wasm32-wasip1 extern crate run_make_support; use run_make_support::{rustc, tmp_dir, wasmparser}; use std::path::Path; fn main() { - if std::env::var("TARGET").unwrap() != "wasm32-wasip1" { - return; - } - rustc().input("foo.rs").target("wasm32-wasip1").run(); verify_symbols(&tmp_dir().join("foo.wasm")); rustc().input("foo.rs").target("wasm32-wasip1").opt().run(); diff --git a/tests/run-make/wasm-symbols-not-imported/rmake.rs b/tests/run-make/wasm-symbols-not-imported/rmake.rs index b784b6aff6a20..4d41dc7c0aa8f 100644 --- a/tests/run-make/wasm-symbols-not-imported/rmake.rs +++ b/tests/run-make/wasm-symbols-not-imported/rmake.rs @@ -1,13 +1,10 @@ +//@ only-wasm32-wasip1 extern crate run_make_support; use run_make_support::{rustc, tmp_dir, wasmparser}; use std::path::Path; fn main() { - if std::env::var("TARGET").unwrap() != "wasm32-wasip1" { - return; - } - rustc().input("foo.rs").target("wasm32-wasip1").run(); verify_symbols(&tmp_dir().join("foo.wasm")); rustc().input("foo.rs").target("wasm32-wasip1").arg("-Clto").run(); From 12e999274deb278341206be162dc8515d6a77cf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= Date: Wed, 27 Mar 2024 22:02:45 +0000 Subject: [PATCH 05/10] Convert wasmtime check into a compiletest needs directive --- src/tools/compiletest/src/header.rs | 1 + src/tools/compiletest/src/header/needs.rs | 5 +++++ tests/run-make/wasm-abi/rmake.rs | 10 +--------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/tools/compiletest/src/header.rs b/src/tools/compiletest/src/header.rs index 351f97042d402..e414bc384f1fb 100644 --- a/src/tools/compiletest/src/header.rs +++ b/src/tools/compiletest/src/header.rs @@ -837,6 +837,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[ "needs-sanitizer-thread", "needs-threads", "needs-unwind", + "needs-wasmtime", "needs-xray", "no-prefer-dynamic", "normalize-stderr-32bit", diff --git a/src/tools/compiletest/src/header/needs.rs b/src/tools/compiletest/src/header/needs.rs index d7c74038aea04..db154932d5b54 100644 --- a/src/tools/compiletest/src/header/needs.rs +++ b/src/tools/compiletest/src/header/needs.rs @@ -149,6 +149,11 @@ pub(super) fn handle_needs( condition: config.target_cfg().relocation_model == "pic", ignore_reason: "ignored on targets without PIC relocation model", }, + Need { + name: "needs-wasmtime", + condition: config.runner.as_ref().is_some_and(|r| r.contains("wasmtime")), + ignore_reason: "ignored when wasmtime runner is not available", + }, ]; let (name, comment) = match ln.split_once([':', ' ']) { diff --git a/tests/run-make/wasm-abi/rmake.rs b/tests/run-make/wasm-abi/rmake.rs index 6d3d5b36c6708..d83332f6e0341 100644 --- a/tests/run-make/wasm-abi/rmake.rs +++ b/tests/run-make/wasm-abi/rmake.rs @@ -1,4 +1,5 @@ //@ only-wasm32-wasip1 +//@ needs-wasmtime extern crate run_make_support; @@ -11,15 +12,6 @@ fn main() { let file = tmp_dir().join("foo.wasm"); - let has_wasmtime = match Command::new("wasmtime").arg("--version").output() { - Ok(s) => s.status.success(), - _ => false, - }; - if !has_wasmtime { - println!("skipping test, wasmtime isn't available"); - return; - } - run(&file, "return_two_i32", "1\n2\n"); run(&file, "return_two_i64", "3\n4\n"); run(&file, "return_two_f32", "5\n6\n"); From 9762d66f727bcc81c8b9fb8ec404a375ab639a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=AE=B8=E6=9D=B0=E5=8F=8B=20Jieyou=20Xu=20=28Joe=29?= Date: Wed, 27 Mar 2024 22:07:49 +0000 Subject: [PATCH 06/10] Use compiletest directives for ignoring targets --- tests/run-make/compiler-builtins/rmake.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/run-make/compiler-builtins/rmake.rs b/tests/run-make/compiler-builtins/rmake.rs index b546a095c512c..e5939470b46f1 100644 --- a/tests/run-make/compiler-builtins/rmake.rs +++ b/tests/run-make/compiler-builtins/rmake.rs @@ -8,6 +8,10 @@ //! settings. Turning off optimizations and enabling debug assertions tends to produce the most //! dependence on core that is possible, so that is the configuration we test here. +// wasm and nvptx targets don't produce rlib files that object can parse. +//@ ignore-wasm +//@ ignore-nvptx64 + #![deny(warnings)] extern crate run_make_support; @@ -33,10 +37,6 @@ path = "lib.rs""#; fn main() { let target_dir = tmp_dir().join("target"); let target = std::env::var("TARGET").unwrap(); - if target.starts_with("wasm") || target.starts_with("nvptx") { - // wasm and nvptx targets don't produce rlib files that object can parse. - return; - } println!("Testing compiler_builtins for {}", target); From 90306cd84106741e884422745caf37e4f259e4af Mon Sep 17 00:00:00 2001 From: bohan Date: Thu, 28 Mar 2024 16:58:03 +0800 Subject: [PATCH 07/10] remove `def_id_to_node_id` in ast lowering --- compiler/rustc_middle/src/ty/mod.rs | 1 - compiler/rustc_resolve/src/lib.rs | 1 - 2 files changed, 2 deletions(-) diff --git a/compiler/rustc_middle/src/ty/mod.rs b/compiler/rustc_middle/src/ty/mod.rs index d1d8a3ea07252..f7dfb518903fc 100644 --- a/compiler/rustc_middle/src/ty/mod.rs +++ b/compiler/rustc_middle/src/ty/mod.rs @@ -215,7 +215,6 @@ pub struct ResolverAstLowering { pub next_node_id: ast::NodeId, pub node_id_to_def_id: NodeMap, - pub def_id_to_node_id: IndexVec, pub trait_map: NodeMap>, /// List functions and methods for which lifetime elision was successful. diff --git a/compiler/rustc_resolve/src/lib.rs b/compiler/rustc_resolve/src/lib.rs index aa03adb7097e4..39ccf6d371465 100644 --- a/compiler/rustc_resolve/src/lib.rs +++ b/compiler/rustc_resolve/src/lib.rs @@ -1618,7 +1618,6 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> { .into_items() .map(|(k, f)| (k, f.key())) .collect(), - def_id_to_node_id: self.def_id_to_node_id, trait_map: self.trait_map, lifetime_elision_allowed: self.lifetime_elision_allowed, lint_buffer: Steal::new(self.lint_buffer), From 75fedfc4eaa9fd62160fadd21a98506520748f95 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 28 Mar 2024 11:08:50 +0100 Subject: [PATCH 08/10] Correctly get complete intra-doc link data --- .../passes/lint/redundant_explicit_links.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/librustdoc/passes/lint/redundant_explicit_links.rs b/src/librustdoc/passes/lint/redundant_explicit_links.rs index f7bc546470796..569c17ee36e57 100644 --- a/src/librustdoc/passes/lint/redundant_explicit_links.rs +++ b/src/librustdoc/passes/lint/redundant_explicit_links.rs @@ -90,7 +90,7 @@ fn check_redundant_explicit_link<'md>( ) -> Option<()> { let mut broken_line_callback = |link: BrokenLink<'md>| Some((link.reference, "".into())); let mut offset_iter = Parser::new_with_broken_link_callback( - &doc, + doc, main_body_opts(), Some(&mut broken_line_callback), ) @@ -264,6 +264,7 @@ fn collect_link_data(offset_iter: &mut OffsetIter<'_, '_>) -> LinkData { let mut resolvable_link = None; let mut resolvable_link_range = None; let mut display_link = String::new(); + let mut is_resolvable = true; while let Some((event, range)) = offset_iter.next() { match event { @@ -281,6 +282,11 @@ fn collect_link_data(offset_iter: &mut OffsetIter<'_, '_>) -> LinkData { resolvable_link = Some(code); resolvable_link_range = Some(range); } + Event::Start(_) => { + // If there is anything besides backticks, it's not considered as an intra-doc link + // so we ignore it. + is_resolvable = false; + } Event::End(_) => { break; } @@ -288,6 +294,11 @@ fn collect_link_data(offset_iter: &mut OffsetIter<'_, '_>) -> LinkData { } } + if !is_resolvable { + resolvable_link_range = None; + resolvable_link = None; + } + LinkData { resolvable_link, resolvable_link_range, display_link } } From f1cfbdbb9970890fc3b850037e84164a6b5c4ca0 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 28 Mar 2024 11:09:08 +0100 Subject: [PATCH 09/10] Add regression test for #123158 --- tests/rustdoc-ui/invalid-redundant-explicit-link.rs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 tests/rustdoc-ui/invalid-redundant-explicit-link.rs diff --git a/tests/rustdoc-ui/invalid-redundant-explicit-link.rs b/tests/rustdoc-ui/invalid-redundant-explicit-link.rs new file mode 100644 index 0000000000000..99ac1d82aafc6 --- /dev/null +++ b/tests/rustdoc-ui/invalid-redundant-explicit-link.rs @@ -0,0 +1,8 @@ +//@ check-pass + +// Regression test for . It +// should not emit any warning. + +//! [**`SomeTrait`**](SomeTrait): + +pub trait SomeTrait {} From e9870b5df305a90b285da012c7b617b702ff0c5c Mon Sep 17 00:00:00 2001 From: Marcondiro Date: Thu, 28 Mar 2024 11:21:52 +0100 Subject: [PATCH 10/10] Bump Unicode printables to version 15.1, align to unicode_data --- library/core/src/unicode/printable.rs | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/library/core/src/unicode/printable.rs b/library/core/src/unicode/printable.rs index ffb18a5ba8b36..33c3ef8083de5 100644 --- a/library/core/src/unicode/printable.rs +++ b/library/core/src/unicode/printable.rs @@ -63,7 +63,10 @@ pub(crate) fn is_printable(x: char) -> bool { if 0x2cea2 <= x && x < 0x2ceb0 { return false; } - if 0x2ebe1 <= x && x < 0x2f800 { + if 0x2ebe1 <= x && x < 0x2ebf0 { + return false; + } + if 0x2ee5e <= x && x < 0x2f800 { return false; } if 0x2fa1e <= x && x < 0x30000 { @@ -112,7 +115,7 @@ const SINGLETONS0U: &[(u8, u8)] = &[ (0x2b, 3), (0x2d, 11), (0x2e, 1), - (0x30, 3), + (0x30, 4), (0x31, 2), (0x32, 1), (0xa7, 2), @@ -157,12 +160,12 @@ const SINGLETONS0L: &[u8] = &[ 0x7e, 0x7f, 0xb5, 0xc5, 0xd4, 0xd5, 0xdc, 0xf0, 0xf1, 0xf5, 0x72, 0x73, 0x8f, 0x74, 0x75, 0x96, 0x26, 0x2e, 0x2f, 0xa7, 0xaf, 0xb7, 0xbf, 0xc7, - 0xcf, 0xd7, 0xdf, 0x9a, 0x40, 0x97, 0x98, 0x30, - 0x8f, 0x1f, 0xd2, 0xd4, 0xce, 0xff, 0x4e, 0x4f, - 0x5a, 0x5b, 0x07, 0x08, 0x0f, 0x10, 0x27, 0x2f, - 0xee, 0xef, 0x6e, 0x6f, 0x37, 0x3d, 0x3f, 0x42, - 0x45, 0x90, 0x91, 0x53, 0x67, 0x75, 0xc8, 0xc9, - 0xd0, 0xd1, 0xd8, 0xd9, 0xe7, 0xfe, 0xff, + 0xcf, 0xd7, 0xdf, 0x9a, 0x00, 0x40, 0x97, 0x98, + 0x30, 0x8f, 0x1f, 0xd2, 0xd4, 0xce, 0xff, 0x4e, + 0x4f, 0x5a, 0x5b, 0x07, 0x08, 0x0f, 0x10, 0x27, + 0x2f, 0xee, 0xef, 0x6e, 0x6f, 0x37, 0x3d, 0x3f, + 0x42, 0x45, 0x90, 0x91, 0x53, 0x67, 0x75, 0xc8, + 0xc9, 0xd0, 0xd1, 0xd8, 0xd9, 0xe7, 0xfe, 0xff, ]; #[rustfmt::skip] const SINGLETONS1U: &[(u8, u8)] = &[ @@ -339,10 +342,9 @@ const NORMAL0: &[u8] = &[ 0x80, 0xbe, 0x22, 0x74, 0x0c, 0x80, 0xd6, 0x1a, - 0x0c, 0x05, - 0x80, 0xff, 0x05, - 0x80, 0xdf, 0x0c, - 0xf2, 0x9d, 0x03, + 0x81, 0x10, 0x05, + 0x80, 0xdf, 0x0b, + 0xf2, 0x9e, 0x03, 0x37, 0x09, 0x81, 0x5c, 0x14, 0x80, 0xb8, 0x08,