about summary refs log tree commit diff
path: root/compiler/rustc_passes/src
AgeCommit message (Collapse)AuthorLines
2023-06-28Auto merge of #111269 - clubby789:validate-fluent-variables, r=davidtwcobors-8/+0
Validate fluent variable references in tests Closes #101109 Under `cfg(test)`, the `fluent_messages` macro will emit a list of variables referenced by each message and its attributes. The derive attribute will now emit a `#[test]` that checks that each referenced variable exists in the structure it's applied to.
2023-06-26`hir`: Add `Become` expression kindMaybe Waffle-2/+10
2023-06-21Rollup merge of #112790 - WaffleLapkin:syntactically, r=NilstriebNilstrieb-1/+2
Syntactically accept `become` expressions (explicit tail calls experiment) This adds `ast::ExprKind::Become`, implements parsing and properly gates the feature. cc `@scottmcm`
2023-06-20Merge attrs, better validationMichael Goulet-44/+6
2023-06-19Syntatically accept `become` expressionsMaybe Waffle-1/+2
2023-06-05Rollup merge of #112081 - obeis:doc-test-literal, r=compiler-errorsMatthias Krüger-6/+17
Avoid ICE on `#![doc(test(...)]` with literal parameter Close #109066 r? `@compiler-errors`
2023-06-02Separate AnonConst from ConstBlock in HIR.Camille GILLOT-3/+23
2023-06-01Use translatable diagnostics in `rustc_const_eval`Deadbeef-7/+2
2023-05-29Avoid ICE on `#![doc(test(...)]` with literal parameterObei Sideg-6/+17
2023-05-26Fix diagnostics with errorsclubby789-8/+0
2023-05-24Use `is_some_and`/`is_ok_and` in less obvious spotsMaybe Waffle-9/+6
2023-05-24Use `Option::is_some_and` and `Result::is_ok_and` in the compilerMaybe Waffle-7/+5
2023-05-17Don't sort output of debugger_visualizer query because it already is in ↵Michael Woerister-2/+3
deterministic order.
2023-05-16Move DebuggerVisualizerFile types from rustc_span to rustc_middleMichael Woerister-2/+6
2023-05-16Turn debugger_visualizers from feed- into regular query.Michael Woerister-5/+16
2023-05-16Fix dependency tracking for debugger visualizersMichael Woerister-110/+61
2023-05-15Move expansion of query macros in rustc_middle to rustc_middle::queryJohn Kåre Alsaker-15/+16
2023-05-04Auto merge of #111014 - klensy:no-rc, r=WaffleLapkinbors-3/+2
try to downgrade Arc -> Lrc -> Rc -> no-Rc in few places Expecting this be not slower on non-parallel compiler and probably faster on parallel (checked that this PR builds on it).
2023-05-04Rollup merge of #111062 - clubby789:invalid-repr-unchecked, r=petrochenkovDylan DPC-7/+1
Don't bail out early when checking invalid `repr` attr Fixes #111051 An invalid repr delays a bug. If there are other invalid attributes on the item, we emit a warning and exit without re-checking the repr here, so no error is emitted and the delayed bug ICEs
2023-05-03Restrict `From<S>` for `{D,Subd}iagnosticMessage`.Nicholas Nethercote-3/+3
Currently a `{D,Subd}iagnosticMessage` can be created from any type that impls `Into<String>`. That includes `&str`, `String`, and `Cow<'static, str>`, which are reasonable. It also includes `&String`, which is pretty weird, and results in many places making unnecessary allocations for patterns like this: ``` self.fatal(&format!(...)) ``` This creates a string with `format!`, takes a reference, passes the reference to `fatal`, which does an `into()`, which clones the reference, doing a second allocation. Two allocations for a single string, bleh. This commit changes the `From` impls so that you can only create a `{D,Subd}iagnosticMessage` from `&str`, `String`, or `Cow<'static, str>`. This requires changing all the places that currently create one from a `&String`. Most of these are of the `&format!(...)` form described above; each one removes an unnecessary static `&`, plus an allocation when executed. There are also a few places where the existing use of `&String` was more reasonable; these now just use `clone()` at the call site. As well as making the code nicer and more efficient, this is a step towards possibly using `Cow<'static, str>` in `{D,Subd}iagnosticMessage::{Str,Eager}`. That would require changing the `From<&'a str>` impls to `From<&'static str>`, which is doable, but I'm not yet sure if it's worthwhile.
2023-05-01Don't bail out early when checking invalid `repr` attrclubby789-7/+1
2023-04-30Arc -> Lrcklensy-3/+2
2023-04-26Migrate `rustc_passes` to translatable diagnosticsclubby789-174/+266
2023-04-24Split `{Idx, IndexVec, IndexSlice}` into their own modulesMaybe Waffle-1/+1
2023-04-24Auto merge of #109590 - Nilstrieb:copy-hir, r=oli-obkbors-1/+1
Impl `Copy` for most HIR types This simplifies the invocation of the `arena_types` macro and probably makes working with HIR nicer in general. Based on #109588
2023-04-23Auto merge of #108118 - oli-obk:lazy_typeck, r=cjgillotbors-13/+14
Run various queries from other queries instead of explicitly in phases These are just legacy leftovers from when rustc didn't have a query system. While there are more cleanups of this sort that can be done here, I want to land them in smaller steps. This phased order of query invocations was already a lie, as any query that looks at types (e.g. the wf checks run before) can invoke e.g. const eval which invokes borrowck, which invokes typeck, ...
2023-04-22Impl `Copy` for almost all HIR typesNilstrieb-1/+1
This simplifies the invocation of the `arena_types` macro and probably makes working with HIR nicer in general.
2023-04-21Run `check_match` and `check_liveness` when MIR is built instead of having ↵Oli Scherer-2/+8
an explicit phase for them
2023-04-21Make `check_match` and `check_liveness` take a `LocalDefId`Oli Scherer-11/+6
2023-04-21fmtDrMeepster-6/+3
2023-04-21fix incorrect param env in dead code lintDrMeepster-4/+5
2023-04-21offset_ofDrMeepster-3/+44
2023-04-18Add `rustc_fluent_macro` to decouple fluent from `rustc_macros`Nilstrieb-1/+1
Fluent, with all the icu4x it brings in, takes quite some time to compile. `fluent_messages!` is only needed in further downstream rustc crates, but is blocking more upstream crates like `rustc_index`. By splitting it out, we allow `rustc_macros` to be compiled earlier, which speeds up `x check compiler` by about 5 seconds (and even more after the needless dependency on `serde_json` is removed from `rustc_data_structures`).
2023-04-16Allow all associated functions and add testDeadbeef-4/+4
2023-04-14allow `repr(align = x)` on inherent methodsDeadbeef-5/+11
2023-04-13impl reviewer feedbackEzra Shaw-11/+10
- remove unused (pun intentional) `continue` - improve wording with assoc items in general
2023-04-13dead-code-lint: de-dup multiple unused assoc fnsEzra Shaw-17/+37
2023-04-13refactor: emit "unused assoc fn" in lexical orderEzra Shaw-4/+7
with repect to other dead code lints
2023-04-12Rollup merge of #110203 - compiler-errors:rtn-dots, r=eholkMatthias Krüger-1/+1
Remove `..` from return type notation `@nikomatsakis` and I decided that using `..` in the return-type notation syntax is probably overkill. r? `@eholk` since you reviewed the last one Since this is piggybacking now totally off of a pre-existing syntax (parenthesized generics), let me know if you need any explanation of the logic here, since it's a bit more complicated now.
2023-04-12Auto merge of #109935 - michaelwoerister:fix-feed-in-eval-always, r=cjgillotbors-2/+0
incr.comp.: Make sure dependencies are recorded when feeding queries during eval-always queries. This PR makes sure we don't drop dependency edges when feeding queries during an eval-always query. Background: During eval-always queries, no dependencies are recorded because the system knows to unconditionally re-evaluate them regardless of any actual dependencies. This works fine for these queries themselves but leads to a problem when feeding other queries: When queries are fed, we set up their dependency edges by copying the current set of dependencies of the feeding query. But because this set is empty for eval-always queries, we record no edges at all -- which has the effect that the fed query instances always look "green" to the system, although they should always be "red". The fix is to explicitly add a dependency on the artificial "always red" dep-node when feeding during eval-always queries. Fixes https://github.com/rust-lang/rust/issues/108481 Maybe also fixes issue https://github.com/rust-lang/rust/issues/88488. cc `@jyn514` r? `@cjgillot` or `@oli-obk`
2023-04-10Remove `..` from return type notationMichael Goulet-1/+1
2023-04-09Migrate `sess.opts.tests` uses to `sess.is_test_crate()`blyxyas-1/+1
2023-04-05incr.comp.: Don't ignore dep-tracking during HirId validation.Michael Woerister-22/+20
2023-04-04incr.comp.: Make sure dependencies are recorded when feeding queries during ↵Michael Woerister-22/+22
eval-always queries.
2023-04-04Replace a lock with an atomicOli Scherer-1/+1
2023-04-01slighty simplify a few boolean expressions (clippy::nonminimal_bool)Matthias Krüger-1/+1
2023-03-31Auto merge of #109824 - GuillaumeGomez:rollup-i5r4uts, r=GuillaumeGomezbors-15/+0
Rollup of 7 pull requests Successful merges: - #109104 (rustdoc: Fix invalid suggestions on ambiguous intra doc links v2) - #109443 (Move `doc(primitive)` future incompat warning to `invalid_doc_attributes`) - #109680 (Fix subslice capture in closure) - #109798 (fluent_messages macro: don't emit the OS error in a note) - #109805 (Source map cleanups) - #109818 (rustdoc: Add GUI test for jump to collapsed item) - #109820 (rustdoc-search: update docs for comma in `?` help popover) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2023-03-31Rollup merge of #109443 - GuillaumeGomez:doc-primitive-hard-error, r=notriddleGuillaume Gomez-15/+0
Move `doc(primitive)` future incompat warning to `invalid_doc_attributes` Fixes #88070. It's been a while since this was turned into a "future incompatible lint" so I think we can now turn it into a hard error without problem. r? `@jyn514`
2023-03-31Auto merge of #109010 - compiler-errors:rtn, r=eholkbors-1/+1
Initial support for return type notation (RTN) See: https://smallcultfollowing.com/babysteps/blog/2023/02/13/return-type-notation-send-bounds-part-2/ 1. Only supports `T: Trait<method(): Send>` style bounds, not `<T as Trait>::method(): Send`. Checking validity and injecting an implicit binder for all of the late-bound method generics is harder to do for the latter. * I'd add this in a follow-up. 3. ~Doesn't support RTN in general type position, i.e. no `let x: <T as Trait>::method() = ...`~ * I don't think we actually want this. 5. Doesn't add syntax for "eliding" the function args -- i.e. for now, we write `method(): Send` instead of `method(..): Send`. * May be a hazard if we try to add it in the future. I'll probably add it in a follow-up later, with a structured suggestion to change `method()` to `method(..)` once we add it. 7. ~I'm not in love with the feature gate name 😺~ * I renamed it to `return_type_notation` :heavy_check_mark: Follow-up PRs will probably add support for `where T::method(): Send` bounds. I'm not sure if we ever want to support return-type-notation in arbitrary type positions. I may also make the bounds require `..` in the args list later. r? `@ghost`
2023-03-30Rename doc(primitive) into rustc_doc_primitiveGuillaume Gomez-15/+0