This commit extends the current unused macro linter
to support directives like #[allow(unused_macros)]
or #[deny(unused_macros)] directly next to the macro
definition, or in one of the modules the macro is
inside. Before, we only supported such directives
at a per crate level, due to the crate's NodeId
being passed to session.add_lint.
We also had to implement handling of the macro's
NodeId in the lint visitor.
remove the #[inline] attribute from drop_in_place
Apparently LLVM has exponential code growth while inlining landing pads
if that attribute is present.
Fixes#41696.
beta-nominating because regression.
r? @eddyb
* Handles `b"…"`, `br#"…"#` and `...` for `quote_expr!()`.
* Refactored the match statement to allow it to complain loudly on any
unhandled token.
* Similarly, proc_macro's `quote!()` did not handle `br#"…"#` or `r#"…"#`,
so this commit fixes it too.
Update jemalloc to 4.5.0
* pointing jemalloc submodule to the 4.5.0 HEAD + generated configure script
* removed the now unnecessary extra config for windows. jemalloc is now much better at configuring itself overall.
Let's see what the CI think.
rustc: Add a new `-Z force-unstable-if-unmarked` flag
This commit adds a new `-Z` flag to the compiler for use when bootstrapping the
compiler itself. We want to be able to use crates.io crates, but we also want
the usage of such crates to be as ergonomic as possible! To that end compiler
crates are a little tricky in that the crates.io crates are not annotated as
unstable, nor do they expect to pull in unstable dependencies.
To cover all these situations it's intended that the compiler will forever now
bootstrap with `-Z force-unstable-if-unmarked`. This flags serves a dual purpose
of forcing crates.io crates to themselves be unstable while also allowing them
to use other "unstable" crates.io crates. This should mean that adding a
dependency to compiler no longer requires upstream modification with
unstable/staged_api attributes for inclusion!
Fix unexpected panic with the -Z treat-err-as-bug option
This fix an issue where the compiler panics even if there is no error when passed with the `-Z treat-err-as-bug` option.
Fixes#35886.
r? @Mark-Simulacrum
config.toml.example: point out that optimize = false won't speed up a full bootstrap
Originally I've learned about this by @eddyb pointing this out to me over IRC, and after having told someone today the same over IRC I've thought that this is a common mistake and should be prevented by a note in config.toml.example
r? @eddyb
box large variants in MIR
Operand: 72 -> 24 B
Statement: 192 -> 96 B
Terminator: 256 -> 112 B
librustc translation memory usage: 1795 -> 1669 MB
next step would be interning lvalues, I suppose?
cc #36799 (@urschrei - does ostn15_phf compile with this PR?)
r? @eddyb
Removes unused macros from:
* libcore
* libcollections
The last use of these two macros was removed in commit
b64c9d5670
when the char_range_at_reverse function was been removed.
* librustc_errors
Their last use was removed by commits
2f2c3e1783
and 11dc974a38.
* libsyntax_ext
* librustc_trans
Also, put the otry macro in back/msvc/mod.rs under the
same cfg argument as the places that use it.
rustc: Stabilize `-C target-feature=+crt-static`
This commit stabilizes the `crt-static` feature accepted by the compiler. Note
that this does not stabilize the `#[cfg]` attribute for `crt-static` as
that's going to be covered by #29717. This only stabilizes a few small pieces:
* The `crt-static` feature as accepted by the `-C target-feature` flag, and its
connection with the platform-specific definition of `crt-static`.
* The semantics of `--print cfg` printing out activated `crt-static` feature, if
available.
This should be enough to get the benefits of `crt-static` on stable Rust with
MSVC and with musl, but sidsteps the issue of stabilizing #29717 first.
Closes#37406
enforce WF conditions after generalizing
Add a `WF(T')` obligation after generalizing `T` to `T'`, if `T'` contains an unconstrained type variable in a bivariant context.
Fixes#41677.
Beta nominating -- regression.
r? @arielb1
Operand: 72 -> 24 B
Statement: 192 -> 96 B
Terminator: 256 -> 112 B
librustc translation memory usage: 1795 -> 1669 MB
next step would be interning lvalues, I suppose?
Windows io::Error: also format NTSTATUS error codes
`NTSTATUS` errors may be encoded as `HRESULT`, see [[MS-ERREF]](https://msdn.microsoft.com/en-us/library/cc231198.aspx). These error codes can still be formatted using `FormatMessageW` but require some different parameters to be passed in.
I wasn't sure if this needed a test and if so, how to test it. Presumably we wouldn't want to make our tests dependent on localization-dependent strings returned from `FormatMessageW`.
Users that get an `err: NTSTATUS` will need to do `io::Error::from_raw_os_error(err|0x1000_0000)` (the equivalent of [`HRESULT_FROM_NT`](https://msdn.microsoft.com/en-us/library/ms693780(VS.85).aspx))