Skip to content

rustc: added a check for builtin bounds to vtable search - #13228

Closed
dmski wants to merge 1 commit into
rust-lang:masterfrom
dmski:trait-static-bound
Closed

dmski wants to merge 1 commit into
rust-lang:masterfrom
dmski:trait-static-bound

Conversation

@dmski

@dmski dmski commented Mar 31, 2014

Copy link
Copy Markdown
Contributor

There wasn't a check for builtin bounds when looking up vtables, only for trait bounds. This led to types sometimes implementing traits they shouldn't have been able to.

Closes #10751

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although, I expect this to break with the opt-in work. Would you mind adding a FIXME(#13231) so that I remember to update this code once the new opt-in work is done?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@flaper87

Copy link
Copy Markdown
Contributor

This looks quite good. The fix will have to be updated by the opt-in bound traits work.

@nikomatsakis r?

Comment thread src/test/compile-fail/issue-10751.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please extend this test for other built-in bounds too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done as well. I've also added a couple of positive test cases - to make sure opt-in changes don't break them.

bors added a commit that referenced this pull request Apr 18, 2014
There wasn't a check for builtin bounds when looking up vtables, only for trait bounds. This led to types sometimes implementing traits they shouldn't have been able to.

Closes #10751
@dmski dmski closed this Apr 23, 2014
@dmski

dmski commented Apr 23, 2014

Copy link
Copy Markdown
Contributor Author

This is now failing for me because of some DST changes. Considering that opt-in built-in traits are probably just around the corner now, i'm closing this for now and will re-open with a rebase when opt-in stuff lands (if these changes will still be needed then).

notriddle pushed a commit to notriddle/rust that referenced this pull request Sep 20, 2022
Move reference imports filtering into to_proto layer

Follow up to rust-lang/rust-analyzer#13186
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.

'static bound not enforced in borrowed trait coercion

2 participants