Skip to content

Commit dc36b38

Browse files
committed
Make a comment more obvious
1 parent d3b534b commit dc36b38

File tree

1 file changed

+4
-2
lines changed
  • compiler/rustc_trait_selection/src/traits/select

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2248,8 +2248,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
22482248
) -> Result<Vec<PredicateObligation<'tcx>>, ()> {
22492249
self.infcx
22502250
.at(&obligation.cause, obligation.param_env)
2251-
// We don't want opaque types to just randomly match everything,
2252-
// they should be opaque, even in their defining scope.
2251+
// We don't want predicates for opaque types to just match all other types,
2252+
// if there is an obligation on the opaque type, then that obligation must be met
2253+
// opaquely. Otherwise we'd match any obligation to the opaque type and then error
2254+
// out later.
22532255
.define_opaque_types(false)
22542256
.sup(obligation.predicate.to_poly_trait_ref(), poly_trait_ref)
22552257
.map(|InferOk { obligations, .. }| obligations)

0 commit comments

Comments
 (0)