slightly cleanup building SelectionContext
This commit is contained in:
parent
88a192257c
commit
5922d6cf60
1 changed files with 2 additions and 14 deletions
|
@ -226,13 +226,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn intercrate(infcx: &'cx InferCtxt<'cx, 'tcx>) -> SelectionContext<'cx, 'tcx> {
|
pub fn intercrate(infcx: &'cx InferCtxt<'cx, 'tcx>) -> SelectionContext<'cx, 'tcx> {
|
||||||
SelectionContext {
|
SelectionContext { intercrate: true, ..SelectionContext::new(infcx) }
|
||||||
infcx,
|
|
||||||
freshener: infcx.freshener_keep_static(),
|
|
||||||
intercrate: true,
|
|
||||||
intercrate_ambiguity_causes: None,
|
|
||||||
query_mode: TraitQueryMode::Standard,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_query_mode(
|
pub fn with_query_mode(
|
||||||
|
@ -240,13 +234,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||||
query_mode: TraitQueryMode,
|
query_mode: TraitQueryMode,
|
||||||
) -> SelectionContext<'cx, 'tcx> {
|
) -> SelectionContext<'cx, 'tcx> {
|
||||||
debug!(?query_mode, "with_query_mode");
|
debug!(?query_mode, "with_query_mode");
|
||||||
SelectionContext {
|
SelectionContext { query_mode, ..SelectionContext::new(infcx) }
|
||||||
infcx,
|
|
||||||
freshener: infcx.freshener_keep_static(),
|
|
||||||
intercrate: false,
|
|
||||||
intercrate_ambiguity_causes: None,
|
|
||||||
query_mode,
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Enables tracking of intercrate ambiguity causes. See
|
/// Enables tracking of intercrate ambiguity causes. See
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue