Skip to main content

rustc_middle/query/
stack.rs

1use rustc_span::Span;
2
3use crate::queries::TaggedQueryKey;
4
5/// Description of a frame in the query stack.
6///
7/// This is mostly used in case of cycles for error reporting.
8#[derive(#[automatically_derived]
impl<'tcx> ::core::fmt::Debug for QueryStackFrame<'tcx> {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f,
            "QueryStackFrame", "span", &self.span, "tagged_key",
            &&self.tagged_key)
    }
}Debug)]
9pub struct QueryStackFrame<'tcx> {
10    pub span: Span,
11
12    /// The query and key of the query method call that this stack frame
13    /// corresponds to.
14    ///
15    /// Code that doesn't care about the specific key can still use this to
16    /// check which query it's for, or obtain the query's name.
17    pub tagged_key: TaggedQueryKey<'tcx>,
18}