2018 Edition End of Week Post (2018-07-20)

This is the weekly Edition Status Update; it contains the state of the content areas surveyed this week. This is the second post in this series. You can read the first post here. This week we’re happy to announce that we were able to get status updates from every group.

Each content area lists the blocking issues for the Preview 2 milestone described here, which is scheduled for 2018-08-02. In addition, some areas highlight important news or places where contribution is needed. You can track the full issue burndown on this spreadsheet.

General note

  • Please keep trying to migrate crates, the weirder the better!

NLL (@nikomatsakis)

  • Focusing on:
    • ICEs and correctness problems
    • Edge cases for diagnostics
    • Edge cases for performance or memory usage
  • Making progress on those items
    • Current list of issues is mostly assigned
    • There are some ICEs and things yet to be investigated
  • News
    • Meeting is at 19:30 UTC on Tuesday(s), and you can check the internals thread where we post updates and in particular issues to tackle.
    • Thanks to lqd, pietroalbini and some others for crater run triage and assistance

Clippy (@oli-obk)

  • Clippy is in rustup! So one issue down, just 2 left
  • The RFC has been silent for a while, just needs a small patch and it should be ready.
  • The other issue is #[allow(clippy::foo)], but someone is working on it, so we’ll get it in a few weeks
  • PR https://github.com/rust-lang/rust/pull/52264 was merged

Edition Guide (@steveklabnik)

  • Current resources sufficient
  • Work will be split up between steveklabnik, Centril, and @mark_simulacrum
  • If you’d like to help out, feel free to give us feedback on the issue tracker, in particular we’d love input on the readability of the guide.
  • No important news this week

TRPL (steveklabnik)

  • Preview 2 issues done
  • RC issues blocked on stabilizations etc

Embedded (@japaric)

CLI (@killercup)

  • Originally had 4 things killercup wanted WG CLI to work on to make writing CLIs in Rust a somewhat coherent experience:
    • Input (args, config files)
    • Output (colors, logs, human vs machine output)
    • Distribution (producing linux packages but also stuff like generating man pages)
    • Testing (assert_cli 1.0)
  • A lot of progress has already been made and published:
    • Argument parsing (clap 3)
    • Packaging (various efforts)
    • Testing (@epage rewrote assert_cli)
  • Other work has also happened, such as man page generation, but is not yet ready for use
  • Two near-term strategies:
    • Double down on ongoing efforts and push them over the finish line (requires killercup to work on stuff but way more heavily depends other people to be motivated to work on the right issues)
    • Get prototypes going for the stuff we’ve only just designed
    • killercup is inclined towards the former.
  • Deliverable: A rough draft for a “writing a CLI app in rust in 15min” guide that showcases most of what killercup has mentioned
  • Will try to work with some folks and see if we can integrate more other docs in a prominent place, e.g. https://crate-ci.github.io/
  • Once we have some stuff that works, killercup will make sure to open a huge bunch of easy issues!
    • clap and assert-rs already have a few easy issues

rustfix (killercup)

  • Merging into Cargo
  • Generally in good shape for Preview 2

Lints (acrichto)

  • We need more testing!
  • Migration lints should be reaching a pretty polished state

WASM (@fitzgen)

Lang stabilizations (@aturon)

  • aturon made a post about a roster of a few possible stabilizations for preview 2.
    • We aim to stabilize these features. Thus, this is an excellent and the last opportunity to test them out and give feedback, particularly if you did not care for the features from the get go.

Networking WG (aturon)

  • Attempting to reboot the WG
  • Main goals for Preview 2:
    • futures 0.3 alpha out — done!
    • async / await working with futures 0.3 — done!
    • WG actively meeting and setting goals for the Edition — next week

Marketing (aturon)

  • No news this week

rustfmt (@nrc)

  • Solid progress this week, on track for Preview 2
  • RFCs waiting on updates from nrc

RLS (nrc)

Editors (nrc)

  • No change from last week
  • Nothing pressing for Preview 2

Regarding the new module system and embedded (@japaric): can we have a cfg to enable the core lib in std builds? Motivation:

#![cfg_attr(feature="std", core_with_std)]
#![cfg_attr(not(feature="std"), no_std)]

/// works with and without std:
use core::mem::size_of;

Our current solution, extern crate std as core;, doesn’t work as well when having to prefix crate:: to crate paths (Rust 2018).

Alternatively Cargo may be able to handle this, except I don’t believe it’s possible to add a dependency on the core crate?

Today you can always use extern crate core;, regardless of whether you also use #![no_std].

The module/path changes make extern crate unnecessary for dependencies declared in Cargo.toml, but it’s still necessary for standard library crates, right? For example extern crate proc_macro;.

1 Like

use core::mem::size_of; or let x = ::core::mem::size_of; already work regardless of no_std (in 2018 edition), because it can search crates not passed with --extern in library directories.

“Extern prelude” (i.e. mod m { let x = core::mem::size_of; }) has to be a bit more conservative, it only looks at crates passed with --extern and a very conservative list of “known” crates (it’s std for std builds and core for no-std builds). We can certainly add core to known crates in std builds too.

@SimonSapin thanks; not sure why we didn’t do that already! Unfortunately it doesn’t help in Rust 2018 because it only binds core in the top-level crate namespace, so use core::mem; won’t work in sub-modules in Rust 2018 (though it does in 2015).

@petrochenkov doesn’t work for me. Perhaps core should be added to the list of known crates, yes, though maybe then we’ll have newbies asking "should I use core or std"?

@dhardy it appears to work in 2018 for me, can you show an example of what’s not working for you?

@Nemo157 It doesn’t work outside of use statements.

@vks ok, but that’s just what @petrochenkov said earlier, the core crate is available in the “global” scope that use or absolute (::<path>) uses, but isn’t in the prelude injected into every module so you have to use an absolute path to it while you don’t for std. It sounds like it should be possible to add core to the prelude as well which would fix this:

(although then what about alloc? ISTM that we’re a bit late to do anything major about it for 2018, but removing the prelude and having to explicitly add dependencies on the standard libraries to Cargo.toml seems like something to aim for in Rust 202X):

Standard library crates today are:

  • core
  • alloc
  • std
  • proc_macro
  • test

@vks I suppose we can use this solution for now.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.