pub ThisWeekInRust {} – Telegram
pub ThisWeekInRust {}
989 subscribers
2 photos
2.41K links
Handpicked Rust updates,
delivered to your telegram.

Contacts: @sergeysova
Reposted from: https://this-week-in-rust.org
Source code: https://github.com/sergeysova/this_week_in_rust.rs
Another: @this_week_in_react
Download Telegram
Crate of the week: cargo-sweep

This week's crate is cargo-sweep, a cargo subcommand to clean cargo's various temporaries. Thanks to Viktor Holmgren for the suggestion!
Updates from core

lint if a private item has doctests
https://github.com/rust-lang/rust/pull/55367

fix self profiler ICE on Windows
https://github.com/rust-lang/rust/pull/56170

allow #[must_use] on traits
https://github.com/rust-lang/rust/pull/55663

suggest correct syntax when writing type arg instead of assoc type
https://github.com/rust-lang/rust/pull/55808

match_ref_pats: don't emit suggestions inside of a macro
https://github.com/rust-lang/rust-clippy/pull/3432

fix stability hole with `static _
https://github.com/rust-lang/rust/pull/55983

stabilize macro_literal_matcher
https://github.com/rust-lang/rust/pull/56072

check arg/ret sizedness at ExprKind::Path
https://github.com/rust-lang/rust/pull/56045

miri: accept extern types in structs if they are the only field
https://github.com/rust-lang/rust/pull/55672

miri engine refactoring
https://github.com/rust-lang/rust/pull/55915

allow assignments in const contexts
https://github.com/rust-lang/rust/pull/56070

clean up and streamline snapshot data structures
https://github.com/rust-lang/rust/pull/55906

remove clones made redundant by Intern SourceId
https://github.com/rust-lang/cargo/pull/6347

cleanup from lexical MIR borrowck removal
https://github.com/rust-lang/rust/pull/55959

stabilize extern_crate_item_prelude
https://github.com/rust-lang/rust/pull/56032

generator fields are not necessarily initialized
https://github.com/rust-lang/rust/pull/56100

stabilize the int_to_from_bytes feature
https://github.com/rust-lang/rust/pull/56207

add std::iter::unfold
https://github.com/rust-lang/rust/pull/55869

read_c_str should call the AllocationExtra hooks
https://github.com/rust-lang/rust/pull/56210

implement checked_add_duration for SystemTime
https://github.com/rust-lang/rust/pull/55527

return &T / &mut T in ManuallyDrop Deref(Mut) impl
https://github.com/rust-lang/rust/pull/55485

debug: fix VecDeque pretty-printer
https://github.com/rust-lang/rust/pull/55961

debug: fix BTreeSet and BTreeMap gdb pretty-printers
https://github.com/rust-lang/rust/pull/56144

do not panic just because cargo failed
https://github.com/rust-lang/rust/pull/55867

cargo: allow crate_type=bin examples to run
https://github.com/rust-lang/cargo/pull/6330
News

Announcing Rust 2018 Beta release.
https://internals.rust-lang.org/t/announcing-rust-2018-beta-release/8901

Announcing Firecracker from Amazon: MicroVM for serverless computing.
https://aws.amazon.com/blogs/opensource/firecracker-open-source-secure-fast-microvm-serverless/

Rust survey 2018 results.
https://blog.rust-lang.org/2018/11/27/Rust-survey-2018.html

Getting started with nightly async/await support.
https://jsdw.me/posts/rust-asyncawait-preview/

Converting AsyncRead and AsyncWrite to Futures, Sinks, and Streams.
https://jsdw.me/posts/rust-futures-tokio/

Bootstrapping an embedded Rust development environment.
https://josh.robsonchase.com/embedded-bootstrapping/

Tide's evolving middleware approach.
https://rust-lang-nursery.github.io/wg-net/2018/11/27/tide-middleware-evolution.html

Rust traits and their (lack of) privacy.
https://phaazon.net/blog/rust-traits-privacy

Serverless HTTP.
https://medium.com/@softprops/serverless-http-9a58f9b2df60

Generic methods in Rust: How Exonum shifted from Iron to Actix-web.
https://medium.com/meetbitfury/generic-methods-in-rust-how-exonum-shifted-from-iron-to-actix-web-7a2752171388

Rust+GNOME Hackfest 4.
http://antoyo.ml/rust-gnome-hackfest-thessaloniki

Amethyst Foundation has been formed.
https://www.amethyst.rs/blog/non-profit-announce/

Rust language cheat sheet (cheats.rs).
https://cheats.rs

Rust Latam CFP is now open, deadline is December 31st. Also ticket sales are open.
https://cfp.rustlatam.org/events/rust-latam

Videos from Rust Belt Rust 2018 are now available.
https://www.youtube.com/playlist?list=PLgC1L0fKd7UlpVTHVfLYVtudVx8CzbSxW
Crate of the week: modulator

This week's crate is modulator, a crate of abstract modulators for use in audio synthesizers (and possibly elsewhere). Thanks to Andrea Pessino for the suggestion!
Updates from core

decouple proc_macro from the rest of the compiler
https://github.com/rust-lang/rust/pull/49219

implement chalk unification routines
https://github.com/rust-lang/rust/pull/56214

upgrade LLVM to trunk, still version 8
https://github.com/rust-lang/rust/pull/55835

another LLVM Update and Re-enable lldb
https://github.com/rust-lang/rust/pull/56313

use sort_by_cached_key when the key function is not trivial/free
https://github.com/rust-lang/rust/pull/55821

deduplicate literal → constant lowering
https://github.com/rust-lang/rust/pull/56312

use MaybeUninit instead of mem::uninitialized for Windows Mutex
https://github.com/rust-lang/rust/pull/56275

libcore: add VaList and variadic arg handling intrinsics
https://github.com/rust-lang/rust/pull/49878

arena: speed up TypedArena::clear and improve common patterns
https://github.com/rust-lang/rust/pull/56378

stabilize macro_at_most_once_rep
https://github.com/rust-lang/rust/pull/56245

stabilize dbg!(..)
https://github.com/rust-lang/rust/pull/56395

stabilize self_in_typedefs
https://github.com/rust-lang/rust/pull/56366

stabilize self_struct_ctor
https://github.com/rust-lang/rust/pull/56365

remove unsafe unsafe inner function
https://github.com/rust-lang/rust/pull/56236

add TryFrom<&[T]> for [T; $N] where T: Copy
https://github.com/rust-lang/rust/pull/56216

move VecDeque::resize_with out of the impl block
https://github.com/rust-lang/rust/pull/56401

use allow-dirty option in cargo package to skip vcs checks
https://github.com/rust-lang/cargo/pull/6280

make ParseIntError and IntErrorKind fully public
https://github.com/rust-lang/rust/pull/55705

use MaybeUninit in libcore
https://github.com/rust-lang/rust/pull/54668

fix futures creating aliasing mutable and shared ref
https://github.com/rust-lang/rust/pull/56319

add libstd Cargo feature panic_immediate_abort
https://github.com/rust-lang/rust/pull/55011

cargo: ConflictStoreTrie: faster filtered search
https://github.com/rust-lang/cargo/pull/6366

crates.io: email verification warning
https://github.com/rust-lang/crates.io/pull/1565
Crate of the week: cargo-call-stack

This week's crate is cargo-call-stack, a cargo subcommand for whole-program call stack analysis. Thanks to Jorge Aparicio for the suggestion!
Updates from core

bump stack size to 32MB
https://github.com/rust-lang/rust/pull/56467

resolve: reduce some clutter in import ambiguity errors
https://github.com/rust-lang/rust/pull/56620

delay gensym creation for "_ items" (use foo as _/const _) until name resolution
https://github.com/rust-lang/rust/pull/56392

codegen_llvm_back: improve allocations
https://github.com/rust-lang/rust/pull/55871

panic on include bytes of own file
https://github.com/rust-lang/rust/pull/54517

fix ICE with generators and NLL
https://github.com/rust-lang/rust/pull/56460

fix ICE in const slice patterns
https://github.com/rust-lang/rust/pull/55922

handle existential types in dead code analysis
https://github.com/rust-lang/rust/pull/56456

more MIR borrow check cleanup
https://github.com/rust-lang/rust/pull/56388

use a SmallVec within _match::Matrix
https://github.com/rust-lang/rust/pull/56269

introduce ptr::hash for references
https://github.com/rust-lang/rust/pull/56250

allow calling const unsafe fn in const fn behind a feature gate
https://github.com/rust-lang/rust/pull/55635

add template parameter debuginfo to generic types
https://github.com/rust-lang/rust/pull/55010

add Weak.ptr_eq
https://github.com/rust-lang/rust/pull/55987

optimized String FromIterator + Extend impls
https://github.com/rust-lang/rust/pull/56548

only ensure solutions are in the same file in cargo fix
https://github.com/rust-lang/cargo/pull/6402

emit error when doc generation fails
https://github.com/rust-lang/rust/pull/55933

rustdoc: Fix line numbers display
https://github.com/rust-lang/rust/pull/56498

rustdoc inline macro reexport
https://github.com/rust-lang/rust/pull/56315

crates.io: Mark API tokens as revoked
https://github.com/rust-lang/crates.io/pull/1567
News

🎈🎉 Announcing Rust 1.31 and Rust 2018. 🎉🎈
https://blog.rust-lang.org/2018/12/06/Rust-1.31-and-rust-2018.html

Rust 2018 is here… but what is it?
https://hacks.mozilla.org/2018/12/rust-2018-is-here/

Reflecting on Rust and WebAssembly in 2018.
https://rustwasm.github.io/2018/12/06/reflecting-on-rust-and-wasm-in-2018.html

Rocket v0.4: Typed URIs, database support, revamped queries, & more.
https://rocket.rs/v0.4/news/2018-12-08-version-0.4/

Inside Rust's async transform.
https://blag.nemo157.com/2018/12/09/inside-rusts-async-transform.html

The Swiss army knife of hashmaps.
https://blog.waffles.space/2018/12/07/deep-dive-into-hashbrown/

Building Alexa Skills in Rust.
https://medium.com/@amalec/building-alexa-skills-in-rust-4cf54a497ea4

Wherefore art thou Romio? Romio is a port of a small part of the Tokio project to the newer futures APIs.
https://boats.gitlab.io/blog/post/romio/

Existential types in Rust.
https://adelbertc.github.io/posts/2018-12-10-rust-existentials.html

Currying in Rust.
https://hashnode.com/post/currying-in-rust-cjpfb0i2z00cm56s2aideuo4z

More on RLS version numbering.
https://www.ncameron.org/blog/more-on-rls-version-numbering/

Patterns of Refactoring C to Rust: The case of librnoscript.
https://people.gnome.org/~federico/blog/guadec-2018-presentation.html
Crate of the week: lsd

This week's crate is lsd, a colorful and fast ls replacement. Thanks to Pierre Peltier for the suggestion!
Updates from core

x86: add the adx target feature to whitelist
https://github.com/rust-lang/rust/pull/56749

bump minimum required LLVM version to 6.0
https://github.com/rust-lang/rust/pull/56642

unconditionally emit the target-cpu LLVM attribute
https://github.com/rust-lang/rust/pull/56609

account for impl Trait when suggesting lifetime
https://github.com/rust-lang/rust/pull/56755

fixed issue with using Self ctor in typedefs
https://github.com/rust-lang/rust/pull/56850

clearer error message for dead assign
https://github.com/rust-lang/rust/pull/56439

emit error with span for empty asserts
https://github.com/rust-lang/rust/pull/56491

fix span for invalid number of parameters in trait method
https://github.com/rust-lang/rust/pull/56641

contexually dependent error message for E0424 when value is assigned to "self"
https://github.com/rust-lang/rust/pull/56572

don't depend on Allocation sizes for pattern length
https://github.com/rust-lang/rust/pull/56540

some cleanups around AllocId management
https://github.com/rust-lang/rust/pull/56461

improve MIR match generation for ranges
https://github.com/rust-lang/rust/pull/56810

rustc: add an unstable simd_select_bitmask intrinsic
https://github.com/rust-lang/rust/pull/56789

allow ptr::hash to accept fat pointers
https://github.com/rust-lang/rust/pull/56751

specialize: remove Boxes used by Children::insert
https://github.com/rust-lang/rust/pull/56744

infer: remove Box from a returned Iterator
infer: remove Box from a returned Iterator

TokenStream improvements
https://github.com/rust-lang/rust/pull/56737

remove tokenstream::Delimited
https://github.com/rust-lang/rust/pull/56369

overhaul FileSearch and SearchPaths
https://github.com/rust-lang/rust/pull/56090

SortedMap upgrades
https://github.com/rust-lang/rust/pull/56039

make const unsafe fn bodies unsafe
https://github.com/rust-lang/rust/pull/56706

self-profiler: add column for percent of total time
https://github.com/rust-lang/rust/pull/56702

#[must_use] on traits in stdlib
https://github.com/rust-lang/rust/pull/56677

fix BTreeMap UB
https://github.com/rust-lang/rust/pull/56648

std: activate compiler_builtins mem feature for no_std targets
https://github.com/rust-lang/rust/pull/56825

add checked_add method to Instant time type
https://github.com/rust-lang/rust/pull/56490

VecDeque: fix for stacked borrows
https://github.com/rust-lang/rust/pull/56161

std: depend directly on crates.io crates
https://github.com/rust-lang/rust/pull/56092

libtest: use deterministic HashMap, avoid spawning thread if there is no concurrency
https://github.com/rust-lang/rust/pull/56243

greatly improve rustdoc rendering speed issues
https://github.com/rust-lang/rust/pull/56005

rustdoc: fix local reexports of proc macros
https://github.com/rust-lang/rust/pull/56637
Crate of the week: yaserde

This week's crate is yaserde, a specialized XML (de)serialization crate compatible with serde. Thanks to Marc Antoine Arnaud for the suggestion!
Updates from core

add targets thumbv7neon-linux-androideabi and thumbv7neon-unknown-linux-gnueabihf
https://github.com/rust-lang/rust/pull/56947

less conservative uninhabitedness check
https://github.com/rust-lang/rust/pull/54125

remove "visited" set from inhabitedness checking
https://github.com/rust-lang/rust/pull/57033

short-circuit DefIdForest::intersection()
https://github.com/rust-lang/rust/pull/57060

make the 'a lifetime on TyCtxt useless
https://github.com/rust-lang/rust/pull/56601

trigger unsized coercions keyed on Sized bounds
https://github.com/rust-lang/rust/pull/56219

fix various aspects around let bindings inside const functions
https://github.com/rust-lang/rust/pull/56160

deny intra-doc link resolution failures in libstd
https://github.com/rust-lang/rust/pull/56941

process nested obligations in autoderef
https://github.com/rust-lang/rust/pull/54252

mark tuple structs as live if their constructors are used
https://github.com/rust-lang/rust/pull/56953

fix alignment for array indexing
https://github.com/rust-lang/rust/pull/57053

enable emission of alignment attrs for pointer params
https://github.com/rust-lang/rust/pull/57021

enum type instead of variant suggestion unification
https://github.com/rust-lang/rust/pull/56188

make basic CTFE tracing available on release builds
https://github.com/rust-lang/rust/pull/56973

remove TokenStream::JointTree
https://github.com/rust-lang/rust/pull/56964

miri: allocation is infallible
https://github.com/rust-lang/rust/pull/56981

fix mutable references in static mut
https://github.com/rust-lang/rust/pull/56916

simplify MIR generation for logical operations
https://github.com/rust-lang/rust/pull/56917

static eval: do not ICE on layout size overflow
https://github.com/rust-lang/rust/pull/56909

disable field reordering for repr(int)
https://github.com/rust-lang/rust/pull/56887

always run rustc in a thread
https://github.com/rust-lang/rust/pull/56813

version-gate the trailing semicolon change of return statements inside a match arm
https://github.com/rust-lang/rustfmt/pull/3250

add DoubleEndedIterator::nth_back
https://github.com/rust-lang/rust/pull/56802

mir-opt: make SimplifyCfg collapse goto chains starting from bb0
https://github.com/rust-lang/rust/pull/56764

treat ref-to-raw cast like a reborrow: do a special kind of retag
https://github.com/rust-lang/rust/pull/56741

MIR borrowck doesn't accept the example of iterating and updating a mutable reference
https://github.com/rust-lang/rust/pull/56649

rework treatment of $crate in procedural macros
https://github.com/rust-lang/rust/pull/56647

tweak query code for performance
https://github.com/rust-lang/rust/pull/56613

implement Eq, PartialEq and Hash for atomic::Ordering
https://github.com/rust-lang/rust/pull/56881

add unstable VecDeque::rotate_{left, right}
https://github.com/rust-lang/rust/pull/56842

remove Cycle::try_fold override
https://github.com/rust-lang/rust/pull/56904

short-circuit Rc/Arc equality checking on equal pointers where T: Eq
https://github.com/rust-lang/rust/pull/56550

stabilize Rc, Arc and Pin as method receivers
https://github.com/rust-lang/rust/pull/56805

stabilize min_const_unsafe_fn in 1.33
https://github.com/rust-lang/rust/pull/57067

stabilize Vec(Deque)::resize_with
https://github.com/rust-lang/rust/pull/57002

stabilize Pin
https://github.com/rust-lang/rust/pull/56939

stabilize underscore_imports
https://github.com/rust-lang/rust/pull/56303

bootstrap: Link LLVM as a dylib with ThinLTO
https://github.com/rust-lang/rust/pull/56944

profiler: simplify total_duration, improve readability
https://github.com/rust-lang/rust/pull/56918

cargo: warn on unused patches
https://github.com/rust-lang/cargo/pull/6470

rustdoc: add new CLI flag to load static files from a different location
https://github.com/rust-lang/rust/pull/57011
News

🎈🎉 Announcing Rust 1.31.1. 🎉🎈
https://blog.rust-lang.org/2018/12/20/Rust-1.31.1.html

Procedural macros in Rust 2018.
https://blog.rust-lang.org/2018/12/21/Procedural-Macros-in-Rust-2018.html

Tokio: A great 2018, an even better 2019.
https://tokio.rs/blog/2018-12-recap-2018/

Using C libraries un Rust: making a *-sys crate.
https://kornel.ski/rust-sys-crate

Rust asynchronous IO: from mio to coroutine.
https://github.com/Hexilee/async-io-demo

Methods for array initialization in Rust.
https://www.joshmcguigan.com/blog/array-initialization-rust/

Currying in rust Part 3 (The circle of life... aka why borrowchecker... why)!?
https://hashnode.com/post/currying-in-rust-part-3-the-circle-of-life-aka-why-borrowchecker-why-cjq3z1dd800dknds1sls4dqav

How to get better at Rust: For beginners.
https://hashnode.com/post/how-to-become-a-rust-super-developer-cjpv1ee7e000buhs2aqrdw2ym