name of non-Rpitit assoc item
error
#140259
Labels
C-bug
Category: This is a bug.
I-ICE
Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
S-has-mcve
Status: A Minimal Complete and Verifiable Example has been found for this issue
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I've encountered a compiler error in the latest rustc nightly (2025-04-23) and made a somewhat small reproduction example. It is, however, far from minimal, unfortunately. If I substitute the code, which contains macros, for the version with the macros expanded, and naively sidestep some issues I don't quite understand, the error seems to stop happening. It is possible this bug is related to something else, but, since it is on the latest nightly, I would assume it hasn't been addressed yet.
Code
I've got a Cargo project at https://github.com/veigaribo/rust-rpitit-error/.
Analyzing
src/main.rs
, the definition ofMyServerFnError
(up to line 24) is mostly noise so that I can create a server function in line 26/27. That server function expands to a function with the same name, but also to a struct with pascal case naming (MyServerFn
in this case) that implements theServerFn
trait, defined here: https://github.com/leptos-rs/leptos/blob/2b50ddc0db85e12c7667a938ad5ce8c563da3f1b/server_fn/src/lib.rs#L216.The error happens when I create a function (
problem
in this case) with a parameter bounded onServerFn
with an specific associated type (Output
in this case) set to some type, and then I invoke that function with aServerFn
type that does not satisfy that associated type (line 34).ServerFn
seems to carry some significance.ServerFn
manually, and, as previously stated, I also could not reproduce the problem with the macros expanded. So theserver
macro may carry some significance too. It is defined at https://github.com/leptos-rs/leptos/blob/2b50ddc0db85e12c7667a938ad5ce8c563da3f1b/leptos_macro/src/lib.rs#L925.Meta
rustc --version --verbose
:Error output
Output of
cargo run
Backtrace
The text was updated successfully, but these errors were encountered: