/// Return the list of labels for the edges to the successor basic blocks.
Return the list of labels for the edges to the successor basic blocks.
Return the list of labels for the edges to the successor basic blocks .
pub fn fmt_successor_labels(&self) -> Vec<Cow<'static, str>> {
        use self::TerminatorKind::*;
        match *self {
            Return | Resume | Unreachable => vec![],
            Goto { .. } => vec!["".into()],
            If { .. } => vec!["true".into(), "false".into()],
            Switch { ref adt_def, .. } => {
                adt_def.variants
                       .iter()
                       .map(|variant| variant.name.to_string().into())
                       .collect()
            }
            SwitchInt { ref values, .. } => {
                values.iter()
                      .map(|const_val| {
                          let mut buf = String::new();
                          fmt_const_val(&mut buf, const_val).unwrap();
                          buf.into()
                      })
                      .chain(iter::once(String::from("otherwise").into()))
                      .collect()
            }
            Call { destination: Some(_), cleanup: Some(_), .. } =>
                vec!["return".into_cow(), "unwind".into_cow()],
            Call { destination: Some(_), cleanup: None, .. } => vec!["return".into_cow()],
            Call { destination: None, cleanup: Some(_), .. } => vec!["unwind".into_cow()],
            Call { destination: None, cleanup: None, .. } => vec![],
            DropAndReplace { unwind: None, .. } |
            Drop { unwind: None, .. } => vec!["return".into_cow()],
            DropAndReplace { unwind: Some(_), .. } |
            Drop { unwind: Some(_), .. } => {
                vec!["return".into_cow(), "unwind".into_cow()]
            }
            Assert { cleanup: None, .. } => vec!["".into()],
            Assert { .. } =>
                vec!["success".into_cow(), "unwind".into_cow()]
        }
    }
pub fn fmt_successor_labels ( & self ) -> Vec < Cow < ' static , str > > { use self :: TerminatorKind :: * ; match * self { Return | Resume | Unreachable => vec ! [ ] , Goto { .. } => vec ! [ " " into ( ) ] , If { .. } => vec ! [ " " into ( ) " " into ( ) ] , Switch { ref adt_def , .. } => { adt_def . variants . iter ( ) . map ( | variant | variant . name . to_string ( ) . into ( ) ) . collect ( ) } SwitchInt { ref values , .. } => { values . iter ( ) . map ( | const_val | { let mut buf = String :: new ( ) ; fmt_const_val ( & mut buf , const_val ) . unwrap ( ) ; buf . into ( ) } ) . chain ( iter :: once ( String :: from ( " " ) . into ( ) ) ) . collect ( ) } Call { destination : Some ( _ ) , cleanup : Some ( _ ) , .. } => vec ! [ " " into_cow ( ) " " into_cow ( ) ] , Call { destination : Some ( _ ) , cleanup : None , .. } => vec ! [ " " into_cow ( ) ] , Call { destination : None , cleanup : Some ( _ ) , .. } => vec ! [ " " into_cow ( ) ] , Call { destination : None , cleanup : None , .. } => vec ! [ ] , DropAndReplace { unwind : None , .. } | Drop { unwind : None , .. } => vec ! [ " " into_cow ( ) ] , DropAndReplace { unwind : Some ( _ ) , .. } | Drop { unwind : Some ( _ ) , .. } => { vec ! [ " " into_cow ( ) " " into_cow ( ) ] } Assert { cleanup : None , .. } => vec ! [ " " into ( ) ] , Assert { .. } => vec ! [ " " into_cow ( ) " " into_cow ( ) ] } }
Return the list of labels for the edges to the successor basic blocks.
Return the list of labels for the edges to the successor basic blocks .
&self