- Add `Item::from_hir_id_and_kind` convenience wrapper
- Make name parameter mandatory
`tcx.opt_item_name` doesn't handle renames, so this is necessary
for any item that could be renamed, which is almost all of them.
- Override visibilities to be `Inherited` for enum variants
`tcx.visibility` returns the effective visibility, not the visibility
that was written in the source code. `pub enum E { A, B }` always has
public variants `A` and `B`, so there's no sense printing `pub` again.
- Don't duplicate handling of `Visibility::Crate`
Instead, represent it as just another `Restricted` path.
15 lines
344 B
Rust
15 lines
344 B
Rust
// aux-build:variant-struct.rs
|
|
// build-aux-docs
|
|
// ignore-cross-compile
|
|
|
|
// @has variant_struct/enum.Foo.html
|
|
// @!has - 'pub qux'
|
|
// @!has - 'pub(crate) qux'
|
|
// @!has - 'pub Bar'
|
|
extern crate variant_struct;
|
|
|
|
// @has issue_32395/enum.Foo.html
|
|
// @!has - 'pub qux'
|
|
// @!has - 'pub(crate) qux'
|
|
// @!has - 'pub Bar'
|
|
pub use variant_struct::Foo;
|