-
Couldn't load subscription status.
- Fork 13.9k
rustdoc: replace clean::InstantiationParam with clean::GenericArg
#120999
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
Conversation
|
Some changes occurred in src/librustdoc/clean/types.rs cc @camelid |
clean::InstantiationParam with clean::GenericArgclean::InstantiationParam with clean::GenericArg
| 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 { .. } => {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
r? rustdoc |
|
@bors r+ rollup |
…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.
…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
…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
…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
…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
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.
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.