about summary refs log tree commit diff
path: root/compiler/rustc_span/src
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com>2023-07-16 18:18:38 +0800
committer许杰友 Jieyou Xu (Joe) <jieyouxu@outlook.com>2023-07-16 19:22:03 +0800
commit08c77a6eb403768ed64ae567980887984f506ef9 (patch)
tree3da9b7971e6ad61ebedf5c5dd716886948ba3e89 /compiler/rustc_span/src
parent00a39cc785fcbb4f1e9c9454e9ee8a85e6ff021c (diff)
Add infrastructure `#[rustc_confusables]` attribute to allow targeted
"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.
Diffstat (limited to 'compiler/rustc_span/src')
-rw-r--r--compiler/rustc_span/src/symbol.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs
index 4fc440ef947..08925761b39 100644
--- a/compiler/rustc_span/src/symbol.rs
+++ b/compiler/rustc_span/src/symbol.rs
@@ -1265,6 +1265,7 @@ symbols! {
         rustc_clean,
         rustc_coherence_is_core,
         rustc_coinductive,
+        rustc_confusables,
         rustc_const_stable,
         rustc_const_unstable,
         rustc_conversion_suggestion,