- Niko to reach out to wg-grammar around writing up a “what is status” thing
- Niko to prep a write-up for auto-trait-lifetime interactions
- scott to post comment on “elide array size” RFC
- Josh to invite Ryan to present state of safe transmute
- Felix to investigate rust-lang/rust#66740 and rust-lang/rust#66741 before next meeting
Niko to prepare a meeting proposal for WF checks on type parameters- Josh to write a comment +T-Lang Meeting: Current meeting: Discussion-about-https://githu
- Felix to analyze rust-lang/rust#66740 and form an opinion.
Niko to write a comment discussing the idea of adding raw pointer methods to~~AtomicUse~~
to make itpossibleto correct rust-lang/rust#55005.- Reminder: another “help wanted” lang-team proposal raw pointer methods?
Niko to comment on rust-lang/rfcs#2545 to cancel FCP and encourage moving to MCP process to consider revitalizing.- Also close some older FCPs and consider re-opening them.
- Lower priority of rust-lang/rust#68015 and add as a blocker to CoerceUnsized
- Add new MCPs and meeting proposals to the Lang Team Project Board
- Review newly created RFCs
- Review Lang Team Project Board:
- Active items
- Major Change Proposals
- Meeting Proposals
- Review P-high issues
- Review Nominated PRs
- Review Nominated issues
- Review Nominated RFCs
- Review rfcbot pending list
FFI-Unwind
- Not inclined to revisit questions like keyword notation (at least Niko is not)
- Would rather not have
"system"
mean unwind if"C"
excludes unwinding, would want to have a consistent opt-in - Could we have a lint for
#[unwind(allowed)]
that warns if the ABI does not permit unwinding?- We are going to remove this attribute but it’ll require some sort of transition period as people are using it today (on nightly).
- Ideal:
- Make this imply the newer ABI
- Warn and encourage folks to migrate to the newer ABI
Issue 72012
-
Soundness problem with target feature
-
Reviewed the various solutions proposed
- Unsafe to reference without calling
- this breaks existing code but is also a more complex fix to implement, somewhat “unnatural” to not be able to refactor
foo()
tolet x = foo; x()
- this breaks existing code but is also a more complex fix to implement, somewhat “unnatural” to not be able to refactor
- Unsafe to reference without calling
-
“Fast fix”
- functions that declare “target feature” do not implement
Fn
and friends
- functions that declare “target feature” do not implement
-
Josh’s ideal alternative
- it is “unsafe” for functions that declare “target feature” to implement
Fn
and friends- i.e., you can only use this implementation in an unsafe block
- but this is not an option (today) because it is a concept that the language supports, it would be like an impl that is unsafe to use
- or — it is only possible within a function that has the same target feature set
- it’s ok that functions can escape in this case because you’ve already “demonstrated” that you are capable of supporting those target features
- conceptually these are kind of “impls” with where clauses that test the environment (“am I
- it is “unsafe” for functions that declare “target feature” to implement
-
Observation:
- you can kind of model the “preferred” solution using closures, but not quite, because closures aren’t allowed to use the target feature of their enclosing item (example)
- answer is probably yes
- you can kind of model the “preferred” solution using closures, but not quite, because closures aren’t allowed to use the target feature of their enclosing item (example)
-
Niko’s proposal:
- Accept the PR that says fns with target-feature declared do not implement the Fn traits
- Address the question of closures and what target features they have available, which also provides a workaround for the above case
- If in the future we wish to do so, we can create some conditions under which fns with target-feature may implement the Fn traits (backwards compatibly), but it involves adding some new concepts to the trait system (e.g., impls usable only with a given target feature in scope, or unsafe impls).
// Example of escaping:
#[target_feature(enable="avx")] fn use_avx() -> Box<dyn Fn()> { let x: Box<dyn Fn()> = Box::new(also_use_avx); x }
#[target_feature(enable="avx")] fn also_use_avx() { println!("Hello from AVX") }
fn main() { let y = use_avx(); }
//
#[target_feature(enable="avx")] fn use_avx() -> Box<dyn Fn()> { }
impl … { // For the type of
use_avx
#[target_feature(enable="avx")] fn as_fn(&self) → impl Fn(…); }fn main() { let y = unsafe { use_avx.as_fn() }; }
#[target_feature(enable="avx")] fn another_avx() -> Box<dyn Fn()> { use_avx.as_fn() // no unsafe needed }