# error[E0432]: unresolved import `my-crate` -- could not find `my-crate` in the crate root

- **ID:** `rust/e0432-unresolved-import-crate-name-hyphen`
- **Domain:** rust
- **Category:** module_error
- **Error Code:** `E0432`
- **Verification:** ai_generated
- **Fix Rate:** 98%

## Root Cause

Rust crate names with hyphens are automatically converted to underscores in code; use `my_crate` instead of `my-crate` in use statements.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| rustc 1.56.0 | active | — | — |
| rustc 1.63.0 | active | — | — |
| rustc 1.70.0 | active | — | — |

## Workarounds

1. **Replace hyphens with underscores in all use statements: `use my_crate::SomeType;`** (98% success)
   ```
   Replace hyphens with underscores in all use statements: `use my_crate::SomeType;`
   ```
2. **In Cargo.toml, use the `package` key to rename: `my_crate = { package = "my-crate", version = "1.0" }` then import as `my_crate`.** (95% success)
   ```
   In Cargo.toml, use the `package` key to rename: `my_crate = { package = "my-crate", version = "1.0" }` then import as `my_crate`.
   ```
3. **Use `extern crate my_crate as my_crate;` if needed for legacy code.** (85% success)
   ```
   Use `extern crate my_crate as my_crate;` if needed for legacy code.
   ```

## Dead Ends

- **** — extern crate also uses the underscore convention. The hyphen is only valid in Cargo.toml dependency names, not in code. (95% fail)
- **** — Cargo.toml dependency names can have hyphens, but the crate name in Rust source is always underscores. Renaming in Cargo.toml is unnecessary. (70% fail)
- **** — Hyphens are not valid in Rust identifiers. Use underscores instead. (95% fail)
