---
title: "Triage meeting 2024-02-21"
tags: ["T-lang", "triage-meeting", "minutes"]
date: 2024-02-21
discussion: https://rust-lang.zulipchat.com/#narrow/stream/410673-t-lang.2Fmeetings/topic/Triage.20meeting.202024-02-21
url: https://hackmd.io/_cTHAPiqTFOPwLcJ9IHiLw
---
# T-lang meeting agenda
- Meeting date: 2024-02-21
## Attendance
- People: TC, tmandry, CE, Josh, Santiago, Adrian Taylor, Urgau, Mara, eholk, bstrie
## Meeting roles
- Minutes, driver: TC
## Scheduled meetings
- 2024-02-21: "Discuss feedback for T-spec sample chapters" [#250](https://github.com/rust-lang/lang-team/issues/250)
- 2024-02-28: "Discuss arbitrary self types v2 RFC" [#254](https://github.com/rust-lang/lang-team/issues/254)
Edit the schedule here: https://github.com/orgs/rust-lang/projects/31/views/7.
## Announcements or custom items
(Meeting attendees, feel free to add items here!)
### Moving right along
TC: Last week, as I mentioned at the start of the meeting, I pushed the triage meeting along a bit faster than usual. The results were as follows:
- We discussed 12 matters.
- We proposed 5 FCPs.
- Of those, 4 actually moved into FCP.
- We scheduled 1 meeting (which we had later that week).
- We checked an awful lot of boxes.
In terms of output, that's quite a lot more than usual. But I want to be sure we were happy with it. Striking the right balance is challenging (we need those dials they use for focus groups to indicate "faster" or "slower").
TC: Here's an idea: if I'm moving it along and you need a moment, please just raise your hand in the conference and we'll stop until you're ready to move on.
tmandry: Last week felt good.
JT: Happy with how much we got done last week. Did feel a bit rushed in terms of the gaps between items to figure out if there are any issues. Happy to see it tuned over time.
### Duration of design meetings
TC: We've talked about making these 90 minutes. The last meeting (on temporary lifetimes) went as well as possible (we finished reading at about 25 minutes and discussion moved along briskly) and we still just wasn't enough time. It seems likely that next week's topic (arbitrary self types) will also be at risk of that.
TC: Do we want to make this 90 minutes? If so, do we want to start half an hour earlier or go half an hour later?
TC: For half an hour earlier, TC, JT, tmandry, and pnkfelix indicated availability.
Josh: Have some indication that we may want to move the T-libs meeting into the slot half an hour earlier.
Mara: We could move the T-libs call.
*Consensus*: We need more people here to make progress on this.
### RTN
TC: We had a call on Friday in which we resolved the semantics concerns regarding RTN:
https://hackmd.io/Yne6UYvkRTiEv5OZspCfxw
The consensus was as follows:
*Consensus on semantic concerns*: We'll try to ship trait aliases (but not necessarily implementable trait aliases) concurrently with RTN (but we'll reevaluate if those are taking too long), and we'll ship RTN with a warn-by-default lint against the direct use of RTN in the bounds of a reachable crate-level public interface (e.g. function, method, type (or type alias), trait, etc.) except for a trait alias.
*Outcome on syntax concerns*: We did not discuss the syntax concerns. Those are still blocking, and we'll try to resolve those asynchronously. We'll check in at the next triage meeting how that is going.
On the syntax question, we opened a thread to discuss that asynchronously:
https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/RTN.20syntax
TC: Anything we want to add here? Do we want to schedule a call?
Josh: We may in the end set up a call to bring together the feedback, but I don't think we have sufficient team quorum to determine that yet.
## Rust 2024 review
Project board: https://github.com/orgs/rust-lang/projects/43/views/5
### Tracking Issue for Lifetime Capture Rules 2024 (RFC 3498) #117587
**Link:** https://github.com/rust-lang/rust/issues/117587
TC: We accepted the RFC but it has a dependency on some means of expressing precise capturing. That probably means stabilizing TAIT. We're starting with stabilizing ATPIT, and we've now posted the stabilization report and PR for that which is now in proposed FCP. This is also nominated, so let's discuss it further there.
### Reserve gen keyword in 2024 edition for Iterator generators #3513
**Link:** https://github.com/rust-lang/rfcs/pull/3513
TC: Oli is back, and we're all working on this. The minimum we need to do for 2024 is to reserve the keyword.
TC: Both `gen` and `async gen` blocks work today in nightly Rust. It might be worth giving these a try, along with concurrent work on async closures, if you haven't yet. E.g.:
```toml
cargo-features = ["edition2024"]
[package]
edition = "2024"
```
```rust
#![feature(async_closure)]
#![feature(async_iterator)]
#![feature(gen_blocks)]
use core::{async_iter::{AsyncIterator, IntoAsyncIterator},
future::{poll_fn, ready}, pin::pin};
async fn f<F: async Fn() -> u8>(f: F) -> u8 { f().await }
async fn g<G: IntoAsyncIterator<Item = u8>>(g: G) -> Option<u8> {
let mut g = pin!(g.into_async_iter());
poll_fn(|cx| g.as_mut().poll_next(cx)).await
}
fn main() {
f(async || ready(42u8).await);
g(async gen {
yield 42u8;
});
}
```
Josh: I expect to have feedback on `gen fn`, but have no concerns with `gen` or `async gen` blocks as proposed. But in any case we definitely have enough ready to justify reserving the keyword.
Josh: Let's kick off an FCP on reserving the keyword. I'll do that. Worth noting that `yield` is already a keyword.
### Tracking issue for promoting `!` to a type (RFC 1216) #35121
**Link:** https://github.com/rust-lang/rust/issues/35121
TC: The never type is still living up to its name. There's been a long discussion on Zulip. This is what we had been hoping to lint against:
```rust
fn never_type_fallback() { unsafe {
if false { panic!() } else { transmute::<_, _ /* ?0 */>(()) }
// later in fallback: ?0 := ()
// after ! stabilization: ?0 := !
}}
```
TC: My read of the situation is that this would be a good topic for a design document and a design meeting.
TC: Waffle, Nadri, and Mark Simulacrum seem to be the key people here.
tmandry: +1 this would make a good design meeting. It'd be a good forcing function.
## Nominated RFCs, PRs, and issues
### "Stabilize associated type position impl Trait (ATPIT)" rust#120700
**Link:** https://github.com/rust-lang/rust/pull/120700
TC: Wesley Wiser raised a concern, which tmandry relayed, that rust-analyzer does not support ATPIT (and gave a spurious error due to it).
TC: I asked the r-a folks about this. This prompted them to fix the spurious error, but they also indicated that 1) they probably won't have the bandwidth needed to implement the feature generally for an unbounded amount of time and therefore that 2) it would be unreasonable to wait on them for this.
TC: This resolved Wesley's immediate concern (though he'd still prefer to have full r-a support first).
tmandry: I've gone ahead and resolved the concern.
tmandry: In general, waiting for r-a support feels like too much of a potential blocker.
Josh: Agreed that we shouldn't in general wait for r-a to ship support, but I do in general that r-a has objections that we should hear those out.
---
TC: Separately, last week we made this a dual FCP with T-types. This makes it more important that everyone checks boxes. On the lang side, we have checkboxes current from NM, tmandry, scottmcm, JT (thanks!) and need review from pnkfelix.
---
TC: On the T-types side, we (Oli, CE, and myself) have had extensive discussions with lcnr, and we have a concrete plan on how to move forward that involves some data collection, verifying the behavior in some edge cases, and either shipping new solver coherence first or implementing a fix in the old solver.
CE: +1. We found a good path here to make this good with respect to the new solver.
### "Consider linting against 00B7 aka interpunct aka middle dot" rust#120797
**Link:** https://github.com/rust-lang/rust/issues/120797
TC: The question, nominated by pnkfelix, is what to do about this:
```rust
#![allow(dead_code)]
#![deny(uncommon_codepoints)]
const COL·LECCIÓ: () = ();// This is Catalan
// The below is not allowed by the lexer today...
// const ·START: () = ();
// ... but this is allowed today ...
const MID·DLE: () = ();
// ... and this is also allowed today
const END·: () = ();
fn main() {
println!("{}", r#"
COL·LECCIÓ
·START
MID·DLE
END·
"#)
}
```
TC: pnkfelix gives these options:
> 1. Leave things as they are (00B7 is hard-rejected as an initial character, and silently accepted in all other contexts)
> 2. Adopt something like what was proposed in PR [`uncommon_codepoints`: lint against 00B7 MIDDLE DOT in final position #120695](https://github.com/rust-lang/rust/pull/120695): continue hard-rejecting 00B7 as an initial character; lint against its occurrence as a final character, and silently accept it as a "medial" character
> 3. Something more aggressive than PR [`uncommon_codepoints`: lint against 00B7 MIDDLE DOT in final position #120695](https://github.com/rust-lang/rust/pull/120695), like linting against 00B7 in all contexts (except perhaps when it occurs in between two L's, to accommodate Catalan, as suggested by Manish [here](https://github.com/rust-lang/rust/pull/120695#issuecomment-1932984685))
> 4. Other options? (We probably don't get any benefit from deviating far from Unicode committee recommendations, so we probably do not want to start _accepting_ 00B7 as an initial character)
TC: We tabled this last week. The substantive discussion was:
> JT: I don't want us to adopt language-specific rules, though. But I think we can lint against it at end position.
>
> pnkfelix: On the one hand, I want to forbid this everywhere, but on the other, that seems to unfairly bias against this language.
TC: What do we think?
tmandry: I'm not sure I understand the motivation here.
JT: It's because it could look like operative punctuation, i.e. a normal dot (`receiver.method()`. We have similar lints about smart quotes.
tmandry: It's hard to weigh the tradeoffs. It seems like we may be speculating a bit here.
CE: Someone saw this when looking through the code and spotted this inconsistency.
JT: Looking now, TR39 does spell this out as an exception.
CE: TR39 notes that it should only be discouraged at the end of an identifier and should otherwise be allowed.
CE: There are other identifiers that Unicode puts in this class that we do not have in our exclusion set.
CE: These points were noted in the PR that pnkfelix closed:
https://github.com/rust-lang/rust/pull/120695#issuecomment-1929657945
tmandry: I'd fine with following the Unicode recommendations.
CE: I don't think we should be linting against middle dot at all. Maybe there should be a lint against some broader set of characters in trailing position of identifiers. There's an issue that Manish opened about splitting out uncommon code points into several different diagnostics:
https://github.com/rust-lang/rust/issues/120228
JT: Clearly, in splitting it out that way, that first item is where it should go if we had it at all.
tmandry: If Manish is questioning the premise of this PR, maybe we should table this.
TC: Proposed: let's FCP to not lint against it at all and note the further work to be done here.
Josh: Proposal variation: let's FCP not linting against it under the uncomment code points lint.
TC: Sounds good. Let's FCP it here:
https://github.com/rust-lang/rust/issues/120797
### "Implement `PartialOrd` and `Ord` for `Discriminant`" rust#106418
**Link:** https://github.com/rust-lang/rust/pull/106418
TC: This has been on and off our radar. @scottmcm in particular has strong concerns about this that he first raised 5 years ago.
scottmcm:
> I remain strongly opposed to anything that makes it *impossible* for a library author to leave open the door to reorder their enum variants later.
https://github.com/rust-lang/rust/pull/106418#pullrequestreview-1594299402
TC: Recently, T-libs-api decided to move forward on this:
> We discussed this PR in today's T-libs-api meeting. Among the team members in the meeting (myself, Amanieu, Josh, Mara), we were still on board with unconditional Ord and PartialOrd impls; no need for a marker trait. Our approvals for the FCP are registered in [#106418 (comment)](https://github.com/rust-lang/rust/pull/106418#issuecomment-1679322224).
>
> Exposing the discriminant order is the intended behavior. The documentation on `mem::discriminant` mentions that changing the definition of the enum can impact the order of discriminant values, and cites the Reference for detail on how discriminant values are assigned. Amanieu summarized the stability contract as being similar to transmute — the extent to which a caller gets to rely on particular properties across library versions is up to a contract between the caller and library author.
TC: tmandry has filed a concern:
> Is it important that the discriminant order remain the same between different versions of the compiler? If not I'd like to document that it could change, and left a suggestion to that effect.
>
> @rfcbot concern stability wrt compiler version
>
> Otherwise this proposal looks good to me. Thanks for pushing it through.
TC: What do we think?
tmandry: I'm thinking of scenarios where we might want to rearrange the discriminants for one reason or another, e.g. for performance optimization.
*Consensus*: Let's wait for scottmcm here.
### "`is` operator for pattern-matching and binding" rfcs#3573
**Link:** https://github.com/rust-lang/rfcs/pull/3573
TC: Josh proposes for us that we should accept:
```rust
if an_option is Some(x) && x > 3 {
println!("{x}");
}
```
And:
```rust
func(x is Some(y) && y > 3);
```
TC: The main topic discussed in the issue thread so far has been the degree to which Rust should have "two ways to do things". Probably the more interesting issue is how the binding and drop scopes for this should work.
TC: What do we think, as a gut check?
Josh: This has been framed in the past as either-or with respect to let chaining, but I'm proposing that we do both.
tmandry: What stops us from shipping let chains today?
Josh: It's a couple of bug fixes and otherwise it seems ready.
tmandry: Other than the edition, we should prioritize this. It seems important to people.
Josh: +1, in case people hadn't seen it it's one of the items on the survey that people want to see stabilized.
tmandry: With respect to `is`, we probably want to stabilize let chains and let that settle for a bit first. I'd like to see how this feels by rewriting code and giving it a try.
tmandry: I do share the concern about having too many ways to do things. We probably should be guiding people better.
Mara: The only time-sensitive decision is reserving the keyword, right?
Josh: We generally want to know that we want to do it first though.
bstrie: As a side note, I'm happy to help in writing RFCs or doing other things to push the edition along.
### "Tracking Issue for `core::mem::variant_count`" rust#73662
**Link:** https://github.com/rust-lang/rust/issues/73662
TC: We discussed this back in 2022, per Josh:
> This seems like it fits in with a broader story of enums, including things like `AsRepr`.
>
> In the absence of those, we're not sure if we want to have this function in its current state.
Josh now renominates this for us:
> Nominating this for lang, because empirically we've stalled out on a potentially useful library addition on the basis of proposed lang features, which themselves seem to have stalled out.
>
> I'd love to see `AsRepr` if someone wants to pick that back up and get it over the finish line. But also, this might be a reasonable interim step, and it doesn't seem like it does any _harm_ to have it even if we add better solutions in the future.
TC: What do we think?
Josh: We had, at the time, some other proposals on the table. So our sentiment was to ask that someone would summarize these and propose how to move forward. The result was for everything to stall out. I'm still very enthusiastic about `AsRepr`. We shouldn't block this on future lang items.
Josh: Proposal: we make it clear that this isn't blocked on any future lang work. If we do that, and resolve the lang blocker, then I'll renominate this for T-libs-api.
Josh: Someone recently brought up how sad it was that this had stalled.
Mara: I don't personally see this specific API passing T-libs-api right now. Maybe the more interesting lang question is how much information about enums that lang is comfortable exposing through an API in core.
TC: This probably once again needs scottmcm.
### "Propagate temporary lifetime extension into if and match." rust#121346
**Link:** https://github.com/rust-lang/rust/pull/121346
TC: Mara nominates this for us:
> This PR makes this work:
>
> ```rust
> let a = if true {
> ..;
> &temp() // used to error, but now gets lifetime extended
> } else {
> unreachable!()
> };
> ```
>
> and
>
> ```rust
> let a = match () {
> _ => {
> ..;
> &temp() // used to error, but now gets lifetime extended
> }
> };
> ```
>
> to make it consistent with:
>
> ```rust
> let a = {
> ..;
> &temp() // lifetime is extended
> };
> ```
>
> This is one small part of [the temporary lifetimes work](https://github.com/rust-lang/lang-team/issues/253).
>
> This part is backwards compatible (so doesn't need be edition-gated), because all code affected by this change previously resulted in a hard error.
TC: What do we think?
Mara: We already do this for plain blocks and this extends it to these cases also.
TC: Another similar case here would be temporary lifetime extension in breaking with a value from a loop.
Mara: That could indeed be a separate PR.
TC: Do we want to propose FCP merge?
tmandry: This seems like extending part of the language to work like another aspect of the language. So +1 on that. Go ahead and check my box.
Josh: I'll propose FCP.
(The meeting ended here.)
### "Tracking issue for function attribute `#[no_coverage]`" rust#84605
**Link:** https://github.com/rust-lang/rust/issues/84605
TC: This is about stabilizing a `#[coverage(off)]` attribute to exclude items from `-Z instrument-coverage`.
Josh proposed FCP merge and nominated this for us.
There are two open questions about applying this automatically to nested functions and to inlined functions.
TC: What do we think?
### "Should Rust still ignore SIGPIPE by default?" rust#62569
**Link:** https://github.com/rust-lang/rust/issues/62569
TC: Prior to `main()` being executed, the Rust startup code makes a syscall to change the handling of `SIGPIPE`. Many believe that this is wrong thing for a low-level language like Rust to do, because 1) it makes it impossible to recover what the original value was, and 2) means things like `seccomp` filters must be adjusted for this.
It's also just, in a practical sense, wrong for most CLI applications.
This seems to have been added back when Rust had green threads and then forgotten about. But it's been an ongoing footgun.
There was discussion in 2019 about fixing this over an edition, but nothing came of it.
TC: Are we interested in fixing it over this one?
### "Stabilize `#[unix_sigpipe = "sig_dfl"]` on `fn main()`" rust#120832
**Link:** https://github.com/rust-lang/rust/pull/120832
TC: This is related to the above, and is a proposal to stabilize an option to have the startup code set `SIGPIPE` to the *other* handler. However, this does not address the problem that the Rust startup code is making this syscall at all, which means that e.g. `seccomp` filters must be correctly adjusted and it's still impossible to recover the original inherited setting of this handler.
There are also the following options to this attribute that are not proposed for stabilization here:
- `sig_ign`: This is the current default behavior.
- `inherent`: This would prevent the startup code from making this syscall at all.
TC: What do we think?
### "offset: allow zero-byte offset on arbitrary pointers" rust#117329
**Link:** https://github.com/rust-lang/rust/pull/117329
TC: RalfJ nominates this for us:
> Nominating for t-lang discussion. This implements the t-opsem consensus from [rust-lang/opsem-team#10](https://github.com/rust-lang/opsem-team/issues/10), [rust-lang/unsafe-code-guidelines#472](https://github.com/rust-lang/unsafe-code-guidelines/issues/472) to generally allow zero-sized accesses on all pointers. Also see the [tracking issue](https://github.com/rust-lang/rust/issues/117945).
>
> * Zero-sized reads and writes are allowed on all sufficiently aligned pointers, including the null pointer
> * Inbounds-offset-by-zero is allowed on all pointers, including the null pointer
> * `offset_from` on two pointers is always allowed when they have the same address (but see the caveat below)
>
> This means the following function is safe to be called on any pointer:
>
> ```rust
> fn test_ptr(ptr: *mut ()) { unsafe {
> // Reads and writes.
> let mut val = *ptr;
> *ptr = val;
> ptr.read();
> ptr.write(());
> // Memory access intrinsics.
> // - memcpy (1st and 2nd argument)
> ptr.copy_from_nonoverlapping(&(), 1);
> ptr.copy_to_nonoverlapping(&mut val, 1);
> // - memmove (1st and 2nd argument)
> ptr.copy_from(&(), 1);
> ptr.copy_to(&mut val, 1);
> // - memset
> ptr.write_bytes(0u8, 1);
> // Offset.
> let _ = ptr.offset(0);
> let _ = ptr.offset(1); // this is still 0 bytes
> // Distance.
> let ptr = ptr.cast::<i32>();
> ptr.offset_from(ptr);
> } }
> ```
>
> Some specific concerns warrant closer scrutiny.
>
> ## LLVM 16
>
> We currently still support LLVM 16, which does not yet have the patches that make `getelementptr inbounds` always well-defined for offset 0. The function above thus generates LLVM IR with UB. No known miscompilations arise from that, and my attempt at just removing the `inbounds` annotation on old versions of LLVM failed (I got segfaults, and Nikic [suggested](https://github.com/rust-lang/rust/pull/117329#issuecomment-1783925317) that keeping these attribute around is actually less risky than removing them). If we want to avoid this, we have to wait until support for LLVM 16 can be dropped (which apparently is in May).
>
> ## Null pointers
> t-opsem decided to allow zero-sized reads and writes on null pointers. This is mostly for consistency: we definitely want to allow zero-sized offsets on null pointers (`ptr::null::<T>().offset(0)`), since this is allowed in C++ (and a proposal is being made to allow it in C) and there's no reason for us to have more UB than C++ here. But if we allow this, and therefore consider the null pointer to have a zero-sized region of "inbounds" memory, then it would be inconsistent to not allow reading from / writing to that region.
>
> ## `offset_from`
>
> This operation is somewhat special as it takes two pointers. We do want `test_ptr` above to be defined on all pointers, so `offset_from` between two identical pointers without provenance must be allowed. But we also want to achieve this property called "provenance monotonicity", whereby adding arbitrary provenance to any no-provenance pointer must never make the program UB.[1](#user-content-fn-mono-e335860ede81d9f8aeed856dbd25a8e3) From these two it follows that calling `offset_from` with two pointers with the same address but arbitrary different provenance must be allowed. This does have some [minor downsides](https://github.com/rust-lang/unsafe-code-guidelines/issues/472#issuecomment-1921686682). So my proposal (and this goes beyond what t-opsem agreed on) is to define the `ptr_offset_from` intrinsic to satisfy provenance monotonicity, but to document the user-facing `ptr.offset_from(...)` as requiring either two pointers without provenance or two pointers with provenance for the same allocation -- therefore, making the case of provenance mismatch library UB, but not language UB.
>
> ## Footnotes
>
> 1. This property should hopefully make some intuitive sense, and it is also crucial to justify optimizations that make the program have more provenance than before -- such as optimizing away provenance-stripping operations. Specifically, `*ptr = *ptr` where `ptr: *mut usize` is likely going to be a provenance-stripping operation, and so optimizing away this redundant assignment requires provenance monotonicity. [↩](#user-content-fnref-mono-e335860ede81d9f8aeed856dbd25a8e3)
### "Let's `#[expect]` some lints: Stabilize `lint_reasons` (RFC 2383) " rust#120924
**Link:** https://github.com/rust-lang/rust/pull/120924
TC: Since the last time this was proposed for stabilization, various unresolved questions have now been resolved, so this is being proposed again.
> Hey everyone, with the `#[expect]` implementation done, I'd like to propose stabilizing this feature. I've crated two stabilization PRs, one updating the documentation and one removing the feature from rustc:
>
> * [Let's `#[expect]` some lints: Stabilize `lint_reasons` (RFC 2383) #120924](https://github.com/rust-lang/rust/pull/120924)
> * [Document new `#[expect]` attribute and `reasons` parameter (RFC 2383) reference#1237](https://github.com/rust-lang/reference/pull/1237)
>
> The RFC 2383 adds a `reason` parameter to lint attributes and a new `#[expect()]` attribute to expect lint emissions.
>
> * Here is an example how the reason can be added and how it'll be displayed as
> part of the emitted lint message:
>
```rust
#![feature(lint_reasons)]
fn main() {
#[deny(unused_variables, reason = "unused variables, should be removed")]
let unused = "How much wood would a woodchuck chuck?";
}
error: unused variable: `unused`
--> src/main.rs:5:9
|
5 | let unused = "How much wood would a woodchuck chuck?";
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_unused`
|
= note: unused variables, should be removed
note: the lint level is defined here
--> src/main.rs:4:12
|
4 | #[deny(unused_variables, reason = "unused variables, should be removed")]
| ^^^^^^^^^^^^^^^^
```
>
> * Here is an example, that fulfills the expectation and compiles successfully:
>
```rust
#![feature(lint_reasons)]
fn main() {
#[expect(unused_variables, reason = "WIP, I'll use this value later")]
let message = "How much wood would a woodchuck chuck?";
#[expect(unused_variables, reason = "is this unused?")]
let answer = "about 700 pounds";
println!("A: {answer}")
}
warning: this lint expectation is unfulfilled
--> src/main.rs:4:14
|
6 | #[expect(unused_variables, reason = "is this unused?")]
| ^^^^^^^^^^^^^^^^
|
= note: `#[warn(unfulfilled_lint_expectations)]` on by default
= note: is this unused?
```
> ## Changes from the RFC
>
> As part of my implementation, I renamed the `#[expect]` lint from `expectation_missing` to `unfulfilled_lint_expectations`. I think the name works better with other lint attributes and is more descriptive.
>
> ## Resolutions of unresolved questions
>
> 1. Where should the `reason` parameter be allowed?
>
> * The current implementation only allows it as the last parameter in all lint attributes
> 2. How should `#[expect(unfulfilled_lint_expectations)]` be handled?
>
> * In the RFC, it was suggested that the `unfulfilled_lint_expectations` can be expected by outer attributes. However, it was also questioned how useful this would actually be. The current implementation doesn't allow users to expect this lint. For `#[expect(unfulfilled_lint_expectations)]` the lint will be emitted as usual, with a note saying that `unfulfilled_lint_expectations` can't be expected.
>
> 3. How should `#[expect(XYZ)]` and `--force-warn XYZ` work?
>
> * This implementation, will emit the lint XYZ, as the lint level has been defined by `--force-warn` and also track the expectation as it usually would with only the `#[expect]` attribute.
>
> ## Updates
>
> Since the initial report, a few questions have been discussed by the lang team, here is a quick overview of the questions and resolutions:
>
> 1. Should the attribute really be called `#[expect]` or is the name too generic?
>
> * `#[expect]` is good ([Decision](https://hackmd.io/@xFrednet/rust-lang-team191#Q1-Name))
> 2. What are the semantics of the `#[expect]` attribute?
>
> * Decision: An expectation should count as fulfilled, if a `#[warn]` attribute at the same location would result in a lint emission ([Decision](https://github.com/rust-lang/rust/issues/115980))
>
> ## Open issues
>
> * `#[expect(lint)]` currently doesn't work on macros. This is in line with other lint attributes. This bug is tracked in [Specifying lint levels does not work on macros #87391](https://github.com/rust-lang/rust/issues/87391) and tested in [`expect_lint_from_macro.rs`](https://github.com/rust-lang/rust/blob/a9bf9eaef5165067414b33777a2c924e42aab5aa/src/test/ui/lint/rfc-2383-lint-reason/expect_lint_from_macro.rs#L26)
TC: What do we think?
### "`c_unwind` full stabilization request: change in `extern "C"` behavior" rust#115285
**Link:** https://github.com/rust-lang/rust/issues/115285
TC: BatmanAoD proposes for stabilization:
> This is a request for _full_ stabilization of the `c_unwind` feature, [RFC-2945](https://github.com/rust-lang/rfcs/blob/master/text/2945-c-unwind-abi.md). The behavior of non-`"Rust"`, non-`unwind` ABIs (such as `extern "C"`) will be modified to close soundness holes caused by permitting stack-unwinding to cross FFI boundaries that do not support unwinding.
>
> When using `panic=unwind`, if a Rust function marked `extern "C"` panics (and that panic is not caught), the runtime will now abort.
>
> Previously, the runtime would simply attempt to unwind the caller's stack, but the behavior when doing so was undefined, because `extern "C"` functions are optimized with the assumption that they cannot unwind (i.e. in `rustc`, they are given the LLVM `nounwind` annotation).
>
> This affects existing programs. If a program relies on a Rust panic "escaping" from `extern "C"`:
>
> * It is currently unsound.
> * Once this feature is stabilized, the program will crash when this occurs, whereas previously it may have appeared to work as expected.
> * Replacing `extern "x"` with `extern "x-unwind"` will produce the intended behavior without the unsoundness.
>
> The behavior of function calls using `extern "C"` is unchanged; thus, it is still undefined behavior to call a C++ function that throws an exception using the `extern "C"` ABI, even when compiling with `panic=unwind`.
TC: We had been waiting for a crater run and analysis on this, and that has now been completed:
https://github.com/rust-lang/rust/pull/116088#issuecomment-1870577466
There were no regressions of substance.
From an implementation perspective, this does seem currently blocked on [#113923](https://github.com/rust-lang/rust/pull/113923), which was [reverted](https://github.com/rust-lang/rust/pull/119885), but that probably doesn't need to block our FCP on the language questions.
TC: What do we think?
TC: Niko expressed +1 but did not check his box. With that box, this would move into FCP.
### "RFC: Syntax for embedding cargo-script manifests" rfcs#3503
**Link:** https://github.com/rust-lang/rfcs/pull/3503
TC: This has been changed to use `---` syntax with an optional infostring (that is arbitrary except for forbidding whitespace and commas).
TC: tmandry, Josh, and I are +1. What do we think?
### "Lang discussion: Item-level `const {}` blocks, and `const { assert!(...) }`" lang-team#251
**Link:** https://github.com/rust-lang/lang-team/issues/251
TC: This issue was raised due to discussion in a T-libs-api call. Josh gives the context:
> In discussion of [rust-lang/libs-team#325](https://github.com/rust-lang/libs-team/issues/325) (a proposal for a compile-time assert macro), the idea came up to allow `const {}` blocks at item level, and then have people use `const { assert!(...) }`.
>
> @rust-lang/libs-api would like some guidance from @rust-lang/lang about whether lang is open to toplevel `const { ... }` blocks like this, which would influence whether we want to add a compile-time assert macro, as well as what we want to call it (e.g. `static_assert!` vs `const_assert!` vs some other name).
>
> Filing this issue to discuss in a lang meeting. This issue is _not_ seeking any hard commitment to add such a construct, just doing a temperature check.
CAD97 noted:
> To ensure that it's noted: if both item and expression `const` blocks are valid in the same position (i.e. in statement position), a rule to disambiguate would be needed (like for statement versus expression `if`-`else`). IMO it would be quite unfortunate for item-level `const` blocks to be evaluated pre-mono if that same `const` block but statement-level would be evaluated post-mono.
>
> Additionally: since `const { assert!(...) }` is post-mono (due to using the generic context), it's potentially desirable to push people towards using `const _: () = assert!(...);` (which is pre-mono) whenever possible (not capturing generics).
TC: What do we think?
### "add float semantics RFC" rfcs#3514
**Link:** https://github.com/rust-lang/rfcs/pull/3514
TC: In addition to documenting the current behavior carefully, this RFC (per RalfJ)...
> says we should allow float operations in `const fn`, which is currently not stable. This is a somewhat profound decision since it is the first non-deterministic operation we stably allow in `const fn`. (We already allow those operations in `const`/`static` initializers.)
TC: What do we think? tmandry proposed this for FCP merge back in October 2023.
### "align_offset, align_to: no longer allow implementations to spuriously fail to align" rust#121201
**Link:** https://github.com/rust-lang/rust/pull/121201
TC: RalfJ nominates this for us:
> For a long time, we have allowed `align_offset` to fail to compute a properly aligned offset, and `align_to` to return a smaller-than-maximal "middle slice". This was done to cover the implementation of `align_offset` in const-eval and Miri. See #62420 for more background. For about the same amount of time, this has caused confusion and surprise, where people didn't realize they have to write their code to be defensive against `align_offset` failures.
>
> Another way to put this is: the specification is effectively non-deterministic, and non-determinism is hard to test for -- in particular if the implementation everyone uses to test always produces the same reliable result, and nobody expects it to be non-deterministic to begin with.
>
> With #117840, Miri has stopped making use of this liberty in the spec; it now always behaves like rustc. That only leaves const-eval as potential motivation for this behavior. I do not think this is sufficient motivation. Currently, none of the relevant functions are stably const: `align_offset` is unstably const, `align_to` is not const at all. I propose that if we ever want to make these const-stable, we just accept the fact that they can behave differently at compile-time vs at run-time. This is not the end of the world, and it seems to be much less surprising to programmers than unexpected non-determinism. (Related: [rust-lang/rfcs#3352](https://github.com/rust-lang/rfcs/pull/3352).)
>
> @thomcc has repeatedly made it clear that they strongly dislike the non-determinism in align_offset, so I expect they will support this. @oli-obk, what do you think? Also, whom else should we involve? The primary team responsible is clearly libs-api, so I will nominate this for them. However, allowing const-evaluated code to behave different from run-time code is t-lang territory. The thing is, this is not stabilizing anything t-lang-worthy immediately, but it still does make a decision we will be bound to: if we accept this change, then
>
> * either `align_offset`/`align_to` can never be called in const fn,
> * or we allow compile-time behavior to differ from run-time behavior.
>
> So I will nominate for t-lang as well, with the question being: are you okay with accepting either of these outcomes (without committing to which one, just accepting that it has to be one of them)? This closes the door to "have `align_offset` and `align_to` at compile-time and also always have compile-time behavior match run-time behavior".
### "Don't make statement nonterminals match pattern nonterminals" rust#120221
**Link:** https://github.com/rust-lang/rust/pull/120221
TC: CE handed this one to us, since it changes the contract of macro matchers:
> Right now, the heuristic we use to check if a token may begin a pattern nonterminal falls back to `may_be_ident`.
>
> This has the unfortunate side effect that a `stmt` nonterminal eagerly matches against a `pat` nonterminal, leading to a parse error:
>
```rust
macro_rules! m {
($pat:pat) => {};
($stmt:stmt) => {};
}
macro_rules! m2 {
($stmt:stmt) => {
m! { $stmt }
};
}
m2! { let x = 1 }
```
>
> This PR fixes it by more accurately reflecting the set of nonterminals that may begin a pattern nonterminal.
>
> As a side-effect, I modified `Token::can_begin_pattern` to work correctly and used that in `Parser::nonterminal_may_begin_with`.
TC: What do we think?
### "RFC: Allow symbol re-export in cdylib crate from linked staticlib" rfcs#3556
**Link:** https://github.com/rust-lang/rfcs/pull/3556
TC: This seems to be about making the following work:
```rust
// kind is optional if it's been specified elsewhere, e.g. via the `-l` flag to rustc
#[link(name="ext", kind="static")]
extern {
#[no_mangle]
pub fn foo();
#[no_mangle]
pub static bar: std::ffi::c_int;
}
```
There are apparently use cases for this.
What's interesting is that apparently it already does, but we issue a warning that is wrong:
```rust
warning: `#[no_mangle]` has no effect on a foreign function
--> src/lib.rs:21:5
|
21 | #[no_mangle]
| ^^^^^^^^^^^^ help: remove this attribute
22 | pub fn foo_rfc3556_pub_with_no_mangle();
| ---------------------------------------- foreign function
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: symbol names in extern blocks are not mangled
```
TC: One of the author's asks of us is that we don't make this into a hard error (e.g. with the new edition).
TC: What do we think?
### "Lint singleton gaps after exclusive ranges" rust#118879
**Link:** https://github.com/rust-lang/rust/pull/118879
TC: Nadri describes the change:
> In the discussion to stabilize exclusive range patterns (#37854), it has often come up that they're likely to cause off-by-one mistakes. We already have the `overlapping_range_endpoints` lint, so I [proposed](https://github.com/rust-lang/rust/issues/37854#issuecomment-1845580712) a lint to catch the complementary mistake.
>
> This PR adds a new `non_contiguous_range_endpoints` lint that catches likely off-by-one errors with exclusive range patterns. Here's the idea (see the test file for more examples):
>
> ```rust
> match x {
> 0..10 => ..., // WARN: this range doesn't match `10_u8` because `..` is an exclusive range
> 11..20 => ..., // this could appear to continue range `0_u8..10_u8`, but `10_u8` isn't matched by either of them
> _ => ...,
> }
> // help: use an inclusive range instead: `0_u8..=10_u8`
> ```
>
> More precisely: for any exclusive range `lo..hi`, if `hi+1` is matched by another range but `hi` isn't, we suggest writing an inclusive range `lo..=hi` instead. We also catch `lo..T::MAX`.
TC: What do we think?
### "Tracking Issue for unicode and escape codes in literals" rust#116907
**Link:** https://github.com/rust-lang/rust/issues/116907
TC: nnethercote has implemented most of RFC 3349 ("Mixed UTF-8 literals") and, based on implementation experience, argues that the remainder of the RFC should not be implemented:
> I have a partial implementation of this RFC working locally (EDIT: now at #120286). The RFC proposes five changes to literal syntax. I think three of them are good, and two of them aren't necessary.
TC: What do we think?
### "Better errors with bad/missing identifiers in MBEs" rust#118939
**Link:** https://github.com/rust-lang/rust/pull/118939
TC: The idea here seems to be to improve some diagnostics around `macro_rules`, but this seems to be done by way of reserving the `macro_rules` token more widely, which is a breaking change. Petrochenkov has objected to it on that basis, given that reserving `macro_rules` minimally has been the intention since we hope it will one day disappear in favor of `macro`. What do we think?
### "unsafe attributes" rfcs#3325
**Link:** https://github.com/rust-lang/rfcs/pull/3325
TC: tmandry nominated this one for us so that we could finish the bikeshed that we started in time for Rust 2024.
Lokathor laid out these options:
> The three basic proposals are:
>
> * `#[unsafe attr]` ("unsafe space")
> * `#[unsafe(attr)]` ("unsafe parens")
> * `#[unsafe { attr }]` ("unsafe braces")
>
> During the lang meeting on 2023-06-06, it was requested that a summary of how each option actually _looks_ in practice be made,so that hopefully one of the proposals can be selected based on readability.
>
> When using an attribute, the attribute itself can be one of three basic forms:
>
> * lone token: `#[no_mangle]`
>
> * `#[unsafe no_mangle]`
> * `#[unsafe(no_mangle)]`
> * `#[unsafe { no_mangle }]`
>
> * key-val expression: `#[link_section = ".foo"]`
>
> * `#[unsafe link_section = ".foo"]`
> * `#[unsafe(link_section = ".foo")]`
> * `#[unsafe { link_section = ".foo" }]`
>
> * an attribute "call": `#[link_ordinal(15)]`
>
> * `#[unsafe link_ordinal(15)]`
> * `#[unsafe(link_ordinal(15))]`
> * `#[unsafe { link_ordinal(15) }]`
>
> There is also the issue of readability when mixed with `cfg_attr`.
>
> * Interior, around only the attribute:
>
> * `#[cfg_attr(cond, unsafe no_mangle)]`
> * `#[cfg_attr(cond, unsafe(no_mangle)]`
> * `#[cfg_attr(cond, unsafe { no_mangle } )]`
>
> * Exterior, around the `cfg_attr`:
>
> * `#[unsafe cfg_attr(cond, no_mangle)]`
> * `#[unsafe(cfg_attr(cond, no_mangle))]`
> * `#[unsafe { cfg_attr(cond, no_mangle ) }]`
TC: This is an interesting case because we are not *discharging* unsafety, as with `unsafe { expr }` in a function body. Neither does saying `unsafe` here create and push upward a type-checked *obligation*. Instead, the upward obligation exists regardless and there is no means to signal to the compiler that it has been discharged and no enforcement of that.
TC: Another option I've seen discussed is finding some way to make these annotations safe.
TC: What do we think?
### "Add lint against function pointer comparisons" rust#118833
**Link:** https://github.com/rust-lang/rust/pull/118833
TC: In the 2024-01-03 call, we developed a tentative consensus to lint against direct function pointer comparison and to push people toward using `ptr::fn_addr_eq`. We decided to ask T-libs-api to add this. There's now an open proposal for that here:
https://github.com/rust-lang/libs-team/issues/323
One question that has come up is whether we would expect this to work like `ptr::addr_eq` and have separate generic parameters, e.g.:
```rust
/// Compares the *addresses* of the two pointers for equality,
/// ignoring any metadata in fat pointers.
///
/// If the arguments are thin pointers of the same type,
/// then this is the same as [`eq`].
pub fn addr_eq<T: ?Sized, U: ?Sized>(p: *const T, q: *const U) -> bool { .. }
```
Or whether we would prefer that `fn_addr_eq` enforced type equality of the function pointers. Since we're the ones asking for this, we probably want to develop a consensus here. We discussed this in the call on 2024-01-10, then we opened a Zulip thread:
https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Signature.20of.20.60ptr.3A.3Afn_addr_eq.60
TC: On this subject, scottmcm raised this point, with which pnkfelix seemed to concur:
> I do feel like if I saw code that had `fn1.addr() == fn2.addr()` (if `FnPtr` were stabilized), I'd write a comment saying "isn't that what `fn_addr_eq` is for?"
>
> If the answer ends up being "no, actually, because I have different types", that feels unfortunate even if it's rare.
>
> (Like how `addr_eq(a, b)` is nice even if with strict provenance I could write `a.addr() == b.addr()` anyway.)
TC: scottmcm also asserted confidence that allowing mixed-type pointer comparisons is correct for `ptr::addr_eq` since comparing the addresses of `*const T`, `*const [T; N]`, and `*const [T]` are all reasonable. I pointed out that, if that's reasonable, then `ptr::fn_addr_eq` is the higher-ranked version of that, since for the same use cases, it could be reasonable to compare function pointers that return those three different things or accept them as arguments.
TC: Adding to that, scottmcm noted that comparing addresses despite lifetime differences is also compelling, e.g. comparing `fn(Box<T>) -> &'static mut T` with `for<'a> fn(Box<T>) -> &'a mut T`.
TC: Other alternatives we considered were not stabilizing `ptr::fn_addr_eq` at all and instead stabilizing `FnPtr` so people could write `ptr::addr_eq(fn1.addr(), fn2.addr())`, or expecting that people would write instead `fn1 as *const () == fn2 as *const ()`.
TC: Recently CAD97 raised an interesting alternative:
> From the precedent of `ptr::eq` and `ptr::addr_eq`, I'd expect a "`ptr::fn_eq`" to have one generic type and a "`ptr::fn_addr_eq`" to have two. Even if `ptr::fn_eq`'s implementation is just an address comparison, it still serves as a documentation point to call out the potential pitfalls with comparing function pointers.
TC: What do we think?
---
TC: Separately, on the 2024-01-10 call, we discussed some interest use cases for function pointer comparison, especially when it's indirected through `PartialEq`. We had earlier said we didn't want to lint when such comparisons were indirected through generics, but we did address the non-generic case of simply composing such comparisons.
One example of how this is used is in the standard library, in `Waker::will_wake`:
https://doc.rust-lang.org/core/task/struct.Waker.html#method.will_wake
It's comparing multiple function pointers via a `#[derive(PartialEq)]` on the `RawWakerVTable`.
We decided on 2024-01-01 that this case was interesting and we wanted to think about it further. We opened a discussion thread about this:
https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Function.20pointer.20comparison.20and.20.60PartialEq.60
Since then, another interesting use case in the standard library was raised, in the formatting machinery:
https://doc.rust-lang.org/src/core/fmt/rt.rs.html
What do we think about these, and would we lint on derived `PartialEq` cases like these or no?
### "Uplift `clippy::invalid_null_ptr_usage` lint" rust#119220
**Link:** https://github.com/rust-lang/rust/pull/119220
TC: Urgau proposes this for us:
> This PR aims at uplifting the `clippy::invalid_null_ptr_usage` lint into rustc, this is similar to the [`clippy::invalid_utf8_in_unchecked` uplift](https://github.com/rust-lang/rust/pull/111543) a few months ago, in the sense that those two lints lint on invalid parameter(s), here a null pointer where it is unexpected and UB to pass one.
>
> ## `invalid_null_ptr_usages`
>
> (deny-by-default)
>
> The `invalid_null_ptr_usages` lint checks for invalid usage of null pointers.
>
> ### Example
>
```rust
// Undefined behavior
unsafe { std::slice::from_raw_parts(ptr::null(), 0); }
// Not Undefined behavior
unsafe { std::slice::from_raw_parts(NonNull::dangling().as_ptr(), 0); }
```
>
> Produces:
>
```
error: calling this function with a null pointer is undefined behavior, even if the result of the function is unused, consider using a dangling pointer instead
--> $DIR/invalid_null_ptr_usages.rs:14:23
|
LL | let _: &[usize] = std::slice::from_raw_parts(ptr::null(), 0);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^-----------^^^^
| |
| help: use a dangling pointer instead: `core::ptr::NonNull::dangling().as_ptr()`
```
>
> ### Explanation
>
> Calling methods who's safety invariants requires non-null pointer with a null pointer is undefined behavior.
>
> The lint use a list of functions to know which functions and arguments to checks, this could be improved in the future with a rustc attribute, or maybe even with a `#[diagnostic]` attribute.
TC: What do we think?
### "#[cold] on match arms" rust#120193
**Link:** https://github.com/rust-lang/rust/pull/120193
TC: Apparently our unstable `likely` and `unlikel` intrinsics don't work. There's a proposal to do some work on fixing that and stabilizing a solution here. The nominated question is whether we want to charter this as an experiment.
### "`.await` does not perform autoref or autoderef" rust#111546
**Link:** https://github.com/rust-lang/rust/issues/111546
TC: This was nominated for T-lang by WG-async. @tmandry said:
> We discussed this in a recent wg-async meeting ([notes](https://hackmd.io/G6ULofyXSIS4CK9u-jwYRg)). The consensus was that we thought the change was well-motivated. At the same time, we want to be cautious about introducing problems (namely backwards compatibility).
>
> There should probably be a crater run of this change, and we should also work through any problematic interactions that could be caused by this change. (@rust-lang/types should probably weigh in.)
>
> The main motivation for the change is the analogy to `.method()`, as well as to wanting async and sync to feel similarly convenient in most cases.
>
> Note that there is another analogy that works against this, the analogy to `IntoIterator`, where the lang-effect form (`for _ in foo {}`) does not do autoref/autoderef. However, given that this _looks_ very different from `foo.await`, and taking a reference with that form is significantly more convenient (`for x in &foo` or `for x in foo.iter()` vs `(&foo).await`), it seemed the analogy was stretched pretty thin. So we elected to put more weight on the above two considerations.
>
> That being said, this change would need lang team signoff. You can consider this comment wg-async's official recommendation to the lang team.
TC: There's now been a crater run done for this. The result was that this breaks a small number of crates, but at least one of those crates has a large number of dependents (`aws-smithy-runtime`). It can be fixed in the dependency in such a way that dependent crates do not have to make changes, but those dependent crates would need to update to a fixed version of the dependency.
(See this [discussion](https://rust-lang.zulipchat.com/#narrow/stream/187312-wg-async/topic/Perform.20autoref.2Fautoderef.20on.20.2Eawait.20-.20.23111773).)
TC: What do we think?
### "Add `wasm_c_abi` `future-incompat` lint" rust#117918
**Link:** https://github.com/rust-lang/rust/pull/117918
TC: daxpedda gives the context:
> This is a warning that will tell users to update to `wasm-bindgen` v0.2.88, which supports spec-compliant C ABI.
>
> The idea is to prepare for a future where Rust will switch to the spec-compliant C ABI by default; so not to break everyone's world, this warning is introduced.
>
> Addresses https://github.com/rust-lang/rust/issues/71871
TC: Is this something we want to do?
### "types team / lang team interaction" rust#116557
**Link:** https://github.com/rust-lang/rust/issues/116557
TC: nikomatsakis nominated this:
> We had some discussion about types/lang team interaction. We concluded a few things:
>
> * Pinging the team like @rust-lang/lang is not an effective way to get attention. Nomination is the only official way to get attention.
> * It's ok to nominate things in an "advisory" capacity but not block (e.g., landing a PR), particularly as most any action can ultimately be reversed. But right now, triagebot doesn't track closed issues, so that's a bit risky.
>
> Action items:
>
> * We should fix triagebot to track closed issues.
TC: What do we think?
### "Uplift `clippy::precedence` lint" rust#117161
**Link:** https://github.com/rust-lang/rust/pull/117161
TC: The proposal is to lint against:
```rust
-2.pow(2); // Equals -4.
1 << 2 + 3; // Equals 32.
```
These would instead be written:
```rust
-(2.pow(2)); // Equals -4.
1 << (2 + 3); // Equals 32.
```
Prompts for discussion:
- Is this an appropriate lint for `rustc`?
- How do other languages handle precedence here?
- Is minus special enough to treat differently than other unary operators (e.g. `!`, `*`, `&`)?
### "Implement lint against unexpected unary precedence" rust#121364
**Link:** https://github.com/rust-lang/rust/pull/121364
TC: This is the implementation of the item above.
### "Decision on "must define before use" for opaque types" rust#117866
**Link:** https://github.com/rust-lang/rust/issues/117866
TC: The question is whether to adopt the following "must define before use" rule for opaque types:
> If the body of an item that may define the hidden type of some opaque does define that hidden type, it must do so syntactically *before* using the opaque type in a non-defining way.
This is a breaking change to RPIT. Here's an example of code that works today that would break under this rule:
```rust
use core::convert::identity;
struct I;
struct IShow;
impl I { fn show(&self) -> IShow { IShow } }
struct OnIShow;
trait OnI { fn show(&self) -> OnIShow { OnIShow } }
impl OnI for I {}
fn test(n: bool) -> impl OnI {
let true = n else { loop {} };
let x = test(!n); //~ NOTE this is the opaque type
let _: OnIShow = x.show(); //~ NOTE this is a non-defining use
//~^ ERROR if the body registers a hidden type for the opaque, it
// must do so *before* using it opaquely
let _: IShow = identity::<I>(x).show();
//~^ NOTE this registers a hidden type for the opaque, but does so
// too late
loop {}
}
fn main() {}
```
This rule has relevance to the new trait solver.
TC: What do we think?
### "TAIT decision on whether nested inner items may define" rust#117860
**Link:** https://github.com/rust-lang/rust/issues/117860
TC: The question is whether this should be true:
> Unless and until [RFC PR 3373](https://github.com/rust-lang/rfcs/pull/3373) is accepted and scheduled for stabilization in some future edition, items nested inside of other items may define the hidden type for opaques declared outside of those items without those items having to recursively be allowed to define the hidden type themselves.
The context is that we allow this:
```rust
trait Trait {}
struct S;
const _: () = {
impl Trait for S {} // Allowed.
};
```
Should we accept spiritually-similar TAIT code unless and until we decide to go a different direction with the language?
### "TAIT decision on "may define implies must define"" rust#117861
**Link:** https://github.com/rust-lang/rust/issues/117861
TC: The question is whether this should be true:
> At least until the new trait solver is stabilized, any item that is allowed to define the hidden type of some opaque type *must* define the hidden type of that opaque type.
TC: This is important for the new trait solver.
TC: Here's one reason for that. The new trait solver treats strictly more code as being a defining use. It's also more willing to reveal the hidden type during inference if that hidden type is defined within the same body. This rule helps to avoid inference changes when moving from the old solver to the new solver. Adding this restriction makes TAIT roughly equivalent to RPIT with respect to these challenges.
TC: (This question is entirely orthogonal to how we notate whether an item is allowed to define the hidden type of an opaque.)
### "TAIT decision on "may not define may guide inference"" rust#117865
**Link:** https://github.com/rust-lang/rust/issues/117865
TC: The question is whether this should be true:
> The compiler is allowed to rely on whether or not an item is allowed to define the hidden type of an opaque type to guide inference.
Here's the door that this would close:
> If this rule is adopted, then after TAIT is stabilized, it will not be possible in a fully backward compatible way to later change the rules that determine whether or not an item is allowed to define the hidden type in such a way that an item in existing code that uses an opaque type could switch (without any code changes) from being not allowed to define its hidden type to being allowed to define it.
TC: This is of importance to the new trait solver.
TC: Here's one reason for this. When we're type checking a body and we find an opaque type, we sometimes have to decide, should we infer this in such a way that this body would define the hidden type, or should we treat the type as opaque (other than auto trait leakage) and infer based on that? Depending on that, we can get different answers.
TC: If we did not let inference rely on this, then we would be closing the door on later *allowing* inference to rely on this without provoking changes in inference.
TC: (This question is entirely orthogonal to how we notate whether an item is allowed to define the hidden type of an opaque. Answering this question in the affirmative would update one element of the [#107645 FCP][].)
[#107645 FCP]: https://github.com/rust-lang/rust/issues/107645#issuecomment-1571789814
### "Arbitrary self types v2" rfcs#3519
**Link:** https://github.com/rust-lang/rfcs/pull/3519
TC: We discussed this on 2023-11-22. The general feeling seemed to be that we wanted to find some way to enable this, including for raw pointers, `NonNull`, etc., but we were feeling unsure about the path to get there. We asked the author to cogitate on this and come back with a revised plan.
TC: The author did that, and we had an extensive discussion on 2024-01-17 without consensus. We have open threads for discussing this asynchronously.
Here's the thread for the proposal:
https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Arbitrary.20self.20types.20v2.20RFC
And here's the thread for the broader question of whether we want arbitrary self types at all:
https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Do.20we.20want.20arbitrary.20self.20types.3F
TC: We have a design meeting schedule for 2024-02-28 for this.
## Action item review
- [Action items list](https://hackmd.io/gstfhtXYTHa3Jv-P_2RK7A)
## Pending lang team project proposals
None.
## PRs on the lang-team repo
### "Add soqb`s design doc to variadics notes" lang-team#236
**Link:** https://github.com/rust-lang/lang-team/pull/236
### "Update auto traits design notes with recent discussion" lang-team#237
**Link:** https://github.com/rust-lang/lang-team/pull/237
## RFCs waiting to be merged
None.
## `S-waiting-on-team`
### "[ptr] Document maximum allocation size" rust#116675
**Link:** https://github.com/rust-lang/rust/pull/116675
### "warn less about non-exhaustive in ffi" rust#116863
**Link:** https://github.com/rust-lang/rust/pull/116863
### "Lint singleton gaps after exclusive ranges" rust#118879
**Link:** https://github.com/rust-lang/rust/pull/118879
### "Rename `AsyncIterator` back to `Stream`, introduce an AFIT-based `AsyncIterator` trait" rust#119550
**Link:** https://github.com/rust-lang/rust/pull/119550
### "Stabilize `cfg_target_abi`" rust#119590
**Link:** https://github.com/rust-lang/rust/pull/119590
### "privacy: Stabilize lint `unnameable_types`" rust#120144
**Link:** https://github.com/rust-lang/rust/pull/120144
## Proposed FCPs
**Check your boxes!**
### "RFC: inherent trait implementation" rfcs#2375
**Link:** https://github.com/rust-lang/rfcs/pull/2375
### "unsafe attributes" rfcs#3325
**Link:** https://github.com/rust-lang/rfcs/pull/3325
### "MaybeDangling" rfcs#3336
**Link:** https://github.com/rust-lang/rfcs/pull/3336
### "Add text for the CFG OS Version RFC" rfcs#3379
**Link:** https://github.com/rust-lang/rfcs/pull/3379
### "RFC: Syntax for embedding cargo-script manifests" rfcs#3503
**Link:** https://github.com/rust-lang/rfcs/pull/3503
### "add float semantics RFC" rfcs#3514
**Link:** https://github.com/rust-lang/rfcs/pull/3514
### "RFC: patchable-function-entry" rfcs#3543
**Link:** https://github.com/rust-lang/rfcs/pull/3543
### "RFC: New range types for Edition 2024" rfcs#3550
**Link:** https://github.com/rust-lang/rfcs/pull/3550
### "Tracking issue for Allow a re-export for `main` (RFC 1260)" rust#28937
**Link:** https://github.com/rust-lang/rust/issues/28937
### "Tracking issue for function attribute `#[no_coverage]`" rust#84605
**Link:** https://github.com/rust-lang/rust/issues/84605
### "Stabilise inline_const" rust#104087
**Link:** https://github.com/rust-lang/rust/pull/104087
### "Implement `PartialOrd` and `Ord` for `Discriminant`" rust#106418
**Link:** https://github.com/rust-lang/rust/pull/106418
### "Stabilize `anonymous_lifetime_in_impl_trait`" rust#107378
**Link:** https://github.com/rust-lang/rust/pull/107378
### "Report monomorphization time errors in dead code, too" rust#112879
**Link:** https://github.com/rust-lang/rust/pull/112879
### "`c_unwind` full stabilization request: change in `extern "C"` behavior" rust#115285
**Link:** https://github.com/rust-lang/rust/issues/115285
### "[ptr] Document maximum allocation size" rust#116675
**Link:** https://github.com/rust-lang/rust/pull/116675
### "Prevent opaque types being instantiated twice with different regions within the same function" rust#116935
**Link:** https://github.com/rust-lang/rust/pull/116935
### "Stabilize Wasm target features that are in phase 4 and 5" rust#117457
**Link:** https://github.com/rust-lang/rust/pull/117457
### "Stabilize Wasm relaxed SIMD" rust#117468
**Link:** https://github.com/rust-lang/rust/pull/117468
### "Add `REDUNDANT_LIFETIMES` lint to detect lifetimes which are semantically redundant" rust#118391
**Link:** https://github.com/rust-lang/rust/pull/118391
### "privacy: Stabilize lint `unnameable_types`" rust#120144
**Link:** https://github.com/rust-lang/rust/pull/120144
### "Stabilize associated type position impl Trait (ATPIT)" rust#120700
**Link:** https://github.com/rust-lang/rust/pull/120700
## Active FCPs
### "Tracking Issue for cfg-target-abi" rust#80970
**Link:** https://github.com/rust-lang/rust/issues/80970
### "Tracking Issue for `min_exhaustive_patterns`" rust#119612
**Link:** https://github.com/rust-lang/rust/issues/119612
### "Stabilize the `#[diagnostic]` namespace and `#[diagnostic::on_unimplemented]` attribute" rust#119888
**Link:** https://github.com/rust-lang/rust/pull/119888
### "Implement RFC 3373: Avoid non-local definitions in functions" rust#120393
**Link:** https://github.com/rust-lang/rust/pull/120393
### "make non-PartialEq-typed consts as patterns a hard error" rust#120805
**Link:** https://github.com/rust-lang/rust/pull/120805
## P-critical issues
None.