Skip to content

Commit 5dc86dc

Browse files
committed
Use header IDs
1 parent a2b36f6 commit 5dc86dc

File tree

1 file changed

+16
-32
lines changed

1 file changed

+16
-32
lines changed

src/doc/src/reference/semver.md

+16-32
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,7 @@ Some examples of breaking changes are:
275275
[`std::mem::transmute`]: ../../std/mem/fn.transmute.html
276276
[`UnsafeCell`]: ../../std/cell/struct.UnsafeCell.html#memory-layout
277277

278-
<a id="repr-c-private-change"></a>
279-
#### Minor: `repr(C)` add, remove, or change a private field
278+
#### Minor: `repr(C)` add, remove, or change a private field {#repr-c-private-change}
280279

281280
It is usually safe to add, remove, or change a private field of a `repr(C)` struct, union, or enum, assuming it follows the other guidelines in this guide (see [struct-add-private-field-when-public](#struct-add-private-field-when-public), [struct-add-public-field-when-no-private](#struct-add-public-field-when-no-private), [struct-private-fields-with-private](#struct-private-fields-with-private), [enum-fields-new](#enum-fields-new)).
282281

@@ -318,8 +317,7 @@ fn main() {
318317
}
319318
```
320319

321-
<a id="repr-c-enum-variant-new"></a>
322-
#### Minor: `repr(C)` add enum variant
320+
#### Minor: `repr(C)` add enum variant {#repr-c-enum-variant-new}
323321

324322
It is usually safe to add variants to a `repr(C)` enum, if the enum uses `non_exhastive`.
325323
See [enum-variant-new](#enum-variant-new) for more discussion.
@@ -359,8 +357,7 @@ fn main() {
359357
}
360358
```
361359

362-
<a id="repr-c-add"></a>
363-
#### Minor: Adding `repr(C)` to a default representation
360+
#### Minor: Adding `repr(C)` to a default representation {#repr-c-add}
364361

365362
It is safe to add `repr(C)` to a struct, union, or enum with [the default representation].
366363
This is safe because users should not make assumptions about the alignment, layout, or size of types with with the default representation.
@@ -390,8 +387,7 @@ fn main() {
390387
}
391388
```
392389

393-
<a id="repr-int-enum-add"></a>
394-
#### Minor: Adding `repr(<int>)` to an enum
390+
#### Minor: Adding `repr(<int>)` to an enum {#repr-int-enum-add}
395391

396392
It is safe to add `repr(<int>)` [primitive representation] to an enum with [the default representation].
397393
This is safe because users should not make assumptions about the alignment, layout, or size of an enum with the default representation.
@@ -423,8 +419,7 @@ fn main() {
423419
}
424420
```
425421

426-
<a id="repr-transparent-add"></a>
427-
#### Minor: Adding `repr(transparent)` to a default representation struct or enum
422+
#### Minor: Adding `repr(transparent)` to a default representation struct or enum {#repr-transparent-add}
428423

429424
It is safe to add `repr(transparent)` to a struct or enum with [the default representation].
430425
This is safe because users should not make assumptions about the alignment, layout, or size of a struct or enum with the default representation.
@@ -450,8 +445,7 @@ fn main() {
450445
}
451446
```
452447

453-
<a id="repr-packed-add"></a>
454-
#### Major: Adding `repr(packed)` to a struct or union
448+
#### Major: Adding `repr(packed)` to a struct or union {#repr-packed-add}
455449

456450
It is a breaking change to add `repr(packed)` to a struct or union.
457451
Making a type `repr(packed)` makes changes that can break code, such as being invalid to take a reference to a field, or causing truncation of disjoint closure captures.
@@ -510,8 +504,7 @@ fn main() {
510504
}
511505
```
512506

513-
<a id="repr-align-add"></a>
514-
#### Major: Adding `repr(align)` to a struct, union, or enum
507+
#### Major: Adding `repr(align)` to a struct, union, or enum {#repr-align-add}
515508

516509
It is a breaking change to add `repr(align)` to a struct, union, or enum.
517510
Making a type `repr(align)` would break any use of that type in a `repr(packed)` type because that combination is not allowed.
@@ -550,8 +543,7 @@ fn main() {
550543
}
551544
```
552545

553-
<a id="repr-packed-remove"></a>
554-
#### Major: Removing `repr(packed)` from a struct or union
546+
#### Major: Removing `repr(packed)` from a struct or union {#repr-packed-remove}
555547

556548
It is a breaking change to remove `repr(packed)` from a struct or union.
557549
This may change the alignment or layout that extern crates are relying on.
@@ -633,8 +625,7 @@ fn main() {
633625
}
634626
```
635627

636-
<a id="repr-packed-n-change"></a>
637-
#### Major: Changing the value N of `repr(packed(N))` if that changes the alignment or layout
628+
#### Major: Changing the value N of `repr(packed(N))` if that changes the alignment or layout {#repr-packed-n-change}
638629

639630
It is a breaking change to change the value of N of `repr(packed(N))` if that changes the alignment or layout.
640631
This may change the alignment or layout that external crates are relying on.
@@ -672,8 +663,7 @@ fn main() {
672663
}
673664
```
674665

675-
<a id="repr-align-n-change"></a>
676-
#### Major: Changing the value N of `repr(align(N))` if that changes the alignment
666+
#### Major: Changing the value N of `repr(align(N))` if that changes the alignment {#repr-align-n-change}
677667

678668
It is a breaking change to change the value `N` of `repr(align(N))` if that changes the alignment.
679669
This may change the alignment that external crates are relying on.
@@ -713,8 +703,7 @@ fn main() {
713703
}
714704
```
715705

716-
<a id="repr-align-remove"></a>
717-
#### Major: Removing `repr(align)` from a struct, union, or enum
706+
#### Major: Removing `repr(align)` from a struct, union, or enum {#repr-align-remove}
718707

719708
It is a breaking change to remove `repr(align)` from a struct, union, or enum, if their layout was well-defined.
720709
This may change the alignment or layout that external crates are relying on.
@@ -752,8 +741,7 @@ fn main() {
752741
}
753742
```
754743

755-
<a id="repr-c-shuffle"></a>
756-
#### Major: Changing the order of public fields of a `repr(C)` type
744+
#### Major: Changing the order of public fields of a `repr(C)` type {#repr-c-shuffle}
757745

758746
It is a breaking change to change the order of public fields of a `repr(C)` type.
759747
External crates may be relying on the specific ordering of the fields.
@@ -807,8 +795,7 @@ fn main() {
807795
# }
808796
```
809797

810-
<a id="repr-c-remove"></a>
811-
#### Major: Removing `repr(C)` from a struct, union, or enum
798+
#### Major: Removing `repr(C)` from a struct, union, or enum {#repr-c-remove}
812799

813800
It is a breaking change to remove `repr(C)` from a struct, union, or enum.
814801
External crates may be relying on the specific layout of the type.
@@ -862,8 +849,7 @@ fn main() {
862849
# }
863850
```
864851

865-
<a id="repr-int-enum-remove"></a>
866-
#### Major: Removing `repr(<int>)` from an enum
852+
#### Major: Removing `repr(<int>)` from an enum {#repr-int-enum-remove}
867853

868854
It is a breaking change to remove `repr(<int>)` from an enum.
869855
External crates may be assuming that the discriminant is a specific size.
@@ -899,8 +885,7 @@ fn main() {
899885
}
900886
```
901887

902-
<a id="repr-int-enum-change"></a>
903-
#### Major: Changing the primitive representation of a `repr(<int>)` enum
888+
#### Major: Changing the primitive representation of a `repr(<int>)` enum {#repr-int-enum-change}
904889

905890
It is a breaking change to change the primitive representation of a `repr(<int>)` enum.
906891
External crates may be assuming that the discriminant is a specific size.
@@ -936,8 +921,7 @@ fn main() {
936921
}
937922
```
938923

939-
<a id="repr-transparent-remove"></a>
940-
#### Major: Removing `repr(transparent)` from a struct or enum
924+
#### Major: Removing `repr(transparent)` from a struct or enum {#repr-transparent-remove}
941925

942926
It is a breaking change to remove `repr(transparent)` from a struct or enum.
943927
External crates may be relying on the type having the alignment, layout, or size of the transparent field.

0 commit comments

Comments
 (0)