In some build environments (such as chrooted Nix builds), `env` can only
be found in the explicitly-provided PATH, not in default places such as
/bin or /usr/bin. So we need to pass-through PATH when spawning the
`env` sub-process.
Fixes#17617
Fixes that unit-like structs cannot be used if they are re-exported and used in another crate. (ICE)
The relevant changes are in `rustc::metadata::{decoder, encoder}` and `rustc::middle::ty`.
A test case is included.
The problem is that the expressoin `UnitStruct` is an `ExprPath` to an `DefFn`, which is of expr kind `RvalueDatumExpr`, but for unit-struct ctors the expr kind should be `RvalueDpsExpr`. I fixed this (in a I guess clean way) by introducing `CtorFn` in the metadata and including a `is_ctor` flag in `DefFn`.
prefer `Deref` over `DerefMut` in all other circumstances.
Because the compiler now prefers `Deref`, this can break code that
looked like:
let mut foo = bar.borrow_mut();
(*foo).call_something_that_requires_mutable_self();
Replace this code with:
let mut foo = bar.baz();
(&mut *foo).call_something_that_requires_mutable_self();
Closes#12825.
[breaking-change]
r? @nikomatsakis
This bound is already implicit through the AnyPrivate trait,
but since it is not explicit, you still have to write Box<Any + 'static>,
even though Any can only be 'static.
Introducing the 'static bound here makes this bound explicit, making
Box<Any> legal.
This bound is already implicit through the AnyPrivate trait,
but since it is not explicit, you still have to write Box<Any + 'static>,
even though Any can only be 'static.
Introducing the 'static bound here makes this bound explicit, making
Box<Any> legal.
In some build environments (such as chrooted Nix builds), `env` can only
be found in the explicitly-provided PATH, not in default places such as
/bin or /usr/bin. So we need to pass-through PATH when spawning the
`env` sub-process.
Fixes#17617
Modify ast::ExprMatch to include a new value of type ast::MatchSource,
making it easy to tell whether the match was written literally or
produced via desugaring. This allows us to customize error messages
appropriately.
I don't know exactly what made this regress so badly…maybe it was all the lifetimes that @eddyb landed. According to `git blame` this is all somewhat old code. Regardless this is an enormous improvement in compile times.
r? @brson
Fixes that unit-like structs cannot be used if they are reexported and
used in another crate. The compiler fails with an ICE, because unit-like
structs are exported as DefFn and the expression `UnitStruct` is
interpreted as function pointer instead of a call to the constructor.
To resolve this ambiguity tuple-like struct constructors are now exported
as CtorFn. When `rustc::metadata::decoder` finds a CtorFn it sets a new
flag `is_ctor` in DefFn to true.
Relevant changes are in `rustc::metadata::{encoder, decoder}` and in
`rustc::middle::ty`.
Closes#12660 and #16973.
This makes the windows `make dist` target start producing binary tarballs, and tweaks install.sh so they work, in preparation for working on a combined Rust+Cargo installer.
This is the bare minimum to stop using split stacks on Windows, fixing https://github.com/rust-lang/rust/issues/13259 and #14742, by turning on stack probes for all functions and disabling compiler and runtime support for split stacks on Windows.
It does not restore the out-of-stack error message, which requires more runtime work.
This includes a test that the Windows TCB is no longer being clobbered, but the out-of-stack test itself is pretty weak, only testing that the program exits abnormally, not that it isn't writing to bogus memory, so I haven't truly verified that this is providing the safety we claim.
A more complete solution is in https://github.com/rust-lang/rust/pull/16388, which has some unresolved issues yet.
cc @Zoxc @klutzy @vadimcn