forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
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#137302 - compiler-errors:stray-drop-regions…
…, r=matthewjasper Use a probe to avoid registering stray region obligations when re-checking drops in MIR typeck Fixes rust-lang#137288. See the comment I left on the probe. I'm not totally sure why this depends on *both* an unconstrained type parameter in the impl and a type error for the self type, but I think the fix is at least theoretically well motivated. r? ``@matthewjasper``
- Loading branch information
Showing
4 changed files
with
42 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Regression test for <https://github.com/rust-lang/rust/issues/137288>. | ||
|
||
trait B { | ||
type C; | ||
} | ||
|
||
impl<U> B for &Missing { | ||
//~^ ERROR cannot find type `Missing` in this scope | ||
type C = (); | ||
} | ||
|
||
struct E<T: B> { | ||
g: <T as B>::C, | ||
} | ||
|
||
fn h(i: Box<E<&()>>) {} | ||
|
||
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,9 @@ | ||
error[E0412]: cannot find type `Missing` in this scope | ||
--> $DIR/bad-drop-side-effects.rs:7:16 | ||
| | ||
LL | impl<U> B for &Missing { | ||
| ^^^^^^^ not found in this scope | ||
|
||
error: aborting due to 1 previous error | ||
|
||
For more information about this error, try `rustc --explain E0412`. |