<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_lint/src/lib.rs, branch 1.76.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.76.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.76.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2024-01-24T08:55:16+00:00</updated>
<entry>
<title>Revert "Auto merge of #118133 - Urgau:stabilize_trait_upcasting, r=WaffleLapkin"</title>
<updated>2024-01-24T08:55:16+00:00</updated>
<author>
<name>Oli Scherer</name>
<email>git-spam-no-reply9815368754983@oli-obk.de</email>
</author>
<published>2024-01-22T12:23:50+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=166fb652e4150eda7132293a2e293911a99ed1f3'/>
<id>urn:sha1:166fb652e4150eda7132293a2e293911a99ed1f3</id>
<content type='text'>
This reverts commit 6d2b84b3ed7848fd91b8d6151d4451b3103ed816, reversing
changes made to 73bc12199ea8c7651ed98b069c0dd6b0bb5fabcf.
</content>
</entry>
<entry>
<title>Remove the lint outright</title>
<updated>2023-12-16T01:28:06+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2023-11-16T20:19:03+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=32907c72ebd7e20a5d232a6bcb4d8e2fac985888'/>
<id>urn:sha1:32907c72ebd7e20a5d232a6bcb4d8e2fac985888</id>
<content type='text'>
</content>
</entry>
<entry>
<title>remove redundant imports</title>
<updated>2023-12-10T02:56:22+00:00</updated>
<author>
<name>surechen</name>
<email>chenshuo17@huawei.com</email>
</author>
<published>2023-11-10T02:11:24+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=40ae34194c586eea3614d3216322053d2e8e7b37'/>
<id>urn:sha1:40ae34194c586eea3614d3216322053d2e8e7b37</id>
<content type='text'>
detects redundant imports that can be eliminated.

for #117772 :

In order to facilitate review and modification, split the checking code and
removing redundant imports code into two PR.
</content>
</entry>
<entry>
<title>Rollup merge of #118158 - nnethercote:reduce-fluent-boilerplate, r=compiler-errors</title>
<updated>2023-11-25T22:23:33+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2023-11-25T22:23:33+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=3b2f33ee28038d51dc479b2f8ec07bed8e01d012'/>
<id>urn:sha1:3b2f33ee28038d51dc479b2f8ec07bed8e01d012</id>
<content type='text'>
Reduce fluent boilerplate

Best reviewed one commit at a time.

r? `@davidtwco`
</content>
</entry>
<entry>
<title>Use `rustc_fluent_macro::fluent_messages!` directly.</title>
<updated>2023-11-25T21:38:40+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-11-21T22:53:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=57cd5e6551ffcd071aa0496f9b8c0ed28dca7ffe'/>
<id>urn:sha1:57cd5e6551ffcd071aa0496f9b8c0ed28dca7ffe</id>
<content type='text'>
Currently we always do this:
```
use rustc_fluent_macro::fluent_messages;
...
fluent_messages! { "./example.ftl" }
```
But there is no need, we can just do this everywhere:
```
rustc_fluent_macro::fluent_messages! { "./example.ftl" }
```
which is shorter.
</content>
</entry>
<entry>
<title>Avoid need for `{D,Subd}iagnosticMessage` imports.</title>
<updated>2023-11-25T21:38:00+00:00</updated>
<author>
<name>Nicholas Nethercote</name>
<email>n.nethercote@gmail.com</email>
</author>
<published>2023-11-21T22:22:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a733082be9962317e41f357a9708632a759c28b2'/>
<id>urn:sha1:a733082be9962317e41f357a9708632a759c28b2</id>
<content type='text'>
The `fluent_messages!` macro produces uses of
`crate::{D,Subd}iagnosticMessage`, which means that every crate using
the macro must have this import:
```
use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage};
```

