diff options
| author | bors <bors@rust-lang.org> | 2024-08-30 05:53:23 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-08-30 05:53:23 +0000 |
| commit | a729229a217a623ecd9bcb4ed08e07ad40ac5a71 (patch) | |
| tree | 2f1eb3e211b1ec7e93a4f2ece5575a8067ca7400 /tests/codegen/patchable-function-entry | |
| parent | 16a29ced1575e47559e2e46d28c0183e576113c9 (diff) | |
| parent | 92f27dc57df1e01186a2ab515ced9125a8ba2673 (diff) | |
| download | rust-a729229a217a623ecd9bcb4ed08e07ad40ac5a71.tar.gz rust-a729229a217a623ecd9bcb4ed08e07ad40ac5a71.zip | |
Auto merge of #17999 - ShoyuVanilla:issue-17998, r=Veykril
fix: `std::error::Error` is object unsafe
Fixes #17998
I tried to get generic predicates of assoc function itself, not inherited from the parent here;
https://github.com/rust-lang/rust-analyzer/blob/0ae42bd42576566540a84c62e118aa823edcf2ec/crates/hir-ty/src/object_safety.rs#L420-L442
But this naive equality check approach doesn't work when the assoc function has one or more generic paramters like;
```rust
trait Foo {}
trait Bar: Foo {
fn bar(&self);
}
```
because the generic predicates of the parent, `Bar` is `[^1.0 implements Foo]` and the generic predicates of `fn bar` is `[^1.1 implements Foo]`, which are different.
This PR implements a correct logic for filtering out parent generic predicates for this.
Diffstat (limited to 'tests/codegen/patchable-function-entry')
0 files changed, 0 insertions, 0 deletions
