08c77a6eb4
"no method" errors on standard library types The standard library developer can annotate methods on e.g. `BTreeSet::push` with `#[rustc_confusables("insert")]`. When the user mistypes `btreeset.push()`, `BTreeSet::insert` will be suggested if there are no other candidates to suggest.
12 lines
199 B
Rust
12 lines
199 B
Rust
#![feature(rustc_attrs)]
|
|
|
|
pub struct BTreeSet;
|
|
|
|
impl BTreeSet {
|
|
#[rustc_confusables("push", "test_b")]
|
|
pub fn insert(&self) {}
|
|
|
|
#[rustc_confusables("pulled")]
|
|
pub fn pull(&self) {}
|
|
}
|