forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 7
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#133323 - compiler-errors:bail-if-self-var, r=lcnr Bail in effects in old solver if self ty is ty var Otherwise when we try to check something like `?t: ~const Trait` we'll immediately stick it to the first param-env candidate, lol. r? lcnr
- Loading branch information
Showing
2 changed files
with
21 additions
and
0 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
16 changes: 16 additions & 0 deletions
16
tests/ui/traits/const-traits/effects/dont-prefer-param-env-for-infer-self-ty.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,16 @@ | ||
//@ check-pass | ||
|
||
#![feature(const_trait_impl)] | ||
|
||
#[const_trait] | ||
trait Foo {} | ||
|
||
impl<T> const Foo for (T,) where T: ~const Foo {} | ||
|
||
const fn needs_const_foo(_: impl ~const Foo + Copy) {} | ||
|
||
const fn test<T: ~const Foo + Copy>(t: T) { | ||
needs_const_foo((t,)); | ||
} | ||
|
||
fn main() {} |