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.
Auto merge of rust-lang#125285 - spastorino:unchk-region-opaque-deadc…
…ode, r=<try> Error for RPIT if they are not defined during MIR borrowck r? `@lcnr` Fixes rust-lang#112417 There are some changes in tests that we would need to properly review. I've left some comments on each of them.
- Loading branch information
Showing
43 changed files
with
392 additions
and
190 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
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
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
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,33 @@ | ||
//@ compile-flags:-Zverbose-internals | ||
|
||
#![feature(rustc_attrs)] | ||
#![rustc_hidden_type_of_opaques] | ||
|
||
trait CallMeMaybe<'a, 'b> { | ||
fn mk() -> Self; | ||
fn subtype<T>(self, x: &'b T) -> &'a T; | ||
} | ||
|
||
struct Foo<'a, 'b: 'a>(&'a (), &'b ()); | ||
impl<'a, 'b> CallMeMaybe<'a, 'b> for Foo<'a, 'b> { | ||
fn mk() -> Self { | ||
Foo(&(), &()) | ||
} | ||
|
||
fn subtype<T>(self, x: &'b T) -> &'a T { | ||
x | ||
} | ||
} | ||
|
||
fn good_bye() -> ! { | ||
panic!(); | ||
} | ||
|
||
fn foo<'a, 'b: 'a>() -> impl CallMeMaybe<'a, 'b> { | ||
//~^ ERROR: {type error} | ||
//~| ERROR: undefined opaque type | ||
good_bye(); | ||
Foo(&(), &()) | ||
} | ||
|
||
fn main() {} |
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,14 @@ | ||
error: undefined opaque type | ||
--> $DIR/opaque-types-deadcode.rs:26:25 | ||
| | ||
LL | fn foo<'a, 'b: 'a>() -> impl CallMeMaybe<'a, 'b> { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: {type error} | ||
--> $DIR/opaque-types-deadcode.rs:26:25 | ||
| | ||
LL | fn foo<'a, 'b: 'a>() -> impl CallMeMaybe<'a, 'b> { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 2 previous errors | ||
|
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
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
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
//@ check-pass | ||
|
||
fn foo() -> impl MyTrait { | ||
//~^ ERROR undefined opaque type | ||
panic!(); | ||
MyStruct | ||
} | ||
|
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,8 @@ | ||
error: undefined opaque type | ||
--> $DIR/divergence.rs:1:13 | ||
| | ||
LL | fn foo() -> impl MyTrait { | ||
| ^^^^^^^^^^^^ | ||
|
||
error: aborting due to 1 previous error | ||
|
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
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
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
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
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
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,26 @@ | ||
error: undefined opaque type | ||
--> $DIR/impl_fn_associativity.rs:4:30 | ||
| | ||
LL | fn f_debug() -> impl Fn() -> impl Debug { | ||
| ^^^^^^^^^^ | ||
|
||
error: undefined opaque type | ||
--> $DIR/impl_fn_associativity.rs:9:31 | ||
| | ||
LL | fn ff_debug() -> impl Fn() -> impl Fn() -> impl Debug { | ||
| ^^^^^^^^^^^^^^^^^^^^^^^ | ||
|
||
error: undefined opaque type | ||
--> $DIR/impl_fn_associativity.rs:9:44 | ||
| | ||
LL | fn ff_debug() -> impl Fn() -> impl Fn() -> impl Debug { | ||
| ^^^^^^^^^^ | ||
|
||
error: undefined opaque type | ||
--> $DIR/impl_fn_associativity.rs:15:29 | ||
| | ||
LL | fn multi() -> impl Fn() -> (impl Debug + Send) { | ||
| ^^^^^^^^^^^^^^^^^ | ||
|
||
error: aborting due to 4 previous errors | ||
|
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
Oops, something went wrong.