提交 bdd24b2a 编写于 作者: A Alex Crichton

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
上级 25e52383
......@@ -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(),
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册