rust/compiler/rustc_resolve/src
Joshua Nelson 3b7e654fad Use more appropriate return type for resolve_associated_item
Previously, the types looked like this:

- None means this is not an associated item (but may be a variant field)
- Some(Err) means this is known to be an error. I think the only way that can happen is if it resolved and but you had your own anchor.
- Some(Ok(_, None)) was impossible.

Now, this returns a nested Option and does the error handling and
fiddling with the side channel in the caller. As a side-effect, it also
removes duplicate error handling.

This has one small change in behavior, which is that
`resolve_primitive_associated_item` now goes through `variant_field` if
it fails to resolve something.  This is not ideal, but since it will be
quickly rejected anyway, I think the performance hit is worth the
cleanup.

This also fixes a bug where struct fields would forget to set the side
channel, adds a test for the bug, and ignores `private_intra_doc_links`
in rustc_resolve (since it's always documented with
--document-private-items).
2021-04-05 08:34:17 -04:00
..
late Cleanups and comments 2021-03-31 10:16:37 -04:00
build_reduced_graph.rs ast/hir: Rename field-related structures 2021-03-16 11:41:24 +03:00
check_unused.rs Attach TokenStream to ast::Visibility 2020-09-10 17:33:06 -04:00
def_collector.rs ast/hir: Rename field-related structures 2021-03-16 11:41:24 +03:00
diagnostics.rs resolve: Partially unify early and late scope-relative ident resolution 2021-03-27 23:38:17 +03:00
imports.rs Fix ICE with use clippy:🅰️:b; 2021-03-21 14:20:28 -07:00
late.rs Cleanups and comments 2021-03-31 10:16:37 -04:00
lib.rs Use more appropriate return type for resolve_associated_item 2021-04-05 08:34:17 -04:00
macros.rs resolve: Stable order for derive helper attributes 2021-04-04 17:51:41 +03:00