rust/library/core/src
Matthias Krüger a660516334
Rollup merge of #117596 - thomcc:core_macro_diag_items, r=Nilstrieb
Add diagnostic items for a few of core's builtin macros

Specifically, `env`, `option_env`, and `include`. There are a number of reasons why people might want to look at these in lints (For example, to ensure that things behave consistently, detect things that might make builds less reproducible, etc).

Concretely, in PL/Rust (well, `plrustc`) we have lints that forbid these (which I'd like to [add to clippy as restriction lints](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Landing.20a.20flotilla.20of.20lints.3F) eventually), and `dylint` also has [lints that look for `env!`/`option_env!`](109a07e9f2/examples/general/env_cargo_path/src/lib.rs) (although perhaps not `include`), which would benefit from this.

My experience is that it's pretty annoying to (robustly) check uses of builtin macros without these IME, although that's perhaps just my own fault (e.g. I could be doing it wrong).

At `@Nilstrieb's` suggestion, I've added a comment that explains why these are here, even though they are not used in the compiler. This is mostly to discourage removal, although it's not a big deal if it happens (I'm certainly not suggesting the presence of these be in any way stable).

---

In theory this is a library PR (in that it's in library/core), but I'm going to roll compiler because the existence of this or not is much more likely something they care about rather than libs. Hopefully nobody objects to this.

r? compiler
2023-11-05 12:41:48 +01:00
..
alloc Update library/core/src/alloc/layout.rs 2023-10-12 16:03:45 -07:00
array Auto merge of #115515 - the8472:zip-for-arrays, r=scottmcm 2023-10-15 00:49:21 +00:00
ascii fix Debug impl for AsciiChar 2023-09-01 12:29:40 +01:00
async_iter use consistent terminology 2022-10-29 09:23:12 +02:00
cell Add some optimizations 2023-10-13 14:54:33 +02:00
char Refactor some char, u8 ascii functions to be branchless 2023-10-26 21:48:36 -04:00
cmp Merge two different equality specialization traits in core 2023-03-01 14:42:06 -08:00
convert Draft fleshed-out deref docs 2023-11-04 17:47:25 +00:00
ffi Fix invalid stability attribute features in standard library 2023-10-23 13:03:10 -07:00
fmt Add more diagnostic items for clippy 2023-10-05 18:21:47 -04:00
future s/Generator/Coroutine/ 2023-10-20 21:10:38 +00:00
hash clarify that unsafe code must not rely on our safe traits 2023-09-06 16:12:39 +02:00
intrinsics Bump to latest beta 2023-10-08 19:57:43 -04:00
iter Fix documentation typo in std::iter::Iterator::collect_into 2023-10-26 19:28:48 +02:00
macros Add diagnostic items for a few of core's builtin macros 2023-11-04 17:00:51 -07:00
mem Auto merge of #116218 - tgross35:const-maybe-uninit-zeroed, r=dtolnay 2023-11-05 05:56:21 +00:00
net Rollup merge of #116714 - WaffleLapkin:order-the-order, r=joshtriplett 2023-10-24 19:29:54 +02:00
num Rollup merge of #115626 - clarfonthey:unchecked-math, r=thomcc 2023-11-01 11:29:41 +01:00
ops Rollup merge of #110340 - jmaargh:jmaargh/deref-docs, r=Mark-Simulacrum 2023-11-04 21:38:28 +01:00
panic Increase the reach of panic_immediate_abort 2023-10-29 09:31:07 -04:00
prelude Revert "Remove #[alloc_error_handler] from the compiler and library" 2023-04-25 00:08:35 +02:00
ptr Stabilize [const_]pointer_byte_offsets 2023-10-25 22:35:12 +00:00
slice Make rustc_onunimplemented export path agnostic 2023-10-16 19:37:12 +02:00
str Increase the reach of panic_immediate_abort 2023-10-29 09:31:07 -04:00
sync s/generator/coroutine/ 2023-10-20 21:14:01 +00:00
task Auto merge of #96875 - SabrinaJewson:noop-waker, r=m-ou-se 2023-06-07 06:04:32 +00:00
unicode Apply changes to fix python linting errors 2023-06-16 20:56:01 -04:00
any.rs core/any: remove Provider trait 2023-08-13 13:07:53 -06:00
arch.rs use visibility to check unused imports and delete some stmts 2023-10-22 21:27:46 +08:00
ascii.rs ascii::Char-ify the escaping code 2023-05-12 19:37:02 -07:00
asserting.rs [RFC 2011] Library code 2022-05-22 07:18:32 -03:00
bool.rs core is now compilable 2023-04-16 07:20:26 +00:00
borrow.rs doc: replace wrong punctuation mark 2023-07-28 14:46:17 +02:00
cell.rs Increase the reach of panic_immediate_abort 2023-10-29 09:31:07 -04:00
clone.rs Explain more clearly why fn() -> T can't be #[derive(Clone)] 2023-07-30 18:04:38 +02:00
cmp.rs fixes: typo in std::cmp::Ord trait docs 2023-11-01 23:23:34 -04:00
default.rs Add more diagnostic items for clippy 2023-10-05 18:21:47 -04:00
error.md Fix minor grammar typo 2023-09-06 09:47:22 -07:00
error.rs add missing feature(error_in_core) 2023-08-15 08:21:41 +02:00
escape.rs Rename copying ascii::Char methods from as_ to to_ 2023-08-08 16:03:47 -07:00
hint.rs Rollup merge of #116350 - Nilstrieb:in-situ, r=Dylan-DPC 2023-10-02 16:09:43 -04:00
internal_macros.rs rm const traits in libcore 2023-04-16 06:49:27 +00:00
intrinsics.rs Auto merge of #116218 - tgross35:const-maybe-uninit-zeroed, r=dtolnay 2023-11-05 05:56:21 +00:00
lib.rs Rollup merge of #115626 - clarfonthey:unchecked-math, r=thomcc 2023-11-01 11:29:41 +01:00
marker.rs Rework unsize documentation 2023-11-01 20:16:24 +00:00
option.rs Auto merge of #115333 - joshlf:patch-5, r=RalfJung 2023-11-03 20:29:13 +00:00
panic.rs Auto merge of #115670 - Zoxc:outline-panic-macro-1, r=Mark-Simulacrum 2023-10-01 05:56:47 +00:00
panicking.rs Bump to latest beta 2023-10-08 19:57:43 -04:00
pin.rs Fix stage0 core tests 2023-10-20 21:14:02 +00:00
primitive.rs
primitive_docs.rs Rollup merge of #117534 - RalfJung:str, r=Mark-Simulacrum 2023-11-04 21:38:29 +01:00
result.rs Add track_caller attribute to Result::unwrap_or_else 2023-10-01 09:42:37 -05:00
time.rs Add missing inline attributes to Duration trait impls 2023-10-03 18:39:56 +03:00
tuple.rs get rid of duplicate primitive_docs 2023-09-18 08:17:36 +02:00
unit.rs Use implicit capture syntax in format_args 2022-03-10 10:23:40 -05:00