about summary refs log tree commit diff
path: root/compiler/rustc_hir_analysis
AgeCommit message (Collapse)AuthorLines
2024-06-30add `rustc_dump_def_parents` attributeBoxy-1/+50
2024-06-30Make `feature(effects)` require `-Znext-solver`Deadbeef-0/+16
2024-06-30Auto merge of #127133 - matthiaskrgr:rollup-jxkp3yf, r=matthiaskrgrbors-1/+18
Rollup of 9 pull requests Successful merges: - #123237 (Various rustc_codegen_ssa cleanups) - #126960 (Improve error message in tidy) - #127002 (Implement `x perf` as a separate tool) - #127081 (Add a run-make test that LLD is not being used by default on the x64 beta/stable channel) - #127106 (Improve unsafe extern blocks diagnostics) - #127110 (Fix a error suggestion for E0121 when using placeholder _ as return types on function signature.) - #127114 (fix: prefer `(*p).clone` to `p.clone` if the `p` is a raw pointer) - #127118 (Show `used attribute`'s kind for user when find it isn't applied to a `static` variable.) - #127122 (Remove uneccessary condition in `div_ceil`) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-29Rollup merge of #127110 - surechen:fix_125488_06, r=compiler-errorsMatthias Krüger-1/+18
Fix a error suggestion for E0121 when using placeholder _ as return types on function signature. Recommit after refactoring based on comment: https://github.com/rust-lang/rust/pull/126017#issuecomment-2189149361 But when changing return type's lifetime to `ReError` will affect the subsequent borrow check process and cause test11 in typeck_type_placeholder_item.rs to lost E0515 message. ```rust fn test11(x: &usize) -> &_ { //~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types &x //~ ERROR cannot return reference to function parameter(this E0515 msg will disappear) } ``` fixes #125488 r? ``@pnkfelix``
2024-06-29Auto merge of #120639 - fee1-dead-contrib:new-effects-desugaring, r=oli-obkbors-67/+224
Implement new effects desugaring cc `@rust-lang/project-const-traits.` Will write down notes once I have finished. * [x] See if we want `T: Tr` to desugar into `T: Tr, T::Effects: Compat<true>` * [x] Fix ICEs on `type Assoc: ~const Tr` and `type Assoc<T: ~const Tr>` * [ ] add types and traits to minicore test * [ ] update rustc-dev-guide Fixes #119717 Fixes #123664 Fixes #124857 Fixes #126148
2024-06-29Fix a error suggestion for E0121 when using placeholder _ as return types on ↵surechen-1/+18
function signature. Recommit after refactoring based on comment: https://github.com/rust-lang/rust/pull/126017#issuecomment-2189149361 But when changing return type's lifetime to `ReError` will affect the subsequent borrow check process and cause test11 in typeck_type_placeholder_item.rs to lost E0515 message. ```rust fn test11(x: &usize) -> &_ { //~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types &x //~ ERROR cannot return reference to function parameter(this E0515 msg will disappear) } ```
2024-06-28address review commentsDeadbeef-24/+30
2024-06-28general fixups and turn `TODO`s into `FIXME`sDeadbeef-9/+14
2024-06-28Implement `Self::Effects: Compat<HOST>` desugaringDeadbeef-3/+20
2024-06-28bless tests part 1Deadbeef-0/+4
2024-06-28temporarily disable effects on specialization testsDeadbeef-0/+1
2024-06-28move desugaring to item boundsDeadbeef-31/+26
2024-06-28Implement `Min` trait in new solverDeadbeef-1/+1
2024-06-28implement new effects desugaringDeadbeef-67/+196
2024-06-27Make queries more explicitMichael Goulet-14/+14
2024-06-26Rollup merge of #126968 - lqd:issue-126670, r=compiler-errorsMatthias Krüger-4/+4
Don't ICE during RPITIT refinement checking for resolution errors after normalization #126670 shows a case where resolution errors after normalization can happen during RPITIT refinement checking. Our tests didn't reach this path before, and we explicitly ICEd until we had a test. We can now delay a bug since we're sure it is reachable and have the test from the isue. The comment I added likely still needs more expert wordsmithing. r? ``@compiler-errors`` who's making me work during vacation (j/k). Fixes #126670
2024-06-25delay bug in RPITIT refinement checking with resolution errorsRémy Rakic-4/+4
2024-06-25Rollup merge of #126868 - bvanjoi:fix-126764, r=davidtwcoMatthias Krüger-5/+12
not use offset when there is not ends with brace Fixes #126764
2024-06-24Split out IntoIterator and non-Iterator constructors for ↵Michael Goulet-15/+24
AliasTy/AliasTerm/TraitRef/projection
2024-06-23not use offset when there is not ends with bracebohan-5/+12
2024-06-22Rollup merge of #126552 - fee1-dead-contrib:rmfx, r=compiler-errorsMatthias Krüger-12/+12
Remove use of const traits (and `feature(effects)`) from stdlib The current uses are already unsound because they are using non-const impls in const contexts. We can reintroduce them by reverting the commit in this PR, after #120639 lands. Also, make `effects` an incomplete feature. cc `@rust-lang/project-const-traits` r? `@compiler-errors`
2024-06-22Rollup merge of #126686 - fmease:dump-preds-n-item-bounds, r=compiler-errorsGuillaume Gomez-104/+118
Add `#[rustc_dump_{predicates,item_bounds}]` Conflicts with #126668. As discussed r? compiler-errors CC ``@fee1-dead``
2024-06-22Add `#[rustc_dump_{predicates,item_bounds}]`León Orell Valerian Liehr-0/+26
2024-06-21Fix remaining casesMichael Goulet-2/+2
2024-06-21Rename a bunch of thingsMichael Goulet-11/+11
2024-06-21update intrinsic const param countingDeadbeef-12/+12
2024-06-20Slightly refactor the dumping of HIR analysis dataLeón Orell Valerian Liehr-104/+92
2024-06-20Rollup merge of #126717 - nnethercote:rustfmt-use-pre-cleanups, r=jieyouxuMatthias Krüger-0/+1
Clean up some comments near `use` declarations #125443 will reformat all `use` declarations in the repository. There are a few edge cases involving comments on `use` declarations that require care. This PR cleans up some clumsy comment cases, taking us a step closer to #125443 being able to merge. r? ``@lqd``
2024-06-20Rollup merge of #126620 - oli-obk:taint_errors, r=fee1-deadMatthias Krüger-10/+1
Actually taint InferCtxt when a fulfillment error is emitted And avoid checking the global error counter fixes #122044 fixes #123255 fixes #123276 fixes #125799
2024-06-20Add blank lines after module-level `//` comments.Nicholas Nethercote-0/+1
Similar to the previous commit.
2024-06-19Allow tracing through item_bounds query invocations on opaquesOli Scherer-1/+1
Previously these caused cycles when printing the result
2024-06-19Remove a hack that isn't needed anymoreOli Scherer-10/+1
2024-06-19Rollup merge of #125293 - dingxiangfei2009:tail-expr-temp-lifetime, ↵许杰友 Jieyou Xu (Joe)-2/+8
r=estebank,davidtwco Place tail expression behind terminating scope This PR implements #123739 so that we can do further experiments in nightly. A little rewrite has been applied to `for await` lowering. It was previously `unsafe { Pin::unchecked_new(into_async_iter(..)) }`. Under the edition 2024 rule, however, `into_async_iter` gets dropped at the end of the `unsafe` block. This presumably the first Edition 2024 migration rule goes by hoisting `into_async_iter(..)` into `match` one level above, so it now looks like the following. ```rust match into_async_iter($iter_expr) { ref mut iter => match unsafe { Pin::unchecked_new(iter) } { ... } } ```
2024-06-18Remove redundant argument from `subdiagnostic` methodOli Scherer-46/+28
2024-06-18Use a dedicated type instead of a reference for the diagnostic contextOli Scherer-2/+2
This paves the way for tracking more state (e.g. error tainting) in the diagnostic context handle
2024-06-18Prefer `dcx` methods over fields or fields' methodsOli Scherer-1/+1
2024-06-17Rework precise capturing syntaxMichael Goulet-2/+8
2024-06-18tail expression behind terminating scopeDing Xiang Fei-2/+8
2024-06-15Rollup merge of #126417 - beetrees:f16-f128-inline-asm-x86, r=AmanieuMatthias Krüger-0/+4
Add `f16` and `f128` inline ASM support for `x86` and `x86-64` This PR adds `f16` and `f128` input and output support to inline ASM on `x86` and `x86-64`. `f16` vector sizes are taken from [here](https://www.intel.com/content/www/us/en/docs/intrinsics-guide/index.html). Relevant issue: #125398 Tracking issue: #116909 ``@rustbot`` label +F-f16_and_f128
2024-06-14Use is_lang_item more aggressivelyMichael Goulet-5/+6
2024-06-14Update for reviewmatt rice-2/+17
2024-06-14Rollup merge of #126054 - veera-sivarajan:bugfix-113073-bound-on-generics-2, ↵Matthias Krüger-10/+78
r=fee1-dead `E0229`: Suggest Moving Type Constraints to Type Parameter Declaration Fixes #113073 This PR suggests `impl<T: Bound> Trait<T> for Foo` when finding `impl Trait<T: Bound> for Foo`. Tangentially, it also improves a handful of other error messages. It accomplishes this in two steps: 1. Check if constrained arguments and parameter names appear in the same order and delay emitting "incorrect number of generic arguments" error because it can be confusing for the programmer to see `0 generic arguments provided` when there are `n` constrained generic arguments. 2. Inside `E0229`, suggest declaring the type parameter right after the `impl` keyword by finding the relevant impl block's span for type parameter declaration. This also handles lifetime declarations correctly. Also, the multi part suggestion doesn't use the fluent error mechanism because translating all the errors to fluent style feels outside the scope of this PR. I will handle it in a separate PR if this gets approved.
2024-06-13Add `f16` and `f128` inline ASM support for `x86` and `x86-64`beetrees-0/+4
2024-06-12E0229: Suggest Moving Type Constraints to Type Parameter DeclarationVeera-10/+78
2024-06-12Rollup merge of #126340 - fee1-dead-contrib:fix-predicates_of-comments, ↵Michael Goulet-5/+4
r=compiler-errors Fix outdated predacates_of.rs comments <!-- If this PR is related to an unstable feature or an otherwise tracked effort, please link to the relevant tracking issue here. If you don't know of a related tracking issue or there are none, feel free to ignore this. This PR will get automatically assigned to a reviewer. In case you would like a specific user to review your work, you can assign it to them by using r​? <reviewer name> -->
2024-06-12Fix outdated predacates_of.rs commentsDeadbeef-5/+4
2024-06-12Rollup merge of #126228 - BoxyUwU:nested_repeat_expr_generics, r=compiler-errorsGuillaume Gomez-5/+21
Provide correct parent for nested anon const Fixes #126147 99% of this PR is just comments explaining what the issue is. `tcx.parent(` and `hir().get_parent_item(` give different results as the hir owner for all the hir of anon consts is the enclosing function. I didn't attempt to change that as being a hir owner requires a `DefId` and long term we want to stop creating anon consts' `DefId`s before hir ty lowering. So i just opted to change `generics_of` to use `tcx.parent` to get the parent for `AnonConst`'s. I'm not entirely sure about this being what we want, it does seem weird that we have two ways of getting the parent of an `AnonConst` and they both give different results. Alternatively we could just go ahead and make `const_evaluatable_unchecked` a hard error and stop providing generics to repeat exprs. Then this isn't an issue. (The FCW has been around for almost 4 years now) r? ````@compiler-errors````
2024-06-12Auto merge of #126319 - workingjubilee:rollup-lendnud, r=workingjubileebors-68/+95
Rollup of 16 pull requests Successful merges: - #123374 (DOC: Add FFI example for slice::from_raw_parts()) - #124514 (Recommend to never display zero disambiguators when demangling v0 symbols) - #125978 (Cleanup: HIR ty lowering: Consolidate the places that do assoc item probing & access checking) - #125980 (Nvptx remove direct passmode) - #126187 (For E0277 suggest adding `Result` return type for function when using QuestionMark `?` in the body.) - #126210 (docs(core): make more const_ptr doctests assert instead of printing) - #126249 (Simplify `[T; N]::try_map` signature) - #126256 (Add {{target}} substitution to compiletest) - #126263 (Make issue-122805.rs big endian compatible) - #126281 (set_env: State the conclusion upfront) - #126286 (Make `storage-live.rs` robust against rustc internal changes.) - #126287 (Update a cranelift patch file for formatting changes.) - #126301 (Use `tidy` to sort crate attributes for all compiler crates.) - #126305 (Make PathBuf less Ok with adding UTF-16 then `into_string`) - #126310 (Migrate run make prefer rlib) - #126314 (fix RELEASES: we do not support upcasting to auto traits) r? `@ghost` `@rustbot` modify labels: rollup
2024-06-12Rollup merge of #126301 - nnethercote:sort-crate-attributes, r=davidtwcoJubilee-2/+4
Use `tidy` to sort crate attributes for all compiler crates. We already do this for a number of crates, e.g. `rustc_middle`, `rustc_span`, `rustc_metadata`, `rustc_span`, `rustc_errors`. For the ones we don't, in many cases the attributes are a mess. - There is no consistency about order of attribute kinds (e.g. `allow`/`deny`/`feature`). - Within attribute kind groups (e.g. the `feature` attributes), sometimes the order is alphabetical, and sometimes there is no particular order. - Sometimes the attributes of a particular kind aren't even grouped all together, e.g. there might be a `feature`, then an `allow`, then another `feature`. This commit extends the existing sorting to all compiler crates, increasing consistency. If any new attribute line is added there is now only one place it can go -- no need for arbitrary decisions. Exceptions: - `rustc_log`, `rustc_next_trait_solver` and `rustc_type_ir_macros`, because they have no crate attributes. - `rustc_codegen_gcc`, because it's quasi-external to rustc (e.g. it's ignored in `rustfmt.toml`). r? `@davidtwco`
2024-06-12Rollup merge of #125978 - ↵Jubilee-66/+91
fmease:cleanup-hir-ty-lowering-consolidate-assoc-item-access-checking, r=davidtwco Cleanup: HIR ty lowering: Consolidate the places that do assoc item probing & access checking Use `probe_assoc_item` (for hygienically probing an assoc item and checking if it's accessible wrt. visibility and stability) for assoc item constraints, too, not just for assoc type paths and make the privacy error translatable.