(
alias: &str,
key: &str,
exports: &std::collections::HashSet<String>,
)
| 1279 | continue; |
| 1280 | } |
| 1281 | match aliases.get(short) { |
| 1282 | Some(existing) if existing != *export => { |
| 1283 | aliases.remove(short); |
| 1284 | } |
| 1285 | Some(_) => {} |
| 1286 | None => { |
| 1287 | aliases.insert(short.to_owned(), (*export).clone()); |
| 1288 | } |
| 1289 | } |
| 1290 | } |
| 1291 | } |
| 1292 | for export in &sorted_exports { |
| 1293 | if let Some(short) = export.strip_prefix('k') |
| 1294 | && short |
| 1295 | .chars() |
| 1296 | .next() |
| 1297 | .is_some_and(|ch| ch.is_ascii_lowercase()) |
| 1298 | { |
| 1299 | aliases |
| 1300 | .entry(short.to_owned()) |
| 1301 | .or_insert_with(|| (*export).clone()); |
| 1302 | } |
| 1303 | } |
| 1304 | aliases |
| 1305 | } |
| 1306 | |
| 1307 | fn source_identity(name: &str, source_path: Option<&Path>) -> String { |
| 1308 | source_path |
| 1309 | .map(|path| path.display().to_string()) |
| 1310 | .unwrap_or_else(|| name.to_owned()) |
| 1311 | } |
| 1312 | |
| 1313 | fn mark_all_defined_symbols_global(assembled: &mut AssembledOutput) { |
| 1314 | let symbols: Vec<String> = assembled |
| 1315 | .symbols_iter() |
| 1316 | .filter(|(name, _addr)| is_legacy_export_symbol(name)) |
| 1317 | .map(|(name, _addr)| name.to_owned()) |
| 1318 | .collect(); |
| 1319 | for symbol in symbols { |
| 1320 | assembled.mark_entry_global(&symbol); |
| 1321 | } |
| 1322 | } |
| 1323 | |
| 1324 | fn is_legacy_export_symbol(name: &str) -> bool { |
| 1325 | !name.starts_with('.') && !name.contains("__") |
| 1326 | } |
| 1327 | |
| 1328 | fn programs_module_resolver(name: &str) -> Option<String> { |
| 1329 | bundled_module_source(name).map(str::to_owned) |
| 1330 | } |
no test coverage detected