forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#134105 - compiler-errors:validate-self-preds, r=wesleywiser Validate self in host predicates correctly `assert_only_contains_predicates_from` was added to make sure that we are computing predicates for the correct self type for a given `PredicateFilter`. That was not implemented correctly for `PredicateFilter::SelfOnly` when there are const predicates. Fixes rust-lang#133526
- Loading branch information
Showing
2 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
tests/ui/traits/const-traits/dont-ice-on-const-pred-for-bounds.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// Regression test for <https://github.com/rust-lang/rust/issues/133526>. | ||
|
||
// Ensures we don't ICE when we encounter a `HostEffectPredicate` when computing | ||
// the "item super predicates" for `Assoc`. | ||
|
||
//@ compile-flags: -Znext-solver | ||
//@ check-pass | ||
|
||
#![feature(const_trait_impl)] | ||
|
||
#[const_trait] | ||
trait Trait { | ||
type Assoc: const Trait; | ||
} | ||
|
||
const fn needs_trait<T: ~const Trait>() {} | ||
|
||
fn test<T: Trait>() { | ||
const { needs_trait::<T::Assoc>() }; | ||
} | ||
|
||
fn main() {} |