about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2022-03-29update miriRalf Jung-8/+8
2022-03-29Rollup merge of #95437 - notriddle:notriddle/issue-79076, r=compiler-errorsDylan DPC-0/+61
diagnostics: regression test for derive bounds Closes #79076
2022-03-29Rollup merge of #95386 - compiler-errors:try-wrapping, r=oli-obkDylan DPC-1/+171
Suggest wrapping patterns in enum variants Structured suggestion to wrap a pattern in a single-field enum or struct: ```diff struct A; enum B { A(A), } fn main(b: B) { match b { - A => {} + B::A(A) => {} } } ``` Half of #94942, the other half I'm not exactly sure how to fix. Also includes two drive-by changes (that I am open to splitting out into another PR, but thought they could be rolled up into this one): - 07776c111f07b887cd46b752870cd3fd76b2ba7c: Makes sure not to suggest wrapping if it doesn't have tuple field constructor (i.e. has named fields) - 8f2bbb18fd53e5008bb488302dbd354577698ede: Also suggest wrapping expressions in a tuple struct (not just enum variants)
2022-03-29Rollup merge of #93840 - ↵Dylan DPC-2/+0
yaahc:termination-stabilization-celebration-station, r=joshtriplett Stabilize Termination and ExitCode From https://github.com/rust-lang/rust/issues/43301 This PR stabilizes the Termination trait and associated ExitCode type. It also adjusts the ExitCode feature flag to replace the placeholder flag with a more permanent name, as well as splitting off the `to_i32` method behind its own permanently unstable feature flag. This PR stabilizes the termination trait with the following signature: ```rust pub trait Termination { fn report(self) -> ExitCode; } ``` The existing impls of `Termination` are effectively already stable due to the prior stabilization of `?` in main. This PR also stabilizes the following APIs on exit code ```rust #[derive(Clone, Copy, Debug)] pub struct ExitCode(_); impl ExitCode { pub const SUCCESS: ExitCode; pub const FAILURE: ExitCode; } impl From<u8> for ExitCode { /* ... */ } ``` --- All of the previous blockers have been resolved. The main ones that were resolved recently are: * The trait's name: We decided against changing this since none of the alternatives seemed particularly compelling. Instead we decided to end the bikeshedding and stick with the current name. ([link to the discussion](https://rust-lang.zulipchat.com/#narrow/stream/219381-t-libs/topic/Termination.2FExit.20Status.20Stabilization/near/269793887)) * Issues around platform specific representations: We resolved this issue by changing the return type of `report` from `i32` to the opaque type `ExitCode`. That way we can change the underlying representation without affecting the API, letting us offer full support for platform specific exit code APIs in the future. * Custom exit codes: We resolved this by adding `From<u8> for ExitCode`. We choose to only support u8 initially because it is the least common denominator between the sets of exit codes supported by our current platforms. In the future we anticipate adding platform specific extension traits to ExitCode for constructors from larger or negative numbers, as needed.
2022-03-29Auto merge of #95433 - Dylan-DPC:rollup-xdfit9h, r=Dylan-DPCbors-24/+73
Rollup of 4 pull requests Successful merges: - #94566 (Show ignore message in console and json output) - #95415 (diagnostics: regression test for HashMap iter_mut suggestion) - #95422 (Refactor: Use `format-args-capture` and remove an unnecessary nested block) - #95424 (:arrow_up: rust-analyzer) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-29diagnostics: regression test for derive boundsMichael Howell-0/+61
Closes #79076
2022-03-29Auto merge of #94566 - yanganto:show-ignore-message, r=m-ou-sebors-8/+7
Show ignore message in console and json output - Provide ignore the message in console and JSON output - Modify the ignore message style in the log file related: #92714
2022-03-29Rollup merge of #95424 - lnicola:rust-analyzer-2022-03-29, r=lnicolaDylan DPC-24/+16
:arrow_up: rust-analyzer r? `@ghost`
2022-03-29Rollup merge of #95415 - notriddle:notriddle/issue-82081, r=Dylan-DPCDylan DPC-0/+57
diagnostics: regression test for HashMap iter_mut suggestion Closes #82081
2022-03-29Rollup merge of #94566 - yanganto:show-ignore-message, r=m-ou-seDylan DPC-8/+7
Show ignore message in console and json output - Provide ignore the message in console and JSON output - Modify the ignore message style in the log file related: #92714
2022-03-29Auto merge of #95096 - GuillaumeGomez:rm-header-fn-field, r=camelidbors-113/+100
Remove header field from clean::Function Fixes https://github.com/rust-lang/rust/issues/89673. This is another take on https://github.com/rust-lang/rust/issues/89673 (compared to https://github.com/rust-lang/rust/pull/91217) but very different on the approach: I moved the header call in one place but still require to have the `clean::Item` so I can use the `DefId` to get what is missing. cc `@jyn514` (you reviewed the original so maybe you want to take a look?) r? `@camelid`
2022-03-29Merge ItemKind::TyMethodItem branch with ItemKind::FunctionItem and ↵Guillaume Gomez-16/+16
ItemKind::MethodItem in fn_header function
2022-03-29Add test to ensure foreign functions from dependencies are correctly handledGuillaume Gomez-0/+12
2022-03-29Remove header field from clean::FunctionGuillaume Gomez-113/+88
2022-03-29Auto merge of #95257 - compiler-errors:fn-borrow, r=lcnrbors-3/+116
Add suggestion to borrow `Fn` and `FnMut` params/opaque/closures instead of move I think that Closure/ParamTy/Opaque are all "opaque" enough that it's meaningful to suggest borrowing them instead of moving them at their usage sites when we see a move error. See the attached issue for example. Is this suggestion too general? I could perhaps use the move site information to limit this to places like fn calls, but I don't know enough about mir borrowck to know if that's an easy change. Fixes #90828
2022-03-29:arrow_up: rust-analyzerLaurențiu Nicola-24/+16
2022-03-28Suggest function borrow ignoring needs_noteMichael Goulet-2/+47
`needs_note` is false if we've already suggested why the type is Copy... but that has nothing to do with the diagnostic.
2022-03-28Add suggestion to borrow opaque Fn and FnMut instead of moveMichael Goulet-3/+71
2022-03-28Update booksEric Huss-0/+0
2022-03-29Auto merge of #95417 - ehuss:doc-no_std-error, r=Dylan-DPCbors-0/+6
bootstrap: better error message for no_std docs Currently if one tries to build std documentation for a no_std target, you get a confusing error message: `error: The argument '--package [<SPEC>...]' was provided more than once, but cannot be used multiple times` This is because [`std_cargo`](https://github.com/rust-lang/rust/blob/600ec284838c52d1f6657c2cf0097b58970b133b/src/bootstrap/compile.rs#L299-L305) has a built-in `-p alloc` argument that conflicts with the `cargo rustdoc` command used in the Std doc step. This just adds a better error message in this scenario. It may be possible to fix this correctly, but that would likely be a bit more of an invasive change that I don't have time for right now.
2022-03-28bootstrap: better error message for no_std docsEric Huss-0/+6
2022-03-28diagnostics: add regression test for #82081Michael Howell-0/+57
2022-03-28Rollup merge of #95328 - DrMeepster:box_gep_err, r=oli-obkDylan DPC-0/+22
Fix yet another Box<T, A> ICE Fixes #95036. This widens the special case from #94414 to make sure that boxes with a custom allocator are never directly dereferenced.
2022-03-28Rollup merge of #95318 - rust-lang:notriddle/issue-95208, r=wesleywiserDylan DPC-0/+64
diagnostics: correct generic bounds with doubled colon Fixes #95208
2022-03-28Rollup merge of #93787 - klensy:really-not-a-features, r=wesleywiserDylan DPC-5/+11
parallel_compiler: hide dependencies behind feature Separate dependencies for `parallel_compiler` feature, so they will not be compiled if feature not selected, reducing number of compiled crates from 238 to 224.
2022-03-28Auto merge of #95403 - Dylan-DPC:rollup-9on30mg, r=Dylan-DPCbors-216/+50
Rollup of 6 pull requests Successful merges: - #95301 (Remove `Nonterminal::NtTT`.) - #95314 (Tell users that `||` operators are not currently supported in let chain expressions) - #95350 (resolve: Simplify some diagnostic code to avoid an ICE) - #95370 ([bootstrap] Don't print `Suite not skipped` unless `--verbose` is set) - #95390 (Ignore doc comments in a declarative macro matcher.) - #95401 (Remove duplicated and unused test files) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-28Rollup merge of #95401 - c410-f3r:moar-tests, r=petrochenkovDylan DPC-201/+0
Remove duplicated and unused test files cc https://github.com/rust-lang/rust/issues/73494 r? `@petrochenkov`
2022-03-28Rollup merge of #95390 - nnethercote:allow-doc-comments-in-macros, ↵Dylan DPC-0/+13
r=petrochenkov Ignore doc comments in a declarative macro matcher. Fixes #95267. Reverts to the old behaviour before #95159 introduced a regression. r? `@petrochenkov`
2022-03-28Rollup merge of #95370 - jyn514:less-verbose-skips, r=Dylan-DPCDylan DPC-2/+2
[bootstrap] Don't print `Suite not skipped` unless `--verbose` is set This was so verbose before that it made it hard to see what effect the flag actually had. Before: ``` Set({test::src/tools/tidy}) not skipped for "bootstrap::test::Tidy" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Skipping Suite(test::src/test/ui) because it is excluded Suite(test::src/test/run-pass-valgrind) not skipped for "bootstrap::test::RunPassValgrind" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Skipping Suite(test::src/test/mir-opt) because it is excluded Suite(test::src/test/codegen) not skipped for "bootstrap::test::Codegen" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Suite(test::src/test/codegen-units) not skipped for "bootstrap::test::CodegenUnits" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Suite(test::src/test/assembly) not skipped for "bootstrap::test::Assembly" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Suite(test::src/test/incremental) not skipped for "bootstrap::test::Incremental" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Skipping Suite(test::src/test/debuginfo) because it is excluded Skipping Suite(test::src/test/ui-fulldeps) because it is excluded ... about 100 more lines ... ``` After: ``` Skipping Suite(test::src/test/ui) because it is excluded Skipping Suite(test::src/test/mir-opt) because it is excluded Skipping Suite(test::src/test/debuginfo) because it is excluded Skipping Suite(test::src/test/ui-fulldeps) because it is excluded ```
2022-03-28Rollup merge of #95350 - petrochenkov:qpathregr, r=cjgillotDylan DPC-2/+24
resolve: Simplify some diagnostic code to avoid an ICE No need to resolve those paths, they are already resolved, we just need to take the results from `partial_res_map`. Fixes https://github.com/rust-lang/rust/issues/95327
2022-03-28Rollup merge of #95314 - c410-f3r:aqui-vamos-nos, r=lcnrDylan DPC-11/+11
Tell users that `||` operators are not currently supported in let chain expressions Tells that `||` operators are not currently supported instead of not allowed. See https://github.com/rust-lang/rust/issues/53667#issuecomment-1066075876 In other words, this PR is pretty much trivial.
2022-03-28Auto merge of #95024 - koehlma:rustdoc-private-items, ↵bors-3/+43
r=GuillaumeGomez,camelid,jsha rustdoc: add 🔒 to items with restricted visibility This change marks items with restricted visibility with 🔒 when building with `--document-private-items`: <img width="278" alt="Screen Shot 2022-03-20 at 23 50 24" src="https://user-images.githubusercontent.com/509209/159189513-9e4b09bb-6785-41a5-bfe2-df02f83f8641.png"> There also appears a “Restricted Visibility” tooltip when hovering over the emoji. --- The original PR for reference: This change makes private items slightly transparent (similar to `unstable` items in rustc): <img width="272" alt="Screen Shot 2022-03-16 at 22 17 43" src="https://user-images.githubusercontent.com/509209/158692627-a1f6f5ec-e043-4aa2-9352-8d2b15c31c08.png"> I found myself using `--document-private-items` a lot recently because I find the documentation of private internals quite helpful when working on a larger project. However, not being able to distinguish private from public items (see #87785) when looking at the documentation makes this somewhat cumbersome. This PR addresses the third suggestion of issue #87785 by marking private items typographically. It seems to me that the other suggestions are more involved but this is at least a first step. A private item is also made slightly transparent in the path displayed in the header of a page: <img width="467" alt="Screen Shot 2022-03-16 at 22 19 51" src="https://user-images.githubusercontent.com/509209/158692885-0bbd3417-3c0b-486f-b8ab-99c05c6fa7ca.png"> I am looking forward to feedback and suggestions.
2022-03-28Remove duplicated and unused test filesCaio-201/+0
2022-03-28Auto merge of #95396 - ↵bors-0/+122
TaKO8Ki:suggest-replacing-field-when-using-the-same-type, r=compiler-errors Suggest replacing a field when using the same type closes #89166
2022-03-28Propagate `parallel_compiler` feature through rustc crates. Turned off ↵klensy-5/+11
feature gives change of builded crates: 238 -> 224.
2022-03-28use `can_coerce` instead of `same_type_modulo_infer`Takayuki Maeda-1/+4
2022-03-28suggest replacing field when using the same typeTakayuki Maeda-4/+123
2022-03-28Ignore doc comments in a declarative macro matcher.Nicholas Nethercote-0/+13
Fixes #95267. Reverts to the old behaviour before #95159 introduced a regression.
2022-03-27suggest wrapping in struct tuples as wellMichael Goulet-3/+25
2022-03-27do not suggest enum tuple variant for named field variantMichael Goulet-1/+24
2022-03-27suggest wrapping patterns with compatible enum variantsMichael Goulet-0/+125
2022-03-27Auto merge of #95382 - Dylan-DPC:rollup-bebyfd1, r=Dylan-DPCbors-65/+59
Rollup of 5 pull requests Successful merges: - #94939 (diagnostics: suggest missing comma in bad FRU syntax) - #95120 (Implement `apply_switch_int_edge_effects` for backward analyses) - #95364 (Add long error explanation for E0667) - #95366 (Remove test files with duplicated checksums) - #95368 (Fix typo in `String::try_reserve_exact` docs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-03-27Rollup merge of #95366 - c410-f3r:moar-tests, r=petrochenkovDylan DPC-64/+0
Remove test files with duplicated checksums cc https://github.com/rust-lang/rust/issues/73494 r? `@petrochenkov`
2022-03-27Rollup merge of #95364 - GuillaumeGomez:long-error-explanation-e0667, ↵Dylan DPC-1/+3
r=Dylan-DPC Add long error explanation for E0667 Part of #61137.
2022-03-27Rollup merge of #94939 - notriddle:notriddle/fru-comma-suggestion, r=cjgillotDylan DPC-0/+56
diagnostics: suggest missing comma in bad FRU syntax Fixes #51103
2022-03-27fix other source of box derefDrMeepster-0/+12
2022-03-27Auto merge of #94495 - estebank:missing-closing-gt, r=jackh726bors-13/+174
Provide suggestion for missing `>` in a type parameter list When encountering an inproperly terminated type parameter list, provide a suggestion to close it after the last non-constraint type parameter that was successfully parsed. Fix #94058.
2022-03-27Update ui test outputGuillaume Gomez-1/+3
2022-03-27diagnostics: suggest missing comma in bad FRU syntaxMichael Howell-0/+56
Fixes #51103
2022-03-27[bootstrap] Don't print `Suite not skipped` unless `--verbose` is setJoshua Nelson-2/+2
This was so verbose before that it made it hard to see what effect the flag actually had. Before: ``` Set({test::src/tools/tidy}) not skipped for "bootstrap::test::Tidy" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Skipping Suite(test::src/test/ui) because it is excluded Suite(test::src/test/run-pass-valgrind) not skipped for "bootstrap::test::RunPassValgrind" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Skipping Suite(test::src/test/mir-opt) because it is excluded Suite(test::src/test/codegen) not skipped for "bootstrap::test::Codegen" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Suite(test::src/test/codegen-units) not skipped for "bootstrap::test::CodegenUnits" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Suite(test::src/test/assembly) not skipped for "bootstrap::test::Assembly" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Suite(test::src/test/incremental) not skipped for "bootstrap::test::Incremental" -- not in [src/test/ui, src/test/mir-opt/, src/test/debuginfo, src/test/ui-fulldeps] Skipping Suite(test::src/test/debuginfo) because it is excluded Skipping Suite(test::src/test/ui-fulldeps) because it is excluded ... about 100 more lines ... ``` After: ``` Skipping Suite(test::src/test/ui) because it is excluded Skipping Suite(test::src/test/mir-opt) because it is excluded Skipping Suite(test::src/test/debuginfo) because it is excluded Skipping Suite(test::src/test/ui-fulldeps) because it is excluded ```