Forwarded from мне не нравится реальность
Statement of the day:
(|_, ()| ())(while true {});
Forwarded from мне не нравится реальность
Вы спросите: what???, а я отвечу:
Это MRE (minimal reproducible example) который показывает неправильную диагностику в компиляторе:
Это MRE (minimal reproducible example) который показывает неправильную диагностику в компиляторе:
error[E0308]: `if` and `else` have incompatible types
--> ./t.rs:2:18
|
2 | (|_, ()| ())(while true {});
| ^^^^^^^^^^^--
| | |
| | expected because of this
| expected `()`, found `!`
|
= note: expected unit type `()`
found type `!`
В реальном коде ошибка ещё страннее выглядела X)#prog #rust #rustlib
Reinventing Rust formatting syntax — заметка о fmtools, библиотеке, которая позволяет использовать в форматных строках произвольные выражения вместо просто идентификаторов и включать в них if-ы.
Пример
До:
Reinventing Rust formatting syntax — заметка о fmtools, библиотеке, которая позволяет использовать в форматных строках произвольные выражения вместо просто идентификаторов и включать в них if-ы.
Пример
До:
let power = 0.5;После:
print!("At ");
if power >= 1.0 {
print!("full");
} else {
print!("{:.0}%", power * 100.0);
}
print!(" power");
let power = 0.5;
fmtools::println!("At "
if power >= 1.0 { "full" }
else { {power * 100.0:.0}"%" }
" power");
👍3
Блог*
#prog #rust #article Вот только на практике такой прямолинейный пример просто так не заработает. И в статье The Better Alternative to Lifetime GATs рассказывается, почему.
#rust
https://github.com/rust-lang/rust/pull/96709#issuecomment-1173170243
Список крейтов, которым так или иначе требуются GAT
https://github.com/rust-lang/rust/pull/96709#issuecomment-1173170243
Список крейтов, которым так или иначе требуются GAT
GitHub
Stabilize generic associated types by jackh726 · Pull Request #96709 · rust-lang/rust
Closes #44265
r? @nikomatsakis
⚡ Status of the discussion ⚡
There have been several serious concerns raised, summarized here.
There has also been a deep-dive comment explaining some of the "...
r? @nikomatsakis
⚡ Status of the discussion ⚡
There have been several serious concerns raised, summarized here.
There has also been a deep-dive comment explaining some of the "...
👍2
Forwarded from мне не нравится реальность
Ещё одно классное:
А основная причина скорее всего всё та-же: некорректный код в диагностике неправильных аргументов функции.
(|_, ()| ())([return, ()]);
На этот раз аж ICE (internal compiler error)!А основная причина скорее всего всё та-же: некорректный код в диагностике неправильных аргументов функции.
😱3
Forwarded from ozkriff.games 🦀 (ozkriff🇺🇦)
# lib.rs Version Pages Now Link to Git Commits
When you publish a crate, Cargo makes a note of its git repository commit hash and includes it in the crates-io crate tarball. A few days ago Kornel announced that lib.rs started exposing this information, nice!
Also, check out https://lib.rs/stats if you haven't seen it yet, it has a bunch of cool graphs.
When you publish a crate, Cargo makes a note of its git repository commit hash and includes it in the crates-io crate tarball. A few days ago Kornel announced that lib.rs started exposing this information, nice!
Also, check out https://lib.rs/stats if you haven't seen it yet, it has a bunch of cool graphs.
👍2
#prog #rust #article
Статья в двух частях о rust-minidump — библиотеки для разбора minidump, разработанного в microsoft портируемого формата для хранения дампов памяти. К слову, именно она сейчас используется по умолчанию в Firefox в проде на протяжении где-то шести месяцев.
Everything Is Broken: Shipping rust-minidump at Mozilla – Part 1
В это части, в частности, рассказывается, зачем вообще решили делать RIIR, когда есть Breakpad от Google:
> Meanwhile, Google has kind-of moved on to Crashpad. I say kind-of because there’s still a lot of Breakpad in there, but they’re more interested in building out tooling on top of it than improving Breakpad itself. Having made a few changes to Breakpad: honestly fair, I don’t want to work on it either. Still, this was a bit of a problem for us, because it meant the project became increasingly under-staffed.
<...>
> Why is working on Breakpad so miserable, you ask?
> Parsing and analyzing minidumps is basically an exercise in writing a fractal parser of platform-specific formats nested in formats nested in formats. For many operating systems. For many hardware architectures. And all the inputs you’re parsing and analyzing are terrible and buggy so you have to write a really permissive parser and crawl forward however you can.
<...>
> Hey, you know who has a lot of experience dealing with really complicated permissive parsers written in C++? Mozilla! That’s like the core functionality of a web browser.
> Do you know Mozilla’s secret solution to writing really complicated permissive parsers in C++?
> We stopped doing it.
> We developed Rust and ported our nastiest parsers to it.
Fuzzing rust-minidump for Embarrassment and Crashes – Part 2
Во второй части рассказывается о том, как фаззинг сумел найти кучу багов, и подробно разбираются парочка из них (включая тот, который был сделан и Breakpad).
Статья в двух частях о rust-minidump — библиотеки для разбора minidump, разработанного в microsoft портируемого формата для хранения дампов памяти. К слову, именно она сейчас используется по умолчанию в Firefox в проде на протяжении где-то шести месяцев.
Everything Is Broken: Shipping rust-minidump at Mozilla – Part 1
В это части, в частности, рассказывается, зачем вообще решили делать RIIR, когда есть Breakpad от Google:
> Meanwhile, Google has kind-of moved on to Crashpad. I say kind-of because there’s still a lot of Breakpad in there, but they’re more interested in building out tooling on top of it than improving Breakpad itself. Having made a few changes to Breakpad: honestly fair, I don’t want to work on it either. Still, this was a bit of a problem for us, because it meant the project became increasingly under-staffed.
<...>
> Why is working on Breakpad so miserable, you ask?
> Parsing and analyzing minidumps is basically an exercise in writing a fractal parser of platform-specific formats nested in formats nested in formats. For many operating systems. For many hardware architectures. And all the inputs you’re parsing and analyzing are terrible and buggy so you have to write a really permissive parser and crawl forward however you can.
<...>
> Hey, you know who has a lot of experience dealing with really complicated permissive parsers written in C++? Mozilla! That’s like the core functionality of a web browser.
> Do you know Mozilla’s secret solution to writing really complicated permissive parsers in C++?
> We stopped doing it.
> We developed Rust and ported our nastiest parsers to it.
Fuzzing rust-minidump for Embarrassment and Crashes – Part 2
Во второй части рассказывается о том, как фаззинг сумел найти кучу багов, и подробно разбираются парочка из них (включая тот, который был сделан и Breakpad).
Wikipedia
Core dump
record of memory at the exact moment a computer program crashes, is terminated or explicitly requests a dump
👍4
Forwarded from мне не нравится реальность
Occult club registration rejected after complaint it may summon Satan to University of Adelaide
> "Even if we did want to summon Satan, it's not against university or union policy to do so, so it's still not really grounds to reject us," Adelaide University Occult Club president Ashley Towner said.
теперь это моя любимая новость
> "Even if we did want to summon Satan, it's not against university or union policy to do so, so it's still not really grounds to reject us," Adelaide University Occult Club president Ashley Towner said.
теперь это моя любимая новость
🔥5🤔1
Быть Антоном — это получать от абсолютно постороннего человека вопрос:
— Вы Металлику слушаете?
— Вы Металлику слушаете?
Блог*
— Молодой человек, не проходите мимо, купите кожаную куртку, с вашими волосами подойдёт!
Ну а хотя как будто в первый раз
бумеры смотрят телек
Анимешники ликуют: разработчик Александр Чау создал удобный гайд почти по всем существующим аниме. Можно отсортировать по году выпуска, количеству эпизодов, студии и даже актёру озвучки — фильтров много. Кто любит аниме — сохраняйте себе. Классная визуализация.…
Что ж, выбор, что постить — очевиден
👍4👎2🔥1
RWPS::Mirror
Photo
Launchpad
Bug #1463112 “Cat sitting on keyboard crashes lightdm” : Bugs : unity package : Ubuntu
14.04, locked screen to go to lunch, upon return from lunch cat was sitting on keyboard, login screen was frozen & unresponsive.
To replicate: In unity hit ctrl-alt-l, place keyboard on chair. Sit on keyboard.
Resolution: Switched to virtual terminal…
To replicate: In unity hit ctrl-alt-l, place keyboard on chair. Sit on keyboard.
Resolution: Switched to virtual terminal…
👍2
Forwarded from Таксики и лытдыбр σποραδικος
Был такой английский ботаник Ньюман, и вот он в середине 19-го века пытался воссоздать облик птеродактилей. Живите теперь с этим, не мне же одной
(господи, все мы)
(господи, все мы)
🤩7
Каждый раз, когда говорю бабушке, что еду в Москву, она спрашивает, не на свидание ли 😒
🔥5❤3