Ah, excellent! I was going to try to track you down!
The discussion so far seems to have settled on picking some hitherto unused syntax that simple literals desugar to. The current syntax strawman is 42i32 -> 42::[i32]. It is unclear what the grammar inside ::[] (which one might be tempted to call a āturbolitā, as in āturbofishā) is going to be, but the idea is that expressions like 123::[m/s] will be desugared into something like m::int_lit(123).lit_div::<s>(). I think that this is far more than I want to try to figure out in an initial RFC, so Iām punting on any literals that arenāt Rust identifiers. (Also, as nice as having a symbol for angstroms sounds, Iām not going to be in favor of allowing non-ascii outside of str/char lits.)
Right, this is a problem my proposal is blocked on. In order to happen, we need to sort out my literal types proposal (which I linked in the OP), which adds the unsized types i__ and f__. In principle it might be ok to have &'static i__ around at runtime, but itād need to be cast to i32 or whatever first (which would be mediated by a compiler-provided shim, leaving the representation of such pointers unspecified).
Your alternate proposal is interesting, but has a few problems. First, weād probably want this:
// core::marker
pub unsafe trait FromLiteral {}
unsafe impl FromLiteral for i32 {}
unsafe impl FromLiteral for &'static str {}
to have as a bound for T in your trait. Thereās also the problem that you need to implement it all at once for all of the number types if you want reasonable behavior, and thereās no good way to enforce this. We also canāt enforce that you need e.g. T = i64 if you want T = f64. My FloatLit has IntLit as a supertrait.
There isnāt. The rationale for adding this is the same rational for any operator overloading: ergonomics and readability. (Of course, like all operators, itās a massive readability footgun if overused, but that ship sailed with the rest of the ops traits.)