-
Notifications
You must be signed in to change notification settings - Fork 17
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
Remove trait bounds from generated program type's declaration #25
Conversation
7092061
to
3be5483
Compare
Following up on #23 (comment) I've amended this PR to support the following (optional) syntax for specifying diverging impl trait bounds: Non-diverging impl trait boundsIf only a generic The following … ascent!{
struct AscentProgram<T> where T: Clone + Eq + Hash;
// ...
} … expands to something along the lines of this: struct AscentProgram<T>
where
T: Clone + Hash + Eq
{
// ...
}
impl<T> AscentProgram<T>
where
T: Clone + Hash + Eq,
{
// ...
}
impl<T> Default for AscentProgram<T>
where
T: Clone + Hash + Eq
{
// ...
} Diverging impl trait boundsIf both, a generic The following … ascent!{
struct AscentProgram<T> where T: Clone;
impl<T> AscentProgram<T> where T: Clone + Eq + Hash;
// ...
} … expands to something along the lines of this: struct AscentProgram<T>
where
T: Clone
{
// ...
}
impl<T> AscentProgram<T>
where
T: Clone + Hash + Eq,
{
// ...
}
impl<T> Default for AscentProgram<T>
where
T: Clone
{
// ...
} Impl-only trait boundsSimilarly the following … ascent!{
struct AscentProgram<T>;
impl<T> AscentProgram<T> where T: Clone + Eq + Hash;
// ...
} … expands to something along the lines of this: struct AscentProgram<T> {
// ...
}
impl<T> AscentProgram<T>
where
T: Clone + Hash + Eq,
{
// ...
}
impl<T> Default for AscentProgram<T> {
// ...
} |
032ba02
to
de24744
Compare
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.
We should also disallow custom impl
signatures on ascent_run
and ascent_run_par
. This could be done at the start of the compile_mir
function.
de24744
to
753ba7d
Compare
Hi @regexident, and thanks again for the PR! |
I'll try to give it a go tomorrow or the day after. |
753ba7d
to
ac94d5b
Compare
…nto `Signatures`) This allows for specifying deviating trait bounds on the program's impls
ac94d5b
to
7d28be0
Compare
@s-arash Looks like the experimental "attrs on relations" in The handling of attritibute parsing within I'm not sure how to best address this. Feel free to take it from here, if you do. |
It wasn't changes to |
Fixes #23