Implement the `min_const_fn` feature gate
cc @RalfJung @eddyb
r? @Centril
implements the feature gate for #53555
I added a hack so the `const_fn` feature gate also enables the `min_const_fn` feature gate. This ensures that nightly users of `const_fn` don't have to touch their code at all.
The `min_const_fn` checks are run first, and if they succeeded, the `const_fn` checks are run additionally to ensure we didn't miss anything.
This commit adds a few changes for atomic instructions on the
`wasm32-unknown-unknown` target. Atomic instructions are not yet stable in
WebAssembly itself but there are multiple implementations and LLVM has support
for the proposed instruction set, so let's work on exposing it!
Here there are a few inclusions:
* The `atomics` feature was whitelisted for LLVM, allowing code in Rust to
enable/disable/gate on this.
* The `singlethread` option is turned off for wasm when the `atomics` feature is
enabled. This means that by default wasm won't be lowering with atomics, but
when atomics are enabled globally we'll turn off single-threaded mode to
actually codegen atomics. This probably isn't what we'll want in the long term
but for now it should work.
* Finally the maximum atomic width is increased to 64 to reflect the current
wasm spec.
Backwards compatibility for tool/clippy lints
cc #44690
cc https://github.com/rust-lang-nursery/rust-clippy/pull/2977#issuecomment-409706557
This is the next step towards `tool_lints`.
This makes Clippy lints still work without scoping, but will warn and suggest the new scoped name. This warning will only appear if the code is checked with Clippy itself.
There is still an issue with using the old lint name in inner attributes. For inner attributes the warning gets emitted twice. I'm currently not really sure why this happens, but will try to fix this ASAP.
r? @Manishearth
Update LLVM submodule
This commit updates the LLVM submodule to the current trunk of LLVM itself. This
brings a few notable improvements for the wasm target:
* Support for wasm atomic instructions is greatly improved
* Renamed memory wasm intrinsics are fully supported
* LLD has fixed a quadratic execution bug with large numbers of relocations in
wasm files.
The compiler-rt submodule has been updated in tandem as well.
This commit updates the LLVM submodule to the current trunk of LLVM itself. This
brings a few notable improvements for the wasm target:
* Support for wasm atomic instructions is greatly improved
* Renamed memory wasm intrinsics are fully supported
* LLD has fixed a quadratic execution bug with large numbers of relocations in
wasm files.
The compiler-rt submodule has been updated in tandem as well.
rustdoc: add flag to control the html_root_url of dependencies
The `--extern-html-root-url` flag in this PR allows one to override links to crates whose docs are not already available locally in the doc bundle. Docs.rs currently uses a version of this to make sure links to other crates go into that crate's docs.rs page. See the included test for intended use, but the idea is as follows:
Calling rustdoc with `--extern-html-root-url crate=https://some-url.com` will cause rustdoc to override links that point to that crate to instead be replaced with a link rooted at `https://some-url.com/`. (e.g. for docs.rs this would be `https://docs.rs/crate/0.1.0` or the like.) Cheekily, rustup could use these options to redirect links to std/core/etc to instead point to locally-downloaded docs, if it so desired.
Fixes https://github.com/rust-lang/rust/issues/19603
With eRFC 2497, previously accepted ambigious syntax regarding use of
`&&` and `||` in if-let and while-let statements should now warn
or error depending on the edition.
This commit takes a naive approach to detecting ambigious use of `&&`
or `||` and will probably need fine tuned to handle all cases.
Fix promotion stability hole in old borrowck
r? @nikomatsakis
I screwed up the promotion stability checks. Big time. They were basically nonexistant. We had tests for it. I also screwed up said tests. This is in stable already :(
Basically stability checks of promotion only worked if you tried to use a const fn defined in the same crate.
cc @eddyb
Rollup of 20 pull requests
Successful merges:
- #51760 (Add another PartialEq example)
- #53113 (Add example for Cow)
- #53129 (remove `let x = baz` which was obscuring the real error)
- #53389 (document effect of join on memory ordering)
- #53472 (Use FxHash{Map,Set} instead of the default Hash{Map,Set} everywhere in rustc.)
- #53476 (Add partialeq implementation for TryFromIntError type)
- #53513 (Force-inline `shallow_resolve` at its hottest call site.)
- #53655 (set applicability)
- #53702 (Fix stabilisation version for macro_vis_matcher.)
- #53727 (Do not suggest dereferencing in macro)
- #53732 (save-analysis: Differentiate foreign functions and statics.)
- #53740 (add llvm-readobj to llvm-tools-preview)
- #53743 (fix a typo: taget_env -> target_env)
- #53747 (Rustdoc fixes)
- #53753 (expand keep-stage --help text)
- #53756 (Fix typo in comment)
- #53768 (move file-extension based .gitignore down to src/)
- #53785 (Fix a comment in src/libcore/slice/mod.rs)
- #53786 (Replace usages of 'bad_style' with 'nonstandard_style'.)
- #53806 (Fix UI issues on Implementations on Foreign types)
Failed merges:
r? @ghost