Move trait into attr so it's greppable
This commit is contained in:
parent
9c25823bb4
commit
a9dbf63087
31 changed files with 91 additions and 80 deletions
|
@ -23,8 +23,8 @@ use std::fmt;
|
|||
use std::num::NonZero;
|
||||
use std::ops::Bound;
|
||||
|
||||
#[extension]
|
||||
pub impl IntegerExt for Integer {
|
||||
#[extension(pub trait IntegerExt)]
|
||||
impl Integer {
|
||||
#[inline]
|
||||
fn to_ty<'tcx>(&self, tcx: TyCtxt<'tcx>, signed: bool) -> Ty<'tcx> {
|
||||
match (*self, signed) {
|
||||
|
@ -111,8 +111,8 @@ pub impl IntegerExt for Integer {
|
|||
}
|
||||
}
|
||||
|
||||
#[extension]
|
||||
pub impl PrimitiveExt for Primitive {
|
||||
#[extension(pub trait PrimitiveExt)]
|
||||
impl Primitive {
|
||||
#[inline]
|
||||
fn to_ty<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Ty<'tcx> {
|
||||
match *self {
|
||||
|
|
|
@ -96,8 +96,8 @@ impl<'tcx> Discr<'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
#[extension]
|
||||
pub impl IntTypeExt for IntegerType {
|
||||
#[extension(pub trait IntTypeExt)]
|
||||
impl IntegerType {
|
||||
fn to_ty<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Ty<'tcx> {
|
||||
match self {
|
||||
IntegerType::Pointer(true) => tcx.types.isize,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue