diff options
| author | bors <bors@rust-lang.org> | 2022-01-18 09:58:39 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-01-18 09:58:39 +0000 |
| commit | 7bc7be860f99f4a40d45b0f74e2d01b02e072357 (patch) | |
| tree | bae7d965ae2524594d217ae3022513e7c929ea2c /compiler/rustc_interface/src | |
| parent | 7531d2fdd49966d83830a7b4596c95587b1e9573 (diff) | |
| parent | b77bb5cb2589246cf684431ad2a184466940633d (diff) | |
| download | rust-7bc7be860f99f4a40d45b0f74e2d01b02e072357.tar.gz rust-7bc7be860f99f4a40d45b0f74e2d01b02e072357.zip | |
Auto merge of #87648 - JulianKnodt:const_eq_constrain, r=oli-obk
allow eq constraints on associated constants Updates #70256 (cc `@varkor,` `@Centril)`
Diffstat (limited to 'compiler/rustc_interface/src')
| -rw-r--r-- | compiler/rustc_interface/src/util.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/compiler/rustc_interface/src/util.rs b/compiler/rustc_interface/src/util.rs index cb51555f5ca..3921187baa5 100644 --- a/compiler/rustc_interface/src/util.rs +++ b/compiler/rustc_interface/src/util.rs @@ -1,7 +1,7 @@ use libloading::Library; use rustc_ast::mut_visit::{visit_clobber, MutVisitor, *}; use rustc_ast::ptr::P; -use rustc_ast::{self as ast, AttrVec, BlockCheckMode}; +use rustc_ast::{self as ast, AttrVec, BlockCheckMode, Term}; use rustc_codegen_ssa::traits::CodegenBackend; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; #[cfg(parallel_compiler)] @@ -738,9 +738,14 @@ impl<'a, 'b> ReplaceBodyWithLoop<'a, 'b> { | ast::GenericArg::Const(_) => false, }, ast::AngleBracketedArg::Constraint(c) => match c.kind { - ast::AssocTyConstraintKind::Bound { .. } => true, - ast::AssocTyConstraintKind::Equality { ref ty } => { - involves_impl_trait(ty) + ast::AssocConstraintKind::Bound { .. } => true, + ast::AssocConstraintKind::Equality { ref term } => { + match term { + Term::Ty(ty) => involves_impl_trait(ty), + // FIXME(...): This should check if the constant + // involves a trait impl, but for now ignore. + Term::Const(_) => false, + } } }, }) |
