-
Notifications
You must be signed in to change notification settings - Fork 149
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
[E0308] mismatch types on both sides of assignment Operator #2494
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CohenArthur
approved these changes
Aug 1, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slight nit but looks good otherwise! Thank you!
5e8cbfd
to
9d010b3
Compare
CohenArthur
reviewed
Aug 2, 2023
dc5cea3
to
cbeec6b
Compare
CohenArthur
approved these changes
Aug 2, 2023
auto-merge was automatically disabled
August 2, 2023 08:28
Head branch was pushed to by a user without write access
I also updated the test case now, Thanks for review :) |
c7b8f17
to
0fc051e
Compare
@CohenArthur Sorry for delay as this message was used in many places in our test suite. |
This errorcode emits when there are mismatch types between lhs & rhs of assignment operator & refactored message. This error code was used in many test cases, so updated the error comments. gcc/rust/ChangeLog: * typecheck/rust-unify.cc (UnifyRules::emit_type_mismatch): refactored & called error function. gcc/testsuite/ChangeLog: * rust/compile/arrays1.rs: changed comment to pass testcase. * rust/compile/bad_type1.rs: likewise. * rust/compile/bad_type2.rs: likewise. * rust/compile/const_generics_6.rs: likewise. * rust/compile/deadcode_err1.rs: likewise. * rust/compile/deadcode_err2.rs: likewise. * rust/compile/func1.rs: likewise. * rust/compile/func3.rs: likewise. * rust/compile/func4.rs: likewise. * rust/compile/func5.rs: likewise. * rust/compile/generics1.rs: likewise. * rust/compile/generics2.rs: likewise. * rust/compile/generics3.rs: likewise. * rust/compile/implicit_returns_err1.rs: likewise. * rust/compile/implicit_returns_err2.rs: likewise. * rust/compile/implicit_returns_err3.rs: likewise. * rust/compile/implicit_returns_err4.rs: likewise. * rust/compile/issue-1152.rs: likewise. * rust/compile/issue-2477.rs: likewise. * rust/compile/reference1.rs: likewise. * rust/compile/stmt_with_block_err1.rs: likewise. * rust/compile/traits1.rs: likewise. * rust/compile/traits2.rs: likewise. * rust/compile/tuple_mismatch.rs: likewise. * rust/compile/tuple_struct3.rs: likewise. * rust/compile/mismatched-types.rs: New test from rustc. Signed-off-by: Muhammad Mahad <mahadtxt@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Mismatch types -
E0308
Code Tested from
E0308
Output:
gcc/rust/ChangeLog:
gcc/testsuite/ChangeLog: