Skip to content

Commit ace092f

Browse files
committed
Auto merge of rust-lang#38286 - pftbest:msp430_at_symbol, r=michaelwoerister
[MSP430] Do not generate '@' character in symbol names. MSP430 assembler does not like '@' character in symbol names, so we need to replace it with some other character. Fixes rust-lang#38116
2 parents b1a2ab8 + 9d764fc commit ace092f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Diff for: src/librustc_data_structures/base_n.rs

+2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
use std::str;
1515

1616
pub const MAX_BASE: u64 = 64;
17+
pub const ALPHANUMERIC_ONLY: u64 = 62;
18+
1719
const BASE_64: &'static [u8; MAX_BASE as usize] =
1820
b"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@$";
1921

Diff for: src/librustc_trans/context.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -971,7 +971,7 @@ impl<'b, 'tcx> CrateContext<'b, 'tcx> {
971971
let mut name = String::with_capacity(prefix.len() + 6);
972972
name.push_str(prefix);
973973
name.push_str(".");
974-
base_n::push_str(idx as u64, base_n::MAX_BASE, &mut name);
974+
base_n::push_str(idx as u64, base_n::ALPHANUMERIC_ONLY, &mut name);
975975
name
976976
}
977977
}

0 commit comments

Comments
 (0)