about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2023-12-12Add ASCII whitespace trimming functions to `&str`okaneco-0/+82
Add `trim_ascii_start`, `trim_ascii_end`, and `trim_ascii` functions to `&str` for trimming ASCII whitespace under the `byte_slice_trim_ascii` feature gate. Add `inline` to `[u8]` `trim_ascii` functions
2023-12-12Auto merge of #11829 - J-ZhengLi:issue11438, r=matthiaskrgrbors-1/+798
new lint to detect infinite loop closes: #11438 changelog: add new lint to detect infinite loop ~*I'll change the lint name*~. Should I name it `infinite_loop` or `infinite_loops` is fine? Ahhhh, English is hard...
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-12emit lints in `check_crate_post` for useless_vecEric-72/+164
this fixes issue #11861 by adding an extra map to keep track of which spans are ok to lint
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
2023-12-12test that both size_of_val and align_of_val panicRalf Jung-6/+16
2023-12-12Update cargoWeihang Lo-0/+0
2023-12-12Auto merge of #118751 - lcnr:writeback-change, r=compiler-errorsbors-119/+104
refactor writeback: emit normalization errors with new solver implements https://github.com/rust-lang/rust/pull/118725#discussion_r1419824030 r? `@compiler-errors` `@BoxyUwU` whoever comes first n stuff
2023-12-12Auto merge of #16104 - lnicola:bump-line-index, r=lnicolabors-5/+5
internal: Bump line-index Let's try out that sweet SIMD code path!
2023-12-12Bump line-indexLaurențiu Nicola-5/+5
2023-12-12Auto merge of #16102 - lnicola:publish-libs, r=lnicolabors-2/+2
Publish `line-index`
2023-12-12Publish line-indexLaurențiu Nicola-2/+2
2023-12-12Auto merge of #16101 - Veykril:search-depedencies-fix, r=Veykrilbors-35/+65
fix: Fix `import_map::search_dependencies` getting confused by assoc and non assoc items with the same name No test case as creating one is kind of tricky... Ideally the code should be restructured such that this collision wouldn't matter in the first place, its kind of a mess. Fixes https://github.com/rust-lang/rust-analyzer/issues/16074 Fixes https://github.com/rust-lang/rust-analyzer/issues/16080 Fixes https://github.com/rust-lang/rust-analyzer/issues/15845
2023-12-12tests: CGU tests require build-pass, not check-pass (remove FIXME)Martin Nordholts-3/+3
CGU tests require CGU code to be exercised. We can't merely do "cargo check" on these tests.
2023-12-12fix: Fix `import_map::search_dependencies` getting confused by assoc and non ↵Lukas Wirth-35/+65
assoc items with the same name
2023-12-12Follow guidelines for lint suggestionsGuillaume Gomez-36/+76
2023-12-12Add test for `rustX` codeblock attributeGuillaume Gomez-1/+20
2023-12-12Add `rustX` check to codeblock attributes lintGuillaume Gomez-0/+10
2023-12-12Move some methods from `tcx.hir()` to `tcx`zetanumbers-60/+59
Renamings: - 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 Fix rebase changes using removed methods Use `tcx.hir_node_by_def_id()` whenever possible in compiler Fix clippy errors Fix compiler Apply suggestions from code review Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> Add FIXME for `tcx.hir()` returned type about its removal Simplify with with `tcx.hir_node_by_def_id`
2023-12-12Move some methods from `tcx.hir()` to `tcx`zetanumbers-393/+390
Renamings: - 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 Fix rebase changes using removed methods Use `tcx.hir_node_by_def_id()` whenever possible in compiler Fix clippy errors Fix compiler Apply suggestions from code review Co-authored-by: Vadim Petrochenkov <vadim.petrochenkov@gmail.com> Add FIXME for `tcx.hir()` returned type about its removal Simplify with with `tcx.hir_node_by_def_id`
2023-12-12Auto merge of #16099 - Veykril:flyimport, r=Veykrilbors-191/+196
internal: Improve import asset perf a bit And bump the query limit from 40 to 100
2023-12-12Bump DEFAULT_QUERY_SEARCH_LIMIT from 40 to 100Lukas Wirth-24/+66
2023-12-12Auto merge of #11902 - GuillaumeGomez:write-and-append, r=llogiqbors-1/+199
Add `ineffective_open_options` lint Fixes https://github.com/rust-lang/rust-clippy/issues/9628. For `OpenOptions`, in case you call both `write(true)` and `append(true)` on `OpenOptions`, then `write(true)` is actually useless since `append(true)` does it. r? `@flip1995` changelog: Add `ineffective_open_options` lint
2023-12-12Update CHANGELOG to add `write_and_append` lintGuillaume Gomez-0/+1
2023-12-12Add ui test for `write_and_append` lintGuillaume Gomez-0/+99
2023-12-12Add `write_and_append` lintGuillaume Gomez-1/+99
2023-12-12Don't gate the feature twiceNadrieril-51/+31
2023-12-12Correctly gate the parsing of match arms without bodyNadrieril-26/+227
2023-12-12fix `waker_getters` tracking issue numberLukas Markeffsky-3/+3
2023-12-12rustc_passes: Enforce `rustc::potential_query_instability` lintMartin Nordholts-1/+10
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.
2023-12-12Fix rustc test suitebjorn3-0/+1
2023-12-12Rustup to rustc 1.76.0-nightly (06e02d5b2 2023-12-09)bjorn3-2/+2
2023-12-12Auto merge of #118841 - compiler-errors:always-copy, r=jackh726bors-60/+15
Make most `rustc_type_ir` kinds `Copy` by default 1. There's no reason why `TyKind` and `ConstKind`/`ConstData` can't be `Copy`. This allows us to avoid needing a typed arena for the two types. 2. Simplify some impls into derives.
2023-12-12llvm-wrapper: adapt for LLVM API changeKrasimir Georgiev-1/+3
LLVM commit https://github.com/llvm/llvm-project/commit/f09cf34d00625e57dea5317a3ac0412c07292148 moved some functions to a different header: https://buildkite.com/llvm-project/rust-llvm-integrate-prototype/builds/24416#018c5de6-b9c9-4b22-9473-6070d99dcfa7/233-537
2023-12-12review + rename fnlcnr-7/+5
2023-12-12refactor writeback: emit normalization errors with new solverlcnr-115/+102
2023-12-12rustc_codegen_llvm: Enforce `rustc::potential_query_instability` lintMartin Nordholts-1/+8
Stop allowing `rustc::potential_query_instability` on all of `rustc_codegen_llvm` and instead allow it on a case-by-case basis. In this case, both instances are safe to allow.
2023-12-12Fix alignment passed down to LLVM for simd_masked_loadJakub Okoński-3/+3
2023-12-12Clean up CodeBlocks::next codeGuillaume Gomez-38/+29