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

feat: add support for extern functions without a return type #127

Merged

Conversation

baszalmstra
Copy link
Collaborator

This PR fixes an issue where it was not possible to add an extern function like this:

extern "C" fn foo(a: i64) {
    println!("{}", a);
}

because it doesn't have a return type and HasStaticTypeInfo is not implemented for ().

The PR fixes this by adding an implementation of IntoFunctionInfo for functions without a return type.

@baszalmstra baszalmstra self-assigned this Apr 11, 2020
@baszalmstra baszalmstra requested a review from Wodann April 11, 2020 18:36
@codecov
Copy link

codecov bot commented Apr 11, 2020

Codecov Report

Merging #127 into master will increase coverage by 0.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #127      +/-   ##
==========================================
+ Coverage   78.81%   78.85%   +0.03%     
==========================================
  Files         141      141              
  Lines        8739     8750      +11     
==========================================
+ Hits         6888     6900      +12     
+ Misses       1851     1850       -1     
Impacted Files Coverage Δ
crates/mun_runtime/src/function.rs 100.00% <100.00%> (+6.25%) ⬆️
crates/mun_runtime/src/test.rs 98.29% <100.00%> (+0.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 36b9809...5b0672a. Read the comment docs.

@Wodann Wodann merged commit a028ebf into mun-lang:master Apr 11, 2020
@Wodann Wodann added this to the Mun v0.2 milestone May 14, 2020
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.

None yet

2 participants