You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trait coherence: disallow inherent impls on external types
This improves the trait coherence checks for impl self case,
and polishes a bit of the wording on the existing diagnostics.
* Add CompileError::InherentImplForExternalType and diagnostics.
Reason/issue/help now refer to "package" to match coherence scope
* Enforce package-level check in impl-self type checking
Reject inherent impls for external nominal types (struct/enum)
Temporary whitelist: allow inherent impls on std::storage::StorageKey<_>
This is a workaround so current code that uses this pattern keeps
working.
Copy file name to clipboardExpand all lines: sway-error/src/error.rs
+37-5Lines changed: 37 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1085,12 +1085,18 @@ pub enum CompileError {
1085
1085
},
1086
1086
#[error("This expression has type \"{argument_type}\", which does not implement \"std::marker::Error\". Panic expression arguments must implement \"Error\".")]
0 commit comments