Improve ux when calling associated functions with dot notation

Issue: 22692
This commit is contained in:
Donato Sciarra 2018-09-17 23:37:20 +02:00
parent eb50e75729
commit 0390736dce
3 changed files with 69 additions and 14 deletions

View file

@ -0,0 +1,13 @@
// Copyright 2018 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 _ = String.new();
}

View file

@ -0,0 +1,11 @@
error[E0423]: expected value, found struct `String`
--> $DIR/issue-22692.rs:12:13
|
LL | let _ = String.new();
| ^^^^^^----
| |
| help: use `::` to access an associated function: `String::new`
error: aborting due to previous error
For more information about this error, try `rustc --explain E0423`.