This commit changes the macro to instead use
`rustc_errors::{D,Subd}iagnosticMessage`, which avoids the need for the
imports.
</content>
</entry>
<entry>
<title>rustc_session: implement latent TODO</title>
<updated>2023-11-22T19:37:12+00:00</updated>
<author>
<name>Tamir Duberstein</name>
<email>tamird@gmail.com</email>
</author>
<published>2023-11-17T20:24:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=55393b6eca0c203b03b76447e42af0bd1d06204d'/>
<id>urn:sha1:55393b6eca0c203b03b76447e42af0bd1d06204d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Auto merge of #112380 - jieyouxu:useless-bindings-lint, r=WaffleLapkin</title>
<updated>2023-11-22T14:03:16+00:00</updated>
<author>
<name>bors</name>
<email>bors@rust-lang.org</email>
</author>
<published>2023-11-22T14:03:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=73bc12199ea8c7651ed98b069c0dd6b0bb5fabcf'/>
<id>urn:sha1:73bc12199ea8c7651ed98b069c0dd6b0bb5fabcf</id>
<content type='text'>
Add allow-by-default lint for unit bindings

### Example

```rust
#![warn(unit_bindings)]

macro_rules! owo {
    () =&gt; {
        let whats_this = ();
    }
}

fn main() {
    // No warning if user explicitly wrote `()` on either side.
    let expr = ();
    let () = expr;
    let _ = ();

    let _ = expr; //~ WARN binding has unit type
    let pat = expr; //~ WARN binding has unit type
    let _pat = expr; //~ WARN binding has unit type

    // No warning for let bindings with unit type in macro expansions.
    owo!();

    // No warning if user explicitly annotates the unit type on the binding.
    let pat: () = expr;
}
```

outputs

```
warning: binding has unit type `()`
  --&gt; $DIR/unit-bindings.rs:17:5
   |
LL |     let _ = expr;
   |     ^^^^-^^^^^^^^
   |         |
   |         this pattern is inferred to be the unit type `()`
   |
note: the lint level is defined here
  --&gt; $DIR/unit-bindings.rs:3:9
   |
LL | #![warn(unit_bindings)]
   |         ^^^^^^^^^^^^^

warning: binding has unit type `()`
  --&gt; $DIR/unit-bindings.rs:18:5
   |
LL |     let pat = expr;
   |     ^^^^---^^^^^^^^
   |         |
   |         this pattern is inferred to be the unit type `()`

warning: binding has unit type `()`
  --&gt; $DIR/unit-bindings.rs:19:5
   |
LL |     let _pat = expr;
   |     ^^^^----^^^^^^^^
   |         |
   |         this pattern is inferred to be the unit type `()`

warning: 3 warnings emitted
```

This lint is not triggered if any of the following conditions are met:

- The user explicitly annotates the binding with the `()` type.
- The binding is from a macro expansion.
- The user explicitly wrote `let () = init;`
- The user explicitly wrote `let pat = ();`. This is allowed for local lifetimes.

### Known Issue

It is known that this lint can trigger on some proc-macro generated code whose span returns false for `Span::from_expansion` because e.g. the proc-macro simply forwards user code spans, and otherwise don't have distinguishing syntax context compared to non-macro-generated code. For those kind of proc-macros, I believe the correct way to fix them is to instead emit identifers with span like `Span::mixed_site().located_at(user_span)`.

Closes #71432.
</content>
</entry>
<entry>
<title>Add allow-by-default lint for unit bindings</title>
<updated>2023-11-20T03:45:44+00:00</updated>
<author>
<name>许杰友 Jieyou Xu (Joe)</name>
<email>jieyouxu@outlook.com</email>
</author>
<published>2023-06-13T16:19:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8da09aed94e0c407f3c82450fa8268e6bff0f71b'/>
<id>urn:sha1:8da09aed94e0c407f3c82450fa8268e6bff0f71b</id>
<content type='text'>
This lint is not triggered if any of the following conditions are met:

- The user explicitly annotates the binding with the `()` type.
- The binding is from a macro expansion.
- The user explicitly wrote `let () = init;`
- The user explicitly wrote `let pat = ();`. This is allowed for local
  lifetimes.
</content>
</entry>
<entry>
<title>Remove --check-cfg checking of --cfg args</title>
<updated>2023-11-18T11:21:58+00:00</updated>
<author>
<name>Urgau</name>
<email>urgau@numericable.fr</email>
</author>
<published>2023-11-02T16:05:28+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f5023e4c76e6af7720fe3e75236d519140190d19'/>
<id>urn:sha1:f5023e4c76e6af7720fe3e75236d519140190d19</id>
<content type='text'>
</content>
</entry>
</feed>
