0

I'm reading a book named "Programming Rust".

I couldn't get the meaning of the following sentence in the last chapter.

Note that unsafe code must not depend on ordinary, safe traits being implemented correctly.

Is ordinary is a noun? And what is omitted after comma to connect the two sentences?

I thought it is saying

Unsafe code requires not ordinary implementation. That's why safe traits are implemented correctly.

Is it right? It sounds odd to me, though.

1

The comma just means “and”.

In the example:

Note that unsafe code must not depend on ordinary, safe traits being implemented correctly.

You can rephrase this as:

Note that unsafe code must not depend on traits, that are ordinary and safe, being implemented correctly.

Or if you prefer:

Note that unsafe code must not depend on {the correct implementation} of traits, {that are considered “ordinary” and “safe”}.

4
  • 1
    It's me or the sentence makes no sense? "UNSAFE code MUST NOT depend on SAFE traits"? I think that it made more sense if you replace "must" by "may". You may have unsafe code if you just implement ordinary safe traits.
    – RubioRic
    Oct 9 '19 at 10:20
  • I don’t take any position on whether the sentence is true. Oct 9 '19 at 21:15
  • I had the same suspicion about the meaning of the sentence. But I finally get it as I think the meaning is that "Safe traits are not relevant to unsafe code's safety. Unsafe code must depend on itself".
    – fx-kirin
    Oct 10 '19 at 14:05
  • It's not true that the comma just means and. Assuming that it's substituting for anything at all (it doesn't have to be; safe could be acting as an appositive to ordinary), it's at least as likely that it's substituting for or. Oct 13 '19 at 5:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .