]> git.lizzy.rs Git - rust.git/commitdiff
update fixme
authorlcnr <rust@lcnr.de>
Wed, 28 Sep 2022 15:04:29 +0000 (17:04 +0200)
committerlcnr <rust@lcnr.de>
Wed, 28 Sep 2022 15:04:29 +0000 (17:04 +0200)
compiler/rustc_trait_selection/src/traits/select/mod.rs

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