fn replace_identifiers(&self, orig: &str, span: Span) -> (String, HashSet<String>) {
        let mut result = String::new();
        let mut used_idents = HashSet::new();
        let mut chars = orig.chars();
        while let Some(c) = chars.next() {
            result.push(c);
            if c == '$' {
                let rest = chars.as_str();
                if let Some(c2) = chars.next() {
                    if c2 == '$' {
                        // Keep the "$$" around so LLVM will see it.
                        result.push(c2);
                    } else if let Some((ident, replacement)) = self.consume_translate_ident(rest, &mut chars, span) {
                        // A defined identifier was found. Replace it with its position in the register lists.
                        result.push_str(replacement.as_str());
                        used_idents.insert(ident);
                    } else {
                        // No identifier found. Issue a warning.
                        result.push(c2);
                        warn(span, "expected an identifier after `$`");
                        help(span, "you can include a literal dollar sign by using `$$`");
                    }
                } else {
                    // No more characters. Issue a warning.
                    warn(span, "unexpected end of asm block after `$`");
                    help(span, "you can include a literal dollar sign by using `$$`");
                }
            }
        }
        (result, used_idents)
    }
// Replaces every occurrence of `$<ident>` in `orig` with the appropriate numeral reference to an
// input or output register, if the identifier matches a bridge variable.
Replaces every occurrence of `$` in `orig` with the appropriate numeral reference to an
input or output register, if the identifier matches a bridge variable.
Replaces every occurrence of ` $ ` in ` orig ` with the appropriate numeral reference to an input or output register if the identifier matches a bridge variable .
fn replace_identifiers(&self, orig: &str, span: Span) -> (String, HashSet<String>) {
        let mut result = String::new();
        let mut used_idents = HashSet::new();
        let mut chars = orig.chars();
        while let Some(c) = chars.next() {
            result.push(c);
            if c == '$' {
                let rest = chars.as_str();
                if let Some(c2) = chars.next() {
                    if c2 == '$' {
                        // Keep the "$$" around so LLVM will see it.
                        result.push(c2);
                    } else if let Some((ident, replacement)) = self.consume_translate_ident(rest, &mut chars, span) {
                        // A defined identifier was found. Replace it with its position in the register lists.
                        result.push_str(replacement.as_str());
                        used_idents.insert(ident);
                    } else {
                        // No identifier found. Issue a warning.
                        result.push(c2);
                        warn(span, "expected an identifier after `$`");
                        help(span, "you can include a literal dollar sign by using `$$`");
                    }
                } else {
                    // No more characters. Issue a warning.
                    warn(span, "unexpected end of asm block after `$`");
                    help(span, "you can include a literal dollar sign by using `$$`");
                }
            }
        }
        (result, used_idents)
    }
fn replace_identifiers ( & self , orig : & str , span : Span ) -> ( String , HashSet < String > ) { let mut result = String :: new ( ) ; let mut used_idents = HashSet :: new ( ) ; let mut chars = orig . chars ( ) ; while let Some ( c ) = chars . next ( ) { result . push ( c ) ; if c == '$' { let rest = chars . as_str ( ) ; if let Some ( c2 ) = chars . next ( ) { if c2 == '$' { // Keep the "$$" around so LLVM will see it. result . push ( c2 ) ; } else if let Some ( ( ident , replacement ) ) = self . consume_translate_ident ( rest , & mut chars , span ) { // A defined identifier was found. Replace it with its position in the register lists. result . push_str ( replacement . as_str ( ) ) ; used_idents . insert ( ident ) ; } else { // No identifier found. Issue a warning. result . push ( c2 ) ; warn ( span , " " ) ; help ( span , " " ) ; } } else { // No more characters. Issue a warning. warn ( span , " " ) ; help ( span , " " ) ; } } } ( result , used_idents ) }
Replaces every occurrence of `$<ident>` in `orig` with the appropriate numeral reference to an
input or output register, if the identifier matches a bridge variable.
Replaces every occurrence of ` $<ident > ` in ` orig ` with the appropriate numeral reference to an input or output register if the identifier matches a bridge variable .
&self
orig
&str
span
Span
&self
orig
&str
span
Span