Вход на сайт

Просмотр новости

Найдите то, что Вас интересует

Optimization of inlined functions returning Result?

Дата публикации: 06-10-2026 09:59:40


from the json-rust parser.rs:
// There is a lot of macros here! Like, woah! This is mostly due to the fact
// that Rust isn't very cool about optimizing inlined functions that return
// a `Result` type. Since different functions will have different `Result`
// signatures, the `try!` macro will always have to repackage our results.
// With macros those issues don't exist, the macro will return an unpackaged
// result - whatever it is - and if we ever stumble upon the error, we can
// return an `Err` without worrying about the exact signature of `Result`.
//
// This makes for some ugly code, but it is faster. Hopefully in the future
// with MIR support the compiler will get smarter about this.
how true is this still?
3 posts - 3 participants
Read full topic

Схожие новости

#Наименование новостиТональностьИнформативностьДата публикации
1Limitations of `min_specialization` when specializing a generic implementation?09.3804-10-2026
2Rust Derive Macros: Why the Compiler Automatically Inlines Them09.2907-10-2026
3Type erasure and dyn lifetime in a NonNull/Box struct field08.5504-10-2026
4Why no Dependent Matrix Type?05.1608-10-2026
5Strategies for dyn trait objects with optional behavior?07.1206-10-2026
6Calling static C++ method from Rust09.9404-10-2026
7Why is f32/f64::sqrt not const?022.7206-10-2026
8Does my lockfree stack impl look correct?06.0605-10-2026
9Array initialization post declaration016.7906-10-2026
10Trait object with associated types in field - requires generic param?011.0807-10-2026

Классификация: . Схожих патентов: 0. Схожих новостей: 10. Тональность: 0. Информативность: 7.36. Источник: users.rust-lang.org.