fn fix_overlapping_clobbers(&mut self) {
        // If a clobber is the same as an output, remove the clobber and produce a warning, since
        // that may or may not be what the programmer expects. In any case, having both an `out`
        // variable and a clobber is confusing to the reader, so one should be removed.
        for var in self.bridge_vars_out.iter() {
            if let Some(reg) = var.explicit_register() {
                for clobber in self.clobbers.clone().iter() {
                    if clobber.constraint_as_str() == reg {
                        warn(clobber.span(), "clobber points to same register as an output; ignoring clobber");
                        help(var.constraint_span(), "output declared here");
                        self.clobbers.remove(&clobber);
                        break; // There are already no duplicate clobbers.
                    }
                }
            }
        }

        // If a clobber is the same as an input, change the clobber into an output, bound to the
        // same variable (since the `asm!` macro won't let us bind something to `_`).
        for (i, var) in self.bridge_vars_in.clone().iter().enumerate() {
            if let Some(reg) = var.explicit_register() {
                for clobber in self.clobbers.clone().iter() {
                    if clobber.constraint_as_str() == reg {
                        // Add the output and link the input to it.
                        let out_constraint = format!("={}", var.constraint_as_str());
                        let in_constraint = format!("{}", self.bridge_vars_out.len());
                        self.bridge_vars_out.push(BridgeVar {
                            ident: var.ident.clone(),
                            llvm_constraint: (out_constraint, var.constraint_span())
                        });
                        self.bridge_vars_in.remove(i);
                        self.bridge_vars_in.push(BridgeVar {
                            ident: var.ident.clone(),
                            llvm_constraint: (in_constraint, var.constraint_span())
                        });
                        // Remove the clobber.
                        self.clobbers.remove(&clobber);
                        break;
                    }
                }
            }
        }
    }
// Makes sure that the list of clobbers has nothing in common with the lists of inputs and outputs. The `asm!` macro
// may or may not require that, and it doesn't hurt in any case.
Makes sure that the list of clobbers has nothing in common with the lists of inputs and outputs. The `asm!` macro
may or may not require that, and it doesn't hurt in any case.
Makes sure that the list of clobbers has nothing in common with the lists of inputs and outputs . The ` asm! ` macro may or may not require that and it doesn ' t hurt in any case .
fn fix_overlapping_clobbers(&mut self) {
        // If a clobber is the same as an output, remove the clobber and produce a warning, since
        // that may or may not be what the programmer expects. In any case, having both an `out`
        // variable and a clobber is confusing to the reader, so one should be removed.
        for var in self.bridge_vars_out.iter() {
            if let Some(reg) = var.explicit_register() {
                for clobber in self.clobbers.clone().iter() {
                    if clobber.constraint_as_str() == reg {
                        warn(clobber.span(), "clobber points to same register as an output; ignoring clobber");
                        help(var.constraint_span(), "output declared here");
                        self.clobbers.remove(&clobber);
                        break; // There are already no duplicate clobbers.
                    }
                }
            }
        }
        // If a clobber is the same as an input, change the clobber into an output, bound to the
        // same variable (since the `asm!` macro won't let us bind something to `_`).
        for (i, var) in self.bridge_vars_in.clone().iter().enumerate() {
            if let Some(reg) = var.explicit_register() {
                for clobber in self.clobbers.clone().iter() {
                    if clobber.constraint_as_str() == reg {
                        // Add the output and link the input to it.
                        let out_constraint = format!("={}", var.constraint_as_str());
                        let in_constraint = format!("{}", self.bridge_vars_out.len());
                        self.bridge_vars_out.push(BridgeVar {
                            ident: var.ident.clone(),
                            llvm_constraint: (out_constraint, var.constraint_span())
                        });
                        self.bridge_vars_in.remove(i);
                        self.bridge_vars_in.push(BridgeVar {
                            ident: var.ident.clone(),
                            llvm_constraint: (in_constraint, var.constraint_span())
                        });
                        // Remove the clobber.
                        self.clobbers.remove(&clobber);
                        break;
                    }
                }
            }
        }
    }
fn fix_overlapping_clobbers ( & mut self ) { // If a clobber is the same as an output, remove the clobber and produce a warning, since // that may or may not be what the programmer expects. In any case, having both an `out` // variable and a clobber is confusing to the reader, so one should be removed. for var in self . bridge_vars_out . iter ( ) { if let Some ( reg ) = var . explicit_register ( ) { for clobber in self . clobbers . clone ( ) . iter ( ) { if clobber . constraint_as_str ( ) == reg { warn ( clobber . span ( ) , " " ) ; help ( var . constraint_span ( ) , " " ) ; self . clobbers . remove ( & clobber ) ; break ; // There are already no duplicate clobbers. } } } } // If a clobber is the same as an input, change the clobber into an output, bound to the // same variable (since the `asm!` macro won't let us bind something to `_`). for ( i , var ) in self . bridge_vars_in . clone ( ) . iter ( ) . enumerate ( ) { if let Some ( reg ) = var . explicit_register ( ) { for clobber in self . clobbers . clone ( ) . iter ( ) { if clobber . constraint_as_str ( ) == reg { // Add the output and link the input to it. let out_constraint = format ! ( " " var constraint_as_str ( ) ) ; let in_constraint = format ! ( " " self bridge_vars_out len ( ) ) ; self . bridge_vars_out . push ( BridgeVar { ident : var . ident . clone ( ) , llvm_constraint : ( out_constraint , var . constraint_span ( ) ) } ) ; self . bridge_vars_in . remove ( i ) ; self . bridge_vars_in . push ( BridgeVar { ident : var . ident . clone ( ) , llvm_constraint : ( in_constraint , var . constraint_span ( ) ) } ) ; // Remove the clobber. self . clobbers . remove ( & clobber ) ; break ; } } } } }
Makes sure that the list of clobbers has nothing in common with the lists of inputs and outputs.
Makes sure that the list of clobbers has nothing in common with the lists of inputs and outputs .
&mut self
&mut self