Commit Graph

106 Commits

Author SHA1 Message Date
Dylan DPC 5ca2327217 Rollup merge of #95497 - nyurik:compiler-spell-comments, r=compiler-errors
Spellchecking compiler comments

This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.
2022-03-31 04:57:28 +02:00
Yuri Astrakhan 4b2b8734c7 Spellchecking compiler comments
This PR cleans up the rest of the spelling mistakes in the compiler comments. This PR does not change any literal or code spelling issues.
2022-03-30 15:14:15 -04:00
Camille GILLOT bc84fad964 Remember mutability in DefKind::Static.
This allows to compute the `BodyOwnerKind` from `DefKind` only, and
removes a direct dependency of some MIR queries onto HIR.

As a side effect, it also simplifies metadata, since we don't need 4
flavours of `EntryKind::*Static` any more.
2022-03-29 18:50:52 +02:00
Nicholas Nethercote c4fb3e39fa Improve AdtDef interning.
This commit makes `AdtDef` use `Interned`. Much the commit is tedious
changes to introduce getter functions. The interesting changes are in
`compiler/rustc_middle/src/ty/adt.rs`.
2022-03-11 13:31:24 +11:00
Mark Rousskov 1be1cee840 Switch bootstrap cfgs 2022-02-25 08:00:52 -05:00
Vadim Petrochenkov 2b788835eb resolve: Fix incorrect results of opt_def_kind query for some built-in macros
Previously it always returned `MacroKind::Bang` while some of those macros are actually attributes and derives
2022-02-24 22:54:36 +03:00
bors b1063490e9 Auto merge of #94062 - Mark-Simulacrum:drop-print-cfg, r=oli-obk
Move ty::print methods to Drop-based scope guards

Primary goal is reducing codegen of the TLS access for each closure, which shaves ~3 seconds of bootstrap time over rustc as a whole.
2022-02-20 18:12:59 +00:00
est31 3ceec03f0f Adopt let else in more places 2022-02-19 17:27:43 +01:00
Mark Rousskov bbe17f6688 Move ty::print methods to Drop-based scope guards 2022-02-16 17:24:23 -05:00
Ellen ae8c5d2570 change to a struct variant 2022-02-12 11:23:53 +00:00
Frank Steffahn 0f70ea16e8 Remove further usage of &hir::Map 2022-02-10 13:04:59 +01:00
est31 0f0954d5d0 More let_else adoptions 2022-02-02 17:11:01 +01:00
lcnr 2b315440d3 add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
Matthias Krüger 5e0b23665e Rollup merge of #90277 - pierwill:fix-70258-inference-terms, r=jackh726
Improve terminology around "after typeck"

Closes #70258.
2022-01-31 06:58:26 +01:00
Cameron Steffen 9a8a27496e Remove a span from hir::ExprKind::MethodCall 2022-01-21 07:48:10 -06:00
Guillaume Gomez 4270dec766 Correctly handle starts in block doc comments 2022-01-19 11:18:17 +01:00
Cameron Steffen d09a12259a Replace NestedVisitorMap with NestedFilter 2022-01-16 16:02:36 -06:00
Matthew Jasper cdf8ecb370 Add trait_item_def_id to AssocItem
This allows avoiding some lookups by name
2022-01-07 12:28:12 -08:00
lcnr dee4440970 review 2022-01-03 11:59:01 +01:00
lcnr 089da0cfa4 implement generic_arg_infer for array lengths 2021-12-23 10:09:35 +01:00
bors b5f08995cd Auto merge of #91957 - nnethercote:rm-SymbolStr, r=oli-obk
Remove `SymbolStr`

This was originally proposed in https://github.com/rust-lang/rust/pull/74554#discussion_r466203544. As well as removing the icky `SymbolStr` type, it allows the removal of a lot of `&` and `*` occurrences.

Best reviewed one commit at a time.

r? `@oli-obk`
2021-12-19 09:31:37 +00:00
Matthias Krüger 68eee8e58e Rollup merge of #91880 - matthiaskrgr:clippy_perf_dec, r=jyn514
fix clippy::single_char_pattern perf findings
2021-12-15 10:56:58 +01:00
Nicholas Nethercote d8c26eeb60 Remove unnecessary sigils around Ident::as_str() calls. 2021-12-15 17:32:42 +11:00
Nicholas Nethercote 41c6543547 Remove unnecessary sigils around Symbol::as_str() calls. 2021-12-15 17:32:14 +11:00
Matthias Krüger acb86cb2f7 fix clippy::single_char_pattern perf findings 2021-12-14 12:40:28 +01:00
Esteban Kuber b8c21c95dc Keep info on pre-desugaring expression for better "incorrect .await" suggestion
Keep the `HirId` of `.await`ed expressions so in the case of a `fn` call
on on a sync `fn`, we can suggest maybe turning it into an `async fn`.
2021-12-13 17:09:16 +00:00
Gary Guo f0ff4c2d83 Give inline const separate DefKind 2021-11-07 03:59:06 +00:00
pierwill c8f9e9db94 Improve terminology around "after typeck" 2021-11-06 20:59:38 -05:00
Matthias Krüger a3af550711 clippy::perf fixes 2021-11-04 21:07:56 +01:00
Mark Rousskov ed9ff1b8fc Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
lcnr a55adf3606 allow potential_query_instability everywhere 2021-10-15 10:58:18 +02:00
bors e5f92e6edb Auto merge of #89266 - cjgillot:session-ich, r=michaelwoerister
Move ICH to rustc_query_system

Based on https://github.com/rust-lang/rust/pull/89183

The StableHashingContext does not need to be in rustc_middle.

This PR moves it to rustc_query_system. This will avoid a dependency between rustc_ast_lowering and rustc_middle in https://github.com/rust-lang/rust/pull/89124.
2021-10-05 09:45:11 +00:00
Camille GILLOT 5997ba0be5 Move rustc_middle::middle::cstore to rustc_session. 2021-10-03 16:08:51 +02:00
Bruce Mitchener 600e8704c3 Consistently use 'supertrait'.
A subset of places referred to 'super-trait', so this changes them
to all use 'supertrait'. This matches 'supertype' and some other
usages. An exception is 'auto-trait' which is consistently used
in that manner.
2021-10-02 08:05:44 +07:00
Camille GILLOT c0b0a839bd Avoid more invocations of hir_crate query. 2021-09-29 23:16:47 +02:00
Mark Rousskov f5a19f35c1 Migrate to 2021 2021-09-20 22:21:42 -04:00
Mark Rousskov 82c064933c Bump stage0 compiler to 1.56 2021-09-08 20:51:05 -04:00
jackh726 c2eae151c5 Don't move ?Trait bounds to param bounds if they're in where clauses 2021-09-07 18:08:46 -04:00
Camille GILLOT 17db2dc99b Rename walk_crate. 2021-09-02 19:23:11 +02:00
Camille GILLOT 81c07a9d16 Stop using walk_crate. 2021-09-02 19:08:58 +02:00
inquisitivecrystal acb1c27561 Treat macros as HIR items 2021-08-28 00:16:34 -07:00
Léo Lanteri Thauvin 40f1dd91c1 Use if-let guards in the codebase 2021-08-25 20:24:35 +02:00
Aaron Hill b4f3e54f20 Include (potentially remapped) working dir in crate hash
Fixes #85019

A `SourceFile` created during compilation may have a relative
path (e.g. if rustc itself is invoked with a relative path).
When we write out crate metadata, we convert all relative paths
to absolute paths using the current working direction.

However, the working directory is not included in the crate hash.
This means that the crate metadata can change while the crate
hash remains the same. Among other problems, this can cause a
fingerprint mismatch ICE, since incremental compilation uses
the crate metadata hash to determine if a foreign query is green.

This commit moves the field holding the working directory from
`Session` to `Options`, including it as part of the crate hash.
2021-08-15 15:17:37 -05:00
bors 42c46d15a6 Auto merge of #87568 - petrochenkov:localevel, r=cjgillot
rustc: Replace `HirId`s with `LocalDefId`s in `AccessLevels` tables

and passes using those tables - primarily privacy checking, stability checking and dead code checking.

All these passes work with definitions rather than with arbitrary HIR nodes.
r? `@cjgillot`
cc `@lambinoo` (#87487)
2021-08-04 02:04:04 +00:00
bors 123cdb3a20 Auto merge of #87535 - lf-:authors, r=Mark-Simulacrum
rfc3052 followup: Remove authors field from Cargo manifests

Since RFC 3052 soft deprecated the authors field, hiding it from
crates.io, docs.rs, and making Cargo not add it by default, and it is
not generally up to date/useful information for contributors, we may as well
remove it from crates in this repo.
2021-08-02 05:49:17 +00:00
Vadim Petrochenkov 5a2ce8ebb8 rustc: Replace HirIds with LocalDefIds in AccessLevels tables
and passes using them - primarily privacy checking, stability checking and dead code checking.

WIP
2021-07-31 19:31:29 +03:00
Esteban Küber d82c4bfacc Do not discard ?Sized type params and suggest their removal 2021-07-30 08:44:31 -07:00
Jade c72215df19 rfc3052: Remove authors field from Cargo manifests
Since RFC 3052 soft deprecated the authors field anyway, hiding it from
crates.io, docs.rs, and making Cargo not add it by default, and it is
not generally up to date/useful information, we should remove it from
crates in this repo.
2021-07-29 14:56:05 -07:00
Camille GILLOT 5b12c4496f Introduce OwnerNode::Crate. 2021-07-25 12:22:47 +02:00
Vadim Petrochenkov 891d674d36 rustc_span: Revert addition of proc_macro field to ExpnKind::Macro
The flag has a vague meaning and is used for a single diagnostic change that is low benefit and appears only under `-Z macro_backtrace`.
2021-07-10 23:03:35 +03:00