rust-lang / rust-lang/rust-analyzer
Filter const trait syntax and some unstable trait
Open
Nobody has claimed this yet.
C-feature
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
The Rust standard library has some unstable trait and const trait syntax
Although rustc_const_unstable can be handle correctly, r-a will output it when completing item-list
I want to implement it, but there are two problems:
- Which traits need to be removed itself instead of just removing
[const]? Unstable and in thestd::marker? - When will it be disabled this? in configure?
#![feature(const_trait_impl)]? Or something else?
struct Foo;
impl Iterator for Foo {
fol$0
}
Current:
struct Foo;
impl Iterator for Foo {
fn fold<B, F>(mut self, init: B, mut f: F) -> B
where
Self: Sized + [const] std::marker::Destruct,
F: [const] FnMut(B, Self::Item) -> B + [const] std::marker::Destruct,
{
$0
}
}
Expect:
struct Foo;
impl Iterator for Foo {
fn fold<B, F>(mut self, init: B, mut f: F) -> B
where
Self: Sized,
F: FnMut(B, Self::Item) -> B,
{
$0
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce item-list completion for the provided Iterator implementation and inspect how rust-analyzer handles rustc_const_unstable and const trait syntax. Determine which unstable traits and [const] bounds should be omitted, and verify completion produces the expected fold signature without them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100