Commit 9df9c9d
committed
choose a less arbitrary span when parsing the empty visibility modifier
Visibility spans were added to the AST in #47799 (d6bdf29) as a
`Spanned<_>`—which means that we need to choose a span even in the case
of inherited visibility (what you get when there's no `pub` &c. keyword
at all). That initial implementation's choice is pretty
counterintuitive, which could matter if we want to use it as a site to
suggest inserting a visibility modifier, &c.
(The phrase "Schelling span" in the comment is meant in analogy to the
game-theoretic concept of a "Schelling point", a value that is chosen
simply because it's what one can expect to agree upon with other agents
in the absence of explicit coördination.)1 parent 33b40f5 commit 9df9c9d
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6032 | 6032 | | |
6033 | 6033 | | |
6034 | 6034 | | |
6035 | | - | |
| 6035 | + | |
| 6036 | + | |
| 6037 | + | |
| 6038 | + | |
6036 | 6039 | | |
6037 | 6040 | | |
6038 | 6041 | | |
| |||
0 commit comments