rust/compiler
bors 8cfa7b4ec9 Auto merge of #78588 - HeroicKatora:sccc, r=nikomatsakis
Reworks Sccc computation to iteration instead of recursion

Linear graphs, producing as many scc's as nodes, would recurse once for every node when entered from the start of the list. This adds a test that exhausted the stack at least on my machine with error:

```
thread 'graph::scc::tests::test_deep_linear' has overflowed its stack
fatal runtime error: stack overflow
```

This may or may not be connected to #78567. I was only reminded that I started this rework some time ago. It might be plausible as borrow checking a long function with many borrow regions around each other—((((((…))))))— may produce the linear list setup to trigger this stack overflow ? I don't know enough about borrow check to say for sure.

This is best read in two separate commits. The first addresses only `find_state` internally. This is classical union phase from union-find. There's also a common solution of using the parent pointers in the (virtual) linked list to track the backreferences while traversing upwards and then following them backwards in a second path compression phase.

The second is more involved as it rewrites the mutually recursive `walk_node` and `walk_unvisited_node`. Firstly, the caller is required to handle the unvisited case of `walk_node` so a new `start_walk_from` method is added to handle that by walking the unvisited node if necessary. Then `walk_unvisited_node`, where we would previously recurse into in the missing case, is rewritten to construct a manual stack of its frames. The state fields consist of the previous stack slots.
2020-11-21 01:30:26 +00:00
..
rustc
rustc_apfloat
rustc_arena Use specialization to avoid copying 2020-11-20 21:02:09 +01:00
rustc_ast
rustc_ast_lowering
rustc_ast_passes Use span_suggestion_verbose instead of span_suggestion for fn with qualifiers inside an extern "C" block 2020-11-17 07:57:54 -06:00
rustc_ast_pretty
rustc_attr Never inline naked functions 2020-11-20 00:00:00 +00:00
rustc_builtin_macros Auto merge of #78088 - fusion-engineering-forks:panic-fmt-lint, r=estebank 2020-11-20 03:40:20 +00:00
rustc_codegen_cranelift update cg_clif 2020-11-16 22:42:09 +01:00
rustc_codegen_llvm Never inline naked functions 2020-11-20 00:00:00 +00:00
rustc_codegen_ssa Rollup merge of #78361 - DevJPM:master, r=workingjubilee 2020-11-18 15:46:19 +01:00
rustc_data_structures Auto merge of #78588 - HeroicKatora:sccc, r=nikomatsakis 2020-11-21 01:30:26 +00:00
rustc_driver
rustc_error_codes
rustc_errors Rollup merge of #74293 - GuillaumeGomez:rustdoc-test-compiler-output-color, r=jyn514 2020-11-17 16:13:46 +01:00
rustc_expand Auto merge of #78088 - fusion-engineering-forks:panic-fmt-lint, r=estebank 2020-11-20 03:40:20 +00:00
rustc_feature Auto merge of #78801 - sexxi-goose:min_capture, r=nikomatsakis 2020-11-17 03:56:03 +00:00
rustc_fs_util
rustc_graphviz
rustc_hir resolve: Introduce a separate NonMacroAttrKind for legacy derive helpers 2020-11-19 19:25:20 +03:00
rustc_hir_pretty
rustc_incremental
rustc_index
rustc_infer Move rustc_ty -> rustc_ty_utils 2020-11-19 21:57:29 +01:00
rustc_interface Move rustc_ty -> rustc_ty_utils 2020-11-19 21:57:29 +01:00
rustc_lexer
rustc_lint Auto merge of #78779 - LeSeulArtichaut:ty-visitor-return, r=oli-obk 2020-11-17 12:24:34 +00:00
rustc_lint_defs
rustc_llvm
rustc_macros Auto merge of #78779 - LeSeulArtichaut:ty-visitor-return, r=oli-obk 2020-11-17 12:24:34 +00:00
rustc_metadata
rustc_middle Make PackedFingerprint's Fingerprint private 2020-11-18 15:10:43 -08:00
rustc_mir Auto merge of #79192 - tmiasko:naked-noinline, r=oli-obk 2020-11-20 06:01:49 +00:00
rustc_mir_build Rollup merge of #79149 - sexxi-goose:upvar_ref, r=nikomatsakis 2020-11-19 16:26:39 +01:00
rustc_parse Rollup merge of #79185 - petrochenkov:derattr2, r=Aaron1011 2020-11-19 23:58:42 +01:00
rustc_parse_format
rustc_passes Auto merge of #78801 - sexxi-goose:min_capture, r=nikomatsakis 2020-11-17 03:56:03 +00:00
rustc_plugin_impl
rustc_privacy
rustc_query_system Make PackedFingerprint's Fingerprint private 2020-11-18 15:10:43 -08:00
rustc_resolve resolve/expand: Misc cleanup 2020-11-19 19:25:20 +03:00
rustc_save_analysis
rustc_serialize
rustc_session
rustc_span Auto merge of #78801 - sexxi-goose:min_capture, r=nikomatsakis 2020-11-17 03:56:03 +00:00
rustc_symbol_mangling compiler: fold by value 2020-11-16 22:34:57 +01:00
rustc_target
rustc_trait_selection Move rustc_ty -> rustc_ty_utils 2020-11-19 21:57:29 +01:00
rustc_traits Auto merge of #78779 - LeSeulArtichaut:ty-visitor-return, r=oli-obk 2020-11-17 12:24:34 +00:00
rustc_ty_utils Move rustc_ty -> rustc_ty_utils 2020-11-19 21:57:29 +01:00
rustc_typeck Rollup merge of #78961 - CraftSpider:22565, r=oli-obk 2020-11-19 16:26:19 +01:00