about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/lib.rs
AgeCommit message (Collapse)AuthorLines
2025-09-26Apply cfg(bootstrap) replacementMark Rousskov-1/+0
2025-08-29Rollup merge of #145756 - okaneco:stabilize_char_boundary, r=scottmcmTrevor Gross-1/+1
str: Stabilize `round_char_boundary` feature Closes https://github.com/rust-lang/rust/issues/93743 FCP completed https://github.com/rust-lang/rust/issues/93743#issuecomment-3168382171
2025-08-22Stabilize `round_char_boundary` featureokaneco-1/+1
2025-08-21Introduce ProjectionElem::try_map.Camille GILLOT-0/+1
2025-08-04small refactor of `InterpResult`Waffle Lapkin-0/+1
- don't need type alias to default type argument - `Residual` impl allows to use more std APIs (like `<[T; N]>::try_map`)
2025-07-01Update `cfg(bootstrap)`Josh Stone-2/+2
2025-06-28Remove unused feature gatesYotam Ofek-1/+0
2025-06-20Use gen blocks in the compiler instead of from_coroutineMichael Goulet-1/+1
2025-06-18Implement lint against direct uses of rustc_type_ir in compiler cratesRomain Perier-0/+1
This commit adds a lint to prevent the use of rustc_type_ir in random compiler crates, except for type system internals traits, which are explicitly allowed. Moreover, this fixes diagnostic_items() to include the CRATE_OWNER_ID, otherwise rustc_diagnostic_item attribute is ignored on the crate root.
2025-06-16library/compiler: add `PointeeSized` boundsDavid Wood-0/+1
As core uses an extern type (`ptr::VTable`), the default `?Sized` to `MetaSized` migration isn't sufficient, and some code that previously accepted `VTable` needs relaxed to continue to accept extern types. Similarly, the compiler uses many extern types in `rustc_codegen_llvm` and in the `rustc_middle::ty::List` implementation (`OpaqueListContents`) some bounds must be relaxed to continue to accept these types. Unfortunately, due to the current inability to relax `Deref::Target`, some of the bounds in the standard library are forced to be stricter than they ideally would be.
2025-06-08Remove all unused feature gates from the compilerbjorn3-1/+0
2025-05-26Limit the size of cgu names when using the `-Zhuman-readable-cgu-names` optionDiggory Blake-0/+1
Prior to this change, cgu names could be generated which would result in filenames longer than the limit imposed by the OS.
2025-05-12update cfg(bootstrap)Pietro Albini-1/+0
2025-05-06Auto merge of #131160 - ↵bors-1/+0
ismailarilik:handle-potential-query-instability-lint-for-rustc-middle, r=oli-obk Handle `rustc_middle` cases of `rustc::potential_query_instability` lint This PR removes `#![allow(rustc::potential_query_instability)]` line from [`compiler/rustc_middle/src/lib.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_middle/src/lib.rs#L29) and converts `FxHash{Map,Set}` types into `FxIndex{Map,Set}` to suppress lint errors. A somewhat tracking issue: https://github.com/rust-lang/rust/issues/84447 r? `@compiler-errors`
2025-05-05Handle rustc_middle cases of rustc::potential_query_instability lintismailarilik-1/+0
2025-04-30Simplify `LazyAttrTokenStream`.Nicholas Nethercote-0/+1
This commit does the following. - Changes it from `Lrc<Box<dyn ToAttrTokenStream>>` to `Lrc<LazyAttrTokenStreamInner>`. - Reworks `LazyAttrTokenStreamImpl` as `LazyAttrTokenStreamInner`, which is a two-variant enum. - Removes the `ToAttrTokenStream` trait and the two impls of it. The recursion limit must be increased in some crates otherwise rustdoc aborts.
2025-04-23Make #![feature(let_chains)] bootstrap conditional in compiler/est31-1/+1
2025-04-02Remove `recursion_limit` increases.Nicholas Nethercote-1/+0
These are no longer needed now that `Nonterminal` is gone.
2025-03-12Auto merge of #138414 - matthiaskrgr:rollup-9ablqdb, r=matthiaskrgrbors-1/+0
Rollup of 7 pull requests Successful merges: - #137314 (change definitely unproductive cycles to error) - #137701 (Convert `ShardedHashMap` to use `hashbrown::HashTable`) - #138269 (uefi: fs: Implement FileType, FilePermissions and FileAttr) - #138331 (Use `RUSTC_LINT_FLAGS` more) - #138345 (Some autodiff cleanups) - #138387 (intrinsics: remove unnecessary leading underscore from argument names) - #138390 (fix incorrect tracing log) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-11Remove `#![warn(unreachable_pub)]` from all `compiler/` crates.Nicholas Nethercote-1/+0
It's no longer necessary now that `-Wunreachable_pub` is being passed.
2025-03-10Revert "Use workspace lints for crates in `compiler/` #138084"许杰友 Jieyou Xu (Joe)-0/+1
Revert <https://github.com/rust-lang/rust/pull/138084> to buy time to consider options that avoids breaking downstream usages of cargo on distributed `rustc-src` artifacts, where such cargo invocations fail due to inability to inherit `lints` from workspace root manifest's `workspace.lints` (this is only valid for the source rust-lang/rust workspace, but not really the distributed `rustc-src` artifacts). This breakage was reported in <https://github.com/rust-lang/rust/issues/138304>. This reverts commit 48caf81484b50dca5a5cebb614899a3df81ca898, reversing changes made to c6662879b27f5161e95f39395e3c9513a7b97028.
2025-03-08Remove `#![warn(unreachable_pub)]` from all `compiler/` crates.Nicholas Nethercote-1/+0
(Except for `rustc_codegen_cranelift`.) It's no longer necessary now that `unreachable_pub` is in the workspace lints.
2025-03-07Increase recursion_limit in numerous crates.Nicholas Nethercote-0/+1
This is temporarily needed for `x doc compiler` to work. They can be removed once the `Nonterminal` is removed (#124141).
2025-02-24Rollup merge of #137109 - bend-n:knife, r=oli-obkTrevor Gross-1/+0
stabilize extract_if Tracking issue: #43244 Closes: #43244 FCP completed: https://github.com/rust-lang/rust/issues/43244#issuecomment-2523595704
2025-02-23stabilize extract_ifbendn-1/+0
2025-02-18update `cfg(bootstrap)`Josh Stone-1/+0
2025-02-06stabilize `feature(trait_upcasting)`Waffle Lapkin-1/+1
2025-02-04Update top-level `rustc_middle` comment.Nicholas Nethercote-2/+3
- Mention THIR. - Removed mentions of non-existent READMEs.
2025-02-04Remove unused features from `rustc_middle`.Nicholas Nethercote-2/+0
2025-01-24use `fmt::from_fn` in more places, instead of using structs that impl ↵Yotam Ofek-0/+1
formatting traits
2024-10-21move strict provenance lints to new feature gate, remove old feature gatesRalf Jung-1/+0
2024-10-12Stabilize `const_option`Trevor Gross-1/+0
This makes the following API stable in const contexts: impl<T> Option<T> { pub const fn as_mut(&mut self) -> Option<&mut T>; pub const fn expect(self, msg: &str) -> T; pub const fn unwrap(self) -> T; pub const unsafe fn unwrap_unchecked(self) -> T; pub const fn take(&mut self) -> Option<T>; pub const fn replace(&mut self, value: T) -> Option<T>; } impl<T> Option<&T> { pub const fn copied(self) -> Option<T> where T: Copy; } impl<T> Option<&mut T> { pub const fn copied(self) -> Option<T> where T: Copy; } impl<T, E> Option<Result<T, E>> { pub const fn transpose(self) -> Result<Option<T>, E> } impl<T> Option<Option<T>> { pub const fn flatten(self) -> Option<T>; } The following functions make use of the unstable `const_precise_live_drops` feature: - `expect` - `unwrap` - `unwrap_unchecked` - `transpose` - `flatten` Fixes: <https://github.com/rust-lang/rust/issues/67441>
2024-10-01make InterpResult a dedicated type to avoid accidentally discarding the errorRalf Jung-0/+2
2024-09-24Dogfood `feature(file_buffered)`Josh Stone-0/+1
2024-09-17Use associative type defaults in `{Layout,FnAbi}OfHelpers`.Nicholas Nethercote-0/+1
This avoids some repetitive boilerplate code.
2024-09-05update cfgsBoxy-1/+0
2024-08-29Add `warn(unreachable_pub)` to `rustc_middle`.Nicholas Nethercote-0/+1
I am surprised the diff is so small for this enormous crate.
2024-08-28Rollup merge of #129401 - ↵Jubilee-1/+0
workingjubilee:partial-initialization-of-stabilization, r=dtolnay,joboet Partially stabilize `feature(new_uninit)` Finished comment period: https://github.com/rust-lang/rust/issues/63291#issuecomment-2183022955 The following API has been stabilized from https://github.com/rust-lang/rust/issues/63291 ```rust impl<T> Box<T> { pub fn new_uninit() -> Box<MaybeUninit<T>> {…} } impl<T> Rc<T> { pub fn new_uninit() -> Rc<MaybeUninit<T>> {…} } impl<T> Arc<T> { pub fn new_uninit() -> Arc<MaybeUninit<T>> {…} } impl<T> Box<[T]> { pub fn new_uninit_slice(len: usize) -> Box<[MaybeUninit<T>]> {…} } impl<T> Rc<[T]> { pub fn new_uninit_slice(len: usize) -> Rc<[MaybeUninit<T>]> {…} } impl<T> Arc<[T]> { pub fn new_uninit_slice(len: usize) -> Arc<[MaybeUninit<T>]> {…} } impl<T> Box<MaybeUninit<T>> { pub unsafe fn assume_init(self) -> Box<T> {…} } impl<T> Box<[MaybeUninit<T>]> { pub unsafe fn assume_init(self) -> Box<[T]> {…} } impl<T> Rc<MaybeUninit<T>> { pub unsafe fn assume_init(self) -> Rc<T> {…} } impl<T> Rc<[MaybeUninit<T>]> { pub unsafe fn assume_init(self) -> Rc<[T]> {…} } impl<T> Arc<MaybeUninit<T>> { pub unsafe fn assume_init(self) -> Arc<T> {…} } impl<T> Arc<[MaybeUninit<T>]> { pub unsafe fn assume_init(self) -> Arc<[T]> {…} } ``` The remaining API is split between new issues - `new_zeroed_alloc`: https://github.com/rust-lang/rust/issues/129396 - `box_uninit_write`: https://github.com/rust-lang/rust/issues/129397 All relevant code is thus either stabilized or split out of that issue, so this closes #63291 as, with the FCP concluded, that issue has served its purpose. try-job: x86_64-rust-for-linux
2024-08-27compiler: Remove feature(new_uninit)Jubilee Young-1/+0
2024-08-26Use unsafe extern blocks throughout the compilerMichael Goulet-1/+1
2024-08-14use the new Box methods in the interpreterRalf Jung-0/+1
2024-08-10Update std and compilerNadrieril-1/+1
2024-06-05Rollup merge of #125505 - aDotInTheVoid:middle-idl, r=pnkfelixMatthias Krüger-5/+6
Add intra-doc-links to rustc_middle crate-level docs. Makes it slightly faster to find these modules, as you don't need to hunt for them in the big list.
2024-05-24Add intra-doc-links to rustc_middle crate-level docs.Alona Enraght-Moony-5/+6
2024-05-23Remove `#[macro_use] extern crate tracing` from `rustc_middle`.Nicholas Nethercote-3/+0
2024-05-21Sort `rustc_middle` attributes.Nicholas Nethercote-19/+21
As is already done in several other crates, such as `rustc_errors`.
2024-05-21Remove unused features from `rustc_middle`.Nicholas Nethercote-3/+1
2024-05-01Step bootstrap cfgsMark Rousskov-2/+0
2024-04-29Remove `extern crate smallvec` from a couple of crates.Nicholas Nethercote-2/+0
2024-04-29Remove `extern crate bitflags` from a couple of crates.Nicholas Nethercote-2/+0