rustdoc: replace clean::InstantiationParam with clean::GenericArg#120999
Merged
bors merged 1 commit intorust-lang:masterfrom Feb 14, 2024
Merged
rustdoc: replace clean::InstantiationParam with clean::GenericArg#120999bors merged 1 commit intorust-lang:masterfrom
clean::InstantiationParam with clean::GenericArg#120999bors merged 1 commit intorust-lang:masterfrom
Conversation
Collaborator
Collaborator
|
Some changes occurred in src/librustdoc/clean/types.rs cc @camelid |
clean::InstantiationParam with clean::GenericArgclean::InstantiationParam with clean::GenericArg
fmease
commented
Feb 13, 2024
Comment on lines
-1828
to
+1819
| hir::GenericParamKind::Const { .. } => { | ||
| let mut j = 0; | ||
| let const_ = generic_args.args.iter().find_map(|arg| match arg { | ||
| hir::GenericArg::Const(ct) => { | ||
| if indices.consts == j { | ||
| return Some(ct); | ||
| } | ||
| j += 1; | ||
| None | ||
| } | ||
| _ => None, | ||
| }); | ||
| if let Some(_) = const_ { | ||
| args.insert(param.def_id.to_def_id(), InstantiationParam::Constant); | ||
| } | ||
| // FIXME(const_generics_defaults) | ||
| indices.consts += 1; | ||
| } | ||
| // FIXME(#82852): Instantiate const parameters. | ||
| hir::GenericParamKind::Const { .. } => {} |
Member
Author
There was a problem hiding this comment.
No need to perform all this logic when the result isn't used anyway at the moment, cc #82852.
Cc'ing the source code comment I added below:
We don't record const params since we don't visit const exprs at all and […] therefore wouldn't use the corresp. generic arg anyway. […]
11a1afa to
36d7f76
Compare
Member
Author
|
r? rustdoc |
Contributor
|
@bors r+ rollup |
Collaborator
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Feb 13, 2024
…ram, r=notriddle rustdoc: replace `clean::InstantiationParam` with `clean::GenericArg` Probably better known as `SubstParam` (until rust-lang#120958 which should've probably renamed it to `InstantiatedParam` but anyways). It doesn't make any sense to me why it should exist as a separate type. `GenericArg` is exactly what we want here anyways from a semantic perspective. Both have the same size btw. I also took the liberty of doing some drive-by cleanups.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 13, 2024
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#118882 (Check normalized call signature for WF in mir typeck) - rust-lang#120999 (rustdoc: replace `clean::InstantiationParam` with `clean::GenericArg`) - rust-lang#121002 (remove unnecessary calls to `commit_if_ok`) - rust-lang#121005 (Remove jsha from the rustdoc review rotation) - rust-lang#121043 (add lcnr to the compiler-team assignment group) - rust-lang#121045 (Fix two UI tests with incorrect directive / invalid revision) - rust-lang#121046 (Fix incorrect use of `compile_fail`) - rust-lang#121047 (Do not assemble candidates for default impls) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 13, 2024
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#118882 (Check normalized call signature for WF in mir typeck) - rust-lang#120999 (rustdoc: replace `clean::InstantiationParam` with `clean::GenericArg`) - rust-lang#121002 (remove unnecessary calls to `commit_if_ok`) - rust-lang#121005 (Remove jsha from the rustdoc review rotation) - rust-lang#121014 (Remove `force_print_diagnostic`) - rust-lang#121043 (add lcnr to the compiler-team assignment group) - rust-lang#121046 (Fix incorrect use of `compile_fail`) - rust-lang#121047 (Do not assemble candidates for default impls) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 14, 2024
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#118882 (Check normalized call signature for WF in mir typeck) - rust-lang#120999 (rustdoc: replace `clean::InstantiationParam` with `clean::GenericArg`) - rust-lang#121002 (remove unnecessary calls to `commit_if_ok`) - rust-lang#121005 (Remove jsha from the rustdoc review rotation) - rust-lang#121014 (Remove `force_print_diagnostic`) - rust-lang#121043 (add lcnr to the compiler-team assignment group) - rust-lang#121046 (Fix incorrect use of `compile_fail`) - rust-lang#121047 (Do not assemble candidates for default impls) r? `@ghost` `@rustbot` modify labels: rollup
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 14, 2024
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#118882 (Check normalized call signature for WF in mir typeck) - rust-lang#120999 (rustdoc: replace `clean::InstantiationParam` with `clean::GenericArg`) - rust-lang#121002 (remove unnecessary calls to `commit_if_ok`) - rust-lang#121005 (Remove jsha from the rustdoc review rotation) - rust-lang#121014 (Remove `force_print_diagnostic`) - rust-lang#121043 (add lcnr to the compiler-team assignment group) - rust-lang#121046 (Fix incorrect use of `compile_fail`) - rust-lang#121047 (Do not assemble candidates for default impls) r? `@ghost` `@rustbot` modify labels: rollup
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Feb 14, 2024
Rollup merge of rust-lang#120999 - fmease:rustdoc-rm-instantiation-param, r=notriddle rustdoc: replace `clean::InstantiationParam` with `clean::GenericArg` Probably better known as `SubstParam` (until rust-lang#120958 which should've probably renamed it to `InstantiatedParam` but anyways). It doesn't make any sense to me why it should exist as a separate type. `GenericArg` is exactly what we want here anyways from a semantic perspective. Both have the same size btw. I also took the liberty of doing some drive-by cleanups.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Probably better known as
SubstParam(until #120958 which should've probably renamed it toInstantiatedParambut anyways).It doesn't make any sense to me why it should exist as a separate type.
GenericArgis exactly what we want here anyways from a semantic perspective. Both have the same size btw.I also took the liberty of doing some drive-by cleanups.