about summary refs log tree commit diff
path: root/compiler/rustc_span/src
AgeCommit message (Collapse)AuthorLines
2023-12-05rustc_arena: add `alloc_str`Josh Stone-5/+1
Two places called `from_utf8_unchecked` for strings from `alloc_slice`, and one's SAFETY comment said this was for lack of `alloc_str` -- so let's just add that instead!
2023-12-05Detect incorrect `;` in `Option::ok_or_else` and `Result::map_err`Esteban Küber-0/+2
Fix #72124.
2023-12-05Add lifetime_capture_rules_2024Michael Goulet-0/+1
2023-12-05Remove `#[rustc_host]`, use internal desugaringDeadbeef-1/+0
2023-12-02Add diagnostic item to PartialEq::{eq,ne}Urgau-0/+2
2023-12-02Rename `HandlerInner::delay_span_bug` as `HandlerInner::span_delayed_bug`.Nicholas Nethercote-2/+2
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug` follows the pattern used everywhere else: `span_err`, `span_warning`, etc.
2023-11-30Enable link-arg link kind inside of #[link] attributezetanumbers-0/+1
- Implement link-arg as an attribute - Apply suggestions from review - Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> - Add unstable book entry
2023-11-29rustc_span: Remove unused symbols.Alona Enraght-Moony-27/+0
2023-11-29Rollup merge of #118157 - Nadrieril:never_pat-feature-gate, r=compiler-errorsMatthias Krüger-0/+1
Add `never_patterns` feature gate This PR adds the feature gate and most basic parsing for the experimental `never_patterns` feature. See the tracking issue (https://github.com/rust-lang/rust/issues/118155) for details on the experiment. `@scottmcm` has agreed to be my lang-team liaison for this experiment.
2023-11-29Rollup merge of #118401 - nnethercote:rustc_ast_lowering, r=compiler-errorsMatthias Krüger-1/+0
`rustc_ast_lowering` cleanups Just some cleanups I found while looking through this code. r? `@spastorino`
2023-11-29Add `never_patterns` feature gateNadrieril-0/+1
2023-11-28Remove a comment.Nicholas Nethercote-1/+0
It was merged by accident in a previous PR.
2023-11-27rustc_span: Use correct edit distance start length for suggestionsMartin Nordholts-1/+5
Otherwise the suggestions can be off-base for non-ASCII identifiers. For example suggesting that `Ok` is a name similar to `读文`.
2023-11-25Rollup merge of #117871 - klensy:unused-pub, r=cjgillotGuillaume Gomez-7/+0
remove unused pub fns This removes some unused `pub fn`; also fixes few obsoleted fn names or added fixmes with reminders to update them.
2023-11-23Add an experimental feature gate for function delegationVadim Petrochenkov-0/+1
In accordance with the [process](https://github.com/rust-lang/lang-team/blob/master/src/how_to/experiment.md). Detailed description of the feature can be found in the RFC repo - https://github.com/rust-lang/rfcs/pull/3530.
2023-11-23remove unused pub fnklensy-7/+0
2023-11-22Replace `no_ord_impl` with `orderable`.Nicholas Nethercote-1/+4
Similar to the previous commit, this replaces `newtype_index`'s opt-out `no_ord_impl` attribute with the opt-in `orderable` attribute.
2023-11-22Replace `custom_encodable` with `encodable`.Nicholas Nethercote-4/+1
By default, `newtype_index!` types get a default `Encodable`/`Decodable` impl. You can opt out of this with `custom_encodable`. Opting out is the opposite to how Rust normally works with autogenerated (derived) impls. This commit inverts the behaviour, replacing `custom_encodable` with `encodable` which opts into the default `Encodable`/`Decodable` impl. Only 23 of the 59 `newtype_index!` occurrences need `encodable`. Even better, there were eight crates with a dependency on `rustc_serialize` just from unused default `Encodable`/`Decodable` impls. This commit removes that dependency from those eight crates.
2023-11-16Remove option_payload_ptr; redundant to offset_ofGeorge Bateman-1/+0
2023-11-15Bump cfg(bootstrap)sMark Rousskov-2/+2
2023-11-14Auto merge of #117330 - tmiasko:custom-mir-cleanup-blocks, r=cjgillotbors-0/+34
Custom MIR: Support cleanup blocks Cleanup blocks are declared with `bb (cleanup) = { ... }`. `Call` and `Drop` terminators take an additional argument describing the unwind action, which is one of the following: * `UnwindContinue()` * `UnwindUnreachable()` * `UnwindTerminate(reason)`, where reason is `ReasonAbi` or `ReasonInCleanup` * `UnwindCleanup(block)` Also support unwind resume and unwind terminate terminators: * `UnwindResume()` * `UnwindTerminate(reason)`
2023-11-14Custom MIR: Support cleanup blocksTomasz Miąsko-0/+34
Cleanup blocks are declared with `bb (cleanup) = { ... }`. `Call` and `Drop` terminators take an additional argument describing the unwind action, which is one of the following: * `UnwindContinue()` * `UnwindUnreachable()` * `UnwindTerminate(reason)`, where reason is `ReasonAbi` or `ReasonInCleanup` * `UnwindCleanup(block)` Also support unwind resume and unwind terminate terminators: * `UnwindResume()` * `UnwindTerminate(reason)`
2023-11-14Rollup merge of #117737 - nnethercote:rm-Zkeep-hygiene-data, r=petrochenkovTakayuki Maeda-4/+0
Remove `-Zkeep-hygiene-data`. It was added way back in #28585 under the name `-Zkeep-mtwt-tables`. The justification was: > This is so that the resolution results can be used after analysis, > potentially for tool support. There are no uses of significance in the code base, and various Google searches for both option names (and variants) found nothing of interest. I think this can safely be removed. r? `@davidtwco`
2023-11-10Remove `-Zkeep-hygiene-data`.Nicholas Nethercote-4/+0
It was added way back in #28585 under the name `-Zkeep-mtwt-tables`. The justification was: > This is so that the resolution results can be used after analysis, > potentially for tool support. There are no uses of significance in the code base, and various Google searches for both option names (and variants) found nothing of interest. @petrochenkov says removing this part (and it's only part) of the hygiene data is dubious. It doesn't seem that big, so let's just keep it around.
2023-11-09Rollup merge of #117694 - jmillikin:core-io-borrowed-buf, r=m-ou-seTakayuki Maeda-0/+1
Move `BorrowedBuf` and `BorrowedCursor` from `std:io` to `core::io` Tracking issue: https://github.com/rust-lang/rust/issues/117693 ACP: https://github.com/rust-lang/libs-team/issues/290
2023-11-09Auto merge of #117557 - Zoxc:panic-prio, r=petrochenkovbors-1/+1
Make `FatalErrorMarker` lower priority than other panics This makes `FatalErrorMarker` lower priority than other panics in a parallel sections. If any other panics occur, they will be unwound instead of `FatalErrorMarker`. This ensures `rustc` will exit with the correct error code on ICEs. This fixes https://github.com/rust-lang/rust/issues/116659.
2023-11-09Move `BorrowedBuf` and `BorrowedCursor` from `std:io` to `core::io`John Millikin-0/+1
Assigned new feature name `core_io_borrowed_buf` to distinguish from the `Read::read_buf` functionality in `std::io`.
2023-11-07Auto merge of #117297 - clubby789:fn-trait-missing-paren, r=TaKO8Kibors-0/+3
Give a better diagnostic for missing parens in Fn* bounds Fixes #108109 It would be nice to try and recover here, but I'm not sure it's worth the effort, especially as the bounds on the recovered function would be incorrect.
2023-11-05Auto merge of #117537 - GKFX:offset-of-enum-feature, r=cjgillotbors-0/+1
Feature gate enums in offset_of As requested at https://github.com/rust-lang/rust/issues/106655#issuecomment-1790815262, put enums in offset_of behind their own feature gate. `@rustbot` label F-offset_of
2023-11-03Make `FatalErrorMarker` lower priority than other panicsJohn Kåre Alsaker-1/+1
2023-11-03Auto merge of #117507 - nnethercote:rustc_span, r=Nilstriebbors-106/+46
`rustc_span` cleanups Just some things I found while looking over this crate. r? `@oli-obk`
2023-11-03Feature gate enums in offset_ofGeorge Bateman-0/+1
2023-11-03Auto merge of #116439 - compiler-errors:on-unimplemented, r=davidtwcobors-0/+1
Pretty print `Fn` traits in `rustc_on_unimplemented` I don't think that users really ever should need to think about `Fn*` traits' tupled args for a simple trait error. r? diagnostics
2023-11-02Pretty print Fn traits in rustc_on_unimplementedMichael Goulet-0/+1
2023-11-03Use `FxIndexSet` in the symbol interner.Nicholas Nethercote-21/+12
It makes the code a little nicer. As part of this, the interner's `Default` impl is removed and `prefill` is used in a test instead.
2023-11-02Add a couple of clarifying comments.Nicholas Nethercote-3/+3
2023-11-02Deinline all session global functions.Nicholas Nethercote-6/+0
These are all called very rarely, so there is no need for them to be inline.
2023-11-02Minimize `pub` usage in `source_map.rs`.Nicholas Nethercote-43/+7
Most notably, this commit changes the `pub use crate::*;` in that file to `use crate::*;`. This requires a lot of `use` items in other crates to be adjusted, because everything defined within `rustc_span::*` was also available via `rustc_span::source_map::*`, which is bizarre. The commit also removes `SourceMap::span_to_relative_line_string`, which is unused.
2023-11-02Formatting tweaks.Nicholas Nethercote-9/+12
2023-11-02Minimize `pub` usage in `hygiene.rs`.Nicholas Nethercote-35/+16
And remove dead functions revealed by this.
2023-11-02Tweak `use` items.Nicholas Nethercote-6/+3
2023-11-02Fix some comments.Nicholas Nethercote-4/+2
The comment just below the first one describes how the `impl !Send for FatalError` makes it impossible to `panic!(FatalError)`. And the second one should be `panic_any` instead of `panic!`.
2023-11-02Explain the `()` argument to `ErrorGuaranteed`.Nicholas Nethercote-0/+3
2023-11-01Give a better diagnostic for missing parens in Fn* boundsclubby789-0/+3
2023-10-29Auto merge of #116447 - oli-obk:gen_fn, r=compiler-errorsbors-2/+7
Implement `gen` blocks in the 2024 edition Coroutines tracking issue https://github.com/rust-lang/rust/issues/43122 `gen` block tracking issue https://github.com/rust-lang/rust/issues/117078 This PR implements `gen` blocks that implement `Iterator`. Most of the logic with `async` blocks is shared, and thus I renamed various types that were referring to `async` specifically. An example usage of `gen` blocks is ```rust fn foo() -> impl Iterator<Item = i32> { gen { yield 42; for i in 5..18 { if i.is_even() { continue } yield i * 2; } } } ``` The limitations (to be resolved) of the implementation are listed in the tracking issue
2023-10-27Feature gate `gen` blocks, even in 2024 editionOli Scherer-0/+2
2023-10-27Make `gen` blocks implement the `Iterator` traitOli Scherer-0/+1
2023-10-26Pre-intern a symbol for env!("CFG_RELEASE")David Tolnay-0/+1
2023-10-26Reserve `gen` keyword for `gen {}` blocks and `gen fn` in 2024 editionOli Scherer-2/+4
2023-10-25Make `Iterator` a lang itemOli Scherer-0/+1