about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/lib.rs
AgeCommit message (Collapse)AuthorLines
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
2024-04-29Remove `extern crate rustc_data_structures` from numerous crates.Nicholas Nethercote-2/+0
2024-04-29Remove `extern crate rustc_macros` from `rustc_middle`.Nicholas Nethercote-2/+0
2024-04-24Stabilise `inline_const`Gary Guo-1/+1
2024-04-24Error on using `yield` without also using `#[coroutine]` on the closureOli Scherer-0/+1
And suggest adding the `#[coroutine]` to the closure
2024-04-22Stabilize generic `NonZero`.Markus Reiter-1/+0
2024-03-20step cfgsMark Rousskov-2/+1
2024-03-19Make span_bug panic site useful againOli Scherer-0/+1
2024-03-08Stabilize associated type boundsMichael Goulet-1/+1
2024-02-23Rollup merge of #120742 - Nadrieril:use-min_exh_pats, r=compiler-errorsMatthias Krüger-1/+2
mark `min_exhaustive_patterns` as complete This is step 1 and 2 of my [proposal](https://github.com/rust-lang/rust/issues/119612#issuecomment-1918097361) to move `min_exhaustive_patterns` forward. The vast majority of in-tree use cases of `exhaustive_patterns` are covered by `min_exhaustive_patterns`. There are a few cases that still require `exhaustive_patterns` in tests and they're all behind references. r? ``@ghost``
2024-02-15Use generic `NonZero` internally.Markus Reiter-0/+1
2024-02-13Prefer `min_exhaustive_patterns` in compilerNadrieril-1/+2
2024-02-09Auto merge of #120676 - Mark-Simulacrum:bootstrap-bump, r=clubby789bors-1/+1
Bump bootstrap compiler to just-built 1.77 beta https://forge.rust-lang.org/release/process.html#master-bootstrap-update-t-2-day-tuesday
2024-02-09Rollup merge of #120693 - nnethercote:invert-diagnostic-lints, r=davidtwcoMatthias Krüger-1/+3
Invert diagnostic lints. That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has been converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted. r? ````@davidtwco````
2024-02-08Step all bootstrap cfgs forwardMark Rousskov-1/+1
This also takes care of other bootstrap-related changes.
2024-02-07MirPass: make name more constklensy-0/+1
2024-02-06Invert diagnostic lints.Nicholas Nethercote-1/+3
That is, change `diagnostic_outside_of_impl` and `untranslatable_diagnostic` from `allow` to `deny`, because more than half of the compiler has be converted to use translated diagnostics. This commit removes more `deny` attributes than it adds `allow` attributes, which proves that this change is warranted.
2024-01-25Remove unused featuresclubby789-6/+0
2024-01-22Revert "Auto merge of #118133 - Urgau:stabilize_trait_upcasting, r=WaffleLapkin"Oli Scherer-0/+1
This reverts commit 6d2b84b3ed7848fd91b8d6151d4451b3103ed816, reversing changes made to 73bc12199ea8c7651ed98b069c0dd6b0bb5fabcf.
2023-12-22update cfg(bootstrap)sPietro Albini-1/+0
2023-11-26Use `rustc_fluent_macro::fluent_messages!` directly.Nicholas Nethercote-3/+1
Currently we always do this: ``` use rustc_fluent_macro::fluent_messages; ... fluent_messages! { "./example.ftl" } ``` But there is no need, we can just do this everywhere: ``` rustc_fluent_macro::fluent_messages! { "./example.ftl" } ``` which is shorter.
2023-11-26Avoid need for `{D,Subd}iagnosticMessage` imports.Nicholas Nethercote-1/+0
The `fluent_messages!` macro produces uses of `crate::{D,Subd}iagnosticMessage`, which means that every crate using the macro must have this import: ``` use rustc_errors::{DiagnosticMessage, SubdiagnosticMessage}; ``` This commit changes the macro to instead use `rustc_errors::{D,Subd}iagnosticMessage`, which avoids the need for the imports.
2023-11-22Stabilize RFC3324 dyn upcasting coercionUrgau-1/+1
Aka trait_upcasting feature. And also adjust the `deref_into_dyn_supertrait` lint.
2023-11-15Bump cfg(bootstrap)sMark Rousskov-4/+3
2023-11-13Auto merge of #116866 - slanterns:inspect-stabilize, r=BurntSushibors-1/+0
Stabilize `result_option_inspect` This PR stabilizes `result_option_inspect`: ```rust // core::option impl Option<T> { pub fn inspect<F: FnOnce(&T)>(self, f: F) -> Self; } // core::result impl Result<T, E> { pub fn inspect<F: FnOnce(&T)>(self, f: F) -> Self; pub fn inspect_err<F: FnOnce(&E)>(self, f: F) -> Self; } ``` <br> Tracking issue: https://github.com/rust-lang/rust/issues/91345. Implementation PR: https://github.com/rust-lang/rust/pull/91346. Closes https://github.com/rust-lang/rust/issues/91345.
2023-10-20s/generator/coroutine/Oli Scherer-2/+3
2023-10-18Remove `#![feature(result_option_inspect)]` from the compilerSlanterns-1/+0
2023-10-08rustdoc: remove rust logo from non-Rust cratesMichael Howell-0/+2
2023-09-22Add a way to decouple the implementation and the declaration of a TyCtxt method.Oli Scherer-0/+1
2023-08-23Bump cfg(bootstrap)Mark Rousskov-1/+1