Null
Crate of the week: winrt This week's crate is winrt, Microsoft's Rust/WinRT language projection.
Null
This week in Rust #338 — 12 may 2020 https://this-week-in-rust.org/blog/2020/05/12/this-week-in-rust-338/
Null
Updates from core Define UB in float-to-int casts to saturate rust-lang/rust/pull/71269 Improve bitcode generation for Apple platforms rust-lang/rust/pull/71970 Don't force rustc to do codegen for LTO builds rust-lang/cargo/pull/8192 Correctly handle UEFI targets as Windows-like when emitting sections for LLVM bitcode rust-lang/rust/pull/71881 Prevent compiler stack overflow for deeply recursive code rust-lang/rust/pull/55617 resolve: Relax fresh binding disambiguation slightly to fix regression rust-lang/rust/pull/71846 upgrade chalk and use chalk-solve/chalk-ir/chalk-rust-ir rust-lang/rust/pull/69406 Report cannot move errors in promoted MIR rust-lang/rust/pull/71587 Simplify the tcx.alloc_map API rust-lang/rust/pull/71508 Suggest removing semicolon in last expression only if it's type is known rust-lang/rust/pull/71894 Skip attempting to run coerce_unsized on an inference variable rust-lang/rust/pull/69530 Unify the undo log of all snapshot types rust-lang/rust/pull/69464 Reduce TypedArena creations in check_match rust-lang/rust/pull/71975 Shrink LocalDecl rust-lang/rust/pull/71942 Add remove_current_as_list to LinkedList's CursorMut rust-lang/rust/pull/71878 Add Arc::{incr, decr}_strong_count rust-lang/rust/pull/70733 Add Option to Force Unwind Tables rust-lang/rust/pull/69984 Make BTreeMap::new and BTreeSet::new const rust-lang/rust/pull/71839 Btreemap iter intertwined rust-lang/rust/pull/71510 Add core::future::{pending, ready} rust-lang/rust/pull/70834 futures: Refactor to reduce the amount of unsafe and duplicated code rust-lang/futures-rs/pull/2128 cargo: Update assertions in LTO calculations rust-lang/cargo/pull/8226 cargo: Try to remove secrets from http.debug rust-lang/cargo/pull/8222 cargo features: allow activated_features_unverified to communicate not-present rust-lang/cargo/pull/8194
Null
News Announcing Rust 1.43.1 blog.rust-lang.org Rust concurrency: the single-writer principle. medium.com/@polyglot_factotum This Month in Rust OSDev (April 2020) rust-osdev.com A no_std Rust binary fasterthanli.me Notes on io_uring boats.gitlab.io no_std async/await - soon on stable ferrous-systems.com "try fn" without special-casing Result dev.to time_it: A case study in Rust macros notes.iveselov.info Dynamic stylesheets and Yew conradludgate.com A practical introduction to async programming in Rust jamesmcm.github.io Rust Closures in FFI adventures.michaelfbryan.com Collecting many errors from an iterator of Results. tarquin-the-brave.github.io Auto-currying Rust Functions peppe.rs Converting bits to integers in Rust using generics dev.to Magnifying Glasses for Rust Assembly www.justanotherdot.com More Rust and Load Balancer Adventures medium.com/@bparli Porting North Korean Dictionaries with Rust digitalnk.com Rust verification tools alastairreid.github.io Series Announcement - Zero to Production in Rust www.lpalmieri.com What I Learned Contributing to Rust-Analyzer dev.to What’s the difference between a Rust char and a Go rune? www.christianfscott.com Writing A Wayland Compositor In Rust wiki.alopex.li Yak shaving conditional compilation in Rust bitshifter.github.io Oxidize Global Workshop and CfP announcement ferrous-systems.com Collecting many errors from an iterator of Results. tarquin-the-brave.github.io Writing Python inside your Rust code - Part 3 blog.m-ou.se Rust FFI - Building an ASN1 codec sjames.github.io [video] Building a simple GraphQL API with Actix and Juniper youtu.be [video] Named Field Init in C, C++20, Zig, Rust, & D www.youtube.com
Null
Crate of the week: cargo-workspaces This week's crate is cargo-workspaces, a cargo subcommand to manage your cargo workspace.
Null
This week in Rust #339 — 19 may 2020 https://this-week-in-rust.org/blog/2020/05/19/this-week-in-rust-339/
Max
о бота прорвлао)
Null
Updates from core add built in PSP target rust-lang/rust/pull/72062 emit a warning when optimization fuel runs out rust-lang/rust/pull/72067 literal error reporting cleanup rust-lang/rust/pull/72047 incomplete features can also be unsound rust-lang/rust/pull/72045 be less aggressive with DroplessArena/TypedArena growth rust-lang/rust/pull/71872 provide separate option for std debug asserts rust-lang/rust/pull/72146 rework the std::iter::Step trait rust-lang/rust/pull/69659 simpler slice Iterator methods rust-lang/rust/pull/72166 make RawVec::grow mostly non-generic rust-lang/rust/pull/72013 implement FromStr for OsString rust-lang/rust/pull/71662 make offset must_use rust-lang/rust/pull/72143 cargo: ignore broken console output in some situations rust-lang/cargo/pull/8236 cargo: handle LTO with an rlib/cdylib crate type rust-lang/cargo/pull/8254 cargo: gracefully handle errors during a build rust-lang/cargo/pull/8247
Null
News Five Years of Rust blog.rust-lang.org Structuring and handling errors in 2020 nick.groenen.me Taking Advantage of Auto-Vectorization in Rust nickwilcox.github.io State of Web Routing in Rust pksunkara.com Rust releases for single and multiple targets with GitHub Actions mateuscosta.me Getting Started With Rust By Building A Tiny Markdown Compiler jesselawson.org Parcel and Rust: A WASM Romcom dev.to Reading temperature sensor in Rust using Raspberry Pi GPIO dev.to Rust Analyzer - Next Few Years rust-analyzer.github.io Rust Closures in FFI adventures.michaelfbryan.com The case for using Rust for Automotive Software medium.com/@sojan.james Gamedev #4: Benefits of full-stack Rust www.jakobmeier.ch RISC-V OS using Rust Chapter 9: Block IO osblog.stephenmarz.com A Guide to Global Data in Rust paulkernfeld/global-data-in-rust [audio] What's New in Rust 1.42 and 1.43 rustacean-station.org [video] Jonathan Teaches Jason Rust! www.youtube.com [video] Educational Rust coding - Building a web app www.twitch.tv [video] Rust and C++ Cardiff Virtual Meetup www.youtube.com
Null
Crate of the week: apply This week's crate is apply, a tiny library for chaining free functions into method call chains.
ozkriff🇺🇦
@sovasergey 👍
Dårk
походу сдам курс "Innopolis Programming Windows Services With C++" на расте. вперед, REFS!
kitsu
This week in Rust #339 — 19 may 2020 https://this-week-in-rust.org/blog/2020/05/19/this-week-in-rust-339/
Кмк есть смысл оставить только вот этот тип сообщения, вся остальная простыня как-то избыточна
Dårk
Слушатель ivan (ratijas) - имеет разрешение показать вместо С++ всю мощь Rust
Sergey
Кмк есть смысл оставить только вот этот тип сообщения, вся остальная простыня как-то избыточна
оно само репостит всё но могу настроить боту, чтобы он сюда только заголовок пихал
Sergey
а ещё я зачем-то домотал до начала https://t.me/this_week_in_rust/4
ozkriff🇺🇦
оно само репостит всё но могу настроить боту, чтобы он сюда только заголовок пихал
обсуждали ж еще в 2019, вроде, и сошлись, что раз в неделю мелькающая простыня норм
Sergey
а, точно значит не меняю ничего
Willy
Можно подобное в Cargo.toml указать: [package.metadata.docs.rs] all-features = true rustdoc-args = ["--cfg", "docsrs"]
https://docs.rs/tokio/0.2.21/tokio/net/struct.UdpSocket.html Как я могу обрабатывать подключения?
Willy
(случайно ответил не на тот месседж)
Mikail
А, перепутал с TCP
Willy
Или в данном случае нельзя смотреть кто подключается?
Mikail
Ага
Кажется, что надо сделать bind()
Berkus
https://docs.rs/tokio/0.2.21/tokio/net/struct.UdpSocket.html Как я могу обрабатывать подключения?
bind -> listen -> get packet -> send response "соединения" в UDP нету
Mikail
Это я сделал.
sock.recv_from() вернет и данные, и отправителя
Willy
bind -> listen -> get packet -> send response "соединения" в UDP нету
Тогда мой сервер отвергает почему-то telnet. Или он для TCP?
Berkus
telnet это tcp
Anonymous
Неткат по удп умеет наверн
Berkus
netcat умеет
Anonymous
Попробуй nc -u
Willy
Значит я тупенький, спасибо :)
Anonymous
Udp умеет в тн коннектед сокеты,но это клиентсайд
Anonymous
Так, на будущее )
Matwey
а можно ли как-нибудь лайфтаймы объеденить во время спецификации типа?
Matwey
хочу чтобы было &('a + 'b) T
Sergey
хочу чтобы было &('a + 'b) T
Объяви третий лайфтайм И where ‘c: ‘a + ‘b
Anonymous
Это будет пересечение? Или расширение?
Mikail
Объединение лайфтаймов
Anonymous
Понятно, спасибо
Mikail
То есть пересечение типов
Anonymous
Вообще кто дольше живёт тут: 'ц: 'а, ц или а?
Anonymous
Спасибо
Alexander
То есть пересечение типов
Точнее, join в решётке. 😉
Cuno
'c живет дольше
Не меньше, если быть точнее
Hirrolot
Не меньше, если быть точнее
А когда объекты живут одинаково?
Cuno
А когда объекты живут одинаково?
Два объекта в одном векторе, например
Matwey
Господа
red75prime
А когда объекты живут одинаково?
указываем им один и тот же лайфтайм. С поправками на субтайпинг
Hirrolot
Ага, точно
Alexander
А когда объекты живут одинаково?
Одинаково — это тоже не меньше. 🤷‍♀️
Matwey
А я вот делаю типа итератор, и хочу чтобы возвращаемый функцией next() объект имел время жизни вплоть до следующего вызова этой функции. Можно ли так сделать?
Matwey
Просто следующий next() для него кое-что испортит
Matwey
А это разве не просто ограничит время жизни временем жизни self?
red75prime
А это разве не просто ограничит время жизни временем жизни self?
Лайфтайм аннотации не влияют на время жизни объектов. Чтобы вызвать my_next() нужно будет дропнуть предыдущий MyObject. Иначе не скомпилируется
Matwey
Ну я так и хочу
red75prime
А это разве не просто ограничит время жизни временем жизни self?
Или другими словами self будет заблокирован на время жизни MyObject.
вафля
А как в Debug перенаправлять нижележащим объектам alternate флаг? Т.е. у меня сейчас что-то такого рода: fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { f.write_fmt(format_args!( "Quantity<_, {unit:?}>({value:?})", value = self.storage, unit = U::default(), )) } Хочется чтобы alternate флаг передавался ниже и value с unit форматировались с ним
Mikail
Два объекта в одном векторе, например
Ну, можно считать, что один умрет чуть позже.
mental
А почему, владея [Vec<T>; N] я не могу сделать его плоским Vec<T>? T: Copy + Clone, конечно же
mental
Можешь: мемкпи все элементы в новый вектор
Мне просто непонятна причина, почему into_iter().flatten() не работает
Hirrolot
Потому что там ссылка
Hirrolot
А, подожди
Hirrolot
Да, походу ссылка там, поэтому не можешь
mental
Странная штука. Интересно почему так, ведь все владения есть
вафля
Наверно только f.write_str("Quantity<_, ")?; self.storage.fmt(f)?; и т.д.
Ugh. А это будет нормально по ЗиРоКоСтНоСтИ? (если не считать что io всё равно будет гораздо больнее) Или может лучше сделать if f.alternate() и в зависимости от делать {:#?} или {:?}?
Hirrolot
Там была реализация, но в найтли AFAIK
Mikail
А почему, владея [Vec<T>; N] я не могу сделать его плоским Vec<T>? T: Copy + Clone, конечно же
Потому что эти маленькие вектора лежат не подряд. Придется выбрать один, перенести в него остальные и им пользоваться.
вафля
А почему, владея [Vec<T>; N] я не могу сделать его плоским Vec<T>? T: Copy + Clone, конечно же
Можешь воспользоваться чем-то что делает правильный IntoIter для массива. Например arraylib + arr.iter_move()
Mikail
Например сделать split_at_mut(0) И дальше в первый переносить все остальные, и потом его take-нуть