1
Fork 0

Auto merge of #50876 - matthewjasper:rollback-trivial-bounds, r=nikomatsakis

Filter global bounds from ParamEnv again.

This PR adds back the filtering of global bounds from ParamEnv as a temporary solution for #50825.

<details>

Long term, the fix seems like it should be changing the priority in `candidate_should_be_dropped_in_favor_of` so that (global) where clauses aren't considered as highly.

a722296b6e/src/librustc/traits/select.rs (L2017-L2022)

</details>

r? @nikomatsakis
This commit is contained in:
bors 2018-05-22 06:54:34 +00:00
commit 1bbae5f386
14 changed files with 102 additions and 5 deletions

View file

@ -644,8 +644,13 @@ pub fn normalize_param_env_or_error<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
let predicates: Vec<_> =
util::elaborate_predicates(tcx, unnormalized_env.caller_bounds.to_vec())
.filter(|p| !p.is_global() || p.has_late_bound_regions()) // (*)
.collect();
// (*) FIXME(#50825) This shouldn't be needed.
// Removing the bounds here stopped them from being prefered in selection.
// See the issue-50825 ui tests for examples
debug!("normalize_param_env_or_error: elaborated-predicates={:?}",
predicates);