Skip to content

Commit 80e009c

Browse files
authored
Rollup merge of #102416 - lcnr:specialization-fixme, r=compiler-errors
remove FIXME, improve documentation r? types
2 parents 039e9e2 + 9ccb851 commit 80e009c

File tree

1 file changed

+5
-5
lines changed
  • compiler/rustc_trait_selection/src/traits/select

1 file changed

+5
-5
lines changed

compiler/rustc_trait_selection/src/traits/select/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -1737,12 +1737,12 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
17371737

17381738
(&ImplCandidate(other_def), &ImplCandidate(victim_def)) => {
17391739
// See if we can toss out `victim` based on specialization.
1740-
// This requires us to know *for sure* that the `other` impl applies
1741-
// i.e., `EvaluatedToOk`.
1740+
// While this requires us to know *for sure* that the `other` impl applies
1741+
// we still use modulo regions here.
17421742
//
1743-
// FIXME(@lcnr): Using `modulo_regions` here seems kind of scary
1744-
// to me but is required for `std` to compile, so I didn't change it
1745-
// for now.
1743+
// This is fine as specialization currently assumes that specializing
1744+
// impls have to be always applicable, meaning that the only allowed
1745+
// region constraints may be constraints also present on the default impl.
17461746
let tcx = self.tcx();
17471747
if other.evaluation.must_apply_modulo_regions() {
17481748
if tcx.specializes((other_def, victim_def)) {

0 commit comments

Comments
 (0)