Stream: compiler development

Topic: ✔ Symbol::GENERIC_COPY_REF not found


view this post on Zulip Joshua Warner (Aug 13 2024 at 04:59):

A month or so ago I started seeing the following error when running cargo check --all --all-targets - is this known?

error[E0599]: no associated item named `GENERIC_COPY_REF` found for struct `roc_module::symbol::Symbol` in the current scope
   --> crates/compiler/gen_llvm/src/llvm/bitcode.rs:749:26
    |
749 |     let symbol = Symbol::GENERIC_COPY_REF;
    |                          ^^^^^^^^^^^^^^^^
    |                          |
    |                          associated item not found in `Symbol`
    |                          help: there is an associated constant with a similar name: `GENERIC_COMPARE_REF`
    |
note: if you're trying to build a new `roc_module::symbol::Symbol`, consider using `roc_module::symbol::Symbol::new` which returns `roc_module::symbol::Symbol`

view this post on Zulip Brendan Hansknecht (Aug 13 2024 at 05:43):

Intriguing. GENERIC_COPY_REF exists. It is defined here: https://github.com/roc-lang/roc/blob/main/crates/compiler/module/src/symbol.rs#L1178

view this post on Zulip Brendan Hansknecht (Aug 13 2024 at 05:44):

I must have missed something when I added it...not sure what though.

view this post on Zulip Brendan Hansknecht (Aug 13 2024 at 05:45):

I see no difference between GENERIC_COPY_REF and GENERIC_RC_REF in definition and use. Yet you see no error for GENERIC_RC_REF

view this post on Zulip Brendan Hansknecht (Aug 13 2024 at 05:47):

Though cargo check --all --all-targets doesn't generate any errors for me

view this post on Zulip Brendan Hansknecht (Aug 13 2024 at 05:47):

Do you have an old version of rust?

view this post on Zulip Brendan Hansknecht (Aug 13 2024 at 05:47):

$ cargo --version
cargo 1.77.2 (e52e36006 2024-03-26)

view this post on Zulip Joshua Warner (Aug 13 2024 at 05:48):

Same cargo version: cargo 1.77.2 (e52e36006 2024-03-26)

view this post on Zulip Joshua Warner (Aug 13 2024 at 05:49):

Strange!

view this post on Zulip Brendan Hansknecht (Aug 13 2024 at 05:51):

Oh, interesting. I see multiple errors on linux. None on macos.

For example see this:

oc_exhaustive v0.0.1 (/home/bren077s/Projects/roc-misc/roc/crates/compiler/exhaustive)
error[E0004]: non-exhaustive patterns: `roc_module::called_via::BinOp::Assignment`, `roc_module::called_via::BinOp::IsAliasType`, `roc_module::called_via::BinOp::IsOpaqueType` and 1 more not covered
   --> crates/compiler/fmt/src/expr.rs:657:11
    |
657 |     match op {
    |           ^^ patterns `roc_module::called_via::BinOp::Assignment`, `roc_module::called_via::BinOp::IsAliasType`, `roc_module::called_via::BinOp::IsOpaqueType` and 1 more not covered
    |

view this post on Zulip Brendan Hansknecht (Aug 13 2024 at 05:53):

Ok, I'm really confused by this error. Those missing patterns aren't part of roc_module::called_via::BinOp

view this post on Zulip Brendan Hansknecht (Aug 13 2024 at 05:56):

try running cargo clean. Fixed it for me.

view this post on Zulip Brendan Hansknecht (Aug 13 2024 at 05:57):

bad rust caching with version changes I guess.

view this post on Zulip Luke Boswell (Aug 13 2024 at 05:58):

This is all I'm seeing
https://gist.github.com/lukewilliamboswell/feffeb6d5705a05409fb86532f45c0dd

view this post on Zulip Brendan Hansknecht (Aug 13 2024 at 05:58):

Yeah, that's what I see on my mac. And now on my linux machine after running clean

view this post on Zulip Joshua Warner (Aug 13 2024 at 06:01):

Wow; cargo clean worked!

view this post on Zulip Joshua Warner (Aug 13 2024 at 06:01):

Should have thought to try that :/

view this post on Zulip Joshua Warner (Aug 13 2024 at 06:02):

Definitely seen this thing before with rust in other contexts

view this post on Zulip Joshua Warner (Aug 13 2024 at 06:02):

Thanks!

view this post on Zulip Notification Bot (Aug 13 2024 at 06:04):

Joshua Warner has marked this topic as resolved.


Last updated: Jul 06 2025 at 12:14 UTC