The codebase is getting larger, so its hard to provide a minimal verifiable snapshot, but the below code is what I believe to be the relevant sections. Interestingly after playing with the bug, it only ever popped up on the entity_type("type") in the builder. Other parameters showed no apparent issues.
// ApiEndpoint.rs
#[derive(Debug, Builder, Clone)]
#[builder(setter(strip_option))]
pub struct ApiEndpoint {
/// Dataset ID
#[builder(default, setter(into))]
dataset: Option<String>,
#[builder(default, setter(into))]
limit: Option<String>,
/// Created at date, used for filtering by entities created after a specific date
#[builder(default)]
created_at: Option<DateTime<Utc>>,
/// Filter by entity type
#[builder(default, setter(into))]
entity_type: Option<String>,
#[builder(default)]
tag: Option<String>,
}
impl ApiEndpoint {
pub fn builder() -> ApiEndpointBuilder {
ApiEndpointBuilder::default()
}
}
impl<'a> Endpoint for ApiEndpoint {
//..//
fn parameters(&self) -> QueryParams {
let mut params = QueryParams::default();
params
.push_opt("limit", self.limit.as_ref())
.push_opt("filter[datasets]", self.dataset.as_ref())
.push_opt("filter[>created_at]", self.created_at)
.push_opt("filter[type]", self.entity_type.as_ref())
.push_opt("filter[tags]", self.tag.as_ref());
params
}
}
// endpoint.rs
pub trait Endpoint {
/// HTTP Method to use for the endpoint
fn method(&self) -> Method;
/// Endpoint Path
fn endpoint(&self) -> Cow<'static, str>;
/// Endpoint Query parameters
fn parameters(&self) -> QueryParams {
QueryParams::default()
}
/// Body for endpoints that take body parameters.
fn body(&self) -> Result<Option<(&'static str, Vec<u8>)>, crate::Error> {
Ok(None)
}
}
// main.rs
let entity_query = EntititesEndpoint::builder()
.limit("5")
.entity_type("type")
.build()
.unwrap()
.query(&tip_client)
.unwrap();
Code
The codebase is getting larger, so its hard to provide a minimal verifiable snapshot, but the below code is what I believe to be the relevant sections. Interestingly after playing with the bug, it only ever popped up on the
entity_type("type")
in the builder. Other parameters showed no apparent issues.Meta
rustc --version --verbose
:Error output
Backtrace
``` stack backtrace: 0: 0x7f1509047cca - std::backtrace_rs::backtrace::libunwind::trace::h9a6b80bbf328ba5d at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5 1: 0x7f1509047cca - std::backtrace_rs::backtrace::trace_unsynchronized::hd162ec543a11886b at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5 2: 0x7f1509047cca - std::sys_common::backtrace::_print_fmt::h78a5099be12f51a6 at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:65:5 3: 0x7f1509047cca -::fmt::ha1c5390454d74f71
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:44:22
4: 0x7f15090ac0cf - core::fmt::write::h9ffde816c577717b
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/fmt/mod.rs:1254:17
5: 0x7f150903a805 - std::io::Write::write_fmt::h88186074961638e4
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/io/mod.rs:1698:15
6: 0x7f1509047a95 - std::sys_common::backtrace::_print::h184198273ed08d59
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:47:5
7: 0x7f1509047a95 - std::sys_common::backtrace::print::h1b4d8e7add699453
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:34:9
8: 0x7f150904a73e - std::panicking::default_hook::{{closure}}::h393bcea75423915a
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:269:22
9: 0x7f150904a4e5 - std::panicking::default_hook::h48c64f31d8b3fd03
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:288:9
10: 0x7f1507e23995 - >::call_once::{shim:vtable#0}
11: 0x7f150904af34 - as core::ops::function::Fn>::call::hb9b860f5a1175bda
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/alloc/src/boxed.rs:1987:9
12: 0x7f150904af34 - std::panicking::rust_panic_with_hook::hafdc493a79370062
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:695:13
13: 0x7f150904aca9 - std::panicking::begin_panic_handler::{{closure}}::h0a64bc82e36bedc7
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:582:13
14: 0x7f1509048136 - std::sys_common::backtrace::__rust_end_short_backtrace::hc203444fb7416a16
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys_common/backtrace.rs:150:18
15: 0x7f150904aa02 - rust_begin_unwind
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/panicking.rs:578:5
16: 0x7f15090a8443 - core::panicking::panic_fmt::h0f6ef0178afce4f2
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/core/src/panicking.rs:67:14
17: 0x7f15086f82de - rustc_query_system[5e34f8384464b8a5]::query::plumbing::incremental_verify_ich_failed::
18: 0x7f1506ed9527 - >>::with::::{closure#1}, core[da82827a87f140f9]::option::Option<(rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[5e34f8384464b8a5]::dep_graph::graph::DepNodeIndex)>>::{closure#0}, core[da82827a87f140f9]::option::Option<(rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[5e34f8384464b8a5]::dep_graph::graph::DepNodeIndex)>>
19: 0x7f1506ed84cb - rustc_query_system[5e34f8384464b8a5]::query::plumbing::try_execute_query::
20: 0x7f1507822f55 - ::mir_built
21: 0x7f1506a966c7 - rustc_mir_transform[9506650463ce67a9]::mir_const
22: 0x7f1508773c61 - >>::with::::{closure#1}, rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 8usize]>>::{closure#0}, rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 8usize]>>
23: 0x7f1508729141 - ::with_deps::::{closure#1}, rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 8usize]>>
24: 0x7f1506f5bf30 - >>::with::::{closure#1}, core[da82827a87f140f9]::option::Option<(rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[5e34f8384464b8a5]::dep_graph::graph::DepNodeIndex)>>::{closure#0}, core[da82827a87f140f9]::option::Option<(rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[5e34f8384464b8a5]::dep_graph::graph::DepNodeIndex)>>
25: 0x7f1506f5b48b - rustc_query_system[5e34f8384464b8a5]::query::plumbing::try_execute_query::
26: 0x7f150650a90f - rustc_mir_transform[9506650463ce67a9]::mir_promoted
27: 0x7f150876b8a1 - >>::with::::{closure#1}, rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 16usize]>>::{closure#0}, rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 16usize]>>
28: 0x7f1508721d6d - ::with_deps::::{closure#1}, rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 16usize]>>
29: 0x7f1506cb4a79 - >>::with::::{closure#1}, core[da82827a87f140f9]::option::Option<(rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 16usize]>, rustc_query_system[5e34f8384464b8a5]::dep_graph::graph::DepNodeIndex)>>::{closure#0}, core[da82827a87f140f9]::option::Option<(rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 16usize]>, rustc_query_system[5e34f8384464b8a5]::dep_graph::graph::DepNodeIndex)>>
30: 0x7f1506cb36ee - rustc_query_system[5e34f8384464b8a5]::query::plumbing::try_execute_query::
31: 0x7f1506cb2418 - rustc_borrowck[c07eeb7c7aba6c08]::mir_borrowck
32: 0x7f1506cb1f6e - >::call_once
33: 0x7f150876b752 - >>::with::::{closure#1}, rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 8usize]>>::{closure#0}, rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 8usize]>>
34: 0x7f1508721c11 - ::with_deps::::{closure#1}, rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 8usize]>>
35: 0x7f15068abdd6 - >>::with::::{closure#1}, core[da82827a87f140f9]::option::Option<(rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[5e34f8384464b8a5]::dep_graph::graph::DepNodeIndex)>>::{closure#0}, core[da82827a87f140f9]::option::Option<(rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[5e34f8384464b8a5]::dep_graph::graph::DepNodeIndex)>>
36: 0x7f15068ab198 - rustc_query_system[5e34f8384464b8a5]::query::plumbing::try_execute_query::
37: 0x7f15068aaa53 - ::mir_borrowck
38: 0x7f150677ec24 - rustc_mir_transform[9506650463ce67a9]::mir_drops_elaborated_and_const_checked
39: 0x7f1506c95839 - >>::with::::{closure#2}, (rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[5e34f8384464b8a5]::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[5e34f8384464b8a5]::dep_graph::graph::DepNodeIndex)>
40: 0x7f1506c94c1e - rustc_query_system[5e34f8384464b8a5]::query::plumbing::try_execute_query::
41: 0x7f1506efd85e - rustc_mir_transform[9506650463ce67a9]::optimized_mir
42: 0x7f1506f00b85 - >>::with::::{closure#2}, (rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[5e34f8384464b8a5]::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[5e34f8384464b8a5]::dep_graph::graph::DepNodeIndex)>
43: 0x7f1506efce90 - rustc_query_system[5e34f8384464b8a5]::query::plumbing::try_execute_query::
44: 0x7f1506c17379 - rustc_monomorphize[66853f4365510c0d]::collector::collect_neighbours
45: 0x7f1506c13345 - rustc_monomorphize[66853f4365510c0d]::collector::collect_items_rec
46: 0x7f1506c137e6 - rustc_monomorphize[66853f4365510c0d]::collector::collect_items_rec
47: 0x7f1506c137e6 - rustc_monomorphize[66853f4365510c0d]::collector::collect_items_rec
48: 0x7f1506c137e6 - rustc_monomorphize[66853f4365510c0d]::collector::collect_items_rec
49: 0x7f1506c137e6 - rustc_monomorphize[66853f4365510c0d]::collector::collect_items_rec
50: 0x7f1506c137e6 - rustc_monomorphize[66853f4365510c0d]::collector::collect_items_rec
51: 0x7f1506c137e6 - rustc_monomorphize[66853f4365510c0d]::collector::collect_items_rec
52: 0x7f1506c137e6 - rustc_monomorphize[66853f4365510c0d]::collector::collect_items_rec
53: 0x7f1506c137e6 - rustc_monomorphize[66853f4365510c0d]::collector::collect_items_rec
54: 0x7f1506c137e6 - rustc_monomorphize[66853f4365510c0d]::collector::collect_items_rec
55: 0x7f1506c137e6 - rustc_monomorphize[66853f4365510c0d]::collector::collect_items_rec
56: 0x7f1506eab231 - rustc_data_structures[fea82b52c2e47d17]::sync::par_for_each_in::, rustc_monomorphize[66853f4365510c0d]::collector::collect_crate_mono_items::{closure#1}::{closure#0}>
57: 0x7f1506eaaf10 - ::time::<(), rustc_monomorphize[66853f4365510c0d]::collector::collect_crate_mono_items::{closure#1}>
58: 0x7f1506eaa9c9 - rustc_monomorphize[66853f4365510c0d]::collector::collect_crate_mono_items
59: 0x7f1506ea8d17 - rustc_monomorphize[66853f4365510c0d]::partitioning::collect_and_partition_mono_items
60: 0x7f150723da10 - >>::with::::{closure#2}, (rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 24usize]>, rustc_query_system[5e34f8384464b8a5]::dep_graph::graph::DepNodeIndex)>::{closure#0}, (rustc_middle[a487dff4633a86d0]::query::erase::Erased<[u8; 24usize]>, rustc_query_system[5e34f8384464b8a5]::dep_graph::graph::DepNodeIndex)>
61: 0x7f150723d50d - rustc_query_system[5e34f8384464b8a5]::query::plumbing::try_execute_query::
62: 0x7f150723cfad - ::collect_and_partition_mono_items
63: 0x7f1507296b25 - rustc_codegen_ssa[1d731886b33fc99d]::base::codegen_crate::
64: 0x7f15072968fa - ::codegen_crate
65: 0x7f1507115302 - ::time::, rustc_interface[7aa24cde61830128]::passes::start_codegen::{closure#0}>
66: 0x7f1507114dcd - rustc_interface[7aa24cde61830128]::passes::start_codegen
67: 0x7f15071101b4 - ::enter::<::ongoing_codegen::{closure#0}::{closure#0}, core[da82827a87f140f9]::result::Result, rustc_span[2f805118d893a80f]::ErrorGuaranteed>>
68: 0x7f150710e858 - ::ongoing_codegen
69: 0x7f150710e061 - ::enter::, rustc_span[2f805118d893a80f]::ErrorGuaranteed>>
70: 0x7f1507109281 - rustc_span[2f805118d893a80f]::set_source_map::, rustc_interface[7aa24cde61830128]::interface::run_compiler, rustc_driver_impl[fe6df70259db788d]::run_compiler::{closure#1}>::{closure#0}::{closure#0}>
71: 0x7f150710882f - std[b70fedfd8b77e9]::sys_common::backtrace::__rust_begin_short_backtrace::, rustc_driver_impl[fe6df70259db788d]::run_compiler::{closure#1}>::{closure#0}, core[da82827a87f140f9]::result::Result<(), rustc_span[2f805118d893a80f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[da82827a87f140f9]::result::Result<(), rustc_span[2f805118d893a80f]::ErrorGuaranteed>>
72: 0x7f15076ec661 - <::spawn_unchecked_, rustc_driver_impl[fe6df70259db788d]::run_compiler::{closure#1}>::{closure#0}, core[da82827a87f140f9]::result::Result<(), rustc_span[2f805118d893a80f]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[da82827a87f140f9]::result::Result<(), rustc_span[2f805118d893a80f]::ErrorGuaranteed>>::{closure#1} as core[da82827a87f140f9]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
73: 0x7f15090553b5 - as core::ops::function::FnOnce>::call_once::ha1f2224656a778fb
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/alloc/src/boxed.rs:1973:9
74: 0x7f15090553b5 - as core::ops::function::FnOnce>::call_once::haa29ed9703f354b7
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/alloc/src/boxed.rs:1973:9
75: 0x7f15090553b5 - std::sys::unix::thread::Thread::new::thread_start::h33b6dae3e3692197
at /rustc/90c541806f23a127002de5b4038be731ba1458ca/library/std/src/sys/unix/thread.rs:108:17
76: 0x7f1504894b43 - start_thread
at ./nptl/./nptl/pthread_create.c:442:8
77: 0x7f1504926a00 - clone3
at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
78: 0x0 -
error: 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.70.0 (90c541806 2023-05-31) running on x86_64-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 [mir_built] building MIR for `endpoints::entities::::entity_type`
#1 [mir_const] preparing `endpoints::entities::::entity_type` for borrow checking
#2 [mir_promoted] processing MIR for `endpoints::entities::::entity_type`
#3 [mir_borrowck] borrow-checking `endpoints::entities::::entity_type`
#4 [mir_drops_elaborated_and_const_checked] elaborating drops for `endpoints::entities::::entity_type`
#5 [optimized_mir] optimizing MIR for `endpoints::entities::::entity_type`
#6 [collect_and_partition_mono_items] collect_and_partition_mono_items
end of query stack
```