Skip to content

Commit 8397fca

Browse files
committed
chore: add migration docs for functional changes to cfg attributes and macro export args
1 parent 76c561e commit 8397fca

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

soroban-sdk/src/_migrating.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,33 @@
55
//! passed to [`bytes!`] or [`bytesn!`] in hex or binary form (e.g. `bytes!(&env, 1)` becomes
66
//! `bytes!(&env, 0x1)`). Array literals such as `bytes!(&env, [3, 2, 1])` are unaffected.
77
//!
8+
//! 2. The `export` argument on [`contracttype`], [`contracterror`], and
9+
//! [`contractevent`] is deprecated under the
10+
//! [`experimental_spec_shaking_v2`][crate::_features#experimental_spec_shaking_v2]
11+
//! feature. Under spec shaking v2 the final spec is determined by
12+
//! reachability from the contract boundary, so `export` no longer has any
13+
//! effect and now emits a deprecation warning. Remove `export = ...` from
14+
//! these annotations when the feature is enabled; the argument will be
15+
//! removed entirely in a future release. This affects only builds that opt
16+
//! in to the experimental feature — default builds are unchanged. See
17+
//! [`_features`][crate::_features] for details.
18+
//!
19+
//! 3. [`cfg` and `cfg_attr` are no longer accepted on `#[contracttrait]` default
20+
//! functions][v25_contracttrait]. Default-function metadata is captured where
21+
//! the trait is defined, but the wrappers for non-overridden defaults are
22+
//! generated later at the `#[contractimpl(contracttrait)]` site, so a `cfg`
23+
//! there would be evaluated in the implementing crate's context rather than
24+
//! the trait-defining crate's. Direct `cfg` attributes on
25+
//! `#[contractimpl(contracttrait)]` override methods are now supported, but
26+
//! `cfg_attr` on those methods is rejected because it is not normalized by the
27+
//! handoff. Move conditional configuration to the impl site, or gate the whole
28+
//! trait.
29+
//!
830
//! [`bytes!`]: crate::bytes
931
//! [`bytesn!`]: crate::bytesn
32+
//! [`contracttype`]: crate::contracttype
33+
//! [`contracterror`]: crate::contracterror
34+
//! [`contractevent`]: crate::contractevent
1035
//!
1136
//! # Migrating from v25 to v26
1237
//!

0 commit comments

Comments
 (0)