From bdd24b2a56e8bf6b952bd8880364fb0a57c2c540 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Thu, 20 Mar 2014 14:10:52 -0700 Subject: [PATCH] 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 --- src/librustc/middle/typeck/astconv.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/librustc/middle/typeck/astconv.rs b/src/librustc/middle/typeck/astconv.rs index 93962b3e410..54ed9ef6ef6 100644 --- a/src/librustc/middle/typeck/astconv.rs +++ b/src/librustc/middle/typeck/astconv.rs @@ -850,15 +850,12 @@ fn conv_builtin_bounds(tcx: &ty::ctxt, ast_bounds: &Option { - 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:. - (&None, ty::RegionTraitStore(..)) => ty::EmptyBuiltinBounds(), + // No bounds are automatically applied for &'r Trait or ~Trait + (&None, ty::RegionTraitStore(..)) | + (&None, ty::UniqTraitStore) => ty::EmptyBuiltinBounds(), } }