Skip to content

Commit 00f6c38

Browse files
committed
Merge branch 'main' into few_args
2 parents ca69abc + 31d8863 commit 00f6c38

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1157
-777
lines changed

.github/workflows/auto_assign_prs.yaml

Lines changed: 0 additions & 63 deletions
This file was deleted.

CODEOWNERS

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
2+
# Exceptions. See /LICENSE for license information.
3+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4+
5+
# This file is only used for PR autoassignment. Branch protections don't enforce
6+
# it.
7+
#
8+
# Syntax:
9+
# https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners#codeowners-syntax
10+
11+
# Toolchain reviewers are used as a fallback.
12+
* @carbon-language/toolchain-reviewers
13+
14+
# Key project documents should be reviewed by leads.
15+
/*.md @carbon-language/leads
16+
/LICENSE @carbon-language/leads
17+
/docs/project/evolution.md @carbon-language/leads
18+
/docs/project/goals.md @carbon-language/leads
19+
/docs/project/principles/* @carbon-language/leads
20+
/docs/project/roadmap.md @carbon-language/leads
21+
/proposals/*.md @carbon-language/leads
22+
23+
# Toolchain code.
24+
/toolchain @carbon-language/toolchain-reviewers

docs/design/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -862,6 +862,9 @@ or restrictions on casts between pointers and integers.
862862
863863
### Arrays and slices
864864

865+
> **TODO:** The provisional array syntax documented here has been superseded by
866+
> [p4682: The Core.Array type for direct-storage immutably-sized buffers](/proposals/p4682.md).
867+
865868
The type of an array of holding 4 `i32` values is written `[i32; 4]`. There is
866869
an [implicit conversion](expressions/implicit_conversions.md) from tuples to
867870
arrays of the same length as long as every component of the tuple may be

docs/design/classes.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,10 @@ class GraphNode {
752752
**Open question:** What is specifically allowed and forbidden with an incomplete
753753
type has not yet been decided.
754754

755+
> **TODO:** Document that qualified names can be looked up in an incomplete
756+
> type, as adopted in
757+
> [p5087: Qualified lookup into types being defined](/proposals/p5087.md).
758+
755759
### `Self`
756760

757761
A `class` definition may provisionally include references to its own name in

docs/design/expressions/member_access.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3333

3434
## Overview
3535

36+
> **TODO:** [p3720: Member binding operators](/proposals/p3720.md) introduces an
37+
> additional "member binding" step, redefines simple member access in terms of
38+
> compound member access, and defines compound member access in terms of calls
39+
> to user-implementable interface methods. This document must be updated to
40+
> reflect those changes.
41+
3642
A _qualified name_ is a [word](../lexical_conventions/words.md) that is preceded
3743
by a period or a rightward arrow. The name is found within a contextually
3844
determined entity:

docs/design/functions.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2424

2525
## Overview
2626

27+
> **TODO:** Update this document to reflect the introduction of function values,
28+
> function types, and the `Call` interface in
29+
> [p2875: Functions, function types, and function calls](/proposals/p2875.md).
30+
31+
> **TODO:** Update this document to reflect the changes to named functions in
32+
> [p3848: Lambdas](/proposals/p3848.md).
33+
2734
Functions are the core building block for applications. Carbon's basic function
2835
syntax is:
2936

docs/design/generics/details.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,10 @@ impl Point_ExtendForward as Vector {
447447
}
448448
```
449449

450+
> **TODO:** The second `impl` in this example is no longer a valid redeclaration
451+
> of the first after
452+
> [p5366: The name of an `impl` in `class` scope](/proposals/p5366.md).
453+
450454
More about forward declaring implementations in
451455
[its dedicated section](#declaring-implementations).
452456

@@ -929,6 +933,9 @@ constraint DrawVectorLegoFish {
929933
}
930934
```
931935

936+
> **TODO:** Document that `Self` can be omitted, as adopted in
937+
> [P5337: Interface extension and `final impl` update](/proposals/p5337.md).
938+
932939
In general, Carbon makes no syntactic distinction between the uses of named
933940
constraints and interfaces, so one may be replaced with the other without
934941
affecting users. To accomplish this, Carbon allows a named constraint to be used
@@ -1249,6 +1256,10 @@ fn DoHashAndEquals[T:! Hashable](x: T) {
12491256

12501257
### Interface extension
12511258

1259+
> **TODO:** Update this section as needed to reflect the fact that an impl of an
1260+
> interface doesn't impl the interfaces it extends, as adopted in
1261+
> [p5168: Forward `impl` declaration of an incomplete interface](/proposals/p5168.md).
1262+
12521263
When implementing an interface, we allow implementing the aliased names as well.
12531264
In the case of `Hashable` above, this includes all the members of `Equatable`,
12541265
obviating the need to implement `Equatable` itself:
@@ -1276,6 +1287,9 @@ benefits:
12761287
We expect this concept to be common enough to warrant dedicated `interface`
12771288
syntax:
12781289

1290+
> **TODO:** Update this section to reflect the new syntax adopted in
1291+
> [p5337: Interface extension and `final impl` update](/proposals/p5337.md).
1292+
12791293
```carbon
12801294
interface Equatable { fn Equals[self: Self](rhs: Self) -> bool; }
12811295
@@ -1326,6 +1340,9 @@ interface SetAlgebra {
13261340
}
13271341
```
13281342

1343+
> **TODO:** Document `extend [final] impl as I`, as adopted in
1344+
> [p5337: Interface extension and `final impl` update](/proposals/p5337.md).
1345+
13291346
**Alternative considered:** The `extend` declarations are in the body of the
13301347
`interface` definition instead of the header so we can use
13311348
[associated constants](terminology.md#associated-entity) also defined in the
@@ -1434,6 +1451,9 @@ interface MovieCodec {
14341451

14351452
#### Diamond dependency issue
14361453

1454+
> **TODO:** Update this section to reflect the changes in
1455+
> [p5168: Forward `impl` declaration of an incomplete interface](/proposals/p5168.md).
1456+
14371457
Consider this set of interfaces, simplified from
14381458
[this example generic graph library doc](https://docs.google.com/document/d/15Brjv8NO_96jseSesqer5HbghqSTJICJ_fTaZOH0Mg4/edit?usp=sharing&resourcekey=0-CYSbd6-xF8vYHv9m1rolEQ):
14391459

@@ -1986,6 +2006,10 @@ keyword `private` before `adapt`, so you might write
19862006

19872007
## Associated constants
19882008

2009+
> **TODO:** Update this section to reflect the new rules and guidance on
2010+
> associated constants in
2011+
> [p5168: Forward `impl` declaration of an incomplete interface](/proposals/p5168.md).
2012+
19892013
In addition to associated methods, we allow other kinds of
19902014
[associated entities](terminology.md#associated-entity). For consistency, we use
19912015
the same syntax to describe a compile-time constant in an interface as in a type
@@ -2112,6 +2136,10 @@ Together associated methods and associated class functions are called
21122136
_associated functions_, much like together methods and class functions are
21132137
called [member functions](/docs/design/classes.md#member-functions).
21142138

2139+
> **TODO:** Document rules on where associated function implementations can be
2140+
> declared, as adopted in
2141+
> [p5168: Forward `impl` declaration of an incomplete interface](/proposals/p5168.md).
2142+
21152143
## Associated facets
21162144

21172145
Associated facets are [associated constants](#associated-constants) that happen
@@ -4466,6 +4494,9 @@ difference.
44664494

44674495
#### Prioritization rule
44684496

4497+
> **TODO:** Document the changes to prioritization adopted in
4498+
> [p5337: Interface extension and `final impl` update](/proposals/p5337.md).
4499+
44694500
Since at most one library can contain `impl` definitions with a given type
44704501
structure, all `impl` definitions with a given type structure must be in the
44714502
same library. Furthermore by the [`impl` declaration access rules](#access),
@@ -4864,6 +4895,10 @@ class Optional(T:! type) {
48644895
// ❌ Illegal: impl Optional(i32) as Deref { ... }
48654896
```
48664897

4898+
> **TODO:** Update the following passage to reflect the relaxed overlap rule
4899+
> adopted in
4900+
> [p5337: Interface extension and `final impl` update](/proposals/p5337.md).
4901+
48674902
This prevents any higher-priority impl that overlaps a final impl from being
48684903
defined unless it agrees with the `final` impl on the overlap. Overlap is
48694904
computed between two non-`template` `impl` declaration by
@@ -4996,6 +5031,10 @@ differences between the Carbon design and Rust plans:
49965031

49975032
## Forward declarations and cyclic references
49985033

5034+
> **TODO:** Update this section to distinguish between _defined_ and _complete_,
5035+
> as adopted in
5036+
> [p5087: Qualified lookup into types being defined](/proposals/p5087.md).
5037+
49995038
Interfaces, named constraints, and their implementations may be forward declared
50005039
and then later defined. This is needed to allow cyclic references, for example
50015040
when declaring the edges and nodes of a graph. It is also a tool that may be
@@ -5014,6 +5053,10 @@ used.
50145053

50155054
### Declaring interfaces and named constraints
50165055

5056+
> **TODO:** Update this section to reflect the additional things you can do with
5057+
> a defined but incomplete type, as adoped in
5058+
> [p5087: Qualified lookup into types being defined](/proposals/p5087.md).
5059+
50175060
The declaration for an interface or named constraint consists of:
50185061

50195062
- an optional access-control keyword like `private`,
@@ -5100,6 +5143,9 @@ An incomplete `C` cannot be used in the following contexts:
51005143
51015144
### Declaring implementations
51025145
5146+
> **TODO:** Update this section to reflect the new rules adopted in
5147+
> [p5168: Forward `impl` declaration of an incomplete interface](/proposals/p5168.md).
5148+
51035149
The declaration of an interface implementation consists of:
51045150
51055151
- optional modifier keyword `final`,
@@ -5115,6 +5161,9 @@ The declaration of an interface implementation consists of:
51155161
[associated constants](#associated-constants) including
51165162
[associated facets](#associated-facets).
51175163
5164+
> **TODO:** Document the redeclaration syntax `impl C.(as I)` adopted in
5165+
> [p5366: The name of an `impl` in `class` scope](/proposals/p5366.md).
5166+
51185167
**Note:** The type before the `as` is required except in class scope, where it
51195168
defaults to `Self` as described in the
51205169
[matching and agreeing section](#matching-and-agreeing).
@@ -5154,6 +5203,11 @@ these rules:
51545203
51555204
### Matching and agreeing
51565205
5206+
> **TODO:** Update this section to reflect the new terminology and rules adopted
5207+
> in [p3763: Matching redeclarations](/proposals/p3763.md), and the new rules
5208+
> adopted in
5209+
> [p5168: Forward `impl` declaration of an incomplete interface](/proposals/p5168.md).
5210+
51575211
Carbon needs to determine if two declarations match in order to say which
51585212
definition a forward declaration corresponds to and to verify that nothing is
51595213
defined twice. Declarations that match must also agree, meaning they are
@@ -5189,6 +5243,10 @@ expressions match along with
51895243
an interface, as in `constraint Equivalent { extend MyInterface; }`, is not
51905244
considered to match.
51915245
5246+
> **TODO:** Document the matching rules for the redeclaration syntax
5247+
> `impl C.(as I)` adopted in
5248+
> [p5366: The name of an `impl` in `class` scope](/proposals/p5366.md).
5249+
51925250
For implementations to agree:
51935251
51945252
- The presence of the modifier keyword `final` before `impl` must match

docs/project/code_review.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2828
- [What should be covered by a review?](#what-should-be-covered-by-a-review)
2929
- [Writing review comments](#writing-review-comments)
3030
- [Approving the change](#approving-the-change)
31+
- [Pausing reviews and reassigning PRs](#pausing-reviews-and-reassigning-prs)
3132
- [Merging pull requests](#merging-pull-requests)
3233
- [Merge commit descriptions](#merge-commit-descriptions)
3334
- [Resolving an impasse or conflict](#resolving-an-impasse-or-conflict)
@@ -86,11 +87,11 @@ In Carbon, developers will focus on particular areas, loosely broken down as:
8687
- We split out auto-assignment by explorer, toolchain, and other files
8788
(including documentation).
8889

89-
[Auto-assignment](/.github/workflows/auto_assign_prs.yaml) will help find
90-
owners, but won't always be perfect -- developers may take a PR they weren't
91-
auto-assigned in order to help review go quickly. Contributors can also request
92-
multiple reviewers, but it can be daunting to get feedback from a large number
93-
of reviewers, so we suggest keeping the number of reviewers reasonably small.
90+
[Auto-assignment](/CODEOWNERS) will help find owners, but won't always be
91+
perfect -- developers may take a PR they weren't auto-assigned in order to help
92+
review go quickly. Contributors can also request multiple reviewers, but it can
93+
be daunting to get feedback from a large number of reviewers, so we suggest
94+
keeping the number of reviewers reasonably small.
9495

9596
Any reviews that explicitly request changes should be addressed, either with the
9697
changes or an explanation of why not, before a pull request is merged. Further,
@@ -440,6 +441,18 @@ author can always come back to you if they have questions, and we can always
440441
revert changes if the resolution for some reason diverges wildly from your
441442
expectations.
442443

444+
### Pausing reviews and reassigning PRs
445+
446+
When temporarily unavailable to review, for example due to a vacation, reviewers
447+
can either mark themselves as
448+
[busy in GitHub](https://docs.github.com/en/account-and-profile/tutorials/personalize-your-profile#setting-a-status),
449+
or ask an admin to stop assignment (using
450+
["Never assign to certain team members"](https://docs.github.com/en/organizations/organizing-members-into-teams/managing-code-review-settings-for-your-team#configuring-auto-assignment)).
451+
452+
A PR's reviewer can also be changed to a team, such as
453+
`carbon-language/toolchain-reviewers`, and it should be automatically
454+
reassigned. This can be done by anyone, not just a reviewer.
455+
443456
## Merging pull requests
444457

445458
Pull requests are ready to be merged when reviewers have indicated they're happy

docs/project/evolution.md

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,36 @@ The author of a proposal is not required to include changes to the design
314314
documentation as part of a proposal, and it may in some cases be preferable to
315315
decouple the proposal process from updating the design. When accepted, the
316316
proposal would then be implemented through a series of future PRs to the rest of
317-
the project, and the proposal document should describe what is being proposed in
318-
enough detail to validate that those future PRs properly implement the proposed
319-
direction.
317+
the project. If the proposal PR defers any documentation changes in this way,
318+
the proposal document should describe what is being proposed in enough detail to
319+
validate that those future PRs properly implement the proposed direction, and
320+
the proposal PR should add "TODO" comments in the places where significant
321+
future changes will be needed (including adding new placeholder documents if
322+
needed), with links back to the proposal document. These comments should be kept
323+
close to the passages that need to be changed. This is intended to ensure that
324+
readers of the design documentation know when what they're reading is out of
325+
date, and can easily find out what has changed. For example:
326+
327+
```md
328+
> **TODO:** Document the redeclaration syntax `impl C.(as I)` adopted in
329+
> [p5366](/proposals/p5366.md).
330+
```
331+
332+
See the `docs/design` changes in
333+
[#5606: Keep design documents current](https://github.com/carbon-language/carbon-lang/pull/5606)
334+
for additional examples of adding those comments. As with other parts of the
335+
proposal, these comments should be included in the initial PR, and updated as
336+
needed during the review.
337+
338+
As an exception, proposals that will have a widespread, pervasive effect on the
339+
design documents (such as proposals to replace widely-used vocabulary) usually
340+
shouldn't make those changes as part of the proposal, so that changes during the
341+
review aren't an excessive burden on the proposal author. Such proposals usually
342+
shouldn't apply "TODO" comments either, because pervasive "TODO" comments are
343+
more likely to be disruptive than helpful to the reader. Instead, the proposal
344+
author should file a GitHub issue to track the need for documentation updates,
345+
and include a link to it in the proposal document, and then follow up with pull
346+
requests to make the changes after the proposal is approved by the leads.
320347

321348
#### Open questions
322349

0 commit comments

Comments
 (0)