Closed Marwes closed 4 years ago
Added a commit which fixes the use of no_std which I forgot to test.
Are there still plans to merge this? I think this would be very useful to have.
Rebased on top of current master. Also had to add some lang_items to the no_std examples to get them to build.
Any chance of getting this merged and pushed to crates.io? If there are any problems with this PR I would be happy to update it.
@Marwes: the modifications to the lang items: what requires that? I haven’t had any problems with running the tests or the examples on stable, beta or nightly.
@chris-morgan I am not exactly sure why actually. I tried compiling the tests and got undefined reference errors from the linker and after looking up the signatures for the functions and adding them it compiled fine.
The best guess I can give is that I needed them due to compiling on windows and only windows versions of rustc properly check for stack overflow (the functions seem to refer to "frames"). Might be misunderstanding something though so it may be safer to remove them if it compiles fine on travis without them.
Very likely that those lang items are Windows specific, due to SEH exceptions which are quite different than dwarf which is used on other platforms. They're unrelated to stack overflows, and rather refer to exception frames. Rust doesn't check for stack overflow, rather LLVM on Windows will inject a stack probe for any function that uses over a page of stack, and then Rust catches the SEH exception that fires when code tries to access the guard page at the top of the stack.
@retep998 Thanks for the explanation. The guard page was the "overflow check" I thought though I was quite off base with "stack frames".
@chris-morgan Should I remove the additional lang items and/or are there any other modifications I should make?
This PR is useful. I hope it gets merged soon.
Adds to the mopafy! macro so that it can take traits with parameters like
mopafy!(Paremetrized<A, B>)
.I had to use parentheses in the variants which actually do something to avoid ambiguity but otherwise it is a quite small generalization. This does not make it possible to add trait bounds to those parameters as I do not know a good way to do this in macros but for my purposes I did not need that anyway.