about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-12-13Auto merge of #118213 - Urgau:check-cfg-diagnostics-rustc-cargo, r=petrochenkovbors-326/+468
Add more suggestions to unexpected cfg names and values This pull request adds more suggestion to unexpected cfg names and values diagnostics: - it first adds a links to the [rustc unstable book](https://doc.rust-lang.org/nightly/unstable-book/compiler-flags/check-cfg.html) or the [Cargo reference](https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg), depending if rustc is invoked by Cargo - it secondly adds a suggestion on how to expect the cfg name or value: *excluding well known names and values* - for Cargo: it suggest using a feature or `cargo:rust-check-cfg` in build script - for rustc: it suggest using `--check-cfg` (with the correct invocation) Those diagnostics improvements are directed towards enabling users to fix the issue if the previous suggestions weren't good enough. r? `@petrochenkov`
2023-12-13Auto merge of #118919 - matthiaskrgr:rollup-02udckl, r=matthiaskrgrbors-49/+121
Rollup of 4 pull requests Successful merges: - #118759 (Support bare unit structs in destructuring assignments) - #118871 (Coroutine variant fields can be uninitialized) - #118883 (Change a typo mistake in the-doc-attribute.md) - #118906 (Fix LLD thread flags in bootstrap on Windows) r? `@ghost` `@rustbot` modify labels: rollup
2023-12-13Rollup merge of #118906 - Kobzol:bootstrap-is-windows, r=petrochenkovMatthias Krüger-20/+20
Fix LLD thread flags in bootstrap on Windows Fixes [this comment](https://github.com/rust-lang/rust/pull/116278#discussion_r1424627056). r? `@petrochenkov`
2023-12-13Rollup merge of #118883 - HosseinAssaran:patch-1, r=fmeaseMatthias Krüger-1/+1
Change a typo mistake in the-doc-attribute.md I guess that `Bar` in the section I changed should be `bar` because when I run the program it has its page under struct but bar doesn't have any page.
2023-12-13Rollup merge of #118871 - tmiasko:coroutine-maybe-uninit-fields, ↵Matthias Krüger-4/+58
r=compiler-errors Coroutine variant fields can be uninitialized Wrap coroutine variant fields in MaybeUninit to indicate that they might be uninitialized. Otherwise an uninhabited field will make the entire variant uninhabited and introduce undefined behaviour. The analogous issue in the prefix of coroutine layout was addressed by 6fae7f807146e400fa2bbd1c44768d9bcaa57c4c.
2023-12-13Rollup merge of #118759 - compiler-errors:bare-unit-structs, r=petrochenkovMatthias Krüger-24/+42
Support bare unit structs in destructuring assignments We should be allowed to use destructuring assignments on *bare* unit structs, not just unit structs that are located within other pattern constructors. Fixes #118753 r? petrochenkov since you reviewed #95380, reassign if you're busy or don't want to review this.
2023-12-13Remove dangling check-cfg ui tests filesUrgau-249/+0
2023-12-13Add more suggestion to unexpected cfg names and valuesUrgau-77/+468
2023-12-13Auto merge of #118894 - dtolnay:bootstrapwrite, r=onur-ozkanbors-1/+0
Unbreak non-unix non-windows bootstrap Fixes #118862. #118647 added a new use of std::io::Write that is not conditional on any cfg. https://github.com/rust-lang/rust/blob/028b6d152e904bbc02dc3cd67e4cbdffcbd039e1/src/bootstrap/src/bin/main.rs#L134 ```console error[E0599]: no method named `write_all` found for struct `File` in the current scope --> src/bin/main.rs:134:21 | 134 | t!(file.write_all(lines.join("\n").as_bytes())); | ^^^^^^^^^ method not found in `File` | = help: items from traits can only be used if the trait is in scope help: the following trait is implemented but not in scope; perhaps add a `use` for it: | 8 + use std::io::Write; | ```
2023-12-13Auto merge of #118870 - Enselic:rustc_passes-query-stability, r=compiler-errorsbors-1/+10
rustc_passes: Enforce `rustc::potential_query_instability` lint Stop allowing `rustc::potential_query_instability` in all of `rustc_passes` and instead allow it on a case-by-case basis if it is safe. In this case, all instances of the lint are safe to allow. Part of https://github.com/rust-lang/rust/issues/84447 which is E-help-wanted.
2023-12-13Auto merge of #118500 - ZetaNumbers:tcx_hir_refactor, r=petrochenkovbors-393/+390
Move some methods from `tcx.hir()` to `tcx` https://github.com/rust-lang/rust/pull/118256#issuecomment-1826442834 Renamed: - find -> opt_hir_node - get -> hir_node - find_by_def_id -> opt_hir_node_by_def_id - get_by_def_id -> hir_node_by_def_id
2023-12-13Auto merge of #118534 - RalfJung:extern-type-size-of-val, r=WaffleLapkinbors-162/+211
codegen: panic when trying to compute size/align of extern type The alignment is also computed when accessing a field of extern type at non-zero offset, so we also panic in that case. Previously `size_of_val` worked because the code path there assumed that "thin pointer" means "sized". But that's not true any more with extern types. The returned size and align are just blatantly wrong, so it seems better to panic than returning wrong results. We use a non-unwinding panic since code probably does not expect size_of_val to panic.
2023-12-13Fix LLD thread flag selection for Windows targetsJakub Beránek-1/+1
2023-12-13Add `TargetSelection::is_windows` methodJakub Beránek-19/+19
2023-12-13Auto merge of #117050 - c410-f3r:here-we-go-again, r=petrochenkovbors-242/+676
[`RFC 3086`] Attempt to try to resolve blocking concerns Implements what is described at https://github.com/rust-lang/rust/issues/83527#issuecomment-1744822345 to hopefully make some progress. It is unknown if such approach is or isn't desired due to the lack of further feedback, as such, it is probably best to nominate this PR to the official entities. `@rustbot` labels +I-compiler-nominated
2023-12-13Auto merge of #118900 - workingjubilee:rollup-wkv9hq1, r=workingjubileebors-171/+307
Rollup of 10 pull requests Successful merges: - #118858 (Remove dead codes in core) - #118864 (Fix alignment passed down to LLVM for simd_masked_load) - #118872 (Add rustX check to codeblock attributes lint) - #118873 (fix `waker_getters` tracking issue number) - #118884 (NFC: simplify merging of two vecs) - #118885 (clippy::complexity fixes) - #118886 (Clean up variables in `search.js`) - #118887 (Typo) - #118889 (more clippy::complexity fixes) - #118891 (Actually parse async gen blocks correctly) r? `@ghost` `@rustbot` modify labels: rollup
2023-12-12Rollup merge of #118891 - compiler-errors:async-gen-blocks, r=eholkJubilee-15/+87
Actually parse async gen blocks correctly 1. I got the control flow in `parse_expr_bottom` messed up, and obviously forgot a test for `async gen`, so we weren't actually ever parsing it correctly. 2. I forgot to gate the span for `async gen {}`, so even if we did parse it, we wouldn't have correctly denied it in `cfg(FALSE)`. r? eholk
2023-12-12Rollup merge of #118889 - matthiaskrgr:compl_2023_2, r=WaffleLapkinJubilee-28/+18
more clippy::complexity fixes redundant_guards redundant_slicing filter_next needless_borrowed_reference useless_format
2023-12-12Rollup merge of #118887 - smoelius:patch-1, r=NilstriebJubilee-1/+1
Typo
2023-12-12Rollup merge of #118886 - GuillaumeGomez:clean-up-search-vars, r=notriddleJubilee-13/+7
Clean up variables in `search.js` While reviewing https://github.com/rust-lang/rust/pull/118402, I saw a few small clean ups that were needed, mostly about variables creation. r? ```@notriddle```
2023-12-12Rollup merge of #118885 - matthiaskrgr:compl_2023, r=compiler-errorsJubilee-33/+14
clippy::complexity fixes filter_map_identity needless_bool search_is_some unit_arg map_identity needless_question_mark derivable_impls
2023-12-12Rollup merge of #118884 - matthiaskrgr:auszweimacheins, r=NadrierilJubilee-2/+3
NFC: simplify merging of two vecs
2023-12-12Rollup merge of #118873 - lukas-code:fix_waker_getter_tracking_issue_number, ↵Jubilee-3/+3
r=workingjubilee fix `waker_getters` tracking issue number The feature currently links to the closed issue https://github.com/rust-lang/rust/issues/87021. Make it link to the tracking issue https://github.com/rust-lang/rust/issues/96992 instead.
2023-12-12Rollup merge of #118872 - GuillaumeGomez:codeblock-attr-lint, r=notriddleJubilee-70/+168
Add rustX check to codeblock attributes lint We discovered this issue [here](https://github.com/rust-lang/rust/pull/118802#discussion_r1421815943). I assume that the issue will be present in other places outside of the compiler so it's worth adding a check for it. First commit is just a small cleanup about variables creation which was a bit strange (at least more than necessary). r? ```@notriddle```
2023-12-12Rollup merge of #118864 - farnoy:masked-load-store-fixes, r=workingjubileeJubilee-3/+3
Fix alignment passed down to LLVM for simd_masked_load Follow up to #117953 The alignment for a masked load operation should be that of the element/lane, not the vector as a whole It can produce miscompilations after the LLVM optimizer notices the higher alignment and promotes this to an unmasked, aligned load followed up by blend/select - https://rust.godbolt.org/z/KEeGbevbb
2023-12-12Rollup merge of #118858 - mu001999:dead_code/clean, r=cuviperJubilee-3/+3
Remove dead codes in core Detected by #118257
2023-12-13Auto merge of #116438 - ChrisDenton:truncate, r=thomccbors-7/+53
Windows: Allow `File::create` to work on hidden files This makes `OpenOptions::new().write(true).create(true).truncate(true).open(&path)` work if the path exists and is a hidden file. Previously it would fail with access denied. This makes it consistent with `OpenOptions::new().write(true).truncate(true).open(&path)` (note the lack of `create`) which does not have this restriction. It's also more consistent with other platforms. Fixes #115745 (see that issue for more details).
2023-12-12Unbreak non-unix non-windows bootstrapDavid Tolnay-1/+0
2023-12-12Auto merge of #118765 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 20 commits in 9787229614b27854cf73d57ffae430d7c1e6caa4..1aa9df1a5be205cce621f0bc0ea6062a5e22a98c 2023-12-06 02:29:23 +0000 to 2023-12-12 14:52:31 +0000 - crates-io: Add support for other 2xx HTTP status codes (rust-lang/cargo#13158) - Remove the deleted feature test_2018_feature from the test (rust-lang/cargo#13156) - refactor(schema): Remove reliance on cargo types (rust-lang/cargo#13154) - fix(toml)!: Disallow `[lints]` in virtual workspaces (rust-lang/cargo#13155) - Limit exported-private-dependencies lints to libraries (rust-lang/cargo#13135) - chore: update to gix-index@0.27.1 (rust-lang/cargo#13148) - Update curl-sys to bring in curl 8.5.0 (rust-lang/cargo#13147) - chore: downgrade to openssl v1.1.1 (rust-lang/cargo#13144) - fix: explicitly remap current dir by using `.` (rust-lang/cargo#13114) - Don't rely on mtime to test changes (rust-lang/cargo#13143) - refactor: Pull PackageIdSpec into schema (rust-lang/cargo#13128) - fix: Print rustc messages colored on wincon (rust-lang/cargo#13140) - Add a windows manifest file (rust-lang/cargo#13131) - Avoid writing CACHEDIR.TAG if it already exists (rust-lang/cargo#13132) - re-enable flaky tests thanks to update to `gix-config`. (rust-lang/cargo#11821) (rust-lang/cargo#13130) - fix bash completion in directory with spaces (rust-lang/cargo#13126) - test: re-ignore git auth tests for gitoxide (rust-lang/cargo#13129) - fix(toml): Disallow inheriting of dependency public status (rust-lang/cargo#13125) - re-enable previously disabled tests with Windows-specific fix (rust-lang/cargo#13117) - refactor: Clarify PackageId constructor names (rust-lang/cargo#13123)
2023-12-12Actually parse async gen blocks correctlyMichael Goulet-15/+87
2023-12-12Update compiler/rustc_pattern_analysis/src/constructor.rs Matthias Krüger-0/+1
add note that `missing_empty` is cleared now Co-authored-by: Nadrieril <Nadrieril@users.noreply.github.com>
2023-12-12more clippy::complexity fixesMatthias Krüger-28/+18
redundant_guards redundant_slicing filter_next needless_borrowed_reference useless_format
2023-12-12TypoSamuel Moelius-1/+1
2023-12-12Add a test for a codeblock with multiple invalid attributesGuillaume Gomez-1/+39
2023-12-12Clean up variables in `search.js`Guillaume Gomez-13/+7
2023-12-12clippy::complexity fixesMatthias Krüger-33/+14
filter_map_identity needless_bool search_is_some unit_arg map_identity needless_question_mark derivable_impls
2023-12-12Auto merge of #118881 - matthiaskrgr:rollup-0rl3tir, r=matthiaskrgrbors-168/+939
Rollup of 9 pull requests Successful merges: - #116740 (dont ICE when ConstKind::Expr for is_const_evaluatable) - #117914 (On borrow return type, suggest borrowing from arg or owned return type) - #117927 (Clarify how to choose a FutureIncompatibilityReason variant.) - #118855 (Improve an error involving attribute values.) - #118856 (rustdoc-search: clean up parser) - #118865 (rustc_codegen_llvm: Enforce `rustc::potential_query_instability` lint) - #118866 (llvm-wrapper: adapt for LLVM API change) - #118868 (Correctly gate the parsing of match arms without body) - #118877 (tests: CGU tests require build-pass, not check-pass (remove FIXME)) r? `@ghost` `@rustbot` modify labels: rollup
2023-12-12simplify merging of two vecsMatthias Krüger-2/+2
2023-12-12Change a typo mistake in the-doc-attribute.md Hosssein-1/+1
I guess that `Bar` in the section I changed should be `bar` because when I run the program it has its page under struct but bar doesn't have any page.
2023-12-12Rollup merge of #118877 - Enselic:remove-cgu-fixme, r=NilstriebMatthias Krüger-3/+3
tests: CGU tests require build-pass, not check-pass (remove FIXME) CGU tests require CGU code to be exercised. We can't merely do "cargo check" on these tests. Part of #62277
2023-12-12Rollup merge of #118868 - Nadrieril:correctly-gate-never_patterns-parsing, ↵Matthias Krüger-26/+207
r=petrochenkov Correctly gate the parsing of match arms without body https://github.com/rust-lang/rust/pull/118527 accidentally allowed the following to parse on stable: ```rust match Some(0) { None => { foo(); } #[cfg(FALSE)] Some(_) } ``` This fixes that oversight. The way I choose which error to emit is the best I could think of, I'm open if you know a better way. r? `@petrochenkov` since you're the one who noticed
2023-12-12Rollup merge of #118866 - krasimirgg:llvm-18-ref, r=durin42Matthias Krüger-1/+3
llvm-wrapper: adapt for LLVM API change LLVM commit https://github.com/llvm/llvm-project/commit/f09cf34d00625e57dea5317a3ac0412c07292148 (old) moved some functions to a different header. It looks we were getting it transitively in PassWrapper, and something in LLVM recently removed it from the set of transitively available headers, so include it directly: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/24416#018c5de6-b9c9-4b22-9473-6070d99dcfa7/233-537 r? `@nikic`
2023-12-12Rollup merge of #118865 - Enselic:rustc_codegen_llvm-lint-fix, r=petrochenkovMatthias Krüger-1/+8
rustc_codegen_llvm: Enforce `rustc::potential_query_instability` lint Stop allowing `rustc::potential_query_instability` on all of `rustc_codegen_llvm` and instead allow it on a case-by-case basis if it is safe to do so. In this case, all 2 instances are safe to allow. Part of https://github.com/rust-lang/rust/issues/84447 which is E-help-wanted.
2023-12-12Rollup merge of #118856 - notriddle:notriddle/search-js, r=GuillaumeGomezMatthias Krüger-7/+2
rustdoc-search: clean up parser The `c === "="` was redundant when `isSeparatorCharacter` already checks that. The function `isStopCharacter` and `isEndCharacter` functions did exactly the same thing and have synonymous names. There doesn't seem much point in having both.
2023-12-12Rollup merge of #118855 - nnethercote:improve-attribute-value-error, ↵Matthias Krüger-62/+87
r=compiler-errors,petrochenkov Improve an error involving attribute values. Attribute values must be literals. The error you get when that doesn't hold is pretty bad, e.g.: ``` unexpected expression: 1 + 1 ``` You also get the same error if the attribute value is a literal, but an invalid literal, e.g.: ``` unexpected expression: "foo"suffix ``` This commit does two things. - Changes the error message to "attribute value must be a literal", which gives a better idea of what the problem is and how to fix it. It also no longer prints the invalid expression, because the carets below highlight it anyway. - Separates the "not a literal" case from the "invalid literal" case. Which means invalid literals now get the specific error at the literal level, rather than at the attribute level. r? `@compiler-errors`
2023-12-12Rollup merge of #117927 - ehuss:future-incompat-docs, r=wesleywiserMatthias Krüger-0/+67
Clarify how to choose a FutureIncompatibilityReason variant. There has been some confusion about how to choose these variants, or what the procedure is for handling future-incompatible errors. Hopefully this helps provide some more information on how these work.
2023-12-12Rollup merge of #117914 - estebank:issue-85843, r=wesleywiserMatthias Krüger-55/+450
On borrow return type, suggest borrowing from arg or owned return type When we encounter a function with a return type that has an anonymous lifetime with no argument to borrow from, besides suggesting the `'static` lifetime we now also suggest changing the arguments to be borrows or changing the return type to be an owned type. ``` error[E0106]: missing lifetime specifier --> $DIR/variadic-ffi-6.rs:7:6 | LL | ) -> &usize { | ^ expected named lifetime parameter | = help: this function's return type contains a borrowed value, but there is no value for it to be borrowed from help: consider using the `'static` lifetime, but this is uncommon unless you're returning a borrowed value from a `const` or a `static` | LL | ) -> &'static usize { | +++++++ help: instead, you are more likely to want to change one of the arguments to be borrowed... | LL | x: &usize, | + help: ...or alternatively, to want to return an owned value | LL - ) -> &usize { LL + ) -> usize { | ``` Fix #85843.
2023-12-12Rollup merge of #116740 - ↵Matthias Krüger-13/+112
lenko-d:const_evaluatable_failed_for_non_unevaluated_const, r=BoxyUwU dont ICE when ConstKind::Expr for is_const_evaluatable The problem is that we are not handling ConstKind::Expr inside report_not_const_evaluatable_error Fixes [#114151]
2023-12-12also add a Miri testRalf Jung-0/+43
2023-12-12also test projecting to some sized fields at non-zero offset in structs with ↵Ralf Jung-5/+16
an extern type tail