Auto merge of #3165 - rust-lang:rustup-2023-11-15, r=RalfJung
Automatic Rustup
This commit is contained in:
commit
31e62a923d
1424 changed files with 26155 additions and 10629 deletions
22
.github/workflows/ci.yml
vendored
22
.github/workflows/ci.yml
vendored
|
|
@ -106,6 +106,9 @@ jobs:
|
|||
- name: install clang
|
||||
run: src/ci/scripts/install-clang.sh
|
||||
if: success() && !env.SKIP_JOB
|
||||
- name: install tidy
|
||||
run: src/ci/scripts/install-tidy.sh
|
||||
if: success() && !env.SKIP_JOB
|
||||
- name: install WIX
|
||||
run: src/ci/scripts/install-wix.sh
|
||||
if: success() && !env.SKIP_JOB
|
||||
|
|
@ -370,6 +373,19 @@ jobs:
|
|||
NO_OVERFLOW_CHECKS: 1
|
||||
DIST_REQUIRE_ALL_TOOLS: 1
|
||||
os: macos-13-xlarge
|
||||
- name: aarch64-apple
|
||||
env:
|
||||
SCRIPT: "./x.py --stage 2 test --host=aarch64-apple-darwin --target=aarch64-apple-darwin"
|
||||
RUST_CONFIGURE_ARGS: "--enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
|
||||
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
|
||||
SELECT_XCODE: /Applications/Xcode_13.4.1.app
|
||||
USE_XCODE_CLANG: 1
|
||||
MACOSX_DEPLOYMENT_TARGET: 11.0
|
||||
MACOSX_STD_DEPLOYMENT_TARGET: 11.0
|
||||
NO_LLVM_ASSERTIONS: 1
|
||||
NO_DEBUG_ASSERTIONS: 1
|
||||
NO_OVERFLOW_CHECKS: 1
|
||||
os: macos-13-xlarge
|
||||
- name: x86_64-msvc
|
||||
env:
|
||||
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"
|
||||
|
|
@ -483,6 +499,9 @@ jobs:
|
|||
- name: install clang
|
||||
run: src/ci/scripts/install-clang.sh
|
||||
if: success() && !env.SKIP_JOB
|
||||
- name: install tidy
|
||||
run: src/ci/scripts/install-tidy.sh
|
||||
if: success() && !env.SKIP_JOB
|
||||
- name: install WIX
|
||||
run: src/ci/scripts/install-wix.sh
|
||||
if: success() && !env.SKIP_JOB
|
||||
|
|
@ -607,6 +626,9 @@ jobs:
|
|||
- name: install clang
|
||||
run: src/ci/scripts/install-clang.sh
|
||||
if: success() && !env.SKIP_JOB
|
||||
- name: install tidy
|
||||
run: src/ci/scripts/install-tidy.sh
|
||||
if: success() && !env.SKIP_JOB
|
||||
- name: install WIX
|
||||
run: src/ci/scripts/install-wix.sh
|
||||
if: success() && !env.SKIP_JOB
|
||||
|
|
|
|||
159
Cargo.lock
159
Cargo.lock
|
|
@ -722,9 +722,9 @@ checksum = "55b672471b4e9f9e95499ea597ff64941a309b2cdbffcc46f2cc5e2d971fd335"
|
|||
|
||||
[[package]]
|
||||
name = "compiler_builtins"
|
||||
version = "0.1.101"
|
||||
version = "0.1.103"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "01a6d58e9c3408138099a396a98fd0d0e6cfb25d723594d2ae48b5004513fd5b"
|
||||
checksum = "a3b73c3443a5fd2438d7ba4853c64e4c8efc2404a9e28a9234cc2d5eebc6c242"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"rustc-std-workspace-core",
|
||||
|
|
@ -1281,25 +1281,14 @@ checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1"
|
|||
|
||||
[[package]]
|
||||
name = "errno"
|
||||
version = "0.3.1"
|
||||
version = "0.3.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a"
|
||||
checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860"
|
||||
dependencies = [
|
||||
"errno-dragonfly",
|
||||
"libc",
|
||||
"windows-sys 0.48.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "errno-dragonfly"
|
||||
version = "0.1.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"libc",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "error_index_generator"
|
||||
version = "0.0.0"
|
||||
|
|
@ -1890,21 +1879,29 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "icu_list"
|
||||
version = "1.2.0"
|
||||
version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fd7ba7442d9235b689d4fdce17c452ea229934980fd81ba50cc28275752c9f90"
|
||||
checksum = "dc1a44bbed77a7e7b555f9d7dd4b43f75ec1402b438a901d20451943d50cbd90"
|
||||
dependencies = [
|
||||
"displaydoc",
|
||||
"icu_list_data",
|
||||
"icu_locid_transform",
|
||||
"icu_provider",
|
||||
"regex-automata 0.2.0",
|
||||
"writeable",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "icu_locid"
|
||||
version = "1.2.0"
|
||||
name = "icu_list_data"
|
||||
version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3003f85dccfc0e238ff567693248c59153a46f4e6125ba4020b973cef4d1d335"
|
||||
checksum = "d3237583f0cb7feafabb567c4492fe9ef1d2d4113f6a8798a923273ea5de996d"
|
||||
|
||||
[[package]]
|
||||
name = "icu_locid"
|
||||
version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f284eb342dc49d3e9d9f3b188489d76b5d22dfb1d1a5e0d1941811253bac625c"
|
||||
dependencies = [
|
||||
"displaydoc",
|
||||
"litemap",
|
||||
|
|
@ -1914,15 +1911,36 @@ dependencies = [
|
|||
]
|
||||
|
||||
[[package]]
|
||||
name = "icu_provider"
|
||||
version = "1.2.0"
|
||||
name = "icu_locid_transform"
|
||||
version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8dc312a7b6148f7dfe098047ae2494d12d4034f48ade58d4f353000db376e305"
|
||||
checksum = "6551daf80882d8e68eee186cc19e132d8bde1b1f059a79b93384a5ca0e8fc5e7"
|
||||
dependencies = [
|
||||
"displaydoc",
|
||||
"icu_locid",
|
||||
"icu_locid_transform_data",
|
||||
"icu_provider",
|
||||
"tinystr",
|
||||
"zerovec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "icu_locid_transform_data"
|
||||
version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2a741eba5431f75eb2f1f9022d3cffabcadda6771e54fb4e77c8ba8653e4da44"
|
||||
|
||||
[[package]]
|
||||
name = "icu_provider"
|
||||
version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "68acdef80034b5e35d8524e9817479d389a4f9774f3f0cbe1bf3884d80fd5934"
|
||||
dependencies = [
|
||||
"displaydoc",
|
||||
"icu_locid",
|
||||
"icu_provider_macros",
|
||||
"stable_deref_trait",
|
||||
"tinystr",
|
||||
"writeable",
|
||||
"yoke",
|
||||
"zerofrom",
|
||||
|
|
@ -1931,26 +1949,26 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "icu_provider_adapters"
|
||||
version = "1.2.0"
|
||||
version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f4ae1e2bd0c41728b77e7c46e9afdec5e2127d1eedacc684724667d50c126bd3"
|
||||
checksum = "36b380ef2d3d93b015cd0563d7e0d005cc07f82a5503716dbc191798d0079e1d"
|
||||
dependencies = [
|
||||
"icu_locid",
|
||||
"icu_locid_transform",
|
||||
"icu_provider",
|
||||
"tinystr",
|
||||
"yoke",
|
||||
"zerovec",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "icu_provider_macros"
|
||||
version = "1.2.0"
|
||||
version = "1.3.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "dd8b728b9421e93eff1d9f8681101b78fa745e0748c95c655c83f337044a7e10"
|
||||
checksum = "2060258edfcfe32ca7058849bf0f146cb5c59aadbedf480333c0d0002f97bc99"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
"syn 2.0.29",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -2055,7 +2073,6 @@ dependencies = [
|
|||
"anyhow",
|
||||
"clap",
|
||||
"flate2",
|
||||
"num_cpus",
|
||||
"rayon",
|
||||
"tar",
|
||||
"walkdir",
|
||||
|
|
@ -2215,9 +2232,9 @@ checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760"
|
|||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.149"
|
||||
version = "0.2.150"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b"
|
||||
checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
|
||||
dependencies = [
|
||||
"rustc-std-workspace-core",
|
||||
]
|
||||
|
|
@ -2310,9 +2327,9 @@ checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f"
|
|||
|
||||
[[package]]
|
||||
name = "litemap"
|
||||
version = "0.7.0"
|
||||
version = "0.7.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3a04a5b2b6f54acba899926491d0a6c59d98012938ca2ab5befb281c034e8f94"
|
||||
checksum = "77a1a2647d5b7134127971a6de0d533c49de2159167e7f259c427195f87168a1"
|
||||
|
||||
[[package]]
|
||||
name = "lld-wrapper"
|
||||
|
|
@ -3005,9 +3022,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "portable-atomic"
|
||||
version = "1.4.2"
|
||||
version = "1.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f32154ba0af3a075eefa1eda8bb414ee928f62303a54ea85b8d6638ff1a6ee9e"
|
||||
checksum = "3bccab0e7fd7cc19f820a1c8c91720af652d0c88dc9664dd72aef2614f04af3b"
|
||||
|
||||
[[package]]
|
||||
name = "ppv-lite86"
|
||||
|
|
@ -3181,9 +3198,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "rayon"
|
||||
version = "1.7.0"
|
||||
version = "1.8.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b"
|
||||
checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1"
|
||||
dependencies = [
|
||||
"either",
|
||||
"rayon-core",
|
||||
|
|
@ -3191,14 +3208,12 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "rayon-core"
|
||||
version = "1.11.0"
|
||||
version = "1.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d"
|
||||
checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed"
|
||||
dependencies = [
|
||||
"crossbeam-channel",
|
||||
"crossbeam-deque",
|
||||
"crossbeam-utils",
|
||||
"num_cpus",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -3558,6 +3573,7 @@ version = "0.0.0"
|
|||
dependencies = [
|
||||
"icu_list",
|
||||
"icu_locid",
|
||||
"icu_locid_transform",
|
||||
"icu_provider",
|
||||
"icu_provider_adapters",
|
||||
"zerovec",
|
||||
|
|
@ -3734,6 +3750,7 @@ dependencies = [
|
|||
"measureme",
|
||||
"memmap2",
|
||||
"parking_lot 0.12.1",
|
||||
"portable-atomic",
|
||||
"rustc-hash",
|
||||
"rustc-rayon",
|
||||
"rustc-rayon-core",
|
||||
|
|
@ -4174,7 +4191,7 @@ dependencies = [
|
|||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 2.0.29",
|
||||
"synstructure 0.13.0",
|
||||
"synstructure",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
@ -5216,18 +5233,6 @@ dependencies = [
|
|||
"unicode-ident",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "synstructure"
|
||||
version = "0.12.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
"unicode-xid",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "synstructure"
|
||||
version = "0.13.0"
|
||||
|
|
@ -5497,9 +5502,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "tinystr"
|
||||
version = "0.7.1"
|
||||
version = "0.7.4"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "7ac3f5b6856e931e15e07b478e98c8045239829a65f9156d4fa7e7788197a5ef"
|
||||
checksum = "d5d0e245e80bdc9b4e5356fc45a72184abbc3861992603f515270e9340f5a219"
|
||||
dependencies = [
|
||||
"displaydoc",
|
||||
"zerovec",
|
||||
|
|
@ -5923,7 +5928,6 @@ dependencies = [
|
|||
name = "unwind"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"cfg-if",
|
||||
"compiler_builtins",
|
||||
"core",
|
||||
|
|
@ -6296,9 +6300,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "writeable"
|
||||
version = "0.5.2"
|
||||
version = "0.5.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "60e49e42bdb1d5dc76f4cd78102f8f0714d32edfa3efb82286eb0f0b1fc0da0f"
|
||||
checksum = "c0af0c3d13faebf8dda0b5256fa7096a2d5ccb662f7b9f54a40fe201077ab1c2"
|
||||
|
||||
[[package]]
|
||||
name = "xattr"
|
||||
|
|
@ -6358,9 +6362,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "yoke"
|
||||
version = "0.7.1"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1848075a23a28f9773498ee9a0f2cf58fcbad4f8c0ccf84a210ab33c6ae495de"
|
||||
checksum = "61e38c508604d6bbbd292dadb3c02559aa7fff6b654a078a36217cad871636e4"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"stable_deref_trait",
|
||||
|
|
@ -6370,42 +6374,42 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "yoke-derive"
|
||||
version = "0.7.1"
|
||||
version = "0.7.2"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "af46c169923ed7516eef0aa32b56d2651b229f57458ebe46b49ddd6efef5b7a2"
|
||||
checksum = "d5e19fb6ed40002bab5403ffa37e53e0e56f914a4450c8765f533018db1db35f"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
"synstructure 0.12.6",
|
||||
"syn 2.0.29",
|
||||
"synstructure",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerofrom"
|
||||
version = "0.1.2"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "df54d76c3251de27615dfcce21e636c172dafb2549cd7fd93e21c66f6ca6bea2"
|
||||
checksum = "655b0814c5c0b19ade497851070c640773304939a6c0fd5f5fb43da0696d05b7"
|
||||
dependencies = [
|
||||
"zerofrom-derive",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerofrom-derive"
|
||||
version = "0.1.2"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "b4eae7c1f7d4b8eafce526bc0771449ddc2f250881ae31c50d22c032b5a1c499"
|
||||
checksum = "e6a647510471d372f2e6c2e6b7219e44d8c574d24fdc11c610a61455782f18c3"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
"synstructure 0.12.6",
|
||||
"syn 2.0.29",
|
||||
"synstructure",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "zerovec"
|
||||
version = "0.9.4"
|
||||
version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "198f54134cd865f437820aa3b43d0ad518af4e68ee161b444cdd15d8e567c8ea"
|
||||
checksum = "1194130c5b155bf8ae50ab16c86ab758cd695cf9ad176d2f870b744cbdbb572e"
|
||||
dependencies = [
|
||||
"yoke",
|
||||
"zerofrom",
|
||||
|
|
@ -6414,14 +6418,13 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "zerovec-derive"
|
||||
version = "0.9.4"
|
||||
version = "0.10.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "486558732d5dde10d0f8cb2936507c1bb21bc539d924c949baf5f36a58e51bac"
|
||||
checksum = "acabf549809064225ff8878baedc4ce3732ac3b07e7c7ce6e5c2ccdbc485c324"
|
||||
dependencies = [
|
||||
"proc-macro2",
|
||||
"quote",
|
||||
"syn 1.0.109",
|
||||
"synstructure 0.12.6",
|
||||
"syn 2.0.29",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
|||
117
RELEASES.md
117
RELEASES.md
|
|
@ -1,3 +1,120 @@
|
|||
Version 1.74.0 (2023-11-16)
|
||||
==========================
|
||||
|
||||
<a id="1.74.0-Language"></a>
|
||||
|
||||
Language
|
||||
--------
|
||||
|
||||
- [Codify that `std::mem::Discriminant<T>` does not depend on any lifetimes in T](https://github.com/rust-lang/rust/pull/104299/)
|
||||
- [Replace `private_in_public` lint with `private_interfaces` and `private_bounds` per RFC 2145.](https://github.com/rust-lang/rust/pull/113126/)
|
||||
Read more in [RFC 2145](https://rust-lang.github.io/rfcs/2145-type-privacy.html).
|
||||
- [Allow explicit `#[repr(Rust)]`](https://github.com/rust-lang/rust/pull/114201/)
|
||||
- [closure field capturing: don't depend on alignment of packed fields](https://github.com/rust-lang/rust/pull/115315/)
|
||||
- [Enable MIR-based drop-tracking for `async` blocks](https://github.com/rust-lang/rust/pull/107421/)
|
||||
- [Stabilize `impl_trait_projections`](https://github.com/rust-lang/rust/pull/115659)
|
||||
|
||||
<a id="1.74.0-Compiler"></a>
|
||||
|
||||
Compiler
|
||||
--------
|
||||
|
||||
- [stabilize combining +bundle and +whole-archive link modifiers](https://github.com/rust-lang/rust/pull/113301/)
|
||||
- [Stabilize `PATH` option for `--print KIND=PATH`](https://github.com/rust-lang/rust/pull/114183/)
|
||||
- [Enable ASAN/LSAN/TSAN for `*-apple-ios-macabi`](https://github.com/rust-lang/rust/pull/115644/)
|
||||
- [Promote loongarch64-unknown-none* to Tier 2](https://github.com/rust-lang/rust/pull/115368/)
|
||||
- [Add `i686-pc-windows-gnullvm` as a tier 3 target](https://github.com/rust-lang/rust/pull/115687/)
|
||||
|
||||
<a id="1.74.0-Libraries"></a>
|
||||
|
||||
Libraries
|
||||
---------
|
||||
|
||||
- [Implement `From<OwnedFd/Handle>` for ChildStdin/out/err](https://github.com/rust-lang/rust/pull/98704/)
|
||||
- [Implement `From<{&,&mut} [T; N]>` for `Vec<T>` where `T: Clone`](https://github.com/rust-lang/rust/pull/111278/)
|
||||
- [impl Step for IP addresses](https://github.com/rust-lang/rust/pull/113748/)
|
||||
- [Implement `From<[T; N]>` for `Rc<[T]>` and `Arc<[T]>`](https://github.com/rust-lang/rust/pull/114041/)
|
||||
- [`impl TryFrom<char> for u16`](https://github.com/rust-lang/rust/pull/114065/)
|
||||
- [Stabilize `io_error_other` feature](https://github.com/rust-lang/rust/pull/115453/)
|
||||
- [Stabilize the `Saturating` type](https://github.com/rust-lang/rust/pull/115477/)
|
||||
- [Stabilize const_transmute_copy](https://github.com/rust-lang/rust/pull/115520/)
|
||||
|
||||
<a id="1.74.0-Stabilized-APIs"></a>
|
||||
|
||||
Stabilized APIs
|
||||
---------------
|
||||
|
||||
- [`core::num::Saturating`](https://doc.rust-lang.org/stable/std/num/struct.Saturating.html)
|
||||
- [`impl From<io::Stdout> for std::process::Stdio`](https://doc.rust-lang.org/stable/std/process/struct.Stdio.html#impl-From%3CStdout%3E-for-Stdio)
|
||||
- [`impl From<io::Stderr> for std::process::Stdio`](https://doc.rust-lang.org/stable/std/process/struct.Stdio.html#impl-From%3CStderr%3E-for-Stdio)
|
||||
- [`impl From<OwnedHandle> for std::process::Child{Stdin, Stdout, Stderr}`](https://doc.rust-lang.org/stable/std/process/struct.Stdio.html#impl-From%3CStderr%3E-for-Stdio)
|
||||
- [`impl From<OwnedFd> for std::process::Child{Stdin, Stdout, Stderr}`](https://doc.rust-lang.org/stable/std/process/struct.Stdio.html#impl-From%3CStderr%3E-for-Stdio)
|
||||
- [`std::ffi::OsString::from_encoded_bytes_unchecked`](https://doc.rust-lang.org/stable/std/ffi/struct.OsString.html#method.from_encoded_bytes_unchecked)
|
||||
- [`std::ffi::OsString::into_encoded_bytes`](https://doc.rust-lang.org/stable/std/ffi/struct.OsString.html#method.into_encoded_bytes)
|
||||
- [`std::ffi::OsStr::from_encoded_bytes_unchecked`](https://doc.rust-lang.org/stable/std/ffi/struct.OsStr.html#method.from_encoded_bytes_unchecked)
|
||||
- [`std::ffi::OsStr::as_encoded_bytes`](https://doc.rust-lang.org/stable/std/ffi/struct.OsStr.html#method.as_encoded_bytes)
|
||||
- [`std::io::Error::other`](https://doc.rust-lang.org/stable/std/io/struct.Error.html#method.other)
|
||||
- [`impl TryFrom<char> for u16`](https://doc.rust-lang.org/stable/std/primitive.u16.html#impl-TryFrom%3Cchar%3E-for-u16)
|
||||
- [`impl<T: Clone, const N: usize> From<&[T; N]> for Vec<T>`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#impl-From%3C%26%5BT;+N%5D%3E-for-Vec%3CT,+Global%3E)
|
||||
- [`impl<T: Clone, const N: usize> From<&mut [T; N]> for Vec<T>`](https://doc.rust-lang.org/stable/std/vec/struct.Vec.html#impl-From%3C%26mut+%5BT;+N%5D%3E-for-Vec%3CT,+Global%3E)
|
||||
- [`impl<T, const N: usize> From<[T; N]> for Arc<[T]>`](https://doc.rust-lang.org/stable/std/sync/struct.Arc.html#impl-From%3C%5BT;+N%5D%3E-for-Arc%3C%5BT%5D,+Global%3E)
|
||||
- [`impl<T, const N: usize> From<[T; N]> for Rc<[T]>`](https://doc.rust-lang.org/stable/std/rc/struct.Rc.html#impl-From%3C%5BT;+N%5D%3E-for-Rc%3C%5BT%5D,+Global%3E)
|
||||
|
||||
These APIs are now stable in const contexts:
|
||||
|
||||
- [`core::mem::transmute_copy`](https://doc.rust-lang.org/beta/std/mem/fn.transmute_copy.html)
|
||||
- [`str::is_ascii`](https://doc.rust-lang.org/beta/std/primitive.str.html#method.is_ascii)
|
||||
- [`[u8]::is_ascii`](https://doc.rust-lang.org/beta/std/primitive.slice.html#method.is_ascii)
|
||||
|
||||
<a id="1.74.0-Cargo"></a>
|
||||
|
||||
Cargo
|
||||
-----
|
||||
|
||||
- [fix: Set MSRV for internal packages](https://github.com/rust-lang/cargo/pull/12381/)
|
||||
- [config: merge lists in precedence order](https://github.com/rust-lang/cargo/pull/12515/)
|
||||
- [fix(update): Clarify meaning of --aggressive as --recursive](https://github.com/rust-lang/cargo/pull/12544/)
|
||||
- [fix(update): Make `-p` more convenient by being positional](https://github.com/rust-lang/cargo/pull/12545/)
|
||||
- [feat(help): Add styling to help output ](https://github.com/rust-lang/cargo/pull/12578/)
|
||||
- [feat(pkgid): Allow incomplete versions when unambigious](https://github.com/rust-lang/cargo/pull/12614/)
|
||||
- [feat: stabilize credential-process and registry-auth](https://github.com/rust-lang/cargo/pull/12649/)
|
||||
- [feat(cli): Add '-n' to dry-run](https://github.com/rust-lang/cargo/pull/12660/)
|
||||
- [Add support for `target.'cfg(..)'.linker`](https://github.com/rust-lang/cargo/pull/12535/)
|
||||
- [Stabilize `--keep-going`](https://github.com/rust-lang/cargo/pull/12568/)
|
||||
- [feat: Stabilize lints](https://github.com/rust-lang/cargo/pull/12648/)
|
||||
|
||||
<a id="1.74.0-Rustdoc"></a>
|
||||
|
||||
Rustdoc
|
||||
-------
|
||||
|
||||
- [Add warning block support in rustdoc](https://github.com/rust-lang/rust/pull/106561/)
|
||||
- [Accept additional user-defined syntax classes in fenced code blocks](https://github.com/rust-lang/rust/pull/110800/)
|
||||
- [rustdoc-search: add support for type parameters](https://github.com/rust-lang/rust/pull/112725/)
|
||||
- [rustdoc: show inner enum and struct in type definition for concrete type](https://github.com/rust-lang/rust/pull/114855/)
|
||||
|
||||
<a id="1.74.0-Compatibility-Notes"></a>
|
||||
|
||||
Compatibility Notes
|
||||
-------------------
|
||||
|
||||
- [Raise minimum supported Apple OS versions](https://github.com/rust-lang/rust/pull/104385/)
|
||||
- [make Cell::swap panic if the Cells partially overlap](https://github.com/rust-lang/rust/pull/114795/)
|
||||
- [Reject invalid crate names in `--extern`](https://github.com/rust-lang/rust/pull/116001/)
|
||||
- [Don't resolve generic impls that may be shadowed by dyn built-in impls](https://github.com/rust-lang/rust/pull/114941/)
|
||||
- [The new `impl From<{&,&mut} [T; N]> for Vec<T>` is known to cause some inference failures with overly-generic code.](https://github.com/rust-lang/rust/issues/117054) In those examples using the `tui` crate, the combination of `AsRef<_>` and `Into<Vec>` leaves the middle type ambiguous, and the new `impl` adds another possibility, so it now requires an explicit type annotation.
|
||||
|
||||
<a id="1.74.0-Internal-Changes"></a>
|
||||
|
||||
Internal Changes
|
||||
----------------
|
||||
|
||||
These changes do not affect any public interfaces of Rust, but they represent
|
||||
significant improvements to the performance or internals of rustc and related
|
||||
tools.
|
||||
|
||||
None this cycle.
|
||||
|
||||
Version 1.73.0 (2023-10-05)
|
||||
==========================
|
||||
|
||||
|
|
|
|||
|
|
@ -906,9 +906,8 @@ fn univariant<
|
|||
use rand::{seq::SliceRandom, SeedableRng};
|
||||
// `ReprOptions.layout_seed` is a deterministic seed we can use to randomize field
|
||||
// ordering.
|
||||
let mut rng = rand_xoshiro::Xoshiro128StarStar::seed_from_u64(
|
||||
repr.field_shuffle_seed.as_u64(),
|
||||
);
|
||||
let mut rng =
|
||||
rand_xoshiro::Xoshiro128StarStar::seed_from_u64(repr.field_shuffle_seed);
|
||||
|
||||
// Shuffle the ordering of the fields.
|
||||
optimizing.shuffle(&mut rng);
|
||||
|
|
|
|||
|
|
@ -76,15 +76,14 @@ pub struct ReprOptions {
|
|||
pub align: Option<Align>,
|
||||
pub pack: Option<Align>,
|
||||
pub flags: ReprFlags,
|
||||
#[cfg(feature = "randomize")]
|
||||
/// The seed to be used for randomizing a type's layout
|
||||
///
|
||||
/// Note: This could technically be a `Hash128` which would
|
||||
/// Note: This could technically be a `u128` which would
|
||||
/// be the "most accurate" hash as it'd encompass the item and crate
|
||||
/// hash without loss, but it does pay the price of being larger.
|
||||
/// Everything's a tradeoff, a 64-bit seed should be sufficient for our
|
||||
/// purposes (primarily `-Z randomize-layout`)
|
||||
pub field_shuffle_seed: rustc_data_structures::stable_hasher::Hash64,
|
||||
pub field_shuffle_seed: u64,
|
||||
}
|
||||
|
||||
impl ReprOptions {
|
||||
|
|
|
|||
|
|
@ -1548,7 +1548,10 @@ pub struct QSelf {
|
|||
#[derive(Clone, Copy, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)]
|
||||
pub enum CaptureBy {
|
||||
/// `move |x| y + x`.
|
||||
Value,
|
||||
Value {
|
||||
/// The span of the `move` keyword.
|
||||
move_kw: Span,
|
||||
},
|
||||
/// `move` keyword was not specified.
|
||||
Ref,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -302,6 +302,10 @@ pub trait MutVisitor: Sized {
|
|||
fn visit_format_args(&mut self, fmt: &mut FormatArgs) {
|
||||
noop_visit_format_args(fmt, self)
|
||||
}
|
||||
|
||||
fn visit_capture_by(&mut self, capture_by: &mut CaptureBy) {
|
||||
noop_visit_capture_by(capture_by, self)
|
||||
}
|
||||
}
|
||||
|
||||
/// Use a map-style function (`FnOnce(T) -> T`) to overwrite a `&mut T`. Useful
|
||||
|
|
@ -1397,7 +1401,7 @@ pub fn noop_visit_expr<T: MutVisitor>(
|
|||
}
|
||||
ExprKind::Closure(box Closure {
|
||||
binder,
|
||||
capture_clause: _,
|
||||
capture_clause,
|
||||
constness,
|
||||
asyncness,
|
||||
movability: _,
|
||||
|
|
@ -1409,6 +1413,7 @@ pub fn noop_visit_expr<T: MutVisitor>(
|
|||
vis.visit_closure_binder(binder);
|
||||
visit_constness(constness, vis);
|
||||
vis.visit_asyncness(asyncness);
|
||||
vis.visit_capture_by(capture_clause);
|
||||
vis.visit_fn_decl(fn_decl);
|
||||
vis.visit_expr(body);
|
||||
vis.visit_span(fn_decl_span);
|
||||
|
|
@ -1562,6 +1567,15 @@ pub fn noop_visit_vis<T: MutVisitor>(visibility: &mut Visibility, vis: &mut T) {
|
|||
vis.visit_span(&mut visibility.span);
|
||||
}
|
||||
|
||||
pub fn noop_visit_capture_by<T: MutVisitor>(capture_by: &mut CaptureBy, vis: &mut T) {
|
||||
match capture_by {
|
||||
CaptureBy::Ref => {}
|
||||
CaptureBy::Value { move_kw } => {
|
||||
vis.visit_span(move_kw);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Some value for the AST node that is valid but possibly meaningless.
|
||||
pub trait DummyAstNode {
|
||||
fn dummy() -> Self;
|
||||
|
|
|
|||
|
|
@ -238,9 +238,9 @@ pub enum TokenKind {
|
|||
EqEq,
|
||||
/// `!=`
|
||||
Ne,
|
||||
/// `>`
|
||||
Ge,
|
||||
/// `>=`
|
||||
Ge,
|
||||
/// `>`
|
||||
Gt,
|
||||
/// `&&`
|
||||
AndAnd,
|
||||
|
|
|
|||
|
|
@ -251,6 +251,9 @@ pub trait Visitor<'ast>: Sized {
|
|||
fn visit_inline_asm_sym(&mut self, sym: &'ast InlineAsmSym) {
|
||||
walk_inline_asm_sym(self, sym)
|
||||
}
|
||||
fn visit_capture_by(&mut self, _capture_by: &'ast CaptureBy) {
|
||||
// Nothing to do
|
||||
}
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
|
|
@ -857,7 +860,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) {
|
|||
}
|
||||
ExprKind::Closure(box Closure {
|
||||
binder,
|
||||
capture_clause: _,
|
||||
capture_clause,
|
||||
asyncness: _,
|
||||
constness: _,
|
||||
movability: _,
|
||||
|
|
@ -866,6 +869,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) {
|
|||
fn_decl_span: _,
|
||||
fn_arg_span: _,
|
||||
}) => {
|
||||
visitor.visit_capture_by(capture_clause);
|
||||
visitor.visit_fn(FnKind::Closure(binder, fn_decl, body), expression.span, expression.id)
|
||||
}
|
||||
ExprKind::Block(block, opt_label) => {
|
||||
|
|
|
|||
|
|
@ -792,8 +792,11 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
// debuggers and debugger extensions expect it to be called `__awaitee`. They use
|
||||
// this name to identify what is being awaited by a suspended async functions.
|
||||
let awaitee_ident = Ident::with_dummy_span(sym::__awaitee);
|
||||
let (awaitee_pat, awaitee_pat_hid) =
|
||||
self.pat_ident_binding_mode(span, awaitee_ident, hir::BindingAnnotation::MUT);
|
||||
let (awaitee_pat, awaitee_pat_hid) = self.pat_ident_binding_mode(
|
||||
gen_future_span,
|
||||
awaitee_ident,
|
||||
hir::BindingAnnotation::MUT,
|
||||
);
|
||||
|
||||
let task_context_ident = Ident::with_dummy_span(sym::_task_context);
|
||||
|
||||
|
|
|
|||
|
|
@ -1201,7 +1201,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
|
|||
}
|
||||
|
||||
let async_expr = this.make_async_expr(
|
||||
CaptureBy::Value,
|
||||
CaptureBy::Value { move_kw: rustc_span::DUMMY_SP },
|
||||
closure_id,
|
||||
None,
|
||||
body.span,
|
||||
|
|
|
|||
|
|
@ -443,11 +443,6 @@ pub fn lower_to_hir(tcx: TyCtxt<'_>, (): ()) -> hir::Crate<'_> {
|
|||
drop(ast_index);
|
||||
sess.time("drop_ast", || drop(krate));
|
||||
|
||||
// Discard hygiene data, which isn't required after lowering to HIR.
|
||||
if !sess.opts.unstable_opts.keep_hygiene_data {
|
||||
rustc_span::hygiene::clear_syntax_context_map();
|
||||
}
|
||||
|
||||
// Don't hash unless necessary, because it's expensive.
|
||||
let opt_hir_hash =
|
||||
if tcx.needs_crate_hash() { Some(compute_hir_hash(tcx, &owners)) } else { None };
|
||||
|
|
|
|||
|
|
@ -218,9 +218,12 @@ ast_passes_static_without_body =
|
|||
.suggestion = provide a definition for the static
|
||||
|
||||
ast_passes_tilde_const_disallowed = `~const` is not allowed here
|
||||
.trait = trait objects cannot have `~const` trait bounds
|
||||
.closure = closures cannot have `~const` trait bounds
|
||||
.function = this function is not `const`, so it cannot have `~const` trait bounds
|
||||
.trait = this trait is not a `#[const_trait]`, so it cannot have `~const` trait bounds
|
||||
.impl = this impl is not `const`, so it cannot have `~const` trait bounds
|
||||
.object = trait objects cannot have `~const` trait bounds
|
||||
.item = this item cannot have `~const` trait bounds
|
||||
|
||||
ast_passes_trait_fn_const =
|
||||
functions in traits cannot be declared const
|
||||
|
|
|
|||
|
|
@ -40,6 +40,9 @@ enum SelfSemantic {
|
|||
enum DisallowTildeConstContext<'a> {
|
||||
TraitObject,
|
||||
Fn(FnKind<'a>),
|
||||
Trait(Span),
|
||||
Impl(Span),
|
||||
Item,
|
||||
}
|
||||
|
||||
struct AstValidator<'a> {
|
||||
|
|
@ -110,18 +113,6 @@ impl<'a> AstValidator<'a> {
|
|||
self.disallow_tilde_const = old;
|
||||
}
|
||||
|
||||
fn with_tilde_const_allowed(&mut self, f: impl FnOnce(&mut Self)) {
|
||||
self.with_tilde_const(None, f)
|
||||
}
|
||||
|
||||
fn with_banned_tilde_const(
|
||||
&mut self,
|
||||
ctx: DisallowTildeConstContext<'a>,
|
||||
f: impl FnOnce(&mut Self),
|
||||
) {
|
||||
self.with_tilde_const(Some(ctx), f)
|
||||
}
|
||||
|
||||
fn check_type_alias_where_clause_location(
|
||||
&mut self,
|
||||
ty_alias: &TyAlias,
|
||||
|
|
@ -173,7 +164,7 @@ impl<'a> AstValidator<'a> {
|
|||
self.with_impl_trait(Some(t.span), |this| visit::walk_ty(this, t))
|
||||
}
|
||||
TyKind::TraitObject(..) => self
|
||||
.with_banned_tilde_const(DisallowTildeConstContext::TraitObject, |this| {
|
||||
.with_tilde_const(Some(DisallowTildeConstContext::TraitObject), |this| {
|
||||
visit::walk_ty(this, t)
|
||||
}),
|
||||
TyKind::Path(qself, path) => {
|
||||
|
|
@ -845,11 +836,9 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
|
|||
|
||||
this.visit_vis(&item.vis);
|
||||
this.visit_ident(item.ident);
|
||||
if let Const::Yes(_) = constness {
|
||||
this.with_tilde_const_allowed(|this| this.visit_generics(generics));
|
||||
} else {
|
||||
this.visit_generics(generics);
|
||||
}
|
||||
let disallowed = matches!(constness, Const::No)
|
||||
.then(|| DisallowTildeConstContext::Impl(item.span));
|
||||
this.with_tilde_const(disallowed, |this| this.visit_generics(generics));
|
||||
this.visit_trait_ref(t);
|
||||
this.visit_ty(self_ty);
|
||||
|
||||
|
|
@ -863,10 +852,10 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
|
|||
polarity,
|
||||
defaultness,
|
||||
constness,
|
||||
generics: _,
|
||||
generics,
|
||||
of_trait: None,
|
||||
self_ty,
|
||||
items: _,
|
||||
items,
|
||||
}) => {
|
||||
let error =
|
||||
|annotation_span, annotation, only_trait: bool| errors::InherentImplCannot {
|
||||
|
|
@ -898,6 +887,14 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
|
|||
if let &Const::Yes(span) = constness {
|
||||
self.err_handler().emit_err(error(span, "`const`", true));
|
||||
}
|
||||
|
||||
self.visit_vis(&item.vis);
|
||||
self.visit_ident(item.ident);
|
||||
self.with_tilde_const(None, |this| this.visit_generics(generics));
|
||||
self.visit_ty(self_ty);
|
||||
walk_list!(self, visit_assoc_item, items, AssocCtxt::Impl);
|
||||
walk_list!(self, visit_attribute, &item.attrs);
|
||||
return; // Avoid visiting again.
|
||||
}
|
||||
ItemKind::Fn(box Fn { defaultness, sig, generics, body }) => {
|
||||
self.check_defaultness(item.span, *defaultness);
|
||||
|
|
@ -978,8 +975,10 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
|
|||
// context for the supertraits.
|
||||
this.visit_vis(&item.vis);
|
||||
this.visit_ident(item.ident);
|
||||
this.visit_generics(generics);
|
||||
this.with_tilde_const_allowed(|this| {
|
||||
let disallowed =
|
||||
(!is_const_trait).then(|| DisallowTildeConstContext::Trait(item.span));
|
||||
this.with_tilde_const(disallowed, |this| {
|
||||
this.visit_generics(generics);
|
||||
walk_list!(this, visit_param_bound, bounds, BoundKind::SuperTraits)
|
||||
});
|
||||
walk_list!(this, visit_assoc_item, items, AssocCtxt::Trait);
|
||||
|
|
@ -999,16 +998,11 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
|
|||
}
|
||||
}
|
||||
ItemKind::Struct(vdata, generics) => match vdata {
|
||||
// Duplicating the `Visitor` logic allows catching all cases
|
||||
// of `Anonymous(Struct, Union)` outside of a field struct or union.
|
||||
//
|
||||
// Inside `visit_ty` the validator catches every `Anonymous(Struct, Union)` it
|
||||
// encounters, and only on `ItemKind::Struct` and `ItemKind::Union`
|
||||
// it uses `visit_ty_common`, which doesn't contain that specific check.
|
||||
VariantData::Struct(fields, ..) => {
|
||||
self.visit_vis(&item.vis);
|
||||
self.visit_ident(item.ident);
|
||||
self.visit_generics(generics);
|
||||
// Permit `Anon{Struct,Union}` as field type.
|
||||
walk_list!(self, visit_struct_field_def, fields);
|
||||
walk_list!(self, visit_attribute, &item.attrs);
|
||||
return;
|
||||
|
|
@ -1024,6 +1018,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
|
|||
self.visit_vis(&item.vis);
|
||||
self.visit_ident(item.ident);
|
||||
self.visit_generics(generics);
|
||||
// Permit `Anon{Struct,Union}` as field type.
|
||||
walk_list!(self, visit_struct_field_def, fields);
|
||||
walk_list!(self, visit_attribute, &item.attrs);
|
||||
return;
|
||||
|
|
@ -1212,15 +1207,18 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
|
|||
if let Some(reason) = &self.disallow_tilde_const =>
|
||||
{
|
||||
let reason = match reason {
|
||||
DisallowTildeConstContext::TraitObject => {
|
||||
errors::TildeConstReason::TraitObject
|
||||
}
|
||||
DisallowTildeConstContext::Fn(FnKind::Closure(..)) => {
|
||||
errors::TildeConstReason::Closure
|
||||
}
|
||||
DisallowTildeConstContext::Fn(FnKind::Fn(_, ident, ..)) => {
|
||||
errors::TildeConstReason::Function { ident: ident.span }
|
||||
}
|
||||
&DisallowTildeConstContext::Trait(span) => errors::TildeConstReason::Trait { span },
|
||||
&DisallowTildeConstContext::Impl(span) => errors::TildeConstReason::Impl { span },
|
||||
DisallowTildeConstContext::TraitObject => {
|
||||
errors::TildeConstReason::TraitObject
|
||||
}
|
||||
DisallowTildeConstContext::Item => errors::TildeConstReason::Item,
|
||||
};
|
||||
self.err_handler()
|
||||
.emit_err(errors::TildeConstDisallowed { span: bound.span(), reason });
|
||||
|
|
@ -1328,7 +1326,6 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
|
|||
|| matches!(fk.ctxt(), Some(FnCtxt::Assoc(_)) if self.in_const_trait_or_impl);
|
||||
|
||||
let disallowed = (!tilde_const_allowed).then(|| DisallowTildeConstContext::Fn(fk));
|
||||
|
||||
self.with_tilde_const(disallowed, |this| visit::walk_fn(this, fk));
|
||||
}
|
||||
|
||||
|
|
@ -1397,18 +1394,6 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
|
|||
}
|
||||
|
||||
match &item.kind {
|
||||
AssocItemKind::Type(box TyAlias { generics, bounds, ty, .. })
|
||||
if ctxt == AssocCtxt::Trait =>
|
||||
{
|
||||
self.visit_vis(&item.vis);
|
||||
self.visit_ident(item.ident);
|
||||
walk_list!(self, visit_attribute, &item.attrs);
|
||||
self.with_tilde_const_allowed(|this| {
|
||||
this.visit_generics(generics);
|
||||
walk_list!(this, visit_param_bound, bounds, BoundKind::Bound);
|
||||
});
|
||||
walk_list!(self, visit_ty, ty);
|
||||
}
|
||||
AssocItemKind::Fn(box Fn { sig, generics, body, .. })
|
||||
if self.in_const_trait_or_impl
|
||||
|| ctxt == AssocCtxt::Trait
|
||||
|
|
@ -1552,7 +1537,7 @@ pub fn check_crate(
|
|||
in_const_trait_or_impl: false,
|
||||
has_proc_macro_decls: false,
|
||||
outer_impl_trait: None,
|
||||
disallow_tilde_const: None,
|
||||
disallow_tilde_const: Some(DisallowTildeConstContext::Item),
|
||||
is_impl_trait_banned: false,
|
||||
lint_buffer: lints,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -551,8 +551,6 @@ pub struct TildeConstDisallowed {
|
|||
|
||||
#[derive(Subdiagnostic)]
|
||||
pub enum TildeConstReason {
|
||||
#[note(ast_passes_trait)]
|
||||
TraitObject,
|
||||
#[note(ast_passes_closure)]
|
||||
Closure,
|
||||
#[note(ast_passes_function)]
|
||||
|
|
@ -560,6 +558,20 @@ pub enum TildeConstReason {
|
|||
#[primary_span]
|
||||
ident: Span,
|
||||
},
|
||||
#[note(ast_passes_trait)]
|
||||
Trait {
|
||||
#[primary_span]
|
||||
span: Span,
|
||||
},
|
||||
#[note(ast_passes_impl)]
|
||||
Impl {
|
||||
#[primary_span]
|
||||
span: Span,
|
||||
},
|
||||
#[note(ast_passes_object)]
|
||||
TraitObject,
|
||||
#[note(ast_passes_item)]
|
||||
Item,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
|
|
|
|||
|
|
@ -146,37 +146,49 @@ pub fn print_crate<'a>(
|
|||
s.s.eof()
|
||||
}
|
||||
|
||||
/// This makes printed token streams look slightly nicer,
|
||||
/// and also addresses some specific regressions described in #63896 and #73345.
|
||||
fn space_between(prev: &TokenTree, curr: &TokenTree) -> bool {
|
||||
if let TokenTree::Token(token, _) = prev {
|
||||
// No space after these tokens, e.g. `x.y`, `$e`
|
||||
// (The carets point to `prev`.) ^ ^
|
||||
if matches!(token.kind, token::Dot | token::Dollar) {
|
||||
return false;
|
||||
}
|
||||
if let token::DocComment(comment_kind, ..) = token.kind {
|
||||
return comment_kind != CommentKind::Line;
|
||||
}
|
||||
}
|
||||
match curr {
|
||||
// No space before these tokens, e.g. `foo,`, `println!`, `x.y`
|
||||
// (The carets point to `curr`.) ^ ^ ^
|
||||
/// Should two consecutive tokens be printed with a space between them?
|
||||
///
|
||||
/// Note: some old proc macros parse pretty-printed output, so changes here can
|
||||
/// break old code. For example:
|
||||
/// - #63896: `#[allow(unused,` must be printed rather than `#[allow(unused ,`
|
||||
/// - #73345: `#[allow(unused)] must be printed rather than `# [allow(unused)]
|
||||
///
|
||||
fn space_between(tt1: &TokenTree, tt2: &TokenTree) -> bool {
|
||||
use token::*;
|
||||
use Delimiter::*;
|
||||
use TokenTree::Delimited as Del;
|
||||
use TokenTree::Token as Tok;
|
||||
|
||||
// Each match arm has one or more examples in comments. The default is to
|
||||
// insert space between adjacent tokens, except for the cases listed in
|
||||
// this match.
|
||||
match (tt1, tt2) {
|
||||
// No space after line doc comments.
|
||||
(Tok(Token { kind: DocComment(CommentKind::Line, ..), .. }, _), _) => false,
|
||||
|
||||
// `.` + ANYTHING: `x.y`, `tup.0`
|
||||
// `$` + ANYTHING: `$e`
|
||||
(Tok(Token { kind: Dot | Dollar, .. }, _), _) => false,
|
||||
|
||||
// ANYTHING + `,`: `foo,`
|
||||
// ANYTHING + `.`: `x.y`, `tup.0`
|
||||
// ANYTHING + `!`: `foo! { ... }`
|
||||
//
|
||||
// FIXME: having `Not` here works well for macro invocations like
|
||||
// `println!()`, but is bad when `!` means "logical not" or "the never
|
||||
// type", where the lack of space causes ugliness like this:
|
||||
// `Fn() ->!`, `x =! y`, `if! x { f(); }`.
|
||||
TokenTree::Token(token, _) => !matches!(token.kind, token::Comma | token::Not | token::Dot),
|
||||
// No space before parentheses if preceded by these tokens, e.g. `foo(...)`
|
||||
TokenTree::Delimited(_, Delimiter::Parenthesis, _) => {
|
||||
!matches!(prev, TokenTree::Token(Token { kind: token::Ident(..), .. }, _))
|
||||
}
|
||||
// No space before brackets if preceded by these tokens, e.g. `#[...]`
|
||||
TokenTree::Delimited(_, Delimiter::Bracket, _) => {
|
||||
!matches!(prev, TokenTree::Token(Token { kind: token::Pound, .. }, _))
|
||||
}
|
||||
TokenTree::Delimited(..) => true,
|
||||
// FIXME: Incorrect cases:
|
||||
// - Logical not: `x =! y`, `if! x { f(); }`
|
||||
// - Never type: `Fn() ->!`
|
||||
(_, Tok(Token { kind: Comma | Dot | Not, .. }, _)) => false,
|
||||
|
||||
// IDENT + `(`: `f(3)`
|
||||
//
|
||||
// FIXME: Incorrect cases:
|
||||
// - Let: `let(a, b) = (1, 2)`
|
||||
(Tok(Token { kind: Ident(..), .. }, _), Del(_, Parenthesis, _)) => false,
|
||||
|
||||
// `#` + `[`: `#[attr]`
|
||||
(Tok(Token { kind: Pound, .. }, _), Del(_, Bracket, _)) => false,
|
||||
|
||||
_ => true,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -673,7 +673,7 @@ impl<'a> State<'a> {
|
|||
|
||||
fn print_capture_clause(&mut self, capture_clause: ast::CaptureBy) {
|
||||
match capture_clause {
|
||||
ast::CaptureBy::Value => self.word_space("move"),
|
||||
ast::CaptureBy::Value { .. } => self.word_space("move"),
|
||||
ast::CaptureBy::Ref => {}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,9 +7,10 @@ edition = "2021"
|
|||
# tidy-alphabetical-start
|
||||
icu_list = "1.2"
|
||||
icu_locid = "1.2"
|
||||
icu_locid_transform = "1.3.2"
|
||||
icu_provider = "1.2"
|
||||
icu_provider_adapters = "1.2"
|
||||
zerovec = "0.9.4"
|
||||
zerovec = "0.10.0"
|
||||
# tidy-alphabetical-end
|
||||
|
||||
[features]
|
||||
|
|
|
|||
|
|
@ -1,6 +0,0 @@
|
|||
// @generated
|
||||
type DataStruct = < :: icu_provider_adapters :: fallback :: provider :: LocaleFallbackLikelySubtagsV1Marker as :: icu_provider :: DataMarker > :: Yokeable ;
|
||||
pub fn lookup(locale: &icu_provider::DataLocale) -> Option<&'static DataStruct> {
|
||||
locale.is_empty().then(|| &UND)
|
||||
}
|
||||
static UND: DataStruct = include!("und.rs.data");
|
||||
|
|
@ -1,66 +0,0 @@
|
|||
::icu_provider_adapters::fallback::provider::LocaleFallbackLikelySubtagsV1 {
|
||||
l2s: unsafe {
|
||||
#[allow(unused_unsafe)]
|
||||
::zerovec::ZeroMap::from_parts_unchecked(
|
||||
unsafe {
|
||||
:: zerovec :: ZeroVec :: from_bytes_unchecked (b"am\0ar\0as\0be\0bg\0bgcbhobn\0brxchrcv\0doiel\0fa\0gu\0he\0hi\0hy\0ja\0ka\0kk\0km\0kn\0ko\0kokks\0ky\0lo\0maimk\0ml\0mn\0mnimr\0my\0ne\0or\0pa\0ps\0rajru\0sa\0satsd\0si\0sr\0ta\0te\0tg\0th\0ti\0tt\0uk\0ur\0yuezh\0")
|
||||
},
|
||||
unsafe {
|
||||
:: zerovec :: ZeroVec :: from_bytes_unchecked (b"EthiArabBengCyrlCyrlDevaDevaBengDevaCherCyrlDevaGrekArabGujrHebrDevaArmnJpanGeorCyrlKhmrKndaKoreDevaArabCyrlLaooDevaCyrlMlymCyrlBengDevaMymrDevaOryaGuruArabDevaCyrlDevaOlckArabSinhCyrlTamlTeluCyrlThaiEthiCyrlCyrlArabHantHans")
|
||||
},
|
||||
)
|
||||
},
|
||||
lr2s: unsafe {
|
||||
#[allow(unused_unsafe)]
|
||||
::zerovec::ZeroMap2d::from_parts_unchecked(
|
||||
unsafe {
|
||||
::zerovec::ZeroVec::from_bytes_unchecked(
|
||||
b"az\0ha\0kk\0ky\0mn\0ms\0pa\0sd\0sr\0tg\0uz\0yuezh\0",
|
||||
)
|
||||
},
|
||||
unsafe {
|
||||
:: zerovec :: ZeroVec :: from_bytes_unchecked (b"\x03\0\0\0\x05\0\0\0\t\0\0\0\x0B\0\0\0\x0C\0\0\0\r\0\0\0\x0E\0\0\0\x0F\0\0\0\x13\0\0\0\x14\0\0\0\x16\0\0\0\x17\0\0\0&\0\0\0")
|
||||
},
|
||||
unsafe {
|
||||
:: zerovec :: ZeroVec :: from_bytes_unchecked (b"IQ\0IR\0RU\0CM\0SD\0AF\0CN\0IR\0MN\0CN\0TR\0CN\0CC\0PK\0IN\0ME\0RO\0RU\0TR\0PK\0AF\0CN\0CN\0AU\0BN\0GB\0GF\0HK\0ID\0MO\0PA\0PF\0PH\0SR\0TH\0TW\0US\0VN\0")
|
||||
},
|
||||
unsafe {
|
||||
:: zerovec :: ZeroVec :: from_bytes_unchecked (b"ArabArabCyrlArabArabArabArabArabArabArabLatnMongArabArabDevaLatnLatnLatnLatnArabArabCyrlHansHantHantHantHantHantHantHantHantHantHantHantHantHantHantHant")
|
||||
},
|
||||
)
|
||||
},
|
||||
l2r: unsafe {
|
||||
#[allow(unused_unsafe)]
|
||||
::zerovec::ZeroMap::from_parts_unchecked(
|
||||
unsafe {
|
||||
:: zerovec :: ZeroVec :: from_bytes_unchecked (b"af\0am\0ar\0as\0astaz\0be\0bg\0bgcbhobn\0br\0brxbs\0ca\0cebchrcs\0cv\0cy\0da\0de\0doidsbel\0en\0es\0et\0eu\0fa\0ff\0fi\0filfo\0fr\0ga\0gd\0gl\0gu\0ha\0he\0hi\0hr\0hsbhu\0hy\0ia\0id\0ig\0is\0it\0ja\0jv\0ka\0keakgpkk\0km\0kn\0ko\0kokks\0ky\0lo\0lt\0lv\0maimi\0mk\0ml\0mn\0mnimr\0ms\0my\0ne\0nl\0nn\0no\0or\0pa\0pcmpl\0ps\0pt\0qu\0rajrm\0ro\0ru\0sa\0satsc\0sd\0si\0sk\0sl\0so\0sq\0sr\0su\0sv\0sw\0ta\0te\0tg\0th\0ti\0tk\0to\0tr\0tt\0uk\0ur\0uz\0vi\0wo\0xh\0yo\0yrlyuezh\0zu\0")
|
||||
},
|
||||
unsafe {
|
||||
:: zerovec :: ZeroVec :: from_bytes_unchecked (b"ZA\0ET\0EG\0IN\0ES\0AZ\0BY\0BG\0IN\0IN\0BD\0FR\0IN\0BA\0ES\0PH\0US\0CZ\0RU\0GB\0DK\0DE\0IN\0DE\0GR\0US\0ES\0EE\0ES\0IR\0SN\0FI\0PH\0FO\0FR\0IE\0GB\0ES\0IN\0NG\0IL\0IN\0HR\0DE\0HU\0AM\x00001ID\0NG\0IS\0IT\0JP\0ID\0GE\0CV\0BR\0KZ\0KH\0IN\0KR\0IN\0IN\0KG\0LA\0LT\0LV\0IN\0NZ\0MK\0IN\0MN\0IN\0IN\0MY\0MM\0NP\0NL\0NO\0NO\0IN\0IN\0NG\0PL\0AF\0BR\0PE\0IN\0CH\0RO\0RU\0IN\0IN\0IT\0PK\0LK\0SK\0SI\0SO\0AL\0RS\0ID\0SE\0TZ\0IN\0IN\0TJ\0TH\0ET\0TM\0TO\0TR\0RU\0UA\0PK\0UZ\0VN\0SN\0ZA\0NG\0BR\0HK\0CN\0ZA\0")
|
||||
},
|
||||
)
|
||||
},
|
||||
ls2r: unsafe {
|
||||
#[allow(unused_unsafe)]
|
||||
::zerovec::ZeroMap2d::from_parts_unchecked(
|
||||
unsafe {
|
||||
::zerovec::ZeroVec::from_bytes_unchecked(
|
||||
b"az\0en\0ff\0kk\0ky\0mn\0pa\0sd\0tg\0uz\0yuezh\0",
|
||||
)
|
||||
},
|
||||
unsafe {
|
||||
:: zerovec :: ZeroVec :: from_bytes_unchecked (b"\x01\0\0\0\x02\0\0\0\x03\0\0\0\x04\0\0\0\x06\0\0\0\x07\0\0\0\x08\0\0\0\x0B\0\0\0\x0C\0\0\0\r\0\0\0\x0E\0\0\0\x11\0\0\0")
|
||||
},
|
||||
unsafe {
|
||||
::zerovec::ZeroVec::from_bytes_unchecked(
|
||||
b"ArabShawAdlmArabArabLatnMongArabDevaKhojSindArabArabHansBopoHanbHant",
|
||||
)
|
||||
},
|
||||
unsafe {
|
||||
::zerovec::ZeroVec::from_bytes_unchecked(
|
||||
b"IR\0GB\0GN\0CN\0CN\0TR\0CN\0PK\0IN\0IN\0IN\0PK\0AF\0CN\0TW\0TW\0TW\0",
|
||||
)
|
||||
},
|
||||
)
|
||||
},
|
||||
}
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
// @generated
|
||||
pub mod likelysubtags_v1;
|
||||
pub mod parents_v1;
|
||||
pub mod supplement;
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// @generated
|
||||
type DataStruct = < :: icu_provider_adapters :: fallback :: provider :: LocaleFallbackParentsV1Marker as :: icu_provider :: DataMarker > :: Yokeable ;
|
||||
pub fn lookup(locale: &icu_provider::DataLocale) -> Option<&'static DataStruct> {
|
||||
locale.is_empty().then(|| &UND)
|
||||
}
|
||||
static UND: DataStruct = include!("und.rs.data");
|
||||
|
|
@ -1,13 +0,0 @@
|
|||
::icu_provider_adapters::fallback::provider::LocaleFallbackParentsV1 {
|
||||
parents: unsafe {
|
||||
#[allow(unused_unsafe)]
|
||||
::zerovec::ZeroMap::from_parts_unchecked(
|
||||
unsafe {
|
||||
:: zerovec :: VarZeroVec :: from_bytes_unchecked (b"\x84\0\0\0\0\0\x06\0\x0B\0\x10\0\x15\0\x1A\0\x1F\0$\0)\0.\x003\08\0=\0B\0G\0L\0Q\0V\0[\0`\0e\0j\0o\0t\0y\0~\0\x83\0\x88\0\x8D\0\x92\0\x97\0\x9C\0\xA1\0\xA6\0\xAB\0\xB0\0\xB5\0\xBA\0\xBF\0\xC4\0\xC9\0\xCE\0\xD3\0\xD8\0\xDD\0\xE2\0\xE7\0\xEC\0\xF1\0\xF6\0\xFB\0\0\x01\x05\x01\n\x01\x0F\x01\x14\x01\x19\x01\x1E\x01#\x01(\x01-\x012\x017\x01<\x01A\x01F\x01K\x01P\x01U\x01Z\x01_\x01d\x01i\x01n\x01s\x01x\x01}\x01\x82\x01\x87\x01\x8C\x01\x91\x01\x96\x01\x9B\x01\xA0\x01\xA5\x01\xAA\x01\xAF\x01\xB4\x01\xB9\x01\xBE\x01\xC3\x01\xC8\x01\xCD\x01\xD2\x01\xD7\x01\xDC\x01\xE1\x01\xE6\x01\xEB\x01\xF0\x01\xF5\x01\xFA\x01\xFF\x01\x04\x02\t\x02\x0E\x02\x13\x02\x18\x02\x1D\x02\"\x02'\x02,\x021\x026\x02;\x02@\x02G\x02I\x02K\x02M\x02R\x02W\x02\\\x02a\x02f\x02k\x02p\x02u\x02z\x02\x7F\x02\x84\x02\x89\x02en-150en-AGen-AIen-ATen-AUen-BBen-BEen-BMen-BSen-BWen-BZen-CCen-CHen-CKen-CMen-CXen-CYen-DEen-DGen-DKen-DMen-ERen-FIen-FJen-FKen-FMen-GBen-GDen-GGen-GHen-GIen-GMen-GYen-HKen-IEen-ILen-IMen-INen-IOen-JEen-JMen-KEen-KIen-KNen-KYen-LCen-LRen-LSen-MGen-MOen-MSen-MTen-MUen-MVen-MWen-MYen-NAen-NFen-NGen-NLen-NRen-NUen-NZen-PGen-PKen-PNen-PWen-RWen-SBen-SCen-SDen-SEen-SGen-SHen-SIen-SLen-SSen-SXen-SZen-TCen-TKen-TOen-TTen-TVen-TZen-UGen-VCen-VGen-VUen-WSen-ZAen-ZMen-ZWes-ARes-BOes-BRes-BZes-CLes-COes-CRes-CUes-DOes-ECes-GTes-HNes-MXes-NIes-PAes-PEes-PRes-PYes-SVes-USes-UYes-VEhi-Latnhtnbnnno-NOpt-AOpt-CHpt-CVpt-FRpt-GQpt-GWpt-LUpt-MOpt-MZpt-STpt-TLzh-Hant-MO")
|
||||
},
|
||||
unsafe {
|
||||
:: zerovec :: ZeroVec :: from_bytes_unchecked (b"en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419en\0\0\0\0\0\0\x01IN\0fr\0\0\0\0\0\0\x01HT\0no\0\0\0\0\0\0\0\0\0\0no\0\0\0\0\0\0\0\0\0\0no\0\0\0\0\0\0\0\0\0\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0zh\0\x01Hant\x01HK\0")
|
||||
},
|
||||
)
|
||||
},
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
// @generated
|
||||
type DataStruct = < :: icu_provider_adapters :: fallback :: provider :: CollationFallbackSupplementV1Marker as :: icu_provider :: DataMarker > :: Yokeable ;
|
||||
pub fn lookup(locale: &icu_provider::DataLocale) -> Option<&'static DataStruct> {
|
||||
locale.is_empty().then(|| &UND)
|
||||
}
|
||||
static UND: DataStruct = include!("und.rs.data");
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
::icu_provider_adapters::fallback::provider::LocaleFallbackSupplementV1 {
|
||||
parents: unsafe {
|
||||
#[allow(unused_unsafe)]
|
||||
::zerovec::ZeroMap::from_parts_unchecked(
|
||||
unsafe { ::zerovec::VarZeroVec::from_bytes_unchecked(b"\x01\0\0\0\0\0yue") },
|
||||
unsafe { ::zerovec::ZeroVec::from_bytes_unchecked(b"zh\0\x01Hant\0\0\0\0") },
|
||||
)
|
||||
},
|
||||
unicode_extension_defaults: unsafe {
|
||||
#[allow(unused_unsafe)]
|
||||
::zerovec::ZeroMap2d::from_parts_unchecked(
|
||||
unsafe { ::zerovec::ZeroVec::from_bytes_unchecked(b"co") },
|
||||
unsafe { ::zerovec::ZeroVec::from_bytes_unchecked(b"\x02\0\0\0") },
|
||||
unsafe {
|
||||
::zerovec::VarZeroVec::from_bytes_unchecked(b"\x02\0\0\0\0\0\x02\0zhzh-Hant")
|
||||
},
|
||||
unsafe {
|
||||
::zerovec::VarZeroVec::from_bytes_unchecked(b"\x02\0\0\0\0\0\x06\0pinyinstroke")
|
||||
},
|
||||
)
|
||||
},
|
||||
}
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
// @generated
|
||||
pub mod co_v1;
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
::icu_list::provider::ListFormatterPatternsV1([
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", and ", 6u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" and ", 5u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", & ", 4u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" & ", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
])
|
||||
|
|
@ -1,116 +0,0 @@
|
|||
::icu_list::provider::ListFormatterPatternsV1([
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" y ", 3u8),
|
||||
special_case: Some(::icu_list::provider::SpecialCasePattern {
|
||||
condition: unsafe {
|
||||
::icu_list::provider::SerdeDFA::from_dfa_bytes_unchecked(
|
||||
if cfg!(target_endian = "little") {
|
||||
b"rust-regex-automata-dfa-sparse\0\0\xFF\xFE\0\0\x02\0\0\0\0\0\0\0\x0E\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x03\x04\x04\x05\x06\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x08\t\t\t\n\x0B\x0B\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x12\x12\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x14\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x16\x17\x17\x18\x19\x19\x19\x1A\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B(\x01\0\0\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x05\0\x05\x05\x06\x06\x0C\x0C\r\r\0\0S\0\0\0D\0\0\0S\0\0\0D\0\0\0\0\0\0\0\0\x02\0\0\x1B\0\0\x12\0\0\0\x12\0\0\0\0\x03\0\x06\x06\r\r\0\0h\0\0\0h\0\0\0\0\0\0\0\0\x0E\0\0\0\x02\x02\x04\x07\t\t\x0B\x0E\x13\x13\x14\x14\x15\x15\x16\x16\x17\x17\x18\x18\x19\x19\x1A\x1A\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0\xBF\0\0\0\xCE\0\0\0\xDD\0\0\0\xEC\0\0\0\xDD\0\0\0\xFB\0\0\0\n\x01\0\0\x19\x01\0\0\x12\0\0\0\0\x02\0\x0F\x11\0\0D\0\0\0\0\0\0\0\0\x02\0\x11\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x10\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x10\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x0F\0\0\xDD\0\0\0\0\0\0\0\0\x04\0\0\0\0\0\0\0#\0\0\0#\0\0\0#\0\0\0#\0\0\0#\0\0\0\t\0\0\0\x12\0\0\0\x12\0\0\0\0\0\0\0\0\0\0\0#\0\0\0#\0\0\0"
|
||||
} else {
|
||||
b"rust-regex-automata-dfa-sparse\0\0\0\0\xFE\xFF\0\0\0\x02\0\0\0\0\0\0\0\x0E\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x03\x04\x04\x05\x06\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x08\t\t\t\n\x0B\x0B\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x12\x12\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x14\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x16\x17\x17\x18\x19\x19\x19\x1A\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\0\0\x01(\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x05\0\x05\x05\x06\x06\x0C\x0C\r\r\0\0S\0\0\0D\0\0\0S\0\0\0D\0\0\0\0\0\0\0\0\x02\0\0\x1B\0\0\x12\0\0\0\x12\0\0\0\0\x03\0\x06\x06\r\r\0\0h\0\0\0h\0\0\0\0\0\0\0\0\x0E\0\0\0\x02\x02\x04\x07\t\t\x0B\x0E\x13\x13\x14\x14\x15\x15\x16\x16\x17\x17\x18\x18\x19\x19\x1A\x1A\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0\xBF\0\0\0\xCE\0\0\0\xDD\0\0\0\xEC\0\0\0\xDD\0\0\0\xFB\0\0\0\n\x01\0\0\x19\x01\0\0\x12\0\0\0\0\x02\0\x0F\x11\0\0D\0\0\0\0\0\0\0\0\x02\0\x11\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x10\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x10\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x0F\0\0\xDD\0\0\0\0\0\0\0\0\0\0\0\x04\0\0\0\0#\0\0\0#\0\0\0#\0\0\0#\0\0\0\0\0\0#\0\0\0\t\0\0\0\x12\0\0\0\x12\0\0\0\0\0\0\0\0\0\0\0#\0\0\0#"
|
||||
},
|
||||
)
|
||||
},
|
||||
pattern: ::icu_list::provider::ListJoinerPattern::from_parts(" e ", 3u8),
|
||||
}),
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" y ", 3u8),
|
||||
special_case: Some(::icu_list::provider::SpecialCasePattern {
|
||||
condition: unsafe {
|
||||
::icu_list::provider::SerdeDFA::from_dfa_bytes_unchecked(
|
||||
if cfg!(target_endian = "little") {
|
||||
b"rust-regex-automata-dfa-sparse\0\0\xFF\xFE\0\0\x02\0\0\0\0\0\0\0\x0E\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x03\x04\x04\x05\x06\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x08\t\t\t\n\x0B\x0B\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x12\x12\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x14\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x16\x17\x17\x18\x19\x19\x19\x1A\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B(\x01\0\0\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x05\0\x05\x05\x06\x06\x0C\x0C\r\r\0\0S\0\0\0D\0\0\0S\0\0\0D\0\0\0\0\0\0\0\0\x02\0\0\x1B\0\0\x12\0\0\0\x12\0\0\0\0\x03\0\x06\x06\r\r\0\0h\0\0\0h\0\0\0\0\0\0\0\0\x0E\0\0\0\x02\x02\x04\x07\t\t\x0B\x0E\x13\x13\x14\x14\x15\x15\x16\x16\x17\x17\x18\x18\x19\x19\x1A\x1A\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0\xBF\0\0\0\xCE\0\0\0\xDD\0\0\0\xEC\0\0\0\xDD\0\0\0\xFB\0\0\0\n\x01\0\0\x19\x01\0\0\x12\0\0\0\0\x02\0\x0F\x11\0\0D\0\0\0\0\0\0\0\0\x02\0\x11\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x10\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x10\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x0F\0\0\xDD\0\0\0\0\0\0\0\0\x04\0\0\0\0\0\0\0#\0\0\0#\0\0\0#\0\0\0#\0\0\0#\0\0\0\t\0\0\0\x12\0\0\0\x12\0\0\0\0\0\0\0\0\0\0\0#\0\0\0#\0\0\0"
|
||||
} else {
|
||||
b"rust-regex-automata-dfa-sparse\0\0\0\0\xFE\xFF\0\0\0\x02\0\0\0\0\0\0\0\x0E\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x03\x04\x04\x05\x06\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x08\t\t\t\n\x0B\x0B\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x12\x12\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x14\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x16\x17\x17\x18\x19\x19\x19\x1A\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\0\0\x01(\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x05\0\x05\x05\x06\x06\x0C\x0C\r\r\0\0S\0\0\0D\0\0\0S\0\0\0D\0\0\0\0\0\0\0\0\x02\0\0\x1B\0\0\x12\0\0\0\x12\0\0\0\0\x03\0\x06\x06\r\r\0\0h\0\0\0h\0\0\0\0\0\0\0\0\x0E\0\0\0\x02\x02\x04\x07\t\t\x0B\x0E\x13\x13\x14\x14\x15\x15\x16\x16\x17\x17\x18\x18\x19\x19\x1A\x1A\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0\xBF\0\0\0\xCE\0\0\0\xDD\0\0\0\xEC\0\0\0\xDD\0\0\0\xFB\0\0\0\n\x01\0\0\x19\x01\0\0\x12\0\0\0\0\x02\0\x0F\x11\0\0D\0\0\0\0\0\0\0\0\x02\0\x11\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x10\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x10\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x0F\0\0\xDD\0\0\0\0\0\0\0\0\0\0\0\x04\0\0\0\0#\0\0\0#\0\0\0#\0\0\0#\0\0\0\0\0\0#\0\0\0\t\0\0\0\x12\0\0\0\x12\0\0\0\0\0\0\0\0\0\0\0#\0\0\0#"
|
||||
},
|
||||
)
|
||||
},
|
||||
pattern: ::icu_list::provider::ListJoinerPattern::from_parts(" e ", 3u8),
|
||||
}),
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" y ", 3u8),
|
||||
special_case: Some(::icu_list::provider::SpecialCasePattern {
|
||||
condition: unsafe {
|
||||
::icu_list::provider::SerdeDFA::from_dfa_bytes_unchecked(
|
||||
if cfg!(target_endian = "little") {
|
||||
b"rust-regex-automata-dfa-sparse\0\0\xFF\xFE\0\0\x02\0\0\0\0\0\0\0\x0E\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x03\x04\x04\x05\x06\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x08\t\t\t\n\x0B\x0B\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x12\x12\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x14\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x16\x17\x17\x18\x19\x19\x19\x1A\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B(\x01\0\0\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x05\0\x05\x05\x06\x06\x0C\x0C\r\r\0\0S\0\0\0D\0\0\0S\0\0\0D\0\0\0\0\0\0\0\0\x02\0\0\x1B\0\0\x12\0\0\0\x12\0\0\0\0\x03\0\x06\x06\r\r\0\0h\0\0\0h\0\0\0\0\0\0\0\0\x0E\0\0\0\x02\x02\x04\x07\t\t\x0B\x0E\x13\x13\x14\x14\x15\x15\x16\x16\x17\x17\x18\x18\x19\x19\x1A\x1A\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0\xBF\0\0\0\xCE\0\0\0\xDD\0\0\0\xEC\0\0\0\xDD\0\0\0\xFB\0\0\0\n\x01\0\0\x19\x01\0\0\x12\0\0\0\0\x02\0\x0F\x11\0\0D\0\0\0\0\0\0\0\0\x02\0\x11\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x10\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x10\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x0F\0\0\xDD\0\0\0\0\0\0\0\0\x04\0\0\0\0\0\0\0#\0\0\0#\0\0\0#\0\0\0#\0\0\0#\0\0\0\t\0\0\0\x12\0\0\0\x12\0\0\0\0\0\0\0\0\0\0\0#\0\0\0#\0\0\0"
|
||||
} else {
|
||||
b"rust-regex-automata-dfa-sparse\0\0\0\0\xFE\xFF\0\0\0\x02\0\0\0\0\0\0\0\x0E\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x03\x04\x04\x05\x06\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x08\t\t\t\n\x0B\x0B\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x12\x12\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x14\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x16\x17\x17\x18\x19\x19\x19\x1A\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\0\0\x01(\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x05\0\x05\x05\x06\x06\x0C\x0C\r\r\0\0S\0\0\0D\0\0\0S\0\0\0D\0\0\0\0\0\0\0\0\x02\0\0\x1B\0\0\x12\0\0\0\x12\0\0\0\0\x03\0\x06\x06\r\r\0\0h\0\0\0h\0\0\0\0\0\0\0\0\x0E\0\0\0\x02\x02\x04\x07\t\t\x0B\x0E\x13\x13\x14\x14\x15\x15\x16\x16\x17\x17\x18\x18\x19\x19\x1A\x1A\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0\xBF\0\0\0\xCE\0\0\0\xDD\0\0\0\xEC\0\0\0\xDD\0\0\0\xFB\0\0\0\n\x01\0\0\x19\x01\0\0\x12\0\0\0\0\x02\0\x0F\x11\0\0D\0\0\0\0\0\0\0\0\x02\0\x11\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x10\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x10\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x0F\0\0\xDD\0\0\0\0\0\0\0\0\0\0\0\x04\0\0\0\0#\0\0\0#\0\0\0#\0\0\0#\0\0\0\0\0\0#\0\0\0\t\0\0\0\x12\0\0\0\x12\0\0\0\0\0\0\0\0\0\0\0#\0\0\0#"
|
||||
},
|
||||
)
|
||||
},
|
||||
pattern: ::icu_list::provider::ListJoinerPattern::from_parts(" e ", 3u8),
|
||||
}),
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" y ", 3u8),
|
||||
special_case: Some(::icu_list::provider::SpecialCasePattern {
|
||||
condition: unsafe {
|
||||
::icu_list::provider::SerdeDFA::from_dfa_bytes_unchecked(
|
||||
if cfg!(target_endian = "little") {
|
||||
b"rust-regex-automata-dfa-sparse\0\0\xFF\xFE\0\0\x02\0\0\0\0\0\0\0\x0E\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x03\x04\x04\x05\x06\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x08\t\t\t\n\x0B\x0B\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x12\x12\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x14\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x16\x17\x17\x18\x19\x19\x19\x1A\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B(\x01\0\0\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x05\0\x05\x05\x06\x06\x0C\x0C\r\r\0\0S\0\0\0D\0\0\0S\0\0\0D\0\0\0\0\0\0\0\0\x02\0\0\x1B\0\0\x12\0\0\0\x12\0\0\0\0\x03\0\x06\x06\r\r\0\0h\0\0\0h\0\0\0\0\0\0\0\0\x0E\0\0\0\x02\x02\x04\x07\t\t\x0B\x0E\x13\x13\x14\x14\x15\x15\x16\x16\x17\x17\x18\x18\x19\x19\x1A\x1A\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0\xBF\0\0\0\xCE\0\0\0\xDD\0\0\0\xEC\0\0\0\xDD\0\0\0\xFB\0\0\0\n\x01\0\0\x19\x01\0\0\x12\0\0\0\0\x02\0\x0F\x11\0\0D\0\0\0\0\0\0\0\0\x02\0\x11\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x10\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x10\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x0F\0\0\xDD\0\0\0\0\0\0\0\0\x04\0\0\0\0\0\0\0#\0\0\0#\0\0\0#\0\0\0#\0\0\0#\0\0\0\t\0\0\0\x12\0\0\0\x12\0\0\0\0\0\0\0\0\0\0\0#\0\0\0#\0\0\0"
|
||||
} else {
|
||||
b"rust-regex-automata-dfa-sparse\0\0\0\0\xFE\xFF\0\0\0\x02\0\0\0\0\0\0\0\x0E\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x03\x04\x04\x05\x06\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x08\t\t\t\n\x0B\x0B\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x12\x12\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x14\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x16\x17\x17\x18\x19\x19\x19\x1A\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\0\0\x01(\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x05\0\x05\x05\x06\x06\x0C\x0C\r\r\0\0S\0\0\0D\0\0\0S\0\0\0D\0\0\0\0\0\0\0\0\x02\0\0\x1B\0\0\x12\0\0\0\x12\0\0\0\0\x03\0\x06\x06\r\r\0\0h\0\0\0h\0\0\0\0\0\0\0\0\x0E\0\0\0\x02\x02\x04\x07\t\t\x0B\x0E\x13\x13\x14\x14\x15\x15\x16\x16\x17\x17\x18\x18\x19\x19\x1A\x1A\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0\xBF\0\0\0\xCE\0\0\0\xDD\0\0\0\xEC\0\0\0\xDD\0\0\0\xFB\0\0\0\n\x01\0\0\x19\x01\0\0\x12\0\0\0\0\x02\0\x0F\x11\0\0D\0\0\0\0\0\0\0\0\x02\0\x11\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x10\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x10\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x0F\0\0\xDD\0\0\0\0\0\0\0\0\0\0\0\x04\0\0\0\0#\0\0\0#\0\0\0#\0\0\0#\0\0\0\0\0\0#\0\0\0\t\0\0\0\x12\0\0\0\x12\0\0\0\0\0\0\0\0\0\0\0#\0\0\0#"
|
||||
},
|
||||
)
|
||||
},
|
||||
pattern: ::icu_list::provider::ListJoinerPattern::from_parts(" e ", 3u8),
|
||||
}),
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" y ", 3u8),
|
||||
special_case: Some(::icu_list::provider::SpecialCasePattern {
|
||||
condition: unsafe {
|
||||
::icu_list::provider::SerdeDFA::from_dfa_bytes_unchecked(
|
||||
if cfg!(target_endian = "little") {
|
||||
b"rust-regex-automata-dfa-sparse\0\0\xFF\xFE\0\0\x02\0\0\0\0\0\0\0\x0E\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x03\x04\x04\x05\x06\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x08\t\t\t\n\x0B\x0B\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x12\x12\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x14\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x16\x17\x17\x18\x19\x19\x19\x1A\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B(\x01\0\0\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x05\0\x05\x05\x06\x06\x0C\x0C\r\r\0\0S\0\0\0D\0\0\0S\0\0\0D\0\0\0\0\0\0\0\0\x02\0\0\x1B\0\0\x12\0\0\0\x12\0\0\0\0\x03\0\x06\x06\r\r\0\0h\0\0\0h\0\0\0\0\0\0\0\0\x0E\0\0\0\x02\x02\x04\x07\t\t\x0B\x0E\x13\x13\x14\x14\x15\x15\x16\x16\x17\x17\x18\x18\x19\x19\x1A\x1A\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0\xBF\0\0\0\xCE\0\0\0\xDD\0\0\0\xEC\0\0\0\xDD\0\0\0\xFB\0\0\0\n\x01\0\0\x19\x01\0\0\x12\0\0\0\0\x02\0\x0F\x11\0\0D\0\0\0\0\0\0\0\0\x02\0\x11\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x10\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x10\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x0F\0\0\xDD\0\0\0\0\0\0\0\0\x04\0\0\0\0\0\0\0#\0\0\0#\0\0\0#\0\0\0#\0\0\0#\0\0\0\t\0\0\0\x12\0\0\0\x12\0\0\0\0\0\0\0\0\0\0\0#\0\0\0#\0\0\0"
|
||||
} else {
|
||||
b"rust-regex-automata-dfa-sparse\0\0\0\0\xFE\xFF\0\0\0\x02\0\0\0\0\0\0\0\x0E\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x03\x04\x04\x05\x06\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x08\t\t\t\n\x0B\x0B\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x12\x12\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x14\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x16\x17\x17\x18\x19\x19\x19\x1A\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\0\0\x01(\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x05\0\x05\x05\x06\x06\x0C\x0C\r\r\0\0S\0\0\0D\0\0\0S\0\0\0D\0\0\0\0\0\0\0\0\x02\0\0\x1B\0\0\x12\0\0\0\x12\0\0\0\0\x03\0\x06\x06\r\r\0\0h\0\0\0h\0\0\0\0\0\0\0\0\x0E\0\0\0\x02\x02\x04\x07\t\t\x0B\x0E\x13\x13\x14\x14\x15\x15\x16\x16\x17\x17\x18\x18\x19\x19\x1A\x1A\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0\xBF\0\0\0\xCE\0\0\0\xDD\0\0\0\xEC\0\0\0\xDD\0\0\0\xFB\0\0\0\n\x01\0\0\x19\x01\0\0\x12\0\0\0\0\x02\0\x0F\x11\0\0D\0\0\0\0\0\0\0\0\x02\0\x11\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x10\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x10\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x0F\0\0\xDD\0\0\0\0\0\0\0\0\0\0\0\x04\0\0\0\0#\0\0\0#\0\0\0#\0\0\0#\0\0\0\0\0\0#\0\0\0\t\0\0\0\x12\0\0\0\x12\0\0\0\0\0\0\0\0\0\0\0#\0\0\0#"
|
||||
},
|
||||
)
|
||||
},
|
||||
pattern: ::icu_list::provider::ListJoinerPattern::from_parts(" e ", 3u8),
|
||||
}),
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" y ", 3u8),
|
||||
special_case: Some(::icu_list::provider::SpecialCasePattern {
|
||||
condition: unsafe {
|
||||
::icu_list::provider::SerdeDFA::from_dfa_bytes_unchecked(
|
||||
if cfg!(target_endian = "little") {
|
||||
b"rust-regex-automata-dfa-sparse\0\0\xFF\xFE\0\0\x02\0\0\0\0\0\0\0\x0E\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x03\x04\x04\x05\x06\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x08\t\t\t\n\x0B\x0B\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x12\x12\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x14\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x16\x17\x17\x18\x19\x19\x19\x1A\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B(\x01\0\0\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x05\0\x05\x05\x06\x06\x0C\x0C\r\r\0\0S\0\0\0D\0\0\0S\0\0\0D\0\0\0\0\0\0\0\0\x02\0\0\x1B\0\0\x12\0\0\0\x12\0\0\0\0\x03\0\x06\x06\r\r\0\0h\0\0\0h\0\0\0\0\0\0\0\0\x0E\0\0\0\x02\x02\x04\x07\t\t\x0B\x0E\x13\x13\x14\x14\x15\x15\x16\x16\x17\x17\x18\x18\x19\x19\x1A\x1A\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0\xBF\0\0\0\xCE\0\0\0\xDD\0\0\0\xEC\0\0\0\xDD\0\0\0\xFB\0\0\0\n\x01\0\0\x19\x01\0\0\x12\0\0\0\0\x02\0\x0F\x11\0\0D\0\0\0\0\0\0\0\0\x02\0\x11\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x10\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x10\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x0F\0\0\xDD\0\0\0\0\0\0\0\0\x04\0\0\0\0\0\0\0#\0\0\0#\0\0\0#\0\0\0#\0\0\0#\0\0\0\t\0\0\0\x12\0\0\0\x12\0\0\0\0\0\0\0\0\0\0\0#\0\0\0#\0\0\0"
|
||||
} else {
|
||||
b"rust-regex-automata-dfa-sparse\0\0\0\0\xFE\xFF\0\0\0\x02\0\0\0\0\0\0\0\x0E\0\0\0\x01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\x01\x02\x02\x02\x03\x04\x04\x05\x06\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x07\x08\t\t\t\n\x0B\x0B\x0C\r\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0E\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x0F\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x10\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x11\x12\x12\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x13\x14\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x15\x16\x17\x17\x18\x19\x19\x19\x1A\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\x1B\0\0\x01(\x01\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x01\x80\0\0\0\0\0\0\x01\0\0\0\0\0\0\0\0\x05\0\x05\x05\x06\x06\x0C\x0C\r\r\0\0S\0\0\0D\0\0\0S\0\0\0D\0\0\0\0\0\0\0\0\x02\0\0\x1B\0\0\x12\0\0\0\x12\0\0\0\0\x03\0\x06\x06\r\r\0\0h\0\0\0h\0\0\0\0\0\0\0\0\x0E\0\0\0\x02\x02\x04\x07\t\t\x0B\x0E\x13\x13\x14\x14\x15\x15\x16\x16\x17\x17\x18\x18\x19\x19\x1A\x1A\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0D\0\0\0\xBF\0\0\0\xCE\0\0\0\xDD\0\0\0\xEC\0\0\0\xDD\0\0\0\xFB\0\0\0\n\x01\0\0\x19\x01\0\0\x12\0\0\0\0\x02\0\x0F\x11\0\0D\0\0\0\0\0\0\0\0\x02\0\x11\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x0F\x10\0\0\xBF\0\0\0\0\0\0\0\0\x02\0\x10\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x11\0\0\xDD\0\0\0\0\0\0\0\0\x02\0\x0F\x0F\0\0\xDD\0\0\0\0\0\0\0\0\0\0\0\x04\0\0\0\0#\0\0\0#\0\0\0#\0\0\0#\0\0\0\0\0\0#\0\0\0\t\0\0\0\x12\0\0\0\x12\0\0\0\0\0\0\0\0\0\0\0#\0\0\0#"
|
||||
},
|
||||
)
|
||||
},
|
||||
pattern: ::icu_list::provider::ListJoinerPattern::from_parts(" e ", 3u8),
|
||||
}),
|
||||
},
|
||||
])
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
::icu_list::provider::ListFormatterPatternsV1([
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" et ", 4u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" et ", 4u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" et ", 4u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" et ", 4u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
])
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
::icu_list::provider::ListFormatterPatternsV1([
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" e ", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" e ", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" e ", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" e ", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" e ", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" e ", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
])
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
::icu_list::provider::ListFormatterPatternsV1([
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
])
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
// @generated
|
||||
type DataStruct = <::icu_list::provider::AndListV1Marker as ::icu_provider::DataMarker>::Yokeable;
|
||||
pub fn lookup(locale: &icu_provider::DataLocale) -> Option<&'static DataStruct> {
|
||||
static KEYS: [&str; 12usize] =
|
||||
["en", "es", "fr", "it", "ja", "pt", "ru", "tr", "und", "zh", "zh-Hans", "zh-Hant"];
|
||||
static DATA: [&DataStruct; 12usize] =
|
||||
[&EN, &ES, &FR, &IT, &JA, &PT, &RU, &TR, &UND, &ZH, &ZH, &ZH_HANT];
|
||||
KEYS.binary_search_by(|k| locale.strict_cmp(k.as_bytes()).reverse())
|
||||
.ok()
|
||||
.map(|i| unsafe { *DATA.get_unchecked(i) })
|
||||
}
|
||||
static EN: DataStruct = include!("en.rs.data");
|
||||
static ES: DataStruct = include!("es.rs.data");
|
||||
static FR: DataStruct = include!("fr.rs.data");
|
||||
static IT: DataStruct = include!("it.rs.data");
|
||||
static JA: DataStruct = include!("ja.rs.data");
|
||||
static PT: DataStruct = include!("pt.rs.data");
|
||||
static RU: DataStruct = include!("ru.rs.data");
|
||||
static TR: DataStruct = include!("tr.rs.data");
|
||||
static UND: DataStruct = include!("und.rs.data");
|
||||
static ZH_HANT: DataStruct = include!("zh-Hant.rs.data");
|
||||
static ZH: DataStruct = include!("zh.rs.data");
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
::icu_list::provider::ListFormatterPatternsV1([
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" e ", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" e ", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" e ", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" e ", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
])
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
::icu_list::provider::ListFormatterPatternsV1([
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" и ", 4u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" и ", 4u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" и ", 4u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" и ", 4u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
])
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
::icu_list::provider::ListFormatterPatternsV1([
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" ve ", 4u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" ve ", 4u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" ve ", 4u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(" ve ", 4u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
])
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
::icu_list::provider::ListFormatterPatternsV1([
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts(", ", 2u8),
|
||||
special_case: None,
|
||||
},
|
||||
])
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
::icu_list::provider::ListFormatterPatternsV1([
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("和", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("和", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("和", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("和", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("和", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("和", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
])
|
||||
|
|
@ -1,50 +0,0 @@
|
|||
::icu_list::provider::ListFormatterPatternsV1([
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("和", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("和", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("和", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("和", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
::icu_list::provider::ConditionalListJoinerPattern {
|
||||
default: ::icu_list::provider::ListJoinerPattern::from_parts("、", 3u8),
|
||||
special_case: None,
|
||||
},
|
||||
])
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
// @generated
|
||||
pub mod and_v1;
|
||||
46
compiler/rustc_baked_icu_data/src/data/macros.rs
Normal file
46
compiler/rustc_baked_icu_data/src/data/macros.rs
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
// @generated
|
||||
/// Marks a type as a data provider. You can then use macros like
|
||||
/// `impl_core_helloworld_v1` to add implementations.
|
||||
///
|
||||
/// ```ignore
|
||||
/// struct MyProvider;
|
||||
/// const _: () = {
|
||||
/// include!("path/to/generated/macros.rs");
|
||||
/// make_provider!(MyProvider);
|
||||
/// impl_core_helloworld_v1!(MyProvider);
|
||||
/// }
|
||||
/// ```
|
||||
#[doc(hidden)]
|
||||
#[macro_export]
|
||||
macro_rules! __make_provider {
|
||||
($ name : ty) => {
|
||||
#[clippy::msrv = "1.66"]
|
||||
impl $name {
|
||||
#[doc(hidden)]
|
||||
#[allow(dead_code)]
|
||||
pub const MUST_USE_MAKE_PROVIDER_MACRO: () = ();
|
||||
}
|
||||
};
|
||||
}
|
||||
#[doc(inline)]
|
||||
pub use __make_provider as make_provider;
|
||||
#[macro_use]
|
||||
#[path = "macros/fallback_likelysubtags_v1.data.rs"]
|
||||
mod fallback_likelysubtags_v1;
|
||||
#[doc(inline)]
|
||||
pub use __impl_fallback_likelysubtags_v1 as impl_fallback_likelysubtags_v1;
|
||||
#[macro_use]
|
||||
#[path = "macros/fallback_parents_v1.data.rs"]
|
||||
mod fallback_parents_v1;
|
||||
#[doc(inline)]
|
||||
pub use __impl_fallback_parents_v1 as impl_fallback_parents_v1;
|
||||
#[macro_use]
|
||||
#[path = "macros/fallback_supplement_co_v1.data.rs"]
|
||||
mod fallback_supplement_co_v1;
|
||||
#[doc(inline)]
|
||||
pub use __impl_fallback_supplement_co_v1 as impl_fallback_supplement_co_v1;
|
||||
#[macro_use]
|
||||
#[path = "macros/list_and_v1.data.rs"]
|
||||
mod list_and_v1;
|
||||
#[doc(inline)]
|
||||
pub use __impl_list_and_v1 as impl_list_and_v1;
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
// @generated
|
||||
/// Implement `DataProvider<LocaleFallbackLikelySubtagsV1Marker>` on the given struct using the data
|
||||
/// hardcoded in this file. This allows the struct to be used with
|
||||
/// `icu`'s `_unstable` constructors.
|
||||
#[doc(hidden)]
|
||||
#[macro_export]
|
||||
macro_rules! __impl_fallback_likelysubtags_v1 {
|
||||
($ provider : ty) => {
|
||||
#[clippy::msrv = "1.66"]
|
||||
const _: () = <$provider>::MUST_USE_MAKE_PROVIDER_MACRO;
|
||||
#[clippy::msrv = "1.66"]
|
||||
impl $provider {
|
||||
#[doc(hidden)]
|
||||
pub const SINGLETON_FALLBACK_LIKELYSUBTAGS_V1: &'static <icu_locid_transform::provider::LocaleFallbackLikelySubtagsV1Marker as icu_provider::DataMarker>::Yokeable = &icu_locid_transform::provider::LocaleFallbackLikelySubtagsV1 {
|
||||
l2s: unsafe {
|
||||
#[allow(unused_unsafe)]
|
||||
zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"am\0ar\0as\0be\0bg\0bgcbhobn\0brxchrcv\0doiel\0fa\0gu\0he\0hi\0hy\0ja\0ka\0kk\0km\0kn\0ko\0kokks\0ky\0lo\0maimk\0ml\0mn\0mnimr\0my\0ne\0or\0pa\0ps\0rajru\0sa\0satsd\0si\0sr\0ta\0te\0tg\0th\0ti\0tt\0uk\0ur\0yuezh\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"EthiArabBengCyrlCyrlDevaDevaBengDevaCherCyrlDevaGrekArabGujrHebrDevaArmnJpanGeorCyrlKhmrKndaKoreDevaArabCyrlLaooDevaCyrlMlymCyrlBengDevaMymrDevaOryaGuruArabDevaCyrlDevaOlckArabSinhCyrlTamlTeluCyrlThaiEthiCyrlCyrlArabHantHans") })
|
||||
},
|
||||
lr2s: unsafe {
|
||||
#[allow(unused_unsafe)]
|
||||
zerovec::ZeroMap2d::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"az\0ha\0kk\0ky\0mn\0ms\0pa\0sd\0sr\0tg\0uz\0yuezh\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x03\0\0\0\x05\0\0\0\t\0\0\0\x0B\0\0\0\x0C\0\0\0\r\0\0\0\x0E\0\0\0\x0F\0\0\0\x13\0\0\0\x14\0\0\0\x16\0\0\0\x17\0\0\0&\0\0\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"IQ\0IR\0RU\0CM\0SD\0AF\0CN\0IR\0MN\0CN\0TR\0CN\0CC\0PK\0IN\0ME\0RO\0RU\0TR\0PK\0AF\0CN\0CN\0AU\0BN\0GB\0GF\0HK\0ID\0MO\0PA\0PF\0PH\0SR\0TH\0TW\0US\0VN\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"ArabArabCyrlArabArabArabArabArabArabArabLatnMongArabArabDevaLatnLatnLatnLatnArabArabCyrlHansHantHantHantHantHantHantHantHantHantHantHantHantHantHantHant") })
|
||||
},
|
||||
l2r: unsafe {
|
||||
#[allow(unused_unsafe)]
|
||||
zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"af\0am\0ar\0as\0astaz\0be\0bg\0bgcbhobn\0br\0brxbs\0ca\0cebchrcs\0cv\0cy\0da\0de\0doidsbel\0en\0es\0et\0eu\0fa\0ff\0fi\0filfo\0fr\0ga\0gd\0gl\0gu\0ha\0he\0hi\0hr\0hsbhu\0hy\0ia\0id\0ig\0is\0it\0ja\0jv\0ka\0keakgpkk\0km\0kn\0ko\0kokks\0ky\0lo\0lt\0lv\0maimi\0mk\0ml\0mn\0mnimr\0ms\0my\0ne\0nl\0nn\0no\0or\0pa\0pcmpl\0ps\0pt\0qu\0rajrm\0ro\0ru\0sa\0satsc\0sd\0si\0sk\0sl\0so\0sq\0sr\0su\0sv\0sw\0ta\0te\0tg\0th\0ti\0tk\0to\0tr\0tt\0uk\0ur\0uz\0vi\0wo\0xh\0yo\0yrlyuezh\0zu\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"ZA\0ET\0EG\0IN\0ES\0AZ\0BY\0BG\0IN\0IN\0BD\0FR\0IN\0BA\0ES\0PH\0US\0CZ\0RU\0GB\0DK\0DE\0IN\0DE\0GR\0US\0ES\0EE\0ES\0IR\0SN\0FI\0PH\0FO\0FR\0IE\0GB\0ES\0IN\0NG\0IL\0IN\0HR\0DE\0HU\0AM\x00001ID\0NG\0IS\0IT\0JP\0ID\0GE\0CV\0BR\0KZ\0KH\0IN\0KR\0IN\0IN\0KG\0LA\0LT\0LV\0IN\0NZ\0MK\0IN\0MN\0IN\0IN\0MY\0MM\0NP\0NL\0NO\0NO\0IN\0IN\0NG\0PL\0AF\0BR\0PE\0IN\0CH\0RO\0RU\0IN\0IN\0IT\0PK\0LK\0SK\0SI\0SO\0AL\0RS\0ID\0SE\0TZ\0IN\0IN\0TJ\0TH\0ET\0TM\0TO\0TR\0RU\0UA\0PK\0UZ\0VN\0SN\0ZA\0NG\0BR\0HK\0CN\0ZA\0") })
|
||||
},
|
||||
ls2r: unsafe {
|
||||
#[allow(unused_unsafe)]
|
||||
zerovec::ZeroMap2d::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"az\0en\0ff\0kk\0ky\0mn\0pa\0sd\0tg\0uz\0yuezh\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x01\0\0\0\x02\0\0\0\x03\0\0\0\x04\0\0\0\x06\0\0\0\x07\0\0\0\x08\0\0\0\x0B\0\0\0\x0C\0\0\0\r\0\0\0\x0E\0\0\0\x11\0\0\0") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"ArabShawAdlmArabArabLatnMongArabDevaKhojSindArabArabHansBopoHanbHant") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"IR\0GB\0GN\0CN\0CN\0TR\0CN\0PK\0IN\0IN\0IN\0PK\0AF\0CN\0TW\0TW\0TW\0") })
|
||||
},
|
||||
};
|
||||
}
|
||||
#[clippy::msrv = "1.66"]
|
||||
impl icu_provider::DataProvider<icu_locid_transform::provider::LocaleFallbackLikelySubtagsV1Marker> for $provider {
|
||||
fn load(&self, req: icu_provider::DataRequest) -> Result<icu_provider::DataResponse<icu_locid_transform::provider::LocaleFallbackLikelySubtagsV1Marker>, icu_provider::DataError> {
|
||||
if req.locale.is_empty() { Ok(icu_provider::DataResponse { payload: Some(icu_provider::DataPayload::from_static_ref(Self::SINGLETON_FALLBACK_LIKELYSUBTAGS_V1)), metadata: Default::default() }) } else { Err(icu_provider::DataErrorKind::ExtraneousLocale.with_req(<icu_locid_transform::provider::LocaleFallbackLikelySubtagsV1Marker as icu_provider::KeyedDataMarker>::KEY, req)) }
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,28 @@
|
|||
// @generated
|
||||
/// Implement `DataProvider<LocaleFallbackParentsV1Marker>` on the given struct using the data
|
||||
/// hardcoded in this file. This allows the struct to be used with
|
||||
/// `icu`'s `_unstable` constructors.
|
||||
#[doc(hidden)]
|
||||
#[macro_export]
|
||||
macro_rules! __impl_fallback_parents_v1 {
|
||||
($ provider : ty) => {
|
||||
#[clippy::msrv = "1.66"]
|
||||
const _: () = <$provider>::MUST_USE_MAKE_PROVIDER_MACRO;
|
||||
#[clippy::msrv = "1.66"]
|
||||
impl $provider {
|
||||
#[doc(hidden)]
|
||||
pub const SINGLETON_FALLBACK_PARENTS_V1: &'static <icu_locid_transform::provider::LocaleFallbackParentsV1Marker as icu_provider::DataMarker>::Yokeable = &icu_locid_transform::provider::LocaleFallbackParentsV1 {
|
||||
parents: unsafe {
|
||||
#[allow(unused_unsafe)]
|
||||
zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::VarZeroVec::from_bytes_unchecked(b"\x84\0\0\0\0\0\x06\0\x0B\0\x10\0\x15\0\x1A\0\x1F\0$\0)\0.\x003\08\0=\0B\0G\0L\0Q\0V\0[\0`\0e\0j\0o\0t\0y\0~\0\x83\0\x88\0\x8D\0\x92\0\x97\0\x9C\0\xA1\0\xA6\0\xAB\0\xB0\0\xB5\0\xBA\0\xBF\0\xC4\0\xC9\0\xCE\0\xD3\0\xD8\0\xDD\0\xE2\0\xE7\0\xEC\0\xF1\0\xF6\0\xFB\0\0\x01\x05\x01\n\x01\x0F\x01\x14\x01\x19\x01\x1E\x01#\x01(\x01-\x012\x017\x01<\x01A\x01F\x01K\x01P\x01U\x01Z\x01_\x01d\x01i\x01n\x01s\x01x\x01}\x01\x82\x01\x87\x01\x8C\x01\x91\x01\x96\x01\x9B\x01\xA0\x01\xA5\x01\xAA\x01\xAF\x01\xB4\x01\xB9\x01\xBE\x01\xC3\x01\xC8\x01\xCD\x01\xD2\x01\xD7\x01\xDC\x01\xE1\x01\xE6\x01\xEB\x01\xF0\x01\xF5\x01\xFA\x01\xFF\x01\x04\x02\t\x02\x0E\x02\x13\x02\x18\x02\x1D\x02\"\x02'\x02,\x021\x026\x02;\x02@\x02G\x02I\x02K\x02M\x02R\x02W\x02\\\x02a\x02f\x02k\x02p\x02u\x02z\x02\x7F\x02\x84\x02\x89\x02en-150en-AGen-AIen-ATen-AUen-BBen-BEen-BMen-BSen-BWen-BZen-CCen-CHen-CKen-CMen-CXen-CYen-DEen-DGen-DKen-DMen-ERen-FIen-FJen-FKen-FMen-GBen-GDen-GGen-GHen-GIen-GMen-GYen-HKen-IEen-ILen-IMen-INen-IOen-JEen-JMen-KEen-KIen-KNen-KYen-LCen-LRen-LSen-MGen-MOen-MSen-MTen-MUen-MVen-MWen-MYen-NAen-NFen-NGen-NLen-NRen-NUen-NZen-PGen-PKen-PNen-PWen-RWen-SBen-SCen-SDen-SEen-SGen-SHen-SIen-SLen-SSen-SXen-SZen-TCen-TKen-TOen-TTen-TVen-TZen-UGen-VCen-VGen-VUen-WSen-ZAen-ZMen-ZWes-ARes-BOes-BRes-BZes-CLes-COes-CRes-CUes-DOes-ECes-GTes-HNes-MXes-NIes-PAes-PEes-PRes-PYes-SVes-USes-UYes-VEhi-Latnhtnbnnno-NOpt-AOpt-CHpt-CVpt-FRpt-GQpt-GWpt-LUpt-MOpt-MZpt-STpt-TLzh-Hant-MO") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01150en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001en\0\0\0\0\0\0\x01001es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419es\0\0\0\0\0\0\x01419en\0\0\0\0\0\0\x01IN\0fr\0\0\0\0\0\0\x01HT\0no\0\0\0\0\0\0\0\0\0\0no\0\0\0\0\0\0\0\0\0\0no\0\0\0\0\0\0\0\0\0\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0pt\0\0\0\0\0\0\x01PT\0zh\0\x01Hant\x01HK\0") })
|
||||
},
|
||||
};
|
||||
}
|
||||
#[clippy::msrv = "1.66"]
|
||||
impl icu_provider::DataProvider<icu_locid_transform::provider::LocaleFallbackParentsV1Marker> for $provider {
|
||||
fn load(&self, req: icu_provider::DataRequest) -> Result<icu_provider::DataResponse<icu_locid_transform::provider::LocaleFallbackParentsV1Marker>, icu_provider::DataError> {
|
||||
if req.locale.is_empty() { Ok(icu_provider::DataResponse { payload: Some(icu_provider::DataPayload::from_static_ref(Self::SINGLETON_FALLBACK_PARENTS_V1)), metadata: Default::default() }) } else { Err(icu_provider::DataErrorKind::ExtraneousLocale.with_req(<icu_locid_transform::provider::LocaleFallbackParentsV1Marker as icu_provider::KeyedDataMarker>::KEY, req)) }
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
// @generated
|
||||
/// Implement `DataProvider<CollationFallbackSupplementV1Marker>` on the given struct using the data
|
||||
/// hardcoded in this file. This allows the struct to be used with
|
||||
/// `icu`'s `_unstable` constructors.
|
||||
#[doc(hidden)]
|
||||
#[macro_export]
|
||||
macro_rules! __impl_fallback_supplement_co_v1 {
|
||||
($ provider : ty) => {
|
||||
#[clippy::msrv = "1.66"]
|
||||
const _: () = <$provider>::MUST_USE_MAKE_PROVIDER_MACRO;
|
||||
#[clippy::msrv = "1.66"]
|
||||
impl $provider {
|
||||
#[doc(hidden)]
|
||||
pub const SINGLETON_FALLBACK_SUPPLEMENT_CO_V1: &'static <icu_locid_transform::provider::CollationFallbackSupplementV1Marker as icu_provider::DataMarker>::Yokeable = &icu_locid_transform::provider::LocaleFallbackSupplementV1 {
|
||||
parents: unsafe {
|
||||
#[allow(unused_unsafe)]
|
||||
zerovec::ZeroMap::from_parts_unchecked(unsafe { zerovec::VarZeroVec::from_bytes_unchecked(b"\x01\0\0\0\0\0yue") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"zh\0\x01Hant\0\0\0\0") })
|
||||
},
|
||||
unicode_extension_defaults: unsafe {
|
||||
#[allow(unused_unsafe)]
|
||||
zerovec::ZeroMap2d::from_parts_unchecked(unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"co") }, unsafe { zerovec::ZeroVec::from_bytes_unchecked(b"\x02\0\0\0") }, unsafe { zerovec::VarZeroVec::from_bytes_unchecked(b"\x02\0\0\0\0\0\x02\0zhzh-Hant") }, unsafe { zerovec::VarZeroVec::from_bytes_unchecked(b"\x02\0\0\0\0\0\x06\0pinyinstroke") })
|
||||
},
|
||||
};
|
||||
}
|
||||
#[clippy::msrv = "1.66"]
|
||||
impl icu_provider::DataProvider<icu_locid_transform::provider::CollationFallbackSupplementV1Marker> for $provider {
|
||||
fn load(&self, req: icu_provider::DataRequest) -> Result<icu_provider::DataResponse<icu_locid_transform::provider::CollationFallbackSupplementV1Marker>, icu_provider::DataError> {
|
||||
if req.locale.is_empty() { Ok(icu_provider::DataResponse { payload: Some(icu_provider::DataPayload::from_static_ref(Self::SINGLETON_FALLBACK_SUPPLEMENT_CO_V1)), metadata: Default::default() }) } else { Err(icu_provider::DataErrorKind::ExtraneousLocale.with_req(<icu_locid_transform::provider::CollationFallbackSupplementV1Marker as icu_provider::KeyedDataMarker>::KEY, req)) }
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,122 +1,31 @@
|
|||
// @generated
|
||||
#[clippy::msrv = "1.61"]
|
||||
mod fallback;
|
||||
#[clippy::msrv = "1.61"]
|
||||
mod list;
|
||||
#[clippy::msrv = "1.61"]
|
||||
use icu_provider::prelude::*;
|
||||
/// Implement [`DataProvider<M>`] on the given struct using the data
|
||||
/// hardcoded in this module. This allows the struct to be used with
|
||||
/// `icu`'s `_unstable` constructors.
|
||||
///
|
||||
/// This macro can only be called from its definition-site, i.e. right
|
||||
/// after `include!`-ing the generated module.
|
||||
///
|
||||
/// ```compile_fail
|
||||
/// struct MyDataProvider;
|
||||
/// include!("/path/to/generated/mod.rs");
|
||||
/// impl_data_provider(MyDataProvider);
|
||||
/// ```
|
||||
#[allow(unused_macros)]
|
||||
include!("macros.rs");
|
||||
macro_rules! impl_data_provider {
|
||||
($ provider : path) => {
|
||||
#[clippy::msrv = "1.61"]
|
||||
impl DataProvider<::icu_list::provider::AndListV1Marker> for $provider {
|
||||
fn load(&self, req: DataRequest) -> Result<DataResponse<::icu_list::provider::AndListV1Marker>, DataError> {
|
||||
list::and_v1::lookup(&req.locale)
|
||||
.map(zerofrom::ZeroFrom::zero_from)
|
||||
.map(DataPayload::from_owned)
|
||||
.map(|payload| DataResponse { metadata: Default::default(), payload: Some(payload) })
|
||||
.ok_or_else(|| DataErrorKind::MissingLocale.with_req(::icu_list::provider::AndListV1Marker::KEY, req))
|
||||
}
|
||||
}
|
||||
#[clippy::msrv = "1.61"]
|
||||
impl DataProvider<::icu_provider_adapters::fallback::provider::CollationFallbackSupplementV1Marker> for $provider {
|
||||
fn load(
|
||||
&self,
|
||||
req: DataRequest,
|
||||
) -> Result<DataResponse<::icu_provider_adapters::fallback::provider::CollationFallbackSupplementV1Marker>, DataError> {
|
||||
fallback::supplement::co_v1::lookup(&req.locale)
|
||||
.map(zerofrom::ZeroFrom::zero_from)
|
||||
.map(DataPayload::from_owned)
|
||||
.map(|payload| DataResponse { metadata: Default::default(), payload: Some(payload) })
|
||||
.ok_or_else(|| {
|
||||
DataErrorKind::MissingLocale
|
||||
.with_req(::icu_provider_adapters::fallback::provider::CollationFallbackSupplementV1Marker::KEY, req)
|
||||
})
|
||||
}
|
||||
}
|
||||
#[clippy::msrv = "1.61"]
|
||||
impl DataProvider<::icu_provider_adapters::fallback::provider::LocaleFallbackLikelySubtagsV1Marker> for $provider {
|
||||
fn load(
|
||||
&self,
|
||||
req: DataRequest,
|
||||
) -> Result<DataResponse<::icu_provider_adapters::fallback::provider::LocaleFallbackLikelySubtagsV1Marker>, DataError> {
|
||||
fallback::likelysubtags_v1::lookup(&req.locale)
|
||||
.map(zerofrom::ZeroFrom::zero_from)
|
||||
.map(DataPayload::from_owned)
|
||||
.map(|payload| DataResponse { metadata: Default::default(), payload: Some(payload) })
|
||||
.ok_or_else(|| {
|
||||
DataErrorKind::MissingLocale
|
||||
.with_req(::icu_provider_adapters::fallback::provider::LocaleFallbackLikelySubtagsV1Marker::KEY, req)
|
||||
})
|
||||
}
|
||||
}
|
||||
#[clippy::msrv = "1.61"]
|
||||
impl DataProvider<::icu_provider_adapters::fallback::provider::LocaleFallbackParentsV1Marker> for $provider {
|
||||
fn load(
|
||||
&self,
|
||||
req: DataRequest,
|
||||
) -> Result<DataResponse<::icu_provider_adapters::fallback::provider::LocaleFallbackParentsV1Marker>, DataError> {
|
||||
fallback::parents_v1::lookup(&req.locale)
|
||||
.map(zerofrom::ZeroFrom::zero_from)
|
||||
.map(DataPayload::from_owned)
|
||||
.map(|payload| DataResponse { metadata: Default::default(), payload: Some(payload) })
|
||||
.ok_or_else(|| {
|
||||
DataErrorKind::MissingLocale.with_req(::icu_provider_adapters::fallback::provider::LocaleFallbackParentsV1Marker::KEY, req)
|
||||
})
|
||||
}
|
||||
}
|
||||
($ provider : ty) => {
|
||||
make_provider!($provider);
|
||||
impl_fallback_likelysubtags_v1!($provider);
|
||||
impl_fallback_parents_v1!($provider);
|
||||
impl_fallback_supplement_co_v1!($provider);
|
||||
impl_list_and_v1!($provider);
|
||||
};
|
||||
}
|
||||
/// Implement [`AnyProvider`] on the given struct using the data
|
||||
/// hardcoded in this module. This allows the struct to be used with
|
||||
/// `icu`'s `_any` constructors.
|
||||
///
|
||||
/// This macro can only be called from its definition-site, i.e. right
|
||||
/// after `include!`-ing the generated module.
|
||||
///
|
||||
/// ```compile_fail
|
||||
/// struct MyAnyProvider;
|
||||
/// include!("/path/to/generated/mod.rs");
|
||||
/// impl_any_provider(MyAnyProvider);
|
||||
/// ```
|
||||
#[allow(unused_macros)]
|
||||
macro_rules! impl_any_provider {
|
||||
($ provider : path) => {
|
||||
#[clippy::msrv = "1.61"]
|
||||
impl AnyProvider for $provider {
|
||||
fn load_any(&self, key: DataKey, req: DataRequest) -> Result<AnyResponse, DataError> {
|
||||
const ANDLISTV1MARKER: ::icu_provider::DataKeyHash = ::icu_list::provider::AndListV1Marker::KEY.hashed();
|
||||
const COLLATIONFALLBACKSUPPLEMENTV1MARKER: ::icu_provider::DataKeyHash =
|
||||
::icu_provider_adapters::fallback::provider::CollationFallbackSupplementV1Marker::KEY.hashed();
|
||||
const LOCALEFALLBACKLIKELYSUBTAGSV1MARKER: ::icu_provider::DataKeyHash =
|
||||
::icu_provider_adapters::fallback::provider::LocaleFallbackLikelySubtagsV1Marker::KEY.hashed();
|
||||
const LOCALEFALLBACKPARENTSV1MARKER: ::icu_provider::DataKeyHash =
|
||||
::icu_provider_adapters::fallback::provider::LocaleFallbackParentsV1Marker::KEY.hashed();
|
||||
($ provider : ty) => {
|
||||
#[clippy::msrv = "1.66"]
|
||||
impl icu_provider::AnyProvider for $provider {
|
||||
fn load_any(&self, key: icu_provider::DataKey, req: icu_provider::DataRequest) -> Result<icu_provider::AnyResponse, icu_provider::DataError> {
|
||||
match key.hashed() {
|
||||
ANDLISTV1MARKER => list::and_v1::lookup(&req.locale).map(AnyPayload::from_static_ref),
|
||||
COLLATIONFALLBACKSUPPLEMENTV1MARKER => fallback::supplement::co_v1::lookup(&req.locale).map(AnyPayload::from_static_ref),
|
||||
LOCALEFALLBACKLIKELYSUBTAGSV1MARKER => fallback::likelysubtags_v1::lookup(&req.locale).map(AnyPayload::from_static_ref),
|
||||
LOCALEFALLBACKPARENTSV1MARKER => fallback::parents_v1::lookup(&req.locale).map(AnyPayload::from_static_ref),
|
||||
_ => return Err(DataErrorKind::MissingDataKey.with_req(key, req)),
|
||||
h if h == <icu_locid_transform::provider::LocaleFallbackLikelySubtagsV1Marker as icu_provider::KeyedDataMarker>::KEY.hashed() => icu_provider::DataProvider::<icu_locid_transform::provider::LocaleFallbackLikelySubtagsV1Marker>::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response),
|
||||
h if h == <icu_locid_transform::provider::LocaleFallbackParentsV1Marker as icu_provider::KeyedDataMarker>::KEY.hashed() => icu_provider::DataProvider::<icu_locid_transform::provider::LocaleFallbackParentsV1Marker>::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response),
|
||||
h if h == <icu_locid_transform::provider::CollationFallbackSupplementV1Marker as icu_provider::KeyedDataMarker>::KEY.hashed() => icu_provider::DataProvider::<icu_locid_transform::provider::CollationFallbackSupplementV1Marker>::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response),
|
||||
h if h == <icu_list::provider::AndListV1Marker as icu_provider::KeyedDataMarker>::KEY.hashed() => icu_provider::DataProvider::<icu_list::provider::AndListV1Marker>::load(self, req).map(icu_provider::DataResponse::wrap_into_any_response),
|
||||
_ => Err(icu_provider::DataErrorKind::MissingDataKey.with_req(key, req)),
|
||||
}
|
||||
.map(|payload| AnyResponse { payload: Some(payload), metadata: Default::default() })
|
||||
.ok_or_else(|| DataErrorKind::MissingLocale.with_req(key, req))
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
#[clippy::msrv = "1.61"]
|
||||
#[clippy::msrv = "1.66"]
|
||||
pub struct BakedDataProvider;
|
||||
impl_data_provider!(BakedDataProvider);
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ impl<'tcx> fmt::Display for BorrowData<'tcx> {
|
|||
fn fmt(&self, w: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
let kind = match self.kind {
|
||||
mir::BorrowKind::Shared => "",
|
||||
mir::BorrowKind::Shallow => "shallow ",
|
||||
mir::BorrowKind::Fake => "fake ",
|
||||
mir::BorrowKind::Mut { kind: mir::MutBorrowKind::ClosureCapture } => "uniq ",
|
||||
// FIXME: differentiate `TwoPhaseBorrow`
|
||||
mir::BorrowKind::Mut {
|
||||
|
|
|
|||
|
|
@ -273,11 +273,10 @@ impl<'tcx> PoloniusOutOfScopePrecomputer<'_, 'tcx> {
|
|||
) {
|
||||
let sccs = self.regioncx.constraint_sccs();
|
||||
let universal_regions = self.regioncx.universal_regions();
|
||||
let issuing_region_scc = sccs.scc(issuing_region);
|
||||
|
||||
// We first handle the cases where the loan doesn't go out of scope, depending on the issuing
|
||||
// region's successors.
|
||||
for scc in sccs.depth_first_search(issuing_region_scc) {
|
||||
for successor in self.regioncx.region_graph().depth_first_search(issuing_region) {
|
||||
// 1. Via applied member constraints
|
||||
//
|
||||
// The issuing region can flow into the choice regions, and they are either:
|
||||
|
|
@ -290,6 +289,7 @@ impl<'tcx> PoloniusOutOfScopePrecomputer<'_, 'tcx> {
|
|||
// For additional insurance via fuzzing and crater, we verify that the constraint's min
|
||||
// choice indeed escapes the function. In the future, we could e.g. turn this check into
|
||||
// a debug assert and early return as an optimization.
|
||||
let scc = sccs.scc(successor);
|
||||
for constraint in self.regioncx.applied_member_constraints(scc) {
|
||||
if universal_regions.is_universal_region(constraint.min_choice) {
|
||||
return;
|
||||
|
|
@ -300,7 +300,7 @@ impl<'tcx> PoloniusOutOfScopePrecomputer<'_, 'tcx> {
|
|||
//
|
||||
// If the issuing region outlives such a region, its loan escapes the function and
|
||||
// cannot go out of scope. We can early return.
|
||||
if self.regioncx.scc_is_live_at_all_points(scc) {
|
||||
if self.regioncx.is_region_live_at_all_points(successor) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ pub fn categorize(context: PlaceContext) -> Option<DefUse> {
|
|||
// cross suspension points so this behavior is unproblematic.
|
||||
PlaceContext::MutatingUse(MutatingUseContext::Borrow) |
|
||||
PlaceContext::NonMutatingUse(NonMutatingUseContext::SharedBorrow) |
|
||||
PlaceContext::NonMutatingUse(NonMutatingUseContext::ShallowBorrow) |
|
||||
PlaceContext::NonMutatingUse(NonMutatingUseContext::FakeBorrow) |
|
||||
|
||||
// `PlaceMention` and `AscribeUserType` both evaluate the place, which must not
|
||||
// contain dangling references.
|
||||
|
|
|
|||
|
|
@ -1022,7 +1022,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
self.cannot_uniquely_borrow_by_two_closures(span, &desc_place, issued_span, None)
|
||||
}
|
||||
|
||||
(BorrowKind::Mut { .. }, BorrowKind::Shallow) => {
|
||||
(BorrowKind::Mut { .. }, BorrowKind::Fake) => {
|
||||
if let Some(immutable_section_description) =
|
||||
self.classify_immutable_section(issued_borrow.assigned_place)
|
||||
{
|
||||
|
|
@ -1114,11 +1114,10 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
)
|
||||
}
|
||||
|
||||
(BorrowKind::Shared, BorrowKind::Shared | BorrowKind::Shallow)
|
||||
| (
|
||||
BorrowKind::Shallow,
|
||||
BorrowKind::Mut { .. } | BorrowKind::Shared | BorrowKind::Shallow,
|
||||
) => unreachable!(),
|
||||
(BorrowKind::Shared, BorrowKind::Shared | BorrowKind::Fake)
|
||||
| (BorrowKind::Fake, BorrowKind::Mut { .. } | BorrowKind::Shared | BorrowKind::Fake) => {
|
||||
unreachable!()
|
||||
}
|
||||
};
|
||||
|
||||
if issued_spans == borrow_spans {
|
||||
|
|
@ -2806,7 +2805,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
let loan_span = loan_spans.args_or_use();
|
||||
|
||||
let descr_place = self.describe_any_place(place.as_ref());
|
||||
if loan.kind == BorrowKind::Shallow {
|
||||
if loan.kind == BorrowKind::Fake {
|
||||
if let Some(section) = self.classify_immutable_section(loan.assigned_place) {
|
||||
let mut err = self.cannot_mutate_in_immutable_section(
|
||||
span,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use rustc_hir as hir;
|
|||
use rustc_hir::def::{CtorKind, Namespace};
|
||||
use rustc_hir::CoroutineKind;
|
||||
use rustc_index::IndexSlice;
|
||||
use rustc_infer::infer::LateBoundRegionConversionTime;
|
||||
use rustc_infer::infer::BoundRegionConversionTime;
|
||||
use rustc_middle::mir::tcx::PlaceTy;
|
||||
use rustc_middle::mir::{
|
||||
AggregateKind, CallSource, ConstOperand, FakeReadCause, Local, LocalInfo, LocalKind, Location,
|
||||
|
|
@ -462,7 +462,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
// lifetimes without names with the value `'0`.
|
||||
if let ty::Ref(region, ..) = ty.kind() {
|
||||
match **region {
|
||||
ty::ReLateBound(_, ty::BoundRegion { kind: br, .. })
|
||||
ty::ReBound(_, ty::BoundRegion { kind: br, .. })
|
||||
| ty::RePlaceholder(ty::PlaceholderRegion {
|
||||
bound: ty::BoundRegion { kind: br, .. },
|
||||
..
|
||||
|
|
@ -482,7 +482,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
|
||||
let region = if let ty::Ref(region, ..) = ty.kind() {
|
||||
match **region {
|
||||
ty::ReLateBound(_, ty::BoundRegion { kind: br, .. })
|
||||
ty::ReBound(_, ty::BoundRegion { kind: br, .. })
|
||||
| ty::RePlaceholder(ty::PlaceholderRegion {
|
||||
bound: ty::BoundRegion { kind: br, .. },
|
||||
..
|
||||
|
|
@ -634,7 +634,7 @@ impl UseSpans<'_> {
|
|||
err.subdiagnostic(match kind {
|
||||
Some(kd) => match kd {
|
||||
rustc_middle::mir::BorrowKind::Shared
|
||||
| rustc_middle::mir::BorrowKind::Shallow => {
|
||||
| rustc_middle::mir::BorrowKind::Fake => {
|
||||
CaptureVarKind::Immut { kind_span: capture_kind_span }
|
||||
}
|
||||
|
||||
|
|
@ -1113,7 +1113,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
&& let ty::Ref(_, _, hir::Mutability::Mut) = args.type_at(0).kind()
|
||||
&& let self_ty = self.infcx.instantiate_binder_with_fresh_vars(
|
||||
fn_call_span,
|
||||
LateBoundRegionConversionTime::FnCall,
|
||||
BoundRegionConversionTime::FnCall,
|
||||
tcx.fn_sig(method_did).instantiate(tcx, method_args).input(0),
|
||||
)
|
||||
&& self.infcx.can_eq(self.param_env, ty, self_ty)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ use rustc_errors::{Applicability, Diagnostic, DiagnosticBuilder, ErrorGuaranteed
|
|||
use rustc_middle::mir::*;
|
||||
use rustc_middle::ty::{self, Ty};
|
||||
use rustc_mir_dataflow::move_paths::{LookupResult, MovePathIndex};
|
||||
use rustc_span::{BytePos, Span};
|
||||
use rustc_span::{BytePos, ExpnKind, MacroKind, Span};
|
||||
|
||||
use crate::diagnostics::CapturedMessageOpt;
|
||||
use crate::diagnostics::{DescribePlaceOpt, UseSpans};
|
||||
|
|
@ -488,6 +488,8 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
|||
args_span,
|
||||
}
|
||||
});
|
||||
|
||||
self.add_note_for_packed_struct_derive(err, original_path.local);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -594,4 +596,20 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
|
|||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// Adds an explanatory note if the move error occurs in a derive macro
|
||||
/// expansion of a packed struct.
|
||||
/// Such errors happen because derive macro expansions shy away from taking
|
||||
/// references to the struct's fields since doing so would be undefined behaviour
|
||||
fn add_note_for_packed_struct_derive(&self, err: &mut Diagnostic, local: Local) {
|
||||
let local_place: PlaceRef<'tcx> = local.into();
|
||||
let local_ty = local_place.ty(self.body.local_decls(), self.infcx.tcx).ty.peel_refs();
|
||||
|
||||
if let Some(adt) = local_ty.ty_adt_def()
|
||||
&& adt.repr().packed()
|
||||
&& let ExpnKind::Macro(MacroKind::Derive, name) = self.body.span.ctxt().outer_expn_data().kind
|
||||
{
|
||||
err.note(format!("`#[derive({name})]` triggers a move because taking references to the fields of a packed struct is undefined behaviour"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -357,7 +357,7 @@ impl<'tcx> MirBorrowckCtxt<'_, 'tcx> {
|
|||
ty::BoundRegionKind::BrAnon => None,
|
||||
},
|
||||
|
||||
ty::ReLateBound(..)
|
||||
ty::ReBound(..)
|
||||
| ty::ReVar(..)
|
||||
| ty::RePlaceholder(..)
|
||||
| ty::ReErased
|
||||
|
|
|
|||
|
|
@ -253,8 +253,8 @@ impl<'cx, 'tcx> InvalidationGenerator<'cx, 'tcx> {
|
|||
match rvalue {
|
||||
&Rvalue::Ref(_ /*rgn*/, bk, place) => {
|
||||
let access_kind = match bk {
|
||||
BorrowKind::Shallow => {
|
||||
(Shallow(Some(ArtificialField::ShallowBorrow)), Read(ReadKind::Borrow(bk)))
|
||||
BorrowKind::Fake => {
|
||||
(Shallow(Some(ArtificialField::FakeBorrow)), Read(ReadKind::Borrow(bk)))
|
||||
}
|
||||
BorrowKind::Shared => (Deep, Read(ReadKind::Borrow(bk))),
|
||||
BorrowKind::Mut { .. } => {
|
||||
|
|
@ -376,8 +376,8 @@ impl<'cx, 'tcx> InvalidationGenerator<'cx, 'tcx> {
|
|||
// have already taken the reservation
|
||||
}
|
||||
|
||||
(Read(_), BorrowKind::Shallow | BorrowKind::Shared)
|
||||
| (Read(ReadKind::Borrow(BorrowKind::Shallow)), BorrowKind::Mut { .. }) => {
|
||||
(Read(_), BorrowKind::Fake | BorrowKind::Shared)
|
||||
| (Read(ReadKind::Borrow(BorrowKind::Fake)), BorrowKind::Mut { .. }) => {
|
||||
// Reads don't invalidate shared or shallow borrows
|
||||
}
|
||||
|
||||
|
|
@ -422,7 +422,7 @@ impl<'cx, 'tcx> InvalidationGenerator<'cx, 'tcx> {
|
|||
|
||||
// only mutable borrows should be 2-phase
|
||||
assert!(match borrow.kind {
|
||||
BorrowKind::Shared | BorrowKind::Shallow => false,
|
||||
BorrowKind::Shared | BorrowKind::Fake => false,
|
||||
BorrowKind::Mut { .. } => true,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -846,7 +846,7 @@ use self::ReadOrWrite::{Activation, Read, Reservation, Write};
|
|||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||
enum ArtificialField {
|
||||
ArrayLength,
|
||||
ShallowBorrow,
|
||||
FakeBorrow,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, PartialEq, Eq, Debug)]
|
||||
|
|
@ -1085,18 +1085,18 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
Control::Continue
|
||||
}
|
||||
|
||||
(Read(_), BorrowKind::Shared | BorrowKind::Shallow)
|
||||
| (Read(ReadKind::Borrow(BorrowKind::Shallow)), BorrowKind::Mut { .. }) => {
|
||||
(Read(_), BorrowKind::Shared | BorrowKind::Fake)
|
||||
| (Read(ReadKind::Borrow(BorrowKind::Fake)), BorrowKind::Mut { .. }) => {
|
||||
Control::Continue
|
||||
}
|
||||
|
||||
(Reservation(_), BorrowKind::Shallow | BorrowKind::Shared) => {
|
||||
(Reservation(_), BorrowKind::Fake | BorrowKind::Shared) => {
|
||||
// This used to be a future compatibility warning (to be
|
||||
// disallowed on NLL). See rust-lang/rust#56254
|
||||
Control::Continue
|
||||
}
|
||||
|
||||
(Write(WriteKind::Move), BorrowKind::Shallow) => {
|
||||
(Write(WriteKind::Move), BorrowKind::Fake) => {
|
||||
// Handled by initialization checks.
|
||||
Control::Continue
|
||||
}
|
||||
|
|
@ -1204,8 +1204,8 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
match rvalue {
|
||||
&Rvalue::Ref(_ /*rgn*/, bk, place) => {
|
||||
let access_kind = match bk {
|
||||
BorrowKind::Shallow => {
|
||||
(Shallow(Some(ArtificialField::ShallowBorrow)), Read(ReadKind::Borrow(bk)))
|
||||
BorrowKind::Fake => {
|
||||
(Shallow(Some(ArtificialField::FakeBorrow)), Read(ReadKind::Borrow(bk)))
|
||||
}
|
||||
BorrowKind::Shared => (Deep, Read(ReadKind::Borrow(bk))),
|
||||
BorrowKind::Mut { .. } => {
|
||||
|
|
@ -1226,7 +1226,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
flow_state,
|
||||
);
|
||||
|
||||
let action = if bk == BorrowKind::Shallow {
|
||||
let action = if bk == BorrowKind::Fake {
|
||||
InitializationRequiringAction::MatchOn
|
||||
} else {
|
||||
InitializationRequiringAction::Borrow
|
||||
|
|
@ -1583,7 +1583,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
|
||||
// only mutable borrows should be 2-phase
|
||||
assert!(match borrow.kind {
|
||||
BorrowKind::Shared | BorrowKind::Shallow => false,
|
||||
BorrowKind::Shared | BorrowKind::Fake => false,
|
||||
BorrowKind::Mut { .. } => true,
|
||||
});
|
||||
|
||||
|
|
@ -2142,14 +2142,14 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
| WriteKind::Replace
|
||||
| WriteKind::StorageDeadOrDrop
|
||||
| WriteKind::MutableBorrow(BorrowKind::Shared)
|
||||
| WriteKind::MutableBorrow(BorrowKind::Shallow),
|
||||
| WriteKind::MutableBorrow(BorrowKind::Fake),
|
||||
)
|
||||
| Write(
|
||||
WriteKind::Move
|
||||
| WriteKind::Replace
|
||||
| WriteKind::StorageDeadOrDrop
|
||||
| WriteKind::MutableBorrow(BorrowKind::Shared)
|
||||
| WriteKind::MutableBorrow(BorrowKind::Shallow),
|
||||
| WriteKind::MutableBorrow(BorrowKind::Fake),
|
||||
) => {
|
||||
if self.is_mutable(place.as_ref(), is_local_mutation_allowed).is_err()
|
||||
&& !self.has_buffered_errors()
|
||||
|
|
@ -2173,7 +2173,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
|
|||
return false;
|
||||
}
|
||||
Read(
|
||||
ReadKind::Borrow(BorrowKind::Mut { .. } | BorrowKind::Shared | BorrowKind::Shallow)
|
||||
ReadKind::Borrow(BorrowKind::Mut { .. } | BorrowKind::Shared | BorrowKind::Fake)
|
||||
| ReadKind::Copy,
|
||||
) => {
|
||||
// Access authorized
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ fn place_components_conflict<'tcx>(
|
|||
|
||||
match (elem, &base_ty.kind(), access) {
|
||||
(_, _, Shallow(Some(ArtificialField::ArrayLength)))
|
||||
| (_, _, Shallow(Some(ArtificialField::ShallowBorrow))) => {
|
||||
| (_, _, Shallow(Some(ArtificialField::FakeBorrow))) => {
|
||||
// The array length is like additional fields on the
|
||||
// type; it does not overlap any existing data there.
|
||||
// Furthermore, if cannot actually be a prefix of any
|
||||
|
|
@ -273,10 +273,10 @@ fn place_components_conflict<'tcx>(
|
|||
// If the second example, where we did, then we still know
|
||||
// that the borrow can access a *part* of our place that
|
||||
// our access cares about, so we still have a conflict.
|
||||
if borrow_kind == BorrowKind::Shallow
|
||||
if borrow_kind == BorrowKind::Fake
|
||||
&& borrow_place.projection.len() < access_place.projection.len()
|
||||
{
|
||||
debug!("borrow_conflicts_with_place: shallow borrow");
|
||||
debug!("borrow_conflicts_with_place: fake borrow");
|
||||
false
|
||||
} else {
|
||||
debug!("borrow_conflicts_with_place: full borrow, CONFLICT");
|
||||
|
|
|
|||
|
|
@ -22,11 +22,10 @@ use rustc_middle::traits::ObligationCauseCode;
|
|||
use rustc_middle::ty::{self, RegionVid, Ty, TyCtxt, TypeFoldable, TypeVisitableExt};
|
||||
use rustc_span::Span;
|
||||
|
||||
use crate::constraints::graph::{self, NormalConstraintGraph, RegionGraph};
|
||||
use crate::dataflow::BorrowIndex;
|
||||
use crate::{
|
||||
constraints::{
|
||||
graph::NormalConstraintGraph, ConstraintSccIndex, OutlivesConstraint, OutlivesConstraintSet,
|
||||
},
|
||||
constraints::{ConstraintSccIndex, OutlivesConstraint, OutlivesConstraintSet},
|
||||
diagnostics::{RegionErrorKind, RegionErrors, UniverseInfo},
|
||||
member_constraints::{MemberConstraintSet, NllMemberConstraintIndex},
|
||||
nll::PoloniusOutput,
|
||||
|
|
@ -2293,19 +2292,21 @@ impl<'tcx> RegionInferenceContext<'tcx> {
|
|||
self.constraint_sccs.as_ref()
|
||||
}
|
||||
|
||||
/// Returns whether the given SCC is live at all points: whether the representative is a
|
||||
/// Access to the region graph, built from the outlives constraints.
|
||||
pub(crate) fn region_graph(&self) -> RegionGraph<'_, 'tcx, graph::Normal> {
|
||||
self.constraint_graph.region_graph(&self.constraints, self.universal_regions.fr_static)
|
||||
}
|
||||
|
||||
/// Returns whether the given region is considered live at all points: whether it is a
|
||||
/// placeholder or a free region.
|
||||
pub(crate) fn scc_is_live_at_all_points(&self, scc: ConstraintSccIndex) -> bool {
|
||||
pub(crate) fn is_region_live_at_all_points(&self, region: RegionVid) -> bool {
|
||||
// FIXME: there must be a cleaner way to find this information. At least, when
|
||||
// higher-ranked subtyping is abstracted away from the borrowck main path, we'll only
|
||||
// need to check whether this is a universal region.
|
||||
let representative = self.scc_representatives[scc];
|
||||
let origin = self.var_infos[representative].origin;
|
||||
let origin = self.region_definition(region).origin;
|
||||
let live_at_all_points = matches!(
|
||||
origin,
|
||||
RegionVariableOrigin::Nll(
|
||||
NllRegionVariableOrigin::Placeholder(_) | NllRegionVariableOrigin::FreeRegion
|
||||
)
|
||||
NllRegionVariableOrigin::Placeholder(_) | NllRegionVariableOrigin::FreeRegion
|
||||
);
|
||||
live_at_all_points
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@ pub fn renumber_mir<'tcx>(
|
|||
renumberer.visit_body(body);
|
||||
}
|
||||
|
||||
// FIXME(@lcnr): A lot of these variants overlap and it seems like
|
||||
// this type is only used to decide which region should be used
|
||||
// as representative. This should be cleaned up.
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash)]
|
||||
pub(crate) enum RegionCtxt {
|
||||
Location(Location),
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
//! `RETURN_PLACE` the MIR arguments) are always fully normalized (and
|
||||
//! contain revealed `impl Trait` values).
|
||||
|
||||
use rustc_infer::infer::LateBoundRegionConversionTime;
|
||||
use rustc_infer::infer::BoundRegionConversionTime;
|
||||
use rustc_middle::mir::*;
|
||||
use rustc_middle::ty::{self, Ty};
|
||||
use rustc_span::Span;
|
||||
|
|
@ -35,7 +35,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
|
|||
.instantiate_canonical_with_fresh_inference_vars(body.span, &user_provided_poly_sig);
|
||||
let user_provided_sig = self.infcx.instantiate_binder_with_fresh_vars(
|
||||
body.span,
|
||||
LateBoundRegionConversionTime::FnCall,
|
||||
BoundRegionConversionTime::FnCall,
|
||||
user_provided_sig,
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ use rustc_infer::infer::outlives::env::RegionBoundPairs;
|
|||
use rustc_infer::infer::region_constraints::RegionConstraintData;
|
||||
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
|
||||
use rustc_infer::infer::{
|
||||
InferCtxt, LateBoundRegion, LateBoundRegionConversionTime, NllRegionVariableOrigin,
|
||||
BoundRegion, BoundRegionConversionTime, InferCtxt, NllRegionVariableOrigin,
|
||||
};
|
||||
use rustc_middle::mir::tcx::PlaceTy;
|
||||
use rustc_middle::mir::visit::{NonMutatingUseContext, PlaceContext, Visitor};
|
||||
|
|
@ -751,7 +751,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {
|
|||
PlaceContext::MutatingUse(_) => ty::Invariant,
|
||||
PlaceContext::NonUse(StorageDead | StorageLive | VarDebugInfo) => ty::Invariant,
|
||||
PlaceContext::NonMutatingUse(
|
||||
Inspect | Copy | Move | PlaceMention | SharedBorrow | ShallowBorrow | AddressOf
|
||||
Inspect | Copy | Move | PlaceMention | SharedBorrow | FakeBorrow | AddressOf
|
||||
| Projection,
|
||||
) => ty::Covariant,
|
||||
PlaceContext::NonUse(AscribeUserTy(variance)) => variance,
|
||||
|
|
@ -1401,10 +1401,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {
|
|||
};
|
||||
|
||||
self.infcx.next_region_var(
|
||||
LateBoundRegion(
|
||||
BoundRegion(
|
||||
term.source_info.span,
|
||||
br.kind,
|
||||
LateBoundRegionConversionTime::FnCall,
|
||||
BoundRegionConversionTime::FnCall,
|
||||
),
|
||||
region_ctxt_fn,
|
||||
)
|
||||
|
|
|
|||
|
|
@ -107,12 +107,12 @@ impl<'tcx> TypeRelatingDelegate<'tcx> for NllTypeRelatingDelegate<'_, '_, 'tcx>
|
|||
fn next_existential_region_var(
|
||||
&mut self,
|
||||
from_forall: bool,
|
||||
_name: Option<Symbol>,
|
||||
name: Option<Symbol>,
|
||||
) -> ty::Region<'tcx> {
|
||||
let origin = NllRegionVariableOrigin::Existential { from_forall };
|
||||
|
||||
let reg_var =
|
||||
self.type_checker.infcx.next_nll_region_var(origin, || RegionCtxt::Existential(_name));
|
||||
self.type_checker.infcx.next_nll_region_var(origin, || RegionCtxt::Existential(name));
|
||||
|
||||
reg_var
|
||||
}
|
||||
|
|
|
|||
|
|
@ -665,7 +665,7 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> {
|
|||
var: ty::BoundVar::from_usize(bound_vars.len() - 1),
|
||||
kind: ty::BrEnv,
|
||||
};
|
||||
let env_region = ty::Region::new_late_bound(tcx, ty::INNERMOST, br);
|
||||
let env_region = ty::Region::new_bound(tcx, ty::INNERMOST, br);
|
||||
let closure_ty = tcx.closure_env_ty(def_id, args, env_region).unwrap();
|
||||
|
||||
// The "inputs" of the closure in the
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ pub fn expand_deriving_debug(
|
|||
explicit_self: true,
|
||||
nonself_args: vec![(fmtr, sym::f)],
|
||||
ret_ty: Path(path_std!(fmt::Result)),
|
||||
attributes: ast::AttrVec::new(),
|
||||
attributes: thin_vec![cx.attr_word(sym::inline, span)],
|
||||
fieldless_variants_strategy:
|
||||
FieldlessVariantsStrategy::SpecializeIfAllVariantsFieldless,
|
||||
combine_substructure: combine_substructure(Box::new(|a, b, c| {
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ pub fn expand_env<'cx>(
|
|||
|
||||
return DummyResult::any(sp);
|
||||
}
|
||||
Some(value) => cx.expr_str(sp, value),
|
||||
Some(value) => cx.expr_str(span, value),
|
||||
};
|
||||
MacEager::expr(e)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,8 +76,6 @@ configuration options.
|
|||
|
||||
## Not yet supported
|
||||
|
||||
* Inline assembly ([no cranelift support](https://github.com/bytecodealliance/wasmtime/issues/1041))
|
||||
* On UNIX there is support for invoking an external assembler for `global_asm!` and `asm!`.
|
||||
* SIMD ([tracked here](https://github.com/rust-lang/rustc_codegen_cranelift/issues/171), `std::simd` fully works, `std::arch` is partially supported)
|
||||
* Unwinding on panics ([no cranelift support](https://github.com/bytecodealliance/wasmtime/issues/1677), `-Cpanic=abort` is enabled by default)
|
||||
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@ const BASE_SYSROOT_SUITE: &[TestCase] = &[
|
|||
TestCase::build_bin_and_run("aot.mod_bench", "example/mod_bench.rs", &[]),
|
||||
TestCase::build_bin_and_run("aot.issue-72793", "example/issue-72793.rs", &[]),
|
||||
TestCase::build_bin("aot.issue-59326", "example/issue-59326.rs"),
|
||||
TestCase::build_bin_and_run("aot.neon", "example/neon.rs", &[]),
|
||||
];
|
||||
|
||||
pub(crate) static RAND_REPO: GitRepo = GitRepo::github(
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@ aot.float-minmax-pass
|
|||
aot.mod_bench
|
||||
aot.issue-72793
|
||||
aot.issue-59326
|
||||
aot.neon
|
||||
|
||||
testsuite.extended_sysroot
|
||||
test.rust-random/rand
|
||||
|
|
|
|||
234
compiler/rustc_codegen_cranelift/example/neon.rs
Normal file
234
compiler/rustc_codegen_cranelift/example/neon.rs
Normal file
|
|
@ -0,0 +1,234 @@
|
|||
// Most of these tests are copied from https://github.com/japaric/stdsimd/blob/0f4413d01c4f0c3ffbc5a69e9a37fbc7235b31a9/coresimd/arm/neon.rs
|
||||
|
||||
#![feature(portable_simd)]
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
use std::arch::aarch64::*;
|
||||
use std::mem::transmute;
|
||||
use std::simd::*;
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpmin_s8() {
|
||||
let a = i8x8::from([1, -2, 3, -4, 5, 6, 7, 8]);
|
||||
let b = i8x8::from([0, 3, 2, 5, 4, 7, 6, 9]);
|
||||
let e = i8x8::from([-2, -4, 5, 7, 0, 2, 4, 6]);
|
||||
let r: i8x8 = transmute(vpmin_s8(transmute(a), transmute(b)));
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpmin_s16() {
|
||||
let a = i16x4::from([1, 2, 3, -4]);
|
||||
let b = i16x4::from([0, 3, 2, 5]);
|
||||
let e = i16x4::from([1, -4, 0, 2]);
|
||||
let r: i16x4 = transmute(vpmin_s16(transmute(a), transmute(b)));
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpmin_s32() {
|
||||
let a = i32x2::from([1, -2]);
|
||||
let b = i32x2::from([0, 3]);
|
||||
let e = i32x2::from([-2, 0]);
|
||||
let r: i32x2 = transmute(vpmin_s32(transmute(a), transmute(b)));
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpmin_u8() {
|
||||
let a = u8x8::from([1, 2, 3, 4, 5, 6, 7, 8]);
|
||||
let b = u8x8::from([0, 3, 2, 5, 4, 7, 6, 9]);
|
||||
let e = u8x8::from([1, 3, 5, 7, 0, 2, 4, 6]);
|
||||
let r: u8x8 = transmute(vpmin_u8(transmute(a), transmute(b)));
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpmin_u16() {
|
||||
let a = u16x4::from([1, 2, 3, 4]);
|
||||
let b = u16x4::from([0, 3, 2, 5]);
|
||||
let e = u16x4::from([1, 3, 0, 2]);
|
||||
let r: u16x4 = transmute(vpmin_u16(transmute(a), transmute(b)));
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpmin_u32() {
|
||||
let a = u32x2::from([1, 2]);
|
||||
let b = u32x2::from([0, 3]);
|
||||
let e = u32x2::from([1, 0]);
|
||||
let r: u32x2 = transmute(vpmin_u32(transmute(a), transmute(b)));
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpmin_f32() {
|
||||
let a = f32x2::from([1., -2.]);
|
||||
let b = f32x2::from([0., 3.]);
|
||||
let e = f32x2::from([-2., 0.]);
|
||||
let r: f32x2 = transmute(vpmin_f32(transmute(a), transmute(b)));
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpmax_s8() {
|
||||
let a = i8x8::from([1, -2, 3, -4, 5, 6, 7, 8]);
|
||||
let b = i8x8::from([0, 3, 2, 5, 4, 7, 6, 9]);
|
||||
let e = i8x8::from([1, 3, 6, 8, 3, 5, 7, 9]);
|
||||
let r: i8x8 = transmute(vpmax_s8(transmute(a), transmute(b)));
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpmax_s16() {
|
||||
let a = i16x4::from([1, 2, 3, -4]);
|
||||
let b = i16x4::from([0, 3, 2, 5]);
|
||||
let e = i16x4::from([2, 3, 3, 5]);
|
||||
let r: i16x4 = transmute(vpmax_s16(transmute(a), transmute(b)));
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpmax_s32() {
|
||||
let a = i32x2::from([1, -2]);
|
||||
let b = i32x2::from([0, 3]);
|
||||
let e = i32x2::from([1, 3]);
|
||||
let r: i32x2 = transmute(vpmax_s32(transmute(a), transmute(b)));
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpmax_u8() {
|
||||
let a = u8x8::from([1, 2, 3, 4, 5, 6, 7, 8]);
|
||||
let b = u8x8::from([0, 3, 2, 5, 4, 7, 6, 9]);
|
||||
let e = u8x8::from([2, 4, 6, 8, 3, 5, 7, 9]);
|
||||
let r: u8x8 = transmute(vpmax_u8(transmute(a), transmute(b)));
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpmax_u16() {
|
||||
let a = u16x4::from([1, 2, 3, 4]);
|
||||
let b = u16x4::from([0, 3, 2, 5]);
|
||||
let e = u16x4::from([2, 4, 3, 5]);
|
||||
let r: u16x4 = transmute(vpmax_u16(transmute(a), transmute(b)));
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpmax_u32() {
|
||||
let a = u32x2::from([1, 2]);
|
||||
let b = u32x2::from([0, 3]);
|
||||
let e = u32x2::from([2, 3]);
|
||||
let r: u32x2 = transmute(vpmax_u32(transmute(a), transmute(b)));
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpmax_f32() {
|
||||
let a = f32x2::from([1., -2.]);
|
||||
let b = f32x2::from([0., 3.]);
|
||||
let e = f32x2::from([1., 3.]);
|
||||
let r: f32x2 = transmute(vpmax_f32(transmute(a), transmute(b)));
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpadd_s16() {
|
||||
let a = i16x4::from([1, 2, 3, 4]);
|
||||
let b = i16x4::from([0, -1, -2, -3]);
|
||||
let r: i16x4 = transmute(vpadd_s16(transmute(a), transmute(b)));
|
||||
let e = i16x4::from([3, 7, -1, -5]);
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpadd_s32() {
|
||||
let a = i32x2::from([1, 2]);
|
||||
let b = i32x2::from([0, -1]);
|
||||
let r: i32x2 = transmute(vpadd_s32(transmute(a), transmute(b)));
|
||||
let e = i32x2::from([3, -1]);
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpadd_s8() {
|
||||
let a = i8x8::from([1, 2, 3, 4, 5, 6, 7, 8]);
|
||||
let b = i8x8::from([0, -1, -2, -3, -4, -5, -6, -7]);
|
||||
let r: i8x8 = transmute(vpadd_s8(transmute(a), transmute(b)));
|
||||
let e = i8x8::from([3, 7, 11, 15, -1, -5, -9, -13]);
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpadd_u16() {
|
||||
let a = u16x4::from([1, 2, 3, 4]);
|
||||
let b = u16x4::from([30, 31, 32, 33]);
|
||||
let r: u16x4 = transmute(vpadd_u16(transmute(a), transmute(b)));
|
||||
let e = u16x4::from([3, 7, 61, 65]);
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpadd_u32() {
|
||||
let a = u32x2::from([1, 2]);
|
||||
let b = u32x2::from([30, 31]);
|
||||
let r: u32x2 = transmute(vpadd_u32(transmute(a), transmute(b)));
|
||||
let e = u32x2::from([3, 61]);
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vpadd_u8() {
|
||||
let a = u8x8::from([1, 2, 3, 4, 5, 6, 7, 8]);
|
||||
let b = u8x8::from([30, 31, 32, 33, 34, 35, 36, 37]);
|
||||
let r: u8x8 = transmute(vpadd_u8(transmute(a), transmute(b)));
|
||||
let e = u8x8::from([3, 7, 11, 15, 61, 65, 69, 73]);
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vqsub_u8() {
|
||||
let a = u8x8::from([1, 2, 3, 4, 5, 6, 7, 0xff]);
|
||||
let b = u8x8::from([30, 1, 1, 1, 34, 0xff, 36, 37]);
|
||||
let r: u8x8 = transmute(vqsub_u8(transmute(a), transmute(b)));
|
||||
let e = u8x8::from([0, 1, 2, 3, 0, 0, 0, 218]);
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe fn test_vqadd_u8() {
|
||||
let a = u8x8::from([1, 2, 3, 4, 5, 6, 7, 0xff]);
|
||||
let b = u8x8::from([30, 1, 1, 1, 34, 0xff, 36, 37]);
|
||||
let r: u8x8 = transmute(vqadd_u8(transmute(a), transmute(b)));
|
||||
let e = u8x8::from([31, 3, 4, 5, 39, 0xff, 43, 0xff]);
|
||||
assert_eq!(r, e);
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
fn main() {
|
||||
unsafe {
|
||||
test_vpmin_s8();
|
||||
test_vpmin_s16();
|
||||
test_vpmin_s32();
|
||||
test_vpmin_u8();
|
||||
test_vpmin_u16();
|
||||
test_vpmin_u32();
|
||||
test_vpmin_f32();
|
||||
test_vpmax_s8();
|
||||
test_vpmax_s16();
|
||||
test_vpmax_s32();
|
||||
test_vpmax_u8();
|
||||
test_vpmax_u16();
|
||||
test_vpmax_u32();
|
||||
test_vpmax_f32();
|
||||
|
||||
test_vpadd_s16();
|
||||
test_vpadd_s32();
|
||||
test_vpadd_s8();
|
||||
test_vpadd_u16();
|
||||
test_vpadd_u32();
|
||||
test_vpadd_u8();
|
||||
|
||||
test_vqsub_u8();
|
||||
test_vqadd_u8();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_arch = "aarch64"))]
|
||||
fn main() {}
|
||||
|
|
@ -58,9 +58,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "compiler_builtins"
|
||||
version = "0.1.100"
|
||||
version = "0.1.103"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d6c0f24437059853f0fa64afc51f338f93647a3de4cf3358ba1bb4171a199775"
|
||||
checksum = "a3b73c3443a5fd2438d7ba4853c64e4c8efc2404a9e28a9234cc2d5eebc6c242"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"rustc-std-workspace-core",
|
||||
|
|
@ -158,9 +158,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "libc"
|
||||
version = "0.2.149"
|
||||
version = "0.2.150"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b"
|
||||
checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c"
|
||||
dependencies = [
|
||||
"rustc-std-workspace-core",
|
||||
]
|
||||
|
|
@ -415,7 +415,6 @@ dependencies = [
|
|||
name = "unwind"
|
||||
version = "0.0.0"
|
||||
dependencies = [
|
||||
"cc",
|
||||
"cfg-if",
|
||||
"compiler_builtins",
|
||||
"core",
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
[toolchain]
|
||||
channel = "nightly-2023-10-29"
|
||||
channel = "nightly-2023-11-10"
|
||||
components = ["rust-src", "rustc-dev", "llvm-tools"]
|
||||
|
|
|
|||
|
|
@ -146,6 +146,11 @@ rm tests/ui/process/nofile-limit.rs # TODO some AArch64 linking issue
|
|||
|
||||
rm tests/ui/stdio-is-blocking.rs # really slow with unoptimized libstd
|
||||
|
||||
# rustc bugs
|
||||
# ==========
|
||||
# https://github.com/rust-lang/rust/pull/116447#issuecomment-1790451463
|
||||
rm tests/ui/coroutine/gen_block_*.rs
|
||||
|
||||
cp ../dist/bin/rustdoc-clif ../dist/bin/rustdoc # some tests expect bin/rustdoc to exist
|
||||
|
||||
# prevent $(RUSTDOC) from picking up the sysroot built by x.py. It conflicts with the one used by
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ use crate::prelude::*;
|
|||
enum CInlineAsmOperand<'tcx> {
|
||||
In {
|
||||
reg: InlineAsmRegOrRegClass,
|
||||
value: CValue<'tcx>,
|
||||
value: Value,
|
||||
},
|
||||
Out {
|
||||
reg: InlineAsmRegOrRegClass,
|
||||
|
|
@ -23,7 +23,7 @@ enum CInlineAsmOperand<'tcx> {
|
|||
InOut {
|
||||
reg: InlineAsmRegOrRegClass,
|
||||
_late: bool,
|
||||
in_value: CValue<'tcx>,
|
||||
in_value: Value,
|
||||
out_place: Option<CPlace<'tcx>>,
|
||||
},
|
||||
Const {
|
||||
|
|
@ -47,7 +47,9 @@ pub(crate) fn codegen_inline_asm<'tcx>(
|
|||
// Used by panic_abort on Windows, but uses a syntax which only happens to work with
|
||||
// asm!() by accident and breaks with the GNU assembler as well as global_asm!() for
|
||||
// the LLVM backend.
|
||||
if template[0] == InlineAsmTemplatePiece::String("int $$0x29".to_string()) {
|
||||
if template.len() == 1
|
||||
&& template[0] == InlineAsmTemplatePiece::String("int $$0x29".to_string())
|
||||
{
|
||||
fx.bcx.ins().trap(TrapCode::User(1));
|
||||
return;
|
||||
}
|
||||
|
|
@ -55,9 +57,10 @@ pub(crate) fn codegen_inline_asm<'tcx>(
|
|||
let operands = operands
|
||||
.into_iter()
|
||||
.map(|operand| match *operand {
|
||||
InlineAsmOperand::In { reg, ref value } => {
|
||||
CInlineAsmOperand::In { reg, value: crate::base::codegen_operand(fx, value) }
|
||||
}
|
||||
InlineAsmOperand::In { reg, ref value } => CInlineAsmOperand::In {
|
||||
reg,
|
||||
value: crate::base::codegen_operand(fx, value).load_scalar(fx),
|
||||
},
|
||||
InlineAsmOperand::Out { reg, late, ref place } => CInlineAsmOperand::Out {
|
||||
reg,
|
||||
late,
|
||||
|
|
@ -67,7 +70,7 @@ pub(crate) fn codegen_inline_asm<'tcx>(
|
|||
CInlineAsmOperand::InOut {
|
||||
reg,
|
||||
_late: late,
|
||||
in_value: crate::base::codegen_operand(fx, in_value),
|
||||
in_value: crate::base::codegen_operand(fx, in_value).load_scalar(fx),
|
||||
out_place: out_place.map(|place| crate::base::codegen_place(fx, place)),
|
||||
}
|
||||
}
|
||||
|
|
@ -165,7 +168,7 @@ pub(crate) fn codegen_inline_asm<'tcx>(
|
|||
for (i, operand) in operands.iter().enumerate() {
|
||||
match operand {
|
||||
CInlineAsmOperand::In { reg: _, value } => {
|
||||
inputs.push((asm_gen.stack_slots_input[i].unwrap(), value.load_scalar(fx)));
|
||||
inputs.push((asm_gen.stack_slots_input[i].unwrap(), *value));
|
||||
}
|
||||
CInlineAsmOperand::Out { reg: _, late: _, place } => {
|
||||
if let Some(place) = place {
|
||||
|
|
@ -173,7 +176,7 @@ pub(crate) fn codegen_inline_asm<'tcx>(
|
|||
}
|
||||
}
|
||||
CInlineAsmOperand::InOut { reg: _, _late: _, in_value, out_place } => {
|
||||
inputs.push((asm_gen.stack_slots_input[i].unwrap(), in_value.load_scalar(fx)));
|
||||
inputs.push((asm_gen.stack_slots_input[i].unwrap(), *in_value));
|
||||
if let Some(out_place) = out_place {
|
||||
outputs.push((asm_gen.stack_slots_output[i].unwrap(), *out_place));
|
||||
}
|
||||
|
|
@ -726,3 +729,83 @@ fn call_inline_asm<'tcx>(
|
|||
place.write_cvalue(fx, CValue::by_val(value, place.layout()));
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn codegen_xgetbv<'tcx>(
|
||||
fx: &mut FunctionCx<'_, '_, 'tcx>,
|
||||
xcr_no: Value,
|
||||
ret: CPlace<'tcx>,
|
||||
) {
|
||||
// FIXME add .eh_frame unwind info directives
|
||||
|
||||
let operands = vec![
|
||||
CInlineAsmOperand::In {
|
||||
reg: InlineAsmRegOrRegClass::Reg(InlineAsmReg::X86(X86InlineAsmReg::cx)),
|
||||
value: xcr_no,
|
||||
},
|
||||
CInlineAsmOperand::Out {
|
||||
reg: InlineAsmRegOrRegClass::Reg(InlineAsmReg::X86(X86InlineAsmReg::ax)),
|
||||
late: true,
|
||||
place: Some(ret),
|
||||
},
|
||||
CInlineAsmOperand::Out {
|
||||
reg: InlineAsmRegOrRegClass::Reg(InlineAsmReg::X86(X86InlineAsmReg::dx)),
|
||||
late: true,
|
||||
place: None,
|
||||
},
|
||||
];
|
||||
let options = InlineAsmOptions::NOSTACK | InlineAsmOptions::PURE | InlineAsmOptions::NOMEM;
|
||||
|
||||
let mut inputs = Vec::new();
|
||||
let mut outputs = Vec::new();
|
||||
|
||||
let mut asm_gen = InlineAssemblyGenerator {
|
||||
tcx: fx.tcx,
|
||||
arch: fx.tcx.sess.asm_arch.unwrap(),
|
||||
enclosing_def_id: fx.instance.def_id(),
|
||||
template: &[InlineAsmTemplatePiece::String(
|
||||
"
|
||||
xgetbv
|
||||
// out = rdx << 32 | rax
|
||||
shl rdx, 32
|
||||
or rax, rdx
|
||||
"
|
||||
.to_string(),
|
||||
)],
|
||||
operands: &operands,
|
||||
options,
|
||||
registers: Vec::new(),
|
||||
stack_slots_clobber: Vec::new(),
|
||||
stack_slots_input: Vec::new(),
|
||||
stack_slots_output: Vec::new(),
|
||||
stack_slot_size: Size::from_bytes(0),
|
||||
};
|
||||
asm_gen.allocate_registers();
|
||||
asm_gen.allocate_stack_slots();
|
||||
|
||||
let inline_asm_index = fx.cx.inline_asm_index.get();
|
||||
fx.cx.inline_asm_index.set(inline_asm_index + 1);
|
||||
let asm_name = format!(
|
||||
"__inline_asm_{}_n{}",
|
||||
fx.cx.cgu_name.as_str().replace('.', "__").replace('-', "_"),
|
||||
inline_asm_index
|
||||
);
|
||||
|
||||
let generated_asm = asm_gen.generate_asm_wrapper(&asm_name);
|
||||
fx.cx.global_asm.push_str(&generated_asm);
|
||||
|
||||
for (i, operand) in operands.iter().enumerate() {
|
||||
match operand {
|
||||
CInlineAsmOperand::In { reg: _, value } => {
|
||||
inputs.push((asm_gen.stack_slots_input[i].unwrap(), *value));
|
||||
}
|
||||
CInlineAsmOperand::Out { reg: _, late: _, place } => {
|
||||
if let Some(place) = place {
|
||||
outputs.push((asm_gen.stack_slots_output[i].unwrap(), *place));
|
||||
}
|
||||
}
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
call_inline_asm(fx, &asm_name, asm_gen.stack_slot_size, inputs, outputs);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,21 @@ pub(crate) fn codegen_llvm_intrinsic_call<'tcx>(
|
|||
});
|
||||
}
|
||||
|
||||
_ if intrinsic.starts_with("llvm.fma.v") => {
|
||||
intrinsic_args!(fx, args => (x,y,z); intrinsic);
|
||||
|
||||
simd_trio_for_each_lane(
|
||||
fx,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
ret,
|
||||
&|fx, _lane_ty, _res_lane_ty, lane_x, lane_y, lane_z| {
|
||||
fx.bcx.ins().fma(lane_x, lane_y, lane_z)
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
_ => {
|
||||
fx.tcx
|
||||
.sess
|
||||
|
|
|
|||
|
|
@ -44,7 +44,9 @@ pub(crate) fn codegen_aarch64_llvm_intrinsic_call<'tcx>(
|
|||
});
|
||||
}
|
||||
|
||||
_ if intrinsic.starts_with("llvm.aarch64.neon.sqadd.v") => {
|
||||
_ if intrinsic.starts_with("llvm.aarch64.neon.sqadd.v")
|
||||
|| intrinsic.starts_with("llvm.aarch64.neon.uqadd.v") =>
|
||||
{
|
||||
intrinsic_args!(fx, args => (x, y); intrinsic);
|
||||
|
||||
simd_pair_for_each_lane_typed(fx, x, y, ret, &|fx, x_lane, y_lane| {
|
||||
|
|
@ -52,7 +54,9 @@ pub(crate) fn codegen_aarch64_llvm_intrinsic_call<'tcx>(
|
|||
});
|
||||
}
|
||||
|
||||
_ if intrinsic.starts_with("llvm.aarch64.neon.sqsub.v") => {
|
||||
_ if intrinsic.starts_with("llvm.aarch64.neon.sqsub.v")
|
||||
|| intrinsic.starts_with("llvm.aarch64.neon.uqsub.v") =>
|
||||
{
|
||||
intrinsic_args!(fx, args => (x, y); intrinsic);
|
||||
|
||||
simd_pair_for_each_lane_typed(fx, x, y, ret, &|fx, x_lane, y_lane| {
|
||||
|
|
@ -156,6 +160,90 @@ pub(crate) fn codegen_aarch64_llvm_intrinsic_call<'tcx>(
|
|||
});
|
||||
}
|
||||
|
||||
_ if intrinsic.starts_with("llvm.aarch64.neon.umaxp.v") => {
|
||||
intrinsic_args!(fx, args => (x, y); intrinsic);
|
||||
|
||||
simd_horizontal_pair_for_each_lane(
|
||||
fx,
|
||||
x,
|
||||
y,
|
||||
ret,
|
||||
&|fx, _lane_ty, _res_lane_ty, x_lane, y_lane| fx.bcx.ins().umax(x_lane, y_lane),
|
||||
);
|
||||
}
|
||||
|
||||
_ if intrinsic.starts_with("llvm.aarch64.neon.smaxp.v") => {
|
||||
intrinsic_args!(fx, args => (x, y); intrinsic);
|
||||
|
||||
simd_horizontal_pair_for_each_lane(
|
||||
fx,
|
||||
x,
|
||||
y,
|
||||
ret,
|
||||
&|fx, _lane_ty, _res_lane_ty, x_lane, y_lane| fx.bcx.ins().smax(x_lane, y_lane),
|
||||
);
|
||||
}
|
||||
|
||||
_ if intrinsic.starts_with("llvm.aarch64.neon.uminp.v") => {
|
||||
intrinsic_args!(fx, args => (x, y); intrinsic);
|
||||
|
||||
simd_horizontal_pair_for_each_lane(
|
||||
fx,
|
||||
x,
|
||||
y,
|
||||
ret,
|
||||
&|fx, _lane_ty, _res_lane_ty, x_lane, y_lane| fx.bcx.ins().umin(x_lane, y_lane),
|
||||
);
|
||||
}
|
||||
|
||||
_ if intrinsic.starts_with("llvm.aarch64.neon.sminp.v") => {
|
||||
intrinsic_args!(fx, args => (x, y); intrinsic);
|
||||
|
||||
simd_horizontal_pair_for_each_lane(
|
||||
fx,
|
||||
x,
|
||||
y,
|
||||
ret,
|
||||
&|fx, _lane_ty, _res_lane_ty, x_lane, y_lane| fx.bcx.ins().smin(x_lane, y_lane),
|
||||
);
|
||||
}
|
||||
|
||||
_ if intrinsic.starts_with("llvm.aarch64.neon.fminp.v") => {
|
||||
intrinsic_args!(fx, args => (x, y); intrinsic);
|
||||
|
||||
simd_horizontal_pair_for_each_lane(
|
||||
fx,
|
||||
x,
|
||||
y,
|
||||
ret,
|
||||
&|fx, _lane_ty, _res_lane_ty, x_lane, y_lane| fx.bcx.ins().fmin(x_lane, y_lane),
|
||||
);
|
||||
}
|
||||
|
||||
_ if intrinsic.starts_with("llvm.aarch64.neon.fmaxp.v") => {
|
||||
intrinsic_args!(fx, args => (x, y); intrinsic);
|
||||
|
||||
simd_horizontal_pair_for_each_lane(
|
||||
fx,
|
||||
x,
|
||||
y,
|
||||
ret,
|
||||
&|fx, _lane_ty, _res_lane_ty, x_lane, y_lane| fx.bcx.ins().fmax(x_lane, y_lane),
|
||||
);
|
||||
}
|
||||
|
||||
_ if intrinsic.starts_with("llvm.aarch64.neon.addp.v") => {
|
||||
intrinsic_args!(fx, args => (x, y); intrinsic);
|
||||
|
||||
simd_horizontal_pair_for_each_lane(
|
||||
fx,
|
||||
x,
|
||||
y,
|
||||
ret,
|
||||
&|fx, _lane_ty, _res_lane_ty, x_lane, y_lane| fx.bcx.ins().iadd(x_lane, y_lane),
|
||||
);
|
||||
}
|
||||
|
||||
// FIXME generalize vector types
|
||||
"llvm.aarch64.neon.tbl1.v16i8" => {
|
||||
intrinsic_args!(fx, args => (t, idx); intrinsic);
|
||||
|
|
@ -172,25 +260,6 @@ pub(crate) fn codegen_aarch64_llvm_intrinsic_call<'tcx>(
|
|||
}
|
||||
}
|
||||
|
||||
// FIXME generalize vector types
|
||||
"llvm.aarch64.neon.umaxp.v16i8" => {
|
||||
intrinsic_args!(fx, args => (a, b); intrinsic);
|
||||
|
||||
// FIXME add helper for horizontal pairwise operations
|
||||
for i in 0..8 {
|
||||
let lane1 = a.value_lane(fx, i * 2).load_scalar(fx);
|
||||
let lane2 = a.value_lane(fx, i * 2 + 1).load_scalar(fx);
|
||||
let res = fx.bcx.ins().umax(lane1, lane2);
|
||||
ret.place_lane(fx, i).to_ptr().store(fx, res, MemFlags::trusted());
|
||||
}
|
||||
for i in 0..8 {
|
||||
let lane1 = b.value_lane(fx, i * 2).load_scalar(fx);
|
||||
let lane2 = b.value_lane(fx, i * 2 + 1).load_scalar(fx);
|
||||
let res = fx.bcx.ins().umax(lane1, lane2);
|
||||
ret.place_lane(fx, 8 + i).to_ptr().store(fx, res, MemFlags::trusted());
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
_ if intrinsic.starts_with("llvm.aarch64.neon.sshl.v")
|
||||
|| intrinsic.starts_with("llvm.aarch64.neon.sqshl.v")
|
||||
|
|
|
|||
|
|
@ -20,16 +20,21 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
|
|||
|
||||
// Used by is_x86_feature_detected!();
|
||||
"llvm.x86.xgetbv" => {
|
||||
// FIXME use the actual xgetbv instruction
|
||||
intrinsic_args!(fx, args => (v); intrinsic);
|
||||
intrinsic_args!(fx, args => (xcr_no); intrinsic);
|
||||
|
||||
let v = v.load_scalar(fx);
|
||||
let xcr_no = xcr_no.load_scalar(fx);
|
||||
|
||||
// As of writing on XCR0 exists
|
||||
fx.bcx.ins().trapnz(v, TrapCode::UnreachableCodeReached);
|
||||
crate::inline_asm::codegen_xgetbv(fx, xcr_no, ret);
|
||||
}
|
||||
|
||||
let res = fx.bcx.ins().iconst(types::I64, 1 /* bit 0 must be set */);
|
||||
ret.write_cvalue(fx, CValue::by_val(res, fx.layout_of(fx.tcx.types.i64)));
|
||||
"llvm.x86.sse3.ldu.dq" | "llvm.x86.avx.ldu.dq.256" => {
|
||||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_lddqu_si128&ig_expand=4009
|
||||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_lddqu_si256&ig_expand=4010
|
||||
intrinsic_args!(fx, args => (ptr); intrinsic);
|
||||
|
||||
// FIXME correctly handle unalignedness
|
||||
let val = CValue::by_ref(Pointer::new(ptr.load_scalar(fx)), ret.layout());
|
||||
ret.write_cvalue(fx, val);
|
||||
}
|
||||
|
||||
"llvm.x86.sse.cmp.ps" | "llvm.x86.sse2.cmp.pd" => {
|
||||
|
|
@ -177,8 +182,12 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
|
|||
}
|
||||
}
|
||||
}
|
||||
"llvm.x86.avx2.vperm2i128" => {
|
||||
"llvm.x86.avx2.vperm2i128"
|
||||
| "llvm.x86.avx.vperm2f128.ps.256"
|
||||
| "llvm.x86.avx.vperm2f128.pd.256" => {
|
||||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_permute2x128_si256
|
||||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_permute2f128_ps
|
||||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_permute2f128_pd
|
||||
let (a, b, imm8) = match args {
|
||||
[a, b, imm8] => (a, b, imm8),
|
||||
_ => bug!("wrong number of args for intrinsic {intrinsic}"),
|
||||
|
|
@ -187,19 +196,11 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
|
|||
let b = codegen_operand(fx, b);
|
||||
let imm8 = codegen_operand(fx, imm8).load_scalar(fx);
|
||||
|
||||
let a_0 = a.value_lane(fx, 0).load_scalar(fx);
|
||||
let a_1 = a.value_lane(fx, 1).load_scalar(fx);
|
||||
let a_low = fx.bcx.ins().iconcat(a_0, a_1);
|
||||
let a_2 = a.value_lane(fx, 2).load_scalar(fx);
|
||||
let a_3 = a.value_lane(fx, 3).load_scalar(fx);
|
||||
let a_high = fx.bcx.ins().iconcat(a_2, a_3);
|
||||
let a_low = a.value_typed_lane(fx, fx.tcx.types.u128, 0).load_scalar(fx);
|
||||
let a_high = a.value_typed_lane(fx, fx.tcx.types.u128, 1).load_scalar(fx);
|
||||
|
||||
let b_0 = b.value_lane(fx, 0).load_scalar(fx);
|
||||
let b_1 = b.value_lane(fx, 1).load_scalar(fx);
|
||||
let b_low = fx.bcx.ins().iconcat(b_0, b_1);
|
||||
let b_2 = b.value_lane(fx, 2).load_scalar(fx);
|
||||
let b_3 = b.value_lane(fx, 3).load_scalar(fx);
|
||||
let b_high = fx.bcx.ins().iconcat(b_2, b_3);
|
||||
let b_low = b.value_typed_lane(fx, fx.tcx.types.u128, 0).load_scalar(fx);
|
||||
let b_high = b.value_typed_lane(fx, fx.tcx.types.u128, 1).load_scalar(fx);
|
||||
|
||||
fn select4(
|
||||
fx: &mut FunctionCx<'_, '_, '_>,
|
||||
|
|
@ -224,16 +225,20 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
|
|||
|
||||
let control0 = imm8;
|
||||
let res_low = select4(fx, a_high, a_low, b_high, b_low, control0);
|
||||
let (res_0, res_1) = fx.bcx.ins().isplit(res_low);
|
||||
|
||||
let control1 = fx.bcx.ins().ushr_imm(imm8, 4);
|
||||
let res_high = select4(fx, a_high, a_low, b_high, b_low, control1);
|
||||
let (res_2, res_3) = fx.bcx.ins().isplit(res_high);
|
||||
|
||||
ret.place_lane(fx, 0).to_ptr().store(fx, res_0, MemFlags::trusted());
|
||||
ret.place_lane(fx, 1).to_ptr().store(fx, res_1, MemFlags::trusted());
|
||||
ret.place_lane(fx, 2).to_ptr().store(fx, res_2, MemFlags::trusted());
|
||||
ret.place_lane(fx, 3).to_ptr().store(fx, res_3, MemFlags::trusted());
|
||||
ret.place_typed_lane(fx, fx.tcx.types.u128, 0).to_ptr().store(
|
||||
fx,
|
||||
res_low,
|
||||
MemFlags::trusted(),
|
||||
);
|
||||
ret.place_typed_lane(fx, fx.tcx.types.u128, 1).to_ptr().store(
|
||||
fx,
|
||||
res_high,
|
||||
MemFlags::trusted(),
|
||||
);
|
||||
}
|
||||
"llvm.x86.ssse3.pabs.b.128" | "llvm.x86.ssse3.pabs.w.128" | "llvm.x86.ssse3.pabs.d.128" => {
|
||||
let a = match args {
|
||||
|
|
@ -309,7 +314,9 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
|
|||
fx.bcx.ins().sshr(a_lane, saturated_count)
|
||||
});
|
||||
}
|
||||
"llvm.x86.sse2.psad.bw" => {
|
||||
"llvm.x86.sse2.psad.bw" | "llvm.x86.avx2.psad.bw" => {
|
||||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_sad_epu8&ig_expand=5770
|
||||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_sad_epu8&ig_expand=5771
|
||||
intrinsic_args!(fx, args => (a, b); intrinsic);
|
||||
|
||||
assert_eq!(a.layout(), b.layout());
|
||||
|
|
@ -340,7 +347,9 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
|
|||
ret.place_lane(fx, out_lane_idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
}
|
||||
"llvm.x86.ssse3.pmadd.ub.sw.128" => {
|
||||
"llvm.x86.ssse3.pmadd.ub.sw.128" | "llvm.x86.avx2.pmadd.ub.sw" => {
|
||||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_maddubs_epi16&ig_expand=4267
|
||||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_maddubs_epi16&ig_expand=4270
|
||||
intrinsic_args!(fx, args => (a, b); intrinsic);
|
||||
|
||||
let (lane_count, lane_ty) = a.layout().ty.simd_size_and_type(fx.tcx);
|
||||
|
|
@ -379,7 +388,9 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
|
|||
ret.place_lane(fx, out_lane_idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
}
|
||||
"llvm.x86.sse2.pmadd.wd" => {
|
||||
"llvm.x86.sse2.pmadd.wd" | "llvm.x86.avx2.pmadd.wd" => {
|
||||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_madd_epi16&ig_expand=4231
|
||||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_madd_epi16&ig_expand=4234
|
||||
intrinsic_args!(fx, args => (a, b); intrinsic);
|
||||
|
||||
assert_eq!(a.layout(), b.layout());
|
||||
|
|
@ -412,6 +423,369 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
|
|||
ret.place_lane(fx, out_lane_idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
}
|
||||
|
||||
"llvm.x86.ssse3.pmul.hr.sw.128" => {
|
||||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_mulhrs_epi16&ig_expand=4782
|
||||
intrinsic_args!(fx, args => (a, b); intrinsic);
|
||||
|
||||
assert_eq!(a.layout(), b.layout());
|
||||
let layout = a.layout();
|
||||
|
||||
let (lane_count, lane_ty) = layout.ty.simd_size_and_type(fx.tcx);
|
||||
let (ret_lane_count, ret_lane_ty) = ret.layout().ty.simd_size_and_type(fx.tcx);
|
||||
assert_eq!(lane_ty, fx.tcx.types.i16);
|
||||
assert_eq!(ret_lane_ty, fx.tcx.types.i16);
|
||||
assert_eq!(lane_count, ret_lane_count);
|
||||
|
||||
let ret_lane_layout = fx.layout_of(fx.tcx.types.i16);
|
||||
for out_lane_idx in 0..lane_count {
|
||||
let a_lane = a.value_lane(fx, out_lane_idx).load_scalar(fx);
|
||||
let a_lane = fx.bcx.ins().sextend(types::I32, a_lane);
|
||||
let b_lane = b.value_lane(fx, out_lane_idx).load_scalar(fx);
|
||||
let b_lane = fx.bcx.ins().sextend(types::I32, b_lane);
|
||||
|
||||
let mul: Value = fx.bcx.ins().imul(a_lane, b_lane);
|
||||
let shifted = fx.bcx.ins().ushr_imm(mul, 14);
|
||||
let incremented = fx.bcx.ins().iadd_imm(shifted, 1);
|
||||
let shifted_again = fx.bcx.ins().ushr_imm(incremented, 1);
|
||||
|
||||
let res_lane = fx.bcx.ins().ireduce(types::I16, shifted_again);
|
||||
let res_lane = CValue::by_val(res_lane, ret_lane_layout);
|
||||
|
||||
ret.place_lane(fx, out_lane_idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
}
|
||||
|
||||
"llvm.x86.sse2.packuswb.128" => {
|
||||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_packus_epi16&ig_expand=4903
|
||||
intrinsic_args!(fx, args => (a, b); intrinsic);
|
||||
|
||||
assert_eq!(a.layout(), b.layout());
|
||||
let layout = a.layout();
|
||||
|
||||
let (lane_count, lane_ty) = layout.ty.simd_size_and_type(fx.tcx);
|
||||
let (ret_lane_count, ret_lane_ty) = ret.layout().ty.simd_size_and_type(fx.tcx);
|
||||
assert_eq!(lane_ty, fx.tcx.types.i16);
|
||||
assert_eq!(ret_lane_ty, fx.tcx.types.u8);
|
||||
assert_eq!(lane_count * 2, ret_lane_count);
|
||||
|
||||
let zero = fx.bcx.ins().iconst(types::I16, 0);
|
||||
let max_u8 = fx.bcx.ins().iconst(types::I16, 255);
|
||||
let ret_lane_layout = fx.layout_of(fx.tcx.types.u8);
|
||||
|
||||
for idx in 0..lane_count {
|
||||
let lane = a.value_lane(fx, idx).load_scalar(fx);
|
||||
let sat = fx.bcx.ins().smax(lane, zero);
|
||||
let sat = fx.bcx.ins().umin(sat, max_u8);
|
||||
let res = fx.bcx.ins().ireduce(types::I8, sat);
|
||||
|
||||
let res_lane = CValue::by_val(res, ret_lane_layout);
|
||||
ret.place_lane(fx, idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
|
||||
for idx in 0..lane_count {
|
||||
let lane = b.value_lane(fx, idx).load_scalar(fx);
|
||||
let sat = fx.bcx.ins().smax(lane, zero);
|
||||
let sat = fx.bcx.ins().umin(sat, max_u8);
|
||||
let res = fx.bcx.ins().ireduce(types::I8, sat);
|
||||
|
||||
let res_lane = CValue::by_val(res, ret_lane_layout);
|
||||
ret.place_lane(fx, lane_count + idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
}
|
||||
|
||||
"llvm.x86.avx2.packuswb" => {
|
||||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_packus_epi16&ig_expand=4906
|
||||
intrinsic_args!(fx, args => (a, b); intrinsic);
|
||||
|
||||
assert_eq!(a.layout(), b.layout());
|
||||
let layout = a.layout();
|
||||
|
||||
let (lane_count, lane_ty) = layout.ty.simd_size_and_type(fx.tcx);
|
||||
let (ret_lane_count, ret_lane_ty) = ret.layout().ty.simd_size_and_type(fx.tcx);
|
||||
assert_eq!(lane_ty, fx.tcx.types.i16);
|
||||
assert_eq!(ret_lane_ty, fx.tcx.types.u8);
|
||||
assert_eq!(lane_count * 2, ret_lane_count);
|
||||
|
||||
let zero = fx.bcx.ins().iconst(types::I16, 0);
|
||||
let max_u8 = fx.bcx.ins().iconst(types::I16, 255);
|
||||
let ret_lane_layout = fx.layout_of(fx.tcx.types.u8);
|
||||
|
||||
for idx in 0..lane_count / 2 {
|
||||
let lane = a.value_lane(fx, idx).load_scalar(fx);
|
||||
let sat = fx.bcx.ins().smax(lane, zero);
|
||||
let sat = fx.bcx.ins().umin(sat, max_u8);
|
||||
let res = fx.bcx.ins().ireduce(types::I8, sat);
|
||||
|
||||
let res_lane = CValue::by_val(res, ret_lane_layout);
|
||||
ret.place_lane(fx, idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
|
||||
for idx in 0..lane_count / 2 {
|
||||
let lane = b.value_lane(fx, idx).load_scalar(fx);
|
||||
let sat = fx.bcx.ins().smax(lane, zero);
|
||||
let sat = fx.bcx.ins().umin(sat, max_u8);
|
||||
let res = fx.bcx.ins().ireduce(types::I8, sat);
|
||||
|
||||
let res_lane = CValue::by_val(res, ret_lane_layout);
|
||||
ret.place_lane(fx, lane_count / 2 + idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
|
||||
for idx in 0..lane_count / 2 {
|
||||
let lane = a.value_lane(fx, idx).load_scalar(fx);
|
||||
let sat = fx.bcx.ins().smax(lane, zero);
|
||||
let sat = fx.bcx.ins().umin(sat, max_u8);
|
||||
let res = fx.bcx.ins().ireduce(types::I8, sat);
|
||||
|
||||
let res_lane = CValue::by_val(res, ret_lane_layout);
|
||||
ret.place_lane(fx, lane_count / 2 * 2 + idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
|
||||
for idx in 0..lane_count / 2 {
|
||||
let lane = b.value_lane(fx, idx).load_scalar(fx);
|
||||
let sat = fx.bcx.ins().smax(lane, zero);
|
||||
let sat = fx.bcx.ins().umin(sat, max_u8);
|
||||
let res = fx.bcx.ins().ireduce(types::I8, sat);
|
||||
|
||||
let res_lane = CValue::by_val(res, ret_lane_layout);
|
||||
ret.place_lane(fx, lane_count / 2 * 3 + idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
}
|
||||
|
||||
"llvm.x86.sse2.packssdw.128" => {
|
||||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_packs_epi32&ig_expand=4889
|
||||
intrinsic_args!(fx, args => (a, b); intrinsic);
|
||||
|
||||
assert_eq!(a.layout(), b.layout());
|
||||
let layout = a.layout();
|
||||
|
||||
let (lane_count, lane_ty) = layout.ty.simd_size_and_type(fx.tcx);
|
||||
let (ret_lane_count, ret_lane_ty) = ret.layout().ty.simd_size_and_type(fx.tcx);
|
||||
assert_eq!(lane_ty, fx.tcx.types.i32);
|
||||
assert_eq!(ret_lane_ty, fx.tcx.types.i16);
|
||||
assert_eq!(lane_count * 2, ret_lane_count);
|
||||
|
||||
let min_i16 = fx.bcx.ins().iconst(types::I32, i64::from(i16::MIN as u16));
|
||||
let max_i16 = fx.bcx.ins().iconst(types::I32, i64::from(i16::MAX as u16));
|
||||
let ret_lane_layout = fx.layout_of(fx.tcx.types.i16);
|
||||
|
||||
for idx in 0..lane_count {
|
||||
let lane = a.value_lane(fx, idx).load_scalar(fx);
|
||||
let sat = fx.bcx.ins().smax(lane, min_i16);
|
||||
let sat = fx.bcx.ins().umin(sat, max_i16);
|
||||
let res = fx.bcx.ins().ireduce(types::I16, sat);
|
||||
|
||||
let res_lane = CValue::by_val(res, ret_lane_layout);
|
||||
ret.place_lane(fx, idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
|
||||
for idx in 0..lane_count {
|
||||
let lane = b.value_lane(fx, idx).load_scalar(fx);
|
||||
let sat = fx.bcx.ins().smax(lane, min_i16);
|
||||
let sat = fx.bcx.ins().umin(sat, max_i16);
|
||||
let res = fx.bcx.ins().ireduce(types::I16, sat);
|
||||
|
||||
let res_lane = CValue::by_val(res, ret_lane_layout);
|
||||
ret.place_lane(fx, lane_count + idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
}
|
||||
|
||||
"llvm.x86.sse41.packusdw" => {
|
||||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_packus_epi32&ig_expand=4912
|
||||
intrinsic_args!(fx, args => (a, b); intrinsic);
|
||||
|
||||
assert_eq!(a.layout(), b.layout());
|
||||
let layout = a.layout();
|
||||
|
||||
let (lane_count, lane_ty) = layout.ty.simd_size_and_type(fx.tcx);
|
||||
let (ret_lane_count, ret_lane_ty) = ret.layout().ty.simd_size_and_type(fx.tcx);
|
||||
assert_eq!(lane_ty, fx.tcx.types.i32);
|
||||
assert_eq!(ret_lane_ty, fx.tcx.types.u16);
|
||||
assert_eq!(lane_count * 2, ret_lane_count);
|
||||
|
||||
let min_u16 = fx.bcx.ins().iconst(types::I32, i64::from(u16::MIN));
|
||||
let max_u16 = fx.bcx.ins().iconst(types::I32, i64::from(u16::MAX));
|
||||
let ret_lane_layout = fx.layout_of(fx.tcx.types.u16);
|
||||
|
||||
for idx in 0..lane_count {
|
||||
let lane = a.value_lane(fx, idx).load_scalar(fx);
|
||||
let sat = fx.bcx.ins().umax(lane, min_u16);
|
||||
let sat = fx.bcx.ins().umin(sat, max_u16);
|
||||
let res = fx.bcx.ins().ireduce(types::I16, sat);
|
||||
|
||||
let res_lane = CValue::by_val(res, ret_lane_layout);
|
||||
ret.place_lane(fx, idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
|
||||
for idx in 0..lane_count {
|
||||
let lane = b.value_lane(fx, idx).load_scalar(fx);
|
||||
let sat = fx.bcx.ins().umax(lane, min_u16);
|
||||
let sat = fx.bcx.ins().umin(sat, max_u16);
|
||||
let res = fx.bcx.ins().ireduce(types::I16, sat);
|
||||
|
||||
let res_lane = CValue::by_val(res, ret_lane_layout);
|
||||
ret.place_lane(fx, lane_count + idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
}
|
||||
|
||||
"llvm.x86.avx2.packssdw" => {
|
||||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_packs_epi32&ig_expand=4892
|
||||
intrinsic_args!(fx, args => (a, b); intrinsic);
|
||||
|
||||
assert_eq!(a.layout(), b.layout());
|
||||
let layout = a.layout();
|
||||
|
||||
let (lane_count, lane_ty) = layout.ty.simd_size_and_type(fx.tcx);
|
||||
let (ret_lane_count, ret_lane_ty) = ret.layout().ty.simd_size_and_type(fx.tcx);
|
||||
assert_eq!(lane_ty, fx.tcx.types.i32);
|
||||
assert_eq!(ret_lane_ty, fx.tcx.types.i16);
|
||||
assert_eq!(lane_count * 2, ret_lane_count);
|
||||
|
||||
let min_i16 = fx.bcx.ins().iconst(types::I32, i64::from(i16::MIN as u16));
|
||||
let max_i16 = fx.bcx.ins().iconst(types::I32, i64::from(i16::MAX as u16));
|
||||
let ret_lane_layout = fx.layout_of(fx.tcx.types.i16);
|
||||
|
||||
for idx in 0..lane_count / 2 {
|
||||
let lane = a.value_lane(fx, idx).load_scalar(fx);
|
||||
let sat = fx.bcx.ins().smax(lane, min_i16);
|
||||
let sat = fx.bcx.ins().umin(sat, max_i16);
|
||||
let res = fx.bcx.ins().ireduce(types::I16, sat);
|
||||
|
||||
let res_lane = CValue::by_val(res, ret_lane_layout);
|
||||
ret.place_lane(fx, idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
|
||||
for idx in 0..lane_count / 2 {
|
||||
let lane = b.value_lane(fx, idx).load_scalar(fx);
|
||||
let sat = fx.bcx.ins().smax(lane, min_i16);
|
||||
let sat = fx.bcx.ins().umin(sat, max_i16);
|
||||
let res = fx.bcx.ins().ireduce(types::I16, sat);
|
||||
|
||||
let res_lane = CValue::by_val(res, ret_lane_layout);
|
||||
ret.place_lane(fx, lane_count / 2 + idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
|
||||
for idx in 0..lane_count / 2 {
|
||||
let lane = a.value_lane(fx, idx).load_scalar(fx);
|
||||
let sat = fx.bcx.ins().smax(lane, min_i16);
|
||||
let sat = fx.bcx.ins().umin(sat, max_i16);
|
||||
let res = fx.bcx.ins().ireduce(types::I16, sat);
|
||||
|
||||
let res_lane = CValue::by_val(res, ret_lane_layout);
|
||||
ret.place_lane(fx, lane_count / 2 * 2 + idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
|
||||
for idx in 0..lane_count / 2 {
|
||||
let lane = b.value_lane(fx, idx).load_scalar(fx);
|
||||
let sat = fx.bcx.ins().smax(lane, min_i16);
|
||||
let sat = fx.bcx.ins().umin(sat, max_i16);
|
||||
let res = fx.bcx.ins().ireduce(types::I16, sat);
|
||||
|
||||
let res_lane = CValue::by_val(res, ret_lane_layout);
|
||||
ret.place_lane(fx, lane_count / 2 * 3 + idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
}
|
||||
|
||||
"llvm.x86.pclmulqdq" => {
|
||||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm_clmulepi64_si128&ig_expand=772
|
||||
intrinsic_args!(fx, args => (a, b, imm8); intrinsic);
|
||||
|
||||
assert_eq!(a.layout(), b.layout());
|
||||
let layout = a.layout();
|
||||
|
||||
let (lane_count, lane_ty) = layout.ty.simd_size_and_type(fx.tcx);
|
||||
let (ret_lane_count, ret_lane_ty) = ret.layout().ty.simd_size_and_type(fx.tcx);
|
||||
assert_eq!(lane_ty, fx.tcx.types.i64);
|
||||
assert_eq!(ret_lane_ty, fx.tcx.types.i64);
|
||||
assert_eq!(lane_count, 2);
|
||||
assert_eq!(ret_lane_count, 2);
|
||||
|
||||
let imm8 = imm8.load_scalar(fx);
|
||||
|
||||
let control0 = fx.bcx.ins().band_imm(imm8, 0b0000_0001);
|
||||
let a_lane0 = a.value_lane(fx, 0).load_scalar(fx);
|
||||
let a_lane1 = a.value_lane(fx, 1).load_scalar(fx);
|
||||
let temp1 = fx.bcx.ins().select(control0, a_lane1, a_lane0);
|
||||
|
||||
let control4 = fx.bcx.ins().band_imm(imm8, 0b0001_0000);
|
||||
let b_lane0 = b.value_lane(fx, 0).load_scalar(fx);
|
||||
let b_lane1 = b.value_lane(fx, 1).load_scalar(fx);
|
||||
let temp2 = fx.bcx.ins().select(control4, b_lane1, b_lane0);
|
||||
|
||||
fn extract_bit(fx: &mut FunctionCx<'_, '_, '_>, val: Value, bit: i64) -> Value {
|
||||
let tmp = fx.bcx.ins().ushr_imm(val, bit);
|
||||
fx.bcx.ins().band_imm(tmp, 1)
|
||||
}
|
||||
|
||||
let mut res1 = fx.bcx.ins().iconst(types::I64, 0);
|
||||
for i in 0..=63 {
|
||||
let x = extract_bit(fx, temp1, 0);
|
||||
let y = extract_bit(fx, temp2, i);
|
||||
let mut temp = fx.bcx.ins().band(x, y);
|
||||
for j in 1..=i {
|
||||
let x = extract_bit(fx, temp1, j);
|
||||
let y = extract_bit(fx, temp2, i - j);
|
||||
let z = fx.bcx.ins().band(x, y);
|
||||
temp = fx.bcx.ins().bxor(temp, z);
|
||||
}
|
||||
let temp = fx.bcx.ins().ishl_imm(temp, i);
|
||||
res1 = fx.bcx.ins().bor(res1, temp);
|
||||
}
|
||||
ret.place_lane(fx, 0).to_ptr().store(fx, res1, MemFlags::trusted());
|
||||
|
||||
let mut res2 = fx.bcx.ins().iconst(types::I64, 0);
|
||||
for i in 64..=127 {
|
||||
let mut temp = fx.bcx.ins().iconst(types::I64, 0);
|
||||
for j in i - 63..=63 {
|
||||
let x = extract_bit(fx, temp1, j);
|
||||
let y = extract_bit(fx, temp2, i - j);
|
||||
let z = fx.bcx.ins().band(x, y);
|
||||
temp = fx.bcx.ins().bxor(temp, z);
|
||||
}
|
||||
let temp = fx.bcx.ins().ishl_imm(temp, i);
|
||||
res2 = fx.bcx.ins().bor(res2, temp);
|
||||
}
|
||||
ret.place_lane(fx, 1).to_ptr().store(fx, res2, MemFlags::trusted());
|
||||
}
|
||||
|
||||
"llvm.x86.avx.ptestz.256" => {
|
||||
// https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html#text=_mm256_testz_si256&ig_expand=6945
|
||||
intrinsic_args!(fx, args => (a, b); intrinsic);
|
||||
|
||||
assert_eq!(a.layout(), b.layout());
|
||||
let layout = a.layout();
|
||||
|
||||
let (lane_count, lane_ty) = layout.ty.simd_size_and_type(fx.tcx);
|
||||
assert_eq!(lane_ty, fx.tcx.types.i64);
|
||||
assert_eq!(ret.layout().ty, fx.tcx.types.i32);
|
||||
assert_eq!(lane_count, 4);
|
||||
|
||||
let a_lane0 = a.value_lane(fx, 0).load_scalar(fx);
|
||||
let a_lane1 = a.value_lane(fx, 1).load_scalar(fx);
|
||||
let a_lane2 = a.value_lane(fx, 2).load_scalar(fx);
|
||||
let a_lane3 = a.value_lane(fx, 3).load_scalar(fx);
|
||||
let b_lane0 = b.value_lane(fx, 0).load_scalar(fx);
|
||||
let b_lane1 = b.value_lane(fx, 1).load_scalar(fx);
|
||||
let b_lane2 = b.value_lane(fx, 2).load_scalar(fx);
|
||||
let b_lane3 = b.value_lane(fx, 3).load_scalar(fx);
|
||||
|
||||
let zero0 = fx.bcx.ins().band(a_lane0, b_lane0);
|
||||
let zero1 = fx.bcx.ins().band(a_lane1, b_lane1);
|
||||
let zero2 = fx.bcx.ins().band(a_lane2, b_lane2);
|
||||
let zero3 = fx.bcx.ins().band(a_lane3, b_lane3);
|
||||
|
||||
let all_zero0 = fx.bcx.ins().bor(zero0, zero1);
|
||||
let all_zero1 = fx.bcx.ins().bor(zero2, zero3);
|
||||
let all_zero = fx.bcx.ins().bor(all_zero0, all_zero1);
|
||||
|
||||
let res = fx.bcx.ins().icmp_imm(IntCC::Equal, all_zero, 0);
|
||||
let res = CValue::by_val(
|
||||
fx.bcx.ins().uextend(types::I32, res),
|
||||
fx.layout_of(fx.tcx.types.i32),
|
||||
);
|
||||
ret.write_cvalue(fx, res);
|
||||
}
|
||||
|
||||
_ => {
|
||||
fx.tcx
|
||||
.sess
|
||||
|
|
|
|||
|
|
@ -132,6 +132,65 @@ fn simd_pair_for_each_lane<'tcx>(
|
|||
}
|
||||
}
|
||||
|
||||
fn simd_horizontal_pair_for_each_lane<'tcx>(
|
||||
fx: &mut FunctionCx<'_, '_, 'tcx>,
|
||||
x: CValue<'tcx>,
|
||||
y: CValue<'tcx>,
|
||||
ret: CPlace<'tcx>,
|
||||
f: &dyn Fn(&mut FunctionCx<'_, '_, 'tcx>, Ty<'tcx>, Ty<'tcx>, Value, Value) -> Value,
|
||||
) {
|
||||
assert_eq!(x.layout(), y.layout());
|
||||
let layout = x.layout();
|
||||
|
||||
let (lane_count, lane_ty) = layout.ty.simd_size_and_type(fx.tcx);
|
||||
let lane_layout = fx.layout_of(lane_ty);
|
||||
let (ret_lane_count, ret_lane_ty) = ret.layout().ty.simd_size_and_type(fx.tcx);
|
||||
let ret_lane_layout = fx.layout_of(ret_lane_ty);
|
||||
assert_eq!(lane_count, ret_lane_count);
|
||||
|
||||
for lane_idx in 0..lane_count {
|
||||
let src = if lane_idx < (lane_count / 2) { x } else { y };
|
||||
let src_idx = lane_idx % (lane_count / 2);
|
||||
|
||||
let lhs_lane = src.value_lane(fx, src_idx * 2).load_scalar(fx);
|
||||
let rhs_lane = src.value_lane(fx, src_idx * 2 + 1).load_scalar(fx);
|
||||
|
||||
let res_lane = f(fx, lane_layout.ty, ret_lane_layout.ty, lhs_lane, rhs_lane);
|
||||
let res_lane = CValue::by_val(res_lane, ret_lane_layout);
|
||||
|
||||
ret.place_lane(fx, lane_idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
}
|
||||
|
||||
fn simd_trio_for_each_lane<'tcx>(
|
||||
fx: &mut FunctionCx<'_, '_, 'tcx>,
|
||||
x: CValue<'tcx>,
|
||||
y: CValue<'tcx>,
|
||||
z: CValue<'tcx>,
|
||||
ret: CPlace<'tcx>,
|
||||
f: &dyn Fn(&mut FunctionCx<'_, '_, 'tcx>, Ty<'tcx>, Ty<'tcx>, Value, Value, Value) -> Value,
|
||||
) {
|
||||
assert_eq!(x.layout(), y.layout());
|
||||
let layout = x.layout();
|
||||
|
||||
let (lane_count, lane_ty) = layout.ty.simd_size_and_type(fx.tcx);
|
||||
let lane_layout = fx.layout_of(lane_ty);
|
||||
let (ret_lane_count, ret_lane_ty) = ret.layout().ty.simd_size_and_type(fx.tcx);
|
||||
let ret_lane_layout = fx.layout_of(ret_lane_ty);
|
||||
assert_eq!(lane_count, ret_lane_count);
|
||||
|
||||
for lane_idx in 0..lane_count {
|
||||
let x_lane = x.value_lane(fx, lane_idx).load_scalar(fx);
|
||||
let y_lane = y.value_lane(fx, lane_idx).load_scalar(fx);
|
||||
let z_lane = z.value_lane(fx, lane_idx).load_scalar(fx);
|
||||
|
||||
let res_lane = f(fx, lane_layout.ty, ret_lane_layout.ty, x_lane, y_lane, z_lane);
|
||||
let res_lane = CValue::by_val(res_lane, ret_lane_layout);
|
||||
|
||||
ret.place_lane(fx, lane_idx).write_cvalue(fx, res_lane);
|
||||
}
|
||||
}
|
||||
|
||||
fn simd_reduce<'tcx>(
|
||||
fx: &mut FunctionCx<'_, '_, 'tcx>,
|
||||
val: CValue<'tcx>,
|
||||
|
|
|
|||
|
|
@ -243,6 +243,34 @@ impl<'tcx> CValue<'tcx> {
|
|||
let (lane_count, lane_ty) = layout.ty.simd_size_and_type(fx.tcx);
|
||||
let lane_layout = fx.layout_of(lane_ty);
|
||||
assert!(lane_idx < lane_count);
|
||||
|
||||
match self.0 {
|
||||
CValueInner::ByVal(_) | CValueInner::ByValPair(_, _) => unreachable!(),
|
||||
CValueInner::ByRef(ptr, None) => {
|
||||
let field_offset = lane_layout.size * lane_idx;
|
||||
let field_ptr = ptr.offset_i64(fx, i64::try_from(field_offset.bytes()).unwrap());
|
||||
CValue::by_ref(field_ptr, lane_layout)
|
||||
}
|
||||
CValueInner::ByRef(_, Some(_)) => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Like [`CValue::value_field`] except using the passed type as lane type instead of the one
|
||||
/// specified by the vector type.
|
||||
pub(crate) fn value_typed_lane(
|
||||
self,
|
||||
fx: &mut FunctionCx<'_, '_, 'tcx>,
|
||||
lane_ty: Ty<'tcx>,
|
||||
lane_idx: u64,
|
||||
) -> CValue<'tcx> {
|
||||
let layout = self.1;
|
||||
assert!(layout.ty.is_simd());
|
||||
let (orig_lane_count, orig_lane_ty) = layout.ty.simd_size_and_type(fx.tcx);
|
||||
let lane_layout = fx.layout_of(lane_ty);
|
||||
assert!(
|
||||
(lane_idx + 1) * lane_layout.size <= orig_lane_count * fx.layout_of(orig_lane_ty).size
|
||||
);
|
||||
|
||||
match self.0 {
|
||||
CValueInner::ByVal(_) | CValueInner::ByValPair(_, _) => unreachable!(),
|
||||
CValueInner::ByRef(ptr, None) => {
|
||||
|
|
@ -734,6 +762,34 @@ impl<'tcx> CPlace<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
/// Like [`CPlace::place_field`] except using the passed type as lane type instead of the one
|
||||
/// specified by the vector type.
|
||||
pub(crate) fn place_typed_lane(
|
||||
self,
|
||||
fx: &mut FunctionCx<'_, '_, 'tcx>,
|
||||
lane_ty: Ty<'tcx>,
|
||||
lane_idx: u64,
|
||||
) -> CPlace<'tcx> {
|
||||
let layout = self.layout();
|
||||
assert!(layout.ty.is_simd());
|
||||
let (orig_lane_count, orig_lane_ty) = layout.ty.simd_size_and_type(fx.tcx);
|
||||
let lane_layout = fx.layout_of(lane_ty);
|
||||
assert!(
|
||||
(lane_idx + 1) * lane_layout.size <= orig_lane_count * fx.layout_of(orig_lane_ty).size
|
||||
);
|
||||
|
||||
match self.inner {
|
||||
CPlaceInner::Var(_, _) => unreachable!(),
|
||||
CPlaceInner::VarPair(_, _, _) => unreachable!(),
|
||||
CPlaceInner::Addr(ptr, None) => {
|
||||
let field_offset = lane_layout.size * lane_idx;
|
||||
let field_ptr = ptr.offset_i64(fx, i64::try_from(field_offset.bytes()).unwrap());
|
||||
CPlace::for_ptr(field_ptr, lane_layout)
|
||||
}
|
||||
CPlaceInner::Addr(_, Some(_)) => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn place_index(
|
||||
self,
|
||||
fx: &mut FunctionCx<'_, '_, 'tcx>,
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ pub fn target_features(sess: &Session, allow_unstable: bool, target_info: &Locke
|
|||
.iter()
|
||||
.filter_map(
|
||||
|&(feature, gate)| {
|
||||
if sess.is_nightly_build() || allow_unstable || gate.is_none() { Some(feature) } else { None }
|
||||
if sess.is_nightly_build() || allow_unstable || gate.is_stable() { Some(feature) } else { None }
|
||||
},
|
||||
)
|
||||
.filter(|_feature| {
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ codegen_llvm_target_machine = could not create LLVM TargetMachine for triple: {$
|
|||
codegen_llvm_target_machine_with_llvm_err = could not create LLVM TargetMachine for triple: {$triple}: {$llvm_err}
|
||||
|
||||
codegen_llvm_unknown_ctarget_feature =
|
||||
unknown feature specified for `-Ctarget-feature`: `{$feature}`
|
||||
.note = it is still passed through to the codegen backend
|
||||
unknown and unstable feature specified for `-Ctarget-feature`: `{$feature}`
|
||||
.note = it is still passed through to the codegen backend, but use of this feature might be unsound and the behavior of this feature can change in the future
|
||||
.possible_feature = you might have meant: `{$rust_feature}`
|
||||
.consider_filing_feature_request = consider filing a feature request
|
||||
|
||||
|
|
@ -87,6 +87,10 @@ codegen_llvm_unknown_ctarget_feature_prefix =
|
|||
|
||||
codegen_llvm_unknown_debuginfo_compression = unknown debuginfo compression algorithm {$algorithm} - will fall back to uncompressed debuginfo
|
||||
|
||||
codegen_llvm_unstable_ctarget_feature =
|
||||
unstable feature specified for `-Ctarget-feature`: `{$feature}`
|
||||
.note = this feature is not stably supported; its behavior can change in the future
|
||||
|
||||
codegen_llvm_write_bytecode = failed to write bytecode to {$path}: {$err}
|
||||
|
||||
codegen_llvm_write_ir = failed to write LLVM IR to {$path}
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ pub fn get_fn<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, instance: Instance<'tcx>) ->
|
|||
// To avoid this, we set the Storage Class to "DllImport" so that
|
||||
// LLVM will prefix the name with `__imp_`. Ideally, we'd like the
|
||||
// existing logic below to set the Storage Class, but it has an
|
||||
// exemption for MinGW for backwards compatability.
|
||||
// exemption for MinGW for backwards compatibility.
|
||||
let llfn = cx.declare_fn(
|
||||
&common::i686_decorated_name(
|
||||
&dllimport,
|
||||
|
|
|
|||
|
|
@ -374,15 +374,7 @@ impl<'ll> StaticMethods for CodegenCx<'ll, '_> {
|
|||
|
||||
let g = self.get_static(def_id);
|
||||
|
||||
// boolean SSA values are i1, but they have to be stored in i8 slots,
|
||||
// otherwise some LLVM optimization passes don't work as expected
|
||||
let mut val_llty = self.val_ty(v);
|
||||
let v = if val_llty == self.type_i1() {
|
||||
val_llty = self.type_i8();
|
||||
llvm::LLVMConstZExt(v, val_llty)
|
||||
} else {
|
||||
v
|
||||
};
|
||||
let val_llty = self.val_ty(v);
|
||||
|
||||
let instance = Instance::mono(self.tcx, def_id);
|
||||
let ty = instance.ty(self.tcx, ty::ParamEnv::reveal_all());
|
||||
|
|
|
|||
|
|
@ -26,6 +26,13 @@ pub(crate) struct UnknownCTargetFeature<'a> {
|
|||
pub rust_feature: PossibleFeature<'a>,
|
||||
}
|
||||
|
||||
#[derive(Diagnostic)]
|
||||
#[diag(codegen_llvm_unstable_ctarget_feature)]
|
||||
#[note]
|
||||
pub(crate) struct UnstableCTargetFeature<'a> {
|
||||
pub feature: &'a str,
|
||||
}
|
||||
|
||||
#[derive(Subdiagnostic)]
|
||||
pub(crate) enum PossibleFeature<'a> {
|
||||
#[help(codegen_llvm_possible_feature)]
|
||||
|
|
|
|||
|
|
@ -969,7 +969,6 @@ extern "C" {
|
|||
ConstantIndices: *const &'a Value,
|
||||
NumIndices: c_uint,
|
||||
) -> &'a Value;
|
||||
pub fn LLVMConstZExt<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
||||
pub fn LLVMConstPtrToInt<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
||||
pub fn LLVMConstIntToPtr<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
||||
pub fn LLVMConstBitCast<'a>(ConstantVal: &'a Value, ToType: &'a Type) -> &'a Value;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use crate::back::write::create_informational_target_machine;
|
||||
use crate::errors::{
|
||||
PossibleFeature, TargetFeatureDisableOrEnable, UnknownCTargetFeature,
|
||||
UnknownCTargetFeaturePrefix,
|
||||
UnknownCTargetFeaturePrefix, UnstableCTargetFeature,
|
||||
};
|
||||
use crate::llvm;
|
||||
use libc::c_int;
|
||||
|
|
@ -293,7 +293,7 @@ pub fn target_features(sess: &Session, allow_unstable: bool) -> Vec<Symbol> {
|
|||
supported_target_features(sess)
|
||||
.iter()
|
||||
.filter_map(|&(feature, gate)| {
|
||||
if sess.is_nightly_build() || allow_unstable || gate.is_none() {
|
||||
if sess.is_nightly_build() || allow_unstable || gate.is_stable() {
|
||||
Some(feature)
|
||||
} else {
|
||||
None
|
||||
|
|
@ -531,25 +531,35 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str
|
|||
};
|
||||
|
||||
let feature = backend_feature_name(s)?;
|
||||
// Warn against use of LLVM specific feature names on the CLI.
|
||||
if diagnostics && !supported_features.iter().any(|&(v, _)| v == feature) {
|
||||
let rust_feature = supported_features.iter().find_map(|&(rust_feature, _)| {
|
||||
let llvm_features = to_llvm_features(sess, rust_feature);
|
||||
if llvm_features.contains(&feature) && !llvm_features.contains(&rust_feature) {
|
||||
Some(rust_feature)
|
||||
// Warn against use of LLVM specific feature names and unstable features on the CLI.
|
||||
if diagnostics {
|
||||
let feature_state = supported_features.iter().find(|&&(v, _)| v == feature);
|
||||
if feature_state.is_none() {
|
||||
let rust_feature = supported_features.iter().find_map(|&(rust_feature, _)| {
|
||||
let llvm_features = to_llvm_features(sess, rust_feature);
|
||||
if llvm_features.contains(&feature)
|
||||
&& !llvm_features.contains(&rust_feature)
|
||||
{
|
||||
Some(rust_feature)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
});
|
||||
let unknown_feature = if let Some(rust_feature) = rust_feature {
|
||||
UnknownCTargetFeature {
|
||||
feature,
|
||||
rust_feature: PossibleFeature::Some { rust_feature },
|
||||
}
|
||||
} else {
|
||||
None
|
||||
}
|
||||
});
|
||||
let unknown_feature = if let Some(rust_feature) = rust_feature {
|
||||
UnknownCTargetFeature {
|
||||
feature,
|
||||
rust_feature: PossibleFeature::Some { rust_feature },
|
||||
}
|
||||
} else {
|
||||
UnknownCTargetFeature { feature, rust_feature: PossibleFeature::None }
|
||||
};
|
||||
sess.emit_warning(unknown_feature);
|
||||
UnknownCTargetFeature { feature, rust_feature: PossibleFeature::None }
|
||||
};
|
||||
sess.emit_warning(unknown_feature);
|
||||
} else if feature_state
|
||||
.is_some_and(|(_name, feature_gate)| !feature_gate.is_stable())
|
||||
{
|
||||
// An unstable feature. Warn about using it.
|
||||
sess.emit_warning(UnstableCTargetFeature { feature });
|
||||
}
|
||||
}
|
||||
|
||||
if diagnostics {
|
||||
|
|
|
|||
|
|
@ -1033,7 +1033,7 @@ fn link_natively<'a>(
|
|||
SplitDebuginfo::Packed => link_dwarf_object(sess, codegen_results, out_filename),
|
||||
}
|
||||
|
||||
let strip = strip_value(sess);
|
||||
let strip = sess.opts.cg.strip;
|
||||
|
||||
if sess.target.is_like_osx {
|
||||
match (strip, crate_type) {
|
||||
|
|
@ -1070,14 +1070,6 @@ fn link_natively<'a>(
|
|||
Ok(())
|
||||
}
|
||||
|
||||
// Temporarily support both -Z strip and -C strip
|
||||
fn strip_value(sess: &Session) -> Strip {
|
||||
match (sess.opts.unstable_opts.strip, sess.opts.cg.strip) {
|
||||
(s, Strip::None) => s,
|
||||
(_, s) => s,
|
||||
}
|
||||
}
|
||||
|
||||
fn strip_symbols_with_external_utility<'a>(
|
||||
sess: &'a Session,
|
||||
util: &str,
|
||||
|
|
@ -2370,7 +2362,7 @@ fn add_order_independent_options(
|
|||
);
|
||||
|
||||
// Pass debuginfo, NatVis debugger visualizers and strip flags down to the linker.
|
||||
cmd.debuginfo(strip_value(sess), &natvis_visualizers);
|
||||
cmd.debuginfo(sess.opts.cg.strip, &natvis_visualizers);
|
||||
|
||||
// We want to prevent the compiler from accidentally leaking in any system libraries,
|
||||
// so by default we tell linkers not to link to any default libraries.
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ pub fn non_ssa_locals<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
|
|||
|
||||
// Arguments get assigned to by means of the function being called
|
||||
for arg in mir.args_iter() {
|
||||
analyzer.assign(arg, DefLocation::Argument);
|
||||
analyzer.define(arg, DefLocation::Argument);
|
||||
}
|
||||
|
||||
// If there exists a local definition that dominates all uses of that local,
|
||||
|
|
@ -74,7 +74,7 @@ struct LocalAnalyzer<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> {
|
|||
}
|
||||
|
||||
impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> LocalAnalyzer<'mir, 'a, 'tcx, Bx> {
|
||||
fn assign(&mut self, local: mir::Local, location: DefLocation) {
|
||||
fn define(&mut self, local: mir::Local, location: DefLocation) {
|
||||
let kind = &mut self.locals[local];
|
||||
match *kind {
|
||||
LocalKind::ZST => {}
|
||||
|
|
@ -162,7 +162,7 @@ impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
|
|||
debug!("visit_assign(place={:?}, rvalue={:?})", place, rvalue);
|
||||
|
||||
if let Some(local) = place.as_local() {
|
||||
self.assign(local, DefLocation::Body(location));
|
||||
self.define(local, DefLocation::Assignment(location));
|
||||
if self.locals[local] != LocalKind::Memory {
|
||||
let decl_span = self.fx.mir.local_decls[local].source_info.span;
|
||||
if !self.fx.rvalue_creates_operand(rvalue, decl_span) {
|
||||
|
|
@ -183,9 +183,14 @@ impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
|
|||
|
||||
fn visit_local(&mut self, local: mir::Local, context: PlaceContext, location: Location) {
|
||||
match context {
|
||||
PlaceContext::MutatingUse(MutatingUseContext::Call)
|
||||
| PlaceContext::MutatingUse(MutatingUseContext::Yield) => {
|
||||
self.assign(local, DefLocation::Body(location));
|
||||
PlaceContext::MutatingUse(MutatingUseContext::Call) => {
|
||||
let call = location.block;
|
||||
let TerminatorKind::Call { target, .. } =
|
||||
self.fx.mir.basic_blocks[call].terminator().kind
|
||||
else {
|
||||
bug!()
|
||||
};
|
||||
self.define(local, DefLocation::CallReturn { call, target });
|
||||
}
|
||||
|
||||
PlaceContext::NonUse(_)
|
||||
|
|
@ -219,7 +224,7 @@ impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
|
|||
| PlaceContext::NonMutatingUse(
|
||||
NonMutatingUseContext::Inspect
|
||||
| NonMutatingUseContext::SharedBorrow
|
||||
| NonMutatingUseContext::ShallowBorrow
|
||||
| NonMutatingUseContext::FakeBorrow
|
||||
| NonMutatingUseContext::AddressOf
|
||||
| NonMutatingUseContext::Projection,
|
||||
) => {
|
||||
|
|
@ -237,6 +242,8 @@ impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
PlaceContext::MutatingUse(MutatingUseContext::Yield) => bug!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,141 +19,183 @@ use rustc_span::Span;
|
|||
/// Features that control behaviour of rustc, rather than the codegen.
|
||||
pub const RUSTC_SPECIFIC_FEATURES: &[&str] = &["crt-static"];
|
||||
|
||||
/// Stability information for target features.
|
||||
#[derive(Debug, Clone, Copy)]
|
||||
pub enum Stability {
|
||||
/// This target feature is stable, it can be used in `#[target_feature]` and
|
||||
/// `#[cfg(target_feature)]`.
|
||||
Stable,
|
||||
/// This target feature is unstable; using it in `#[target_feature]` or `#[cfg(target_feature)]`
|
||||
/// requires enabling the given nightly feature.
|
||||
Unstable(Symbol),
|
||||
}
|
||||
use Stability::*;
|
||||
|
||||
impl Stability {
|
||||
fn as_feature_name(self) -> Option<Symbol> {
|
||||
match self {
|
||||
Stable => None,
|
||||
Unstable(s) => Some(s),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_stable(self) -> bool {
|
||||
matches!(self, Stable)
|
||||
}
|
||||
}
|
||||
|
||||
// Here we list target features that rustc "understands": they can be used in `#[target_feature]`
|
||||
// and `#[cfg(target_feature)]`. They also do not trigger any warnings when used with
|
||||
// `-Ctarget-feature`.
|
||||
//
|
||||
// When adding features to the below lists
|
||||
// check whether they're named already elsewhere in rust
|
||||
// e.g. in stdarch and whether the given name matches LLVM's
|
||||
// if it doesn't, to_llvm_feature in llvm_util in rustc_codegen_llvm needs to be adapted
|
||||
// if it doesn't, to_llvm_feature in llvm_util in rustc_codegen_llvm needs to be adapted.
|
||||
//
|
||||
// Also note that all target features listed here must be purely additive: for target_feature 1.1 to
|
||||
// be sound, we can never allow features like `+soft-float` (on x86) to be controlled on a
|
||||
// per-function level, since we would then allow safe calls from functions with `+soft-float` to
|
||||
// functions without that feature!
|
||||
//
|
||||
// When adding a new feature, be particularly mindful of features that affect function ABIs. Those
|
||||
// need to be treated very carefully to avoid introducing unsoundness! This often affects features
|
||||
// that enable/disable hardfloat support (see https://github.com/rust-lang/rust/issues/116344 for an
|
||||
// example of this going wrong), but features enabling new SIMD registers are also a concern (see
|
||||
// https://github.com/rust-lang/rust/issues/116558 for an example of this going wrong).
|
||||
//
|
||||
// Stabilizing a target feature requires t-lang approval.
|
||||
|
||||
const ARM_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
|
||||
const ARM_ALLOWED_FEATURES: &[(&str, Stability)] = &[
|
||||
// tidy-alphabetical-start
|
||||
("aclass", Some(sym::arm_target_feature)),
|
||||
("aes", Some(sym::arm_target_feature)),
|
||||
("crc", Some(sym::arm_target_feature)),
|
||||
("d32", Some(sym::arm_target_feature)),
|
||||
("dotprod", Some(sym::arm_target_feature)),
|
||||
("dsp", Some(sym::arm_target_feature)),
|
||||
("fp-armv8", Some(sym::arm_target_feature)),
|
||||
("i8mm", Some(sym::arm_target_feature)),
|
||||
("mclass", Some(sym::arm_target_feature)),
|
||||
("neon", Some(sym::arm_target_feature)),
|
||||
("rclass", Some(sym::arm_target_feature)),
|
||||
("sha2", Some(sym::arm_target_feature)),
|
||||
("aclass", Unstable(sym::arm_target_feature)),
|
||||
("aes", Unstable(sym::arm_target_feature)),
|
||||
("crc", Unstable(sym::arm_target_feature)),
|
||||
("d32", Unstable(sym::arm_target_feature)),
|
||||
("dotprod", Unstable(sym::arm_target_feature)),
|
||||
("dsp", Unstable(sym::arm_target_feature)),
|
||||
("fp-armv8", Unstable(sym::arm_target_feature)),
|
||||
("i8mm", Unstable(sym::arm_target_feature)),
|
||||
("mclass", Unstable(sym::arm_target_feature)),
|
||||
("neon", Unstable(sym::arm_target_feature)),
|
||||
("rclass", Unstable(sym::arm_target_feature)),
|
||||
("sha2", Unstable(sym::arm_target_feature)),
|
||||
// This is needed for inline assembly, but shouldn't be stabilized as-is
|
||||
// since it should be enabled per-function using #[instruction_set], not
|
||||
// #[target_feature].
|
||||
("thumb-mode", Some(sym::arm_target_feature)),
|
||||
("thumb2", Some(sym::arm_target_feature)),
|
||||
("trustzone", Some(sym::arm_target_feature)),
|
||||
("v5te", Some(sym::arm_target_feature)),
|
||||
("v6", Some(sym::arm_target_feature)),
|
||||
("v6k", Some(sym::arm_target_feature)),
|
||||
("v6t2", Some(sym::arm_target_feature)),
|
||||
("v7", Some(sym::arm_target_feature)),
|
||||
("v8", Some(sym::arm_target_feature)),
|
||||
("vfp2", Some(sym::arm_target_feature)),
|
||||
("vfp3", Some(sym::arm_target_feature)),
|
||||
("vfp4", Some(sym::arm_target_feature)),
|
||||
("virtualization", Some(sym::arm_target_feature)),
|
||||
("thumb-mode", Unstable(sym::arm_target_feature)),
|
||||
("thumb2", Unstable(sym::arm_target_feature)),
|
||||
("trustzone", Unstable(sym::arm_target_feature)),
|
||||
("v5te", Unstable(sym::arm_target_feature)),
|
||||
("v6", Unstable(sym::arm_target_feature)),
|
||||
("v6k", Unstable(sym::arm_target_feature)),
|
||||
("v6t2", Unstable(sym::arm_target_feature)),
|
||||
("v7", Unstable(sym::arm_target_feature)),
|
||||
("v8", Unstable(sym::arm_target_feature)),
|
||||
("vfp2", Unstable(sym::arm_target_feature)),
|
||||
("vfp3", Unstable(sym::arm_target_feature)),
|
||||
("vfp4", Unstable(sym::arm_target_feature)),
|
||||
("virtualization", Unstable(sym::arm_target_feature)),
|
||||
// tidy-alphabetical-end
|
||||
];
|
||||
|
||||
const AARCH64_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
|
||||
const AARCH64_ALLOWED_FEATURES: &[(&str, Stability)] = &[
|
||||
// tidy-alphabetical-start
|
||||
// FEAT_AES
|
||||
("aes", None),
|
||||
("aes", Stable),
|
||||
// FEAT_BF16
|
||||
("bf16", None),
|
||||
("bf16", Stable),
|
||||
// FEAT_BTI
|
||||
("bti", None),
|
||||
("bti", Stable),
|
||||
// FEAT_CRC
|
||||
("crc", None),
|
||||
("crc", Stable),
|
||||
// FEAT_DIT
|
||||
("dit", None),
|
||||
("dit", Stable),
|
||||
// FEAT_DotProd
|
||||
("dotprod", None),
|
||||
("dotprod", Stable),
|
||||
// FEAT_DPB
|
||||
("dpb", None),
|
||||
("dpb", Stable),
|
||||
// FEAT_DPB2
|
||||
("dpb2", None),
|
||||
("dpb2", Stable),
|
||||
// FEAT_F32MM
|
||||
("f32mm", None),
|
||||
("f32mm", Stable),
|
||||
// FEAT_F64MM
|
||||
("f64mm", None),
|
||||
("f64mm", Stable),
|
||||
// FEAT_FCMA
|
||||
("fcma", None),
|
||||
("fcma", Stable),
|
||||
// FEAT_FHM
|
||||
("fhm", None),
|
||||
("fhm", Stable),
|
||||
// FEAT_FLAGM
|
||||
("flagm", None),
|
||||
("flagm", Stable),
|
||||
// FEAT_FP16
|
||||
("fp16", None),
|
||||
("fp16", Stable),
|
||||
// FEAT_FRINTTS
|
||||
("frintts", None),
|
||||
("frintts", Stable),
|
||||
// FEAT_I8MM
|
||||
("i8mm", None),
|
||||
("i8mm", Stable),
|
||||
// FEAT_JSCVT
|
||||
("jsconv", None),
|
||||
("jsconv", Stable),
|
||||
// FEAT_LOR
|
||||
("lor", None),
|
||||
("lor", Stable),
|
||||
// FEAT_LSE
|
||||
("lse", None),
|
||||
("lse", Stable),
|
||||
// FEAT_MTE
|
||||
("mte", None),
|
||||
("mte", Stable),
|
||||
// FEAT_AdvSimd & FEAT_FP
|
||||
("neon", None),
|
||||
("neon", Stable),
|
||||
// FEAT_PAUTH (address authentication)
|
||||
("paca", None),
|
||||
("paca", Stable),
|
||||
// FEAT_PAUTH (generic authentication)
|
||||
("pacg", None),
|
||||
("pacg", Stable),
|
||||
// FEAT_PAN
|
||||
("pan", None),
|
||||
("pan", Stable),
|
||||
// FEAT_PMUv3
|
||||
("pmuv3", None),
|
||||
("pmuv3", Stable),
|
||||
// FEAT_RAND
|
||||
("rand", None),
|
||||
("rand", Stable),
|
||||
// FEAT_RAS
|
||||
("ras", None),
|
||||
("ras", Stable),
|
||||
// FEAT_RCPC
|
||||
("rcpc", None),
|
||||
("rcpc", Stable),
|
||||
// FEAT_RCPC2
|
||||
("rcpc2", None),
|
||||
("rcpc2", Stable),
|
||||
// FEAT_RDM
|
||||
("rdm", None),
|
||||
("rdm", Stable),
|
||||
// FEAT_SB
|
||||
("sb", None),
|
||||
("sb", Stable),
|
||||
// FEAT_SHA1 & FEAT_SHA256
|
||||
("sha2", None),
|
||||
("sha2", Stable),
|
||||
// FEAT_SHA512 & FEAT_SHA3
|
||||
("sha3", None),
|
||||
("sha3", Stable),
|
||||
// FEAT_SM3 & FEAT_SM4
|
||||
("sm4", None),
|
||||
("sm4", Stable),
|
||||
// FEAT_SPE
|
||||
("spe", None),
|
||||
("spe", Stable),
|
||||
// FEAT_SSBS
|
||||
("ssbs", None),
|
||||
("ssbs", Stable),
|
||||
// FEAT_SVE
|
||||
("sve", None),
|
||||
("sve", Stable),
|
||||
// FEAT_SVE2
|
||||
("sve2", None),
|
||||
("sve2", Stable),
|
||||
// FEAT_SVE2_AES
|
||||
("sve2-aes", None),
|
||||
("sve2-aes", Stable),
|
||||
// FEAT_SVE2_BitPerm
|
||||
("sve2-bitperm", None),
|
||||
("sve2-bitperm", Stable),
|
||||
// FEAT_SVE2_SHA3
|
||||
("sve2-sha3", None),
|
||||
("sve2-sha3", Stable),
|
||||
// FEAT_SVE2_SM4
|
||||
("sve2-sm4", None),
|
||||
("sve2-sm4", Stable),
|
||||
// FEAT_TME
|
||||
("tme", None),
|
||||
("v8.1a", Some(sym::aarch64_ver_target_feature)),
|
||||
("v8.2a", Some(sym::aarch64_ver_target_feature)),
|
||||
("v8.3a", Some(sym::aarch64_ver_target_feature)),
|
||||
("v8.4a", Some(sym::aarch64_ver_target_feature)),
|
||||
("v8.5a", Some(sym::aarch64_ver_target_feature)),
|
||||
("v8.6a", Some(sym::aarch64_ver_target_feature)),
|
||||
("v8.7a", Some(sym::aarch64_ver_target_feature)),
|
||||
("tme", Stable),
|
||||
("v8.1a", Unstable(sym::aarch64_ver_target_feature)),
|
||||
("v8.2a", Unstable(sym::aarch64_ver_target_feature)),
|
||||
("v8.3a", Unstable(sym::aarch64_ver_target_feature)),
|
||||
("v8.4a", Unstable(sym::aarch64_ver_target_feature)),
|
||||
("v8.5a", Unstable(sym::aarch64_ver_target_feature)),
|
||||
("v8.6a", Unstable(sym::aarch64_ver_target_feature)),
|
||||
("v8.7a", Unstable(sym::aarch64_ver_target_feature)),
|
||||
// FEAT_VHE
|
||||
("vh", None),
|
||||
("vh", Stable),
|
||||
// tidy-alphabetical-end
|
||||
];
|
||||
|
||||
|
|
@ -161,197 +203,197 @@ const AARCH64_TIED_FEATURES: &[&[&str]] = &[
|
|||
&["paca", "pacg"], // Together these represent `pauth` in LLVM
|
||||
];
|
||||
|
||||
const X86_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
|
||||
const X86_ALLOWED_FEATURES: &[(&str, Stability)] = &[
|
||||
// tidy-alphabetical-start
|
||||
("adx", None),
|
||||
("aes", None),
|
||||
("avx", None),
|
||||
("avx2", None),
|
||||
("avx512bf16", Some(sym::avx512_target_feature)),
|
||||
("avx512bitalg", Some(sym::avx512_target_feature)),
|
||||
("avx512bw", Some(sym::avx512_target_feature)),
|
||||
("avx512cd", Some(sym::avx512_target_feature)),
|
||||
("avx512dq", Some(sym::avx512_target_feature)),
|
||||
("avx512er", Some(sym::avx512_target_feature)),
|
||||
("avx512f", Some(sym::avx512_target_feature)),
|
||||
("avx512ifma", Some(sym::avx512_target_feature)),
|
||||
("avx512pf", Some(sym::avx512_target_feature)),
|
||||
("avx512vbmi", Some(sym::avx512_target_feature)),
|
||||
("avx512vbmi2", Some(sym::avx512_target_feature)),
|
||||
("avx512vl", Some(sym::avx512_target_feature)),
|
||||
("avx512vnni", Some(sym::avx512_target_feature)),
|
||||
("avx512vp2intersect", Some(sym::avx512_target_feature)),
|
||||
("avx512vpopcntdq", Some(sym::avx512_target_feature)),
|
||||
("bmi1", None),
|
||||
("bmi2", None),
|
||||
("cmpxchg16b", None),
|
||||
("ermsb", Some(sym::ermsb_target_feature)),
|
||||
("f16c", None),
|
||||
("fma", None),
|
||||
("fxsr", None),
|
||||
("gfni", Some(sym::avx512_target_feature)),
|
||||
("lzcnt", None),
|
||||
("movbe", None),
|
||||
("pclmulqdq", None),
|
||||
("popcnt", None),
|
||||
("rdrand", None),
|
||||
("rdseed", None),
|
||||
("rtm", Some(sym::rtm_target_feature)),
|
||||
("sha", None),
|
||||
("sse", None),
|
||||
("sse2", None),
|
||||
("sse3", None),
|
||||
("sse4.1", None),
|
||||
("sse4.2", None),
|
||||
("sse4a", Some(sym::sse4a_target_feature)),
|
||||
("ssse3", None),
|
||||
("tbm", Some(sym::tbm_target_feature)),
|
||||
("vaes", Some(sym::avx512_target_feature)),
|
||||
("vpclmulqdq", Some(sym::avx512_target_feature)),
|
||||
("xsave", None),
|
||||
("xsavec", None),
|
||||
("xsaveopt", None),
|
||||
("xsaves", None),
|
||||
("adx", Stable),
|
||||
("aes", Stable),
|
||||
("avx", Stable),
|
||||
("avx2", Stable),
|
||||
("avx512bf16", Unstable(sym::avx512_target_feature)),
|
||||
("avx512bitalg", Unstable(sym::avx512_target_feature)),
|
||||
("avx512bw", Unstable(sym::avx512_target_feature)),
|
||||
("avx512cd", Unstable(sym::avx512_target_feature)),
|
||||
("avx512dq", Unstable(sym::avx512_target_feature)),
|
||||
("avx512er", Unstable(sym::avx512_target_feature)),
|
||||
("avx512f", Unstable(sym::avx512_target_feature)),
|
||||
("avx512ifma", Unstable(sym::avx512_target_feature)),
|
||||
("avx512pf", Unstable(sym::avx512_target_feature)),
|
||||
("avx512vbmi", Unstable(sym::avx512_target_feature)),
|
||||
("avx512vbmi2", Unstable(sym::avx512_target_feature)),
|
||||
("avx512vl", Unstable(sym::avx512_target_feature)),
|
||||
("avx512vnni", Unstable(sym::avx512_target_feature)),
|
||||
("avx512vp2intersect", Unstable(sym::avx512_target_feature)),
|
||||
("avx512vpopcntdq", Unstable(sym::avx512_target_feature)),
|
||||
("bmi1", Stable),
|
||||
("bmi2", Stable),
|
||||
("cmpxchg16b", Stable),
|
||||
("ermsb", Unstable(sym::ermsb_target_feature)),
|
||||
("f16c", Stable),
|
||||
("fma", Stable),
|
||||
("fxsr", Stable),
|
||||
("gfni", Unstable(sym::avx512_target_feature)),
|
||||
("lzcnt", Stable),
|
||||
("movbe", Stable),
|
||||
("pclmulqdq", Stable),
|
||||
("popcnt", Stable),
|
||||
("rdrand", Stable),
|
||||
("rdseed", Stable),
|
||||
("rtm", Unstable(sym::rtm_target_feature)),
|
||||
("sha", Stable),
|
||||
("sse", Stable),
|
||||
("sse2", Stable),
|
||||
("sse3", Stable),
|
||||
("sse4.1", Stable),
|
||||
("sse4.2", Stable),
|
||||
("sse4a", Unstable(sym::sse4a_target_feature)),
|
||||
("ssse3", Stable),
|
||||
("tbm", Unstable(sym::tbm_target_feature)),
|
||||
("vaes", Unstable(sym::avx512_target_feature)),
|
||||
("vpclmulqdq", Unstable(sym::avx512_target_feature)),
|
||||
("xsave", Stable),
|
||||
("xsavec", Stable),
|
||||
("xsaveopt", Stable),
|
||||
("xsaves", Stable),
|
||||
// tidy-alphabetical-end
|
||||
];
|
||||
|
||||
const HEXAGON_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
|
||||
const HEXAGON_ALLOWED_FEATURES: &[(&str, Stability)] = &[
|
||||
// tidy-alphabetical-start
|
||||
("hvx", Some(sym::hexagon_target_feature)),
|
||||
("hvx-length128b", Some(sym::hexagon_target_feature)),
|
||||
("hvx", Unstable(sym::hexagon_target_feature)),
|
||||
("hvx-length128b", Unstable(sym::hexagon_target_feature)),
|
||||
// tidy-alphabetical-end
|
||||
];
|
||||
|
||||
const POWERPC_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
|
||||
const POWERPC_ALLOWED_FEATURES: &[(&str, Stability)] = &[
|
||||
// tidy-alphabetical-start
|
||||
("altivec", Some(sym::powerpc_target_feature)),
|
||||
("power10-vector", Some(sym::powerpc_target_feature)),
|
||||
("power8-altivec", Some(sym::powerpc_target_feature)),
|
||||
("power8-vector", Some(sym::powerpc_target_feature)),
|
||||
("power9-altivec", Some(sym::powerpc_target_feature)),
|
||||
("power9-vector", Some(sym::powerpc_target_feature)),
|
||||
("vsx", Some(sym::powerpc_target_feature)),
|
||||
("altivec", Unstable(sym::powerpc_target_feature)),
|
||||
("power10-vector", Unstable(sym::powerpc_target_feature)),
|
||||
("power8-altivec", Unstable(sym::powerpc_target_feature)),
|
||||
("power8-vector", Unstable(sym::powerpc_target_feature)),
|
||||
("power9-altivec", Unstable(sym::powerpc_target_feature)),
|
||||
("power9-vector", Unstable(sym::powerpc_target_feature)),
|
||||
("vsx", Unstable(sym::powerpc_target_feature)),
|
||||
// tidy-alphabetical-end
|
||||
];
|
||||
|
||||
const MIPS_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
|
||||
const MIPS_ALLOWED_FEATURES: &[(&str, Stability)] = &[
|
||||
// tidy-alphabetical-start
|
||||
("fp64", Some(sym::mips_target_feature)),
|
||||
("msa", Some(sym::mips_target_feature)),
|
||||
("virt", Some(sym::mips_target_feature)),
|
||||
("fp64", Unstable(sym::mips_target_feature)),
|
||||
("msa", Unstable(sym::mips_target_feature)),
|
||||
("virt", Unstable(sym::mips_target_feature)),
|
||||
// tidy-alphabetical-end
|
||||
];
|
||||
|
||||
const RISCV_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
|
||||
const RISCV_ALLOWED_FEATURES: &[(&str, Stability)] = &[
|
||||
// tidy-alphabetical-start
|
||||
("a", None),
|
||||
("c", None),
|
||||
("d", Some(sym::riscv_target_feature)),
|
||||
("e", Some(sym::riscv_target_feature)),
|
||||
("f", Some(sym::riscv_target_feature)),
|
||||
("m", None),
|
||||
("relax", Some(sym::riscv_target_feature)),
|
||||
("unaligned-scalar-mem", Some(sym::riscv_target_feature)),
|
||||
("v", Some(sym::riscv_target_feature)),
|
||||
("zba", None),
|
||||
("zbb", None),
|
||||
("zbc", None),
|
||||
("zbkb", None),
|
||||
("zbkc", None),
|
||||
("zbkx", None),
|
||||
("zbs", None),
|
||||
("zdinx", Some(sym::riscv_target_feature)),
|
||||
("zfh", Some(sym::riscv_target_feature)),
|
||||
("zfhmin", Some(sym::riscv_target_feature)),
|
||||
("zfinx", Some(sym::riscv_target_feature)),
|
||||
("zhinx", Some(sym::riscv_target_feature)),
|
||||
("zhinxmin", Some(sym::riscv_target_feature)),
|
||||
("zk", None),
|
||||
("zkn", None),
|
||||
("zknd", None),
|
||||
("zkne", None),
|
||||
("zknh", None),
|
||||
("zkr", None),
|
||||
("zks", None),
|
||||
("zksed", None),
|
||||
("zksh", None),
|
||||
("zkt", None),
|
||||
("a", Stable),
|
||||
("c", Stable),
|
||||
("d", Unstable(sym::riscv_target_feature)),
|
||||
("e", Unstable(sym::riscv_target_feature)),
|
||||
("f", Unstable(sym::riscv_target_feature)),
|
||||
("m", Stable),
|
||||
("relax", Unstable(sym::riscv_target_feature)),
|
||||
("unaligned-scalar-mem", Unstable(sym::riscv_target_feature)),
|
||||
("v", Unstable(sym::riscv_target_feature)),
|
||||
("zba", Stable),
|
||||
("zbb", Stable),
|
||||
("zbc", Stable),
|
||||
("zbkb", Stable),
|
||||
("zbkc", Stable),
|
||||
("zbkx", Stable),
|
||||
("zbs", Stable),
|
||||
("zdinx", Unstable(sym::riscv_target_feature)),
|
||||
("zfh", Unstable(sym::riscv_target_feature)),
|
||||
("zfhmin", Unstable(sym::riscv_target_feature)),
|
||||
("zfinx", Unstable(sym::riscv_target_feature)),
|
||||
("zhinx", Unstable(sym::riscv_target_feature)),
|
||||
("zhinxmin", Unstable(sym::riscv_target_feature)),
|
||||
("zk", Stable),
|
||||
("zkn", Stable),
|
||||
("zknd", Stable),
|
||||
("zkne", Stable),
|
||||
("zknh", Stable),
|
||||
("zkr", Stable),
|
||||
("zks", Stable),
|
||||
("zksed", Stable),
|
||||
("zksh", Stable),
|
||||
("zkt", Stable),
|
||||
// tidy-alphabetical-end
|
||||
];
|
||||
|
||||
const WASM_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
|
||||
const WASM_ALLOWED_FEATURES: &[(&str, Stability)] = &[
|
||||
// tidy-alphabetical-start
|
||||
("atomics", Some(sym::wasm_target_feature)),
|
||||
("bulk-memory", Some(sym::wasm_target_feature)),
|
||||
("exception-handling", Some(sym::wasm_target_feature)),
|
||||
("multivalue", Some(sym::wasm_target_feature)),
|
||||
("mutable-globals", Some(sym::wasm_target_feature)),
|
||||
("nontrapping-fptoint", Some(sym::wasm_target_feature)),
|
||||
("reference-types", Some(sym::wasm_target_feature)),
|
||||
("relaxed-simd", Some(sym::wasm_target_feature)),
|
||||
("sign-ext", Some(sym::wasm_target_feature)),
|
||||
("simd128", None),
|
||||
("atomics", Unstable(sym::wasm_target_feature)),
|
||||
("bulk-memory", Unstable(sym::wasm_target_feature)),
|
||||
("exception-handling", Unstable(sym::wasm_target_feature)),
|
||||
("multivalue", Unstable(sym::wasm_target_feature)),
|
||||
("mutable-globals", Unstable(sym::wasm_target_feature)),
|
||||
("nontrapping-fptoint", Unstable(sym::wasm_target_feature)),
|
||||
("reference-types", Unstable(sym::wasm_target_feature)),
|
||||
("relaxed-simd", Unstable(sym::wasm_target_feature)),
|
||||
("sign-ext", Unstable(sym::wasm_target_feature)),
|
||||
("simd128", Stable),
|
||||
// tidy-alphabetical-end
|
||||
];
|
||||
|
||||
const BPF_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[("alu32", Some(sym::bpf_target_feature))];
|
||||
const BPF_ALLOWED_FEATURES: &[(&str, Stability)] = &[("alu32", Unstable(sym::bpf_target_feature))];
|
||||
|
||||
const CSKY_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
|
||||
const CSKY_ALLOWED_FEATURES: &[(&str, Stability)] = &[
|
||||
// tidy-alphabetical-start
|
||||
("10e60", Some(sym::csky_target_feature)),
|
||||
("2e3", Some(sym::csky_target_feature)),
|
||||
("3e3r1", Some(sym::csky_target_feature)),
|
||||
("3e3r2", Some(sym::csky_target_feature)),
|
||||
("3e3r3", Some(sym::csky_target_feature)),
|
||||
("3e7", Some(sym::csky_target_feature)),
|
||||
("7e10", Some(sym::csky_target_feature)),
|
||||
("cache", Some(sym::csky_target_feature)),
|
||||
("doloop", Some(sym::csky_target_feature)),
|
||||
("dsp1e2", Some(sym::csky_target_feature)),
|
||||
("dspe60", Some(sym::csky_target_feature)),
|
||||
("e1", Some(sym::csky_target_feature)),
|
||||
("e2", Some(sym::csky_target_feature)),
|
||||
("edsp", Some(sym::csky_target_feature)),
|
||||
("elrw", Some(sym::csky_target_feature)),
|
||||
("float1e2", Some(sym::csky_target_feature)),
|
||||
("float1e3", Some(sym::csky_target_feature)),
|
||||
("float3e4", Some(sym::csky_target_feature)),
|
||||
("float7e60", Some(sym::csky_target_feature)),
|
||||
("floate1", Some(sym::csky_target_feature)),
|
||||
("hard-tp", Some(sym::csky_target_feature)),
|
||||
("high-registers", Some(sym::csky_target_feature)),
|
||||
("hwdiv", Some(sym::csky_target_feature)),
|
||||
("mp", Some(sym::csky_target_feature)),
|
||||
("mp1e2", Some(sym::csky_target_feature)),
|
||||
("nvic", Some(sym::csky_target_feature)),
|
||||
("trust", Some(sym::csky_target_feature)),
|
||||
("vdsp2e60f", Some(sym::csky_target_feature)),
|
||||
("vdspv1", Some(sym::csky_target_feature)),
|
||||
("vdspv2", Some(sym::csky_target_feature)),
|
||||
("10e60", Unstable(sym::csky_target_feature)),
|
||||
("2e3", Unstable(sym::csky_target_feature)),
|
||||
("3e3r1", Unstable(sym::csky_target_feature)),
|
||||
("3e3r2", Unstable(sym::csky_target_feature)),
|
||||
("3e3r3", Unstable(sym::csky_target_feature)),
|
||||
("3e7", Unstable(sym::csky_target_feature)),
|
||||
("7e10", Unstable(sym::csky_target_feature)),
|
||||
("cache", Unstable(sym::csky_target_feature)),
|
||||
("doloop", Unstable(sym::csky_target_feature)),
|
||||
("dsp1e2", Unstable(sym::csky_target_feature)),
|
||||
("dspe60", Unstable(sym::csky_target_feature)),
|
||||
("e1", Unstable(sym::csky_target_feature)),
|
||||
("e2", Unstable(sym::csky_target_feature)),
|
||||
("edsp", Unstable(sym::csky_target_feature)),
|
||||
("elrw", Unstable(sym::csky_target_feature)),
|
||||
("float1e2", Unstable(sym::csky_target_feature)),
|
||||
("float1e3", Unstable(sym::csky_target_feature)),
|
||||
("float3e4", Unstable(sym::csky_target_feature)),
|
||||
("float7e60", Unstable(sym::csky_target_feature)),
|
||||
("floate1", Unstable(sym::csky_target_feature)),
|
||||
("hard-tp", Unstable(sym::csky_target_feature)),
|
||||
("high-registers", Unstable(sym::csky_target_feature)),
|
||||
("hwdiv", Unstable(sym::csky_target_feature)),
|
||||
("mp", Unstable(sym::csky_target_feature)),
|
||||
("mp1e2", Unstable(sym::csky_target_feature)),
|
||||
("nvic", Unstable(sym::csky_target_feature)),
|
||||
("trust", Unstable(sym::csky_target_feature)),
|
||||
("vdsp2e60f", Unstable(sym::csky_target_feature)),
|
||||
("vdspv1", Unstable(sym::csky_target_feature)),
|
||||
("vdspv2", Unstable(sym::csky_target_feature)),
|
||||
// tidy-alphabetical-end
|
||||
//fpu
|
||||
// tidy-alphabetical-start
|
||||
("fdivdu", Some(sym::csky_target_feature)),
|
||||
("fpuv2_df", Some(sym::csky_target_feature)),
|
||||
("fpuv2_sf", Some(sym::csky_target_feature)),
|
||||
("fpuv3_df", Some(sym::csky_target_feature)),
|
||||
("fpuv3_hf", Some(sym::csky_target_feature)),
|
||||
("fpuv3_hi", Some(sym::csky_target_feature)),
|
||||
("fpuv3_sf", Some(sym::csky_target_feature)),
|
||||
("hard-float", Some(sym::csky_target_feature)),
|
||||
("hard-float-abi", Some(sym::csky_target_feature)),
|
||||
("fdivdu", Unstable(sym::csky_target_feature)),
|
||||
("fpuv2_df", Unstable(sym::csky_target_feature)),
|
||||
("fpuv2_sf", Unstable(sym::csky_target_feature)),
|
||||
("fpuv3_df", Unstable(sym::csky_target_feature)),
|
||||
("fpuv3_hf", Unstable(sym::csky_target_feature)),
|
||||
("fpuv3_hi", Unstable(sym::csky_target_feature)),
|
||||
("fpuv3_sf", Unstable(sym::csky_target_feature)),
|
||||
("hard-float", Unstable(sym::csky_target_feature)),
|
||||
("hard-float-abi", Unstable(sym::csky_target_feature)),
|
||||
// tidy-alphabetical-end
|
||||
];
|
||||
|
||||
const LOONGARCH_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
|
||||
const LOONGARCH_ALLOWED_FEATURES: &[(&str, Stability)] = &[
|
||||
// tidy-alphabetical-start
|
||||
("d", Some(sym::loongarch_target_feature)),
|
||||
("f", Some(sym::loongarch_target_feature)),
|
||||
("lasx", Some(sym::loongarch_target_feature)),
|
||||
("lbt", Some(sym::loongarch_target_feature)),
|
||||
("lsx", Some(sym::loongarch_target_feature)),
|
||||
("lvz", Some(sym::loongarch_target_feature)),
|
||||
("ual", Some(sym::loongarch_target_feature)),
|
||||
("d", Unstable(sym::loongarch_target_feature)),
|
||||
("f", Unstable(sym::loongarch_target_feature)),
|
||||
("lasx", Unstable(sym::loongarch_target_feature)),
|
||||
("lbt", Unstable(sym::loongarch_target_feature)),
|
||||
("lsx", Unstable(sym::loongarch_target_feature)),
|
||||
("lvz", Unstable(sym::loongarch_target_feature)),
|
||||
("ual", Unstable(sym::loongarch_target_feature)),
|
||||
// tidy-alphabetical-end
|
||||
];
|
||||
|
||||
|
|
@ -359,7 +401,7 @@ const LOONGARCH_ALLOWED_FEATURES: &[(&str, Option<Symbol>)] = &[
|
|||
/// primitives may be documented.
|
||||
///
|
||||
/// IMPORTANT: If you're adding another feature list above, make sure to add it to this iterator!
|
||||
pub fn all_known_features() -> impl Iterator<Item = (&'static str, Option<Symbol>)> {
|
||||
pub fn all_known_features() -> impl Iterator<Item = (&'static str, Stability)> {
|
||||
std::iter::empty()
|
||||
.chain(ARM_ALLOWED_FEATURES.iter())
|
||||
.chain(AARCH64_ALLOWED_FEATURES.iter())
|
||||
|
|
@ -375,7 +417,7 @@ pub fn all_known_features() -> impl Iterator<Item = (&'static str, Option<Symbol
|
|||
.cloned()
|
||||
}
|
||||
|
||||
pub fn supported_target_features(sess: &Session) -> &'static [(&'static str, Option<Symbol>)] {
|
||||
pub fn supported_target_features(sess: &Session) -> &'static [(&'static str, Stability)] {
|
||||
match &*sess.target.arch {
|
||||
"arm" => ARM_ALLOWED_FEATURES,
|
||||
"aarch64" => AARCH64_ALLOWED_FEATURES,
|
||||
|
|
@ -520,11 +562,11 @@ pub(crate) fn provide(providers: &mut Providers) {
|
|||
if tcx.sess.opts.actually_rustdoc {
|
||||
// rustdoc needs to be able to document functions that use all the features, so
|
||||
// whitelist them all
|
||||
all_known_features().map(|(a, b)| (a.to_string(), b)).collect()
|
||||
all_known_features().map(|(a, b)| (a.to_string(), b.as_feature_name())).collect()
|
||||
} else {
|
||||
supported_target_features(tcx.sess)
|
||||
.iter()
|
||||
.map(|&(a, b)| (a.to_string(), b))
|
||||
.map(|&(a, b)| (a.to_string(), b.as_feature_name()))
|
||||
.collect()
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -104,11 +104,7 @@ pub trait CodegenBackend {
|
|||
outputs: &OutputFilenames,
|
||||
) -> Result<(CodegenResults, FxIndexMap<WorkProductId, WorkProduct>), ErrorGuaranteed>;
|
||||
|
||||
/// This is called on the returned `Box<dyn Any>` from `join_codegen`
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// Panics when the passed `Box<dyn Any>` was not returned by `join_codegen`.
|
||||
/// This is called on the returned `CodegenResults` from `join_codegen`
|
||||
fn link(
|
||||
&self,
|
||||
sess: &Session,
|
||||
|
|
|
|||
|
|
@ -97,11 +97,27 @@ pub(crate) fn const_to_valtree_inner<'tcx>(
|
|||
Ok(ty::ValTree::Leaf(val.assert_int()))
|
||||
}
|
||||
|
||||
// Raw pointers are not allowed in type level constants, as we cannot properly test them for
|
||||
// equality at compile-time (see `ptr_guaranteed_cmp`).
|
||||
ty::RawPtr(_) => {
|
||||
// Not all raw pointers are allowed, as we cannot properly test them for
|
||||
// equality at compile-time (see `ptr_guaranteed_cmp`).
|
||||
// However we allow those that are just integers in disguise.
|
||||
// (We could allow wide raw pointers where both sides are integers in the future,
|
||||
// but for now we reject them.)
|
||||
let Ok(val) = ecx.read_scalar(place) else {
|
||||
return Err(ValTreeCreationError::Other);
|
||||
};
|
||||
// We are in the CTFE machine, so ptr-to-int casts will fail.
|
||||
// This can only be `Ok` if `val` already is an integer.
|
||||
let Ok(val) = val.try_to_int() else {
|
||||
return Err(ValTreeCreationError::Other);
|
||||
};
|
||||
// It's just a ScalarInt!
|
||||
Ok(ty::ValTree::Leaf(val))
|
||||
}
|
||||
|
||||
// Technically we could allow function pointers (represented as `ty::Instance`), but this is not guaranteed to
|
||||
// agree with runtime equality tests.
|
||||
ty::FnPtr(_) | ty::RawPtr(_) => Err(ValTreeCreationError::NonSupportedType),
|
||||
ty::FnPtr(_) => Err(ValTreeCreationError::NonSupportedType),
|
||||
|
||||
ty::Ref(_, _, _) => {
|
||||
let Ok(derefd_place)= ecx.deref_pointer(place) else {
|
||||
|
|
@ -222,12 +238,14 @@ pub fn valtree_to_const_value<'tcx>(
|
|||
assert!(valtree.unwrap_branch().is_empty());
|
||||
mir::ConstValue::ZeroSized
|
||||
}
|
||||
ty::Bool | ty::Int(_) | ty::Uint(_) | ty::Float(_) | ty::Char => match valtree {
|
||||
ty::ValTree::Leaf(scalar_int) => mir::ConstValue::Scalar(Scalar::Int(scalar_int)),
|
||||
ty::ValTree::Branch(_) => bug!(
|
||||
"ValTrees for Bool, Int, Uint, Float or Char should have the form ValTree::Leaf"
|
||||
),
|
||||
},
|
||||
ty::Bool | ty::Int(_) | ty::Uint(_) | ty::Float(_) | ty::Char | ty::RawPtr(_) => {
|
||||
match valtree {
|
||||
ty::ValTree::Leaf(scalar_int) => mir::ConstValue::Scalar(Scalar::Int(scalar_int)),
|
||||
ty::ValTree::Branch(_) => bug!(
|
||||
"ValTrees for Bool, Int, Uint, Float, Char or RawPtr should have the form ValTree::Leaf"
|
||||
),
|
||||
}
|
||||
}
|
||||
ty::Ref(_, inner_ty, _) => {
|
||||
let mut ecx = mk_eval_cx(tcx, DUMMY_SP, param_env, CanAccessStatics::No);
|
||||
let imm = valtree_to_ref(&mut ecx, valtree, *inner_ty);
|
||||
|
|
@ -281,7 +299,6 @@ pub fn valtree_to_const_value<'tcx>(
|
|||
| ty::Coroutine(..)
|
||||
| ty::CoroutineWitness(..)
|
||||
| ty::FnPtr(_)
|
||||
| ty::RawPtr(_)
|
||||
| ty::Str
|
||||
| ty::Slice(_)
|
||||
| ty::Dynamic(..) => bug!("no ValTree should have been created for type {:?}", ty.kind()),
|
||||
|
|
|
|||
|
|
@ -119,7 +119,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
if matches!(ty.kind(), ty::Adt(def, ..) if def.variants().is_empty()) {
|
||||
throw_ub!(UninhabitedEnumVariantRead(index))
|
||||
}
|
||||
// For consisteny with `write_discriminant`, and to make sure that
|
||||
// For consistency with `write_discriminant`, and to make sure that
|
||||
// `project_downcast` cannot fail due to strange layouts, we declare immediate UB
|
||||
// for uninhabited variants.
|
||||
if op.layout().for_variant(self, index).abi.is_uninhabited() {
|
||||
|
|
@ -236,7 +236,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
|
|||
variant
|
||||
}
|
||||
};
|
||||
// For consisteny with `write_discriminant`, and to make sure that `project_downcast` cannot fail due to strange layouts, we declare immediate UB for uninhabited variants.
|
||||
// For consistency with `write_discriminant`, and to make sure that `project_downcast` cannot fail due to strange layouts, we declare immediate UB for uninhabited variants.
|
||||
if op.layout().for_variant(self, index).abi.is_uninhabited() {
|
||||
throw_ub!(UninhabitedEnumVariantRead(index))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -423,8 +423,8 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
|
|||
BorrowKind::Shared => {
|
||||
PlaceContext::NonMutatingUse(NonMutatingUseContext::SharedBorrow)
|
||||
}
|
||||
BorrowKind::Shallow => {
|
||||
PlaceContext::NonMutatingUse(NonMutatingUseContext::ShallowBorrow)
|
||||
BorrowKind::Fake => {
|
||||
PlaceContext::NonMutatingUse(NonMutatingUseContext::FakeBorrow)
|
||||
}
|
||||
BorrowKind::Mut { .. } => {
|
||||
PlaceContext::MutatingUse(MutatingUseContext::Borrow)
|
||||
|
|
@ -500,7 +500,7 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> {
|
|||
self.check_mut_borrow(place.local, hir::BorrowKind::Raw)
|
||||
}
|
||||
|
||||
Rvalue::Ref(_, BorrowKind::Shared | BorrowKind::Shallow, place)
|
||||
Rvalue::Ref(_, BorrowKind::Shared | BorrowKind::Fake, place)
|
||||
| Rvalue::AddressOf(Mutability::Not, place) => {
|
||||
let borrowed_place_has_mut_interior = qualifs::in_place::<HasMutInterior, _>(
|
||||
&self.ccx,
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ where
|
|||
fn ref_allows_mutation(&self, kind: mir::BorrowKind, place: mir::Place<'tcx>) -> bool {
|
||||
match kind {
|
||||
mir::BorrowKind::Mut { .. } => true,
|
||||
mir::BorrowKind::Shared | mir::BorrowKind::Shallow => {
|
||||
mir::BorrowKind::Shared | mir::BorrowKind::Fake => {
|
||||
self.shared_borrow_allows_mutation(place)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -456,7 +456,7 @@ impl<'tcx> Validator<'_, 'tcx> {
|
|||
match kind {
|
||||
// Reject these borrow types just to be safe.
|
||||
// FIXME(RalfJung): could we allow them? Should we? No point in it until we have a usecase.
|
||||
BorrowKind::Shallow | BorrowKind::Mut { kind: MutBorrowKind::ClosureCapture } => {
|
||||
BorrowKind::Fake | BorrowKind::Mut { kind: MutBorrowKind::ClosureCapture } => {
|
||||
return Err(Unpromotable);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -848,11 +848,11 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> {
|
|||
}
|
||||
match rvalue {
|
||||
Rvalue::Use(_) | Rvalue::CopyForDeref(_) | Rvalue::Aggregate(..) => {}
|
||||
Rvalue::Ref(_, BorrowKind::Shallow, _) => {
|
||||
Rvalue::Ref(_, BorrowKind::Fake, _) => {
|
||||
if self.mir_phase >= MirPhase::Runtime(RuntimePhase::Initial) {
|
||||
self.fail(
|
||||
location,
|
||||
"`Assign` statement with a `Shallow` borrow should have been removed in runtime MIR",
|
||||
"`Assign` statement with a `Fake` borrow should have been removed in runtime MIR",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,9 @@ features = [
|
|||
memmap2 = "0.2.1"
|
||||
# tidy-alphabetical-end
|
||||
|
||||
[target.'cfg(any(target_arch = "powerpc", target_arch = "mips"))'.dependencies]
|
||||
portable-atomic = "1.5.1"
|
||||
|
||||
[features]
|
||||
# tidy-alphabetical-start
|
||||
rustc_use_parallel_compiler = ["indexmap/rustc-rayon", "rustc-rayon", "rustc-rayon-core"]
|
||||
|
|
|
|||
|
|
@ -127,6 +127,9 @@ impl<F: FnOnce()> Drop for OnDrop<F> {
|
|||
}
|
||||
}
|
||||
|
||||
/// This is a marker for a fatal compiler error used with `resume_unwind`.
|
||||
pub struct FatalErrorMarker;
|
||||
|
||||
/// Turns a closure that takes an `&mut Formatter` into something that can be display-formatted.
|
||||
pub fn make_display(f: impl Fn(&mut fmt::Formatter<'_>) -> fmt::Result) -> impl fmt::Display {
|
||||
struct Printer<F> {
|
||||
|
|
|
|||
|
|
@ -138,7 +138,6 @@ cfg_match! {
|
|||
[std::sync::atomic::AtomicUsize]
|
||||
[std::sync::atomic::AtomicU8]
|
||||
[std::sync::atomic::AtomicU32]
|
||||
[std::sync::atomic::AtomicU64]
|
||||
[std::backtrace::Backtrace]
|
||||
[std::io::Error]
|
||||
[std::fs::File]
|
||||
|
|
@ -148,6 +147,18 @@ cfg_match! {
|
|||
[crate::owned_slice::OwnedSlice]
|
||||
);
|
||||
|
||||
// PowerPC and MIPS platforms with 32-bit pointers do not
|
||||
// have AtomicU64 type.
|
||||
#[cfg(not(any(target_arch = "powerpc", target_arch = "mips")))]
|
||||
already_sync!(
|
||||
[std::sync::atomic::AtomicU64]
|
||||
);
|
||||
|
||||
#[cfg(any(target_arch = "powerpc", target_arch = "mips"))]
|
||||
already_sync!(
|
||||
[portable_atomic::AtomicU64]
|
||||
);
|
||||
|
||||
macro_rules! impl_dyn_sync {
|
||||
($($($attr: meta)* [$ty: ty where $($generics2: tt)*])*) => {
|
||||
$(unsafe impl<$($generics2)*> DynSync for $ty {})*
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ impl<T> Sharded<T> {
|
|||
pub fn lock_shard_by_value<K: Hash + ?Sized>(&self, _val: &K) -> LockGuard<'_, T> {
|
||||
match self {
|
||||
Self::Single(single) => {
|
||||
// Syncronization is disabled so use the `lock_assume_no_sync` method optimized
|
||||
// Synchronization is disabled so use the `lock_assume_no_sync` method optimized
|
||||
// for that case.
|
||||
|
||||
// SAFETY: We know `is_dyn_thread_safe` was false when creating the lock thus
|
||||
|
|
@ -102,7 +102,7 @@ impl<T> Sharded<T> {
|
|||
pub fn lock_shard_by_index(&self, _i: usize) -> LockGuard<'_, T> {
|
||||
match self {
|
||||
Self::Single(single) => {
|
||||
// Syncronization is disabled so use the `lock_assume_no_sync` method optimized
|
||||
// Synchronization is disabled so use the `lock_assume_no_sync` method optimized
|
||||
// for that case.
|
||||
|
||||
// SAFETY: We know `is_dyn_thread_safe` was false when creating the lock thus
|
||||
|
|
@ -111,7 +111,7 @@ impl<T> Sharded<T> {
|
|||
}
|
||||
#[cfg(parallel_compiler)]
|
||||
Self::Shards(shards) => {
|
||||
// Syncronization is enabled so use the `lock_assume_sync` method optimized
|
||||
// Synchronization is enabled so use the `lock_assume_sync` method optimized
|
||||
// for that case.
|
||||
|
||||
// SAFETY (get_unchecked): The index gets ANDed with the shard mask, ensuring it is
|
||||
|
|
|
|||
|
|
@ -265,7 +265,15 @@ cfg_match! {
|
|||
|
||||
pub use std::sync::OnceLock;
|
||||
|
||||
pub use std::sync::atomic::{AtomicBool, AtomicUsize, AtomicU32, AtomicU64};
|
||||
pub use std::sync::atomic::{AtomicBool, AtomicUsize, AtomicU32};
|
||||
|
||||
// PowerPC and MIPS platforms with 32-bit pointers do not
|
||||
// have AtomicU64 type.
|
||||
#[cfg(not(any(target_arch = "powerpc", target_arch = "mips")))]
|
||||
pub use std::sync::atomic::AtomicU64;
|
||||
|
||||
#[cfg(any(target_arch = "powerpc", target_arch = "mips"))]
|
||||
pub use portable_atomic::AtomicU64;
|
||||
|
||||
pub use std::sync::Arc as Lrc;
|
||||
pub use std::sync::Weak as Weak;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ mod maybe_sync {
|
|||
lock: &'a Lock<T>,
|
||||
marker: PhantomData<&'a mut T>,
|
||||
|
||||
/// The syncronization mode of the lock. This is explicitly passed to let LLVM relate it
|
||||
/// The synchronization mode of the lock. This is explicitly passed to let LLVM relate it
|
||||
/// to the original lock operation.
|
||||
mode: Mode,
|
||||
}
|
||||
|
|
@ -142,7 +142,7 @@ mod maybe_sync {
|
|||
.then(|| LockGuard { lock: self, marker: PhantomData, mode })
|
||||
}
|
||||
|
||||
/// This acquires the lock assuming syncronization is in a specific mode.
|
||||
/// This acquires the lock assuming synchronization is in a specific mode.
|
||||
///
|
||||
/// Safety
|
||||
/// This method must only be called with `Mode::Sync` if `might_be_dyn_thread_safe` was
|
||||
|
|
|
|||
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#![allow(dead_code)]
|
||||
|
||||
use crate::sync::IntoDynSyncSend;
|
||||
use crate::FatalErrorMarker;
|
||||
use parking_lot::Mutex;
|
||||
use std::any::Any;
|
||||
use std::panic::{catch_unwind, resume_unwind, AssertUnwindSafe};
|
||||
|
|
@ -18,14 +20,17 @@ pub use enabled::*;
|
|||
/// continuing with unwinding. It's also used for the non-parallel code to ensure error message
|
||||
/// output match the parallel compiler for testing purposes.
|
||||
pub struct ParallelGuard {
|
||||
panic: Mutex<Option<Box<dyn Any + Send + 'static>>>,
|
||||
panic: Mutex<Option<IntoDynSyncSend<Box<dyn Any + Send + 'static>>>>,
|
||||
}
|
||||
|
||||
impl ParallelGuard {
|
||||
pub fn run<R>(&self, f: impl FnOnce() -> R) -> Option<R> {
|
||||
catch_unwind(AssertUnwindSafe(f))
|
||||
.map_err(|err| {
|
||||
*self.panic.lock() = Some(err);
|
||||
let mut panic = self.panic.lock();
|
||||
if panic.is_none() || !(*err).is::<FatalErrorMarker>() {
|
||||
*panic = Some(IntoDynSyncSend(err));
|
||||
}
|
||||
})
|
||||
.ok()
|
||||
}
|
||||
|
|
@ -37,7 +42,7 @@ impl ParallelGuard {
|
|||
pub fn parallel_guard<R>(f: impl FnOnce(&ParallelGuard) -> R) -> R {
|
||||
let guard = ParallelGuard { panic: Mutex::new(None) };
|
||||
let ret = f(&guard);
|
||||
if let Some(panic) = guard.panic.into_inner() {
|
||||
if let Some(IntoDynSyncSend(panic)) = guard.panic.into_inner() {
|
||||
resume_unwind(panic);
|
||||
}
|
||||
ret
|
||||
|
|
@ -77,12 +82,12 @@ mod disabled {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn try_par_for_each_in<T: IntoIterator, E: Copy>(
|
||||
pub fn try_par_for_each_in<T: IntoIterator, E>(
|
||||
t: T,
|
||||
mut for_each: impl FnMut(T::Item) -> Result<(), E>,
|
||||
) -> Result<(), E> {
|
||||
parallel_guard(|guard| {
|
||||
t.into_iter().fold(Ok(()), |ret, i| guard.run(|| for_each(i)).unwrap_or(ret).and(ret))
|
||||
t.into_iter().filter_map(|i| guard.run(|| for_each(i))).fold(Ok(()), Result::and)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -106,14 +111,20 @@ mod enabled {
|
|||
parallel!(impl $fblock [$block, $($c,)*] [$($rest),*])
|
||||
};
|
||||
(impl $fblock:block [$($blocks:expr,)*] []) => {
|
||||
::rustc_data_structures::sync::scope(|s| {
|
||||
$(let block = rustc_data_structures::sync::FromDyn::from(|| $blocks);
|
||||
s.spawn(move |_| block.into_inner()());)*
|
||||
(|| $fblock)();
|
||||
$crate::sync::parallel_guard(|guard| {
|
||||
$crate::sync::scope(|s| {
|
||||
$(
|
||||
let block = $crate::sync::FromDyn::from(|| $blocks);
|
||||
s.spawn(move |_| {
|
||||
guard.run(move || block.into_inner()());
|
||||
});
|
||||
)*
|
||||
guard.run(|| $fblock);
|
||||
});
|
||||
});
|
||||
};
|
||||
($fblock:block, $($blocks:block),*) => {
|
||||
if rustc_data_structures::sync::is_dyn_thread_safe() {
|
||||
if $crate::sync::is_dyn_thread_safe() {
|
||||
// Reverse the order of the later blocks since Rayon executes them in reverse order
|
||||
// when using a single thread. This ensures the execution order matches that
|
||||
// of a single threaded rustc.
|
||||
|
|
@ -146,11 +157,13 @@ mod enabled {
|
|||
if mode::is_dyn_thread_safe() {
|
||||
let oper_a = FromDyn::from(oper_a);
|
||||
let oper_b = FromDyn::from(oper_b);
|
||||
let (a, b) = rayon::join(
|
||||
move || FromDyn::from(oper_a.into_inner()()),
|
||||
move || FromDyn::from(oper_b.into_inner()()),
|
||||
);
|
||||
(a.into_inner(), b.into_inner())
|
||||
let (a, b) = parallel_guard(|guard| {
|
||||
rayon::join(
|
||||
move || guard.run(move || FromDyn::from(oper_a.into_inner()())),
|
||||
move || guard.run(move || FromDyn::from(oper_b.into_inner()())),
|
||||
)
|
||||
});
|
||||
(a.unwrap().into_inner(), b.unwrap().into_inner())
|
||||
} else {
|
||||
super::disabled::join(oper_a, oper_b)
|
||||
}
|
||||
|
|
@ -178,7 +191,7 @@ mod enabled {
|
|||
|
||||
pub fn try_par_for_each_in<
|
||||
T: IntoIterator + IntoParallelIterator<Item = <T as IntoIterator>::Item>,
|
||||
E: Copy + Send,
|
||||
E: Send,
|
||||
>(
|
||||
t: T,
|
||||
for_each: impl Fn(<T as IntoIterator>::Item) -> Result<(), E> + DynSync + DynSend,
|
||||
|
|
@ -187,11 +200,10 @@ mod enabled {
|
|||
if mode::is_dyn_thread_safe() {
|
||||
let for_each = FromDyn::from(for_each);
|
||||
t.into_par_iter()
|
||||
.fold_with(Ok(()), |ret, i| guard.run(|| for_each(i)).unwrap_or(ret).and(ret))
|
||||
.reduce(|| Ok(()), |a, b| a.and(b))
|
||||
.filter_map(|i| guard.run(|| for_each(i)))
|
||||
.reduce(|| Ok(()), Result::and)
|
||||
} else {
|
||||
t.into_iter()
|
||||
.fold(Ok(()), |ret, i| guard.run(|| for_each(i)).unwrap_or(ret).and(ret))
|
||||
t.into_iter().filter_map(|i| guard.run(|| for_each(i))).fold(Ok(()), Result::and)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue