Skip to content

Fix handling of coherence related lang_items #1970

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

Merged
merged 1 commit into from
Mar 8, 2023

Conversation

powerboat9
Copy link
Collaborator

Fixes #1896. I don't think we have coherence checks yet, but the test should detect regressions.

@powerboat9 powerboat9 force-pushed the int-lang branch 3 times, most recently from 268afa8 to 2c5b1d5 Compare March 6, 2023 19:04
@philberty philberty self-requested a review March 7, 2023 10:01
Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

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

I am not sure i like this approach yet for two reasons:

  1. We are lossing the ability to lookup the const_ptr lang item and we still cant lookup the i32 langitem for example
  2. In rustc they have lang items defined on the primitive impl blocks how do we implement a check that lang item i32 has already been defined if we remove all of this?

We don't need to copy Rustc and i dont like jumping ahead when we dont have any test cases for this area either.

I would prefer that we just add the mappings for each of the lang items instead of grouping them like this because we don't know how much we dont know in order to implement the rest of libcore.

gcc/rust/ChangeLog:

	* util/rust-lang-item.h
	(RustLangItem::ItemType): New enumerators.
	(RustLangItem::Parse): Parse new enumerators.
	(RustLangItem::ToString): Handle new enumerators.

gcc/testsuite/ChangeLog:

	* rust/compile/lang-impl.rs: New test.
@powerboat9
Copy link
Collaborator Author

@philberty Fixed

Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

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

LGTM thanks for updating this

@philberty philberty added this pull request to the merge queue Mar 8, 2023
@philberty philberty added this to the Final upstream patches milestone Mar 8, 2023
Merged via the queue into Rust-GCC:master with commit 1a33a5c Mar 8, 2023
@dkm
Copy link
Member

dkm commented Mar 11, 2023

little nit: your commit is missing the SIgned-Off-By. Not a big deal, but would probably make the task of pushing all these in gcc easier if it was systematically there :)

@powerboat9
Copy link
Collaborator Author

@dkm Ah, sorry. I was trying out a new rebase-heavy workflow, and forgot to sign off on the final comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

unknown lang item i32
3 participants