Rollup merge of #138357 - lcnr:goodbye-TypeVerifier-rarw, r=compiler-errors

merge `TypeChecker` and `TypeVerifier`

Stacked on top of #138354. Best reviewed commit by commit.

r? `@compiler-errors`
This commit is contained in:
Manish Goregaokar 2025-03-12 10:19:31 -07:00 committed by GitHub
commit 74c3794ece
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 697 additions and 806 deletions

File diff suppressed because it is too large Load diff

View file

@ -58,18 +58,18 @@ error[E0507]: cannot move out of a shared reference
LL | static STATIC_BAR: str = *"bar";
| ^^^^^^ move occurs because value has type `str`, which does not implement the `Copy` trait
error[E0161]: cannot move a value of type `str`
--> $DIR/const-unsized.rs:20:48
|
LL | println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATIC_BAR);
| ^^^^^^^^^ the size of `str` cannot be statically determined
error[E0161]: cannot move a value of type `dyn Debug + Sync`
--> $DIR/const-unsized.rs:20:38
|
LL | println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATIC_BAR);
| ^^^^^^^ the size of `dyn Debug + Sync` cannot be statically determined
error[E0161]: cannot move a value of type `str`
--> $DIR/const-unsized.rs:20:48
|
LL | println!("{:?} {:?} {:?} {:?}", &CONST_0, &CONST_FOO, &STATIC_1, &STATIC_BAR);
| ^^^^^^^^^ the size of `str` cannot be statically determined
error: aborting due to 10 previous errors
Some errors have detailed explanations: E0161, E0277, E0507.

View file

@ -7,12 +7,12 @@ LL | let _ = x as &dyn Bar<'static, 'a>; // Error
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ cast requires that `'a` must outlive `'static`
error: lifetime may not live long enough
--> $DIR/type-checking-test-4.rs:22:18
--> $DIR/type-checking-test-4.rs:22:13
|
LL | fn test_wrong2<'a>(x: &dyn Foo<'static>, y: &'a u32) {
| -- lifetime `'a` defined here
LL | let _ = x as &dyn Bar<'a, 'static>; // Error
| ^^^^^^^^^^^^^^^^^^^^^ type annotation requires that `'a` must outlive `'static`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ cast requires that `'a` must outlive `'static`
error: lifetime may not live long enough
--> $DIR/type-checking-test-4.rs:28:5