Re:Ferrocene: Rust toolchain to safety-critical environments
by veber-alex on Tuesday July 26, 2022 @01:59PM
(#32241588)
> let b:&str = &"str";
This has nothing to do with DST but with type coercion.
The type of `b` is `&&str` but you requested the type to be `&str` which is fine as the compiler can coerce from `&&str` to `&str` in this case.
In the same way you can write
let b: &i32 = &&&&1;
and it will compile fine
Re:Ferrocene: Rust toolchain to safety-critical environments
by mjw1007 on Tuesday July 26, 2022 @12:39PM
(#32240592)
Better documentation for method resolution than the Reference has would be nice. But at the moment the Ferrocene spec just says
> 6.12:3 A method call expression is subject to method resolution
with "method resolution" marked as being a missing link.
1. Method resolution
2. Unstable?
In particular is it going to define lang items?
3. DST's
Rust has strange things like:
```
let a:&str = "str";
let b:&str = &"str";
```
Which is valid since str is a DST. Although slices and dyn trait are DST they have more strict rules there.
4. Qualified paths
There are more subtle things like qualified paths such as this testcase which could be argued is valid https://github.com/rust-lang/rust/blob/master/src/test/ui/qu... but there was some discussion on zulip which clarifies it: https://rust-lang.zulipchat.com/#narrow/stream/122651-genera...
5. Never type
TLDR: Overall I think its important at some point to start isolating what is the language outside of what version of libcore your running.