owned this note
owned this note
Published
Linked with GitHub
# T-lang meeting agenda
* Meeting date: 2021-02-02
* [Action items document](https://hackmd.io/gstfhtXYTHa3Jv-P_2RK7A)
* [Watch the recording](https://youtu.be/XXuARxRMByQ)
## Attendance
* Team members: nikomatsakis, scottmcm, pnkfelix
* Others:
## Pending proposals
- Discuss policy proposals
- Switch to compiler-team process: meta-design-meeting once a month
- At start of that meeting, review active project groups; this also allows for them to be added to one of the month's meetings
- Handling blocking concerns, and requiring a "second" for them. (Does not indicate agreement with the concern, but indicates desire to hear more about the concern.)
- Will handle these via FCP on a lang-team issue
- "MCP: Deref Patterns" [lang-team#77](https://github.com/rust-lang/lang-team/issues/77)
- [Charter pending](https://github.com/rust-lang/lang-team/pull/78)
## Project board review
Review the [Lang team project board](https://github.com/rust-lang/lang-team/projects/2) and get updates
## Nominated RFCs
- No nominated RFCs this time.
## P-high issues on rust-lang/rust
- "regression 1.50: deny after forbid breaks build" [rust#80988](https://github.com/rust-lang/rust/issues/80988)
- "beta regression: forbid(warnings) interacts poorly with common derives." [rust#81218](https://github.com/rust-lang/rust/issues/81218)
- Fix is in [PR #81556](https://github.com/rust-lang/rust/pull/81556)
- the effect is that if you have a `forbid(group)` and later do a `allow(lint)` where `lint` is in `group`, you get a FCW but the allow takes effect
- Notes for future:
- If we convert a lint into a group, it should be exempted
- We should move swiftly to make this a hard error as there wasn't much breakage
- As soon as we address `derive` triggering it
## Nominated PRs and issues on rust-lang/rust
- "Tracking issue for RFC 2535, 2530, 2175, "Or patterns, i.e `Foo(Bar(x) | Baz(x))`"" [rust#54883](https://github.com/rust-lang/rust/issues/54883)
- Pending action item: scottmcm to look at stabilization report
- Linked from https://github.com/rust-lang/rust/pull/79278 : https://hackmd.io/oczPRxyBSKOAojC1Dgxupw
- "Lint for unused borrows as part of `UNUSED_MUST_USE`" [rust#76894](https://github.com/rust-lang/rust/pull/76894)
- Pending action item: nikomatsakis
- "CString lifetime warning incorrectly fires" [rust#78691](https://github.com/rust-lang/rust/issues/78691)
- Needs the lang team to make a call on this.
- False warning on lint for this line
- `gecko_profiler_register_thread(CString::new("foo").unwrap().as_ptr());`
- the `CString::new()` is being converted to a raw pointer; that raw pointer is valid until end of statement
- Whether this is a false positive depends on what `gecko_profiler_register_thread`
- What is expected rewrite?
- Put `CString::new` into a let, but that is also quite possibly wrong (e.g., )
- Lint on:
- `let x = CString::new("foo").unwrap().as_ptr();` -- good, guaranteed wrong
- `let x = Some(CString::new("foo").unwrap().as_ptr());`
- `let x = Foo { field: CString::new("foo").unwrap().as_ptr() };`
- `let x = (CString::new("foo").unwrap().as_ptr(), ...)`
- Not lint on:
- `let x = foo(CString::new("foo").unwrap().as_ptr());`
- `let x = foo(Some(CString::new("foo").unwrap().as_ptr()));`
- `let x = foo(x.as_ptr())` where `foo` is the identity function
- Resolution: josh to comment
Current output:
```
warning: getting the inner pointer of a temporary `CString`
--> src/main.rs:9:69
|
9 | gecko_profiler_register_thread(CString::new("foo").unwrap().as_ptr());
| ---------------------------- ^^^^^^ this pointer will be invalid
| |
| this `CString` is deallocated at the end of the statement, bind it to a variable to extend its lifetime
|
= note: `#[warn(temporary_cstring_as_ptr)]` on by default
= note: pointers do not have a lifetime; when calling `as_ptr` the `CString` will be deallocated at the end of the statement because nothing is referencing it as far as the type system is concerned
= help: for more information, see https://doc.rust-lang.org/reference/destructors.html
```
- "expand/resolve: Turn `#[derive]` into a regular macro attribute" [rust#79078](https://github.com/rust-lang/rust/pull/79078)
- In FCP for 3 more days, no need to review. Can merge after FCP and after petrochenkov fixes merge conflicts
- "Stabilize `unsafe_op_in_unsafe_fn` lint" [rust#79208](https://github.com/rust-lang/rust/pull/79208)
- Nominated for discussion, would default to allow
- Deferring the question of whether to change the default/recommended style
- Action item: nikomatsakis to request stabilization report
- ""!" is the only type that is unsafe to raw-ptr-deref into a "_" pattern" [rust#79735](https://github.com/rust-lang/rust/issues/79735)
- "Unsafe checking skips pointer dereferences in unused places" [rust#80059](https://github.com/rust-lang/rust/issues/80059)
- Observation:
- initialization is inherently a control-flow based analysis, which implies
- `panic!(); *foo`, the `*foo` is dead code, it's hard to say whether (we care that) `foo` is initialized or not
- `let foo: bool; let _ = *foo;` doesn't involve dead code
- Consensus:
- [We already have precedent that unsafe checks apply in dead code](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=20b3738f2625185d9a4d1215b8b729cd)
- "Promote 2018 warn lints to deny in Rust 2021" [rust#80165](https://github.com/rust-lang/rust/issues/80165)
- Conclusion from previous week: we will break these out into separate PRs
- Action item: Ryan to create those PRs
- Question: should we warn on these lints in prior editions?
- Action item: Niko to write up pros/cons
- "make const_err a future incompat lint" [rust#80394](https://github.com/rust-lang/rust/pull/80394)
- Ralf's grand plan to make const-err less painful
- This step: makes it a future incompatibility lint to have constants that cannot be evaluated
- [Mark's summary](https://github.com/rust-lang/rust/pull/80394#issuecomment-7590986900)
- Josh to leave comment saying "go for it"
- Done
- "relax adt unsizing requirements" [rust#80726](https://github.com/rust-lang/rust/pull/80726)
- [lcnr added a write-up](https://github.com/rust-lang/rust/pull/80726#issuecomment-765906358)
- `struct Foo<T: ?Sized> { x: T }`
- `Arc<Foo<[u8; 32]>>` want to permit coercion to `Arc<Foo<[u8]>>`
- `Arc<T>` can be coerced to `Arc<U>` if `T: Unsize<U>` or something like that
- `struct Foo2<T: ?Sized> { a: T, x: T }`
- `Foo2<[u8]>` would affect type of both fields
- `struct A<T, U: ?Sized>(T, B<T, U>);`
- `struct B<T, U: ?Sized>(T, U);`
- Propose feature-gating -- on principle, to give time
- Felix to leave comment
- "Visit more targets when validating attributes" [rust#80920](https://github.com/rust-lang/rust/pull/80920)
- Validating more cases where we were failing to check for unexpected attributes
- e.g., `#[inline] const T: u32`, these were being silently ignored before
- We now get an error, breaking change, crater run, 3 crates affected
- Affected crates:
- olm-rs-1.0.0 -- real regression on the latest version
- Conclusion:
- Move forward (we may want to revisit our policy but not on this instance)
- Ping authors of olm-rs crate (and perhaps other affected crates) -- done
- Action item:
- Josh to file issue
- https://gitlab.gnome.org/jhaye/olm-rs/-/issues/37
- Mark to leave a comment
- "don't gratuitously error on tests returning Result with lifetime" [rust#80934](https://github.com/rust-lang/rust/pull/80934)
- "Stabilize remaining integer methods as `const fn`" [rust#80962](https://github.com/rust-lang/rust/pull/80962)
- "beta regression: forbid(warnings) interacts poorly with common derives." [rust#81218](https://github.com/rust-lang/rust/issues/81218)
- Already addressed above in P-high issues
- "Allow specifying alignment for functions" [rust#81234](https://github.com/rust-lang/rust/pull/81234)
- "Support forwarding caller location through trait object method call" [rust#81360](https://github.com/rust-lang/rust/pull/81360)
- "Allow casting mut array ref to mut ptr" [rust#81479](https://github.com/rust-lang/rust/pull/81479)