[[package]]
name = "aho-corasick"
-version = "0.7.10"
+version = "0.7.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada"
+checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86"
dependencies = [
"memchr",
]
"markup5ever_rcdom",
"matches",
"tendril",
- "url 2.1.0",
+ "url 2.1.1",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
dependencies = [
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
dependencies = [
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
name = "anyhow"
-version = "1.0.31"
+version = "1.0.32"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "85bb70cc08ec97ca5450e6eba421deeea5f172c0fc61f78b5357b2a8e8be195f"
+checksum = "6b602bfe940d21c130f3895acd65221e8a61270debe89d628b9cb4e3ccb8569b"
[[package]]
name = "arc-swap"
-version = "0.3.7"
+version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1025aeae2b664ca0ea726a89d574fe8f4e77dd712d443236ad1de00379450cf6"
+checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034"
[[package]]
-name = "argon2rs"
-version = "0.2.5"
+name = "arrayref"
+version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f67b0b6a86dae6e67ff4ca2b6201396074996379fba2b92ff649126f37cb392"
-dependencies = [
- "blake2-rfc",
- "scoped_threadpool",
-]
-
-[[package]]
-name = "arrayvec"
-version = "0.4.7"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a1e964f9e24d588183fcb43503abda40d288c8657dfc27311516ce2f05675aef"
-dependencies = [
- "nodrop",
-]
+checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
[[package]]
name = "arrayvec"
dependencies = [
"hermit-abi",
"libc",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
"rustc-demangle",
]
+[[package]]
+name = "base64"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7"
+
[[package]]
name = "bitflags"
version = "1.2.1"
[[package]]
name = "bitmaps"
-version = "2.0.0"
+version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81e039a80914325b37fde728ef7693c212f0ac913d5599607d7b95a9484aae0b"
+checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2"
dependencies = [
"typenum",
]
[[package]]
-name = "blake2-rfc"
-version = "0.2.18"
+name = "blake2b_simd"
+version = "0.5.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5d6d530bdd2d52966a6d03b7a964add7ae1a288d25214066fd4b600f0f796400"
+checksum = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a"
dependencies = [
- "arrayvec 0.4.7",
+ "arrayref",
+ "arrayvec",
"constant_time_eq",
]
"serde_json",
"time",
"toml",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
name = "bstr"
-version = "0.1.3"
+version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "853b090ce0f45d0265902666bf88039ea3da825e33796716c511a1ec9c170036"
+checksum = "31accafdb70df7871592c058eca3985b71104e15ac32f64706022c58867da931"
dependencies = [
"memchr",
]
[[package]]
name = "byteorder"
-version = "1.3.2"
+version = "1.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a7c3dd8985a7111efc5c80b44e23ecdd8c007de8ade3b96595387e812b957cf5"
+checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
[[package]]
name = "bytes"
-version = "0.4.11"
+version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "40ade3d27603c2cb345eb0912aec461a6dec7e06a4ae48589904e808335c7afa"
+checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c"
dependencies = [
"byteorder",
"iovec",
[[package]]
name = "bytesize"
-version = "1.0.0"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "716960a18f978640f25101b5cbf1c6f6b0d3192fab36a2d98ca96f0ecbe41010"
+checksum = "81a18687293a1546b67c246452202bbbf143d239cb43494cc163da14979082da"
[[package]]
name = "cargo"
"git2",
"git2-curl",
"glob",
- "hex 0.4.0",
+ "hex 0.4.2",
"home",
- "humantime 2.0.0",
+ "humantime 2.0.1",
"ignore",
"im-rc",
"jobserver",
"libgit2-sys",
"log",
"memchr",
- "miow 0.3.3",
+ "miow 0.3.5",
"num_cpus",
"opener",
"openssl",
"toml",
"unicode-width",
"unicode-xid",
- "url 2.1.0",
+ "url 2.1.1",
"walkdir",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
"remove_dir_all",
"serde_json",
"tar",
- "url 2.1.0",
+ "url 2.1.1",
]
[[package]]
name = "cargo_metadata"
-version = "0.8.0"
+version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "929766d993a2fde7a0ae962ee82429069cd7b68839cd9375b98efd719df65d3a"
+checksum = "700b3731fd7d357223d0000f4dbf1808401b694609035c3c411fbc0cd375c426"
dependencies = [
- "failure",
"semver 0.9.0",
"serde",
"serde_derive",
[[package]]
name = "chrono"
-version = "0.4.6"
+version = "0.4.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878"
+checksum = "942f72db697d8767c22d46a598e01f2d3b475501ea43d0db4f16d90259182d0b"
dependencies = [
"num-integer",
"num-traits",
[[package]]
name = "clap"
-version = "2.33.0"
+version = "2.33.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9"
+checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002"
dependencies = [
"ansi_term 0.11.0",
"atty",
"regex-syntax",
"semver 0.9.0",
"serde",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"syn",
"toml",
"unicode-normalization",
- "url 2.1.0",
+ "url 2.1.1",
]
[[package]]
"bitflags",
]
+[[package]]
+name = "cloudabi"
+version = "0.1.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467"
+dependencies = [
+ "bitflags",
+]
+
[[package]]
name = "cmake"
-version = "0.1.42"
+version = "0.1.44"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "81fb25b677f8bf1eb325017cb6bb8452f87969db0fedb4f757b297bee78a7c62"
+checksum = "0e56268c17a6248366d66d4a47a3381369d068cce8409bb1716ed77ea32163bb"
dependencies = [
"cc",
]
dependencies = [
"atty",
"lazy_static",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
"glob",
"lazy_static",
"libc",
- "miow 0.3.3",
+ "miow 0.3.5",
"regex",
"rustfix",
"serde",
"serde_json",
"tracing",
"walkdir",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
"getopts",
"libc",
"log",
- "miow 0.3.3",
+ "miow 0.3.5",
"regex",
"rustfix",
"serde",
"serde_json",
"tempfile",
"tester",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
name = "constant_time_eq"
-version = "0.1.3"
+version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8ff012e225ce166d4422e0e78419d901719760f62ae2b7969ca6b564d1b54a9e"
+checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
[[package]]
name = "core"
"percent-encoding 2.1.0",
"serde",
"serde_json",
- "url 2.1.0",
+ "url 2.1.1",
]
[[package]]
[[package]]
name = "crossbeam-channel"
-version = "0.4.0"
+version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "acec9a3b0b3559f15aee4f90746c4e5e293b701c0f7d3925d24e01645267b68c"
+checksum = "09ee0cc8804d5393478d743b035099520087a5186f3b93fa58cec08fa62407b6"
dependencies = [
+ "cfg-if",
"crossbeam-utils 0.7.2",
]
[[package]]
name = "crossbeam-deque"
-version = "0.7.1"
+version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b18cd2e169ad86297e6bc0ad9aa679aee9daa4f19e8163860faf7c164e4f5a71"
+checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285"
dependencies = [
"crossbeam-epoch",
- "crossbeam-utils 0.6.5",
+ "crossbeam-utils 0.7.2",
+ "maybe-uninit",
]
[[package]]
name = "crossbeam-epoch"
-version = "0.7.2"
+version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fedcd6772e37f3da2a9af9bf12ebe046c0dfe657992377b4df982a2b54cd37a9"
+checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace"
dependencies = [
- "arrayvec 0.4.7",
+ "autocfg",
"cfg-if",
- "crossbeam-utils 0.6.5",
+ "crossbeam-utils 0.7.2",
"lazy_static",
+ "maybe-uninit",
"memoffset",
"scopeguard",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b"
dependencies = [
- "crossbeam-utils 0.6.5",
+ "crossbeam-utils 0.6.6",
+]
+
+[[package]]
+name = "crossbeam-queue"
+version = "0.2.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570"
+dependencies = [
+ "cfg-if",
+ "crossbeam-utils 0.7.2",
+ "maybe-uninit",
]
[[package]]
name = "crossbeam-utils"
-version = "0.6.5"
+version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f8306fcef4a7b563b76b7dd949ca48f52bc1141aa067d2ea09565f3e2652aa5c"
+checksum = "04973fa96e96579258a5091af6003abde64af786b860f18622b82e026cca60e6"
dependencies = [
"cfg-if",
"lazy_static",
[[package]]
name = "crypto-hash"
-version = "0.3.1"
+version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "09de9ee0fc255ace04c7fa0763c9395a945c37c8292bb554f8d48361d1dcf1b4"
+checksum = "8a77162240fd97248d19a564a565eb563a3f592b386e4136fb300909e67dddca"
dependencies = [
"commoncrypto",
"hex 0.3.2",
"openssl",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
name = "ctor"
-version = "0.1.13"
+version = "0.1.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "47c5e5ac752e18207b12e16b10631ae5f7f68f8805f335f9b817ead83d9ffce1"
+checksum = "39858aa5bac06462d4dd4b9164848eb81ffc4aa5c479746393598fd193afa227"
dependencies = [
"quote",
"syn",
[[package]]
name = "curl"
-version = "0.4.25"
+version = "0.4.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "06aa71e9208a54def20792d877bc663d6aae0732b9852e612c4a933177c31283"
+checksum = "9447ad28eee2a5cfb031c329d46bef77487244fff6a724b378885b8691a35f78"
dependencies = [
"curl-sys",
"libc",
"openssl-sys",
"schannel",
"socket2",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
name = "curl-sys"
-version = "0.4.25"
+version = "0.4.34+curl-7.71.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0c38ca47d60b86d0cc9d42caa90a0885669c2abc9791f871c81f58cdf39e979b"
+checksum = "ad4eff0be6985b7e709f64b5a541f700e9ad1407190a29f4884319eb663ed1d6"
dependencies = [
"cc",
"libc",
"openssl-sys",
"pkg-config",
"vcpkg",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
[[package]]
name = "derive_more"
-version = "0.99.2"
+version = "0.99.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2159be042979966de68315bce7034bb000c775f22e3e834e1c52ff78f041cae8"
+checksum = "298998b1cf6b5b2c8a7b023dfd45821825ce3ba8a8af55c921a0e734e4653f76"
dependencies = [
"proc-macro2",
"quote",
[[package]]
name = "diff"
-version = "0.1.11"
+version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c2b69f912779fbb121ceb775d74d51e915af17aaebc38d28a592843a2dd0a3a"
+checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499"
[[package]]
name = "difference"
[[package]]
name = "directories"
-version = "2.0.1"
+version = "2.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ccc83e029c3cebb4c8155c644d34e3a070ccdb4ff90d369c74cd73f7cb3c984"
+checksum = "551a778172a450d7fc12e629ca3b0428d00f6afa9a43da1b630d54604e97371c"
dependencies = [
"cfg-if",
"dirs-sys",
[[package]]
name = "dirs"
-version = "2.0.1"
+version = "2.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1c4ef5a8b902d393339e2a2c7fe573af92ce7e0ee5a3ff827b4c9ad7e07e4fa1"
+checksum = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3"
dependencies = [
"cfg-if",
"dirs-sys",
[[package]]
name = "dirs-sys"
-version = "0.3.3"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "937756392ec77d1f2dd9dc3ac9d69867d109a2121479d72c364e42f4cab21e2d"
+checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a"
dependencies = [
- "cfg-if",
"libc",
"redox_users",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
[[package]]
name = "either"
-version = "1.5.0"
+version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0"
+checksum = "cd56b59865bce947ac5958779cfa508f6c3b9497cc762b7e24a12d11ccde2c4f"
[[package]]
name = "elasticlunr-rs"
version = "0.1.0"
dependencies = [
"yaml-merge-keys",
- "yaml-rust 0.4.3",
+ "yaml-rust 0.4.4",
]
[[package]]
name = "failure"
-version = "0.1.5"
+version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2"
+checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86"
dependencies = [
"backtrace",
"failure_derive",
[[package]]
name = "filetime"
-version = "0.2.9"
+version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f59efc38004c988e4201d11d263b8171f49a2e7ec0bdbb71773433f271504a5e"
+checksum = "3ed85775dcc68644b5c950ac06a2b23768d3bc9390464151aaf27136998dcf9e"
dependencies = [
"cfg-if",
"libc",
"redox_syscall",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
[[package]]
name = "fnv"
-version = "1.0.6"
+version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
+checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
[[package]]
name = "foreign-types"
[[package]]
name = "fortanix-sgx-abi"
-version = "0.3.2"
+version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f8cbee5e872cf7db61a999a041f9bc4706ca7bf7df4cb914f53fabb1c1bc550"
+checksum = "c56c422ef86062869b2d57ae87270608dc5929969dd130a6e248979cf4fb6ca6"
dependencies = [
"compiler_builtins",
"rustc-std-workspace-core",
[[package]]
name = "fst"
-version = "0.3.0"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d94485a00b1827b861dd9d1a2cc9764f9044d4c535514c0760a5a2012ef3399f"
+checksum = "927fb434ff9f0115b215dc0efd2e4fbdd7448522a92a1aa37c77d6a2f8f1ebd6"
dependencies = [
"byteorder",
]
-[[package]]
-name = "fuchsia-cprng"
-version = "0.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
-
[[package]]
name = "fuchsia-zircon"
version = "0.3.3"
[[package]]
name = "futures"
-version = "0.1.28"
+version = "0.1.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "45dc39533a6cae6da2b56da48edae506bb767ec07370f86f70fc062e9d435869"
+checksum = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef"
[[package]]
name = "fwdansi"
[[package]]
name = "git2"
-version = "0.13.5"
+version = "0.13.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e1e02a51cd90229028c9bd8be0a0364f85b6b3199cccaa0ef39005ddbd5ac165"
+checksum = "e6ac22e49b7d886b6802c66662b12609452248b1bc9e87d6d83ecea3db96f557"
dependencies = [
"bitflags",
"libc",
"log",
"openssl-probe",
"openssl-sys",
- "url 2.1.0",
+ "url 2.1.1",
]
[[package]]
"curl",
"git2",
"log",
- "url 2.1.0",
+ "url 2.1.1",
]
[[package]]
[[package]]
name = "globset"
-version = "0.4.3"
+version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef4feaabe24a0a658fd9cf4a9acf6ed284f045c77df0f49020ba3245cfb7b454"
+checksum = "7ad1da430bd7281dde2576f44c84cc3f0f7b475e7202cd503042dff01a8c8120"
dependencies = [
"aho-corasick",
"bstr",
[[package]]
name = "handlebars"
-version = "3.0.1"
+version = "3.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ba758d094d31274eb49d15da6f326b96bf3185239a6359bf684f3d5321148900"
+checksum = "5deefd4816fb852b1ff3cb48f6c41da67be2d0e1d20b26a7a3b076da11f064b1"
dependencies = [
"log",
"pest",
"pest_derive",
- "quick-error",
+ "quick-error 2.0.0",
"serde",
"serde_json",
]
[[package]]
name = "heck"
-version = "0.3.0"
+version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ea04fa3ead4e05e51a7c806fc07271fdbde4e246a6c6d1efd52e72230b771b82"
+checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205"
dependencies = [
"unicode-segmentation",
]
[[package]]
name = "hex"
-version = "0.4.0"
+version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "023b39be39e3a2da62a94feb433e91e8bcd37676fbc8bea371daf52b7a769a3e"
+checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35"
[[package]]
name = "home"
-version = "0.5.1"
+version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a3753954f7bd71f0e671afb8b5a992d1724cf43b7f95a563cd4a0bde94659ca8"
+checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654"
dependencies = [
- "scopeguard",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f"
dependencies = [
- "quick-error",
+ "quick-error 1.2.3",
]
[[package]]
name = "humantime"
-version = "2.0.0"
+version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b9b6c53306532d3c8e8087b44e6580e10db51a023cf9b433cea2ac38066b92da"
+checksum = "3c1ad908cc71012b7bea4d0c53ba96a8cba9962f048fa68d143376143d863b7a"
[[package]]
name = "idna"
[[package]]
name = "ignore"
-version = "0.4.11"
+version = "0.4.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "522daefc3b69036f80c7d2990b28ff9e0471c683bad05ca258e0a01dd22c5a1e"
+checksum = "22dcbf2a4a289528dbef21686354904e1c694ac642610a9bff9e7df730d9ec72"
dependencies = [
- "crossbeam-channel",
+ "crossbeam-utils 0.7.2",
"globset",
"lazy_static",
"log",
checksum = "3ca8957e71f04a205cb162508f9326aea04676c8dfd0711220190d6b83664f3f"
dependencies = [
"bitmaps",
- "rand_core 0.5.1",
+ "rand_core",
"rand_xoshiro",
"sized-chunks",
"typenum",
"remove_dir_all",
"tar",
"walkdir",
- "winapi 0.3.8",
+ "winapi 0.3.9",
"xz2",
]
+[[package]]
+name = "instant"
+version = "0.1.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5b141fdc7836c525d4d594027d318c84161ca17aaf8113ab1f81ab93ae897485"
+
[[package]]
name = "iovec"
version = "0.1.4"
[[package]]
name = "itertools"
-version = "0.8.0"
+version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b8467d9c1cebe26feb08c640139247fac215782d35371ade9a2136ed6085358"
+checksum = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484"
dependencies = [
"either",
]
[[package]]
name = "itoa"
-version = "0.4.4"
+version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "501266b7edd0174f8530248f87f99c88fbe60ca4ef3dd486835b8d8d53136f7f"
+checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6"
[[package]]
name = "jemalloc-sys"
-version = "0.3.0"
+version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7bef0d4ce37578dfd80b466e3d8324bd9de788e249f1accebb0c472ea4b52bdc"
+checksum = "0d3b9f3f5c9b31aa0f5ed3260385ac205db665baa41d49bb8338008ae94ede45"
dependencies = [
"cc",
"fs_extra",
[[package]]
name = "json"
-version = "0.11.13"
+version = "0.11.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9ad0485404155f45cce53a40d4b2d6ac356418300daed05273d9e26f91c390be"
+checksum = "92c245af8786f6ac35f95ca14feca9119e71339aaab41e878e7cdd655c97e9e5"
[[package]]
name = "jsonrpc-client-transports"
-version = "14.0.5"
+version = "14.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0a9ae166c4d1f702d297cd76d4b55758ace80272ffc6dbb139fdc1bf810de40b"
+checksum = "2773fa94a2a1fd51efb89a8f45b8861023dbb415d18d3c9235ae9388d780f9ec"
dependencies = [
"failure",
"futures",
[[package]]
name = "jsonrpc-core"
-version = "14.0.5"
+version = "14.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fe3b688648f1ef5d5072229e2d672ecb92cbff7d1c79bcf3fd5898f3f3df0970"
+checksum = "a0747307121ffb9703afd93afbd0fb4f854c38fb873f2c8b90e0e902f27c7b62"
dependencies = [
"futures",
"log",
[[package]]
name = "jsonrpc-core-client"
-version = "14.0.5"
+version = "14.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "080dc110be17701097df238fad3c816d4a478a1899dfbcf8ec8957dd40ec7304"
+checksum = "34221123bc79b66279a3fde2d3363553835b43092d629b34f2e760c44dc94713"
dependencies = [
"jsonrpc-client-transports",
]
[[package]]
name = "jsonrpc-derive"
-version = "14.0.5"
+version = "14.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8609af8f63b626e8e211f52441fcdb6ec54f1a446606b10d5c89ae9bf8a20058"
+checksum = "0fadf6945e227246825a583514534d864554e9f23d80b3c77d034b10983db5ef"
dependencies = [
"proc-macro-crate",
"proc-macro2",
[[package]]
name = "jsonrpc-pubsub"
-version = "14.0.6"
+version = "14.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b31c9b90731276fdd24d896f31bb10aecf2e5151733364ae81123186643d939"
+checksum = "2d44f5602a11d657946aac09357956d2841299ed422035edf140c552cb057986"
dependencies = [
"jsonrpc-core",
"log",
"parking_lot 0.10.2",
+ "rand",
"serde",
]
[[package]]
name = "jsonrpc-server-utils"
-version = "14.0.5"
+version = "14.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "95b7635e618a0edbbe0d2a2bbbc69874277c49383fcf6c3c0414491cfb517d22"
+checksum = "56cbfb462e7f902e21121d9f0d1c2b77b2c5b642e1a4e8f4ebfa2e15b94402bb"
dependencies = [
"bytes",
"globset",
[[package]]
name = "lazycell"
-version = "1.2.1"
+version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"
+checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
[[package]]
name = "libc"
[[package]]
name = "libgit2-sys"
-version = "0.12.7+1.0.0"
+version = "0.12.9+1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcd07968649bcb7b9351ecfde53ca4d27673cccfdf57c84255ec18710f3153e0"
+checksum = "9b33bf3d9d4c45b48ae1ea7c334be69994624dc0a69f833d5d9f7605f24b552b"
dependencies = [
"cc",
"libc",
[[package]]
name = "libnghttp2-sys"
-version = "0.1.2"
+version = "0.1.4+1.41.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "02254d44f4435dd79e695f2c2b83cd06a47919adea30216ceaf0c57ca0a72463"
+checksum = "03624ec6df166e79e139a2310ca213283d6b3c30810c54844f307086d4488df1"
dependencies = [
"cc",
"libc",
[[package]]
name = "libssh2-sys"
-version = "0.2.14"
+version = "0.2.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "36aa6e813339d3a063292b77091dfbbb6152ff9006a459895fa5bebed7d34f10"
+checksum = "eafa907407504b0e683786d4aba47acf250f114d37357d56608333fd167dd0fc"
dependencies = [
"cc",
"libc",
[[package]]
name = "libz-sys"
-version = "1.0.25"
+version = "1.0.27"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe"
+checksum = "6ca8894883d250240341478bf987467332fbdd5da5c42426c69a8f93dbc302f2"
dependencies = [
"cc",
"libc",
[[package]]
name = "linked-hash-map"
-version = "0.5.2"
+version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83"
+checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a"
[[package]]
name = "lock_api"
"scopeguard",
]
+[[package]]
+name = "lock_api"
+version = "0.4.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "28247cc5a5be2f05fbcd76dd0cf2c7d3b5400cb978a28042abcd4fa0b3f8261c"
+dependencies = [
+ "scopeguard",
+]
+
[[package]]
name = "log"
-version = "0.4.8"
+version = "0.4.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7"
+checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b"
dependencies = [
"cfg-if",
]
"serde",
"serde_json",
"serde_repr",
- "url 2.1.0",
+ "url 2.1.1",
]
[[package]]
name = "lzma-sys"
-version = "0.1.14"
+version = "0.1.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "16b5c59c57cc4d39e7999f50431aa312ea78af7c93b23fbb0c3567bd672e7f35"
+checksum = "f24f76ec44a8ac23a31915d6e326bca17ce88da03096f1ff194925dc714dac99"
dependencies = [
"cc",
"libc",
[[package]]
name = "macro-utils"
-version = "0.1.2"
+version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f2c4deaccc2ead6a28c16c0ba82f07d52b6475397415ce40876e559b0b0ea510"
+checksum = "0e72f7deb758fea9ea7d290aebfa788763d0bffae12caa6406a25baaf8fa68a8"
[[package]]
name = "maplit"
-version = "1.0.1"
+version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43"
+checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
[[package]]
name = "markup5ever"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
+[[package]]
+name = "maybe-uninit"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00"
+
[[package]]
name = "md-5"
version = "0.8.0"
[[package]]
name = "mdbook"
-version = "0.4.0"
+version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2567ffadc0fd26fe15d6f6e0a80639f19f6a50082fdb460d0ae5d1f7298181be"
+checksum = "b75e31ae4eaa0e45e17ee2b6b9e3ed969c3c6ff12bb4c2e352c42493f4ebb706"
dependencies = [
"ammonia",
"anyhow",
checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b"
dependencies = [
"libc",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
name = "memoffset"
-version = "0.5.1"
+version = "0.5.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ce6075db033bbbb7ee5a0bbd3a3186bbae616f57fb001c485c7ff77955f8177f"
+checksum = "c198b026e1bbf08a937e94c6c60f9ec4a2267f5b0d2eec9c1b21b061ce2be55f"
dependencies = [
- "rustc_version",
+ "autocfg",
]
[[package]]
[[package]]
name = "mio"
-version = "0.6.16"
+version = "0.6.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71646331f2619b1026cc302f87a2b8b648d5c6dd6937846a16cc8ce0f347f432"
+checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430"
dependencies = [
+ "cfg-if",
"fuchsia-zircon",
"fuchsia-zircon-sys",
"iovec",
"kernel32-sys",
- "lazycell",
"libc",
"log",
"miow 0.2.1",
[[package]]
name = "mio-named-pipes"
-version = "0.1.6"
+version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f5e374eff525ce1c5b7687c4cef63943e7686524a387933ad27ca7ec43779cb3"
+checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656"
dependencies = [
"log",
"mio",
- "miow 0.3.3",
- "winapi 0.3.8",
+ "miow 0.3.5",
+ "winapi 0.3.9",
]
[[package]]
name = "mio-uds"
-version = "0.6.7"
+version = "0.6.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125"
+checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0"
dependencies = [
"iovec",
"libc",
[[package]]
name = "miow"
-version = "0.3.3"
+version = "0.3.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "396aa0f2003d7df8395cb93e09871561ccc3e785f0acb369170e8cc74ddf9226"
+checksum = "07b88fb9795d4d36d62a012dfbf49a8f5cf12751f36d31a9dbe66d528e58979e"
dependencies = [
"socket2",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
"compiletest_rs",
"env_logger 0.7.1",
"getrandom",
- "hex 0.4.0",
+ "hex 0.4.2",
"libc",
"log",
"rand",
[[package]]
name = "net2"
-version = "0.2.33"
+version = "0.2.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88"
+checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7"
dependencies = [
"cfg-if",
"libc",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
name = "new_debug_unreachable"
-version = "1.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f40f005c60db6e03bae699e414c58bf9aa7ea02a2d0b9bfbcf19286cc4c82b30"
-
-[[package]]
-name = "nodrop"
-version = "0.1.12"
+version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2"
+checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54"
[[package]]
name = "num-integer"
-version = "0.1.39"
+version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea"
+checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b"
dependencies = [
+ "autocfg",
"num-traits",
]
[[package]]
name = "num-traits"
-version = "0.2.6"
+version = "0.2.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0b3a5d7cc97d6d30d8b9bc8fa19bf45349ffe46241e8816f50f62f6d6aaabee1"
+checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611"
+dependencies = [
+ "autocfg",
+]
[[package]]
name = "num_cpus"
-version = "1.10.1"
+version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bcef43580c035376c0705c42792c294b66974abbfd2789b511784023f71f3273"
+checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
dependencies = [
+ "hermit-abi",
"libc",
]
[[package]]
name = "once_cell"
-version = "1.1.0"
+version = "1.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d6a04cb71e910d0034815600180f62a95bf6e67942d7ab52a166a68c7d7e9cd0"
+checksum = "260e51e7efe62b592207e9e13a68e43692a7a279171d6ba57abd208bf23645ad"
dependencies = [
- "parking_lot 0.9.0",
+ "parking_lot 0.11.0",
]
[[package]]
[[package]]
name = "open"
-version = "1.2.1"
+version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c281318d992e4432cfa799969467003d05921582a7489a8325e37f8a450d5113"
+checksum = "7c283bf0114efea9e42f1a60edea9859e8c47528eae09d01df4b29c1e489cc48"
+dependencies = [
+ "winapi 0.3.9",
+]
[[package]]
name = "opener"
-version = "0.4.0"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "998c59e83d9474c01127a96e023b7a04bb061dd286bf8bb939d31dc8d31a7448"
+checksum = "13117407ca9d0caf3a0e74f97b490a7e64c0ae3aa90a8b7085544d0c37b6f3ae"
dependencies = [
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
name = "openssl"
-version = "0.10.25"
+version = "0.10.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f372b2b53ce10fb823a337aaa674e3a7d072b957c6264d0f4ff0bd86e657449"
+checksum = "8d575eff3665419f9b83678ff2815858ad9d11567e082f5ac1814baba4e2bcb4"
dependencies = [
"bitflags",
"cfg-if",
[[package]]
name = "openssl-src"
-version = "111.9.0+1.1.1g"
+version = "111.10.2+1.1.1g"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a2dbe10ddd1eb335aba3780eb2eaa13e1b7b441d2562fd962398740927f39ec4"
+checksum = "a287fdb22e32b5b60624d4a5a7a02dbe82777f730ec0dbc42a0554326fef5a70"
dependencies = [
"cc",
]
[[package]]
name = "openssl-sys"
-version = "0.9.54"
+version = "0.9.58"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1024c0a59774200a555087a6da3f253a9095a5f344e353b212ac4c8b8e450986"
+checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de"
dependencies = [
"autocfg",
"cc",
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "53cdc5b785b7a58c5aad8216b3dfa114df64b0b06ae6e1501cef91df2fbdf8f9"
dependencies = [
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
name = "packed_simd"
-version = "0.3.1"
+version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "25d36de864f7218ec5633572a800109bbe5a1cc8d9d95a967f3daf93ea7e6ddc"
+checksum = "a85ea9fc0d4ac0deb6fe7911d38786b32fc11119afd9e9d38b84ff691ce64220"
dependencies = [
"cfg-if",
]
"futures",
"log",
"mio-named-pipes",
- "miow 0.3.3",
+ "miow 0.3.5",
"rand",
"tokio",
"tokio-named-pipes",
"tokio-uds",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252"
dependencies = [
- "lock_api",
+ "lock_api 0.3.4",
"parking_lot_core 0.6.2",
"rustc_version",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e"
dependencies = [
- "lock_api",
- "parking_lot_core 0.7.1",
+ "lock_api 0.3.4",
+ "parking_lot_core 0.7.2",
+]
+
+[[package]]
+name = "parking_lot"
+version = "0.11.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733"
+dependencies = [
+ "instant",
+ "lock_api 0.4.1",
+ "parking_lot_core 0.8.0",
]
[[package]]
checksum = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b"
dependencies = [
"cfg-if",
- "cloudabi",
+ "cloudabi 0.0.3",
"libc",
"redox_syscall",
"rustc_version",
- "smallvec 0.6.10",
- "winapi 0.3.8",
+ "smallvec 0.6.13",
+ "winapi 0.3.9",
]
[[package]]
name = "parking_lot_core"
-version = "0.7.1"
+version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0e136c1904604defe99ce5fd71a28d473fa60a12255d511aa78a9ddf11237aeb"
+checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3"
dependencies = [
"cfg-if",
- "cloudabi",
+ "cloudabi 0.0.3",
"libc",
"redox_syscall",
- "smallvec 1.4.0",
- "winapi 0.3.8",
+ "smallvec 1.4.2",
+ "winapi 0.3.9",
+]
+
+[[package]]
+name = "parking_lot_core"
+version = "0.8.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b"
+dependencies = [
+ "cfg-if",
+ "cloudabi 0.1.0",
+ "instant",
+ "libc",
+ "redox_syscall",
+ "smallvec 1.4.2",
+ "winapi 0.3.9",
]
[[package]]
[[package]]
name = "pest"
-version = "2.1.0"
+version = "2.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "54f0c72a98d8ab3c99560bfd16df8059cc10e1f9a8e83e6e3b97718dd766e9c3"
+checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53"
dependencies = [
"ucd-trie",
]
[[package]]
name = "pkg-config"
-version = "0.3.17"
+version = "0.3.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677"
+checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33"
[[package]]
name = "polonius-engine"
[[package]]
name = "proc-macro-crate"
-version = "0.1.4"
+version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e10d4b51f154c8a7fb96fd6dad097cb74b863943ec010ac94b9fd1be8861fe1e"
+checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785"
dependencies = [
"toml",
]
[[package]]
name = "proc-macro-error"
-version = "0.2.6"
+version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aeccfe4d5d8ea175d5f0e4a2ad0637e0f4121d63bd99d356fb1f39ab2e7c6097"
+checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
dependencies = [
+ "proc-macro-error-attr",
"proc-macro2",
"quote",
"syn",
+ "version_check",
+]
+
+[[package]]
+name = "proc-macro-error-attr"
+version = "1.0.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "version_check",
]
[[package]]
name = "proc-macro2"
-version = "1.0.3"
+version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e98a83a9f9b331f54b924e68a66acb1bb35cb01fb0a23645139967abefb697e8"
+checksum = "04f5f085b5d71e2188cb8271e5da0161ad52c3f227a661a3c135fdf28e258b12"
dependencies = [
"unicode-xid",
]
[[package]]
name = "psm"
-version = "0.1.10"
+version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "092d385624a084892d07374caa7b0994956692cf40650419a1f1a787a8d229cf"
+checksum = "96e0536f6528466dbbbbe6b986c34175a8d0ff25b794c4bacda22e068cd2f2c5"
dependencies = [
"cc",
]
[[package]]
name = "pulldown-cmark"
-version = "0.7.1"
+version = "0.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3e142c3b8f49d2200605ee6ba0b1d757310e9e7a72afe78c36ee2ef67300ee00"
+checksum = "ca36dea94d187597e104a5c8e4b07576a8a45aa5db48a65e12940d3eb7461f55"
dependencies = [
"bitflags",
"getopts",
[[package]]
name = "punycode"
-version = "0.4.0"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6ddd112cca70a4d30883b2d21568a1d376ff8be4758649f64f973c6845128ad3"
+checksum = "e9e1dcb320d6839f6edb64f7a4a59d39b30480d4d1765b56873f7c858538a5fe"
[[package]]
name = "quick-error"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
+[[package]]
+name = "quick-error"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "3ac73b1112776fc109b2e61909bc46c7e1bf0d7f690ffb1676553acce16d5cda"
+
[[package]]
name = "quine-mc_cluskey"
version = "0.2.4"
[[package]]
name = "quote"
-version = "1.0.2"
+version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe"
+checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37"
dependencies = [
"proc-macro2",
]
"clap",
"derive_more",
"env_logger 0.7.1",
- "humantime 2.0.0",
+ "humantime 2.0.1",
"lazy_static",
"log",
"rls-span",
"getrandom",
"libc",
"rand_chacha",
- "rand_core 0.5.1",
+ "rand_core",
"rand_hc",
"rand_pcg",
]
checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402"
dependencies = [
"ppv-lite86",
- "rand_core 0.5.1",
+ "rand_core",
]
-[[package]]
-name = "rand_core"
-version = "0.3.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0905b6b7079ec73b314d4c748701f6931eb79fd97c668caa3f1899b22b32c6db"
-
-[[package]]
-name = "rand_core"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0"
-
[[package]]
name = "rand_core"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c"
dependencies = [
- "rand_core 0.5.1",
-]
-
-[[package]]
-name = "rand_os"
-version = "0.1.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071"
-dependencies = [
- "cloudabi",
- "fuchsia-cprng",
- "libc",
- "rand_core 0.4.0",
- "rdrand",
- "winapi 0.3.8",
+ "rand_core",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16abd0c1b639e9eb4d7c50c0b8100b0d0f849be2349829c740fe8e6eb4816429"
dependencies = [
- "rand_core 0.5.1",
+ "rand_core",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77d416b86801d23dde1aa643023b775c3a462efc0ed96443add11546cdf1dca8"
dependencies = [
- "rand_core 0.5.1",
+ "rand_core",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9fcdd2e881d02f1d9390ae47ad8e5696a9e4be7b547a1da2afbc61973217004"
dependencies = [
- "rand_core 0.5.1",
+ "rand_core",
]
[[package]]
name = "rayon"
-version = "1.2.0"
+version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "83a27732a533a1be0a0035a111fe76db89ad312f6f0347004c220c57f209a123"
+checksum = "62f02856753d04e03e26929f820d0a0a337ebe71f849801eea335d464b349080"
dependencies = [
+ "autocfg",
"crossbeam-deque",
"either",
"rayon-core",
[[package]]
name = "rayon-core"
-version = "1.6.0"
+version = "1.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "98dcf634205083b17d0861252431eb2acbfb698ab7478a2d20de07954f47ec7b"
+checksum = "e92e15d89083484e11353891f1af602cc661426deb9564c298b270c726973280"
dependencies = [
"crossbeam-deque",
- "crossbeam-queue",
- "crossbeam-utils 0.6.5",
+ "crossbeam-queue 0.2.3",
+ "crossbeam-utils 0.7.2",
"lazy_static",
"num_cpus",
]
-[[package]]
-name = "rdrand"
-version = "0.4.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
-dependencies = [
- "rand_core 0.3.0",
-]
-
[[package]]
name = "redox_syscall"
-version = "0.1.56"
+version = "0.1.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84"
+checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce"
[[package]]
name = "redox_users"
-version = "0.3.0"
+version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3fe5204c3a17e97dde73f285d49be585df59ed84b50a872baf416e73b62c3828"
+checksum = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431"
dependencies = [
- "argon2rs",
- "failure",
- "rand_os",
+ "getrandom",
"redox_syscall",
+ "rust-argon2",
]
[[package]]
name = "regex"
-version = "1.3.7"
+version = "1.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a6020f034922e3194c711b82a627453881bc4682166cabb07134a10c26ba7692"
+checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6"
dependencies = [
"aho-corasick",
"memchr",
[[package]]
name = "regex-syntax"
-version = "0.6.17"
+version = "0.6.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae"
+checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8"
[[package]]
name = "remote-test-client"
[[package]]
name = "remove_dir_all"
-version = "0.5.2"
+version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e"
+checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
dependencies = [
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
dependencies = [
"anyhow",
"cargo",
- "cargo_metadata 0.8.0",
+ "cargo_metadata 0.8.2",
"clippy_lints",
"crossbeam-channel",
"difference",
"futures",
"heck",
"home",
- "itertools 0.8.0",
+ "itertools 0.8.2",
"jsonrpc-core",
"lazy_static",
"log",
"tokio-process",
"tokio-timer",
"toml",
- "url 2.1.0",
+ "url 2.1.1",
"walkdir",
]
dependencies = [
"derive-new",
"fst",
- "itertools 0.8.0",
+ "itertools 0.8.2",
"json",
"log",
"rls-data",
"rls-span",
]
+[[package]]
+name = "rust-argon2"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017"
+dependencies = [
+ "base64",
+ "blake2b_simd",
+ "constant_time_eq",
+ "crossbeam-utils 0.7.2",
+]
+
[[package]]
name = "rust-demangler"
version = "0.0.0"
checksum = "4a3941333c39ffa778611a34692244052fc9ba0f6b02dcf019c8d24925707dd6"
dependencies = [
"rustc-ap-rustc_data_structures",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
]
[[package]]
"rustc-ap-rustc_serialize",
"rustc-ap-rustc_span",
"scoped-tls",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f9914fadee461568d19ca2ebaec8699ff898f8ffec9928154659a57ee018e5fd"
dependencies = [
- "itertools 0.8.0",
+ "itertools 0.8.2",
"log",
"rustc-ap-rustc_ast",
"rustc-ap-rustc_ast_pretty",
"rustc-hash",
"rustc-rayon",
"rustc-rayon-core",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"stable_deref_trait",
"stacker",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
"termcolor",
"termize",
"unicode-width",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
"rustc-ap-rustc_serialize",
"rustc-ap-rustc_session",
"rustc-ap-rustc_span",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "335bfb187a2489a59ee8c67fcf5d1760e9dcdbe0f02025c199a74caa05096b15"
dependencies = [
- "arrayvec 0.5.1",
+ "arrayvec",
"rustc-ap-rustc_serialize",
]
checksum = "0e8c0b704e3dedb97cbb1ac566bbc0ab397ec4a4743098326a8f2230463fd9f9"
dependencies = [
"indexmap",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
]
[[package]]
checksum = "ea2427831f0053ea3ea73559c8eabd893133a51b251d142bacee53c62a288cb3"
dependencies = [
"crossbeam-deque",
- "crossbeam-queue",
- "crossbeam-utils 0.6.5",
+ "crossbeam-queue 0.1.2",
+ "crossbeam-utils 0.6.6",
"lazy_static",
"num_cpus",
]
"quote",
"serde",
"serde_json",
- "smallvec 0.6.10",
- "smallvec 1.4.0",
+ "smallvec 0.6.13",
+ "smallvec 1.4.2",
"syn",
- "url 2.1.0",
- "winapi 0.3.8",
+ "url 2.1.1",
+ "winapi 0.3.9",
]
[[package]]
version = "0.0.0"
dependencies = [
"bitflags",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
]
[[package]]
version = "0.0.0"
dependencies = [
"rustc_data_structures",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
]
[[package]]
"rustc_macros",
"rustc_serialize",
"rustc_span",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"tracing",
]
"rustc_session",
"rustc_span",
"rustc_target",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"tracing",
]
name = "rustc_ast_passes"
version = "0.0.0"
dependencies = [
- "itertools 0.8.0",
+ "itertools 0.8.2",
"rustc_ast",
"rustc_ast_pretty",
"rustc_attr",
"rustc_session",
"rustc_span",
"rustc_target",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"tracing",
]
"rustc_session",
"rustc_span",
"rustc_target",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"tracing",
]
"rustc_index",
"rustc_macros",
"rustc_serialize",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"stable_deref_trait",
"stacker",
"tempfile",
"tracing",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
"rustc_target",
"tracing",
"tracing-subscriber",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
"termize",
"tracing",
"unicode-width",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
"rustc_serialize",
"rustc_session",
"rustc_span",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"tracing",
]
"rustc_serialize",
"rustc_span",
"rustc_target",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"tracing",
]
name = "rustc_index"
version = "0.0.0"
dependencies = [
- "arrayvec 0.5.1",
+ "arrayvec",
"rustc_macros",
"rustc_serialize",
]
"rustc_session",
"rustc_span",
"rustc_target",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"tracing",
]
"rustc_traits",
"rustc_ty",
"rustc_typeck",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"tempfile",
"tracing",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
"rustc_session",
"rustc_span",
"rustc_target",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"stable_deref_trait",
"tracing",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
"rustc_session",
"rustc_span",
"rustc_target",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"tracing",
]
version = "0.0.0"
dependencies = [
"either",
- "itertools 0.8.0",
+ "itertools 0.8.2",
"log_settings",
"polonius-engine",
"rustc_apfloat",
"rustc_span",
"rustc_target",
"rustc_trait_selection",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"tracing",
]
"rustc_span",
"rustc_target",
"rustc_trait_selection",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"tracing",
]
"rustc_lexer",
"rustc_session",
"rustc_span",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"tracing",
"unicode-normalization",
]
"rustc_macros",
"rustc_serialize",
"rustc_span",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"tracing",
]
"rustc_middle",
"rustc_session",
"rustc_span",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"tracing",
]
dependencies = [
"indexmap",
"rustc_macros",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
]
[[package]]
"rustc_session",
"rustc_span",
"rustc_target",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"tracing",
]
"rustc_middle",
"rustc_span",
"rustc_trait_selection",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"tracing",
]
"rustc_span",
"rustc_target",
"rustc_trait_selection",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
"tracing",
]
name = "rustdoc"
version = "0.0.0"
dependencies = [
- "itertools 0.8.0",
+ "itertools 0.8.2",
"minifier",
"pulldown-cmark",
"rustc-rayon",
[[package]]
name = "rustfix"
-version = "0.5.0"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "804b11883a5ce0ad0378fbf95a8dea59ee6b51c331a73b8f471b6bdaa3bd40c1"
+checksum = "f2c50b74badcddeb8f7652fa8323ce440b95286f8e4b64ebfd871c609672704e"
dependencies = [
"anyhow",
"log",
"annotate-snippets 0.6.1",
"anyhow",
"bytecount",
- "cargo_metadata 0.8.0",
+ "cargo_metadata 0.8.2",
"derive-new",
"diff",
"dirs",
"env_logger 0.6.2",
"getopts",
"ignore",
- "itertools 0.8.0",
+ "itertools 0.8.2",
"lazy_static",
"log",
"regex",
"serde",
"serde_json",
"structopt",
- "term 0.6.0",
+ "term 0.6.1",
"thiserror",
"toml",
"unicode-segmentation",
[[package]]
name = "ryu"
-version = "1.0.0"
+version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c92464b447c0ee8c4fb3824ecc8383b81717b9f1e74ba2e72540aef7b9f82997"
+checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e"
[[package]]
name = "same-file"
-version = "1.0.4"
+version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267"
+checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
dependencies = [
"winapi-util",
]
[[package]]
name = "schannel"
-version = "0.1.16"
+version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "87f550b06b6cba9c8b8be3ee73f391990116bf527450d2556e9b9ce263b9a021"
+checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75"
dependencies = [
"lazy_static",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"
-[[package]]
-name = "scoped_threadpool"
-version = "0.1.9"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8"
-
[[package]]
name = "scopeguard"
-version = "1.0.0"
+version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b42e15e59b18a828bbf5c58ea01debb36b9b096346de35d941dcb89009f24a0d"
+checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
[[package]]
name = "semver"
[[package]]
name = "serde"
-version = "1.0.99"
+version = "1.0.115"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fec2851eb56d010dc9a21b89ca53ee75e6528bab60c11e89d38390904982da9f"
+checksum = "e54c9a88f2da7238af84b5101443f0c0d0a3bbdc455e34a5c9497b1903ed55d5"
dependencies = [
"serde_derive",
]
[[package]]
name = "serde_derive"
-version = "1.0.106"
+version = "1.0.115"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c"
+checksum = "609feed1d0a73cc36a0182a840a9b37b4a82f0b1150369f0536a9e3f2a31dc48"
dependencies = [
"proc-macro2",
"quote",
[[package]]
name = "serde_ignored"
-version = "0.1.0"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3c24bbb8f4b81834f618cd3e28698235c2fba06ddf7f4fbe30519dd081364e59"
+checksum = "1c2c7d39d14f2f2ea82239de71594782f186fd03501ac81f0ce08e674819ff2f"
dependencies = [
"serde",
]
[[package]]
name = "serde_json"
-version = "1.0.40"
+version = "1.0.57"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "051c49229f282f7c6f3813f8286cc1e3323e8051823fce42c7ea80fe13521704"
+checksum = "164eacbdb13512ec2745fb09d51fd5b22b0d65ed294a1dcf7285a360c80a675c"
dependencies = [
"itoa",
"ryu",
[[package]]
name = "serde_repr"
-version = "0.1.5"
+version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "cd02c7587ec314570041b2754829f84d873ced14a96d1fd1823531e11db40573"
+checksum = "2dc6b7951b17b051f3210b063f12cc17320e2fe30ae05b0fe2a3abb068551c76"
dependencies = [
"proc-macro2",
"quote",
[[package]]
name = "shell-escape"
-version = "0.1.4"
+version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "170a13e64f2a51b77a45702ba77287f5c6829375b04a69cf2222acd17d0cfab9"
+checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f"
[[package]]
name = "shlex"
checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2"
[[package]]
-name = "signal-hook"
-version = "0.1.7"
+name = "signal-hook-registry"
+version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1f272d1b7586bec132ed427f532dd418d8beca1ca7f2caf7df35569b1415a4b4"
+checksum = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035"
dependencies = [
"arc-swap",
"libc",
[[package]]
name = "smallvec"
-version = "0.6.10"
+version = "0.6.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ab606a9c5e214920bb66c458cd7be8ef094f813f20fe77a54cc7dbfff220d4b7"
+checksum = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6"
+dependencies = [
+ "maybe-uninit",
+]
[[package]]
name = "smallvec"
-version = "1.4.0"
+version = "1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4"
+checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252"
[[package]]
name = "socket2"
"cfg-if",
"libc",
"redox_syscall",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
name = "stable_deref_trait"
-version = "1.1.0"
+version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ffbc596e092fe5f598b12ef46cc03754085ac2f4d8c739ad61c4ae266cc3b3fa"
+checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
[[package]]
name = "stacker"
-version = "0.1.9"
+version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72dd941b456e1c006d6b9f27c526d5b69281288aeea8cba82c19d3843d8ccdd2"
+checksum = "a92bc346006ae78c539d6ab2cf1a1532bc657b8339c464877a990ec82073c66f"
dependencies = [
"cc",
"cfg-if",
"libc",
"psm",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
[[package]]
name = "structopt"
-version = "0.3.1"
+version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ac9d6e93dd792b217bf89cda5c14566e3043960c6f9da890c2ba5d09d07804c"
+checksum = "de5472fb24d7e80ae84a7801b7978f95a19ec32cb1876faea59ab711eb901976"
dependencies = [
"clap",
+ "lazy_static",
"structopt-derive",
]
[[package]]
name = "structopt-derive"
-version = "0.3.1"
+version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2ae9e5165d463a0dea76967d021f8d0f9316057bf5163aa2a4843790e842ff37"
+checksum = "1e0eb37335aeeebe51be42e2dc07f031163fbabfa6ac67d7ea68b5c2f68d5f99"
dependencies = [
"heck",
"proc-macro-error",
[[package]]
name = "syn"
-version = "1.0.11"
+version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dff0acdb207ae2fe6d5976617f887eb1e35a2ba52c13c7234c790960cdad9238"
+checksum = "e69abc24912995b3038597a7a593be5053eb0fb44f3cc5beec0deb421790c1f4"
dependencies = [
"proc-macro2",
"quote",
[[package]]
name = "synstructure"
-version = "0.12.1"
+version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3f085a5855930c0441ca1288cf044ea4aecf4f43a91668abdb870b4ba546a203"
+checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701"
dependencies = [
"proc-macro2",
"quote",
[[package]]
name = "tar"
-version = "0.4.26"
+version = "0.4.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b3196bfbffbba3e57481b6ea32249fbaf590396a52505a2615adbb79d9d826d3"
+checksum = "c8a4c1d0bee3230179544336c15eefb563cf0302955d962e456542323e8c2e8a"
dependencies = [
"filetime",
"libc",
"rand",
"redox_syscall",
"remove_dir_all",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
name = "tendril"
-version = "0.4.0"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9de21546595a0873061940d994bbbc5c35f024ae4fd61ec5c5b159115684f508"
+checksum = "707feda9f2582d5d680d733e38755547a3e8fb471e7ba11452ecfd9ce93a5d3b"
dependencies = [
"futf",
"mac",
[[package]]
name = "term"
-version = "0.6.0"
+version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0dd90505d5006a4422d3520b30c781d480b3f36768c2fa2187c3e950bc110464"
+checksum = "c0863a3345e70f61d613eab32ee046ccd1bcc5f9105fe402c61fcd0c13eeb8b5"
dependencies = [
- "byteorder",
"dirs",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
checksum = "1706be6b564323ce7092f5f7e6b118a14c8ef7ed0e69c8c5329c914a9f101295"
dependencies = [
"libc",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
dependencies = [
"getopts",
"libc",
- "term 0.6.0",
+ "term 0.6.1",
]
[[package]]
[[package]]
name = "thiserror"
-version = "1.0.5"
+version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f9fb62ff737e573b1e677459bea6fd023cd5d6e868c3242d3cdf3ef2f0554824"
+checksum = "7dfdd070ccd8ccb78f4ad66bf1982dc37f620ef696c6b5028fe2ed83dd3d0d08"
dependencies = [
"thiserror-impl",
]
[[package]]
name = "thiserror-impl"
-version = "1.0.5"
+version = "1.0.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "24069c0ba08aab54289d6a25f5036d94afc61e1538bbc42ae5501df141c9027d"
+checksum = "bd80fc12f73063ac132ac92aceea36734f04a1d93c1240c6944e23a3b8841793"
dependencies = [
"proc-macro2",
"quote",
[[package]]
name = "time"
-version = "0.1.42"
+version = "0.1.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f"
+checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438"
dependencies = [
"libc",
- "redox_syscall",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
+[[package]]
+name = "tinyvec"
+version = "0.3.4"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117"
+
[[package]]
name = "tokio"
version = "0.1.22"
[[package]]
name = "tokio-codec"
-version = "0.1.1"
+version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c501eceaf96f0e1793cf26beb63da3d11c738c4a943fdf3746d81d64684c39f"
+checksum = "25b2998660ba0e70d18684de5d06b70b70a3a747469af9dea7618cc59e75976b"
dependencies = [
"bytes",
"futures",
[[package]]
name = "tokio-current-thread"
-version = "0.1.6"
+version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d16217cad7f1b840c5a97dfb3c43b0c871fef423a6e8d2118c604e843662a443"
+checksum = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e"
dependencies = [
"futures",
"tokio-executor",
[[package]]
name = "tokio-executor"
-version = "0.1.9"
+version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca6df436c42b0c3330a82d855d2ef017cd793090ad550a6bc2184f4b933532ab"
+checksum = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671"
dependencies = [
- "crossbeam-utils 0.6.5",
+ "crossbeam-utils 0.7.2",
"futures",
]
[[package]]
name = "tokio-fs"
-version = "0.1.6"
+version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3fe6dc22b08d6993916647d108a1a7d15b9cd29c4f4496c62b92c45b5041b7af"
+checksum = "297a1206e0ca6302a0eed35b700d292b275256f596e2f3fea7729d5e629b6ff4"
dependencies = [
"futures",
"tokio-io",
[[package]]
name = "tokio-io"
-version = "0.1.12"
+version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5090db468dad16e1a7a54c8c67280c5e4b544f3d3e018f0b913b400261f85926"
+checksum = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674"
dependencies = [
"bytes",
"futures",
[[package]]
name = "tokio-process"
-version = "0.2.4"
+version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "afbd6ef1b8cc2bd2c2b580d882774d443ebb1c6ceefe35ba9ea4ab586c89dbe8"
+checksum = "382d90f43fa31caebe5d3bc6cfd854963394fff3b8cb59d5146607aaae7e7e43"
dependencies = [
- "crossbeam-queue",
+ "crossbeam-queue 0.1.2",
"futures",
"lazy_static",
"libc",
"tokio-io",
"tokio-reactor",
"tokio-signal",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
name = "tokio-reactor"
-version = "0.1.11"
+version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6732fe6b53c8d11178dcb77ac6d9682af27fc6d4cb87789449152e5377377146"
+checksum = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351"
dependencies = [
- "crossbeam-utils 0.6.5",
+ "crossbeam-utils 0.7.2",
"futures",
"lazy_static",
"log",
[[package]]
name = "tokio-signal"
-version = "0.2.7"
+version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "dd6dc5276ea05ce379a16de90083ec80836440d5ef8a6a39545a3207373b8296"
+checksum = "d0c34c6e548f101053321cba3da7cbb87a610b85555884c41b07da2eb91aff12"
dependencies = [
"futures",
"libc",
"mio",
"mio-uds",
- "signal-hook",
+ "signal-hook-registry",
"tokio-executor",
"tokio-io",
"tokio-reactor",
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
name = "tokio-sync"
-version = "0.1.7"
+version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d06554cce1ae4a50f42fba8023918afa931413aded705b560e29600ccf7c6d76"
+checksum = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee"
dependencies = [
"fnv",
"futures",
[[package]]
name = "tokio-tcp"
-version = "0.1.3"
+version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1d14b10654be682ac43efee27401d792507e30fd8d26389e1da3b185de2e4119"
+checksum = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72"
dependencies = [
"bytes",
"futures",
[[package]]
name = "tokio-threadpool"
-version = "0.1.17"
+version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0c32ffea4827978e9aa392d2f743d973c1dfa3730a2ed3f22ce1e6984da848c"
+checksum = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89"
dependencies = [
"crossbeam-deque",
- "crossbeam-queue",
- "crossbeam-utils 0.6.5",
+ "crossbeam-queue 0.2.3",
+ "crossbeam-utils 0.7.2",
"futures",
"lazy_static",
"log",
[[package]]
name = "tokio-timer"
-version = "0.2.12"
+version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1739638e364e558128461fc1ad84d997702c8e31c2e6b18fb99842268199e827"
+checksum = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296"
dependencies = [
- "crossbeam-utils 0.6.5",
+ "crossbeam-utils 0.7.2",
"futures",
"slab",
"tokio-executor",
[[package]]
name = "tokio-udp"
-version = "0.1.5"
+version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f02298505547f73e60f568359ef0d016d5acd6e830ab9bc7c4a5b3403440121b"
+checksum = "e2a0b10e610b39c38b031a2fcab08e4b82f16ece36504988dcbd81dbba650d82"
dependencies = [
"bytes",
"futures",
[[package]]
name = "tokio-uds"
-version = "0.2.5"
+version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "037ffc3ba0e12a0ab4aca92e5234e0dedeb48fddf6ccd260f1f150a36a9f2445"
+checksum = "ab57a4ac4111c8c9dbcf70779f6fc8bc35ae4b2454809febac840ad19bd7e4e0"
dependencies = [
"bytes",
"futures",
[[package]]
name = "toml"
-version = "0.5.3"
+version = "0.5.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c7aabe75941d914b72bf3e5d3932ed92ce0664d49d8432305a8b547c37227724"
+checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a"
dependencies = [
"serde",
]
[[package]]
name = "tracing"
-version = "0.1.18"
+version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0aae59226cf195d8e74d4b34beae1859257efb4e5fed3f147d2dc2c7d372178"
+checksum = "6d79ca061b032d6ce30c660fded31189ca0b9922bf483cd70759f13a2d86786c"
dependencies = [
"cfg-if",
"tracing-attributes",
[[package]]
name = "tracing-attributes"
-version = "0.1.9"
+version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f0693bf8d6f2bf22c690fc61a9d21ac69efdbb894a17ed596b9af0f01e64b84b"
+checksum = "1fe233f4227389ab7df5b32649239da7ebe0b281824b4e84b342d04d3fd8c25e"
dependencies = [
"proc-macro2",
"quote",
[[package]]
name = "tracing-core"
-version = "0.1.12"
+version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2734b5a028fa697686f16c6d18c2c6a3c7e41513f9a213abb6754c4acb3c8d7"
+checksum = "db63662723c316b43ca36d833707cc93dff82a02ba3d7e354f342682cc8b3545"
dependencies = [
"lazy_static",
]
[[package]]
name = "tracing-subscriber"
-version = "0.2.10"
+version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f7b33f8b2ef2ab0c3778c12646d9c42a24f7772bee4cdafc72199644a9f58fdc"
+checksum = "abd165311cc4d7a555ad11cc77a37756df836182db0d81aac908c8184c584f40"
dependencies = [
"ansi_term 0.12.1",
"lazy_static",
"matchers",
- "parking_lot 0.10.2",
+ "parking_lot 0.11.0",
"regex",
"sharded-slab",
- "smallvec 1.4.0",
+ "smallvec 1.4.2",
+ "thread_local",
"tracing-core",
]
[[package]]
name = "ucd-parse"
-version = "0.1.4"
+version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca6b52bf4da6512f0f07785a04769222e50d29639e7ecd016b7806fd2de306b4"
+checksum = "5269f8d35df6b8b60758343a6d742ecf09e4bca13faee32af5503aebd1e11b7c"
dependencies = [
"lazy_static",
"regex",
[[package]]
name = "ucd-trie"
-version = "0.1.1"
+version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "71a9c5b1fe77426cf144cc30e49e955270f5086e31a6441dfa8b32efc09b9d77"
+checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
[[package]]
name = "unicase"
[[package]]
name = "unicode-normalization"
-version = "0.1.12"
+version = "0.1.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4"
+checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977"
dependencies = [
- "smallvec 1.4.0",
+ "tinyvec",
]
[[package]]
name = "unicode-script"
-version = "0.5.1"
+version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "58b33414ea8db4b7ea0343548dbdc31d27aef06beacf7044a87e564d9b0feb7d"
+checksum = "79bf4d5fc96546fdb73f9827097810bbda93b11a6770ff3a54e1f445d4135787"
[[package]]
name = "unicode-security"
[[package]]
name = "unicode-width"
-version = "0.1.6"
+version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7007dbd421b92cc6e28410fe7362e2e0a2503394908f417b68ec8d1c364c4e20"
+checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3"
dependencies = [
"compiler_builtins",
"rustc-std-workspace-core",
[[package]]
name = "unicode-xid"
-version = "0.2.0"
+version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"
+checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564"
[[package]]
name = "unicode_categories"
[[package]]
name = "url"
-version = "2.1.0"
+version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "75b414f6c464c879d7f9babf951f23bc3743fb7313c081b2e6ca719067ea9d61"
+checksum = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb"
dependencies = [
"idna 0.2.0",
"matches",
[[package]]
name = "utf-8"
-version = "0.7.2"
+version = "0.7.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f1262dfab4c30d5cb7c07026be00ee343a6cf5027fdc0104a9160f354e5db75c"
+checksum = "05e42f7c18b8f902290b009cde6d651262f956c98bc51bca4cd1d511c9cd85c7"
[[package]]
name = "utf8parse"
[[package]]
name = "vcpkg"
-version = "0.2.8"
+version = "0.2.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168"
+checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c"
[[package]]
name = "vec_map"
-version = "0.8.1"
+version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
+checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
[[package]]
name = "vergen"
[[package]]
name = "walkdir"
-version = "2.2.7"
+version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9d9d7ed3431229a144296213105a390676cc49c9b6a72bd19f3176c98e129fa1"
+checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d"
dependencies = [
"same-file",
- "winapi 0.3.8",
+ "winapi 0.3.9",
"winapi-util",
]
[[package]]
name = "winapi"
-version = "0.3.8"
+version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6"
+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [
"winapi-i686-pc-windows-gnu",
"winapi-x86_64-pc-windows-gnu",
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
dependencies = [
- "winapi 0.3.8",
+ "winapi 0.3.9",
]
[[package]]
[[package]]
name = "xz2"
-version = "0.1.5"
+version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "df8bf41d3030c3577c9458fd6640a05afbf43b150d0b531b16bd77d3f794f27a"
+checksum = "c179869f34fc7c01830d3ce7ea2086bc3a07e0d35289b667d0a8bf910258926c"
dependencies = [
"lzma-sys",
]
[[package]]
name = "yaml-merge-keys"
-version = "0.4.0"
+version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "59893318ba3ad2b704498c7761214a10eaf42c5f838bce9fc0145bf2ba658cfa"
+checksum = "fd236a7dc9bb598f349fe4a8754f49181fee50284daa15cd1ba652d722280004"
dependencies = [
"lazy_static",
"thiserror",
- "yaml-rust 0.4.3",
+ "yaml-rust 0.4.4",
]
[[package]]
[[package]]
name = "yaml-rust"
-version = "0.4.3"
+version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d"
+checksum = "39f0c922f1a334134dc2f7a8b67dc5d25f0735263feec974345ff706bcf20b0d"
dependencies = [
"linked-hash-map",
]
[patch."https://github.com/rust-lang/cargo"]
cargo = { path = "src/tools/cargo" }
-[patch.crates-io]
+[patch."https://github.com/rust-lang/rustfmt"]
# Similar to Cargo above we want the RLS to use a vendored version of `rustfmt`
# that we're shipping as well (to ensure that the rustfmt in RLS and the
# `rustfmt` executable are the same exact version).
rustfmt-nightly = { path = "src/tools/rustfmt" }
+[patch.crates-io]
# See comments in `src/tools/rustc-workspace-hack/README.md` for what's going on
# here
rustc-workspace-hack = { path = 'src/tools/rustc-workspace-hack' }
unsafe { __rust_alloc_zeroed(layout.size(), layout.align()) }
}
+impl Global {
+ #[inline]
+ fn alloc_impl(&mut self, layout: Layout, zeroed: bool) -> Result<NonNull<[u8]>, AllocErr> {
+ match layout.size() {
+ 0 => Ok(NonNull::slice_from_raw_parts(layout.dangling(), 0)),
+ // SAFETY: `layout` is non-zero in size,
+ size => unsafe {
+ let raw_ptr = if zeroed { alloc_zeroed(layout) } else { alloc(layout) };
+ let ptr = NonNull::new(raw_ptr).ok_or(AllocErr)?;
+ Ok(NonNull::slice_from_raw_parts(ptr, size))
+ },
+ }
+ }
+
+ // Safety: Same as `AllocRef::grow`
+ #[inline]
+ unsafe fn grow_impl(
+ &mut self,
+ ptr: NonNull<u8>,
+ layout: Layout,
+ new_size: usize,
+ zeroed: bool,
+ ) -> Result<NonNull<[u8]>, AllocErr> {
+ debug_assert!(
+ new_size >= layout.size(),
+ "`new_size` must be greater than or equal to `layout.size()`"
+ );
+
+ match layout.size() {
+ // SAFETY: the caller must ensure that the `new_size` does not overflow.
+ // `layout.align()` comes from a `Layout` and is thus guaranteed to be valid for a Layout.
+ 0 => unsafe {
+ let new_layout = Layout::from_size_align_unchecked(new_size, layout.align());
+ self.alloc_impl(new_layout, zeroed)
+ },
+
+ // SAFETY: `new_size` is non-zero as `old_size` is greater than or equal to `new_size`
+ // as required by safety conditions. Other conditions must be upheld by the caller
+ old_size => unsafe {
+ // `realloc` probably checks for `new_size >= size` or something similar.
+ intrinsics::assume(new_size >= layout.size());
+
+ let raw_ptr = realloc(ptr.as_ptr(), layout, new_size);
+ let ptr = NonNull::new(raw_ptr).ok_or(AllocErr)?;
+ if zeroed {
+ raw_ptr.add(old_size).write_bytes(0, new_size - old_size);
+ }
+ Ok(NonNull::slice_from_raw_parts(ptr, new_size))
+ },
+ }
+ }
+}
+
#[unstable(feature = "allocator_api", issue = "32838")]
unsafe impl AllocRef for Global {
#[inline]
fn alloc(&mut self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr> {
- let size = layout.size();
- let ptr = if size == 0 {
- layout.dangling()
- } else {
- // SAFETY: `layout` is non-zero in size,
- unsafe { NonNull::new(alloc(layout)).ok_or(AllocErr)? }
- };
- Ok(NonNull::slice_from_raw_parts(ptr, size))
+ self.alloc_impl(layout, false)
}
#[inline]
fn alloc_zeroed(&mut self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr> {
- let size = layout.size();
- let ptr = if size == 0 {
- layout.dangling()
- } else {
- // SAFETY: `layout` is non-zero in size,
- unsafe { NonNull::new(alloc_zeroed(layout)).ok_or(AllocErr)? }
- };
- Ok(NonNull::slice_from_raw_parts(ptr, size))
+ self.alloc_impl(layout, true)
}
#[inline]
layout: Layout,
new_size: usize,
) -> Result<NonNull<[u8]>, AllocErr> {
- debug_assert!(
- new_size >= layout.size(),
- "`new_size` must be greater than or equal to `layout.size()`"
- );
-
- // SAFETY: `new_size` must be non-zero, which is checked in the match expression.
- // Other conditions must be upheld by the caller
- unsafe {
- match layout.size() {
- old_size if old_size == new_size => {
- Ok(NonNull::slice_from_raw_parts(ptr, new_size))
- }
- 0 => self.alloc(Layout::from_size_align_unchecked(new_size, layout.align())),
- old_size => {
- // `realloc` probably checks for `new_size > size` or something similar.
- intrinsics::assume(new_size > old_size);
- let raw_ptr = realloc(ptr.as_ptr(), layout, new_size);
- let ptr = NonNull::new(raw_ptr).ok_or(AllocErr)?;
- Ok(NonNull::slice_from_raw_parts(ptr, new_size))
- }
- }
- }
+ // SAFETY: all conditions must be upheld by the caller
+ unsafe { self.grow_impl(ptr, layout, new_size, false) }
}
#[inline]
layout: Layout,
new_size: usize,
) -> Result<NonNull<[u8]>, AllocErr> {
- debug_assert!(
- new_size >= layout.size(),
- "`new_size` must be greater than or equal to `layout.size()`"
- );
-
- // SAFETY: `new_size` must be non-zero, which is checked in the match expression.
- // Other conditions must be upheld by the caller
- unsafe {
- match layout.size() {
- old_size if old_size == new_size => {
- Ok(NonNull::slice_from_raw_parts(ptr, new_size))
- }
- 0 => self.alloc_zeroed(Layout::from_size_align_unchecked(new_size, layout.align())),
- old_size => {
- // `realloc` probably checks for `new_size > size` or something similar.
- intrinsics::assume(new_size > old_size);
- let raw_ptr = realloc(ptr.as_ptr(), layout, new_size);
- raw_ptr.add(old_size).write_bytes(0, new_size - old_size);
- let ptr = NonNull::new(raw_ptr).ok_or(AllocErr)?;
- Ok(NonNull::slice_from_raw_parts(ptr, new_size))
- }
- }
- }
+ // SAFETY: all conditions must be upheld by the caller
+ unsafe { self.grow_impl(ptr, layout, new_size, true) }
}
#[inline]
layout: Layout,
new_size: usize,
) -> Result<NonNull<[u8]>, AllocErr> {
- let old_size = layout.size();
debug_assert!(
- new_size <= old_size,
+ new_size <= layout.size(),
"`new_size` must be smaller than or equal to `layout.size()`"
);
- let ptr = if new_size == old_size {
- ptr
- } else if new_size == 0 {
- // SAFETY: `layout` is non-zero in size as `old_size` != `new_size`
- // Other conditions must be upheld by the caller
- unsafe {
+ match new_size {
+ // SAFETY: conditions must be upheld by the caller
+ 0 => unsafe {
self.dealloc(ptr, layout);
- }
- layout.dangling()
- } else {
- // SAFETY: new_size is not zero,
- // Other conditions must be upheld by the caller
- let raw_ptr = unsafe {
- // `realloc` probably checks for `new_size < old_size` or something similar.
- intrinsics::assume(new_size < old_size);
- realloc(ptr.as_ptr(), layout, new_size)
- };
- NonNull::new(raw_ptr).ok_or(AllocErr)?
- };
+ Ok(NonNull::slice_from_raw_parts(layout.dangling(), 0))
+ },
- Ok(NonNull::slice_from_raw_parts(ptr, new_size))
+ // SAFETY: `new_size` is non-zero. Other conditions must be upheld by the caller
+ new_size => unsafe {
+ // `realloc` probably checks for `new_size <= size` or something similar.
+ intrinsics::assume(new_size <= layout.size());
+
+ let raw_ptr = realloc(ptr.as_ptr(), layout, new_size);
+ let ptr = NonNull::new(raw_ptr).ok_or(AllocErr)?;
+ Ok(NonNull::slice_from_raw_parts(ptr, new_size))
+ },
+ }
}
}
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn shrink_to_fit(&mut self) {
- if self.capacity() != self.len {
+ // The capacity is never less than the length, and there's nothing to do when
+ // they are equal, so we can avoid the panic case in `RawVec::shrink_to_fit`
+ // by only calling it with a greater capacity.
+ if self.capacity() > self.len {
self.buf.shrink_to_fit(self.len);
}
}
/// alignment and a size given by `new_size`. To accomplish this, the allocator may extend the
/// allocation referenced by `ptr` to fit the new layout.
///
+ /// If this returns `Ok`, then ownership of the memory block referenced by `ptr` has been
+ /// transferred to this allocator. The memory may or may not have been freed, and should be
+ /// considered unusable unless it was transferred back to the caller again via the return value
+ /// of this method.
+ ///
/// If this method returns `Err`, then ownership of the memory block has not been transferred to
/// this allocator, and the contents of the memory block are unaltered.
///
/// * `new_size` must be greater than or equal to `layout.size()`, and
/// * `new_size`, when rounded up to the nearest multiple of `layout.align()`, must not overflow
/// (i.e., the rounded value must be less than or equal to `usize::MAX`).
- // Note: We can't require that `new_size` is strictly greater than `layout.size()` because of ZSTs.
- // alternative: `new_size` must be strictly greater than `layout.size()` or both are zero
///
/// [*currently allocated*]: #currently-allocated-memory
/// [*fit*]: #memory-fitting
"`new_size` must be greater than or equal to `layout.size()`"
);
- if size == new_size {
- return Ok(NonNull::slice_from_raw_parts(ptr, size));
- }
-
- let new_layout =
- // SAFETY: the caller must ensure that the `new_size` does not overflow.
- // `layout.align()` comes from a `Layout` and is thus guaranteed to be valid for a Layout.
- // The caller must ensure that `new_size` is greater than or equal to zero. If it's equal
- // to zero, it's catched beforehand.
- unsafe { Layout::from_size_align_unchecked(new_size, layout.align()) };
+ // SAFETY: the caller must ensure that the `new_size` does not overflow.
+ // `layout.align()` comes from a `Layout` and is thus guaranteed to be valid for a Layout.
+ let new_layout = unsafe { Layout::from_size_align_unchecked(new_size, layout.align()) };
let new_ptr = self.alloc(new_layout)?;
// SAFETY: because `new_size` must be greater than or equal to `size`, both the old and new
// `copy_nonoverlapping` is safe.
// The safety contract for `dealloc` must be upheld by the caller.
unsafe {
- ptr::copy_nonoverlapping(ptr.as_ptr(), new_ptr.as_non_null_ptr().as_ptr(), size);
+ ptr::copy_nonoverlapping(ptr.as_ptr(), new_ptr.as_mut_ptr(), size);
self.dealloc(ptr, layout);
- Ok(new_ptr)
}
+
+ Ok(new_ptr)
}
/// Behaves like `grow`, but also ensures that the new contents are set to zero before being
/// The memory block will contain the following contents after a successful call to
/// `grow_zeroed`:
/// * Bytes `0..layout.size()` are preserved from the original allocation.
- /// * Bytes `layout.size()..old_size` will either be preserved or zeroed,
- /// depending on the allocator implementation. `old_size` refers to the size of
- /// the `MemoryBlock` prior to the `grow_zeroed` call, which may be larger than the size
- /// that was originally requested when it was allocated.
- /// * Bytes `old_size..new_size` are zeroed. `new_size` refers to
- /// the size of the `MemoryBlock` returned by the `grow` call.
+ /// * Bytes `layout.size()..old_size` will either be preserved or zeroed, depending on the
+ /// allocator implementation. `old_size` refers to the size of the memory block prior to
+ /// the `grow_zeroed` call, which may be larger than the size that was originally requested
+ /// when it was allocated.
+ /// * Bytes `old_size..new_size` are zeroed. `new_size` refers to the size of the memory
+ /// block returned by the `grow` call.
///
/// # Safety
///
/// * `new_size` must be greater than or equal to `layout.size()`, and
/// * `new_size`, when rounded up to the nearest multiple of `layout.align()`, must not overflow
/// (i.e., the rounded value must be less than or equal to `usize::MAX`).
- // Note: We can't require that `new_size` is strictly greater than `layout.size()` because of ZSTs.
- // alternative: `new_size` must be strictly greater than `layout.size()` or both are zero
///
/// [*currently allocated*]: #currently-allocated-memory
/// [*fit*]: #memory-fitting
"`new_size` must be greater than or equal to `layout.size()`"
);
- if size == new_size {
- return Ok(NonNull::slice_from_raw_parts(ptr, size));
- }
-
- let new_layout =
- // SAFETY: the caller must ensure that the `new_size` does not overflow.
- // `layout.align()` comes from a `Layout` and is thus guaranteed to be valid for a Layout.
- // The caller must ensure that `new_size` is greater than or equal to zero. If it's equal
- // to zero, it's caught beforehand.
- unsafe { Layout::from_size_align_unchecked(new_size, layout.align()) };
+ // SAFETY: the caller must ensure that the `new_size` does not overflow.
+ // `layout.align()` comes from a `Layout` and is thus guaranteed to be valid for a Layout.
+ let new_layout = unsafe { Layout::from_size_align_unchecked(new_size, layout.align()) };
let new_ptr = self.alloc_zeroed(new_layout)?;
// SAFETY: because `new_size` must be greater than or equal to `size`, both the old and new
// `copy_nonoverlapping` is safe.
// The safety contract for `dealloc` must be upheld by the caller.
unsafe {
- ptr::copy_nonoverlapping(ptr.as_ptr(), new_ptr.as_non_null_ptr().as_ptr(), size);
+ ptr::copy_nonoverlapping(ptr.as_ptr(), new_ptr.as_mut_ptr(), size);
self.dealloc(ptr, layout);
- Ok(new_ptr)
}
+
+ Ok(new_ptr)
}
/// Attempts to shrink the memory block.
///
/// If this returns `Ok`, then ownership of the memory block referenced by `ptr` has been
/// transferred to this allocator. The memory may or may not have been freed, and should be
- /// considered unusable unless it was transferred back to the caller again via the
- /// return value of this method.
+ /// considered unusable unless it was transferred back to the caller again via the return value
+ /// of this method.
///
/// If this method returns `Err`, then ownership of the memory block has not been transferred to
/// this allocator, and the contents of the memory block are unaltered.
/// * `ptr` must denote a block of memory [*currently allocated*] via this allocator,
/// * `layout` must [*fit*] that block of memory (The `new_size` argument need not fit it.), and
/// * `new_size` must be smaller than or equal to `layout.size()`.
- // Note: We can't require that `new_size` is strictly smaller than `layout.size()` because of ZSTs.
- // alternative: `new_size` must be smaller than `layout.size()` or both are zero
///
/// [*currently allocated*]: #currently-allocated-memory
/// [*fit*]: #memory-fitting
"`new_size` must be smaller than or equal to `layout.size()`"
);
- if size == new_size {
- return Ok(NonNull::slice_from_raw_parts(ptr, size));
- }
-
- let new_layout =
// SAFETY: the caller must ensure that the `new_size` does not overflow.
// `layout.align()` comes from a `Layout` and is thus guaranteed to be valid for a Layout.
- // The caller must ensure that `new_size` is greater than zero.
- unsafe { Layout::from_size_align_unchecked(new_size, layout.align()) };
+ let new_layout = unsafe { Layout::from_size_align_unchecked(new_size, layout.align()) };
let new_ptr = self.alloc(new_layout)?;
// SAFETY: because `new_size` must be lower than or equal to `size`, both the old and new
// `copy_nonoverlapping` is safe.
// The safety contract for `dealloc` must be upheld by the caller.
unsafe {
- ptr::copy_nonoverlapping(ptr.as_ptr(), new_ptr.as_non_null_ptr().as_ptr(), size);
+ ptr::copy_nonoverlapping(ptr.as_ptr(), new_ptr.as_mut_ptr(), size);
self.dealloc(ptr, layout);
- Ok(new_ptr)
}
+
+ Ok(new_ptr)
}
/// Creates a "by reference" adaptor for this instance of `AllocRef`.
))]
pub trait From<T>: Sized {
/// Performs the conversion.
+ #[cfg_attr(not(bootstrap), lang = "from")]
#[stable(feature = "rust1", since = "1.0.0")]
fn from(_: T) -> Self;
}
/// [`Context`]: ../task/struct.Context.html
/// [`Waker`]: ../task/struct.Waker.html
/// [`Waker::wake`]: ../task/struct.Waker.html#method.wake
+ #[cfg_attr(not(bootstrap), lang = "poll")]
#[stable(feature = "futures_api", since = "1.36.0")]
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output>;
}
/// This function returns a `GenFuture` underneath, but hides it in `impl Trait` to give
/// better error messages (`impl Future` rather than `GenFuture<[closure.....]>`).
// This is `const` to avoid extra errors after we recover from `const async fn`
+#[cfg_attr(not(bootstrap), lang = "from_generator")]
#[doc(hidden)]
#[unstable(feature = "gen_future", issue = "50547")]
#[inline]
GenFuture(gen)
}
+#[cfg_attr(not(bootstrap), lang = "get_context")]
#[doc(hidden)]
#[unstable(feature = "gen_future", issue = "50547")]
#[inline]
/// assert_eq!(Some(3), iter.next());
/// assert_eq!(None, iter.next());
/// ```
+ #[cfg_attr(not(bootstrap), lang = "into_iter")]
#[stable(feature = "rust1", since = "1.0.0")]
fn into_iter(self) -> Self::IntoIter;
}
/// assert_eq!(None, iter.next());
/// assert_eq!(None, iter.next());
/// ```
+ #[cfg_attr(not(bootstrap), lang = "next")]
#[stable(feature = "rust1", since = "1.0.0")]
fn next(&mut self) -> Option<Self::Item>;
#![feature(optin_builtin_traits)]
#![feature(or_patterns)]
#![feature(prelude_import)]
+#![feature(ptr_as_uninit)]
#![feature(repr_simd, platform_intrinsics)]
#![feature(rustc_attrs)]
#![feature(simd_ffi)]
///
/// ```
/// # #[allow(dead_code)]
+/// #[derive(Copy, Clone)]
/// struct Point {
/// x: i32,
/// y: i32,
/// the trait `Copy` may not be implemented for this type; field `points` does not implement `Copy`
/// ```
///
+/// Shared references (`&T`) are also `Copy`, so a type can be `Copy`, even when it holds
+/// shared references of types `T` that are *not* `Copy`. Consider the following struct,
+/// which can implement `Copy`, because it only holds a *shared reference* to our non-`Copy`
+/// type `PointList` from above:
+///
+/// ```
+/// # #![allow(dead_code)]
+/// # struct PointList;
+/// #[derive(Copy, Clone)]
+/// struct PointListWrapper<'a> {
+/// point_list_ref: &'a PointList,
+/// }
+/// ```
+///
/// ## When *can't* my type be `Copy`?
///
/// Some types can't be copied safely. For example, copying `&mut T` would create an aliased
/// Swaps the values at two mutable locations, without deinitializing either one.
///
+/// * If you want to swap with a default or dummy value, see [`take`].
+/// * If you want to swap with a passed value, returning the old value, see [`replace`].
+///
/// # Examples
///
/// ```
/// assert_eq!(42, x);
/// assert_eq!(5, y);
/// ```
+///
+/// [`replace`]: fn.replace.html
+/// [`take`]: fn.take.html
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
pub fn swap<T>(x: &mut T, y: &mut T) {
/// Replaces `dest` with the default value of `T`, returning the previous `dest` value.
///
+/// * If you want to replace the values of two variables, see [`swap`].
+/// * If you want to replace with a passed value instead of the default value, see [`replace`].
+///
/// # Examples
///
/// A simple example:
/// ```
///
/// [`Clone`]: ../../std/clone/trait.Clone.html
+/// [`replace`]: fn.replace.html
+/// [`swap`]: fn.swap.html
#[inline]
#[stable(feature = "mem_take", since = "1.40.0")]
pub fn take<T: Default>(dest: &mut T) -> T {
///
/// Neither value is dropped.
///
+/// * If you want to replace the values of two variables, see [`swap`].
+/// * If you want to replace with a default value, see [`take`].
+///
/// # Examples
///
/// A simple example:
/// ```
///
/// [`Clone`]: ../../std/clone/trait.Clone.html
+/// [`swap`]: fn.swap.html
+/// [`take`]: fn.take.html
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[must_use = "if you don't need the old value, you can just assign the new value directly"]
/// [`IntoIterator`]: ../iter/trait.Iterator.html
/// [`Iterator`]: ../iter/trait.IntoIterator.html
/// [slicing index]: ../slice/trait.SliceIndex.html
+#[cfg_attr(not(bootstrap), lang = "RangeFull")]
#[doc(alias = "..")]
#[derive(Copy, Clone, Default, PartialEq, Eq, Hash)]
#[stable(feature = "rust1", since = "1.0.0")]
/// assert_eq!(arr[1.. 3], [ 1,2 ]); // Range
/// assert_eq!(arr[1..=3], [ 1,2,3 ]);
/// ```
+#[cfg_attr(not(bootstrap), lang = "Range")]
#[doc(alias = "..")]
#[derive(Clone, Default, PartialEq, Eq, Hash)] // not Copy -- see #27186
#[stable(feature = "rust1", since = "1.0.0")]
/// ```
///
/// [`Iterator`]: ../iter/trait.IntoIterator.html
+#[cfg_attr(not(bootstrap), lang = "RangeFrom")]
#[doc(alias = "..")]
#[derive(Clone, PartialEq, Eq, Hash)] // not Copy -- see #27186
#[stable(feature = "rust1", since = "1.0.0")]
/// [`IntoIterator`]: ../iter/trait.Iterator.html
/// [`Iterator`]: ../iter/trait.IntoIterator.html
/// [slicing index]: ../slice/trait.SliceIndex.html
+#[cfg_attr(not(bootstrap), lang = "RangeTo")]
#[doc(alias = "..")]
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
#[stable(feature = "rust1", since = "1.0.0")]
/// assert_eq!(arr[1.. 3], [ 1,2 ]);
/// assert_eq!(arr[1..=3], [ 1,2,3 ]); // RangeInclusive
/// ```
+#[cfg_attr(not(bootstrap), lang = "RangeInclusive")]
#[doc(alias = "..=")]
#[derive(Clone, PartialEq, Eq, Hash)] // not Copy -- see #27186
#[stable(feature = "inclusive_range", since = "1.26.0")]
///
/// assert_eq!(3..=5, RangeInclusive::new(3, 5));
/// ```
+ #[cfg_attr(not(bootstrap), lang = "range_inclusive_new")]
#[stable(feature = "inclusive_range_methods", since = "1.27.0")]
#[inline]
#[rustc_promotable]
/// [`IntoIterator`]: ../iter/trait.Iterator.html
/// [`Iterator`]: ../iter/trait.IntoIterator.html
/// [slicing index]: ../slice/trait.SliceIndex.html
+#[cfg_attr(not(bootstrap), lang = "RangeToInclusive")]
#[doc(alias = "..=")]
#[derive(Copy, Clone, PartialEq, Eq, Hash)]
#[stable(feature = "inclusive_range", since = "1.26.0")]
/// in the return type of the enclosing scope (which must itself implement
/// `Try`). Specifically, the value `X::from_error(From::from(e))`
/// is returned, where `X` is the return type of the enclosing function.
+ #[cfg_attr(not(bootstrap), lang = "into_result")]
#[unstable(feature = "try_trait", issue = "42327")]
fn into_result(self) -> Result<Self::Ok, Self::Error>;
/// Wrap an error value to construct the composite result. For example,
/// `Result::Err(x)` and `Result::from_error(x)` are equivalent.
+ #[cfg_attr(not(bootstrap), lang = "from_error")]
#[unstable(feature = "try_trait", issue = "42327")]
fn from_error(v: Self::Error) -> Self;
/// Wrap an OK value to construct the composite result. For example,
/// `Result::Ok(x)` and `Result::from_ok(x)` are equivalent.
+ #[cfg_attr(not(bootstrap), lang = "from_ok")]
#[unstable(feature = "try_trait", issue = "42327")]
fn from_ok(v: Self::Ok) -> Self;
}
#[stable(feature = "rust1", since = "1.0.0")]
pub enum Option<T> {
/// No value
+ #[cfg_attr(not(bootstrap), lang = "None")]
#[stable(feature = "rust1", since = "1.0.0")]
None,
/// Some value `T`
+ #[cfg_attr(not(bootstrap), lang = "Some")]
#[stable(feature = "rust1", since = "1.0.0")]
Some(#[stable(feature = "rust1", since = "1.0.0")] T),
}
/// ```
///
/// [`mem::swap`]: ../../std/mem/fn.swap.html
+ #[cfg_attr(not(bootstrap), lang = "new_unchecked")]
#[stable(feature = "pin", since = "1.33.0")]
#[inline(always)]
pub unsafe fn new_unchecked(pointer: P) -> Pin<P> {
use crate::cmp::Ordering::{self, Equal, Greater, Less};
use crate::intrinsics;
use crate::mem;
-use crate::slice::SliceIndex;
+use crate::slice::{self, SliceIndex};
#[lang = "const_ptr"]
impl<T: ?Sized> *const T {
/// Therefore, two pointers that are null may still not compare equal to
/// each other.
///
+ /// ## Behavior during const evaluation
+ ///
+ /// When this function is used during const evaluation, it may return `false` for pointers
+ /// that turn out to be null at runtime. Specifically, when a pointer to some memory
+ /// is offset beyond its bounds in such a way that the resulting pointer is null,
+ /// the function will still return `false`. There is no way for CTFE to know
+ /// the absolute position of that memory, so we cannot tell if the pointer is
+ /// null or not.
+ ///
/// # Examples
///
/// Basic usage:
/// assert!(!ptr.is_null());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
+ #[rustc_const_unstable(feature = "const_ptr_is_null", issue = "74939")]
#[inline]
- pub fn is_null(self) -> bool {
+ pub const fn is_null(self) -> bool {
// Compare via a cast to a thin pointer, so fat pointers are only
// considering their "data" part for null-ness.
- (self as *const u8) == null()
+ (self as *const u8).guaranteed_eq(null())
}
/// Casts to a pointer of another type.
self as _
}
- /// Returns `None` if the pointer is null, or else returns a reference to
- /// the value wrapped in `Some`.
+ /// Returns `None` if the pointer is null, or else returns a shared reference to
+ /// the value wrapped in `Some`. If the value may be uninitialized, [`as_uninit_ref`]
+ /// must be used instead.
///
- /// # Safety
+ /// [`as_uninit_ref`]: #method.as_uninit_ref
///
- /// While this method and its mutable counterpart are useful for
- /// null-safety, it is important to note that this is still an unsafe
- /// operation because the returned value could be pointing to invalid
- /// memory.
+ /// # Safety
///
/// When calling this method, you have to ensure that *either* the pointer is NULL *or*
/// all of the following is true:
- /// - it is properly aligned
- /// - it must point to an initialized instance of T; in particular, the pointer must be
- /// "dereferenceable" in the sense defined [here].
+ ///
+ /// * The pointer must be properly aligned.
+ ///
+ /// * It must be "dereferencable" in the sense defined in [the module documentation].
+ ///
+ /// * The pointer must point to an initialized instance of `T`.
+ ///
+ /// * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is
+ /// arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
+ /// In particular, for the duration of this lifetime, the memory the pointer points to must
+ /// not get mutated (except inside `UnsafeCell`).
///
/// This applies even if the result of this method is unused!
/// (The part about being initialized is not yet fully decided, but until
/// it is, the only safe approach is to ensure that they are indeed initialized.)
///
- /// Additionally, the lifetime `'a` returned is arbitrarily chosen and does
- /// not necessarily reflect the actual lifetime of the data. *You* must enforce
- /// Rust's aliasing rules. In particular, for the duration of this lifetime,
- /// the memory the pointer points to must not get mutated (except inside `UnsafeCell`).
- ///
- /// [here]: crate::ptr#safety
+ /// [the module documentation]: crate::ptr#safety
///
/// # Examples
///
if self.is_null() { None } else { unsafe { Some(&*self) } }
}
+ /// Returns `None` if the pointer is null, or else returns a shared reference to
+ /// the value wrapped in `Some`. In contrast to [`as_ref`], this does not require
+ /// that the value has to be initialized.
+ ///
+ /// [`as_ref`]: #method.as_ref
+ ///
+ /// # Safety
+ ///
+ /// When calling this method, you have to ensure that *either* the pointer is NULL *or*
+ /// all of the following is true:
+ ///
+ /// * The pointer must be properly aligned.
+ ///
+ /// * It must be "dereferencable" in the sense defined in [the module documentation].
+ ///
+ /// * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is
+ /// arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
+ /// In particular, for the duration of this lifetime, the memory the pointer points to must
+ /// not get mutated (except inside `UnsafeCell`).
+ ///
+ /// This applies even if the result of this method is unused!
+ ///
+ /// [the module documentation]: crate::ptr#safety
+ ///
+ /// # Examples
+ ///
+ /// Basic usage:
+ ///
+ /// ```
+ /// #![feature(ptr_as_uninit)]
+ ///
+ /// let ptr: *const u8 = &10u8 as *const u8;
+ ///
+ /// unsafe {
+ /// if let Some(val_back) = ptr.as_uninit_ref() {
+ /// println!("We got back the value: {}!", val_back.assume_init());
+ /// }
+ /// }
+ /// ```
+ #[inline]
+ #[unstable(feature = "ptr_as_uninit", issue = "75402")]
+ pub unsafe fn as_uninit_ref<'a>(self) -> Option<&'a MaybeUninit<T>>
+ where
+ T: Sized,
+ {
+ // SAFETY: the caller must guarantee that `self` meets all the
+ // requirements for a reference.
+ if self.is_null() { None } else { Some(unsafe { &*(self as *const MaybeUninit<T>) }) }
+ }
+
/// Calculates the offset from a pointer.
///
/// `count` is in units of T; e.g., a `count` of 3 represents a pointer
// SAFETY: the caller ensures that `self` is dereferencable and `index` in-bounds.
unsafe { index.get_unchecked(self) }
}
+
+ /// Returns `None` if the pointer is null, or else returns a shared slice to
+ /// the value wrapped in `Some`. In contrast to [`as_ref`], this does not require
+ /// that the value has to be initialized.
+ ///
+ /// [`as_ref`]: #method.as_ref
+ ///
+ /// # Safety
+ ///
+ /// When calling this method, you have to ensure that *either* the pointer is NULL *or*
+ /// all of the following is true:
+ ///
+ /// * The pointer must be [valid] for reads for `ptr.len() * mem::size_of::<T>()` many bytes,
+ /// and it must be properly aligned. This means in particular:
+ ///
+ /// * The entire memory range of this slice must be contained within a single allocated object!
+ /// Slices can never span across multiple allocated objects.
+ ///
+ /// * The pointer must be aligned even for zero-length slices. One
+ /// reason for this is that enum layout optimizations may rely on references
+ /// (including slices of any length) being aligned and non-null to distinguish
+ /// them from other data. You can obtain a pointer that is usable as `data`
+ /// for zero-length slices using [`NonNull::dangling()`].
+ ///
+ /// * The total size `ptr.len() * mem::size_of::<T>()` of the slice must be no larger than `isize::MAX`.
+ /// See the safety documentation of [`pointer::offset`].
+ ///
+ /// * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is
+ /// arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
+ /// In particular, for the duration of this lifetime, the memory the pointer points to must
+ /// not get mutated (except inside `UnsafeCell`).
+ ///
+ /// This applies even if the result of this method is unused!
+ ///
+ /// See also [`slice::from_raw_parts`][].
+ ///
+ /// [valid]: crate::ptr#safety
+ /// [`NonNull::dangling()`]: NonNull::dangling
+ /// [`pointer::offset`]: ../std/primitive.pointer.html#method.offset
+ #[inline]
+ #[unstable(feature = "ptr_as_uninit", issue = "75402")]
+ pub unsafe fn as_uninit_slice<'a>(self) -> Option<&'a [MaybeUninit<T>]> {
+ if self.is_null() {
+ None
+ } else {
+ // SAFETY: the caller must uphold the safety contract for `as_uninit_slice`.
+ Some(unsafe { slice::from_raw_parts(self as *const MaybeUninit<T>, self.len()) })
+ }
+ }
}
// Equality for pointers
use super::*;
use crate::cmp::Ordering::{self, Equal, Greater, Less};
use crate::intrinsics;
-use crate::slice::SliceIndex;
+use crate::slice::{self, SliceIndex};
#[lang = "mut_ptr"]
impl<T: ?Sized> *mut T {
/// Therefore, two pointers that are null may still not compare equal to
/// each other.
///
+ /// ## Behavior during const evaluation
+ ///
+ /// When this function is used during const evaluation, it may return `false` for pointers
+ /// that turn out to be null at runtime. Specifically, when a pointer to some memory
+ /// is offset beyond its bounds in such a way that the resulting pointer is null,
+ /// the function will still return `false`. There is no way for CTFE to know
+ /// the absolute position of that memory, so we cannot tell if the pointer is
+ /// null or not.
+ ///
/// # Examples
///
/// Basic usage:
/// assert!(!ptr.is_null());
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
+ #[rustc_const_unstable(feature = "const_ptr_is_null", issue = "74939")]
#[inline]
- pub fn is_null(self) -> bool {
+ pub const fn is_null(self) -> bool {
// Compare via a cast to a thin pointer, so fat pointers are only
// considering their "data" part for null-ness.
- (self as *mut u8) == null_mut()
+ (self as *mut u8).guaranteed_eq(null_mut())
}
/// Casts to a pointer of another type.
self as _
}
- /// Returns `None` if the pointer is null, or else returns a reference to
- /// the value wrapped in `Some`.
+ /// Returns `None` if the pointer is null, or else returns a shared reference to
+ /// the value wrapped in `Some`. If the value may be uninitialized, [`as_uninit_ref`]
+ /// must be used instead.
///
- /// # Safety
+ /// For the mutable counterpart see [`as_mut`].
///
- /// While this method and its mutable counterpart are useful for
- /// null-safety, it is important to note that this is still an unsafe
- /// operation because the returned value could be pointing to invalid
- /// memory.
+ /// [`as_uninit_ref`]: #method.as_uninit_ref-1
+ /// [`as_mut`]: #method.as_mut
+ ///
+ /// # Safety
///
/// When calling this method, you have to ensure that *either* the pointer is NULL *or*
/// all of the following is true:
- /// - it is properly aligned
- /// - it must point to an initialized instance of T; in particular, the pointer must be
- /// "dereferencable" in the sense defined [here].
+ ///
+ /// * The pointer must be properly aligned.
+ ///
+ /// * It must be "dereferencable" in the sense defined in [the module documentation].
+ ///
+ /// * The pointer must point to an initialized instance of `T`.
+ ///
+ /// * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is
+ /// arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
+ /// In particular, for the duration of this lifetime, the memory the pointer points to must
+ /// not get mutated (except inside `UnsafeCell`).
///
/// This applies even if the result of this method is unused!
/// (The part about being initialized is not yet fully decided, but until
/// it is, the only safe approach is to ensure that they are indeed initialized.)
///
- /// Additionally, the lifetime `'a` returned is arbitrarily chosen and does
- /// not necessarily reflect the actual lifetime of the data. *You* must enforce
- /// Rust's aliasing rules. In particular, for the duration of this lifetime,
- /// the memory the pointer points to must not get mutated (except inside `UnsafeCell`).
- ///
- /// [here]: crate::ptr#safety
+ /// [the module documentation]: crate::ptr#safety
///
/// # Examples
///
if self.is_null() { None } else { unsafe { Some(&*self) } }
}
+ /// Returns `None` if the pointer is null, or else returns a shared reference to
+ /// the value wrapped in `Some`. In contrast to [`as_ref`], this does not require
+ /// that the value has to be initialized.
+ ///
+ /// For the mutable counterpart see [`as_uninit_mut`].
+ ///
+ /// [`as_ref`]: #method.as_ref-1
+ /// [`as_uninit_mut`]: #method.as_uninit_mut
+ ///
+ /// # Safety
+ ///
+ /// When calling this method, you have to ensure that *either* the pointer is NULL *or*
+ /// all of the following is true:
+ ///
+ /// * The pointer must be properly aligned.
+ ///
+ /// * It must be "dereferencable" in the sense defined in [the module documentation].
+ ///
+ /// * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is
+ /// arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
+ /// In particular, for the duration of this lifetime, the memory the pointer points to must
+ /// not get mutated (except inside `UnsafeCell`).
+ ///
+ /// This applies even if the result of this method is unused!
+ ///
+ /// [the module documentation]: crate::ptr#safety
+ ///
+ /// # Examples
+ ///
+ /// Basic usage:
+ ///
+ /// ```
+ /// #![feature(ptr_as_uninit)]
+ ///
+ /// let ptr: *mut u8 = &mut 10u8 as *mut u8;
+ ///
+ /// unsafe {
+ /// if let Some(val_back) = ptr.as_uninit_ref() {
+ /// println!("We got back the value: {}!", val_back.assume_init());
+ /// }
+ /// }
+ /// ```
+ #[inline]
+ #[unstable(feature = "ptr_as_uninit", issue = "75402")]
+ pub unsafe fn as_uninit_ref<'a>(self) -> Option<&'a MaybeUninit<T>>
+ where
+ T: Sized,
+ {
+ // SAFETY: the caller must guarantee that `self` meets all the
+ // requirements for a reference.
+ if self.is_null() { None } else { Some(unsafe { &*(self as *const MaybeUninit<T>) }) }
+ }
+
/// Calculates the offset from a pointer.
///
/// `count` is in units of T; e.g., a `count` of 3 represents a pointer
unsafe { intrinsics::arith_offset(self, count) as *mut T }
}
- /// Returns `None` if the pointer is null, or else returns a mutable
- /// reference to the value wrapped in `Some`.
+ /// Returns `None` if the pointer is null, or else returns a unique reference to
+ /// the value wrapped in `Some`. If the value may be uninitialized, [`as_uninit_mut`]
+ /// must be used instead.
///
- /// # Safety
+ /// For the shared counterpart see [`as_ref`].
+ ///
+ /// [`as_uninit_mut`]: #method.as_uninit_mut
+ /// [`as_ref`]: #method.as_ref-1
///
- /// As with [`as_ref`], this is unsafe because it cannot verify the validity
- /// of the returned pointer, nor can it ensure that the lifetime `'a`
- /// returned is indeed a valid lifetime for the contained data.
+ /// # Safety
///
/// When calling this method, you have to ensure that *either* the pointer is NULL *or*
/// all of the following is true:
- /// - it is properly aligned
- /// - it must point to an initialized instance of T; in particular, the pointer must be
- /// "dereferenceable" in the sense defined [here].
+ ///
+ /// * The pointer must be properly aligned.
+ ///
+ /// * It must be "dereferencable" in the sense defined in [the module documentation].
+ ///
+ /// * The pointer must point to an initialized instance of `T`.
+ ///
+ /// * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is
+ /// arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
+ /// In particular, for the duration of this lifetime, the memory the pointer points to must
+ /// not get accessed (read or written) through any other pointer.
///
/// This applies even if the result of this method is unused!
/// (The part about being initialized is not yet fully decided, but until
- /// it is the only safe approach is to ensure that they are indeed initialized.)
- ///
- /// Additionally, the lifetime `'a` returned is arbitrarily chosen and does
- /// not necessarily reflect the actual lifetime of the data. *You* must enforce
- /// Rust's aliasing rules. In particular, for the duration of this lifetime,
- /// the memory this pointer points to must not get accessed (read or written)
- /// through any other pointer.
+ /// it is, the only safe approach is to ensure that they are indeed initialized.)
///
- /// [here]: crate::ptr#safety
- /// [`as_ref`]: #method.as_ref
+ /// [the module documentation]: crate::ptr#safety
///
/// # Examples
///
/// let ptr: *mut u32 = s.as_mut_ptr();
/// let first_value = unsafe { ptr.as_mut().unwrap() };
/// *first_value = 4;
+ /// # assert_eq!(s, [4, 2, 3]);
/// println!("{:?}", s); // It'll print: "[4, 2, 3]".
/// ```
///
/// let ptr: *mut u32 = s.as_mut_ptr();
/// let first_value = unsafe { &mut *ptr };
/// *first_value = 4;
+ /// # assert_eq!(s, [4, 2, 3]);
/// println!("{:?}", s); // It'll print: "[4, 2, 3]".
/// ```
#[stable(feature = "ptr_as_ref", since = "1.9.0")]
if self.is_null() { None } else { unsafe { Some(&mut *self) } }
}
+ /// Returns `None` if the pointer is null, or else returns a unique reference to
+ /// the value wrapped in `Some`. In contrast to [`as_mut`], this does not require
+ /// that the value has to be initialized.
+ ///
+ /// For the shared counterpart see [`as_uninit_ref`].
+ ///
+ /// [`as_mut`]: #method.as_mut
+ /// [`as_uninit_ref`]: #method.as_uninit_ref-1
+ ///
+ /// # Safety
+ ///
+ /// When calling this method, you have to ensure that *either* the pointer is NULL *or*
+ /// all of the following is true:
+ ///
+ /// * The pointer must be properly aligned.
+ ///
+ /// * It must be "dereferencable" in the sense defined in [the module documentation].
+ ///
+ /// * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is
+ /// arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
+ /// In particular, for the duration of this lifetime, the memory the pointer points to must
+ /// not get accessed (read or written) through any other pointer.
+ ///
+ /// This applies even if the result of this method is unused!
+ ///
+ /// [the module documentation]: crate::ptr#safety
+ #[inline]
+ #[unstable(feature = "ptr_as_uninit", issue = "75402")]
+ pub unsafe fn as_uninit_mut<'a>(self) -> Option<&'a mut MaybeUninit<T>>
+ where
+ T: Sized,
+ {
+ // SAFETY: the caller must guarantee that `self` meets all the
+ // requirements for a reference.
+ if self.is_null() { None } else { Some(unsafe { &mut *(self as *mut MaybeUninit<T>) }) }
+ }
+
/// Returns whether two pointers are guaranteed to be equal.
///
/// At runtime this function behaves like `self == other`.
// SAFETY: the caller ensures that `self` is dereferencable and `index` in-bounds.
unsafe { index.get_unchecked_mut(self) }
}
+
+ /// Returns `None` if the pointer is null, or else returns a shared slice to
+ /// the value wrapped in `Some`. In contrast to [`as_ref`], this does not require
+ /// that the value has to be initialized.
+ ///
+ /// For the mutable counterpart see [`as_uninit_slice_mut`].
+ ///
+ /// [`as_ref`]: #method.as_ref-1
+ /// [`as_uninit_slice_mut`]: #method.as_uninit_slice_mut
+ ///
+ /// # Safety
+ ///
+ /// When calling this method, you have to ensure that *either* the pointer is NULL *or*
+ /// all of the following is true:
+ ///
+ /// * The pointer must be [valid] for reads for `ptr.len() * mem::size_of::<T>()` many bytes,
+ /// and it must be properly aligned. This means in particular:
+ ///
+ /// * The entire memory range of this slice must be contained within a single allocated object!
+ /// Slices can never span across multiple allocated objects.
+ ///
+ /// * The pointer must be aligned even for zero-length slices. One
+ /// reason for this is that enum layout optimizations may rely on references
+ /// (including slices of any length) being aligned and non-null to distinguish
+ /// them from other data. You can obtain a pointer that is usable as `data`
+ /// for zero-length slices using [`NonNull::dangling()`].
+ ///
+ /// * The total size `ptr.len() * mem::size_of::<T>()` of the slice must be no larger than `isize::MAX`.
+ /// See the safety documentation of [`pointer::offset`].
+ ///
+ /// * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is
+ /// arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
+ /// In particular, for the duration of this lifetime, the memory the pointer points to must
+ /// not get mutated (except inside `UnsafeCell`).
+ ///
+ /// This applies even if the result of this method is unused!
+ ///
+ /// See also [`slice::from_raw_parts`][].
+ ///
+ /// [valid]: crate::ptr#safety
+ /// [`NonNull::dangling()`]: NonNull::dangling
+ /// [`pointer::offset`]: ../std/primitive.pointer.html#method.offset
+ #[inline]
+ #[unstable(feature = "ptr_as_uninit", issue = "75402")]
+ pub unsafe fn as_uninit_slice<'a>(self) -> Option<&'a [MaybeUninit<T>]> {
+ if self.is_null() {
+ None
+ } else {
+ // SAFETY: the caller must uphold the safety contract for `as_uninit_slice`.
+ Some(unsafe { slice::from_raw_parts(self as *const MaybeUninit<T>, self.len()) })
+ }
+ }
+
+ /// Returns `None` if the pointer is null, or else returns a unique slice to
+ /// the value wrapped in `Some`. In contrast to [`as_mut`], this does not require
+ /// that the value has to be initialized.
+ ///
+ /// For the shared counterpart see [`as_uninit_slice`].
+ ///
+ /// [`as_mut`]: #method.as_mut
+ /// [`as_uninit_slice`]: #method.as_uninit_slice-1
+ ///
+ /// # Safety
+ ///
+ /// When calling this method, you have to ensure that *either* the pointer is NULL *or*
+ /// all of the following is true:
+ ///
+ /// * The pointer must be [valid] for reads and writes for `ptr.len() * mem::size_of::<T>()`
+ /// many bytes, and it must be properly aligned. This means in particular:
+ ///
+ /// * The entire memory range of this slice must be contained within a single allocated object!
+ /// Slices can never span across multiple allocated objects.
+ ///
+ /// * The pointer must be aligned even for zero-length slices. One
+ /// reason for this is that enum layout optimizations may rely on references
+ /// (including slices of any length) being aligned and non-null to distinguish
+ /// them from other data. You can obtain a pointer that is usable as `data`
+ /// for zero-length slices using [`NonNull::dangling()`].
+ ///
+ /// * The total size `ptr.len() * mem::size_of::<T>()` of the slice must be no larger than `isize::MAX`.
+ /// See the safety documentation of [`pointer::offset`].
+ ///
+ /// * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is
+ /// arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
+ /// In particular, for the duration of this lifetime, the memory the pointer points to must
+ /// not get accessed (read or written) through any other pointer.
+ ///
+ /// This applies even if the result of this method is unused!
+ ///
+ /// See also [`slice::from_raw_parts_mut`][].
+ ///
+ /// [valid]: crate::ptr#safety
+ /// [`NonNull::dangling()`]: NonNull::dangling
+ /// [`pointer::offset`]: ../std/primitive.pointer.html#method.offset
+ #[inline]
+ #[unstable(feature = "ptr_as_uninit", issue = "75402")]
+ pub unsafe fn as_uninit_slice_mut<'a>(self) -> Option<&'a mut [MaybeUninit<T>]> {
+ if self.is_null() {
+ None
+ } else {
+ // SAFETY: the caller must uphold the safety contract for `as_uninit_slice_mut`.
+ Some(unsafe { slice::from_raw_parts_mut(self as *mut MaybeUninit<T>, self.len()) })
+ }
+ }
}
// Equality for pointers
use crate::fmt;
use crate::hash;
use crate::marker::Unsize;
-use crate::mem;
+use crate::mem::{self, MaybeUninit};
use crate::ops::{CoerceUnsized, DispatchFromDyn};
use crate::ptr::Unique;
-use crate::slice::SliceIndex;
+use crate::slice::{self, SliceIndex};
/// `*mut T` but non-zero and covariant.
///
NonNull::new_unchecked(ptr)
}
}
+
+ /// Returns a shared references to the value. In contrast to [`as_ref`], this does not require
+ /// that the value has to be initialized.
+ ///
+ /// For the mutable counterpart see [`as_uninit_mut`].
+ ///
+ /// [`as_ref`]: #method.as_ref
+ /// [`as_uninit_mut`]: #method.as_uninit_mut
+ ///
+ /// # Safety
+ ///
+ /// When calling this method, you have to ensure that all of the following is true:
+ ///
+ /// * The pointer must be properly aligned.
+ ///
+ /// * It must be "dereferencable" in the sense defined in [the module documentation].
+ ///
+ /// * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is
+ /// arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
+ /// In particular, for the duration of this lifetime, the memory the pointer points to must
+ /// not get mutated (except inside `UnsafeCell`).
+ ///
+ /// This applies even if the result of this method is unused!
+ ///
+ /// [the module documentation]: crate::ptr#safety
+ #[inline]
+ #[unstable(feature = "ptr_as_uninit", issue = "75402")]
+ pub unsafe fn as_uninit_ref(&self) -> &MaybeUninit<T> {
+ // SAFETY: the caller must guarantee that `self` meets all the
+ // requirements for a reference.
+ unsafe { &*self.cast().as_ptr() }
+ }
+
+ /// Returns a unique references to the value. In contrast to [`as_mut`], this does not require
+ /// that the value has to be initialized.
+ ///
+ /// For the shared counterpart see [`as_uninit_ref`].
+ ///
+ /// [`as_mut`]: #method.as_mut
+ /// [`as_uninit_ref`]: #method.as_uninit_ref
+ ///
+ /// # Safety
+ ///
+ /// When calling this method, you have to ensure that all of the following is true:
+ ///
+ /// * The pointer must be properly aligned.
+ ///
+ /// * It must be "dereferencable" in the sense defined in [the module documentation].
+ ///
+ /// * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is
+ /// arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
+ /// In particular, for the duration of this lifetime, the memory the pointer points to must
+ /// not get accessed (read or written) through any other pointer.
+ ///
+ /// This applies even if the result of this method is unused!
+ ///
+ /// [the module documentation]: crate::ptr#safety
+ #[inline]
+ #[unstable(feature = "ptr_as_uninit", issue = "75402")]
+ pub unsafe fn as_uninit_mut(&mut self) -> &mut MaybeUninit<T> {
+ // SAFETY: the caller must guarantee that `self` meets all the
+ // requirements for a reference.
+ unsafe { &mut *self.cast().as_ptr() }
+ }
}
impl<T: ?Sized> NonNull<T> {
self.pointer as *mut T
}
- /// Dereferences the content.
+ /// Returns a shared reference to the value. If the value may be uninitialized, [`as_uninit_ref`]
+ /// must be used instead.
+ ///
+ /// For the mutable counterpart see [`as_mut`].
///
- /// The resulting lifetime is bound to self so this behaves "as if"
- /// it were actually an instance of T that is getting borrowed. If a longer
- /// (unbound) lifetime is needed, use `&*my_ptr.as_ptr()`.
+ /// [`as_uninit_ref`]: #method.as_uninit_ref
+ /// [`as_mut`]: #method.as_mut
///
/// # Safety
///
/// When calling this method, you have to ensure that all of the following is true:
- /// - `self` is properly aligned
- /// - `self` must point to an initialized instance of T; in particular, the pointer must be
- /// "dereferencable" in the sense defined [here].
+ ///
+ /// * The pointer must be properly aligned.
+ ///
+ /// * It must be "dereferencable" in the sense defined in [the module documentation].
+ ///
+ /// * The pointer must point to an initialized instance of `T`.
+ ///
+ /// * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is
+ /// arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
+ /// In particular, for the duration of this lifetime, the memory the pointer points to must
+ /// not get mutated (except inside `UnsafeCell`).
///
/// This applies even if the result of this method is unused!
/// (The part about being initialized is not yet fully decided, but until
/// it is, the only safe approach is to ensure that they are indeed initialized.)
///
- /// Additionally, the lifetime of `self` does not necessarily reflect the actual
- /// lifetime of the data. *You* must enforce Rust's aliasing rules. In particular,
- /// for the duration of this lifetime, the memory the pointer points to must not
- /// get mutated (except inside `UnsafeCell`).
- ///
- /// [here]: crate::ptr#safety
+ /// [the module documentation]: crate::ptr#safety
#[stable(feature = "nonnull", since = "1.25.0")]
#[inline]
pub unsafe fn as_ref(&self) -> &T {
unsafe { &*self.as_ptr() }
}
- /// Mutably dereferences the content.
+ /// Returns a unique reference to the value. If the value may be uninitialized, [`as_uninit_mut`]
+ /// must be used instead.
+ ///
+ /// For the shared counterpart see [`as_ref`].
///
- /// The resulting lifetime is bound to self so this behaves "as if"
- /// it were actually an instance of T that is getting borrowed. If a longer
- /// (unbound) lifetime is needed, use `&mut *my_ptr.as_ptr()`.
+ /// [`as_uninit_mut`]: #method.as_uninit_mut
+ /// [`as_ref`]: #method.as_ref
///
/// # Safety
///
/// When calling this method, you have to ensure that all of the following is true:
- /// - `self` is properly aligned
- /// - `self` must point to an initialized instance of T; in particular, the pointer must be
- /// "dereferenceable" in the sense defined [here].
+ ///
+ /// * The pointer must be properly aligned.
+ ///
+ /// * It must be "dereferencable" in the sense defined in [the module documentation].
+ ///
+ /// * The pointer must point to an initialized instance of `T`.
+ ///
+ /// * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is
+ /// arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
+ /// In particular, for the duration of this lifetime, the memory the pointer points to must
+ /// not get accessed (read or written) through any other pointer.
///
/// This applies even if the result of this method is unused!
/// (The part about being initialized is not yet fully decided, but until
- /// it is the only safe approach is to ensure that they are indeed initialized.)
- ///
- /// Additionally, the lifetime of `self` does not necessarily reflect the actual
- /// lifetime of the data. *You* must enforce Rust's aliasing rules. In particular,
- /// for the duration of this lifetime, the memory this pointer points to must not
- /// get accessed (read or written) through any other pointer.
+ /// it is, the only safe approach is to ensure that they are indeed initialized.)
///
- /// [here]: crate::ptr#safety
+ /// [the module documentation]: crate::ptr#safety
#[stable(feature = "nonnull", since = "1.25.0")]
#[inline]
pub unsafe fn as_mut(&mut self) -> &mut T {
self.as_non_null_ptr().as_ptr()
}
+ /// Returns a shared reference to a slice of possibly uninitialized values. In contrast to
+ /// [`as_ref`], this does not require that the value has to be initialized.
+ ///
+ /// For the mutable counterpart see [`as_uninit_slice_mut`].
+ ///
+ /// [`as_ref`]: #method.as_ref
+ /// [`as_uninit_slice_mut`]: #method.as_uninit_slice_mut
+ ///
+ /// # Safety
+ ///
+ /// When calling this method, you have to ensure that all of the following is true:
+ ///
+ /// * The pointer must be [valid] for reads for `ptr.len() * mem::size_of::<T>()` many bytes,
+ /// and it must be properly aligned. This means in particular:
+ ///
+ /// * The entire memory range of this slice must be contained within a single allocated object!
+ /// Slices can never span across multiple allocated objects.
+ ///
+ /// * The pointer must be aligned even for zero-length slices. One
+ /// reason for this is that enum layout optimizations may rely on references
+ /// (including slices of any length) being aligned and non-null to distinguish
+ /// them from other data. You can obtain a pointer that is usable as `data`
+ /// for zero-length slices using [`NonNull::dangling()`].
+ ///
+ /// * The total size `ptr.len() * mem::size_of::<T>()` of the slice must be no larger than `isize::MAX`.
+ /// See the safety documentation of [`pointer::offset`].
+ ///
+ /// * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is
+ /// arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
+ /// In particular, for the duration of this lifetime, the memory the pointer points to must
+ /// not get mutated (except inside `UnsafeCell`).
+ ///
+ /// This applies even if the result of this method is unused!
+ ///
+ /// See also [`slice::from_raw_parts`][].
+ ///
+ /// [valid]: crate::ptr#safety
+ /// [`NonNull::dangling()`]: NonNull::dangling
+ /// [`pointer::offset`]: ../../std/primitive.pointer.html#method.offset
+ #[inline]
+ #[unstable(feature = "ptr_as_uninit", issue = "75402")]
+ pub unsafe fn as_uninit_slice(&self) -> &[MaybeUninit<T>] {
+ // SAFETY: the caller must uphold the safety contract for `as_uninit_slice`.
+ unsafe { slice::from_raw_parts(self.cast().as_ptr(), self.len()) }
+ }
+
+ /// Returns a unique reference to a slice of possibly uninitialized values. In contrast to
+ /// [`as_mut`], this does not require that the value has to be initialized.
+ ///
+ /// For the shared counterpart see [`as_uninit_slice`].
+ ///
+ /// [`as_mut`]: #method.as_mut
+ /// [`as_uninit_slice`]: #method.as_uninit_slice
+ ///
+ /// # Safety
+ ///
+ /// When calling this method, you have to ensure that all of the following is true:
+ ///
+ /// * The pointer must be [valid] for reads and writes for `ptr.len() * mem::size_of::<T>()`
+ /// many bytes, and it must be properly aligned. This means in particular:
+ ///
+ /// * The entire memory range of this slice must be contained within a single allocated object!
+ /// Slices can never span across multiple allocated objects.
+ ///
+ /// * The pointer must be aligned even for zero-length slices. One
+ /// reason for this is that enum layout optimizations may rely on references
+ /// (including slices of any length) being aligned and non-null to distinguish
+ /// them from other data. You can obtain a pointer that is usable as `data`
+ /// for zero-length slices using [`NonNull::dangling()`].
+ ///
+ /// * The total size `ptr.len() * mem::size_of::<T>()` of the slice must be no larger than `isize::MAX`.
+ /// See the safety documentation of [`pointer::offset`].
+ ///
+ /// * You must enforce Rust's aliasing rules, since the returned lifetime `'a` is
+ /// arbitrarily chosen and does not necessarily reflect the actual lifetime of the data.
+ /// In particular, for the duration of this lifetime, the memory the pointer points to must
+ /// not get accessed (read or written) through any other pointer.
+ ///
+ /// This applies even if the result of this method is unused!
+ ///
+ /// See also [`slice::from_raw_parts_mut`][].
+ ///
+ /// [valid]: crate::ptr#safety
+ /// [`NonNull::dangling()`]: NonNull::dangling
+ /// [`pointer::offset`]: ../../std/primitive.pointer.html#method.offset
+ ///
+ /// # Examples
+ ///
+ /// ```rust
+ /// #![feature(allocator_api, ptr_as_uninit)]
+ ///
+ /// use std::alloc::{AllocRef, Layout, Global};
+ /// use std::mem::MaybeUninit;
+ /// use std::ptr::NonNull;
+ ///
+ /// let memory: NonNull<[u8]> = Global.alloc(Layout::new::<[u8; 32]>())?;
+ /// // This is safe as `memory` is valid for reads and writes for `memory.len()` many bytes.
+ /// // Note that calling `memory.as_mut()` is not allowed here as the content may be uninitialized.
+ /// # #[allow(unused_variables)]
+ /// let slice: &mut [MaybeUninit<u8>] = unsafe { memory.as_uninit_slice_mut() };
+ /// # Ok::<_, std::alloc::AllocErr>(())
+ /// ```
+ #[inline]
+ #[unstable(feature = "ptr_as_uninit", issue = "75402")]
+ pub unsafe fn as_uninit_slice_mut(&self) -> &mut [MaybeUninit<T>] {
+ // SAFETY: the caller must uphold the safety contract for `as_uninit_slice_mut`.
+ unsafe { slice::from_raw_parts_mut(self.cast().as_ptr(), self.len()) }
+ }
+
/// Returns a raw pointer to an element or subslice, without doing bounds
/// checking.
///
#[stable(feature = "rust1", since = "1.0.0")]
pub enum Result<T, E> {
/// Contains the success value
+ #[cfg_attr(not(bootstrap), lang = "Ok")]
#[stable(feature = "rust1", since = "1.0.0")]
Ok(#[stable(feature = "rust1", since = "1.0.0")] T),
/// Contains the error value
+ #[cfg_attr(not(bootstrap), lang = "Err")]
#[stable(feature = "rust1", since = "1.0.0")]
Err(#[stable(feature = "rust1", since = "1.0.0")] E),
}
/// # Panics
///
/// Panics if `begin` does not point to the starting byte offset of
- /// a character (as defined by `is_char_boundary`), or if `begin >= len`.
+ /// a character (as defined by `is_char_boundary`), or if `begin > len`.
#[stable(feature = "str_checked_slicing", since = "1.20.0")]
unsafe impl SliceIndex<str> for ops::RangeFrom<usize> {
type Output = str;
#[stable(feature = "futures_api", since = "1.36.0")]
pub enum Poll<T> {
/// Represents that a value is immediately ready.
+ #[cfg_attr(not(bootstrap), lang = "Ready")]
#[stable(feature = "futures_api", since = "1.36.0")]
Ready(#[stable(feature = "futures_api", since = "1.36.0")] T),
/// When a function returns `Pending`, the function *must* also
/// ensure that the current task is scheduled to be awoken when
/// progress can be made.
+ #[cfg_attr(not(bootstrap), lang = "Pending")]
#[stable(feature = "futures_api", since = "1.36.0")]
Pending,
}
//! like `cdylib`s and `staticlib`s are guaranteed to use the [`System`] by
//! default.
//!
-//! [`System`]: struct.System.html
-//!
//! # The `#[global_allocator]` attribute
//!
//! This attribute allows configuring the choice of global allocator.
//! The attribute is used on a `static` item whose type implements the
//! [`GlobalAlloc`] trait. This type can be provided by an external library:
//!
-//! [`GlobalAlloc`]: ../../core/alloc/trait.GlobalAlloc.html
-//!
//! ```rust,ignore (demonstrates crates.io usage)
//! extern crate jemallocator;
//!
#[derive(Debug, Default, Copy, Clone)]
pub struct System;
+impl System {
+ #[inline]
+ fn alloc_impl(&mut self, layout: Layout, zeroed: bool) -> Result<NonNull<[u8]>, AllocErr> {
+ match layout.size() {
+ 0 => Ok(NonNull::slice_from_raw_parts(layout.dangling(), 0)),
+ // SAFETY: `layout` is non-zero in size,
+ size => unsafe {
+ let raw_ptr = if zeroed {
+ GlobalAlloc::alloc_zeroed(self, layout)
+ } else {
+ GlobalAlloc::alloc(self, layout)
+ };
+ let ptr = NonNull::new(raw_ptr).ok_or(AllocErr)?;
+ Ok(NonNull::slice_from_raw_parts(ptr, size))
+ },
+ }
+ }
+
+ // Safety: Same as `AllocRef::grow`
+ #[inline]
+ unsafe fn grow_impl(
+ &mut self,
+ ptr: NonNull<u8>,
+ layout: Layout,
+ new_size: usize,
+ zeroed: bool,
+ ) -> Result<NonNull<[u8]>, AllocErr> {
+ debug_assert!(
+ new_size >= layout.size(),
+ "`new_size` must be greater than or equal to `layout.size()`"
+ );
+
+ match layout.size() {
+ // SAFETY: the caller must ensure that the `new_size` does not overflow.
+ // `layout.align()` comes from a `Layout` and is thus guaranteed to be valid for a Layout.
+ 0 => unsafe {
+ let new_layout = Layout::from_size_align_unchecked(new_size, layout.align());
+ self.alloc_impl(new_layout, zeroed)
+ },
+
+ // SAFETY: `new_size` is non-zero as `old_size` is greater than or equal to `new_size`
+ // as required by safety conditions. Other conditions must be upheld by the caller
+ old_size => unsafe {
+ // `realloc` probably checks for `new_size >= size` or something similar.
+ intrinsics::assume(new_size >= layout.size());
+
+ let raw_ptr = GlobalAlloc::realloc(self, ptr.as_ptr(), layout, new_size);
+ let ptr = NonNull::new(raw_ptr).ok_or(AllocErr)?;
+ if zeroed {
+ raw_ptr.add(old_size).write_bytes(0, new_size - old_size);
+ }
+ Ok(NonNull::slice_from_raw_parts(ptr, new_size))
+ },
+ }
+ }
+}
+
// The AllocRef impl checks the layout size to be non-zero and forwards to the GlobalAlloc impl,
// which is in `std::sys::*::alloc`.
#[unstable(feature = "allocator_api", issue = "32838")]
unsafe impl AllocRef for System {
#[inline]
fn alloc(&mut self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr> {
- let size = layout.size();
- let ptr = if size == 0 {
- layout.dangling()
- } else {
- // SAFETY: `layout` is non-zero in size,
- unsafe { NonNull::new(GlobalAlloc::alloc(&System, layout)).ok_or(AllocErr)? }
- };
- Ok(NonNull::slice_from_raw_parts(ptr, size))
+ self.alloc_impl(layout, false)
}
#[inline]
fn alloc_zeroed(&mut self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr> {
- let size = layout.size();
- let ptr = if size == 0 {
- layout.dangling()
- } else {
- // SAFETY: `layout` is non-zero in size,
- unsafe { NonNull::new(GlobalAlloc::alloc_zeroed(&System, layout)).ok_or(AllocErr)? }
- };
- Ok(NonNull::slice_from_raw_parts(ptr, size))
+ self.alloc_impl(layout, true)
}
#[inline]
if layout.size() != 0 {
// SAFETY: `layout` is non-zero in size,
// other conditions must be upheld by the caller
- unsafe { GlobalAlloc::dealloc(&System, ptr.as_ptr(), layout) }
+ unsafe { GlobalAlloc::dealloc(self, ptr.as_ptr(), layout) }
}
}
layout: Layout,
new_size: usize,
) -> Result<NonNull<[u8]>, AllocErr> {
- debug_assert!(
- new_size >= layout.size(),
- "`new_size` must be greater than or equal to `layout.size()`"
- );
-
- // SAFETY: `new_size` must be non-zero, which is checked in the match expression.
- // Other conditions must be upheld by the caller
- unsafe {
- match layout.size() {
- old_size if old_size == new_size => {
- Ok(NonNull::slice_from_raw_parts(ptr, new_size))
- }
- 0 => self.alloc(Layout::from_size_align_unchecked(new_size, layout.align())),
- old_size => {
- // `realloc` probably checks for `new_size > size` or something similar.
- intrinsics::assume(new_size > old_size);
- let raw_ptr = GlobalAlloc::realloc(&System, ptr.as_ptr(), layout, new_size);
- let ptr = NonNull::new(raw_ptr).ok_or(AllocErr)?;
- Ok(NonNull::slice_from_raw_parts(ptr, new_size))
- }
- }
- }
+ // SAFETY: all conditions must be upheld by the caller
+ unsafe { self.grow_impl(ptr, layout, new_size, false) }
}
#[inline]
layout: Layout,
new_size: usize,
) -> Result<NonNull<[u8]>, AllocErr> {
- debug_assert!(
- new_size >= layout.size(),
- "`new_size` must be greater than or equal to `layout.size()`"
- );
-
- // SAFETY: `new_size` must be non-zero, which is checked in the match expression.
- // Other conditions must be upheld by the caller
- unsafe {
- match layout.size() {
- old_size if old_size == new_size => {
- Ok(NonNull::slice_from_raw_parts(ptr, new_size))
- }
- 0 => self.alloc_zeroed(Layout::from_size_align_unchecked(new_size, layout.align())),
- old_size => {
- // `realloc` probably checks for `new_size > size` or something similar.
- intrinsics::assume(new_size > old_size);
- let raw_ptr = GlobalAlloc::realloc(&System, ptr.as_ptr(), layout, new_size);
- raw_ptr.add(old_size).write_bytes(0, new_size - old_size);
- let ptr = NonNull::new(raw_ptr).ok_or(AllocErr)?;
- Ok(NonNull::slice_from_raw_parts(ptr, new_size))
- }
- }
- }
+ // SAFETY: all conditions must be upheld by the caller
+ unsafe { self.grow_impl(ptr, layout, new_size, true) }
}
#[inline]
layout: Layout,
new_size: usize,
) -> Result<NonNull<[u8]>, AllocErr> {
- let old_size = layout.size();
debug_assert!(
- new_size <= old_size,
+ new_size <= layout.size(),
"`new_size` must be smaller than or equal to `layout.size()`"
);
- let ptr = if new_size == old_size {
- ptr
- } else if new_size == 0 {
- // SAFETY: `layout` is non-zero in size as `old_size` != `new_size`
- // Other conditions must be upheld by the caller
- unsafe {
+ match new_size {
+ // SAFETY: conditions must be upheld by the caller
+ 0 => unsafe {
self.dealloc(ptr, layout);
- }
- layout.dangling()
- } else {
- // SAFETY: new_size is not zero,
- // Other conditions must be upheld by the caller
- let raw_ptr = unsafe {
- // `realloc` probably checks for `new_size < old_size` or something similar.
- intrinsics::assume(new_size < old_size);
- GlobalAlloc::realloc(&System, ptr.as_ptr(), layout, new_size)
- };
- NonNull::new(raw_ptr).ok_or(AllocErr)?
- };
+ Ok(NonNull::slice_from_raw_parts(layout.dangling(), 0))
+ },
+
+ // SAFETY: `new_size` is non-zero. Other conditions must be upheld by the caller
+ new_size => unsafe {
+ // `realloc` probably checks for `new_size <= size` or something similar.
+ intrinsics::assume(new_size <= layout.size());
- Ok(NonNull::slice_from_raw_parts(ptr, new_size))
+ let raw_ptr = GlobalAlloc::realloc(self, ptr.as_ptr(), layout, new_size);
+ let ptr = NonNull::new(raw_ptr).ok_or(AllocErr)?;
+ Ok(NonNull::slice_from_raw_parts(ptr, new_size))
+ },
+ }
}
}
+
static HOOK: AtomicPtr<()> = AtomicPtr::new(ptr::null_mut());
/// Registers a custom allocation error hook, replacing any that was previously registered.
/// about the allocation that failed.
///
/// The allocation error hook is a global resource.
-///
-/// [`set_alloc_error_hook`]: fn.set_alloc_error_hook.html
-/// [`take_alloc_error_hook`]: fn.take_alloc_error_hook.html
#[unstable(feature = "alloc_error_hook", issue = "51245")]
pub fn set_alloc_error_hook(hook: fn(Layout)) {
HOOK.store(hook as *mut (), Ordering::SeqCst);
/// *See also the function [`set_alloc_error_hook`].*
///
/// If no custom hook is registered, the default hook will be returned.
-///
-/// [`set_alloc_error_hook`]: fn.set_alloc_error_hook.html
#[unstable(feature = "alloc_error_hook", issue = "51245")]
pub fn take_alloc_error_hook() -> fn(Layout) {
let hook = HOOK.swap(ptr::null_mut(), Ordering::SeqCst);
//!
//! The [`escape_default`] function provides an iterator over the bytes of an
//! escaped version of the character given.
-//!
-//! [`AsciiExt`]: trait.AsciiExt.html
-//! [`escape_default`]: fn.escape_default.html
#![stable(feature = "rust1", since = "1.0.0")]
///
/// # Note
///
- /// This method will be deprecated in favor of the identically-named
+ /// This method is deprecated in favor of the identically-named
/// inherent methods on `u8`, `char`, `[u8]` and `str`.
#[stable(feature = "rust1", since = "1.0.0")]
fn is_ascii(&self) -> bool;
///
/// # Note
///
- /// This method will be deprecated in favor of the identically-named
+ /// This method is deprecated in favor of the identically-named
/// inherent methods on `u8`, `char`, `[u8]` and `str`.
///
- /// [`make_ascii_uppercase`]: #tymethod.make_ascii_uppercase
+ /// [`make_ascii_uppercase`]: AsciiExt::make_ascii_uppercase
/// [`str::to_uppercase`]: ../primitive.str.html#method.to_uppercase
#[stable(feature = "rust1", since = "1.0.0")]
#[allow(deprecated)]
///
/// # Note
///
- /// This method will be deprecated in favor of the identically-named
+ /// This method is deprecated in favor of the identically-named
/// inherent methods on `u8`, `char`, `[u8]` and `str`.
///
- /// [`make_ascii_lowercase`]: #tymethod.make_ascii_lowercase
+ /// [`make_ascii_lowercase`]: AsciiExt::make_ascii_lowercase
/// [`str::to_lowercase`]: ../primitive.str.html#method.to_lowercase
#[stable(feature = "rust1", since = "1.0.0")]
#[allow(deprecated)]
///
/// # Note
///
- /// This method will be deprecated in favor of the identically-named
+ /// This method is deprecated in favor of the identically-named
/// inherent methods on `u8`, `char`, `[u8]` and `str`.
#[stable(feature = "rust1", since = "1.0.0")]
fn eq_ignore_ascii_case(&self, other: &Self) -> bool;
///
/// # Note
///
- /// This method will be deprecated in favor of the identically-named
+ /// This method is deprecated in favor of the identically-named
/// inherent methods on `u8`, `char`, `[u8]` and `str`.
///
- /// [`to_ascii_uppercase`]: #tymethod.to_ascii_uppercase
+ /// [`to_ascii_uppercase`]: AsciiExt::to_ascii_uppercase
#[stable(feature = "ascii", since = "1.9.0")]
fn make_ascii_uppercase(&mut self);
///
/// # Note
///
- /// This method will be deprecated in favor of the identically-named
+ /// This method is deprecated in favor of the identically-named
/// inherent methods on `u8`, `char`, `[u8]` and `str`.
///
- /// [`to_ascii_lowercase`]: #tymethod.to_ascii_lowercase
+ /// [`to_ascii_lowercase`]: AsciiExt::to_ascii_lowercase
#[stable(feature = "ascii", since = "1.9.0")]
fn make_ascii_lowercase(&mut self);
}
//! There are several functions and structs in this module that have a
//! counterpart ending in `os`. Those ending in `os` will return an [`OsString`]
//! and those without will return a [`String`].
-//!
-//! [`OsString`]: ../../std/ffi/struct.OsString.html
-//! [`String`]: ../string/struct.String.html
#![stable(feature = "env", since = "1.0.0")]
/// * Current directory does not exist.
/// * There are insufficient permissions to access the current directory.
///
-/// [`PathBuf`]: ../../std/path/struct.PathBuf.html
-/// [`Err`]: ../../std/result/enum.Result.html#method.err
-///
/// # Examples
///
/// ```
///
/// Returns an [`Err`] if the operation fails.
///
-/// [`Err`]: ../../std/result/enum.Result.html#method.err
-///
/// # Examples
///
/// ```
/// This structure is created by the [`std::env::vars`] function. See its
/// documentation for more.
///
-/// [`std::env::vars`]: fn.vars.html
+/// [`std::env::vars`]: vars
#[stable(feature = "env", since = "1.0.0")]
pub struct Vars {
inner: VarsOs,
/// This structure is created by the [`std::env::vars_os`] function. See
/// its documentation for more.
///
-/// [`std::env::vars_os`]: fn.vars_os.html
+/// [`std::env::vars_os`]: vars_os
#[stable(feature = "env", since = "1.0.0")]
pub struct VarsOs {
inner: os_imp::Env,
/// environment is not valid unicode. If this is not desired, consider using the
/// [`env::vars_os`] function.
///
-/// [`env::vars_os`]: fn.vars_os.html
+/// [`env::vars_os`]: vars_os
///
/// # Examples
///
/// Fetches the environment variable `key` from the current process, returning
/// [`None`] if the variable isn't set.
///
-/// [`None`]: ../option/enum.Option.html#variant.None
-///
/// # Panics
///
/// This function may panic if `key` is empty, contains an ASCII equals sign
/// The error type for operations interacting with environment variables.
/// Possibly returned from the [`env::var`] function.
///
-/// [`env::var`]: fn.var.html
+/// [`env::var`]: var
#[derive(Debug, PartialEq, Eq, Clone)]
#[stable(feature = "env", since = "1.0.0")]
pub enum VarError {
/// This structure is created by the [`std::env::split_paths`] function. See its
/// documentation for more.
///
-/// [`PathBuf`]: ../../std/path/struct.PathBuf.html
-/// [`std::env::split_paths`]: fn.split_paths.html
+/// [`std::env::split_paths`]: split_paths
#[stable(feature = "env", since = "1.0.0")]
pub struct SplitPaths<'a> {
inner: os_imp::SplitPaths<'a>,
/// None => println!("{} is not defined in the environment.", key)
/// }
/// ```
-///
-/// [`PathBuf`]: ../../std/path/struct.PathBuf.html
#[stable(feature = "env", since = "1.0.0")]
pub fn split_paths<T: AsRef<OsStr> + ?Sized>(unparsed: &T) -> SplitPaths<'_> {
SplitPaths { inner: os_imp::split_paths(unparsed.as_ref()) }
/// The error type for operations on the `PATH` variable. Possibly returned from
/// the [`env::join_paths`] function.
///
-/// [`env::join_paths`]: fn.join_paths.html
+/// [`env::join_paths`]: join_paths
#[derive(Debug)]
#[stable(feature = "env", since = "1.0.0")]
pub struct JoinPathsError {
///
/// # Errors
///
-/// Returns an [`Err`][err] (containing an error message) if one of the input
+/// Returns an [`Err`] (containing an error message) if one of the input
/// [`Path`]s contains an invalid character for constructing the `PATH`
/// variable (a double quote on Windows or a colon on Unix).
///
-/// [`Path`]: ../../std/path/struct.Path.html
-/// [`OsString`]: ../../std/ffi/struct.OsString.html
-/// [err]: ../../std/result/enum.Result.html#variant.Err
-///
/// # Examples
///
/// Joining paths on a Unix-like platform:
/// }
/// ```
///
-/// [`env::split_paths`]: fn.split_paths.html
+/// [`env::split_paths`]: split_paths
#[stable(feature = "env", since = "1.0.0")]
pub fn join_paths<I, T>(paths: I) -> Result<OsString, JoinPathsError>
where
/// set to arbitrary text, and may not even exist. This means this property
/// should not be relied upon for security purposes.
///
-/// [`String`]: ../string/struct.String.html
-/// [`std::env::args`]: ./fn.args.html
+/// [`std::env::args`]: args
#[stable(feature = "env", since = "1.0.0")]
pub struct Args {
inner: ArgsOs,
/// set to arbitrary text, and may not even exist. This means this property
/// should not be relied upon for security purposes.
///
-/// [`OsString`]: ../ffi/struct.OsString.html
-/// [`std::env::args_os`]: ./fn.args_os.html
+/// [`std::env::args_os`]: args_os
#[stable(feature = "env", since = "1.0.0")]
pub struct ArgsOs {
inner: sys::args::Args,
/// println!("{}", argument);
/// }
/// ```
-///
-/// [`args_os`]: ./fn.args_os.html
#[stable(feature = "env", since = "1.0.0")]
pub fn args() -> Args {
Args { inner: args_os() }
/// provide its own errors while also revealing some of the implementation for
/// debugging via [`source`] chains.
///
-/// [`Result<T, E>`]: ../result/enum.Result.html
-/// [`Display`]: ../fmt/trait.Display.html
-/// [`Debug`]: ../fmt/trait.Debug.html
-/// [`source`]: trait.Error.html#method.source
+/// [`Result<T, E>`]: Result
+/// [`source`]: Error::source
#[stable(feature = "rust1", since = "1.0.0")]
pub trait Error: Debug + Display {
/// The lower-level source of this error, if any.
impl<'a, E: Error + 'a> From<E> for Box<dyn Error + 'a> {
/// Converts a type of [`Error`] into a box of dyn [`Error`].
///
- /// [`Error`]: ../error/trait.Error.html
- ///
/// # Examples
///
/// ```
/// Converts a type of [`Error`] + [`Send`] + [`Sync`] into a box of
/// dyn [`Error`] + [`Send`] + [`Sync`].
///
- /// [`Error`]: ../error/trait.Error.html
- ///
/// # Examples
///
/// ```
impl From<String> for Box<dyn Error + Send + Sync> {
/// Converts a [`String`] into a box of dyn [`Error`] + [`Send`] + [`Sync`].
///
- /// [`Error`]: ../error/trait.Error.html
- ///
/// # Examples
///
/// ```
impl From<String> for Box<dyn Error> {
/// Converts a [`String`] into a box of dyn [`Error`].
///
- /// [`Error`]: ../error/trait.Error.html
- ///
/// # Examples
///
/// ```
impl<'a> From<&str> for Box<dyn Error + Send + Sync + 'a> {
/// Converts a [`str`] into a box of dyn [`Error`] + [`Send`] + [`Sync`].
///
- /// [`Error`]: ../error/trait.Error.html
- ///
/// # Examples
///
/// ```
impl From<&str> for Box<dyn Error> {
/// Converts a [`str`] into a box of dyn [`Error`].
///
- /// [`Error`]: ../error/trait.Error.html
- ///
/// # Examples
///
/// ```
impl<'a, 'b> From<Cow<'b, str>> for Box<dyn Error + Send + Sync + 'a> {
/// Converts a [`Cow`] into a box of dyn [`Error`] + [`Send`] + [`Sync`].
///
- /// [`Cow`]: ../borrow/enum.Cow.html
- /// [`Error`]: ../error/trait.Error.html
- ///
/// # Examples
///
/// ```
impl<'a> From<Cow<'a, str>> for Box<dyn Error> {
/// Converts a [`Cow`] into a box of dyn [`Error`].
///
- /// [`Cow`]: ../borrow/enum.Cow.html
- /// [`Error`]: ../error/trait.Error.html
- ///
/// # Examples
///
/// ```
/// assert!(iter.next().is_none());
/// ```
///
- /// [`source`]: trait.Error.html#method.source
+ /// [`source`]: Error::source
#[unstable(feature = "error_iter", issue = "58520")]
#[inline]
pub fn chain(&self) -> Chain<'_> {
///
/// If you want to omit the initial error and only process
/// its sources, use `skip(1)`.
-///
-/// [`Error`]: trait.Error.html
#[unstable(feature = "error_iter", issue = "58520")]
#[derive(Clone, Debug)]
pub struct Chain<'a> {
/// [Reference on "break expression"]: ../reference/expressions/loop-expr.html#break-expressions
/// [Reference on "break and loop values"]:
/// ../reference/expressions/loop-expr.html#break-and-loop-values
-///
mod break_keyword {}
#[doc(keyword = "const")]
/// For more information, take a look at the [Rust Book] or the [Reference]
///
/// [ADT]: https://en.wikipedia.org/wiki/Algebraic_data_type
-/// [`Option`]: option/enum.Option.html
/// [Rust Book]: ../book/ch06-01-defining-an-enum.html
/// [Reference]: ../reference/items/enumerations.html
mod enum_keyword {}
/// [`in`]: keyword.in.html
/// [`impl`]: keyword.impl.html
/// [higher-ranked trait bounds]: ../reference/trait-bounds.html#higher-ranked-trait-bounds
-/// [`IntoIterator`]: iter/trait.IntoIterator.html
/// [Rust book]:
/// ../book/ch03-05-control-flow.html#looping-through-a-collection-with-for
/// [Reference]: ../reference/expressions/loop-expr.html#iterator-loops
/// For more information on the `move` keyword, see the [closure]'s section
/// of the Rust book or the [threads] section
///
-/// [`Fn` trait]: ../std/ops/trait.Fn.html
/// [closure]: ../book/ch13-01-closures.html
/// [threads]: ../book/ch16-01-threads.html#using-move-closures-with-threads
mod move_keyword {}
/// [`extern`]: keyword.extern.html
/// [`mut`]: keyword.mut.html
/// [`unsafe`]: keyword.unsafe.html
-/// [`drop`]: mem/fn.drop.html
-/// [`Sync`]: marker/trait.Sync.html
-/// [`RefCell`]: cell/struct.RefCell.html
+/// [`RefCell`]: cell::RefCell
/// [Reference]: ../reference/items/static-items.html
mod static_keyword {}
/// For more information on structs, take a look at the [Rust Book][book] or the
/// [Reference][reference].
///
-/// [`PhantomData`]: marker/struct.PhantomData.html
+/// [`PhantomData`]: marker::PhantomData
/// [book]: ../book/ch05-01-defining-structs.html
/// [reference]: ../reference/items/structs.html
mod struct_keyword {}
/// [`for`]: keyword.for.html
/// [`impl`]: keyword.impl.html
/// [`unsafe`]: keyword.unsafe.html
-/// [`Send`]: marker/trait.Send.html
-/// [`Sync`]: marker/trait.Sync.html
/// [Ref-Traits]: ../reference/items/traits.html
/// [Ref-Trait-Objects]: ../reference/types/trait-object.html
mod trait_keyword {}
/// [`while`]: keyword.while.html
/// [`match`]: ../reference/expressions/match-expr.html#match-guards
/// [`false`]: keyword.false.html
-/// [`bool`]: primitive.bool.html
mod true_keyword {}
#[doc(keyword = "type")]
/// [`static`]: keyword.static.html
/// [`union`]: keyword.union.html
/// [`impl`]: keyword.impl.html
-/// [Send]: marker/trait.Send.html
-/// [Sync]: marker/trait.Sync.html
-/// [`Vec::set_len`]: vec/struct.Vec.html#method.set_len
/// [raw pointers]: ../reference/types/pointer.html
/// [memory safety]: ../book/ch19-01-unsafe-rust.html
/// [Rustnomicon]: ../nomicon/index.html
///
/// It is available for use in stable rust from version 1.39 onwards.
///
-/// [`Future`]: ./future/trait.Future.html
+/// [`Future`]: future::Future
/// [async book]: https://rust-lang.github.io/async-book/
mod async_keyword {}
///
/// It is available for use in stable rust from version 1.39 onwards.
///
-/// [`Future`]: ./future/trait.Future.html
+/// [`Future`]: future::Future
/// [async book]: https://rust-lang.github.io/async-book/
mod await_keyword {}
/// purpose of this trait is to encode what types are safe to cross a [`catch_unwind`]
/// boundary with no fear of unwind safety.
///
-/// [`Send`]: ../marker/trait.Send.html
-/// [`Sync`]: ../marker/trait.Sync.html
-/// [`catch_unwind`]: ./fn.catch_unwind.html
-///
/// ## What is unwind safety?
///
/// In Rust a function can "return" early if it either panics or calls a
/// above, the lack of `unsafe` means it is mostly an advisory. The
/// [`AssertUnwindSafe`] wrapper struct can be used to force this trait to be
/// implemented for any closed over variables passed to `catch_unwind`.
-///
-/// [`AssertUnwindSafe`]: ./struct.AssertUnwindSafe.html
#[stable(feature = "catch_unwind", since = "1.9.0")]
#[rustc_on_unimplemented(
message = "the type `{Self}` may not be safely transferred across an unwind boundary",
///
/// This is a "helper marker trait" used to provide impl blocks for the
/// [`UnwindSafe`] trait, for more information see that documentation.
-///
-/// [`UnsafeCell`]: ../cell/struct.UnsafeCell.html
-/// [`UnwindSafe`]: ./trait.UnwindSafe.html
#[stable(feature = "catch_unwind", since = "1.9.0")]
#[rustc_on_unimplemented(
message = "the type `{Self}` may contain interior mutability and a reference may not be safely \
/// account. This wrapper struct is useful for a quick and lightweight
/// annotation that a variable is indeed unwind safe.
///
-/// [`catch_unwind`]: ./fn.catch_unwind.html
/// # Examples
///
/// One way to use `AssertUnwindSafe` is to assert that the entire closure
/// can fail on a regular basis. Additionally, this function is not guaranteed
/// to catch all panics, see the "Notes" section below.
///
-/// [`Result`]: ../result/enum.Result.html
-///
/// The closure provided is required to adhere to the [`UnwindSafe`] trait to ensure
/// that all captured variables are safe to cross this boundary. The purpose of
/// this bound is to encode the concept of [exception safety][rfc] in the type
/// becomes a problem the [`AssertUnwindSafe`] wrapper struct can be used to quickly
/// assert that the usage here is indeed unwind safe.
///
-/// [`AssertUnwindSafe`]: ./struct.AssertUnwindSafe.html
-/// [`UnwindSafe`]: ./trait.UnwindSafe.html
-///
/// [rfc]: https://github.com/rust-lang/rfcs/blob/master/text/1236-stabilize-catch-panic.md
///
/// # Notes
/// This is designed to be used in conjunction with [`catch_unwind`] to, for
/// example, carry a panic across a layer of C code.
///
-/// [`catch_unwind`]: ./fn.catch_unwind.html
-///
/// # Notes
///
/// Note that panics in Rust are not always implemented via unwinding, but they
}
}
cfg.define("CMAKE_C_COMPILER", sanitize_cc(cc))
- .define("CMAKE_CXX_COMPILER", sanitize_cc(cxx));
+ .define("CMAKE_CXX_COMPILER", sanitize_cc(cxx))
+ .define("CMAKE_ASM_COMPILER", sanitize_cc(cc));
}
cfg.build_arg("-j").build_arg(builder.jobs().to_string());
= note: for more information, see issue #36887 <https://github.com/rust-lang/rust/issues/36887>
```
-## missing-fragment-specifier
-
-The missing_fragment_specifier warning is issued when an unused pattern in a
-`macro_rules!` macro definition has a meta-variable (e.g. `$e`) that is not
-followed by a fragment specifier (e.g. `:expr`).
-
-This warning can always be fixed by removing the unused pattern in the
-`macro_rules!` macro definition.
-
## mutable-transmutes
This lint catches transmuting from `&T` to `&mut T` because it is undefined
`thumbv4t-none-eabi` | * | | ARMv4T T32
`x86_64-apple-ios-macabi` | ✓[^apple] | | Apple Catalyst
`x86_64-apple-tvos` | *[^apple] | | x86 64-bit tvOS
-`x86_64-linux-kernel` | ? | | Linux kernel modules
+`x86_64-linux-kernel` | * | | Linux kernel modules
`x86_64-pc-solaris` | ? | |
`x86_64-pc-windows-msvc` | ✓ | | 64-bit Windows XP support
`x86_64-unknown-cloudabi` | ✓ | | 64-bit CloudABI
pub mod tokenstream;
pub mod visit;
+pub use self::ast::*;
+
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
/// Requirements for a `StableHashingContext` to be used in this crate.
use super::{ImplTraitContext, LoweringContext, ParamMode, ParenthesizedGenericArgs};
-use rustc_ast::ast::*;
use rustc_ast::attr;
use rustc_ast::ptr::P as AstP;
+use rustc_ast::*;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stack::ensure_sufficient_stack;
use rustc_data_structures::thin_vec::ThinVec;
// `::std::ops::Try::from_ok($tail_expr)`
block.expr = Some(this.wrap_in_try_constructor(
- sym::from_ok,
+ hir::LangItem::TryFromOk,
try_span,
tail_expr,
ok_wrapped_span,
fn wrap_in_try_constructor(
&mut self,
- method: Symbol,
+ lang_item: hir::LangItem,
method_span: Span,
expr: &'hir hir::Expr<'hir>,
overall_span: Span,
) -> &'hir hir::Expr<'hir> {
- let path = &[sym::ops, sym::Try, method];
let constructor =
- self.arena.alloc(self.expr_std_path(method_span, path, None, ThinVec::new()));
+ self.arena.alloc(self.expr_lang_item_path(method_span, lang_item, ThinVec::new()));
self.expr_call(overall_span, constructor, std::slice::from_ref(expr))
}
// `future::from_generator`:
let unstable_span =
self.mark_span_with_reason(DesugaringKind::Async, span, self.allow_gen_future.clone());
- let gen_future = self.expr_std_path(
- unstable_span,
- &[sym::future, sym::from_generator],
- None,
- ThinVec::new(),
- );
+ let gen_future =
+ self.expr_lang_item_path(unstable_span, hir::LangItem::FromGenerator, ThinVec::new());
// `future::from_generator(generator)`:
hir::ExprKind::Call(self.arena.alloc(gen_future), arena_vec![self; generator])
// Use of `await` outside of an async context, we cannot use `task_context` here.
self.expr_err(span)
};
- let pin_ty_id = self.next_id();
- let new_unchecked_expr_kind = self.expr_call_std_assoc_fn(
- pin_ty_id,
+ let new_unchecked = self.expr_call_lang_item_fn_mut(
span,
- &[sym::pin, sym::Pin],
- "new_unchecked",
+ hir::LangItem::PinNewUnchecked,
arena_vec![self; ref_mut_pinned],
);
- let new_unchecked = self.expr(span, new_unchecked_expr_kind, ThinVec::new());
- let get_context = self.expr_call_std_path_mut(
+ let get_context = self.expr_call_lang_item_fn_mut(
gen_future_span,
- &[sym::future, sym::get_context],
+ hir::LangItem::GetContext,
arena_vec![self; task_context],
);
- let call = self.expr_call_std_path(
+ let call = self.expr_call_lang_item_fn(
span,
- &[sym::future, sym::Future, sym::poll],
+ hir::LangItem::FuturePoll,
arena_vec![self; new_unchecked, get_context],
);
self.arena.alloc(self.expr_unsafe(call))
let x_ident = Ident::with_dummy_span(sym::result);
let (x_pat, x_pat_hid) = self.pat_ident(span, x_ident);
let x_expr = self.expr_ident(span, x_ident, x_pat_hid);
- let ready_pat = self.pat_std_enum(
- span,
- &[sym::task, sym::Poll, sym::Ready],
- arena_vec![self; x_pat],
- );
+ let ready_field = self.single_pat_field(span, x_pat);
+ let ready_pat = self.pat_lang_item_variant(span, hir::LangItem::PollReady, ready_field);
let break_x = self.with_loop_scope(loop_node_id, move |this| {
let expr_break =
hir::ExprKind::Break(this.lower_loop_destination(None), Some(x_expr));
// `::std::task::Poll::Pending => {}`
let pending_arm = {
- let pending_pat = self.pat_std_enum(span, &[sym::task, sym::Poll, sym::Pending], &[]);
+ let pending_pat = self.pat_lang_item_variant(span, hir::LangItem::PollPending, &[]);
let empty_block = self.expr_block_empty(span);
self.arm(pending_pat, empty_block)
};
/// Desugar `<start>..=<end>` into `std::ops::RangeInclusive::new(<start>, <end>)`.
fn lower_expr_range_closed(&mut self, span: Span, e1: &Expr, e2: &Expr) -> hir::ExprKind<'hir> {
- let id = self.next_id();
let e1 = self.lower_expr_mut(e1);
let e2 = self.lower_expr_mut(e2);
- self.expr_call_std_assoc_fn(
- id,
- span,
- &[sym::ops, sym::RangeInclusive],
- "new",
- arena_vec![self; e1, e2],
- )
+ let fn_path = hir::QPath::LangItem(hir::LangItem::RangeInclusiveNew, span);
+ let fn_expr =
+ self.arena.alloc(self.expr(span, hir::ExprKind::Path(fn_path), ThinVec::new()));
+ hir::ExprKind::Call(fn_expr, arena_vec![self; e1, e2])
}
fn lower_expr_range(
e2: Option<&Expr>,
lims: RangeLimits,
) -> hir::ExprKind<'hir> {
- use rustc_ast::ast::RangeLimits::*;
-
- let path = match (e1, e2, lims) {
- (None, None, HalfOpen) => sym::RangeFull,
- (Some(..), None, HalfOpen) => sym::RangeFrom,
- (None, Some(..), HalfOpen) => sym::RangeTo,
- (Some(..), Some(..), HalfOpen) => sym::Range,
- (None, Some(..), Closed) => sym::RangeToInclusive,
+ use rustc_ast::RangeLimits::*;
+
+ let lang_item = match (e1, e2, lims) {
+ (None, None, HalfOpen) => hir::LangItem::RangeFull,
+ (Some(..), None, HalfOpen) => hir::LangItem::RangeFrom,
+ (None, Some(..), HalfOpen) => hir::LangItem::RangeTo,
+ (Some(..), Some(..), HalfOpen) => hir::LangItem::Range,
+ (None, Some(..), Closed) => hir::LangItem::RangeToInclusive,
(Some(..), Some(..), Closed) => unreachable!(),
(_, None, Closed) => {
self.diagnostic().span_fatal(span, "inclusive range with no end").raise()
}),
);
- let is_unit = fields.is_empty();
- let struct_path = [sym::ops, path];
- let struct_path = self.std_path(span, &struct_path, None, is_unit);
- let struct_path = hir::QPath::Resolved(None, struct_path);
-
- if is_unit {
- hir::ExprKind::Path(struct_path)
- } else {
- hir::ExprKind::Struct(self.arena.alloc(struct_path), fields, None)
- }
+ hir::ExprKind::Struct(self.arena.alloc(hir::QPath::LangItem(lang_item, span)), fields, None)
}
fn lower_loop_destination(&mut self, destination: Option<(NodeId, Label)>) -> hir::Destination {
let match_expr = {
let iter = self.expr_ident(desugared_span, iter, iter_pat_nid);
let ref_mut_iter = self.expr_mut_addr_of(desugared_span, iter);
- let next_path = &[sym::iter, sym::Iterator, sym::next];
- let next_expr =
- self.expr_call_std_path(desugared_span, next_path, arena_vec![self; ref_mut_iter]);
+ let next_expr = self.expr_call_lang_item_fn(
+ desugared_span,
+ hir::LangItem::IteratorNext,
+ arena_vec![self; ref_mut_iter],
+ );
let arms = arena_vec![self; pat_arm, break_arm];
self.expr_match(desugared_span, next_expr, arms, hir::MatchSource::ForLoopDesugar)
// `match ::std::iter::IntoIterator::into_iter(<head>) { ... }`
let into_iter_expr = {
- let into_iter_path = &[sym::iter, sym::IntoIterator, sym::into_iter];
- self.expr_call_std_path(into_iter_span, into_iter_path, arena_vec![self; head])
+ self.expr_call_lang_item_fn(
+ into_iter_span,
+ hir::LangItem::IntoIterIntoIter,
+ arena_vec![self; head],
+ )
};
let match_expr = self.arena.alloc(self.expr_match(
// expand <expr>
let sub_expr = self.lower_expr_mut(sub_expr);
- let path = &[sym::ops, sym::Try, sym::into_result];
- self.expr_call_std_path(unstable_span, path, arena_vec![self; sub_expr])
+ self.expr_call_lang_item_fn(
+ unstable_span,
+ hir::LangItem::TryIntoResult,
+ arena_vec![self; sub_expr],
+ )
};
// `#[allow(unreachable_code)]`
let err_ident = Ident::with_dummy_span(sym::err);
let (err_local, err_local_nid) = self.pat_ident(try_span, err_ident);
let from_expr = {
- let from_path = &[sym::convert, sym::From, sym::from];
let err_expr = self.expr_ident_mut(try_span, err_ident, err_local_nid);
- self.expr_call_std_path(try_span, from_path, arena_vec![self; err_expr])
+ self.expr_call_lang_item_fn(
+ try_span,
+ hir::LangItem::FromFrom,
+ arena_vec![self; err_expr],
+ )
};
- let from_err_expr =
- self.wrap_in_try_constructor(sym::from_error, unstable_span, from_expr, try_span);
+ let from_err_expr = self.wrap_in_try_constructor(
+ hir::LangItem::TryFromError,
+ unstable_span,
+ from_expr,
+ try_span,
+ );
let thin_attrs = ThinVec::from(attrs);
let catch_scope = self.catch_scopes.last().copied();
let ret_expr = if let Some(catch_node) = catch_scope {
self.arena.alloc(self.expr_call_mut(span, e, args))
}
- // Note: associated functions must use `expr_call_std_path`.
- fn expr_call_std_path_mut(
+ fn expr_call_lang_item_fn_mut(
&mut self,
span: Span,
- path_components: &[Symbol],
+ lang_item: hir::LangItem,
args: &'hir [hir::Expr<'hir>],
) -> hir::Expr<'hir> {
- let path =
- self.arena.alloc(self.expr_std_path(span, path_components, None, ThinVec::new()));
+ let path = self.arena.alloc(self.expr_lang_item_path(span, lang_item, ThinVec::new()));
self.expr_call_mut(span, path, args)
}
- fn expr_call_std_path(
+ fn expr_call_lang_item_fn(
&mut self,
span: Span,
- path_components: &[Symbol],
+ lang_item: hir::LangItem,
args: &'hir [hir::Expr<'hir>],
) -> &'hir hir::Expr<'hir> {
- self.arena.alloc(self.expr_call_std_path_mut(span, path_components, args))
- }
-
- // Create an expression calling an associated function of an std type.
- //
- // Associated functions cannot be resolved through the normal `std_path` function,
- // as they are resolved differently and so cannot use `expr_call_std_path`.
- //
- // This function accepts the path component (`ty_path_components`) separately from
- // the name of the associated function (`assoc_fn_name`) in order to facilitate
- // separate resolution of the type and creation of a path referring to its associated
- // function.
- fn expr_call_std_assoc_fn(
- &mut self,
- ty_path_id: hir::HirId,
- span: Span,
- ty_path_components: &[Symbol],
- assoc_fn_name: &str,
- args: &'hir [hir::Expr<'hir>],
- ) -> hir::ExprKind<'hir> {
- let ty_path = self.std_path(span, ty_path_components, None, false);
- let ty =
- self.arena.alloc(self.ty_path(ty_path_id, span, hir::QPath::Resolved(None, ty_path)));
- let fn_seg = self.arena.alloc(hir::PathSegment::from_ident(Ident::from_str(assoc_fn_name)));
- let fn_path = hir::QPath::TypeRelative(ty, fn_seg);
- let fn_expr =
- self.arena.alloc(self.expr(span, hir::ExprKind::Path(fn_path), ThinVec::new()));
- hir::ExprKind::Call(fn_expr, args)
+ self.arena.alloc(self.expr_call_lang_item_fn_mut(span, lang_item, args))
}
- fn expr_std_path(
+ fn expr_lang_item_path(
&mut self,
span: Span,
- components: &[Symbol],
- params: Option<&'hir hir::GenericArgs<'hir>>,
+ lang_item: hir::LangItem,
attrs: AttrVec,
) -> hir::Expr<'hir> {
- let path = self.std_path(span, components, params, true);
- self.expr(span, hir::ExprKind::Path(hir::QPath::Resolved(None, path)), attrs)
+ self.expr(span, hir::ExprKind::Path(hir::QPath::LangItem(lang_item, span)), attrs)
}
pub(super) fn expr_ident(
use super::{ImplTraitContext, ImplTraitPosition};
use crate::Arena;
-use rustc_ast::ast::*;
use rustc_ast::node_id::NodeMap;
use rustc_ast::ptr::P;
use rustc_ast::visit::{self, AssocCtxt, FnCtxt, FnKind, Visitor};
+use rustc_ast::*;
use rustc_data_structures::fx::FxHashSet;
use rustc_errors::struct_span_err;
use rustc_hir as hir;
#![feature(or_patterns)]
#![recursion_limit = "256"]
-use rustc_ast::ast;
-use rustc_ast::ast::*;
use rustc_ast::node_id::NodeMap;
use rustc_ast::token::{self, DelimToken, Nonterminal, Token};
use rustc_ast::tokenstream::{DelimSpan, TokenStream, TokenTree};
use rustc_ast::visit::{self, AssocCtxt, Visitor};
use rustc_ast::walk_list;
+use rustc_ast::{self as ast, *};
use rustc_ast_pretty::pprust;
use rustc_data_structures::captures::Captures;
use rustc_data_structures::fx::FxHashSet;
rustc_hir::arena_types!(rustc_arena::declare_arena, [], 'tcx);
struct LoweringContext<'a, 'hir: 'a> {
- crate_root: Option<Symbol>,
-
/// Used to assign IDs to HIR nodes that do not directly correspond to AST nodes.
sess: &'a Session,
/// This should only return `None` during testing.
fn definitions(&mut self) -> &mut Definitions;
- /// Given suffix `["b", "c", "d"]`, creates an AST path for `[::crate_root]::b::c::d` and
- /// resolves it based on `is_value`.
- fn resolve_str_path(
- &mut self,
- span: Span,
- crate_root: Option<Symbol>,
- components: &[Symbol],
- ns: Namespace,
- ) -> (ast::Path, Res<NodeId>);
-
fn lint_buffer(&mut self) -> &mut LintBuffer;
fn next_node_id(&mut self) -> NodeId;
let _prof_timer = sess.prof.verbose_generic_activity("hir_lowering");
LoweringContext {
- crate_root: sess.parse_sess.injected_crate_name.get().copied(),
sess,
resolver,
nt_to_tokenstream,
};
// "<Output = T>"
- let future_params = self.arena.alloc(hir::GenericArgs {
+ let future_args = self.arena.alloc(hir::GenericArgs {
args: &[],
bindings: arena_vec![self; self.output_ty_binding(span, output_ty)],
parenthesized: false,
});
- // ::std::future::Future<future_params>
- let future_path =
- self.std_path(span, &[sym::future, sym::Future], Some(future_params), false);
-
- hir::GenericBound::Trait(
- hir::PolyTraitRef {
- trait_ref: hir::TraitRef { path: future_path, hir_ref_id: self.next_id() },
- bound_generic_params: &[],
- span,
- },
- hir::TraitBoundModifier::None,
+ hir::GenericBound::LangItemTrait(
+ // ::std::future::Future<future_params>
+ hir::LangItem::FutureTraitLangItem,
+ span,
+ self.next_id(),
+ future_args,
)
}
}
fn pat_ok(&mut self, span: Span, pat: &'hir hir::Pat<'hir>) -> &'hir hir::Pat<'hir> {
- self.pat_std_enum(span, &[sym::result, sym::Result, sym::Ok], arena_vec![self; pat])
+ let field = self.single_pat_field(span, pat);
+ self.pat_lang_item_variant(span, hir::LangItem::ResultOk, field)
}
fn pat_err(&mut self, span: Span, pat: &'hir hir::Pat<'hir>) -> &'hir hir::Pat<'hir> {
- self.pat_std_enum(span, &[sym::result, sym::Result, sym::Err], arena_vec![self; pat])
+ let field = self.single_pat_field(span, pat);
+ self.pat_lang_item_variant(span, hir::LangItem::ResultErr, field)
}
fn pat_some(&mut self, span: Span, pat: &'hir hir::Pat<'hir>) -> &'hir hir::Pat<'hir> {
- self.pat_std_enum(span, &[sym::option, sym::Option, sym::Some], arena_vec![self; pat])
+ let field = self.single_pat_field(span, pat);
+ self.pat_lang_item_variant(span, hir::LangItem::OptionSome, field)
}
fn pat_none(&mut self, span: Span) -> &'hir hir::Pat<'hir> {
- self.pat_std_enum(span, &[sym::option, sym::Option, sym::None], &[])
+ self.pat_lang_item_variant(span, hir::LangItem::OptionNone, &[])
}
- fn pat_std_enum(
+ fn single_pat_field(
&mut self,
span: Span,
- components: &[Symbol],
- subpats: &'hir [&'hir hir::Pat<'hir>],
- ) -> &'hir hir::Pat<'hir> {
- let path = self.std_path(span, components, None, true);
- let qpath = hir::QPath::Resolved(None, path);
- let pt = if subpats.is_empty() {
- hir::PatKind::Path(qpath)
- } else {
- hir::PatKind::TupleStruct(qpath, subpats, None)
+ pat: &'hir hir::Pat<'hir>,
+ ) -> &'hir [hir::FieldPat<'hir>] {
+ let field = hir::FieldPat {
+ hir_id: self.next_id(),
+ ident: Ident::new(sym::integer(0), span),
+ is_shorthand: false,
+ pat,
+ span,
};
- self.pat(span, pt)
+ arena_vec![self; field]
+ }
+
+ fn pat_lang_item_variant(
+ &mut self,
+ span: Span,
+ lang_item: hir::LangItem,
+ fields: &'hir [hir::FieldPat<'hir>],
+ ) -> &'hir hir::Pat<'hir> {
+ let qpath = hir::QPath::LangItem(lang_item, span);
+ self.pat(span, hir::PatKind::Struct(qpath, fields, false))
}
fn pat_ident(&mut self, span: Span, ident: Ident) -> (&'hir hir::Pat<'hir>, hir::HirId) {
self.arena.alloc(hir::Pat { hir_id: self.next_id(), kind, span })
}
- /// Given a suffix `["b", "c", "d"]`, returns path `::std::b::c::d` when
- /// `fld.cx.use_std`, and `::core::b::c::d` otherwise.
- /// The path is also resolved according to `is_value`.
- fn std_path(
- &mut self,
- span: Span,
- components: &[Symbol],
- params: Option<&'hir hir::GenericArgs<'hir>>,
- is_value: bool,
- ) -> &'hir hir::Path<'hir> {
- let ns = if is_value { Namespace::ValueNS } else { Namespace::TypeNS };
- let (path, res) = self.resolver.resolve_str_path(span, self.crate_root, components, ns);
-
- let mut segments: Vec<_> = path
- .segments
- .iter()
- .map(|segment| {
- let res = self.expect_full_res(segment.id);
- hir::PathSegment {
- ident: segment.ident,
- hir_id: Some(self.lower_node_id(segment.id)),
- res: Some(self.lower_res(res)),
- infer_args: true,
- args: None,
- }
- })
- .collect();
- segments.last_mut().unwrap().args = params;
-
- self.arena.alloc(hir::Path {
- span,
- res: res.map_id(|_| panic!("unexpected `NodeId`")),
- segments: self.arena.alloc_from_iter(segments),
- })
- }
-
fn ty_path(
&mut self,
mut hir_id: hir::HirId,
use super::{ImplTraitContext, LoweringContext, ParamMode};
-use rustc_ast::ast::*;
use rustc_ast::ptr::P;
+use rustc_ast::*;
use rustc_data_structures::stack::ensure_sufficient_stack;
use rustc_errors::Applicability;
use rustc_hir as hir;
use super::{AnonymousLifetimeMode, ImplTraitContext, LoweringContext, ParamMode};
use super::{GenericArgsCtor, ParenthesizedGenericArgs};
-use rustc_ast::ast::{self, *};
+use rustc_ast::{self as ast, *};
use rustc_errors::{struct_span_err, Applicability};
use rustc_hir as hir;
use rustc_hir::def::{DefKind, PartialRes, Res};
// or type checking or some other kind of complex analysis.
use itertools::{Either, Itertools};
-use rustc_ast::ast::*;
use rustc_ast::ptr::P;
use rustc_ast::visit::{self, AssocCtxt, FnCtxt, FnKind, Visitor};
use rustc_ast::walk_list;
+use rustc_ast::*;
use rustc_ast_pretty::pprust;
use rustc_data_structures::fx::FxHashMap;
use rustc_errors::{error_code, pluralize, struct_span_err, Applicability};
-use rustc_ast::ast::{self, AssocTyConstraint, AssocTyConstraintKind, NodeId};
-use rustc_ast::ast::{GenericParam, GenericParamKind, PatKind, RangeEnd, VariantData};
+use rustc_ast as ast;
use rustc_ast::visit::{self, AssocCtxt, FnCtxt, FnKind, Visitor};
+use rustc_ast::{AssocTyConstraint, AssocTyConstraintKind, NodeId};
+use rustc_ast::{GenericParam, GenericParamKind, PatKind, RangeEnd, VariantData};
use rustc_errors::struct_span_err;
use rustc_feature::{AttributeGate, BUILTIN_ATTRIBUTE_MAP};
use rustc_feature::{Features, GateIssue};
// Simply gives a rough count of the number of nodes in an AST.
-use rustc_ast::ast::*;
use rustc_ast::visit::*;
+use rustc_ast::*;
use rustc_span::symbol::Ident;
use rustc_span::Span;
use std::str::FromStr;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::visit;
use rustc_ast::visit::Visitor;
use crate::pp::Breaks::{Consistent, Inconsistent};
use crate::pp::{self, Breaks};
-use rustc_ast::ast::{self, BlockCheckMode, PatKind, RangeEnd, RangeSyntax};
-use rustc_ast::ast::{Attribute, GenericArg, MacArgs};
-use rustc_ast::ast::{GenericBound, SelfKind, TraitBoundModifier};
-use rustc_ast::ast::{InlineAsmOperand, InlineAsmRegOrRegClass};
-use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece};
use rustc_ast::attr;
use rustc_ast::ptr::P;
use rustc_ast::token::{self, BinOpToken, CommentKind, DelimToken, Nonterminal, Token, TokenKind};
use rustc_ast::util::classify;
use rustc_ast::util::comments::{gather_comments, Comment, CommentStyle};
use rustc_ast::util::parser::{self, AssocOp, Fixity};
+use rustc_ast::{self as ast, BlockCheckMode, PatKind, RangeEnd, RangeSyntax};
+use rustc_ast::{GenericArg, MacArgs};
+use rustc_ast::{GenericBound, SelfKind, TraitBoundModifier};
+use rustc_ast::{InlineAsmOperand, InlineAsmRegOrRegClass};
+use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
use rustc_span::edition::Edition;
use rustc_span::source_map::{SourceMap, Spanned};
use rustc_span::symbol::{kw, sym, Ident, IdentPrinter, Symbol};
}
}
- crate fn print_foreign_mod(&mut self, nmod: &ast::ForeignMod, attrs: &[Attribute]) {
+ crate fn print_foreign_mod(&mut self, nmod: &ast::ForeignMod, attrs: &[ast::Attribute]) {
self.print_inner_attributes(attrs);
for item in &nmod.items {
self.print_foreign_item(item);
}
}
- fn print_expr_vec(&mut self, exprs: &[P<ast::Expr>], attrs: &[Attribute]) {
+ fn print_expr_vec(&mut self, exprs: &[P<ast::Expr>], attrs: &[ast::Attribute]) {
self.ibox(INDENT_UNIT);
self.s.word("[");
self.print_inner_attributes_inline(attrs);
&mut self,
element: &ast::Expr,
count: &ast::AnonConst,
- attrs: &[Attribute],
+ attrs: &[ast::Attribute],
) {
self.ibox(INDENT_UNIT);
self.s.word("[");
path: &ast::Path,
fields: &[ast::Field],
wth: &Option<P<ast::Expr>>,
- attrs: &[Attribute],
+ attrs: &[ast::Attribute],
) {
self.print_path(path, true, 0);
self.s.word("{");
self.s.word("}");
}
- fn print_expr_tup(&mut self, exprs: &[P<ast::Expr>], attrs: &[Attribute]) {
+ fn print_expr_tup(&mut self, exprs: &[P<ast::Expr>], attrs: &[ast::Attribute]) {
self.popen();
self.print_inner_attributes_inline(attrs);
self.commasep_exprs(Inconsistent, &exprs[..]);
use super::*;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_span::source_map::respan;
use rustc_span::symbol::Ident;
use rustc_span::with_default_session_globals;
//! Parsing and validation of builtin attributes
-use rustc_ast::ast::{self, Attribute, Lit, LitKind, MetaItem, MetaItemKind, NestedMetaItem};
+use rustc_ast::{self as ast, Attribute, Lit, LitKind, MetaItem, MetaItemKind, NestedMetaItem};
use rustc_ast_pretty::pprust;
use rustc_errors::{struct_span_err, Applicability};
use rustc_feature::{find_gated_cfg, is_builtin_attr_name, Features, GatedCfg};
[dependencies]
rustc_parse_format = { path = "../librustc_parse_format" }
-log = { package = "tracing", version = "0.1" }
+tracing = "0.1"
rustc_ast_pretty = { path = "../librustc_ast_pretty" }
rustc_attr = { path = "../librustc_attr" }
rustc_data_structures = { path = "../librustc_data_structures" }
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::ptr::P;
use rustc_ast::token;
use rustc_ast::tokenstream::TokenStream;
use rustc_errors::{Applicability, DiagnosticBuilder};
-use rustc_ast::ast::{self, *};
use rustc_ast::ptr::P;
use rustc_ast::token::{self, TokenKind};
use rustc_ast::tokenstream::{DelimSpan, TokenStream, TokenTree};
+use rustc_ast::{self as ast, *};
use rustc_ast_pretty::pprust;
use rustc_expand::base::*;
use rustc_parse::parser::Parser;
//! a literal `true` or `false` based on whether the given cfg matches the
//! current compilation environment.
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::token;
use rustc_ast::tokenstream::TokenStream;
use rustc_attr as attr;
//! Implementation of the `#[cfg_accessible(path)]` attribute macro.
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_expand::base::{Annotatable, ExpandResult, ExtCtxt, MultiItemModifier};
use rustc_feature::AttributeTemplate;
use rustc_parse::validate_attr;
//! Attributes injected into the crate root from command line using `-Z crate-attr`.
-use rustc_ast::ast::{self, AttrItem, AttrStyle};
use rustc_ast::attr::mk_attr;
use rustc_ast::token;
+use rustc_ast::{self as ast, AttrItem, AttrStyle};
use rustc_session::parse::ParseSess;
use rustc_span::FileName;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::tokenstream::TokenStream;
use rustc_expand::base::{self, DummyResult};
use rustc_span::symbol::Symbol;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::ptr::P;
use rustc_ast::token::{self, Token};
use rustc_ast::tokenstream::{TokenStream, TokenTree};
use crate::deriving::generic::*;
use crate::deriving::path_std;
-use rustc_ast::ast::MetaItem;
+use rustc_ast::MetaItem;
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::Span;
use crate::deriving::generic::*;
use crate::deriving::path_std;
-use rustc_ast::ast::{self, Expr, GenericArg, Generics, ItemKind, MetaItem, VariantData};
use rustc_ast::ptr::P;
+use rustc_ast::{self as ast, Expr, GenericArg, Generics, ItemKind, MetaItem, VariantData};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::symbol::{kw, sym, Ident, Symbol};
use rustc_span::Span;
use crate::deriving::generic::*;
use crate::deriving::path_std;
-use rustc_ast::ast::{self, Expr, GenericArg, MetaItem};
use rustc_ast::ptr::P;
+use rustc_ast::{self as ast, Expr, GenericArg, MetaItem};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::symbol::{sym, Ident, Symbol};
use rustc_span::Span;
use crate::deriving::generic::*;
use crate::deriving::path_std;
-use rustc_ast::ast::{self, Expr, MetaItem};
use rustc_ast::ptr::P;
+use rustc_ast::{self as ast, Expr, MetaItem};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::symbol::{sym, Ident};
use rustc_span::Span;
use crate::deriving::generic::*;
use crate::deriving::{path_local, path_std};
-use rustc_ast::ast::{BinOpKind, Expr, MetaItem};
use rustc_ast::ptr::P;
+use rustc_ast::{BinOpKind, Expr, MetaItem};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::symbol::sym;
use rustc_span::Span;
use crate::deriving::generic::*;
use crate::deriving::{path_local, path_std, pathvec_std};
-use rustc_ast::ast::{self, BinOpKind, Expr, MetaItem};
use rustc_ast::ptr::P;
+use rustc_ast::{self as ast, BinOpKind, Expr, MetaItem};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::symbol::{sym, Ident, Symbol};
use rustc_span::Span;
use crate::deriving::generic::*;
use crate::deriving::path_std;
-use rustc_ast::ast;
-use rustc_ast::ast::{Expr, MetaItem};
use rustc_ast::ptr::P;
+use rustc_ast::{self as ast, Expr, MetaItem};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::symbol::{sym, Ident};
use rustc_span::{Span, DUMMY_SP};
use crate::deriving::generic::*;
use crate::deriving::pathvec_std;
-use rustc_ast::ast;
-use rustc_ast::ast::{Expr, MetaItem, Mutability};
use rustc_ast::ptr::P;
+use rustc_ast::{self as ast, Expr, MetaItem, Mutability};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::symbol::{sym, Ident, Symbol};
use rustc_span::Span;
use crate::deriving::generic::ty::*;
use crate::deriving::generic::*;
-use rustc_ast::ast::{Expr, MetaItem};
use rustc_ast::ptr::P;
+use rustc_ast::{Expr, MetaItem};
use rustc_errors::struct_span_err;
use rustc_expand::base::{Annotatable, DummyResult, ExtCtxt};
use rustc_span::symbol::{kw, sym};
use crate::deriving::generic::*;
use crate::deriving::pathvec_std;
-use rustc_ast::ast::{Expr, ExprKind, MetaItem, Mutability};
use rustc_ast::ptr::P;
+use rustc_ast::{Expr, ExprKind, MetaItem, Mutability};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::symbol::{sym, Ident, Symbol};
use rustc_span::Span;
use std::iter;
use std::vec;
-use rustc_ast::ast::{self, BinOpKind, EnumDef, Expr, Generics, PatKind};
-use rustc_ast::ast::{GenericArg, GenericParamKind, VariantData};
use rustc_ast::ptr::P;
+use rustc_ast::{self as ast, BinOpKind, EnumDef, Expr, Generics, PatKind};
+use rustc_ast::{GenericArg, GenericParamKind, VariantData};
use rustc_attr as attr;
use rustc_data_structures::map_in_place::MapInPlace;
use rustc_expand::base::{Annotatable, ExtCtxt};
pub use PtrTy::*;
pub use Ty::*;
-use rustc_ast::ast::{self, Expr, GenericArg, GenericParamKind, Generics, SelfKind};
use rustc_ast::ptr::P;
+use rustc_ast::{self as ast, Expr, GenericArg, GenericParamKind, Generics, SelfKind};
use rustc_expand::base::ExtCtxt;
use rustc_span::source_map::{respan, DUMMY_SP};
use rustc_span::symbol::{kw, Ident, Symbol};
use crate::deriving::generic::*;
use crate::deriving::{self, path_std, pathvec_std};
-use rustc_ast::ast::{Expr, MetaItem, Mutability};
use rustc_ast::ptr::P;
+use rustc_ast::{Expr, MetaItem, Mutability};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::symbol::sym;
use rustc_span::Span;
//! The compiler code necessary to implement the `#[derive]` extensions.
-use rustc_ast::ast::{self, ItemKind, MetaItem};
+use rustc_ast as ast;
use rustc_ast::ptr::P;
+use rustc_ast::{ItemKind, MetaItem};
use rustc_expand::base::{Annotatable, ExpandResult, ExtCtxt, MultiItemModifier};
use rustc_span::symbol::{sym, Ident, Symbol};
use rustc_span::Span;
// interface.
//
-use rustc_ast::ast::{self, GenericArg};
use rustc_ast::tokenstream::TokenStream;
+use rustc_ast::{self as ast, GenericArg};
use rustc_expand::base::{self, *};
use rustc_span::symbol::{kw, sym, Ident, Symbol};
use rustc_span::Span;
use ArgumentType::*;
use Position::*;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::ptr::P;
use rustc_ast::token;
use rustc_ast::tokenstream::TokenStream;
use crate::util::check_builtin_macro_attribute;
-use rustc_ast::ast::{self, Attribute, Expr, FnHeader, FnSig, Generics, Param};
-use rustc_ast::ast::{ItemKind, Mutability, Stmt, Ty, TyKind, Unsafe};
use rustc_ast::expand::allocator::{
AllocatorKind, AllocatorMethod, AllocatorTy, ALLOCATOR_METHODS,
};
use rustc_ast::ptr::P;
+use rustc_ast::{self as ast, Attribute, Expr, FnHeader, FnSig, Generics, Param};
+use rustc_ast::{ItemKind, Mutability, Stmt, Ty, TyKind, Unsafe};
use rustc_expand::base::{Annotatable, ExtCtxt};
use rustc_span::symbol::{kw, sym, Ident, Symbol};
use rustc_span::Span;
//! LLVM's `module asm "some assembly here"`. All of LLVM's caveats
//! therefore apply.
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::ptr::P;
use rustc_ast::token;
use rustc_ast::tokenstream::TokenStream;
//
use State::*;
-use rustc_ast::ast::{self, LlvmAsmDialect};
+use rustc_ast as ast;
use rustc_ast::ptr::P;
use rustc_ast::token::{self, Token};
use rustc_ast::tokenstream::{self, TokenStream};
+use rustc_ast::LlvmAsmDialect;
use rustc_errors::{struct_span_err, DiagnosticBuilder, PResult};
use rustc_expand::base::*;
use rustc_parse::parser::Parser;
use std::mem;
-use rustc_ast::ast::{self, NodeId};
use rustc_ast::attr;
use rustc_ast::ptr::P;
use rustc_ast::visit::{self, Visitor};
+use rustc_ast::{self as ast, NodeId};
use rustc_ast_pretty::pprust;
use rustc_expand::base::{ExtCtxt, ResolverExpand};
use rustc_expand::expand::{AstFragment, ExpansionConfig};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::ptr::P;
use rustc_ast::token;
use rustc_ast::tokenstream::TokenStream;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::ptr::P;
use rustc_expand::base::{ExtCtxt, ResolverExpand};
use rustc_expand::expand::ExpansionConfig;
/// Ideally, this code would be in libtest but for efficiency and error messages it lives here.
use crate::util::check_builtin_macro_attribute;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::attr;
use rustc_ast_pretty::pprust;
use rustc_expand::base::*;
// extern crate test
let test_extern = cx.item(sp, test_id, vec![], ast::ItemKind::ExternCrate(None));
- log::debug!("synthetic test item:\n{}\n", pprust::item_to_string(&test_const));
+ tracing::debug!("synthetic test item:\n{}\n", pprust::item_to_string(&test_const));
vec![
// Access to libtest under a hygienic name
// Code that generates a test runner to run all the tests in a crate
-use log::debug;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::attr;
use rustc_ast::entry::EntryPointType;
use rustc_ast::mut_visit::{ExpectOne, *};
use rustc_span::{Span, DUMMY_SP};
use rustc_target::spec::PanicStrategy;
use smallvec::{smallvec, SmallVec};
+use tracing::debug;
use std::{iter, mem};
-use rustc_ast::ast::MetaItem;
+use rustc_ast::MetaItem;
use rustc_expand::base::ExtCtxt;
use rustc_feature::AttributeTemplate;
use rustc_parse::validate_attr;
flate2 = "1.0"
libc = "0.2"
measureme = "0.7.1"
-log = { package = "tracing", version = "0.1" }
+tracing = "0.1"
rustc_middle = { path = "../librustc_middle" }
rustc-demangle = "0.1"
rustc_attr = { path = "../librustc_attr" }
use crate::type_of::LayoutLlvmExt;
use crate::value::Value;
-use rustc_ast::ast::LlvmAsmDialect;
-use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece};
+use rustc_ast::LlvmAsmDialect;
+use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
use rustc_codegen_ssa::mir::operand::OperandValue;
use rustc_codegen_ssa::mir::place::PlaceRef;
use rustc_codegen_ssa::traits::*;
use rustc_target::asm::*;
use libc::{c_char, c_uint};
-use log::debug;
+use tracing::debug;
impl AsmBuilderMethods<'tcx> for Builder<'a, 'll, 'tcx> {
fn codegen_llvm_inline_asm(
use crate::llvm::archive_ro::ArchiveRO;
use crate::llvm::{self, False, True};
use crate::{LlvmCodegenBackend, ModuleLlvm};
-use log::{debug, info};
use rustc_codegen_ssa::back::lto::{LtoModuleCodegen, SerializedModule, ThinModule, ThinShared};
use rustc_codegen_ssa::back::symbol_export;
use rustc_codegen_ssa::back::write::{CodegenContext, FatLTOInput, ModuleConfig};
use rustc_middle::middle::exported_symbols::SymbolExportLevel;
use rustc_session::cgu_reuse_tracker::CguReuse;
use rustc_session::config::{self, CrateType, Lto};
+use tracing::{debug, info};
use std::ffi::{CStr, CString};
use std::fs::File;
use crate::type_::Type;
use crate::LlvmCodegenBackend;
use crate::ModuleLlvm;
-use log::debug;
use rustc_codegen_ssa::back::write::{BitcodeSection, CodegenContext, EmitObj, ModuleConfig};
use rustc_codegen_ssa::traits::*;
use rustc_codegen_ssa::{CompiledModule, ModuleCodegen};
use rustc_span::symbol::sym;
use rustc_span::InnerSpan;
use rustc_target::spec::{CodeModel, RelocModel};
+use tracing::debug;
use libc::{c_char, c_int, c_uint, c_void, size_t};
use std::ffi::CString;
use crate::type_of::LayoutLlvmExt;
use crate::value::Value;
use libc::{c_char, c_uint};
-use log::debug;
use rustc_codegen_ssa::base::to_immediate;
use rustc_codegen_ssa::common::{IntPredicate, RealPredicate, TypeKind};
use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue};
use std::iter::TrustedLen;
use std::ops::{Deref, Range};
use std::ptr;
+use tracing::debug;
// All Builders must have an llfn associated with them
#[must_use]
lhs: Self::Value,
rhs: Self::Value,
) -> (Self::Value, Self::Value) {
- use rustc_ast::ast::IntTy::*;
- use rustc_ast::ast::UintTy::*;
+ use rustc_ast::IntTy::*;
+ use rustc_ast::UintTy::*;
use rustc_middle::ty::{Int, Uint};
let new_kind = match ty.kind {
use crate::context::CodegenCx;
use crate::llvm;
use crate::value::Value;
-use log::debug;
use rustc_codegen_ssa::traits::*;
+use tracing::debug;
use rustc_middle::ty::layout::{FnAbiExt, HasTyCtxt};
use rustc_middle::ty::{self, Instance, TypeFoldable};
use crate::type_of::LayoutLlvmExt;
use crate::value::Value;
-use rustc_ast::ast::Mutability;
+use rustc_ast::Mutability;
use rustc_codegen_ssa::mir::place::PlaceRef;
use rustc_codegen_ssa::traits::*;
use rustc_middle::bug;
use rustc_target::abi::{self, AddressSpace, HasDataLayout, LayoutOf, Pointer, Size};
use libc::{c_char, c_uint};
-use log::debug;
+use tracing::debug;
/*
* A note on nomenclature of linking: "extern", "foreign", and "upcall".
use crate::type_of::LayoutLlvmExt;
use crate::value::Value;
use libc::c_uint;
-use log::debug;
use rustc_codegen_ssa::traits::*;
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_span::symbol::sym;
use rustc_span::Span;
use rustc_target::abi::{AddressSpace, Align, HasDataLayout, LayoutOf, Primitive, Scalar, Size};
+use tracing::debug;
use std::ffi::CStr;
use crate::llvm;
use llvm::coverageinfo::CounterMappingRegion;
-use log::debug;
use rustc_codegen_ssa::coverageinfo::map::{Counter, CounterExpression, Region};
use rustc_codegen_ssa::traits::{BaseTypeMethods, ConstMethods};
use rustc_data_structures::fx::FxIndexSet;
use rustc_llvm::RustString;
+use tracing::debug;
use std::ffi::CString;
use libc::c_uint;
use llvm::coverageinfo::CounterMappingRegion;
-use log::debug;
use rustc_codegen_ssa::coverageinfo::map::{CounterExpression, ExprKind, FunctionCoverage, Region};
use rustc_codegen_ssa::traits::{
BaseTypeMethods, CoverageInfoBuilderMethods, CoverageInfoMethods, MiscMethods, StaticMethods,
use rustc_data_structures::fx::FxHashMap;
use rustc_llvm::RustString;
use rustc_middle::ty::Instance;
+use tracing::debug;
use std::cell::RefCell;
use std::ffi::CString;
};
use crate::value::Value;
-use log::debug;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_codegen_ssa::traits::*;
use rustc_data_structures::const_cstr;
use rustc_data_structures::fingerprint::Fingerprint;
use rustc_target::abi::{Abi, Align, HasDataLayout, Integer, LayoutOf, TagEncoding};
use rustc_target::abi::{Int, Pointer, F32, F64};
use rustc_target::abi::{Primitive, Size, VariantIdx, Variants};
+use tracing::debug;
use libc::{c_longlong, c_uint};
use std::collections::hash_map::Entry;
use rustc_target::abi::{LayoutOf, Primitive, Size};
use libc::c_uint;
-use log::debug;
use smallvec::SmallVec;
use std::cell::RefCell;
+use tracing::debug;
mod create_scope_map;
pub mod gdb;
use crate::llvm::AttributePlace::Function;
use crate::type_::Type;
use crate::value::Value;
-use log::debug;
use rustc_codegen_ssa::traits::*;
use rustc_middle::ty::Ty;
+use tracing::debug;
/// Declare a function.
///
use crate::va_arg::emit_va_arg;
use crate::value::Value;
-use log::debug;
-
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_codegen_ssa::base::{compare_simd_types, to_immediate, wants_msvc_seh};
use rustc_codegen_ssa::common::span_invalid_monomorphization_error;
use rustc_codegen_ssa::common::{IntPredicate, TypeKind};
use rustc_span::{sym, symbol::kw, Span, Symbol};
use rustc_target::abi::{self, HasDataLayout, LayoutOf, Primitive};
use rustc_target::spec::PanicStrategy;
+use tracing::debug;
use std::cmp::Ordering;
use std::iter;
}
impl AsmDialect {
- pub fn from_generic(asm: rustc_ast::ast::LlvmAsmDialect) -> Self {
+ pub fn from_generic(asm: rustc_ast::LlvmAsmDialect) -> Self {
match asm {
- rustc_ast::ast::LlvmAsmDialect::Att => AsmDialect::Att,
- rustc_ast::ast::LlvmAsmDialect::Intel => AsmDialect::Intel,
+ rustc_ast::LlvmAsmDialect::Att => AsmDialect::Att,
+ rustc_ast::LlvmAsmDialect::Intel => AsmDialect::Intel,
}
}
}
use rustc_middle::middle::cstore::MetadataLoader;
use rustc_target::spec::Target;
-use log::debug;
use rustc_codegen_ssa::METADATA_FILENAME;
use rustc_data_structures::owning_ref::OwningRef;
use rustc_data_structures::rustc_erase_owner;
+use tracing::debug;
use rustc_fs_util::path_to_c_string;
use std::path::Path;
use crate::context::CodegenCx;
use crate::llvm;
use crate::type_of::LayoutLlvmExt;
-use log::debug;
use rustc_codegen_ssa::traits::*;
use rustc_hir::def_id::{DefId, LOCAL_CRATE};
pub use rustc_middle::mir::mono::MonoItem;
use rustc_middle::ty::layout::FnAbiExt;
use rustc_middle::ty::{self, Instance, TypeFoldable};
use rustc_target::abi::LayoutOf;
+use tracing::debug;
impl PreDefineMethods<'tcx> for CodegenCx<'ll, 'tcx> {
fn predefine_static(
use crate::llvm::{Bool, False, True};
use crate::type_of::LayoutLlvmExt;
use crate::value::Value;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_codegen_ssa::common::TypeKind;
use rustc_codegen_ssa::traits::*;
use rustc_data_structures::small_c_str::SmallCStr;
use crate::abi::FnAbi;
use crate::common::*;
use crate::type_::Type;
-use log::debug;
use rustc_codegen_ssa::traits::*;
use rustc_middle::bug;
use rustc_middle::ty::layout::{FnAbiExt, TyAndLayout};
use rustc_target::abi::{Abi, AddressSpace, Align, FieldsShape};
use rustc_target::abi::{Int, Pointer, F32, F64};
use rustc_target::abi::{LayoutOf, PointeeInfo, Scalar, Size, TyAndLayoutMethods, Variants};
+use tracing::debug;
use std::fmt::Write;
cc = "1.0.1"
num_cpus = "1.0"
memmap = "0.7"
-log = { package = "tracing", version = "0.1" }
+tracing = "0.1"
libc = "0.2.50"
jobserver = "0.1.11"
tempfile = "3.1"
if let Some(implib_name) = implib_name {
let implib = out_filename.parent().map(|dir| dir.join(&implib_name));
if let Some(implib) = implib {
- self.linker_arg(&format!("--out-implib,{}", (*implib).to_str().unwrap()));
+ self.linker_arg(&format!("--out-implib={}", (*implib).to_str().unwrap()));
}
}
}
#[macro_use]
extern crate rustc_macros;
#[macro_use]
-extern crate log;
+extern crate tracing;
#[macro_use]
extern crate rustc_middle;
use crate::traits::*;
use crate::MemFlags;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_hir::lang_items;
use rustc_index::vec::Idx;
use rustc_middle::mir;
use super::BackendTypes;
use crate::mir::operand::OperandRef;
use crate::mir::place::PlaceRef;
-use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece};
+use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
use rustc_hir::def_id::DefId;
use rustc_hir::{GlobalAsm, LlvmInlineAsmInner};
use rustc_middle::ty::Instance;
[dependencies]
ena = "0.14"
indexmap = "1.5.1"
-log = { package = "tracing", version = "0.1" }
+tracing = "0.1"
jobserver_crate = { version = "0.1.13", package = "jobserver" }
lazy_static = "1"
once_cell = { version = "1", features = ["parking_lot"] }
bitflags = "1.2.1"
measureme = "0.7.1"
libc = "0.2"
-stacker = "0.1.9"
+stacker = "0.1.11"
tempfile = "3.0.5"
[dependencies.parking_lot]
#![allow(rustc::default_hash_types)]
#[macro_use]
-extern crate log;
+extern crate tracing;
#[macro_use]
extern crate cfg_if;
#[macro_use]
pub extern crate rustc_plugin_impl as plugin;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_codegen_ssa::{traits::CodegenBackend, CodegenResults};
use rustc_data_structures::profiling::print_time_passes_entry;
use rustc_data_structures::sync::SeqCst;
//! The various pretty-printing routines.
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast_pretty::pprust;
use rustc_errors::ErrorReported;
use rustc_hir as hir;
An non-ascii identifier was used in an invalid context.
-Erroneous code example:
+Erroneous code examples:
```compile_fail,E0754
# #![feature(non_ascii_idents)]
-mod řųśť;
-// ^ error!
-fn main() {}
-```
-
-```compile_fail,E0754
-# #![feature(non_ascii_idents)]
+mod řųśť; // error!
#[no_mangle]
-fn řųśť() {}
-// ^ error!
+fn řųśť() {} // error!
+
fn main() {}
```
-Non-ascii can be used as module names if it is inline
-or a #\[path\] attribute is specified. For example:
+Non-ascii can be used as module names if it is inlined or if a `#[path]`
+attribute is specified. For example:
```
# #![feature(non_ascii_idents)]
-mod řųśť {
+mod řųśť { // ok!
const IS_GREAT: bool = true;
}
}
/// Adds a span/label to be included in the resulting snippet.
- /// This label will be shown together with the original span/label used when creating the
- /// diagnostic, *not* a span added by one of the `span_*` methods.
///
- /// This is pushed onto the `MultiSpan` that was created when the
- /// diagnostic was first built. If you don't call this function at
- /// all, and you just supplied a `Span` to create the diagnostic,
- /// then the snippet will just include that `Span`, which is
- /// called the primary span.
+ /// This is pushed onto the [`MultiSpan`] that was created when the diagnostic
+ /// was first built. That means it will be shown together with the original
+ /// span/label, *not* a span added by one of the `span_{note,warn,help,suggestions}` methods.
+ ///
+ /// This span is *not* considered a ["primary span"][`MultiSpan`]; only
+ /// the `Span` supplied when creating the diagnostic is primary.
+ ///
+ /// [`MultiSpan`]: ../rustc_span/struct.MultiSpan.html
pub fn span_label<T: Into<String>>(&mut self, span: Span, label: T) -> &mut Self {
self.span.push_span_label(span, label.into());
self
}
/// Adds a span/label to be included in the resulting snippet.
- /// This is pushed onto the `MultiSpan` that was created when the
- /// diagnostic was first built. If you don't call this function at
- /// all, and you just supplied a `Span` to create the diagnostic,
- /// then the snippet will just include that `Span`, which is
- /// called the primary span.
+ ///
+ /// This is pushed onto the [`MultiSpan`] that was created when the diagnostic
+ /// was first built. That means it will be shown together with the original
+ /// span/label, *not* a span added by one of the `span_{note,warn,help,suggestions}` methods.
+ ///
+ /// This span is *not* considered a ["primary span"][`MultiSpan`]; only
+ /// the `Span` supplied when creating the diagnostic is primary.
+ ///
+ /// [`MultiSpan`]: ../rustc_span/struct.MultiSpan.html
pub fn span_label(&mut self, span: Span, label: impl Into<String>) -> &mut Self {
self.0.diagnostic.span_label(span, label);
self
use crate::expand::{self, AstFragment, Invocation};
use crate::module::DirectoryOwnership;
-use rustc_ast::ast::{self, Attribute, NodeId, PatKind};
use rustc_ast::mut_visit::{self, MutVisitor};
use rustc_ast::ptr::P;
use rustc_ast::token;
use rustc_ast::tokenstream::{self, TokenStream};
use rustc_ast::visit::{AssocCtxt, Visitor};
+use rustc_ast::{self as ast, Attribute, NodeId, PatKind};
use rustc_attr::{self as attr, Deprecation, HasAttrs, Stability};
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::{self, Lrc};
use crate::base::ExtCtxt;
-use rustc_ast::ast::{self, AttrVec, BlockCheckMode, Expr, PatKind, UnOp};
use rustc_ast::attr;
use rustc_ast::ptr::P;
+use rustc_ast::{self as ast, AttrVec, BlockCheckMode, Expr, PatKind, UnOp};
use rustc_span::source_map::{respan, Spanned};
use rustc_span::symbol::{kw, sym, Ident, Symbol};
//! Conditional compilation stripping.
-use rustc_ast::ast::{self, AttrItem, Attribute, MetaItem};
use rustc_ast::attr::HasAttrs;
use rustc_ast::mut_visit::*;
use rustc_ast::ptr::P;
+use rustc_ast::{self as ast, AttrItem, Attribute, MetaItem};
use rustc_attr as attr;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::map_in_place::MapInPlace;
use crate::placeholders::{placeholder, PlaceholderExpander};
use crate::proc_macro::collect_derives;
-use rustc_ast::ast::{self, AttrItem, Block, LitKind, NodeId, PatKind, Path};
-use rustc_ast::ast::{ItemKind, MacArgs, MacStmtStyle, StmtKind};
use rustc_ast::mut_visit::*;
use rustc_ast::ptr::P;
use rustc_ast::token;
use rustc_ast::tokenstream::TokenStream;
use rustc_ast::visit::{self, AssocCtxt, Visitor};
+use rustc_ast::{self as ast, AttrItem, Block, LitKind, NodeId, PatKind, Path};
+use rustc_ast::{ItemKind, MacArgs, MacStmtStyle, StmtKind};
use rustc_ast_pretty::pprust;
use rustc_attr::{self as attr, is_builtin_attr, HasAttrs};
use rustc_data_structures::map_in_place::MapInPlace;
/// e.g., `$var`
MetaVar(Span, Ident),
/// e.g., `$var:expr`. This is only used in the left hand side of MBE macros.
- MetaVarDecl(Span, Ident /* name to bind */, Option<NonterminalKind>),
+ MetaVarDecl(Span, Ident /* name to bind */, NonterminalKind),
}
impl TokenTree {
//! bound.
use crate::mbe::{KleeneToken, TokenTree};
-use rustc_ast::ast::{NodeId, DUMMY_NODE_ID};
use rustc_ast::token::{DelimToken, Token, TokenKind};
+use rustc_ast::{NodeId, DUMMY_NODE_ID};
use rustc_data_structures::fx::FxHashMap;
use rustc_session::lint::builtin::META_VARIABLE_MISUSE;
use rustc_session::parse::ParseSess;
n_rec(sess, next_m, res.by_ref(), ret_val)?;
}
}
- TokenTree::MetaVarDecl(span, _, None) => {
- if sess.missing_fragment_specifiers.borrow_mut().remove(&span).is_some() {
- return Err((span, "missing fragment specifier".to_string()));
- }
- }
TokenTree::MetaVarDecl(sp, bind_name, _) => match ret_val
.entry(MacroRulesNormalizedIdent::new(bind_name))
{
///
/// A `ParseResult`. Note that matches are kept track of through the items generated.
fn inner_parse_loop<'root, 'tt>(
- sess: &ParseSess,
cur_items: &mut SmallVec<[MatcherPosHandle<'root, 'tt>; 1]>,
next_items: &mut Vec<MatcherPosHandle<'root, 'tt>>,
eof_items: &mut SmallVec<[MatcherPosHandle<'root, 'tt>; 1]>,
})));
}
- // We need to match a metavar (but the identifier is invalid)... this is an error
- TokenTree::MetaVarDecl(span, _, None) => {
- if sess.missing_fragment_specifiers.borrow_mut().remove(&span).is_some() {
- return Error(span, "missing fragment specifier".to_string());
- }
- }
-
// We need to match a metavar with a valid ident... call out to the black-box
// parser by adding an item to `bb_items`.
- TokenTree::MetaVarDecl(_, _, Some(kind)) => {
+ TokenTree::MetaVarDecl(_, _, kind) => {
// Built-in nonterminals never start with these tokens,
// so we can eliminate them from consideration.
if Parser::nonterminal_may_begin_with(kind, token) {
// parsing from the black-box parser done. The result is that `next_items` will contain a
// bunch of possible next matcher positions in `next_items`.
match inner_parse_loop(
- parser.sess,
&mut cur_items,
&mut next_items,
&mut eof_items,
let nts = bb_items
.iter()
.map(|item| match item.top_elts.get_tt(item.idx) {
- TokenTree::MetaVarDecl(_, bind, Some(kind)) => format!("{} ('{}')", kind, bind),
+ TokenTree::MetaVarDecl(_, bind, kind) => format!("{} ('{}')", kind, bind),
_ => panic!(),
})
.collect::<Vec<String>>()
assert_eq!(bb_items.len(), 1);
let mut item = bb_items.pop().unwrap();
- if let TokenTree::MetaVarDecl(span, _, Some(kind)) = item.top_elts.get_tt(item.idx) {
+ if let TokenTree::MetaVarDecl(span, _, kind) = item.top_elts.get_tt(item.idx) {
let match_cur = item.match_cur;
let nt = match parser.to_mut().parse_nonterminal(kind) {
Err(mut err) => {
use crate::mbe::macro_parser::{MatchedNonterminal, MatchedSeq};
use crate::mbe::transcribe::transcribe;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::token::{self, NonterminalKind, NtTT, Token, TokenKind::*};
use rustc_ast::tokenstream::{DelimSpan, TokenStream};
use rustc_ast_pretty::pprust;
let diag = &sess.parse_sess.span_diagnostic;
let lhs_nm = Ident::new(sym::lhs, def.span);
let rhs_nm = Ident::new(sym::rhs, def.span);
- let tt_spec = Some(NonterminalKind::TT);
+ let tt_spec = NonterminalKind::TT;
// Parse the macro_rules! invocation
let (macro_rules, body) = match &def.kind {
TokenTree::Sequence(span, ref seq) => {
if seq.separator.is_none()
&& seq.tts.iter().all(|seq_tt| match *seq_tt {
- TokenTree::MetaVarDecl(_, _, Some(NonterminalKind::Vis)) => true,
+ TokenTree::MetaVarDecl(_, _, NonterminalKind::Vis) => true,
TokenTree::Sequence(_, ref sub_seq) => {
sub_seq.kleene.op == mbe::KleeneOp::ZeroOrMore
|| sub_seq.kleene.op == mbe::KleeneOp::ZeroOrOne
// Now `last` holds the complete set of NT tokens that could
// end the sequence before SUFFIX. Check that every one works with `suffix`.
for token in &last.tokens {
- if let TokenTree::MetaVarDecl(_, name, Some(kind)) = *token {
+ if let TokenTree::MetaVarDecl(_, name, kind) = *token {
for next_token in &suffix_first.tokens {
match is_in_follow(next_token, kind) {
IsInFollow::Yes => {}
}
fn token_can_be_followed_by_any(tok: &mbe::TokenTree) -> bool {
- if let mbe::TokenTree::MetaVarDecl(_, _, Some(kind)) = *tok {
+ if let mbe::TokenTree::MetaVarDecl(_, _, kind) = *tok {
frag_can_be_followed_by_any(kind)
} else {
// (Non NT's can always be followed by anything in matchers.)
}
_ => IsInFollow::No(TOKENS),
},
- TokenTree::MetaVarDecl(_, _, Some(NonterminalKind::Block)) => IsInFollow::Yes,
+ TokenTree::MetaVarDecl(_, _, NonterminalKind::Block) => IsInFollow::Yes,
_ => IsInFollow::No(TOKENS),
}
}
TokenTree::MetaVarDecl(
_,
_,
- Some(NonterminalKind::Ident | NonterminalKind::Ty | NonterminalKind::Path),
+ NonterminalKind::Ident | NonterminalKind::Ty | NonterminalKind::Path,
) => IsInFollow::Yes,
_ => IsInFollow::No(TOKENS),
}
match *tt {
mbe::TokenTree::Token(ref token) => pprust::token_to_string(&token),
mbe::TokenTree::MetaVar(_, name) => format!("${}", name),
- mbe::TokenTree::MetaVarDecl(_, name, Some(kind)) => format!("${}:{}", name, kind),
- mbe::TokenTree::MetaVarDecl(_, name, None) => format!("${}:", name),
+ mbe::TokenTree::MetaVarDecl(_, name, kind) => format!("${}:{}", name, kind),
_ => panic!(
"unexpected mbe::TokenTree::{{Sequence or Delimited}} \
in follow set checker"
use crate::mbe::macro_parser;
use crate::mbe::{Delimited, KleeneOp, KleeneToken, SequenceRepetition, TokenTree};
-use rustc_ast::ast::{NodeId, DUMMY_NODE_ID};
use rustc_ast::token::{self, Token};
use rustc_ast::tokenstream;
+use rustc_ast::NodeId;
use rustc_ast_pretty::pprust;
use rustc_session::parse::ParseSess;
use rustc_span::symbol::{kw, Ident};
.emit();
token::NonterminalKind::Ident
});
- result.push(TokenTree::MetaVarDecl(span, ident, Some(kind)));
+ result.push(TokenTree::MetaVarDecl(span, ident, kind));
continue;
}
_ => token.span,
}
tree => tree.as_ref().map(tokenstream::TokenTree::span).unwrap_or(start_sp),
};
- if node_id != DUMMY_NODE_ID {
- // Macros loaded from other crates have dummy node ids.
- sess.missing_fragment_specifiers.borrow_mut().insert(span, node_id);
- }
- result.push(TokenTree::MetaVarDecl(span, ident, None));
+ sess.span_diagnostic.struct_span_err(span, "missing fragment specifier").emit();
+ continue;
}
// Not a metavar or no matchers allowed, so just return the tree
use crate::mbe;
use crate::mbe::macro_parser::{MatchedNonterminal, MatchedSeq, NamedMatch};
-use rustc_ast::ast::MacCall;
use rustc_ast::mut_visit::{self, MutVisitor};
use rustc_ast::token::{self, NtTT, Token};
use rustc_ast::tokenstream::{DelimSpan, TokenStream, TokenTree, TreeAndJoint};
+use rustc_ast::MacCall;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::Lrc;
use rustc_errors::{pluralize, PResult};
-use rustc_ast::ast::{Attribute, Mod};
-use rustc_ast::token;
+use rustc_ast::{token, Attribute, Mod};
use rustc_errors::{struct_span_err, PResult};
use rustc_parse::new_parser_from_file;
use rustc_session::parse::ParseSess;
use crate::tests::{matches_codepattern, string_to_crate};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::mut_visit::{self, MutVisitor};
use rustc_ast_pretty::pprust;
use rustc_span::symbol::Ident;
use crate::tests::{matches_codepattern, string_to_stream, with_error_checking_parse};
-use rustc_ast::ast::{self, PatKind};
use rustc_ast::ptr::P;
use rustc_ast::token::{self, Token};
use rustc_ast::tokenstream::{DelimSpan, TokenStream, TokenTree};
use rustc_ast::visit;
+use rustc_ast::{self as ast, PatKind};
use rustc_ast_pretty::pprust::item_to_string;
use rustc_errors::PResult;
use rustc_parse::new_parser_from_source_str;
use crate::base::ExtCtxt;
use crate::expand::{AstFragment, AstFragmentKind};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::mut_visit::*;
use rustc_ast::ptr::P;
use rustc_span::source_map::{dummy_spanned, DUMMY_SP};
use crate::base::{self, *};
use crate::proc_macro_server;
-use rustc_ast::ast::{self, ItemKind, MetaItemKind, NestedMetaItem};
use rustc_ast::token;
use rustc_ast::tokenstream::{TokenStream, TokenTree};
+use rustc_ast::{self as ast, *};
use rustc_data_structures::sync::Lrc;
use rustc_errors::{Applicability, ErrorReported};
use rustc_parse::nt_to_tokenstream;
use crate::base::ExtCtxt;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::token;
use rustc_ast::tokenstream::{self, DelimSpan, IsJoint::*, TokenStream, TreeAndJoint};
use rustc_ast_pretty::pprust;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::tokenstream::TokenStream;
use rustc_parse::{new_parser_from_source_str, parser::Parser, source_file_to_stream};
use rustc_session::parse::ParseSess;
[few] hir_krate: rustc_hir::Crate<$tcx>,
[] arm: rustc_hir::Arm<$tcx>,
[] asm_operand: rustc_hir::InlineAsmOperand<$tcx>,
- [] asm_template: rustc_ast::ast::InlineAsmTemplatePiece,
- [] attribute: rustc_ast::ast::Attribute,
+ [] asm_template: rustc_ast::InlineAsmTemplatePiece,
+ [] attribute: rustc_ast::Attribute,
[] block: rustc_hir::Block<$tcx>,
[] bare_fn_ty: rustc_hir::BareFnTy<$tcx>,
[few] global_asm: rustc_hir::GlobalAsm,
use crate::def_id::{DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
use crate::hir;
-use rustc_ast::ast;
-use rustc_ast::ast::NodeId;
+use rustc_ast as ast;
+use rustc_ast::NodeId;
use rustc_macros::HashStable_Generic;
use rustc_span::hygiene::MacroKind;
use crate::def::{DefKind, Namespace, Res};
use crate::def_id::DefId;
crate use crate::hir_id::HirId;
-use crate::itemlikevisit;
+use crate::{itemlikevisit, LangItem};
-use rustc_ast::ast::{self, CrateSugar, LlvmAsmDialect};
-use rustc_ast::ast::{AttrVec, Attribute, FloatTy, IntTy, Label, LitKind, StrStyle, UintTy};
-pub use rustc_ast::ast::{BorrowKind, ImplPolarity, IsAuto};
-pub use rustc_ast::ast::{CaptureBy, Movability, Mutability};
-use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece};
use rustc_ast::node_id::NodeMap;
use rustc_ast::util::parser::ExprPrecedence;
+use rustc_ast::{self as ast, CrateSugar, LlvmAsmDialect};
+use rustc_ast::{AttrVec, Attribute, FloatTy, IntTy, Label, LitKind, StrStyle, UintTy};
+pub use rustc_ast::{BorrowKind, ImplPolarity, IsAuto};
+pub use rustc_ast::{CaptureBy, Movability, Mutability};
+use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
use rustc_data_structures::sync::{par_for_each_in, Send, Sync};
use rustc_macros::HashStable_Generic;
use rustc_span::def_id::LocalDefId;
-use rustc_span::source_map::{SourceMap, Spanned};
+use rustc_span::source_map::Spanned;
use rustc_span::symbol::{kw, sym, Ident, Symbol};
use rustc_span::{MultiSpan, Span, DUMMY_SP};
use rustc_target::asm::InlineAsmRegOrRegClass;
#[derive(Debug, HashStable_Generic)]
pub enum GenericBound<'hir> {
Trait(PolyTraitRef<'hir>, TraitBoundModifier),
+ // FIXME(davidtwco): Introduce `PolyTraitRef::LangItem`
+ LangItemTrait(LangItem, Span, HirId, &'hir GenericArgs<'hir>),
Outlives(Lifetime),
}
pub fn span(&self) -> Span {
match self {
&GenericBound::Trait(ref t, ..) => t.span,
+ &GenericBound::LangItemTrait(_, span, ..) => span,
&GenericBound::Outlives(ref l) => l.span,
}
}
self.is_place_expr(|_| true)
}
- // Whether this is a place expression.
- // `allow_projections_from` should return `true` if indexing a field or
- // index expression based on the given expression should be considered a
- // place expression.
+ /// Whether this is a place expression.
+ ///
+ /// `allow_projections_from` should return `true` if indexing a field or index expression based
+ /// on the given expression should be considered a place expression.
pub fn is_place_expr(&self, mut allow_projections_from: impl FnMut(&Self) -> bool) -> bool {
match self.kind {
ExprKind::Path(QPath::Resolved(_, ref path)) => match path.res {
allow_projections_from(base) || base.is_place_expr(allow_projections_from)
}
+ // Lang item paths cannot currently be local variables or statics.
+ ExprKind::Path(QPath::LangItem(..)) => false,
+
// Partially qualified paths in expressions can only legally
// refer to associated items which are always rvalues.
ExprKind::Path(QPath::TypeRelative(..))
/// Checks if the specified expression is a built-in range literal.
/// (See: `LoweringContext::lower_expr()`).
-///
-/// FIXME(#60607): This function is a hack. If and when we have `QPath::Lang(...)`,
-/// we can use that instead as simpler, more reliable mechanism, as opposed to using `SourceMap`.
-pub fn is_range_literal(sm: &SourceMap, expr: &Expr<'_>) -> bool {
- // Returns whether the given path represents a (desugared) range,
- // either in std or core, i.e. has either a `::std::ops::Range` or
- // `::core::ops::Range` prefix.
- fn is_range_path(path: &Path<'_>) -> bool {
- let segs: Vec<_> = path.segments.iter().map(|seg| seg.ident.to_string()).collect();
- let segs: Vec<_> = segs.iter().map(|seg| &**seg).collect();
-
- // "{{root}}" is the equivalent of `::` prefix in `Path`.
- if let ["{{root}}", std_core, "ops", range] = segs.as_slice() {
- (*std_core == "std" || *std_core == "core") && range.starts_with("Range")
- } else {
- false
- }
- };
-
- // Check whether a span corresponding to a range expression is a
- // range literal, rather than an explicit struct or `new()` call.
- fn is_lit(sm: &SourceMap, span: &Span) -> bool {
- sm.span_to_snippet(*span).map(|range_src| range_src.contains("..")).unwrap_or(false)
- };
-
+pub fn is_range_literal(expr: &Expr<'_>) -> bool {
match expr.kind {
// All built-in range literals but `..=` and `..` desugar to `Struct`s.
- ExprKind::Struct(ref qpath, _, _) => {
- if let QPath::Resolved(None, ref path) = **qpath {
- return is_range_path(&path) && is_lit(sm, &expr.span);
- }
- }
-
- // `..` desugars to its struct path.
- ExprKind::Path(QPath::Resolved(None, ref path)) => {
- return is_range_path(&path) && is_lit(sm, &expr.span);
- }
+ ExprKind::Struct(ref qpath, _, _) => matches!(
+ **qpath,
+ QPath::LangItem(
+ LangItem::Range
+ | LangItem::RangeTo
+ | LangItem::RangeFrom
+ | LangItem::RangeFull
+ | LangItem::RangeToInclusive,
+ _,
+ )
+ ),
// `..=` desugars into `::std::ops::RangeInclusive::new(...)`.
ExprKind::Call(ref func, _) => {
- if let ExprKind::Path(QPath::TypeRelative(ref ty, ref segment)) = func.kind {
- if let TyKind::Path(QPath::Resolved(None, ref path)) = ty.kind {
- let new_call = segment.ident.name == sym::new;
- return is_range_path(&path) && is_lit(sm, &expr.span) && new_call;
- }
- }
+ matches!(func.kind, ExprKind::Path(QPath::LangItem(LangItem::RangeInclusiveNew, _)))
}
- _ => {}
+ _ => false,
}
-
- false
}
#[derive(Debug, HashStable_Generic)]
/// `<Vec>::new`, and `T::X::Y::method` into `<<<T>::X>::Y>::method`,
/// the `X` and `Y` nodes each being a `TyKind::Path(QPath::TypeRelative(..))`.
TypeRelative(&'hir Ty<'hir>, &'hir PathSegment<'hir>),
+
+ /// Reference to a `#[lang = "foo"]` item.
+ LangItem(LangItem, Span),
+}
+
+impl<'hir> QPath<'hir> {
+ /// Returns the span of this `QPath`.
+ pub fn span(&self) -> Span {
+ match *self {
+ QPath::Resolved(_, path) => path.span,
+ QPath::TypeRelative(_, ps) => ps.ident.span,
+ QPath::LangItem(_, span) => span,
+ }
+ }
+
+ /// Returns the span of the qself of this `QPath`. For example, `()` in
+ /// `<() as Trait>::method`.
+ pub fn qself_span(&self) -> Span {
+ match *self {
+ QPath::Resolved(_, path) => path.span,
+ QPath::TypeRelative(qself, _) => qself.span,
+ QPath::LangItem(_, span) => span,
+ }
+ }
+
+ /// Returns the span of the last segment of this `QPath`. For example, `method` in
+ /// `<() as Trait>::method`.
+ pub fn last_segment_span(&self) -> Span {
+ match *self {
+ QPath::Resolved(_, path) => path.segments.last().unwrap().ident.span,
+ QPath::TypeRelative(_, segment) => segment.ident.span,
+ QPath::LangItem(_, span) => span,
+ }
+ }
}
/// Hints at the original code for a let statement.
use crate::hir::*;
use crate::hir_id::CRATE_HIR_ID;
use crate::itemlikevisit::{ItemLikeVisitor, ParItemLikeVisitor};
-use rustc_ast::ast::{Attribute, Label};
use rustc_ast::walk_list;
+use rustc_ast::{Attribute, Label};
use rustc_span::symbol::{Ident, Symbol};
use rustc_span::Span;
visitor.visit_ty(qself);
visitor.visit_path_segment(span, segment);
}
+ QPath::LangItem(..) => {}
}
}
GenericBound::Trait(ref typ, modifier) => {
visitor.visit_poly_trait_ref(typ, modifier);
}
+ GenericBound::LangItemTrait(_, span, hir_id, args) => {
+ visitor.visit_id(hir_id);
+ visitor.visit_generic_args(span, args);
+ }
GenericBound::Outlives(ref lifetime) => visitor.visit_lifetime(lifetime),
}
}
pub use self::LangItem::*;
use crate::def_id::DefId;
-use crate::Target;
+use crate::{MethodKind, Target};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_macros::HashStable_Generic;
CountCodeRegionFnLangItem, sym::count_code_region, count_code_region_fn, Target::Fn;
CoverageCounterAddFnLangItem, sym::coverage_counter_add, coverage_counter_add_fn, Target::Fn;
CoverageCounterSubtractFnLangItem, sym::coverage_counter_subtract, coverage_counter_subtract_fn, Target::Fn;
+
+ // Language items from AST lowering
+ TryFromError, sym::from_error, from_error_fn, Target::Method(MethodKind::Trait { body: false });
+ TryFromOk, sym::from_ok, from_ok_fn, Target::Method(MethodKind::Trait { body: false });
+ TryIntoResult, sym::into_result, into_result_fn, Target::Method(MethodKind::Trait { body: false });
+
+ PollReady, sym::Ready, poll_ready_variant, Target::Variant;
+ PollPending, sym::Pending, poll_pending_variant, Target::Variant;
+
+ FromGenerator, sym::from_generator, from_generator_fn, Target::Fn;
+ GetContext, sym::get_context, get_context_fn, Target::Fn;
+
+ FuturePoll, sym::poll, future_poll_fn, Target::Method(MethodKind::Trait { body: false });
+
+ FromFrom, sym::from, from_fn, Target::Method(MethodKind::Trait { body: false });
+
+ OptionSome, sym::Some, option_some_variant, Target::Variant;
+ OptionNone, sym::None, option_none_variant, Target::Variant;
+
+ ResultOk, sym::Ok, result_ok_variant, Target::Variant;
+ ResultErr, sym::Err, result_err_variant, Target::Variant;
+
+ IntoIterIntoIter, sym::into_iter, into_iter_fn, Target::Method(MethodKind::Trait { body: false });
+ IteratorNext, sym::next, next_fn, Target::Method(MethodKind::Trait { body: false});
+
+ PinNewUnchecked, sym::new_unchecked, new_unchecked_fn, Target::Method(MethodKind::Inherent);
+
+ RangeFrom, sym::RangeFrom, range_from_struct, Target::Struct;
+ RangeFull, sym::RangeFull, range_full_struct, Target::Struct;
+ RangeInclusiveStruct, sym::RangeInclusive, range_inclusive_struct, Target::Struct;
+ RangeInclusiveNew, sym::range_inclusive_new, range_inclusive_new_method, Target::Method(MethodKind::Inherent);
+ Range, sym::Range, range_struct, Target::Struct;
+ RangeToInclusive, sym::RangeToInclusive, range_to_inclusive_struct, Target::Struct;
+ RangeTo, sym::RangeTo, range_to_struct, Target::Struct;
}
TyAlias,
OpaqueTy,
Enum,
+ Variant,
Struct,
Union,
Trait,
Target::TyAlias => "type alias",
Target::OpaqueTy => "opaque type",
Target::Enum => "enum",
+ Target::Variant => "enum variant",
Target::Struct => "struct",
Target::Union => "union",
Target::Trait => "trait",
use crate::def_id::DefId;
use crate::{lang_items, LangItem, LanguageItems};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_data_structures::fx::FxHashMap;
use rustc_span::symbol::{sym, Symbol};
#![feature(or_patterns)]
#![recursion_limit = "256"]
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::util::parser::{self, AssocOp, Fixity};
use rustc_ast_pretty::pp::Breaks::{Consistent, Inconsistent};
use rustc_ast_pretty::pp::{self, Breaks};
colons_before_params,
)
}
+ hir::QPath::LangItem(lang_item, span) => {
+ self.s.word("#[lang = \"");
+ self.print_ident(Ident::new(lang_item.name(), span));
+ self.s.word("\"]");
+ }
}
}
}
self.print_poly_trait_ref(tref);
}
+ GenericBound::LangItemTrait(lang_item, span, ..) => {
+ self.s.word("#[lang = \"");
+ self.print_ident(Ident::new(lang_item.name(), *span));
+ self.s.word("\"]");
+ }
GenericBound::Outlives(lt) => {
self.print_lifetime(lt);
}
//! fn baz() { foo(); }
//! ```
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::graph::implementation::{Direction, NodeIndex, INCOMING, OUTGOING};
use rustc_graphviz as dot;
//! allows for doing a more fine-grained check to see if pre- or post-lto data
//! was re-used.
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_hir::def_id::LOCAL_CRATE;
use rustc_middle::mir::mono::CodegenUnitNameBuilder;
use rustc_middle::ty::TyCtxt;
//! Errors are reported if we are in the suitable configuration but
//! the required condition is not met.
-use rustc_ast::ast::{self, Attribute, NestedMetaItem};
+use rustc_ast::{self as ast, Attribute, NestedMetaItem};
use rustc_data_structures::fingerprint::Fingerprint;
use rustc_data_structures::fx::FxHashSet;
use rustc_hir as hir;
use crate::traits::{Obligation, PredicateObligations};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_hir::def_id::DefId;
use rustc_middle::traits::ObligationCause;
use rustc_middle::ty::error::TypeError;
pub use crate::passes::BoxedResolver;
use crate::util;
-use rustc_ast::ast::{self, MetaItemKind};
use rustc_ast::token;
+use rustc_ast::{self as ast, MetaItemKind};
use rustc_codegen_ssa::traits::CodegenBackend;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::sync::Lrc;
use once_cell::sync::Lazy;
use rustc_ast::mut_visit::MutVisitor;
-use rustc_ast::{self, ast, visit};
+use rustc_ast::{self as ast, visit};
use rustc_codegen_ssa::back::link::emit_metadata;
use rustc_codegen_ssa::traits::CodegenBackend;
use rustc_data_structures::sync::{par_iter, Lrc, OnceCell, ParallelIterator, WorkerLocal};
use rustc_plugin_impl as plugin;
use rustc_resolve::{Resolver, ResolverArenas};
use rustc_session::config::{CrateType, Input, OutputFilenames, OutputType, PpMode, PpSourceMode};
-use rustc_session::lint;
use rustc_session::output::{filename_for_input, filename_for_metadata};
use rustc_session::search_paths::PathKind;
use rustc_session::Session;
ecx.check_unused_macros();
});
- let mut missing_fragment_specifiers: Vec<_> = ecx
- .sess
- .parse_sess
- .missing_fragment_specifiers
- .borrow()
- .iter()
- .map(|(span, node_id)| (*span, *node_id))
- .collect();
- missing_fragment_specifiers.sort_unstable_by_key(|(span, _)| *span);
-
- let recursion_limit_hit = ecx.reduced_recursion_limit.is_some();
-
- for (span, node_id) in missing_fragment_specifiers {
- let lint = lint::builtin::MISSING_FRAGMENT_SPECIFIER;
- let msg = "missing fragment specifier";
- resolver.lint_buffer().buffer_lint(lint, node_id, span, msg);
- }
if cfg!(windows) {
env::set_var("PATH", &old_path);
}
+ let recursion_limit_hit = ecx.reduced_recursion_limit.is_some();
if recursion_limit_hit {
// If we hit a recursion limit, exit early to avoid later passes getting overwhelmed
// with a large AST
use crate::interface::{Compiler, Result};
use crate::passes::{self, BoxedResolver, QueryContext};
-use rustc_ast::{self, ast};
+use rustc_ast as ast;
use rustc_codegen_ssa::traits::CodegenBackend;
use rustc_data_structures::sync::{Lrc, OnceCell, WorkerLocal};
use rustc_errors::ErrorReported;
-use rustc_ast::ast::{AttrVec, BlockCheckMode};
use rustc_ast::mut_visit::{visit_clobber, MutVisitor, *};
use rustc_ast::ptr::P;
use rustc_ast::util::lev_distance::find_best_match_for_name;
-use rustc_ast::{self, ast};
+use rustc_ast::{self as ast, AttrVec, BlockCheckMode};
use rustc_codegen_ssa::traits::CodegenBackend;
use rustc_data_structures::fingerprint::Fingerprint;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use crate::{
types::CItemKind, EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext,
};
-use rustc_ast::ast::{self, Expr};
use rustc_ast::attr::{self, HasAttrs};
use rustc_ast::tokenstream::{TokenStream, TokenTree};
use rustc_ast::visit::{FnCtxt, FnKind};
+use rustc_ast::{self as ast, *};
use rustc_ast_pretty::pprust::{self, expr_to_string};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
+use rustc_data_structures::stack::ensure_sufficient_stack;
use rustc_errors::{Applicability, DiagnosticBuilder, DiagnosticStyledString};
use rustc_feature::{deprecated_attributes, AttributeGate, AttributeTemplate, AttributeType};
use rustc_feature::{GateIssue, Stability};
_ => false,
}
}
- hir::QPath::Resolved(..) => false,
+ hir::QPath::Resolved(..) | hir::QPath::LangItem(..) => false,
}
}
return;
}
- use self::ast::{PatKind, RangeEnd, RangeSyntax::DotDotDot};
+ use self::ast::{PatKind, RangeSyntax::DotDotDot};
/// If `pat` is a `...` pattern, return the start and end of the range, as well as the span
/// corresponding to the ellipsis.
/// Test if this constant is all-0.
fn is_zero(expr: &hir::Expr<'_>) -> bool {
use hir::ExprKind::*;
- use rustc_ast::ast::LitKind::*;
+ use rustc_ast::LitKind::*;
match &expr.kind {
Lit(lit) => {
if let Int(i, _) = lit.node {
b: Ty<'tcx>,
ckind: CItemKind,
) -> bool {
- debug!("structurally_same_type(cx, a = {:?}, b = {:?})", a, b);
- let tcx = cx.tcx;
- if a == b || rustc_middle::ty::TyS::same_type(a, b) {
- // All nominally-same types are structurally same, too.
- true
- } else {
- // Do a full, depth-first comparison between the two.
- use rustc_middle::ty::TyKind::*;
- let a_kind = &a.kind;
- let b_kind = &b.kind;
-
- let compare_layouts = |a, b| -> bool {
- let a_layout = &cx.layout_of(a).unwrap().layout.abi;
- let b_layout = &cx.layout_of(b).unwrap().layout.abi;
- debug!("{:?} == {:?} = {}", a_layout, b_layout, a_layout == b_layout);
- a_layout == b_layout
- };
+ fn structurally_same_type_impl<'tcx>(
+ seen_types: &mut FxHashSet<(Ty<'tcx>, Ty<'tcx>)>,
+ cx: &LateContext<'tcx>,
+ a: Ty<'tcx>,
+ b: Ty<'tcx>,
+ ckind: CItemKind,
+ ) -> bool {
+ debug!("structurally_same_type_impl(cx, a = {:?}, b = {:?})", a, b);
+ if !seen_types.insert((a, b)) {
+ // We've encountered a cycle. There's no point going any further -- the types are
+ // structurally the same.
+ return true;
+ }
+ let tcx = cx.tcx;
+ if a == b || rustc_middle::ty::TyS::same_type(a, b) {
+ // All nominally-same types are structurally same, too.
+ true
+ } else {
+ // Do a full, depth-first comparison between the two.
+ use rustc_middle::ty::TyKind::*;
+ let a_kind = &a.kind;
+ let b_kind = &b.kind;
+
+ let compare_layouts = |a, b| -> bool {
+ let a_layout = &cx.layout_of(a).unwrap().layout.abi;
+ let b_layout = &cx.layout_of(b).unwrap().layout.abi;
+ debug!("{:?} == {:?} = {}", a_layout, b_layout, a_layout == b_layout);
+ a_layout == b_layout
+ };
+
+ #[allow(rustc::usage_of_ty_tykind)]
+ let is_primitive_or_pointer = |kind: &ty::TyKind<'_>| {
+ kind.is_primitive() || matches!(kind, RawPtr(..) | Ref(..))
+ };
- #[allow(rustc::usage_of_ty_tykind)]
- let is_primitive_or_pointer =
- |kind: &ty::TyKind<'_>| kind.is_primitive() || matches!(kind, RawPtr(..));
-
- match (a_kind, b_kind) {
- (Adt(_, a_substs), Adt(_, b_substs)) => {
- let a = a.subst(cx.tcx, a_substs);
- let b = b.subst(cx.tcx, b_substs);
- debug!("Comparing {:?} and {:?}", a, b);
-
- if let (Adt(a_def, ..), Adt(b_def, ..)) = (&a.kind, &b.kind) {
- // Grab a flattened representation of all fields.
- let a_fields = a_def.variants.iter().flat_map(|v| v.fields.iter());
- let b_fields = b_def.variants.iter().flat_map(|v| v.fields.iter());
- compare_layouts(a, b)
+ ensure_sufficient_stack(|| {
+ match (a_kind, b_kind) {
+ (Adt(a_def, a_substs), Adt(b_def, b_substs)) => {
+ let a = a.subst(cx.tcx, a_substs);
+ let b = b.subst(cx.tcx, b_substs);
+ debug!("Comparing {:?} and {:?}", a, b);
+
+ // Grab a flattened representation of all fields.
+ let a_fields = a_def.variants.iter().flat_map(|v| v.fields.iter());
+ let b_fields = b_def.variants.iter().flat_map(|v| v.fields.iter());
+ compare_layouts(a, b)
&& a_fields.eq_by(
b_fields,
|&ty::FieldDef { did: a_did, .. },
&ty::FieldDef { did: b_did, .. }| {
- Self::structurally_same_type(
+ structurally_same_type_impl(
+ seen_types,
cx,
tcx.type_of(a_did),
tcx.type_of(b_did),
)
},
)
- } else {
- unreachable!()
- }
- }
- (Array(a_ty, a_const), Array(b_ty, b_const)) => {
- // For arrays, we also check the constness of the type.
- a_const.val == b_const.val
- && Self::structurally_same_type(cx, a_const.ty, b_const.ty, ckind)
- && Self::structurally_same_type(cx, a_ty, b_ty, ckind)
- }
- (Slice(a_ty), Slice(b_ty)) => Self::structurally_same_type(cx, a_ty, b_ty, ckind),
- (RawPtr(a_tymut), RawPtr(b_tymut)) => {
- a_tymut.mutbl == b_tymut.mutbl
- && Self::structurally_same_type(cx, &a_tymut.ty, &b_tymut.ty, ckind)
- }
- (Ref(_a_region, a_ty, a_mut), Ref(_b_region, b_ty, b_mut)) => {
- // For structural sameness, we don't need the region to be same.
- a_mut == b_mut && Self::structurally_same_type(cx, a_ty, b_ty, ckind)
- }
- (FnDef(..), FnDef(..)) => {
- let a_poly_sig = a.fn_sig(tcx);
- let b_poly_sig = b.fn_sig(tcx);
-
- // As we don't compare regions, skip_binder is fine.
- let a_sig = a_poly_sig.skip_binder();
- let b_sig = b_poly_sig.skip_binder();
-
- (a_sig.abi, a_sig.unsafety, a_sig.c_variadic)
- == (b_sig.abi, b_sig.unsafety, b_sig.c_variadic)
- && a_sig.inputs().iter().eq_by(b_sig.inputs().iter(), |a, b| {
- Self::structurally_same_type(cx, a, b, ckind)
- })
- && Self::structurally_same_type(cx, a_sig.output(), b_sig.output(), ckind)
- }
- (Tuple(a_substs), Tuple(b_substs)) => {
- a_substs.types().eq_by(b_substs.types(), |a_ty, b_ty| {
- Self::structurally_same_type(cx, a_ty, b_ty, ckind)
- })
- }
- // For these, it's not quite as easy to define structural-sameness quite so easily.
- // For the purposes of this lint, take the conservative approach and mark them as
- // not structurally same.
- (Dynamic(..), Dynamic(..))
- | (Error(..), Error(..))
- | (Closure(..), Closure(..))
- | (Generator(..), Generator(..))
- | (GeneratorWitness(..), GeneratorWitness(..))
- | (Projection(..), Projection(..))
- | (Opaque(..), Opaque(..)) => false,
-
- // These definitely should have been caught above.
- (Bool, Bool) | (Char, Char) | (Never, Never) | (Str, Str) => unreachable!(),
-
- // An Adt and a primitive type. This can be FFI-safe is the ADT is an enum with a
- // non-null field.
- (Adt(..), other_kind) | (other_kind, Adt(..))
- if is_primitive_or_pointer(other_kind) =>
- {
- let (primitive, adt) =
- if is_primitive_or_pointer(&a.kind) { (a, b) } else { (b, a) };
- if let Some(ty) = crate::types::repr_nullable_ptr(cx, adt, ckind) {
- ty == primitive
- } else {
- compare_layouts(a, b)
+ }
+ (Array(a_ty, a_const), Array(b_ty, b_const)) => {
+ // For arrays, we also check the constness of the type.
+ a_const.val == b_const.val
+ && structurally_same_type_impl(seen_types, cx, a_ty, b_ty, ckind)
+ }
+ (Slice(a_ty), Slice(b_ty)) => {
+ structurally_same_type_impl(seen_types, cx, a_ty, b_ty, ckind)
+ }
+ (RawPtr(a_tymut), RawPtr(b_tymut)) => {
+ a_tymut.mutbl == b_tymut.mutbl
+ && structurally_same_type_impl(
+ seen_types,
+ cx,
+ &a_tymut.ty,
+ &b_tymut.ty,
+ ckind,
+ )
+ }
+ (Ref(_a_region, a_ty, a_mut), Ref(_b_region, b_ty, b_mut)) => {
+ // For structural sameness, we don't need the region to be same.
+ a_mut == b_mut
+ && structurally_same_type_impl(seen_types, cx, a_ty, b_ty, ckind)
+ }
+ (FnDef(..), FnDef(..)) => {
+ let a_poly_sig = a.fn_sig(tcx);
+ let b_poly_sig = b.fn_sig(tcx);
+
+ // As we don't compare regions, skip_binder is fine.
+ let a_sig = a_poly_sig.skip_binder();
+ let b_sig = b_poly_sig.skip_binder();
+
+ (a_sig.abi, a_sig.unsafety, a_sig.c_variadic)
+ == (b_sig.abi, b_sig.unsafety, b_sig.c_variadic)
+ && a_sig.inputs().iter().eq_by(b_sig.inputs().iter(), |a, b| {
+ structurally_same_type_impl(seen_types, cx, a, b, ckind)
+ })
+ && structurally_same_type_impl(
+ seen_types,
+ cx,
+ a_sig.output(),
+ b_sig.output(),
+ ckind,
+ )
+ }
+ (Tuple(a_substs), Tuple(b_substs)) => {
+ a_substs.types().eq_by(b_substs.types(), |a_ty, b_ty| {
+ structurally_same_type_impl(seen_types, cx, a_ty, b_ty, ckind)
+ })
+ }
+ // For these, it's not quite as easy to define structural-sameness quite so easily.
+ // For the purposes of this lint, take the conservative approach and mark them as
+ // not structurally same.
+ (Dynamic(..), Dynamic(..))
+ | (Error(..), Error(..))
+ | (Closure(..), Closure(..))
+ | (Generator(..), Generator(..))
+ | (GeneratorWitness(..), GeneratorWitness(..))
+ | (Projection(..), Projection(..))
+ | (Opaque(..), Opaque(..)) => false,
+
+ // These definitely should have been caught above.
+ (Bool, Bool) | (Char, Char) | (Never, Never) | (Str, Str) => unreachable!(),
+
+ // An Adt and a primitive or pointer type. This can be FFI-safe if non-null
+ // enum layout optimisation is being applied.
+ (Adt(..), other_kind) | (other_kind, Adt(..))
+ if is_primitive_or_pointer(other_kind) =>
+ {
+ let (primitive, adt) =
+ if is_primitive_or_pointer(&a.kind) { (a, b) } else { (b, a) };
+ if let Some(ty) = crate::types::repr_nullable_ptr(cx, adt, ckind) {
+ ty == primitive
+ } else {
+ compare_layouts(a, b)
+ }
+ }
+ // Otherwise, just compare the layouts. This may fail to lint for some
+ // incompatible types, but at the very least, will stop reads into
+ // uninitialised memory.
+ _ => compare_layouts(a, b),
}
- }
- // Otherwise, just compare the layouts. This may fail to lint for some
- // incompatible types, but at the very least, will stop reads into
- // uninitialised memory.
- _ => compare_layouts(a, b),
+ })
}
}
+ let mut seen_types = FxHashSet::default();
+ structurally_same_type_impl(&mut seen_types, cx, a, b, ckind)
}
}
use crate::levels::LintLevelsBuilder;
use crate::passes::{EarlyLintPassObject, LateLintPassObject};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::util::lev_distance::find_best_match_for_name;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync;
pub fn qpath_res(&self, qpath: &hir::QPath<'_>, id: hir::HirId) -> Res {
match *qpath {
hir::QPath::Resolved(_, ref path) => path.res,
- hir::QPath::TypeRelative(..) => self
+ hir::QPath::TypeRelative(..) | hir::QPath::LangItem(..) => self
.maybe_typeck_results()
.and_then(|typeck_results| typeck_results.type_dependent_def(id))
.map_or(Res::Err, |(kind, def_id)| Res::Def(kind, def_id)),
use crate::context::{EarlyContext, LintContext, LintStore};
use crate::passes::{EarlyLintPass, EarlyLintPassObject};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::visit as ast_visit;
use rustc_session::lint::{BufferedEarlyLint, LintBuffer, LintPass};
use rustc_session::Session;
//! Clippy.
use crate::{EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext};
-use rustc_ast::ast::{Item, ItemKind};
+use rustc_ast::{Item, ItemKind};
use rustc_data_structures::fx::FxHashMap;
use rustc_errors::Applicability;
use rustc_hir::{GenericArg, HirId, MutTy, Mutability, Path, PathSegment, QPath, Ty, TyKind};
//! for all lint attributes.
use crate::{passes::LateLintPassObject, LateContext, LateLintPass, LintStore};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::walk_list;
use rustc_data_structures::sync::{join, par_iter, ParallelIterator};
use rustc_hir as hir;
use crate::context::{CheckLintNameResult, LintStore};
use crate::late::unerased_lint_store;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::attr;
use rustc_ast::unwrap_or;
use rustc_ast_pretty::pprust;
mod types;
mod unused;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_hir as hir;
use rustc_hir::def_id::LocalDefId;
use rustc_middle::ty::query::Providers;
use crate::{EarlyContext, EarlyLintPass, LintContext};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_data_structures::fx::FxHashMap;
use rustc_span::symbol::Symbol;
use crate::{EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_attr as attr;
use rustc_errors::Applicability;
use rustc_hir as hir;
use crate::context::{EarlyContext, LateContext};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_data_structures::sync;
use rustc_hir as hir;
use rustc_session::lint::builtin::HardwiredLints;
use crate::{EarlyContext, EarlyLintPass, LintContext};
-use rustc_ast::ast::{Block, StmtKind};
+use rustc_ast::{Block, StmtKind};
use rustc_errors::Applicability;
use rustc_span::Span;
#![allow(non_snake_case)]
use crate::{LateContext, LateLintPass, LintContext};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_attr as attr;
use rustc_data_structures::fx::FxHashSet;
use rustc_errors::Applicability;
//
// No suggestion for: `isize`, `usize`.
fn get_type_suggestion(t: Ty<'_>, val: u128, negative: bool) -> Option<&'static str> {
- use rustc_ast::ast::IntTy::*;
- use rustc_ast::ast::UintTy::*;
+ use rustc_ast::IntTy::*;
+ use rustc_ast::UintTy::*;
macro_rules! find_fit {
($ty:expr, $val:expr, $negative:expr,
$($type:ident => [$($utypes:expr),*] => [$($itypes:expr),*]),+) => {
let par_id = cx.tcx.hir().get_parent_node(e.hir_id);
if let Node::Expr(par_e) = cx.tcx.hir().get(par_id) {
if let hir::ExprKind::Struct(..) = par_e.kind {
- if is_range_literal(cx.sess().source_map(), par_e)
+ if is_range_literal(par_e)
&& lint_overflowing_range_endpoint(cx, lit, v, max, e, par_e, t.name_str())
{
// The overflowing literal lint was overridden.
return;
}
}
- hir::ExprKind::Struct(..) if is_range_literal(cx.sess().source_map(), par_e) => {
+ hir::ExprKind::Struct(..) if is_range_literal(par_e) => {
let t = t.name_str();
if lint_overflowing_range_endpoint(cx, lit, lit_val, max, e, par_e, t) {
// The overflowing literal lint was overridden.
use crate::Lint;
use crate::{EarlyContext, EarlyLintPass, LateContext, LateLintPass, LintContext};
-use rustc_ast::ast;
-use rustc_ast::ast::{ExprKind, StmtKind};
+use rustc_ast as ast;
use rustc_ast::util::parser;
+use rustc_ast::{ExprKind, StmtKind};
use rustc_ast_pretty::pprust;
use rustc_data_structures::fx::FxHashMap;
use rustc_errors::{pluralize, Applicability};
}
fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &ast::Expr) {
- use rustc_ast::ast::ExprKind::*;
+ use rustc_ast::ExprKind::*;
let (value, ctx, followed_by_block, left_pos, right_pos) = match e.kind {
// Do not lint `unused_braces` in `if let` expressions.
If(ref cond, ref block, ..)
use crate::rmeta::{CrateDep, CrateMetadata, CrateNumMap, CrateRoot, MetadataBlob};
use rustc_ast::expand::allocator::AllocatorKind;
-use rustc_ast::{ast, visit};
+use rustc_ast::{self as ast, *};
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::svh::Svh;
use rustc_data_structures::sync::Lrc;
&& file.ends_with(&self.target.options.dll_suffix)
{
// Make sure there's at most one rlib and at most one dylib.
- let loc = fs::canonicalize(&loc).unwrap_or_else(|_| loc.clone());
+ // Note to take care and match against the non-canonicalized name:
+ // some systems save build artifacts into content-addressed stores
+ // that do not preserve extensions, and then link to them using
+ // e.g. symbolic links. If we canonicalize too early, we resolve
+ // the symlink, the file type is lost and we might treat rlibs and
+ // rmetas as dylibs.
+ let loc_canon = fs::canonicalize(&loc).unwrap_or_else(|_| loc.clone());
if loc.file_name().unwrap().to_str().unwrap().ends_with(".rlib") {
- rlibs.insert(loc, PathKind::ExternFlag);
+ rlibs.insert(loc_canon, PathKind::ExternFlag);
} else if loc.file_name().unwrap().to_str().unwrap().ends_with(".rmeta") {
- rmetas.insert(loc, PathKind::ExternFlag);
+ rmetas.insert(loc_canon, PathKind::ExternFlag);
} else {
- dylibs.insert(loc, PathKind::ExternFlag);
+ dylibs.insert(loc_canon, PathKind::ExternFlag);
}
} else {
self.rejected_via_filename
use crate::rmeta::table::{FixedSizeEncoding, Table};
use crate::rmeta::*;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_attr as attr;
use rustc_data_structures::captures::Captures;
use rustc_data_structures::fingerprint::{Fingerprint, FingerprintDecoder};
use crate::native_libs;
use crate::rmeta::{self, encoder};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::expand::allocator::AllocatorKind;
use rustc_data_structures::svh::Svh;
use rustc_hir as hir;
item_attrs => { tcx.arena.alloc_from_iter(
cdata.get_item_attrs(def_id.index, tcx.sess).into_iter()
) }
- // FIXME(#38501) We've skipped a `read` on the `hir_owner_nodes` of
- // a `fn` when encoding, so the dep-tracking wouldn't work.
- // This is only used by rustdoc anyway, which shouldn't have
- // incremental recompilation ever enabled.
fn_arg_names => { cdata.get_fn_param_names(tcx, def_id.index) }
rendered_const => { cdata.get_rendered_const(def_id.index) }
impl_parent => { cdata.get_parent_impl(def_id.index) }
use crate::rmeta::table::{FixedSizeEncoding, TableBuilder};
use crate::rmeta::*;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_data_structures::fingerprint::{Fingerprint, FingerprintEncoder};
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexSet};
use rustc_data_structures::stable_hasher::StableHasher;
}
fn encode_fn_param_names_for_body(&mut self, body_id: hir::BodyId) -> Lazy<[Ident]> {
- self.tcx.dep_graph.with_ignore(|| self.lazy(self.tcx.hir().body_param_names(body_id)))
+ self.lazy(self.tcx.hir().body_param_names(body_id))
}
fn encode_fn_param_names(&mut self, param_names: &[Ident]) -> Lazy<[Ident]> {
use decoder::Metadata;
use table::{Table, TableBuilder};
-use rustc_ast::ast::{self, MacroDef};
+use rustc_ast::{self as ast, MacroDef};
use rustc_attr as attr;
use rustc_data_structures::svh::Svh;
use rustc_data_structures::sync::MetadataRef;
[] upvars_mentioned: rustc_data_structures::fx::FxIndexMap<rustc_hir::HirId, rustc_hir::Upvar>,
[] object_safety_violations: rustc_middle::traits::ObjectSafetyViolation,
[] codegen_unit: rustc_middle::mir::mono::CodegenUnit<$tcx>,
- [] attribute: rustc_ast::ast::Attribute,
+ [] attribute: rustc_ast::Attribute,
[] name_set: rustc_data_structures::fx::FxHashSet<rustc_span::symbol::Symbol>,
[] hir_id_set: rustc_hir::HirIdSet,
// Note that this deliberately duplicates items in the `rustc_hir::arena`,
// since we need to allocate this type on both the `rustc_hir` arena
// (during lowering) and the `librustc_middle` arena (for decoding MIR)
- [decode] asm_template: rustc_ast::ast::InlineAsmTemplatePiece,
+ [decode] asm_template: rustc_ast::InlineAsmTemplatePiece,
// This is used to decode the &'tcx [Span] for InlineAsm's line_spans.
[decode] span: rustc_span::Span,
//! for the `Code` associated with a particular NodeId.
use crate::hir::map::Map;
-use rustc_ast::ast::Attribute;
+use rustc_ast::Attribute;
use rustc_hir as hir;
use rustc_hir::intravisit::FnKind;
use rustc_hir::{Expr, FnDecl, Node};
use crate::hir::{Owner, OwnerNodes};
use crate::ty::query::Providers;
use crate::ty::TyCtxt;
-use rustc_ast::ast::{self};
+use rustc_ast as ast;
use rustc_data_structures::svh::Svh;
use rustc_hir::def::{DefKind, Res};
use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, CRATE_DEF_INDEX, LOCAL_CRATE};
use crate::middle::cstore::CrateStore;
use crate::ty::{fast_reject, TyCtxt};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::sync::Lrc;
use crate::ich::StableHashingContext;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_span::SourceFile;
use crate::ty::TyCtxt;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::expand::allocator::AllocatorKind;
use rustc_data_structures::svh::Svh;
use rustc_data_structures::sync::{self, MetadataRef};
//! just peeks and looks for that attribute.
use crate::bug;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_data_structures::sync::OnceCell;
use rustc_session::{Limit, Session};
use rustc_span::symbol::{sym, Symbol};
pub use self::StabilityLevel::*;
use crate::ty::{self, TyCtxt};
-use rustc_ast::ast::CRATE_NODE_ID;
+use rustc_ast::CRATE_NODE_ID;
use rustc_attr::{self as attr, ConstStability, Deprecation, Stability};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_errors::{Applicability, DiagnosticBuilder};
use std::iter;
use std::ops::{Deref, DerefMut, Range};
-use rustc_ast::ast::Mutability;
+use rustc_ast::Mutability;
use rustc_data_structures::sorted_map::SortedMap;
use rustc_target::abi::{Align, HasDataLayout, Size};
use std::sync::atomic::{AtomicU32, Ordering};
use byteorder::{BigEndian, LittleEndian, ReadBytesExt, WriteBytesExt};
-use rustc_ast::ast::LitKind;
+use rustc_ast::LitKind;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::sync::{HashMapExt, Lock};
use rustc_data_structures::tiny_list::TinyList;
use rustc_target::abi::VariantIdx;
use polonius_engine::Atom;
-pub use rustc_ast::ast::Mutability;
+pub use rustc_ast::Mutability;
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::graph::dominators::{dominators, Dominators};
use rustc_data_structures::graph::{self, GraphSuccessors};
use crate::mir::interpret::Scalar;
use crate::ty::{self, Ty, TyCtxt};
-use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece};
+use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
use super::{
AssertMessage, BasicBlock, InlineAsmOperand, Operand, Place, SourceInfo, Successors,
SuccessorsMut,
};
-pub use rustc_ast::ast::Mutability;
+pub use rustc_ast::Mutability;
use rustc_macros::HashStable;
use rustc_span::Span;
use std::borrow::Cow;
use crate::ty::{self, Ty};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_macros::HashStable;
/// Types that are represented as ints.
ProjectionTy, Region, RegionKind, ReprOptions, TraitObjectVisitor, Ty, TyKind, TyS, TyVar,
TyVid, TypeAndMut,
};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::expand::allocator::AllocatorKind;
use rustc_attr as attr;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
pub fn qpath_res(&self, qpath: &hir::QPath<'_>, id: hir::HirId) -> Res {
match *qpath {
hir::QPath::Resolved(_, ref path) => path.res,
- hir::QPath::TypeRelative(..) => self
+ hir::QPath::TypeRelative(..) | hir::QPath::LangItem(..) => self
.type_dependent_def(id)
.map_or(Res::Err, |(kind, def_id)| Res::Def(kind, def_id)),
}
use crate::traits::{ObligationCause, ObligationCauseCode};
use crate::ty::diagnostics::suggest_constraining_type_param;
use crate::ty::{self, BoundRegion, Region, Ty, TyCtxt};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_errors::Applicability::{MachineApplicable, MaybeIncorrect};
use rustc_errors::{pluralize, DiagnosticBuilder};
use rustc_hir as hir;
use crate::ich::StableHashingContext;
use crate::ty::{self, Ty, TyCtxt};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_hir::def_id::DefId;
use std::fmt::Debug;
use crate::ty::subst::Subst;
use crate::ty::{self, subst::SubstsRef, ReprOptions, Ty, TyCtxt, TypeFoldable};
-use rustc_ast::ast::{self, IntTy, UintTy};
+use rustc_ast::{self as ast, IntTy, UintTy};
use rustc_attr as attr;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_hir as hir;
use crate::ty;
use crate::ty::subst::{GenericArg, InternalSubsts, Subst, SubstsRef};
use crate::ty::util::{Discr, IntTypeExt};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_attr as attr;
use rustc_data_structures::captures::Captures;
use rustc_data_structures::fingerprint::Fingerprint;
use crate::ty::{self, ConstInt, DefIdTree, ParamConst, Ty, TyCtxt, TypeFoldable};
use rustc_apfloat::ieee::{Double, Single};
use rustc_apfloat::Float;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_attr::{SignedInt, UnsignedInt};
use rustc_hir as hir;
use rustc_hir::def::{CtorKind, DefKind, Namespace};
use rustc_session::CrateDisambiguator;
use rustc_target::spec::PanicStrategy;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_attr as attr;
use rustc_span::symbol::Symbol;
use rustc_span::{Span, DUMMY_SP};
}
}
-impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>>
- for &'tcx [rustc_ast::ast::InlineAsmTemplatePiece]
-{
+impl<'a, 'tcx> Decodable<CacheDecoder<'a, 'tcx>> for &'tcx [rustc_ast::InlineAsmTemplatePiece] {
fn decode(d: &mut CacheDecoder<'a, 'tcx>) -> Result<Self, String> {
RefDecodable::decode(d)
}
u64,
String,
crate::middle::region::Scope,
- ::rustc_ast::ast::FloatTy,
- ::rustc_ast::ast::InlineAsmOptions,
- ::rustc_ast::ast::InlineAsmTemplatePiece,
- ::rustc_ast::ast::NodeId,
+ ::rustc_ast::FloatTy,
+ ::rustc_ast::InlineAsmOptions,
+ ::rustc_ast::InlineAsmTemplatePiece,
+ ::rustc_ast::NodeId,
::rustc_span::symbol::Symbol,
::rustc_hir::def::Res,
::rustc_hir::def_id::DefId,
};
use crate::ty::{DelaySpanBugEmitted, List, ParamEnv, TyS};
use polonius_engine::Atom;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_data_structures::captures::Captures;
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use crate::ty::TyKind::*;
use crate::ty::{self, DefIdTree, GenericParamDefKind, List, Ty, TyCtxt, TypeFoldable};
use rustc_apfloat::Float as _;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_attr::{self as attr, SignedInt, UnsignedInt};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::fx::FxHashMap;
-use rustc_ast::ast::Mutability;
+use rustc_ast::Mutability;
use rustc_hir::def_id::DefId;
use rustc_middle::mir::AssertMessage;
use rustc_session::Limit;
use std::fs;
use std::path::PathBuf;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_data_structures::work_queue::WorkQueue;
use rustc_graphviz as dot;
use rustc_hir::def_id::DefId;
-use rustc_ast::ast::{self, MetaItem};
+use rustc_ast::{self as ast, MetaItem};
use rustc_middle::ty;
use rustc_session::Session;
use rustc_span::symbol::{sym, Symbol};
use rustc_apfloat::ieee::{Double, Single};
use rustc_apfloat::{Float, FloatConvert};
-use rustc_ast::ast::FloatTy;
+use rustc_ast::FloatTy;
use rustc_attr as attr;
use rustc_middle::mir::interpret::{InterpResult, PointerArithmetic, Scalar};
use rustc_middle::mir::CastKind;
use rustc_middle::mir::interpret::InterpResult;
use rustc_middle::ty::{self, query::TyCtxtAt, Ty};
-use rustc_ast::ast::Mutability;
+use rustc_ast::Mutability;
use super::{AllocId, Allocation, InterpCx, MPlaceTy, Machine, MemoryKind, Scalar, ValueVisitor};
self.write_scalar(offset_ptr, dest)?;
}
sym::ptr_guaranteed_eq | sym::ptr_guaranteed_ne => {
- // FIXME: return `true` for at least some comparisons where we can reliably
- // determine the result of runtime (in)equality tests at compile-time.
- self.write_scalar(Scalar::from_bool(false), dest)?;
+ let a = self.read_immediate(args[0])?.to_scalar()?;
+ let b = self.read_immediate(args[1])?.to_scalar()?;
+ let cmp = if intrinsic_name == sym::ptr_guaranteed_eq {
+ self.guaranteed_eq(a, b)
+ } else {
+ self.guaranteed_ne(a, b)
+ };
+ self.write_scalar(Scalar::from_bool(cmp), dest)?;
}
sym::ptr_offset_from => {
let a = self.read_immediate(args[0])?.to_scalar()?;
Ok(true)
}
+ fn guaranteed_eq(&mut self, a: Scalar<M::PointerTag>, b: Scalar<M::PointerTag>) -> bool {
+ match (a, b) {
+ // Comparisons between integers are always known.
+ (Scalar::Raw { .. }, Scalar::Raw { .. }) => a == b,
+ // Equality with integers can never be known for sure.
+ (Scalar::Raw { .. }, Scalar::Ptr(_)) | (Scalar::Ptr(_), Scalar::Raw { .. }) => false,
+ // FIXME: return `true` for when both sides are the same pointer, *except* that
+ // some things (like functions and vtables) do not have stable addresses
+ // so we need to be careful around them.
+ (Scalar::Ptr(_), Scalar::Ptr(_)) => false,
+ }
+ }
+
+ fn guaranteed_ne(&mut self, a: Scalar<M::PointerTag>, b: Scalar<M::PointerTag>) -> bool {
+ match (a, b) {
+ // Comparisons between integers are always known.
+ (Scalar::Raw { .. }, Scalar::Raw { .. }) => a != b,
+ // Comparisons of abstract pointers with null pointers are known if the pointer
+ // is in bounds, because if they are in bounds, the pointer can't be null.
+ (Scalar::Raw { data: 0, .. }, Scalar::Ptr(ptr))
+ | (Scalar::Ptr(ptr), Scalar::Raw { data: 0, .. }) => !self.memory.ptr_may_be_null(ptr),
+ // Inequality with integers other than null can never be known for sure.
+ (Scalar::Raw { .. }, Scalar::Ptr(_)) | (Scalar::Ptr(_), Scalar::Raw { .. }) => false,
+ // FIXME: return `true` for at least some comparisons where we can reliably
+ // determine the result of runtime inequality tests at compile-time.
+ // Examples include comparison of addresses in static items, for these we can
+ // give reliable results.
+ (Scalar::Ptr(_), Scalar::Ptr(_)) => false,
+ }
+ }
+
pub fn exact_div(
&mut self,
a: ImmTy<'tcx, M::PointerTag>,
use std::fmt;
use std::ptr;
-use rustc_ast::ast::Mutability;
+use rustc_ast::Mutability;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_middle::ty::{Instance, ParamEnv, TyCtxt};
use rustc_target::abi::{Align, HasDataLayout, Size, TargetDataLayout};
use std::convert::TryFrom;
use rustc_apfloat::Float;
-use rustc_ast::ast::FloatTy;
+use rustc_ast::FloatTy;
use rustc_middle::mir;
use rustc_middle::mir::interpret::{InterpResult, Scalar};
use rustc_middle::ty::{self, layout::TyAndLayout, Ty};
let base_ty = Place::ty_from(place.local, proj_base, self.body, self.tcx).ty;
match base_ty.kind {
ty::RawPtr(..) => self.require_unsafe(
- UnsafetyViolationKind::General,
+ UnsafetyViolationKind::GeneralAndConstFn,
UnsafetyViolationDetails::DerefOfRawPointer,
),
ty::Adt(adt, _) => {
use std::cell::Cell;
-use rustc_ast::ast::Mutability;
+use rustc_ast::Mutability;
use rustc_data_structures::fx::FxHashSet;
use rustc_hir::def::DefKind;
use rustc_hir::HirId;
//! initialization and can otherwise silence errors, if
//! move analysis runs after promotion on broken MIR.
-use rustc_ast::ast::LitKind;
+use rustc_ast::LitKind;
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_middle::mir::traversal::ReversePostorder;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_span::symbol::sym;
use rustc_span::Span;
use rustc_target::spec::abi::Abi;
use rustc_index::{bit_set::BitSet, vec::IndexVec};
use rustc_middle::mir::visit::{NonUseContext, PlaceContext, Visitor};
use rustc_middle::mir::*;
-use rustc_middle::ty::{List, Ty, TyCtxt};
+use rustc_middle::ty::{self, List, Ty, TyCtxt};
use rustc_target::abi::VariantIdx;
use std::iter::{Enumerate, Peekable};
use std::slice::Iter;
pub struct SimplifyBranchSame;
impl<'tcx> MirPass<'tcx> for SimplifyBranchSame {
- fn run_pass(&self, _: TyCtxt<'tcx>, _: MirSource<'tcx>, body: &mut Body<'tcx>) {
- let mut did_remove_blocks = false;
- let bbs = body.basic_blocks_mut();
- for bb_idx in bbs.indices() {
- let targets = match &bbs[bb_idx].terminator().kind {
- TerminatorKind::SwitchInt { targets, .. } => targets,
- _ => continue,
- };
+ fn run_pass(&self, tcx: TyCtxt<'tcx>, source: MirSource<'tcx>, body: &mut Body<'tcx>) {
+ trace!("Running SimplifyBranchSame on {:?}", source);
+ let finder = SimplifyBranchSameOptimizationFinder { body, tcx };
+ let opts = finder.find();
+
+ let did_remove_blocks = opts.len() > 0;
+ for opt in opts.iter() {
+ trace!("SUCCESS: Applying optimization {:?}", opt);
+ // Replace `SwitchInt(..) -> [bb_first, ..];` with a `goto -> bb_first;`.
+ body.basic_blocks_mut()[opt.bb_to_opt_terminator].terminator_mut().kind =
+ TerminatorKind::Goto { target: opt.bb_to_goto };
+ }
+
+ if did_remove_blocks {
+ // We have dead blocks now, so remove those.
+ simplify::remove_dead_blocks(body);
+ }
+ }
+}
+
+#[derive(Debug)]
+struct SimplifyBranchSameOptimization {
+ /// All basic blocks are equal so go to this one
+ bb_to_goto: BasicBlock,
+ /// Basic block where the terminator can be simplified to a goto
+ bb_to_opt_terminator: BasicBlock,
+}
+
+struct SimplifyBranchSameOptimizationFinder<'a, 'tcx> {
+ body: &'a Body<'tcx>,
+ tcx: TyCtxt<'tcx>,
+}
- let mut iter_bbs_reachable = targets
- .iter()
- .map(|idx| (*idx, &bbs[*idx]))
- .filter(|(_, bb)| {
- // Reaching `unreachable` is UB so assume it doesn't happen.
- bb.terminator().kind != TerminatorKind::Unreachable
+impl<'a, 'tcx> SimplifyBranchSameOptimizationFinder<'a, 'tcx> {
+ fn find(&self) -> Vec<SimplifyBranchSameOptimization> {
+ self.body
+ .basic_blocks()
+ .iter_enumerated()
+ .filter_map(|(bb_idx, bb)| {
+ let (discr_switched_on, targets) = match &bb.terminator().kind {
+ TerminatorKind::SwitchInt { targets, discr, .. } => (discr, targets),
+ _ => return None,
+ };
+
+ // find the adt that has its discriminant read
+ // assuming this must be the last statement of the block
+ let adt_matched_on = match &bb.statements.last()?.kind {
+ StatementKind::Assign(box (place, rhs))
+ if Some(*place) == discr_switched_on.place() =>
+ {
+ match rhs {
+ Rvalue::Discriminant(adt_place) if adt_place.ty(self.body, self.tcx).ty.is_enum() => adt_place,
+ _ => {
+ trace!("NO: expected a discriminant read of an enum instead of: {:?}", rhs);
+ return None;
+ }
+ }
+ }
+ other => {
+ trace!("NO: expected an assignment of a discriminant read to a place. Found: {:?}", other);
+ return None
+ },
+ };
+
+ let mut iter_bbs_reachable = targets
+ .iter()
+ .map(|idx| (*idx, &self.body.basic_blocks()[*idx]))
+ .filter(|(_, bb)| {
+ // Reaching `unreachable` is UB so assume it doesn't happen.
+ bb.terminator().kind != TerminatorKind::Unreachable
// But `asm!(...)` could abort the program,
// so we cannot assume that the `unreachable` terminator itself is reachable.
// FIXME(Centril): use a normalization pass instead of a check.
StatementKind::LlvmInlineAsm(..) => true,
_ => false,
})
- })
- .peekable();
-
- // We want to `goto -> bb_first`.
- let bb_first = iter_bbs_reachable.peek().map(|(idx, _)| *idx).unwrap_or(targets[0]);
-
- // All successor basic blocks should have the exact same form.
- let all_successors_equivalent =
- iter_bbs_reachable.map(|(_, bb)| bb).tuple_windows().all(|(bb_l, bb_r)| {
- bb_l.is_cleanup == bb_r.is_cleanup
- && bb_l.terminator().kind == bb_r.terminator().kind
- && bb_l.statements.iter().eq_by(&bb_r.statements, |x, y| x.kind == y.kind)
- });
-
- if all_successors_equivalent {
- // Replace `SwitchInt(..) -> [bb_first, ..];` with a `goto -> bb_first;`.
- bbs[bb_idx].terminator_mut().kind = TerminatorKind::Goto { target: bb_first };
- did_remove_blocks = true;
+ })
+ .peekable();
+
+ let bb_first = iter_bbs_reachable.peek().map(|(idx, _)| *idx).unwrap_or(targets[0]);
+ let mut all_successors_equivalent = StatementEquality::TrivialEqual;
+
+ // All successor basic blocks must be equal or contain statements that are pairwise considered equal.
+ for ((bb_l_idx,bb_l), (bb_r_idx,bb_r)) in iter_bbs_reachable.tuple_windows() {
+ let trivial_checks = bb_l.is_cleanup == bb_r.is_cleanup
+ && bb_l.terminator().kind == bb_r.terminator().kind;
+ let statement_check = || {
+ bb_l.statements.iter().zip(&bb_r.statements).try_fold(StatementEquality::TrivialEqual, |acc,(l,r)| {
+ let stmt_equality = self.statement_equality(*adt_matched_on, &l, bb_l_idx, &r, bb_r_idx);
+ if matches!(stmt_equality, StatementEquality::NotEqual) {
+ // short circuit
+ None
+ } else {
+ Some(acc.combine(&stmt_equality))
+ }
+ })
+ .unwrap_or(StatementEquality::NotEqual)
+ };
+ if !trivial_checks {
+ all_successors_equivalent = StatementEquality::NotEqual;
+ break;
+ }
+ all_successors_equivalent = all_successors_equivalent.combine(&statement_check());
+ };
+
+ match all_successors_equivalent{
+ StatementEquality::TrivialEqual => {
+ // statements are trivially equal, so just take first
+ trace!("Statements are trivially equal");
+ Some(SimplifyBranchSameOptimization {
+ bb_to_goto: bb_first,
+ bb_to_opt_terminator: bb_idx,
+ })
+ }
+ StatementEquality::ConsideredEqual(bb_to_choose) => {
+ trace!("Statements are considered equal");
+ Some(SimplifyBranchSameOptimization {
+ bb_to_goto: bb_to_choose,
+ bb_to_opt_terminator: bb_idx,
+ })
+ }
+ StatementEquality::NotEqual => {
+ trace!("NO: not all successors of basic block {:?} were equivalent", bb_idx);
+ None
+ }
+ }
+ })
+ .collect()
+ }
+
+ /// Tests if two statements can be considered equal
+ ///
+ /// Statements can be trivially equal if the kinds match.
+ /// But they can also be considered equal in the following case A:
+ /// ```
+ /// discriminant(_0) = 0; // bb1
+ /// _0 = move _1; // bb2
+ /// ```
+ /// In this case the two statements are equal iff
+ /// 1: _0 is an enum where the variant index 0 is fieldless, and
+ /// 2: bb1 was targeted by a switch where the discriminant of _1 was switched on
+ fn statement_equality(
+ &self,
+ adt_matched_on: Place<'tcx>,
+ x: &Statement<'tcx>,
+ x_bb_idx: BasicBlock,
+ y: &Statement<'tcx>,
+ y_bb_idx: BasicBlock,
+ ) -> StatementEquality {
+ let helper = |rhs: &Rvalue<'tcx>,
+ place: &Box<Place<'tcx>>,
+ variant_index: &VariantIdx,
+ side_to_choose| {
+ let place_type = place.ty(self.body, self.tcx).ty;
+ let adt = match place_type.kind {
+ ty::Adt(adt, _) if adt.is_enum() => adt,
+ _ => return StatementEquality::NotEqual,
+ };
+ let variant_is_fieldless = adt.variants[*variant_index].fields.is_empty();
+ if !variant_is_fieldless {
+ trace!("NO: variant {:?} was not fieldless", variant_index);
+ return StatementEquality::NotEqual;
+ }
+
+ match rhs {
+ Rvalue::Use(operand) if operand.place() == Some(adt_matched_on) => {
+ StatementEquality::ConsideredEqual(side_to_choose)
+ }
+ _ => {
+ trace!(
+ "NO: RHS of assignment was {:?}, but expected it to match the adt being matched on in the switch, which is {:?}",
+ rhs,
+ adt_matched_on
+ );
+ StatementEquality::NotEqual
+ }
+ }
+ };
+ match (&x.kind, &y.kind) {
+ // trivial case
+ (x, y) if x == y => StatementEquality::TrivialEqual,
+
+ // check for case A
+ (
+ StatementKind::Assign(box (_, rhs)),
+ StatementKind::SetDiscriminant { place, variant_index },
+ ) => {
+ // choose basic block of x, as that has the assign
+ helper(rhs, place, variant_index, x_bb_idx)
+ }
+ (
+ StatementKind::SetDiscriminant { place, variant_index },
+ StatementKind::Assign(box (_, rhs)),
+ ) => {
+ // choose basic block of y, as that has the assign
+ helper(rhs, place, variant_index, y_bb_idx)
+ }
+ _ => {
+ trace!("NO: statements `{:?}` and `{:?}` not considered equal", x, y);
+ StatementEquality::NotEqual
}
}
+ }
+}
- if did_remove_blocks {
- // We have dead blocks now, so remove those.
- simplify::remove_dead_blocks(body);
+#[derive(Copy, Clone, Eq, PartialEq)]
+enum StatementEquality {
+ /// The two statements are trivially equal; same kind
+ TrivialEqual,
+ /// The two statements are considered equal, but may be of different kinds. The BasicBlock field is the basic block to jump to when performing the branch-same optimization.
+ /// For example, `_0 = _1` and `discriminant(_0) = discriminant(0)` are considered equal if 0 is a fieldless variant of an enum. But we don't want to jump to the basic block with the SetDiscriminant, as that is not legal if _1 is not the 0 variant index
+ ConsideredEqual(BasicBlock),
+ /// The two statements are not equal
+ NotEqual,
+}
+
+impl StatementEquality {
+ fn combine(&self, other: &StatementEquality) -> StatementEquality {
+ use StatementEquality::*;
+ match (self, other) {
+ (TrivialEqual, TrivialEqual) => TrivialEqual,
+ (TrivialEqual, ConsideredEqual(b)) | (ConsideredEqual(b), TrivialEqual) => {
+ ConsideredEqual(*b)
+ }
+ (ConsideredEqual(b1), ConsideredEqual(b2)) => {
+ if b1 == b2 {
+ ConsideredEqual(*b1)
+ } else {
+ NotEqual
+ }
+ }
+ (_, NotEqual) | (NotEqual, _) => NotEqual,
}
}
}
fn visit_constant(&mut self, constant: &Constant<'tcx>, location: Location) {
self.super_constant(constant, location);
let Constant { span, user_ty, literal } = constant;
- self.push("mir::Constant");
- self.push(&format!("+ span: {}", self.tcx.sess.source_map().span_to_string(*span)));
- if let Some(user_ty) = user_ty {
- self.push(&format!("+ user_ty: {:?}", user_ty));
+ match literal.ty.kind {
+ ty::Int(_) | ty::Uint(_) | ty::Bool | ty::Char => {}
+ _ => {
+ self.push("mir::Constant");
+ self.push(&format!("+ span: {}", self.tcx.sess.source_map().span_to_string(*span)));
+ if let Some(user_ty) = user_ty {
+ self.push(&format!("+ user_ty: {:?}", user_ty));
+ }
+ self.push(&format!("+ literal: {:?}", literal));
+ }
}
- self.push(&format!("+ literal: {:?}", literal));
}
fn visit_const(&mut self, constant: &&'tcx ty::Const<'tcx>, _: Location) {
self.super_const(constant);
let ty::Const { ty, val, .. } = constant;
- self.push("ty::Const");
- self.push(&format!("+ ty: {:?}", ty));
- self.push(&format!("+ val: {:?}", val));
+ match ty.kind {
+ ty::Int(_) | ty::Uint(_) | ty::Bool | ty::Char => {}
+ _ => {
+ self.push("ty::Const");
+ self.push(&format!("+ ty: {:?}", ty));
+ self.push(&format!("+ val: {:?}", val));
+ }
+ }
}
fn visit_rvalue(&mut self, rvalue: &Rvalue<'tcx>, location: Location) {
use crate::build::expr::category::{Category, RvalueFunc};
use crate::build::{BlockAnd, BlockAndExtension, BlockFrame, Builder};
use crate::thir::*;
-use rustc_ast::ast::InlineAsmOptions;
+use rustc_ast::InlineAsmOptions;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stack::ensure_sufficient_stack;
use rustc_hir as hir;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_middle::mir::interpret::{
truncate, Allocation, ConstValue, LitToConstError, LitToConstInput, Scalar,
};
use crate::thir::util::UserAnnotatedTyHelpers;
use crate::thir::*;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_hir as hir;
use rustc_hir::def_id::{DefId, LocalDefId};
use rustc_hir::Node;
//! structures.
use self::cx::Cx;
-use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece};
+use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece};
use rustc_hir as hir;
use rustc_hir::def_id::DefId;
use rustc_middle::infer::canonical::Canonical;
use super::{PatCtxt, PatKind, PatternError};
use rustc_arena::TypedArena;
-use rustc_ast::ast::Mutability;
+use rustc_ast::Mutability;
use rustc_errors::{error_code, struct_span_err, Applicability, DiagnosticBuilder};
use rustc_hir as hir;
use rustc_hir::def::*;
use crate::thir::util::UserAnnotatedTyHelpers;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_errors::struct_span_err;
use rustc_hir as hir;
use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res};
#![feature(try_blocks)]
#![feature(or_patterns)]
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::token::{self, DelimToken, Nonterminal, Token};
use rustc_ast::tokenstream::{self, TokenStream, TokenTree};
use rustc_ast_pretty::pprust;
use super::{Parser, PathStyle};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::attr;
use rustc_ast::token::{self, Nonterminal};
use rustc_ast_pretty::pprust;
use super::ty::AllowPlus;
use super::{BlockMode, Parser, PathStyle, SemiColonMode, SeqSep, TokenExpectType, TokenType};
-use rustc_ast::ast::{
- self, AngleBracketedArgs, AttrVec, BinOpKind, BindingMode, BlockCheckMode, Expr, ExprKind,
- Item, ItemKind, Mutability, Param, Pat, PatKind, PathSegment, QSelf, Ty, TyKind,
-};
use rustc_ast::ptr::P;
use rustc_ast::token::{self, Lit, LitKind, TokenKind};
use rustc_ast::util::parser::AssocOp;
+use rustc_ast::{
+ self as ast, AngleBracketedArgs, AttrVec, BinOpKind, BindingMode, BlockCheckMode, Expr,
+ ExprKind, Item, ItemKind, Mutability, Param, Pat, PatKind, PathSegment, QSelf, Ty, TyKind,
+};
use rustc_ast_pretty::pprust;
use rustc_data_structures::fx::FxHashSet;
use rustc_errors::{pluralize, struct_span_err};
use super::{SemiColonMode, SeqSep, TokenExpectType};
use crate::maybe_recover_from_interpolated_ty_qpath;
-use rustc_ast::ast::{self, AttrStyle, AttrVec, CaptureBy, Field, Lit, UnOp, DUMMY_NODE_ID};
-use rustc_ast::ast::{AnonConst, BinOp, BinOpKind, FnDecl, FnRetTy, MacCall, Param, Ty, TyKind};
-use rustc_ast::ast::{Arm, Async, BlockCheckMode, Expr, ExprKind, Label, Movability, RangeLimits};
use rustc_ast::ptr::P;
use rustc_ast::token::{self, Token, TokenKind};
use rustc_ast::util::classify;
use rustc_ast::util::literal::LitError;
use rustc_ast::util::parser::{prec_let_scrutinee_needs_par, AssocOp, Fixity};
+use rustc_ast::{self as ast, AttrStyle, AttrVec, CaptureBy, Field, Lit, UnOp, DUMMY_NODE_ID};
+use rustc_ast::{AnonConst, BinOp, BinOpKind, FnDecl, FnRetTy, MacCall, Param, Ty, TyKind};
+use rustc_ast::{Arm, Async, BlockCheckMode, Expr, ExprKind, Label, Movability, RangeLimits};
use rustc_ast_pretty::pprust;
use rustc_errors::{Applicability, DiagnosticBuilder, PResult};
use rustc_span::source_map::{self, Span, Spanned};
}
fn should_continue_as_assoc_expr(&mut self, lhs: &Expr) -> bool {
- match (self.expr_is_complete(lhs), self.check_assoc_op().map(|op| op.node)) {
+ match (self.expr_is_complete(lhs), AssocOp::from_token(&self.token)) {
// Semi-statement forms are odd:
// See https://github.com/rust-lang/rust/issues/29071
(true, None) => false,
use super::Parser;
-use rustc_ast::ast::{self, Attribute, GenericBounds, GenericParam, GenericParamKind, WhereClause};
use rustc_ast::token;
+use rustc_ast::{
+ self as ast, Attribute, GenericBounds, GenericParam, GenericParamKind, WhereClause,
+};
use rustc_errors::PResult;
use rustc_span::symbol::{kw, sym};
use crate::maybe_whole;
-use rustc_ast::ast::{self, AttrStyle, AttrVec, Attribute, DUMMY_NODE_ID};
-use rustc_ast::ast::{AssocItem, AssocItemKind, ForeignItemKind, Item, ItemKind, Mod};
-use rustc_ast::ast::{Async, Const, Defaultness, IsAuto, Mutability, Unsafe, UseTree, UseTreeKind};
-use rustc_ast::ast::{BindingMode, Block, FnDecl, FnSig, Param, SelfKind};
-use rustc_ast::ast::{EnumDef, Generics, StructField, TraitRef, Ty, TyKind, Variant, VariantData};
-use rustc_ast::ast::{FnHeader, ForeignItem, Path, PathSegment, Visibility, VisibilityKind};
-use rustc_ast::ast::{MacArgs, MacCall, MacDelimiter};
use rustc_ast::ptr::P;
use rustc_ast::token::{self, TokenKind};
use rustc_ast::tokenstream::{DelimSpan, TokenStream, TokenTree};
+use rustc_ast::{self as ast, AttrStyle, AttrVec, Attribute, DUMMY_NODE_ID};
+use rustc_ast::{AssocItem, AssocItemKind, ForeignItemKind, Item, ItemKind, Mod};
+use rustc_ast::{Async, Const, Defaultness, IsAuto, Mutability, Unsafe, UseTree, UseTreeKind};
+use rustc_ast::{BindingMode, Block, FnDecl, FnSig, Param, SelfKind};
+use rustc_ast::{EnumDef, Generics, StructField, TraitRef, Ty, TyKind, Variant, VariantData};
+use rustc_ast::{FnHeader, ForeignItem, Path, PathSegment, Visibility, VisibilityKind};
+use rustc_ast::{MacArgs, MacCall, MacDelimiter};
use rustc_ast_pretty::pprust;
use rustc_errors::{struct_span_err, Applicability, PResult, StashKey};
use rustc_span::edition::Edition;
use diagnostics::Error;
pub use path::PathStyle;
-use rustc_ast::ast::DUMMY_NODE_ID;
-use rustc_ast::ast::{self, AttrStyle, AttrVec, Const, CrateSugar, Extern, Unsafe};
-use rustc_ast::ast::{
- Async, MacArgs, MacDelimiter, Mutability, StrLit, Visibility, VisibilityKind,
-};
use rustc_ast::ptr::P;
use rustc_ast::token::{self, DelimToken, Token, TokenKind};
use rustc_ast::tokenstream::{self, DelimSpan, TokenStream, TokenTree, TreeAndJoint};
+use rustc_ast::DUMMY_NODE_ID;
+use rustc_ast::{self as ast, AttrStyle, AttrVec, Const, CrateSugar, Extern, Unsafe};
+use rustc_ast::{Async, MacArgs, MacDelimiter, Mutability, StrLit, Visibility, VisibilityKind};
use rustc_ast_pretty::pprust;
use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder, FatalError, PResult};
use rustc_session::parse::ParseSess;
use super::{Parser, PathStyle};
use crate::{maybe_recover_from_interpolated_ty_qpath, maybe_whole};
-use rustc_ast::ast::{self, AttrVec, Attribute, FieldPat, MacCall, Pat, PatKind, RangeEnd};
-use rustc_ast::ast::{BindingMode, Expr, ExprKind, Mutability, Path, QSelf, RangeSyntax};
use rustc_ast::mut_visit::{noop_visit_mac, noop_visit_pat, MutVisitor};
use rustc_ast::ptr::P;
use rustc_ast::token;
+use rustc_ast::{self as ast, AttrVec, Attribute, FieldPat, MacCall, Pat, PatKind, RangeEnd};
+use rustc_ast::{BindingMode, Expr, ExprKind, Mutability, Path, QSelf, RangeSyntax};
use rustc_ast_pretty::pprust;
use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder, PResult};
use rustc_span::source_map::{respan, Span, Spanned};
use super::ty::{AllowPlus, RecoverQPath};
use super::{Parser, TokenType};
use crate::maybe_whole;
-use rustc_ast::ast::{self, AngleBracketedArg, AngleBracketedArgs, GenericArg, ParenthesizedArgs};
-use rustc_ast::ast::{AnonConst, AssocTyConstraint, AssocTyConstraintKind, BlockCheckMode};
-use rustc_ast::ast::{Path, PathSegment, QSelf};
use rustc_ast::ptr::P;
use rustc_ast::token::{self, Token};
+use rustc_ast::{
+ self as ast, AngleBracketedArg, AngleBracketedArgs, GenericArg, ParenthesizedArgs,
+};
+use rustc_ast::{AnonConst, AssocTyConstraint, AssocTyConstraintKind, BlockCheckMode};
+use rustc_ast::{Path, PathSegment, QSelf};
use rustc_errors::{pluralize, Applicability, PResult};
use rustc_span::source_map::{BytePos, Span};
use rustc_span::symbol::{kw, sym, Ident};
use super::{BlockMode, Parser, Restrictions, SemiColonMode};
use crate::maybe_whole;
-use rustc_ast::ast;
-use rustc_ast::ast::{AttrStyle, AttrVec, Attribute, MacCall, MacStmtStyle};
-use rustc_ast::ast::{Block, BlockCheckMode, Expr, ExprKind, Local, Stmt, StmtKind, DUMMY_NODE_ID};
+use rustc_ast as ast;
use rustc_ast::ptr::P;
use rustc_ast::token::{self, TokenKind};
use rustc_ast::util::classify;
+use rustc_ast::{AttrStyle, AttrVec, Attribute, MacCall, MacStmtStyle};
+use rustc_ast::{Block, BlockCheckMode, Expr, ExprKind, Local, Stmt, StmtKind, DUMMY_NODE_ID};
use rustc_errors::{Applicability, PResult};
use rustc_span::source_map::{BytePos, Span};
use rustc_span::symbol::{kw, sym};
use crate::{maybe_recover_from_interpolated_ty_qpath, maybe_whole};
-use rustc_ast::ast::{self, BareFnTy, FnRetTy, GenericParam, Lifetime, MutTy, Ty, TyKind};
-use rustc_ast::ast::{GenericBound, GenericBounds, MacCall, Mutability};
-use rustc_ast::ast::{PolyTraitRef, TraitBoundModifier, TraitObjectSyntax};
use rustc_ast::ptr::P;
use rustc_ast::token::{self, Token, TokenKind};
+use rustc_ast::{self as ast, BareFnTy, FnRetTy, GenericParam, Lifetime, MutTy, Ty, TyKind};
+use rustc_ast::{GenericBound, GenericBounds, MacCall, Mutability};
+use rustc_ast::{PolyTraitRef, TraitBoundModifier, TraitObjectSyntax};
use rustc_errors::{pluralize, struct_span_err, Applicability, PResult};
use rustc_span::source_map::Span;
use rustc_span::symbol::{kw, sym};
use crate::parse_in;
-use rustc_ast::ast::{self, Attribute, MacArgs, MacDelimiter, MetaItem, MetaItemKind};
use rustc_ast::tokenstream::DelimSpan;
+use rustc_ast::{self as ast, Attribute, MacArgs, MacDelimiter, MetaItem, MetaItemKind};
use rustc_errors::{Applicability, PResult};
use rustc_feature::{AttributeTemplate, BUILTIN_ATTRIBUTE_MAP};
use rustc_session::lint::builtin::ILL_FORMED_ATTRIBUTE_INPUT;
use rustc_middle::ty::query::Providers;
use rustc_middle::ty::TyCtxt;
-use rustc_ast::ast::{Attribute, NestedMetaItem};
+use rustc_ast::{Attribute, NestedMetaItem};
use rustc_errors::struct_span_err;
use rustc_hir as hir;
use rustc_hir::def_id::LocalDefId;
use rustc_middle::ty::{self, DefIdTree, TyCtxt};
use rustc_session::lint;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_span::symbol::{sym, Symbol};
// Any local node that may call something in its body block should be
//!
//! * Compiler internal types like `Ty` and `TyCtxt`
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_data_structures::fx::FxHashMap;
use rustc_hir as hir;
use rustc_hir::def_id::{DefId, LOCAL_CRATE};
// pieces of AST and HIR. The resulting numbers are good approximations but not
// completely accurate (some things might be counted twice, others missed).
-use rustc_ast::ast::{self, AttrId, NodeId};
use rustc_ast::visit as ast_visit;
+use rustc_ast::{self as ast, AttrId, NodeId};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_hir as hir;
use rustc_hir::intravisit as hir_visit;
-use rustc_ast::ast::{FloatTy, InlineAsmTemplatePiece, IntTy, UintTy};
+use rustc_ast::{FloatTy, InlineAsmTemplatePiece, IntTy, UintTy};
use rustc_errors::struct_span_err;
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res};
use rustc_middle::middle::cstore::ExternCrate;
use rustc_middle::ty::TyCtxt;
-use rustc_ast::ast::Attribute;
+use rustc_ast::Attribute;
use rustc_errors::struct_span_err;
use rustc_hir as hir;
use rustc_hir::def_id::{DefId, LOCAL_CRATE};
impl ItemLikeVisitor<'v> for LanguageItemCollector<'tcx> {
fn visit_item(&mut self, item: &hir::Item<'_>) {
- self.check_for_lang(Target::from_item(item), item.hir_id, item.attrs)
+ self.check_for_lang(Target::from_item(item), item.hir_id, item.attrs);
+
+ if let hir::ItemKind::Enum(def, ..) = &item.kind {
+ for variant in def.variants {
+ self.check_for_lang(Target::Variant, variant.id, variant.attrs);
+ }
+ }
}
fn visit_trait_item(&mut self, trait_item: &hir::TraitItem<'_>) {
-use rustc_ast::ast::Attribute;
+use rustc_ast::Attribute;
use rustc_hir as hir;
use rustc_hir::def_id::LocalDefId;
use rustc_hir::itemlikevisit::ItemLikeVisitor;
// and `#[unstable (..)]`), but are not declared in one single location
// (unlike lang features), which means we need to collect them instead.
-use rustc_ast::ast::{Attribute, MetaItem, MetaItemKind};
+use rustc_ast::{Attribute, MetaItem, MetaItemKind};
use rustc_errors::struct_span_err;
use rustc_hir::def_id::LOCAL_CRATE;
use rustc_hir::intravisit::{self, NestedVisitorMap, Visitor};
use self::LiveNodeKind::*;
use self::VarKind::*;
-use rustc_ast::ast::InlineAsmOptions;
+use rustc_ast::InlineAsmOptions;
use rustc_data_structures::fx::FxIndexMap;
use rustc_errors::Applicability;
use rustc_hir as hir;
| hir::ExprKind::Yield(..)
| hir::ExprKind::Type(..)
| hir::ExprKind::Err
- | hir::ExprKind::Path(hir::QPath::TypeRelative(..)) => {
+ | hir::ExprKind::Path(hir::QPath::TypeRelative(..))
+ | hir::ExprKind::Path(hir::QPath::LangItem(..)) => {
intravisit::walk_expr(ir, expr);
}
}
hir::ExprKind::Lit(..)
| hir::ExprKind::Err
- | hir::ExprKind::Path(hir::QPath::TypeRelative(..)) => succ,
+ | hir::ExprKind::Path(hir::QPath::TypeRelative(..))
+ | hir::ExprKind::Path(hir::QPath::LangItem(..)) => succ,
// Note that labels have been resolved, so we don't need to look
// at the label ident
//! A pass that annotates every item and method with its stability level,
//! propagating default levels lexically from parent to children ast nodes.
-use rustc_ast::ast::Attribute;
+use rustc_ast::Attribute;
use rustc_attr::{self as attr, ConstStability, Stability};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_errors::struct_span_err;
//! Used by `rustc` when loading a plugin.
use crate::Registry;
-use rustc_ast::ast::Crate;
+use rustc_ast::Crate;
use rustc_errors::struct_span_err;
use rustc_metadata::locator;
use rustc_middle::middle::cstore::MetadataLoader;
Res::Def(kind, def_id) => Some((kind, def_id)),
_ => None,
},
- hir::QPath::TypeRelative(..) => self
+ hir::QPath::TypeRelative(..) | hir::QPath::LangItem(..) => self
.maybe_typeck_results
.and_then(|typeck_results| typeck_results.type_dependent_def(id)),
};
let sess = self.tcx.sess;
let sm = sess.source_map();
let name = match qpath {
- hir::QPath::Resolved(_, path) => sm.span_to_snippet(path.span).ok(),
+ hir::QPath::Resolved(..) | hir::QPath::LangItem(..) => {
+ sm.span_to_snippet(qpath.span()).ok()
+ }
hir::QPath::TypeRelative(_, segment) => Some(segment.ident.to_string()),
};
let kind = kind.descr(def_id);
};
use crate::{Module, ModuleData, ModuleKind, NameBinding, NameBindingKind, Segment, ToNameBinding};
-use rustc_ast::ast::{self, Block, ForeignItem, ForeignItemKind, Item, ItemKind, NodeId};
-use rustc_ast::ast::{AssocItem, AssocItemKind, MetaItemKind, StmtKind};
use rustc_ast::token::{self, Token};
use rustc_ast::visit::{self, AssocCtxt, Visitor};
+use rustc_ast::{self as ast, Block, ForeignItem, ForeignItemKind, Item, ItemKind, NodeId};
+use rustc_ast::{AssocItem, AssocItemKind, MetaItemKind, StmtKind};
use rustc_ast_lowering::ResolverAstLowering;
use rustc_attr as attr;
use rustc_data_structures::sync::Lrc;
use crate::imports::ImportKind;
use crate::Resolver;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::node_id::NodeMap;
use rustc_ast::visit::{self, Visitor};
use rustc_ast_lowering::ResolverAstLowering;
use crate::Resolver;
-use rustc_ast::ast::*;
use rustc_ast::token::{self, Token};
use rustc_ast::visit::{self, FnKind};
use rustc_ast::walk_list;
+use rustc_ast::*;
use rustc_ast_lowering::ResolverAstLowering;
use rustc_expand::expand::AstFragment;
use rustc_hir::def_id::LocalDefId;
use std::cmp::Reverse;
use std::ptr;
-use rustc_ast::ast::{self, Path};
use rustc_ast::util::lev_distance::find_best_match_for_name;
+use rustc_ast::{self as ast, Path};
use rustc_ast_pretty::pprust;
use rustc_data_structures::fx::FxHashSet;
use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder};
use crate::{CrateLint, Module, ModuleOrUniformRoot, ParentScope, PerNS, ScopeSet, Weak};
use crate::{NameBinding, NameBindingKind, PathResult, PrivacyError, ToNameBinding};
-use rustc_ast::ast::NodeId;
use rustc_ast::unwrap_or;
use rustc_ast::util::lev_distance::find_best_match_for_name;
+use rustc_ast::NodeId;
use rustc_ast_lowering::ResolverAstLowering;
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::ptr_key::PtrKey;
use crate::{Module, ModuleOrUniformRoot, NameBindingKind, ParentScope, PathResult};
use crate::{ResolutionError, Resolver, Segment, UseError};
-use rustc_ast::ast::*;
use rustc_ast::ptr::P;
use rustc_ast::visit::{self, AssocCtxt, FnCtxt, FnKind, Visitor};
+use rustc_ast::*;
use rustc_ast::{unwrap_or, walk_list};
use rustc_ast_lowering::ResolverAstLowering;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use crate::{CrateLint, Module, ModuleKind, ModuleOrUniformRoot};
use crate::{PathResult, PathSource, Segment};
-use rustc_ast::ast::{self, Expr, ExprKind, Item, ItemKind, NodeId, Path, Ty, TyKind};
use rustc_ast::util::lev_distance::find_best_match_for_name;
use rustc_ast::visit::FnKind;
+use rustc_ast::{self as ast, Expr, ExprKind, Item, ItemKind, NodeId, Path, Ty, TyKind};
use rustc_data_structures::fx::FxHashSet;
use rustc_errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder};
use rustc_hir as hir;
}
}
+ fn visit_param_bound(&mut self, bound: &'tcx hir::GenericBound<'tcx>) {
+ match bound {
+ hir::GenericBound::LangItemTrait { .. } if !self.trait_ref_hack => {
+ let scope = Scope::Binder {
+ lifetimes: FxHashMap::default(),
+ s: self.scope,
+ next_early_index: self.next_early_index(),
+ track_lifetime_uses: true,
+ opaque_type_parent: false,
+ };
+ self.with(scope, |_, this| {
+ intravisit::walk_param_bound(this, bound);
+ });
+ }
+ _ => intravisit::walk_param_bound(self, bound),
+ }
+ }
+
fn visit_poly_trait_ref(
&mut self,
trait_ref: &'tcx hir::PolyTraitRef<'tcx>,
self.outer_index.shift_out(1);
}
+ fn visit_param_bound(&mut self, bound: &hir::GenericBound<'_>) {
+ if let hir::GenericBound::LangItemTrait { .. } = bound {
+ self.outer_index.shift_in(1);
+ intravisit::walk_param_bound(self, bound);
+ self.outer_index.shift_out(1);
+ } else {
+ intravisit::walk_param_bound(self, bound);
+ }
+ }
+
fn visit_lifetime(&mut self, lifetime_ref: &hir::Lifetime) {
if let Some(&lifetime) = self.map.defs.get(&lifetime_ref.hir_id) {
match lifetime {
use Determinacy::*;
use rustc_arena::TypedArena;
-use rustc_ast::ast::{self, FloatTy, IntTy, NodeId, UintTy};
-use rustc_ast::ast::{Crate, CRATE_NODE_ID};
-use rustc_ast::ast::{ItemKind, Path};
use rustc_ast::node_id::NodeMap;
use rustc_ast::unwrap_or;
use rustc_ast::visit::{self, Visitor};
+use rustc_ast::{self as ast, FloatTy, IntTy, NodeId, UintTy};
+use rustc_ast::{Crate, CRATE_NODE_ID};
+use rustc_ast::{ItemKind, Path};
use rustc_ast_lowering::ResolverAstLowering;
use rustc_ast_pretty::pprust;
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
self.cstore().item_generics_num_lifetimes(def_id, sess)
}
- fn resolve_str_path(
- &mut self,
- span: Span,
- crate_root: Option<Symbol>,
- components: &[Symbol],
- ns: Namespace,
- ) -> (ast::Path, Res) {
- let root = if crate_root.is_some() { kw::PathRoot } else { kw::Crate };
- let segments = iter::once(Ident::with_dummy_span(root))
- .chain(
- crate_root
- .into_iter()
- .chain(components.iter().cloned())
- .map(Ident::with_dummy_span),
- )
- .map(|i| self.new_ast_path_segment(i))
- .collect::<Vec<_>>();
-
- let path = ast::Path { span, segments };
-
- let parent_scope = &ParentScope::module(self.graph_root);
- let res = match self.resolve_ast_path(&path, ns, parent_scope) {
- Ok(res) => res,
- Err((span, error)) => {
- self.report_error(span, error);
- Res::Err
- }
- };
- (path, res)
- }
-
fn get_partial_res(&mut self, id: NodeId) -> Option<PartialRes> {
self.partial_res_map.get(&id).cloned()
}
use crate::{AmbiguityError, AmbiguityErrorMisc, AmbiguityKind, Determinacy};
use crate::{CrateLint, ParentScope, ResolutionError, Resolver, Scope, ScopeSet, Weak};
use crate::{ModuleKind, ModuleOrUniformRoot, NameBinding, PathResult, Segment, ToNameBinding};
-use rustc_ast::ast::{self, NodeId};
+use rustc_ast::{self as ast, NodeId};
use rustc_ast_lowering::ResolverAstLowering;
use rustc_ast_pretty::pprust;
use rustc_attr::StabilityLevel;
//! DumpVisitor walks the AST and processes it, and Dumper is used for
//! recording the output.
-use rustc_ast::ast::{self};
+use rustc_ast as ast;
use rustc_ast::{token, walk_list};
use rustc_data_structures::fx::FxHashSet;
use rustc_hir as hir;
// super-traits
for super_bound in trait_refs.iter() {
- let trait_ref = match *super_bound {
- hir::GenericBound::Trait(ref trait_ref, _) => trait_ref,
+ let (def_id, sub_span) = match *super_bound {
+ hir::GenericBound::Trait(ref trait_ref, _) => (
+ self.lookup_def_id(trait_ref.trait_ref.hir_ref_id),
+ trait_ref.trait_ref.path.segments.last().unwrap().ident.span,
+ ),
+ hir::GenericBound::LangItemTrait(lang_item, span, _, _) => {
+ (Some(self.tcx.require_lang_item(lang_item, Some(span))), span)
+ }
hir::GenericBound::Outlives(..) => continue,
};
- let trait_ref = &trait_ref.trait_ref;
- if let Some(id) = self.lookup_def_id(trait_ref.hir_ref_id) {
- let sub_span = trait_ref.path.segments.last().unwrap().ident.span;
+ if let Some(id) = def_id {
if !self.span.filter_generated(sub_span) {
let span = self.span_from_span(sub_span);
self.dumper.dump_ref(Ref {
}
fn process_path(&mut self, id: hir::HirId, path: &hir::QPath<'tcx>) {
- let span = match path {
- hir::QPath::Resolved(_, path) => path.span,
- hir::QPath::TypeRelative(_, segment) => segment.ident.span,
- };
- if self.span.filter_generated(span) {
+ if self.span.filter_generated(path.span()) {
return;
}
self.dump_path_ref(id, path);
self.visit_ty(ty);
std::slice::from_ref(*segment)
}
+ hir::QPath::LangItem(..) => return,
};
for seg in segments {
if let Some(ref generic_args) = seg.args {
}
if let Some(id) = self.lookup_def_id(t.hir_id) {
- let sub_span = match path {
- hir::QPath::Resolved(_, path) => path.segments.last().unwrap().ident.span,
- hir::QPath::TypeRelative(_, segment) => segment.ident.span,
- };
+ let sub_span = path.last_segment_span();
let span = self.span_from_span(sub_span);
self.dumper.dump_ref(Ref {
kind: RefKind::Type,
mod span_utils;
mod sig;
-use rustc_ast::ast::{self};
+use rustc_ast as ast;
use rustc_ast::util::comments::beautify_doc_string;
use rustc_ast_pretty::pprust::attribute_to_string;
use rustc_hir as hir;
}
}
}
- hir::ExprKind::Struct(qpath, ..) => {
- let segment = match qpath {
- hir::QPath::Resolved(_, path) => path.segments.last().unwrap(),
- hir::QPath::TypeRelative(_, segment) => segment,
- };
- match ty.kind {
- ty::Adt(def, _) => {
- let sub_span = segment.ident.span;
- filter!(self.span_utils, sub_span);
- let span = self.span_from_span(sub_span);
- Some(Data::RefData(Ref {
- kind: RefKind::Type,
- span,
- ref_id: id_from_def_id(def.did),
- }))
- }
- _ => {
- debug!("expected adt, found {:?}", ty);
- None
- }
+ hir::ExprKind::Struct(qpath, ..) => match ty.kind {
+ ty::Adt(def, _) => {
+ let sub_span = qpath.last_segment_span();
+ filter!(self.span_utils, sub_span);
+ let span = self.span_from_span(sub_span);
+ Some(Data::RefData(Ref {
+ kind: RefKind::Type,
+ span,
+ ref_id: id_from_def_id(def.did),
+ }))
}
- }
+ _ => {
+ debug!("expected adt, found {:?}", ty);
+ None
+ }
+ },
hir::ExprKind::MethodCall(ref seg, ..) => {
let method_id = match self.typeck_results().type_dependent_def_id(expr.hir_id) {
Some(id) => id,
})
| Node::Ty(&hir::Ty { kind: hir::TyKind::Path(ref qpath), .. }) => match qpath {
hir::QPath::Resolved(_, path) => path.res,
- hir::QPath::TypeRelative(..) => self
+ hir::QPath::TypeRelative(..) | hir::QPath::LangItem(..) => self
.maybe_typeck_results
.map_or(Res::Err, |typeck_results| typeck_results.qpath_res(qpath, hir_id)),
},
let segment = match path {
hir::QPath::Resolved(_, path) => path.segments.last(),
hir::QPath::TypeRelative(_, segment) => Some(*segment),
+ hir::QPath::LangItem(..) => None,
};
segment.and_then(|seg| {
self.get_path_segment_data(seg).or_else(|| self.get_path_segment_data_with_id(seg, id))
use rls_data::{SigElement, Signature};
-use rustc_ast::ast::Mutability;
+use rustc_ast::Mutability;
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res};
use rustc_hir_pretty::id_to_string;
refs: vec![SigElement { id, start, end }],
})
}
+ hir::TyKind::Path(hir::QPath::LangItem(lang_item, _)) => {
+ Ok(text_sig(format!("#[lang = \"{}\"]", lang_item.name())))
+ }
hir::TyKind::TraitObject(bounds, ..) => {
// FIXME recurse into bounds
let bounds: Vec<hir::GenericBound<'_>> = bounds
};
}
-declare_lint! {
- pub MISSING_FRAGMENT_SPECIFIER,
- Deny,
- "detects missing fragment specifiers in unused `macro_rules!` patterns",
- @future_incompatible = FutureIncompatibleInfo {
- reference: "issue #40107 <https://github.com/rust-lang/rust/issues/40107>",
- edition: None,
- };
-}
-
declare_lint! {
pub LATE_BOUND_LIFETIME_ARGUMENTS,
Warn,
UNALIGNED_REFERENCES,
SAFE_PACKED_BORROWS,
PATTERNS_IN_FNS_WITHOUT_BODY,
- MISSING_FRAGMENT_SPECIFIER,
LATE_BOUND_LIFETIME_ARGUMENTS,
ORDER_DEPENDENT_TRAIT_OBJECTS,
COHERENCE_LEAK_CHECK,
//! Related to out filenames of compilation (e.g. save analysis, binaries).
use crate::config::{CrateType, Input, OutputFilenames, OutputType};
use crate::Session;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_span::symbol::sym;
use rustc_span::Span;
use std::path::{Path, PathBuf};
pub unstable_features: UnstableFeatures,
pub config: CrateConfig,
pub edition: Edition,
- pub missing_fragment_specifiers: Lock<FxHashMap<Span, NodeId>>,
/// Places where raw identifiers were used. This is used for feature-gating raw identifiers.
pub raw_identifier_spans: Lock<Vec<Span>>,
/// Used to determine and report recursive module inclusions.
unstable_features: UnstableFeatures::from_environment(),
config: FxHashSet::default(),
edition: ExpnId::root().expn_data().edition,
- missing_fragment_specifiers: Default::default(),
raw_identifier_spans: Lock::new(Vec::new()),
included_mod_stack: Lock::new(vec![]),
source_map,
use crate::parse::ParseSess;
use crate::search_paths::{PathKind, SearchPath};
-pub use rustc_ast::ast::Attribute;
pub use rustc_ast::attr::MarkedAttrs;
pub use rustc_ast::crate_disambiguator::CrateDisambiguator;
+pub use rustc_ast::Attribute;
use rustc_data_structures::flock;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_data_structures::jobserver::{self, Client};
never_type,
never_type_fallback,
new,
+ new_unchecked,
next,
nll,
no,
quad_precision_float,
question_mark,
quote,
+ range_inclusive_new,
raw_dylib,
raw_identifiers,
raw_ref_op,
-use rustc_ast::ast::{FloatTy, IntTy, UintTy};
+use rustc_ast::{FloatTy, IntTy, UintTy};
use rustc_data_structures::base_n;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_hir as hir;
-use rustc_ast::ast::{MetaItem, NestedMetaItem};
+use rustc_ast::{MetaItem, NestedMetaItem};
use rustc_attr as attr;
use rustc_data_structures::fx::FxHashMap;
use rustc_errors::{struct_span_err, ErrorReported};
impl<'tcx> LowerInto<'tcx, chalk_ir::Ty<RustInterner<'tcx>>> for Ty<'tcx> {
fn lower_into(self, interner: &RustInterner<'tcx>) -> chalk_ir::Ty<RustInterner<'tcx>> {
use chalk_ir::TyData;
- use rustc_ast::ast;
+ use rustc_ast as ast;
use TyKind::*;
let empty = || chalk_ir::Substitution::empty(interner);
match _data {
chalk_ir::GenericArgData::Ty(_t) => {
use chalk_ir::TyData;
- use rustc_ast::ast;
+ use rustc_ast as ast;
let _data = _t.data(&interner);
let kind = match _data {
use crate::collect::PlaceholderHirTyCollector;
use crate::middle::resolve_lifetime as rl;
use crate::require_c_abi_if_c_variadic;
-use rustc_ast::{ast::ParamKindOrd, util::lev_distance::find_best_match_for_name};
+use rustc_ast::{util::lev_distance::find_best_match_for_name, ParamKindOrd};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_errors::ErrorReported;
use rustc_errors::{pluralize, struct_span_err, Applicability, DiagnosticId, FatalError};
)
}
+ pub fn instantiate_lang_item_trait_ref(
+ &self,
+ lang_item: hir::LangItem,
+ span: Span,
+ hir_id: hir::HirId,
+ args: &GenericArgs<'_>,
+ self_ty: Ty<'tcx>,
+ bounds: &mut Bounds<'tcx>,
+ ) {
+ let trait_def_id = self.tcx().require_lang_item(lang_item, Some(span));
+
+ let (substs, assoc_bindings, _) =
+ self.create_substs_for_ast_path(span, trait_def_id, &[], args, false, Some(self_ty));
+ let poly_trait_ref = ty::Binder::bind(ty::TraitRef::new(trait_def_id, substs));
+ bounds.trait_bounds.push((poly_trait_ref, span, Constness::NotConst));
+
+ let mut dup_bindings = FxHashMap::default();
+ for binding in assoc_bindings {
+ let _: Result<_, ErrorReported> = self.add_predicates_for_ast_type_binding(
+ hir_id,
+ poly_trait_ref,
+ &binding,
+ bounds,
+ false,
+ &mut dup_bindings,
+ span,
+ );
+ }
+ }
+
fn ast_path_to_mono_trait_ref(
&self,
span: Span,
trait_bounds.push((b, Constness::NotConst))
}
hir::GenericBound::Trait(_, hir::TraitBoundModifier::Maybe) => {}
+ hir::GenericBound::LangItemTrait(lang_item, span, hir_id, args) => self
+ .instantiate_lang_item_trait_ref(
+ lang_item, span, hir_id, args, param_ty, bounds,
+ ),
hir::GenericBound::Outlives(ref l) => region_bounds.push(l),
}
}
.map(|(ty, _, _)| ty)
.unwrap_or_else(|_| tcx.ty_error())
}
+ hir::TyKind::Path(hir::QPath::LangItem(lang_item, span)) => {
+ let def_id = tcx.require_lang_item(lang_item, Some(span));
+ let (substs, _, _) = self.create_substs_for_ast_path(
+ span,
+ def_id,
+ &[],
+ &GenericArgs::none(),
+ true,
+ None,
+ );
+ self.normalize_ty(span, tcx.at(span).type_of(def_id).subst(tcx, substs))
+ }
hir::TyKind::Array(ref ty, ref length) => {
let length_def_id = tcx.hir().local_def_id(length.hir_id);
let length = ty::Const::from_anon_const(tcx, length_def_id);
use crate::hir::def_id::DefId;
use crate::type_error_struct;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder, ErrorReported};
use rustc_hir as hir;
use rustc_hir::lang_items;
self.suggest_missing_await(err, expr, expected, expr_ty);
self.suggest_missing_parentheses(err, expr);
self.note_need_for_fn_pointer(err, expected, expr_ty);
+ self.note_internal_mutation_in_method(err, expr, expected, expr_ty);
}
// Requires that the two types unify, and prints an error message if
// parenthesize if needed (Issue #46756)
hir::ExprKind::Cast(_, _) | hir::ExprKind::Binary(_, _, _) => true,
// parenthesize borrows of range literals (Issue #54505)
- _ if is_range_literal(self.tcx.sess.source_map(), expr) => true,
+ _ if is_range_literal(expr) => true,
_ => false,
};
let sugg_expr = if needs_parens { format!("({})", src) } else { src };
use crate::check::TupleArgumentsFlag::DontTupleArguments;
use crate::type_error_struct;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::util::lev_distance::find_best_match_for_name;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stack::ensure_sufficient_stack;
ExprKind::AddrOf(kind, mutbl, ref oprnd) => {
self.check_expr_addr_of(kind, mutbl, oprnd, expected, expr)
}
+ ExprKind::Path(QPath::LangItem(lang_item, _)) => {
+ self.check_lang_item_path(lang_item, expr)
+ }
ExprKind::Path(ref qpath) => self.check_expr_path(qpath, expr),
ExprKind::InlineAsm(asm) => self.check_expr_asm(asm),
ExprKind::LlvmInlineAsm(ref asm) => {
}
}
+ fn check_lang_item_path(
+ &self,
+ lang_item: hir::LangItem,
+ expr: &'tcx hir::Expr<'tcx>,
+ ) -> Ty<'tcx> {
+ self.resolve_lang_item_path(lang_item, expr.span, expr.hir_id).1
+ }
+
fn check_expr_path(&self, qpath: &hir::QPath<'_>, expr: &'tcx hir::Expr<'tcx>) -> Ty<'tcx> {
let tcx = self.tcx;
let (res, opt_ty, segs) = self.resolve_ty_and_res_ufcs(qpath, expr.hir_id, expr.span);
return self.tcx.ty_error();
};
- let path_span = match *qpath {
- QPath::Resolved(_, ref path) => path.span,
- QPath::TypeRelative(ref qself, _) => qself.span,
- };
-
// Prohibit struct expressions when non-exhaustive flag is set.
let adt = adt_ty.ty_adt_def().expect("`check_struct_path` returned non-ADT type");
if !adt.did.is_local() && variant.is_field_list_non_exhaustive() {
adt_ty,
expected,
expr.hir_id,
- path_span,
+ qpath.span(),
variant,
fields,
base_expr.is_none(),
use crate::hir::def::DefKind;
use crate::hir::def_id::DefId;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::util::lev_distance::{find_best_match_for_name, lev_distance};
use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::sync::Lrc;
use crate::astconv::{
AstConv, ExplicitLateBound, GenericArgCountMismatch, GenericArgCountResult, PathSeg,
};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::util::parser::ExprPrecedence;
use rustc_attr as attr;
use rustc_data_structures::captures::Captures;
use rustc_middle::ty::subst::{self, InternalSubsts, Subst, SubstsRef};
use rustc_middle::ty::subst::{GenericArgKind, UserSelfTy, UserSubsts};
use rustc_middle::ty::util::{Discr, IntTypeExt, Representability};
-use rustc_middle::ty::{
- self, AdtKind, CanonicalUserType, Const, GenericParamDefKind, RegionKind, ToPolyTraitRef,
- ToPredicate, Ty, TyCtxt, UserType, WithConstness,
-};
+use rustc_middle::ty::WithConstness;
+use rustc_middle::ty::{self, AdtKind, CanonicalUserType, Const, DefIdTree, GenericParamDefKind};
+use rustc_middle::ty::{RegionKind, ToPolyTraitRef, ToPredicate, Ty, TyCtxt, UserType};
use rustc_session::config::{self, EntryFnType};
use rustc_session::lint;
use rustc_session::parse::feature_err;
qpath: &QPath<'_>,
hir_id: hir::HirId,
) -> Option<(&'tcx ty::VariantDef, Ty<'tcx>)> {
- let path_span = match *qpath {
- QPath::Resolved(_, ref path) => path.span,
- QPath::TypeRelative(ref qself, _) => qself.span,
- };
+ let path_span = qpath.qself_span();
let (def, ty) = self.finish_resolving_struct_path(qpath, path_span, hir_id);
let variant = match def {
Res::Err => {
(result.map(|(kind, def_id)| Res::Def(kind, def_id)).unwrap_or(Res::Err), ty)
}
+ QPath::LangItem(lang_item, span) => {
+ self.resolve_lang_item_path(lang_item, span, hir_id)
+ }
}
}
+ fn resolve_lang_item_path(
+ &self,
+ lang_item: hir::LangItem,
+ span: Span,
+ hir_id: hir::HirId,
+ ) -> (Res, Ty<'tcx>) {
+ let def_id = self.tcx.require_lang_item(lang_item, Some(span));
+ let def_kind = self.tcx.def_kind(def_id);
+
+ let item_ty = if let DefKind::Variant = def_kind {
+ self.tcx.type_of(self.tcx.parent(def_id).expect("variant w/out parent"))
+ } else {
+ self.tcx.type_of(def_id)
+ };
+ let substs = self.infcx.fresh_substs_for_item(span, def_id);
+ let ty = item_ty.subst(self.tcx, substs);
+
+ self.write_resolution(hir_id, Ok((def_kind, def_id)));
+ self.add_required_obligations(span, def_id, &substs);
+ (Res::Def(def_kind, def_id), ty)
+ }
+
/// Resolves an associated value path into a base type and associated constant, or method
/// resolution. The newly resolved definition is written into `type_dependent_defs`.
pub fn resolve_ty_and_res_ufcs<'b>(
);
}
QPath::TypeRelative(ref qself, ref segment) => (self.to_ty(qself), qself, segment),
+ QPath::LangItem(..) => bug!("`resolve_ty_and_res_ufcs` called on `LangItem`"),
};
if let Some(&cached_result) = self.typeck_results.borrow().type_dependent_defs().get(hir_id)
{
}
}
+ fn note_internal_mutation_in_method(
+ &self,
+ err: &mut DiagnosticBuilder<'_>,
+ expr: &hir::Expr<'_>,
+ expected: Ty<'tcx>,
+ found: Ty<'tcx>,
+ ) {
+ if found != self.tcx.types.unit {
+ return;
+ }
+ if let ExprKind::MethodCall(path_segment, _, [rcvr, ..], _) = expr.kind {
+ if self
+ .typeck_results
+ .borrow()
+ .expr_ty_adjusted_opt(rcvr)
+ .map_or(true, |ty| expected.peel_refs() != ty.peel_refs())
+ {
+ return;
+ }
+ let mut sp = MultiSpan::from_span(path_segment.ident.span);
+ sp.push_span_label(
+ path_segment.ident.span,
+ format!(
+ "this call modifies {} in-place",
+ match rcvr.kind {
+ ExprKind::Path(QPath::Resolved(
+ None,
+ hir::Path { segments: [segment], .. },
+ )) => format!("`{}`", segment.ident),
+ _ => "its receiver".to_string(),
+ }
+ ),
+ );
+ sp.push_span_label(
+ rcvr.span,
+ "you probably want to use this value after calling the method...".to_string(),
+ );
+ err.span_note(
+ sp,
+ &format!("method `{}` modifies its receiver in-place", path_segment.ident),
+ );
+ err.note(&format!("...instead of the `()` output of method `{}`", path_segment.ident));
+ }
+ }
+
/// When encountering an `impl Future` where `BoxFuture` is expected, suggest `Box::pin`.
fn suggest_calling_boxed_future_when_appropriate(
&self,
use crate::check::FnCtxt;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_ast::util::lev_distance::find_best_match_for_name;
use rustc_data_structures::fx::FxHashMap;
use rustc_errors::{pluralize, struct_span_err, Applicability, DiagnosticBuilder};
// |
// L | let A(()) = A(());
// | ^ ^
- [] => {
- let qpath_span = match qpath {
- hir::QPath::Resolved(_, path) => path.span,
- hir::QPath::TypeRelative(_, ps) => ps.ident.span,
- };
- (qpath_span.shrink_to_hi(), pat_span)
- }
+ [] => (qpath.span().shrink_to_hi(), pat_span),
// Easy case. Just take the "lo" of the first sub-pattern and the "hi" of the
// last sub-pattern. In the case of `A(x)` the first and last may coincide.
// This looks like:
use crate::check::{FnCtxt, Inherited};
use crate::constrained_generic_params::{identify_constrained_generic_params, Parameter};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_errors::{struct_span_err, Applicability, DiagnosticBuilder};
use rustc_hir as hir;
use rustc_hir::itemlikevisit::ItemLikeVisitor;
use rustc_middle::ty::{self, CrateInherentImpls, TyCtxt};
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_span::Span;
/// On-demand query: yields a map containing all types mapped to their inherent impls.
use crate::check::intrinsic::intrinsic_operation_unsafety;
use crate::constrained_generic_params as cgp;
use crate::middle::resolve_lifetime as rl;
-use rustc_ast::ast;
-use rustc_ast::ast::MetaItemKind;
+use rustc_ast as ast;
+use rustc_ast::MetaItemKind;
use rustc_attr::{list_contains_name, InlineAttr, OptimizeAttr};
use rustc_data_structures::captures::Captures;
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexSet};
predicates.extend(bounds.predicates(tcx, ty));
}
+ &hir::GenericBound::LangItemTrait(lang_item, span, hir_id, args) => {
+ let mut bounds = Bounds::default();
+ AstConv::instantiate_lang_item_trait_ref(
+ &icx,
+ lang_item,
+ span,
+ hir_id,
+ args,
+ ty,
+ &mut bounds,
+ );
+ predicates.extend(bounds.predicates(tcx, ty));
+ }
+
&hir::GenericBound::Outlives(ref lifetime) => {
let region = AstConv::ast_region_to_region(&icx, lifetime, None);
predicates.push((
let _ = astconv.instantiate_poly_trait_ref(tr, constness, param_ty, &mut bounds);
bounds.predicates(astconv.tcx(), param_ty)
}
+ hir::GenericBound::LangItemTrait(lang_item, span, hir_id, args) => {
+ let mut bounds = Bounds::default();
+ astconv.instantiate_lang_item_trait_ref(
+ lang_item,
+ span,
+ hir_id,
+ args,
+ param_ty,
+ &mut bounds,
+ );
+ bounds.predicates(astconv.tcx(), param_ty)
+ }
hir::GenericBound::Outlives(ref lifetime) => {
let region = astconv.ast_region_to_region(lifetime, None);
let pred = ty::PredicateAtom::TypeOutlives(ty::OutlivesPredicate(param_ty, region))
}
fn check_link_ordinal(tcx: TyCtxt<'_>, attr: &ast::Attribute) -> Option<usize> {
- use rustc_ast::ast::{Lit, LitIntType, LitKind};
+ use rustc_ast::{Lit, LitIntType, LitKind};
let meta_item_list = attr.meta_item_list();
let meta_item_list: Option<&[ast::NestedMetaItem]> = meta_item_list.as_ref().map(Vec::as_ref);
let sole_meta_list = match meta_item_list {
use std::mem;
use std::ops;
-use rustc_ast::ast::{LitKind, MetaItem, MetaItemKind, NestedMetaItem};
+use rustc_ast::{LitKind, MetaItem, MetaItemKind, NestedMetaItem};
use rustc_feature::Features;
use rustc_session::parse::ParseSess;
use rustc_span::symbol::{sym, Symbol};
use super::*;
-use rustc_ast::ast::*;
use rustc_ast::attr;
+use rustc_ast::Path;
use rustc_span::symbol::{Ident, Symbol};
use rustc_span::with_default_session_globals;
use rustc_span::DUMMY_SP;
use std::iter::once;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_data_structures::fx::FxHashSet;
use rustc_hir as hir;
use rustc_hir::def::{CtorKind, DefKind, Res};
pub mod types;
pub mod utils;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_attr as attr;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_hir as hir;
use rustc_hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX};
use rustc_index::vec::{Idx, IndexVec};
use rustc_infer::infer::region_constraints::{Constraint, RegionConstraintData};
+use rustc_middle::bug;
use rustc_middle::middle::resolve_lifetime as rl;
use rustc_middle::middle::stability;
use rustc_middle::ty::fold::TypeFolder;
fn clean(&self, cx: &DocContext<'_>) -> GenericBound {
match *self {
hir::GenericBound::Outlives(lt) => GenericBound::Outlives(lt.clean(cx)),
+ hir::GenericBound::LangItemTrait(lang_item, span, _, generic_args) => {
+ let def_id = cx.tcx.require_lang_item(lang_item, Some(span));
+
+ let trait_ref = ty::TraitRef::identity(cx.tcx, def_id);
+
+ let generic_args = generic_args.clean(cx);
+ let bindings = match generic_args {
+ GenericArgs::AngleBracketed { bindings, .. } => bindings,
+ _ => bug!("clean: parenthesized `GenericBound::LangItemTrait`"),
+ };
+
+ GenericBound::TraitBound(
+ PolyTrait { trait_: (trait_ref, &*bindings).clean(cx), generic_params: vec![] },
+ hir::TraitBoundModifier::None,
+ )
+ }
hir::GenericBound::Trait(ref t, modifier) => {
GenericBound::TraitBound(t.clean(cx), modifier)
}
trait_: box resolve_type(cx, trait_path.clean(cx), self.hir_id),
}
}
+ TyKind::Path(hir::QPath::LangItem(..)) => {
+ bug!("clean: requiring documentation of lang item")
+ }
TyKind::TraitObject(ref bounds, ref lifetime) => {
match bounds[0].clean(cx).trait_ {
ResolvedPath { path, param_names: None, did, is_generic } => {
use std::sync::Arc;
use std::{slice, vec};
-use rustc_ast::ast::{self, AttrStyle};
use rustc_ast::attr;
use rustc_ast::util::comments::beautify_doc_string;
+use rustc_ast::{self as ast, AttrStyle};
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_hir as hir;
use rustc_hir::def::Res;
impl Attributes {
/// Extracts the content from an attribute `#[doc(cfg(content))]`.
pub fn extract_cfg(mi: &ast::MetaItem) -> Option<&ast::MetaItem> {
- use rustc_ast::ast::NestedMetaItem::MetaItem;
+ use rustc_ast::NestedMetaItem::MetaItem;
if let ast::MetaItemKind::List(ref nmis) = mi.kind {
if nmis.len() == 1 {
let segments = match *p {
hir::QPath::Resolved(_, ref path) => &path.segments,
hir::QPath::TypeRelative(_, ref segment) => return segment.ident.to_string(),
+ hir::QPath::LangItem(lang_item, ..) => return lang_item.name().to_string(),
};
let mut s = String::new();
//! manner (and with prettier names) before cleaning.
pub use self::StructType::*;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_span::hygiene::MacroKind;
use rustc_span::{self, Span, Symbol};
match *clean_type {
clean::ResolvedPath { ref path, .. } => {
let segments = &path.segments;
- let path_segment = segments.iter().last().unwrap_or_else(|| panic!(
+ let path_segment = segments.iter().last().unwrap_or_else(|| {
+ panic!(
"get_index_type_name(clean_type: {:?}, accept_generic: {:?}) had length zero path",
clean_type, accept_generic
- ));
+ )
+ });
Some(path_segment.name.clone())
}
clean::Generic(ref s) if accept_generic => Some(s.clone()),
use crate::config::OutputFormat;
use crate::core::DocContext;
use crate::fold::{self, DocFolder};
+use crate::html::markdown::{find_testable_code, ErrorCodes};
+use crate::passes::doc_test_lints::Tests;
use crate::passes::Pass;
-
use rustc_span::symbol::sym;
use rustc_span::FileName;
use serde::Serialize;
struct ItemCount {
total: u64,
with_docs: u64,
+ with_examples: u64,
}
impl ItemCount {
- fn count_item(&mut self, has_docs: bool) {
+ fn count_item(&mut self, has_docs: bool, has_doc_example: bool) {
self.total += 1;
if has_docs {
self.with_docs += 1;
}
+ if has_doc_example {
+ self.with_examples += 1;
+ }
}
fn percentage(&self) -> Option<f64> {
None
}
}
+
+ fn examples_percentage(&self) -> Option<f64> {
+ if self.total > 0 {
+ Some((self.with_examples as f64 * 100.0) / self.total as f64)
+ } else {
+ None
+ }
+ }
}
impl ops::Sub for ItemCount {
type Output = Self;
fn sub(self, rhs: Self) -> Self {
- ItemCount { total: self.total - rhs.total, with_docs: self.with_docs - rhs.with_docs }
+ ItemCount {
+ total: self.total - rhs.total,
+ with_docs: self.with_docs - rhs.with_docs,
+ with_examples: self.with_examples - rhs.with_examples,
+ }
}
}
fn add_assign(&mut self, rhs: Self) {
self.total += rhs.total;
self.with_docs += rhs.with_docs;
+ self.with_examples += rhs.with_examples;
}
}
let mut total = ItemCount::default();
fn print_table_line() {
- println!("+-{0:->35}-+-{0:->10}-+-{0:->10}-+-{0:->10}-+", "");
+ println!("+-{0:->35}-+-{0:->10}-+-{0:->10}-+-{0:->10}-+-{0:->10}-+-{0:->10}-+", "");
}
- fn print_table_record(name: &str, count: ItemCount, percentage: f64) {
+ fn print_table_record(
+ name: &str,
+ count: ItemCount,
+ percentage: f64,
+ examples_percentage: f64,
+ ) {
println!(
- "| {:<35} | {:>10} | {:>10} | {:>9.1}% |",
- name, count.with_docs, count.total, percentage
+ "| {:<35} | {:>10} | {:>10} | {:>9.1}% | {:>10} | {:>9.1}% |",
+ name,
+ count.with_docs,
+ count.total,
+ percentage,
+ count.with_examples,
+ examples_percentage,
);
}
print_table_line();
println!(
- "| {:<35} | {:>10} | {:>10} | {:>10} |",
- "File", "Documented", "Total", "Percentage"
+ "| {:<35} | {:>10} | {:>10} | {:>10} | {:>10} | {:>10} |",
+ "File", "Documented", "Total", "Percentage", "Examples", "Percentage",
);
print_table_line();
for (file, &count) in &self.items {
- if let Some(percentage) = count.percentage() {
- print_table_record(&limit_filename_len(file.to_string()), count, percentage);
+ if let (Some(percentage), Some(examples_percentage)) =
+ (count.percentage(), count.examples_percentage())
+ {
+ print_table_record(
+ &limit_filename_len(file.to_string()),
+ count,
+ percentage,
+ examples_percentage,
+ );
total += count;
}
}
print_table_line();
- print_table_record("Total", total, total.percentage().unwrap_or(0.0));
+ print_table_record(
+ "Total",
+ total,
+ total.percentage().unwrap_or(0.0),
+ total.examples_percentage().unwrap_or(0.0),
+ );
print_table_line();
}
}
impl fold::DocFolder for CoverageCalculator {
fn fold_item(&mut self, i: clean::Item) -> Option<clean::Item> {
let has_docs = !i.attrs.doc_strings.is_empty();
+ let mut tests = Tests { found_tests: 0 };
+
+ find_testable_code(
+ &i.attrs.doc_strings.iter().map(|d| d.as_str()).collect::<Vec<_>>().join("\n"),
+ &mut tests,
+ ErrorCodes::No,
+ false,
+ None,
+ );
+
+ let has_doc_example = tests.found_tests != 0;
match i.inner {
_ if !i.def_id.is_local() => {
}
_ => {
debug!("counting {:?} {:?} in {}", i.type_(), i.name, i.source.filename);
- self.items.entry(i.source.filename.clone()).or_default().count_item(has_docs);
+ self.items
+ .entry(i.source.filename.clone())
+ .or_default()
+ .count_item(has_docs, has_doc_example);
}
}
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_errors::{Applicability, DiagnosticBuilder};
use rustc_expand::base::SyntaxExtensionKind;
use rustc_feature::UnstableFeatures;
disambiguator,
None | Some(Disambiguator::Namespace(Namespace::TypeNS))
) {
- if let Some(prim) = is_primitive(path_str, ns) {
+ if let Some((path, prim)) = is_primitive(path_str, ns) {
if extra_fragment.is_some() {
return Err(ErrorKind::AnchorFailure(AnchorFailure::Primitive));
}
- return Ok((prim, Some(path_str.to_owned())));
+ return Ok((prim, Some(path.to_owned())));
}
}
return Ok((res, extra_fragment.clone()));
if value != (ns == ValueNS) {
return Err(ErrorKind::ResolutionFailure);
}
- } else if let Some(prim) = is_primitive(path_str, ns) {
+ } else if let Some((path, prim)) = is_primitive(path_str, ns) {
if extra_fragment.is_some() {
return Err(ErrorKind::AnchorFailure(AnchorFailure::Primitive));
}
- return Ok((prim, Some(path_str.to_owned())));
+ return Ok((prim, Some(path.to_owned())));
} else {
// If resolution failed, it may still be a method
// because methods are not handled by the resolver
})
.ok_or(ErrorKind::ResolutionFailure)?;
- if let Some(prim) = is_primitive(&path, TypeNS) {
+ if let Some((path, prim)) = is_primitive(&path, TypeNS) {
let did = primitive_impl(cx, &path).ok_or(ErrorKind::ResolutionFailure)?;
return cx
.tcx
}
const PRIMITIVES: &[(&str, Res)] = &[
- ("u8", Res::PrimTy(hir::PrimTy::Uint(rustc_ast::ast::UintTy::U8))),
- ("u16", Res::PrimTy(hir::PrimTy::Uint(rustc_ast::ast::UintTy::U16))),
- ("u32", Res::PrimTy(hir::PrimTy::Uint(rustc_ast::ast::UintTy::U32))),
- ("u64", Res::PrimTy(hir::PrimTy::Uint(rustc_ast::ast::UintTy::U64))),
- ("u128", Res::PrimTy(hir::PrimTy::Uint(rustc_ast::ast::UintTy::U128))),
- ("usize", Res::PrimTy(hir::PrimTy::Uint(rustc_ast::ast::UintTy::Usize))),
- ("i8", Res::PrimTy(hir::PrimTy::Int(rustc_ast::ast::IntTy::I8))),
- ("i16", Res::PrimTy(hir::PrimTy::Int(rustc_ast::ast::IntTy::I16))),
- ("i32", Res::PrimTy(hir::PrimTy::Int(rustc_ast::ast::IntTy::I32))),
- ("i64", Res::PrimTy(hir::PrimTy::Int(rustc_ast::ast::IntTy::I64))),
- ("i128", Res::PrimTy(hir::PrimTy::Int(rustc_ast::ast::IntTy::I128))),
- ("isize", Res::PrimTy(hir::PrimTy::Int(rustc_ast::ast::IntTy::Isize))),
- ("f32", Res::PrimTy(hir::PrimTy::Float(rustc_ast::ast::FloatTy::F32))),
- ("f64", Res::PrimTy(hir::PrimTy::Float(rustc_ast::ast::FloatTy::F64))),
+ ("u8", Res::PrimTy(hir::PrimTy::Uint(rustc_ast::UintTy::U8))),
+ ("u16", Res::PrimTy(hir::PrimTy::Uint(rustc_ast::UintTy::U16))),
+ ("u32", Res::PrimTy(hir::PrimTy::Uint(rustc_ast::UintTy::U32))),
+ ("u64", Res::PrimTy(hir::PrimTy::Uint(rustc_ast::UintTy::U64))),
+ ("u128", Res::PrimTy(hir::PrimTy::Uint(rustc_ast::UintTy::U128))),
+ ("usize", Res::PrimTy(hir::PrimTy::Uint(rustc_ast::UintTy::Usize))),
+ ("i8", Res::PrimTy(hir::PrimTy::Int(rustc_ast::IntTy::I8))),
+ ("i16", Res::PrimTy(hir::PrimTy::Int(rustc_ast::IntTy::I16))),
+ ("i32", Res::PrimTy(hir::PrimTy::Int(rustc_ast::IntTy::I32))),
+ ("i64", Res::PrimTy(hir::PrimTy::Int(rustc_ast::IntTy::I64))),
+ ("i128", Res::PrimTy(hir::PrimTy::Int(rustc_ast::IntTy::I128))),
+ ("isize", Res::PrimTy(hir::PrimTy::Int(rustc_ast::IntTy::Isize))),
+ ("f32", Res::PrimTy(hir::PrimTy::Float(rustc_ast::FloatTy::F32))),
+ ("f64", Res::PrimTy(hir::PrimTy::Float(rustc_ast::FloatTy::F64))),
("str", Res::PrimTy(hir::PrimTy::Str)),
("bool", Res::PrimTy(hir::PrimTy::Bool)),
+ ("true", Res::PrimTy(hir::PrimTy::Bool)),
+ ("false", Res::PrimTy(hir::PrimTy::Bool)),
("char", Res::PrimTy(hir::PrimTy::Char)),
];
-fn is_primitive(path_str: &str, ns: Namespace) -> Option<Res> {
- if ns == TypeNS { PRIMITIVES.iter().find(|x| x.0 == path_str).map(|x| x.1) } else { None }
+fn is_primitive(path_str: &str, ns: Namespace) -> Option<(&'static str, Res)> {
+ if ns == TypeNS {
+ PRIMITIVES
+ .iter()
+ .filter(|x| x.0 == path_str)
+ .copied()
+ .map(|x| if x.0 == "true" || x.0 == "false" { ("bool", x.1) } else { x })
+ .next()
+ } else {
+ None
+ }
}
fn primitive_impl(cx: &DocContext<'_>, path_str: &str) -> Option<DefId> {
}
}
+pub(crate) struct Tests {
+ pub(crate) found_tests: usize,
+}
+
+impl Tests {
+ pub(crate) fn new() -> Tests {
+ Tests { found_tests: 0 }
+ }
+}
+
+impl crate::test::Tester for Tests {
+ fn add_test(&mut self, _: String, _: LangString, _: usize) {
+ self.found_tests += 1;
+ }
+}
+
pub fn look_for_tests<'tcx>(cx: &DocContext<'tcx>, dox: &str, item: &Item) {
let hir_id = match cx.as_local_hir_id(item.def_id) {
Some(hir_id) => hir_id,
}
};
- struct Tests {
- found_tests: usize,
- }
-
- impl crate::test::Tester for Tests {
- fn add_test(&mut self, _: String, _: LangString, _: usize) {
- self.found_tests += 1;
- }
- }
-
- let mut tests = Tests { found_tests: 0 };
+ let mut tests = Tests::new();
find_testable_code(&dox, &mut tests, ErrorCodes::No, false, None);
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_data_structures::sync::Lrc;
use rustc_errors::ErrorReported;
use rustc_feature::UnstableFeatures;
//! The Rust AST Visitor. Extracts useful information and massages it into a form
//! usable for `clean`.
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res};
--- /dev/null
+// compile-flags: -O
+// ignore-debug: the debug assertions get in the way
+#![crate_type = "lib"]
+#![feature(shrink_to)]
+
+// Make sure that `Vec::shrink_to_fit` never emits panics via `RawVec::shrink_to_fit`,
+// "Tried to shrink to a larger capacity", because the length is *always* <= capacity.
+
+// CHECK-LABEL: @shrink_to_fit
+#[no_mangle]
+pub fn shrink_to_fit(vec: &mut Vec<u32>) {
+ // CHECK-NOT: panic
+ vec.shrink_to_fit();
+}
+
+// CHECK-LABEL: @issue71861
+#[no_mangle]
+pub fn issue71861(n: usize) -> Box<[u32]> {
+ // CHECK-NOT: panic
+ vec![0; n].into_boxed_slice()
+}
+
+// CHECK-LABEL: @issue75636
+#[no_mangle]
+pub fn issue75636<'a>(iter: &[&'a str]) -> Box<[&'a str]> {
+ // CHECK-NOT: panic
+ iter.iter().copied().collect()
+}
+
+// Sanity-check that we do see a possible panic for an arbitrary `Vec::shrink_to`.
+// CHECK-LABEL: @shrink_to
+#[no_mangle]
+pub fn shrink_to(vec: &mut Vec<u32>) {
+ // CHECK: panic
+ vec.shrink_to(42);
+}
StorageLive(_1); // scope 0 at $DIR/address-of.rs:4:9: 4:10
StorageLive(_2); // scope 0 at $DIR/address-of.rs:4:14: 4:21
_2 = [const 0_i32; 10]; // scope 0 at $DIR/address-of.rs:4:14: 4:21
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/address-of.rs:4:15: 4:16
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
_1 = &_2; // scope 0 at $DIR/address-of.rs:4:13: 4:21
FakeRead(ForLet, _1); // scope 0 at $DIR/address-of.rs:4:9: 4:10
StorageLive(_3); // scope 1 at $DIR/address-of.rs:5:9: 5:14
StorageLive(_4); // scope 1 at $DIR/address-of.rs:5:22: 5:29
_4 = [const 0_i32; 10]; // scope 1 at $DIR/address-of.rs:5:22: 5:29
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/address-of.rs:5:23: 5:24
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
_3 = &mut _4; // scope 1 at $DIR/address-of.rs:5:17: 5:29
FakeRead(ForLet, _3); // scope 1 at $DIR/address-of.rs:5:9: 5:14
StorageLive(_5); // scope 2 at $DIR/address-of.rs:7:5: 7:18
bb0: {
StorageLive(_1); // scope 0 at $DIR/array-index-is-temporary.rs:13:9: 13:14
_1 = [const 42_u32, const 43_u32, const 44_u32]; // scope 0 at $DIR/array-index-is-temporary.rs:13:17: 13:29
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/array-index-is-temporary.rs:13:18: 13:20
- // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x0000002b))
- // mir::Constant
- // + span: $DIR/array-index-is-temporary.rs:13:22: 13:24
- // + literal: Const { ty: u32, val: Value(Scalar(0x0000002b)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x0000002c))
- // mir::Constant
- // + span: $DIR/array-index-is-temporary.rs:13:26: 13:28
- // + literal: Const { ty: u32, val: Value(Scalar(0x0000002c)) }
StorageLive(_2); // scope 1 at $DIR/array-index-is-temporary.rs:14:9: 14:14
_2 = const 1_usize; // scope 1 at $DIR/array-index-is-temporary.rs:14:17: 14:18
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/array-index-is-temporary.rs:14:17: 14:18
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
StorageLive(_3); // scope 2 at $DIR/array-index-is-temporary.rs:15:9: 15:10
StorageLive(_4); // scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
_4 = &mut _2; // scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
bb0: {
StorageLive(_1); // scope 0 at $DIR/array-index-is-temporary.rs:13:9: 13:14
_1 = [const 42_u32, const 43_u32, const 44_u32]; // scope 0 at $DIR/array-index-is-temporary.rs:13:17: 13:29
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/array-index-is-temporary.rs:13:18: 13:20
- // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x0000002b))
- // mir::Constant
- // + span: $DIR/array-index-is-temporary.rs:13:22: 13:24
- // + literal: Const { ty: u32, val: Value(Scalar(0x0000002b)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x0000002c))
- // mir::Constant
- // + span: $DIR/array-index-is-temporary.rs:13:26: 13:28
- // + literal: Const { ty: u32, val: Value(Scalar(0x0000002c)) }
StorageLive(_2); // scope 1 at $DIR/array-index-is-temporary.rs:14:9: 14:14
_2 = const 1_usize; // scope 1 at $DIR/array-index-is-temporary.rs:14:17: 14:18
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000001))
- // mir::Constant
- // + span: $DIR/array-index-is-temporary.rs:14:17: 14:18
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
StorageLive(_3); // scope 2 at $DIR/array-index-is-temporary.rs:15:9: 15:10
StorageLive(_4); // scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
_4 = &mut _2; // scope 2 at $DIR/array-index-is-temporary.rs:15:25: 15:31
bb0: {
StorageLive(_1); // scope 0 at $DIR/basic_assignment.rs:11:9: 11:17
_1 = const false; // scope 0 at $DIR/basic_assignment.rs:11:20: 11:25
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/basic_assignment.rs:11:20: 11:25
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
FakeRead(ForLet, _1); // scope 0 at $DIR/basic_assignment.rs:11:9: 11:17
StorageLive(_2); // scope 1 at $DIR/basic_assignment.rs:12:9: 12:17
StorageLive(_3); // scope 2 at $DIR/basic_assignment.rs:16:16: 16:24
// + literal: Const { ty: &[u8; 3], val: Value(Scalar(alloc0)) }
StorageLive(_2); // scope 1 at $DIR/byte_slice.rs:6:9: 6:10
_2 = [const 5_u8, const 120_u8]; // scope 1 at $DIR/byte_slice.rs:6:13: 6:24
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x05))
- // mir::Constant
- // + span: $DIR/byte_slice.rs:6:14: 6:17
- // + literal: Const { ty: u8, val: Value(Scalar(0x05)) }
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x78))
- // mir::Constant
- // + span: $DIR/byte_slice.rs:6:19: 6:23
- // + literal: Const { ty: u8, val: Value(Scalar(0x78)) }
_0 = const (); // scope 0 at $DIR/byte_slice.rs:4:11: 7:2
// ty::Const
// + ty: ()
StorageLive(_2); // scope 0 at $DIR/combine_array_len.rs:5:9: 5:10
StorageLive(_3); // scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
_3 = const 0_usize; // scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/combine_array_len.rs:5:15: 5:16
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
- _4 = Len(_1); // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+ _4 = const 2_usize; // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x00000002))
-+ // mir::Constant
-+ // + span: $DIR/combine_array_len.rs:5:13: 5:17
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
_5 = Lt(_3, _4); // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
}
StorageLive(_6); // scope 1 at $DIR/combine_array_len.rs:6:9: 6:10
StorageLive(_7); // scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
_7 = const 1_usize; // scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/combine_array_len.rs:6:15: 6:16
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
- _8 = Len(_1); // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+ _8 = const 2_usize; // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x00000002))
-+ // mir::Constant
-+ // + span: $DIR/combine_array_len.rs:6:13: 6:17
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
_9 = Lt(_7, _8); // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
}
StorageLive(_2); // scope 0 at $DIR/combine_array_len.rs:5:9: 5:10
StorageLive(_3); // scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
_3 = const 0_usize; // scope 0 at $DIR/combine_array_len.rs:5:15: 5:16
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000000))
- // mir::Constant
- // + span: $DIR/combine_array_len.rs:5:15: 5:16
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
- _4 = Len(_1); // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
+ _4 = const 2_usize; // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x0000000000000002))
-+ // mir::Constant
-+ // + span: $DIR/combine_array_len.rs:5:13: 5:17
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000002)) }
_5 = Lt(_3, _4); // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/combine_array_len.rs:5:13: 5:17
}
StorageLive(_6); // scope 1 at $DIR/combine_array_len.rs:6:9: 6:10
StorageLive(_7); // scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
_7 = const 1_usize; // scope 1 at $DIR/combine_array_len.rs:6:15: 6:16
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000001))
- // mir::Constant
- // + span: $DIR/combine_array_len.rs:6:15: 6:16
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
- _8 = Len(_1); // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
+ _8 = const 2_usize; // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x0000000000000002))
-+ // mir::Constant
-+ // + span: $DIR/combine_array_len.rs:6:13: 6:17
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000002)) }
_9 = Lt(_7, _8); // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
assert(move _9, "index out of bounds: the len is {} but the index is {}", move _8, _7) -> bb2; // scope 1 at $DIR/combine_array_len.rs:6:13: 6:17
}
StorageLive(_2); // scope 0 at $DIR/aggregate.rs:5:13: 5:24
StorageLive(_3); // scope 0 at $DIR/aggregate.rs:5:13: 5:22
(_3.0: i32) = const 0_i32; // scope 0 at $DIR/aggregate.rs:5:13: 5:22
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/aggregate.rs:5:14: 5:15
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
(_3.1: i32) = const 1_i32; // scope 0 at $DIR/aggregate.rs:5:13: 5:22
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/aggregate.rs:5:17: 5:18
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
(_3.2: i32) = const 2_i32; // scope 0 at $DIR/aggregate.rs:5:13: 5:22
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/aggregate.rs:5:20: 5:21
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
- _2 = (_3.1: i32); // scope 0 at $DIR/aggregate.rs:5:13: 5:24
- _1 = Add(move _2, const 0_i32); // scope 0 at $DIR/aggregate.rs:5:13: 5:28
+ _2 = const 1_i32; // scope 0 at $DIR/aggregate.rs:5:13: 5:24
- // ty::Const
- // + ty: i32
-- // + val: Value(Scalar(0x00000000))
-+ // + val: Value(Scalar(0x00000001))
- // mir::Constant
-- // + span: $DIR/aggregate.rs:5:27: 5:28
-- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
-+ // + span: $DIR/aggregate.rs:5:13: 5:24
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
+ _1 = const 1_i32; // scope 0 at $DIR/aggregate.rs:5:13: 5:28
-+ // ty::Const
-+ // + ty: i32
-+ // + val: Value(Scalar(0x00000001))
-+ // mir::Constant
-+ // + span: $DIR/aggregate.rs:5:13: 5:28
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
StorageDead(_2); // scope 0 at $DIR/aggregate.rs:5:27: 5:28
StorageDead(_3); // scope 0 at $DIR/aggregate.rs:5:28: 5:29
_0 = const (); // scope 0 at $DIR/aggregate.rs:4:11: 6:2
StorageLive(_1); // scope 0 at $DIR/array_index.rs:5:9: 5:10
StorageLive(_2); // scope 0 at $DIR/array_index.rs:5:18: 5:30
_2 = [const 0_u32, const 1_u32, const 2_u32, const 3_u32]; // scope 0 at $DIR/array_index.rs:5:18: 5:30
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/array_index.rs:5:19: 5:20
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/array_index.rs:5:22: 5:23
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/array_index.rs:5:25: 5:26
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/array_index.rs:5:28: 5:29
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
StorageLive(_3); // scope 0 at $DIR/array_index.rs:5:31: 5:32
_3 = const 2_usize; // scope 0 at $DIR/array_index.rs:5:31: 5:32
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/array_index.rs:5:31: 5:32
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
_4 = const 4_usize; // scope 0 at $DIR/array_index.rs:5:18: 5:33
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000004))
- // mir::Constant
- // + span: $DIR/array_index.rs:5:18: 5:33
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000004)) }
- _5 = Lt(_3, _4); // scope 0 at $DIR/array_index.rs:5:18: 5:33
- assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33
+ _5 = const true; // scope 0 at $DIR/array_index.rs:5:18: 5:33
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/array_index.rs:5:18: 5:33
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 4_usize, const 2_usize) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/array_index.rs:5:18: 5:33
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x00000004))
-+ // mir::Constant
-+ // + span: $DIR/array_index.rs:5:18: 5:33
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000004)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x00000002))
-+ // mir::Constant
-+ // + span: $DIR/array_index.rs:5:18: 5:33
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
}
bb1: {
- _1 = _2[_3]; // scope 0 at $DIR/array_index.rs:5:18: 5:33
+ _1 = const 2_u32; // scope 0 at $DIR/array_index.rs:5:18: 5:33
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x00000002))
-+ // mir::Constant
-+ // + span: $DIR/array_index.rs:5:18: 5:33
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageDead(_3); // scope 0 at $DIR/array_index.rs:5:33: 5:34
StorageDead(_2); // scope 0 at $DIR/array_index.rs:5:33: 5:34
_0 = const (); // scope 0 at $DIR/array_index.rs:4:11: 6:2
StorageLive(_1); // scope 0 at $DIR/array_index.rs:5:9: 5:10
StorageLive(_2); // scope 0 at $DIR/array_index.rs:5:18: 5:30
_2 = [const 0_u32, const 1_u32, const 2_u32, const 3_u32]; // scope 0 at $DIR/array_index.rs:5:18: 5:30
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/array_index.rs:5:19: 5:20
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/array_index.rs:5:22: 5:23
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/array_index.rs:5:25: 5:26
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/array_index.rs:5:28: 5:29
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
StorageLive(_3); // scope 0 at $DIR/array_index.rs:5:31: 5:32
_3 = const 2_usize; // scope 0 at $DIR/array_index.rs:5:31: 5:32
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000002))
- // mir::Constant
- // + span: $DIR/array_index.rs:5:31: 5:32
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000002)) }
_4 = const 4_usize; // scope 0 at $DIR/array_index.rs:5:18: 5:33
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000004))
- // mir::Constant
- // + span: $DIR/array_index.rs:5:18: 5:33
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000004)) }
- _5 = Lt(_3, _4); // scope 0 at $DIR/array_index.rs:5:18: 5:33
- assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33
+ _5 = const true; // scope 0 at $DIR/array_index.rs:5:18: 5:33
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/array_index.rs:5:18: 5:33
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 4_usize, const 2_usize) -> bb1; // scope 0 at $DIR/array_index.rs:5:18: 5:33
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/array_index.rs:5:18: 5:33
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x0000000000000004))
-+ // mir::Constant
-+ // + span: $DIR/array_index.rs:5:18: 5:33
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000004)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x0000000000000002))
-+ // mir::Constant
-+ // + span: $DIR/array_index.rs:5:18: 5:33
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000002)) }
}
bb1: {
- _1 = _2[_3]; // scope 0 at $DIR/array_index.rs:5:18: 5:33
+ _1 = const 2_u32; // scope 0 at $DIR/array_index.rs:5:18: 5:33
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x00000002))
-+ // mir::Constant
-+ // + span: $DIR/array_index.rs:5:18: 5:33
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageDead(_3); // scope 0 at $DIR/array_index.rs:5:33: 5:34
StorageDead(_2); // scope 0 at $DIR/array_index.rs:5:33: 5:34
_0 = const (); // scope 0 at $DIR/array_index.rs:4:11: 6:2
bb0: {
StorageLive(_1); // scope 0 at $DIR/bad_op_div_by_zero.rs:4:9: 4:10
_1 = const 0_i32; // scope 0 at $DIR/bad_op_div_by_zero.rs:4:13: 4:14
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/bad_op_div_by_zero.rs:4:13: 4:14
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
StorageLive(_2); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:9: 5:11
StorageLive(_3); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:18: 5:19
- _3 = _1; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:18: 5:19
- _4 = Eq(_3, const 0_i32); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
-+ _3 = const 0_i32; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:18: 5:19
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
-- // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
-+ // + span: $DIR/bad_op_div_by_zero.rs:5:18: 5:19
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
- assert(!move _4, "attempt to divide {} by zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++ _3 = const 0_i32; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:18: 5:19
+ _4 = const true; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
- // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+ assert(!const true, "attempt to divide {} by zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:15
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
}
bb1: {
- _5 = Eq(_3, const -1_i32); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
-+ _5 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
- // ty::Const
-- // + ty: i32
-- // + val: Value(Scalar(0xffffffff))
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
-- // + literal: Const { ty: i32, val: Value(Scalar(0xffffffff)) }
- _6 = Eq(const 1_i32, const i32::MIN); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+ _6 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
- // ty::Const
-- // + ty: i32
-- // + val: Value(Scalar(0x00000001))
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
- // mir::Constant
-- // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:15
-- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-+ // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+ _7 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
- // ty::Const
-- // + ty: i32
-- // + val: Value(Scalar(0x80000000))
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
-- // + literal: Const { ty: i32, val: Value(Scalar(0x80000000)) }
- _7 = BitAnd(move _5, move _6); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
- assert(!move _7, "attempt to compute `{} / {}` which would overflow", const 1_i32, _3) -> bb2; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++ _5 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++ _6 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
++ _7 = const false; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+ assert(!const false, "attempt to compute `{} / {}` which would overflow", const 1_i32, const 0_i32) -> bb2; // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
- // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
-+ // mir::Constant
-+ // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+ // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:15
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-+ // ty::Const
-+ // + ty: i32
-+ // + val: Value(Scalar(0x00000000))
-+ // mir::Constant
-+ // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
}
bb2: {
- _2 = Div(const 1_i32, move _3); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
+ _2 = Div(const 1_i32, const 0_i32); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:14: 5:19
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:15
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-+ // ty::Const
-+ // + ty: i32
-+ // + val: Value(Scalar(0x00000000))
-+ // mir::Constant
-+ // + span: $DIR/bad_op_div_by_zero.rs:5:14: 5:19
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
StorageDead(_3); // scope 1 at $DIR/bad_op_div_by_zero.rs:5:18: 5:19
_0 = const (); // scope 0 at $DIR/bad_op_div_by_zero.rs:3:11: 6:2
// ty::Const
bb0: {
StorageLive(_1); // scope 0 at $DIR/bad_op_mod_by_zero.rs:4:9: 4:10
_1 = const 0_i32; // scope 0 at $DIR/bad_op_mod_by_zero.rs:4:13: 4:14
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/bad_op_mod_by_zero.rs:4:13: 4:14
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
StorageLive(_2); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:9: 5:11
StorageLive(_3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:18: 5:19
- _3 = _1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:18: 5:19
- _4 = Eq(_3, const 0_i32); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
-+ _3 = const 0_i32; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:18: 5:19
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
-- // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
-+ // + span: $DIR/bad_op_mod_by_zero.rs:5:18: 5:19
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
- assert(!move _4, "attempt to calculate the remainder of {} with a divisor of zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++ _3 = const 0_i32; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:18: 5:19
+ _4 = const true; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
- // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+ assert(!const true, "attempt to calculate the remainder of {} with a divisor of zero", const 1_i32) -> bb1; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:15
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
}
bb1: {
- _5 = Eq(_3, const -1_i32); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
-+ _5 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
- // ty::Const
-- // + ty: i32
-- // + val: Value(Scalar(0xffffffff))
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
-- // + literal: Const { ty: i32, val: Value(Scalar(0xffffffff)) }
- _6 = Eq(const 1_i32, const i32::MIN); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+ _6 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
- // ty::Const
-- // + ty: i32
-- // + val: Value(Scalar(0x00000001))
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
- // mir::Constant
-- // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:15
-- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-+ // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+ _7 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
- // ty::Const
-- // + ty: i32
-- // + val: Value(Scalar(0x80000000))
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
-- // + literal: Const { ty: i32, val: Value(Scalar(0x80000000)) }
- _7 = BitAnd(move _5, move _6); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
- assert(!move _7, "attempt to compute the remainder of `{} % {}` which would overflow", const 1_i32, _3) -> bb2; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++ _5 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++ _6 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
++ _7 = const false; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+ assert(!const false, "attempt to compute the remainder of `{} % {}` which would overflow", const 1_i32, const 0_i32) -> bb2; // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
- // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
-+ // mir::Constant
-+ // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+ // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:15
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-+ // ty::Const
-+ // + ty: i32
-+ // + val: Value(Scalar(0x00000000))
-+ // mir::Constant
-+ // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
}
bb2: {
- _2 = Rem(const 1_i32, move _3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
+ _2 = Rem(const 1_i32, const 0_i32); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:15
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
-+ // ty::Const
-+ // + ty: i32
-+ // + val: Value(Scalar(0x00000000))
-+ // mir::Constant
-+ // + span: $DIR/bad_op_mod_by_zero.rs:5:14: 5:19
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
StorageDead(_3); // scope 1 at $DIR/bad_op_mod_by_zero.rs:5:18: 5:19
_0 = const (); // scope 0 at $DIR/bad_op_mod_by_zero.rs:3:11: 6:2
// ty::Const
StorageLive(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:13: 7:15
StorageLive(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
_6 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000003)) }
_7 = Len((*_1)); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
- _8 = Lt(_6, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
- assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+ _8 = Lt(const 3_usize, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x00000003))
-+ // mir::Constant
-+ // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000003)) }
+ assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, const 3_usize) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x00000003))
-+ // mir::Constant
-+ // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000003)) }
}
bb1: {
StorageLive(_5); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:13: 7:15
StorageLive(_6); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
_6 = const 3_usize; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000003))
- // mir::Constant
- // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:7:23: 7:24
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000003)) }
_7 = Len((*_1)); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
- _8 = Lt(_6, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
- assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
+ _8 = Lt(const 3_usize, _7); // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x0000000000000003))
-+ // mir::Constant
-+ // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000003)) }
+ assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, const 3_usize) -> bb1; // scope 2 at $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x0000000000000003))
-+ // mir::Constant
-+ // + span: $DIR/bad_op_unsafe_oob_for_slices.rs:7:18: 7:25
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000003)) }
}
bb1: {
_4 = _2; // scope 0 at $DIR/boolean_identities.rs:5:6: 5:7
- _3 = BitOr(move _4, const true); // scope 0 at $DIR/boolean_identities.rs:5:5: 5:15
+ _3 = const true; // scope 0 at $DIR/boolean_identities.rs:5:5: 5:15
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
-- // + span: $DIR/boolean_identities.rs:5:10: 5:14
-+ // + span: $DIR/boolean_identities.rs:5:5: 5:15
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
StorageDead(_4); // scope 0 at $DIR/boolean_identities.rs:5:14: 5:15
StorageLive(_5); // scope 0 at $DIR/boolean_identities.rs:5:18: 5:29
StorageLive(_6); // scope 0 at $DIR/boolean_identities.rs:5:19: 5:20
_6 = _1; // scope 0 at $DIR/boolean_identities.rs:5:19: 5:20
- _5 = BitAnd(move _6, const false); // scope 0 at $DIR/boolean_identities.rs:5:18: 5:29
+ _5 = const false; // scope 0 at $DIR/boolean_identities.rs:5:18: 5:29
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
-- // + span: $DIR/boolean_identities.rs:5:23: 5:28
-+ // + span: $DIR/boolean_identities.rs:5:18: 5:29
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
StorageDead(_6); // scope 0 at $DIR/boolean_identities.rs:5:28: 5:29
- _0 = BitAnd(move _3, move _5); // scope 0 at $DIR/boolean_identities.rs:5:5: 5:29
+ _0 = const false; // scope 0 at $DIR/boolean_identities.rs:5:5: 5:29
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
-+ // mir::Constant
-+ // + span: $DIR/boolean_identities.rs:5:5: 5:29
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
StorageDead(_5); // scope 0 at $DIR/boolean_identities.rs:5:28: 5:29
StorageDead(_3); // scope 0 at $DIR/boolean_identities.rs:5:28: 5:29
return; // scope 0 at $DIR/boolean_identities.rs:6:2: 6:2
StorageLive(_4); // scope 0 at $DIR/boxes.rs:12:14: 12:22
_4 = Box(i32); // scope 0 at $DIR/boxes.rs:12:14: 12:22
(*_4) = const 42_i32; // scope 0 at $DIR/boxes.rs:12:19: 12:21
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/boxes.rs:12:19: 12:21
- // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
_3 = move _4; // scope 0 at $DIR/boxes.rs:12:14: 12:22
StorageDead(_4); // scope 0 at $DIR/boxes.rs:12:21: 12:22
_2 = (*_3); // scope 0 at $DIR/boxes.rs:12:13: 12:22
_1 = Add(move _2, const 0_i32); // scope 0 at $DIR/boxes.rs:12:13: 12:26
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/boxes.rs:12:25: 12:26
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
StorageDead(_2); // scope 0 at $DIR/boxes.rs:12:25: 12:26
drop(_3) -> [return: bb2, unwind: bb1]; // scope 0 at $DIR/boxes.rs:12:26: 12:27
}
StorageLive(_1); // scope 0 at $DIR/cast.rs:4:9: 4:10
- _1 = const 42_u8 as u32 (Misc); // scope 0 at $DIR/cast.rs:4:13: 4:24
+ _1 = const 42_u32; // scope 0 at $DIR/cast.rs:4:13: 4:24
- // ty::Const
-- // + ty: u8
-- // + val: Value(Scalar(0x2a))
-- // mir::Constant
-- // + span: $DIR/cast.rs:4:13: 4:17
-- // + literal: Const { ty: u8, val: Value(Scalar(0x2a)) }
-- StorageLive(_2); // scope 1 at $DIR/cast.rs:6:9: 6:10
+ StorageLive(_2); // scope 1 at $DIR/cast.rs:6:9: 6:10
- _2 = const 42_u32 as u8 (Misc); // scope 1 at $DIR/cast.rs:6:13: 6:24
-- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
-- // + span: $DIR/cast.rs:6:13: 6:18
-+ // + span: $DIR/cast.rs:4:13: 4:24
- // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
-+ StorageLive(_2); // scope 1 at $DIR/cast.rs:6:9: 6:10
+ _2 = const 42_u8; // scope 1 at $DIR/cast.rs:6:13: 6:24
-+ // ty::Const
-+ // + ty: u8
-+ // + val: Value(Scalar(0x2a))
-+ // mir::Constant
-+ // + span: $DIR/cast.rs:6:13: 6:24
-+ // + literal: Const { ty: u8, val: Value(Scalar(0x2a)) }
_0 = const (); // scope 0 at $DIR/cast.rs:3:11: 7:2
// ty::Const
// + ty: ()
bb0: {
StorageLive(_1); // scope 0 at $DIR/checked_add.rs:5:9: 5:10
- _2 = CheckedAdd(const 1_u32, const 1_u32); // scope 0 at $DIR/checked_add.rs:5:18: 5:23
-+ _2 = (const 2_u32, const false); // scope 0 at $DIR/checked_add.rs:5:18: 5:23
- // ty::Const
- // + ty: u32
-- // + val: Value(Scalar(0x00000001))
-+ // + val: Value(Scalar(0x00000002))
- // mir::Constant
-- // + span: $DIR/checked_add.rs:5:18: 5:19
-- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
-+ // + span: $DIR/checked_add.rs:5:18: 5:23
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- // ty::Const
-- // + ty: u32
-- // + val: Value(Scalar(0x00000001))
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
- // mir::Constant
-- // + span: $DIR/checked_add.rs:5:22: 5:23
-- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
- assert(!move (_2.1: bool), "attempt to compute `{} + {}` which would overflow", const 1_u32, const 1_u32) -> bb1; // scope 0 at $DIR/checked_add.rs:5:18: 5:23
-+ // + span: $DIR/checked_add.rs:5:18: 5:23
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++ _2 = (const 2_u32, const false); // scope 0 at $DIR/checked_add.rs:5:18: 5:23
+ assert(!const false, "attempt to compute `{} + {}` which would overflow", const 1_u32, const 1_u32) -> bb1; // scope 0 at $DIR/checked_add.rs:5:18: 5:23
- // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
-+ // mir::Constant
-+ // + span: $DIR/checked_add.rs:5:18: 5:23
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+ // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/checked_add.rs:5:18: 5:19
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/checked_add.rs:5:22: 5:23
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
}
bb1: {
- _1 = move (_2.0: u32); // scope 0 at $DIR/checked_add.rs:5:18: 5:23
+ _1 = const 2_u32; // scope 0 at $DIR/checked_add.rs:5:18: 5:23
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x00000002))
-+ // mir::Constant
-+ // + span: $DIR/checked_add.rs:5:18: 5:23
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
_0 = const (); // scope 0 at $DIR/checked_add.rs:4:11: 6:2
// ty::Const
// + ty: ()
bb0: {
StorageLive(_1); // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
- _1 = const <bool as NeedsDrop>::NEEDS; // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
-+ _1 = const false; // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
- // ty::Const
- // + ty: bool
-- // + val: Unevaluated(WithOptConstParam { did: DefId(0:4 ~ control_flow_simplification[317d]::NeedsDrop[0]::NEEDS[0]), const_param_did: None }, [bool], None)
-+ // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/control-flow-simplification.rs:12:8: 12:21
-- // + literal: Const { ty: bool, val: Unevaluated(WithOptConstParam { did: DefId(0:4 ~ control_flow_simplification[317d]::NeedsDrop[0]::NEEDS[0]), const_param_did: None }, [bool], None) }
- switchInt(_1) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++ _1 = const false; // scope 0 at $DIR/control-flow-simplification.rs:12:8: 12:21
+ switchInt(const false) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/control-flow-simplification.rs:12:5: 14:6
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
-+ // mir::Constant
-+ // + span: $DIR/control-flow-simplification.rs:12:5: 14:6
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
}
bb1: {
StorageLive(_2); // scope 0 at $DIR/discriminant.rs:11:13: 11:64
StorageLive(_3); // scope 0 at $DIR/discriminant.rs:11:34: 11:44
((_3 as Some).0: bool) = const true; // scope 0 at $DIR/discriminant.rs:11:34: 11:44
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/discriminant.rs:11:39: 11:43
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
discriminant(_3) = 1; // scope 0 at $DIR/discriminant.rs:11:34: 11:44
- _4 = discriminant(_3); // scope 0 at $DIR/discriminant.rs:11:21: 11:31
- switchInt(move _4) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:11:21: 11:31
+ _4 = const 1_isize; // scope 0 at $DIR/discriminant.rs:11:21: 11:31
-+ // ty::Const
-+ // + ty: isize
-+ // + val: Value(Scalar(0x00000001))
-+ // mir::Constant
-+ // + span: $DIR/discriminant.rs:11:21: 11:31
-+ // + literal: Const { ty: isize, val: Value(Scalar(0x00000001)) }
+ switchInt(const 1_isize) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:11:21: 11:31
-+ // ty::Const
-+ // + ty: isize
-+ // + val: Value(Scalar(0x00000001))
-+ // mir::Constant
-+ // + span: $DIR/discriminant.rs:11:21: 11:31
-+ // + literal: Const { ty: isize, val: Value(Scalar(0x00000001)) }
}
bb1: {
_2 = const 10_i32; // scope 0 at $DIR/discriminant.rs:11:59: 11:61
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x0000000a))
- // mir::Constant
- // + span: $DIR/discriminant.rs:11:59: 11:61
- // + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
goto -> bb4; // scope 0 at $DIR/discriminant.rs:11:13: 11:64
}
bb3: {
_2 = const 42_i32; // scope 0 at $DIR/discriminant.rs:11:47: 11:49
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/discriminant.rs:11:47: 11:49
- // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
goto -> bb4; // scope 0 at $DIR/discriminant.rs:11:13: 11:64
}
bb4: {
_1 = Add(move _2, const 0_i32); // scope 0 at $DIR/discriminant.rs:11:13: 11:68
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/discriminant.rs:11:67: 11:68
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
StorageDead(_2); // scope 0 at $DIR/discriminant.rs:11:67: 11:68
StorageDead(_3); // scope 0 at $DIR/discriminant.rs:11:68: 11:69
_0 = const (); // scope 0 at $DIR/discriminant.rs:10:11: 12:2
StorageLive(_2); // scope 0 at $DIR/discriminant.rs:11:13: 11:64
StorageLive(_3); // scope 0 at $DIR/discriminant.rs:11:34: 11:44
((_3 as Some).0: bool) = const true; // scope 0 at $DIR/discriminant.rs:11:34: 11:44
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/discriminant.rs:11:39: 11:43
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
discriminant(_3) = 1; // scope 0 at $DIR/discriminant.rs:11:34: 11:44
- _4 = discriminant(_3); // scope 0 at $DIR/discriminant.rs:11:21: 11:31
- switchInt(move _4) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:11:21: 11:31
+ _4 = const 1_isize; // scope 0 at $DIR/discriminant.rs:11:21: 11:31
-+ // ty::Const
-+ // + ty: isize
-+ // + val: Value(Scalar(0x0000000000000001))
-+ // mir::Constant
-+ // + span: $DIR/discriminant.rs:11:21: 11:31
-+ // + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000001)) }
+ switchInt(const 1_isize) -> [1_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/discriminant.rs:11:21: 11:31
-+ // ty::Const
-+ // + ty: isize
-+ // + val: Value(Scalar(0x0000000000000001))
-+ // mir::Constant
-+ // + span: $DIR/discriminant.rs:11:21: 11:31
-+ // + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000001)) }
}
bb1: {
_2 = const 10_i32; // scope 0 at $DIR/discriminant.rs:11:59: 11:61
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x0000000a))
- // mir::Constant
- // + span: $DIR/discriminant.rs:11:59: 11:61
- // + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
goto -> bb4; // scope 0 at $DIR/discriminant.rs:11:13: 11:64
}
bb3: {
_2 = const 42_i32; // scope 0 at $DIR/discriminant.rs:11:47: 11:49
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/discriminant.rs:11:47: 11:49
- // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
goto -> bb4; // scope 0 at $DIR/discriminant.rs:11:13: 11:64
}
bb4: {
_1 = Add(move _2, const 0_i32); // scope 0 at $DIR/discriminant.rs:11:13: 11:68
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/discriminant.rs:11:67: 11:68
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
StorageDead(_2); // scope 0 at $DIR/discriminant.rs:11:67: 11:68
StorageDead(_3); // scope 0 at $DIR/discriminant.rs:11:68: 11:69
_0 = const (); // scope 0 at $DIR/discriminant.rs:10:11: 12:2
StorageLive(_1); // scope 0 at $DIR/indirect.rs:5:9: 5:10
StorageLive(_2); // scope 0 at $DIR/indirect.rs:5:13: 5:25
- _2 = const 2_u32 as u8 (Misc); // scope 0 at $DIR/indirect.rs:5:13: 5:25
-+ _2 = const 2_u8; // scope 0 at $DIR/indirect.rs:5:13: 5:25
- // ty::Const
-- // + ty: u32
-- // + val: Value(Scalar(0x00000002))
-+ // + ty: u8
-+ // + val: Value(Scalar(0x02))
- // mir::Constant
-- // + span: $DIR/indirect.rs:5:14: 5:18
-- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- _3 = CheckedAdd(_2, const 1_u8); // scope 0 at $DIR/indirect.rs:5:13: 5:29
-+ // + span: $DIR/indirect.rs:5:13: 5:25
-+ // + literal: Const { ty: u8, val: Value(Scalar(0x02)) }
-+ _3 = (const 3_u8, const false); // scope 0 at $DIR/indirect.rs:5:13: 5:29
- // ty::Const
- // + ty: u8
-- // + val: Value(Scalar(0x01))
-+ // + val: Value(Scalar(0x03))
- // mir::Constant
-- // + span: $DIR/indirect.rs:5:28: 5:29
-- // + literal: Const { ty: u8, val: Value(Scalar(0x01)) }
- assert(!move (_3.1: bool), "attempt to compute `{} + {}` which would overflow", move _2, const 1_u8) -> bb1; // scope 0 at $DIR/indirect.rs:5:13: 5:29
-+ // + span: $DIR/indirect.rs:5:13: 5:29
-+ // + literal: Const { ty: u8, val: Value(Scalar(0x03)) }
- // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
-+ // mir::Constant
-+ // + span: $DIR/indirect.rs:5:13: 5:29
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++ _2 = const 2_u8; // scope 0 at $DIR/indirect.rs:5:13: 5:25
++ _3 = (const 3_u8, const false); // scope 0 at $DIR/indirect.rs:5:13: 5:29
+ assert(!const false, "attempt to compute `{} + {}` which would overflow", const 2_u8, const 1_u8) -> bb1; // scope 0 at $DIR/indirect.rs:5:13: 5:29
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
-+ // mir::Constant
-+ // + span: $DIR/indirect.rs:5:13: 5:29
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+ // ty::Const
- // + ty: u8
-+ // + val: Value(Scalar(0x02))
-+ // mir::Constant
-+ // + span: $DIR/indirect.rs:5:13: 5:29
-+ // + literal: Const { ty: u8, val: Value(Scalar(0x02)) }
-+ // ty::Const
-+ // + ty: u8
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/indirect.rs:5:28: 5:29
- // + literal: Const { ty: u8, val: Value(Scalar(0x01)) }
}
bb1: {
- _1 = move (_3.0: u8); // scope 0 at $DIR/indirect.rs:5:13: 5:29
+ _1 = const 3_u8; // scope 0 at $DIR/indirect.rs:5:13: 5:29
-+ // ty::Const
-+ // + ty: u8
-+ // + val: Value(Scalar(0x03))
-+ // mir::Constant
-+ // + span: $DIR/indirect.rs:5:13: 5:29
-+ // + literal: Const { ty: u8, val: Value(Scalar(0x03)) }
StorageDead(_2); // scope 0 at $DIR/indirect.rs:5:28: 5:29
_0 = const (); // scope 0 at $DIR/indirect.rs:4:11: 6:2
// ty::Const
+ // + span: $DIR/issue-66971.rs:16:12: 16:22
+ // + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
(_2.1: u8) = const 0_u8; // scope 0 at $DIR/issue-66971.rs:16:12: 16:22
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-66971.rs:16:17: 16:18
- // + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
(_2.2: u8) = const 0_u8; // scope 0 at $DIR/issue-66971.rs:16:12: 16:22
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-66971.rs:16:20: 16:21
- // + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
StorageDead(_3); // scope 0 at $DIR/issue-66971.rs:16:21: 16:22
_1 = const encode(move _2) -> bb1; // scope 0 at $DIR/issue-66971.rs:16:5: 16:23
// ty::Const
StorageLive(_2); // scope 0 at $DIR/issue-67019.rs:11:10: 11:19
StorageLive(_3); // scope 0 at $DIR/issue-67019.rs:11:11: 11:17
(_3.0: u8) = const 1_u8; // scope 0 at $DIR/issue-67019.rs:11:11: 11:17
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/issue-67019.rs:11:12: 11:13
- // + literal: Const { ty: u8, val: Value(Scalar(0x01)) }
(_3.1: u8) = const 2_u8; // scope 0 at $DIR/issue-67019.rs:11:11: 11:17
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x02))
- // mir::Constant
- // + span: $DIR/issue-67019.rs:11:15: 11:16
- // + literal: Const { ty: u8, val: Value(Scalar(0x02)) }
- (_2.0: (u8, u8)) = move _3; // scope 0 at $DIR/issue-67019.rs:11:10: 11:19
+ (_2.0: (u8, u8)) = (const 1_u8, const 2_u8); // scope 0 at $DIR/issue-67019.rs:11:10: 11:19
-+ // ty::Const
-+ // + ty: u8
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/issue-67019.rs:11:10: 11:19
-+ // + literal: Const { ty: u8, val: Value(Scalar(0x01)) }
-+ // ty::Const
-+ // + ty: u8
-+ // + val: Value(Scalar(0x02))
-+ // mir::Constant
-+ // + span: $DIR/issue-67019.rs:11:10: 11:19
-+ // + literal: Const { ty: u8, val: Value(Scalar(0x02)) }
StorageDead(_3); // scope 0 at $DIR/issue-67019.rs:11:18: 11:19
_1 = const test(move _2) -> bb1; // scope 0 at $DIR/issue-67019.rs:11:5: 11:20
// ty::Const
StorageLive(_1); // scope 0 at $DIR/large_array_index.rs:6:9: 6:10
StorageLive(_2); // scope 0 at $DIR/large_array_index.rs:6:17: 6:29
_2 = [const 0_u8; 5000]; // scope 0 at $DIR/large_array_index.rs:6:17: 6:29
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/large_array_index.rs:6:18: 6:22
- // + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
StorageLive(_3); // scope 0 at $DIR/large_array_index.rs:6:30: 6:31
_3 = const 2_usize; // scope 0 at $DIR/large_array_index.rs:6:30: 6:31
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/large_array_index.rs:6:30: 6:31
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
_4 = const 5000_usize; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00001388))
- // mir::Constant
- // + span: $DIR/large_array_index.rs:6:17: 6:32
- // + literal: Const { ty: usize, val: Value(Scalar(0x00001388)) }
- _5 = Lt(_3, _4); // scope 0 at $DIR/large_array_index.rs:6:17: 6:32
- assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32
+ _5 = const true; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/large_array_index.rs:6:17: 6:32
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 5000_usize, const 2_usize) -> bb1; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/large_array_index.rs:6:17: 6:32
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x00001388))
-+ // mir::Constant
-+ // + span: $DIR/large_array_index.rs:6:17: 6:32
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x00001388)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x00000002))
-+ // mir::Constant
-+ // + span: $DIR/large_array_index.rs:6:17: 6:32
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
}
bb1: {
StorageLive(_1); // scope 0 at $DIR/large_array_index.rs:6:9: 6:10
StorageLive(_2); // scope 0 at $DIR/large_array_index.rs:6:17: 6:29
_2 = [const 0_u8; 5000]; // scope 0 at $DIR/large_array_index.rs:6:17: 6:29
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/large_array_index.rs:6:18: 6:22
- // + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
StorageLive(_3); // scope 0 at $DIR/large_array_index.rs:6:30: 6:31
_3 = const 2_usize; // scope 0 at $DIR/large_array_index.rs:6:30: 6:31
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000002))
- // mir::Constant
- // + span: $DIR/large_array_index.rs:6:30: 6:31
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000002)) }
_4 = const 5000_usize; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000001388))
- // mir::Constant
- // + span: $DIR/large_array_index.rs:6:17: 6:32
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000001388)) }
- _5 = Lt(_3, _4); // scope 0 at $DIR/large_array_index.rs:6:17: 6:32
- assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> bb1; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32
+ _5 = const true; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/large_array_index.rs:6:17: 6:32
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 5000_usize, const 2_usize) -> bb1; // scope 0 at $DIR/large_array_index.rs:6:17: 6:32
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/large_array_index.rs:6:17: 6:32
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x0000000000001388))
-+ // mir::Constant
-+ // + span: $DIR/large_array_index.rs:6:17: 6:32
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000001388)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x0000000000000002))
-+ // mir::Constant
-+ // + span: $DIR/large_array_index.rs:6:17: 6:32
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000002)) }
}
bb1: {
_2 = _1; // scope 0 at $DIR/mult_by_zero.rs:5:3: 5:4
- _0 = Mul(move _2, const 0_i32); // scope 0 at $DIR/mult_by_zero.rs:5:3: 5:8
+ _0 = const 0_i32; // scope 0 at $DIR/mult_by_zero.rs:5:3: 5:8
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
-- // + span: $DIR/mult_by_zero.rs:5:7: 5:8
-+ // + span: $DIR/mult_by_zero.rs:5:3: 5:8
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
StorageDead(_2); // scope 0 at $DIR/mult_by_zero.rs:5:7: 5:8
return; // scope 0 at $DIR/mult_by_zero.rs:6:2: 6:2
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/mutable_variable.rs:5:9: 5:14
_1 = const 42_i32; // scope 0 at $DIR/mutable_variable.rs:5:17: 5:19
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/mutable_variable.rs:5:17: 5:19
- // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
_1 = const 99_i32; // scope 1 at $DIR/mutable_variable.rs:6:5: 6:11
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000063))
- // mir::Constant
- // + span: $DIR/mutable_variable.rs:6:9: 6:11
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000063)) }
StorageLive(_2); // scope 1 at $DIR/mutable_variable.rs:7:9: 7:10
- _2 = _1; // scope 1 at $DIR/mutable_variable.rs:7:13: 7:14
+ _2 = const 99_i32; // scope 1 at $DIR/mutable_variable.rs:7:13: 7:14
-+ // ty::Const
-+ // + ty: i32
-+ // + val: Value(Scalar(0x00000063))
-+ // mir::Constant
-+ // + span: $DIR/mutable_variable.rs:7:13: 7:14
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000063)) }
_0 = const (); // scope 0 at $DIR/mutable_variable.rs:4:11: 8:2
// ty::Const
// + ty: ()
bb0: {
StorageLive(_1); // scope 0 at $DIR/mutable_variable_aggregate.rs:5:9: 5:14
(_1.0: i32) = const 42_i32; // scope 0 at $DIR/mutable_variable_aggregate.rs:5:17: 5:25
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/mutable_variable_aggregate.rs:5:18: 5:20
- // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
(_1.1: i32) = const 43_i32; // scope 0 at $DIR/mutable_variable_aggregate.rs:5:17: 5:25
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x0000002b))
- // mir::Constant
- // + span: $DIR/mutable_variable_aggregate.rs:5:22: 5:24
- // + literal: Const { ty: i32, val: Value(Scalar(0x0000002b)) }
(_1.1: i32) = const 99_i32; // scope 1 at $DIR/mutable_variable_aggregate.rs:6:5: 6:13
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000063))
- // mir::Constant
- // + span: $DIR/mutable_variable_aggregate.rs:6:11: 6:13
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000063)) }
StorageLive(_2); // scope 1 at $DIR/mutable_variable_aggregate.rs:7:9: 7:10
- _2 = _1; // scope 1 at $DIR/mutable_variable_aggregate.rs:7:13: 7:14
+ _2 = (const 42_i32, const 99_i32); // scope 1 at $DIR/mutable_variable_aggregate.rs:7:13: 7:14
-+ // ty::Const
-+ // + ty: i32
-+ // + val: Value(Scalar(0x0000002a))
-+ // mir::Constant
-+ // + span: $DIR/mutable_variable_aggregate.rs:7:13: 7:14
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
-+ // ty::Const
-+ // + ty: i32
-+ // + val: Value(Scalar(0x00000063))
-+ // mir::Constant
-+ // + span: $DIR/mutable_variable_aggregate.rs:7:13: 7:14
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000063)) }
_0 = const (); // scope 0 at $DIR/mutable_variable_aggregate.rs:4:11: 8:2
// ty::Const
// + ty: ()
bb0: {
StorageLive(_1); // scope 0 at $DIR/mutable_variable_aggregate_mut_ref.rs:5:9: 5:14
(_1.0: i32) = const 42_i32; // scope 0 at $DIR/mutable_variable_aggregate_mut_ref.rs:5:17: 5:25
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/mutable_variable_aggregate_mut_ref.rs:5:18: 5:20
- // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
(_1.1: i32) = const 43_i32; // scope 0 at $DIR/mutable_variable_aggregate_mut_ref.rs:5:17: 5:25
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x0000002b))
- // mir::Constant
- // + span: $DIR/mutable_variable_aggregate_mut_ref.rs:5:22: 5:24
- // + literal: Const { ty: i32, val: Value(Scalar(0x0000002b)) }
StorageLive(_2); // scope 1 at $DIR/mutable_variable_aggregate_mut_ref.rs:6:9: 6:10
_2 = &mut _1; // scope 1 at $DIR/mutable_variable_aggregate_mut_ref.rs:6:13: 6:19
((*_2).1: i32) = const 99_i32; // scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:7:5: 7:13
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000063))
- // mir::Constant
- // + span: $DIR/mutable_variable_aggregate_mut_ref.rs:7:11: 7:13
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000063)) }
StorageLive(_3); // scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:8:9: 8:10
_3 = _1; // scope 2 at $DIR/mutable_variable_aggregate_mut_ref.rs:8:13: 8:14
_0 = const (); // scope 0 at $DIR/mutable_variable_aggregate_mut_ref.rs:4:11: 9:2
bb1: {
(_1.1: i32) = const 99_i32; // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:6:5: 6:13
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000063))
- // mir::Constant
- // + span: $DIR/mutable_variable_aggregate_partial_read.rs:6:11: 6:13
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000063)) }
(_1.0: i32) = const 42_i32; // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:7:5: 7:13
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/mutable_variable_aggregate_partial_read.rs:7:11: 7:13
- // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
StorageLive(_2); // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:8:9: 8:10
- _2 = (_1.1: i32); // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:8:13: 8:16
+ _2 = const 99_i32; // scope 1 at $DIR/mutable_variable_aggregate_partial_read.rs:8:13: 8:16
-+ // ty::Const
-+ // + ty: i32
-+ // + val: Value(Scalar(0x00000063))
-+ // mir::Constant
-+ // + span: $DIR/mutable_variable_aggregate_partial_read.rs:8:13: 8:16
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000063)) }
_0 = const (); // scope 0 at $DIR/mutable_variable_aggregate_partial_read.rs:4:11: 9:2
// ty::Const
// + ty: ()
bb0: {
StorageLive(_1); // scope 0 at $DIR/mutable_variable_no_prop.rs:7:9: 7:14
_1 = const 42_u32; // scope 0 at $DIR/mutable_variable_no_prop.rs:7:17: 7:19
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/mutable_variable_no_prop.rs:7:17: 7:19
- // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
StorageLive(_2); // scope 1 at $DIR/mutable_variable_no_prop.rs:8:5: 10:6
StorageLive(_3); // scope 2 at $DIR/mutable_variable_no_prop.rs:9:13: 9:19
StorageLive(_4); // scope 2 at $DIR/mutable_variable_no_prop.rs:9:13: 9:19
bb1: {
StorageLive(_2); // scope 1 at $DIR/mutable_variable_unprop_assign.rs:6:9: 6:14
(_2.0: i32) = const 1_i32; // scope 1 at $DIR/mutable_variable_unprop_assign.rs:6:29: 6:35
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/mutable_variable_unprop_assign.rs:6:30: 6:31
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
(_2.1: i32) = const 2_i32; // scope 1 at $DIR/mutable_variable_unprop_assign.rs:6:29: 6:35
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/mutable_variable_unprop_assign.rs:6:33: 6:34
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
StorageLive(_3); // scope 2 at $DIR/mutable_variable_unprop_assign.rs:7:11: 7:12
_3 = _1; // scope 2 at $DIR/mutable_variable_unprop_assign.rs:7:11: 7:12
(_2.1: i32) = move _3; // scope 2 at $DIR/mutable_variable_unprop_assign.rs:7:5: 7:12
bb0: {
StorageLive(_1); // scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
- _2 = CheckedAdd(const 2_i32, const 2_i32); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
-+ _2 = (const 4_i32, const false); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
- // ty::Const
- // + ty: i32
-- // + val: Value(Scalar(0x00000002))
-+ // + val: Value(Scalar(0x00000004))
- // mir::Constant
-- // + span: $DIR/optimizes_into_variable.rs:12:13: 12:14
-- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
-+ // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
- // ty::Const
-- // + ty: i32
-- // + val: Value(Scalar(0x00000002))
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
- // mir::Constant
-- // + span: $DIR/optimizes_into_variable.rs:12:17: 12:18
-- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
- assert(!move (_2.1: bool), "attempt to compute `{} + {}` which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
-+ // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++ _2 = (const 4_i32, const false); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+ assert(!const false, "attempt to compute `{} + {}` which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
- // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
-+ // mir::Constant
-+ // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+ // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:12:13: 12:14
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:12:17: 12:18
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
}
bb1: {
- _1 = move (_2.0: i32); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+ _1 = const 4_i32; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
-+ // ty::Const
-+ // + ty: i32
-+ // + val: Value(Scalar(0x00000004))
-+ // mir::Constant
-+ // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
StorageLive(_3); // scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
StorageLive(_4); // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
_4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32]; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:13:14: 13:15
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:13:17: 13:18
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:13:20: 13:21
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:13:23: 13:24
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000004))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:13:26: 13:27
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000005))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:13:29: 13:30
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000005)) }
StorageLive(_5); // scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
_5 = const 3_usize; // scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:13:32: 13:33
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000003)) }
_6 = const 6_usize; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000006))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000006)) }
- _7 = Lt(_5, _6); // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
- assert(move _7, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+ _7 = const true; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 6_usize, const 3_usize) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x00000006))
-+ // mir::Constant
-+ // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000006)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x00000003))
-+ // mir::Constant
-+ // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000003)) }
}
bb2: {
- _3 = _4[_5]; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+ _3 = const 3_i32; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ // ty::Const
-+ // + ty: i32
-+ // + val: Value(Scalar(0x00000003))
-+ // mir::Constant
-+ // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
StorageDead(_5); // scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
StorageDead(_4); // scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
StorageLive(_8); // scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
StorageLive(_9); // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
(_9.0: u32) = const 12_u32; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x0000000c))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:14:25: 14:27
- // + literal: Const { ty: u32, val: Value(Scalar(0x0000000c)) }
(_9.1: u32) = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:14:32: 14:34
- // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
- _8 = (_9.1: u32); // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
+ _8 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x0000002a))
-+ // mir::Constant
-+ // + span: $DIR/optimizes_into_variable.rs:14:13: 14:38
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
StorageDead(_9); // scope 2 at $DIR/optimizes_into_variable.rs:14:38: 14:39
_0 = const (); // scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
// ty::Const
bb0: {
StorageLive(_1); // scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
- _2 = CheckedAdd(const 2_i32, const 2_i32); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
-+ _2 = (const 4_i32, const false); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
- // ty::Const
- // + ty: i32
-- // + val: Value(Scalar(0x00000002))
-+ // + val: Value(Scalar(0x00000004))
- // mir::Constant
-- // + span: $DIR/optimizes_into_variable.rs:12:13: 12:14
-- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
-+ // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
- // ty::Const
-- // + ty: i32
-- // + val: Value(Scalar(0x00000002))
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
- // mir::Constant
-- // + span: $DIR/optimizes_into_variable.rs:12:17: 12:18
-- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
- assert(!move (_2.1: bool), "attempt to compute `{} + {}` which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
-+ // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++ _2 = (const 4_i32, const false); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+ assert(!const false, "attempt to compute `{} + {}` which would overflow", const 2_i32, const 2_i32) -> bb1; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
- // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
-+ // mir::Constant
-+ // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+ // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:12:13: 12:14
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:12:17: 12:18
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
}
bb1: {
- _1 = move (_2.0: i32); // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
+ _1 = const 4_i32; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
-+ // ty::Const
-+ // + ty: i32
-+ // + val: Value(Scalar(0x00000004))
-+ // mir::Constant
-+ // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
StorageLive(_3); // scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
StorageLive(_4); // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
_4 = [const 0_i32, const 1_i32, const 2_i32, const 3_i32, const 4_i32, const 5_i32]; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:31
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:13:14: 13:15
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:13:17: 13:18
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:13:20: 13:21
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:13:23: 13:24
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000004))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:13:26: 13:27
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000005))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:13:29: 13:30
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000005)) }
StorageLive(_5); // scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
_5 = const 3_usize; // scope 1 at $DIR/optimizes_into_variable.rs:13:32: 13:33
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000003))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:13:32: 13:33
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000003)) }
_6 = const 6_usize; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000006))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000006)) }
- _7 = Lt(_5, _6); // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
- assert(move _7, "index out of bounds: the len is {} but the index is {}", move _6, _5) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+ _7 = const true; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 6_usize, const 3_usize) -> bb2; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x0000000000000006))
-+ // mir::Constant
-+ // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000006)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x0000000000000003))
-+ // mir::Constant
-+ // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000003)) }
}
bb2: {
- _3 = _4[_5]; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
+ _3 = const 3_i32; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ // ty::Const
-+ // + ty: i32
-+ // + val: Value(Scalar(0x00000003))
-+ // mir::Constant
-+ // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
StorageDead(_5); // scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
StorageDead(_4); // scope 1 at $DIR/optimizes_into_variable.rs:13:34: 13:35
StorageLive(_8); // scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
StorageLive(_9); // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
(_9.0: u32) = const 12_u32; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x0000000c))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:14:25: 14:27
- // + literal: Const { ty: u32, val: Value(Scalar(0x0000000c)) }
(_9.1: u32) = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:36
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:14:32: 14:34
- // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
- _8 = (_9.1: u32); // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
+ _8 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x0000002a))
-+ // mir::Constant
-+ // + span: $DIR/optimizes_into_variable.rs:14:13: 14:38
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
StorageDead(_9); // scope 2 at $DIR/optimizes_into_variable.rs:14:38: 14:39
_0 = const (); // scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
// ty::Const
bb0: {
StorageLive(_1); // scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
_1 = const 4_i32; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000004))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
StorageLive(_2); // scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
_2 = const 3_i32; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
StorageLive(_3); // scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
_3 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:14:13: 14:38
- // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
_0 = const (); // scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
// ty::Const
// + ty: ()
bb0: {
StorageLive(_1); // scope 0 at $DIR/optimizes_into_variable.rs:12:9: 12:10
_1 = const 4_i32; // scope 0 at $DIR/optimizes_into_variable.rs:12:13: 12:18
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000004))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:12:13: 12:18
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
StorageLive(_2); // scope 1 at $DIR/optimizes_into_variable.rs:13:9: 13:10
_2 = const 3_i32; // scope 1 at $DIR/optimizes_into_variable.rs:13:13: 13:34
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:13:13: 13:34
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
StorageLive(_3); // scope 2 at $DIR/optimizes_into_variable.rs:14:9: 14:10
_3 = const 42_u32; // scope 2 at $DIR/optimizes_into_variable.rs:14:13: 14:38
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/optimizes_into_variable.rs:14:13: 14:38
- // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
_0 = const (); // scope 0 at $DIR/optimizes_into_variable.rs:11:11: 15:2
// ty::Const
// + ty: ()
// + literal: Const { ty: &u8, val: Value(Scalar(alloc0)) }
- _2 = (*_3); // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
+ _2 = const 2_u8; // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:16
-+ // ty::Const
-+ // + ty: u8
-+ // + val: Value(Scalar(0x02))
-+ // mir::Constant
-+ // + span: $DIR/read_immutable_static.rs:7:13: 7:16
-+ // + literal: Const { ty: u8, val: Value(Scalar(0x02)) }
StorageLive(_4); // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
StorageLive(_5); // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
_5 = const {alloc0: &u8}; // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
- _4 = (*_5); // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
- _1 = Add(move _2, move _4); // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:22
+ _4 = const 2_u8; // scope 0 at $DIR/read_immutable_static.rs:7:19: 7:22
-+ // ty::Const
-+ // + ty: u8
-+ // + val: Value(Scalar(0x02))
-+ // mir::Constant
-+ // + span: $DIR/read_immutable_static.rs:7:19: 7:22
-+ // + literal: Const { ty: u8, val: Value(Scalar(0x02)) }
+ _1 = const 4_u8; // scope 0 at $DIR/read_immutable_static.rs:7:13: 7:22
-+ // ty::Const
-+ // + ty: u8
-+ // + val: Value(Scalar(0x04))
-+ // mir::Constant
-+ // + span: $DIR/read_immutable_static.rs:7:13: 7:22
-+ // + literal: Const { ty: u8, val: Value(Scalar(0x04)) }
StorageDead(_4); // scope 0 at $DIR/read_immutable_static.rs:7:21: 7:22
StorageDead(_2); // scope 0 at $DIR/read_immutable_static.rs:7:21: 7:22
StorageDead(_5); // scope 0 at $DIR/read_immutable_static.rs:7:22: 7:23
_2 = _4; // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
- _1 = (*_2); // scope 0 at $DIR/ref_deref.rs:5:5: 5:10
+ _1 = const 4_i32; // scope 0 at $DIR/ref_deref.rs:5:5: 5:10
-+ // ty::Const
-+ // + ty: i32
-+ // + val: Value(Scalar(0x00000004))
-+ // mir::Constant
-+ // + span: $DIR/ref_deref.rs:5:5: 5:10
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
StorageDead(_2); // scope 0 at $DIR/ref_deref.rs:5:10: 5:11
StorageDead(_1); // scope 0 at $DIR/ref_deref.rs:5:10: 5:11
_0 = const (); // scope 0 at $DIR/ref_deref.rs:4:11: 6:2
StorageLive(_2); // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
- StorageLive(_3); // scope 0 at $DIR/ref_deref.rs:5:8: 5:9
- _3 = const 4_i32; // scope 0 at $DIR/ref_deref.rs:5:8: 5:9
+- _2 = &_3; // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
+ _4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
- // ty::Const
-- // + ty: i32
-- // + val: Value(Scalar(0x00000004))
++ // ty::Const
+ // + ty: &i32
+ // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref[317d]::main[0]), const_param_did: None }, [], Some(promoted[0]))
- // mir::Constant
-- // + span: $DIR/ref_deref.rs:5:8: 5:9
-- // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
-- _2 = &_3; // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
++ // mir::Constant
+ // + span: $DIR/ref_deref.rs:5:6: 5:10
+ // + literal: Const { ty: &i32, val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) }
+ _2 = &(*_4); // scope 0 at $DIR/ref_deref.rs:5:6: 5:10
StorageLive(_2); // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
- StorageLive(_3); // scope 0 at $DIR/ref_deref_project.rs:5:8: 5:14
- _3 = (const 4_i32, const 5_i32); // scope 0 at $DIR/ref_deref_project.rs:5:8: 5:14
+- _2 = &(_3.1: i32); // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
+ _4 = const main::promoted[0]; // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
- // ty::Const
-- // + ty: i32
-- // + val: Value(Scalar(0x00000004))
++ // ty::Const
+ // + ty: &(i32, i32)
+ // + val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref_project[317d]::main[0]), const_param_did: None }, [], Some(promoted[0]))
- // mir::Constant
-- // + span: $DIR/ref_deref_project.rs:5:9: 5:10
-- // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
-- // ty::Const
-- // + ty: i32
-- // + val: Value(Scalar(0x00000005))
-- // mir::Constant
-- // + span: $DIR/ref_deref_project.rs:5:12: 5:13
-- // + literal: Const { ty: i32, val: Value(Scalar(0x00000005)) }
-- _2 = &(_3.1: i32); // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
++ // mir::Constant
+ // + span: $DIR/ref_deref_project.rs:5:6: 5:17
+ // + literal: Const { ty: &(i32, i32), val: Unevaluated(WithOptConstParam { did: DefId(0:3 ~ ref_deref_project[317d]::main[0]), const_param_did: None }, [], Some(promoted[0])) }
+ _2 = &((*_4).1: i32); // scope 0 at $DIR/ref_deref_project.rs:5:6: 5:17
StorageLive(_2); // scope 0 at $DIR/repeat.rs:6:18: 6:28
StorageLive(_3); // scope 0 at $DIR/repeat.rs:6:18: 6:25
_3 = [const 42_u32; 8]; // scope 0 at $DIR/repeat.rs:6:18: 6:25
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/repeat.rs:6:19: 6:21
- // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
StorageLive(_4); // scope 0 at $DIR/repeat.rs:6:26: 6:27
_4 = const 2_usize; // scope 0 at $DIR/repeat.rs:6:26: 6:27
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/repeat.rs:6:26: 6:27
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
_5 = const 8_usize; // scope 0 at $DIR/repeat.rs:6:18: 6:28
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000008))
- // mir::Constant
- // + span: $DIR/repeat.rs:6:18: 6:28
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000008)) }
- _6 = Lt(_4, _5); // scope 0 at $DIR/repeat.rs:6:18: 6:28
- assert(move _6, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28
+ _6 = const true; // scope 0 at $DIR/repeat.rs:6:18: 6:28
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/repeat.rs:6:18: 6:28
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 8_usize, const 2_usize) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/repeat.rs:6:18: 6:28
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x00000008))
-+ // mir::Constant
-+ // + span: $DIR/repeat.rs:6:18: 6:28
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000008)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x00000002))
-+ // mir::Constant
-+ // + span: $DIR/repeat.rs:6:18: 6:28
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
}
bb1: {
- _2 = _3[_4]; // scope 0 at $DIR/repeat.rs:6:18: 6:28
- _1 = Add(move _2, const 0_u32); // scope 0 at $DIR/repeat.rs:6:18: 6:32
+ _2 = const 42_u32; // scope 0 at $DIR/repeat.rs:6:18: 6:28
- // ty::Const
- // + ty: u32
-- // + val: Value(Scalar(0x00000000))
-+ // + val: Value(Scalar(0x0000002a))
- // mir::Constant
-- // + span: $DIR/repeat.rs:6:31: 6:32
-- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
-+ // + span: $DIR/repeat.rs:6:18: 6:28
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
+ _1 = const 42_u32; // scope 0 at $DIR/repeat.rs:6:18: 6:32
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x0000002a))
-+ // mir::Constant
-+ // + span: $DIR/repeat.rs:6:18: 6:32
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
StorageDead(_2); // scope 0 at $DIR/repeat.rs:6:31: 6:32
StorageDead(_4); // scope 0 at $DIR/repeat.rs:6:32: 6:33
StorageDead(_3); // scope 0 at $DIR/repeat.rs:6:32: 6:33
StorageLive(_2); // scope 0 at $DIR/repeat.rs:6:18: 6:28
StorageLive(_3); // scope 0 at $DIR/repeat.rs:6:18: 6:25
_3 = [const 42_u32; 8]; // scope 0 at $DIR/repeat.rs:6:18: 6:25
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/repeat.rs:6:19: 6:21
- // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
StorageLive(_4); // scope 0 at $DIR/repeat.rs:6:26: 6:27
_4 = const 2_usize; // scope 0 at $DIR/repeat.rs:6:26: 6:27
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000002))
- // mir::Constant
- // + span: $DIR/repeat.rs:6:26: 6:27
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000002)) }
_5 = const 8_usize; // scope 0 at $DIR/repeat.rs:6:18: 6:28
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000008))
- // mir::Constant
- // + span: $DIR/repeat.rs:6:18: 6:28
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000008)) }
- _6 = Lt(_4, _5); // scope 0 at $DIR/repeat.rs:6:18: 6:28
- assert(move _6, "index out of bounds: the len is {} but the index is {}", move _5, _4) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28
+ _6 = const true; // scope 0 at $DIR/repeat.rs:6:18: 6:28
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/repeat.rs:6:18: 6:28
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 8_usize, const 2_usize) -> bb1; // scope 0 at $DIR/repeat.rs:6:18: 6:28
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/repeat.rs:6:18: 6:28
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x0000000000000008))
-+ // mir::Constant
-+ // + span: $DIR/repeat.rs:6:18: 6:28
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000008)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x0000000000000002))
-+ // mir::Constant
-+ // + span: $DIR/repeat.rs:6:18: 6:28
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000002)) }
}
bb1: {
- _2 = _3[_4]; // scope 0 at $DIR/repeat.rs:6:18: 6:28
- _1 = Add(move _2, const 0_u32); // scope 0 at $DIR/repeat.rs:6:18: 6:32
+ _2 = const 42_u32; // scope 0 at $DIR/repeat.rs:6:18: 6:28
- // ty::Const
- // + ty: u32
-- // + val: Value(Scalar(0x00000000))
-+ // + val: Value(Scalar(0x0000002a))
- // mir::Constant
-- // + span: $DIR/repeat.rs:6:31: 6:32
-- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
-+ // + span: $DIR/repeat.rs:6:18: 6:28
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
+ _1 = const 42_u32; // scope 0 at $DIR/repeat.rs:6:18: 6:32
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x0000002a))
-+ // mir::Constant
-+ // + span: $DIR/repeat.rs:6:18: 6:32
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x0000002a)) }
StorageDead(_2); // scope 0 at $DIR/repeat.rs:6:31: 6:32
StorageDead(_4); // scope 0 at $DIR/repeat.rs:6:32: 6:33
StorageDead(_3); // scope 0 at $DIR/repeat.rs:6:32: 6:33
bb0: {
- _1 = CheckedAdd(const 2_u32, const 2_u32); // scope 0 at $DIR/return_place.rs:6:5: 6:10
-+ _1 = (const 4_u32, const false); // scope 0 at $DIR/return_place.rs:6:5: 6:10
- // ty::Const
- // + ty: u32
-- // + val: Value(Scalar(0x00000002))
-+ // + val: Value(Scalar(0x00000004))
- // mir::Constant
-- // + span: $DIR/return_place.rs:6:5: 6:6
-- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
-+ // + span: $DIR/return_place.rs:6:5: 6:10
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000004)) }
- // ty::Const
-- // + ty: u32
-- // + val: Value(Scalar(0x00000002))
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
- // mir::Constant
-- // + span: $DIR/return_place.rs:6:9: 6:10
-- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- assert(!move (_1.1: bool), "attempt to compute `{} + {}` which would overflow", const 2_u32, const 2_u32) -> bb1; // scope 0 at $DIR/return_place.rs:6:5: 6:10
-+ // + span: $DIR/return_place.rs:6:5: 6:10
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
++ _1 = (const 4_u32, const false); // scope 0 at $DIR/return_place.rs:6:5: 6:10
+ assert(!const false, "attempt to compute `{} + {}` which would overflow", const 2_u32, const 2_u32) -> bb1; // scope 0 at $DIR/return_place.rs:6:5: 6:10
- // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
-+ // mir::Constant
-+ // + span: $DIR/return_place.rs:6:5: 6:10
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
-+ // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/return_place.rs:6:5: 6:6
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/return_place.rs:6:9: 6:10
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
}
bb1: {
- _0 = move (_1.0: u32); // scope 0 at $DIR/return_place.rs:6:5: 6:10
+ _0 = const 4_u32; // scope 0 at $DIR/return_place.rs:6:5: 6:10
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x00000004))
-+ // mir::Constant
-+ // + span: $DIR/return_place.rs:6:5: 6:10
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000004)) }
return; // scope 0 at $DIR/return_place.rs:7:2: 7:2
}
}
bb0: {
_0 = const 4_u32; // scope 0 at $DIR/return_place.rs:6:5: 6:10
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000004))
- // mir::Constant
- // + span: $DIR/return_place.rs:6:5: 6:10
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000004)) }
return; // scope 0 at $DIR/return_place.rs:7:2: 7:2
}
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/scalar_literal_propagation.rs:3:9: 3:10
_1 = const 1_u32; // scope 0 at $DIR/scalar_literal_propagation.rs:3:13: 3:14
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/scalar_literal_propagation.rs:3:13: 3:14
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
StorageLive(_2); // scope 1 at $DIR/scalar_literal_propagation.rs:4:5: 4:15
StorageLive(_3); // scope 1 at $DIR/scalar_literal_propagation.rs:4:13: 4:14
- _3 = _1; // scope 1 at $DIR/scalar_literal_propagation.rs:4:13: 4:14
- _2 = const consume(move _3) -> bb1; // scope 1 at $DIR/scalar_literal_propagation.rs:4:5: 4:15
+ _3 = const 1_u32; // scope 1 at $DIR/scalar_literal_propagation.rs:4:13: 4:14
- // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x00000001))
-+ // mir::Constant
-+ // + span: $DIR/scalar_literal_propagation.rs:4:13: 4:14
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
+ _2 = const consume(const 1_u32) -> bb1; // scope 1 at $DIR/scalar_literal_propagation.rs:4:5: 4:15
-+ // ty::Const
+ // ty::Const
// + ty: fn(u32) {consume}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/scalar_literal_propagation.rs:4:5: 4:12
// + literal: Const { ty: fn(u32) {consume}, val: Value(Scalar(<ZST>)) }
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x00000001))
-+ // mir::Constant
-+ // + span: $DIR/scalar_literal_propagation.rs:4:5: 4:15
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
}
bb1: {
StorageDead(_3); // scope 0 at $DIR/slice_len.rs:5:18: 5:19
StorageLive(_6); // scope 0 at $DIR/slice_len.rs:5:31: 5:32
_6 = const 1_usize; // scope 0 at $DIR/slice_len.rs:5:31: 5:32
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/slice_len.rs:5:31: 5:32
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
- _7 = Len((*_2)); // scope 0 at $DIR/slice_len.rs:5:5: 5:33
- _8 = Lt(_6, _7); // scope 0 at $DIR/slice_len.rs:5:5: 5:33
- assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+ _7 = const 3_usize; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x00000003))
-+ // mir::Constant
-+ // + span: $DIR/slice_len.rs:5:5: 5:33
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000003)) }
+ _8 = const true; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/slice_len.rs:5:5: 5:33
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 3_usize, const 1_usize) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/slice_len.rs:5:5: 5:33
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x00000003))
-+ // mir::Constant
-+ // + span: $DIR/slice_len.rs:5:5: 5:33
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000003)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x00000001))
-+ // mir::Constant
-+ // + span: $DIR/slice_len.rs:5:5: 5:33
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
}
bb1: {
- _1 = (*_2)[_6]; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+ _1 = const 2_u32; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x00000002))
-+ // mir::Constant
-+ // + span: $DIR/slice_len.rs:5:5: 5:33
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageDead(_6); // scope 0 at $DIR/slice_len.rs:5:33: 5:34
StorageDead(_4); // scope 0 at $DIR/slice_len.rs:5:33: 5:34
StorageDead(_2); // scope 0 at $DIR/slice_len.rs:5:33: 5:34
StorageDead(_3); // scope 0 at $DIR/slice_len.rs:5:18: 5:19
StorageLive(_6); // scope 0 at $DIR/slice_len.rs:5:31: 5:32
_6 = const 1_usize; // scope 0 at $DIR/slice_len.rs:5:31: 5:32
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000001))
- // mir::Constant
- // + span: $DIR/slice_len.rs:5:31: 5:32
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
- _7 = Len((*_2)); // scope 0 at $DIR/slice_len.rs:5:5: 5:33
- _8 = Lt(_6, _7); // scope 0 at $DIR/slice_len.rs:5:5: 5:33
- assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+ _7 = const 3_usize; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x0000000000000003))
-+ // mir::Constant
-+ // + span: $DIR/slice_len.rs:5:5: 5:33
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000003)) }
+ _8 = const true; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/slice_len.rs:5:5: 5:33
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+ assert(const true, "index out of bounds: the len is {} but the index is {}", const 3_usize, const 1_usize) -> bb1; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/slice_len.rs:5:5: 5:33
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x0000000000000003))
-+ // mir::Constant
-+ // + span: $DIR/slice_len.rs:5:5: 5:33
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000003)) }
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x0000000000000001))
-+ // mir::Constant
-+ // + span: $DIR/slice_len.rs:5:5: 5:33
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
}
bb1: {
- _1 = (*_2)[_6]; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
+ _1 = const 2_u32; // scope 0 at $DIR/slice_len.rs:5:5: 5:33
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x00000002))
-+ // mir::Constant
-+ // + span: $DIR/slice_len.rs:5:5: 5:33
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageDead(_6); // scope 0 at $DIR/slice_len.rs:5:33: 5:34
StorageDead(_4); // scope 0 at $DIR/slice_len.rs:5:33: 5:34
StorageDead(_2); // scope 0 at $DIR/slice_len.rs:5:33: 5:34
bb0: {
StorageLive(_1); // scope 0 at $DIR/switch_int.rs:7:11: 7:12
_1 = const 1_i32; // scope 0 at $DIR/switch_int.rs:7:11: 7:12
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/switch_int.rs:7:11: 7:12
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
- switchInt(_1) -> [1_i32: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:8:9: 8:10
+ switchInt(const 1_i32) -> [1_i32: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:8:9: 8:10
-+ // ty::Const
-+ // + ty: i32
-+ // + val: Value(Scalar(0x00000001))
-+ // mir::Constant
-+ // + span: $DIR/switch_int.rs:8:9: 8:10
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
}
bb1: {
// mir::Constant
// + span: $DIR/switch_int.rs:9:14: 9:17
// + literal: Const { ty: fn(i32) {foo}, val: Value(Scalar(<ZST>)) }
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0xffffffff))
- // mir::Constant
- // + span: $DIR/switch_int.rs:9:18: 9:20
- // + literal: Const { ty: i32, val: Value(Scalar(0xffffffff)) }
}
bb2: {
// mir::Constant
// + span: $DIR/switch_int.rs:8:14: 8:17
// + literal: Const { ty: fn(i32) {foo}, val: Value(Scalar(<ZST>)) }
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/switch_int.rs:8:18: 8:19
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
}
bb3: {
bb0: {
StorageLive(_1); // scope 0 at $DIR/switch_int.rs:7:11: 7:12
_1 = const 1_i32; // scope 0 at $DIR/switch_int.rs:7:11: 7:12
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/switch_int.rs:7:11: 7:12
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
- switchInt(const 1_i32) -> [1_i32: bb2, otherwise: bb1]; // scope 0 at $DIR/switch_int.rs:8:9: 8:10
-- // ty::Const
-- // + ty: i32
-- // + val: Value(Scalar(0x00000001))
-- // mir::Constant
-- // + span: $DIR/switch_int.rs:8:9: 8:10
-- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
+ goto -> bb2; // scope 0 at $DIR/switch_int.rs:8:9: 8:10
}
// mir::Constant
// + span: $DIR/switch_int.rs:9:14: 9:17
// + literal: Const { ty: fn(i32) {foo}, val: Value(Scalar(<ZST>)) }
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0xffffffff))
- // mir::Constant
- // + span: $DIR/switch_int.rs:9:18: 9:20
- // + literal: Const { ty: i32, val: Value(Scalar(0xffffffff)) }
}
bb2: {
// mir::Constant
// + span: $DIR/switch_int.rs:8:14: 8:17
// + literal: Const { ty: fn(i32) {foo}, val: Value(Scalar(<ZST>)) }
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/switch_int.rs:8:18: 8:19
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
}
bb3: {
bb0: {
StorageLive(_1); // scope 0 at $DIR/tuple_literal_propagation.rs:3:9: 3:10
(_1.0: u32) = const 1_u32; // scope 0 at $DIR/tuple_literal_propagation.rs:3:13: 3:19
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/tuple_literal_propagation.rs:3:14: 3:15
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
(_1.1: u32) = const 2_u32; // scope 0 at $DIR/tuple_literal_propagation.rs:3:13: 3:19
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/tuple_literal_propagation.rs:3:17: 3:18
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageLive(_2); // scope 1 at $DIR/tuple_literal_propagation.rs:5:5: 5:15
StorageLive(_3); // scope 1 at $DIR/tuple_literal_propagation.rs:5:13: 5:14
- _3 = _1; // scope 1 at $DIR/tuple_literal_propagation.rs:5:13: 5:14
+ _3 = (const 1_u32, const 2_u32); // scope 1 at $DIR/tuple_literal_propagation.rs:5:13: 5:14
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x00000001))
-+ // mir::Constant
-+ // + span: $DIR/tuple_literal_propagation.rs:5:13: 5:14
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x00000002))
-+ // mir::Constant
-+ // + span: $DIR/tuple_literal_propagation.rs:5:13: 5:14
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
_2 = const consume(move _3) -> bb1; // scope 1 at $DIR/tuple_literal_propagation.rs:5:5: 5:15
// ty::Const
// + ty: fn((u32, u32)) {consume}
bb0: {
StorageLive(_1); // scope 0 at $DIR/const_prop_miscompile.rs:12:9: 12:14
(_1.0: i32) = const 1_i32; // scope 0 at $DIR/const_prop_miscompile.rs:12:17: 12:21
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/const_prop_miscompile.rs:12:18: 12:19
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
StorageLive(_2); // scope 1 at $DIR/const_prop_miscompile.rs:13:5: 15:6
StorageLive(_3); // scope 2 at $DIR/const_prop_miscompile.rs:14:10: 14:22
_3 = &raw mut (_1.0: i32); // scope 2 at $DIR/const_prop_miscompile.rs:14:10: 14:22
(*_3) = const 5_i32; // scope 2 at $DIR/const_prop_miscompile.rs:14:9: 14:26
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000005))
- // mir::Constant
- // + span: $DIR/const_prop_miscompile.rs:14:25: 14:26
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000005)) }
StorageDead(_3); // scope 2 at $DIR/const_prop_miscompile.rs:14:26: 14:27
_2 = const (); // scope 2 at $DIR/const_prop_miscompile.rs:13:5: 15:6
// ty::Const
StorageLive(_5); // scope 1 at $DIR/const_prop_miscompile.rs:16:13: 16:20
_5 = (_1.0: i32); // scope 1 at $DIR/const_prop_miscompile.rs:16:15: 16:18
_4 = Eq(move _5, const 5_i32); // scope 1 at $DIR/const_prop_miscompile.rs:16:13: 16:25
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000005))
- // mir::Constant
- // + span: $DIR/const_prop_miscompile.rs:16:24: 16:25
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000005)) }
StorageDead(_5); // scope 1 at $DIR/const_prop_miscompile.rs:16:24: 16:25
_0 = const (); // scope 0 at $DIR/const_prop_miscompile.rs:11:10: 17:2
// ty::Const
bb0: {
StorageLive(_1); // scope 0 at $DIR/const_prop_miscompile.rs:5:9: 5:14
(_1.0: i32) = const 1_i32; // scope 0 at $DIR/const_prop_miscompile.rs:5:17: 5:21
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/const_prop_miscompile.rs:5:18: 5:19
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
StorageLive(_2); // scope 1 at $DIR/const_prop_miscompile.rs:6:6: 6:14
_2 = &mut (_1.0: i32); // scope 1 at $DIR/const_prop_miscompile.rs:6:6: 6:14
(*_2) = const 5_i32; // scope 1 at $DIR/const_prop_miscompile.rs:6:5: 6:18
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000005))
- // mir::Constant
- // + span: $DIR/const_prop_miscompile.rs:6:17: 6:18
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000005)) }
StorageDead(_2); // scope 1 at $DIR/const_prop_miscompile.rs:6:18: 6:19
StorageLive(_3); // scope 1 at $DIR/const_prop_miscompile.rs:7:9: 7:10
StorageLive(_4); // scope 1 at $DIR/const_prop_miscompile.rs:7:13: 7:20
_4 = (_1.0: i32); // scope 1 at $DIR/const_prop_miscompile.rs:7:15: 7:18
_3 = Eq(move _4, const 5_i32); // scope 1 at $DIR/const_prop_miscompile.rs:7:13: 7:25
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000005))
- // mir::Constant
- // + span: $DIR/const_prop_miscompile.rs:7:24: 7:25
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000005)) }
StorageDead(_4); // scope 1 at $DIR/const_prop_miscompile.rs:7:24: 7:25
_0 = const (); // scope 0 at $DIR/const_prop_miscompile.rs:4:10: 8:2
// ty::Const
StorageLive(_2); // scope 0 at $DIR/copy_propagation_arg.rs:28:9: 28:10
_2 = _1; // scope 0 at $DIR/copy_propagation_arg.rs:28:13: 28:14
_1 = const 123_i32; // scope 1 at $DIR/copy_propagation_arg.rs:29:5: 29:12
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x0000007b))
- // mir::Constant
- // + span: $DIR/copy_propagation_arg.rs:29:9: 29:12
- // + literal: Const { ty: i32, val: Value(Scalar(0x0000007b)) }
_0 = _2; // scope 1 at $DIR/copy_propagation_arg.rs:30:5: 30:6
StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:31:1: 31:2
return; // scope 0 at $DIR/copy_propagation_arg.rs:31:2: 31:2
StorageDead(_3); // scope 0 at $DIR/copy_propagation_arg.rs:16:12: 16:13
StorageDead(_2); // scope 0 at $DIR/copy_propagation_arg.rs:16:13: 16:14
_1 = const 5_u8; // scope 0 at $DIR/copy_propagation_arg.rs:17:5: 17:10
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x05))
- // mir::Constant
- // + span: $DIR/copy_propagation_arg.rs:17:9: 17:10
- // + literal: Const { ty: u8, val: Value(Scalar(0x05)) }
_0 = const (); // scope 0 at $DIR/copy_propagation_arg.rs:15:19: 18:2
// ty::Const
// + ty: ()
// + span: $DIR/deaggregator_test.rs:9:20: 9:23
// + literal: Const { ty: f32, val: Value(Scalar(0x00000000)) }
+ (_0.2: bool) = const false; // scope 0 at $DIR/deaggregator_test.rs:9:5: 9:35
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/deaggregator_test.rs:9:28: 9:33
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
StorageDead(_2); // scope 0 at $DIR/deaggregator_test.rs:9:34: 9:35
return; // scope 0 at $DIR/deaggregator_test.rs:10:2: 10:2
}
bb1: {
_0 = const 0_u32; // scope 0 at $DIR/exponential-or.rs:9:14: 9:15
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/exponential-or.rs:9:14: 9:15
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
goto -> bb10; // scope 0 at $DIR/exponential-or.rs:7:5: 10:6
}
bb4: {
_5 = Le(const 6_u32, (_1.3: u32)); // scope 0 at $DIR/exponential-or.rs:8:62: 8:67
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000006))
- // mir::Constant
- // + span: $DIR/exponential-or.rs:8:62: 8:67
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000006)) }
switchInt(move _5) -> [false: bb6, otherwise: bb5]; // scope 0 at $DIR/exponential-or.rs:8:62: 8:67
}
bb5: {
_6 = Le((_1.3: u32), const 9_u32); // scope 0 at $DIR/exponential-or.rs:8:62: 8:67
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000009))
- // mir::Constant
- // + span: $DIR/exponential-or.rs:8:62: 8:67
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000009)) }
switchInt(move _6) -> [false: bb6, otherwise: bb8]; // scope 0 at $DIR/exponential-or.rs:8:62: 8:67
}
bb6: {
_3 = Le(const 13_u32, (_1.3: u32)); // scope 0 at $DIR/exponential-or.rs:8:70: 8:77
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x0000000d))
- // mir::Constant
- // + span: $DIR/exponential-or.rs:8:70: 8:77
- // + literal: Const { ty: u32, val: Value(Scalar(0x0000000d)) }
switchInt(move _3) -> [false: bb1, otherwise: bb7]; // scope 0 at $DIR/exponential-or.rs:8:70: 8:77
}
bb7: {
_4 = Le((_1.3: u32), const 16_u32); // scope 0 at $DIR/exponential-or.rs:8:70: 8:77
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000010))
- // mir::Constant
- // + span: $DIR/exponential-or.rs:8:70: 8:77
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000010)) }
switchInt(move _4) -> [false: bb1, otherwise: bb8]; // scope 0 at $DIR/exponential-or.rs:8:70: 8:77
}
_15 = move _16 as u32 (Misc); // scope 3 at $DIR/funky_arms.rs:26:59: 26:75
StorageDead(_16); // scope 3 at $DIR/funky_arms.rs:26:74: 26:75
_14 = Add(move _15, const 1_u32); // scope 3 at $DIR/funky_arms.rs:26:59: 26:79
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/funky_arms.rs:26:78: 26:79
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
StorageDead(_15); // scope 3 at $DIR/funky_arms.rs:26:78: 26:79
StorageLive(_17); // scope 3 at $DIR/funky_arms.rs:26:81: 26:86
_17 = _3; // scope 3 at $DIR/funky_arms.rs:26:81: 26:86
bb0: {
StorageLive(_3); // scope 0 at $DIR/generator-storage-dead-unwind.rs:23:13: 23:14
(_3.0: i32) = const 5_i32; // scope 0 at $DIR/generator-storage-dead-unwind.rs:23:17: 23:23
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000005))
- // mir::Constant
- // + span: $DIR/generator-storage-dead-unwind.rs:23:21: 23:22
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000005)) }
StorageLive(_4); // scope 1 at $DIR/generator-storage-dead-unwind.rs:24:13: 24:14
(_4.0: i32) = const 6_i32; // scope 1 at $DIR/generator-storage-dead-unwind.rs:24:17: 24:23
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000006))
- // mir::Constant
- // + span: $DIR/generator-storage-dead-unwind.rs:24:21: 24:22
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000006)) }
StorageLive(_5); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
StorageLive(_6); // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
_5 = yield(move _6) -> [resume: bb2, drop: bb4]; // scope 2 at $DIR/generator-storage-dead-unwind.rs:25:9: 25:14
StorageLive(_2); // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:6
_2 = _1; // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:6
_3 = const 1_i32; // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/inline-any-operand.rs:12:7: 12:8
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
_4 = const -1_i32; // scope 1 at $DIR/inline-any-operand.rs:12:5: 12:13
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0xffffffff))
- // mir::Constant
- // + span: $DIR/inline-any-operand.rs:12:10: 12:12
- // + literal: Const { ty: i32, val: Value(Scalar(0xffffffff)) }
_0 = Eq(move _3, move _4); // scope 2 at $DIR/inline-any-operand.rs:17:5: 17:11
StorageDead(_2); // scope 1 at $DIR/inline-any-operand.rs:12:12: 12:13
StorageDead(_1); // scope 0 at $DIR/inline-any-operand.rs:13:1: 13:2
+ // + user_ty: UserType(0)
+ // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [255], len: Size { raw: 8 } }, size: Size { raw: 8 }, align: Align { pow2: 2 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) }
+ ((*_4).1: usize) = const 0_usize; // scope 2 at $SRC_DIR/alloc/src/vec.rs:LL:COL
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x00000000))
-+ // mir::Constant
-+ // + span: $SRC_DIR/alloc/src/vec.rs:LL:COL
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
_1 = move _2; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
StorageDead(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
_0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2
+ // + user_ty: UserType(0)
+ // + literal: Const { ty: alloc::raw_vec::RawVec<u32>, val: Value(ByRef { alloc: Allocation { bytes: [4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [65535], len: Size { raw: 16 } }, size: Size { raw: 16 }, align: Align { pow2: 3 }, mutability: Not, extra: () }, offset: Size { raw: 0 } }) }
+ ((*_4).1: usize) = const 0_usize; // scope 2 at $SRC_DIR/alloc/src/vec.rs:LL:COL
-+ // ty::Const
-+ // + ty: usize
-+ // + val: Value(Scalar(0x0000000000000000))
-+ // mir::Constant
-+ // + span: $SRC_DIR/alloc/src/vec.rs:LL:COL
-+ // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
_1 = move _2; // scope 0 at $DIR/inline-into-box-place.rs:8:29: 8:43
StorageDead(_2); // scope 0 at $DIR/inline-into-box-place.rs:8:42: 8:43
_0 = const (); // scope 0 at $DIR/inline-into-box-place.rs:7:11: 9:2
bb0: {
StorageLive(_1); // scope 0 at $DIR/inline-specialization.rs:5:9: 5:10
- _1 = const <std::vec::Vec<()> as Foo>::bar() -> bb1; // scope 0 at $DIR/inline-specialization.rs:5:13: 5:38
-+ _1 = const 123_u32; // scope 2 at $DIR/inline-specialization.rs:14:31: 14:34
- // ty::Const
+- // ty::Const
- // + ty: fn() -> u32 {<std::vec::Vec<()> as Foo>::bar}
- // + val: Value(Scalar(<ZST>))
-+ // + ty: u32
-+ // + val: Value(Scalar(0x0000007b))
- // mir::Constant
+- // mir::Constant
- // + span: $DIR/inline-specialization.rs:5:13: 5:36
- // + literal: Const { ty: fn() -> u32 {<std::vec::Vec<()> as Foo>::bar}, val: Value(Scalar(<ZST>)) }
- }
-
- bb1: {
-+ // + span: $DIR/inline-specialization.rs:14:31: 14:34
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x0000007b)) }
++ _1 = const 123_u32; // scope 2 at $DIR/inline-specialization.rs:14:31: 14:34
_0 = const (); // scope 0 at $DIR/inline-specialization.rs:4:11: 6:2
// ty::Const
// + ty: ()
+ // + span: /the/src/instrument_coverage.rs:19:18: 19:18
+ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u64, u32, &'static str, u32, u32, u32, u32) {std::intrinsics::count_code_region}, val: Value(Scalar(<ZST>)) }
+ // ty::Const
-+ // + ty: u64
-+ // + val: Value(Scalar(0x8dabe565aaa2aefd))
-+ // mir::Constant
-+ // + span: /the/src/instrument_coverage.rs:19:18: 19:18
-+ // + literal: Const { ty: u64, val: Value(Scalar(0x8dabe565aaa2aefd)) }
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x00000000))
-+ // mir::Constant
-+ // + span: /the/src/instrument_coverage.rs:19:18: 19:18
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
-+ // ty::Const
+ // + ty: &str
+ // + val: Value(Slice { data: Allocation { bytes: [47, 116, 104, 101, 47, 115, 114, 99, 47, 105, 110, 115, 116, 114, 117, 109, 101, 110, 116, 95, 99, 111, 118, 101, 114, 97, 103, 101, 46, 114, 115], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [2147483647], len: Size { raw: 31 } }, size: Size { raw: 31 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 31 })
+ // mir::Constant
+ // + span: /the/src/instrument_coverage.rs:19:18: 19:18
+ // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [47, 116, 104, 101, 47, 115, 114, 99, 47, 105, 110, 115, 116, 114, 117, 109, 101, 110, 116, 95, 99, 111, 118, 101, 114, 97, 103, 101, 46, 114, 115], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [2147483647], len: Size { raw: 31 } }, size: Size { raw: 31 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 31 }) }
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x00000013))
-+ // mir::Constant
-+ // + span: /the/src/instrument_coverage.rs:19:18: 19:18
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000013)) }
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x00000012))
-+ // mir::Constant
-+ // + span: /the/src/instrument_coverage.rs:19:18: 19:18
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000012)) }
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x00000015))
-+ // mir::Constant
-+ // + span: /the/src/instrument_coverage.rs:19:18: 19:18
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000015)) }
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x00000002))
-+ // mir::Constant
-+ // + span: /the/src/instrument_coverage.rs:19:18: 19:18
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
+ }
+
+ bb1 (cleanup): {
+ bb2: {
+ StorageDead(_1); // scope 0 at /the/src/instrument_coverage.rs:20:5: 20:9
_0 = const true; // scope 0 at /the/src/instrument_coverage.rs:20:5: 20:9
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: /the/src/instrument_coverage.rs:20:5: 20:9
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
return; // scope 0 at /the/src/instrument_coverage.rs:21:2: 21:2
}
}
+ // + span: /the/src/instrument_coverage.rs:10:11: 10:11
+ // + literal: Const { ty: unsafe extern "rust-intrinsic" fn(u64, u32, &'static str, u32, u32, u32, u32) {std::intrinsics::count_code_region}, val: Value(Scalar(<ZST>)) }
+ // ty::Const
-+ // + ty: u64
-+ // + val: Value(Scalar(0xde1b3f75a72fc7f7))
-+ // mir::Constant
-+ // + span: /the/src/instrument_coverage.rs:10:11: 10:11
-+ // + literal: Const { ty: u64, val: Value(Scalar(0xde1b3f75a72fc7f7)) }
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x00000000))
-+ // mir::Constant
-+ // + span: /the/src/instrument_coverage.rs:10:11: 10:11
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
-+ // ty::Const
+ // + ty: &str
+ // + val: Value(Slice { data: Allocation { bytes: [47, 116, 104, 101, 47, 115, 114, 99, 47, 105, 110, 115, 116, 114, 117, 109, 101, 110, 116, 95, 99, 111, 118, 101, 114, 97, 103, 101, 46, 114, 115], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [2147483647], len: Size { raw: 31 } }, size: Size { raw: 31 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 31 })
+ // mir::Constant
+ // + span: /the/src/instrument_coverage.rs:10:11: 10:11
+ // + literal: Const { ty: &str, val: Value(Slice { data: Allocation { bytes: [47, 116, 104, 101, 47, 115, 114, 99, 47, 105, 110, 115, 116, 114, 117, 109, 101, 110, 116, 95, 99, 111, 118, 101, 114, 97, 103, 101, 46, 114, 115], relocations: Relocations(SortedMap { data: [] }), init_mask: InitMask { blocks: [2147483647], len: Size { raw: 31 } }, size: Size { raw: 31 }, align: Align { pow2: 0 }, mutability: Not, extra: () }, start: 0, end: 31 }) }
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x0000000a))
-+ // mir::Constant
-+ // + span: /the/src/instrument_coverage.rs:10:11: 10:11
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x0000000a)) }
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x0000000b))
-+ // mir::Constant
-+ // + span: /the/src/instrument_coverage.rs:10:11: 10:11
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x0000000b)) }
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x00000010))
-+ // mir::Constant
-+ // + span: /the/src/instrument_coverage.rs:10:11: 10:11
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000010)) }
-+ // ty::Const
-+ // + ty: u32
-+ // + val: Value(Scalar(0x00000002))
-+ // mir::Constant
-+ // + span: /the/src/instrument_coverage.rs:10:11: 10:11
-+ // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
}
bb1: {
bb0: {
StorageLive(_1); // scope 0 at $DIR/issue-38669.rs:5:9: 5:25
_1 = const false; // scope 0 at $DIR/issue-38669.rs:5:28: 5:33
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-38669.rs:5:28: 5:33
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
FakeRead(ForLet, _1); // scope 0 at $DIR/issue-38669.rs:5:9: 5:25
goto -> bb2; // scope 1 at $DIR/issue-38669.rs:6:5: 11:6
}
StorageDead(_4); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10
StorageDead(_3); // scope 1 at $DIR/issue-38669.rs:9:9: 9:10
_1 = const true; // scope 1 at $DIR/issue-38669.rs:10:9: 10:28
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/issue-38669.rs:10:24: 10:28
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
_2 = const (); // scope 1 at $DIR/issue-38669.rs:6:10: 11:6
// ty::Const
// + ty: ()
bb0: {
_5 = const false; // scope 0 at $DIR/issue-41110.rs:8:9: 8:10
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-41110.rs:8:9: 8:10
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
StorageLive(_1); // scope 0 at $DIR/issue-41110.rs:8:9: 8:10
StorageLive(_2); // scope 0 at $DIR/issue-41110.rs:8:13: 8:14
_5 = const true; // scope 0 at $DIR/issue-41110.rs:8:13: 8:14
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/issue-41110.rs:8:13: 8:14
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
_2 = S; // scope 0 at $DIR/issue-41110.rs:8:13: 8:14
StorageLive(_3); // scope 0 at $DIR/issue-41110.rs:8:21: 8:27
StorageLive(_4); // scope 0 at $DIR/issue-41110.rs:8:21: 8:22
bb2: {
StorageDead(_4); // scope 0 at $DIR/issue-41110.rs:8:26: 8:27
_5 = const false; // scope 0 at $DIR/issue-41110.rs:8:13: 8:28
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-41110.rs:8:13: 8:28
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
_1 = const S::other(move _2, move _3) -> [return: bb6, unwind: bb5]; // scope 0 at $DIR/issue-41110.rs:8:13: 8:28
// ty::Const
// + ty: fn(S, S) {S::other}
bb6: {
StorageDead(_3); // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
_5 = const false; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-41110.rs:8:27: 8:28
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
StorageDead(_2); // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
_0 = const (); // scope 0 at $DIR/issue-41110.rs:7:11: 9:2
// ty::Const
bb8 (cleanup): {
_5 = const false; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-41110.rs:8:27: 8:28
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
goto -> bb7; // scope 0 at $DIR/issue-41110.rs:8:27: 8:28
}
bb0: {
_6 = const false; // scope 0 at $DIR/issue-41110.rs:15:9: 15:10
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-41110.rs:15:9: 15:10
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
StorageLive(_1); // scope 0 at $DIR/issue-41110.rs:15:9: 15:10
_6 = const true; // scope 0 at $DIR/issue-41110.rs:15:13: 15:14
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/issue-41110.rs:15:13: 15:14
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
_1 = S; // scope 0 at $DIR/issue-41110.rs:15:13: 15:14
StorageLive(_2); // scope 1 at $DIR/issue-41110.rs:16:9: 16:14
_2 = S; // scope 1 at $DIR/issue-41110.rs:16:17: 16:18
StorageDead(_3); // scope 2 at $DIR/issue-41110.rs:17:12: 17:13
StorageLive(_5); // scope 2 at $DIR/issue-41110.rs:18:9: 18:10
_6 = const false; // scope 2 at $DIR/issue-41110.rs:18:9: 18:10
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-41110.rs:18:9: 18:10
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
_5 = move _1; // scope 2 at $DIR/issue-41110.rs:18:9: 18:10
goto -> bb12; // scope 2 at $DIR/issue-41110.rs:18:5: 18:6
}
bb10: {
_6 = const false; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-41110.rs:19:1: 19:2
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
StorageDead(_1); // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
return; // scope 0 at $DIR/issue-41110.rs:19:2: 19:2
}
bb14 (cleanup): {
_6 = const false; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-41110.rs:19:1: 19:2
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
goto -> bb13; // scope 0 at $DIR/issue-41110.rs:19:1: 19:2
}
bb0: {
_1 = CheckedAdd(const 1_usize, const 1_usize); // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/issue-41697.rs:18:19: 18:20
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/issue-41697.rs:18:21: 18:22
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
assert(!move (_1.1: bool), "attempt to compute `{} + {}` which would overflow", const 1_usize, const 1_usize) -> [success: bb2, unwind: bb1]; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/issue-41697.rs:18:19: 18:20
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/issue-41697.rs:18:21: 18:22
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
}
bb1 (cleanup): {
bb0: {
_1 = CheckedAdd(const 1_usize, const 1_usize); // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000001))
- // mir::Constant
- // + span: $DIR/issue-41697.rs:18:19: 18:20
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000001))
- // mir::Constant
- // + span: $DIR/issue-41697.rs:18:21: 18:22
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
assert(!move (_1.1: bool), "attempt to compute `{} + {}` which would overflow", const 1_usize, const 1_usize) -> [success: bb2, unwind: bb1]; // scope 0 at $DIR/issue-41697.rs:18:19: 18:22
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000001))
- // mir::Constant
- // + span: $DIR/issue-41697.rs:18:19: 18:20
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000001))
- // mir::Constant
- // + span: $DIR/issue-41697.rs:18:21: 18:22
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
}
bb1 (cleanup): {
bb0: {
_9 = const false; // scope 0 at $DIR/issue-41888.rs:7:9: 7:10
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-41888.rs:7:9: 7:10
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
_7 = const false; // scope 0 at $DIR/issue-41888.rs:7:9: 7:10
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-41888.rs:7:9: 7:10
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
_8 = const false; // scope 0 at $DIR/issue-41888.rs:7:9: 7:10
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-41888.rs:7:9: 7:10
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
StorageLive(_1); // scope 0 at $DIR/issue-41888.rs:7:9: 7:10
StorageLive(_2); // scope 1 at $DIR/issue-41888.rs:8:8: 8:14
_2 = const cond() -> [return: bb2, unwind: bb3]; // scope 1 at $DIR/issue-41888.rs:8:8: 8:14
bb10: {
StorageLive(_6); // scope 1 at $DIR/issue-41888.rs:10:21: 10:23
_9 = const false; // scope 1 at $DIR/issue-41888.rs:10:21: 10:23
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-41888.rs:10:21: 10:23
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
_6 = move ((_1 as F).0: K); // scope 1 at $DIR/issue-41888.rs:10:21: 10:23
_0 = const (); // scope 2 at $DIR/issue-41888.rs:10:29: 13:10
// ty::Const
bb12: {
_7 = const false; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-41888.rs:15:1: 15:2
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
_8 = const false; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-41888.rs:15:1: 15:2
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
_9 = const false; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-41888.rs:15:1: 15:2
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
StorageDead(_1); // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
StorageDead(_2); // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
return; // scope 0 at $DIR/issue-41888.rs:15:2: 15:2
bb13 (cleanup): {
_7 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/issue-41888.rs:9:9: 9:10
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
_8 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/issue-41888.rs:9:9: 9:10
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
_9 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/issue-41888.rs:9:9: 9:10
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
_1 = move _3; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
goto -> bb7; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
}
bb14: {
_7 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/issue-41888.rs:9:9: 9:10
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
_8 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/issue-41888.rs:9:9: 9:10
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
_9 = const true; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/issue-41888.rs:9:9: 9:10
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
_1 = move _3; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
goto -> bb6; // scope 1 at $DIR/issue-41888.rs:9:9: 9:10
}
bb15: {
_7 = const false; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-41888.rs:15:1: 15:2
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
goto -> bb12; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
}
bb16 (cleanup): {
_7 = const false; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/issue-41888.rs:15:1: 15:2
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
goto -> bb1; // scope 0 at $DIR/issue-41888.rs:15:1: 15:2
}
StorageLive(_2); // scope 0 at $DIR/issue-49232.rs:7:13: 7:19
StorageLive(_3); // scope 0 at $DIR/issue-49232.rs:8:19: 8:23
_3 = const true; // scope 0 at $DIR/issue-49232.rs:8:19: 8:23
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/issue-49232.rs:8:19: 8:23
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
FakeRead(ForMatchedPlace, _3); // scope 0 at $DIR/issue-49232.rs:8:19: 8:23
switchInt(_3) -> [false: bb5, otherwise: bb6]; // scope 0 at $DIR/issue-49232.rs:9:17: 9:22
}
bb7: {
_2 = const 4_i32; // scope 0 at $DIR/issue-49232.rs:9:26: 9:27
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000004))
- // mir::Constant
- // + span: $DIR/issue-49232.rs:9:26: 9:27
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
goto -> bb12; // scope 0 at $DIR/issue-49232.rs:8:13: 11:14
}
bb0: {
StorageLive(_2); // scope 0 at $DIR/issue-72181.rs:16:43: 16:44
_2 = const 0_usize; // scope 0 at $DIR/issue-72181.rs:16:43: 16:44
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/issue-72181.rs:16:43: 16:44
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
_3 = Len(_1); // scope 0 at $DIR/issue-72181.rs:16:40: 16:45
_4 = Lt(_2, _3); // scope 0 at $DIR/issue-72181.rs:16:40: 16:45
assert(move _4, "index out of bounds: the len is {} but the index is {}", move _3, _2) -> [success: bb2, unwind: bb1]; // scope 0 at $DIR/issue-72181.rs:16:40: 16:45
bb0: {
StorageLive(_2); // scope 0 at $DIR/issue-72181.rs:16:43: 16:44
_2 = const 0_usize; // scope 0 at $DIR/issue-72181.rs:16:43: 16:44
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000000))
- // mir::Constant
- // + span: $DIR/issue-72181.rs:16:43: 16:44
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
_3 = Len(_1); // scope 0 at $DIR/issue-72181.rs:16:40: 16:45
_4 = Lt(_2, _3); // scope 0 at $DIR/issue-72181.rs:16:40: 16:45
assert(move _4, "index out of bounds: the len is {} but the index is {}", move _3, _2) -> [success: bb2, unwind: bb1]; // scope 0 at $DIR/issue-72181.rs:16:40: 16:45
StorageLive(_2); // scope 1 at $DIR/issue-72181.rs:26:9: 26:10
StorageLive(_3); // scope 1 at $DIR/issue-72181.rs:26:14: 26:27
_3 = Foo { a: const 42_u64 }; // scope 1 at $DIR/issue-72181.rs:26:14: 26:27
- // ty::Const
- // + ty: u64
- // + val: Value(Scalar(0x000000000000002a))
- // mir::Constant
- // + span: $DIR/issue-72181.rs:26:23: 26:25
- // + literal: Const { ty: u64, val: Value(Scalar(0x000000000000002a)) }
StorageLive(_4); // scope 1 at $DIR/issue-72181.rs:26:29: 26:42
_4 = Foo { a: const 10_u64 }; // scope 1 at $DIR/issue-72181.rs:26:29: 26:42
- // ty::Const
- // + ty: u64
- // + val: Value(Scalar(0x000000000000000a))
- // mir::Constant
- // + span: $DIR/issue-72181.rs:26:38: 26:40
- // + literal: Const { ty: u64, val: Value(Scalar(0x000000000000000a)) }
_2 = [move _3, move _4]; // scope 1 at $DIR/issue-72181.rs:26:13: 26:43
StorageDead(_4); // scope 1 at $DIR/issue-72181.rs:26:42: 26:43
StorageDead(_3); // scope 1 at $DIR/issue-72181.rs:26:42: 26:43
StorageLive(_5); // scope 2 at $DIR/issue-72181.rs:27:13: 27:30
StorageLive(_6); // scope 4 at $DIR/issue-72181.rs:27:24: 27:25
_6 = const 0_usize; // scope 4 at $DIR/issue-72181.rs:27:24: 27:25
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/issue-72181.rs:27:24: 27:25
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
_7 = Len(_2); // scope 4 at $DIR/issue-72181.rs:27:22: 27:26
_8 = Lt(_6, _7); // scope 4 at $DIR/issue-72181.rs:27:22: 27:26
assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> [success: bb3, unwind: bb1]; // scope 4 at $DIR/issue-72181.rs:27:22: 27:26
StorageLive(_2); // scope 1 at $DIR/issue-72181.rs:26:9: 26:10
StorageLive(_3); // scope 1 at $DIR/issue-72181.rs:26:14: 26:27
_3 = Foo { a: const 42_u64 }; // scope 1 at $DIR/issue-72181.rs:26:14: 26:27
- // ty::Const
- // + ty: u64
- // + val: Value(Scalar(0x000000000000002a))
- // mir::Constant
- // + span: $DIR/issue-72181.rs:26:23: 26:25
- // + literal: Const { ty: u64, val: Value(Scalar(0x000000000000002a)) }
StorageLive(_4); // scope 1 at $DIR/issue-72181.rs:26:29: 26:42
_4 = Foo { a: const 10_u64 }; // scope 1 at $DIR/issue-72181.rs:26:29: 26:42
- // ty::Const
- // + ty: u64
- // + val: Value(Scalar(0x000000000000000a))
- // mir::Constant
- // + span: $DIR/issue-72181.rs:26:38: 26:40
- // + literal: Const { ty: u64, val: Value(Scalar(0x000000000000000a)) }
_2 = [move _3, move _4]; // scope 1 at $DIR/issue-72181.rs:26:13: 26:43
StorageDead(_4); // scope 1 at $DIR/issue-72181.rs:26:42: 26:43
StorageDead(_3); // scope 1 at $DIR/issue-72181.rs:26:42: 26:43
StorageLive(_5); // scope 2 at $DIR/issue-72181.rs:27:13: 27:30
StorageLive(_6); // scope 4 at $DIR/issue-72181.rs:27:24: 27:25
_6 = const 0_usize; // scope 4 at $DIR/issue-72181.rs:27:24: 27:25
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000000))
- // mir::Constant
- // + span: $DIR/issue-72181.rs:27:24: 27:25
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
_7 = Len(_2); // scope 4 at $DIR/issue-72181.rs:27:22: 27:26
_8 = Lt(_6, _7); // scope 4 at $DIR/issue-72181.rs:27:22: 27:26
assert(move _8, "index out of bounds: the len is {} but the index is {}", move _7, _6) -> [success: bb3, unwind: bb1]; // scope 4 at $DIR/issue-72181.rs:27:22: 27:26
bb0: {
StorageLive(_1); // scope 0 at $DIR/issue-73223.rs:2:23: 2:30
((_1 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/issue-73223.rs:2:28: 2:29
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
discriminant(_1) = 1; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30
_2 = ((_1 as Some).0: i32); // scope 0 at $DIR/issue-73223.rs:3:14: 3:15
StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:5:6: 5:7
StorageLive(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_11 = (*_7); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_10 = Eq(move _11, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
StorageDead(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_9 = Not(move _10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
bb0: {
StorageLive(_1); // scope 0 at $DIR/issue-73223.rs:2:23: 2:30
((_1 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/issue-73223.rs:2:28: 2:29
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
discriminant(_1) = 1; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30
_2 = ((_1 as Some).0: i32); // scope 0 at $DIR/issue-73223.rs:3:14: 3:15
StorageDead(_1); // scope 0 at $DIR/issue-73223.rs:5:6: 5:7
StorageLive(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_11 = (*_7); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_10 = Eq(move _11, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
StorageDead(_11); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_9 = Not(move _10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_10); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_1); // scope 0 at $DIR/issue-73223.rs:2:9: 2:14
StorageLive(_2); // scope 0 at $DIR/issue-73223.rs:2:23: 2:30
((_2 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/issue-73223.rs:2:28: 2:29
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
discriminant(_2) = 1; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30
_3 = const 1_isize; // scope 0 at $DIR/issue-73223.rs:3:9: 3:16
- // ty::Const
- // + ty: isize
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/issue-73223.rs:3:9: 3:16
- // + literal: Const { ty: isize, val: Value(Scalar(0x00000001)) }
goto -> bb2; // scope 0 at $DIR/issue-73223.rs:3:9: 3:16
}
_17 = (*_13); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_18); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_18 = const 1_i32; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
_16 = Eq(move _17, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
StorageDead(_18); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_15 = Not(move _16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_1); // scope 0 at $DIR/issue-73223.rs:2:9: 2:14
StorageLive(_2); // scope 0 at $DIR/issue-73223.rs:2:23: 2:30
((_2 as Some).0: i32) = const 1_i32; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/issue-73223.rs:2:28: 2:29
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
discriminant(_2) = 1; // scope 0 at $DIR/issue-73223.rs:2:23: 2:30
_3 = const 1_isize; // scope 0 at $DIR/issue-73223.rs:3:9: 3:16
- // ty::Const
- // + ty: isize
- // + val: Value(Scalar(0x0000000000000001))
- // mir::Constant
- // + span: $DIR/issue-73223.rs:3:9: 3:16
- // + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000001)) }
goto -> bb2; // scope 0 at $DIR/issue-73223.rs:3:9: 3:16
}
_17 = (*_13); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_18); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_18 = const 1_i32; // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
_16 = Eq(move _17, const 1_i32); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
StorageDead(_18); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageDead(_17); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
_15 = Not(move _16); // scope 4 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
StorageLive(_1); // scope 0 at $DIR/loop_test.rs:10:5: 12:6
StorageLive(_2); // scope 0 at $DIR/loop_test.rs:10:8: 10:12
_2 = const true; // scope 0 at $DIR/loop_test.rs:10:8: 10:12
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/loop_test.rs:10:8: 10:12
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/loop_test.rs:10:8: 10:12
switchInt(_2) -> [false: bb3, otherwise: bb2]; // scope 0 at $DIR/loop_test.rs:10:5: 12:6
}
bb6: {
StorageLive(_6); // scope 0 at $DIR/loop_test.rs:14:13: 14:14
_6 = const 1_i32; // scope 0 at $DIR/loop_test.rs:14:17: 14:18
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/loop_test.rs:14:17: 14:18
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
FakeRead(ForLet, _6); // scope 0 at $DIR/loop_test.rs:14:13: 14:14
StorageDead(_6); // scope 0 at $DIR/loop_test.rs:16:5: 16:6
goto -> bb5; // scope 0 at $DIR/loop_test.rs:15:9: 15:17
- bb8: {
+ bb5: {
_0 = const 1_i32; // scope 1 at $DIR/match-arm-scopes.rs:15:77: 15:78
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/match-arm-scopes.rs:15:77: 15:78
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
- drop(_7) -> [return: bb24, unwind: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
+ drop(_7) -> [return: bb19, unwind: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
}
- bb12: {
+ bb8: {
_0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/match-arm-scopes.rs:15:59: 15:60
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
StorageDead(_10); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
StorageDead(_9); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
- bb21: {
+ bb16: {
_0 = const 3_i32; // scope 0 at $DIR/match-arm-scopes.rs:15:59: 15:60
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/match-arm-scopes.rs:15:59: 15:60
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
StorageDead(_13); // scope 0 at $DIR/match-arm-scopes.rs:15:72: 15:73
StorageDead(_12); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
StorageDead(_8); // scope 0 at $DIR/match-arm-scopes.rs:15:77: 15:78
- bb25: {
+ bb20: {
_0 = const 2_i32; // scope 2 at $DIR/match-arm-scopes.rs:16:41: 16:42
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/match-arm-scopes.rs:16:41: 16:42
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
- drop(_16) -> [return: bb27, unwind: bb14]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42
+ drop(_16) -> [return: bb22, unwind: bb10]; // scope 0 at $DIR/match-arm-scopes.rs:16:41: 16:42
}
StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
_2 = std::option::Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:15:24: 15:26
- // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match_false_edges.rs:15:19: 15:27
_3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16
switchInt(move _3) -> [0_isize: bb2, 1_isize: bb3, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:16:9: 16:16
bb2: {
_1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:18:17: 18:23
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:18:18: 18:19
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:18:21: 18:22
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
}
StorageLive(_8); // scope 2 at $DIR/match_false_edges.rs:16:35: 16:36
_8 = _5; // scope 2 at $DIR/match_false_edges.rs:16:35: 16:36
_1 = (const 1_i32, move _8); // scope 2 at $DIR/match_false_edges.rs:16:31: 16:37
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:16:32: 16:33
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:16:36: 16:37
StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37
StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:16:36: 16:37
StorageLive(_10); // scope 3 at $DIR/match_false_edges.rs:17:24: 17:25
_10 = _9; // scope 3 at $DIR/match_false_edges.rs:17:24: 17:25
_1 = (const 2_i32, move _10); // scope 3 at $DIR/match_false_edges.rs:17:20: 17:26
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:17:21: 17:22
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:17:25: 17:26
StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:17:25: 17:26
goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:15:13: 19:6
StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
_2 = std::option::Option::<i32>::Some(const 42_i32); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:26:24: 26:26
- // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match_false_edges.rs:26:19: 26:27
_3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
switchInt(move _3) -> [0_isize: bb2, 1_isize: bb3, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:27:9: 27:16
StorageLive(_10); // scope 3 at $DIR/match_false_edges.rs:29:24: 29:25
_10 = _9; // scope 3 at $DIR/match_false_edges.rs:29:24: 29:25
_1 = (const 2_i32, move _10); // scope 3 at $DIR/match_false_edges.rs:29:20: 29:26
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:29:21: 29:22
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:29:25: 29:26
StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:29:25: 29:26
goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
StorageLive(_8); // scope 2 at $DIR/match_false_edges.rs:27:35: 27:36
_8 = _5; // scope 2 at $DIR/match_false_edges.rs:27:35: 27:36
_1 = (const 1_i32, move _8); // scope 2 at $DIR/match_false_edges.rs:27:31: 27:37
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:27:32: 27:33
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:27:36: 27:37
StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37
StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:27:36: 27:37
bb10: {
_1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:28:17: 28:23
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:28:18: 28:19
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:28:21: 28:22
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:26:13: 30:6
}
StorageLive(_1); // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
StorageLive(_2); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
_2 = std::option::Option::<i32>::Some(const 1_i32); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:35:24: 35:25
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
FakeRead(ForMatchedPlace, _2); // scope 0 at $DIR/match_false_edges.rs:35:19: 35:26
_4 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17
switchInt(move _4) -> [1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/match_false_edges.rs:36:9: 36:17
StorageLive(_14); // scope 0 at $DIR/match_false_edges.rs:39:9: 39:11
_14 = _2; // scope 0 at $DIR/match_false_edges.rs:39:9: 39:11
_1 = const 4_i32; // scope 5 at $DIR/match_false_edges.rs:39:15: 39:16
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000004))
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:39:15: 39:16
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000004)) }
StorageDead(_14); // scope 0 at $DIR/match_false_edges.rs:39:15: 39:16
goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
}
StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
_6 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:36:14: 36:16
_1 = const 1_i32; // scope 2 at $DIR/match_false_edges.rs:36:32: 36:33
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:36:32: 36:33
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33
StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:36:32: 36:33
goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
_9 = _2; // scope 0 at $DIR/match_false_edges.rs:37:9: 37:11
_1 = const 2_i32; // scope 3 at $DIR/match_false_edges.rs:37:15: 37:16
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:37:15: 37:16
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:37:15: 37:16
goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
}
StorageLive(_10); // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
_10 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:38:14: 38:15
_1 = const 3_i32; // scope 4 at $DIR/match_false_edges.rs:38:33: 38:34
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/match_false_edges.rs:38:33: 38:34
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
StorageDead(_10); // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34
StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:38:33: 38:34
goto -> bb15; // scope 0 at $DIR/match_false_edges.rs:35:13: 40:6
bb0: {
StorageLive(_1); // scope 0 at $DIR/match_test.rs:7:9: 7:10
_1 = const 3_i32; // scope 0 at $DIR/match_test.rs:7:13: 7:14
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/match_test.rs:7:13: 7:14
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
FakeRead(ForLet, _1); // scope 0 at $DIR/match_test.rs:7:9: 7:10
StorageLive(_2); // scope 1 at $DIR/match_test.rs:8:9: 8:10
_2 = const true; // scope 1 at $DIR/match_test.rs:8:13: 8:17
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/match_test.rs:8:13: 8:17
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
FakeRead(ForLet, _2); // scope 1 at $DIR/match_test.rs:8:9: 8:10
StorageLive(_3); // scope 2 at $DIR/match_test.rs:12:5: 17:6
FakeRead(ForMatchedPlace, _1); // scope 2 at $DIR/match_test.rs:12:11: 12:12
_6 = Le(const 0_i32, _1); // scope 2 at $DIR/match_test.rs:13:9: 13:14
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/match_test.rs:13:9: 13:14
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
switchInt(move _6) -> [false: bb4, otherwise: bb1]; // scope 2 at $DIR/match_test.rs:13:9: 13:14
}
bb1: {
_7 = Lt(_1, const 10_i32); // scope 2 at $DIR/match_test.rs:13:9: 13:14
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x0000000a))
- // mir::Constant
- // + span: $DIR/match_test.rs:13:9: 13:14
- // + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
switchInt(move _7) -> [false: bb4, otherwise: bb2]; // scope 2 at $DIR/match_test.rs:13:9: 13:14
}
bb3: {
_3 = const 3_i32; // scope 2 at $DIR/match_test.rs:16:14: 16:15
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/match_test.rs:16:14: 16:15
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000003)) }
goto -> bb14; // scope 2 at $DIR/match_test.rs:12:5: 17:6
}
bb4: {
_4 = Le(const 10_i32, _1); // scope 2 at $DIR/match_test.rs:14:9: 14:16
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x0000000a))
- // mir::Constant
- // + span: $DIR/match_test.rs:14:9: 14:16
- // + literal: Const { ty: i32, val: Value(Scalar(0x0000000a)) }
switchInt(move _4) -> [false: bb7, otherwise: bb5]; // scope 2 at $DIR/match_test.rs:14:9: 14:16
}
bb5: {
_5 = Le(_1, const 20_i32); // scope 2 at $DIR/match_test.rs:14:9: 14:16
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000014))
- // mir::Constant
- // + span: $DIR/match_test.rs:14:9: 14:16
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000014)) }
switchInt(move _5) -> [false: bb7, otherwise: bb6]; // scope 2 at $DIR/match_test.rs:14:9: 14:16
}
StorageDead(_9); // scope 2 at $DIR/match_test.rs:13:23: 13:24
FakeRead(ForMatchGuard, _8); // scope 2 at $DIR/match_test.rs:13:18: 13:19
_3 = const 0_i32; // scope 2 at $DIR/match_test.rs:13:23: 13:24
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/match_test.rs:13:23: 13:24
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
goto -> bb14; // scope 2 at $DIR/match_test.rs:12:5: 17:6
}
bb12: {
_3 = const 1_i32; // scope 2 at $DIR/match_test.rs:14:20: 14:21
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/match_test.rs:14:20: 14:21
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
goto -> bb14; // scope 2 at $DIR/match_test.rs:12:5: 17:6
}
bb13: {
_3 = const 2_i32; // scope 2 at $DIR/match_test.rs:15:15: 15:16
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/match_test.rs:15:15: 15:16
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
goto -> bb14; // scope 2 at $DIR/match_test.rs:12:5: 17:6
}
StorageLive(_6); // scope 4 at $DIR/matches_reduce_branches.rs:17:5: 32:6
- switchInt(_1) -> [7_i32: bb2, otherwise: bb1]; // scope 4 at $DIR/matches_reduce_branches.rs:18:9: 18:10
+ _2 = Ne(_1, const 7_i32); // scope 4 at $DIR/matches_reduce_branches.rs:19:13: 19:22
-+ // ty::Const
-+ // + ty: i32
-+ // + val: Value(Scalar(0x00000007))
-+ // mir::Constant
-+ // + span: $DIR/matches_reduce_branches.rs:1:1: 1:1
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000007)) }
+ _3 = Eq(_1, const 7_i32); // scope 4 at $DIR/matches_reduce_branches.rs:20:13: 20:21
-+ // ty::Const
-+ // + ty: i32
-+ // + val: Value(Scalar(0x00000007))
-+ // mir::Constant
-+ // + span: $DIR/matches_reduce_branches.rs:1:1: 1:1
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000007)) }
+ _4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:21:13: 21:22
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
-+ // mir::Constant
-+ // + span: $DIR/matches_reduce_branches.rs:21:17: 21:22
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
+ _5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:22:13: 22:21
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/matches_reduce_branches.rs:22:17: 22:21
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+ goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:18:9: 18:10
}
bb1: {
_2 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:26:13: 26:21
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/matches_reduce_branches.rs:26:17: 26:21
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
_3 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:27:13: 27:22
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/matches_reduce_branches.rs:27:17: 27:22
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
_4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:28:13: 28:22
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/matches_reduce_branches.rs:28:17: 28:22
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
_5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:29:13: 29:21
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/matches_reduce_branches.rs:29:17: 29:21
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:17:5: 32:6
}
bb2: {
_2 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:19:13: 19:22
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/matches_reduce_branches.rs:19:17: 19:22
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
_3 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:20:13: 20:21
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/matches_reduce_branches.rs:20:17: 20:21
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
_4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:21:13: 21:22
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/matches_reduce_branches.rs:21:17: 21:22
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
_5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:22:13: 22:21
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/matches_reduce_branches.rs:22:17: 22:21
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:17:5: 32:6
}
StorageLive(_6); // scope 4 at $DIR/matches_reduce_branches.rs:17:5: 32:6
- switchInt(_1) -> [7_i32: bb2, otherwise: bb1]; // scope 4 at $DIR/matches_reduce_branches.rs:18:9: 18:10
+ _2 = Ne(_1, const 7_i32); // scope 4 at $DIR/matches_reduce_branches.rs:19:13: 19:22
-+ // ty::Const
-+ // + ty: i32
-+ // + val: Value(Scalar(0x00000007))
-+ // mir::Constant
-+ // + span: $DIR/matches_reduce_branches.rs:1:1: 1:1
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000007)) }
+ _3 = Eq(_1, const 7_i32); // scope 4 at $DIR/matches_reduce_branches.rs:20:13: 20:21
-+ // ty::Const
-+ // + ty: i32
-+ // + val: Value(Scalar(0x00000007))
-+ // mir::Constant
-+ // + span: $DIR/matches_reduce_branches.rs:1:1: 1:1
-+ // + literal: Const { ty: i32, val: Value(Scalar(0x00000007)) }
+ _4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:21:13: 21:22
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
-+ // mir::Constant
-+ // + span: $DIR/matches_reduce_branches.rs:21:17: 21:22
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
+ _5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:22:13: 22:21
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x01))
-+ // mir::Constant
-+ // + span: $DIR/matches_reduce_branches.rs:22:17: 22:21
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
+ goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:18:9: 18:10
}
bb1: {
_2 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:26:13: 26:21
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/matches_reduce_branches.rs:26:17: 26:21
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
_3 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:27:13: 27:22
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/matches_reduce_branches.rs:27:17: 27:22
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
_4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:28:13: 28:22
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/matches_reduce_branches.rs:28:17: 28:22
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
_5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:29:13: 29:21
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/matches_reduce_branches.rs:29:17: 29:21
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:17:5: 32:6
}
bb2: {
_2 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:19:13: 19:22
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/matches_reduce_branches.rs:19:17: 19:22
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
_3 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:20:13: 20:21
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/matches_reduce_branches.rs:20:17: 20:21
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
_4 = const false; // scope 4 at $DIR/matches_reduce_branches.rs:21:13: 21:22
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/matches_reduce_branches.rs:21:17: 21:22
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
_5 = const true; // scope 4 at $DIR/matches_reduce_branches.rs:22:13: 22:21
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/matches_reduce_branches.rs:22:17: 22:21
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
goto -> bb3; // scope 4 at $DIR/matches_reduce_branches.rs:17:5: 32:6
}
_3 = discriminant(_1); // scope 0 at $DIR/matches_reduce_branches.rs:6:22: 6:26
- switchInt(move _3) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:6:22: 6:26
+ _2 = Eq(_3, const 0_isize); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-+ // ty::Const
-+ // + ty: isize
-+ // + val: Value(Scalar(0x00000000))
-+ // mir::Constant
-+ // + span: $DIR/matches_reduce_branches.rs:1:1: 1:1
-+ // + literal: Const { ty: isize, val: Value(Scalar(0x00000000)) }
+ goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:6:22: 6:26
}
bb1: {
_2 = const false; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
}
bb2: {
_2 = const true; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
}
_3 = discriminant(_1); // scope 0 at $DIR/matches_reduce_branches.rs:6:22: 6:26
- switchInt(move _3) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/matches_reduce_branches.rs:6:22: 6:26
+ _2 = Eq(_3, const 0_isize); // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
-+ // ty::Const
-+ // + ty: isize
-+ // + val: Value(Scalar(0x0000000000000000))
-+ // mir::Constant
-+ // + span: $DIR/matches_reduce_branches.rs:1:1: 1:1
-+ // + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000000)) }
+ goto -> bb3; // scope 0 at $DIR/matches_reduce_branches.rs:6:22: 6:26
}
bb1: {
_2 = const false; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
}
bb2: {
_2 = const true; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $SRC_DIR/core/src/macros/mod.rs:LL:COL
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
goto -> bb3; // scope 0 at $SRC_DIR/core/src/macros/mod.rs:LL:COL
}
bb1: {
_0 = const 1_u8; // scope 0 at $DIR/matches_u8.rs:14:17: 14:18
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/matches_u8.rs:14:17: 14:18
- // + literal: Const { ty: u8, val: Value(Scalar(0x01)) }
goto -> bb3; // scope 0 at $DIR/matches_u8.rs:12:5: 15:6
}
bb2: {
_0 = const 0_u8; // scope 0 at $DIR/matches_u8.rs:13:17: 13:18
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/matches_u8.rs:13:17: 13:18
- // + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
goto -> bb3; // scope 0 at $DIR/matches_u8.rs:12:5: 15:6
}
bb1: {
_0 = const 1_u8; // scope 0 at $DIR/matches_u8.rs:14:17: 14:18
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/matches_u8.rs:14:17: 14:18
- // + literal: Const { ty: u8, val: Value(Scalar(0x01)) }
goto -> bb3; // scope 0 at $DIR/matches_u8.rs:12:5: 15:6
}
bb2: {
_0 = const 0_u8; // scope 0 at $DIR/matches_u8.rs:13:17: 13:18
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/matches_u8.rs:13:17: 13:18
- // + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
goto -> bb3; // scope 0 at $DIR/matches_u8.rs:12:5: 15:6
}
bb1: {
_0 = const 1_i8; // scope 0 at $DIR/matches_u8.rs:22:17: 22:18
- // ty::Const
- // + ty: i8
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/matches_u8.rs:22:17: 22:18
- // + literal: Const { ty: i8, val: Value(Scalar(0x01)) }
goto -> bb3; // scope 0 at $DIR/matches_u8.rs:20:5: 23:6
}
bb2: {
_0 = const 0_i8; // scope 0 at $DIR/matches_u8.rs:21:17: 21:18
- // ty::Const
- // + ty: i8
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/matches_u8.rs:21:17: 21:18
- // + literal: Const { ty: i8, val: Value(Scalar(0x00)) }
goto -> bb3; // scope 0 at $DIR/matches_u8.rs:20:5: 23:6
}
bb1: {
_0 = const 1_i8; // scope 0 at $DIR/matches_u8.rs:22:17: 22:18
- // ty::Const
- // + ty: i8
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/matches_u8.rs:22:17: 22:18
- // + literal: Const { ty: i8, val: Value(Scalar(0x01)) }
goto -> bb3; // scope 0 at $DIR/matches_u8.rs:20:5: 23:6
}
bb2: {
_0 = const 0_i8; // scope 0 at $DIR/matches_u8.rs:21:17: 21:18
- // ty::Const
- // + ty: i8
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/matches_u8.rs:21:17: 21:18
- // + literal: Const { ty: i8, val: Value(Scalar(0x00)) }
goto -> bb3; // scope 0 at $DIR/matches_u8.rs:20:5: 23:6
}
bb0: {
_0 = const Const(Value(Scalar(0x01)): bool); // bb0[0]: scope 0 at $DIR/named-lifetimes-basic.rs:12:88: 12:92
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/named-lifetimes-basic.rs:12:88: 12:92
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
return; // bb0[1]: scope 0 at $DIR/named-lifetimes-basic.rs:12:94: 12:94
}
}
bb0: {
StorageLive(_1); // bb0[0]: scope 0 at $DIR/region-subtyping-basic.rs:17:9: 17:14
_1 = [const Const(Value(Scalar(0x00000001)): usize), const Const(Value(Scalar(0x00000002)): usize), const Const(Value(Scalar(0x00000003)): usize)]; // bb0[1]: scope 0 at $DIR/region-subtyping-basic.rs:17:17: 17:26
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/region-subtyping-basic.rs:17:18: 17:19
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/region-subtyping-basic.rs:17:21: 17:22
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/region-subtyping-basic.rs:17:24: 17:25
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000003)) }
FakeRead(ForLet, _1); // bb0[2]: scope 0 at $DIR/region-subtyping-basic.rs:17:9: 17:14
StorageLive(_2); // bb0[3]: scope 1 at $DIR/region-subtyping-basic.rs:18:9: 18:10
StorageLive(_3); // bb0[4]: scope 1 at $DIR/region-subtyping-basic.rs:18:16: 18:17
_3 = const Const(Value(Scalar(0x00000000)): usize); // bb0[5]: scope 1 at $DIR/region-subtyping-basic.rs:18:16: 18:17
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/region-subtyping-basic.rs:18:16: 18:17
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
_4 = Len(_1); // bb0[6]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18
_5 = Lt(_3, _4); // bb0[7]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18
assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> [success: bb2, unwind: bb1]; // bb0[8]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18
FakeRead(ForLet, _6); // bb2[4]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10
StorageLive(_7); // bb2[5]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12
_7 = const Const(Value(Scalar(0x01)): bool); // bb2[6]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/region-subtyping-basic.rs:20:8: 20:12
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
FakeRead(ForMatchedPlace, _7); // bb2[7]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12
switchInt(_7) -> [Const(Value(Scalar(0x00)): bool): bb4, otherwise: bb3]; // bb2[8]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6
}
// mir::Constant
// + span: $DIR/region-subtyping-basic.rs:23:9: 23:14
// + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) }
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000016))
- // mir::Constant
- // + span: $DIR/region-subtyping-basic.rs:23:15: 23:17
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000016)) }
}
bb5: {
bb0: {
StorageLive(_1); // bb0[0]: scope 0 at $DIR/region-subtyping-basic.rs:17:9: 17:14
_1 = [const Const(Value(Scalar(0x0000000000000001)): usize), const Const(Value(Scalar(0x0000000000000002)): usize), const Const(Value(Scalar(0x0000000000000003)): usize)]; // bb0[1]: scope 0 at $DIR/region-subtyping-basic.rs:17:17: 17:26
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000001))
- // mir::Constant
- // + span: $DIR/region-subtyping-basic.rs:17:18: 17:19
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000002))
- // mir::Constant
- // + span: $DIR/region-subtyping-basic.rs:17:21: 17:22
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000002)) }
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000003))
- // mir::Constant
- // + span: $DIR/region-subtyping-basic.rs:17:24: 17:25
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000003)) }
FakeRead(ForLet, _1); // bb0[2]: scope 0 at $DIR/region-subtyping-basic.rs:17:9: 17:14
StorageLive(_2); // bb0[3]: scope 1 at $DIR/region-subtyping-basic.rs:18:9: 18:10
StorageLive(_3); // bb0[4]: scope 1 at $DIR/region-subtyping-basic.rs:18:16: 18:17
_3 = const Const(Value(Scalar(0x0000000000000000)): usize); // bb0[5]: scope 1 at $DIR/region-subtyping-basic.rs:18:16: 18:17
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000000))
- // mir::Constant
- // + span: $DIR/region-subtyping-basic.rs:18:16: 18:17
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
_4 = Len(_1); // bb0[6]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18
_5 = Lt(_3, _4); // bb0[7]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18
assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> [success: bb2, unwind: bb1]; // bb0[8]: scope 1 at $DIR/region-subtyping-basic.rs:18:14: 18:18
FakeRead(ForLet, _6); // bb2[4]: scope 2 at $DIR/region-subtyping-basic.rs:19:9: 19:10
StorageLive(_7); // bb2[5]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12
_7 = const Const(Value(Scalar(0x01)): bool); // bb2[6]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/region-subtyping-basic.rs:20:8: 20:12
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
FakeRead(ForMatchedPlace, _7); // bb2[7]: scope 3 at $DIR/region-subtyping-basic.rs:20:8: 20:12
switchInt(_7) -> [Const(Value(Scalar(0x00)): bool): bb4, otherwise: bb3]; // bb2[8]: scope 3 at $DIR/region-subtyping-basic.rs:20:5: 24:6
}
// mir::Constant
// + span: $DIR/region-subtyping-basic.rs:23:9: 23:14
// + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) }
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000016))
- // mir::Constant
- // + span: $DIR/region-subtyping-basic.rs:23:15: 23:17
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000016)) }
}
bb5: {
- StorageLive(_2); // scope 0 at $DIR/nrvo-simple.rs:3:9: 3:16
- _2 = [const 0_u8; 1024]; // scope 0 at $DIR/nrvo-simple.rs:3:19: 3:28
+ _0 = [const 0_u8; 1024]; // scope 0 at $DIR/nrvo-simple.rs:3:19: 3:28
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/nrvo-simple.rs:3:20: 3:21
- // + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
StorageLive(_3); // scope 1 at $DIR/nrvo-simple.rs:4:5: 4:19
StorageLive(_5); // scope 1 at $DIR/nrvo-simple.rs:4:10: 4:18
StorageLive(_6); // scope 1 at $DIR/nrvo-simple.rs:4:10: 4:18
StorageLive(_2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
StorageLive(_3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
_3 = Droppy(const 0_usize); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/packed-struct-drop-aligned.rs:6:39: 6:40
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
_2 = Aligned(move _3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
StorageDead(_3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:41: 6:42
_1 = Packed(move _2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:17: 6:43
StorageLive(_4); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
StorageLive(_5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
_5 = Droppy(const 0_usize); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/packed-struct-drop-aligned.rs:7:26: 7:27
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
_4 = Aligned(move _5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
StorageDead(_5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
StorageLive(_6); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
StorageLive(_2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
StorageLive(_3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
_3 = Droppy(const 0_usize); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:32: 6:41
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000000))
- // mir::Constant
- // + span: $DIR/packed-struct-drop-aligned.rs:6:39: 6:40
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
_2 = Aligned(move _3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:24: 6:42
StorageDead(_3); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:41: 6:42
_1 = Packed(move _2); // scope 0 at $DIR/packed-struct-drop-aligned.rs:6:17: 6:43
StorageLive(_4); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
StorageLive(_5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
_5 = Droppy(const 0_usize); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:19: 7:28
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000000))
- // mir::Constant
- // + span: $DIR/packed-struct-drop-aligned.rs:7:26: 7:27
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
_4 = Aligned(move _5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:11: 7:29
StorageDead(_5); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:28: 7:29
StorageLive(_6); // scope 1 at $DIR/packed-struct-drop-aligned.rs:7:5: 7:8
bb1: {
_0 = const 1_i32; // scope 0 at $DIR/remove_fake_borrows.rs:9:14: 9:15
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/remove_fake_borrows.rs:9:14: 9:15
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
goto -> bb7; // scope 0 at $DIR/remove_fake_borrows.rs:7:5: 10:6
}
+ nop; // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
+ nop; // scope 0 at $DIR/remove_fake_borrows.rs:8:20: 8:21
_0 = const 0_i32; // scope 0 at $DIR/remove_fake_borrows.rs:8:25: 8:26
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/remove_fake_borrows.rs:8:25: 8:26
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
goto -> bb7; // scope 0 at $DIR/remove_fake_borrows.rs:7:5: 10:6
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/retag.rs:30:9: 30:14
_1 = const 0_i32; // scope 0 at $DIR/retag.rs:30:17: 30:18
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/retag.rs:30:17: 30:18
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
StorageLive(_2); // scope 1 at $DIR/retag.rs:31:5: 37:6
StorageLive(_3); // scope 1 at $DIR/retag.rs:32:13: 32:14
StorageLive(_4); // scope 1 at $DIR/retag.rs:32:17: 32:24
StorageLive(_5); // scope 1 at $DIR/retag.rs:32:17: 32:24
_5 = Test(const 0_i32); // scope 1 at $DIR/retag.rs:32:17: 32:24
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/retag.rs:32:22: 32:23
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
_4 = &_5; // scope 1 at $DIR/retag.rs:32:17: 32:24
Retag(_4); // scope 1 at $DIR/retag.rs:32:17: 32:24
StorageLive(_6); // scope 1 at $DIR/retag.rs:32:29: 32:35
StorageLive(_20); // scope 7 at $DIR/retag.rs:47:5: 47:12
StorageLive(_21); // scope 7 at $DIR/retag.rs:47:5: 47:12
_21 = Test(const 0_i32); // scope 7 at $DIR/retag.rs:47:5: 47:12
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/retag.rs:47:10: 47:11
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
_20 = &_21; // scope 7 at $DIR/retag.rs:47:5: 47:12
Retag(_20); // scope 7 at $DIR/retag.rs:47:5: 47:12
StorageLive(_22); // scope 7 at $DIR/retag.rs:47:21: 47:23
bb3: {
_0 = const 20_usize; // scope 0 at $DIR/simple-match.rs:8:14: 8:16
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000014))
- // mir::Constant
- // + span: $DIR/simple-match.rs:8:14: 8:16
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000014)) }
goto -> bb5; // scope 0 at $DIR/simple-match.rs:6:5: 9:6
}
bb4: {
_0 = const 10_usize; // scope 0 at $DIR/simple-match.rs:7:17: 7:19
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000a))
- // mir::Constant
- // + span: $DIR/simple-match.rs:7:17: 7:19
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000a)) }
goto -> bb5; // scope 0 at $DIR/simple-match.rs:6:5: 9:6
}
bb3: {
_0 = const 20_usize; // scope 0 at $DIR/simple-match.rs:8:14: 8:16
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000014))
- // mir::Constant
- // + span: $DIR/simple-match.rs:8:14: 8:16
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000014)) }
goto -> bb5; // scope 0 at $DIR/simple-match.rs:6:5: 9:6
}
bb4: {
_0 = const 10_usize; // scope 0 at $DIR/simple-match.rs:7:17: 7:19
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x000000000000000a))
- // mir::Constant
- // + span: $DIR/simple-match.rs:7:17: 7:19
- // + literal: Const { ty: usize, val: Value(Scalar(0x000000000000000a)) }
goto -> bb5; // scope 0 at $DIR/simple-match.rs:6:5: 9:6
}
-// compile-flags: -Z mir-opt-level=1
+// compile-flags: -Z mir-opt-level=2
// EMIT_MIR simplify_arm.id.SimplifyArmIdentity.diff
// EMIT_MIR simplify_arm.id.SimplifyBranchSame.diff
// EMIT_MIR simplify_arm.id_result.SimplifyArmIdentity.diff
let _3: u8; // in scope 0 at $DIR/simplify-arm.rs:11:14: 11:15
let mut _4: u8; // in scope 0 at $DIR/simplify-arm.rs:11:25: 11:26
scope 1 {
- debug v => _3; // in scope 1 at $DIR/simplify-arm.rs:11:14: 11:15
+- debug v => _3; // in scope 1 at $DIR/simplify-arm.rs:11:14: 11:15
++ debug v => ((_0 as Some).0: u8); // in scope 1 at $DIR/simplify-arm.rs:11:14: 11:15
}
bb0: {
}
bb3: {
- StorageLive(_3); // scope 0 at $DIR/simplify-arm.rs:11:14: 11:15
- _3 = ((_1 as Some).0: u8); // scope 0 at $DIR/simplify-arm.rs:11:14: 11:15
- StorageLive(_4); // scope 1 at $DIR/simplify-arm.rs:11:25: 11:26
- _4 = _3; // scope 1 at $DIR/simplify-arm.rs:11:25: 11:26
- ((_0 as Some).0: u8) = move _4; // scope 1 at $DIR/simplify-arm.rs:11:20: 11:27
- discriminant(_0) = 1; // scope 1 at $DIR/simplify-arm.rs:11:20: 11:27
- StorageDead(_4); // scope 1 at $DIR/simplify-arm.rs:11:26: 11:27
- StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:11:26: 11:27
+- StorageLive(_3); // scope 0 at $DIR/simplify-arm.rs:11:14: 11:15
+- _3 = ((_1 as Some).0: u8); // scope 0 at $DIR/simplify-arm.rs:11:14: 11:15
+- StorageLive(_4); // scope 1 at $DIR/simplify-arm.rs:11:25: 11:26
+- _4 = _3; // scope 1 at $DIR/simplify-arm.rs:11:25: 11:26
+- ((_0 as Some).0: u8) = move _4; // scope 1 at $DIR/simplify-arm.rs:11:20: 11:27
+- discriminant(_0) = 1; // scope 1 at $DIR/simplify-arm.rs:11:20: 11:27
+- StorageDead(_4); // scope 1 at $DIR/simplify-arm.rs:11:26: 11:27
+- StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:11:26: 11:27
++ _0 = move _1; // scope 1 at $DIR/simplify-arm.rs:11:20: 11:27
goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:10:5: 13:6
}
let _3: u8; // in scope 0 at $DIR/simplify-arm.rs:11:14: 11:15
let mut _4: u8; // in scope 0 at $DIR/simplify-arm.rs:11:25: 11:26
scope 1 {
- debug v => _3; // in scope 1 at $DIR/simplify-arm.rs:11:14: 11:15
+ debug v => ((_0 as Some).0: u8); // in scope 1 at $DIR/simplify-arm.rs:11:14: 11:15
}
bb0: {
_2 = discriminant(_1); // scope 0 at $DIR/simplify-arm.rs:11:9: 11:16
- switchInt(move _2) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/simplify-arm.rs:11:9: 11:16
+- switchInt(move _2) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/simplify-arm.rs:11:9: 11:16
++ goto -> bb1; // scope 0 at $DIR/simplify-arm.rs:11:9: 11:16
}
bb1: {
- discriminant(_0) = 0; // scope 0 at $DIR/simplify-arm.rs:12:17: 12:21
- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:10:5: 13:6
+- discriminant(_0) = 0; // scope 0 at $DIR/simplify-arm.rs:12:17: 12:21
+- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:10:5: 13:6
+- }
+-
+- bb2: {
+- unreachable; // scope 0 at $DIR/simplify-arm.rs:10:11: 10:12
+- }
+-
+- bb3: {
+ _0 = move _1; // scope 1 at $DIR/simplify-arm.rs:11:20: 11:27
+- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:10:5: 13:6
++ goto -> bb2; // scope 0 at $DIR/simplify-arm.rs:10:5: 13:6
}
- bb2: {
- unreachable; // scope 0 at $DIR/simplify-arm.rs:10:11: 10:12
- }
-
- bb3: {
- StorageLive(_3); // scope 0 at $DIR/simplify-arm.rs:11:14: 11:15
- _3 = ((_1 as Some).0: u8); // scope 0 at $DIR/simplify-arm.rs:11:14: 11:15
- StorageLive(_4); // scope 1 at $DIR/simplify-arm.rs:11:25: 11:26
- _4 = _3; // scope 1 at $DIR/simplify-arm.rs:11:25: 11:26
- ((_0 as Some).0: u8) = move _4; // scope 1 at $DIR/simplify-arm.rs:11:20: 11:27
- discriminant(_0) = 1; // scope 1 at $DIR/simplify-arm.rs:11:20: 11:27
- StorageDead(_4); // scope 1 at $DIR/simplify-arm.rs:11:26: 11:27
- StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:11:26: 11:27
- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:10:5: 13:6
- }
-
- bb4: {
+- bb4: {
++ bb2: {
return; // scope 0 at $DIR/simplify-arm.rs:14:2: 14:2
}
}
let _5: i32; // in scope 0 at $DIR/simplify-arm.rs:19:13: 19:14
let mut _6: i32; // in scope 0 at $DIR/simplify-arm.rs:19:23: 19:24
scope 1 {
- debug x => _3; // in scope 1 at $DIR/simplify-arm.rs:18:12: 18:13
+- debug x => _3; // in scope 1 at $DIR/simplify-arm.rs:18:12: 18:13
++ debug x => ((_0 as Ok).0: u8); // in scope 1 at $DIR/simplify-arm.rs:18:12: 18:13
}
scope 2 {
- debug y => _5; // in scope 2 at $DIR/simplify-arm.rs:19:13: 19:14
+- debug y => _5; // in scope 2 at $DIR/simplify-arm.rs:19:13: 19:14
++ debug y => ((_0 as Err).0: i32); // in scope 2 at $DIR/simplify-arm.rs:19:13: 19:14
}
bb0: {
}
bb1: {
- StorageLive(_5); // scope 0 at $DIR/simplify-arm.rs:19:13: 19:14
- _5 = ((_1 as Err).0: i32); // scope 0 at $DIR/simplify-arm.rs:19:13: 19:14
- StorageLive(_6); // scope 2 at $DIR/simplify-arm.rs:19:23: 19:24
- _6 = _5; // scope 2 at $DIR/simplify-arm.rs:19:23: 19:24
- ((_0 as Err).0: i32) = move _6; // scope 2 at $DIR/simplify-arm.rs:19:19: 19:25
- discriminant(_0) = 1; // scope 2 at $DIR/simplify-arm.rs:19:19: 19:25
- StorageDead(_6); // scope 2 at $DIR/simplify-arm.rs:19:24: 19:25
- StorageDead(_5); // scope 0 at $DIR/simplify-arm.rs:19:24: 19:25
+- StorageLive(_5); // scope 0 at $DIR/simplify-arm.rs:19:13: 19:14
+- _5 = ((_1 as Err).0: i32); // scope 0 at $DIR/simplify-arm.rs:19:13: 19:14
+- StorageLive(_6); // scope 2 at $DIR/simplify-arm.rs:19:23: 19:24
+- _6 = _5; // scope 2 at $DIR/simplify-arm.rs:19:23: 19:24
+- ((_0 as Err).0: i32) = move _6; // scope 2 at $DIR/simplify-arm.rs:19:19: 19:25
+- discriminant(_0) = 1; // scope 2 at $DIR/simplify-arm.rs:19:19: 19:25
+- StorageDead(_6); // scope 2 at $DIR/simplify-arm.rs:19:24: 19:25
+- StorageDead(_5); // scope 0 at $DIR/simplify-arm.rs:19:24: 19:25
++ _0 = move _1; // scope 2 at $DIR/simplify-arm.rs:19:19: 19:25
goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6
}
}
bb3: {
- StorageLive(_3); // scope 0 at $DIR/simplify-arm.rs:18:12: 18:13
- _3 = ((_1 as Ok).0: u8); // scope 0 at $DIR/simplify-arm.rs:18:12: 18:13
- StorageLive(_4); // scope 1 at $DIR/simplify-arm.rs:18:21: 18:22
- _4 = _3; // scope 1 at $DIR/simplify-arm.rs:18:21: 18:22
- ((_0 as Ok).0: u8) = move _4; // scope 1 at $DIR/simplify-arm.rs:18:18: 18:23
- discriminant(_0) = 0; // scope 1 at $DIR/simplify-arm.rs:18:18: 18:23
- StorageDead(_4); // scope 1 at $DIR/simplify-arm.rs:18:22: 18:23
- StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:18:22: 18:23
+- StorageLive(_3); // scope 0 at $DIR/simplify-arm.rs:18:12: 18:13
+- _3 = ((_1 as Ok).0: u8); // scope 0 at $DIR/simplify-arm.rs:18:12: 18:13
+- StorageLive(_4); // scope 1 at $DIR/simplify-arm.rs:18:21: 18:22
+- _4 = _3; // scope 1 at $DIR/simplify-arm.rs:18:21: 18:22
+- ((_0 as Ok).0: u8) = move _4; // scope 1 at $DIR/simplify-arm.rs:18:18: 18:23
+- discriminant(_0) = 0; // scope 1 at $DIR/simplify-arm.rs:18:18: 18:23
+- StorageDead(_4); // scope 1 at $DIR/simplify-arm.rs:18:22: 18:23
+- StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:18:22: 18:23
++ _0 = move _1; // scope 1 at $DIR/simplify-arm.rs:18:18: 18:23
goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6
}
let _5: i32; // in scope 0 at $DIR/simplify-arm.rs:19:13: 19:14
let mut _6: i32; // in scope 0 at $DIR/simplify-arm.rs:19:23: 19:24
scope 1 {
- debug x => _3; // in scope 1 at $DIR/simplify-arm.rs:18:12: 18:13
+ debug x => ((_0 as Ok).0: u8); // in scope 1 at $DIR/simplify-arm.rs:18:12: 18:13
}
scope 2 {
- debug y => _5; // in scope 2 at $DIR/simplify-arm.rs:19:13: 19:14
+ debug y => ((_0 as Err).0: i32); // in scope 2 at $DIR/simplify-arm.rs:19:13: 19:14
}
bb0: {
_2 = discriminant(_1); // scope 0 at $DIR/simplify-arm.rs:18:9: 18:14
- switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify-arm.rs:18:9: 18:14
+- switchInt(move _2) -> [0_isize: bb3, 1_isize: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify-arm.rs:18:9: 18:14
++ goto -> bb1; // scope 0 at $DIR/simplify-arm.rs:18:9: 18:14
}
bb1: {
- StorageLive(_5); // scope 0 at $DIR/simplify-arm.rs:19:13: 19:14
- _5 = ((_1 as Err).0: i32); // scope 0 at $DIR/simplify-arm.rs:19:13: 19:14
- StorageLive(_6); // scope 2 at $DIR/simplify-arm.rs:19:23: 19:24
- _6 = _5; // scope 2 at $DIR/simplify-arm.rs:19:23: 19:24
- ((_0 as Err).0: i32) = move _6; // scope 2 at $DIR/simplify-arm.rs:19:19: 19:25
- discriminant(_0) = 1; // scope 2 at $DIR/simplify-arm.rs:19:19: 19:25
- StorageDead(_6); // scope 2 at $DIR/simplify-arm.rs:19:24: 19:25
- StorageDead(_5); // scope 0 at $DIR/simplify-arm.rs:19:24: 19:25
- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6
+- _0 = move _1; // scope 2 at $DIR/simplify-arm.rs:19:19: 19:25
+- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6
+- }
+-
+- bb2: {
+- unreachable; // scope 0 at $DIR/simplify-arm.rs:17:11: 17:12
+- }
+-
+- bb3: {
+ _0 = move _1; // scope 1 at $DIR/simplify-arm.rs:18:18: 18:23
+- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6
++ goto -> bb2; // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6
}
- bb2: {
- unreachable; // scope 0 at $DIR/simplify-arm.rs:17:11: 17:12
- }
-
- bb3: {
- StorageLive(_3); // scope 0 at $DIR/simplify-arm.rs:18:12: 18:13
- _3 = ((_1 as Ok).0: u8); // scope 0 at $DIR/simplify-arm.rs:18:12: 18:13
- StorageLive(_4); // scope 1 at $DIR/simplify-arm.rs:18:21: 18:22
- _4 = _3; // scope 1 at $DIR/simplify-arm.rs:18:21: 18:22
- ((_0 as Ok).0: u8) = move _4; // scope 1 at $DIR/simplify-arm.rs:18:18: 18:23
- discriminant(_0) = 0; // scope 1 at $DIR/simplify-arm.rs:18:18: 18:23
- StorageDead(_4); // scope 1 at $DIR/simplify-arm.rs:18:22: 18:23
- StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:18:22: 18:23
- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:17:5: 20:6
- }
-
- bb4: {
+- bb4: {
++ bb2: {
return; // scope 0 at $DIR/simplify-arm.rs:21:2: 21:2
}
}
let _10: u8; // in scope 0 at $DIR/simplify-arm.rs:24:13: 24:15
let mut _11: u8; // in scope 0 at $DIR/simplify-arm.rs:25:8: 25:9
scope 1 {
- debug x => _2; // in scope 1 at $DIR/simplify-arm.rs:24:9: 24:10
+- debug x => _2; // in scope 1 at $DIR/simplify-arm.rs:24:9: 24:10
++ debug x => ((_0 as Ok).0: u8); // in scope 1 at $DIR/simplify-arm.rs:24:9: 24:10
}
scope 2 {
- debug err => _6; // in scope 2 at $DIR/simplify-arm.rs:24:14: 24:15
+- debug err => _6; // in scope 2 at $DIR/simplify-arm.rs:24:14: 24:15
++ debug err => ((_0 as Err).0: i32); // in scope 2 at $DIR/simplify-arm.rs:24:14: 24:15
scope 3 {
+ scope 7 {
+- debug t => _9; // in scope 7 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
++ debug t => ((_0 as Err).0: i32); // in scope 7 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
+ }
+ scope 8 {
+- debug v => _8; // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
++ debug v => ((_0 as Err).0: i32); // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
+ let mut _12: i32; // in scope 8 at $DIR/simplify-arm.rs:24:14: 24:15
+ }
}
}
scope 4 {
- debug val => _10; // in scope 4 at $DIR/simplify-arm.rs:24:13: 24:15
+- debug val => _10; // in scope 4 at $DIR/simplify-arm.rs:24:13: 24:15
++ debug val => ((_0 as Ok).0: u8); // in scope 4 at $DIR/simplify-arm.rs:24:13: 24:15
scope 5 {
}
}
+ scope 6 {
+ debug self => _4; // in scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
+ }
bb0: {
StorageLive(_2); // scope 0 at $DIR/simplify-arm.rs:24:9: 24:10
StorageLive(_3); // scope 0 at $DIR/simplify-arm.rs:24:13: 24:15
StorageLive(_4); // scope 0 at $DIR/simplify-arm.rs:24:13: 24:14
_4 = _1; // scope 0 at $DIR/simplify-arm.rs:24:13: 24:14
- _3 = const <std::result::Result<u8, i32> as std::ops::Try>::into_result(move _4) -> bb1; // scope 0 at $DIR/simplify-arm.rs:24:13: 24:15
- // ty::Const
- // + ty: fn(std::result::Result<u8, i32>) -> std::result::Result<<std::result::Result<u8, i32> as std::ops::Try>::Ok, <std::result::Result<u8, i32> as std::ops::Try>::Error> {<std::result::Result<u8, i32> as std::ops::Try>::into_result}
- // + val: Value(Scalar(<ZST>))
- // mir::Constant
- // + span: $DIR/simplify-arm.rs:24:13: 24:15
- // + literal: Const { ty: fn(std::result::Result<u8, i32>) -> std::result::Result<<std::result::Result<u8, i32> as std::ops::Try>::Ok, <std::result::Result<u8, i32> as std::ops::Try>::Error> {<std::result::Result<u8, i32> as std::ops::Try>::into_result}, val: Value(Scalar(<ZST>)) }
- }
-
- bb1: {
+ _3 = move _4; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_4); // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
_5 = discriminant(_3); // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
- switchInt(move _5) -> [0_isize: bb2, 1_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
+ switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
}
- bb2: {
- StorageLive(_10); // scope 0 at $DIR/simplify-arm.rs:24:13: 24:15
- _10 = ((_3 as Ok).0: u8); // scope 0 at $DIR/simplify-arm.rs:24:13: 24:15
- _2 = _10; // scope 5 at $DIR/simplify-arm.rs:24:13: 24:15
- StorageDead(_10); // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
+ bb1: {
+- StorageLive(_10); // scope 0 at $DIR/simplify-arm.rs:24:13: 24:15
+- _10 = ((_3 as Ok).0: u8); // scope 0 at $DIR/simplify-arm.rs:24:13: 24:15
+- _2 = _10; // scope 5 at $DIR/simplify-arm.rs:24:13: 24:15
+- StorageDead(_10); // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
++ _0 = move _3; // scope 1 at $DIR/simplify-arm.rs:25:5: 25:10
StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:24:15: 24:16
- StorageLive(_11); // scope 1 at $DIR/simplify-arm.rs:25:8: 25:9
- _11 = _2; // scope 1 at $DIR/simplify-arm.rs:25:8: 25:9
- ((_0 as Ok).0: u8) = move _11; // scope 1 at $DIR/simplify-arm.rs:25:5: 25:10
- discriminant(_0) = 0; // scope 1 at $DIR/simplify-arm.rs:25:5: 25:10
- StorageDead(_11); // scope 1 at $DIR/simplify-arm.rs:25:9: 25:10
+- StorageLive(_11); // scope 1 at $DIR/simplify-arm.rs:25:8: 25:9
+- _11 = _2; // scope 1 at $DIR/simplify-arm.rs:25:8: 25:9
+- ((_0 as Ok).0: u8) = move _11; // scope 1 at $DIR/simplify-arm.rs:25:5: 25:10
+- discriminant(_0) = 0; // scope 1 at $DIR/simplify-arm.rs:25:5: 25:10
+- StorageDead(_11); // scope 1 at $DIR/simplify-arm.rs:25:9: 25:10
StorageDead(_2); // scope 0 at $DIR/simplify-arm.rs:26:1: 26:2
- goto -> bb5; // scope 0 at $DIR/simplify-arm.rs:26:2: 26:2
+ goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:26:2: 26:2
}
- bb3: {
+ bb2: {
unreachable; // scope 0 at $DIR/simplify-arm.rs:24:13: 24:15
}
- bb4: {
- StorageLive(_6); // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
- _6 = ((_3 as Err).0: i32); // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
- StorageLive(_8); // scope 3 at $DIR/simplify-arm.rs:24:14: 24:15
- StorageLive(_9); // scope 3 at $DIR/simplify-arm.rs:24:14: 24:15
- _9 = _6; // scope 3 at $DIR/simplify-arm.rs:24:14: 24:15
- _8 = const <i32 as std::convert::From<i32>>::from(move _9) -> bb6; // scope 3 at $DIR/simplify-arm.rs:24:14: 24:15
- // ty::Const
- // + ty: fn(i32) -> i32 {<i32 as std::convert::From<i32>>::from}
- // + val: Value(Scalar(<ZST>))
- // mir::Constant
- // + span: $DIR/simplify-arm.rs:24:14: 24:15
- // + literal: Const { ty: fn(i32) -> i32 {<i32 as std::convert::From<i32>>::from}, val: Value(Scalar(<ZST>)) }
+ bb3: {
+- StorageLive(_6); // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
+- _6 = ((_3 as Err).0: i32); // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
+- StorageLive(_8); // scope 3 at $DIR/simplify-arm.rs:24:14: 24:15
+- StorageLive(_9); // scope 3 at $DIR/simplify-arm.rs:24:14: 24:15
+- _9 = _6; // scope 3 at $DIR/simplify-arm.rs:24:14: 24:15
+- _8 = move _9; // scope 7 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
+- StorageDead(_9); // scope 3 at $DIR/simplify-arm.rs:24:14: 24:15
+- StorageLive(_12); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
+- _12 = move _8; // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
+- ((_0 as Err).0: i32) = move _12; // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
+- discriminant(_0) = 1; // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
+- StorageDead(_12); // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
+- StorageDead(_8); // scope 3 at $DIR/simplify-arm.rs:24:14: 24:15
+- StorageDead(_6); // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
++ _0 = move _3; // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
+ StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:24:15: 24:16
+ StorageDead(_2); // scope 0 at $DIR/simplify-arm.rs:26:1: 26:2
+ goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
}
- bb5: {
+ bb4: {
return; // scope 0 at $DIR/simplify-arm.rs:26:2: 26:2
}
-
- bb6: {
- StorageDead(_9); // scope 3 at $DIR/simplify-arm.rs:24:14: 24:15
- _0 = const <std::result::Result<u8, i32> as std::ops::Try>::from_error(move _8) -> bb7; // scope 3 at $DIR/simplify-arm.rs:24:14: 24:15
- // ty::Const
- // + ty: fn(<std::result::Result<u8, i32> as std::ops::Try>::Error) -> std::result::Result<u8, i32> {<std::result::Result<u8, i32> as std::ops::Try>::from_error}
- // + val: Value(Scalar(<ZST>))
- // mir::Constant
- // + span: $DIR/simplify-arm.rs:24:13: 24:15
- // + literal: Const { ty: fn(<std::result::Result<u8, i32> as std::ops::Try>::Error) -> std::result::Result<u8, i32> {<std::result::Result<u8, i32> as std::ops::Try>::from_error}, val: Value(Scalar(<ZST>)) }
- }
-
- bb7: {
- StorageDead(_8); // scope 3 at $DIR/simplify-arm.rs:24:14: 24:15
- StorageDead(_6); // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
- StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:24:15: 24:16
- StorageDead(_2); // scope 0 at $DIR/simplify-arm.rs:26:1: 26:2
- goto -> bb5; // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
- }
}
let _10: u8; // in scope 0 at $DIR/simplify-arm.rs:24:13: 24:15
let mut _11: u8; // in scope 0 at $DIR/simplify-arm.rs:25:8: 25:9
scope 1 {
- debug x => _2; // in scope 1 at $DIR/simplify-arm.rs:24:9: 24:10
+ debug x => ((_0 as Ok).0: u8); // in scope 1 at $DIR/simplify-arm.rs:24:9: 24:10
}
scope 2 {
- debug err => _6; // in scope 2 at $DIR/simplify-arm.rs:24:14: 24:15
+ debug err => ((_0 as Err).0: i32); // in scope 2 at $DIR/simplify-arm.rs:24:14: 24:15
scope 3 {
+ scope 7 {
+ debug t => ((_0 as Err).0: i32); // in scope 7 at $SRC_DIR/core/src/convert/mod.rs:LL:COL
+ }
+ scope 8 {
+ debug v => ((_0 as Err).0: i32); // in scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
+ let mut _12: i32; // in scope 8 at $DIR/simplify-arm.rs:24:14: 24:15
+ }
}
}
scope 4 {
- debug val => _10; // in scope 4 at $DIR/simplify-arm.rs:24:13: 24:15
+ debug val => ((_0 as Ok).0: u8); // in scope 4 at $DIR/simplify-arm.rs:24:13: 24:15
scope 5 {
}
}
+ scope 6 {
+ debug self => _4; // in scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
+ }
bb0: {
StorageLive(_2); // scope 0 at $DIR/simplify-arm.rs:24:9: 24:10
StorageLive(_3); // scope 0 at $DIR/simplify-arm.rs:24:13: 24:15
StorageLive(_4); // scope 0 at $DIR/simplify-arm.rs:24:13: 24:14
_4 = _1; // scope 0 at $DIR/simplify-arm.rs:24:13: 24:14
- _3 = const <std::result::Result<u8, i32> as std::ops::Try>::into_result(move _4) -> bb1; // scope 0 at $DIR/simplify-arm.rs:24:13: 24:15
- // ty::Const
- // + ty: fn(std::result::Result<u8, i32>) -> std::result::Result<<std::result::Result<u8, i32> as std::ops::Try>::Ok, <std::result::Result<u8, i32> as std::ops::Try>::Error> {<std::result::Result<u8, i32> as std::ops::Try>::into_result}
- // + val: Value(Scalar(<ZST>))
- // mir::Constant
- // + span: $DIR/simplify-arm.rs:24:13: 24:15
- // + literal: Const { ty: fn(std::result::Result<u8, i32>) -> std::result::Result<<std::result::Result<u8, i32> as std::ops::Try>::Ok, <std::result::Result<u8, i32> as std::ops::Try>::Error> {<std::result::Result<u8, i32> as std::ops::Try>::into_result}, val: Value(Scalar(<ZST>)) }
- }
-
- bb1: {
+ _3 = move _4; // scope 6 at $SRC_DIR/core/src/result.rs:LL:COL
StorageDead(_4); // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
_5 = discriminant(_3); // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
- switchInt(move _5) -> [0_isize: bb2, 1_isize: bb4, otherwise: bb3]; // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
+- switchInt(move _5) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
++ goto -> bb1; // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
}
- bb2: {
- StorageLive(_10); // scope 0 at $DIR/simplify-arm.rs:24:13: 24:15
- _10 = ((_3 as Ok).0: u8); // scope 0 at $DIR/simplify-arm.rs:24:13: 24:15
- _2 = _10; // scope 5 at $DIR/simplify-arm.rs:24:13: 24:15
- StorageDead(_10); // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
+ bb1: {
+ _0 = move _3; // scope 1 at $DIR/simplify-arm.rs:25:5: 25:10
StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:24:15: 24:16
- StorageLive(_11); // scope 1 at $DIR/simplify-arm.rs:25:8: 25:9
- _11 = _2; // scope 1 at $DIR/simplify-arm.rs:25:8: 25:9
- ((_0 as Ok).0: u8) = move _11; // scope 1 at $DIR/simplify-arm.rs:25:5: 25:10
- discriminant(_0) = 0; // scope 1 at $DIR/simplify-arm.rs:25:5: 25:10
- StorageDead(_11); // scope 1 at $DIR/simplify-arm.rs:25:9: 25:10
StorageDead(_2); // scope 0 at $DIR/simplify-arm.rs:26:1: 26:2
- goto -> bb5; // scope 0 at $DIR/simplify-arm.rs:26:2: 26:2
- }
-
- bb3: {
- unreachable; // scope 0 at $DIR/simplify-arm.rs:24:13: 24:15
+- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:26:2: 26:2
++ goto -> bb2; // scope 0 at $DIR/simplify-arm.rs:26:2: 26:2
}
- bb4: {
- StorageLive(_6); // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
- _6 = ((_3 as Err).0: i32); // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
- StorageLive(_8); // scope 3 at $DIR/simplify-arm.rs:24:14: 24:15
- StorageLive(_9); // scope 3 at $DIR/simplify-arm.rs:24:14: 24:15
- _9 = _6; // scope 3 at $DIR/simplify-arm.rs:24:14: 24:15
- _8 = const <i32 as std::convert::From<i32>>::from(move _9) -> bb6; // scope 3 at $DIR/simplify-arm.rs:24:14: 24:15
- // ty::Const
- // + ty: fn(i32) -> i32 {<i32 as std::convert::From<i32>>::from}
- // + val: Value(Scalar(<ZST>))
- // mir::Constant
- // + span: $DIR/simplify-arm.rs:24:14: 24:15
- // + literal: Const { ty: fn(i32) -> i32 {<i32 as std::convert::From<i32>>::from}, val: Value(Scalar(<ZST>)) }
- }
-
- bb5: {
+ bb2: {
+- unreachable; // scope 0 at $DIR/simplify-arm.rs:24:13: 24:15
+- }
+-
+- bb3: {
+- _0 = move _3; // scope 8 at $SRC_DIR/core/src/result.rs:LL:COL
+- StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:24:15: 24:16
+- StorageDead(_2); // scope 0 at $DIR/simplify-arm.rs:26:1: 26:2
+- goto -> bb4; // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
+- }
+-
+- bb4: {
return; // scope 0 at $DIR/simplify-arm.rs:26:2: 26:2
}
-
- bb6: {
- StorageDead(_9); // scope 3 at $DIR/simplify-arm.rs:24:14: 24:15
- _0 = const <std::result::Result<u8, i32> as std::ops::Try>::from_error(move _8) -> bb7; // scope 3 at $DIR/simplify-arm.rs:24:14: 24:15
- // ty::Const
- // + ty: fn(<std::result::Result<u8, i32> as std::ops::Try>::Error) -> std::result::Result<u8, i32> {<std::result::Result<u8, i32> as std::ops::Try>::from_error}
- // + val: Value(Scalar(<ZST>))
- // mir::Constant
- // + span: $DIR/simplify-arm.rs:24:13: 24:15
- // + literal: Const { ty: fn(<std::result::Result<u8, i32> as std::ops::Try>::Error) -> std::result::Result<u8, i32> {<std::result::Result<u8, i32> as std::ops::Try>::from_error}, val: Value(Scalar(<ZST>)) }
- }
-
- bb7: {
- StorageDead(_8); // scope 3 at $DIR/simplify-arm.rs:24:14: 24:15
- StorageDead(_6); // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
- StorageDead(_3); // scope 0 at $DIR/simplify-arm.rs:24:15: 24:16
- StorageDead(_2); // scope 0 at $DIR/simplify-arm.rs:26:1: 26:2
- goto -> bb5; // scope 0 at $DIR/simplify-arm.rs:24:14: 24:15
- }
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/simplify-arm-identity.rs:18:9: 18:10
((_1 as Foo).0: u8) = const 0_u8; // scope 0 at $DIR/simplify-arm-identity.rs:18:18: 18:29
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/simplify-arm-identity.rs:18:27: 18:28
- // + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
discriminant(_1) = 0; // scope 0 at $DIR/simplify-arm-identity.rs:18:18: 18:29
StorageLive(_2); // scope 1 at $DIR/simplify-arm-identity.rs:19:18: 22:6
_3 = const 0_isize; // scope 1 at $DIR/simplify-arm-identity.rs:20:9: 20:20
- // ty::Const
- // + ty: isize
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/simplify-arm-identity.rs:20:9: 20:20
- // + literal: Const { ty: isize, val: Value(Scalar(0x00000000)) }
goto -> bb3; // scope 1 at $DIR/simplify-arm-identity.rs:20:9: 20:20
}
bb1: {
((_2 as Foo).0: u8) = const 0_u8; // scope 1 at $DIR/simplify-arm-identity.rs:21:21: 21:32
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/simplify-arm-identity.rs:21:30: 21:31
- // + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
discriminant(_2) = 0; // scope 1 at $DIR/simplify-arm-identity.rs:21:21: 21:32
goto -> bb4; // scope 1 at $DIR/simplify-arm-identity.rs:19:18: 22:6
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/simplify-arm-identity.rs:18:9: 18:10
((_1 as Foo).0: u8) = const 0_u8; // scope 0 at $DIR/simplify-arm-identity.rs:18:18: 18:29
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/simplify-arm-identity.rs:18:27: 18:28
- // + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
discriminant(_1) = 0; // scope 0 at $DIR/simplify-arm-identity.rs:18:18: 18:29
StorageLive(_2); // scope 1 at $DIR/simplify-arm-identity.rs:19:18: 22:6
_3 = const 0_isize; // scope 1 at $DIR/simplify-arm-identity.rs:20:9: 20:20
- // ty::Const
- // + ty: isize
- // + val: Value(Scalar(0x0000000000000000))
- // mir::Constant
- // + span: $DIR/simplify-arm-identity.rs:20:9: 20:20
- // + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000000)) }
goto -> bb3; // scope 1 at $DIR/simplify-arm-identity.rs:20:9: 20:20
}
bb1: {
((_2 as Foo).0: u8) = const 0_u8; // scope 1 at $DIR/simplify-arm-identity.rs:21:21: 21:32
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/simplify-arm-identity.rs:21:30: 21:31
- // + literal: Const { ty: u8, val: Value(Scalar(0x00)) }
discriminant(_2) = 0; // scope 1 at $DIR/simplify-arm-identity.rs:21:21: 21:32
goto -> bb4; // scope 1 at $DIR/simplify-arm-identity.rs:19:18: 22:6
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/simplify_if.rs:6:8: 6:13
_1 = const false; // scope 0 at $DIR/simplify_if.rs:6:8: 6:13
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/simplify_if.rs:6:8: 6:13
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- switchInt(const false) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6
-- // ty::Const
-- // + ty: bool
-- // + val: Value(Scalar(0x00))
-- // mir::Constant
-- // + span: $DIR/simplify_if.rs:6:5: 8:6
-- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
+ goto -> bb1; // scope 0 at $DIR/simplify_if.rs:6:5: 8:6
}
StorageLive(_8); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13
_8 = _6; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:13
_7 = Gt(move _8, const 42_u8); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:12: 5:20
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x2a))
- // mir::Constant
- // + span: $DIR/simplify-locals-fixedpoint.rs:5:16: 5:20
- // + literal: Const { ty: u8, val: Value(Scalar(0x2a)) }
StorageDead(_8); // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:19: 5:20
switchInt(_7) -> [false: bb4, otherwise: bb5]; // scope 1 at $DIR/simplify-locals-fixedpoint.rs:5:9: 7:10
}
- StorageLive(_10); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:30
- StorageLive(_11); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:28
- (_11.0: u8) = const 40_u8; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:28
-+ StorageDead(_1); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:22: 14:23
-+ StorageLive(_2); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
-+ _2 = const use_u8(const 42_u8) -> bb2; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
- // ty::Const
-- // + ty: u8
-- // + val: Value(Scalar(0x28))
-- // mir::Constant
-- // + span: $DIR/simplify-locals-removes-unused-consts.rs:16:23: 16:25
-- // + literal: Const { ty: u8, val: Value(Scalar(0x28)) }
- _10 = const 40_u8; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:30
-- // ty::Const
-- // + ty: u8
-- // + val: Value(Scalar(0x28))
-- // mir::Constant
-- // + span: $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:30
-- // + literal: Const { ty: u8, val: Value(Scalar(0x28)) }
- _9 = const 42_u8; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:34
-- // ty::Const
-- // + ty: u8
-- // + val: Value(Scalar(0x2a))
-- // mir::Constant
-- // + span: $DIR/simplify-locals-removes-unused-consts.rs:16:12: 16:34
-- // + literal: Const { ty: u8, val: Value(Scalar(0x2a)) }
- StorageDead(_10); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:33: 16:34
- _8 = const use_u8(const 42_u8) -> bb2; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
-- // ty::Const
++ StorageDead(_1); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:14:22: 14:23
++ StorageLive(_2); // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
++ _2 = const use_u8(const 42_u8) -> bb2; // scope 1 at $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
+ // ty::Const
// + ty: fn(u8) {use_u8}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:11
// + literal: Const { ty: fn(u8) {use_u8}, val: Value(Scalar(<ZST>)) }
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x2a))
- // mir::Constant
- // + span: $DIR/simplify-locals-removes-unused-consts.rs:16:5: 16:35
- // + literal: Const { ty: u8, val: Value(Scalar(0x2a)) }
}
bb2: {
fn map(_1: std::option::Option<std::boxed::Box<()>>) -> std::option::Option<std::boxed::Box<()>> {
debug x => _1; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:8: 1:9
let mut _0: std::option::Option<std::boxed::Box<()>>; // return place in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:31: 1:46
- let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
+- let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
- let _3: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15
- let mut _4: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:25: 4:26
- let mut _5: bool; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
bb0: {
- _5 = const false; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
-- // ty::Const
-- // + ty: bool
-- // + val: Value(Scalar(0x00))
-- // mir::Constant
-- // + span: $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
-- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- _5 = const true; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
-- // ty::Const
-- // + ty: bool
-- // + val: Value(Scalar(0x01))
-- // mir::Constant
-- // + span: $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
-- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
- _2 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
- switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
- }
-
- bb1: {
+- _2 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
_0 = move _1; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:20: 4:27
- goto -> bb3; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:2:5: 5:6
- }
-
- bb2: {
- discriminant(_0) = 0; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:17: 3:21
- goto -> bb3; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:2:5: 5:6
- }
-
- bb3: {
- _6 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
return; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:2: 6:2
}
fn map(_1: std::option::Option<std::boxed::Box<()>>) -> std::option::Option<std::boxed::Box<()>> {
debug x => _1; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:8: 1:9
let mut _0: std::option::Option<std::boxed::Box<()>>; // return place in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:1:31: 1:46
- let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
+- let mut _2: isize; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
- let _3: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:14: 4:15
- let mut _4: std::boxed::Box<()>; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:25: 4:26
- let mut _5: bool; // in scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
bb0: {
- _5 = const false; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
-- // ty::Const
-- // + ty: bool
-- // + val: Value(Scalar(0x00))
-- // mir::Constant
-- // + span: $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
-- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- _5 = const true; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
-- // ty::Const
-- // + ty: bool
-- // + val: Value(Scalar(0x01))
-- // mir::Constant
-- // + span: $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
-- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
- _2 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
- switchInt(move _2) -> [0_isize: bb2, otherwise: bb1]; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
- }
-
- bb1: {
+- _2 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:9: 3:13
_0 = move _1; // scope 1 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:4:20: 4:27
- goto -> bb3; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:2:5: 5:6
- }
-
- bb2: {
- discriminant(_0) = 0; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:3:17: 3:21
- goto -> bb3; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:2:5: 5:6
- }
-
- bb3: {
- _6 = discriminant(_1); // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:1: 6:2
return; // scope 0 at $DIR/simplify-locals-removes-unused-discriminant-reads.rs:6:2: 6:2
}
StorageLive(_1); // scope 0 at $DIR/simplify_match.rs:6:11: 6:31
StorageLive(_2); // scope 0 at $DIR/simplify_match.rs:6:17: 6:18
_2 = const false; // scope 0 at $DIR/simplify_match.rs:6:21: 6:26
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x00))
- // mir::Constant
- // + span: $DIR/simplify_match.rs:6:21: 6:26
- // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
- _1 = _2; // scope 1 at $DIR/simplify_match.rs:6:28: 6:29
+ _1 = const false; // scope 1 at $DIR/simplify_match.rs:6:28: 6:29
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
-+ // mir::Constant
-+ // + span: $DIR/simplify_match.rs:6:28: 6:29
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
StorageDead(_2); // scope 0 at $DIR/simplify_match.rs:6:30: 6:31
- switchInt(_1) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:7:9: 7:13
+ switchInt(const false) -> [false: bb1, otherwise: bb2]; // scope 0 at $DIR/simplify_match.rs:7:9: 7:13
-+ // ty::Const
-+ // + ty: bool
-+ // + val: Value(Scalar(0x00))
-+ // mir::Constant
-+ // + span: $DIR/simplify_match.rs:7:9: 7:13
-+ // + literal: Const { ty: bool, val: Value(Scalar(0x00)) }
}
bb1: {
bb3 (cleanup): {
_5 = &raw mut (*_1)[_4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
_4 = Add(move _4, const 1_usize); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
drop((*_5)) -> bb4; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
}
bb5: {
_7 = &raw mut (*_1)[_4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
_4 = Add(move _4, const 1_usize); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
drop((*_7)) -> [return: bb6, unwind: bb4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
}
bb7: {
_4 = const 0_usize; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
goto -> bb6; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
}
bb9 (cleanup): {
_11 = _9; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
_9 = Offset(move _9, const 1_usize); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
drop((*_11)) -> bb10; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
}
bb11: {
_13 = _9; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
_9 = Offset(move _9, const 1_usize); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
drop((*_13)) -> [return: bb12, unwind: bb10]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
}
bb3 (cleanup): {
_5 = &raw mut (*_1)[_4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
_4 = Add(move _4, const 1_usize); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000001))
- // mir::Constant
- // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
drop((*_5)) -> bb4; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
}
bb5: {
_7 = &raw mut (*_1)[_4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
_4 = Add(move _4, const 1_usize); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000001))
- // mir::Constant
- // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
drop((*_7)) -> [return: bb6, unwind: bb4]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
}
bb7: {
_4 = const 0_usize; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000000))
- // mir::Constant
- // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000000)) }
goto -> bb6; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
}
bb9 (cleanup): {
_11 = _9; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
_9 = Offset(move _9, const 1_usize); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000001))
- // mir::Constant
- // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
drop((*_11)) -> bb10; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
}
bb11: {
_13 = _9; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
_9 = Offset(move _9, const 1_usize); // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // ty::Const
- // + ty: usize
- // + val: Value(Scalar(0x0000000000000001))
- // mir::Constant
- // + span: $SRC_DIR/core/src/ptr/mod.rs:LL:COL
- // + literal: Const { ty: usize, val: Value(Scalar(0x0000000000000001)) }
drop((*_13)) -> [return: bb12, unwind: bb10]; // scope 0 at $SRC_DIR/core/src/ptr/mod.rs:LL:COL
}
StorageLive(_6); // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:12: 22:6
StorageLive(_7); // scope 0 at $DIR/storage_live_dead_in_statics.rs:8:9: 8:15
_7 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:8:9: 8:15
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:8:10: 8:11
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:8:13: 8:14
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
StorageLive(_8); // scope 0 at $DIR/storage_live_dead_in_statics.rs:8:17: 8:23
_8 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:8:17: 8:23
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:8:18: 8:19
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:8:21: 8:22
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageLive(_9); // scope 0 at $DIR/storage_live_dead_in_statics.rs:8:25: 8:31
_9 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:8:25: 8:31
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:8:26: 8:27
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:8:29: 8:30
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
StorageLive(_10); // scope 0 at $DIR/storage_live_dead_in_statics.rs:9:9: 9:15
_10 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:9:9: 9:15
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:9:10: 9:11
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:9:13: 9:14
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
StorageLive(_11); // scope 0 at $DIR/storage_live_dead_in_statics.rs:9:17: 9:23
_11 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:9:17: 9:23
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:9:18: 9:19
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:9:21: 9:22
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageLive(_12); // scope 0 at $DIR/storage_live_dead_in_statics.rs:9:25: 9:31
_12 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:9:25: 9:31
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:9:26: 9:27
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:9:29: 9:30
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
StorageLive(_13); // scope 0 at $DIR/storage_live_dead_in_statics.rs:10:9: 10:15
_13 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:10:9: 10:15
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:10:10: 10:11
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:10:13: 10:14
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
StorageLive(_14); // scope 0 at $DIR/storage_live_dead_in_statics.rs:10:17: 10:23
_14 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:10:17: 10:23
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:10:18: 10:19
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:10:21: 10:22
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageLive(_15); // scope 0 at $DIR/storage_live_dead_in_statics.rs:10:25: 10:31
_15 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:10:25: 10:31
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:10:26: 10:27
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:10:29: 10:30
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
StorageLive(_16); // scope 0 at $DIR/storage_live_dead_in_statics.rs:11:9: 11:15
_16 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:11:9: 11:15
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:11:10: 11:11
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:11:13: 11:14
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
StorageLive(_17); // scope 0 at $DIR/storage_live_dead_in_statics.rs:11:17: 11:23
_17 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:11:17: 11:23
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:11:18: 11:19
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:11:21: 11:22
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageLive(_18); // scope 0 at $DIR/storage_live_dead_in_statics.rs:11:25: 11:31
_18 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:11:25: 11:31
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:11:26: 11:27
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:11:29: 11:30
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
StorageLive(_19); // scope 0 at $DIR/storage_live_dead_in_statics.rs:12:9: 12:15
_19 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:12:9: 12:15
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:12:10: 12:11
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:12:13: 12:14
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
StorageLive(_20); // scope 0 at $DIR/storage_live_dead_in_statics.rs:12:17: 12:23
_20 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:12:17: 12:23
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:12:18: 12:19
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:12:21: 12:22
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageLive(_21); // scope 0 at $DIR/storage_live_dead_in_statics.rs:12:25: 12:31
_21 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:12:25: 12:31
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:12:26: 12:27
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:12:29: 12:30
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
StorageLive(_22); // scope 0 at $DIR/storage_live_dead_in_statics.rs:13:9: 13:15
_22 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:13:9: 13:15
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:13:10: 13:11
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:13:13: 13:14
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
StorageLive(_23); // scope 0 at $DIR/storage_live_dead_in_statics.rs:13:17: 13:23
_23 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:13:17: 13:23
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:13:18: 13:19
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:13:21: 13:22
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageLive(_24); // scope 0 at $DIR/storage_live_dead_in_statics.rs:13:25: 13:31
_24 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:13:25: 13:31
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:13:26: 13:27
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:13:29: 13:30
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
StorageLive(_25); // scope 0 at $DIR/storage_live_dead_in_statics.rs:14:9: 14:15
_25 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:14:9: 14:15
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:14:10: 14:11
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:14:13: 14:14
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
StorageLive(_26); // scope 0 at $DIR/storage_live_dead_in_statics.rs:14:17: 14:23
_26 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:14:17: 14:23
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:14:18: 14:19
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:14:21: 14:22
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageLive(_27); // scope 0 at $DIR/storage_live_dead_in_statics.rs:14:25: 14:31
_27 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:14:25: 14:31
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:14:26: 14:27
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:14:29: 14:30
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
StorageLive(_28); // scope 0 at $DIR/storage_live_dead_in_statics.rs:15:9: 15:15
_28 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:15:9: 15:15
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:15:10: 15:11
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:15:13: 15:14
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
StorageLive(_29); // scope 0 at $DIR/storage_live_dead_in_statics.rs:15:17: 15:23
_29 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:15:17: 15:23
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:15:18: 15:19
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:15:21: 15:22
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageLive(_30); // scope 0 at $DIR/storage_live_dead_in_statics.rs:15:25: 15:31
_30 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:15:25: 15:31
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:15:26: 15:27
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:15:29: 15:30
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
StorageLive(_31); // scope 0 at $DIR/storage_live_dead_in_statics.rs:16:9: 16:15
_31 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:16:9: 16:15
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:16:10: 16:11
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:16:13: 16:14
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
StorageLive(_32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:16:17: 16:23
_32 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:16:17: 16:23
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:16:18: 16:19
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:16:21: 16:22
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageLive(_33); // scope 0 at $DIR/storage_live_dead_in_statics.rs:16:25: 16:31
_33 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:16:25: 16:31
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:16:26: 16:27
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:16:29: 16:30
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
StorageLive(_34); // scope 0 at $DIR/storage_live_dead_in_statics.rs:17:9: 17:15
_34 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:17:9: 17:15
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:17:10: 17:11
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:17:13: 17:14
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
StorageLive(_35); // scope 0 at $DIR/storage_live_dead_in_statics.rs:17:17: 17:23
_35 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:17:17: 17:23
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:17:18: 17:19
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:17:21: 17:22
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageLive(_36); // scope 0 at $DIR/storage_live_dead_in_statics.rs:17:25: 17:31
_36 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:17:25: 17:31
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:17:26: 17:27
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:17:29: 17:30
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
StorageLive(_37); // scope 0 at $DIR/storage_live_dead_in_statics.rs:18:9: 18:15
_37 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:18:9: 18:15
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:18:10: 18:11
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:18:13: 18:14
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
StorageLive(_38); // scope 0 at $DIR/storage_live_dead_in_statics.rs:18:17: 18:23
_38 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:18:17: 18:23
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:18:18: 18:19
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:18:21: 18:22
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageLive(_39); // scope 0 at $DIR/storage_live_dead_in_statics.rs:18:25: 18:31
_39 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:18:25: 18:31
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:18:26: 18:27
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:18:29: 18:30
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
StorageLive(_40); // scope 0 at $DIR/storage_live_dead_in_statics.rs:19:9: 19:15
_40 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:19:9: 19:15
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:19:10: 19:11
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:19:13: 19:14
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
StorageLive(_41); // scope 0 at $DIR/storage_live_dead_in_statics.rs:19:17: 19:23
_41 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:19:17: 19:23
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:19:18: 19:19
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:19:21: 19:22
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageLive(_42); // scope 0 at $DIR/storage_live_dead_in_statics.rs:19:25: 19:31
_42 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:19:25: 19:31
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:19:26: 19:27
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:19:29: 19:30
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
StorageLive(_43); // scope 0 at $DIR/storage_live_dead_in_statics.rs:20:9: 20:15
_43 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:20:9: 20:15
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:20:10: 20:11
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:20:13: 20:14
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
StorageLive(_44); // scope 0 at $DIR/storage_live_dead_in_statics.rs:20:17: 20:23
_44 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:20:17: 20:23
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:20:18: 20:19
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:20:21: 20:22
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageLive(_45); // scope 0 at $DIR/storage_live_dead_in_statics.rs:20:25: 20:31
_45 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:20:25: 20:31
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:20:26: 20:27
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:20:29: 20:30
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
StorageLive(_46); // scope 0 at $DIR/storage_live_dead_in_statics.rs:21:9: 21:15
_46 = (const 0_u32, const 1_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:21:9: 21:15
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:21:10: 21:11
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:21:13: 21:14
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000001)) }
StorageLive(_47); // scope 0 at $DIR/storage_live_dead_in_statics.rs:21:17: 21:23
_47 = (const 0_u32, const 2_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:21:17: 21:23
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:21:18: 21:19
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:21:21: 21:22
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000002)) }
StorageLive(_48); // scope 0 at $DIR/storage_live_dead_in_statics.rs:21:25: 21:31
_48 = (const 0_u32, const 3_u32); // scope 0 at $DIR/storage_live_dead_in_statics.rs:21:25: 21:31
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:21:26: 21:27
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000000)) }
- // ty::Const
- // + ty: u32
- // + val: Value(Scalar(0x00000003))
- // mir::Constant
- // + span: $DIR/storage_live_dead_in_statics.rs:21:29: 21:30
- // + literal: Const { ty: u32, val: Value(Scalar(0x00000003)) }
_6 = [move _7, move _8, move _9, move _10, move _11, move _12, move _13, move _14, move _15, move _16, move _17, move _18, move _19, move _20, move _21, move _22, move _23, move _24, move _25, move _26, move _27, move _28, move _29, move _30, move _31, move _32, move _33, move _34, move _35, move _36, move _37, move _38, move _39, move _40, move _41, move _42, move _43, move _44, move _45, move _46, move _47, move _48]; // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:12: 22:6
_5 = &_6; // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
_4 = &(*_5); // scope 0 at $DIR/storage_live_dead_in_statics.rs:7:11: 22:6
bb0: {
StorageLive(_1); // scope 0 at $DIR/storage_ranges.rs:4:9: 4:10
_1 = const 0_i32; // scope 0 at $DIR/storage_ranges.rs:4:13: 4:14
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/storage_ranges.rs:4:13: 4:14
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
FakeRead(ForLet, _1); // scope 0 at $DIR/storage_ranges.rs:4:9: 4:10
StorageLive(_2); // scope 1 at $DIR/storage_ranges.rs:5:5: 7:6
StorageLive(_3); // scope 1 at $DIR/storage_ranges.rs:6:13: 6:14
StorageDead(_2); // scope 1 at $DIR/storage_ranges.rs:7:5: 7:6
StorageLive(_6); // scope 1 at $DIR/storage_ranges.rs:8:9: 8:10
_6 = const 1_i32; // scope 1 at $DIR/storage_ranges.rs:8:13: 8:14
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/storage_ranges.rs:8:13: 8:14
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
FakeRead(ForLet, _6); // scope 1 at $DIR/storage_ranges.rs:8:9: 8:10
_0 = const (); // scope 0 at $DIR/storage_ranges.rs:3:11: 9:2
// ty::Const
StorageLive(_3); // scope 2 at $DIR/tls-access.rs:9:9: 9:12
_3 = &/*tls*/ mut FOO; // scope 2 at $DIR/tls-access.rs:9:9: 9:12
(*_3) = const 42_u8; // scope 2 at $DIR/tls-access.rs:9:9: 9:17
- // ty::Const
- // + ty: u8
- // + val: Value(Scalar(0x2a))
- // mir::Constant
- // + span: $DIR/tls-access.rs:9:15: 9:17
- // + literal: Const { ty: u8, val: Value(Scalar(0x2a)) }
StorageDead(_3); // scope 2 at $DIR/tls-access.rs:9:17: 9:18
_0 = const (); // scope 1 at $DIR/tls-access.rs:7:5: 10:6
// ty::Const
StorageLive(_3); // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
_3 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
(*_3) = const 1_i32; // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/uniform_array_move_out.rs:11:18: 11:19
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
_2 = move _3; // scope 0 at $DIR/uniform_array_move_out.rs:11:14: 11:19
drop(_3) -> [return: bb4, unwind: bb2]; // scope 0 at $DIR/uniform_array_move_out.rs:11:18: 11:19
}
StorageLive(_5); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
_5 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
(*_5) = const 2_i32; // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/uniform_array_move_out.rs:11:25: 11:26
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
_4 = move _5; // scope 0 at $DIR/uniform_array_move_out.rs:11:21: 11:26
drop(_5) -> [return: bb7, unwind: bb5]; // scope 0 at $DIR/uniform_array_move_out.rs:11:25: 11:26
}
StorageLive(_3); // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
_3 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
(*_3) = const 1_i32; // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/uniform_array_move_out.rs:5:18: 5:19
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
_2 = move _3; // scope 0 at $DIR/uniform_array_move_out.rs:5:14: 5:19
drop(_3) -> [return: bb4, unwind: bb2]; // scope 0 at $DIR/uniform_array_move_out.rs:5:18: 5:19
}
StorageLive(_5); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
_5 = Box(i32); // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
(*_5) = const 2_i32; // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/uniform_array_move_out.rs:5:25: 5:26
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
_4 = move _5; // scope 0 at $DIR/uniform_array_move_out.rs:5:21: 5:26
drop(_5) -> [return: bb7, unwind: bb5]; // scope 0 at $DIR/uniform_array_move_out.rs:5:25: 5:26
}
- StorageLive(_5); // scope 2 at $DIR/unreachable.rs:12:9: 16:10
- StorageLive(_6); // scope 2 at $DIR/unreachable.rs:12:12: 12:16
- _6 = const true; // scope 2 at $DIR/unreachable.rs:12:12: 12:16
-- // ty::Const
-- // + ty: bool
-- // + val: Value(Scalar(0x01))
-- // mir::Constant
-- // + span: $DIR/unreachable.rs:12:12: 12:16
-- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
- switchInt(_6) -> [false: bb4, otherwise: bb5]; // scope 2 at $DIR/unreachable.rs:12:9: 16:10
- }
-
- bb4: {
- _4 = const 42_i32; // scope 2 at $DIR/unreachable.rs:15:13: 15:20
-- // ty::Const
-- // + ty: i32
-- // + val: Value(Scalar(0x0000002a))
-- // mir::Constant
-- // + span: $DIR/unreachable.rs:15:18: 15:20
-- // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
- _5 = const (); // scope 2 at $DIR/unreachable.rs:14:16: 16:10
- // ty::Const
- // + ty: ()
-
- bb5: {
- _4 = const 21_i32; // scope 2 at $DIR/unreachable.rs:13:13: 13:20
-- // ty::Const
-- // + ty: i32
-- // + val: Value(Scalar(0x00000015))
-- // mir::Constant
-- // + span: $DIR/unreachable.rs:13:18: 13:20
-- // + literal: Const { ty: i32, val: Value(Scalar(0x00000015)) }
- _5 = const (); // scope 2 at $DIR/unreachable.rs:12:17: 14:10
- // ty::Const
- // + ty: ()
StorageLive(_5); // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
StorageLive(_6); // scope 2 at $DIR/unreachable_asm.rs:14:12: 14:16
_6 = const true; // scope 2 at $DIR/unreachable_asm.rs:14:12: 14:16
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/unreachable_asm.rs:14:12: 14:16
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
switchInt(_6) -> [false: bb4, otherwise: bb5]; // scope 2 at $DIR/unreachable_asm.rs:14:9: 18:10
}
bb4: {
_4 = const 42_i32; // scope 2 at $DIR/unreachable_asm.rs:17:13: 17:20
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/unreachable_asm.rs:17:18: 17:20
- // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
_5 = const (); // scope 2 at $DIR/unreachable_asm.rs:16:16: 18:10
// ty::Const
// + ty: ()
bb5: {
_4 = const 21_i32; // scope 2 at $DIR/unreachable_asm.rs:15:13: 15:20
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000015))
- // mir::Constant
- // + span: $DIR/unreachable_asm.rs:15:18: 15:20
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000015)) }
_5 = const (); // scope 2 at $DIR/unreachable_asm.rs:14:17: 16:10
// ty::Const
// + ty: ()
StorageLive(_5); // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
StorageLive(_6); // scope 2 at $DIR/unreachable_asm_2.rs:14:12: 14:16
_6 = const true; // scope 2 at $DIR/unreachable_asm_2.rs:14:12: 14:16
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/unreachable_asm_2.rs:14:12: 14:16
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
switchInt(_6) -> [false: bb4, otherwise: bb5]; // scope 2 at $DIR/unreachable_asm_2.rs:14:9: 22:10
}
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
StorageDead(_8); // scope 2 at $DIR/unreachable_asm_2.rs:20:40: 20:41
_4 = const 42_i32; // scope 2 at $DIR/unreachable_asm_2.rs:21:13: 21:20
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x0000002a))
- // mir::Constant
- // + span: $DIR/unreachable_asm_2.rs:21:18: 21:20
- // + literal: Const { ty: i32, val: Value(Scalar(0x0000002a)) }
_5 = const (); // scope 2 at $DIR/unreachable_asm_2.rs:18:16: 22:10
// ty::Const
// + ty: ()
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
StorageDead(_7); // scope 2 at $DIR/unreachable_asm_2.rs:16:40: 16:41
_4 = const 21_i32; // scope 2 at $DIR/unreachable_asm_2.rs:17:13: 17:20
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000015))
- // mir::Constant
- // + span: $DIR/unreachable_asm_2.rs:17:18: 17:20
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000015)) }
_5 = const (); // scope 2 at $DIR/unreachable_asm_2.rs:14:17: 18:10
// ty::Const
// + ty: ()
bb0: {
StorageLive(_1); // scope 0 at $DIR/unreachable_diverging.rs:13:9: 13:10
_1 = const true; // scope 0 at $DIR/unreachable_diverging.rs:13:13: 13:17
- // ty::Const
- // + ty: bool
- // + val: Value(Scalar(0x01))
- // mir::Constant
- // + span: $DIR/unreachable_diverging.rs:13:13: 13:17
- // + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
StorageLive(_2); // scope 1 at $DIR/unreachable_diverging.rs:14:25: 14:32
_2 = const empty() -> bb1; // scope 1 at $DIR/unreachable_diverging.rs:14:25: 14:32
// ty::Const
bb0: {
_0 = const 5_isize; // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
- // ty::Const
- // + ty: isize
- // + val: Value(Scalar(0x00000005))
- // mir::Constant
- // + span: $DIR/unusual-item-types.rs:22:9: 22:10
- // + literal: Const { ty: isize, val: Value(Scalar(0x00000005)) }
return; // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
}
bb0: {
_0 = const 5_isize; // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
- // ty::Const
- // + ty: isize
- // + val: Value(Scalar(0x0000000000000005))
- // mir::Constant
- // + span: $DIR/unusual-item-types.rs:22:9: 22:10
- // + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000005)) }
return; // scope 0 at $DIR/unusual-item-types.rs:22:9: 22:10
}
bb0: {
_0 = const 2_i32; // scope 0 at $DIR/unusual-item-types.rs:10:38: 10:39
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/unusual-item-types.rs:10:38: 10:39
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
return; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
}
bb0: {
_0 = const 2_i32; // scope 0 at $DIR/unusual-item-types.rs:10:38: 10:39
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000002))
- // mir::Constant
- // + span: $DIR/unusual-item-types.rs:10:38: 10:39
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000002)) }
return; // scope 0 at $DIR/unusual-item-types.rs:10:5: 10:40
}
bb0: {
StorageLive(_1); // scope 0 at $DIR/while_let_loops.rs:6:9: 6:15
_1 = const 0_i32; // scope 0 at $DIR/while_let_loops.rs:6:18: 6:19
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/while_let_loops.rs:6:18: 6:19
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
StorageLive(_3); // scope 1 at $DIR/while_let_loops.rs:7:28: 7:32
discriminant(_3) = 0; // scope 1 at $DIR/while_let_loops.rs:7:28: 7:32
- _4 = discriminant(_3); // scope 1 at $DIR/while_let_loops.rs:7:15: 7:25
- switchInt(move _4) -> [1_isize: bb2, otherwise: bb1]; // scope 1 at $DIR/while_let_loops.rs:7:15: 7:25
+ _4 = const 0_isize; // scope 1 at $DIR/while_let_loops.rs:7:15: 7:25
-+ // ty::Const
-+ // + ty: isize
-+ // + val: Value(Scalar(0x00000000))
-+ // mir::Constant
-+ // + span: $DIR/while_let_loops.rs:7:15: 7:25
-+ // + literal: Const { ty: isize, val: Value(Scalar(0x00000000)) }
+ switchInt(const 0_isize) -> [1_isize: bb2, otherwise: bb1]; // scope 1 at $DIR/while_let_loops.rs:7:15: 7:25
-+ // ty::Const
-+ // + ty: isize
-+ // + val: Value(Scalar(0x00000000))
-+ // mir::Constant
-+ // + span: $DIR/while_let_loops.rs:7:15: 7:25
-+ // + literal: Const { ty: isize, val: Value(Scalar(0x00000000)) }
}
bb1: {
bb3: {
_1 = const 1_i32; // scope 1 at $DIR/while_let_loops.rs:8:9: 8:15
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/while_let_loops.rs:8:14: 8:15
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
_0 = const (); // scope 1 at $DIR/while_let_loops.rs:9:9: 9:14
// ty::Const
// + ty: ()
bb0: {
StorageLive(_1); // scope 0 at $DIR/while_let_loops.rs:6:9: 6:15
_1 = const 0_i32; // scope 0 at $DIR/while_let_loops.rs:6:18: 6:19
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/while_let_loops.rs:6:18: 6:19
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
StorageLive(_3); // scope 1 at $DIR/while_let_loops.rs:7:28: 7:32
discriminant(_3) = 0; // scope 1 at $DIR/while_let_loops.rs:7:28: 7:32
- _4 = discriminant(_3); // scope 1 at $DIR/while_let_loops.rs:7:15: 7:25
- switchInt(move _4) -> [1_isize: bb2, otherwise: bb1]; // scope 1 at $DIR/while_let_loops.rs:7:15: 7:25
+ _4 = const 0_isize; // scope 1 at $DIR/while_let_loops.rs:7:15: 7:25
-+ // ty::Const
-+ // + ty: isize
-+ // + val: Value(Scalar(0x0000000000000000))
-+ // mir::Constant
-+ // + span: $DIR/while_let_loops.rs:7:15: 7:25
-+ // + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000000)) }
+ switchInt(const 0_isize) -> [1_isize: bb2, otherwise: bb1]; // scope 1 at $DIR/while_let_loops.rs:7:15: 7:25
-+ // ty::Const
-+ // + ty: isize
-+ // + val: Value(Scalar(0x0000000000000000))
-+ // mir::Constant
-+ // + span: $DIR/while_let_loops.rs:7:15: 7:25
-+ // + literal: Const { ty: isize, val: Value(Scalar(0x0000000000000000)) }
}
bb1: {
bb3: {
_1 = const 1_i32; // scope 1 at $DIR/while_let_loops.rs:8:9: 8:15
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000001))
- // mir::Constant
- // + span: $DIR/while_let_loops.rs:8:14: 8:15
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000001)) }
_0 = const (); // scope 1 at $DIR/while_let_loops.rs:9:9: 9:14
// ty::Const
// + ty: ()
bb0: {
StorageLive(_1); // scope 0 at $DIR/while_let_loops.rs:6:9: 6:15
_1 = const 0_i32; // scope 0 at $DIR/while_let_loops.rs:6:18: 6:19
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/while_let_loops.rs:6:18: 6:19
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
StorageLive(_2); // scope 1 at $DIR/while_let_loops.rs:7:28: 7:32
discriminant(_2) = 0; // scope 1 at $DIR/while_let_loops.rs:7:28: 7:32
_0 = const (); // scope 1 at $DIR/while_let_loops.rs:7:5: 10:6
bb0: {
StorageLive(_1); // scope 0 at $DIR/while_let_loops.rs:6:9: 6:15
_1 = const 0_i32; // scope 0 at $DIR/while_let_loops.rs:6:18: 6:19
- // ty::Const
- // + ty: i32
- // + val: Value(Scalar(0x00000000))
- // mir::Constant
- // + span: $DIR/while_let_loops.rs:6:18: 6:19
- // + literal: Const { ty: i32, val: Value(Scalar(0x00000000)) }
StorageLive(_2); // scope 1 at $DIR/while_let_loops.rs:7:28: 7:32
discriminant(_2) = 0; // scope 1 at $DIR/while_let_loops.rs:7:28: 7:32
_0 = const (); // scope 1 at $DIR/while_let_loops.rs:7:5: 10:6
-+-------------------------------------+------------+------------+------------+
-| File | Documented | Total | Percentage |
-+-------------------------------------+------------+------------+------------+
-| ...est/rustdoc-ui/coverage/basic.rs | 7 | 14 | 50.0% |
-+-------------------------------------+------------+------------+------------+
-| Total | 7 | 14 | 50.0% |
-+-------------------------------------+------------+------------+------------+
++-------------------------------------+------------+------------+------------+------------+------------+
+| File | Documented | Total | Percentage | Examples | Percentage |
++-------------------------------------+------------+------------+------------+------------+------------+
+| ...est/rustdoc-ui/coverage/basic.rs | 7 | 14 | 50.0% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
+| Total | 7 | 14 | 50.0% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
--- /dev/null
+// compile-flags:-Z unstable-options --show-coverage
+// check-pass
+
+//! This test ensure that only rust code examples are counted.
+
+/// Doc
+///
+/// ```
+/// let x = 2;
+/// ```
+pub struct Foo;
+
+/// Doc
+///
+/// ```text
+/// yolo
+/// ```
+pub trait Bar {}
+
+/// Doc
+///
+/// ```ignore (just for the sake of this test)
+/// let x = 2;
+/// ```
+pub fn foo<T: Bar, D: ::std::fmt::Debug>(a: Foo, b: u32, c: T, d: D) -> u32 {
+ 0
+}
--- /dev/null
++-------------------------------------+------------+------------+------------+------------+------------+
+| File | Documented | Total | Percentage | Examples | Percentage |
++-------------------------------------+------------+------------+------------+------------+------------+
+| ...tdoc-ui/coverage/doc-examples.rs | 4 | 4 | 100.0% | 2 | 50.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
+| Total | 4 | 4 | 100.0% | 2 | 50.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
-+-------------------------------------+------------+------------+------------+
-| File | Documented | Total | Percentage |
-+-------------------------------------+------------+------------+------------+
-| ...est/rustdoc-ui/coverage/empty.rs | 0 | 1 | 0.0% |
-+-------------------------------------+------------+------------+------------+
-| Total | 0 | 1 | 0.0% |
-+-------------------------------------+------------+------------+------------+
++-------------------------------------+------------+------------+------------+------------+------------+
+| File | Documented | Total | Percentage | Examples | Percentage |
++-------------------------------------+------------+------------+------------+------------+------------+
+| ...est/rustdoc-ui/coverage/empty.rs | 0 | 1 | 0.0% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
+| Total | 0 | 1 | 0.0% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
-+-------------------------------------+------------+------------+------------+
-| File | Documented | Total | Percentage |
-+-------------------------------------+------------+------------+------------+
-| ...est/rustdoc-ui/coverage/enums.rs | 6 | 8 | 75.0% |
-+-------------------------------------+------------+------------+------------+
-| Total | 6 | 8 | 75.0% |
-+-------------------------------------+------------+------------+------------+
++-------------------------------------+------------+------------+------------+------------+------------+
+| File | Documented | Total | Percentage | Examples | Percentage |
++-------------------------------------+------------+------------+------------+------------+------------+
+| ...est/rustdoc-ui/coverage/enums.rs | 6 | 8 | 75.0% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
+| Total | 6 | 8 | 75.0% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
-+-------------------------------------+------------+------------+------------+
-| File | Documented | Total | Percentage |
-+-------------------------------------+------------+------------+------------+
-| ...st/rustdoc-ui/coverage/exotic.rs | 1 | 1 | 100.0% |
-| <anon> | 2 | 2 | 100.0% |
-+-------------------------------------+------------+------------+------------+
-| Total | 3 | 3 | 100.0% |
-+-------------------------------------+------------+------------+------------+
++-------------------------------------+------------+------------+------------+------------+------------+
+| File | Documented | Total | Percentage | Examples | Percentage |
++-------------------------------------+------------+------------+------------+------------+------------+
+| ...st/rustdoc-ui/coverage/exotic.rs | 1 | 1 | 100.0% | 0 | 0.0% |
+| <anon> | 2 | 2 | 100.0% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
+| Total | 3 | 3 | 100.0% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
-{"$DIR/json.rs":{"total":13,"with_docs":7}}
+{"$DIR/json.rs":{"total":13,"with_docs":7,"with_examples":0}}
-+-------------------------------------+------------+------------+------------+
-| File | Documented | Total | Percentage |
-+-------------------------------------+------------+------------+------------+
-| ...t/rustdoc-ui/coverage/private.rs | 4 | 7 | 57.1% |
-+-------------------------------------+------------+------------+------------+
-| Total | 4 | 7 | 57.1% |
-+-------------------------------------+------------+------------+------------+
++-------------------------------------+------------+------------+------------+------------+------------+
+| File | Documented | Total | Percentage | Examples | Percentage |
++-------------------------------------+------------+------------+------------+------------+------------+
+| ...t/rustdoc-ui/coverage/private.rs | 4 | 7 | 57.1% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
+| Total | 4 | 7 | 57.1% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
-+-------------------------------------+------------+------------+------------+
-| File | Documented | Total | Percentage |
-+-------------------------------------+------------+------------+------------+
-| ...oc-ui/coverage/statics-consts.rs | 6 | 7 | 85.7% |
-+-------------------------------------+------------+------------+------------+
-| Total | 6 | 7 | 85.7% |
-+-------------------------------------+------------+------------+------------+
++-------------------------------------+------------+------------+------------+------------+------------+
+| File | Documented | Total | Percentage | Examples | Percentage |
++-------------------------------------+------------+------------+------------+------------+------------+
+| ...oc-ui/coverage/statics-consts.rs | 6 | 7 | 85.7% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
+| Total | 6 | 7 | 85.7% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
-+-------------------------------------+------------+------------+------------+
-| File | Documented | Total | Percentage |
-+-------------------------------------+------------+------------+------------+
-| ...st/rustdoc-ui/coverage/traits.rs | 6 | 7 | 85.7% |
-+-------------------------------------+------------+------------+------------+
-| Total | 6 | 7 | 85.7% |
-+-------------------------------------+------------+------------+------------+
++-------------------------------------+------------+------------+------------+------------+------------+
+| File | Documented | Total | Percentage | Examples | Percentage |
++-------------------------------------+------------+------------+------------+------------+------------+
+| ...st/rustdoc-ui/coverage/traits.rs | 6 | 7 | 85.7% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
+| Total | 6 | 7 | 85.7% | 0 | 0.0% |
++-------------------------------------+------------+------------+------------+------------+------------+
--- /dev/null
+#![deny(broken_intra_doc_links)]
+#![crate_name = "foo"]
+
+// ignore-tidy-linelength
+
+// @has foo/index.html
+// @has - '//*[@id="main"]//a[@href="https://doc.rust-lang.org/nightly/std/primitive.bool.html"]' 'true'
+// @has - '//*[@id="main"]//a[@href="https://doc.rust-lang.org/nightly/std/primitive.bool.html"]' 'false'
+
+//! A `bool` is either [`true`] or [`false`].
use rustc_driver::plugin::Registry;
use rustc_lint::{EarlyContext, EarlyLintPass, LintArray, LintContext, LintPass};
-use rustc_ast::ast;
+use rustc_ast as ast;
declare_lint!(TEST_LINT, Warn, "Warn about items named 'lintme'");
declare_lint_pass!(Pass => [TEST_LINT]);
use rustc_driver::plugin::Registry;
use rustc_lint::{EarlyContext, EarlyLintPass, LintArray, LintContext, LintId, LintPass};
-use rustc_ast::ast;
+use rustc_ast as ast;
declare_tool_lint!(pub clippy::TEST_LINT, Warn, "Warn about stuff");
declare_tool_lint!(
/// Some docs
use rustc_span::source_map::{Spanned, DUMMY_SP, FileName};
use rustc_span::source_map::FilePathMapping;
use rustc_span::symbol::Ident;
-use rustc_ast::ast::*;
+use rustc_ast::*;
use rustc_ast::mut_visit::{self, MutVisitor, visit_clobber};
use rustc_ast::ptr::P;
--- /dev/null
+// check-pass
+#![feature(const_raw_ptr_deref)]
+#![feature(raw_ref_macros)]
+
+use std::ptr;
+
+const fn test_fn(x: *const i32) {
+ let x2 = unsafe { ptr::raw_const!(*x) };
+}
+
+fn main() {}
-const fn bad_const_fn_deref_raw(x: *mut usize) -> &'static usize { unsafe { &*x } } //~ is unsafe
+const fn bad_const_fn_deref_raw(x: *mut usize) -> &'static usize { unsafe { &*x } }
//~^ dereferencing raw pointers in constant functions
const unsafe fn bad_const_unsafe_deref_raw(x: *mut usize) -> usize { *x }
= note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
= help: add `#![feature(const_fn)]` to the crate attributes to enable
-error[E0133]: dereference of raw pointer is unsafe and requires unsafe function or block
- --> $DIR/min_const_fn_unsafe_bad.rs:1:77
- |
-LL | const fn bad_const_fn_deref_raw(x: *mut usize) -> &'static usize { unsafe { &*x } }
- | ^^^ dereference of raw pointer
- |
- = note: raw pointers may be NULL, dangling or unaligned; they can violate aliasing rules and cause data races: all of these are undefined behavior
-
-error: aborting due to 5 previous errors
+error: aborting due to 4 previous errors
-Some errors have detailed explanations: E0133, E0658, E0723.
-For more information about an error, try `rustc --explain E0133`.
+Some errors have detailed explanations: E0658, E0723.
+For more information about an error, try `rustc --explain E0658`.
--- /dev/null
+// compile-flags: --crate-type=lib
+// normalize-stderr-32bit: "offset 8" -> "offset $$TWO_WORDS"
+// normalize-stderr-64bit: "offset 16" -> "offset $$TWO_WORDS"
+// normalize-stderr-32bit: "size 4" -> "size $$WORD"
+// normalize-stderr-64bit: "size 8" -> "size $$WORD"
+
+#![feature(
+ const_panic,
+ core_intrinsics,
+ const_raw_ptr_comparison,
+ const_ptr_offset,
+ const_raw_ptr_deref,
+ raw_ref_macros
+)]
+
+const FOO: &usize = &42;
+
+macro_rules! check {
+ (eq, $a:expr, $b:expr) => {
+ pub const _: () =
+ assert!(std::intrinsics::ptr_guaranteed_eq($a as *const u8, $b as *const u8));
+ };
+ (ne, $a:expr, $b:expr) => {
+ pub const _: () =
+ assert!(std::intrinsics::ptr_guaranteed_ne($a as *const u8, $b as *const u8));
+ };
+ (!eq, $a:expr, $b:expr) => {
+ pub const _: () =
+ assert!(!std::intrinsics::ptr_guaranteed_eq($a as *const u8, $b as *const u8));
+ };
+ (!ne, $a:expr, $b:expr) => {
+ pub const _: () =
+ assert!(!std::intrinsics::ptr_guaranteed_ne($a as *const u8, $b as *const u8));
+ };
+}
+
+check!(eq, 0, 0);
+check!(ne, 0, 1);
+check!(!eq, 0, 1);
+check!(!ne, 0, 0);
+check!(ne, FOO as *const _, 0);
+check!(!eq, FOO as *const _, 0);
+// We want pointers to be equal to themselves, but aren't checking this yet because
+// there are some open questions (e.g. whether function pointers to the same function
+// compare equal, they don't necessarily at runtime).
+// The case tested here should work eventually, but does not work yet.
+check!(!eq, FOO as *const _, FOO as *const _);
+check!(ne, unsafe { (FOO as *const usize).offset(1) }, 0);
+check!(!eq, unsafe { (FOO as *const usize).offset(1) }, 0);
+
+check!(ne, unsafe { (FOO as *const usize as *const u8).offset(3) }, 0);
+check!(!eq, unsafe { (FOO as *const usize as *const u8).offset(3) }, 0);
+
+///////////////////////////////////////////////////////////////////////////////
+// If any of the below start compiling, make sure to add a `check` test for it.
+// These invocations exist as canaries so we don't forget to check that the
+// behaviour of `guaranteed_eq` and `guaranteed_ne` is still correct.
+// All of these try to obtain an out of bounds pointer in some manner. If we
+// can create out of bounds pointers, we can offset a pointer far enough that
+// at runtime it would be zero and at compile-time it would not be zero.
+
+const _: *const usize = unsafe { (FOO as *const usize).offset(2) };
+//~^ NOTE
+
+const _: *const u8 =
+//~^ NOTE
+ unsafe { std::ptr::raw_const!((*(FOO as *const usize as *const [u8; 1000]))[999]) };
+//~^ ERROR any use of this value will cause an error
+
+const _: usize = unsafe { std::mem::transmute::<*const usize, usize>(FOO) + 4 };
+//~^ ERROR any use of this value will cause an error
+//~| NOTE "pointer-to-integer cast" needs an rfc
+//~| NOTE
+
+const _: usize = unsafe { *std::mem::transmute::<&&usize, &usize>(&FOO) + 4 };
+//~^ ERROR any use of this value will cause an error
+//~| NOTE "pointer-to-integer cast" needs an rfc
+//~| NOTE
--- /dev/null
+error: any use of this value will cause an error
+ --> $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
+ |
+LL | unsafe { intrinsics::offset(self, count) }
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ | |
+ | inbounds test failed: pointer must be in-bounds at offset $TWO_WORDS, but is outside bounds of alloc2 which has size $WORD
+ | inside `std::ptr::const_ptr::<impl *const usize>::offset` at $SRC_DIR/core/src/ptr/const_ptr.rs:LL:COL
+ | inside `_` at $DIR/ptr_comparisons.rs:62:34
+ |
+ ::: $DIR/ptr_comparisons.rs:62:1
+ |
+LL | const _: *const usize = unsafe { (FOO as *const usize).offset(2) };
+ | -------------------------------------------------------------------
+ |
+ = note: `#[deny(const_err)]` on by default
+
+error: any use of this value will cause an error
+ --> $DIR/ptr_comparisons.rs:67:14
+ |
+LL | / const _: *const u8 =
+LL | |
+LL | | unsafe { std::ptr::raw_const!((*(FOO as *const usize as *const [u8; 1000]))[999]) };
+ | |______________^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^__-
+ | |
+ | memory access failed: pointer must be in-bounds at offset 1000, but is outside bounds of alloc2 which has size $WORD
+ |
+ = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
+
+error: any use of this value will cause an error
+ --> $DIR/ptr_comparisons.rs:70:27
+ |
+LL | const _: usize = unsafe { std::mem::transmute::<*const usize, usize>(FOO) + 4 };
+ | --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
+ | |
+ | "pointer-to-integer cast" needs an rfc before being allowed inside constants
+
+error: any use of this value will cause an error
+ --> $DIR/ptr_comparisons.rs:75:27
+ |
+LL | const _: usize = unsafe { *std::mem::transmute::<&&usize, &usize>(&FOO) + 4 };
+ | --------------------------^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^---
+ | |
+ | "pointer-to-integer cast" needs an rfc before being allowed inside constants
+
+error: aborting due to 4 previous errors
+
--- /dev/null
+// compile-flags: --crate-type=lib
+// check-pass
+
+#![feature(const_ptr_is_null, const_panic)]
+
+const FOO: &usize = &42;
+
+pub const _: () = assert!(!(FOO as *const usize).is_null());
+
+pub const _: () = assert!(!(42 as *const usize).is_null());
+
+pub const _: () = assert!((0 as *const usize).is_null());
+
+pub const _: () = assert!(std::ptr::null::<usize>().is_null());
+
+pub const _: () = assert!(!("foo" as *const str).is_null());
let b = false;
let _ = a and b; //~ ERROR `and` is not a logical operator
- //~| ERROR `and` is not a logical operator
if a and b { //~ ERROR `and` is not a logical operator
- //~| ERROR `and` is not a logical operator
println!("both");
}
let b = false;
let _ = a or b; //~ ERROR `or` is not a logical operator
- //~| ERROR `or` is not a logical operator
if a or b { //~ ERROR `or` is not a logical operator
- //~| ERROR `or` is not a logical operator
println!("both");
}
}
let a = true;
let b = false;
if (a and b) { //~ ERROR `and` is not a logical operator
- //~| ERROR `and` is not a logical operator
println!("both");
}
}
let a = true;
let b = false;
if (a or b) { //~ ERROR `or` is not a logical operator
- //~| ERROR `or` is not a logical operator
println!("both");
}
}
let a = true;
let b = false;
while a and b { //~ ERROR `and` is not a logical operator
- //~| ERROR `and` is not a logical operator
println!("both");
}
}
let a = true;
let b = false;
while a or b { //~ ERROR `or` is not a logical operator
- //~| ERROR `or` is not a logical operator
println!("both");
}
}
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
- --> $DIR/issue-54109-and_instead_of_ampersands.rs:7:15
- |
-LL | let _ = a and b;
- | ^^^ help: use `&&` to perform logical conjunction
- |
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-
-error: `and` is not a logical operator
- --> $DIR/issue-54109-and_instead_of_ampersands.rs:10:10
- |
-LL | if a and b {
- | ^^^ help: use `&&` to perform logical conjunction
- |
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-
-error: `and` is not a logical operator
- --> $DIR/issue-54109-and_instead_of_ampersands.rs:10:10
+ --> $DIR/issue-54109-and_instead_of_ampersands.rs:9:10
|
LL | if a and b {
| ^^^ help: use `&&` to perform logical conjunction
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
- --> $DIR/issue-54109-and_instead_of_ampersands.rs:22:15
+ --> $DIR/issue-54109-and_instead_of_ampersands.rs:20:15
|
LL | let _ = a or b;
| ^^ help: use `||` to perform logical disjunction
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
- --> $DIR/issue-54109-and_instead_of_ampersands.rs:22:15
- |
-LL | let _ = a or b;
- | ^^ help: use `||` to perform logical disjunction
- |
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-
-error: `or` is not a logical operator
- --> $DIR/issue-54109-and_instead_of_ampersands.rs:25:10
- |
-LL | if a or b {
- | ^^ help: use `||` to perform logical disjunction
- |
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-
-error: `or` is not a logical operator
- --> $DIR/issue-54109-and_instead_of_ampersands.rs:25:10
+ --> $DIR/issue-54109-and_instead_of_ampersands.rs:22:10
|
LL | if a or b {
| ^^ help: use `||` to perform logical disjunction
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
- --> $DIR/issue-54109-and_instead_of_ampersands.rs:34:11
+ --> $DIR/issue-54109-and_instead_of_ampersands.rs:30:11
|
LL | if (a and b) {
| ^^^ help: use `&&` to perform logical conjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-error: `and` is not a logical operator
- --> $DIR/issue-54109-and_instead_of_ampersands.rs:34:11
- |
-LL | if (a and b) {
- | ^^^ help: use `&&` to perform logical conjunction
- |
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-
-error: `or` is not a logical operator
- --> $DIR/issue-54109-and_instead_of_ampersands.rs:43:11
- |
-LL | if (a or b) {
- | ^^ help: use `||` to perform logical disjunction
- |
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-
error: `or` is not a logical operator
- --> $DIR/issue-54109-and_instead_of_ampersands.rs:43:11
+ --> $DIR/issue-54109-and_instead_of_ampersands.rs:38:11
|
LL | if (a or b) {
| ^^ help: use `||` to perform logical disjunction
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
- --> $DIR/issue-54109-and_instead_of_ampersands.rs:52:13
+ --> $DIR/issue-54109-and_instead_of_ampersands.rs:46:13
|
LL | while a and b {
| ^^^ help: use `&&` to perform logical conjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-error: `and` is not a logical operator
- --> $DIR/issue-54109-and_instead_of_ampersands.rs:52:13
- |
-LL | while a and b {
- | ^^^ help: use `&&` to perform logical conjunction
- |
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-
-error: `or` is not a logical operator
- --> $DIR/issue-54109-and_instead_of_ampersands.rs:61:13
- |
-LL | while a or b {
- | ^^ help: use `||` to perform logical disjunction
- |
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-
error: `or` is not a logical operator
- --> $DIR/issue-54109-and_instead_of_ampersands.rs:61:13
+ --> $DIR/issue-54109-and_instead_of_ampersands.rs:54:13
|
LL | while a or b {
| ^^ help: use `||` to perform logical disjunction
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error[E0308]: mismatched types
- --> $DIR/issue-54109-and_instead_of_ampersands.rs:15:33
+ --> $DIR/issue-54109-and_instead_of_ampersands.rs:13:33
|
LL | let _recovery_witness: () = 0;
| -- ^ expected `()`, found integer
| |
| expected due to this
-error: aborting due to 17 previous errors
+error: aborting due to 9 previous errors
For more information about this error, try `rustc --explain E0308`.
let b = false;
let _ = a && b; //~ ERROR `and` is not a logical operator
- //~| ERROR `and` is not a logical operator
if a && b { //~ ERROR `and` is not a logical operator
- //~| ERROR `and` is not a logical operator
println!("both");
}
}
let b = false;
let _ = a || b; //~ ERROR `or` is not a logical operator
- //~| ERROR `or` is not a logical operator
if a || b { //~ ERROR `or` is not a logical operator
- //~| ERROR `or` is not a logical operator
println!("both");
}
}
let a = true;
let b = false;
if (a && b) { //~ ERROR `and` is not a logical operator
- //~| ERROR `and` is not a logical operator
println!("both");
}
}
let a = true;
let b = false;
if (a || b) { //~ ERROR `or` is not a logical operator
- //~| ERROR `or` is not a logical operator
println!("both");
}
}
let a = true;
let b = false;
while a && b { //~ ERROR `and` is not a logical operator
- //~| ERROR `and` is not a logical operator
println!("both");
}
}
let a = true;
let b = false;
while a || b { //~ ERROR `or` is not a logical operator
- //~| ERROR `or` is not a logical operator
println!("both");
}
}
let b = false;
let _ = a and b; //~ ERROR `and` is not a logical operator
- //~| ERROR `and` is not a logical operator
if a and b { //~ ERROR `and` is not a logical operator
- //~| ERROR `and` is not a logical operator
println!("both");
}
}
let b = false;
let _ = a or b; //~ ERROR `or` is not a logical operator
- //~| ERROR `or` is not a logical operator
if a or b { //~ ERROR `or` is not a logical operator
- //~| ERROR `or` is not a logical operator
println!("both");
}
}
let a = true;
let b = false;
if (a and b) { //~ ERROR `and` is not a logical operator
- //~| ERROR `and` is not a logical operator
println!("both");
}
}
let a = true;
let b = false;
if (a or b) { //~ ERROR `or` is not a logical operator
- //~| ERROR `or` is not a logical operator
println!("both");
}
}
let a = true;
let b = false;
while a and b { //~ ERROR `and` is not a logical operator
- //~| ERROR `and` is not a logical operator
println!("both");
}
}
let a = true;
let b = false;
while a or b { //~ ERROR `or` is not a logical operator
- //~| ERROR `or` is not a logical operator
println!("both");
}
}
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
- --> $DIR/issue-54109-without-witness.rs:13:15
- |
-LL | let _ = a and b;
- | ^^^ help: use `&&` to perform logical conjunction
- |
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-
-error: `and` is not a logical operator
- --> $DIR/issue-54109-without-witness.rs:16:10
- |
-LL | if a and b {
- | ^^^ help: use `&&` to perform logical conjunction
- |
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-
-error: `and` is not a logical operator
- --> $DIR/issue-54109-without-witness.rs:16:10
+ --> $DIR/issue-54109-without-witness.rs:15:10
|
LL | if a and b {
| ^^^ help: use `&&` to perform logical conjunction
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
- --> $DIR/issue-54109-without-witness.rs:26:15
+ --> $DIR/issue-54109-without-witness.rs:24:15
|
LL | let _ = a or b;
| ^^ help: use `||` to perform logical disjunction
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `or` is not a logical operator
- --> $DIR/issue-54109-without-witness.rs:26:15
- |
-LL | let _ = a or b;
- | ^^ help: use `||` to perform logical disjunction
- |
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-
-error: `or` is not a logical operator
- --> $DIR/issue-54109-without-witness.rs:29:10
- |
-LL | if a or b {
- | ^^ help: use `||` to perform logical disjunction
- |
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-
-error: `or` is not a logical operator
- --> $DIR/issue-54109-without-witness.rs:29:10
+ --> $DIR/issue-54109-without-witness.rs:26:10
|
LL | if a or b {
| ^^ help: use `||` to perform logical disjunction
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
- --> $DIR/issue-54109-without-witness.rs:38:11
+ --> $DIR/issue-54109-without-witness.rs:34:11
|
LL | if (a and b) {
| ^^^ help: use `&&` to perform logical conjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-error: `and` is not a logical operator
- --> $DIR/issue-54109-without-witness.rs:38:11
- |
-LL | if (a and b) {
- | ^^^ help: use `&&` to perform logical conjunction
- |
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-
-error: `or` is not a logical operator
- --> $DIR/issue-54109-without-witness.rs:47:11
- |
-LL | if (a or b) {
- | ^^ help: use `||` to perform logical disjunction
- |
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-
error: `or` is not a logical operator
- --> $DIR/issue-54109-without-witness.rs:47:11
+ --> $DIR/issue-54109-without-witness.rs:42:11
|
LL | if (a or b) {
| ^^ help: use `||` to perform logical disjunction
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
error: `and` is not a logical operator
- --> $DIR/issue-54109-without-witness.rs:56:13
+ --> $DIR/issue-54109-without-witness.rs:50:13
|
LL | while a and b {
| ^^^ help: use `&&` to perform logical conjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-error: `and` is not a logical operator
- --> $DIR/issue-54109-without-witness.rs:56:13
- |
-LL | while a and b {
- | ^^^ help: use `&&` to perform logical conjunction
- |
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-
-error: `or` is not a logical operator
- --> $DIR/issue-54109-without-witness.rs:65:13
- |
-LL | while a or b {
- | ^^ help: use `||` to perform logical disjunction
- |
- = note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-
error: `or` is not a logical operator
- --> $DIR/issue-54109-without-witness.rs:65:13
+ --> $DIR/issue-54109-without-witness.rs:58:13
|
LL | while a or b {
| ^^ help: use `||` to perform logical disjunction
|
= note: unlike in e.g., python and PHP, `&&` and `||` are used for logical operators
-error: aborting due to 16 previous errors
+error: aborting due to 8 previous errors
--- /dev/null
+// check-pass
+// edition:2018
+// aux-build:not-libstd.rs
+
+// Check that paths created in HIR are not affected by in scope names.
+
+extern crate not_libstd as std;
+
+async fn the_future() {
+ async {}.await;
+}
+
+fn main() -> Result<(), ()> {
+ for i in 0..10 {}
+ for j in 0..=10 {}
+ Ok(())?;
+ Ok(())
+}
+++ /dev/null
-#![allow(unused)]
-
-macro_rules! m { ($i) => {} }
-//~^ ERROR missing fragment specifier
-//~| WARN previously accepted
-
-fn main() {}
+++ /dev/null
-error: missing fragment specifier
- --> $DIR/issue-39404.rs:3:19
- |
-LL | macro_rules! m { ($i) => {} }
- | ^^
- |
- = note: `#[deny(missing_fragment_specifier)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
-
-error: aborting due to previous error
-
--- /dev/null
+// check-pass
+#![allow(non_upper_case_globals)]
+
+const or: usize = 1;
+const and: usize = 2;
+
+mod or {
+ pub const X: usize = 3;
+}
+
+mod and {
+ pub const X: usize = 4;
+}
+
+fn main() {
+ match 0 {
+ 0 => {}
+ or => {}
+ and => {}
+ or::X => {}
+ and::X => {}
+ _ => {}
+ }
+}
--- /dev/null
+// check-pass
+//
+// This tests checks that clashing_extern_declarations handles types that are recursive through a
+// pointer or ref argument. See #75512.
+
+#![crate_type = "lib"]
+
+mod raw_ptr_recursion {
+ mod a {
+ #[repr(C)]
+ struct Pointy {
+ pointy: *const Pointy,
+ }
+
+ extern "C" {
+ fn run_pointy(pointy: Pointy);
+ }
+ }
+ mod b {
+ #[repr(C)]
+ struct Pointy {
+ pointy: *const Pointy,
+ }
+
+ extern "C" {
+ fn run_pointy(pointy: Pointy);
+ }
+ }
+}
+
+mod raw_ptr_recursion_once_removed {
+ mod a {
+ #[repr(C)]
+ struct Pointy1 {
+ pointy_two: *const Pointy2,
+ }
+
+ #[repr(C)]
+ struct Pointy2 {
+ pointy_one: *const Pointy1,
+ }
+
+ extern "C" {
+ fn run_pointy2(pointy: Pointy2);
+ }
+ }
+
+ mod b {
+ #[repr(C)]
+ struct Pointy1 {
+ pointy_two: *const Pointy2,
+ }
+
+ #[repr(C)]
+ struct Pointy2 {
+ pointy_one: *const Pointy1,
+ }
+
+ extern "C" {
+ fn run_pointy2(pointy: Pointy2);
+ }
+ }
+}
+
+mod ref_recursion {
+ mod a {
+ #[repr(C)]
+ struct Reffy<'a> {
+ reffy: &'a Reffy<'a>,
+ }
+
+ extern "C" {
+ fn reffy_recursion(reffy: Reffy);
+ }
+ }
+ mod b {
+ #[repr(C)]
+ struct Reffy<'a> {
+ reffy: &'a Reffy<'a>,
+ }
+
+ extern "C" {
+ fn reffy_recursion(reffy: Reffy);
+ }
+ }
+}
+
+mod ref_recursion_once_removed {
+ mod a {
+ #[repr(C)]
+ struct Reffy1<'a> {
+ reffy: &'a Reffy2<'a>,
+ }
+
+ struct Reffy2<'a> {
+ reffy: &'a Reffy1<'a>,
+ }
+
+ extern "C" {
+ #[allow(improper_ctypes)]
+ fn reffy_once_removed(reffy: Reffy1);
+ }
+ }
+ mod b {
+ #[repr(C)]
+ struct Reffy1<'a> {
+ reffy: &'a Reffy2<'a>,
+ }
+
+ struct Reffy2<'a> {
+ reffy: &'a Reffy1<'a>,
+ }
+
+ extern "C" {
+ #[allow(improper_ctypes)]
+ fn reffy_once_removed(reffy: Reffy1);
+ }
+ }
+}
( $($i:ident)* ) => { $($i)+ }; //~ WARN meta-variable repeats with different Kleene operator
}
-#[warn(missing_fragment_specifier)]
-macro_rules! m { ($i) => {} } //~ WARN missing fragment specifier
- //~| WARN this was previously accepted
-
#[warn(soft_unstable)]
mod benches {
#[bench] //~ WARN use of unstable library feature 'test'
LL | #[warn(meta_variable_misuse)]
| ^^^^^^^^^^^^^^^^^^^^
-warning: missing fragment specifier
- --> $DIR/expansion-time.rs:9:19
- |
-LL | macro_rules! m { ($i) => {} }
- | ^^
- |
-note: the lint level is defined here
- --> $DIR/expansion-time.rs:8:8
- |
-LL | #[warn(missing_fragment_specifier)]
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
-
warning: use of unstable library feature 'test': `bench` is a part of custom test frameworks which are unstable
- --> $DIR/expansion-time.rs:14:7
+ --> $DIR/expansion-time.rs:10:7
|
LL | #[bench]
| ^^^^^
|
note: the lint level is defined here
- --> $DIR/expansion-time.rs:12:8
+ --> $DIR/expansion-time.rs:8:8
|
LL | #[warn(soft_unstable)]
| ^^^^^^^^^^^^^
| ^
|
note: the lint level is defined here
- --> $DIR/expansion-time.rs:19:8
+ --> $DIR/expansion-time.rs:15:8
|
LL | #[warn(incomplete_include)]
| ^^^^^^^^^^^^^^^^^^
-warning: 4 warnings emitted
+warning: 3 warnings emitted
--- /dev/null
+#![allow(unused)]
+
+macro_rules! m { ($i) => {} }
+//~^ ERROR missing fragment specifier
+
+fn main() {}
--- /dev/null
+error: missing fragment specifier
+ --> $DIR/issue-39404.rs:3:19
+ |
+LL | macro_rules! m { ($i) => {} }
+ | ^^
+
+error: aborting due to previous error
+
($a, $b) => {
//~^ ERROR missing fragment
//~| ERROR missing fragment
- //~| WARN this was previously accepted
()
};
}
|
LL | ($a, $b) => {
| ^^
- |
- = note: `#[deny(missing_fragment_specifier)]` on by default
- = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
- = note: for more information, see issue #40107 <https://github.com/rust-lang/rust/issues/40107>
error: aborting due to 2 previous errors
{ $+ } => { //~ ERROR expected identifier, found `+`
//~^ ERROR missing fragment specifier
$(x)(y) //~ ERROR expected one of: `*`, `+`, or `?`
+ //~^ ERROR attempted to repeat an expression containing no syntax variables
}
}
LL | { $+ } => {
| ^
+error: missing fragment specifier
+ --> $DIR/issue-33569.rs:2:8
+ |
+LL | { $+ } => {
+ | ^
+
error: expected one of: `*`, `+`, or `?`
--> $DIR/issue-33569.rs:4:13
|
LL | $(x)(y)
| ^^^
-error: missing fragment specifier
- --> $DIR/issue-33569.rs:2:8
+error: attempted to repeat an expression containing no syntax variables matched as repeating at this depth
+ --> $DIR/issue-33569.rs:4:10
|
-LL | { $+ } => {
- | ^
+LL | $(x)(y)
+ | ^^^
-error: aborting due to 3 previous errors
+error: aborting due to 4 previous errors
|
LL | let range = *arr..;
| ^^^^^^ doesn't have a size known at compile-time
+ |
+ ::: $SRC_DIR/core/src/ops/range.rs:LL:COL
+ |
+LL | pub struct RangeFrom<Idx> {
+ | --- required by this bound in `std::ops::RangeFrom`
|
= help: the trait `std::marker::Sized` is not implemented for `[{integer}]`
- = note: required by `std::ops::RangeFrom`
error: aborting due to 3 previous errors
--- /dev/null
+fn main() {}
+fn foo(mut s: String) -> String {
+ s.push_str("asdf") //~ ERROR mismatched types
+}
--- /dev/null
+error[E0308]: mismatched types
+ --> $DIR/chain-method-call-mutation-in-place.rs:3:5
+ |
+LL | fn foo(mut s: String) -> String {
+ | ------ expected `std::string::String` because of return type
+LL | s.push_str("asdf")
+ | ^^^^^^^^^^^^^^^^^^ expected struct `std::string::String`, found `()`
+ |
+note: method `push_str` modifies its receiver in-place
+ --> $DIR/chain-method-call-mutation-in-place.rs:3:7
+ |
+LL | s.push_str("asdf")
+ | - ^^^^^^^^ this call modifies `s` in-place
+ | |
+ | you probably want to use this value after calling the method...
+ = note: ...instead of the `()` output of method `push_str`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0308`.
//
// error: internal compiler error: get_unique_type_id_of_type() -
// unexpected type: closure,
-// Closure(rustc_ast::ast::DefId{krate: 0, node: 66},
+// Closure(rustc_ast::DefId{krate: 0, node: 66},
// ReScope(63))
//
// This is a regression test for issue #17021.
Test {
name: "tokei",
repo: "https://github.com/XAMPPRocky/tokei",
- sha: "5e11c4852fe4aa086b0e4fe5885822fbe57ba928",
- lock: None,
- packages: &[],
- },
- Test {
- name: "treeify",
- repo: "https://github.com/dzamlo/treeify",
- sha: "999001b223152441198f117a68fb81f57bc086dd",
+ sha: "a950ff128d5a435a8083b1c7577c0431f98360ca",
lock: None,
packages: &[],
},
span_lint_and_sugg, span_lint_and_then, without_block_comments,
};
use if_chain::if_chain;
-use rustc_ast::ast::{AttrKind, AttrStyle, Attribute, Lit, LitKind, MetaItemKind, NestedMetaItem};
+use rustc_ast::{AttrKind, AttrStyle, Attribute, Lit, LitKind, MetaItemKind, NestedMetaItem};
use rustc_ast::util::lev_distance::find_best_match_for_name;
use rustc_errors::Applicability;
use rustc_hir::{
]);
impl EarlyLintPass for EarlyAttributes {
- fn check_item(&mut self, cx: &EarlyContext<'_>, item: &rustc_ast::ast::Item) {
+ fn check_item(&mut self, cx: &EarlyContext<'_>, item: &rustc_ast::Item) {
check_empty_line_after_outer_attr(cx, item);
}
}
}
-fn check_empty_line_after_outer_attr(cx: &EarlyContext<'_>, item: &rustc_ast::ast::Item) {
+fn check_empty_line_after_outer_attr(cx: &EarlyContext<'_>, item: &rustc_ast::Item) {
for attr in &item.attrs {
let attr_item = if let AttrKind::Normal(ref attr) = attr.kind {
attr
);
}
},
- QPath::TypeRelative(..) => {},
+ QPath::TypeRelative(..) | QPath::LangItem(..) => {},
}
}
}
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
if let ExprKind::Index(ref array, ref index) = &expr.kind {
let ty = cx.typeck_results().expr_ty(array);
- if let Some(range) = higher::range(cx, index) {
+ if let Some(range) = higher::range(index) {
// Ranged indexes, i.e., &x[n..m], &x[n..], &x[..n] and &x[..]
if let ty::Array(_, s) = ty.kind {
let size: u128 = if let Some(size) = s.try_eval_usize(cx.tcx, cx.param_env) {
Finite
}
},
- ExprKind::Struct(..) => higher::range(cx, expr).map_or(false, |r| r.end.is_none()).into(),
+ ExprKind::Struct(..) => higher::range(expr).map_or(false, |r| r.end.is_none()).into(),
_ => Finite,
}
}
fn has_is_empty(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
/// Special case ranges until `range_is_empty` is stabilized. See issue 3807.
fn should_skip_range(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
- higher::range(cx, expr).map_or(false, |_| {
+ higher::range(expr).map_or(false, |_| {
!cx.tcx
.features()
.declared_lib_features
}
#[doc(hidden)]
-pub fn read_conf(args: &[rustc_ast::ast::NestedMetaItem], sess: &Session) -> Conf {
+pub fn read_conf(args: &[rustc_ast::NestedMetaItem], sess: &Session) -> Conf {
use std::path::Path;
match utils::conf::file_from_args(args) {
Ok(file_name) => {
start: Some(start),
end: Some(end),
limits,
- }) = higher::range(cx, arg)
+ }) = higher::range(arg)
{
// the var must be a single name
if let PatKind::Binding(_, canonical_id, _, _) = pat.kind {
start: Some(start),
ref end,
limits,
- }) = higher::range(cx, arg)
+ }) = higher::range(arg)
{
// the var must be a single name
if let PatKind::Binding(_, canonical_id, ident, _) = pat.kind {
start: Some(start),
end: Some(end),
..
- }) = higher::range(cx, arg)
+ }) = higher::range(arg)
{
let mut_ids = vec![check_for_mutability(cx, start), check_for_mutability(cx, end)];
if mut_ids[0].is_some() || mut_ids[1].is_some() {
-use crate::utils::{self, is_type_diagnostic_item, match_type, snippet, span_lint_and_sugg, walk_ptrs_ty};
+use crate::utils::{is_type_diagnostic_item, is_type_lang_item, snippet, span_lint_and_sugg};
+use crate::utils::walk_ptrs_ty;
use if_chain::if_chain;
use rustc_errors::Applicability;
-use rustc_hir::{Expr, ExprKind, MatchSource};
+use rustc_hir::{Expr, ExprKind, LangItem, MatchSource};
use rustc_lint::{LateContext, LateLintPass, LintContext};
use rustc_middle::lint::in_external_macro;
use rustc_session::{declare_lint_pass, declare_tool_lint};
fn is_full_range(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool {
let ty = cx.typeck_results().expr_ty(expr);
let ty = walk_ptrs_ty(ty);
- match_type(cx, ty, &utils::paths::RANGE_FULL)
+ is_type_lang_item(cx, ty, LangItem::RangeFull)
}
if_chain! {
if let hir::ExprKind::Index(ref caller_var, ref index_expr) = &caller_expr.kind;
if let Some(higher::Range { start: Some(start_expr), end: None, limits: ast::RangeLimits::HalfOpen })
- = higher::range(cx, index_expr);
+ = higher::range(index_expr);
if let hir::ExprKind::Lit(ref start_lit) = &start_expr.kind;
if let ast::LitKind::Int(start_idx, _) = start_lit.node;
then {
return;
}
let binding = match expr.kind {
+ ExprKind::Path(hir::QPath::LangItem(..)) => None,
ExprKind::Path(ref qpath) => {
let binding = last_path_segment(qpath).ident.as_str();
if binding.starts_with('_') &&
if let ExprKind::MethodCall(ref iter_path, _, ref iter_args , _) = *iter;
if iter_path.ident.name == sym!(iter);
// range expression in `.zip()` call: `0..x.len()`
- if let Some(higher::Range { start: Some(start), end: Some(end), .. }) = higher::range(cx, zip_arg);
+ if let Some(higher::Range { start: Some(start), end: Some(end), .. }) = higher::range(zip_arg);
if is_integer_const(cx, start, 0);
// `.len()` call
if let ExprKind::MethodCall(ref len_path, _, ref len_args, _) = end.kind;
start,
end: Some(end),
limits: RangeLimits::HalfOpen
- }) = higher::range(cx, expr);
+ }) = higher::range(expr);
if let Some(y) = y_plus_one(cx, end);
then {
let span = if expr.span.from_expansion() {
// inclusive range minus one: `x..=(y-1)`
fn check_inclusive_range_minus_one(cx: &LateContext<'_>, expr: &Expr<'_>) {
if_chain! {
- if let Some(higher::Range { start, end: Some(end), limits: RangeLimits::Closed }) = higher::range(cx, expr);
+ if let Some(higher::Range { start, end: Some(end), limits: RangeLimits::Closed }) = higher::range(expr);
if let Some(y) = y_minus_one(cx, end);
then {
span_lint_and_then(
}
if_chain! {
- if let Some(higher::Range { start: Some(start), end: Some(end), limits }) = higher::range(cx, expr);
+ if let Some(higher::Range { start: Some(start), end: Some(end), limits }) = higher::range(expr);
let ty = cx.typeck_results().expr_ty(start);
if let ty::Int(_) | ty::Uint(_) = ty.kind;
if let Some((start_idx, _)) = constant(cx, cx.typeck_results(), start);
use crate::utils::{in_macro, span_lint_and_sugg};
use if_chain::if_chain;
-use rustc_ast::ast::{Item, ItemKind, UseTreeKind};
+use rustc_ast::{Item, ItemKind, UseTreeKind};
use rustc_errors::Applicability;
use rustc_lint::{EarlyContext, EarlyLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint};
impl<'tcx> LateLintPass<'tcx> for StringLitAsBytes {
fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) {
use crate::utils::{snippet, snippet_with_applicability};
- use rustc_ast::ast::LitKind;
+ use rustc_ast::LitKind;
if_chain! {
if let ExprKind::MethodCall(path, _, args, _) = &e.kind;
span_lint_and_then, sugg,
};
use if_chain::if_chain;
-use rustc_ast::ast;
+use rustc_ast as ast;
use rustc_errors::Applicability;
use rustc_hir::{Expr, ExprKind, GenericArg, Mutability, QPath, TyKind, UnOp};
use rustc_lint::{LateContext, LateLintPass};
use crate::consts::{constant_context, Constant};
use crate::utils::{match_qpath, paths, span_lint};
use if_chain::if_chain;
-use rustc_ast::ast::LitKind;
+use rustc_ast::LitKind;
use rustc_hir::{Expr, ExprKind};
use rustc_lint::{LateContext, LateLintPass, LintContext};
use rustc_middle::lint::in_external_macro;
use crate::utils::{
- is_type_diagnostic_item, match_def_path, match_qpath, paths, snippet, snippet_with_macro_callsite,
- span_lint_and_sugg,
+ is_type_diagnostic_item, match_def_path, match_qpath, paths, snippet,
+ snippet_with_macro_callsite, span_lint_and_sugg,
};
use if_chain::if_chain;
use rustc_errors::Applicability;
-use rustc_hir::{Expr, ExprKind, MatchSource};
+use rustc_hir::{Expr, ExprKind, QPath, LangItem, MatchSource};
use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::lint::in_external_macro;
use rustc_middle::ty::{self, Ty};
if let ExprKind::Match(ref match_arg, _, MatchSource::TryDesugar) = expr.kind;
if let ExprKind::Call(ref match_fun, ref try_args) = match_arg.kind;
if let ExprKind::Path(ref match_fun_path) = match_fun.kind;
- if match_qpath(match_fun_path, &paths::TRY_INTO_RESULT);
+ if matches!(match_fun_path, QPath::LangItem(LangItem::TryIntoResult, _));
if let Some(ref try_arg) = try_args.get(0);
if let ExprKind::Call(ref err_fun, ref err_args) = try_arg.kind;
if let Some(ref err_arg) = err_args.get(0);
use std::collections::BTreeMap;
use if_chain::if_chain;
-use rustc_ast::ast::{FloatTy, IntTy, LitFloatType, LitIntType, LitKind, UintTy};
+use rustc_ast::{FloatTy, IntTy, LitFloatType, LitIntType, LitKind, UintTy};
use rustc_errors::{Applicability, DiagnosticBuilder};
use rustc_hir as hir;
use rustc_hir::intravisit::{walk_body, walk_expr, walk_ty, FnKind, NestedVisitorMap, Visitor};
}
}
},
+ QPath::LangItem(..) => {},
}
},
TyKind::Rptr(ref lt, ref mut_ty) => self.check_ty_rptr(cx, hir_ty, is_local, lt, mut_ty),
use crate::utils::ast_utils::{eq_field_pat, eq_id, eq_pat, eq_path};
use crate::utils::{over, span_lint_and_then};
-use rustc_ast::ast::{self, Pat, PatKind, PatKind::*, DUMMY_NODE_ID};
+use rustc_ast::{self as ast, Pat, PatKind, PatKind::*, DUMMY_NODE_ID};
use rustc_ast::mut_visit::*;
use rustc_ast::ptr::P;
use rustc_ast_pretty::pprust;
-use crate::utils::{is_try, match_qpath, match_trait_method, paths, span_lint};
+use crate::utils::{is_try, match_trait_method, paths, span_lint};
use rustc_hir as hir;
use rustc_lint::{LateContext, LateLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint};
match expr.kind {
hir::ExprKind::Match(ref res, _, _) if is_try(expr).is_some() => {
if let hir::ExprKind::Call(ref func, ref args) = res.kind {
- if let hir::ExprKind::Path(ref path) = func.kind {
- if match_qpath(path, &paths::TRY_INTO_RESULT) && args.len() == 1 {
- check_method_call(cx, &args[0], expr);
- }
+ if matches!(
+ func.kind,
+ hir::ExprKind::Path(hir::QPath::LangItem(hir::LangItem::TryIntoResult, _))
+ ) {
+ check_method_call(cx, &args[0], expr);
}
} else {
check_method_call(cx, res, expr);
#![allow(clippy::similar_names, clippy::wildcard_imports, clippy::enum_glob_use)]
use crate::utils::{both, over};
-use rustc_ast::ast::{self, *};
+use rustc_ast::{self as ast, *};
use rustc_ast::ptr::P;
use rustc_span::symbol::Ident;
use std::mem;
}
fn print_qpath(&mut self, path: &QPath<'_>) {
- print!(" if match_qpath({}, &[", self.current);
- print_path(path, &mut true);
- println!("]);");
+ match *path {
+ QPath::LangItem(lang_item, _) => {
+ println!(
+ " if matches!({}, QPath::LangItem(LangItem::{:?}, _));",
+ self.current, lang_item,
+ );
+ },
+ _ => {
+ print!(" if match_qpath({}, &[", self.current);
+ print_path(path, &mut true);
+ println!("]);");
+ },
+ }
}
}
},
ref other => print!("/* unimplemented: {:?}*/", other),
},
+ QPath::LangItem(..) => panic!("print_path: called for lang item qpath"),
}
}
#![deny(clippy::missing_docs_in_private_items)]
-use crate::utils::{is_expn_of, match_def_path, match_qpath, paths};
+use crate::utils::{is_expn_of, match_def_path, paths};
use if_chain::if_chain;
use rustc_ast::ast;
use rustc_hir as hir;
use rustc_lint::LateContext;
-use rustc_middle::ty;
/// Converts a hir binary operator to the corresponding `ast` type.
#[must_use]
}
/// Higher a `hir` range to something similar to `ast::ExprKind::Range`.
-pub fn range<'a, 'tcx>(cx: &LateContext<'tcx>, expr: &'a hir::Expr<'_>) -> Option<Range<'a>> {
+pub fn range<'a>(expr: &'a hir::Expr<'_>) -> Option<Range<'a>> {
/// Finds the field named `name` in the field. Always return `Some` for
/// convenience.
fn get_field<'c>(name: &str, fields: &'c [hir::Field<'_>]) -> Option<&'c hir::Expr<'c>> {
Some(expr)
}
- let def_path = match cx.typeck_results().expr_ty(expr).kind {
- ty::Adt(def, _) => cx.tcx.def_path(def.did),
- _ => return None,
- };
-
- // sanity checks for std::ops::RangeXXXX
- if def_path.data.len() != 3 {
- return None;
- }
- if def_path.data.get(0)?.data.as_symbol() != sym!(ops) {
- return None;
- }
- if def_path.data.get(1)?.data.as_symbol() != sym!(range) {
- return None;
- }
- let type_name = def_path.data.get(2)?.data.as_symbol();
- let range_types = [
- "RangeFrom",
- "RangeFull",
- "RangeInclusive",
- "Range",
- "RangeTo",
- "RangeToInclusive",
- ];
- if !range_types.contains(&&*type_name.as_str()) {
- return None;
- }
-
- // The range syntax is expanded to literal paths starting with `core` or `std`
- // depending on
- // `#[no_std]`. Testing both instead of resolving the paths.
-
match expr.kind {
- hir::ExprKind::Path(ref path) => {
- if match_qpath(path, &paths::RANGE_FULL_STD) || match_qpath(path, &paths::RANGE_FULL) {
- Some(Range {
+ hir::ExprKind::Call(ref path, ref args) if matches!(
+ path.kind,
+ hir::ExprKind::Path(hir::QPath::LangItem(hir::LangItem::RangeInclusiveNew, _))
+ ) => Some(Range {
+ start: Some(&args[0]),
+ end: Some(&args[1]),
+ limits: ast::RangeLimits::Closed,
+ }),
+ hir::ExprKind::Struct(ref path, ref fields, None) => {
+ match path {
+ hir::QPath::LangItem(hir::LangItem::RangeFull, _) => Some(Range {
start: None,
end: None,
limits: ast::RangeLimits::HalfOpen,
- })
- } else {
- None
- }
- },
- hir::ExprKind::Call(ref path, ref args) => {
- if let hir::ExprKind::Path(ref path) = path.kind {
- if match_qpath(path, &paths::RANGE_INCLUSIVE_STD_NEW) || match_qpath(path, &paths::RANGE_INCLUSIVE_NEW)
- {
- Some(Range {
- start: Some(&args[0]),
- end: Some(&args[1]),
- limits: ast::RangeLimits::Closed,
- })
- } else {
- None
- }
- } else {
- None
- }
- },
- hir::ExprKind::Struct(ref path, ref fields, None) => {
- if match_qpath(path, &paths::RANGE_FROM_STD) || match_qpath(path, &paths::RANGE_FROM) {
- Some(Range {
+ }),
+ hir::QPath::LangItem(hir::LangItem::RangeFrom, _) => Some(Range {
start: Some(get_field("start", fields)?),
end: None,
limits: ast::RangeLimits::HalfOpen,
- })
- } else if match_qpath(path, &paths::RANGE_STD) || match_qpath(path, &paths::RANGE) {
- Some(Range {
+ }),
+ hir::QPath::LangItem(hir::LangItem::Range, _) => Some(Range {
start: Some(get_field("start", fields)?),
end: Some(get_field("end", fields)?),
limits: ast::RangeLimits::HalfOpen,
- })
- } else if match_qpath(path, &paths::RANGE_TO_INCLUSIVE_STD) || match_qpath(path, &paths::RANGE_TO_INCLUSIVE)
- {
- Some(Range {
+ }),
+ hir::QPath::LangItem(hir::LangItem::RangeToInclusive, _) => Some(Range {
start: None,
end: Some(get_field("end", fields)?),
limits: ast::RangeLimits::Closed,
- })
- } else if match_qpath(path, &paths::RANGE_TO_STD) || match_qpath(path, &paths::RANGE_TO) {
- Some(Range {
+ }),
+ hir::QPath::LangItem(hir::LangItem::RangeTo, _) => Some(Range {
start: None,
end: Some(get_field("end", fields)?),
limits: ast::RangeLimits::HalfOpen,
- })
- } else {
- None
+ }),
+ _ => None,
}
},
_ => None,
use rustc_ast::ast::InlineAsmTemplatePiece;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_hir::{
- BinOpKind, Block, BlockCheckMode, BodyId, BorrowKind, CaptureBy, Expr, ExprKind, Field, FnRetTy, GenericArg,
- GenericArgs, Guard, InlineAsmOperand, Lifetime, LifetimeName, ParamName, Pat, PatKind, Path, PathSegment, QPath,
- Stmt, StmtKind, Ty, TyKind, TypeBinding,
+ BinOpKind, Block, BlockCheckMode, BodyId, BorrowKind, CaptureBy, Expr, ExprKind, Field, FieldPat,
+ FnRetTy, GenericArg, GenericArgs, Guard, InlineAsmOperand, Lifetime, LifetimeName, ParamName,
+ Pat, PatKind, Path, PathSegment, QPath, Stmt, StmtKind, Ty, TyKind, TypeBinding,
};
use rustc_lint::LateContext;
use rustc_middle::ich::StableHashingContextProvider;
left.name == right.name
}
+ pub fn eq_fieldpat(&mut self, left: &FieldPat<'_>, right: &FieldPat<'_>) -> bool {
+ match (&left, &right) {
+ (FieldPat { ident: li, pat: lp, .. }, FieldPat { ident: ri, pat: rp, .. }) =>
+ li.name.as_str() == ri.name.as_str() && self.eq_pat(lp, rp),
+ }
+ }
+
/// Checks whether two patterns are the same.
pub fn eq_pat(&mut self, left: &Pat<'_>, right: &Pat<'_>) -> bool {
match (&left.kind, &right.kind) {
(&PatKind::Box(ref l), &PatKind::Box(ref r)) => self.eq_pat(l, r),
+ (&PatKind::Struct(ref lp, ref la, ..), &PatKind::Struct(ref rp, ref ra, ..)) => {
+ self.eq_qpath(lp, rp) && over(la, ra, |l, r| self.eq_fieldpat(l, r))
+ },
(&PatKind::TupleStruct(ref lp, ref la, ls), &PatKind::TupleStruct(ref rp, ref ra, rs)) => {
self.eq_qpath(lp, rp) && over(la, ra, |l, r| self.eq_pat(l, r)) && ls == rs
},
(&QPath::TypeRelative(ref lty, ref lseg), &QPath::TypeRelative(ref rty, ref rseg)) => {
self.eq_ty(lty, rty) && self.eq_path_segment(lseg, rseg)
},
+ (&QPath::LangItem(llang_item, _), &QPath::LangItem(rlang_item, _)) =>
+ llang_item == rlang_item,
_ => false,
}
}
QPath::TypeRelative(_, ref path) => {
self.hash_name(path.ident.name);
},
+ QPath::LangItem(lang_item, ..) => {
+ lang_item.hash_stable(&mut self.cx.tcx.get_stable_hashing_context(), &mut self.s);
+ }
}
// self.maybe_typeck_results.unwrap().qpath_res(p, id).hash(&mut self.s);
}
self.hash_ty(ty);
segment.ident.name.hash(&mut self.s);
},
+ QPath::LangItem(lang_item, ..) => {
+ lang_item.hash(&mut self.s);
+ }
},
TyKind::OpaqueDef(_, arg_list) => {
self.hash_generic_args(arg_list);
println!("{}Relative Path, {:?}", ind, ty);
println!("{}seg: {:?}", ind, seg);
},
+ hir::ExprKind::Path(hir::QPath::LangItem(lang_item, ..)) => {
+ println!("{}Lang Item Path, {:?}", ind, lang_item.name());
+ },
hir::ExprKind::AddrOf(kind, ref muta, ref e) => {
println!("{}AddrOf", ind);
println!("kind: {:?}", kind);
println!("{}Relative Path, {:?}", ind, ty);
println!("{}seg: {:?}", ind, seg);
},
+ hir::PatKind::Path(hir::QPath::LangItem(lang_item, ..)) => {
+ println!("{}Lang Item Path, {:?}", ind, lang_item.name());
+ },
hir::PatKind::Tuple(pats, opt_dots_position) => {
println!("{}Tuple", ind);
if let Some(dot_position) = opt_dots_position {
}
}
+/// Checks if the type is equal to a lang item
+pub fn is_type_lang_item(cx: &LateContext<'_>, ty: Ty<'_>, lang_item: hir::LangItem) -> bool {
+ match ty.kind {
+ ty::Adt(adt, _) => cx.tcx.lang_items().require(lang_item).unwrap() == adt.did,
+ _ => false,
+ }
+}
+
/// Checks if the method call given in `expr` belongs to the given trait.
pub fn match_trait_method(cx: &LateContext<'_>, expr: &Expr<'_>, path: &[&str]) -> bool {
let def_id = cx.typeck_results().type_dependent_def_id(expr.hir_id).unwrap();
match *path {
QPath::Resolved(_, ref path) => path.segments.last().expect("A path must have at least one segment"),
QPath::TypeRelative(_, ref seg) => seg,
+ QPath::LangItem(..) => panic!("last_path_segment: lang item has no path segments"),
}
}
match *path {
QPath::Resolved(_, ref path) => path.segments.get(0),
QPath::TypeRelative(_, ref seg) => Some(seg),
+ QPath::LangItem(..) => None,
}
}
},
_ => false,
},
+ QPath::LangItem(..) => false,
}
}
pub fn qpath_res(cx: &LateContext<'_>, qpath: &hir::QPath<'_>, id: hir::HirId) -> Res {
match qpath {
hir::QPath::Resolved(_, path) => path.res,
- hir::QPath::TypeRelative(..) => {
+ hir::QPath::TypeRelative(..) | hir::QPath::LangItem(..) => {
if cx.tcx.has_typeck_results(id.owner.to_def_id()) {
cx.tcx.typeck(id.owner.to_def_id().expect_local()).qpath_res(qpath, id)
} else {
pub const PTR_EQ: [&str; 3] = ["core", "ptr", "eq"];
pub const PTR_NULL: [&str; 2] = ["ptr", "null"];
pub const PTR_NULL_MUT: [&str; 2] = ["ptr", "null_mut"];
-pub const RANGE: [&str; 3] = ["core", "ops", "Range"];
pub const RANGE_ARGUMENT_TRAIT: [&str; 3] = ["core", "ops", "RangeBounds"];
-pub const RANGE_FROM: [&str; 3] = ["core", "ops", "RangeFrom"];
-pub const RANGE_FROM_STD: [&str; 3] = ["std", "ops", "RangeFrom"];
-pub const RANGE_FULL: [&str; 4] = ["core", "ops", "range", "RangeFull"];
-pub const RANGE_FULL_STD: [&str; 3] = ["std", "ops", "RangeFull"];
-pub const RANGE_INCLUSIVE_NEW: [&str; 4] = ["core", "ops", "RangeInclusive", "new"];
-pub const RANGE_INCLUSIVE_STD_NEW: [&str; 4] = ["std", "ops", "RangeInclusive", "new"];
-pub const RANGE_STD: [&str; 3] = ["std", "ops", "Range"];
-pub const RANGE_TO: [&str; 3] = ["core", "ops", "RangeTo"];
-pub const RANGE_TO_INCLUSIVE: [&str; 3] = ["core", "ops", "RangeToInclusive"];
-pub const RANGE_TO_INCLUSIVE_STD: [&str; 3] = ["std", "ops", "RangeToInclusive"];
-pub const RANGE_TO_STD: [&str; 3] = ["std", "ops", "RangeTo"];
pub const RC: [&str; 3] = ["alloc", "rc", "Rc"];
pub const RC_PTR_EQ: [&str; 4] = ["alloc", "rc", "Rc", "ptr_eq"];
pub const RECEIVER: [&str; 4] = ["std", "sync", "mpsc", "Receiver"];
pub const TO_STRING_METHOD: [&str; 4] = ["alloc", "string", "ToString", "to_string"];
pub const TRANSMUTE: [&str; 4] = ["core", "intrinsics", "", "transmute"];
pub const TRY_FROM: [&str; 4] = ["core", "convert", "TryFrom", "try_from"];
-pub const TRY_INTO_RESULT: [&str; 4] = ["std", "ops", "Try", "into_result"];
pub const TRY_INTO_TRAIT: [&str; 3] = ["core", "convert", "TryInto"];
pub const VEC: [&str; 3] = ["alloc", "vec", "Vec"];
pub const VEC_AS_MUT_SLICE: [&str; 4] = ["alloc", "vec", "Vec", "as_mut_slice"];
pub fn hir_opt(cx: &LateContext<'_>, expr: &hir::Expr<'_>) -> Option<Self> {
snippet_opt(cx, expr.span).map(|snippet| {
let snippet = Cow::Owned(snippet);
- Self::hir_from_snippet(cx, expr, snippet)
+ Self::hir_from_snippet(expr, snippet)
})
}
pub fn hir_with_macro_callsite(cx: &LateContext<'_>, expr: &hir::Expr<'_>, default: &'a str) -> Self {
let snippet = snippet_with_macro_callsite(cx, expr.span, default);
- Self::hir_from_snippet(cx, expr, snippet)
+ Self::hir_from_snippet(expr, snippet)
}
/// Generate a suggestion for an expression with the given snippet. This is used by the `hir_*`
/// function variants of `Sugg`, since these use different snippet functions.
- fn hir_from_snippet(cx: &LateContext<'_>, expr: &hir::Expr<'_>, snippet: Cow<'a, str>) -> Self {
- if let Some(range) = higher::range(cx, expr) {
+ fn hir_from_snippet(expr: &hir::Expr<'_>, snippet: Cow<'a, str>) -> Self {
+ if let Some(range) = higher::range(expr) {
let op = match range.limits {
ast::RangeLimits::HalfOpen => AssocOp::DotDot,
ast::RangeLimits::Closed => AssocOp::DotDotEq,
use rustc_span::source_map::Spanned;
use crate::utils::{match_def_path, paths};
-use rustc_ast::ast::LitKind;
+use rustc_ast::LitKind;
use rustc_hir as hir;
declare_clippy_lint! {
if let ExprKind::Match(ref expr1, ref arms, MatchSource::ForLoopDesugar) = expr.kind;
if let ExprKind::Call(ref func, ref args) = expr1.kind;
if let ExprKind::Path(ref path) = func.kind;
- if match_qpath(path, &["{{root}}", "std", "iter", "IntoIterator", "into_iter"]);
+ if matches!(path, QPath::LangItem(LangItem::IntoIterIntoIter, _));
if args.len() == 1;
if let ExprKind::Struct(ref path1, ref fields, None) = args[0].kind;
- if match_qpath(path1, &["{{root}}", "std", "ops", "Range"]);
+ if matches!(path1, QPath::LangItem(LangItem::Range, _));
if fields.len() == 2;
// unimplemented: field checks
if arms.len() == 1;
if let ExprKind::Match(ref expr2, ref arms1, MatchSource::ForLoopDesugar) = e.kind;
if let ExprKind::Call(ref func1, ref args1) = expr2.kind;
if let ExprKind::Path(ref path2) = func1.kind;
- if match_qpath(path2, &["{{root}}", "std", "iter", "Iterator", "next"]);
+ if matches!(path2, QPath::LangItem(LangItem::IteratorNext, _));
if args1.len() == 1;
if let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Mut, ref inner) = args1[0].kind;
if let ExprKind::Path(ref path3) = inner.kind;
if match_qpath(path4, &["__next"]);
if let ExprKind::Path(ref path5) = value.kind;
if match_qpath(path5, &["val"]);
- if let PatKind::TupleStruct(ref path6, ref fields1, None) = arms1[0].pat.kind;
- if match_qpath(path6, &["{{root}}", "std", "option", "Option", "Some"]);
+ if let PatKind::Struct(ref path6, ref fields1, false) = arms1[0].pat.kind;
+ if matches!(path6, QPath::LangItem(LangItem::OptionSome, _));
if fields1.len() == 1;
// unimplemented: field checks
if let ExprKind::Break(ref destination, None) = arms1[1].body.kind;
- if let PatKind::Path(ref path7) = arms1[1].pat.kind;
- if match_qpath(path7, &["{{root}}", "std", "option", "Option", "None"]);
+ if let PatKind::Struct(ref path7, ref fields2, false) = arms1[1].pat.kind;
+ if matches!(path7, QPath::LangItem(LangItem::OptionNone, _));
+ if fields2.len() == 0;
+ // unimplemented: field checks
if let StmtKind::Local(ref local1) = body.stmts[2].kind;
if let Some(ref init) = local1.init;
if let ExprKind::Path(ref path8) = init.kind;
-Subproject commit 1bfb26d6cae6f535ac1034877635fc0cef87fe64
+Subproject commit 2d6d73fafe2f087354f7cea37297cd81316cae98
-Subproject commit 942aa2b5d729a63f8b81592ab7b2720b63a884e9
+Subproject commit 48ef96dd00b90d950a122ca180923aba77efaf74
-Subproject commit c9c518e5e9761bf35d466c47c57c3a1358b56b3c
+Subproject commit 0b2b9a5508186c16a2e782f47ce7e0e1c5fb8d33
"Unlicense/MIT",
"Unlicense OR MIT",
"0BSD OR MIT OR Apache-2.0", // adler license
+ "Zlib OR Apache-2.0 OR MIT", // tinyvec
];
/// These are exceptions to Rust's permissive licensing policy, and
/// tooling. It is _crucial_ that no exception crates be dependencies
/// of the Rust runtime (std/test).
const EXCEPTIONS: &[(&str, &str)] = &[
- ("mdbook", "MPL-2.0"), // mdbook
- ("openssl", "Apache-2.0"), // cargo, mdbook
- ("rdrand", "ISC"), // mdbook, rustfmt
- ("fuchsia-cprng", "BSD-3-Clause"), // mdbook, rustfmt
- ("fuchsia-zircon-sys", "BSD-3-Clause"), // rustdoc, rustc, cargo
- ("fuchsia-zircon", "BSD-3-Clause"), // rustdoc, rustc, cargo (jobserver & tempdir)
- ("colored", "MPL-2.0"), // rustfmt
- ("ordslice", "Apache-2.0"), // rls
- ("cloudabi", "BSD-2-Clause"), // (rls -> crossbeam-channel 0.2 -> rand 0.5)
- ("ryu", "Apache-2.0 OR BSL-1.0"), // rls/cargo/... (because of serde)
- ("bytesize", "Apache-2.0"), // cargo
- ("im-rc", "MPL-2.0+"), // cargo
- ("constant_time_eq", "CC0-1.0"), // rustfmt
- ("sized-chunks", "MPL-2.0+"), // cargo via im-rc
- ("bitmaps", "MPL-2.0+"), // cargo via im-rc
+ ("mdbook", "MPL-2.0"), // mdbook
+ ("openssl", "Apache-2.0"), // cargo, mdbook
+ ("fuchsia-zircon-sys", "BSD-3-Clause"), // rustdoc, rustc, cargo
+ ("fuchsia-zircon", "BSD-3-Clause"), // rustdoc, rustc, cargo (jobserver & tempdir)
+ ("colored", "MPL-2.0"), // rustfmt
+ ("ordslice", "Apache-2.0"), // rls
+ ("cloudabi", "BSD-2-Clause"), // (rls -> crossbeam-channel 0.2 -> rand 0.5)
+ ("ryu", "Apache-2.0 OR BSL-1.0"), // rls/cargo/... (because of serde)
+ ("bytesize", "Apache-2.0"), // cargo
+ ("im-rc", "MPL-2.0+"), // cargo
+ ("constant_time_eq", "CC0-1.0"), // rustfmt
+ ("sized-chunks", "MPL-2.0+"), // cargo via im-rc
+ ("bitmaps", "MPL-2.0+"), // cargo via im-rc
+ ("crossbeam-queue", "MIT/Apache-2.0 AND BSD-2-Clause"), // rls via rayon
+ ("arrayref", "BSD-2-Clause"), // cargo-miri/directories/.../rust-argon2 (redox)
+ ("instant", "BSD-3-Clause"), // rustc_driver/tracing-subscriber/parking_lot
// FIXME: this dependency violates the documentation comment above:
("fortanix-sgx-abi", "MPL-2.0"), // libstd but only for `sgx` target
- ("crossbeam-channel", "MIT/Apache-2.0 AND BSD-2-Clause"), // cargo
];
/// These are the root crates that are part of the runtime. The licenses for
"bitflags",
"block-buffer",
"block-padding",
- "byte-tools",
"byteorder",
+ "byte-tools",
"cc",
"cfg-if",
"chalk-derive",
"hermit-abi",
"humantime",
"indexmap",
+ "instant",
"itertools",
"jobserver",
"kernel32-sys",
"lock_api",
"log",
"log_settings",
+ "maybe-uninit",
"md-5",
"measureme",
"memchr",
"memmap",
"memoffset",
"miniz_oxide",
- "nodrop",
"num_cpus",
"object",
"once_cell",
}
Some(pkg_license) => {
if pkg_license.as_str() != *license {
+ if *name == "crossbeam-queue"
+ && *license == "MIT/Apache-2.0 AND BSD-2-Clause"
+ {
+ // We have two versions of crossbeam-queue and both
+ // are fine.
+ continue;
+ }
+
println!("dependency exception `{}` license has changed", name);
println!(" previously `{}` now `{}`", license, pkg_license);
println!(" update EXCEPTIONS for the new license");