Use https for sourceforge during CI
I saw that we use http during CI opening up the CI process to on the wire tampering.
based on #86573
r? `@pietroalbini`
Add `BuildHasher::hash_one` as unstable
Inspired by https://github.com/rust-lang/rust/pull/86140/files#diff-246941135168fbc44fce120385ee9c3156e08a1c3e2697985b56dcb8d728eedeR2416, where I wanted to write a quick test for a `Hash` implementation and it took more of a dance than I'd hoped.
It looks like this would be handy in hashtable implementations, too -- a quick look at hashbrown found two places where it needs to do the same dance:
6302512a8a/src/map.rs (L247-L270)
I wanted to get a "seems plausible" from a libs member before making a tracking issue, so random-sampling the intersection of highfive and governance gave me...
r? `@joshtriplett`
(As always, bikeshed away! And let me know if I missed something obvious again that I should have used instead.)
Don't lint :pat when re-parsing a macro from another crate.
`compile_macro` is used both when compiling the original definition in the crate that defines it, and to compile the macro when loading it when compiling a crate that uses it. We should only emit lints in the first case.
This adds a `is_definition: bool` to pass this information in, so we don't warn about things that only concern the definition site.
Fixes#86567
Even if the content from box is used in a sharef-ref context,
we capture the box entirerly.
This is motivated by:
1) We only capture data that is on the stack.
2) Capturing data from within the box might end up moving more data than
the user anticipated.
tidy: verify that test revisions with --target have associated needs-llvm-components directives
This ensures that people who tend to write `--target` `#[no_core]` tests don't miss specifying the `needs-llvm-components` directive. This is necessary for the test suite to pass when LLVM is compiled with a subset of components enabled.
While here I also took the opportunity to implement a more fine-grained handling of the ignore directives, so that they are evaluated for each revision, rather than for the entire test. With this even if people have `arm` component disabled, only the revision that depends on the arm component will not run.
Fixes https://github.com/rust-lang/rust/issues/82405
Otherwise something that ought to seemingly work like `//[x86]
needs-llvm-components: x86` or `//[nll_beyond]should-fail` do not get
evaluated properly.
Herein we verify that all of the tests that specify a `--target`
compile-flag, are also annotated with the minimal set of required llvm
components necessary to run that test.
Fix use placement for suggestions near main.
This fixes an edge case for the suggestion to add a `use`. When running with `--test`, the `main` function will be annotated with an `#[allow(dead_code)]` attribute. The `UsePlacementFinder` would end up using the dummy span of that synthetic attribute. If there are top-level inner attributes, this would place the `use` in the wrong position. The solution here is to ignore attributes with dummy spans.
In the process of working on this, I discovered that the `use_suggestion_placement` test was broken. `UsePlacementFinder` is unaware of active attributes. Attributes like `#[derive]` don't exist in the AST since they are removed. Fixing that is difficult, since the AST does not retain enough information. I considered trying to place the `use` towards the top of the module after any `extern crate` items, but I couldn't find a way to get a span for the start of a module block (the `mod` span starts at the `mod` keyword, and it seems tricky to find the spot just after the opening bracket and past inner attributes). For now, I just put some comments about the issue. This appears to have been a known issue in #44215 where the test for it was introduced, and the fix seemed to be deferred to later.
Due to the std/alloc split, it is not possible to make
`alloc::collections::TryReserveError::AllocError` non-exhaustive without
having an unstable, doc-hidden method to construct (which negates the
benefits from `#[non_exhaustive]`.
Permit zero non-zero-field on transparent types
Fixes#77841
This makes the transparent fields meet the below:
> * A `repr(transparent)` type `T` must meet the following rules:
> * It may have any number of 1-ZST fields
> * In addition, it may have at most one other field of type U
r? `@nikomatsakis`
Update cargo
This also updates `opener` used in bootstrap (to try to keep dependencies unified).
18 commits in 44456677b5d1d82fe981c955dc5c67734b31f340..9233aa06c801801cff75df65df718d70905a235e
2021-06-12 18:00:01 +0000 to 2021-06-22 21:32:55 +0000
- Detect incorrectly named cargo.toml (rust-lang/cargo#9607)
- Unify weak and namespaced features. (rust-lang/cargo#9574)
- Change `rustc-cdylib-link-arg` error to a warning. (rust-lang/cargo#9563)
- Updates to future-incompatible reporting. (rust-lang/cargo#9606)
- Add a compatibility notice for diesel and the new resolver. (rust-lang/cargo#9602)
- Don't allow config env to modify vars set by cargo (rust-lang/cargo#9579)
- Disambiguate is_symlink. (rust-lang/cargo#9604)
- Update opener requirement from 0.4 to 0.5 (rust-lang/cargo#9583)
- Avoid quadratic complexity when splitting output into lines (rust-lang/cargo#9586)
- Bump to 0.56.0, update changelog (rust-lang/cargo#9597)
- Fix dep-info files including non-local build script paths. (rust-lang/cargo#9596)
- Relax doc collision error. (rust-lang/cargo#9595)
- Handle "jobs = 0" case in cargo config files (rust-lang/cargo#9584)
- Enhancements to testsuite error output. (rust-lang/cargo#9589)
- Fix typo (rust-lang/cargo#9590)
- Enable support for fix --edition for 2021. (rust-lang/cargo#9588)
- Add more details for installing git repository errors (rust-lang/cargo#9582)
- More information for links conflicting (rust-lang/cargo#9568)
Support lowercase error codes in `--explain`
This enables `rustc --explain` to accept a lowercase error code. Thus, for instance, `rustc --explain e0573` would be valid after this change, where before a user would have needed to do `rustc --explain E0573`. Although the upper case form of an error code is canonical, the user may prefer the easier-to-type lowercase form, and there's nothing to be gained by forcing them to type the upper case version.
Resolves#86518.
Document associativity of iterator folds.
Document the associativity of `Iterator::fold` and
`DoubleEndedIterator::rfold` and add examples demonstrating this.
Add links to direct users to the fold of the opposite associativity.
Error code cleanup and enforce checks
Fixes#86097.
It now checks if an error code is unused, and if so, will report an error if the error code wasn't commented out in the `error_codes.rs` file. It also checks that the constant used in the tidy check is up-to-date.
r? `@Mark-Simulacrum`