Skip to content

Commit 3e4d1b4

Browse files
committed
Auto merge of #26407 - arielb1:paren-binding, r=eddyb
r? @eddyb
2 parents 7d4d77f + 2bce9d0 commit 3e4d1b4

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

src/librustc_typeck/astconv.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,13 @@ pub fn ast_path_substs_for_ty<'tcx>(
290290
ast::AngleBracketedParameters(ref data) => {
291291
convert_angle_bracketed_parameters(this, rscope, span, decl_generics, data)
292292
}
293-
ast::ParenthesizedParameters(ref data) => {
293+
ast::ParenthesizedParameters(..) => {
294294
span_err!(tcx.sess, span, E0214,
295-
"parenthesized parameters may only be used with a trait");
296-
convert_parenthesized_parameters(this, rscope, span, decl_generics, data)
295+
"parenthesized parameters may only be used with a trait");
296+
let ty_param_defs = decl_generics.types.get_slice(TypeSpace);
297+
(Substs::empty(),
298+
ty_param_defs.iter().map(|_| tcx.types.err).collect(),
299+
vec![])
297300
}
298301
};
299302

src/test/compile-fail/issue-23589.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
fn main() {
12+
let v: Vec(&str) = vec!['1', '2'];
13+
//~^ ERROR parenthesized parameters may only be used with a trait
14+
}

src/test/compile-fail/unboxed-closure-sugar-used-on-struct-1.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ struct Bar<A> {
1818
fn bar() {
1919
let x: Box<Bar()> = panic!();
2020
//~^ ERROR parenthesized parameters may only be used with a trait
21-
//~^^ ERROR associated type bindings are not allowed here
2221
}
2322

2423
fn main() { }

src/test/compile-fail/unboxed-closure-sugar-used-on-struct.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ struct Bar<A> {
1616

1717
fn foo(b: Box<Bar()>) {
1818
//~^ ERROR parenthesized parameters may only be used with a trait
19-
//~^^ ERROR associated type bindings are not allowed here
2019
}
2120

2221
fn main() { }

0 commit comments

Comments
 (0)