rust/compiler
Yuki Okushi 0c5fccea22
Rollup merge of #81176 - camsteffen:qpath-res, r=oli-obk
Improve safety of `LateContext::qpath_res`

This is my first rustc code change, inspired by hacking on clippy!

The first change is to clear cached `TypeckResults` from `LateContext` when visiting a nested item. I took a hint from [here](5e91c4ecc0/compiler/rustc_privacy/src/lib.rs (L1300)).

Clippy has a `qpath_res` util function to avoid a possible ICE in `LateContext::qpath_res`. But the docs of `LateContext::qpath_res` promise no ICE. So this updates the `LateContext` method to keep its promises, and removes the util function.

Related: rust-lang/rust-clippy#4545

CC ````````````@eddyb```````````` since you've done related work
CC ````````````@flip1995```````````` FYI
2021-01-29 09:17:32 +09:00
..
rustc
rustc_apfloat
rustc_arena stabilize min_const_generics 2020-12-26 18:24:10 +01:00
rustc_ast Refactor token collection to capture trailing token immediately 2021-01-22 00:33:03 -05:00
rustc_ast_lowering Rollup merge of #81249 - cjgillot:issue-79537, r=oli-obk 2021-01-23 20:16:07 +01:00
rustc_ast_passes Use Option::map_or instead of .map(..).unwrap_or(..) 2021-01-14 19:23:59 +01:00
rustc_ast_pretty Remove unused dependency 2021-01-23 10:30:38 +01:00
rustc_attr Auto merge of #80692 - Aaron1011:feature/query-result-debug, r=estebank 2021-01-26 05:47:23 +00:00
rustc_builtin_macros Rollup merge of #80855 - m-ou-se:assert-2021, r=petrochenkov 2021-01-24 22:09:53 +01:00
rustc_codegen_cranelift Use ty::{IntTy,UintTy,FloatTy} in rustc 2021-01-18 21:09:30 +01:00
rustc_codegen_llvm Rollup merge of #79570 - alexcrichton:split-debuginfo, r=bjorn3 2021-01-29 09:17:20 +09:00
rustc_codegen_ssa Rollup merge of #80215 - visigoth:issue-80202-fix, r=estebank 2021-01-29 09:17:29 +09:00
rustc_data_structures Auto merge of #80692 - Aaron1011:feature/query-result-debug, r=estebank 2021-01-26 05:47:23 +00:00
rustc_driver Rollup merge of #80944 - LingMan:map_or, r=nagisa 2021-01-15 18:26:14 +09:00
rustc_error_codes Fix spelling in documentation for error E0207 2021-01-24 20:31:42 +01:00
rustc_errors Avoid describing a method as 'not found' when bounds are unsatisfied 2021-01-26 23:59:50 -05:00
rustc_expand Add SEMICOLON_IN_EXPRESSIONS_FROM_MACROS lint 2021-01-28 08:51:43 -05:00
rustc_feature Auto merge of #80692 - Aaron1011:feature/query-result-debug, r=estebank 2021-01-26 05:47:23 +00:00
rustc_fs_util Optimize away a fs::metadata call. 2021-01-06 08:33:15 -08:00
rustc_graphviz remove redundant closures (clippy::redundant_closure) 2021-01-03 13:34:24 +01:00
rustc_hir Auto merge of #81393 - pnkfelix:issue-81296-make-weak-item-traversal-deterministic, r=estebank 2021-01-27 00:19:45 +00:00
rustc_hir_pretty Add loop head span to hir 2021-01-21 21:41:46 -08:00
rustc_incremental Auto merge of #80957 - tgnottingham:direct_serialize_depgraph, r=michaelwoerister 2021-01-19 19:36:41 +00:00
rustc_index Switch compiler/ to intra-doc links 2020-12-18 15:22:51 -05:00
rustc_infer Rollup merge of #79951 - LeSeulArtichaut:ty-ir, r=nikomatsakis 2021-01-28 15:09:02 +09:00
rustc_interface Rollup merge of #79570 - alexcrichton:split-debuginfo, r=bjorn3 2021-01-29 09:17:20 +09:00
rustc_lexer Return EOF_CHAR constant instead of magic char. 2021-01-07 13:20:04 +01:00
rustc_lint Rollup merge of #81176 - camsteffen:qpath-res, r=oli-obk 2021-01-29 09:17:32 +09:00
rustc_lint_defs Add SEMICOLON_IN_EXPRESSIONS_FROM_MACROS lint 2021-01-28 08:51:43 -05:00
rustc_llvm Use probe-stack=inline-asm in LLVM 11+ 2021-01-14 22:49:16 -05:00
rustc_macros Use Option::map_or instead of .map(..).unwrap_or(..) 2021-01-14 19:23:59 +01:00
rustc_metadata Check for rmeta crates when getting existing crates from cache 2021-01-26 19:39:24 +01:00
rustc_middle Rollup merge of #81062 - sexxi-goose:precise_capture_diagnostics, r=nikomatsakis 2021-01-28 15:09:06 +09:00
rustc_mir Rollup merge of #81158 - 1000teslas:issue-80313-fix, r=Aaron1011 2021-01-29 09:17:31 +09:00
rustc_mir_build Rollup merge of #79951 - LeSeulArtichaut:ty-ir, r=nikomatsakis 2021-01-28 15:09:02 +09:00
rustc_parse Point only at generic arguments when they are unexpected 2021-01-26 15:59:43 -08:00
rustc_parse_format rustc_parse_format: Fix character indices in find_skips 2021-01-17 17:40:58 +03:00
rustc_passes Rollup merge of #79951 - LeSeulArtichaut:ty-ir, r=nikomatsakis 2021-01-28 15:09:02 +09:00
rustc_plugin_impl Store ForeignItem in a side table. 2020-11-26 21:29:27 +01:00
rustc_privacy Review changes 2021-01-16 18:56:37 -05:00
rustc_query_system Auto merge of #80692 - Aaron1011:feature/query-result-debug, r=estebank 2021-01-26 05:47:23 +00:00
rustc_resolve Add SEMICOLON_IN_EXPRESSIONS_FROM_MACROS lint 2021-01-28 08:51:43 -05:00
rustc_save_analysis Use Option::map_or instead of .map(..).unwrap_or(..) 2021-01-14 19:23:59 +01:00
rustc_serialize rustc_serialize: fix incorrect signed LEB128 decoding 2021-01-11 12:13:26 -08:00
rustc_session Rollup merge of #79570 - alexcrichton:split-debuginfo, r=bjorn3 2021-01-29 09:17:20 +09:00
rustc_span Rollup merge of #81277 - flip1995:from_diag_items, r=matthewjasper 2021-01-28 15:09:08 +09:00
rustc_symbol_mangling Use ty::{IntTy,UintTy,FloatTy} in rustc 2021-01-18 21:09:30 +01:00
rustc_target Rollup merge of #79570 - alexcrichton:split-debuginfo, r=bjorn3 2021-01-29 09:17:20 +09:00
rustc_trait_selection Auto merge of #81055 - matthewjasper:non-fatal-overflow, r=nikomatsakis 2021-01-28 18:57:10 +00:00
rustc_traits Use ty::{IntTy,UintTy,FloatTy} in rustc 2021-01-18 21:09:30 +01:00
rustc_ty_utils Infallible version of def_span. 2021-01-23 13:35:22 +01:00
rustc_type_ir Move a few more types to rustc_type_ir 2021-01-18 21:06:12 +01:00
rustc_typeck Auto merge of #81149 - Aaron1011:feature/better-no-method-found-err, r=estebank 2021-01-28 12:09:50 +00:00