summary refs log tree commit diff
path: root/src/librustdoc/clean
AgeCommit message (Collapse)AuthorLines
2022-12-02Merge generics and where predicates and prevent duplicates in where predicatesGuillaume Gomez-33/+91
2022-12-01rustc_hir: Change representation of import paths to support multiple resolutionsVadim Petrochenkov-4/+27
2022-11-30Auto merge of #104905 - compiler-errors:normalization-changes, r=spastorinobors-2/+2
Some initial normalization method changes 1. Rename `AtExt::normalize` to `QueryNormalizeExt::query_normalize` (using the `QueryNormalizer`) 2. Introduce `NormalizeExt::normalize` to replace `partially_normalize_associated_types_in` (using the `AssocTypeNormalizer`) 3. Rename `FnCtxt::normalize_associated_types_in` to `FnCtxt::normalize` 4. Remove some unused other normalization fns in `Inherited` and `FnCtxt` Also includes one drive-by where we're no longer creating a `FnCtxt` inside of `check_fn`, but passing it in. This means we don't need such weird `FnCtxt` construction logic. Stacked on top of #104835 for convenience. r? types
2022-11-28partially_normalize_... -> At::normalizeMichael Goulet-1/+1
2022-11-28Rename At::normalize to At::query_normalizeMichael Goulet-1/+1
2022-11-28Rollup merge of #104804 - nnethercote:MetaItemLit, r=petrochenkovMatthias Krüger-3/+3
Rename `ast::Lit` as `ast::MetaItemLit`. And some other literal cleanups. r? `@petrochenkov`
2022-11-28Rollup merge of #104732 - WaffleLapkin:from_def_idn't, r=compiler-errorsDylan DPC-1/+1
Refactor `ty::ClosureKind` related stuff I've tried to fix all duplication and weirdness, but if I missed something do tell :p r? `@compiler-errors`
2022-11-28Rename `NestedMetaItem::[Ll]iteral` as `NestedMetaItem::[Ll]it`.Nicholas Nethercote-3/+3
We already use a mix of `Literal` and `Lit`. The latter is better because it is shorter without causing any ambiguity.
2022-11-27Rollup merge of #104984 - GuillaumeGomez:remote-crate-primitives, r=notriddleMatthias Krüger-3/+2
Remove Crate::primitives field It is a new approach to #90447. Instead of removing primitives from everywhere (ie from `BadImplStripper`), I just removed them from the `Crate` type, allowing to reduce its size. cc `@camelid` r? `@notriddle`
2022-11-27Remove Crate::primitives fieldGuillaume Gomez-3/+2
2022-11-27Auto merge of #104048 - cjgillot:split-lifetime, r=compiler-errorsbors-27/+14
Separate lifetime ident from lifetime resolution in HIR Drive-by: change how suggested generic args are computed. Fixes https://github.com/rust-lang/rust/issues/103815 I recommend reviewing commit-by-commit.
2022-11-27Rename `fn_trait_kind_from_{from_lang=>def_id}` to better convey meaningMaybe Waffle-1/+1
2022-11-25Introduce PredicateKind::ClauseSantiago Pastorino-14/+30
2022-11-25get rid of to_poly_trait_predicateOli Scherer-6/+1
2022-11-24Use kw::Empty for elided lifetimes in path.Camille GILLOT-16/+12
2022-11-23Separate lifetime ident from resolution in HIR.Camille GILLOT-11/+2
2022-11-22Rollup merge of #103488 - oli-obk:impl_trait_for_tait, r=lcnrManish Goregaokar-0/+1
Allow opaque types in trait impl headers and rely on coherence to reject unsound cases r? ````@lcnr```` fixes #99840
2022-11-22Auto merge of #103578 - petrochenkov:nofict, r=nagisabors-10/+10
Unreserve braced enum variants in value namespace With this PR braced enum variants (`enum E { V { /*...*/ } }`) no longer take a slot in value namespace, so the special case mentioned in the note in https://github.com/rust-lang/rfcs/blob/master/text/1506-adt-kinds.md#braced-structs is removed. Report - https://github.com/rust-lang/rust/pull/103578#issuecomment-1292594900.
2022-11-22Auto merge of #104696 - matthiaskrgr:rollup-gi1pdb0, r=matthiaskrgrbors-1/+1
Rollup of 11 pull requests Successful merges: - #103396 (Pin::new_unchecked: discuss pinning closure captures) - #104416 (Fix using `include_bytes` in pattern position) - #104557 (Add a test case for async dyn* traits) - #104559 (Split `MacArgs` in two.) - #104597 (Probe + better error messsage for `need_migrate_deref_output_trait_object`) - #104656 (Move tests) - #104657 (Do not check transmute if has non region infer) - #104663 (rustdoc: factor out common button CSS) - #104666 (Migrate alias search result to CSS variables) - #104674 (Make negative_impl and negative_impl_exists take the right types) - #104692 (Update test's cfg-if dependency to 1.0) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-22Split `MacArgs` in two.Nicholas Nethercote-1/+1
`MacArgs` is an enum with three variants: `Empty`, `Delimited`, and `Eq`. It's used in two ways: - For representing attribute macro arguments (e.g. in `AttrItem`), where all three variants are used. - For representing function-like macros (e.g. in `MacCall` and `MacroDef`), where only the `Delimited` variant is used. In other words, `MacArgs` is used in two quite different places due to them having partial overlap. I find this makes the code hard to read. It also leads to various unreachable code paths, and allows invalid values (such as accidentally using `MacArgs::Empty` in a `MacCall`). This commit splits `MacArgs` in two: - `DelimArgs` is a new struct just for the "delimited arguments" case. It is now used in `MacCall` and `MacroDef`. - `AttrArgs` is a renaming of the old `MacArgs` enum for the attribute macro case. Its `Delimited` variant now contains a `DelimArgs`. Various other related things are renamed as well. These changes make the code clearer, avoids several unreachable paths, and disallows the invalid values.
2022-11-21Stop passing the self-type as a separate argument.Oli Scherer-1/+1
2022-11-21Allow iterators instead of requiring slices that will get turned into iteratorsOli Scherer-1/+1
2022-11-21Assert that various types have the right amount of generic args and fix the ↵Oli Scherer-1/+1
sites that used the wrong amount
2022-11-21Unreserve braced enum variants in value namespaceVadim Petrochenkov-10/+10
2022-11-21Add an always-ambiguous predicate to make sure that we don't accidentlally ↵Oli Scherer-0/+1
allow trait resolution to prove false things during coherence
2022-11-17Rollup merge of #104483 - oli-obk:santa-clauses-make-goals, r=compiler-errorsMatthias Krüger-0/+1
Convert predicates into Predicate in the Obligation constructor instead of having almost all callers do that. This reduces a bit of boilerplate, and also paves the way for my work towards https://github.com/rust-lang/compiler-team/issues/531 (as it makes it easier to accept both goals and clauses where right now it only accepts predicates).
2022-11-17Auto merge of #104170 - cjgillot:hir-def-id, r=fee1-deadbors-1/+1
Record `LocalDefId` in HIR nodes instead of a side table This is part of an attempt to remove the `HirId -> LocalDefId` table from HIR. This attempt is a prerequisite to creation of `LocalDefId` after HIR lowering (https://github.com/rust-lang/rust/pull/96840), by controlling how `def_id` information is accessed. This first part adds the information to HIR nodes themselves instead of a table. The second part is https://github.com/rust-lang/rust/pull/103902 The third part will be to make `hir::Visitor::visit_fn` take a `LocalDefId` as last parameter. The fourth part will be to completely remove the side table.
2022-11-16Convert predicates into Predicate in the Obligation constructorOli Scherer-0/+1
2022-11-13Store a LocalDefId in hir::Variant & hir::Field.Camille GILLOT-1/+1
2022-11-11Correctly import all attributes from multi-level importGuillaume Gomez-7/+87
2022-11-08Auto merge of #104013 - notriddle:notriddle/rustdoc-sizeof, r=GuillaumeGomezbors-27/+21
rustdoc: use `ThinVec` and `Box<str>` to shrink `clean::ItemKind`
2022-11-07Rollup merge of #103885 - fmease:rustdoc-various-cross-crate-reexport-fixes, ↵Yuki Okushi-40/+87
r=cjgillot,GuillaumeGomez rustdoc: various cross-crate reexport fixes Fixes for various smaller cross-crate reexport issues. The PR is split into several commits for easier review. Will be squashed after approval. Most notable changes: * We finally render late-bound lifetimes in the generic parameter list of cross-crate functions & methods. Previously, we would display the re-export of `pub fn f<'s>(x: &'s str) {}` as `pub fn f(x: &'s str)` * We now render unnamed parameters of cross-crate functions and function pointers as underscores since that's exactly what we do for local definitions, too. Mentioned as a bug in #44306. * From now on, the rendering of cross-crate trait-object types is more correct: * `for<>` parameter lists (for higher-ranked lifetimes) are now shown * the return type of `Fn{,Mut,Once}` trait bounds is now displayed Regarding the last list item, here is a diff for visualization (before vs. after): ```patch - dyn FnOnce(&'any str) + 'static + dyn for<'any> FnOnce(&'any str) -> bool + 'static ``` The redundant `+ 'static` will be removed in a follow-up PR that will hide trait-object lifetime-bounds if they coincide with [their default](https://doc.rust-lang.org/reference/lifetime-elision.html#default-trait-object-lifetimes) (see [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/clean_middle_ty.3A.20I.20need.20to.20add.20a.20parameter/near/307143097)). `FIXME(fmease)`s were added. ``@rustbot`` label A-cross-crate-reexports r? ``@GuillaumeGomez``
2022-11-05rustdoc: print usize with less string manipulationMichael Howell-12/+6
2022-11-05rustdoc: use `ThinVec` and `Box<str>` to shrink `clean::ItemKind`Michael Howell-15/+15
2022-11-05Rollup merge of #103621 - fee1-dead-contrib:iat-fix-use, r=cjgillotDylan DPC-1/+2
Correctly resolve Inherent Associated Types I don't know if this is the best way to do this, but at least it is one way.
2022-11-04rustdoc: create helper `GenericParamDef::lifetime`León Orell Valerian Liehr-28/+13
2022-11-04rustdoc: add test for cross-crate trait-object typesLeón Orell Valerian Liehr-0/+3
as well as some FIXMEs
2022-11-04rustdoc: render the return type of cross-crate `Fn`-family trait bounds in ↵León Orell Valerian Liehr-7/+7
trait-object types
2022-11-04rustdoc: render `for<>` param lists of cross-crate trait-object typesLeón Orell Valerian Liehr-2/+19
2022-11-04rustdoc: move cross-crate lifetime/outlives bounds on GAT params from ↵León Orell Valerian Liehr-1/+10
where-clause to param declaration site I've overlooked this in #103190.
2022-11-04rustdoc: render unnamed arguments as underscores in cross-crate functions & ↵León Orell Valerian Liehr-7/+13
function pointers for consistency with the way we display local definitions (cleaned from HIR, not from rustc_middle).
2022-11-04rustdoc: render late-bound lifetimes in generic parameter list of ↵León Orell Valerian Liehr-7/+34
cross-crate functions and methods
2022-11-04Rollup merge of #103935 - GuillaumeGomez:remove-rustdoc-visibility-ty, ↵Matthias Krüger-44/+19
r=notriddle Remove rustdoc clean::Visibility type Fixes #90852. Follow-up of https://github.com/rust-lang/rust/pull/103690. This PR completely removes the rustdoc `clean::Visibility` type to use the `rustc_middle` one instead. I don't think there will be any impact on perf. r? `@notriddle`
2022-11-04Auto merge of #103954 - matthiaskrgr:rollup-tskpxnj, r=matthiaskrgrbors-17/+20
Rollup of 10 pull requests Successful merges: - #103825 (Remove let_underscore_must_use from list of uplifted lints) - #103884 (Add visit_fn_ret_ty to hir intravisit) - #103892 (Properly render asyncness for trait fns without default body) - #103905 (rustdoc: remove redundant mobile CSS `.sidebar-elems { background }`) - #103912 (Add howto for adding new targets) - #103915 (Improve use of ErrorGuaranteed and code cleanup) - #103930 (Move some tests from `src/test/ui` to more reasonable places) - #103931 (Add note to RELEASES.md regarding issue 102754.) - #103938 (rustdoc: clean up hardcoded CSS border color on search results) - #103940 (rustdoc: remove no-op CSS `#main-content > .item-info { margin-top: 0 }`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-11-04Rollup merge of #103892 - compiler-errors:afit-rustdoc, r=GuillaumeGomezMatthias Krüger-17/+20
Properly render asyncness for trait fns without default body We weren't properly desugaring async fns in traits unless they had default bodies (in which case rustdoc treats them much like they came from an impl). cc ```@yoshuawuyts``` should help with https://rust-lang.zulipchat.com/#narrow/stream/330606-wg-async.2Fasync-fn-in-trait-impl/topic/type.20inside.20.60async.20fn.60.20body.20must.20be.20known.20in.20this.20context/near/306894869
2022-11-04Auto merge of #102928 - notriddle:notriddle/rustdoc-thin-vec, r=GuillaumeGomezbors-63/+60
rustdoc: use ThinVec for cleaned generics Depends on https://github.com/Gankra/thin-vec/pull/38
2022-11-03Remove rustdoc clean::Visibility typeGuillaume Gomez-44/+19
2022-11-03roll another resolution logic in rustdocDeadbeef-1/+2
2022-11-02rustdoc: add size tracking for `Generics`Michael Howell-0/+1
2022-11-02rustdoc: remove unneeded Box from ItemKindMichael Howell-3/+3