about summary refs log tree commit diff
path: root/src/librustdoc/clean
AgeCommit message (Collapse)AuthorLines
2020-07-31fix rustdoc generic param orderBastian Kauschke-28/+13
2020-07-30Auto merge of #74929 - Manishearth:rollup-z2vflrp, r=Manishearthbors-4/+4
Rollup of 10 pull requests Successful merges: - #74742 (Remove links to rejected errata 4406 for RFC 4291) - #74819 (Point towards `format_spec`; it is in other direction) - #74852 (Explain why inlining default ToString impl) - #74869 (Make closures and generators a must use types) - #74873 (symbol mangling: use ty::print::Print for consts) - #74902 (Remove deprecated unstable `{Box,Rc,Arc}::into_raw_non_null` functions) - #74904 (Fix some typos in src/librustdoc/clean/auto_trait.rs) - #74910 (fence docs: fix example Mutex) - #74912 (Fix broken link in unstable book `plugin`) - #74927 (Change the target data layout to specify more values) Failed merges: r? @ghost
2020-07-29Auto merge of #73767 - P1n3appl3:rustdoc-formats, r=tmandrybors-3/+4
Refactor librustdoc html backend This PR moves several types out of the librustdoc::html module so that they can be used by a future json backend. These changes are a re-implementation of [some work done 6 months ago](https://github.com/rust-lang/rust/compare/master...GuillaumeGomez:multiple-output-formats) by @GuillaumeGomez. I'm currently working on said json backend and will put up an RFC soon with the proposed implementation. There are a couple of changes that are more substantial than relocating structs to a different module: 1. The `Cache` is no longer part of the `html::render::Context` type and therefor it needs to be explicitly passed to any functions that access it. 2. The driving function `html::render::run` has been rewritten to use the `FormatRenderer` trait which should allow different backends to re-use the driving code. r? @GuillaumeGomez cc @tmandry @betamos
2020-07-29Fix some typos in src/librustdoc/clean/auto_trait.rsJosh Triplett-4/+4
2020-07-27Extract `Cache` and other types from `html` moduleJoseph Ryan-3/+4
2020-07-27fix rustdocBastian Kauschke-24/+14
2020-07-27introduce PredicateAtomBastian Kauschke-35/+27
2020-07-27this might be unqualified, but at least it's now quantifiedBastian Kauschke-8/+9
2020-07-27fix rustdocBastian Kauschke-12/+20
2020-07-27rustdocBastian Kauschke-31/+36
2020-07-27`PredicateKint` -> `PredicateKind`, the beginning of the endBastian Kauschke-1/+1
2020-07-20Migrate rustc_depr uses to use deprecation attributeMark Rousskov-14/+4
This should not be a change in behavior.
2020-07-19Only skip impls of foreign unstable traitsMark Rousskov-3/+5
Previously unstable impls were skipped, which meant that any impl with an unstable method would get skipped.
2020-07-16Rollup merge of #74370 - Manishearth:re-spotlight, r=GuillaumeGomezManish Goregaokar-1/+6
Reintroduce spotlight / "important traits" feature (Reopened version of https://github.com/rust-lang/rust/pull/74111 because Github is broken, see discussion there) Fixes https://github.com/rust-lang/rust/issues/73785 This PR reintroduces the "spotlight" ("important traits") feature. A couple changes have been made: As there were concerns about its visibility, it has been moved to be next to the return type, as opposed to being on the side. It also no longer produces a modal, it shows the traits on hover, and it can be clicked on to pin the hover bubble. ![image](https://user-images.githubusercontent.com/1617736/86674555-a82d2600-bfad-11ea-9a4a-a1a9ffd66ae5.png) ![image](https://user-images.githubusercontent.com/1617736/86674533-a1061800-bfad-11ea-9e8a-c62ad86ed0d7.png) It also works fine on mobile: ![image](https://user-images.githubusercontent.com/1617736/86674638-bda25000-bfad-11ea-8d8d-1798b608923e.png)
2020-07-16Rollup merge of #74148 - GuillaumeGomez:doc-alias-check, r=ManishearthManish Goregaokar-28/+0
Move #[doc(alias)] check in rustc Part of #73721. r? @ollie27
2020-07-16Rollup merge of #73771 - alexcrichton:ignore-unstable, r=estebank,GuillaumeGomezManish Goregaokar-0/+10
Don't pollute docs/suggestions with libstd deps Currently dependency crates of the standard library can sometimes leak into error messages such as when traits to import are suggested. Additionally they can leak into documentation such as in the list of "all traits implemented by `u32`". The dependencies of the standard library, however, are intended to be private. The dependencies of the standard library can't actually be stabl-y imported nor is the documentation that relevant since you can't import them on stable either. This commit updates both the compiler and rustdoc to ignore unstable traits in these two scenarios. Specifically the suggestion for traits to import ignore unstable traits, and similarly the list of traits implemented by a type excludes unstable traits. This commit is extracted from #73441 where the addition of some new dependencies to the standard library was showed to leak into various error messages and documentation. The intention here is to go ahead and land these changes ahead of that since it will likely take some time to land.
2020-07-16Revert "Remove "important traits" feature"Manish Goregaokar-1/+6
This reverts commit 1244ced9580b942926afc06815e0691cf3f4a846.
2020-07-15ConstKind::UnevaluatedBastian Kauschke-4/+4
2020-07-15Remove lots of `Symbol::as_str()` calls.Nicholas Nethercote-1/+1
In various ways, such as changing functions to take a `Symbol` instead of a `&str`.
2020-07-15Add and use more static symbols.Nicholas Nethercote-44/+48
Note that the output of `unpretty-debug.stdout` has changed. In that test the hash values are normalized from a symbol numbers to small numbers like "0#0" and "0#1". The increase in the number of static symbols must have caused the original numbers to contain more digits, resulting in different pretty-printing prior to normalization.
2020-07-09Rollup merge of #74079 - nnethercote:session-globals, r=nikomatsakisManish Goregaokar-8/+8
Eliminate confusing "globals" terminology. There are some structures that are called "globals", but are they global to a compilation session, and not truly global. I have always found this highly confusing, so this commit renames them as "session globals" and adds a comment explaining things. Also, the commit fixes an unnecessary nesting of `set()` calls `src/librustc_errors/json/tests.rs` r? @Aaron1011
2020-07-09Rollup merge of #74077 - sethp:docs/fix-intra-doc-primitive-link, r=jyn514Manish Goregaokar-4/+6
Use relative path for local links to primitives Else, links to `char::foo` would point into `/path/to/src/libcore/std/primitive.char.html#method.foo`. Split out from #73804.
2020-07-09Eliminate confusing "globals" terminology.Nicholas Nethercote-8/+8
There are some structures that are called "globals", but are they global to a compilation session, and not truly global. I have always found this highly confusing, so this commit renames them as "session globals" and adds a comment explaining things. Also, the commit fixes an unnecessary nesting of `set()` calls `src/librustc_errors/json/tests.rs`
2020-07-08Move #[doc(alias)] check in rustcGuillaume Gomez-28/+0
2020-07-07Revert "Add guard to check for local `core` crate"Seth Pellegrino-6/+4
This reverts commit ee3a0f867e938f469cbbb422a76ed5662be2ecc7.
2020-07-06Add guard to check for local `core` crateSeth Pellegrino-4/+6
2020-07-05Use relative path for local links to primitives in libcoreSeth Pellegrino-4/+6
Else, links to `char::foo` would point into `/path/to/src/libcore/std/primitive.char.html#method.foo`. Split out from #73804.
2020-07-05Shrink ParamEnv to 16 bytesMark Rousskov-2/+2
2020-06-30change `skip_binder` to use T by valueBastian Kauschke-4/+4
2020-06-26Don't pollute docs/suggestions with libstd depsAlex Crichton-0/+10
Currently dependency crates of the standard library can sometimes leak into error messages such as when traits to import are suggested. Additionally they can leak into documentation such as in the list of "all traits implemented by `u32`". The dependencies of the standard library, however, are intended to be private. The dependencies of the standard library can't actually be stabl-y imported nor is the documentation that relevant since you can't import them on stable either. This commit updates both the compiler and rustdoc to ignore unstable traits in these two scenarios. Specifically the suggestion for traits to import ignore unstable traits, and similarly the list of traits implemented by a type excludes unstable traits. This commit is extracted from #73441 where the addition of some new dependencies to the standard library was showed to leak into various error messages and documentation. The intention here is to go ahead and land these changes ahead of that since it will likely take some time to land.
2020-06-26Auto merge of #73513 - oli-obk:const_binop_overflow, r=estebankbors-2/+2
Show the values and computation that would overflow a const evaluation or propagation Fixes #71134 In contrast to the example in the issue it doesn't use individual spans for each operand. The effort required to implement that is quite high compared to the little (if at all) benefit it would bring to diagnostics. cc @shepmaster The way this is implemented it is also fairly easy to do the same for overflow panics at runtime, but that should be done in a separate PR since it may have runtime performance implications.
2020-06-26Show the values and computation that would overflow a const evaluation or ↵Oliver Scherer-2/+2
propagation
2020-06-25Support configurable deny-warnings for all in-tree crates.Eric Huss-3/+3
2020-06-23Rollup merge of #72780 - GuillaumeGomez:enforce-doc-alias-check, r=ollie27Manish Goregaokar-0/+28
Enforce doc alias check Part of #50146. r? @ollie27
2020-06-15make all uses of ty::Error or ConstKind::Error delay a span bugmark-1/+1
2020-06-11Rename `TyKind::Def` to `OpaqueDef`Matthew Jasper-1/+1
2020-06-11Remove associated opaque typesMatthew Jasper-5/+0
They're unused now.
2020-06-10Rollup merge of #73098 - jyn514:rustdoc-is-fake, r=GuillaumeGomezDylan DPC-3/+8
Add Item::is_fake for rustdoc I wasn't aware items _could_ be fake, so I think having a function mentioning it could be helpful. Also, I'd need to make this change for cross-crate intra-doc links anyway, so I figured it's better to make the refactor separate.
2020-06-07Add Item::is_fake for rustdocJoshua Nelson-3/+8
I wasn't aware items _could_ be fake, so I think having a function mentioning it could be helpful. Also, I'd need to make this change for cross-crate intra-doc links anyway, so I figured it's better to make the refactor separate.
2020-06-01Call `skip_binder` or `no_bound_vars` before `self_ty`Dylan MacKenzie-2/+2
2020-05-30Add check for doc alias attribute formatGuillaume Gomez-0/+28
2020-05-30rustdoc: remove calls to `local_def_id_from_node_id`marmeladema-9/+5
2020-05-22Remove ReScopeMatthew Jasper-1/+0
2020-05-20introduce newtype'd `Predicate<'tcx>`Bastian Kauschke-7/+7
2020-05-20make `to_predicate` take a `tcx` argumentNiko Matsakis-1/+1
2020-05-20rename `Predicate` to `PredicateKind`, introduce aliasBastian Kauschke-19/+17
2020-05-17Assume unevaluated consts are equal to the other consts and add ConstEquate ↵Ben Lewis-1/+2
obligation. This delays the need to evaluate consts eagerly and therefore gets around const eval query cycles.
2020-05-16Rollup merge of #71724 - GuillaumeGomez:doc-alias-improvements, r=ollie27Dylan DPC-0/+9
Doc alias improvements After [this message](https://github.com/rust-lang/rust/issues/50146#issuecomment-496601755), I realized that the **doc alias**. So this PR does the followings: * Align the alias discovery on items added into the search-index. It brings a few nice advantages: * Instead of cloning the data between the two (in rustdoc source code), we now have the search-index one and aliases which reference to the first one. So we go from one big map containing a lot of duplicated data to just integers... * In the front-end (main.js), I improved the code around aliases to allow them to go through the same transformation as other items when we show the search results. * Improve the search tester in order to perform multiple requests into one file (I think it's better in this case than having a file for each case considering how many there are...) * I also had to add the new function inside the tester (`handleAliases`) Once this PR is merged, I intend to finally stabilize this feature. r? @ollie27 cc @rust-lang/rustdoc
2020-05-14Move doc alias discovery into the Attributes struct and some code improvementsGuillaume Gomez-0/+9
2020-05-12Remove ty::UnnormalizedProjectionJack Huey-1/+0