Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal error: entered unreachable code: we captured two identical projections #104649

Closed
shepmaster opened this issue Nov 20, 2022 · 9 comments · Fixed by #104697
Closed

internal error: entered unreachable code: we captured two identical projections #104649

shepmaster opened this issue Nov 20, 2022 · 9 comments · Fixed by #104697
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@shepmaster
Copy link
Member

shepmaster commented Nov 20, 2022

Code

[package]
name = "repro"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
reqwest = { version = "0.11", features = ["json", "brotli", "gzip", "native-tls", "deflate"] }
tokio = { version = "1", features = ["full"] }
futures = "0.3.25"
snafu = { version = "0.7.3", features = ["rust_1_61", "backtraces-impl-std"] }

[profile.release]
debug = true
Cargo.lock
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3

[[package]]
name = "adler"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"

[[package]]
name = "alloc-no-stdlib"
version = "2.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3"

[[package]]
name = "alloc-stdlib"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece"
dependencies = [
 "alloc-no-stdlib",
]

[[package]]
name = "async-compression"
version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a"
dependencies = [
 "brotli",
 "flate2",
 "futures-core",
 "memchr",
 "pin-project-lite",
 "tokio",
]

[[package]]
name = "autocfg"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"

[[package]]
name = "base64"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8"

[[package]]
name = "bitflags"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"

[[package]]
name = "brotli"
version = "3.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68"
dependencies = [
 "alloc-no-stdlib",
 "alloc-stdlib",
 "brotli-decompressor",
]

[[package]]
name = "brotli-decompressor"
version = "2.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59ad2d4653bf5ca36ae797b1f4bb4dbddb60ce49ca4aed8a2ce4829f60425b80"
dependencies = [
 "alloc-no-stdlib",
 "alloc-stdlib",
]

[[package]]
name = "bumpalo"
version = "3.11.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba"

[[package]]
name = "bytes"
version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db"

[[package]]
name = "cc"
version = "1.0.76"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "76a284da2e6fe2092f2353e51713435363112dfd60030e22add80be333fb928f"

