FuelLabs
sway
BlogDocsChangelog

Trait coherence: disallow inherent impls on external types

#7385
Comparing
tritao:improve-trait-coherence-checks
(
308d097
) with
master
(
be2d6ae
)
CodSpeed Performance Gauge
+24%
Improvements
1
Untouched
24

Benchmarks

Improved

format
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks
CodSpeed Performance Gauge
+24%
474.5 ms384.2 ms

Passed

tokens_at_position
sway-lsp/benches/lsp_benchmarks/token_map.rs::benches::benchmarks
CodSpeed Performance Gauge
+7%
2.8 ms2.6 ms
parent_decl_at_position
sway-lsp/benches/lsp_benchmarks/token_map.rs::benches::benchmarks
CodSpeed Performance Gauge
+7%
2.8 ms2.6 ms
completion
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks
CodSpeed Performance Gauge
+6%
4.9 ms4.6 ms
highlight
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks
CodSpeed Performance Gauge
+5%
5.4 ms5.1 ms
code_lens
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks
CodSpeed Performance Gauge
+5%
4.9 µs4.7 µs
find_all_references
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks
CodSpeed Performance Gauge
+5%
5 ms4.7 ms
code_action
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks
CodSpeed Performance Gauge
+5%
5 ms4.8 ms
rename
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks
CodSpeed Performance Gauge
+5%
5 ms4.7 ms
document_symbol
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks
CodSpeed Performance Gauge
+4%
2.7 ms2.6 ms
token_at_position
sway-lsp/benches/lsp_benchmarks/token_map.rs::benches::benchmarks
CodSpeed Performance Gauge
+4%
1.5 ms1.4 ms
tokens_for_file
sway-lsp/benches/lsp_benchmarks/token_map.rs::benches::benchmarks
CodSpeed Performance Gauge
+4%
1.4 ms1.4 ms
goto_definition
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks
CodSpeed Performance Gauge
+4%
1.5 ms1.4 ms
prepare_rename
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks
CodSpeed Performance Gauge
+4%
1.5 ms1.4 ms
hover
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks
CodSpeed Performance Gauge
+4%
1.5 ms1.5 ms
traverse
sway-lsp/benches/lsp_benchmarks/compile.rs::benches::benchmarks
CodSpeed Performance Gauge
+3%
110.4 ms107.3 ms
inlay_hints
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks
CodSpeed Performance Gauge
+3%
1.9 ms1.8 ms
compile
sway-lsp/benches/lsp_benchmarks/compile.rs::benches::benchmarks
CodSpeed Performance Gauge
+2%
5.5 s5.4 s
semantic_tokens
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks
CodSpeed Performance Gauge
+2%
2.8 ms2.8 ms
open_all_example_workspace_members
sway-lsp/benches/lsp_benchmarks/compile.rs::benches::benchmarks
CodSpeed Performance Gauge
+2%
9.9 s9.7 s
build_std_lib_docs
forc-plugins/forc-doc/benches/bench_main.rs::benches::benchmarks
CodSpeed Performance Gauge
+1%
308.5 ms306.6 ms
did_change_with_caching
sway-lsp/benches/lsp_benchmarks/compile.rs::benches::benchmarks
CodSpeed Performance Gauge
+1%
3.7 ms3.7 ms
idents_at_position
sway-lsp/benches/lsp_benchmarks/token_map.rs::benches::benchmarks
CodSpeed Performance Gauge
0%
468.9 µs468.4 µs
tokens_for_program
sway-lsp/benches/lsp_benchmarks/token_map.rs::benches::benchmarks
CodSpeed Performance Gauge
0%
524.2 µs525.2 µs
on_enter
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks
CodSpeed Performance Gauge
-1%
124.7 µs125.5 µs

Commits

Click on a commit to change the comparison range
Base
master
be2d6ae
+0.2%
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.
e22e7ec
19 days ago
by tritao
-0.38%
Merge branch 'master' into improve-trait-coherence-checks
2515e3f
16 days ago
by tritao
+23.69%
Merge branch 'master' into improve-trait-coherence-checks
308d097
9 days ago
by tritao
© 2025 CodSpeed Technology
Home Terms Privacy Docs