rustc_typeck: unify expected return types with formal return types to propagate coercions through calls of generic functions.
Reviewed-by: nikomatsakis
Using "generic" disables a number of features that are present on all
x86_64 cpus, the "x86-64" target cpu is the common denominator for that
arch.
Refs #20777
A derived implementation would not be appropriate for the Buffered types
since the buffer is both huge (64k by default) and full of uninitialized
memory. Instead of printing the whole thing, we display how full it is.
I also altered `MultiWriter` to make it generic over Writers instead of
taking `Box<Writer>` trait objects. `Box<Writer>` implements `Writer` so
existing use cases should continue to work, and this enables a more
useful Show implementation in applicable cases.
The change to `MultiWriter` may break code that uses it, but any fixes
should be easy.
[breaking-change]
r? @alexcrichton
Using "generic" disables a number of features that are present on all
x86_64 cpus, the "x86-64" target cpu is the common denominator for that
arch.
Refs #20777
I saw these hanging on a windows bot, and the previous ones seem to have calmed
down after switching from Thread::spawn to Thread::scoped, so try that here as
well!
I saw these hanging on a windows bot, and the previous ones seem to have calmed
down after switching from Thread::spawn to Thread::scoped, so try that here as
well!
Currently, small aggregates are passed to functions as immediate values
as is. This has two consequences.
One is that aggregates are passed component-wise by LLVM, so e.g. a
struct containing four u8 values (e.g. an RGBA struct) will be passed as
four individual values.
The other is that LLVM isn't very good at optimizing loads/stores of
first class attributes. What clang does is converting the aggregate to
an appropriately sized integer type (e.g. i32 for the four u8 values),
and using that for the function argument. This allows LLVM to create
code that is a lot better.
Fixes#20450#20149#16506#13927
A derived implementation would not be appropriate for the Buffered types
since the buffer is both huge (64k by default) and full of uninitialized
memory. Instead of printing the whole thing, we display how full it is.
I also altered MultiWriter to make it generic over Writers instead of
taking Box<Writer> trait objects. Box<Writer> implements Writer so
existing use cases should continue to work, and this enables a more
useful Show implementation in applicable cases.
The change to MultiWriter may break code that uses it, but any fixes
should be easy.
[breaking-change]
Currently even small fixed-size arrays are passed as indirect
parameters, which seems to be just an oversight. Let's handle them the
same as structs of the same size, passing them as immediate values.
Currently, small aggregates are passed to functions as immediate values
as is. This has two consequences.
One is that aggregates are passed component-wise by LLVM, so e.g. a
struct containing four u8 values (e.g. an RGBA struct) will be passed as
four individual values.
The other is that LLVM isn't very good at optimizing loads/stores of
first class attributes. What clang does is converting the aggregate to
an appropriately sized integer type (e.g. i32 for the four u8 values),
and using that for the function argument. This allows LLVM to create
code that is a lot better.
Fixes#20450#20149#16506#13927
Compiler gives the following warning:
`warning: the `u` suffix on integers is deprecated; use `us` or one of the fixed-sized suffixes`
And also the errror:
`error: mismatched types: expected `u64`, found `usize` (expected u64, found usize)`
Changing the suffix to `u64` results in a successful `cargo run` outputting the desired `Versions compared successfully!`