<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_errors/src/lib.rs, branch 1.55.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.55.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.55.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2021-07-11T20:08:58+00:00</updated>
<entry>
<title>Simplify future incompatible reporting.</title>
<updated>2021-07-11T20:08:58+00:00</updated>
<author>
<name>Eric Huss</name>
<email>eric@huss.org</email>
</author>
<published>2021-07-11T20:08:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4d1daf86833392f9b819938c3ce0848c3adede50'/>
<id>urn:sha1:4d1daf86833392f9b819938c3ce0848c3adede50</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #86572 - rylev:force-warnings-always, r=nikomatsakis</title>
<updated>2021-07-06T16:50:33+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2021-07-06T16:50:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=238fd72880776c5dbd3b067acb096562e6af5399'/>
<id>urn:sha1:238fd72880776c5dbd3b067acb096562e6af5399</id>
<content type='text'>
Force warnings even when can_emit_warnings == false

Fixes an issue mentioned in #85512 with --cap-lints overriding --force-warnings.

Fixes https://github.com/rust-lang/rust/issues/86751

r? `@ehuss`
</content>
</entry>
<entry>
<title>Add missing docs and remove dead code</title>
<updated>2021-07-06T11:47:03+00:00</updated>
<author>
<name>Ryan Levick</name>
<email>me@ryanlevick.com</email>
</author>
<published>2021-07-06T11:47:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5af5a6d49dd5a72c7c4f48ba9749b84002e0b99e'/>
<id>urn:sha1:5af5a6d49dd5a72c7c4f48ba9749b84002e0b99e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>New force_warn diagnostic builder and ensure cap-lints doesn't reduce force_warn level</title>
<updated>2021-07-01T10:29:20+00:00</updated>
<author>
<name>Ryan Levick</name>
<email>me@ryanlevick.com</email>
</author>
<published>2021-07-01T10:29:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=33cc7b1fe21c82d31204e549cd2471ac8ec22aa3'/>
<id>urn:sha1:33cc7b1fe21c82d31204e549cd2471ac8ec22aa3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Force warnings even when can_emit_warnings == false</title>
<updated>2021-06-30T09:18:33+00:00</updated>
<author>
<name>Ryan Levick</name>
<email>me@ryanlevick.com</email>
</author>
<published>2021-06-04T12:37:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a3d6905053ad60e836717976e6e4d38de67888f9'/>
<id>urn:sha1:a3d6905053ad60e836717976e6e4d38de67888f9</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Update to new bootstrap compiler</title>
<updated>2021-06-28T15:30:49+00:00</updated>
<author>
<name>Mark Rousskov</name>
<email>mark.simulacrum@gmail.com</email>
</author>
<published>2021-06-24T16:47:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=06661ba7591b1531555cd084f75540d99ef35ac5'/>
<id>urn:sha1:06661ba7591b1531555cd084f75540d99ef35ac5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Miscellaneous inlining improvements</title>
<updated>2021-06-02T06:49:58+00:00</updated>
<author>
<name>Tomasz Miąsko</name>
<email>tomasz.miasko@gmail.com</email>
</author>
<published>2021-06-01T00:00:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c1f6495b8e19325a57702a7ce016e6d5a3f25e26'/>
<id>urn:sha1:c1f6495b8e19325a57702a7ce016e6d5a3f25e26</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Stabilize extended_key_value_attributes</title>
<updated>2021-05-18T05:01:36+00:00</updated>
<author>
<name>Joshua Nelson</name>
<email>jyn514@gmail.com</email>
</author>
<published>2021-03-22T05:10:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e48b6b459974245efcfc9edda468b4c587cbf37c'/>
<id>urn:sha1:e48b6b459974245efcfc9edda468b4c587cbf37c</id>
<content type='text'>
 # Stabilization report

 ## Summary

This stabilizes using macro expansion in key-value attributes, like so:

 ```rust
 #[doc = include_str!("my_doc.md")]
 struct S;

 #[path = concat!(env!("OUT_DIR"), "/generated.rs")]
 mod m;
 ```

See the changes to the reference for details on what macros are allowed;
see Petrochenkov's excellent blog post [on internals](https://internals.rust-lang.org/t/macro-expansion-points-in-attributes/11455)
for alternatives that were considered and rejected ("why accept no more
and no less?")

This has been available on nightly since 1.50 with no major issues.

 ## Notes

 ### Accepted syntax

The parser accepts arbitrary Rust expressions in this position, but any expression other than a macro invocation will ultimately lead to an error because it is not expected by the built-in expression forms (e.g., `#[doc]`).  Note that decorators and the like may be able to observe other expression forms.

 ### Expansion ordering

Expansion of macro expressions in "inert" attributes occurs after decorators have executed, analogously to macro expressions appearing in the function body or other parts of decorator input.

There is currently no way for decorators to accept macros in key-value position if macro expansion must be performed before the decorator executes (if the macro can simply be copied into the output for later expansion, that can work).

 ## Test cases

 - https://github.com/rust-lang/rust/blob/master/src/test/ui/attributes/key-value-expansion-on-mac.rs
 - https://github.com/rust-lang/rust/blob/master/src/test/rustdoc/external-doc.rs

The feature has also been dogfooded extensively in the compiler and
standard library:

- https://github.com/rust-lang/rust/pull/83329
- https://github.com/rust-lang/rust/pull/83230
- https://github.com/rust-lang/rust/pull/82641
- https://github.com/rust-lang/rust/pull/80534

 ## Implementation history

- Initial proposal: https://github.com/rust-lang/rust/issues/55414#issuecomment-554005412
- Experiment to see how much code it would break: https://github.com/rust-lang/rust/pull/67121
- Preliminary work to restrict expansion that would conflict with this
feature: https://github.com/rust-lang/rust/pull/77271
- Initial implementation: https://github.com/rust-lang/rust/pull/78837
- Fix for an ICE: https://github.com/rust-lang/rust/pull/80563

 ## Unresolved Questions

~~https://github.com/rust-lang/rust/pull/83366#issuecomment-805180738 listed some concerns, but they have been resolved as of this final report.~~

 ## Additional Information

 There are two workarounds that have a similar effect for `#[doc]`
attributes on nightly. One is to emulate this behavior by using a limited version of this feature that was stabilized for historical reasons:

```rust
macro_rules! forward_inner_docs {
    ($e:expr =&gt; $i:item) =&gt; {
        #[doc = $e]
        $i
    };
}

forward_inner_docs!(include_str!("lib.rs") =&gt; struct S {});
```

This also works for other attributes (like `#[path = concat!(...)]`).
The other is to use `doc(include)`:

```rust
 #![feature(external_doc)]
 #[doc(include = "lib.rs")]
 struct S {}
```

The first works, but is non-trivial for people to discover, and
difficult to read and maintain. The second is a strange special-case for
a particular use of the macro. This generalizes it to work for any use
case, not just including files.

I plan to remove `doc(include)` when this is stabilized. The
`forward_inner_docs` workaround will still compile without warnings, but
I expect it to be used less once it's no longer necessary.
</content>
</entry>
<entry>
<title>Show macro name in 'this error originates in macro' message</title>
<updated>2021-05-12T23:03:06+00:00</updated>
<author>
<name>Aaron Hill</name>
<email>aa1ronham@gmail.com</email>
</author>
<published>2021-02-13T19:52:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0dd9f118d973bb077c6ff0e2a57421ca2eecb81c'/>
<id>urn:sha1:0dd9f118d973bb077c6ff0e2a57421ca2eecb81c</id>
<content type='text'>
When there are multiple macros in use, it can be difficult to tell
which one was responsible for producing an error.
</content>
</entry>
<entry>
<title>Note why `Handler::fatal` is different from `Sesssion::fatal`</title>
<updated>2021-05-09T03:13:04+00:00</updated>
<author>
<name>Joshua Nelson</name>
<email>jyn514@gmail.com</email>
</author>
<published>2021-03-28T02:58:25+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ebbc94957555350cdc71c4c853de430119f59f9f'/>
<id>urn:sha1:ebbc94957555350cdc71c4c853de430119f59f9f</id>
<content type='text'>
</content>
</entry>
</feed>
