about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2022-04-15tidyIbraheem Ahmed-0/+1
2022-04-15Rollup merge of #95749 - compiler-errors:ambig, r=oli-obkDylan DPC-25/+23
only downgrade selection Error -> Ambiguous if type error is in predicate That is, we don't care if there's a TypeError type in the ParamEnv. Fixes #95408
2022-04-15Rollup merge of #95194 - kckeiks:update-algo-in-find-use-placement, r=pnkfelixDylan DPC-5/+4
remove find_use_placement A more robust solution to finding where to place use suggestions was added in #94584. The algorithm uses the AST to find the span for the suggestion so we pass this span down to the HIR during lowering and use it instead of calling `find_use_placement` Fixes #94941
2022-04-15Rollup merge of #94849 - ouz-a:master4, r=oli-obkDylan DPC-0/+27
Check var scope if it exist Fixes #92893. Added helper function to check the scope of a variable, if it doesn't have a scope call delay_span_bug, which avoids us trying to get a block/scope that doesn't exist. Had to increase `ROOT_ENTRY_LIMIT` was getting tidy error
2022-04-15Rollup merge of #94461 - jhpratt:2024-edition, r=pnkfelixDylan DPC-8/+9
Create (unstable) 2024 edition [On Zulip](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Deprecating.20macro.20scoping.20shenanigans/near/272860652), there was a small aside regarding creating the 2024 edition now as opposed to later. There was a reasonable amount of support and no stated opposition. This change creates the 2024 edition in the compiler and creates a prelude for the 2024 edition. There is no current difference between the 2021 and 2024 editions. Cargo and other tools will need to be updated separately, as it's not in the same repository. This change permits the vast majority of work towards the next edition to proceed _now_ instead of waiting until 2024. For sanity purposes, I've merged the "hello" UI tests into a single file with multiple revisions. Otherwise we'd end up with a file per edition, despite them being essentially identical. ````@rustbot```` label +T-lang +S-waiting-on-review Not sure on the relevant team, to be honest.
2022-04-15Rollup merge of #94457 - jhpratt:stabilize-derive_default_enum, r=davidtwcoDylan DPC-53/+29
Stabilize `derive_default_enum` This stabilizes `#![feature(derive_default_enum)]`, as proposed in [RFC 3107](https://github.com/rust-lang/rfcs/pull/3107) and tracked in #87517. In short, it permits you to `#[derive(Default)]` on `enum`s, indicating what the default should be by placing a `#[default]` attribute on the desired variant (which must be a unit variant in the interest of forward compatibility). ```````@rustbot``````` label +S-waiting-on-review +T-lang
2022-04-15Remove `--extern-location` and all associated codeJeremy Fitzhardinge-186/+0
`--extern-location` was an experiment to investigate the best way to generate useful diagnostics for unused dependency warnings by enabling a build system to identify the corresponding build config. While I did successfully use this, I've since been convinced the alternative `--json unused-externs` mechanism is the way to go, and there's no point in having two mechanisms with basically the same functionality. This effectively reverts https://github.com/rust-lang/rust/pull/72603
2022-04-14make unaligned_reference warning visible in future compat reportRalf Jung-0/+450
2022-04-14Use native duplicate attribute checkJacob Pratt-20/+28
2022-04-14Error on `#[rustc_deprecated]`Jacob Pratt-2/+36
2022-04-14make unaligned_references lint deny-by-defaultRalf Jung-37/+38
2022-04-14Update issue-92893.stderrouz-a-0/+27
2022-04-14Update output of cycle-cache-err-60010 testEduardo Sánchez Muñoz-1/+1
2022-04-14`Unique<T>` is now considered FFI-safeEduardo Sánchez Muñoz-16/+6
2022-04-14Auto merge of #95315 - compiler-errors:pointee-fix, r=pnkfelixbors-0/+19
when checking pointee metadata, canonicalize the `Sized` check Use `infcx.predicate_must_hold_modulo_regions` with a `Sized` obligation instead of just calling `ty.is_sized`, because the latter does not canonicalize region and type vars (and in the test case I added in this PR, there's a region var in the `ParamEnv`). Fixes #95311
2022-04-14refactor: change to use peekablerainy-me-1/+1
2022-04-14Remove use of `#[rustc_deprecated]`Jacob Pratt-1/+1
2022-04-14improve diagnostics for unterminated nested block commentrainy-me-0/+25
2022-04-13fix: wrong trait import suggestion for T:Bruno Felipe Francisco-0/+24
2022-04-13Consider lifetimes when comparing types for equality in MIR validatorJakob Degen-0/+10
2022-04-13Rollup merge of #95989 - rust-lang:notriddle/issue-82446, r=compiler-errorsDylan DPC-0/+27
diagnostics: regression test for spurrious "help: store this in the heap" Closes #82446
2022-04-12Rollup merge of #95973 - oli-obk:tait_ub3, r=compiler-errorsDylan DPC-41/+153
prevent opaque types from appearing in impl headers cc `@lqd` opaque types are not distinguishable from their hidden type at the codegen stage. So we could either end up with cases where the hidden type doesn't implement the trait (which will thus ICE) or where the hidden type does implement the trait (so we'd be using its impl instead of the one written for the opaque type). This can even lead to unsound behaviour without unsafe code. Fixes https://github.com/rust-lang/rust/issues/86411. Fixes https://github.com/rust-lang/rust/issues/84660. rebase of #87382 plus some diagnostic tweaks
2022-04-12Rollup merge of #95970 - WaffleLapkin:nicer_trait_suggestions, r=compiler-errorsDylan DPC-1/+61
Fix suggestions in case of `T:` bounds This PR fixes a corner case in `suggest_constraining_type_params` that was causing incorrect suggestions. For the following functions: ```rust fn a<T:>(t: T) { [t, t]; } fn b<T>(t: T) where T: { [t, t]; } ``` We previously suggested the following: ```text ... help: consider restricting type parameter `T` | 1 | fn a<T: Copy:>(t: T) { [t, t]; } | ++++++ ... help: consider further restricting this bound | 2 | fn b<T>(t: T) where T: + Copy { [t, t]; } | ++++++ ``` Note that neither `T: Copy:` not `where T: + Copy` is a correct bound. With this commit the suggestions are correct: ```text ... help: consider restricting type parameter `T` | 1 | fn a<T: Copy>(t: T) { [t, t]; } | ++++ ... help: consider further restricting this bound | 2 | fn b<T>(t: T) where T: Copy { [t, t]; } | ++++ ``` r? `@compiler-errors` I've tried fixing #95898 here too, but got too confused with how `suggest_traits_to_import` works and what it does :sweat_smile:
2022-04-12Rollup merge of #95918 - compiler-errors:issue-95878, r=cjgillotDylan DPC-0/+20
Delay a bug when we see SelfCtor in ref pattern Fixes #95878
2022-04-12Apply suggestions from code reviewOli Scherer-1/+1
Co-authored-by: Michael Goulet <michael@errs.io> Co-authored-by: Rémy Rakic <remy.rakic+github@gmail.com>
2022-04-12regression test for spurrious "help: store this in the heap"Michael Howell-0/+27
Closes #82446
2022-04-12Rollup merge of #95975 - m-ou-se:test-70093-no-cross, r=joshtriplettMara Bos-0/+1
Don't test -Cdefault-linker-libraries=yes when cross compiling. See https://github.com/rust-lang/rust/pull/95727#issuecomment-1096603163 and the five comments below that. Unblocks #95727.
2022-04-12Auto merge of #95974 - fee1-dead:rollup-2fr55cs, r=fee1-deadbors-20/+4
Rollup of 5 pull requests Successful merges: - #95671 (feat: Allow usage of sudo [while not accessing root] in x.py) - #95716 (sess: warn w/out fluent bundle w/ user sysroot) - #95820 (simplify const params diagnostic on stable) - #95900 (Fix documentation for wasm32-unknown-unknown) - #95947 (`impl const Default for Box<[T]>` and `Box<str>`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-04-12Don't test -Cdefault-linker-libraries=yes when cross compiling.Mara Bos-0/+1
2022-04-12Rollup merge of #95820 - OliverMD:95150, r=lcnrfee1-dead-20/+4
simplify const params diagnostic on stable Resolves #95150
2022-04-12Compute a more precise span for opaque type implsOli Scherer-20/+20
2022-04-12Ban subnormals and NaNs in const {from,to}_bitsJubilee Young-30/+181
2022-04-12Add test for `T:` suggestionsMaybe Waffle-1/+61
2022-04-12Rollup merge of #95936 - TaKO8Ki:fix-relative-paths-error-message, r=Dylan-DPCMatthias Krüger-2/+2
Fix a bad error message for `relative paths are not supported in visibilities` error closes #95638
2022-04-12Rollup merge of #95920 - compiler-errors:cast-suggestion-span, r=oli-obkMatthias Krüger-0/+23
use `Span::find_ancestor_inside` to get right span in CastCheck This is a quick fix. This bad suggestion likely lives in other places... but thought it would be useful to fix all of the CastCheck ones first. Let me know if reviewer would prefer I add more tests for each of the diagnostics in CastCheck, or would like to do a more thorough review of other suggestions that use spans in typeck. I would also be open to further suggestions on how to better expose an API that gives us the "best" span for a diagnostic suggestion. Fixed #95919
2022-04-12Rollup merge of #95910 - ehuss:fix-crate-type-duplicate, r=Dylan-DPCMatthias Krüger-60/+44
Fix crate_type attribute to not warn on duplicates In #88681 I accidentally marked the `crate_type` attribute as only allowing a single attribute. However, multiple attributes are allowed (they are joined together [here](https://github.com/rust-lang/rust/blob/027a232755fa9728e9699337267f6675dfd0a8ba/compiler/rustc_interface/src/util.rs#L530-L542)). This fixes it to not report a warning if duplicates are found. Closes #95902
2022-04-12Auto merge of #93408 - liangyongrui:master, r=scottmcmbors-4/+4
fix Layout struct member naming style
2022-04-11simplify const params diagnostic on stableOliver Downard-20/+4
2022-04-11Rollup merge of #95008 - c410-f3r:let-chains-paren, r=wesleywiserDylan DPC-461/+709
[`let_chains`] Forbid `let` inside parentheses Parenthesizes are mostly a no-op in let chains, in other words, they are mostly ignored. ```rust let opt = Some(Some(1i32)); if (let Some(a) = opt && (let Some(b) = a)) && b == 1 { println!("`b` is declared inside but used outside"); } ``` As seen above, such behavior can lead to confusion. A proper fix or nested encapsulation would probably require research, time and a modified MIR graph so in this PR I simply denied any `let` inside parentheses. Non-let stuff are still allowed. ```rust fn main() { let fun = || true; if let true = (true && fun()) && (true) { println!("Allowed"); } } ``` It is worth noting that `let ...` is not an expression and the RFC did not mention this specific situation. cc `@matthewjasper`
2022-04-11update ui tests using opaque types in impl headersRémy Rakic-2/+2
2022-04-11add regression tests for opaque types in impl headersRémy Rakic-0/+92
2022-04-11prevent opaque types from appearing in impl headersRémy Rakic-35/+55
2022-04-11Add const eval tests ensuring padding gets correctly marked as deinit on ↵Jakob Degen-0/+37
deaggregation
2022-04-11Bless tests that broke in a trivial way due to change in deaggregationJakob Degen-11/+11
2022-04-11fix a bad error message for `relative paths are not supported in ↵Takayuki Maeda-2/+2
visibilities` error
2022-04-11Auto merge of #95758 - compiler-errors:issue-54771, r=estebankbors-21/+75
Only suggest removing semicolon when expression is compatible with `impl Trait` https://github.com/rust-lang/rust/issues/54771#issuecomment-476423690 > It still needs checking that the last statement's expr can actually conform to the trait, but the naïve behavior is there. Only suggest removing a semicolon when the type behind the semicolon actually implements the trait in an RPIT `-> impl Trait`. Also upgrade the label that suggests removing the semicolon to a suggestion (should it be verbose?). cc #54771
2022-04-11fix Layout struct member naming styleliangyongrui-4/+4
2022-04-11Auto merge of #95754 - compiler-errors:binder-assoc-ty, r=nagisabors-0/+19
Better error for `for<...>` on associated type bound With GATs just around the corner, we'll probably see more people trying out `Trait<for<'a> Assoc<'a> = ..>`. This PR improves the syntax error slightly, and also makes it slightly easier to make this into real syntax in the future. Feel free to push back if the reviewer thinks this should have a suggestion on how to fix it (i.e. push the `for<'a>` outside of the angle brackets), but that can also be handled in a follow-up PR.
2022-04-10use find_ancestor_inside to get right span in CastCheckMichael Goulet-0/+23
2022-04-10Delay a bug when we see SelfCtor in ref patternMichael Goulet-0/+20