title | tags |
---|---|
Triage meeting 2021-04-27 |
triage-meeting |
- Meeting date: 2021-04-27
- Watch the recording
- Team members: nikomatsakis, cramertj, pnkfelix, scottmcm
- Others: simulacrum, Mara
- Action item scribe: simulacrum
- Note-taker: pnkfelix
- "New ABI: "wasm"" lang-team#90
- had the meeting!
- notes to be pushed
- "Generators planning" lang-team#92
- maybe no doc?
Link: #86
- no progress, Niko still hopes to summarize
Link: #89
- FCP to close, no significant discussion afterwards.
- One comment, pointing out there might be reasons to use paths around platform independence (which we did touch on in meeting itself)
Link: rust-lang/rfcs#3016
- looks like it can be merged
- who has permissions to merge?
- simulacrum: need to approve, then anyone from this team should have merge-capability
- pnkfelix takes action item to merge
"fn() -> Out
is a valid type for unsized types Out
, and it implements FnOnce<(), Output = Out>
" rust#82633
Link: rust-lang/rust#82633
- There is a PR and I (niko?) prepared an alternative fix
Link: rust-lang/rust#84366
- Has a pending PR, under review
No nominated items this time.
Link: rust-lang/rust#51999
- Stablization Report
- I would prefer this to be accompanied by a stabilization PR, or at least in its own issue, shall we move it? -Niko
- lang team members should take action items to review this
Link: rust-lang/rust#81789
- cramertj summarized old conversation
- no responses yet
- nothing to do here at this time
- lang team members should take action items to review cramertj's comment
- general impression: no consensus among team about going forward; little confidence in PR as written, but generally positive about doing something to try to improve things here
Link: rust-lang/rust#83312
- In FCP now
- Aaron1011 left a comment
- (comment just says compiler has addressed some of the problems, but there is still value in removing them)
- cramertj: is this actually a breaking change, when you consider when these might fall under a cfg'ed section of code? (Or more generally, a part of the code that is dropped e.g. via macro expansion)
macro_rules! foo {
($foo:expr) => { }
}
fn main() {
foo!((#![foo] 22));
}
- notably, the above (with a
(#![foo] 22)
being passed into a macro that takes a$foo:expr
) compiles today on stable and we are pretty sure it will stop compiling after this change. - simulacrum: For what its worth,
rustfmt
"eats" the inner attribute in that context. (So it won't even be preserved viarustfmt
's transformation.)
4 unique legitimate regressions:
match port { #![allow(clippy::cast_ptr_alignment)] ... }
match self.color { //! The `format!()` [macro] lets us create a `String` with a pattern, ... }
match *self { #![allow(unknown_lints,match_same_arms)] ... }
match mdid { #![allow(clippy::unreadable_literal)] }
-
Based on above comment from petrochenkov (which we believe is referring to code snippets that compile today on stable rust), it sounds like we don't need to go through a macro to observe the breaking change here.
-
This compiles on stable, with a warning that the
#[doc]
attribute is unused: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=b6f83b33ead1fcc59d4ea4a48fd5fea1
fn main() {
let color = 4;
match color {
//! The `format!()` [macro] lets us create a `String` with a pattern, ...
_ => (),
}
}
- simulacrum: if this helps compiler performance on 99% of the code, and it doesn't have a meaningful interpretation today
- nikomatsakis/cramertj: it has a meaningful interpretation to me...
- simulacrum: well in any case, it seems like it might be worth it?
- nikomatsakis: Is the motivation here performance? I had thought maybe it was something else, i.e. that it wasn't correctly implemented today?
- nikomatsakis: I'm going to leave a concern noting that I am not clear on motivation
- scottmcm: how bad would it be to accept these but ignore them and emit a diagnostic saying that they have no meaning?
- various: why not just support them then?
Example: this works (lint is suppressed)
fn main() {
let x = Some(22);
match x {
#![allow(unused_variables)]
Some(y) => { }
None => { }
}
}
Link: rust-lang/rust#83366
- question about arbitrary expressions. PR stabilizes lexing arbitrary expressions in that position.
- nikomatsakis: why is that a concern for lang team? perhaps hygiene?
- nikomatsakis: generally feel like it should be okay to allow arbitrary expressions
- cramertj: should we worry that these macro invocations look like things that are expanded eagerly?
- cramertj: but
doc = ...
andpath = ...
"just work" via compiler-magic. - nikomatsakis: right, they are not macros. (Though maybe they could become macros in the future.)
- cramertj: just concerned that someone might think they can use some macros here and think that they will be expanded eagerly.
- cramertj; Having this feature and not having eager expansion just feels funny to me.
- nikomatsakis: (do procedural macros accept that form?)
- cramertj: (yes. I think. E.g. parsing equals of attributes attached to fields)
- nikomatsakis: but what about the macro invocation itself?
- cramertj: oh I don't think those would work in a procedural macro (today).
#[derive(StructOpt)]
struct Foo {
#[data = include_str!(...)]
field: u32
}
- but this example would work because string is only needed at runtime
- what would not work is if the string is needed at compile time
- scottmcm: does this allow, say,
#[foo = +(3)]
since that could tokenize fine but isn't an expression?- Should it be
tt*
or actuallyexpr
? - niko's "theory": arbitrary tokens will lex, but not parse, but let's discuss it in thread
- Should it be
- nikomatsakis: seems like it parses the expression
- mara: the
StructOpt
example above does not actually work today
Link: rust-lang/rust#83386
-
settled on "pat_param" as a name, but still deciding about whether to provide "pat2021"
-
mara: point of keyword literals is to enable people to write expected keywords without waiting for an edition, not about adding it after the edition is available.
-
joshtriplett: providing a pat2021 is motivated by wanting to allow future editions to make further changes to what
pat
means, and since we do not know what those changes are today, the only thing we can call it ispat2021
-
mara: that sounds like an argument for not having
pat2021
at all -
joshtriplett: it is an argument if you want to write references to
pat2021
in 2015 or 2018 edition code. -
nikomatsakis: felix has often argued for always having a way to specify what you want, even if you rarely use it
-
scottmcm: does it suffice to say "we give you a way, but only in the latest edition"?
-
(debate followed)
-
mara: Note that
$($_:pat_param)|+
works in all editions -
Agreed:
- pat_param -- pat without
|
- pat -- pat without
|
<=2018, pat with|
2021+
- pat_param -- pat without
-
Question:
- do we have pat2021 that is 'pat with
|
' in all editions
- do we have pat2021 that is 'pat with
-
Reason to do so:
- It is nice if older editions can access newer semantics, albeit with a more confusing way
-
Reasons not to do so:
- (a) they can acccess the newer semantics by doing
$($p:pat)|+
(or by upgrading to the newer edition)- But: this is significant more complex and they may well make a subtle mistake
- But: macros do this today
- But: why not adopt newer edition? probably because want support for old compiler
- But: this is significant more complex and they may well make a subtle mistake
- (b) newer editions have no use for this because it's just the same as
pat
- (c) if we add a new variant of pat, we can give it a meaningful name like
pat_param
at that time - (d) cruft, YAGNI
- It would be a shame if we ended up with a big list of
pat2021
,pat2027
, ...
- It would be a shame if we ended up with a big list of
- (a) they can acccess the newer semantics by doing
-
Precedent:
- we tend to give years for 'old names that are deprecated but retained for backwards compat'
Link: rust-lang/rust#83595
- putting
#[repr(align)]
on a field was accepted but did nothing - now rejected
- scott thinks we agreed to this breakage before, so does mark
- action item: scott to leave comment
breakage discussion: rust-lang/rust#80920 (comment)
Link: rust-lang/rust#83918
Link: rust-lang/rust#84045
Link: rust-lang/rust#84133
Link: rust-lang/rust#84364
Link: rust-lang/rust#84414