add some comments to hir::ModuleItems#122771
Conversation
compiler/rustc_middle/src/hir/mod.rs
Outdated
| /// | ||
| /// Note that this does *not* include associated items of `impl` blocks! It also does not | ||
| /// include foreign items. If you want to e.g. get all functions, use `definitions()` below. | ||
| pub fn items(&self) -> impl Iterator<Item = ItemId> + '_ { |
There was a problem hiding this comment.
maybe rename it to free_items?
There was a problem hiding this comment.
Does that term have any precedent in the compiler?
There was a problem hiding this comment.
there are 56 results for free function and 6 results for free const, among them results in diagnostic messages.
There was a problem hiding this comment.
and resolve_instance refers to free item in debug logging
There was a problem hiding this comment.
Yeah, free would be a good descriptor here. Let's help establish precedence here :)
There was a problem hiding this comment.
Okay. :)
"free" captures "non-assoc" but doesn't capture "also excludes foreign items". But I think that's less important to capture anyway.
There was a problem hiding this comment.
Also it seems to include the impl blocks themselves, or did I misunderstand that?
This comment has been minimized.
This comment has been minimized.
|
@bors r=oli-obk rollup |
add some comments to hir::ModuleItems I've definitely been bitten by this in the past, where I assumed `items()` would give me *all* the items.
add some comments to hir::ModuleItems I've definitely been bitten by this in the past, where I assumed `items()` would give me *all* the items.
…kingjubilee Rollup of 9 pull requests Successful merges: - rust-lang#122222 (deref patterns: bare-bones feature gate and typechecking) - rust-lang#122456 (CFI: Skip non-passed arguments) - rust-lang#122696 (Add bare metal riscv32 target.) - rust-lang#122771 (add some comments to hir::ModuleItems) - rust-lang#122773 (make "expected paren or brace" error translatable) - rust-lang#122795 (Inherit `RUSTC_BOOTSTRAP` when testing wasm) - rust-lang#122799 (Replace closures with `_` when suggesting fully qualified path for method call) - rust-lang#122801 (Fix misc printing issues in emit=stable_mir) - rust-lang#122806 (Make `type_ascribe!` not a built-in) r? `@ghost` `@rustbot` modify labels: rollup
add some comments to hir::ModuleItems I've definitely been bitten by this in the past, where I assumed `items()` would give me *all* the items.
|
☔ The latest upstream changes (presumably #122568) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@bors r=oli-obk rollup |
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#122222 (deref patterns: bare-bones feature gate and typechecking) - rust-lang#122358 (Don't ICE when encountering bound regions in generator interior type) - rust-lang#122696 (Add bare metal riscv32 target.) - rust-lang#122773 (make "expected paren or brace" error translatable) - rust-lang#122795 (Inherit `RUSTC_BOOTSTRAP` when testing wasm) - rust-lang#122799 (Replace closures with `_` when suggesting fully qualified path for method call) - rust-lang#122801 (Fix misc printing issues in emit=stable_mir) - rust-lang#122806 (Make `type_ascribe!` not a built-in) Failed merges: - rust-lang#122771 (add some comments to hir::ModuleItems) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 8 pull requests Successful merges: - rust-lang#122402 (Make `#[diagnostic::on_unimplemented]` format string parsing more robust) - rust-lang#122644 (pattern analysis: add a custom test harness) - rust-lang#122733 (Strip placeholders from hidden types before remapping generic parameter) - rust-lang#122752 (Interpolated cleanups) - rust-lang#122771 (add some comments to hir::ModuleItems) - rust-lang#122793 (Implement macro-based deref!() syntax for deref patterns) - rust-lang#122810 (Remove `target_override`) - rust-lang#122827 (Remove unnecessary braces from `bug`/`span_bug`) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#122771 - RalfJung:module-items, r=oli-obk add some comments to hir::ModuleItems I've definitely been bitten by this in the past, where I assumed `items()` would give me *all* the items.
I've definitely been bitten by this in the past, where I assumed
items()would give me all the items.