Skip to content

Commit

Permalink
added test
Browse files Browse the repository at this point in the history
  • Loading branch information
tinaun committed Mar 28, 2018
1 parent d2b9a77 commit 97e0dc3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/test/ui/impl-trait/universal-issue-48703.rs
@@ -0,0 +1,19 @@
// Copyright 2017 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.

#![feature(universal_impl_trait)]

use std::fmt::Debug;

fn foo<T>(x: impl Debug) { }

fn main() {
foo::<String>('a'); //~ ERROR cannot provide explicit type parameters
}
9 changes: 9 additions & 0 deletions src/test/ui/impl-trait/universal-issue-48703.stderr
@@ -0,0 +1,9 @@
error[E0632]: cannot provide explicit type parameters when `impl Trait` is used in argument position.
--> $DIR/universal-issue-48703.rs:18:5
|
LL | foo::<String>('a'); //~ ERROR cannot provide explicit type parameters
| ^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0632`.

0 comments on commit 97e0dc3

Please sign in to comment.