Skip to content

Commit d50e80f

Browse files
author
Jorge Aparicio
committed
librustc: DSTify ClassList, LlvmRepr and Repr
1 parent daa949e commit d50e80f

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/librustc/middle/trans/cabi_x86_64.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ impl RegClass {
6161
}
6262
}
6363

64-
trait ClassList {
64+
trait ClassList for Sized? {
6565
fn is_pass_byval(&self) -> bool;
6666
fn is_ret_bysret(&self) -> bool;
6767
}
6868

69-
impl<'a> ClassList for &'a [RegClass] {
69+
impl ClassList for [RegClass] {
7070
fn is_pass_byval(&self) -> bool {
7171
if self.len() == 0 { return false; }
7272

src/librustc/middle/trans/llrepr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ use middle::trans::context::CrateContext;
1212
use middle::trans::type_::Type;
1313
use llvm::ValueRef;
1414

15-
pub trait LlvmRepr {
15+
pub trait LlvmRepr for Sized? {
1616
fn llrepr(&self, ccx: &CrateContext) -> String;
1717
}
1818

19-
impl<'a, T:LlvmRepr> LlvmRepr for &'a [T] {
19+
impl<T:LlvmRepr> LlvmRepr for [T] {
2020
fn llrepr(&self, ccx: &CrateContext) -> String {
2121
let reprs: Vec<String> = self.iter().map(|t| t.llrepr(ccx)).collect();
2222
format!("[{}]", reprs.connect(","))

src/librustc/util/ppaux.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use syntax::{ast, ast_util};
3737
use syntax::owned_slice::OwnedSlice;
3838

3939
/// Produces a string suitable for debugging output.
40-
pub trait Repr {
40+
pub trait Repr for Sized? {
4141
fn repr(&self, tcx: &ctxt) -> String;
4242
}
4343

@@ -578,9 +578,9 @@ impl Repr for () {
578578
}
579579
}
580580

581-
impl<'a,T:Repr> Repr for &'a T {
581+
impl<'a, Sized? T:Repr> Repr for &'a T {
582582
fn repr(&self, tcx: &ctxt) -> String {
583-
(&**self).repr(tcx)
583+
Repr::repr(*self, tcx)
584584
}
585585
}
586586

@@ -600,9 +600,9 @@ fn repr_vec<T:Repr>(tcx: &ctxt, v: &[T]) -> String {
600600
vec_map_to_string(v, |t| t.repr(tcx))
601601
}
602602

603-
impl<'a, T:Repr> Repr for &'a [T] {
603+
impl<T:Repr> Repr for [T] {
604604
fn repr(&self, tcx: &ctxt) -> String {
605-
repr_vec(tcx, *self)
605+
repr_vec(tcx, self)
606606
}
607607
}
608608

0 commit comments

Comments
 (0)