GitHub Actions: preparations, part 1
This PR adds the first batch of commits in preparation for GitHub Actions:
* Added GitHub Actions support in `src/ci/shared.sh` and bootstrap.
* Addded a `setup-environment.sh` script which guesses and sets the `DEPLOY`, `DEPLOY_ALT` and `IMAGE` environment variables automatically, to reduce the verbosity of the CI configuration.
This PR does **not** yet add any builders on GitHub Actions.
r? @alexcrichton
Add unix::process::CommandExt::arg0
This allows argv[0] to be overridden on the executable's command-line. This also makes the program
executed independent of argv[0].
Does Fuchsia have the same semantics? I'm assuming so.
Addresses: #66510
Preserve whitespace inside one-backtick codeblocks
Previously this was only done inside short docblocks (e.g., summary
lines), but we should also do so in general.
Fixes#65555
Use proc-macro to derive HashStable everywhere
Hello,
A second proc-macro is added to derive HashStable for crates librustc depends on.
This proc-macro `HashStable_Generic` (to bikeshed) allows to decouple code and strip much of librustc's boilerplate.
Still, two implementations `Span` and `TokenKind` require to be placed in librustc.
The latter only depends on the `bug` macro. Advise welcome on how to sever that link.
A trait `StableHasingContextLike` has been introduced at each crate root,
in order to handle those implementations which require librustc's very `StableHashingContext`.
This overall effort allowed to remove the `impl_stable_hash_for` macro.
Each commit passes the `x.py check`.
I still have to double check there was no change in the implementation.
Ast address-of
This is the parts of #64588 that don't affect MIR. If an address-of expression makes it to MIR lowering we error and lower to the best currently expressible approximation to limit further errors.
r? @Centril
Previously tidy would require that the `feature = "name_of_feature"`
part of the stability attribute was on the same line as the `#[stable(`
/ `#[unstable(` opening part of the attribute, and that `)]` was on the
same line as the last key-value pair.
That didn't work with rustfmt's preferred layout of long attributes,
which is like:
#[unstable(
feature = "c_variadic",
reason = "the `c_variadic` feature has not been properly tested on \
all supported platforms",
issue = "44930"
)]
When we normalize the types in a function signature, we may end up
resolving a projection to an opaque type (e.g. `Self::MyType` when
we have `type MyType = impl SomeTrait`). When the projection is
resolved, we will instantiate the generic parameters into fresh
inference variables.
While we do want to normalize projections to opaque types, we don't want
to replace the explicit generic parameters (e.g. `T` in `impl
MyTrait<T>`) with inference variables. We want the opaque type in the
function signature to be eligible to be a defining use of that opaque
type - adding inference variables prevents this, since the opaque type
substs now appears to refer to some specific type, rather than a generic
type.
To resolve this issue, we inspect the opaque types in the function
signature after normalization. Any inference variables in the substs are
replaced with the corresponding generic parameter in the identity substs
(e.g. `T` in `impl MyTrait<T>`). Note that normalization is the only way
that we can end up with inference variables in opaque substs in a
function signature - users have no way of getting inference variables
into a function signature.
Note that all of this refers to the opaque type (ty::Opaque) and its
subst - *not* to the underlying type.
Fixes#59342
Issue #22750
The error reporting for E0277 (the trait `X` is not implemented for `Foo`)
now checks whether `Foo` implements a trait with the same path as `X`,
which probably means that the programmer wanted to actually use only one
version of the trait `X` instead of the two.
Rework raw ident suggestions
Use heuristics to determine whethersuggesting raw identifiers is
appropriate.
Account for raw identifiers when printing a path in a `use` suggestion.
Fix#66126.