rustc: Stop adding the Send bound implicitly

This commit removes implicitly adding the Send bound to ~Trait objects and
procedure types. It will now be manually required to specify that a procedure
or trait must be send-able.

Closes #10296
This commit is contained in:
Alex Crichton 2014-03-20 14:10:52 -07:00
parent 25e523833e
commit bdd24b2a56

View File

@ -850,15 +850,12 @@ fn conv_builtin_bounds(tcx: &ty::ctxt, ast_bounds: &Option<OwnedSlice<ast::TyPar
}
builtin_bounds
},
// ~Trait is sugar for ~Trait:Send.
(&None, ty::UniqTraitStore) => {
let mut set = ty::EmptyBuiltinBounds(); set.add(ty::BoundSend); set
}
// &'static Trait is sugar for &'static Trait:'static.
(&None, ty::RegionTraitStore(ty::ReStatic)) => {
let mut set = ty::EmptyBuiltinBounds(); set.add(ty::BoundStatic); set
}
// &'r Trait is sugar for &'r Trait:<no-bounds>.
(&None, ty::RegionTraitStore(..)) => ty::EmptyBuiltinBounds(),
// No bounds are automatically applied for &'r Trait or ~Trait
(&None, ty::RegionTraitStore(..)) |
(&None, ty::UniqTraitStore) => ty::EmptyBuiltinBounds(),
}
}