From 7b4ee5cce70b9976c96e1bee06493ad44037b000 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Sat, 8 Mar 2014 18:21:01 -0800 Subject: syntax: Add support for trait bounds on procs This is needed to make progress on #10296 as the default bounds will no longer include Send. I believe that this was the originally intended syntax for procs, and it just hasn't been necessary up until now. --- src/libsyntax/parse/parser.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libsyntax/parse/parser.rs') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 6fbf5f071ad..c8bd87024e8 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -893,13 +893,14 @@ impl Parser { // Parses a procedure type (`proc`). The initial `proc` keyword must // already have been parsed. pub fn parse_proc_type(&mut self) -> Ty_ { + let bounds = self.parse_optional_ty_param_bounds(); let (decl, lifetimes) = self.parse_ty_fn_decl(false); TyClosure(@ClosureTy { sigil: OwnedSigil, region: None, purity: ImpureFn, onceness: Once, - bounds: None, + bounds: bounds, decl: decl, lifetimes: lifetimes, }) -- cgit 1.4.1-3-g733a5