Skip to content

Compilation error in v0.24.17: Box type not found in result_ext.rs #171

@RAprogramm

Description

@RAprogramm

Description

Version 0.24.17 fails to compile with errors about Box type not being in scope in src/result_ext.rs:84.

Error Output

error[E0412]: cannot find type `Box` in this scope
  --> src/result_ext.rs:84:25
   |
84 |             let source: Box<dyn CoreError + Send + Sync + 'static> = Box::new(err);
   |                         ^^^ not found in this scope
   |
help: consider importing this struct
   |
 5 + use alloc::boxed::Box;
   |

error[E0433]: failed to resolve: use of undeclared type `Box`
  --> src/result_ext.rs:84:70
   |
84 |             let source: Box<dyn CoreError + Send + Sync + 'static> = Box::new(err);
   |                                                                      ^^^ use of undeclared type `Box`

Environment

  • Rust version: 1.90.0 stable (1159e78c4 2025-09-14)
  • masterror version: 0.24.17
  • Dependency configuration: masterror = { version = "0.24", default-features = false }

Fix

The file src/result_ext.rs is missing the import for Box. Need to add:

use alloc::boxed::Box;

Steps to Reproduce

  1. Add masterror = { version = "0.24", default-features = false } to Cargo.toml
  2. Run cargo build
  3. Observe compilation error

Expected Behavior

Should compile without errors.

Actual Behavior

Compilation fails with "cannot find type Box in this scope" error.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions