Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#116386 - elichai:patch-2, r=thomcc
Add missing inline attributes to Duration trait impls Currently `Duration::checked_add` is marked `#[inline]` but it's trait relative `Add::add` is not. Leading to a case where: ```rust pub fn foo() -> Duration { Duration::from_secs(10) + Duration::from_millis(6) } pub fn bar() -> Duration { Duration::from_secs(10).checked_add(Duration::from_millis(6)).expect("overflow when adding durations") } ``` compiles to: ```asm playground::foo: movl $10, %edi xorl %esi, %esi xorl %edx, %edx movl $6000000, %ecx jmpq *<core::time::Duration as core::ops::arith::Add>::add@GOTPCREL(%rip) playground::bar: movl $10, %eax movl $6000000, %edx retq ``` (The same happens for all arithmetic operation)
- Loading branch information