about summary refs log tree commit diff
path: root/compiler/rustc_span
AgeCommit message (Collapse)AuthorLines
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-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-30Clean up `rustc_*/Cargo.toml`.Nicholas Nethercote-9/+9
- Sort dependencies and features sections. - Add `tidy` markers to the sorted sections so they stay sorted. - Remove empty `[lib`] sections. - Remove "See more keys..." comments. Excluded files: - rustc_codegen_{cranelift,gcc}, because they're external. - rustc_lexer, because it has external use. - stable_mir, because it has external use.
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
2023-10-24Rollup merge of #116943 - heiher:target-features, r=wesleywiserMatthias Krüger-0/+1
Add target features for LoongArch
2023-10-24compiler: Add target features for LoongArchWANG Rui-0/+1
2023-10-23Let's see what those opaque types actually areMichael Goulet-0/+1
2023-10-23Auto merge of #116849 - oli-obk:error_shenanigans, r=cjgillotbors-1/+18
Avoid a `track_errors` by bubbling up most errors from `check_well_formed` I believe `track_errors` is mostly papering over issues that a sufficiently convoluted query graph can hit. I made this change, while the actual change I want to do is to stop bailing out early on errors, and instead use this new `ErrorGuaranteed` to invoke `check_well_formed` for individual items before doing all the `typeck` logic on them. This works towards resolving https://github.com/rust-lang/rust/issues/97477 and various other ICEs, as well as allowing us to use parallel rustc more (which is currently rather limited/bottlenecked due to the very sequential nature in which we do `rustc_hir_analysis::check_crate`) cc `@SparrowLii` `@Zoxc` for the new `try_par_for_each_in` function
2023-10-21Rollup merge of #116312 - c410-f3r:try, r=Mark-SimulacrumMatthias Krüger-14/+16
Initiate the inner usage of `cfg_match` (Compiler) cc #115585 Dogfood to test the implementation and remove dependencies.
2023-10-20Re-add `generators` as a removed feature and point to the new feature nameOli Scherer-0/+2
2023-10-20s/generator/coroutine/Oli Scherer-4/+4
2023-10-20Ensure we never accidentally serialize an `ErrorGuaranteed`Oli Scherer-1/+18
2023-10-19Initiate the inner usage of `cfg_match`Caio-14/+16
2023-10-19Auto merge of #115214 - Urgau:rfc-3127-trim-paths, r=compiler-errorsbors-25/+59
Implement rustc part of RFC 3127 trim-paths This PR implements (or at least tries to) [RFC 3127 trim-paths](https://github.com/rust-lang/rust/issues/111540), the rustc part. That is `-Zremap-path-scope` with all of it's components/scopes. `@rustbot` label: +F-trim-paths
2023-10-17[RFC 3127 - Trim Paths]: Condition remapped filepath on remap scopesUrgau-25/+59
2023-10-16debug Span::ctxt() call detectionArthur Lafrance-2/+2
2023-10-16basic lint v2 implementedArthur Lafrance-2/+2
2023-10-16implement the basics of the lint static analysisArthur Lafrance-0/+2
2023-10-13Format all the let chains in compilerMichael Goulet-1/+1
2023-10-08rustdoc: remove rust logo from non-Rust cratesMichael Howell-0/+3
2023-10-06Rollup merge of #116474 - nnethercote:rustc_assorted, r=spastorinoMatthias Krüger-6/+1
Assorted small cleanups r? `@spastorino`
2023-10-06Auto merge of #115304 - Enselic:trailing-gt, r=cjgillotbors-1/+0
Allow file names to end with '>' The [`rustc_span::FileName`](https://doc.rust-lang.org/stable/nightly-rustc/rustc_span/enum.FileName.html) enum already differentiates between real files and "fake" files such as `<anon>`. We do not need to artificially forbid real file names from ending in `>`. Closes #73419
2023-10-06Remove unused `FileName::CfgSpec`.Nicholas Nethercote-6/+1
2023-10-05Add more diagnostic items for clippyJason Newcomb-0/+49
2023-10-05Allow file names to end with '>'Martin Nordholts-1/+0
The `rustc_span::FileName` enum already differentiates between real files and "fake" files such as `<anon>`. We do not need to artificially forbid real file names from ending in `>`.
2023-10-01Auto merge of #115670 - Zoxc:outline-panic-macro-1, r=Mark-Simulacrumbors-1/+1
Partially outline code inside the panic! macro This outlines code inside the panic! macro in some cases. This is split out from https://github.com/rust-lang/rust/pull/115562 to exclude changes to rustc.
2023-09-30Auto merge of #115933 - oli-obk:simd_shuffle_const, r=workingjubileebors-0/+1
Prototype using const generic for simd_shuffle IDX array cc https://github.com/rust-lang/rust/issues/85229 r? `@workingjubilee` on the design TLDR: there is now a `fn simd_shuffle_generic<T, U, const IDX: &'static [u32]>(x: T, y: T) -> U;` intrinsic that allows replacing ```rust simd_shuffle(a, b, const { stuff }) ``` with ```rust simd_shuffle_generic::<_, _, {&stuff}>(a, b) ``` which makes the compiler implementations much simpler, if we manage to at some point eliminate `simd_shuffle`. There are some issues with this today though (can't do math without bubbling it up in the generic arguments). With this change, we can start porting the simple cases and get better data on the others.
2023-09-27fix clippy::{redundant_guards, useless_format}Matthias Krüger-2/+2
2023-09-25Rename `cold_path` to `outline`John Kåre Alsaker-2/+2
2023-09-21Auto merge of #115549 - saethlin:include-bytes-resilient, r=jackh726bors-2/+58
Fall back to the unoptimized implementation in read_binary_file if File::metadata lies Fixes https://github.com/rust-lang/rust/issues/115458 r? `@jackh726` because you approved the previous PR
2023-09-20Add unit tests based on files that return odd sizes to statBen Kimock-0/+27