Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
2b8f2ac
Indicate both start and end of pass RSS in time-passes output
tgnottingham Jan 25, 2021
a75f9bc
Merge commit 'd556c56f792756dd7cfec742b9f2e07612dc10f4' into sync_cg_…
bjorn3 Feb 1, 2021
eeb75c7
Merge branch 'sync_from_rust'
bjorn3 Feb 1, 2021
02e1fd4
Rollup merge of #81618 - bjorn3:sync_cg_clif-2021-02-01, r=bjorn3
jonas-schievink Feb 1, 2021
d1df92e
Sync from rust d60b29d1ae8147538b8d542f7ffcc03b48e2cbda
bjorn3 Feb 2, 2021
e4ae9ef
Rustup to rustc 1.51.0-nightly (d4e3570db 2021-02-01)
bjorn3 Feb 2, 2021
54523b8
Fix rustc bootstrap test
bjorn3 Jan 22, 2021
5bdc56c
Add a new ABI to support cmse_nonsecure_call
hug-dev Jan 24, 2021
0f861e1
Update Cranelift
bjorn3 Feb 3, 2021
2d3603f
Update dependencies
bjorn3 Feb 3, 2021
decb9b2
Rustfmt
bjorn3 Feb 3, 2021
f36c14f
Sync from rust f4008fe94935d05ffb3a48fc5b7149070bb45550
bjorn3 Feb 9, 2021
176965f
Rustup to rustc 1.52.0-nightly (0fc6756b4 2021-02-08)
bjorn3 Feb 9, 2021
6fe5eac
Update Cranelift
bjorn3 Feb 9, 2021
bfcf97b
Update libc and libloading
bjorn3 Feb 9, 2021
c5dff34
Revert "Update libc and libloading"
bjorn3 Feb 9, 2021
260a5d4
Stabilize str_split_once
jhpratt Feb 9, 2021
94aac0a
Pass around BackendConfig
bjorn3 Feb 12, 2021
658d124
Rustfmt
bjorn3 Feb 12, 2021
9be3936
Use #!/usr/bin/env bash
bjorn3 Feb 14, 2021
87ecdaa
Recognize FreeBSD as OS
bjorn3 Feb 14, 2021
47bc1db
Test FreeBSD on Cirrus CI
bjorn3 Feb 14, 2021
1337f96
Merge pull request #1138 from bjorn3/cirrus_ci
bjorn3 Feb 14, 2021
fe8d11b
Use an ItemId inside mir::GlobalAsm.
cjgillot Jan 30, 2021
c39cb46
Update Cranelift
bjorn3 Feb 18, 2021
92f765f
Remove support for x86 oldBE
bjorn3 Feb 9, 2021
f2f5452
Use real atomic instructions instead of a global lock
bjorn3 Feb 9, 2021
537db9a
Disable 128bit atomic operations on macOS
bjorn3 Feb 18, 2021
702676b
Use a QueryContext for try_mark_green.
cjgillot Jan 18, 2021
92c1b85
Disable stack2reg optimization
bjorn3 Feb 20, 2021
4cfb885
Merge pull request #1140 from bjorn3/no_more_oldbe
bjorn3 Feb 21, 2021
25f7eee
Don't import the metadata symbol
bjorn3 Feb 21, 2021
a8f3877
Don't write clif ir by default when debug assertions are enabled
bjorn3 Feb 21, 2021
b36fd9d
Remove unnecessary parts from alloc_system
bjorn3 Feb 21, 2021
93373e1
Don't build alloc_system as part of the sysroot
bjorn3 Feb 21, 2021
4f45ea7
Re-enable some now compiling libcore tests
bjorn3 Feb 21, 2021
c5f98b5
Remove shift amount masking
bjorn3 Feb 21, 2021
9c98027
Directly use Cranelift instructions for 128bit int shifts
bjorn3 Feb 21, 2021
ee36a1f
Remove workaround for stack_{load,store}.i128 not being implemented
bjorn3 Feb 21, 2021
b0f870e
Fix CI
bjorn3 Feb 21, 2021
74f39b6
Avoid a temporary stackslot in codegen_checked_int_binop
bjorn3 Feb 21, 2021
0610490
Assume constants can't fail to evaluate
bjorn3 Feb 21, 2021
7fc3483
Revert "Remove shift amount masking"
bjorn3 Feb 21, 2021
ecba16f
Various enum to int cast fixes
bjorn3 Feb 21, 2021
4eb6754
Sync from rust 3e826bb11228508fbe749e594038d6727208aa94
bjorn3 Feb 21, 2021
013b3c5
Rustfmt
bjorn3 Feb 21, 2021
a5bf6d2
Rustup to rustc 1.52.0-nightly (83b30a639 2021-02-20)
bjorn3 Feb 21, 2021
d5ac849
Update Cranelift
bjorn3 Feb 22, 2021
b0028fa
Update dependencies
bjorn3 Feb 22, 2021
c247446
Disable macro-error rust-analyzer diagnostic
bjorn3 Feb 23, 2021
ef96a0f
Update Cranelift
bjorn3 Feb 23, 2021
73d3a1c
Use dynamic dispatch for the inner Module
bjorn3 Feb 22, 2021
86c5944
Merge pull request #1144 from bjorn3/dynamic_module
bjorn3 Feb 23, 2021
8b7d335
Rollup merge of #81940 - jhpratt:stabilize-str_split_once, r=m-ou-se
GuillaumeGomez Feb 26, 2021
27a5f4f
Update Cranelift
bjorn3 Mar 1, 2021
7d33e5b
Fix bootstrap test script
bjorn3 Mar 1, 2021
9d25ccf
Change built-in kernel targets to be os = none throughout
Ericson2314 Oct 11, 2020
44c2794
Clean up error reporting for deprecated passes
jyn514 Mar 1, 2021
d5c300b
Report that `doc(plugins)` doesn't work using diagnostics instead of …
jyn514 Mar 1, 2021
d9d6921
Fix diagnostic suggests adding type `[type error]`
henryboisdequin Mar 3, 2021
ebe0407
improve offset_from docs
RalfJung Mar 4, 2021
b3c4e25
Don't require a `DocContext` for `report_diagnostic`
jyn514 Feb 22, 2021
675edd0
Remove RefCell around module_trait_cache
jyn514 Feb 22, 2021
9406510
Sync from rust a0d66b54fb3acc2125972b88ff543a2c04d14af5
bjorn3 Mar 5, 2021
b5f67dc
Rustup to rustc 1.52.0-nightly (45b3c2851 2021-03-04)
bjorn3 Mar 5, 2021
5e73629
Rustfmt
bjorn3 Mar 5, 2021
69a879f
Store `UNVERSIONED_FILES` in a data structure
jyn514 Mar 5, 2021
9a0c329
Disable value debuginfo
bjorn3 Mar 5, 2021
2371914
Prevent Zip specialization from calling __iterator_get_unchecked twic…
SkiFire13 Mar 3, 2021
c1bfb9a
Add relevant test
SkiFire13 Feb 19, 2021
7a6ea77
Merge commit '9a0c32934ebe376128230aa8da3275697b2053e7' into sync_cg_…
bjorn3 Mar 5, 2021
173d2aa
Add an unstable option to print all unversioned files
jyn514 Mar 5, 2021
7d3a6f1
address comments
henryboisdequin Mar 3, 2021
0ca63ec
Fix typo
henryboisdequin Mar 6, 2021
eb9abea
Move some tests to more suitable subdirs
JohnTitor Mar 5, 2021
fbc1741
Improve transmute docs with further clarifications
Lonami Feb 27, 2021
b751548
tweak MaybeUninit docs
RalfJung Mar 6, 2021
79c2b75
Make some Option, Result methods unstably const
jhpratt Feb 15, 2021
d1dc166
Rollup merge of #77916 - QuiltOS:kernel-code-targets-os-none, r=josht…
JohnTitor Mar 7, 2021
0adc196
Rollup merge of #82130 - jhpratt:const-option-result, r=RalfJung
JohnTitor Mar 7, 2021
1d5b2dc
Rollup merge of #82292 - SkiFire13:fix-issue-82291, r=m-ou-se
JohnTitor Mar 7, 2021
3d762a7
Rollup merge of #82402 - jyn514:module-cache-refcell, r=GuillaumeGomez
JohnTitor Mar 7, 2021
817e58f
Rollup merge of #82592 - Lonami:patch-1, r=RalfJung
JohnTitor Mar 7, 2021
f3218df
Rollup merge of #82651 - jyn514:rustdoc-warnings, r=GuillaumeGomez
JohnTitor Mar 7, 2021
a5a825e
Rollup merge of #82720 - henryboisdequin:fix-79040, r=oli-obk
JohnTitor Mar 7, 2021
05a2366
Rollup merge of #82751 - RalfJung:offset_from, r=dtolnay
JohnTitor Mar 7, 2021
a0dcfdf
Rollup merge of #82793 - JohnTitor:move-ui-tests, r=petrochenkov
JohnTitor Mar 7, 2021
379679b
Rollup merge of #82803 - jyn514:unversioned-files, r=GuillaumeGomez
JohnTitor Mar 7, 2021
b6191d7
Rollup merge of #82808 - bjorn3:sync_cg_clif-2021-03-05, r=bjorn3
JohnTitor Mar 7, 2021
74ae20e
Rollup merge of #82822 - henryboisdequin:fix-typo-rustc, r=oli-obk
JohnTitor Mar 7, 2021
6220e00
Rollup merge of #82837 - RalfJung:maybe-uninit, r=dtolnay
JohnTitor Mar 7, 2021
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
Prev Previous commit
Next Next commit
Remove RefCell around module_trait_cache
  • Loading branch information
jyn514 committed Mar 4, 2021
commit 675edd0231fd799f130ae2d46e079b3753475449
4 changes: 2 additions & 2 deletions src/librustdoc/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ crate struct DocContext<'tcx> {
///
/// See `collect_intra_doc_links::traits_implemented_by` for more details.
/// `map<module, set<trait>>`
crate module_trait_cache: RefCell<FxHashMap<DefId, FxHashSet<DefId>>>,
crate module_trait_cache: FxHashMap<DefId, FxHashSet<DefId>>,
/// This same cache is used throughout rustdoc, including in [`crate::html::render`].
crate cache: Cache,
/// Used by [`clean::inline`] to tell if an item has already been inlined.
Expand Down Expand Up @@ -450,7 +450,7 @@ crate fn run_global_ctxt(
.cloned()
.filter(|trait_def_id| tcx.trait_is_auto(*trait_def_id))
.collect(),
module_trait_cache: RefCell::new(FxHashMap::default()),
module_trait_cache: FxHashMap::default(),
cache: Cache::new(access_levels, render_options.document_private),
inlined: FxHashSet::default(),
output_format,
Expand Down
47 changes: 24 additions & 23 deletions src/librustdoc/passes/collect_intra_doc_links.rs
Original file line number Diff line number Diff line change
Expand Up @@ -484,21 +484,23 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
/// Resolves a string as a path within a particular namespace. Returns an
/// optional URL fragment in the case of variants and methods.
fn resolve<'path>(
&self,
&mut self,
path_str: &'path str,
ns: Namespace,
module_id: DefId,
extra_fragment: &Option<String>,
) -> Result<(Res, Option<String>), ErrorKind<'path>> {
let cx = &self.cx;
let tcx = self.cx.tcx;

