Remove onceness & bounds - they don't do anything.
This commit is contained in:
parent
e0eb3ccba0
commit
8e1e0f0b57
8 changed files with 7 additions and 76 deletions
|
@ -628,14 +628,6 @@ fn parse_abi_set(st: &mut PState) -> abi::Abi {
|
|||
})
|
||||
}
|
||||
|
||||
fn parse_onceness(c: char) -> ast::Onceness {
|
||||
match c {
|
||||
'o' => ast::Once,
|
||||
'm' => ast::Many,
|
||||
_ => panic!("parse_onceness: bad onceness")
|
||||
}
|
||||
}
|
||||
|
||||
fn parse_closure_ty<'a, 'tcx, F>(st: &mut PState<'a, 'tcx>,
|
||||
mut conv: F) -> ty::ClosureTy<'tcx> where
|
||||
F: FnMut(DefIdSource, ast::DefId) -> ast::DefId,
|
||||
|
@ -648,14 +640,10 @@ fn parse_closure_ty_<'a, 'tcx, F>(st: &mut PState<'a, 'tcx>,
|
|||
F: FnMut(DefIdSource, ast::DefId) -> ast::DefId,
|
||||
{
|
||||
let unsafety = parse_unsafety(next(st));
|
||||
let onceness = parse_onceness(next(st));
|
||||
let bounds = parse_existential_bounds_(st, conv);
|
||||
let sig = parse_sig_(st, conv);
|
||||
let abi = parse_abi_set(st);
|
||||
ty::ClosureTy {
|
||||
unsafety: unsafety,
|
||||
onceness: onceness,
|
||||
bounds: bounds,
|
||||
sig: sig,
|
||||
abi: abi,
|
||||
}
|
||||
|
|
|
@ -318,13 +318,6 @@ fn enc_abi(w: &mut SeekableMemWriter, abi: Abi) {
|
|||
mywrite!(w, "]")
|
||||
}
|
||||
|
||||
fn enc_onceness(w: &mut SeekableMemWriter, o: ast::Onceness) {
|
||||
match o {
|
||||
ast::Once => mywrite!(w, "o"),
|
||||
ast::Many => mywrite!(w, "m")
|
||||
}
|
||||
}
|
||||
|
||||
pub fn enc_bare_fn_ty<'a, 'tcx>(w: &mut SeekableMemWriter, cx: &ctxt<'a, 'tcx>,
|
||||
ft: &ty::BareFnTy<'tcx>) {
|
||||
enc_unsafety(w, ft.unsafety);
|
||||
|
@ -335,8 +328,6 @@ pub fn enc_bare_fn_ty<'a, 'tcx>(w: &mut SeekableMemWriter, cx: &ctxt<'a, 'tcx>,
|
|||
pub fn enc_closure_ty<'a, 'tcx>(w: &mut SeekableMemWriter, cx: &ctxt<'a, 'tcx>,
|
||||
ft: &ty::ClosureTy<'tcx>) {
|
||||
enc_unsafety(w, ft.unsafety);
|
||||
enc_onceness(w, ft.onceness);
|
||||
enc_existential_bounds(w, cx, &ft.bounds);
|
||||
enc_fn_sig(w, cx, &ft.sig);
|
||||
enc_abi(w, ft.abi);
|
||||
}
|
||||
|
|
|
@ -1032,10 +1032,8 @@ pub struct BareFnTy<'tcx> {
|
|||
#[derive(Clone, PartialEq, Eq, Hash, Show)]
|
||||
pub struct ClosureTy<'tcx> {
|
||||
pub unsafety: ast::Unsafety,
|
||||
pub onceness: ast::Onceness,
|
||||
pub bounds: ExistentialBounds<'tcx>,
|
||||
pub sig: PolyFnSig<'tcx>,
|
||||
pub abi: abi::Abi,
|
||||
pub sig: PolyFnSig<'tcx>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq, Hash, Show)]
|
||||
|
@ -7296,10 +7294,8 @@ impl ReferencesError for Region
|
|||
|
||||
impl<'tcx> Repr<'tcx> for ClosureTy<'tcx> {
|
||||
fn repr(&self, tcx: &ctxt<'tcx>) -> String {
|
||||
format!("ClosureTy({},{},{},{},{})",
|
||||
format!("ClosureTy({},{},{})",
|
||||
self.unsafety,
|
||||
self.onceness,
|
||||
self.bounds.repr(tcx),
|
||||
self.sig.repr(tcx),
|
||||
self.abi)
|
||||
}
|
||||
|
@ -7330,5 +7326,5 @@ impl<'a, 'tcx> Repr<'tcx> for ParameterEnvironment<'a, 'tcx> {
|
|||
self.free_substs.repr(tcx),
|
||||
self.implicit_region_bound.repr(tcx),
|
||||
self.caller_bounds.repr(tcx))
|
||||
}
|
||||
}
|
||||
}
|
|
@ -691,8 +691,6 @@ pub fn super_fold_closure_ty<'tcx, T: TypeFolder<'tcx>>(this: &mut T,
|
|||
ty::ClosureTy {
|
||||
sig: fty.sig.fold_with(this),
|
||||
unsafety: fty.unsafety,
|
||||
onceness: fty.onceness,
|
||||
bounds: fty.bounds.fold_with(this),
|
||||
abi: fty.abi,
|
||||
}
|
||||
}
|
||||
|
|
|
@ -276,7 +276,7 @@ pub fn ty_to_string<'tcx>(cx: &ctxt<'tcx>, typ: &ty::TyS<'tcx>) -> String {
|
|||
_ => { }
|
||||
}
|
||||
|
||||
push_sig_to_string(cx, &mut s, '(', ')', sig, "");
|
||||
push_sig_to_string(cx, &mut s, '(', ')', sig);
|
||||
|
||||
match opt_def_id {
|
||||
Some(def_id) => {
|
||||
|
@ -302,14 +302,7 @@ pub fn ty_to_string<'tcx>(cx: &ctxt<'tcx>, typ: &ty::TyS<'tcx>) -> String {
|
|||
}
|
||||
};
|
||||
|
||||
let bounds_str = cty.bounds.user_string(cx);
|
||||
|
||||
match cty.onceness {
|
||||
ast::Many => {}
|
||||
ast::Once => s.push_str("once ")
|
||||
}
|
||||
push_sig_to_string(cx, &mut s, '|', '|', &cty.sig,
|
||||
&bounds_str[]);
|
||||
push_sig_to_string(cx, &mut s, '|', '|', &cty.sig);
|
||||
|
||||
s
|
||||
}
|
||||
|
@ -318,8 +311,7 @@ pub fn ty_to_string<'tcx>(cx: &ctxt<'tcx>, typ: &ty::TyS<'tcx>) -> String {
|
|||
s: &mut String,
|
||||
bra: char,
|
||||
ket: char,
|
||||
sig: &ty::PolyFnSig<'tcx>,
|
||||
bounds: &str) {
|
||||
sig: &ty::PolyFnSig<'tcx>) {
|
||||
s.push(bra);
|
||||
let strs = sig.0.inputs
|
||||
.iter()
|
||||
|
@ -331,11 +323,6 @@ pub fn ty_to_string<'tcx>(cx: &ctxt<'tcx>, typ: &ty::TyS<'tcx>) -> String {
|
|||
}
|
||||
s.push(ket);
|
||||
|
||||
if !bounds.is_empty() {
|
||||
s.push_str(":");
|
||||
s.push_str(bounds);
|
||||
}
|
||||
|
||||
match sig.0.output {
|
||||
ty::FnConverging(t) => {
|
||||
if !ty::type_is_nil(t) {
|
||||
|
|
|
@ -551,18 +551,13 @@ impl<'tcx> TypeMap<'tcx> {
|
|||
closure_ty: ty::ClosureTy<'tcx>,
|
||||
unique_type_id: &mut String) {
|
||||
let ty::ClosureTy { unsafety,
|
||||
onceness,
|
||||
ref bounds,
|
||||
ref sig,
|
||||
abi: _ } = closure_ty;
|
||||
|
||||
if unsafety == ast::Unsafety::Unsafe {
|
||||
unique_type_id.push_str("unsafe ");
|
||||
}
|
||||
|
||||
if onceness == ast::Once {
|
||||
unique_type_id.push_str("once ");
|
||||
}
|
||||
|
||||
unique_type_id.push_str("|");
|
||||
|
||||
let sig = ty::erase_late_bound_regions(cx.tcx(), sig);
|
||||
|
@ -592,18 +587,6 @@ impl<'tcx> TypeMap<'tcx> {
|
|||
unique_type_id.push_str("!");
|
||||
}
|
||||
}
|
||||
|
||||
unique_type_id.push(':');
|
||||
|
||||
for bound in bounds.builtin_bounds.iter() {
|
||||
match bound {
|
||||
ty::BoundSend => unique_type_id.push_str("Send"),
|
||||
ty::BoundSized => unique_type_id.push_str("Sized"),
|
||||
ty::BoundCopy => unique_type_id.push_str("Copy"),
|
||||
ty::BoundSync => unique_type_id.push_str("Sync"),
|
||||
};
|
||||
unique_type_id.push('+');
|
||||
}
|
||||
}
|
||||
|
||||
// Get the UniqueTypeId for an enum variant. Enum variants are not really
|
||||
|
|
|
@ -1457,8 +1457,6 @@ fn determine_explicit_self_category<'a, 'tcx>(this: &AstConv<'tcx>,
|
|||
pub fn ty_of_closure<'tcx>(
|
||||
this: &AstConv<'tcx>,
|
||||
unsafety: ast::Unsafety,
|
||||
onceness: ast::Onceness,
|
||||
bounds: ty::ExistentialBounds<'tcx>,
|
||||
decl: &ast::FnDecl,
|
||||
abi: abi::Abi,
|
||||
expected_sig: Option<ty::FnSig<'tcx>>)
|
||||
|
@ -1508,8 +1506,6 @@ pub fn ty_of_closure<'tcx>(
|
|||
|
||||
ty::ClosureTy {
|
||||
unsafety: unsafety,
|
||||
onceness: onceness,
|
||||
bounds: bounds,
|
||||
abi: abi,
|
||||
sig: ty::Binder(ty::FnSig {inputs: input_tys,
|
||||
output: output_ty,
|
||||
|
|
|
@ -89,14 +89,6 @@ fn check_unboxed_closure<'a,'tcx>(fcx: &FnCtxt<'a,'tcx>,
|
|||
let mut fn_ty = astconv::ty_of_closure(
|
||||
fcx,
|
||||
ast::Unsafety::Normal,
|
||||
ast::Many,
|
||||
|
||||
// The `RegionTraitStore` and region_existential_bounds
|
||||
// are lies, but we ignore them so it doesn't matter.
|
||||
//
|
||||
// FIXME(pcwalton): Refactor this API.
|
||||
ty::region_existential_bound(ty::ReStatic),
|
||||
|
||||
decl,
|
||||
abi::RustCall,
|
||||
expected_sig);
|
||||
|
|
Loading…
Reference in a new issue