rust/library/std/src
Matthias Krüger 8871fe8bda
Rollup merge of #90296 - CAD97:rip-lerp, r=Mark-Simulacrum
Remove fNN::lerp

Lerp is [surprisingly complex with multiple tradeoffs depending on what guarantees you want to provide](https://github.com/rust-lang/rust/issues/86269#issuecomment-869108301) (and what you're willing to drop for raw speed), so we don't have consensus on what implementation to use, let alone what signature - `t.lerp(a, b)` nicely puts `a, b` together, but makes dispatch to lerp custom types with the same signature basically impossible, and major ecosystem crates (e.g. nalgebra, glium) use `a.lerp(b, t)`, which is easily confusable. It was suggested to maybe provide a `Lerp<T>` trait and `t.lerp([a, b])`, which _could_ be implemented by downstream math libraries for their types, but also significantly raises the bar from a simple fNN method to a full trait, and does nothing to solve the implementation question. (It also raises the question of whether we'd support higher-order bezier interpolation.)

The only consensus we have is the lack of consensus, and the [general temperature](https://github.com/rust-lang/rust/issues/86269#issuecomment-951347135) is that we should just remove this method (giving the method space back to 3rd party libs) and revisit this if (and likely only if) IEEE adds lerp to their specification.

If people want a lerp, they're _probably_ already using (or writing) a math support library, which provides a lerp function for its custom math types and can provide the same lerp implementation for the primitive types via an extension trait.

See also [previous Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/lerp.20API.20design)

cc ``@clarfonthey`` (original PR author), ``@m-ou-se`` (original r+), ``@scottmcm`` (last voice in tracking issue, prompted me to post this)

Closes #86269 (removed)
2021-10-26 19:32:44 +02:00
..
backtrace Add Frames iterator for Backtrace 2021-01-23 11:56:33 -06:00
collections Rollup merge of #89558 - lcnr:query-stable-lint, r=estebank 2021-10-24 15:48:42 +02:00
env std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
error std: move "mod tests/benches" to separate files 2020-08-31 02:56:59 +00:00
f32 Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
f64 Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
ffi Auto merge of #90007 - xfix:inline-cstr-from-str, r=kennytm 2021-10-22 21:01:59 +00:00
fs Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
io Rollup merge of #89753 - jkugelman:must-use-from_value-conversions, r=joshtriplett 2021-10-11 14:11:45 +02:00
lazy Upgrade wasm32 image to Ubuntu 20.04 2021-02-06 13:05:56 +01:00
net Rollup merge of #86984 - Smittyvb:ipv4-octal-zero, r=m-ou-se 2021-10-21 14:11:01 +09:00
num rustc_expand: Mark inner #![test] attributes as soft-unstable 2020-11-20 19:35:03 +03:00
os Rollup merge of #88300 - ijackson:exitstatusext-methods, r=yaahc 2021-10-23 05:28:20 +02:00
panic review: fix nits and move panic safety tests to the correct place 2020-09-25 23:10:24 +02:00
path Ensure that pushing empty path works as before 2021-10-14 08:59:28 +01:00
prelude Move asm! and global_asm! to core::arch 2021-07-18 18:30:58 -04:00
process Test that env_clear works on Windows 2021-06-24 09:32:24 +01:00
sync Remove redundant Aligner 2021-10-26 11:34:03 +01:00
sys Add comment documenting why we can't use a simpler solution 2021-10-22 09:55:32 -04:00
sys_common Rollup merge of #89707 - clemenswasser:apply_clippy_suggestions, r=Mark-Simulacrum 2021-10-11 00:34:39 +02:00
thread Add caveat about changing parallelism and function call overhead 2021-10-23 13:01:07 +02:00
time Rollup merge of #88651 - AGSaidi:monotonize-inner-64b-aarch64, r=dtolnay 2021-10-04 23:56:17 -07:00
alloc.rs Rename rterr to rtprintpanic 2021-05-19 15:52:09 +02:00
ascii.rs Convert many files to intra-doc links 2020-09-02 17:37:40 -04:00
backtrace.rs Fix may not to appropriate might not or must not 2021-07-29 01:15:20 -04:00
env.rs library/std/env: Add 'm68k' to comment on ARCH constant 2021-09-17 15:07:14 +00:00
error.rs Stabilize try_reserve 2021-10-04 10:29:46 +01:00
f32.rs Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
f64.rs Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
fs.rs Add #[must_use] to is_condition tests 2021-10-11 21:15:57 -04:00
keyword_docs.rs Fix typo in break docs 2021-09-16 14:51:14 +03:00
lazy.rs Add #[must_use] to core and std constructors 2021-10-10 02:44:26 -04:00
lib.rs Remove fNN::lerp - consensus unlikely 2021-10-25 22:44:41 -05:00
macros.rs bump bootstrap compiler to 1.55 2021-08-01 11:19:24 -04:00
num.rs Add Saturating type (based on Wrapping type) 2021-08-10 19:27:01 +02:00
panic.rs Deduplicate panic_fmt 2021-10-19 15:02:21 +01:00
panicking.rs Deduplicate panic_fmt 2021-10-19 15:02:21 +01:00
path.rs Ensure that pushing empty path works as before 2021-10-14 08:59:28 +01:00
primitive_docs.rs Add primitive documentation to libcore 2021-09-12 02:23:08 +00:00
process.rs Rollup merge of #88436 - lf-:stabilize-command-access, r=yaahc 2021-10-09 17:08:39 +02:00
rt.rs Deduplicate panic_fmt 2021-10-19 15:02:21 +01:00
time.rs Auto merge of #88652 - AGSaidi:linux-aarch64-should-be-actually-monotonic, r=yaahc 2021-10-17 09:30:30 +00:00