about summary refs log tree commit diff
path: root/src/tools
AgeCommit message (Collapse)AuthorLines
2024-12-09Rollup merge of #133996 - Zalathar:ui-link-native-libs, r=jieyouxuLeón Orell Valerian Liehr-6/+6
Move most tests for `-l` and `#[link(..)]` into `tests/ui/link-native-libs` Tests for the closely-related `-l` flag and `#[link(..)]` attribute are spread across a few different directories, and in some cases have ended up in a test directory intended for other linker-related functionality. This PR moves most of them into a single `tests/ui/link-native-libs` directory. --- Part of #133895. try-job: i686-mingw r? jieyouxu
2024-12-09Introduce `default_field_values` featureEsteban Küber-29/+44
Initial implementation of `#[feature(default_field_values]`, proposed in https://github.com/rust-lang/rfcs/pull/3681. Support default fields in enum struct variant Allow default values in an enum struct variant definition: ```rust pub enum Bar { Foo { bar: S = S, baz: i32 = 42 + 3, } } ``` Allow using `..` without a base on an enum struct variant ```rust Bar::Foo { .. } ``` `#[derive(Default)]` doesn't account for these as it is still gating `#[default]` only being allowed on unit variants. Support `#[derive(Default)]` on enum struct variants with all defaulted fields ```rust pub enum Bar { #[default] Foo { bar: S = S, baz: i32 = 42 + 3, } } ``` Check for missing fields in typeck instead of mir_build. Expand test with `const` param case (needs `generic_const_exprs` enabled). Properly instantiate MIR const The following works: ```rust struct S<A> { a: Vec<A> = Vec::new(), } S::<i32> { .. } ``` Add lint for default fields that will always fail const-eval We *allow* this to happen for API writers that might want to rely on users' getting a compile error when using the default field, different to the error that they would get when the field isn't default. We could change this to *always* error instead of being a lint, if we wanted. This will *not* catch errors for partially evaluated consts, like when the expression relies on a const parameter. Suggestions when encountering `Foo { .. }` without `#[feature(default_field_values)]`: - Suggest adding a base expression if there are missing fields. - Suggest enabling the feature if all the missing fields have optional values. - Suggest removing `..` if there are no missing fields.
2024-12-09jsondocck: Parse, don't validate commands.Alona Enraght-Moony-262/+169
2024-12-10crates/r-a: Fix typo in debug messageYuki Sireneva-1/+1
2024-12-09Unite more bool hashingKirill Bulatov-15/+16
2024-12-09Stop excluding Helix from the general resolve pathKirill Bulatov-2/+2
2024-12-09Always compute the hash when r-a wants the imports to be resolvedKirill Bulatov-17/+6
2024-12-09Draft completion hashingKirill Bulatov-24/+142
2024-12-10minor: enhance name suggestion for `Arc<T>` and `Rc<T>`roife-1/+27
2024-12-09Merge pull request #18647 from Veykril/push-nsrrmmnzzoymLukas Wirth-3/+3
internal: Disable pipe on typing handler
2024-12-09Disable pipe on typing handlerLukas Wirth-3/+3
2024-12-09fix ICE on type error in promotedRalf Jung-2/+5
2024-12-09interpret: clean up deduplicating allocation functionsRalf Jung-104/+3
2024-12-09Merge pull request #18645 from Veykril/push-yruoyrvrsntwLukas Wirth-12/+21
fix: Non-exhaustive structs may be empty
2024-12-09fix: Non-exhaustive structs may be emptyLukas Wirth-12/+21
2024-12-09Enable `[bot-pull-requests]` triagebot featureJakub Beránek-0/+3
2024-12-09compiletest: `print{,ln}!` -> `eprint{,ln}!`clubby789-57/+57
Co-authored-by: Jieyou Xu <jieyouxu@outlook.com>
2024-12-09Merge pull request #18644 from Veykril/push-nolvpzqvoqwxLukas Wirth-53/+18
Remove patch sysroot cfg-if hack
2024-12-09Merge pull request #18643 from Veykril/push-muwuzmowptnnLukas Wirth-397/+407
internal: Rename test fixture crates to ra_test_fixture
2024-12-09Remove patch sysroot cfg-if hackLukas Wirth-53/+18
2024-12-09Rename test fixture crates to ra_test_fixtureLukas Wirth-397/+407
2024-12-09dist: Re-work how we describe the licence of Rust in our distributionsJonathan Pallant-14/+35
) add COPYRIGHT*.html files to the rustc binary distribution ) add contents of LICENSE folder to dist tarballs, because some of our in-tree licences will require that the license text is reproduced. ) The wording of COPYRIGHT is adjusted to not include license text (`reuse` ensures that it's in the LICENSE folder) ) A blanket copyright notice is added to LICENCE-MIT as required by the text. The general approach is that the license statements are now compiled using a tool in CI (generate-copyright), and you get either: * the source code (COPYRIGHT, LICENCE-APACHE, LICENCE-MIT, REUSE.toml and the LICENCES folder), or * the compiled version (COPYRIGHT.html, COPYRIGHT-library.html and the LICENCES folder).
2024-12-09Remove unstable attributes in minicoreLaurențiu Nicola-4/+0
2024-12-09Merge pull request #18441 from Veykril/lw-psyvmlotlvqnLukas Wirth-54/+107
internal: Do not cache the config directory path
2024-12-09Fix config guard lock for ratoml testsLukas Wirth-63/+59
2024-12-09Merge pull request #18635 from ChayimFriedman2/fix-testLukas Wirth-47/+49
minor: Fix a test that didn't test what it should
2024-12-09Merge from rustcRalf Jung-59/+172
2024-12-09Preparing for merge from rustcRalf Jung-1/+1
2024-12-09Auto merge of #134052 - matthiaskrgr:rollup-puxwqrk, r=matthiaskrgrbors-1184/+1791
Rollup of 7 pull requests Successful merges: - #133567 (A bunch of cleanups) - #133789 (Add doc alias 'then_with' for `then` method on `bool`) - #133880 (Expand home_dir docs) - #134036 (crash tests: use individual mir opts instead of mir-opt-level where easily possible) - #134045 (Fix some triagebot mentions paths) - #134046 (Remove ignored tests for hangs w/ new solver) - #134050 (Miri subtree update) r? `@ghost` `@rustbot` modify labels: rollup
2024-12-09Rollup merge of #134050 - RalfJung:miri-sync, r=RalfJungMatthias Krüger-1163/+1755
Miri subtree update r? `@ghost`
2024-12-09Rollup merge of #134046 - lqd:new-solver-hangs, r=compiler-errorsMatthias Krüger-5/+12
Remove ignored tests for hangs w/ new solver As asked on zulip [here](https://rust-lang.zulipchat.com/#narrow/channel/364551-t-types.2Ftrait-system-refactor/topic/needs_help.3A.20look.20through.20compare-mode.20hangs). As far as I can tell there are no more UI tests that hang anymore, so this removes the ignore directives for the compare mode. (As I was using `--compare-mode new-solver` and that failed in an obscure way without any info about what to do, I've also fixed its error handling in `compiletest`: it didn't show the invalid `--compare-mode`, nor the valid values one can pass). r? lcnr
2024-12-09Rollup merge of #133567 - bjorn3:various_cleanups, r=cjgillotMatthias Krüger-16/+24
A bunch of cleanups These are all extracted from a branch I have to get rid of driver queries. Most of the commits are not directly necessary for this, but were found in the process of implementing the removal of driver queries. Previous PR: https://github.com/rust-lang/rust/pull/132410
2024-12-08fix: Map new replacement nodes to their mutable equivalents in `SyntaxEditor`Giga Bowser-20/+22
2024-12-08improve `--compare-mode` error handlingRémy Rakic-5/+12
- show the erroneous value - show the valid values
2024-12-08Downgrade ccclubby789-2/+2
2024-12-08Rollup merge of #133733 - jyn514:compiletest-diffs, r=jieyouxuMatthias Krüger-35/+119
compiletest: show the difference between the normalized output and the actual output for lines which didn't match example output: ``` failures: ---- [ui] tests/ui/layout/enum.rs stdout ---- diff of stderr: - error: align: AbiAndPrefAlign { abi: Align(2 bytes), pref: $PREF_ALIGN } + error: align: AbiAndPrefAlign { abi: Align(2 bytes), pref: $PREF_ALIN } 2 --> $DIR/enum.rs:9:1 3 | 4 LL | enum UninhabitedVariantAlign { Note: some mismatched output was normalized before being compared - error: align: AbiAndPrefAlign { abi: Align(2 bytes), pref: Align(8 bytes) } - --> /home/jyn/src/rust2/tests/ui/layout/enum.rs:9:1 + error: align: AbiAndPrefAlign { abi: Align(2 bytes), pref: $PREF_ALIN } ```
2024-12-08Rollup merge of #133424 - Nadrieril:guard-patterns-parsing, r=fee1-deadMatthias Krüger-3/+17
Parse guard patterns This implements the parsing of [RFC3637 Guard Patterns](https://rust-lang.github.io/rfcs/3637-guard-patterns.html) (see also [tracking issue](https://github.com/rust-lang/rust/issues/129967)). This PR is extracted from https://github.com/rust-lang/rust/pull/129996 with minor modifications. cc `@max-niederman`
2024-12-08Fix a test that didn't test what it shouldChayim Refael Friedman-47/+49
That is, fix the helper function and disable the tests for now.
2024-12-08fix buildRalf Jung-2/+2
2024-12-08Merge pull request #18633 from ChayimFriedman2/unify-fnLukas Wirth-1/+21
fix: Coerce two `FnDef`s to fn pointers even if they are the same, if they are subtypes
2024-12-08Merge from rustcThe Miri Cronjob Bot-1/+1
2024-12-08Preparing for merge from rustcThe Miri Cronjob Bot-1/+1
2024-12-08Auto merge of #133988 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 6 commits in 05f54fdc34310f458033af8a63ce1d699fae8bf6..20a443231846b81c7b909691ec3f15eb173f2b18 2024-12-03 03:14:12 +0000 to 2024-12-06 21:56:56 +0000 - fix(fingerprint): Don't throwaway the cache on RUSTFLAGS changes (rust-lang/cargo#14830) - fix(build-rs)!: Remove meaningless 'cargo_cfg_debug_assertions' (rust-lang/cargo#14901) - docs(fingerprint): cargo-rustc extra flags do not affect the metadata (rust-lang/cargo#14898) - fix(add): Don't select yanked versions when normalizing names (rust-lang/cargo#14895) - fix(fix): Migrate workspace dependencies (rust-lang/cargo#14890) - test(build-std): make mock-std closer to real world (rust-lang/cargo#14896)
2024-12-07Make `Copy` unsafe to implement for ADTs with `unsafe` fieldsJack Wrenn-0/+1
As a rule, the application of `unsafe` to a declaration requires that use-sites of that declaration also require `unsafe`. For example, a field declared `unsafe` may only be read in the lexical context of an `unsafe` block. For nearly all safe traits, the safety obligations of fields are explicitly discharged when they are mentioned in method definitions. For example, idiomatically implementing `Clone` (a safe trait) for a type with unsafe fields will require `unsafe` to clone those fields. Prior to this commit, `Copy` violated this rule. The trait is marked safe, and although it has no explicit methods, its implementation permits reads of `Self`. This commit resolves this by making `Copy` conditionally safe to implement. It remains safe to implement for ADTs without unsafe fields, but unsafe to implement for ADTs with unsafe fields. Tracking: #132922
2024-12-07Coerce two `FnDef`s to fn pointers even if they are the same, if they are ↵Chayim Refael Friedman-1/+21
subtypes That's because they can be the same function but still different substs, which mandates them to coerce to fn pointers in order to unify.
2024-12-07add weak memory consistency test for mixing SC accesses and fencesRalf Jung-0/+30
2024-12-07Watch for user config ratomlAli Bektas-37/+94
2024-12-07Merge pull request #18575 from Giga-Bowser/flip-assistsLukas Wirth-87/+217
minor: Migrate `flip_*` assists to `SyntaxEditor`
2024-12-07Merge pull request #18630 from Veykril/push-ystzsxpywnxnLukas Wirth-19/+37
fix: Temporarily disable completion resolve support for helix and neovim
2024-12-07Auto merge of #133978 - matthiaskrgr:rollup-6gh1iho, r=matthiaskrgrbors-1/+1
Rollup of 7 pull requests Successful merges: - #130209 (Stabilize `std::io::ErrorKind::CrossesDevices`) - #130254 (Stabilize `std::io::ErrorKind::QuotaExceeded`) - #132187 (Add Extend impls for tuples of arity 1 through 12) - #133875 (handle `--json-output` properly) - #133934 (Do not implement unsafe auto traits for types with unsafe fields) - #133954 (Hide errors whose suggestions would contain error constants or types) - #133960 (rustdoc: remove eq for clean::Attributes) r? `@ghost` `@rustbot` modify labels: rollup