FuelLabs/sway · error · anyhow::Error

{err}

Error message

{err}

What it means

Error "{err}" thrown in FuelLabs/sway.

Source

Thrown at forc-plugins/forc-migrate/src/cli/shared.rs:71

        if let Some(path) = &self.path {
            std::result::Result::Ok(PathBuf::from(path))
        } else {
            std::env::current_dir()
        }
    }

    /// Returns the cumulative [ExperimentalFeatures], from the package manifest
    /// file and the CLI experimental flag.
    pub(crate) fn experimental_features(&self) -> Result<ExperimentalFeatures> {
        let manifest = ManifestFile::from_dir(self.manifest_dir()?)?;
        let pkg_manifest = get_pkg_manifest_file(&manifest)?;

        Ok(ExperimentalFeatures::new(
            &pkg_manifest.project.experimental,
            &self.experimental.experimental,
            &self.experimental.no_experimental,
        )
        .map_err(|err| anyhow::anyhow!("{err}"))?)
    }
}

// Clippy issue. It erroneously assumes that `vec!`s in `instructive_error` calls are not needed.
#[allow(clippy::useless_vec)]
fn get_pkg_manifest_file(manifest: &ManifestFile) -> Result<&PackageManifestFile> {
    match manifest {
        ManifestFile::Package(pkg_manifest) => Ok(pkg_manifest),
        ManifestFile::Workspace(_) => Err(anyhow::anyhow!(instructive_error(
            "`forc migrate` does not support migrating workspaces.",
            &vec![
                &format!("\"{}\" is a workspace.", manifest.dir().to_string_lossy()),
                "Please migrate each workspace member individually.",
            ]
        ))),
    }
}

View on GitHub (pinned to 47e5e902fa)

When it happens

Trigger: Thrown at forc-plugins/forc-migrate/src/cli/shared.rs:71 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of FuelLabs/sway@47e5e902fa (2026-08-16). Data as JSON: /api/errors/82384f1419edbe80. Report an issue: GitHub.