Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions cga_analysis/src/post_mono.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,22 +306,7 @@ impl<'b, 'a, 'tcx> PostMonoNode<'b, 'a, 'tcx> {
debug!("ignoring call to non-constant function {func:?}");
return vec![];
};
let mut instance = self.monomorphize_instance(pre_mono_call, generic_args, span);

// Look for `<T as Fn>::call` for some T.
// If T is a function type, the compiler synthesizes an impl, so we'll check
// the trait declaration in libcore which isn't what we want. Check if the
// function is annotated instead.
if let InstanceKind::Shim(ShimKind::FnPtr(_, ty) | ShimKind::FnPtrAddr(_, ty)) = instance.def
&& let ty::FnDef(fn_item, fn_args) = ty.kind()
{
debug!("found function item {fn_item:?}");
instance = self.monomorphize_instance(*fn_item, fn_args, span);
}

// Double check if our instance is OK

instance
self.monomorphize_instance(pre_mono_call, generic_args, span)
}
TerminatorKind::Drop { place, .. } => {
let (ty, _) = self.monomorphize_args(place.ty(self.body, tcx));
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "nightly-2026-06-29"
channel = "nightly-2026-07-15"
components = ["cargo", "llvm-tools", "rust-src", "rust-std", "rustc", "rustc-dev", "rustfmt", "clippy"]
profile = "minimal"
targets = ["thumbv8m.main-none-eabihf"]
14 changes: 7 additions & 7 deletions tests/ui-cargo/fail-blacklist/Cargo.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error: call to associated function `std::process::Command::new` which can panic
7 | let _ = std::process::Command::new("evil");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: 14 different panics from this location
= note: backtrace (1 of 3843059837):
= note: 11 different panics from this location
= note: backtrace (1 of 1863650189):
0: std::rt::panic_fmt (called)
1: alloc::raw_vec::RawVec::<u8>::into_box (called)
2: std::vec::Vec::<u8>::into_boxed_slice (called)
Expand All @@ -23,8 +23,8 @@ error: call to drop of `std::process::Command` which can panic
7 | let _ = std::process::Command::new("evil");
| ^
|
= note: 14 different panics from this location
= note: backtrace (1 of 3843090268):
= note: 11 different panics from this location
= note: backtrace (1 of 1863680573):
0: core::panicking::panic_nounwind_fmt (called)
1: <usize as std::slice::SliceIndex<[T]>>::get_unchecked_mut::precondition_check (called)
2: <usize as std::slice::SliceIndex<[u8]>>::get_unchecked_mut (called)
Expand All @@ -42,7 +42,7 @@ error: call to associated function `std::process::Command::new` which is blackli
7 | let _ = std::process::Command::new("evil");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: 104 different blacklisted functions from this location
= note: 101 different blacklisted functions from this location
= note: backtrace:
0: std::process::Command::new::<&str> (called) <--
1: fail_blacklist::test (called)
Expand All @@ -59,8 +59,8 @@ error: call to drop of `std::process::Command` which can call blacklisted functi
7 | let _ = std::process::Command::new("evil");
| ^
|
= note: 105 different blacklisted functions from this location
= note: backtrace (1 of 42160433):
= note: 101 different blacklisted functions from this location
= note: backtrace (1 of 20283553):
0: std::sys::fs::unix::debug_assert_fd_is_open (called)
1: <std::os::fd::OwnedFd as std::ops::Drop>::drop (called)
2: drop of `std::os::fd::OwnedFd` (called)
Expand Down
12 changes: 6 additions & 6 deletions tests/ui-cargo/fail-embedded/Cargo.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error: call to method `embassy_executor::Executor::run` which can panic
11 | #[embassy_executor::main]
| ^^^^^^^^^^^^^^^^^^^^^^^^^ expanded from here
|
= note: 13 different panics from this location
= note: backtrace (1 of 17249841):
= note: 10 different panics from this location
= note: backtrace (1 of 16511908):
0: core::panicking::panic_fmt (called)
1: core::result::unwrap_failed (called)
2: core::result::Result::<embassy_executor::SpawnToken<{closure@src/main.rs:11:1: 11:26}>, embassy_executor::SpawnError>::unwrap (called)
Expand All @@ -25,9 +25,9 @@ error: call to function `embassy_rp::init` which can panic
= note: 7 different panics from this location
= note: backtrace (1 of 721):
0: core::panicking::panic_fmt (called)
1: core::sync::atomic::compiler_fence (called)
2: <embassy_rp::interrupt::Interrupt as embassy_rp::interrupt::InterruptExt>::enable (called)
3: embassy_rp::time_driver::init (called)
1: core::sync::atomic::atomic_store::<u32> (called)
2: core::sync::atomic::Atomic::<u32>::store (called)
3: embassy_rp::clocks::init (called)
4: embassy_rp::init (called) <--
5: fail_embedded::____embassy_main_task::____embassy_main_task_inner_function::{closure#0} (called)
6: embassy_executor::raw::TaskStorage::<{async fn body of fail_embedded::____embassy_main_task::____embassy_main_task_inner_function()}>::poll (fn-ptr cast)
Expand Down Expand Up @@ -166,7 +166,7 @@ error: call to associated function `embassy_time::Timer::after_secs` which can p
26 | Timer::after_secs(2).await;
| ^^^^^^^^^^^^^^^^^^^^
|
= note: 14 different panics from this location
= note: 11 different panics from this location
= note: backtrace (1 of 2):
0: core::panicking::panic_display::<&str> (called)
1: core::option::expect_failed (called)
Expand Down
8 changes: 4 additions & 4 deletions tests/ui/large_std_process.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ error: call to associated function `std::process::Command::new` which can panic
LL | let _ = std::process::Command::new("evil");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: 14 different panics from this location
= note: backtrace (1 of 3843059837):
= note: 11 different panics from this location
= note: backtrace (1 of 1863650189):
0: std::rt::panic_fmt (called)
1: alloc::raw_vec::RawVec::<u8>::into_box (called)
2: std::vec::Vec::<u8>::into_boxed_slice (called)
Expand All @@ -23,8 +23,8 @@ error: call to drop of `std::process::Command` which can panic
LL | let _ = std::process::Command::new("evil");
| ^
|
= note: 14 different panics from this location
= note: backtrace (1 of 3843090268):
= note: 11 different panics from this location
= note: backtrace (1 of 1863680573):
0: core::panicking::panic_nounwind_fmt (called)
1: <usize as std::slice::SliceIndex<[T]>>::get_unchecked_mut::precondition_check (called)
2: <usize as std::slice::SliceIndex<[u8]>>::get_unchecked_mut (called)
Expand Down
Loading