diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc_typeck/astconv.rs | 9 | ||||
| -rw-r--r-- | src/test/compile-fail/issue-23589.rs | 14 | ||||
| -rw-r--r-- | src/test/compile-fail/unboxed-closure-sugar-used-on-struct-1.rs | 1 | ||||
| -rw-r--r-- | src/test/compile-fail/unboxed-closure-sugar-used-on-struct.rs | 1 |
4 files changed, 20 insertions, 5 deletions
diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index cb3d5bd9bf9..bda32666a3f 100644 --- a/src/librustc_typeck/astconv.rs +++ b/src/librustc_typeck/astconv.rs @@ -291,10 +291,13 @@ pub fn ast_path_substs_for_ty<'tcx>( ast::AngleBracketedParameters(ref data) => { convert_angle_bracketed_parameters(this, rscope, span, decl_generics, data) } - ast::ParenthesizedParameters(ref data) => { + ast::ParenthesizedParameters(..) => { span_err!(tcx.sess, span, E0214, - "parenthesized parameters may only be used with a trait"); - convert_parenthesized_parameters(this, rscope, span, decl_generics, data) + "parenthesized parameters may only be used with a trait"); + let ty_param_defs = decl_generics.types.get_slice(TypeSpace); + (Substs::empty(), + ty_param_defs.iter().map(|_| tcx.types.err).collect(), + vec![]) } }; diff --git a/src/test/compile-fail/issue-23589.rs b/src/test/compile-fail/issue-23589.rs new file mode 100644 index 00000000000..1c1d42da029 --- /dev/null +++ b/src/test/compile-fail/issue-23589.rs @@ -0,0 +1,14 @@ +// Copyright 2015 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +fn main() { + let v: Vec(&str) = vec!['1', '2']; + //~^ ERROR parenthesized parameters may only be used with a trait +} diff --git a/src/test/compile-fail/unboxed-closure-sugar-used-on-struct-1.rs b/src/test/compile-fail/unboxed-closure-sugar-used-on-struct-1.rs index 1e36c47c097..3f88f16d2c3 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-used-on-struct-1.rs +++ b/src/test/compile-fail/unboxed-closure-sugar-used-on-struct-1.rs @@ -18,7 +18,6 @@ struct Bar<A> { fn bar() { let x: Box<Bar()> = panic!(); //~^ ERROR parenthesized parameters may only be used with a trait - //~^^ ERROR associated type bindings are not allowed here } fn main() { } diff --git a/src/test/compile-fail/unboxed-closure-sugar-used-on-struct.rs b/src/test/compile-fail/unboxed-closure-sugar-used-on-struct.rs index f50d91a4ddd..fd6c8ad08d6 100644 --- a/src/test/compile-fail/unboxed-closure-sugar-used-on-struct.rs +++ b/src/test/compile-fail/unboxed-closure-sugar-used-on-struct.rs @@ -16,7 +16,6 @@ struct Bar<A> { fn foo(b: Box<Bar()>) { //~^ ERROR parenthesized parameters may only be used with a trait - //~^^ ERROR associated type bindings are not allowed here } fn main() { } |
