about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2024-07-16Use `ConstArg` for assoc item constraintsNoah Lev-22/+31
2024-07-16Setup ty::Const functions for `ConstArg`Noah Lev-44/+86
2024-07-16Setup ast_lowering functions for `ConstArg`Noah Lev-55/+69
2024-07-16hir: Create `hir::ConstArgKind` enumNoah Lev-40/+102
This will allow lowering const params to a dedicated enum variant, rather than to an `AnonConst` that is later examined during `ty` lowering.
2024-07-16Add `current_def_id_parent` to `LoweringContext`Noah Lev-16/+30
This is needed to track anon const parents properly once we implement `ConstArgKind::Path` (which requires moving anon const def-creation outside of `DefCollector`): Why do we need this in addition to [`Self::current_hir_id_owner`]? Currently (as of June 2024), anonymous constants are not HIR owners; however, they do get their own DefIds. Some of these DefIds have to be created during AST lowering, rather than def collection, because we can't tell until after name resolution whether an anonymous constant will end up instead being a [`rustc_hir::ConstArgKind::Path`]. However, to compute which generics are available to an anonymous constant nested inside another, we need to make sure that the parent is recorded as the parent anon const, not the enclosing item. So we need to track parent defs differently from HIR owners, since they will be finer-grained in the case of anon consts.
2024-07-16Auto merge of #127831 - tgross35:rollup-c0j9n7b, r=tgross35bors-338/+1429
Rollup of 7 pull requests Successful merges: - #124033 (Sync ar_archive_writer to LLVM 18.1.3) - #126699 (Delegation: support coercion for target expression) - #126762 (Deny keyword lifetimes pre-expansion) - #126967 (Promote the `wasm32-wasip2` target to Tier 2) - #127390 (Migrate `raw-dylib-inline-cross-dylib` and `raw-dylib-custom-dlltool` `run-make` tests to rmake) - #127501 (Invert infer `error_reporting` mod struture) - #127816 (Update method name to reflect changes to its internals) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-16Rollup merge of #127816 - oli-obk:misnomer, r=compiler-errorsTrevor Gross-3/+3
Update method name to reflect changes to its internals forgot to do this in https://github.com/rust-lang/rust/pull/127431
2024-07-16Rollup merge of #127501 - compiler-errors:invert-infer-error-mod-struture, ↵Trevor Gross-87/+508
r=lcnr Invert infer `error_reporting` mod struture Parallel change to #127493, which moves `rustc_infer::infer::error_reporting` to `rustc_infer::error_reporting::infer`. After this, we should just be able to merge this into `rustc_trait_selection::error_reporting::infer`, and pull down `TypeErrCtxt` into that crate. 👍 r? lcnr
2024-07-16Rollup merge of #127390 - Oneirical:rough-testimation, r=jieyouxuTrevor Gross-44/+86
Migrate `raw-dylib-inline-cross-dylib` and `raw-dylib-custom-dlltool` `run-make` tests to rmake Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). Please try: try-job: i686-mingw
2024-07-16Rollup merge of #126967 - alexcrichton:wasm32-wasip2-tier-2, r=Mark-SimulacrumTrevor Gross-3/+264
Promote the `wasm32-wasip2` target to Tier 2 This commit promotes the `wasm32-wasip2` Rust target to tier 2 as proposed in rust-lang/compiler-team#760. There are two major changes in this PR: 1. The `dist-various-2` container, which already produces the other WASI targets, now has an extra target added for `wasm32-wasip2`. 2. A new `wasm-component-ld` binary is added to all host toolchains when LLD is enabled. This is the linker used for the `wasm32-wasip2` target. This new linker is added for all host toolchains to ensure that all host toolchains can produce the `wasm32-wasip2` target. This is similar to how `rust-lld` was originally included for all host toolchains to be able to produce WebAssembly output when the targets were first added. The new linker is developed [here][wasm-component-ld] and is pulled in via a crates.io-based dependency to the tree here. [wasm-component-ld]: https://github.com/bytecodealliance/wasm-component-ld
2024-07-16Rollup merge of #126762 - compiler-errors:kw-lt, r=michaelwoeristerTrevor Gross-70/+99
Deny keyword lifetimes pre-expansion https://github.com/rust-lang/rust/pull/126452#issuecomment-2179464266 > Secondly, we confirmed that we're OK with moving the validation of keywords in lifetimes to pre-expansion from post-expansion. We similarly consider this a bug fix. While the breakage of the convenience feature of the with_locals crate that relies on this is unfortunate, and we wish we had not overlooked this earlier for that reason, we're fortunate that the breakage is contained to only one crate, and we're going to accept this breakage as the extra complexity we'd need to carry in the compiler to work around this isn't deemed worth it. T-lang considers it to be a bugfix to deny `'keyword` lifetimes in the parser, rather than during AST validation that only happens post-expansion. This has one breakage: https://github.com/rust-lang/rust/pull/126452#issuecomment-2171654756 This probably should get lang FCP'd just for consistency.
2024-07-16Rollup merge of #126699 - Bryanskiy:delegation-coercion, r=compiler-errorsTrevor Gross-37/+264
Delegation: support coercion for target expression (solves https://github.com/rust-lang/rust/issues/118212#issuecomment-2160723092) The implementation consist of 2 parts. Firstly, method call is generated instead of fully qualified call in AST->HIR lowering if there were no generic arguments or `Qpath` were provided. These restrictions are imposed due to the loss of information after desugaring. For example in ```rust trait Trait { fn foo(&self) {} } reuse <u8 as Trait>::foo; ``` We would like to generate such a code: ```rust fn foo<u8: Trait>(x: &u8) { x.foo(x) } ``` however, the signature is inherited during HIR analysis where `u8` was discarded. Then, we probe the single pre-resolved method. P.S In the future, we would like to avoid restrictions on the callee path by `Self` autoref/autoderef in fully qualified calls, but at the moment it didn't work out. r? `@petrochenkov`
2024-07-16Rollup merge of #124033 - bjorn3:ar_archive_writer_0_3_0, r=davidtwcoTrevor Gross-94/+205
Sync ar_archive_writer to LLVM 18.1.3 From LLVM 15.0.0-rc3. This adds support for COFF archives containing Arm64EC object files and has various fixes for AIX big archive files.
2024-07-16Auto merge of #126484 - Oneirical:test-in-peace, r=jieyouxu,kobzolbors-50/+83
Migrate `std-core-cycle`, `obey-crate-type-flag`, `mixing-libs` and `issue-18943` `run-make` tests to `rmake.rs` Part of #121876 and the associated [Google Summer of Code project](https://blog.rust-lang.org/2024/05/01/gsoc-2024-selected-projects.html). try-job: x86_64-apple-1 try-job: x86_64-msvc try-job: aarch64-gnu
2024-07-16Auto merge of #127819 - matthiaskrgr:rollup-djdffkl, r=matthiaskrgrbors-500/+643
Rollup of 8 pull requests Successful merges: - #127669 (Fix the issue of invalid suggestion for a reference of iterator) - #127707 (match lowering: Use an iterator to find `expand_until`) - #127730 (Fix and enforce `unsafe_op_in_unsafe_fn` in compiler) - #127789 (delete #![allow(unsafe_op_in_unsafe_fn)] in teeos) - #127805 (run-make-support: update gimli to 0.31.0) - #127808 (Make ErrorGuaranteed discoverable outside types, consts, and lifetimes) - #127817 (Fix a bunch of sites that were walking instead of visiting, making it impossible for visitor impls to look at these values) - #127818 (Various ast validation simplifications) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-16Rollup merge of #127818 - oli-obk:ast_validation_simplifications, r=petrochenkovMatthias Krüger-71/+27
Various ast validation simplifications Changes pulled out of https://github.com/rust-lang/rust/pull/127524 These are needed to make ast validation a mutable visitor, as we can't keep immutable references to the AST around in that case. But I think they are simplifying things in general and can stand on their own
2024-07-16Rollup merge of #127817 - oli-obk:mut_visitor_fix, r=petrochenkovMatthias Krüger-3/+3
Fix a bunch of sites that were walking instead of visiting, making it impossible for visitor impls to look at these values This doesn't affects anything right now, but a `MutVisitor` impl could be surprised by this. The reason this doesn't affect anything is that no one overrrides `visit_lifetime` or `visit_param_bounds` currently.
2024-07-16Rollup merge of #127808 - oli-obk:tainting_visitors2, r=lcnr,nnethercoteMatthias Krüger-32/+38
Make ErrorGuaranteed discoverable outside types, consts, and lifetimes types like `PatKind` could contain `ErrorGuaranteed`, but not return them via `tainted_by_errors` or `error_reported` (see https://github.com/rust-lang/rust/pull/127687#discussion_r1679027883). Now this happens, but it's a bit fragile as you can see with the `TypeSuperVisitable for Ty` impl. We will catch any problems around Ty, Region or Const at runtime with an assert, and everything using derives will not have such issues, as it will just invoke the `TypeVisitable for ErrorGuaranteed` impl
2024-07-16Rollup merge of #127805 - Mrmaxmeier:run-make-bump-gimli, r=jieyouxuMatthias Krüger-2/+13
run-make-support: update gimli to 0.31.0 This version bump is required for the tests in #126985 as suggested [here](https://github.com/rust-lang/rust/pull/126985#issuecomment-2196745112). r​? tgross35 (^ that didn't work. cc `@tgross35)` try-job: x86_64-msvc try-job: x86_64-mingw try-job: aarch64-apple try-job: test-various try-job: armhf-gnu try-job: dist-x86_64-linux
2024-07-16Rollup merge of #127789 - Sword-Destiny:master, r=petrochenkovMatthias Krüger-27/+29
delete #![allow(unsafe_op_in_unsafe_fn)] in teeos deny unsafe_op_in_unsafe_fn for teeos
2024-07-16Rollup merge of #127730 - compiler-errors:ed-2024-unsafe, r=petrochenkovMatthias Krüger-350/+432
Fix and enforce `unsafe_op_in_unsafe_fn` in compiler In preparation for edition 2024, this PR previews the fallout of enabling the `unsafe_op_in_unsafe_fn` lint in the compiler, since it's defaulting to warn in the new edition (#112038). The major annoyance comes primarily from the `rustc_codegen_llvm` module, where there's a ton of unsafe calls. I tended to wrap individual calls to unsafe fns in `unsafe {}`, but there a handful of places I chose to just wrap several calls in an `unsafe {}` block just because it would've been excessive to wrap each call individually. This doesn't enable the lint for the standard library, since I'm not totally certain what T-libs prefers w/ this lint.
2024-07-16Rollup merge of #127707 - Zalathar:expand-until, r=NadrierilMatthias Krüger-14/+19
match lowering: Use an iterator to find `expand_until` A small cleanup that I noticed while looking at #127164. This makes it easier to see that the split point is always the index after the found item, or the whole list if no stopping point was found. r? `@Nadrieril`
2024-07-16Rollup merge of #127669 - chenyukang:yukang-fix-deref-127590, r=nnethercoteMatthias Krüger-1/+82
Fix the issue of invalid suggestion for a reference of iterator Fixes #127590
2024-07-16Deny keyword lifetimes pre-expansionMichael Goulet-70/+99
2024-07-16Fix a bunch of sites that were walking instead of visiting, making it ↵Oli Scherer-3/+3
impossible for visitor impls to look at these values
2024-07-16Remove a boilerplaty abstractionOli Scherer-61/+17
2024-07-16Remove a needless borrowOli Scherer-7/+7
2024-07-16Just store a span instead of the whole itemOli Scherer-3/+3
2024-07-16Update method name to reflect changes to its internalsOli Scherer-3/+3
2024-07-16Delegation: support coercion for target expressionBryanskiy-37/+264
2024-07-16Remove an unnecessary implOli Scherer-6/+9
2024-07-16Fix the issue of invalid suggestion for a reference of iteratoryukang-9/+3
2024-07-16add test for issue 127590yukang-0/+87
2024-07-16Make `ErrorGuaranteed` discoverable outside types, consts, and lifetimesOli Scherer-26/+29
2024-07-16Auto merge of #127617 - lnicola:sync-from-ra, r=lnicolabors-4424/+7363
Subtree update of `rust-analyzer` r? `@ghost`
2024-07-16run-make-support: update gimli to 0.31.0Mrmaxmeier-2/+13
2024-07-16Auto merge of #127796 - tgross35:rollup-ubo5hzb, r=tgross35bors-274/+629
Rollup of 6 pull requests Successful merges: - #120990 (Suggest a borrow when using dbg) - #127047 (fix least significant digits of f128 associated constants) - #127709 (match lowering: Move `MatchPair` tree creation to its own module) - #127770 (Update books) - #127780 (Make sure trait def ids match before zipping args in `note_function_argument_obligation`) - #127795 (Fix typos in RELEASES.md) r? `@ghost` `@rustbot` modify labels: rollup
2024-07-16Use re-exported Idx and IndexVec in pat_analysisLaurențiu Nicola-3/+2
2024-07-16Rollup merge of #127795 - programmerjake:patch-3, r=cuviperTrevor Gross-4/+4
Fix typos in RELEASES.md as requested in https://github.com/rust-lang/blog.rust-lang.org/pull/1358#discussion_r1678691772 r? `@cuviper`
2024-07-16Rollup merge of #127780 - compiler-errors:zip-args, r=jieyouxuTrevor Gross-20/+98
Make sure trait def ids match before zipping args in `note_function_argument_obligation` Fixes #126416 Fixes #127745 Didn't add both tests b/c I felt like it was unnecessary.
2024-07-16Rollup merge of #127770 - rustbot:docs-update, r=ehussTrevor Gross-0/+0
Update books ## rust-lang/book 3 commits in f1e49bf7a8ea6c31ce016a52b8a4f6e1ffcfbc64..67fa536768013d9d5a13f3a06790521d511ef711 2024-07-12 21:21:45 UTC to 2024-07-05 17:35:06 UTC - Use Rust 2021 Edition for mdBook (rust-lang/book#3974) - Backport changes to chapter 11 (rust-lang/book#3969) - Upgrade to Rust 1.79.0 (rust-lang/book#3968) ## rust-lang/edition-guide 2 commits in 941db8b3df45fd46cd87b50a5c86714b91dcde9c..5454de3d12b9ccc6375b629cf7ccda8264640aac 2024-07-14 07:06:34 UTC to 2024-07-12 06:05:29 UTC - Update timeline etc. for Rust 2024 - 2024: Add note about never_type_fallback_flowing_into_unsafe lint level. (rust-lang/edition-guide#311) ## rust-embedded/book 1 commits in b10c6acaf0f43481f6600e95d4b5013446e29f7a..019f3928d8b939ec71b63722dcc2e46330156441 2024-07-11 17:46:10 UTC to 2024-07-11 17:46:10 UTC - typo on tooling.md (rust-embedded/book#373) ## rust-lang/reference 9 commits in 1ae3deebc3ac16e276b6558e01420f8e605def08..e2f0bdc4031866734661dcdb548184bde1450baf 2024-06-29 16:59:51 +0000 to 2024-07-15 17:52:44 +0000 - Suppress type length limit test and note that it is not enforced (rust-lang/reference#1527) - elaborate on slice wide pointer metadata (rust-lang/reference#1499) - '.inst' in inline-assembly changed to '.insn' (rust-lang/reference#1453) - Clarify that `asm!` blocks can be duplicated or deduplicated by the compiler (rust-lang/reference#1441) - Add mdbook-spec (rust-lang/reference#1520) - Add note about static libraries not linking their dependencies (rust-lang/reference#1472) - more explicitly explain the UB around immutable extern statics (rust-lang/reference#1502) - Improvements to `items/functions.md` (rust-lang/reference#1458) - Enable mdbook smart-punctuation. (rust-lang/reference#1516) ## rust-lang/rust-by-example 1 commits in 658c6c27cb975b92227936024816986c2d3716fb..89aecb6951b77bc746da73df8c9f2b2ceaad494a 2024-07-11 12:33:43 UTC to 2024-07-11 12:33:43 UTC - Update option_result.md (rust-lang/rust-by-example#1864) ## rust-lang/rustc-dev-guide 6 commits in d6e3a32a557db5902e714604def8015d6bb7e0f7..0c4d55cb59fe440d1a630e4e5774d043968edb3f 2024-07-15 15:16:43 UTC to 2024-07-01 19:05:14 UTC - Improve documentation of MIR queries & passes (rust-lang/rustc-dev-guide#1434) - Bump dependencies for date-check tool (rust-lang/rustc-dev-guide#2012) - Fix typo: lists -> lints (rust-lang/rustc-dev-guide#2011) - use "bootstrap" instead of "rustbuild" (rust-lang/rustc-dev-guide#2010) - Fix grammar issue in optimize-build.md (rust-lang/rustc-dev-guide#2009) - Update name of Fuchsia builder (rust-lang/rustc-dev-guide#2008)
2024-07-16Rollup merge of #127709 - Zalathar:pair-mod, r=NadrierilTrevor Gross-245/+272
match lowering: Move `MatchPair` tree creation to its own module This makes it easier to see that `MatchPair::new` has only one non-recursive caller, because the recursive callers are all in this module. No functional changes. --- I have used `git diff --color-moved` to verify that the moved code is identical to the old code, except for reduced visibility on the helper methods.
2024-07-16Rollup merge of #127047 - tspiteri:f128-aconsts-lsd, r=tgross35Trevor Gross-3/+3
fix least significant digits of f128 associated constants While the numbers are parsed to the correct value, the decimal numbers in the source were rounded to zero instead of to the nearest, making the literals different from the values shown in the documentation.
2024-07-16Rollup merge of #120990 - chenyukang:yukang-fix-120327-dbg, r=oli-obkTrevor Gross-2/+252
Suggest a borrow when using dbg Fixes #120327 r? ````@estebank````
2024-07-16Auto merge of #127680 - Kobzol:bootstrap-cmd-refactor-6, r=onur-ozkanbors-187/+147
Bootstrap command refactoring: port remaining commands with access to `Build` (step 6) Continuation of https://github.com/rust-lang/rust/pull/127450. This PR ports commands in bootstrap that can easily get access to `Build(er)` to `BootstrapCommand`. After this PR, everything that can access `Build(er)` should be using the new API. Statistics of `bootstrap` code (ignoring `src/bin/<shims>`) after this PR: ``` 7 usages of `Command::new` 69 usages of `command()` (new API) - out of that: 16 usages of `as_command_mut()` (new API, but accesses the inner command) ``` Tracking issue: https://github.com/rust-lang/rust/issues/126819 r? `@onur-ozkan`
2024-07-15Fix typos in RELEASES.mdJacob Lifshay-4/+4
as requested in https://github.com/rust-lang/blog.rust-lang.org/pull/1358#discussion_r1678691772
2024-07-16Fix unsafe_op_in_unsafe_fn in compilerMichael Goulet-308/+383
2024-07-16fmtMichael Goulet-42/+49
2024-07-16deny unsafe_op_in_unsafe_fn for teeos袁浩----天命剑主-0/+1
2024-07-16clean unsafe op in unsafe fn袁浩----天命剑主-13/+15