<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/librustc_parse/parser, branch master</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=master</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2020-08-30T15:45:07+00:00</updated>
<entry>
<title>mv compiler to compiler/</title>
<updated>2020-08-30T15:45:07+00:00</updated>
<author>
<name>mark</name>
<email>markm@cs.wisc.edu</email>
</author>
<published>2020-08-28T03:58:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9e5f7d5631b8f4009ac1c693e585d4b7108d4275'/>
<id>urn:sha1:9e5f7d5631b8f4009ac1c693e585d4b7108d4275</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Use smaller def span for functions</title>
<updated>2020-08-22T22:41:49+00:00</updated>
<author>
<name>Aaron Hill</name>
<email>aa1ronham@gmail.com</email>
</author>
<published>2020-08-12T21:02:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e3cd43eb0093a59c4ba98e44c13a8dacc9f4f9b1'/>
<id>urn:sha1:e3cd43eb0093a59c4ba98e44c13a8dacc9f4f9b1</id>
<content type='text'>
Currently, the def span of a funtion encompasses the entire function
signature and body. However, this is usually unnecessarily verbose - when we are
pointing at an entire function in a diagnostic, we almost always want to
point at the signature. The actual contents of the body tends to be
irrelevant to the diagnostic we are emitting, and just takes up
additional screen space.

This commit changes the `def_span` of all function items (freestanding
functions, `impl`-block methods, and `trait`-block methods) to be the
span of the signature. For example, the function

```rust
pub fn foo&lt;T&gt;(val: T) -&gt; T { val }
```

now has a `def_span` corresponding to `pub fn foo&lt;T&gt;(val: T) -&gt; T`
(everything before the opening curly brace).

Trait methods without a body have a `def_span` which includes the
trailing semicolon. For example:

```rust
trait Foo {
    fn bar();
}```

the function definition `Foo::bar` has a `def_span` of `fn bar();`

This makes our diagnostic output much shorter, and emphasizes
information that is relevant to whatever diagnostic we are reporting.

We continue to use the full span (including the body) in a few of
places:

* MIR building uses the full span when building source scopes.
* 'Outlives suggestions' use the full span to sort the diagnostics being
  emitted.
* The `#[rustc_on_unimplemented(enclosing_scope="in this scope")]`
attribute points the entire scope body.
* The 'unconditional recursion' lint uses the full span to show
  additional context for the recursive call.

All of these cases work only with local items, so we don't need to
add anything extra to crate metadata.
</content>
</entry>
<entry>
<title>Auto merge of #74566 - lzutao:guard, r=petrochenkov</title>
<updated>2020-08-22T15:38:13+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2020-08-22T15:38:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5528caf91442729b47b8f818be0a0ddfd0c17ffb'/>
<id>urn:sha1:5528caf91442729b47b8f818be0a0ddfd0c17ffb</id>
<content type='text'>
Gate if-let guard feature

Enhanced on #74315. That PR is in crater queue so I don't want to push to it.

Close  #74232
cc #51114
</content>
</entry>
<entry>
<title>Capture tokens for Pat used in macro_rules! argument</title>
<updated>2020-08-20T06:45:28+00:00</updated>
<author>
<name>Aaron Hill</name>
<email>aa1ronham@gmail.com</email>
</author>
<published>2020-07-27T22:02:29+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=607a1900592c91ba2b284afda8ea9a1521d52475'/>
<id>urn:sha1:607a1900592c91ba2b284afda8ea9a1521d52475</id>
<content type='text'>
This extends PR #73293 to handle patterns (Pat). Unlike expressions,
patterns do not support custom attributes, so we only need to capture
tokens during macro_rules! argument parsing.
</content>
</entry>
<entry>
<title>Rollup merge of #75658 - tgnottingham:issue-75599, r=estebank</title>
<updated>2020-08-19T06:54:35+00:00</updated>
<author>
<name>Yuki Okushi</name>
<email>huyuumi.dev@gmail.com</email>
</author>
<published>2020-08-19T06:54:35+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e6fe5232df75246921f8b89d0161e4508f1cc535'/>
<id>urn:sha1:e6fe5232df75246921f8b89d0161e4508f1cc535</id>
<content type='text'>
Don't emit "is not a logical operator" error outside of associative expressions

Avoid showing this error where it doesn't make sense by not assuming
"and" and "or" were intended to mean "&amp;&amp;" and "||" until after we decide
to continue parsing input as an associative expression.

Note that the decision of whether or not to continue parsing input as an
associative expression doesn't actually depend on this assumption.

Fixes #75599

---

First time contributor! Let me know if there are any conventions or policies I should be following that I missed here. Thanks :)
</content>
</entry>
<entry>
<title>Don't emit "is not a logical operator" error outside of associative expressions</title>
<updated>2020-08-18T19:15:57+00:00</updated>
<author>
<name>Tyson Nottingham</name>
<email>tgnottingham@gmail.com</email>
</author>
<published>2020-08-18T02:15:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ff73a409957d704aba735fb29ab4be2d77efe958'/>
<id>urn:sha1:ff73a409957d704aba735fb29ab4be2d77efe958</id>
<content type='text'>
Avoid showing this error where it doesn't make sense by not assuming
"and" and "or" were intended to mean "&amp;&amp;" and "||" until after we decide
to continue parsing input as an associative expression.

Note that the decision of whether or not to continue parsing input as an
associative expression doesn't actually depend on this assumption.

Fixes #75599
</content>
</entry>
<entry>
<title>rust_ast::ast =&gt; rustc_ast</title>
<updated>2020-08-17T20:32:32+00:00</updated>
<author>
<name>Ujjwal Sharma</name>
<email>ryzokuken@disroot.org</email>
</author>
<published>2020-04-27T17:56:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a888b02884883de41d0ce08aa62a6cd6d4790951'/>
<id>urn:sha1:a888b02884883de41d0ce08aa62a6cd6d4790951</id>
<content type='text'>
</content>
</entry>
<entry>
<title>replaced log with tracing</title>
<updated>2020-08-15T20:03:11+00:00</updated>
<author>
<name>Gurpreet Singh</name>
<email>gdhuper@gmail.com</email>
</author>
<published>2020-08-14T06:05:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d2753f91b5e09a91841fa729ef6b14d7ef249e8a'/>
<id>urn:sha1:d2753f91b5e09a91841fa729ef6b14d7ef249e8a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #75513 - estebank:confused-parser, r=davidtwco</title>
<updated>2020-08-15T03:07:13+00:00</updated>
<author>
<name>Tyler Mandry</name>
<email>tmandry@gmail.com</email>
</author>
<published>2020-08-15T03:07:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e38eaf22d247644e5554d0c200e6df756e469b0a'/>
<id>urn:sha1:e38eaf22d247644e5554d0c200e6df756e469b0a</id>
<content type='text'>
Recover gracefully from `struct` parse errors

Currently the parser tries to recover from finding a keyword where a field name was expected, but this causes extra knock down parse errors that are completely irrelevant. Instead, bail out early in the parsing of the field and consume the remaining tokens in the block. This can reduce output significantly.

_Improvements based on the narrative in https://fasterthanli.me/articles/i-am-a-java-csharp-c-or-cplusplus-dev-time-to-do-some-rust_
</content>
</entry>
<entry>
<title>Recover gracefully from `struct ` parse errors</title>
<updated>2020-08-14T04:15:36+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2020-08-14T04:15:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2e9b45e1dd8d3a248e2aea60314787650e3abcc9'/>
<id>urn:sha1:2e9b45e1dd8d3a248e2aea60314787650e3abcc9</id>
<content type='text'>
</content>
</entry>
</feed>
