Squash all lints tied to foreign macros by default
This PR is a continuation of https://github.com/rust-lang/rust/pull/49755 (thanks for the initial jump-start @Dylan-DPC!) and is targeted at solving https://github.com/rust-lang/rust/issues/48855. This change updates the lint infrastructure to, by default, ignore all lints emitted for code that originates in a foreign macro. For example if `println!("...")` injects some idiomatic warnings these are all ignored by default. The rationale here is that for almost all lints there's no action that can be taken if the code originates from a foreign lint.
Closes#48855Closes#52483Closes#52479
rustc: Stabilize #[wasm_import_module] as #[link(...)]
This commit stabilizes the `#[wasm_import_module]` attribute as
`#[link(wasm_import_module = "...")]`. Tracked by #52090 this new directive in
the `#[link]` attribute is used to configured the module name that the imports
are listed with. The WebAssembly specification indicates two utf-8 names are
associated with all imported items, one for the module the item comes from and
one for the item itself. The item itself is configurable in Rust via its
identifier or `#[link_name = "..."]`, but the module name was previously not
configurable and defaulted to `"env"`. This commit ensures that this is also
configurable.
Closes#52090
Using a `BTreeMap` to represent rows in the bit matrix is really slow.
This patch changes things so that each row is represented by a
`BitVector`. This is a less sparse representation, but a much faster
one.
As a result, `SparseBitSet` and `SparseChunk` can be removed.
Other minor changes in this patch.
- It renames `BitVector::insert()` as `merge()`, which matches the
terminology in the other classes in bitvec.rs.
- It removes `SparseBitMatrix::is_subset()`, which is unused.
- It reinstates `RegionValueElements::num_elements()`, which #52190 had
removed.
- It removes a low-value `debug!` call in `SparseBitMatrix::add()`.
sync::Once use release-acquire access modes
Nothing here makes a case distinction like "this happened before OR after that". All we need is to get happens-before edges whenever we see that the state/signal has been changed. Release-acquire is good enough for that.
RFC 2008 non-exhaustive enums/structs: Rustdoc
Part of #44109. Not sure how those who maintain rustdoc primarily would prefer this addition look or where it should be placed, happy to make any changes required.
r? @QuietMisdreavus (not sure if this is the right person, just guessing)
We used to hardcode that we wanted the liveness of *all* variables.
This can now be configured by selecting an alternative index type
V and providing a (partial) map from locals to that new type V.
This commit fixes an issue where multiple custom attributes could not be fed
into a custom derive in some situations with the `use_extern_macros` feature
enabled. The problem was that the macro expander didn't consider that it was
making progress when we were deducing that attributes should be lumped in with
custom derive invocations.
The fix applied here was to track in the expander if our attribute is changing
(getting stashed away elsewhere and replaced with a new invocation). If it is
swapped then it's considered progress, otherwise behavior should remain the
same.
Closes#52525
This commit updates the tokenization of items which are subsequently passed to
`proc_macro` to ensure that span information is preserved on attributes as much
as possible. Previously this area of the code suffered from #43081 where we
haven't actually implemented converting an attribute to to a token tree yet, but
a local fix was possible here.
Closes#47941
overhaul exit codes for rustc and rustdoc
This commit changes the exit status of rustc to 1 in the presence of
compilation errors. In the event of an unexpected panic (ICE) the
standard panic error exit status of 101 remains.
A run-make test is added to ensure that the exit code does not regress,
and compiletest is updated to check for an exit status of 1 or 101,
depending on the mode and suite.
This is a breaking change for custom drivers.
Note that while changes were made to the rustdoc binary, there is no
intended behavior change. rustdoc errors (i.e., failed lints) will still
report 101. While this could *also* hide potential ICEs, I will leave
that work to a future PR.
Fixes#51971.
Rollup of 13 pull requests
Successful merges:
- #51628 (use checked write in `LineWriter` example)
- #52116 (Handle array manually in str case conversion methods)
- #52218 (Amend option.take examples)
- #52418 (Do not use desugared ident when suggesting adding a type)
- #52439 (Revert some changes from #51917 to fix custom libdir)
- #52455 (Fix doc comment: use `?` instead of `.unwrap()`)
- #52458 (rustc: Fix a suggestion for the `proc_macro` feature)
- #52464 (Allow clippy to be installed with make install)
- #52472 (rustc: Enable `use_extern_macros` in 2018 edition)
- #52477 (Clarify short-circuiting behvaior of Iterator::zip.)
- #52480 (Cleanup #24958)
- #52487 (Don't build twice the sanitizers on Linux)
- #52510 (rustdoc: remove FIXME about macro redirects)
Failed merges:
r? @ghost
update compiler-builtins for openbsd
import rust-lang-nursery/compiler-builtins/pull/249 in rust main line.
it solves an issue on OpenBSD with building of `librsvg`.
rustdoc: remove FIXME about macro redirects
Based on the discussion in #35705, the rustdoc team has determined that macro redirects are here to stay.
Closes#35705
This commit removes a hack in our ThinLTO passes which removes available
externally functions manually. The [upstream bug][1] has long since been fixed,
so we should be able to rely on LLVM natively for this now!
[1]: https://bugs.llvm.org/show_bug.cgi?id=35736