about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-12-11fix: stop emitting `.debug_pubnames` and `.debug_pubtypes`Weihang Lo-5/+44
`.debug_pubnames` and `.debug_pubtypes` are poorly designed and people seldom use them. However, they take a considerable portion of size in the final binary. This tells LLVM stop emitting those sections on DWARFv4 or lower. DWARFv5 use `.debug_names` which is more concise in size and performant for name lookup.
2023-12-11test: demonstrate that dwarf debug names sections are emittedWeihang Lo-0/+25
2023-12-11Rollup merge of #118835 - Urgau:fix-rccg-gcc-tests, r=matthiaskrgrMatthias Krüger-1/+1
Fix again `rustc_codegen_gcc` tests Similar to https://github.com/rust-lang/rust/pull/118706 r? `@GuillaumeGomez`
2023-12-11Rollup merge of #118827 - Nilstrieb:linker-plugin-lto, r=ehussMatthias Krüger-2/+6
Update table for linker-plugin-lto docs
2023-12-11Rollup merge of #118826 - Nilstrieb:no-email-pls, r=davidtwcoMatthias Krüger-1/+1
Edit target doc template to remove email We don't really want to communicate with target maintainers via email. GitHub is where everything happens, people should have a GitHub account that can be pinged on issues. This doesn't necessarily have to be a strict rule, but edit the template to suggest this. The previous template made it look like we care about having an email address, which we do not. r? ````@davidtwco````
2023-12-11Rollup merge of #118822 - Nadrieril:librarify, r=compiler-errorsMatthias Krüger-2460/+2614
Extract exhaustiveness into its own crate It now makes sense to extract exhaustiveness into its own crate! This was much-requested by rust-analyzer (they currently maintain by hand a copy of the algorithm), and I hope this can serve other projects e.g. clippy. This is the churny PR: it exclusively moves code around. It's not yet useable outside of rustc but I wanted the churny parts to be out of the way. r? `@compiler-errors`
2023-12-11Rollup merge of #118818 - krasimirgg:llvm-18-pass, r=nikicMatthias Krüger-0/+4
llvm-wrapper: adapt for LLVM API change LLVM commit https://github.com/llvm/llvm-project/commit/1d608fc755a3e15d0020f61c9535c9b730ab9dec renamed the pass. r? ````@nikic````
2023-12-11Rollup merge of #118726 - dtolnay:matchguardlet, r=compiler-errorsMatthias Krüger-77/+174
Do not parenthesize exterior struct lit inside match guards Before this PR, the AST pretty-printer injects parentheses around expressions any time parens _could_ be needed depending on what else is in the code that surrounds that expression. But the pretty-printer did not pass around enough context to understand whether parentheses really _are_ needed on any particular expression. As a consequence, there are false positives where unneeded parentheses are being inserted. Example: ```rust #![feature(if_let_guard)] macro_rules! pp { ($e:expr) => { stringify!($e) }; } fn main() { println!("{}", pp!(match () { () if let _ = Struct {} => {} })); } ``` **Before:** ```console match () { () if let _ = (Struct {}) => {} } ``` **After:** ```console match () { () if let _ = Struct {} => {} } ``` This PR introduces a bit of state that is passed across various expression printing methods to help understand accurately whether particular situations require parentheses injected by the pretty printer, and it fixes one such false positive involving match guards as shown above. There are other parenthesization false positive cases not fixed by this PR. I intend to address these in follow-up PRs. For example here is one: the expression `{ let _ = match x {} + 1; }` is pretty-printed as `{ let _ = (match x {}) + 1; }` despite there being no reason for parentheses to appear there.
2023-12-11Rollup merge of #118647 - onur-ozkan:bootstrap-shims-dump, r=clubby789Matthias Krüger-26/+158
dump bootstrap shims When making changes to the bootstrap that shouldn't change its behavior, this feature will help developers perform comparisons to check whether the bootstrap behavior has changed or not. As an example, when removing Python from the bootstrap by migrating to Rust, this feature will be super useful for ensuring that the behavior remains unaffected. It will assist me in performing comparisons to verify that the bootstrap behavior and its outputs remains consistent throughout the migration process. This can also be used for different purposes. For example, allowing CI to dump the shims and upload them so that developers can download them and compare with their local dump to see if CI affects the bootstrap unexpectedly. Or, make CI perform comparisons on specific bootstrap tests to check for behavior changes between the master and PR branches.
2023-12-11Rollup merge of #118620 - petrochenkov:defeed2, r=compiler-errorsMatthias Krüger-39/+31
resolve: Use `def_kind` query to cleanup some code Follow up to https://github.com/rust-lang/rust/pull/118188. Similar attempts to use queries in resolver resulted in perf regressions in the past, so this needs a perf run first.
2023-12-11Auto merge of #16094 - HKalbasi:rustc-tests-fixup, r=HKalbasibors-55/+57
Replace `doc_comments_and_attrs` with `collect_attrs`, 2nd round I didn't understand why the one in the semantics is different. Please tell me if it needs special action. r? `@Veykril`
2023-12-11Replace `doc_comments_and_attrs` with `collect_attrs`, 2nd roundhkalbasi-55/+57
2023-12-11Fix binder handling in `unnecessary_to_owned`Jason Newcomb-103/+150
2023-12-11Fix rustc codegen gcc testsUrgau-1/+1
2023-12-11Always render the path to be imported in the completion detailLukas Wirth-51/+31
2023-12-11Auto merge of #118344 - saethlin:rmeta-header-pos, r=WaffleLapkinbors-13/+18
Use a u64 for the rmeta root position Waffle noticed this in https://github.com/rust-lang/rust/pull/117301#discussion_r1405410174 We've upgraded the other file offsets to u64, and this one only costs 4 bytes per file. Also the way the truncation was being done before was extremely easy to miss, I sure missed it! It's not clear to me if not having this change effectively made the other upgrades from u32 to u64 ineffective, but we can have it now. r? `@WaffleLapkin`
2023-12-11Auto merge of #118344 - saethlin:rmeta-header-pos, r=WaffleLapkinbors-44/+46
Use a u64 for the rmeta root position Waffle noticed this in https://github.com/rust-lang/rust/pull/117301#discussion_r1405410174 We've upgraded the other file offsets to u64, and this one only costs 4 bytes per file. Also the way the truncation was being done before was extremely easy to miss, I sure missed it! It's not clear to me if not having this change effectively made the other upgrades from u32 to u64 ineffective, but we can have it now. r? `@WaffleLapkin`
2023-12-11Reinstate the names of the Ayu dark theme developers.Jonathan Pallant (Ferrous Systems)-1/+1
See https://github.com/rust-lang/rust/pull/71237 for more details.
2023-12-11Add tests for `--env` usage with `tracked_env::var`Guillaume Gomez-0/+45
2023-12-11Update rust-analyzer to support new `injected_env_var` functionGuillaume Gomez-0/+4
2023-12-11Add support for `--env` on `tracked_env::var`Guillaume Gomez-1/+7
2023-12-11Remove dead codesr0cky-17/+0
2023-12-11Auto merge of #3222 - RalfJung:waker-noop, r=RalfJungbors-63/+17
tests: use Waker::noop instead of defining our own Waker
2023-12-11use Waker::noop instead of defining our own WakerRalf Jung-63/+17
2023-12-11Auto merge of #117758 - Urgau:lint_pointer_trait_comparisons, r=davidtwcobors-1/+1
Add lint against ambiguous wide pointer comparisons This PR is the resolution of https://github.com/rust-lang/rust/issues/106447 decided in https://github.com/rust-lang/rust/issues/117717 by T-lang. ## `ambiguous_wide_pointer_comparisons` *warn-by-default* The `ambiguous_wide_pointer_comparisons` lint checks comparison of `*const/*mut ?Sized` as the operands. ### Example ```rust let ab = (A, B); let a = &ab.0 as *const dyn T; let b = &ab.1 as *const dyn T; let _ = a == b; ``` ### Explanation The comparison includes metadata which may not be expected. ------- This PR also drops `clippy::vtable_address_comparisons` which is superseded by this one. ~~One thing: is the current naming right? `invalid` seems a bit too much.~~ Fixes https://github.com/rust-lang/rust/issues/117717
2023-12-11Auto merge of #117758 - Urgau:lint_pointer_trait_comparisons, r=davidtwcobors-244/+70
Add lint against ambiguous wide pointer comparisons This PR is the resolution of https://github.com/rust-lang/rust/issues/106447 decided in https://github.com/rust-lang/rust/issues/117717 by T-lang. ## `ambiguous_wide_pointer_comparisons` *warn-by-default* The `ambiguous_wide_pointer_comparisons` lint checks comparison of `*const/*mut ?Sized` as the operands. ### Example ```rust let ab = (A, B); let a = &ab.0 as *const dyn T; let b = &ab.1 as *const dyn T; let _ = a == b; ``` ### Explanation The comparison includes metadata which may not be expected. ------- This PR also drops `clippy::vtable_address_comparisons` which is superseded by this one. ~~One thing: is the current naming right? `invalid` seems a bit too much.~~ Fixes https://github.com/rust-lang/rust/issues/117717
2023-12-11Auto merge of #117758 - Urgau:lint_pointer_trait_comparisons, r=davidtwcobors-254/+933
Add lint against ambiguous wide pointer comparisons This PR is the resolution of https://github.com/rust-lang/rust/issues/106447 decided in https://github.com/rust-lang/rust/issues/117717 by T-lang. ## `ambiguous_wide_pointer_comparisons` *warn-by-default* The `ambiguous_wide_pointer_comparisons` lint checks comparison of `*const/*mut ?Sized` as the operands. ### Example ```rust let ab = (A, B); let a = &ab.0 as *const dyn T; let b = &ab.1 as *const dyn T; let _ = a == b; ``` ### Explanation The comparison includes metadata which may not be expected. ------- This PR also drops `clippy::vtable_address_comparisons` which is superseded by this one. ~~One thing: is the current naming right? `invalid` seems a bit too much.~~ Fixes https://github.com/rust-lang/rust/issues/117717
2023-12-11Update table for linker-plugin-lto docsNilstrieb-2/+6
2023-12-11Edit target doc template to remove emailNilstrieb-1/+1
We don't really want to communicate with target maintainers via email. GitHub is where everything happens, people should have a GitHub account that can be pinged on issues. This doesn't necessarily have to be a strict rule, but edit the template to suggest this. The previous template made it look like we care about having an email address, which we do not.
2023-12-11Auto merge of #16089 - SomeoneToIgnore:fix-parameter-inlay-hints-resolution, ↵bors-20/+38
r=Veykril Query for nearest parent block around the hint to resolve This way, parameter hints will be found for resolution and https://github.com/rust-lang/rust-analyzer/pull/15522#issuecomment-1835896335 will be fixed Hopefully that also helps with whatever else (lifetimes', etc.) hints in https://github.com/rust-lang/rust-analyzer/issues/13962 > hints are resolved by querying for textDocument/inlayHint with hint's position turned into a [position-1, position+1] range (instead of the original, much wider document range). > > This might lead to issues in the future, with e.g. lifetime hints (currently there's nothing to resolve for them and it's fine) that belong to a certain position, but need to have textDocument/inlayHint query for much bigger range than their position+/-1
2023-12-11Search for parent blocks and items when resolving inlay hintsKirill Bulatov-9/+17
2023-12-11Query for nearest parent block around the hint to resolveKirill Bulatov-20/+30
This way, parameter hints will be found for resolution
2023-12-11Auto merge of #118823 - GuillaumeGomez:rollup-6v51gxv, r=GuillaumeGomezbors-667/+588
Rollup of 3 pull requests Successful merges: - #118802 (Remove edition umbrella features.) - #118807 (Remove an allocation in min_stack) - #118812 (rustdoc-search: do not treat associated type names as types) r? `@ghost` `@rustbot` modify labels: rollup
2023-12-11Fix doc linksNadrieril-22/+22
2023-12-11sort dump files at the end of bootstraponur-ozkan-2/+29
To ensure deterministic results we must sort the dump lines. This is necessary because the order of rustc invocations different almost all the time. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-12-11update auto completionsonur-ozkan-17/+62
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-12-11Dump command invocations from bootstrap shimsonur-ozkan-9/+69
When making changes to the bootstrap that shouldn't change its behavior, this feature will help developers perform comparisons to check whether the bootstrap behavior has changed or not. This can also be used for different purposes. For example, allowing CI to dump the shims and upload them so that developers can download them and compare with their local dump to see if CI affects the bootstrap unexpectedly. Or, make CI perform comparisons on specific bootstrap tests to check for behavior changes between the master and PR branches. Signed-off-by: onur-ozkan <work@onurozkan.dev>
2023-12-11Rollup merge of #118812 - notriddle:notriddle/assoc-name-intern, ↵Guillaume Gomez-14/+116
r=GuillaumeGomez rustdoc-search: do not treat associated type names as types [Before](http://notriddle.com/rustdoc-html-demo-6/tor-before/tor_config/list_builder/trait.DirectDefaultEmptyListBuilderAccessors.html?search=DirectDefaultEmptyListBuilderAccessors%3CT%3DT%3E%20-%3E%20Vec%3CT%3E#associatedtype.T) [After](http://notriddle.com/rustdoc-html-demo-6/tor-after/tor_config/list_builder/trait.DirectDefaultEmptyListBuilderAccessors.html?search=DirectDefaultEmptyListBuilderAccessors%3CT%3DT%3E%20-%3E%20Vec%3CT%3E#associatedtype.T) [Profile](http://notriddle.com/rustdoc-html-demo-6/tor-profile/index.html) As a bit of background information: in type-based queries, a type name that does not exist gets treated as a generic type variable. This causes a counterintuitive behavior in the `tor_config` crate, which has a trait with an associated type variable called `T`. This isn't a searchable concrete type, but its name still gets stored in the typeNameIdMap, as a convenient way to intern its name. (The second commit is a mostly unrelated bugfix.)
2023-12-11Rollup merge of #118807 - SUPERCILEX:allo, r=the8472Guillaume Gomez-1/+1
Remove an allocation in min_stack
2023-12-11Rollup merge of #118802 - ehuss:remove-edition-preview, r=TaKO8KiGuillaume Gomez-652/+471
Remove edition umbrella features. In the 2018 edition, there was an "umbrella" feature `#[feature(rust_2018_preview)]` which was used to enable several other features at once. This umbrella mechanism was not used in the 2021 edition and likely will not be used in 2024 either. During 2018 users reported that setting the feature was awkward, especially since they already needed to opt-in via the edition mechanism. This PR removes this mechanism because I believe it will not be used (and will clean up and simplify the code). I believe that there are better ways to handle features and editions. In short: - For highly experimental features, that may or may not be involved in an edition, they can implement regular feature gates like `tcx.features().my_feature`. - For experimental features that *might* be involved in an edition, they should implement gates with `tcx.features().my_feature && span.at_least_rust_20xx()`. This requires the user to still specify `#![feature(my_feature)]`, to avoid disrupting testing of other edition features which are ready and have been accepted within the edition. - For experimental features that have graduated to definitely be part of an edition, they should implement gates with `tcx.features().my_feature || span.at_least_rust_20xx()`, or just remove the feature check altogether and just check `span.at_least_rust_20xx()`. - For relatively simple changes, they can skip the whole feature gating thing and just check `span.at_least_rust_20xx()`, and rely on the instability of the edition itself (which requires `-Zunstable-options`) to gate it. I am working on documenting all of this in the rustc-dev-guide.
2023-12-11Auto merge of #118661 - fee1-dead-contrib:restore-const-partialEq, ↵bors-194/+149
r=compiler-errors Restore `const PartialEq` And thus fixes a number of tests. There is a bug that still needs to be fixed, so WIP for now. r? `@compiler-errors`
2023-12-11Auto merge of #118661 - fee1-dead-contrib:restore-const-partialEq, ↵bors-14/+31
r=compiler-errors Restore `const PartialEq` And thus fixes a number of tests. There is a bug that still needs to be fixed, so WIP for now. r? `@compiler-errors`
2023-12-11Include the new crate in triagebot pingsNadrieril-0/+4
2023-12-11Fix item visibilitiesNadrieril-31/+27
2023-12-11Make `MaybeInfiniteInt` rustc-independentNadrieril-34/+59
2023-12-11Move lints to their own moduleNadrieril-302/+347
2023-12-11Gather rustc-specific functions around `MatchCheckCtxt`Nadrieril-900/+903
2023-12-11Extract exhaustiveness into its own crateNadrieril-900/+981
2023-12-11Fix typo in cfgLaurențiu Nicola-1/+1
2023-12-11Fix typo in cfgLaurențiu Nicola-1/+1