diff --git a/api/rs/build/Cargo.toml b/api/rs/build/Cargo.toml index 512cf1d5233..8f851a78ba9 100644 --- a/api/rs/build/Cargo.toml +++ b/api/rs/build/Cargo.toml @@ -25,5 +25,5 @@ i-slint-compiler = { workspace = true, features = ["default", "rust", "display-d i-slint-core-macros = { workspace = true } spin_on = { workspace = true } -thiserror = "1" toml_edit = { workspace = true } +derive_more = { workspace = true, features = ["std", "error"] } diff --git a/api/rs/build/lib.rs b/api/rs/build/lib.rs index 2bc4e0c32c6..b8e7bfe9114 100644 --- a/api/rs/build/lib.rs +++ b/api/rs/build/lib.rs @@ -192,17 +192,17 @@ impl CompilerConfiguration { } /// Error returned by the `compile` function -#[derive(thiserror::Error, Debug)] +#[derive(derive_more::Error, derive_more::Display, Debug)] #[non_exhaustive] pub enum CompileError { /// Cannot read environment variable CARGO_MANIFEST_DIR or OUT_DIR. The build script need to be run via cargo. - #[error("Cannot read environment variable CARGO_MANIFEST_DIR or OUT_DIR. The build script need to be run via cargo.")] + #[display("Cannot read environment variable CARGO_MANIFEST_DIR or OUT_DIR. The build script need to be run via cargo.")] NotRunViaCargo, /// Parse error. The error are printed in the stderr, and also are in the vector - #[error("{0:?}")] - CompileError(Vec), + #[display("{_0:?}")] + CompileError(#[error(not(source))] Vec), /// Cannot write the generated file - #[error("Cannot write the generated file: {0}")] + #[display("Cannot write the generated file: {_0}")] SaveError(std::io::Error), } diff --git a/internal/compiler/Cargo.toml b/internal/compiler/Cargo.toml index 598b9b8f07f..87e8993bb35 100644 --- a/internal/compiler/Cargo.toml +++ b/internal/compiler/Cargo.toml @@ -50,7 +50,6 @@ quote = { version = "1.0", optional = true } proc-macro2 = { version = "1.0.17", optional = true } lyon_path = { version = "1.0" } lyon_extra = "1.0.1" -thiserror = "1" by_address = { workspace = true } itertools = { workspace = true } once_cell = "1" diff --git a/internal/interpreter/Cargo.toml b/internal/interpreter/Cargo.toml index 5c94711f9fc..f66c6c6eac0 100644 --- a/internal/interpreter/Cargo.toml +++ b/internal/interpreter/Cargo.toml @@ -125,11 +125,10 @@ i-slint-backend-selector = { workspace = true, features = ["rtti"] } vtable = { workspace = true } -derive_more = { workspace = true } +derive_more = { workspace = true, features = ["std", "error"] } generativity = "1" lyon_path = { version = "1.0" } once_cell = "1.5" -thiserror = "1" document-features = { version = "0.2.0", optional = true } spin_on = { workspace = true, optional = true } raw-window-handle-06 = { workspace = true, optional = true } diff --git a/internal/interpreter/api.rs b/internal/interpreter/api.rs index a081404d524..d628f1c6579 100644 --- a/internal/interpreter/api.rs +++ b/internal/interpreter/api.rs @@ -1580,48 +1580,48 @@ impl From } /// Error returned by [`ComponentInstance::get_property`] -#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, derive_more::Error, derive_more::Display)] #[non_exhaustive] pub enum GetPropertyError { /// There is no property with the given name - #[error("no such property")] + #[display("no such property")] NoSuchProperty, } /// Error returned by [`ComponentInstance::set_property`] -#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, derive_more::Error, derive_more::Display)] #[non_exhaustive] pub enum SetPropertyError { /// There is no property with the given name. - #[error("no such property")] + #[display("no such property")] NoSuchProperty, /// The property exists but does not have a type matching the dynamic value. /// /// This happens for example when assigning a source struct value to a target /// struct property, where the source doesn't have all the fields the target struct /// requires. - #[error("wrong type")] + #[display("wrong type")] WrongType, /// Attempt to set an output property. - #[error("access denied")] + #[display("access denied")] AccessDenied, } /// Error returned by [`ComponentInstance::set_callback`] -#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, derive_more::Error, derive_more::Display)] #[non_exhaustive] pub enum SetCallbackError { /// There is no callback with the given name - #[error("no such callback")] + #[display("no such callback")] NoSuchCallback, } /// Error returned by [`ComponentInstance::invoke`] -#[derive(Debug, Clone, Copy, PartialEq, Eq, thiserror::Error)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, derive_more::Error, derive_more::Display)] #[non_exhaustive] pub enum InvokeError { /// There is no callback or function with the given name - #[error("no such callback or function")] + #[display("no such callback or function")] NoSuchCallable, }