mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-25 05:14:27 +00:00
Restore some removed tests
This commit is contained in:
parent
52aff53812
commit
f479a7aa8d
@ -1,13 +1,5 @@
|
||||
// known-bug: unknown
|
||||
|
||||
// If we want this to compile, then we'd need to do something like RPITs do,
|
||||
// where nested associated constants have early-bound versions of their captured
|
||||
// late-bound vars inserted into their generics. This gives us substitutable
|
||||
// lifetimes to actually use when borrow-checking the associated const, which is
|
||||
// lowered as a totally separate body from its parent. Since this doesn't exist,
|
||||
// so we should just error rather than resolving this late-bound var with no
|
||||
// binder to actually attach it to, or worse, as a free region that can't even be
|
||||
// substituted correctly, and ICEing. - @compiler-errors
|
||||
// see comment on `tests/ui/const-generics/late-bound-vars/simple.rs`
|
||||
|
||||
#![feature(generic_const_exprs)]
|
||||
#![allow(incomplete_features)]
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: cannot capture late-bound lifetime in constant
|
||||
--> $DIR/in_closure.rs:24:29
|
||||
--> $DIR/in_closure.rs:16:29
|
||||
|
|
||||
LL | fn test<'a>() {
|
||||
| -- lifetime defined here
|
||||
@ -8,7 +8,7 @@ LL | let _: [u8; inner::<'a>()];
|
||||
| ^^
|
||||
|
||||
error: cannot capture late-bound lifetime in constant
|
||||
--> $DIR/in_closure.rs:25:29
|
||||
--> $DIR/in_closure.rs:17:29
|
||||
|
|
||||
LL | fn test<'a>() {
|
||||
| -- lifetime defined here
|
||||
|
@ -0,0 +1,13 @@
|
||||
// known-bug: unknown
|
||||
// see comment on `tests/ui/const-generics/late-bound-vars/simple.rs`
|
||||
|
||||
#![feature(generic_const_exprs)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
trait MyTrait<T> {}
|
||||
|
||||
fn bug<'a, T>() -> &'static dyn MyTrait<[(); { |x: &'a u32| { x }; 4 }]> {
|
||||
todo!()
|
||||
}
|
||||
|
||||
fn main() {}
|
@ -0,0 +1,8 @@
|
||||
error: cannot capture late-bound lifetime in constant
|
||||
--> $DIR/late-bound-in-return-issue-77357.rs:9:53
|
||||
|
|
||||
LL | fn bug<'a, T>() -> &'static dyn MyTrait<[(); { |x: &'a u32| { x }; 4 }]> {
|
||||
| -- lifetime defined here ^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -0,0 +1,15 @@
|
||||
// known-bug: unknown
|
||||
// see comment on `tests/ui/const-generics/late-bound-vars/simple.rs`
|
||||
|
||||
#![feature(generic_const_exprs)]
|
||||
#![allow(incomplete_features)]
|
||||
|
||||
fn bug<'a>()
|
||||
where
|
||||
for<'b> [(); {
|
||||
let x: &'b ();
|
||||
0
|
||||
}]:
|
||||
{}
|
||||
|
||||
fn main() {}
|
@ -0,0 +1,10 @@
|
||||
error: cannot capture late-bound lifetime in constant
|
||||
--> $DIR/late-bound-in-where-issue-83993.rs:10:17
|
||||
|
|
||||
LL | for<'b> [(); {
|
||||
| -- lifetime defined here
|
||||
LL | let x: &'b ();
|
||||
| ^^
|
||||
|
||||
error: aborting due to previous error
|
||||
|
@ -5,7 +5,7 @@
|
||||
// late-bound vars inserted into their generics. This gives us substitutable
|
||||
// lifetimes to actually use when borrow-checking the associated const, which is
|
||||
// lowered as a totally separate body from its parent. Since this doesn't exist,
|
||||
// so we should just error rather than resolving this late-bound var with no
|
||||
// we should just error rather than resolving this late-bound var with no
|
||||
// binder to actually attach it to, or worse, as a free region that can't even be
|
||||
// substituted correctly, and ICEing. - @compiler-errors
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user