Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve placement of
use
suggestions
- Loading branch information
Showing
9 changed files
with
181 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// Copyright 2016 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. | ||
|
||
macro_rules! y { | ||
() => {} | ||
} | ||
|
||
mod m { | ||
pub const A: i32 = 0; | ||
} | ||
|
||
fn main() { | ||
y!(); | ||
let _ = A; | ||
foo(); | ||
} | ||
|
||
fn foo() { | ||
type Dict<K, V> = HashMap<K, V>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
error[E0425]: cannot find value `A` in this scope | ||
--> $DIR/use_suggestion_placement.rs:21:13 | ||
| | ||
21 | let _ = A; | ||
| ^ not found in this scope | ||
| | ||
help: possible candidate is found in another module, you can import it into scope | ||
| | ||
11 | use m::A; | ||
| | ||
|
||
error[E0412]: cannot find type `HashMap` in this scope | ||
--> $DIR/use_suggestion_placement.rs:26:23 | ||
| | ||
26 | type Dict<K, V> = HashMap<K, V>; | ||
| ^^^^^^^ not found in this scope | ||
| | ||
help: possible candidates are found in other modules, you can import them into scope | ||
| | ||
11 | use std::collections::HashMap; | ||
| | ||
11 | use std::collections::hash_map::HashMap; | ||
| | ||
|
||
error[E0091]: type parameter `K` is unused | ||
--> $DIR/use_suggestion_placement.rs:26:15 | ||
| | ||
26 | type Dict<K, V> = HashMap<K, V>; | ||
| ^ unused type parameter | ||
|
||
error[E0091]: type parameter `V` is unused | ||
--> $DIR/use_suggestion_placement.rs:26:18 | ||
| | ||
26 | type Dict<K, V> = HashMap<K, V>; | ||
| ^ unused type parameter | ||
|
||
error: aborting due to 4 previous errors | ||
|
Oops, something went wrong.