File tree Expand file tree Collapse file tree
compiler/rustc_ty_utils/src
tests/ui/recursion/recursion_limit Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,6 +66,24 @@ fn layout_of<'tcx>(
6666 return tcx. layout_of ( typing_env. as_query_input ( ty) ) ;
6767 }
6868
69+ match typing_env. typing_mode ( ) {
70+ ty:: TypingMode :: Codegen => {
71+ let with_postanalysis =
72+ ty:: TypingEnv :: new ( typing_env. param_env , ty:: TypingMode :: PostAnalysis ) ;
73+ let res = tcx. layout_of ( with_postanalysis. as_query_input ( ty) ) ;
74+ match res {
75+ Err ( LayoutError :: TooGeneric ( _) ) => { }
76+ _ => return res,
77+ } ;
78+ }
79+ ty:: TypingMode :: Coherence
80+ | ty:: TypingMode :: Analysis { .. }
81+ | ty:: TypingMode :: Borrowck { .. }
82+ | ty:: TypingMode :: PostBorrowckAnalysis { .. }
83+ | ty:: TypingMode :: ErasedNotCoherence ( _)
84+ | ty:: TypingMode :: PostAnalysis => { }
85+ }
86+
6987 let cx = LayoutCx :: new ( tcx, typing_env) ;
7088
7189 let layout = layout_of_uncached ( & cx, ty) ?;
Original file line number Diff line number Diff line change 1- //~ ERROR overflow evaluating the requirement `&mut Self: DispatchFromDyn<&mut RustaceansAreAwesome>
1+ //~ ERROR queries overflow the depth limit!
22//~| HELP consider increasing the recursion limit
33//@ build-fail
44
Original file line number Diff line number Diff line change 1- error[E0275]: overflow evaluating the requirement `&mut Self: DispatchFromDyn<&mut RustaceansAreAwesome>`
1+ error: queries overflow the depth limit!
22 |
33 = help: consider increasing the recursion limit by adding a `#![recursion_limit = "2"]` attribute to your crate (`zero_overflow`)
4+ = note: query depth increased by 2 when computing layout of `isize`
45
56error: aborting due to 1 previous error
67
7- For more information about this error, try `rustc --explain E0275`.
You can’t perform that action at this time.
0 commit comments