pub fn layout_scalar_valid_range(self, def_id: DefId) -> (Bound<u128>, Bound<u128>) {
        let attrs = self.get_attrs(def_id);
        let get = |name| {
            let attr = match attrs.iter().find(|a| a.check_name(name)) {
                Some(attr) => attr,
                None => return Bound::Unbounded,
            };
            debug!("layout_scalar_valid_range: attr={:?}", attr);
            for meta in attr.meta_item_list().expect("rustc_layout_scalar_valid_range takes args") {
                match meta.literal().expect("attribute takes lit").kind {
                    ast::LitKind::Int(a, _) => return Bound::Included(a),
                    _ => span_bug!(attr.span, "rustc_layout_scalar_valid_range expects int arg"),
                }
            }
            span_bug!(attr.span, "no arguments to `rustc_layout_scalar_valid_range` attribute");
        };
        (
            get(sym::rustc_layout_scalar_valid_range_start),
            get(sym::rustc_layout_scalar_valid_range_end),
        )
    }
/// Returns a range of the start/end indices specified with the
/// `rustc_layout_scalar_valid_range` attribute.
Returns a range of the start/end indices specified with the
`rustc_layout_scalar_valid_range` attribute.
Returns a range of the start / end indices specified with the ` rustc_layout_scalar_valid_range ` attribute .
pub fn layout_scalar_valid_range(self, def_id: DefId) -> (Bound<u128>, Bound<u128>) {
        let attrs = self.get_attrs(def_id);
        let get = |name| {
            let attr = match attrs.iter().find(|a| a.check_name(name)) {
                Some(attr) => attr,
                None => return Bound::Unbounded,
            };
            debug!("layout_scalar_valid_range: attr={:?}", attr);
            for meta in attr.meta_item_list().expect("rustc_layout_scalar_valid_range takes args") {
                match meta.literal().expect("attribute takes lit").kind {
                    ast::LitKind::Int(a, _) => return Bound::Included(a),
                    _ => span_bug!(attr.span, "rustc_layout_scalar_valid_range expects int arg"),
                }
            }
            span_bug!(attr.span, "no arguments to `rustc_layout_scalar_valid_range` attribute");
        };
        (
            get(sym::rustc_layout_scalar_valid_range_start),
            get(sym::rustc_layout_scalar_valid_range_end),
        )
    }
pub fn layout_scalar_valid_range ( self , def_id : DefId ) -> ( Bound < u128 > , Bound < u128 > ) { let attrs = self . get_attrs ( def_id ) ; let get = | name | { let attr = match attrs . iter ( ) . find ( | a | a . check_name ( name ) ) { Some ( attr ) => attr , None => return Bound :: Unbounded , } ; debug ! ( " " attr ) ; for meta in attr . meta_item_list ( ) . expect ( " " ) { match meta . literal ( ) . expect ( " " ) . kind { ast :: LitKind :: Int ( a , _ ) => return Bound :: Included ( a ) , _ => span_bug ! ( attr span " " ) , } } span_bug ! ( attr span " " ) ; } ; ( get ( sym :: rustc_layout_scalar_valid_range_start ) , get ( sym :: rustc_layout_scalar_valid_range_end ) , ) }
Returns a range of the start/end indices specified with the
`rustc_layout_scalar_valid_range` attribute.
Returns a range of the start / end indices specified with the ` rustc_layout_scalar_valid_range ` attribute .
self
def_id
DefId
self
def_id
DefId