diff options
| author | bors <bors@rust-lang.org> | 2016-12-13 09:30:25 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-12-13 09:30:25 +0000 |
| commit | ace092f569230a00350e56412ac1804ffb806c32 (patch) | |
| tree | 5449afdbc27f69430b5186af5a4e7a47da0dd7ff | |
| parent | b1a2ab86dbd73b3bae979d4472b04ae3655f6b21 (diff) | |
| parent | 9d764fc3c1607b2f5f84b73d48cbddfef33fa37e (diff) | |
| download | rust-ace092f569230a00350e56412ac1804ffb806c32.tar.gz rust-ace092f569230a00350e56412ac1804ffb806c32.zip | |
Auto merge of #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 #38116
| -rw-r--r-- | src/librustc_data_structures/base_n.rs | 2 | ||||
| -rw-r--r-- | src/librustc_trans/context.rs | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/librustc_data_structures/base_n.rs b/src/librustc_data_structures/base_n.rs index bf3e682f86f..4359581a897 100644 --- a/src/librustc_data_structures/base_n.rs +++ b/src/librustc_data_structures/base_n.rs @@ -14,6 +14,8 @@ use std::str; pub const MAX_BASE: u64 = 64; +pub const ALPHANUMERIC_ONLY: u64 = 62; + const BASE_64: &'static [u8; MAX_BASE as usize] = b"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ@$"; diff --git a/src/librustc_trans/context.rs b/src/librustc_trans/context.rs index 8b98eb57814..6435b20eeaa 100644 --- a/src/librustc_trans/context.rs +++ b/src/librustc_trans/context.rs @@ -971,7 +971,7 @@ impl<'b, 'tcx> CrateContext<'b, 'tcx> { let mut name = String::with_capacity(prefix.len() + 6); name.push_str(prefix); name.push_str("."); - base_n::push_str(idx as u64, base_n::MAX_BASE, &mut name); + base_n::push_str(idx as u64, base_n::ALPHANUMERIC_ONLY, &mut name); name } } |
