Commit Graph

1380 Commits

Author SHA1 Message Date
bors
b8c207435c Auto merge of #119192 - michaelwoerister:mcp533-push, r=cjgillot
Replace a number of FxHashMaps/Sets with stable-iteration-order alternatives

This PR replaces almost all of the remaining `FxHashMap`s in query results with either `FxIndexMap` or `UnordMap`. The only case that is missing is the `EffectiveVisibilities` struct which turned out to not be straightforward to transform. Once that is done too, we can remove the `HashStable` implementation from `HashMap`.

The first commit adds the `StableCompare` trait which is a companion trait to `StableOrd`. Some types like `Symbol` can be compared in a cross-session stable way, but their `Ord` implementation is not stable. In such cases, a `StableCompare` implementation can be provided to offer a lightweight way for stable sorting. The more heavyweight option is to sort via `ToStableHashKey`, but then sorting needs to have access to a stable hashing context and `ToStableHashKey` can also be expensive as in the case of `Symbol` where it has to allocate a `String`.

The rest of the commits are rather mechanical and don't overlap, so they are best reviewed individually.

Part of [MCP 533](https://github.com/rust-lang/compiler-team/issues/533).
2024-01-05 19:38:27 +00:00
Vadim Petrochenkov
508d1ff7d8 rustc_span: More consistent span combination operations 2024-01-05 19:41:46 +03:00
Vadim Petrochenkov
205fb75cfa rustc_span: Remove fn fresh_expansion
In the past it did create a fresh expansion, but now, after surviving a number of refactorings, it does not.
Now it's just a thin wrapper around `apply_mark`.
2024-01-05 19:13:52 +03:00
Matthias Krüger
a919d97aaa
Rollup merge of #119325 - RalfJung:custom-mir, r=compiler-errors
custom mir: make it clear what the return block is

Custom MIR recently got support for specifying the "unwind action", so now there's two things coming after the actual call part of `Call` terminators. That's not very self-explaining so I propose we change the syntax to imitate keyword arguments:
```
Call(popped = Vec::pop(v), ReturnTo(drop), UnwindContinue())
```

Also fix some outdated docs and add some docs to `Call` and `Drop`.
2024-01-04 15:33:58 +01:00
Michael Woerister
36dd3d4524 Make iteration order of region_scope_tree query stable 2024-01-04 13:48:54 +01:00
Michael Woerister
739e5ef49e Split StableCompare trait out of StableOrd trait.
StableCompare is a companion trait to `StableOrd`. Some types like `Symbol` can be compared in a cross-session stable way, but their `Ord` implementation is not stable. In such cases, a `StableOrd` implementation can be provided to offer a lightweight way for stable sorting. (The more heavyweight option is to sort via `ToStableHashKey`, but then sorting needs to have access to a stable hashing context and `ToStableHashKey` can also be expensive as in the case of `Symbol` where it has to allocate a `String`.)
2024-01-04 13:32:42 +01:00
bjorn3
8fb8e6eefb Add comments sugested by reviewer 2024-01-01 19:11:50 +00:00
bjorn3
47936b4813 Avoid specialization for AttrId deserialization 2023-12-31 20:48:15 +00:00
bjorn3
8d598b0d58 Remove almost all uses of specialization from the metadata encoding code 2023-12-31 20:42:17 +00:00
bjorn3
6ed37bdc42 Avoid specialization for the Span Encodable and Decodable impls 2023-12-31 20:42:17 +00:00
Ralf Jung
0f9baa8a31 custom mir: make it clear what the return block is 2023-12-26 20:15:26 +01:00
Michael Goulet
50e380c8f3
Rollup merge of #119235 - Urgau:missing-feature-gate-sanitizer-cfi-cfgs, r=Nilstrieb
Add missing feature gate for sanitizer CFI cfgs

Found during the review of https://github.com/rust-lang/rust/pull/118494 in https://github.com/rust-lang/rust/pull/118494#discussion_r1416079288.

cc `@rcvalle`
2023-12-26 13:29:13 -05:00
Michael Goulet
17b433351d select AsyncFn traits during overloaded call op 2023-12-25 20:31:28 +00:00
bors
bf8716f1cd Auto merge of #119139 - michaelwoerister:cleanup-stable-source-file-id, r=cjgillot
Unify SourceFile::name_hash and StableSourceFileId

This PR adapts the existing `StableSourceFileId` type so that it can be used instead of the `name_hash` field of `SourceFile`. This simplifies a few things that were kind of duplicated before.

The PR should also fix issues https://github.com/rust-lang/rust/issues/112700 and https://github.com/rust-lang/rust/issues/115835, but I was not able to reproduce these issues in a regression test. As far as I can tell, the root cause of these issues is that the id of the originating crate is not hashed in the `HashStable` impl of `Span` and thus cache entries that should have been considered invalidated were loaded. After this PR, the `stable_id` field of `SourceFile` includes information about the originating crate, so that ICE should not occur anymore.
2023-12-24 21:58:39 +00:00
Mark Rousskov
6630d69085 Specialize DefPathHash table to skip crate IDs
Instead, we store just the local crate hash as a bare u64. On decoding,
we recombine it with the crate's stable crate ID stored separately in
metadata. The end result is that we save ~8 bytes/DefIndex in metadata
size.

One key detail here is that we no longer distinguish in encoded metadata
between present and non-present DefPathHashes. It used to be highly
likely we could distinguish as we used DefPathHash::default(), an
all-zero representation. However in theory even that is fallible as
nothing strictly prevents the StableCrateId from being zero.
2023-12-23 14:10:28 -05:00
Urgau
cc6cbaad4b Add missing CFI sanitizer cfgs feature gate 2023-12-23 00:52:42 +01:00
Michael Woerister
fa8ef25372 Unify SourceFile::name_hash and StableSourceFileId 2023-12-19 22:34:26 +01:00
Eric Holk
97df0d3657
Desugar for await loops 2023-12-19 12:26:27 -08:00
Eric Holk
27d6539a46
Plumb awaitness of for loops 2023-12-19 12:26:20 -08:00
Ross Smyth
663bea5a96 Add better ICE messages for some undescriptive panics 2023-12-15 00:50:55 -05:00
bors
8a3765582c Auto merge of #117758 - Urgau:lint_pointer_trait_comparisons, r=davidtwco
Add lint against ambiguous wide pointer comparisons

This PR is the resolution of https://github.com/rust-lang/rust/issues/106447 decided in https://github.com/rust-lang/rust/issues/117717 by T-lang.

## `ambiguous_wide_pointer_comparisons`

*warn-by-default*

The `ambiguous_wide_pointer_comparisons` lint checks comparison of `*const/*mut ?Sized` as the operands.

### Example

```rust
let ab = (A, B);
let a = &ab.0 as *const dyn T;
let b = &ab.1 as *const dyn T;

let _ = a == b;
```

### Explanation

The comparison includes metadata which may not be expected.

-------

This PR also drops `clippy::vtable_address_comparisons` which is superseded by this one.

~~One thing: is the current naming right? `invalid` seems a bit too much.~~

Fixes https://github.com/rust-lang/rust/issues/117717
2023-12-11 14:33:16 +00:00
Eric Huss
f481596ee4 Remove edition umbrella features. 2023-12-10 13:03:28 -08:00
bors
b9068315db Auto merge of #116952 - compiler-errors:lifetime_capture_rules_2024, r=TaKO8Ki
Implement 2024-edition lifetime capture rules RFC

Implements rust-lang/rfcs#3498.
2023-12-10 15:51:39 +00:00
surechen
40ae34194c remove redundant imports
detects redundant imports that can be eliminated.

for #117772 :

In order to facilitate review and modification, split the checking code and
removing redundant imports code into two PR.
2023-12-10 10:56:22 +08:00
Jakub Okoński
97ae5095f5
Add simd_masked_{load,store} platform-intrinsics
This maps to the LLVM intrinsics: llvm.masked.load and llvm.masked.store
2023-12-09 12:36:08 +01:00
Michael Goulet
96bb542a31 Implement async gen blocks 2023-12-08 17:23:25 +00:00
Matthias Krüger
cf78a79020
Rollup merge of #118660 - cuviper:alloc_str, r=petrochenkov
rustc_arena: add `alloc_str`

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-06 21:52:32 +01:00
bors
7a34091eed Auto merge of #118679 - matthiaskrgr:rollup-zr1l9w6, r=matthiaskrgr
Rollup of 7 pull requests

Successful merges:

 - #116496 (Provide context when `?` can't be called because of `Result<_, E>`)
 - #117563 (docs: clarify explicitly freeing heap allocated memory)
 - #117874 (`riscv32` platform support)
 - #118516 (Add ADT variant infomation to StableMIR and finish implementing TyKind::internal())
 - #118650 (add comment about keeping flags in sync between bootstrap.py and bootstrap.rs)
 - #118664 (docs: remove #110800 from release notes)
 - #118669 (library: fix comment about const assert in win api)

r? `@ghost`
`@rustbot` modify labels: rollup
2023-12-06 17:59:19 +00:00
Josh Stone
92bf40ffe3 rustc_arena: add alloc_str
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-05 17:52:51 -08:00
Esteban Küber
98e5317173 Detect incorrect ; in Option::ok_or_else and Result::map_err
Fix #72124.
2023-12-05 22:24:29 +00:00
Michael Goulet
0ad160a585 Add lifetime_capture_rules_2024 2023-12-05 19:53:59 +00:00
Deadbeef
65212a07e7 Remove #[rustc_host], use internal desugaring 2023-12-05 01:15:21 +00:00
Urgau
26cbb10a5c Add diagnostic item to PartialEq::{eq,ne} 2023-12-02 15:36:07 +01:00
Nicholas Nethercote
5d1d384443 Rename HandlerInner::delay_span_bug as HandlerInner::span_delayed_bug.
Because the corresponding `Level` is `DelayedBug` and `span_delayed_bug`
follows the pattern used everywhere else: `span_err`, `span_warning`,
etc.
2023-12-02 09:01:19 +11:00
zetanumbers
f7617c1cd4 Enable link-arg link kind inside of #[link] attribute
- 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-30 08:26:13 -08:00
Alona Enraght-Moony
32c035c8c8 rustc_span: Remove unused symbols. 2023-11-29 20:22:18 +00:00
Matthias Krüger
c03f8917ee
Rollup merge of #118157 - Nadrieril:never_pat-feature-gate, r=compiler-errors
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-29 12:34:47 +01:00
Matthias Krüger
82eda5865a
Rollup merge of #118401 - nnethercote:rustc_ast_lowering, r=compiler-errors
`rustc_ast_lowering` cleanups

Just some cleanups I found while looking through this code.

r? `@spastorino`
2023-11-29 04:23:29 +01:00
Nadrieril
a3838c8550 Add never_patterns feature gate 2023-11-29 03:58:29 +01:00
Nicholas Nethercote
fd37da7148 Remove a comment.
It was merged by accident in a previous PR.
2023-11-28 14:32:31 +11:00
Martin Nordholts
45fc842ed9 rustc_span: Use correct edit distance start length for suggestions
Otherwise the suggestions can be off-base for non-ASCII identifiers. For
example suggesting that `Ok` is a name similar to `读文`.
2023-11-27 19:08:27 +01:00
Guillaume Gomez
9a59b059d5
Rollup merge of #117871 - klensy:unused-pub, r=cjgillot
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-25 19:51:54 +01:00
Vadim Petrochenkov
edf6c9c223 Add an experimental feature gate for function delegation
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-23 17:27:31 +03:00
klensy
aff6c741d4 remove unused pub fn 2023-11-23 14:11:02 +03:00
Nicholas Nethercote
7060fc8327 Replace no_ord_impl with orderable.
Similar to the previous commit, this replaces `newtype_index`'s opt-out
`no_ord_impl` attribute with the opt-in `orderable` attribute.
2023-11-22 18:38:17 +11:00
Nicholas Nethercote
3ef9d4d0ed Replace custom_encodable with encodable.
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-22 18:37:14 +11:00
George Bateman
661df4fd55
Remove option_payload_ptr; redundant to offset_of 2023-11-16 22:56:25 +00:00
Mark Rousskov
db3e2bacb6 Bump cfg(bootstrap)s 2023-11-15 19:41:28 -05:00
bors
5526682702 Auto merge of #117330 - tmiasko:custom-mir-cleanup-blocks, r=cjgillot
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-14 08:53:25 +00:00
Tomasz Miąsko
78da577650 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-14 08:23:58 +01:00
Takayuki Maeda
bf8cf456b6
Rollup merge of #117737 - nnethercote:rm-Zkeep-hygiene-data, r=petrochenkov
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-14 00:54:15 +09:00
Nicholas Nethercote
2e40d11f8c 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.

@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-10 14:00:08 +11:00
Takayuki Maeda
b4fa5b7004
Rollup merge of #117694 - jmillikin:core-io-borrowed-buf, r=m-ou-se
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-09 11:36:52 +09:00
bors
d8dbf7ca0e Auto merge of #117557 - Zoxc:panic-prio, r=petrochenkov
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-09 00:39:02 +00:00
John Millikin
341c85648c Move BorrowedBuf and BorrowedCursor from std:io to core::io
Assigned new feature name `core_io_borrowed_buf` to distinguish from the
`Read::read_buf` functionality in `std::io`.
2023-11-09 07:10:11 +09:00
bors
187d1afa9d Auto merge of #117297 - clubby789:fn-trait-missing-paren, r=TaKO8Ki
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-07 13:04:56 +00:00
bors
992943dbae Auto merge of #117537 - GKFX:offset-of-enum-feature, r=cjgillot
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-05 13:44:59 +00:00
John Kåre Alsaker
ff1858e2aa Make FatalErrorMarker lower priority than other panics 2023-11-03 19:46:00 +01:00
bors
9c20ddd956 Auto merge of #117507 - nnethercote:rustc_span, r=Nilstrieb
`rustc_span` cleanups

Just some things I found while looking over this crate.

r? `@oli-obk`
2023-11-03 14:57:40 +00:00
George Bateman
7c09b99ebb
Feature gate enums in offset_of 2023-11-03 13:16:47 +00:00
bors
1d6f05fd37 Auto merge of #116439 - compiler-errors:on-unimplemented, r=davidtwco
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-03 06:08:03 +00:00
Michael Goulet
c83f642f12 Pretty print Fn traits in rustc_on_unimplemented 2023-11-02 20:57:05 +00:00
Nicholas Nethercote
94a36d2ce5 Use FxIndexSet in the symbol interner.
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-03 07:19:41 +11:00
Nicholas Nethercote
6358411da2 Add a couple of clarifying comments. 2023-11-02 19:35:04 +11:00
Nicholas Nethercote
edb357f912 Deinline all session global functions.
These are all called very rarely, so there is no need for them to be
inline.
2023-11-02 19:35:04 +11:00
Nicholas Nethercote
f405ce86c2 Minimize pub usage in source_map.rs.
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-02 19:35:00 +11:00
Nicholas Nethercote
84773b3972 Formatting tweaks. 2023-11-02 17:23:26 +11:00
Nicholas Nethercote
222c22356b Minimize pub usage in hygiene.rs.
And remove dead functions revealed by this.
2023-11-02 17:23:26 +11:00
Nicholas Nethercote
16e9713e60 Tweak use items. 2023-11-02 17:23:26 +11:00
Nicholas Nethercote
1bcb6006ba Fix some comments.
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-02 17:22:44 +11:00
Nicholas Nethercote
d76661bf25 Explain the () argument to ErrorGuaranteed. 2023-11-02 17:07:07 +11:00
clubby789
904aceec7d Give a better diagnostic for missing parens in Fn* bounds 2023-11-01 15:33:46 +00:00
Nicholas Nethercote
8ff624a9f2 Clean up rustc_*/Cargo.toml.
- 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-30 08:46:02 +11:00
bors
2cad938a81 Auto merge of #116447 - oli-obk:gen_fn, r=compiler-errors
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-29 00:03:52 +00:00
Oli Scherer
638d2d6fc1 Feature gate gen blocks, even in 2024 edition 2023-10-27 13:05:48 +00:00
Oli Scherer
998a816106 Make gen blocks implement the Iterator trait 2023-10-27 13:05:48 +00:00
David Tolnay
ac4fa3f245
Pre-intern a symbol for env!("CFG_RELEASE") 2023-10-26 02:02:22 -07:00
Oli Scherer
a61cf673cd Reserve gen keyword for gen {} blocks and gen fn in 2024 edition 2023-10-26 06:49:17 +00:00
Oli Scherer
268ec72839 Make Iterator a lang item 2023-10-25 16:18:57 +00:00
Matthias Krüger
84f0befac5
Rollup merge of #116943 - heiher:target-features, r=wesleywiser
Add target features for LoongArch
2023-10-24 19:29:55 +02:00
WANG Rui
cb618162b1 compiler: Add target features for LoongArch 2023-10-24 09:36:47 +08:00
Michael Goulet
a387a3cf9d Let's see what those opaque types actually are 2023-10-23 16:18:35 -04:00
bors
a56bd2b944 Auto merge of #116849 - oli-obk:error_shenanigans, r=cjgillot
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-23 09:59:40 +00:00
Matthias Krüger
d6ac149b4f
Rollup merge of #116312 - c410-f3r:try, r=Mark-Simulacrum
Initiate the inner usage of `cfg_match` (Compiler)

cc #115585

Dogfood to test the implementation and remove dependencies.
2023-10-21 21:22:59 +02:00
Oli Scherer
8c66e117e2 Re-add generators as a removed feature and point to the new feature name 2023-10-20 21:14:02 +00:00
Oli Scherer
e96ce20b34 s/generator/coroutine/ 2023-10-20 21:14:01 +00:00
Oli Scherer
eb99a89bd7 Ensure we never accidentally serialize an ErrorGuaranteed 2023-10-20 08:46:30 +00:00
Caio
6379013876 Initiate the inner usage of cfg_match 2023-10-19 20:18:51 -03:00
bors
94c4e5c411 Auto merge of #115214 - Urgau:rfc-3127-trim-paths, r=compiler-errors
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-19 19:09:29 +00:00
Urgau
eccc9e6628 [RFC 3127 - Trim Paths]: Condition remapped filepath on remap scopes 2023-10-17 10:11:30 +02:00
Arthur Lafrance
5895102c4d debug Span::ctxt() call detection 2023-10-16 19:50:29 -07:00
Arthur Lafrance
f77dea89e1 basic lint v2 implemented 2023-10-16 19:47:33 -07:00
Arthur Lafrance
8769e02d0b implement the basics of the lint static analysis 2023-10-16 19:47:33 -07:00
Michael Goulet
b2d2184ede Format all the let chains in compiler 2023-10-13 08:59:36 +00:00
Michael Howell
c6e6ecb1af rustdoc: remove rust logo from non-Rust crates 2023-10-08 20:17:53 -07:00
Matthias Krüger
9796dfdd56
Rollup merge of #116474 - nnethercote:rustc_assorted, r=spastorino
Assorted small cleanups

r? `@spastorino`
2023-10-06 21:17:50 +02:00
bors
64fa0c34d7 Auto merge of #115304 - Enselic:trailing-gt, r=cjgillot
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-06 14:57:09 +00:00
Nicholas Nethercote
108e541cc2 Remove unused FileName::CfgSpec. 2023-10-06 14:57:09 +11:00
Jason Newcomb
d464b72970 Add more diagnostic items for clippy 2023-10-05 18:21:47 -04:00
Martin Nordholts
8a1be9942d Allow file names to end with '>'
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-05 20:17:48 +02:00