Avatar for the FuelLabs user
FuelLabs
sway
BlogDocsChangelog

Trait coherence: disallow inherent impls on external types

#7385
Comparing
tritao:improve-trait-coherence-checks
(
e4a6040
) with
master
(
5e22d64
)
CodSpeed Performance Gauge
0%
Untouched
25

Benchmarks

Passed

code_lens
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::code_lens
CodSpeed Performance Gauge
+1%
4.9 µs4.9 µs
open_all_example_workspace_members
sway-lsp/benches/lsp_benchmarks/compile.rs::benches::benchmarks::open_all_example_workspace_members
CodSpeed Performance Gauge
+1%
9.9 s9.8 s
tokens_for_program
sway-lsp/benches/lsp_benchmarks/token_map.rs::benches::benchmarks::tokens_for_program
CodSpeed Performance Gauge
0%
526 µs523.9 µs
did_change_with_caching
sway-lsp/benches/lsp_benchmarks/compile.rs::benches::benchmarks::did_change_with_caching
CodSpeed Performance Gauge
0%
3.8 ms3.8 ms
hover
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::hover
CodSpeed Performance Gauge
0%
1.6 ms1.6 ms
prepare_rename
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::prepare_rename
CodSpeed Performance Gauge
0%
1.5 ms1.5 ms
goto_definition
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::goto_definition
CodSpeed Performance Gauge
0%
1.5 ms1.5 ms
semantic_tokens
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::semantic_tokens
CodSpeed Performance Gauge
0%
2.9 ms2.8 ms
inlay_hints
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::inlay_hints
CodSpeed Performance Gauge
0%
1.9 ms1.9 ms
compile
sway-lsp/benches/lsp_benchmarks/compile.rs::benches::benchmarks::compile
CodSpeed Performance Gauge
0%
5.5 s5.5 s
completion
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::completion
CodSpeed Performance Gauge
0%
4.9 ms4.9 ms
highlight
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::highlight
CodSpeed Performance Gauge
0%
5.4 ms5.4 ms
code_action
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::code_action
CodSpeed Performance Gauge
0%
5 ms5 ms
find_all_references
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::find_all_references
CodSpeed Performance Gauge
0%
5 ms5 ms
rename
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::rename
CodSpeed Performance Gauge
0%
5 ms5 ms
idents_at_position
sway-lsp/benches/lsp_benchmarks/token_map.rs::benches::benchmarks::idents_at_position
CodSpeed Performance Gauge
0%
469.3 µs469.4 µs
build_std_lib_docs
forc-plugins/forc-doc/benches/bench_main.rs::benches::benchmarks::build_std_lib_docs
CodSpeed Performance Gauge
0%
307.9 ms308.2 ms
token_at_position
sway-lsp/benches/lsp_benchmarks/token_map.rs::benches::benchmarks::token_at_position
CodSpeed Performance Gauge
0%
1.5 ms1.5 ms
parent_decl_at_position
sway-lsp/benches/lsp_benchmarks/token_map.rs::benches::benchmarks::parent_decl_at_position
CodSpeed Performance Gauge
0%
2.8 ms2.8 ms
tokens_at_position
sway-lsp/benches/lsp_benchmarks/token_map.rs::benches::benchmarks::tokens_at_position
CodSpeed Performance Gauge
0%
2.8 ms2.8 ms
document_symbol
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::document_symbol
CodSpeed Performance Gauge
0%
2.8 ms2.8 ms
tokens_for_file
sway-lsp/benches/lsp_benchmarks/token_map.rs::benches::benchmarks::tokens_for_file
CodSpeed Performance Gauge
0%
1.4 ms1.5 ms
on_enter
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::on_enter
CodSpeed Performance Gauge
-1%
124.7 µs125.5 µs
traverse
sway-lsp/benches/lsp_benchmarks/compile.rs::benches::benchmarks::traverse
CodSpeed Performance Gauge
-1%
111.4 ms112.4 ms
format
sway-lsp/benches/lsp_benchmarks/requests.rs::benches::benchmarks::format
CodSpeed Performance Gauge
-2%
465.7 ms473.2 ms

Commits

Click on a commit to change the comparison range
Base
master
5e22d64
-0.05%
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.
70828a8
5 days ago
by tritao
-0.02%
Merge branch 'master' into improve-trait-coherence-checks
e4a6040
2 days ago
by tritao
© 2025 CodSpeed Technology
Home Terms Privacy Docs