Skip to content

Commit bdd24b2

Browse files
committed
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
1 parent 25e5238 commit bdd24b2

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/librustc/middle/typeck/astconv.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -850,15 +850,12 @@ fn conv_builtin_bounds(tcx: &ty::ctxt, ast_bounds: &Option<OwnedSlice<ast::TyPar
850850
}
851851
builtin_bounds
852852
},
853-
// ~Trait is sugar for ~Trait:Send.
854-
(&None, ty::UniqTraitStore) => {
855-
let mut set = ty::EmptyBuiltinBounds(); set.add(ty::BoundSend); set
856-
}
857853
// &'static Trait is sugar for &'static Trait:'static.
858854
(&None, ty::RegionTraitStore(ty::ReStatic)) => {
859855
let mut set = ty::EmptyBuiltinBounds(); set.add(ty::BoundStatic); set
860856
}
861-
// &'r Trait is sugar for &'r Trait:<no-bounds>.
862-
(&None, ty::RegionTraitStore(..)) => ty::EmptyBuiltinBounds(),
857+
// No bounds are automatically applied for &'r Trait or ~Trait
858+
(&None, ty::RegionTraitStore(..)) |
859+
(&None, ty::UniqTraitStore) => ty::EmptyBuiltinBounds(),
863860
}
864861
}

0 commit comments

Comments
 (0)