-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #101797: Suggest associated const for incorrect use of let in traits
- Loading branch information
1 parent
c3f5929
commit 98e20c0
Showing
4 changed files
with
43 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Issue: 101797, Suggest associated const for incorrect use of let in traits | ||
// run-rustfix | ||
trait Trait { | ||
const _X: i32; | ||
//~^ ERROR non-item in item list | ||
} | ||
|
||
fn main() { | ||
|
||
} |
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,10 @@ | ||
// Issue: 101797, Suggest associated const for incorrect use of let in traits | ||
// run-rustfix | ||
trait Trait { | ||
let _X: i32; | ||
//~^ ERROR non-item in item list | ||
} | ||
|
||
fn main() { | ||
|
||
} |
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,8 @@ | ||
error: non-item in item list | ||
--> $DIR/suggest-assoc-const.rs:4:5 | ||
| | ||
LL | let _X: i32; | ||
| ^^^ help: considering use `const` instead of `let` for associated const: `const` | ||
|
||
error: aborting due to previous error | ||
|