about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2024-12-05make SC fences stronger, to be correct wrt C++20Ralf Jung-147/+120
2024-12-05move GlobalState definition further up so the types are mor concentrated at ↵Ralf Jung-98/+98
the top of the file
2024-12-05extend some comments regarding weak memory emulationRalf Jung-6/+17
2024-12-05Rollup merge of #133892 - jieyouxu:revert-eprintln, r=jieyouxuLeón Orell Valerian Liehr-210/+206
Revert #133817 This reverts commit 0585134e709de4a14e509158662fa569c155c195, reversing changes made to 5530869e0ff21d69e0eef1a4c4fd1f25bcbe7fbf. #133817 unfortunately only converted the `println!` instances to `eprintln!`, meaning that some test output (via compiletest/bootstrap) was messed up because stdout/stderr output interleaved improperly when some `println!` instances were converted to `eprintln!` instances, while some `print!` instances remain unchanged. This made reading test output annoying for contributors cc #133879. Closes #133879 by reverting. #133817 can be relanded in the future when `print!` instances are also matched with `println!` instances. cc `@clubby789` This is a clean revert so I'm going to self-approve this PR.
2024-12-05Rollup merge of #133863 - oli-obk:push-pystoxvtvssx, r=lqdLeón Orell Valerian Liehr-11/+2
Rename `core_pattern_type` and `core_pattern_types` lib feature gates to `pattern_type_macro` That's what the gates are actually gating, and the single char difference in naming was not helpful either fixes #128987
2024-12-05Rollup merge of #133761 - rustbot:docs-update, r=ehussLeón Orell Valerian Liehr-0/+0
Update books ## rust-lang/book 12 commits in e16dd73690a6cc3ecdc5f5d94bbc3ce158a42e16..614c19cb4025636eb2ba68ebb3d44e3bd3a5e6e4 2024-12-02 16:22:15 UTC to 2024-11-26 21:15:51 UTC - Fix more inverted uses of “shadowed” (rust-lang/book#4122) - Fix a couple inverted uses of “shadowed” (rust-lang/book#4121) - Fix confusion between variable `hello` and string `"hello"` (rust-lang/book#4118) - Ch. 17: fix some wording issues (rust-lang/book#4117) - Rephrase for clarity (rust-lang/book#3809) - Link to tests section of rustc book for `cargo test -- --help` docs (rust-lang/book#4116) - Drop a pedantry-triggering sentence about IEEE-754 (rust-lang/book#4114) - Very small clarification on if let (rust-lang/book#4113) - Ch17-05: Typos (rust-lang/book#4099) - Ch20-01: Fix typos (rust-lang/book#4105) - Add a short paragraph on editors and IDEs in installation (rust-lang/book#4112) - Rust 2024: update Ch. 20 for new `unsafe` rules (rust-lang/book#4111) ## rust-lang/reference 8 commits in 5c86c739ec71b8bc839310ff47fa94e94635bba9..ede56d1bbe132bac476b5029cd6d7508ca9572e9 2024-11-25 17:23:35 +0000 to 2024-12-03 22:26:55 +0000 - Claim to follow Unicode 16 for lexing identifiers. (rust-lang/reference#1688) - Clarify rules for on_unimplemented warnings (rust-lang/reference#1680) - Enable triagebot merge-conflict notifications (rust-lang/reference#1682) - Update default edition to 2024 for code examples (rust-lang/reference#1684) - Fix weak keywords (rust-lang/reference#1685) - `const` expression can borrow static items (rust-lang/reference#1610) - Update function-pointer.md for stabilization of `extended_varargs_abi_support` (rust-lang/reference#1687) - fix inconsistent spacing in example (rust-lang/reference#1686) ## edition-guide 1 commits in f48b0e842a3911c63240e955d042089e9e0894c7..128669297c8a7fdf771042eaec18b8adfaeaf0cd 2024-11-25 16:20:27 +0000 to 2024-12-03 22:02:43 +0000 - Fix `if_let_rescope` applicability (rust-lang/edition-guide#339) ## rust-lang/rustc-dev-guide 6 commits in 787b4166ccc67bd8f72a6e3ef6685ce9ce82909a..b21d99b770f9aceb0810c843847c52f86f45d2ed 2024-12-02 04:45:30 UTC to 2024-11-27 10:31:58 UTC - Spell out `git submodule deinit -f --all` (rust-lang/rustc-dev-guide#2153) - Explain how to deal with exploded git submodules (rust-lang/rustc-dev-guide#2152) - Update `//@ proc-macro` aux build directive docs (rust-lang/rustc-dev-guide#2149) - Remove `pretty-expanded` as it no longer exists (rust-lang/rustc-dev-guide#2147) - Fix trivial typo (rust-lang/rustc-dev-guide#2148) - Remove -Zfuel. (rust-lang/rustc-dev-guide#2032)
2024-12-05Rollup merge of #133233 - estebank:const-errors, r=NadrierilLeón Orell Valerian Liehr-1/+0
Add context to "const in pattern" errors *Each commit addresses specific diagnostics.* - Add primary span labels - Point at `const` item, and `const` generic param definition - Reword messages and notes - Point at generic param through which an associated `const` is being referenced - Silence const in pattern with evaluation errors when they come from `const` items that already emit a diagnostic - On non-structural type in const used as pattern, point at the type that should derive `PartialEq`
2024-12-05Rollup merge of #118833 - Urgau:lint_function_pointer_comparisons, r=cjgillotLeón Orell Valerian Liehr-170/+83
Add lint against function pointer comparisons This is kind of a follow-up to https://github.com/rust-lang/rust/pull/117758 where we added a lint against wide pointer comparisons for being ambiguous and unreliable; well function pointer comparisons are also unreliable. We should IMO follow a similar logic and warn people about it. ----- ## `unpredictable_function_pointer_comparisons` *warn-by-default* The `unpredictable_function_pointer_comparisons` lint checks comparison of function pointer as the operands. ### Example ```rust fn foo() {} let a = foo as fn(); let _ = a == foo; ``` ### Explanation Function pointers comparisons do not produce meaningful result since they are never guaranteed to be unique and could vary between different code generation units. Furthermore different function could have the same address after being merged together. ---- This PR also uplift the very similar `clippy::fn_address_comparisons` lint, which only linted on if one of the operand was an `ty::FnDef` while this PR lints proposes to lint on all `ty::FnPtr` and `ty::FnDef`. ```@rustbot``` labels +I-lang-nominated ~~Edit: Blocked on https://github.com/rust-lang/libs-team/issues/323 being accepted and it's follow-up pr~~
2024-12-05Revert "Rollup merge of #133817 - clubby789:bootstrap-eprintln, r=jieyouxu"Jieyou Xu-210/+206
This reverts commit 0585134e709de4a14e509158662fa569c155c195, reversing changes made to 5530869e0ff21d69e0eef1a4c4fd1f25bcbe7fbf. The PR unfortunately only converted the `ln!` instances, meaning that test output was messed up because stdout/stderr output interleaved when some `println!` instances were converted to `eprintln!` instances, while some `println!` instances remain unchanged.
2024-12-05Remove `//@ compare-output-lines-by-subset` directive (#2151)许杰友 Jieyou Xu (Joe)-4/+0
2024-12-05Document `needs-target-has-atomic` directive (#2154)许杰友 Jieyou Xu (Joe)-0/+4
2024-12-05Update comments on Windows job objectsChris Denton-4/+7
2024-12-05Nested job objects are now supported in CIChris Denton-9/+1
Nested job objects aren't supported on Windows 7 but we've long since moved on from that.
2024-12-05Never close a job after the process is assignedChris Denton-13/+9
2024-12-04Update edition-guide and referenceEric Huss-0/+0
2024-12-04Reformat Python code with `ruff`Jakub Beránek-922/+1492
2024-12-04Exclude additional subtrees in `ruff` configJakub Beránek-0/+6
2024-12-04Tweak ptr in pattern errorEsteban Küber-1/+0
Conform to error style guide.
2024-12-05Fix "std" support status of some tier 3 targetsTaiki Endo-8/+8
2024-12-04Rollup merge of #133856 - GuillaumeGomez:update-sysinfo, r=clubby789Matthias Krüger-8/+9
Update sysinfo version to 0.33.0
2024-12-04Rollup merge of #133737 - Walnut356:msvc_visualizers, r=onur-ozkanMatthias Krüger-14/+14
Include LLDB and GDB visualizers in MSVC distribution MSVC distributions currently don't include the lldb or GDB python files. MSVC and LLDB/GDB are not mutually exclusive (and end up being a common case with vscode + codelldb/lldb-dap), so they should probably be included. the existing visualizers currently only partially work on MSVC due to the differences in how the debug info is generated, but they also only partially work on GNU anyway - both of which are actively being fixed.
2024-12-04Merge pull request #18611 from ChayimFriedman2/proc-macro-warnLukas Wirth-0/+13
fix: Do not report warnings from proc macros, ever
2024-12-04Rename `core_pattern_type` and `core_pattern_types` lib feature gates to ↵Oli Scherer-11/+2
`pattern_type_macro` That's what the gates are actually gating, and the single char difference in naming was not helpful either
2024-12-04add test to demonstrate the effect of #4008Johannes Hostert-0/+60
2024-12-04fix: update `introduce_named_generic` to use `type_param` directlyTarek-3/+2
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04Update sysinfo version to 0.33.0Guillaume Gomez-8/+9
2024-12-04Merge pull request #4006 from JoJoDeveloping/tb-fix-3846-retagRalf Jung-90/+329
Fix #3846 properly, so that subtrees can be skipped again
2024-12-04Do not report warnings from proc macros, everChayim Refael Friedman-0/+13
2024-12-04add a change entry for new default on `build.vendor`onur-ozkan-0/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-04Properly fix #3846 by resetting parents on lazy node creationJohannes Hostert-90/+306
This commit supplies a real fix, which makes retags more complicated, at the benefit of making accesses more performant. Co-authored-by: Ralf Jung <post@ralfj.de>
2024-12-04use vendor sources by default on dist tarballsonur-ozkan-1/+6
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-04refactor: move editing for ast using `SyntaxEditor` to a separate fileTarek-74/+74
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04fix: refactor `introduce_named_generic` assistTarek-42/+31
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04fix: correct token type for closing angle bracketTarek-1/+1
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04fix: refactor `syntax_editor_add_generic_param`Tarek-19/+41
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04fix: refactor `syntax_editor_add_generic_param` to handle adding new generic ↵Tarek-47/+43
parameters Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04fix: refactor syntax_editor_add_generic_param to handle new generic parametersTarek-12/+11
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04fix: implement `syntax_editor_create_generic_param_list`Tarek-5/+35
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04define syntax_editor_add_generic_paramTarek-7/+34
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04fix: remove make_mut from introduce_named_generic assistTarek-2/+0
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04feat: migrate introduce_named_generic assist to use SyntaxFactoryTarek-5/+41
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04Complete diagnostics in ty lowering groundworkChayim Refael Friedman-103/+621
Implement diagnostics in all places left: generics (predicates, defaults, const params' types), fields, and type aliases. Unfortunately this results in a 20mb addition in `analysis-stats .` due to many type methods returning an addition diagnostics result now (even if it's `None` in most cases). I'm not sure if this can be improved. An alternative strategy that can prevent the memory usage growth is to never produce diagnostics in hir-ty methods. Instead, lower all types in the hir crate when computing diagnostics from scratch (with diagnostics this time). But this has two serious disadvantages: 1. This can cause code duplication (although it can probably be not that bad, it will still mean a lot more code). 2. I believe we eventually want to compute diagnostics for the *entire* workspace (either on-type or on-save or something alike), so users can know when they have diagnostics even in inactive files. Choosing this approach will mean we lose all precomputed salsa queries. For one file this is fine, for the whole workspace this will be very slow.
2024-12-04Lay the foundation for diagnostics in ty lowering, and implement a first ↵Chayim Refael Friedman-80/+811
diagnostic The diagnostic implemented is a simple one (E0109). It serves as a test for the new foundation. This commit only implements diagnostics for type in bodies and body-carrying signatures; the next commit will include diagnostics in the rest of the things. Also fix one weird bug that was detected when implementing this that caused `Fn::(A, B) -> C` (which is a valid, if bizarre, alternative syntax to `Fn(A, B) -> C` to lower incorrectly. And also fix a maybe-bug where parentheses were sneaked into a code string needlessly; this was not detected until now because the parentheses were removed (by the make-AST family API), but with a change in this commit they are now inserted. So fix that too.
2024-12-04Store some hir_def Paths in the type ref source mapsChayim Refael Friedman-77/+144
Most paths are types and therefore already are in the source map, but the trait in impl trait and in bounds are not. We do this by storing them basically as `TypeRef`s. For convenience, I created a wrapper around `TypeRefId` called `PathId` that always stores a path, and implemented indexing from the types map to it. Fortunately, this change impacts memory usage negligibly (adds 2mb to `analysis-stats .`, but that could be just fluff). Probably because there aren't that many trait bounds and impl traits, and this also shrinks `TypeBound` by 8 bytes. I also added an accessor to `TypesSourceMap` to get the source code, which will be needed for diagnostics.
2024-12-04Fix parsing of parenthesized type args and RTNLukas Wirth-698/+1020
2024-12-04refactor: change target parameter to a reference in add_rewrite methodTarek-12/+6
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04feat: migrate `sort_items` assist to use `SyntaxFactory`Tarek-18/+22
Signed-off-by: Tarek <tareknaser360@gmail.com>
2024-12-04Auto merge of #133799 - DianQK:llvm/19.1.5, r=nikicbors-0/+0
Update LLVM to 19.1.5 Fixes #133276. Fixes #133203. r? nikic or wg-llvm
2024-12-04implement simd_relaxed_fmaRalf Jung-33/+97
2024-12-04Auto merge of #133841 - matthiaskrgr:rollup-2snj3hc, r=matthiaskrgrbors-252/+250
Rollup of 6 pull requests Successful merges: - #133651 (Update `NonZero` and `NonNull` to not field-project (per MCP#807)) - #133764 (rustdoc: Rename `set_back_info` to `restore_module_data`.) - #133784 (Fix MutVisitor's default implementations to visit Stmt's and BinOp's spans) - #133798 (stop replacing bivariant args with `'static` when computing closure requirements) - #133804 (Improve code for FileName retrieval in rustdoc) - #133817 (Use `eprintln` instead of `println` in bootstrap/compiletest/tidy) Failed merges: - #133810 (remove unnecessary `eval_verify_bound`) r? `@ghost` `@rustbot` modify labels: rollup