if let Some(res) = self.resolve_path(path_str, ns, module_id) {
match res {
// FIXME(#76467): make this fallthrough to lookup the associated
// item a separate function.
Res::Def(DefKind::AssocFn | DefKind::AssocConst, _) => assert_eq!(ns, ValueNS),
Res::Def(DefKind::AssocTy, _) => assert_eq!(ns, TypeNS),
Res::Def(DefKind::Variant, _) => return handle_variant(cx, res, extra_fragment),
Res::Def(DefKind::Variant, _) => {
return handle_variant(self.cx, res, extra_fragment);
}
// Not a trait item; just return what we found.
Res::Primitive(ty) => {
if extra_fragment.is_some() {
Expand Down Expand Up @@ -565,13 +567,12 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
) => {
debug!("looking for associated item named {} for item {:?}", item_name, did);
// Checks if item_name belongs to `impl SomeItem`
let assoc_item = cx
.tcx
let assoc_item = tcx
.inherent_impls(did)
.iter()
.flat_map(|&imp| {
cx.tcx.associated_items(imp).find_by_name_and_namespace(
cx.tcx,
tcx.associated_items(imp).find_by_name_and_namespace(
tcx,
Ident::with_dummy_span(item_name),
ns,
imp,
Expand All @@ -587,7 +588,7 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
// something like [`ambi_fn`](<SomeStruct as SomeTrait>::ambi_fn)
.or_else(|| {
let kind =
resolve_associated_trait_item(did, module_id, item_name, ns, &self.cx);
resolve_associated_trait_item(did, module_id, item_name, ns, self.cx);
debug!("got associated item kind {:?}", kind);
kind
});
Expand All @@ -611,7 +612,7 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
debug!("looking for variants or fields named {} for {:?}", item_name, did);
// FIXME(jynelson): why is this different from
// `variant_field`?
match cx.tcx.type_of(did).kind() {
match tcx.type_of(did).kind() {
ty::Adt(def, _) => {
let field = if def.is_enum() {
def.all_fields().find(|item| item.ident.name == item_name)
Expand Down Expand Up @@ -652,10 +653,9 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
None
}
}
Res::Def(DefKind::Trait, did) => cx
.tcx
Res::Def(DefKind::Trait, did) => tcx
.associated_items(did)
.find_by_name_and_namespace(cx.tcx, Ident::with_dummy_span(item_name), ns, did)
.find_by_name_and_namespace(tcx, Ident::with_dummy_span(item_name), ns, did)
.map(|item| {
let kind = match item.kind {
ty::AssocKind::Const => "associatedconstant",
Expand Down Expand Up @@ -699,7 +699,7 @@ impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
/// This returns the `Res` even if it was erroneous for some reason
/// (such as having invalid URL fragments or being in the wrong namespace).
fn check_full_res(
&self,
&mut self,
ns: Namespace,
path_str: &str,
module_id: DefId,
Expand Down Expand Up @@ -733,7 +733,7 @@ fn resolve_associated_trait_item(
module: DefId,
item_name: Symbol,
ns: Namespace,
cx: &DocContext<'_>,
cx: &mut DocContext<'_>,
) -> Option<(ty::AssocKind, DefId)> {
// FIXME: this should also consider blanket impls (`impl<T> X for T`). Unfortunately
// `get_auto_trait_and_blanket_impls` is broken because the caching behavior is wrong. In the
Expand All @@ -758,10 +758,10 @@ fn resolve_associated_trait_item(
///
/// NOTE: this cannot be a query because more traits could be available when more crates are compiled!
/// So it is not stable to serialize cross-crate.
fn traits_implemented_by(cx: &DocContext<'_>, type_: DefId, module: DefId) -> FxHashSet<DefId> {
let mut cache = cx.module_trait_cache.borrow_mut();
let in_scope_traits = cache.entry(module).or_insert_with(|| {
cx.enter_resolver(|resolver| {
fn traits_implemented_by(cx: &mut DocContext<'_>, type_: DefId, module: DefId) -> FxHashSet<DefId> {
let mut resolver = cx.resolver.borrow_mut();
let in_scope_traits = cx.module_trait_cache.entry(module).or_insert_with(|| {
resolver.access(|resolver| {
let parent_scope = &ParentScope::module(resolver.get_module(module), resolver);
resolver
.traits_in_scope(None, parent_scope, SyntaxContext::root(), None)
Expand All @@ -771,13 +771,14 @@ fn traits_implemented_by(cx: &DocContext<'_>, type_: DefId, module: DefId) -> Fx
})
});

let ty = cx.tcx.type_of(type_);
let tcx = cx.tcx;
let ty = tcx.type_of(type_);
let iter = in_scope_traits.iter().flat_map(|&trait_| {
trace!("considering explicit impl for trait {:?}", trait_);

// Look at each trait implementation to see if it's an impl for `did`
cx.tcx.find_map_relevant_impl(trait_, ty, |impl_| {
let trait_ref = cx.tcx.impl_trait_ref(impl_).expect("this is not an inherent impl");
tcx.find_map_relevant_impl(trait_, ty, |impl_| {
let trait_ref = tcx.impl_trait_ref(impl_).expect("this is not an inherent impl");
// Check if these are the same type.
let impl_type = trait_ref.self_ty();
trace!(
Expand Down Expand Up @@ -1308,7 +1309,7 @@ impl LinkCollector<'_, '_> {
/// After parsing the disambiguator, resolve the main part of the link.
// FIXME(jynelson): wow this is just so much
fn resolve_with_disambiguator(
&self,
&mut self,
key: &ResolutionInfo,
diag: DiagnosticInfo<'_>,
) -> Option<(Res, Option<String>)> {
Expand Down Expand Up @@ -1732,7 +1733,7 @@ fn report_diagnostic(
/// handled earlier. For example, if passed `Item::Crate(std)` and `path_str`
/// `std::io::Error::x`, this will resolve `std::io::Error`.
fn resolution_failure(
collector: &LinkCollector<'_, '_>,
collector: &mut LinkCollector<'_, '_>,
item: &Item,
path_str: &str,
disambiguator: Option<Disambiguator>,
Expand Down
3 changes: 2 additions & 1 deletion src/librustdoc/passes/html_tags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ impl<'a, 'tcx> DocFolder for InvalidHtmlTagsLinter<'a, 'tcx> {
let dox = item.attrs.collapsed_doc_value().unwrap_or_default();
if !dox.is_empty() {
let report_diag = |msg: &str, range: &Range<usize>| {
let sp = match super::source_span_for_markdown_range(tcx, &dox, range, &item.attrs) {
let sp = match super::source_span_for_markdown_range(tcx, &dox, range, &item.attrs)
{
Some(sp) => sp,
None => span_of_attrs(&item.attrs).unwrap_or(item.source.span()),
};
Expand Down