mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-17 17:33:07 +00:00
Fix #23589
This commit is contained in:
parent
7a13b93b00
commit
2bce9d0ff5
@ -291,10 +291,13 @@ pub fn ast_path_substs_for_ty<'tcx>(
|
|||||||
ast::AngleBracketedParameters(ref data) => {
|
ast::AngleBracketedParameters(ref data) => {
|
||||||
convert_angle_bracketed_parameters(this, rscope, span, decl_generics, data)
|
convert_angle_bracketed_parameters(this, rscope, span, decl_generics, data)
|
||||||
}
|
}
|
||||||
ast::ParenthesizedParameters(ref data) => {
|
ast::ParenthesizedParameters(..) => {
|
||||||
span_err!(tcx.sess, span, E0214,
|
span_err!(tcx.sess, span, E0214,
|
||||||
"parenthesized parameters may only be used with a trait");
|
"parenthesized parameters may only be used with a trait");
|
||||||
convert_parenthesized_parameters(this, rscope, span, decl_generics, data)
|
let ty_param_defs = decl_generics.types.get_slice(TypeSpace);
|
||||||
|
(Substs::empty(),
|
||||||
|
ty_param_defs.iter().map(|_| tcx.types.err).collect(),
|
||||||
|
vec![])
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
14
src/test/compile-fail/issue-23589.rs
Normal file
14
src/test/compile-fail/issue-23589.rs
Normal file
@ -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
|
||||||
|
}
|
@ -18,7 +18,6 @@ struct Bar<A> {
|
|||||||
fn bar() {
|
fn bar() {
|
||||||
let x: Box<Bar()> = panic!();
|
let x: Box<Bar()> = panic!();
|
||||||
//~^ ERROR parenthesized parameters may only be used with a trait
|
//~^ ERROR parenthesized parameters may only be used with a trait
|
||||||
//~^^ ERROR associated type bindings are not allowed here
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
@ -16,7 +16,6 @@ struct Bar<A> {
|
|||||||
|
|
||||||
fn foo(b: Box<Bar()>) {
|
fn foo(b: Box<Bar()>) {
|
||||||
//~^ ERROR parenthesized parameters may only be used with a trait
|
//~^ ERROR parenthesized parameters may only be used with a trait
|
||||||
//~^^ ERROR associated type bindings are not allowed here
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn main() { }
|
fn main() { }
|
||||||
|
Loading…
Reference in New Issue
Block a user