For more information about how the query system works, see the rustc dev guide.