1
Fork 0

Move trait into attr so it's greppable

This commit is contained in:
Michael Goulet 2024-02-14 17:18:56 +00:00
parent 9c25823bb4
commit a9dbf63087
31 changed files with 91 additions and 80 deletions

View file

@ -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 {

View file

@ -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,