[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"

[[package]]
name = "core-foundation"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146"
dependencies = [
 "core-foundation-sys",
 "libc",
]

[[package]]
name = "core-foundation-sys"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc"

[[package]]
name = "crc32fast"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d"
dependencies = [
 "cfg-if",
]

[[package]]
name = "doc-comment"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"

[[package]]
name = "encoding_rs"
version = "0.8.31"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b"
dependencies = [
 "cfg-if",
]

[[package]]
name = "fastrand"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499"
dependencies = [
 "instant",
]

[[package]]
name = "flate2"
version = "1.0.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6"
dependencies = [
 "crc32fast",
 "miniz_oxide",
]

[[package]]
name = "fnv"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"

[[package]]
name = "foreign-types"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
dependencies = [
 "foreign-types-shared",
]

[[package]]
name = "foreign-types-shared"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"

[[package]]
name = "form_urlencoded"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8"
dependencies = [
 "percent-encoding",
]

[[package]]
name = "futures"
version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0"
dependencies = [
 "futures-channel",
 "futures-core",
 "futures-executor",
 "futures-io",
 "futures-sink",
 "futures-task",
 "futures-util",
]

[[package]]
name = "futures-channel"
version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed"
dependencies = [
 "futures-core",
 "futures-sink",
]

[[package]]
name = "futures-core"
version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac"

[[package]]
name = "futures-executor"
version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2"
dependencies = [
 "futures-core",
 "futures-task",
 "futures-util",
]

[[package]]
name = "futures-io"
version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb"

[[package]]
name = "futures-macro"
version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d"
dependencies = [
 "proc-macro2",
 "quote",
 "syn",
]

[[package]]
name = "futures-sink"
version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9"

[[package]]
name = "futures-task"
version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea"

[[package]]
name = "futures-util"
version = "0.3.25"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6"
dependencies = [
 "futures-channel",
 "futures-core",
 "futures-io",
 "futures-macro",
 "futures-sink",
 "futures-task",
 "memchr",
 "pin-project-lite",
 "pin-utils",
 "slab",
]

[[package]]
name = "h2"
version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4"
dependencies = [
 "bytes",
 "fnv",
 "futures-core",
 "futures-sink",
 "futures-util",
 "http",
 "indexmap",
 "slab",
 "tokio",
 "tokio-util",
 "tracing",
]

[[package]]
name = "hashbrown"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"

[[package]]
name = "heck"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9"

[[package]]
name = "hermit-abi"
version = "0.1.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
dependencies = [
 "libc",
]

[[package]]
name = "http"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399"
dependencies = [
 "bytes",
 "fnv",
 "itoa",
]

[[package]]
name = "http-body"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1"
dependencies = [
 "bytes",
 "http",
 "pin-project-lite",
]

[[package]]
name = "httparse"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904"

[[package]]
name = "httpdate"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421"

[[package]]
name = "hyper"
version = "0.14.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c"
dependencies = [
 "bytes",
 "futures-channel",
 "futures-core",
 "futures-util",
 "h2",
 "http",
 "http-body",
 "httparse",
 "httpdate",
 "itoa",
 "pin-project-lite",
 "socket2",
 "tokio",
 "tower-service",
 "tracing",
 "want",
]

[[package]]
name = "hyper-tls"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
dependencies = [
 "bytes",
 "hyper",
 "native-tls",
 "tokio",
 "tokio-native-tls",
]

[[package]]
name = "idna"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6"
dependencies = [
 "unicode-bidi",
 "unicode-normalization",
]

[[package]]
name = "indexmap"
version = "1.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399"
dependencies = [
 "autocfg",
 "hashbrown",
]

[[package]]
name = "instant"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
dependencies = [
 "cfg-if",
]

[[package]]
name = "ipnet"
version = "2.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745"

[[package]]
name = "itoa"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc"

[[package]]
name = "js-sys"
version = "0.3.60"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47"
dependencies = [
 "wasm-bindgen",
]

[[package]]
name = "lazy_static"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"

[[package]]
name = "libc"
version = "0.2.137"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89"

[[package]]
name = "lock_api"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df"
dependencies = [
 "autocfg",
 "scopeguard",
]

[[package]]
name = "log"
version = "0.4.17"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e"
dependencies = [
 "cfg-if",
]

[[package]]
name = "memchr"
version = "2.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"

[[package]]
name = "mime"
version = "0.3.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d"

[[package]]
name = "miniz_oxide"
version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34"
dependencies = [
 "adler",
]

[[package]]
name = "mio"
version = "0.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de"
dependencies = [
 "libc",
 "log",
 "wasi",
 "windows-sys 0.42.0",
]

[[package]]
name = "native-tls"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e"
dependencies = [
 "lazy_static",
 "libc",
 "log",
 "openssl",
 "openssl-probe",
 "openssl-sys",
 "schannel",
 "security-framework",
 "security-framework-sys",
 "tempfile",
]

[[package]]
name = "num_cpus"
version = "1.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5"
dependencies = [
 "hermit-abi",
 "libc",
]

[[package]]
name = "once_cell"
version = "1.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860"

[[package]]
name = "openssl"
version = "0.10.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13"
dependencies = [
 "bitflags",
 "cfg-if",
 "foreign-types",
 "libc",
 "once_cell",
 "openssl-macros",
 "openssl-sys",
]

[[package]]
name = "openssl-macros"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c"
dependencies = [
 "proc-macro2",
 "quote",
 "syn",
]

[[package]]
name = "openssl-probe"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"

[[package]]
name = "openssl-sys"
version = "0.9.77"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a"
dependencies = [
 "autocfg",
 "cc",
 "libc",
 "pkg-config",
 "vcpkg",
]

[[package]]
name = "parking_lot"
version = "0.12.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f"
dependencies = [
 "lock_api",
 "parking_lot_core",
]

[[package]]
name = "parking_lot_core"
version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0"
dependencies = [
 "cfg-if",
 "libc",
 "redox_syscall",
 "smallvec",
 "windows-sys 0.42.0",
]

[[package]]
name = "percent-encoding"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"

[[package]]
name = "pin-project-lite"
version = "0.2.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116"

[[package]]
name = "pin-utils"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"

[[package]]
name = "pkg-config"
version = "0.3.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160"

[[package]]
name = "playground-rust"
version = "0.1.0"
dependencies = [
 "futures",
 "reqwest",
 "snafu",
 "tokio",
]

[[package]]
name = "proc-macro2"
version = "1.0.47"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725"
dependencies = [
 "unicode-ident",
]

[[package]]
name = "quote"
version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179"
dependencies = [
 "proc-macro2",
]

[[package]]
name = "redox_syscall"
version = "0.2.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a"
dependencies = [
 "bitflags",
]

[[package]]
name = "remove_dir_all"
version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
dependencies = [
 "winapi",
]

[[package]]
name = "reqwest"
version = "0.11.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c"
dependencies = [
 "async-compression",
 "base64",
 "bytes",
 "encoding_rs",
 "futures-core",
 "futures-util",
 "h2",
 "http",
 "http-body",
 "hyper",
 "hyper-tls",
 "ipnet",
 "js-sys",
 "log",
 "mime",
 "native-tls",
 "once_cell",
 "percent-encoding",
 "pin-project-lite",
 "serde",
 "serde_json",
 "serde_urlencoded",
 "tokio",
 "tokio-native-tls",
 "tokio-util",
 "tower-service",
 "url",
 "wasm-bindgen",
 "wasm-bindgen-futures",
 "web-sys",
 "winreg",
]

[[package]]
name = "ryu"
version = "1.0.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09"

[[package]]
name = "schannel"
version = "0.1.20"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2"
dependencies = [
 "lazy_static",
 "windows-sys 0.36.1",
]

[[package]]
name = "scopeguard"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"

[[package]]
name = "security-framework"
version = "2.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c"
dependencies = [
 "bitflags",
 "core-foundation",
 "core-foundation-sys",
 "libc",
 "security-framework-sys",
]

[[package]]
name = "security-framework-sys"
version = "2.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556"
dependencies = [
 "core-foundation-sys",
 "libc",
]

[[package]]
name = "serde"
version = "1.0.147"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965"

[[package]]
name = "serde_json"
version = "1.0.88"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e8b3801309262e8184d9687fb697586833e939767aea0dda89f5a8e650e8bd7"
dependencies = [
 "itoa",
 "ryu",
 "serde",
]

[[package]]
name = "serde_urlencoded"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd"
dependencies = [
 "form_urlencoded",
 "itoa",
 "ryu",
 "serde",
]

[[package]]
name = "signal-hook-registry"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0"
dependencies = [
 "libc",
]

[[package]]
name = "slab"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef"
dependencies = [
 "autocfg",
]

[[package]]
name = "smallvec"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0"

[[package]]
name = "snafu"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a152ba99b054b22972ee794cf04e5ef572da1229e33b65f3c57abbff0525a454"
dependencies = [
 "doc-comment",
 "snafu-derive",
]

[[package]]
name = "snafu-derive"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5e79cdebbabaebb06a9bdbaedc7f159b410461f63611d4d0e3fb0fab8fed850"
dependencies = [
 "heck",
 "proc-macro2",
 "quote",
 "syn",
]

[[package]]
name = "socket2"
version = "0.4.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd"
dependencies = [
 "libc",
 "winapi",
]

[[package]]
name = "syn"
version = "1.0.103"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d"
dependencies = [
 "proc-macro2",
 "quote",
 "unicode-ident",
]

[[package]]
name = "tempfile"
version = "3.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4"
dependencies = [
 "cfg-if",
 "fastrand",
 "libc",
 "redox_syscall",
 "remove_dir_all",
 "winapi",
]

[[package]]
name = "tinyvec"
version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50"
dependencies = [
 "tinyvec_macros",
]

[[package]]
name = "tinyvec_macros"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"

[[package]]
name = "tokio"
version = "1.22.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d76ce4a75fb488c605c54bf610f221cea8b0dafb53333c1a67e8ee199dcd2ae3"
dependencies = [
 "autocfg",
 "bytes",
 "libc",
 "memchr",
 "mio",
 "num_cpus",
 "parking_lot",
 "pin-project-lite",
 "signal-hook-registry",
 "socket2",
 "tokio-macros",
 "winapi",
]

[[package]]
name = "tokio-macros"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484"
dependencies = [
 "proc-macro2",
 "quote",
 "syn",
]

[[package]]
name = "tokio-native-tls"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b"
dependencies = [
 "native-tls",
 "tokio",
]

[[package]]
name = "tokio-util"
version = "0.7.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740"
dependencies = [
 "bytes",
 "futures-core",
 "futures-sink",
 "pin-project-lite",
 "tokio",
 "tracing",
]

[[package]]
name = "tower-service"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52"

[[package]]
name = "tracing"
version = "0.1.37"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
dependencies = [
 "cfg-if",
 "pin-project-lite",
 "tracing-core",
]

[[package]]
name = "tracing-core"
version = "0.1.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a"
dependencies = [
 "once_cell",
]

[[package]]
name = "try-lock"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642"

[[package]]
name = "unicode-bidi"
version = "0.3.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992"

[[package]]
name = "unicode-ident"
version = "1.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3"

[[package]]
name = "unicode-normalization"
version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921"
dependencies = [
 "tinyvec",
]

[[package]]
name = "url"
version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643"
dependencies = [
 "form_urlencoded",
 "idna",
 "percent-encoding",
]

[[package]]
name = "vcpkg"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"

[[package]]
name = "want"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0"
dependencies = [
 "log",
 "try-lock",
]

[[package]]
name = "wasi"
version = "0.11.0+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"

[[package]]
name = "wasm-bindgen"
version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268"
dependencies = [
 "cfg-if",
 "wasm-bindgen-macro",
]

[[package]]
name = "wasm-bindgen-backend"
version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142"
dependencies = [
 "bumpalo",
 "log",
 "once_cell",
 "proc-macro2",
 "quote",
 "syn",
 "wasm-bindgen-shared",
]

[[package]]
name = "wasm-bindgen-futures"
version = "0.4.33"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d"
dependencies = [
 "cfg-if",
 "js-sys",
 "wasm-bindgen",
 "web-sys",
]

[[package]]
name = "wasm-bindgen-macro"
version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810"
dependencies = [
 "quote",
 "wasm-bindgen-macro-support",
]

[[package]]
name = "wasm-bindgen-macro-support"
version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c"
dependencies = [
 "proc-macro2",
 "quote",
 "syn",
 "wasm-bindgen-backend",
 "wasm-bindgen-shared",
]

[[package]]
name = "wasm-bindgen-shared"
version = "0.2.83"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f"

[[package]]
name = "web-sys"
version = "0.3.60"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f"
dependencies = [
 "js-sys",
 "wasm-bindgen",
]

[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [
 "winapi-i686-pc-windows-gnu",
 "winapi-x86_64-pc-windows-gnu",
]

[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"

[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"

[[package]]
name = "windows-sys"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2"
dependencies = [
 "windows_aarch64_msvc 0.36.1",
 "windows_i686_gnu 0.36.1",
 "windows_i686_msvc 0.36.1",
 "windows_x86_64_gnu 0.36.1",
 "windows_x86_64_msvc 0.36.1",
]

[[package]]
name = "windows-sys"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
dependencies = [
 "windows_aarch64_gnullvm",
 "windows_aarch64_msvc 0.42.0",
 "windows_i686_gnu 0.42.0",
 "windows_i686_msvc 0.42.0",
 "windows_x86_64_gnu 0.42.0",
 "windows_x86_64_gnullvm",
 "windows_x86_64_msvc 0.42.0",
]

[[package]]
name = "windows_aarch64_gnullvm"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e"

[[package]]
name = "windows_aarch64_msvc"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47"

[[package]]
name = "windows_aarch64_msvc"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4"

[[package]]
name = "windows_i686_gnu"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6"

[[package]]
name = "windows_i686_gnu"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7"

[[package]]
name = "windows_i686_msvc"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024"

[[package]]
name = "windows_i686_msvc"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246"

[[package]]
name = "windows_x86_64_gnu"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1"

[[package]]
name = "windows_x86_64_gnu"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed"

[[package]]
name = "windows_x86_64_gnullvm"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028"

[[package]]
name = "windows_x86_64_msvc"
version = "0.36.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"

[[package]]
name = "windows_x86_64_msvc"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5"

[[package]]
name = "winreg"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d"
dependencies = [
 "winapi",
]
use futures::{stream, StreamExt};
use snafu::prelude::*;
use std::time::{Duration, Instant};

const REQUEST_COUNT: usize = 10;
const CONCURRENT_REQUESTS: usize = 1_000;

#[tokio::main]
async fn main() -> Result<()> {
    let client = reqwest::Client::builder()
        .build()
        .unwrap();

    let urls = vec![String::from("http://example.com"); REQUEST_COUNT];

    // Concurrent Requests
    let bodies = stream::iter(urls)
        .map(|url| {
            let req = client.get(&url);
            tokio::spawn(async move {
                let resp = req.send().await.unwrap();
                let text = resp.text().await.unwrap();
                Result::Ok((url, text))
            })
        })
        .buffer_unordered(CONCURRENT_REQUESTS);

    bodies
        .for_each(|b| async {
            match b {
                Ok(Ok((url, b))) => {}
                Err(e) => {}
                Ok(Err(e)) => {}
            }
        })
        .await;

    Ok(())
}

#[derive(Debug, Snafu)]
struct Error;

type Result<T, E = Error> = ::core::result::Result<T, E>;

Meta

rustc --version --verbose:

rustc 1.65.0 (897e37553 2022-11-02)
binary: rustc
commit-hash: 897e37553bba8b42751c67658967889d11ecd120
commit-date: 2022-11-02
host: aarch64-unknown-linux-gnu
release: 1.65.0
LLVM version: 15.0.0

Error output

$ cargo build
   Compiling proc-macro2 v1.0.47
   Compiling libc v0.2.137
   Compiling log v0.4.17
   Compiling lock_api v0.4.9
   Compiling memchr v2.5.0
   Compiling futures-core v0.3.25
   Compiling slab v0.4.7
   Compiling futures-task v0.3.25
   Compiling futures-channel v0.3.25
   Compiling tracing v0.1.37
   Compiling native-tls v0.2.11
   Compiling indexmap v1.9.1
   Compiling unicase v2.6.0
   Compiling want v0.3.0
   Compiling quote v1.0.21
   Compiling signal-hook-registry v1.4.0
   Compiling parking_lot_core v0.9.4
   Compiling mio v0.8.5
   Compiling socket2 v0.4.7
   Compiling num_cpus v1.14.0
   Compiling syn v1.0.103
   Compiling parking_lot v0.12.1
   Compiling openssl-sys v0.9.77
   Compiling mime_guess v2.0.4
   Compiling httparse v1.8.0
   Compiling crc32fast v1.3.2
   Compiling parking_lot_core v0.8.5
   Compiling flate2 v1.0.24
   Compiling getrandom v0.2.8
   Compiling mio v0.7.14
   Compiling encoding_rs v0.8.31
   Compiling rand_core v0.6.4
   Compiling parking_lot v0.11.2
   Compiling signal-hook v0.1.17
   Compiling rand_chacha v0.3.1
   Compiling libmimalloc-sys v0.1.27
   Compiling doc-comment v0.3.3
   Compiling anyhow v1.0.66
   Compiling crossterm v0.19.0
   Compiling tower v0.4.13
   Compiling rand v0.8.5
   Compiling mimalloc v0.1.31
   Compiling colour v0.6.0
   Compiling tokio-macros v1.8.0
   Compiling futures-macro v0.3.25
   Compiling openssl-macros v0.1.0
   Compiling serde_derive v1.0.147
   Compiling thiserror-impl v1.0.37
   Compiling snafu-derive v0.7.3
   Compiling async-trait v0.1.58
   Compiling openssl v0.10.42
   Compiling tokio v1.21.2
   Compiling futures-util v0.3.25
   Compiling thiserror v1.0.37
   Compiling snafu v0.7.3
   Compiling serde v1.0.147
   Compiling futures-executor v0.3.25
   Compiling futures v0.3.25
   Compiling tokio-util v0.7.4
   Compiling tokio-native-tls v0.3.0
   Compiling async-compression v0.3.15
   Compiling task-local-extensions v0.1.3
   Compiling h2 v0.3.15
   Compiling serde_json v1.0.87
   Compiling serde_urlencoded v0.7.1
   Compiling hyper v0.14.23
   Compiling hyper-tls v0.5.0
   Compiling reqwest v0.11.12
   Compiling reqwest-middleware v0.1.6
   Compiling playground-rust v0.1.0 (/home/shep/rust/code-review/candybar/playground-rust-repro)
error[E0412]: cannot find type `Url` in this scope
   --> src/main.rs:132:56
    |
132 |     UnableToSendRequest { source: reqwest::Error, url: Url },
    |                                                        ^^^ not found in this scope
    |
help: consider importing this struct
    |
1   | use reqwest::Url;
    |

error[E0412]: cannot find type `Url` in this scope
   --> src/main.rs:134:56
    |
134 |     UnableToGetTextBody { source: reqwest::Error, url: Url },
    |                                                        ^^^ not found in this scope
    |
help: consider importing this struct
    |
1   | use reqwest::Url;
    |

thread 'rustc' panicked at 'internal error: entered unreachable code: we captured two identical projections: capture1 = CapturedPlace { place: Place { base_ty: std::result::Result<std::result::Result<(std::string::String, std::string::String), _>, tokio::task::JoinError>, base: Upvar(UpvarId(HirId { owner: DefId(0:71 ~ playground_rust[8bc6]::main), local_id: 292 };`b`;DefId(0:77 ~ playground_rust[8bc6]::main::{closure#0}::{closure#0}::{closure#1}::{closure#0}))), projections: [Projection { ty: tokio::task::JoinError, kind: Field(0, 1) }] }, info: CaptureInfo { capture_kind_expr_id: Some(HirId { owner: DefId(0:71 ~ playground_rust[8bc6]::main), local_id: 297 }), path_expr_id: Some(HirId { owner: DefId(0:71 ~ playground_rust[8bc6]::main), local_id: 297 }), capture_kind: ByValue }, mutability: Not, region: None }, capture2 = CapturedPlace { place: Place { base_ty: std::result::Result<std::result::Result<(std::string::String, std::string::String), _>, tokio::task::JoinError>, base: Upvar(UpvarId(HirId { owner: DefId(0:71 ~ playground_rust[8bc6]::main), local_id: 292 };`b`;DefId(0:77 ~ playground_rust[8bc6]::main::{closure#0}::{closure#0}::{closure#1}::{closure#0}))), projections: [Projection { ty: std::result::Result<(std::string::String, std::string::String), _>, kind: Field(0, 0) }, Projection { ty: (std::string::String, std::string::String), kind: Field(0, 0) }, Projection { ty: std::string::String, kind: Field(1, 0) }] }, info: CaptureInfo { capture_kind_expr_id: Some(HirId { owner: DefId(0:71 ~ playground_rust[8bc6]::main), local_id: 297 }), path_expr_id: Some(HirId { owner: DefId(0:71 ~ playground_rust[8bc6]::main), local_id: 297 }), capture_kind: ByValue }, mutability: Not, region: None }', compiler/rustc_typeck/src/check/upvar.rs:712:17
stack backtrace:
   0:     0xffff9512dc40 - std::backtrace_rs::backtrace::libunwind::trace::h3b33c9cccdb04951
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0xffff9512dc40 - std::backtrace_rs::backtrace::trace_unsynchronized::h97f8a977acdf46b5
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0xffff9512dc40 - std::sys_common::backtrace::_print_fmt::h29a91018436399e1
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:66:5
   3:     0xffff9512dc40 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h5d71176f0c544d59
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:45:22
   4:     0xffff9517f794 - core::fmt::write::h7af9795d503e934d
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/fmt/mod.rs:1202:17
   5:     0xffff9511fefc - std::io::Write::write_fmt::h91d11b3091303616
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/io/mod.rs:1679:15
   6:     0xffff95130564 - std::sys_common::backtrace::_print::he156c8869851e532
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:48:5
   7:     0xffff95130564 - std::sys_common::backtrace::print::hd743019ecc0b72d3
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:35:9
   8:     0xffff95130564 - std::panicking::default_hook::{{closure}}::h7d67dd897e63f9d0
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:295:22
   9:     0xffff9513026c - std::panicking::default_hook::h400646a36e95f555
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:314:9
  10:     0xffff95d7736c - rustc_driver[707bca65092ca961]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0xffff95130d08 - std::panicking::rust_panic_with_hook::hd6f5d74b6033aefe
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:702:17
  12:     0xffff95130b70 - std::panicking::begin_panic_handler::{{closure}}::hfbcfd3f1517a4e00
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:588:13
  13:     0xffff9512e0d0 - std::sys_common::backtrace::__rust_end_short_backtrace::h53abd2304f3f7468
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:138:18
  14:     0xffff951308b4 - rust_begin_unwind
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:584:5
  15:     0xffff950fbdbc - core::panicking::panic_fmt::h34b2b0205eaf5cf3
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/panicking.rs:142:14
  16:     0xffff98f5fa1c - <[rustc_middle[8eb223e2294dc9c]::ty::closure::CapturedPlace]>::sort_by::<<rustc_typeck[ab74e667ce3174e8]::check::fn_ctxt::FnCtxt>::compute_min_captures::{closure#1}>::{closure#0}
  17:     0xffff98f4f244 - alloc[268feb060e59a892]::slice::merge_sort::<rustc_middle[8eb223e2294dc9c]::ty::closure::CapturedPlace, <[rustc_middle[8eb223e2294dc9c]::ty::closure::CapturedPlace]>::sort_by<<rustc_typeck[ab74e667ce3174e8]::check::fn_ctxt::FnCtxt>::compute_min_captures::{closure#1}>::{closure#0}>
  18:     0xffff98cf7804 - <rustc_typeck[ab74e667ce3174e8]::check::fn_ctxt::FnCtxt>::compute_min_captures
  19:     0xffff98d0dabc - <rustc_typeck[ab74e667ce3174e8]::check::fn_ctxt::FnCtxt>::analyze_closure
  20:     0xffff98f397f0 - <rustc_typeck[ab74e667ce3174e8]::check::upvar::InferBorrowKindVisitor as rustc_hir[23f83174b72da2b]::intravisit::Visitor>::visit_expr
  21:     0xffff98f128e4 - rustc_hir[23f83174b72da2b]::intravisit::walk_expr::<rustc_typeck[ab74e667ce3174e8]::check::upvar::InferBorrowKindVisitor>
  22:     0xffff98f397d0 - <rustc_typeck[ab74e667ce3174e8]::check::upvar::InferBorrowKindVisitor as rustc_hir[23f83174b72da2b]::intravisit::Visitor>::visit_expr
  23:     0xffff98f12cbc - rustc_hir[23f83174b72da2b]::intravisit::walk_expr::<rustc_typeck[ab74e667ce3174e8]::check::upvar::InferBorrowKindVisitor>
  24:     0xffff98f128e4 - rustc_hir[23f83174b72da2b]::intravisit::walk_expr::<rustc_typeck[ab74e667ce3174e8]::check::upvar::InferBorrowKindVisitor>
  25:     0xffff98f12a5c - rustc_hir[23f83174b72da2b]::intravisit::walk_expr::<rustc_typeck[ab74e667ce3174e8]::check::upvar::InferBorrowKindVisitor>
  26:     0xffff98f12b70 - rustc_hir[23f83174b72da2b]::intravisit::walk_expr::<rustc_typeck[ab74e667ce3174e8]::check::upvar::InferBorrowKindVisitor>
  27:     0xffff98f397d0 - <rustc_typeck[ab74e667ce3174e8]::check::upvar::InferBorrowKindVisitor as rustc_hir[23f83174b72da2b]::intravisit::Visitor>::visit_expr
  28:     0xffff98f128e4 - rustc_hir[23f83174b72da2b]::intravisit::walk_expr::<rustc_typeck[ab74e667ce3174e8]::check::upvar::InferBorrowKindVisitor>
  29:     0xffff98ef81e4 - rustc_hir[23f83174b72da2b]::intravisit::walk_local::<rustc_typeck[ab74e667ce3174e8]::check::upvar::InferBorrowKindVisitor>
  30:     0xffff98f12ba4 - rustc_hir[23f83174b72da2b]::intravisit::walk_expr::<rustc_typeck[ab74e667ce3174e8]::check::upvar::InferBorrowKindVisitor>
  31:     0xffff98f397d0 - <rustc_typeck[ab74e667ce3174e8]::check::upvar::InferBorrowKindVisitor as rustc_hir[23f83174b72da2b]::intravisit::Visitor>::visit_expr
  32:     0xffff98ef81e4 - rustc_hir[23f83174b72da2b]::intravisit::walk_local::<rustc_typeck[ab74e667ce3174e8]::check::upvar::InferBorrowKindVisitor>
  33:     0xffff98f12ba4 - rustc_hir[23f83174b72da2b]::intravisit::walk_expr::<rustc_typeck[ab74e667ce3174e8]::check::upvar::InferBorrowKindVisitor>
  34:     0xffff98e47a70 - <rustc_infer[e7d83e60288ea4e1]::infer::InferCtxtBuilder>::enter::<&rustc_middle[8eb223e2294dc9c]::ty::context::TypeckResults, <rustc_typeck[ab74e667ce3174e8]::check::inherited::InheritedBuilder>::enter<rustc_typeck[ab74e667ce3174e8]::check::typeck_with_fallback<rustc_typeck[ab74e667ce3174e8]::check::typeck::{closure#0}>::{closure#1}, &rustc_middle[8eb223e2294dc9c]::ty::context::TypeckResults>::{closure#0}>
  35:     0xffff98db8fec - rustc_typeck[ab74e667ce3174e8]::check::typeck
  36:     0xffff998e6594 - <rustc_query_system[2fb0e7321504b2f4]::dep_graph::graph::DepGraph<rustc_middle[8eb223e2294dc9c]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[8eb223e2294dc9c]::ty::context::TyCtxt, rustc_span[678915abd2b4f748]::def_id::LocalDefId, &rustc_middle[8eb223e2294dc9c]::ty::context::TypeckResults>
  37:     0xffff99a9c408 - rustc_query_system[2fb0e7321504b2f4]::query::plumbing::try_execute_query::<rustc_query_impl[459f05cc45f8797]::plumbing::QueryCtxt, rustc_query_system[2fb0e7321504b2f4]::query::caches::DefaultCache<rustc_span[678915abd2b4f748]::def_id::LocalDefId, &rustc_middle[8eb223e2294dc9c]::ty::context::TypeckResults>>
  38:     0xffff99b5db40 - rustc_query_system[2fb0e7321504b2f4]::query::plumbing::get_query::<rustc_query_impl[459f05cc45f8797]::queries::typeck, rustc_query_impl[459f05cc45f8797]::plumbing::QueryCtxt>
  39:     0xffff98d18128 - rustc_data_structures[c78496f24077fab1]::sync::par_for_each_in::<&[rustc_span[678915abd2b4f748]::def_id::LocalDefId], <rustc_middle[8eb223e2294dc9c]::hir::map::Map>::par_body_owners<rustc_typeck[ab74e667ce3174e8]::check::typeck_item_bodies::{closure#0}>::{closure#0}>
  40:     0xffff98dbcdac - rustc_typeck[ab74e667ce3174e8]::check::typeck_item_bodies
  41:     0xffff99913270 - <rustc_query_system[2fb0e7321504b2f4]::dep_graph::graph::DepGraph<rustc_middle[8eb223e2294dc9c]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[8eb223e2294dc9c]::ty::context::TyCtxt, (), ()>
  42:     0xffff99b001cc - rustc_query_system[2fb0e7321504b2f4]::query::plumbing::try_execute_query::<rustc_query_impl[459f05cc45f8797]::plumbing::QueryCtxt, rustc_query_system[2fb0e7321504b2f4]::query::caches::DefaultCache<(), ()>>
  43:     0xffff99b4cd3c - rustc_query_system[2fb0e7321504b2f4]::query::plumbing::get_query::<rustc_query_impl[459f05cc45f8797]::queries::typeck_item_bodies, rustc_query_impl[459f05cc45f8797]::plumbing::QueryCtxt>
  44:     0xffff98dcc6b8 - <rustc_session[33c54f278648ba32]::session::Session>::time::<(), rustc_typeck[ab74e667ce3174e8]::check_crate::{closure#7}>
  45:     0xffff98eee090 - rustc_typeck[ab74e667ce3174e8]::check_crate
  46:     0xffff95e9778c - rustc_interface[f7da80859526f58]::passes::analysis
  47:     0xffff9990a7ec - <rustc_query_system[2fb0e7321504b2f4]::dep_graph::graph::DepGraph<rustc_middle[8eb223e2294dc9c]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[8eb223e2294dc9c]::ty::context::TyCtxt, (), core[58c535de022a3993]::result::Result<(), rustc_errors[cd6544614ea58931]::ErrorGuaranteed>>
  48:     0xffff99af573c - rustc_query_system[2fb0e7321504b2f4]::query::plumbing::try_execute_query::<rustc_query_impl[459f05cc45f8797]::plumbing::QueryCtxt, rustc_query_system[2fb0e7321504b2f4]::query::caches::DefaultCache<(), core[58c535de022a3993]::result::Result<(), rustc_errors[cd6544614ea58931]::ErrorGuaranteed>>>
  49:     0xffff99b5df68 - rustc_query_system[2fb0e7321504b2f4]::query::plumbing::get_query::<rustc_query_impl[459f05cc45f8797]::queries::analysis, rustc_query_impl[459f05cc45f8797]::plumbing::QueryCtxt>
  50:     0xffff95de0144 - <rustc_interface[f7da80859526f58]::passes::QueryContext>::enter::<rustc_driver[707bca65092ca961]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[58c535de022a3993]::result::Result<(), rustc_errors[cd6544614ea58931]::ErrorGuaranteed>>
  51:     0xffff95d7d1bc - rustc_interface[f7da80859526f58]::interface::create_compiler_and_run::<core[58c535de022a3993]::result::Result<(), rustc_errors[cd6544614ea58931]::ErrorGuaranteed>, rustc_driver[707bca65092ca961]::run_compiler::{closure#1}>
  52:     0xffff95dea1b0 - <scoped_tls[f1442872682dc609]::ScopedKey<rustc_span[678915abd2b4f748]::SessionGlobals>>::set::<rustc_interface[f7da80859526f58]::interface::run_compiler<core[58c535de022a3993]::result::Result<(), rustc_errors[cd6544614ea58931]::ErrorGuaranteed>, rustc_driver[707bca65092ca961]::run_compiler::{closure#1}>::{closure#0}, core[58c535de022a3993]::result::Result<(), rustc_errors[cd6544614ea58931]::ErrorGuaranteed>>
  53:     0xffff95dac4f0 - std[bda0dce2a3226c65]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[f7da80859526f58]::util::run_in_thread_pool_with_globals<rustc_interface[f7da80859526f58]::interface::run_compiler<core[58c535de022a3993]::result::Result<(), rustc_errors[cd6544614ea58931]::ErrorGuaranteed>, rustc_driver[707bca65092ca961]::run_compiler::{closure#1}>::{closure#0}, core[58c535de022a3993]::result::Result<(), rustc_errors[cd6544614ea58931]::ErrorGuaranteed>>::{closure#0}, core[58c535de022a3993]::result::Result<(), rustc_errors[cd6544614ea58931]::ErrorGuaranteed>>
  54:     0xffff95db0770 - <<std[bda0dce2a3226c65]::thread::Builder>::spawn_unchecked_<rustc_interface[f7da80859526f58]::util::run_in_thread_pool_with_globals<rustc_interface[f7da80859526f58]::interface::run_compiler<core[58c535de022a3993]::result::Result<(), rustc_errors[cd6544614ea58931]::ErrorGuaranteed>, rustc_driver[707bca65092ca961]::run_compiler::{closure#1}>::{closure#0}, core[58c535de022a3993]::result::Result<(), rustc_errors[cd6544614ea58931]::ErrorGuaranteed>>::{closure#0}, core[58c535de022a3993]::result::Result<(), rustc_errors[cd6544614ea58931]::ErrorGuaranteed>>::{closure#1} as core[58c535de022a3993]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  55:     0xffff95139e3c - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf543cb0a771f4677
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/alloc/src/boxed.rs:1940:9
  56:     0xffff95139e3c - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h8ae6f9935b15c9a8
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/alloc/src/boxed.rs:1940:9
  57:     0xffff95139e3c - std::sys::unix::thread::Thread::new::thread_start::h9c7529059c2b9f5e
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys/unix/thread.rs:108:17
  58:     0xffff94f5d5c8 - start_thread
                               at ./nptl/./nptl/pthread_create.c:442:8
  59:     0xffff94fc5d1c - thread_start
                               at ./misc/../sysdeps/unix/sysv/linux/aarch64/clone.S:79
  60:                0x0 - <unknown>

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.65.0 (897e37553 2022-11-02) running on aarch64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED]

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [typeck] type-checking `main`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
@shepmaster shepmaster added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Nov 20, 2022
@Noratrieb
Copy link
Member

I will try to reduce this to an MCVE.

@shepmaster
Copy link
Member Author

Changing Result::Ok((url, text)) to Result::<_>::Ok((url, text)) appears to avoid the ICE, so that may be a useful place to focus.

@Noratrieb
Copy link
Member

Minimized it down to 60 lines without any dependencies. Maybe it can be minimized further but it's getting really hard. I've also left a few comments to say what's going on.

"Minimized"
trait Project {
    type Assoc;
}

pub struct Wrap<T>(T);

impl<T> Project for Wrap<T> {
    type Assoc = Result<T, ()>;
}

pub trait Stream {
    type Item;

    fn get_projected<Fut, F>(self, f: F) -> Self::Item
    where
        F: FnMut(Self::Item) -> Fut,
        Self: Sized,
    {
        loop {}
    }
}

pub struct ProjectFnOutput<F>(F);

impl<F> Stream for ProjectFnOutput<F>
where
    F: GetFnOutput,
    F::Output: Project,
{
    type Item = <F::Output as Project>::Assoc;
}

pub trait GetFnOutput {
    type Output;
}

impl<T, R> GetFnOutput for T
where
    T: FnOnce() -> R,
{
    type Output = R;
}

fn main() {
    let proj = ProjectFnOutput(|| {
        Wrap(
            // This is `Result<(), _1>` but since no type annotations are provided the tpye of _1 is unknown.
            Ok(()),
        )
    });

    proj.get_projected(|b| async {
        // The type of `b` is `Result<Result<(), _1>, ()> where _1 is unknown.
        match b {
            Ok(Ok(url)) => {}
            Err(e) => {}
            Ok(Err(e)) => {}
        }
    });
}

@shepmaster
Copy link
Member Author

This appears to have regressed in Rust 1.64

1.62

error[E0282]: type annotations needed for `Result<Result<(), E>, ()>`
  --> a.rs:52:25
   |
52 |     proj.get_projected(|b| async {
   |                         ^ consider giving this closure parameter the explicit type `Result<Result<(), E>, ()>`, where the type parameter `E` is specified

1.63

error[E0282]: type annotations needed for `Result<Result<(), E>, ()>`
  --> a.rs:52:25
   |
52 |     proj.get_projected(|b| async {
   |                         ^
   |
help: consider giving this closure parameter an explicit type, where the type for type parameter `E` is specified
   |
52 |     proj.get_projected(|b: Result<Result<(), E>, ()>| async {
   |                          +++++++++++++++++++++++++++

1.64

thread 'rustc' panicked at 'internal error: entered unreachable code: we captured two identical projection

@shepmaster
Copy link
Member Author

This continues to ICE on beta and nightly

% rustc +beta -vV
rustc 1.66.0-beta.2 (0040709e3 2022-11-20)
binary: rustc
commit-hash: 0040709e39bfa159d099ee14628ad4ac72f91406
commit-date: 2022-11-20
host: aarch64-apple-darwin
release: 1.66.0-beta.2
LLVM version: 15.0.2
% rustc +nightly -vV
rustc 1.67.0-nightly (a28f3c88e 2022-11-20)
binary: rustc
commit-hash: a28f3c88e50a77bc2a91889241248c4543854e61
commit-date: 2022-11-20
host: aarch64-apple-darwin
release: 1.67.0-nightly
LLVM version: 15.0.4

@albertlarsan68
Copy link
Member

I bisected the regression, here is the output of cargo bisect-rustc:

searched nightlies: from nightly-2022-06-24 to nightly-2022-08-05
regressed nightly: nightly-2022-07-14
searched commit range: 1c7b36d...87588a2
regressed commit: c80dde4

bisected with cargo-bisect-rustc v0.6.4

Host triple: x86_64-pc-windows-msvc
Reproduce with:

cargo bisect-rustc --access=github --regress=ice --start 1.63.0 --end 1.64.0 -- check

@Noratrieb
Copy link
Member

Out of these #98574 seems the most likely, cc @dingxiangfei2009

@dingxiangfei2009
Copy link
Contributor

Zooming onto expr_use_visitor changeset.

@dingxiangfei2009
Copy link
Contributor

dingxiangfei2009 commented Nov 27, 2022

Found MVCE:

type Result<T, E = Error> = ::core::result::Result<T, E>;
struct Error;

trait ForEach {
    type Input;
    fn for_each<F, U>(self, f: F)
    where
        F: FnOnce(Self::Input) -> U;
}

impl<T> ForEach for A<T> {
    type Input = T;
    fn for_each<F, U>(self, f: F)
    where
        F: FnOnce(Self::Input) -> U,
    {
        todo!()
    }
}

struct A<T>(T);

fn main() {
    let a = A(Result::Ok(Result::Ok(())));
     //~^ ERROR type annotations needed
    a.for_each(|a: Result<_>| {
        let f = || {
            match a {
                Ok(Ok(a)) => {},
                Ok(Err(a)) => {},
                Err(a) => {},
            }
        };
    });
}
Output from Rust Playground
   Compiling playground v0.0.1 (/playground)
thread 'rustc' panicked at 'internal error: entered unreachable code: we captured two identical projections: capture1 = CapturedPlace { place: Place { base_ty: std::result::Result<std::result::Result<(), _>, Error>, base: Upvar(UpvarId(HirId { owner: DefId(0:23 ~ playground[d8bd]::main), local_id: 22 };`a`;DefId(0:25 ~ playground[d8bd]::main::{closure#0}::{closure#0}))), projections: [Projection { ty: Error, kind: Field(0, 1) }] }, info: CaptureInfo { capture_kind_expr_id: Some(HirId { owner: DefId(0:23 ~ playground[d8bd]::main), local_id: 25 }), path_expr_id: Some(HirId { owner: DefId(0:23 ~ playground[d8bd]::main), local_id: 25 }), capture_kind: ByValue }, mutability: Not, region: None }, capture2 = CapturedPlace { place: Place { base_ty: std::result::Result<std::result::Result<(), _>, Error>, base: Upvar(UpvarId(HirId { owner: DefId(0:23 ~ playground[d8bd]::main), local_id: 22 };`a`;DefId(0:25 ~ playground[d8bd]::main::{closure#0}::{closure#0}))), projections: [Projection { ty: std::result::Result<(), _>, kind: Field(0, 0) }, Projection { ty: (), kind: Field(0, 0) }] }, info: CaptureInfo { capture_kind_expr_id: Some(HirId { owner: DefId(0:23 ~ playground[d8bd]::main), local_id: 25 }), path_expr_id: Some(HirId { owner: DefId(0:23 ~ playground[d8bd]::main), local_id: 25 }), capture_kind: ByRef(ImmBorrow) }, mutability: Not, region: Some('_#0r) }', compiler/rustc_typeck/src/check/upvar.rs:712:17
stack backtrace:
   0:     0x7f35fd402d40 - std::backtrace_rs::backtrace::libunwind::trace::h32eb3e08e874dd27
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7f35fd402d40 - std::backtrace_rs::backtrace::trace_unsynchronized::haa3f451d27bc11a5
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7f35fd402d40 - std::sys_common::backtrace::_print_fmt::h5b94a01bb4289bb5
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:66:5
   3:     0x7f35fd402d40 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb070b7fa7e3175df
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:45:22
   4:     0x7f35fd45dbfe - core::fmt::write::hd5207aebbb9a86e9
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/fmt/mod.rs:1202:17
   5:     0x7f35fd3f3935 - std::io::Write::write_fmt::h3bd699bbd129ab8a
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/io/mod.rs:1679:15
   6:     0x7f35fd4059f3 - std::sys_common::backtrace::_print::h7a21be552fdf58da
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:48:5
   7:     0x7f35fd4059f3 - std::sys_common::backtrace::print::ha85c41fe4dd80b13
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:35:9
   8:     0x7f35fd4059f3 - std::panicking::default_hook::{{closure}}::h04cca40023d0eeca
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:295:22
   9:     0x7f35fd4056df - std::panicking::default_hook::haa3ca8c310ed5402
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:314:9
  10:     0x7f35ffc332e1 - rustc_driver[cfb34b1539811fe8]::DEFAULT_HOOK::{closure#0}::{closure#0}
  11:     0x7f35fd40622d - std::panicking::rust_panic_with_hook::h7b190ce1a948faac
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:702:17
  12:     0x7f35fd406087 - std::panicking::begin_panic_handler::{{closure}}::hbafbfdc3e1b97f68
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:588:13
  13:     0x7f35fd4031ec - std::sys_common::backtrace::__rust_end_short_backtrace::hda93e5fef243b4c0
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys_common/backtrace.rs:138:18
  14:     0x7f35fd405da2 - rust_begin_unwind
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/panicking.rs:584:5
  15:     0x7f35fd45a7d3 - core::panicking::panic_fmt::h8d17ca1073d9a733
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/core/src/panicking.rs:142:14
  16:     0x7f35ff6aa606 - <[rustc_middle[a9ca1c3f9fd197cd]::ty::closure::CapturedPlace]>::sort_by::<<rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::compute_min_captures::{closure#1}>::{closure#0}
  17:     0x7f35ff6a91f1 - alloc[188ed69dc0d14b4b]::slice::merge_sort::<rustc_middle[a9ca1c3f9fd197cd]::ty::closure::CapturedPlace, <[rustc_middle[a9ca1c3f9fd197cd]::ty::closure::CapturedPlace]>::sort_by<<rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::compute_min_captures::{closure#1}>::{closure#0}>
  18:     0x7f35ff6a7a3e - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::compute_min_captures
  19:     0x7f35ff6a1ad2 - <rustc_typeck[4a3b2f91c49b3c3e]::check::fn_ctxt::FnCtxt>::analyze_closure
  20:     0x7f35fe6717a5 - <rustc_typeck[4a3b2f91c49b3c3e]::check::upvar::InferBorrowKindVisitor as rustc_hir[f29014e7b3f8eb6c]::intravisit::Visitor>::visit_expr
  21:     0x7f35fe671a07 - <rustc_typeck[4a3b2f91c49b3c3e]::check::upvar::InferBorrowKindVisitor as rustc_hir[f29014e7b3f8eb6c]::intravisit::Visitor>::visit_expr
  22:     0x7f35fe671781 - <rustc_typeck[4a3b2f91c49b3c3e]::check::upvar::InferBorrowKindVisitor as rustc_hir[f29014e7b3f8eb6c]::intravisit::Visitor>::visit_expr
  23:     0x7f35fe671a7c - <rustc_typeck[4a3b2f91c49b3c3e]::check::upvar::InferBorrowKindVisitor as rustc_hir[f29014e7b3f8eb6c]::intravisit::Visitor>::visit_expr
  24:     0x7f35fe6719dd - <rustc_typeck[4a3b2f91c49b3c3e]::check::upvar::InferBorrowKindVisitor as rustc_hir[f29014e7b3f8eb6c]::intravisit::Visitor>::visit_expr
  25:     0x7f35ff258bbb - <rustc_infer[ed26b14e1208c12f]::infer::InferCtxtBuilder>::enter::<&rustc_middle[a9ca1c3f9fd197cd]::ty::context::TypeckResults, <rustc_typeck[4a3b2f91c49b3c3e]::check::inherited::InheritedBuilder>::enter<rustc_typeck[4a3b2f91c49b3c3e]::check::typeck_with_fallback<rustc_typeck[4a3b2f91c49b3c3e]::check::typeck::{closure#0}>::{closure#1}, &rustc_middle[a9ca1c3f9fd197cd]::ty::context::TypeckResults>::{closure#0}>
  26:     0x7f35ff256c29 - rustc_typeck[4a3b2f91c49b3c3e]::check::typeck
  27:     0x7f35ff4f5103 - rustc_query_system[860ed7b39cdfb46b]::query::plumbing::try_execute_query::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt, rustc_query_system[860ed7b39cdfb46b]::query::caches::DefaultCache<rustc_span[8f00505efff112e2]::def_id::LocalDefId, &rustc_middle[a9ca1c3f9fd197cd]::ty::context::TypeckResults>>
  28:     0x7f35ffb6fcae - <rustc_query_impl[d6191eea714bd250]::Queries as rustc_middle[a9ca1c3f9fd197cd]::ty::query::QueryEngine>::typeck
  29:     0x7f35ff9b0057 - rustc_data_structures[62ce3989ce8140ee]::sync::par_for_each_in::<&[rustc_span[8f00505efff112e2]::def_id::LocalDefId], <rustc_middle[a9ca1c3f9fd197cd]::hir::map::Map>::par_body_owners<rustc_typeck[4a3b2f91c49b3c3e]::check::typeck_item_bodies::{closure#0}>::{closure#0}>
  30:     0x7f35ff9afe13 - rustc_typeck[4a3b2f91c49b3c3e]::check::typeck_item_bodies
  31:     0x7f35ff8b8f99 - rustc_query_system[860ed7b39cdfb46b]::query::plumbing::try_execute_query::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt, rustc_query_system[860ed7b39cdfb46b]::query::caches::DefaultCache<(), ()>>
  32:     0x7f35ff8b8cc7 - rustc_query_system[860ed7b39cdfb46b]::query::plumbing::get_query::<rustc_query_impl[d6191eea714bd250]::queries::typeck_item_bodies, rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  33:     0x7f35fefa6a9f - <rustc_session[c5946fac61f8bc34]::session::Session>::time::<(), rustc_typeck[4a3b2f91c49b3c3e]::check_crate::{closure#7}>
  34:     0x7f35fefa665f - rustc_typeck[4a3b2f91c49b3c3e]::check_crate
  35:     0x7f35fefa5c27 - rustc_interface[3182dd864eff9d7d]::passes::analysis
  36:     0x7f35ffa037ed - rustc_query_system[860ed7b39cdfb46b]::query::plumbing::try_execute_query::<rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt, rustc_query_system[860ed7b39cdfb46b]::query::caches::DefaultCache<(), core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>>
  37:     0x7f35ffa03517 - rustc_query_system[860ed7b39cdfb46b]::query::plumbing::get_query::<rustc_query_impl[d6191eea714bd250]::queries::analysis, rustc_query_impl[d6191eea714bd250]::plumbing::QueryCtxt>
  38:     0x7f35feaef897 - <rustc_interface[3182dd864eff9d7d]::passes::QueryContext>::enter::<rustc_driver[cfb34b1539811fe8]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>
  39:     0x7f35feae328c - rustc_interface[3182dd864eff9d7d]::interface::create_compiler_and_run::<core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>, rustc_driver[cfb34b1539811fe8]::run_compiler::{closure#1}>
  40:     0x7f35feae1ac1 - <scoped_tls[e395fa6e23b19669]::ScopedKey<rustc_span[8f00505efff112e2]::SessionGlobals>>::set::<rustc_interface[3182dd864eff9d7d]::interface::run_compiler<core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>, rustc_driver[cfb34b1539811fe8]::run_compiler::{closure#1}>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>
  41:     0x7f35feae17af - std[71cb4861428b0c25]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[3182dd864eff9d7d]::util::run_in_thread_pool_with_globals<rustc_interface[3182dd864eff9d7d]::interface::run_compiler<core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>, rustc_driver[cfb34b1539811fe8]::run_compiler::{closure#1}>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>
  42:     0x7f35ffa96d70 - <<std[71cb4861428b0c25]::thread::Builder>::spawn_unchecked_<rustc_interface[3182dd864eff9d7d]::util::run_in_thread_pool_with_globals<rustc_interface[3182dd864eff9d7d]::interface::run_compiler<core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>, rustc_driver[cfb34b1539811fe8]::run_compiler::{closure#1}>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>::{closure#0}, core[8c92e53db3fc2eaa]::result::Result<(), rustc_errors[f77a66b68db622d5]::ErrorGuaranteed>>::{closure#1} as core[8c92e53db3fc2eaa]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  43:     0x7f35fd410003 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h49f797984e2121bf
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/alloc/src/boxed.rs:1940:9
  44:     0x7f35fd410003 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hfa4f3d0ee6440e0b
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/alloc/src/boxed.rs:1940:9
  45:     0x7f35fd410003 - std::sys::unix::thread::Thread::new::thread_start::h62ca48b42d48a8fc
                               at /rustc/897e37553bba8b42751c67658967889d11ecd120/library/std/src/sys/unix/thread.rs:108:17
  46:     0x7f35fd2e3609 - start_thread
  47:     0x7f35fd206133 - clone
  48:                0x0 - <unknown>

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.65.0 (897e37553 2022-11-02) running on x86_64-unknown-linux-gnu

note: compiler flags: --crate-type bin -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [typeck] type-checking `main`
#1 [typeck_item_bodies] type-checking all item bodies
#2 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `playground`

dingxiangfei2009 added a commit to dingxiangfei2009/rust that referenced this issue Nov 27, 2022
@bors bors closed this as completed in 0c14551 Nov 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants