<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_interface/src/interface.rs, branch 1.65.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.65.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.65.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2022-09-01T14:54:27+00:00</updated>
<entry>
<title>Always import all tracing macros for the entire crate instead of piecemeal by module</title>
<updated>2022-09-01T14:54:27+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>git-spam-no-reply9815368754983@oli-obk.de</email>
</author>
<published>2022-08-31T13:09:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ee3c8350189de045ec71997874eaa6cebf99fbf3'/>
<id>urn:sha1:ee3c8350189de045ec71997874eaa6cebf99fbf3</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix a bunch of typo</title>
<updated>2022-08-31T10:24:55+00:00</updated>
<author>
<name>Dezhi Wu</name>
<email>wu543065657@163.com</email>
</author>
<published>2022-08-18T02:13:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b1430fb7ca499d517d9f4b3b6c5a81442129c88b'/>
<id>urn:sha1:b1430fb7ca499d517d9f4b3b6c5a81442129c88b</id>
<content type='text'>
This PR will fix some typos detected by [typos].

I only picked the ones I was sure were spelling errors to fix, mostly in
the comments.

[typos]: https://github.com/crate-ci/typos
</content>
</entry>
<entry>
<title>Adjust cfgs</title>
<updated>2022-08-12T20:28:15+00:00</updated>
<author>
<name>Mark Rousskov</name>
<email>mark.simulacrum@gmail.com</email>
</author>
<published>2022-08-09T13:56:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=154a09dd913edc7db698b8a7230c720a8f0baa74'/>
<id>urn:sha1:154a09dd913edc7db698b8a7230c720a8f0baa74</id>
<content type='text'>
</content>
</entry>
<entry>
<title>lint: add bad opt access internal lint</title>
<updated>2022-07-27T10:24:27+00:00</updated>
<author>
<name>David Wood</name>
<email>david.wood@huawei.com</email>
</author>
<published>2022-07-25T12:02:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7bab769b58db292721ddcb73cc6a7e56cb2b08ab'/>
<id>urn:sha1:7bab769b58db292721ddcb73cc6a7e56cb2b08ab</id>
<content type='text'>
Some command-line options accessible through `sess.opts` are best
accessed through wrapper functions on `Session`, `TyCtxt` or otherwise,
rather than through field access on the option struct in the `Session`.

Adds a new lint which triggers on those options that should be accessed
through a wrapper function so that this is prohibited. Options are
annotated with a new attribute `rustc_lint_opt_deny_field_access` which
can specify the error message (i.e. "use this other function instead")
to be emitted.

A simpler alternative would be to simply rename the options in the
option type so that it is clear they should not be used, however this
doesn't prevent uses, just discourages them. Another alternative would
be to make the option fields private, and adding accessor functions on
the option types, however the wrapper functions sometimes rely on
additional state from `Session` or `TyCtxt` which wouldn't be available
in an function on the option type, so the accessor would simply make the
field available and its use would be discouraged too.

Signed-off-by: David Wood &lt;david.wood@huawei.com&gt;
</content>
</entry>
<entry>
<title>Rename `debugging_opts` to `unstable_opts`</title>
<updated>2022-07-13T22:47:06+00:00</updated>
<author>
<name>Joshua Nelson</name>
<email>jnelson@cloudflare.com</email>
</author>
<published>2022-07-06T12:44:47+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3c9765cff18a3c4ba2962ea59d4c3f6966f9700c'/>
<id>urn:sha1:3c9765cff18a3c4ba2962ea59d4c3f6966f9700c</id>
<content type='text'>
This is no longer used only for debugging options (e.g. `-Zoutput-width`, `-Zallow-features`).
Rename it to be more clear.
</content>
</entry>
<entry>
<title>Add support for values() with --check-cfg</title>
<updated>2022-03-03T11:00:28+00:00</updated>
<author>
<name>Loïc BRANSTETT</name>
<email>lolo.branstett@numericable.fr</email>
</author>
<published>2022-02-25T12:43:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=50e61a1a667929d0db91132246e61c1a67ab07af'/>
<id>urn:sha1:50e61a1a667929d0db91132246e61c1a67ab07af</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rename ErrorReported -&gt; ErrorGuaranteed</title>
<updated>2022-03-02T15:45:25+00:00</updated>
<author>
<name>mark</name>
<email>markm@cs.wisc.edu</email>
</author>
<published>2022-01-23T18:34:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=e489a94deef3d41513fe4254804d730f0fd6cbc0'/>
<id>urn:sha1:e489a94deef3d41513fe4254804d730f0fd6cbc0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #93368 - eddyb:diagbld-guarantee, r=estebank</title>
<updated>2022-02-25T00:46:04+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2022-02-25T00:46:04+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=d4de1f230ca30b7ce08fbf453daebf8b2e7ffcc9'/>
<id>urn:sha1:d4de1f230ca30b7ce08fbf453daebf8b2e7ffcc9</id>
<content type='text'>
rustc_errors: let `DiagnosticBuilder::emit` return a "guarantee of emission".

That is, `DiagnosticBuilder` is now generic over the return type of `.emit()`, so we'll now have:
* `DiagnosticBuilder&lt;ErrorReported&gt;` for error (incl. fatal/bug) diagnostics
  * can only be created via a `const L: Level`-generic constructor, that limits allowed variants via a `where` clause, so not even `rustc_errors` can accidentally bypass this limitation
  * asserts `diagnostic.is_error()` on emission, just in case the construction restriction was bypassed (e.g. by replacing the whole `Diagnostic` inside `DiagnosticBuilder`)
  * `.emit()` returns `ErrorReported`, as a "proof" token that `.emit()` was called
    (though note that this isn't a real guarantee until after completing the work on
     #69426)
* `DiagnosticBuilder&lt;()&gt;` for everything else (warnings, notes, etc.)
  * can also be obtained from other `DiagnosticBuilder`s by calling `.forget_guarantee()`

This PR is a companion to other ongoing work, namely:
* #69426
  and it's ongoing implementation:
  #93222
  the API changes in this PR are needed to get statically-checked "only errors produce `ErrorReported` from `.emit()`", but doesn't itself provide any really strong guarantees without those other `ErrorReported` changes
* #93244
  would make the choices of API changes (esp. naming) in this PR fit better overall

In order to be able to let `.emit()` return anything trustable, several changes had to be made:
* `Diagnostic`'s `level` field is now private to `rustc_errors`, to disallow arbitrary "downgrade"s from "some kind of error" to "warning" (or anything else that doesn't cause compilation to fail)
  * it's still possible to replace the whole `Diagnostic` inside the `DiagnosticBuilder`, sadly, that's harder to fix, but it's unlikely enough that we can paper over it with asserts on `.emit()`
* `.cancel()` now consumes `DiagnosticBuilder`, preventing `.emit()` calls on a cancelled diagnostic
  * it's also now done internally, through `DiagnosticBuilder`-private state, instead of having a `Level::Cancelled` variant that can be read (or worse, written) by the user
  * this removes a hazard of calling `.cancel()` on an error then continuing to attach details to it, and even expect to be able to `.emit()` it
  * warnings were switched to *only* `can_emit_warnings` on emission (instead of pre-cancelling early)
  * `struct_dummy` was removed (as it relied on a pre-`Cancelled` `Diagnostic`)
* since `.emit()` doesn't consume the `DiagnosticBuilder` &lt;sub&gt;(I tried and gave up, it's much more work than this PR)&lt;/sub&gt;,
  we have to make `.emit()` idempotent wrt the guarantees it returns
  * thankfully, `err.emit(); err.emit();` can return `ErrorReported` both times, as the second `.emit()` call has no side-effects *only* because the first one did do the appropriate emission
* `&amp;mut Diagnostic` is now used in a lot of function signatures, which used to take `&amp;mut DiagnosticBuilder` (in the interest of not having to make those functions generic)
  * the APIs were already mostly identical, allowing for low-effort porting to this new setup
  * only some of the suggestion methods needed some rework, to have the extra `DiagnosticBuilder` functionality on the `Diagnostic` methods themselves (that change is also present in #93259)
  * `.emit()`/`.cancel()` aren't available, but IMO calling them from an "error decorator/annotator" function isn't a good practice, and can lead to strange behavior (from the caller's perspective)
  * `.downgrade_to_delayed_bug()` was added, letting you convert any `.is_error()` diagnostic into a `delay_span_bug` one (which works because in both cases the guarantees available are the same)

This PR should ideally be reviewed commit-by-commit, since there is a lot of fallout in each.

r? `@estebank` cc `@Manishearth` `@nikomatsakis` `@mark-i-m`
</content>
</entry>
<entry>
<title>Continue improvements on the --check-cfg implementation</title>
<updated>2022-02-23T12:22:23+00:00</updated>
<author>
<name>Loïc BRANSTETT</name>
<email>lolo.branstett@numericable.fr</email>
</author>
<published>2022-02-20T00:26:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8d3de56da1eba68d012977d4c743d5eaaa1baee8'/>
<id>urn:sha1:8d3de56da1eba68d012977d4c743d5eaaa1baee8</id>
<content type='text'>
- Test the combinations of --check-cfg with partial values() and --cfg
- Test that we detect unexpected value when none are expected
</content>
</entry>
<entry>
<title>rustc_errors: take `self` by value in `DiagnosticBuilder::cancel`.</title>
<updated>2022-02-23T06:08:06+00:00</updated>
<author>
<name>Eduard-Mihai Burtescu</name>
<email>eddyb@lyken.rs</email>
</author>
<published>2022-01-26T03:39:14+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0b9d70cf6d47df456280f83b58c04c96aa58e89e'/>
<id>urn:sha1:0b9d70cf6d47df456280f83b58c04c96aa58e89e</id>
<content type='text'>
</content>
</entry>
</feed>
