about summary refs log tree commit diff
path: root/tests/codegen/patchable-function-entry/patchable-function-entry-one-flag.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-08-22 08:38:27 +0000
committerbors <bors@rust-lang.org>2024-08-22 08:38:27 +0000
commit614fb2472424026e7aaeee6e471cc6c01a2b7662 (patch)
treea07aade54da57f3ffab557ace95ec279b269fc8b /tests/codegen/patchable-function-entry/patchable-function-entry-one-flag.rs
parent9cb66c2c02d272209d610b6724536c7625b64c84 (diff)
parentdb2e8e1ed0e0aa4f4c9e3f5712c4c9351a7bf2e2 (diff)
downloadrust-614fb2472424026e7aaeee6e471cc6c01a2b7662.tar.gz
rust-614fb2472424026e7aaeee6e471cc6c01a2b7662.zip
Auto merge of #17939 - ShoyuVanilla:maybe-sized-fix, r=Veykril
fix: Wrong `Sized` predicate for `generic_predicates_for_param`

I found this gathers wrong `Self: Sized` bound while implementing object safety, though I couldn't find proper test for this.

If we call `generic_predicates_for_param` to `Bar` in the following code;
```rust
trait Foo<T: ?Sized> {}
trait Bar<T: Foo<Self> + ?Sized> {}
```
it returns `T: Sized` and `Self: Sized` bound, because normaly, the `?Sized` bound applied properly in L1059 with;
https://github.com/rust-lang/rust-analyzer/blob/3723e5910c14f0ffbd13de474b8a8fcc74db04ce/crates/hir-ty/src/lower.rs#L1035-L1061

But we filter them before it is lowered with that function here;

https://github.com/rust-lang/rust-analyzer/blob/3723e5910c14f0ffbd13de474b8a8fcc74db04ce/crates/hir-ty/src/lower.rs#L1540-L1586

So, the `?Sized` bounded params are not gathered into `ctx.unsized_types` and thus we are applying them implicit `Sized` bound here;

https://github.com/rust-lang/rust-analyzer/blob/3723e5910c14f0ffbd13de474b8a8fcc74db04ce/crates/hir-ty/src/lower.rs#L1591-L1602
Diffstat (limited to 'tests/codegen/patchable-function-entry/patchable-function-entry-one-flag.rs')
0 files changed, 0 insertions, 0 deletions