diff --git a/forc-plugins/forc-fmt/src/main.rs b/forc-plugins/forc-fmt/src/main.rs index a443070a682..1f51938d27a 100644 --- a/forc-plugins/forc-fmt/src/main.rs +++ b/forc-plugins/forc-fmt/src/main.rs @@ -169,7 +169,11 @@ fn format_file( // TODO: Support formatting for incomplete/invalid sway code. // https://github.com/FuelLabs/sway/issues/5012 debug!("{}", err); - bail!("Failed to compile: {:?}", file); + if let Some(file) = file.to_str() { + bail!("Failed to compile {}\n{}", file, err); + } else { + bail!("Failed to compile.\n{}", err); + } } } } diff --git a/sway-lib-std/src/hash.sw b/sway-lib-std/src/hash.sw index 2e09a41187c..50cc573392d 100644 --- a/sway-lib-std/src/hash.sw +++ b/sway-lib-std/src/hash.sw @@ -47,7 +47,7 @@ impl Hasher { self.write(bytes); } - #![inline(never)] + #[inline(never)] pub fn write_str_array(ref mut self, s: S) { __assert_is_str_array::(); let str_size = __size_of_str_array::(); @@ -159,7 +159,7 @@ impl Hash for str { } impl Hash for (A, B) where A: Hash, B: Hash { - #![inline(never)] + #[inline(never)] fn hash(self, ref mut state: Hasher) { self.0.hash(state); self.1.hash(state); @@ -318,7 +318,7 @@ impl Hash for [T; 10] where T: Hash { /// assert(result = 0xa80f942f4112036dfc2da86daf6d2ef6ede3164dd56d1000eb82fa87c992450f); /// } /// ``` -#![inline(never)] +#[inline(never)] pub fn sha256(s: T) -> b256 where T: Hash { let mut hasher = Hasher::new(); s.hash(hasher); @@ -338,7 +338,7 @@ pub fn sha256(s: T) -> b256 where T: Hash { /// assert(result = 0xa80f942f4112036dfc2da86daf6d2ef6ede3164dd56d1000eb82fa87c992450f); /// } /// ``` -#![inline(never)] +#[inline(never)] pub fn sha256_str_array(param: S) -> b256 { __assert_is_str_array::(); let str_size = __size_of_str_array::(); @@ -374,7 +374,7 @@ pub fn sha256_str_array(param: S) -> b256 { /// assert(result = 0x4375c8bcdc904e5f51752581202ae9ae2bb6eddf8de05d5567d9a6b0ae4789ad); /// } /// ``` -#![inline(never)] +#[inline(never)] pub fn keccak256(s: T) -> b256 where T: Hash { let mut hasher = Hasher::new(); s.hash(hasher);