Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Register new snapshots #17939

Merged
merged 1 commit into from
Oct 11, 2014
Merged

Register new snapshots #17939

merged 1 commit into from
Oct 11, 2014

Conversation

alexcrichton
Copy link
Member

Also convert a number of static mut to just a plain old static and remove
some unsafe blocks.

Also convert a number of `static mut` to just a plain old `static` and remove
some unsafe blocks.
bors added a commit that referenced this pull request Oct 11, 2014
Also convert a number of `static mut` to just a plain old `static` and remove
some unsafe blocks.
@bors bors closed this Oct 11, 2014
@bors bors merged commit dae48a0 into rust-lang:master Oct 11, 2014
@alexcrichton alexcrichton deleted the snapshots branch October 11, 2014 21:40
lnicola pushed a commit to lnicola/rust that referenced this pull request Aug 29, 2024
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
lnicola pushed a commit to lnicola/rust that referenced this pull request Aug 29, 2024
…kril

fix: Wrong `Self: Sized` predicate for trait assoc items

Again while implementing object safety like rust-lang#17939 😅

If we call `generic_predicates_query` on `fn foo` in the following code;
```
trait Foo {
    fn foo();
}
```
It returns implicit bound `Self: Sized`, even though `Self` is not appearing as a generic parameter inside angle brackets, but as a parent generic parameter, "trait self".

This PR prevent pushing "implicit" `Self: Sized` predicates in such cases
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants