about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2022-08-25Attempt to normalize FnDef signature in InferCtxt::cmpMichael Goulet-0/+35
2022-08-25Do not report too many expr field candidatesMichael Goulet-16/+73
2022-08-25Add test for missing cfg propagation for reexportGuillaume Gomez-0/+33
2022-08-25bless the change in note/help order due to migrating to SessionDiagnosticNathan Stocks-2/+2
2022-08-25Provide structured suggestion for `hashmap[idx] = val`Esteban Küber-10/+36
2022-08-25Add test for {:.0$} diagnostic issue.Mara Bos-1/+14
2022-08-25no unnormalized types for implied boundslcnr-0/+48
2022-08-25Auto merge of #100571 - cjgillot:mir-cost-visit, r=compiler-errorsbors-0/+30
Check projection types before inlining MIR Fixes https://github.com/rust-lang/rust/issues/100550 I'm very unhappy with this solution, having to duplicate MIR validation code, but at least it removes the ICE. r? `@compiler-errors`
2022-08-25Do not include `const_ptr_sub_ptr` in this stabilizationDeadbeef-0/+1
2022-08-25Stabilize `const_ptr_offset_from`.Deadbeef-4/+0
Stabilization has been completed [here](https://github.com/rust-lang/rust/issues/92980#issuecomment-1065644848) with a FCP.
2022-08-25Add MaybeUninit memset testAlex Saveau-0/+11
Signed-off-by: Alex Saveau <saveau.alexandre@gmail.com>
2022-08-25Auto merge of #100977 - JohnTitor:rollup-8hc7rxh, r=JohnTitorbors-75/+110
Rollup of 8 pull requests Successful merges: - #99332 (Stabilize `#![feature(label_break_value)]`) - #99954 (let-else: break out to one scope higher for let-else) - #100188 (Parser will not suggest invalid expression when use public) - #100780 (save_analysis: Migrate diagnostic) - #100808 (Migrate `rustc_interface` diagnostics ) - #100921 (Add a warning about `Option/Result::and()` being eagerly evaluated) - #100960 (rustdoc: ayu code color selector more specific) - #100964 (Sync rustc_codegen_cranelift) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-25Handle `Err` in `ast::LitKind::to_token_lit`.Nicholas Nethercote-0/+29
Fixes #100948.
2022-08-24Improve description againMatthew Kelly-7/+8
-- update summary based on review -- rewrite explanation to be more clear and correct
2022-08-24Auto merge of #99946 - tmiasko:elide-storage-makers, r=oli-obkbors-149/+34
Elide superfluous storage markers Follow the existing strategy of omitting the storage markers for temporaries introduced for internal usage when elaborating derefs and deref projections. Those temporaries are simple scalars which are used immediately after being defined and never have their address taken. There is no benefit from storage markers from either liveness analysis or code generation perspective.
2022-08-25Rollup merge of #100188 - chenyukang:fix-issue-100165, r=estebankYuki Okushi-0/+50
Parser will not suggest invalid expression when use public Fixes #100165
2022-08-25Rollup merge of #99954 - dingxiangfei2009:break-out-let-else-higher-up, ↵Yuki Okushi-0/+11
r=oli-obk let-else: break out to one scope higher for let-else ```@est31``` This PR follows up with #99518 which is to break out to the last remainder scope. It breaks to the out-most `region_scope` of the block if the first statement is a `let-else`.
2022-08-25Rollup merge of #99332 - jyn514:stabilize-label-break-value, r=petrochenkovYuki Okushi-75/+49
Stabilize `#![feature(label_break_value)]` See the stabilization report in https://github.com/rust-lang/rust/issues/48594#issuecomment-1186213313.
2022-08-24Add color test for anchors in all themesGuillaume Gomez-1/+100
2022-08-24Extend GUI test to check colors for all srclink elementsGuillaume Gomez-7/+31
2022-08-24Update rustdoc tests for simplified rightside DOMGuillaume Gomez-9/+9
2022-08-24Add test for #100414Michael Goulet-0/+44
2022-08-24Note binding obligation causes for const equate errorsMichael Goulet-0/+78
2022-08-24Call them constants instead of typesMichael Goulet-42/+42
2022-08-24translations: rename warn_ to warningLuis Cardoso-23/+22
The macro warn_ was named like that because it the keyword warn is a built-in attribute and at the time this macro was created the word 'warning' was also taken. However it is no longer the case and we can rename warn_ to warning.
2022-08-24Rollup merge of #100945 - ↵Matthias Krüger-2/+25
TaKO8Ki:add-missing-test-case-for-impl-generic-mismatch, r=Dylan-DPC Add a missing test case for impl generic mismatch This suggestion use different span depending on whether the method has generics or not, so I added a test case about the method with some generics.
2022-08-24Rollup merge of #100940 - ↵Matthias Krüger-0/+26
TaKO8Ki:do-not-suggest-adding-bound-to-opaque-type, r=fee1-dead Do not suggest adding a bound to a opaque type fixes #100442
2022-08-24Rollup merge of #100919 - sanxiyn:parallel-liveness, r=oli-obkMatthias Krüger-55/+55
Use par_body_owners for liveness I did this refactoring while working on something else. Liveness is about bodies, there is no reason to use par_for_each_module here. Tests are updated because things are visited in a different order. I checked diagnostics are same, just in a different (and IMO, better) order.
2022-08-24Rollup merge of #100912 - tmiasko:make-include, r=TaKO8KiMatthias Krüger-273/+273
Diagnose missing includes in run-make tests
2022-08-24Rollup merge of #100906 - ChayimFriedman2:map-index-mut, r=davidtwcoMatthias Krüger-0/+40
Suggest alternatives when trying to mutate a `HashMap`/`BTreeMap` via indexing The error can be quite confusing to newcomers. Fixes #100873. I'm not so sure about the message, open to wording suggestions.
2022-08-24Rollup merge of #100888 - ↵Matthias Krüger-14/+3
spastorino:coherence-negative-impls-implied-bounds, r=lcnr Coherence negative impls implied bounds Fixes #93875 This PR is rebased on top of #100789 and it would need to include that one which is already r+ed. r? ``@nikomatsakis`` cc ``@lcnr`` (which I've talked about https://github.com/rust-lang/rust/commit/3222f420d9d2312efe0735eb48160c7b070adc54, I guess after you finish your reordering of modules and work with OutlivesEnvironmentEnv this commit can just be reverted).
2022-08-24Rollup merge of #100826 - ↵Matthias Krüger-0/+31
vincenzopalazzo:macros/wrong_sugg_with_positional_arg, r=TaKO8Ki sugg: take into count the debug formatting Closes https://github.com/rust-lang/rust/issues/100648 This PR will fix a suggestion error by taking into consideration also the `:?` symbol and act in a different way ``@rustbot`` r? ``@compiler-errors`` N.B: I did not find a full way to test the change, any idea?
2022-08-25use a minimized exampleTakayuki Maeda-31/+14
2022-08-24Add GDB/LLDB pretty-printers for NonZero typesArtem Mukhin-1/+86
2022-08-24add a missing test case for impl generic mismatchTakayuki Maeda-2/+25
2022-08-24Store blocks in `Thir`.Nicholas Nethercote-9/+12
Like expressions, statements, and match arms. This shrinks `thir::Stmt` and is a precursor to further shrinking `thir::Expr`.
2022-08-24do not suggest adding a bound to a opaque typeTakayuki Maeda-0/+43
2022-08-23Stabilize `#![feature(label_break_value)]`Joshua Nelson-75/+49
# Stabilization proposal The feature was implemented in https://github.com/rust-lang/rust/pull/50045 by est31 and has been in nightly since 2018-05-16 (over 4 years now). There are [no open issues][issue-label] other than the tracking issue. There is a strong consensus that `break` is the right keyword and we should not use `return`. There have been several concerns raised about this feature on the tracking issue (other than the one about tests, which has been fixed, and an interaction with try blocks, which has been fixed). 1. nrc's original comment about cost-benefit analysis: https://github.com/rust-lang/rust/issues/48594#issuecomment-422235234 2. joshtriplett's comments about seeing use cases: https://github.com/rust-lang/rust/issues/48594#issuecomment-422281176 3. withoutboats's comments that Rust does not need more control flow constructs: https://github.com/rust-lang/rust/issues/48594#issuecomment-450050630 Many different examples of code that's simpler using this feature have been provided: - A lexer by rpjohnst which must repeat code without label-break-value: https://github.com/rust-lang/rust/issues/48594#issuecomment-422502014 - A snippet by SergioBenitez which avoids using a new function and adding several new return points to a function: https://github.com/rust-lang/rust/issues/48594#issuecomment-427628251. This particular case would also work if `try` blocks were stabilized (at the cost of making the code harder to optimize). - Several examples by JohnBSmith: https://github.com/rust-lang/rust/issues/48594#issuecomment-434651395 - Several examples by Centril: https://github.com/rust-lang/rust/issues/48594#issuecomment-440154733 - An example by petrochenkov where this is used in the compiler itself to avoid duplicating error checking code: https://github.com/rust-lang/rust/issues/48594#issuecomment-443557569 - Amanieu recently provided another example related to complex conditions, where try blocks would not have helped: https://github.com/rust-lang/rust/issues/48594#issuecomment-1184213006 Additionally, petrochenkov notes that this is strictly more powerful than labelled loops due to macros which accidentally exit a loop instead of being consumed by the macro matchers: https://github.com/rust-lang/rust/issues/48594#issuecomment-450246249 nrc later resolved their concern, mostly because of the aforementioned macro problems. joshtriplett suggested that macros could be able to generate IR directly (https://github.com/rust-lang/rust/issues/48594#issuecomment-451685983) but there are no open RFCs, and the design space seems rather speculative. joshtriplett later resolved his concerns, due to a symmetry between this feature and existing labelled break: https://github.com/rust-lang/rust/issues/48594#issuecomment-632960804 withoutboats has regrettably left the language team. joshtriplett later posted that the lang team would consider starting an FCP given a stabilization report: https://github.com/rust-lang/rust/issues/48594#issuecomment-1111269353 [issue-label]: https://github.com/rust-lang/rust/issues?q=is%3Aissue+is%3Aopen+label%3AF-label_break_value+ ## Report + Feature gate: - https://github.com/rust-lang/rust/blob/d695a497bbf4b20d2580b75075faa80230d41667/src/test/ui/feature-gates/feature-gate-label_break_value.rs + Diagnostics: - https://github.com/rust-lang/rust/blob/6b2d3d5f3cd1e553d87b5496632132565b6779d3/compiler/rustc_parse/src/parser/diagnostics.rs#L2629 - https://github.com/rust-lang/rust/blob/f65bf0b2bb1a99f73095c01a118f3c37d3ee614c/compiler/rustc_resolve/src/diagnostics.rs#L749 - https://github.com/rust-lang/rust/blob/f65bf0b2bb1a99f73095c01a118f3c37d3ee614c/compiler/rustc_resolve/src/diagnostics.rs#L1001 - https://github.com/rust-lang/rust/blob/111df9e6eda1d752233482c1309d00d20a4bbf98/compiler/rustc_passes/src/loops.rs#L254 - https://github.com/rust-lang/rust/blob/d695a497bbf4b20d2580b75075faa80230d41667/compiler/rustc_parse/src/parser/expr.rs#L2079 - https://github.com/rust-lang/rust/blob/d695a497bbf4b20d2580b75075faa80230d41667/compiler/rustc_parse/src/parser/expr.rs#L1569 + Tests: - https://github.com/rust-lang/rust/blob/master/src/test/ui/label/label_break_value_continue.rs - https://github.com/rust-lang/rust/blob/master/src/test/ui/label/label_break_value_unlabeled_break.rs - https://github.com/rust-lang/rust/blob/master/src/test/ui/label/label_break_value_illegal_uses.rs - https://github.com/rust-lang/rust/blob/master/src/test/ui/lint/unused_labels.rs - https://github.com/rust-lang/rust/blob/master/src/test/ui/run-pass/for-loop-while/label_break_value.rs ## Interactions with other features Labels follow the hygiene of local variables. label-break-value is permitted within `try` blocks: ```rust let _: Result<(), ()> = try { 'foo: { Err(())?; break 'foo; } }; ``` label-break-value is disallowed within closures, generators, and async blocks: ```rust 'a: { || break 'a //~^ ERROR use of unreachable label `'a` //~| ERROR `break` inside of a closure } ``` label-break-value is disallowed on [_BlockExpression_]; it can only occur as a [_LoopExpression_]: ```rust fn labeled_match() { match false 'b: { //~ ERROR block label not supported here _ => {} } } macro_rules! m { ($b:block) => { 'lab: $b; //~ ERROR cannot use a `block` macro fragment here unsafe $b; //~ ERROR cannot use a `block` macro fragment here |x: u8| -> () $b; //~ ERROR cannot use a `block` macro fragment here } } fn foo() { m!({}); } ``` [_BlockExpression_]: https://doc.rust-lang.org/nightly/reference/expressions/block-expr.html [_LoopExpression_]: https://doc.rust-lang.org/nightly/reference/expressions/loop-expr.html
2022-08-23Auto merge of #100675 - Xiretza:fluent-mandate-crate-prefix, r=davidtwcobors-21/+60
fluent: mandate slug names to be prefixed by crate name This is currently only convention, but not actively checked for. Additionally, improve error messages to highlight the path of the offending fluent file rather than the identifier preceding it. This will conflict with #100671, so I'll leave it as draft until that's merged.
2022-08-23sugg: take into count the debug formattingVincenzo Palazzo-0/+31
Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2022-08-23test: bump the mobile width in rustdoc-gui/type-declation-overflow.gomlJosh Stone-2/+2
2022-08-23Suggest alternatives when trying to mutate a `HashMap`/`BTreeMap` via indexingChayim Refael Friedman-0/+40
The error can be quite confusing to newcomers.
2022-08-23Rollup merge of #100309 - compiler-errors:issue-100300, r=sanxiynDylan DPC-11/+60
Extend comma suggestion to cases where fields arent missing Fixes #100300
2022-08-23Rollup merge of #99249 - cjgillot:no-reparse-fn, r=fee1-deadDylan DPC-50/+51
Do not re-parse function signatures to suggest generics This PR uses the existing resolution rib infrastructure to channel the correct span information to suggest generic parameters. This allows to avoid re-parsing a function's source code. Drive-by cleanup: this removes useless `FnItemRibKind` from late resolution ribs. All the use cases are already covered by `ItemRibKind` and `AssocItemRibKind` which have more precise semantics.
2022-08-23extra sanity check against consts pointing to mutable memoryRalf Jung-10/+10
2022-08-23Permit negative impls coherence to take advantage of implied boundsSantiago Pastorino-14/+3
2022-08-23Use par_body_owners for livenessSeo Sanghyeon-55/+55
2022-08-23parser will not give wrong help message for 'public'yukang-0/+50
2022-08-23Fix testAmanieu d'Antras-0/+5
2022-08-23Diagnose missing includes in run-make testsTomasz Miąsko-273/+273