diff --git a/src/librustc_typeck/astconv.rs b/src/librustc_typeck/astconv.rs index cb3d5bd9bf93..bda32666a3f4 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 000000000000..1c1d42da029b --- /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 or the MIT license +// , 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 1e36c47c0973..3f88f16d2c3a 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 { fn bar() { let x: Box = 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 f50d91a4ddd9..fd6c8ad08d65 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 { fn foo(b: Box) { //~^ ERROR parenthesized parameters may only be used with a trait - //~^^ ERROR associated type bindings are not allowed here } fn main() { }