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

some editing to better reflect my concern #1

Conversation

RalfJung
Copy link

There is also https://github.com/rust-lang/const-eval/blob/master/rfcs/const-generic-const-fn-bounds.md but I am not sure if that is still in sync with this branch...

is already legal in Rust today, even though the `F` doesn't need to be a
`const` function. Since we can't reuse this syntax, do we need a different
syntax or should the same syntax mean different things for `const` types and
`const fn` types?

2. Opt out bounds might seem unintuitive?
Copy link
Author

Choose a reason for hiding this comment

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

I did not edit this part, but given that the exact same thing is called "natural" for dyn Trait, I feel we should adjust one of the two sentences. :)

Copy link
Owner

Choose a reason for hiding this comment

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

It's not my opinion. Iirc I just added it because someone mentioned it.

Copy link
Author

Choose a reason for hiding this comment

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

So what about removing both this and the "natural", basically avoiding making a judgment?

Copy link
Owner

Choose a reason for hiding this comment

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

I still think it's "natural" or at least consistent to keep dyn some trait specifiers in sync with T: some trait specifiers

Copy link
Author

@RalfJung RalfJung Jun 25, 2020

Choose a reason for hiding this comment

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

I agree with that. And moreover, I think it is just as natural to keep dyn <specifiers> Trait in sync with <specifiers> fn (both of these are types here, not items/delcarations). Conversely, I think an asymmetry between our two kinds of dynamic dispatch (fn ptrs and dyn Trait) is just as unnatural as an asymmetry between traits dispatching statically or dynamically.

So I am fine with keeping the "natural" here for traits if we also call the same thing "natural" for function pointers.

Copy link
Author

@RalfJung RalfJung Jun 25, 2020

Choose a reason for hiding this comment

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

extern fn ptrs make no sense -- extern is a property of a function definition, but irrelevant for its type. (We have extern "ABI" fn ptrs, but here extern is just a bad keyword that we use to explicitly specify the ABI. extern "Rust" fn is the exact same thing as fn.)

We don't need dyn unsafe Trait because the Trait declares its methods and whether they are unsafe. That is just like saying that function pointers come with argument and return types which dyn Trait does not -- it is true, and IMO does not change the argument here. It just reflects that dyn Trait is nominal while function pointers are structural.

Imagine a structural version of dyn Trait. It would be dyn trait { fn method1(i32); unsafe fn method2(i64); }. Now a fn ptr is very much the same thing as a dyn trait {...} with a single function. Does this make the symmetry clearer?

Copy link
Owner

Choose a reason for hiding this comment

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

yea, ok, the symmetry in semantics is clear, but I was mainly worried about syntax here 😆

Copy link
Author

Choose a reason for hiding this comment

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

Ah -- I don't care about syntax, as long as it is consistent. ;) Which is what this is not, hence my comments.

Copy link
Owner

Choose a reason for hiding this comment

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

So what about removing both this and the "natural", basically avoiding making a judgment?

ok let's do that.

Copy link
Author

Choose a reason for hiding this comment

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

Done. I also reordered the fn ptr and dyn Trait discussion, because as you said dyn Trait is closer to what the RFC discusses otherwise, so this makes for a smoother transition I think.

@oli-obk oli-obk merged commit daac3ce into oli-obk:const_generic_const_fn_bounds Jun 25, 2020
oli-obk pushed a commit that referenced this pull request Oct 11, 2023
oli-obk pushed a commit that referenced this pull request Oct 11, 2023
…olicy

Clarify that audits evaluate both moderation policies and their application
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.

2 participants