Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 14 pull requests #74195

Merged
merged 42 commits into from
Jul 10, 2020
Merged
Changes from 1 commit
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
049f6ea
Fixing broken link for the Eq trait
poliorcetics Jun 12, 2020
f25811e
Replace early-bound normalization hack with per-query key/value type …
eddyb Jul 5, 2020
f07100a
Use for<'tcx> fn pointers in Providers, instead of having Providers<'…
eddyb Jul 5, 2020
81fbfc4
Use relative path for local links to primitives in libcore
sethp Jul 6, 2020
ee3a0f8
Add guard to check for local `core` crate
sethp Jul 6, 2020
e0b69f2
Hide `&mut self` methods from Deref in sidebar
nbdd0121 Jul 6, 2020
368aa6f
Add test for issue 74083
nbdd0121 Jul 6, 2020
33a5d00
Two new rustdoc tests for intra links
sethp Jul 7, 2020
165aecb
build extern docs as well
sethp Jul 7, 2020
865b930
Assert current behavior for links
sethp Jul 7, 2020
f258d98
ignore-tidy-linelength for @has assertions
sethp Jul 7, 2020
8d267db
Revert "Add guard to check for local `core` crate"
sethp Jul 7, 2020
dd07774
Fix broken link in rustdocdoc
JohnTitor Jul 7, 2020
7bc85e2
Liballoc use vec instead of vector
pickfire Jul 8, 2020
0965443
Remove unneeded ToString import in liballoc slice
pickfire Jul 8, 2020
9366458
Apply #![crate_type = "rlib"] directly to the linker
sethp Jul 8, 2020
1e567c1
Avoid "blacklist"
tamird Jul 8, 2020
56b6b44
Avoid running test on Windows platforms
sethp Jul 8, 2020
ca22091
Update cargo
ehuss Jul 7, 2020
81c5bb6
Eliminate confusing "globals" terminology.
nnethercote Jul 6, 2020
35fae73
update miri
RalfJung Jul 9, 2020
09f51d4
Add docs for intra-doc-links
Manishearth Jun 27, 2020
271e2a9
Update src/doc/rustdoc/src/intra-doc-links.md
Manishearth Jul 9, 2020
08d3a74
Allow for parentheses after macro intra-doc-links
Manishearth Jun 27, 2020
fc6ee8f
Reduce indentation
estebank Jul 9, 2020
e771a4f
Tweak `::` -> `:` typo heuristic and reduce verbosity
estebank Jul 9, 2020
36a229b
Move to unstable section
Manishearth Jul 9, 2020
fe351e9
Add test
Manishearth Jul 9, 2020
5fc46fa
Rollup merge of #73292 - poliorcetics:fix-link-in-partialeq, r=Dylan-DPC
Manishearth Jul 9, 2020
d163524
Rollup merge of #73791 - Manishearth:parens-intra-doc, r=GuillaumeGom…
Manishearth Jul 9, 2020
65ac394
Rollup merge of #74070 - eddyb:forall-tcx-providers, r=nikomatsakis
Manishearth Jul 9, 2020
07301e3
Rollup merge of #74077 - sethp:docs/fix-intra-doc-primitive-link, r=j…
Manishearth Jul 9, 2020
89c9e97
Rollup merge of #74079 - nnethercote:session-globals, r=nikomatsakis
Manishearth Jul 9, 2020
38541b7
Rollup merge of #74107 - nbdd0121:rustdoc, r=GuillaumeGomez
Manishearth Jul 9, 2020
640569c
Rollup merge of #74136 - JohnTitor:index-page-link, r=GuillaumeGomez
Manishearth Jul 9, 2020
178cdc5
Rollup merge of #74137 - ehuss:update-cargo, r=ehuss
Manishearth Jul 9, 2020
887f9e7
Rollup merge of #74142 - pickfire:patch-1, r=dtolnay
Manishearth Jul 9, 2020
2d432ae
Rollup merge of #74143 - pickfire:patch-2, r=jonas-schievink
Manishearth Jul 9, 2020
089a6e1
Rollup merge of #74146 - RalfJung:miri, r=RalfJung
Manishearth Jul 9, 2020
d4d1111
Rollup merge of #74150 - tamird:blocklist, r=nikomatsakis
Manishearth Jul 9, 2020
31d53de
Rollup merge of #74184 - Manishearth:doc-intra-doc, r=GuillaumeGomez
Manishearth Jul 9, 2020
9353e21
Rollup merge of #74188 - estebank:tweak-ascription-typo-heuristic, r=…
Manishearth Jul 9, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 33 additions & 35 deletions src/librustc_resolve/diagnostics.rs
Original file line number Diff line number Diff line change
@@ -840,44 +840,42 @@ impl<'a> Resolver<'a> {
suggestion: Option<TypoSuggestion>,
span: Span,
) -> bool {
if let Some(suggestion) = suggestion {
let suggestion = match suggestion {
None => return false,
// We shouldn't suggest underscore.
if suggestion.candidate == kw::Underscore {
return false;
}

let msg = format!(
"{} {} with a similar name exists",
suggestion.res.article(),
suggestion.res.descr()
);
err.span_suggestion(
span,
&msg,
suggestion.candidate.to_string(),
Applicability::MaybeIncorrect,
);
let def_span = suggestion.res.opt_def_id().and_then(|def_id| match def_id.krate {
LOCAL_CRATE => self.opt_span(def_id),
_ => Some(
self.session
.source_map()
.guess_head_span(self.cstore().get_span_untracked(def_id, self.session)),
Some(suggestion) if suggestion.candidate == kw::Underscore => return false,
Some(suggestion) => suggestion,
};
let msg = format!(
"{} {} with a similar name exists",
suggestion.res.article(),
suggestion.res.descr()
);
err.span_suggestion(
span,
&msg,
suggestion.candidate.to_string(),
Applicability::MaybeIncorrect,
);
let def_span = suggestion.res.opt_def_id().and_then(|def_id| match def_id.krate {
LOCAL_CRATE => self.opt_span(def_id),
_ => Some(
self.session
.source_map()
.guess_head_span(self.cstore().get_span_untracked(def_id, self.session)),
),
});
if let Some(span) = def_span {
err.span_label(
self.session.source_map().guess_head_span(span),
&format!(
"similarly named {} `{}` defined here",
suggestion.res.descr(),
suggestion.candidate.as_str(),
),
});
if let Some(span) = def_span {
err.span_label(
self.session.source_map().guess_head_span(span),
&format!(
"similarly named {} `{}` defined here",
suggestion.res.descr(),
suggestion.candidate.as_str(),
),
);
}
return true;
);
}
false
true
}

fn binding_description(&self, b: &NameBinding<'_>, ident: Ident, from_prelude: bool) -> String {