| 199 | } |
| 200 | |
| 201 | fn validate_item_kind(kind: ComponentExternalKind, msg: &str) -> Result<()> { |
| 202 | match kind { |
| 203 | // Aliasing modules would require keeping track of where a module's |
| 204 | // original definition is. There's not much usage of this in the wild |
| 205 | // so reject it for now as a simplifying assumption. |
| 206 | ComponentExternalKind::Module => { |
| 207 | bail!("wizer does not currently support module {msg}"); |
| 208 | } |
| 209 | |
| 210 | // Aliasing components deals with nested instantiations or similar, |
| 211 | // where a simplifying assumption is made to not worry about that for now. |
| 212 | ComponentExternalKind::Component => { |
| 213 | bail!("wizer does not currently support component {msg}"); |
| 214 | } |
| 215 | |
| 216 | // Like start sections, support for this is just deferred to some other |
| 217 | // time, if ever. |
| 218 | ComponentExternalKind::Value => { |
| 219 | bail!("wizer does not currently support value {msg}"); |
| 220 | } |
| 221 | |
| 222 | ComponentExternalKind::Func |
| 223 | | ComponentExternalKind::Type |
| 224 | | ComponentExternalKind::Instance => Ok(()), |
| 225 | } |
| 226 | } |