Stop passing the self-type as a separate argument. · rust-lang/rust@7658e0f (original) (raw)

`@@ -547,7 +547,7 @@ impl<'a, 'b, 'tcx> TypeVerifier<'a, 'b, 'tcx> {

`

547

547

``

548

548

`if let PlaceContext::NonMutatingUse(NonMutatingUseContext::Copy) = context {

`

549

549

`let tcx = self.tcx();

`

550

``

`-

let trait_ref = tcx.at(self.last_span).mk_trait_ref(LangItem::Copy, place_ty.ty, []);

`

``

550

`+

let trait_ref = tcx.at(self.last_span).mk_trait_ref(LangItem::Copy, [place_ty.ty]);

`

551

551

``

552

552

`` // To have a Copy operand, the type T of the

``

553

553

`` // value must be Copy. Note that we prove that T: Copy,

``

`@@ -1271,7 +1271,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {

`

1271

1271

`self.check_rvalue(body, rv, location);

`

1272

1272

`if !self.unsized_feature_enabled() {

`

1273

1273

`let trait_ref =

`

1274

``

`-

tcx.at(self.last_span).mk_trait_ref(LangItem::Sized, place_ty, []);

`

``

1274

`+

tcx.at(self.last_span).mk_trait_ref(LangItem::Sized, [place_ty]);

`

1275

1275

`self.prove_trait_ref(

`

1276

1276

` trait_ref,

`

1277

1277

` location.to_locations(),

`

`@@ -1860,7 +1860,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {

`

1860

1860

`Operand::Move(place) => {

`

1861

1861

`` // Make sure that repeated elements implement Copy.

``

1862

1862

`let ty = place.ty(body, tcx).ty;

`

1863

``

`-

let trait_ref = tcx.at(span).mk_trait_ref(LangItem::Copy, ty, []);

`

``

1863

`+

let trait_ref = tcx.at(span).mk_trait_ref(LangItem::Copy, [ty]);

`

1864

1864

``

1865

1865

`self.prove_trait_ref(

`

1866

1866

` trait_ref,

`

`@@ -1873,7 +1873,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {

`

1873

1873

`}

`

1874

1874

``

1875

1875

`&Rvalue::NullaryOp(NullOp::SizeOf | NullOp::AlignOf, ty) => {

`

1876

``

`-

let trait_ref = tcx.at(span).mk_trait_ref(LangItem::Sized, ty, []);

`

``

1876

`+

let trait_ref = tcx.at(span).mk_trait_ref(LangItem::Sized, [ty]);

`

1877

1877

``

1878

1878

`self.prove_trait_ref(

`

1879

1879

` trait_ref,

`

`@@ -1885,7 +1885,7 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {

`

1885

1885

`Rvalue::ShallowInitBox(operand, ty) => {

`

1886

1886

`self.check_operand(operand, location);

`

1887

1887

``

1888

``

`-

let trait_ref = tcx.at(span).mk_trait_ref(LangItem::Sized, *ty, []);

`

``

1888

`+

let trait_ref = tcx.at(span).mk_trait_ref(LangItem::Sized, [*ty]);

`

1889

1889

``

1890

1890

`self.prove_trait_ref(

`

1891

1891

` trait_ref,

`

`@@ -1982,11 +1982,9 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> {

`

1982

1982

``

1983

1983

`CastKind::Pointer(PointerCast::Unsize) => {

`

1984

1984

`let &ty = ty;

`

1985

``

`-

let trait_ref = tcx.at(span).mk_trait_ref(

`

1986

``

`-

LangItem::CoerceUnsized,

`

1987

``

`-

op.ty(body, tcx),

`

1988

``

`-

[ty.into()],

`

1989

``

`-

);

`

``

1985

`+

let trait_ref = tcx

`

``

1986

`+

.at(span)

`

``

1987

`+

.mk_trait_ref(LangItem::CoerceUnsized, [op.ty(body, tcx), ty]);

`

1990

1988

``

1991

1989

`self.prove_trait_ref(

`

1992

1990

` trait_ref,

`