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

merge keywords: impl and implements #2301

Closed
graydon opened this issue Apr 25, 2012 · 12 comments
Closed

merge keywords: impl and implements #2301

graydon opened this issue Apr 25, 2012 · 12 comments
Labels
A-grammar Area: The grammar of Rust C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Milestone

Comments

@graydon
Copy link
Contributor

graydon commented Apr 25, 2012

I would prefer to see class C impl D rather than class C implements D. The latter feels redundant and verbose, and I think the former is unambiguous.

@catamorphism
Copy link
Contributor

I'm fine with changing "implements" to something else, but using impl there just makes me shudder. I don't mind short keywords, but using one together with a non-abbreviated keyword is like fingernails on a blackboard to me. (I acknowledge this comment as a total bikeshed.)

@brson
Copy link
Contributor

brson commented Apr 25, 2012

Classes and impls should use the same keyword to say what iface they are implementing. impls currently use of, but class duck of quackable doesn't sound that great.

@lkuper
Copy link
Contributor

lkuper commented Apr 25, 2012

How about class C impls D? It's short, but still clearly "implements" rather than "implementation".

@catamorphism
Copy link
Contributor

@lkuper : +1. @brson : I agree in principle, but can't think of a good syntax either. We might just have to bite the bullet and continue to have an additional keyword. I prefer readability to consistency, but that's just my opinion.

@graydon
Copy link
Contributor Author

graydon commented Apr 26, 2012

I think niko suggested : on irc?

@ghost ghost assigned catamorphism Apr 26, 2012
@catamorphism
Copy link
Contributor

Oh yeah, now I remember that. Sure, ':' is ok. I haven't seen any objections to it, so will implement that.

@lkuper
Copy link
Contributor

lkuper commented Apr 28, 2012

I like : as well.

@graydon
Copy link
Contributor Author

graydon commented May 2, 2012

@brson and @nikomatsakis both indicated on IRC support for this, with the revised syntax:

impl for ty: iface { ... }
impl foo for ty: iface { ... }
class foo: iface { ... }

@catamorphism
Copy link
Contributor

I like it. Will do.

@kud1ing
Copy link

kud1ing commented May 18, 2012

Two downsides, which do not really matter:

  • "class X : Y" will make some people compare Rust to C++
  • ":" has worse grep-ability than "impls" or "implements"

@catamorphism
Copy link
Contributor

@Lenny222 I don't care about the first one that much; I do think the second one matters, but we should probably have better IDE-ish tools anyway that would obviate the need for grepping :-)

@graydon
Copy link
Contributor Author

graydon commented Jul 4, 2012

The headline version of this is fixed and the rest (use of colon and such) is something @lkuper is going to pick up during #2794, so closing.

@graydon graydon closed this as completed Jul 4, 2012
bors added a commit to rust-lang-ci/rust that referenced this issue Sep 22, 2022
Strengthen C++20 SC accesses

`@SabrinaJewson` noted in rust-lang#2301 that Miri could produce behaviours forbidden under C++20 even without SC fences. Due to the added coherence-ordered before relationship which is created from read from and read before, plus the fact that coherence-ordered before between SC operations must be consistent with the Global Total Order S, in C++20 if there's an SC load that reads from any store, then a later SC load cannot read before that store. This PR adds this restriction
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-grammar Area: The grammar of Rust C-cleanup Category: PRs that clean code up or issues documenting cleanup. E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

5 participants