- Meeting date: 2021-04-20
- Watch the recording
- Team members: Niko, Josh, Scott, Taylor, Felix
- Others: simulacrum
- Action item scribe: Niko
- Note-taker: simulacrum
- 2021-04-21: "New ABI: "wasm"" lang-team#90
- 2021-04-28: "Generators planning" lang-team#92
Two items from backlog bonanza:
- 2021-03-17: Taylor to close RFC 2375 rust-lang/rfcs#2375
- cramertj: Is close what we actually wanted?
- It seems like the RFC could be updated with edits from the thread.
- Libs wants this
- Question though: would we want to lint on trait imports that are only used to access inherent methods?
- Warn by default: Keeps you compatible with the newest version
- Allow: Helps you retain compatibility with older versions of Rust
- Question though: would we want to lint on trait imports that are only used to access inherent methods?
- The remaining problems seem small, the RFC seems "close enough", needs some work
- Consensus:
- We would like to see edits to the RFC made
- Leave a comment outlining the remaining answers we want addressed
- Specifically resolving the ambiguity when new methods are added to the trait in favor of "true inherent" methods written in the impl
- Request person who opened RFC to follow up or see if anybody else wants to pick up the torch; revisit next week.
- cramertj: Is close what we actually wanted?
- 2021-03-17: Taylor to discuss with Scott and potentially propose fcp merge RFC 2316 rust-lang/rfcs#2316
- Discussed in Zulip
- Question is how this interacts with
const, as it seems analogous- cramertj: currently I think
constis limited to the impl, but I would be surprised not to see that qualifier used on methods - pnkfelix: not obvious that these are analogous to me (niko: nor I)
- cramertj: currently I think
scott: I feel like it would be useful to be able to do the following in an analogous way
trait Foo {
fn bar();
}
impl Foo for MyType {
const fn bar() { } // allowed to specify *more*
}
- Do we block this rfc on discussing that?
- Reason to do so: it would create an inconsistency
- (scott) Any concern I'd have about it is in ordering, I think -- I'd like to have
impl const Defaultfirst, to avoid a whole bunch of churn that we don't want, from people doingimpl Default for Foo { const fn default() -> Self { ... } }and then needing to change toimpl const Default for Foo { ... }shortly thereafter.
-
const also has complexity because we want to be able to write impls that are conditionally const, and have
constbounds- RFC 2632 (Calling methods on generic parameters of const fns) addresses this
-
Taylor to FCP merge the
unsafeRFC -
Followups later to handle
constand discuss interaction with RFC 2632
Link: #86
- [2021-04-06]: Niko to make sure we have a lang team design note on eagerly drop #86
Link: #89
- Pitch: Handle explicit module paths more intuitively
- Leveraging editions (not 2021)
- General agreement that the current state is confusing
- Ability to use
#[path]within an inline module
- Ability to use
- Currently: path is based on "where this would be if it were a file"
- Proposed: path is based on the file system
- An alternative: Could have an option on the attribute, or introduce a new attribute that is always relative to the file system
- Consensus that we should do something here?
- Not really, many of us want more evidence that people are getting confused.
- path is relatively rare.
- The risk is relatively low: the path has to exist, so the chance you get this wrong in a way that sort of works...
- ...and the error message tells you specifically where it was looking for the file.
- ...and maybe if there are multiple files that potentially match under a different interpretation then that would be a good lint, suggesting that the file be renamed.
- Another approach:
- Look at the cases where folks are using path and find a way to make that easier.
- One common case is conditional compilation; maybe we could target that pattern more specifically.
- Meeting consensus:
- Not inclined to make this change without:
- more evidence that people are feeling confused
- evidence that there are patterns where you must use path without other alternatives
- Not inclined to make this change without:
Link: rust-lang/rfcs#3016
- In FCP, not much more to say
- side note: we might want to tweak this threshold for our team
- In general, I think requiring a supermajority, not just a majority, would be good ~ scott
- Filed rust-lang/rfcbot-rs#293
"fn() -> Out is a valid type for unsized types Out, and it implements FnOnce<(), Output = Out>" rust#82633
Link: rust-lang/rust#82633
- PR is up for review
Link: rust-lang/reference#970
- [2021-04-06]: Niko to leave a summary comment, suggesting to close, rust-lang/reference#970
Link: rust-lang/rust#51999
- Proposal to stabilize: Niko suggested we need a stabilization report
- Remove nominated label; assuming it works as designed, we want it
- Mark to leave comment saying that we are positive and would like a stabilization report
Link: rust-lang/rust#81789
- Discussed on 2021-03-30 in depth
- Our consensus seemed to be lost, but we didn't have much follow-up on the issue
- [2021-03-30]: Taylor to write up a summary of the ptr cast discussion
- Pending crater run as well, which may inform the discussion
Link: rust-lang/rust#83213
- Blocked on impl issues, no discussion required, removing nomination
Link: rust-lang/rust#83312
- FCP Report by petrochenkov:
- "I propose removing support for inner attributes on tuple, parentheses, array, struct and match expressions from the language."
- "Such attributes are not used in practice and pose challenges to token collection performed during parsing for various macros to work correctly"
- "The RFC, however says "Inner attributes can be placed at the top of blocks (and other structure incorporating a block) and apply to that block, which doesn't apply to any cases removed in this PR."
- Niko did an fcp merge
fn attrs() {
(#![print_target_and_args(fifth)] 1, 2) + 5;
((#![print_target_and_args(fifth)] 1), 2) + 5;
[#![print_target_and_args(sixth)] 1 , 2];
[#![print_target_and_args(seventh)] true ; 5];
match 0 {
#![print_target_and_args(eighth)]
_ => {}
}
MyStruct { #![print_target_and_args(ninth)] field: true };
}
- Reasons to keep inline attributes on blocks:
if foo {
#![likely]
} else {
}
match foo {
22 => {
#![likely]
}
44 => {
}
}
Link: rust-lang/rust#83366
- Stabilize
#[foo = bar!(...)]- This is already possible via
macro_rules!(!), due to expr interpolation - Subsumes some other features, such as out of line documentation
- This is already possible via
- Note expansion order:
- The
bar!is expanded after procedural macros (decorators), similar to a macro expression that appears in the fn body
- The
- Pending FCP
#[macro_attr1]
#[doc = mac!()] // "inert"
#[macro_attr2]
#[derive(MacroDerive1, MacroDerive2)]
struct S;
#[macro_attr1]
fn foo() {
mac!();
}
// this works on stable for whatever reason
// and is commonly used "in std and elsewhere" (--simulacrum):
macro_rules! foo {
($x:expr) => {
#[macro_attr1]
#[doc = $x] // "inert"
#[macro_attr2]
#[derive(MacroDerive1, MacroDerive2)]
struct S;
}
}
foo!(mac!());
bar!();
-
Question petrochenkov asked:
- Do we want to enable arbitrary expressions in this position?
- "This stabilizes using macro expansion in key-value attributes, like so:" -- jyn514
- But the PR appears to stabilize both
-
What complications arise from accepting arbitrary expressions that do not arise from this?
#[foo = mac!(arbitrary_expr_here)]
- What complications arise from that, anyway?
- Only thing that the rustdoc team actually needs is
include_strand friends - What about stabilization -- is this arbitrary token trees?
- For example, can you put
try { 4 }in here on stable? - When does macro fragment parsing occur, presumably "after", at the time of macro invocation?
- For example, can you put
NikoFelix to register concern about semantics of expressions here and summarize other questions
Link: rust-lang/rust#83386
- In FCP, no discussion required
Link: rust-lang/rust#83713
- Niko would like to see this revert happen
- Current code doesn't work across crates and not worth the effort to fix it without an active design effort
- We can always re-land it if/when this effort restarts
Link: rust-lang/rust#84133
- PR #84147 is already in FCP
- No discussion needed, but cc pnkfelix
Items not reached in triage meeting:
Link: rust-lang/rust#83595
Link: rust-lang/rust#83918