Migrating back from the hackmd
- niko to post summary comment on turbofish RFC and postpone - update: thought about it, didn't act yet because pondering - talked to varkor, will post comment soon
centril to comment on concerns re: inline asmrust-lang/rfcs#2836- should we have a follow-up meeting?
- Centril to comment on floating point to integer casts can cause undefined behaviour #10184
Felix to comment on rust-lang/rust#68164Centril to comment on #~~~~45600and do PR too perhaps if he feels like it:)- Niko to announce design meeting schedule on Inside Rust blog
- Centril to create issue to remove existing lint against nested unsafe blocks, add a allow-by-default lint encouraging them
- Niko to write comment on RFC#2585 summarizing conversation from meeting
- Feb 3 — Specialization infomercial (presented by Niko)
- Feb 10 — Ralf +
UnsafeCell
bugs (#55005, #68206) - Feb 17 — (Niko is unavailable)
- Feb 24 — ffi-unwind working group (we’d like to start some pre-discussion)
One thing not covered here that I want to do:
- Plan out meetings for all hands
- I want to do this more rapidly anyway, let’s discuss async in #t-lang a bit perhaps
inline assembly (Amanieu, Josh)
- lots happening here, expect 1st RFC show up soon
safe transmute (Ryan, Josh)
- no updates.
const evaluation (ecstatic-morse)
- PR implementing syntax for const bounds landed
?const Trait
ffi-unwind (BatmanAod)
- no update but continued plan to work on writing up the notes from big meeting
"dyn Trait" stuff (nikomatsakis)
-
Relevant issue: rust-lang/rust#57893
-
Relevant PR: rust-lang/rust#66037
-
Still trying to get a crater run on latest proposal, had a few misstarts due to rebasing errors
-
What the PR implemented:
- Making
dyn Trait
notdyn safe
if:- there is a dyn overlapping impl and
- the trait has associated non-functions
- that do not have where
Self: Sized
(not implemented)
- that do not have where
- Making
-
What we discussed:
- If there is a dyn-overlapping impl:
- and the trait is dyn safe
- then the items in the impl must be default
- If there is a dyn-overlapping impl:
-
To aid in reaching a final decision, want to have a write-up covering some of the alternatives
- crater impact where possible
- patterns that work or don’t work trait Foo { type Bar; }
impl<T: ?Sized> Foo for T { type Bar = X; // This impl is allowed in the first version }
grammar (qmx)
- no update
**never_type**
(**!**
) stabilization (nikomatsakis)
-
out of the blue Aaron1011 opened PR #68350
- has an interesting plan that ties warnings to functions that produce
!
but do not take a!
argument- if we default some type parameter
X
to!
- and you have a function call in your code
f(…)
where:- return type of this function call includes
X
- the arguments to
f
are inhabited
- return type of this function call includes
- if we default some type parameter
- alternatives:
- make it a hard error — too complex and would require a very strong sense of false positives
- deny by default to start — probably too strong
- warn by default
- but this might be silenced by allow-warnings
- the concern: if they have
#[allow(warnings)]
, they won’t see this- we could have an “unsilenceable warning” (or at least one with a minimum level)
- but this would be a new thing
- some question about how strong this lint should be, e.g., should it be silenceable?
- We are still waiting on crater (https://crater.rust-lang.org/ex/pr-68350, Running (23%))
// functions that take fn foo(x: T) -> T { .. }
// fn bar() -> T { } let x = bar();
fn baz() -> Result<(), T> { Ok(()) } let x = baz();
fn baz() -> fn() -> T { transmute() } baz()()
- has an interesting plan that ties warnings to functions that produce
None this week
- Nothing new.
[~~Pin~~](https://github.com/rust-lang/rust/issues/66544)
is unsound due to rogue Deref/DerefMut implementations rust-lang/rust#66544- pending fix in #68004
Coherence can be bypassed by an indirect impl for a trait object- (see above)
- Add lint for never type regressions #68350
- see notes above
- revisit next week.
- permit negative impls for non-auto traits #68004
- (see above)
impl Foo for !T
#[marker] trait Foo { }
and #67919impl Foo for u32 { } impl<T> Foo for T { }
impl Foo for SomebodyElsesType { }
- “exclusive rights” is the underlying concept here
- Discuss if we have spare time.
- We didn’t ==> next meeting.
- Some previous similar conversation: https://internals.rust-lang.org/t/pondering-negative-trait-promises/8265
Correct inference of primitive operand type behind binary operation #68129- Check your boxes
- done
- Check your boxes
Pin
is unsound due to transitive effects ofCoerceUnsized
#68015- split off from the other
Pin
issue
- split off from the other
Pin`is unsound due to rogue Deref/DerefMut implementations #66544- see above
Arc::drop has a (potentially) dangling shared ref #55005- meeting planned for Feb 10
floating point to integer casts can cause undefined behaviour #10184- last time we talked, we concluded that it made sense to
- adopt saturated semantics as the default
- maybe offer a
-Z
flag to opt out for a time - there has been plenty of discussion in the meantime
- how do we go forward here?
- a summary might be an amazing contribution --niko
- Centril will leave comment asking for a summary of:
- recommended option from the POV of the summary maker and why :)
- what options have been evaluated and what were the results
- what options exist that have not been evaluated and what are the pros/cons
- Not done yet.
- last time we talked, we concluded that it made sense to
-
RFC for unsafe blocks in unsafe fn #2585
- Recent activity but generally positive sentiment from lang team members
- Do you ever want a
unsafe fn
with no unsafe blocks in the body?- Yes: consider
Vec::set_len
, though unsafe fields might obviate this - If we had unsafe fields, we could probably give warnings if you have an
unsafe
fn with nounsafe
blocks
- Yes: consider
- Do we wish to merge?
- What about
#[unsafe]
attribute as an alternative, opt-in syntax?- concern:
unsafe
is a keyword. - concern: “two ways to do it”
- motivation?
- avoiding breakage
unsafe
keyword continues to be reserved for “(truly) here be dragons”
- concern:
- Rightward drift:
- If you make a more narrow rewrite like
let x = unsafe { foo() }
that will help somewhat (we ought to be able to automate this, too)? - Maybe if you are writing a lot of smaller functions...
- If you make a more narrow rewrite like
- Niko: thoughts on potential edition interactions
- side note: (re)consider
unsafe
vstrusted
- I do like having the split between introduce and discharge keywords, like we have with
async.await
, so would in principle be in favour oftrusted{}
blocks, though who knows if it’s worth the churn — scottmcm- churn is indeed the main counterargument from my POV — nikomatsakis
- side note: (re)consider
- Fighting rightward drift: unsafe fn foo() = unsafe { ... }; fn foo() = match some_expression_here { ... }; fn foo() = try { ... };
fn foo(x: u8) -> u8 = x * 2 + 4;
- Cluster of inter-related proposals here:
- unsafe within unsafe fn body
- fn body after
=
- fights rightward drift
- unsafe fields
- permits warning if unsafe is not used within fn body
- Potential immediate steps:
- Remove the lint that says “don’t add
unsafe
into the body”- maybe add a lint that warns if you do something
unsafe
in the body that is allow-by-default, so folks can opt-in
- maybe add a lint that warns if you do something
- Consider whether to land the RFC
- Remove the lint that says “don’t add
- Compromise?
- retool the RFC to a lint that warns by default?
- this permits people to opt out in specific, FFI-like scenarios, but gives people a nudge
- we can still have an automated transition, it could later become stronger etc
- I’ll note that
fn foo(x: u8) -> u8 { x * 2 + 4 }
is already legal and fine and not materially longer, unlike in C# where the=>
removing thereturn
and;
(and theget{}
in properties) is more materially valuable — scottmcm- it’s not obvious to me that
= x * 2 + 4
should be allowed, it might be something we limit to “the sorts of things that don’t require,
in a match”, for example — nikomatsakis
- it’s not obvious to me that
- Resolved:
- Remove the existing lint
- Add a allow-by-default lint for unsafe code in an unsafe fn without an unsafe function
- Write a comment on #2585 that summarizes the conversation from meeting
-
- Centril wants someone to more convincingly say they’ll implement this.
Centril will ask T-compiler on Zulip.
- Centril wants someone to more convincingly say they’ll implement this.
- items to discuss this meeting: