summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2021-06-14regression test for issue 85713.Felix S. Klock II-0/+21
2021-06-14Revert "Allow specifying alignment for functions"Felix S. Klock II-31/+41
This reverts commit 448d07683a6defd567996114793a09c9a8aef5df to address issue 85713 on beta.
2021-06-11Fix incorrect gating of nonterminals in key-value attributesAaron Hill-0/+30
Fixes #85432 When processing a `#[derive]` or `#[cfg_eval]` attribute, we need to re-parse our attribute target, which requires flattenting all `Nonterminals`. However, this caused us to incorrectly gate on a (flattented) nonterminal in a key-value attribute, which is supposed to be allowed. Since we already perform this gating during the initial parse, we suppress it in `capture_cfg` mode.
2021-06-10Regression test for issue 84297.Felix S. Klock II-0/+9
2021-06-10Change test to use `likely`/`unlikely` instead of `copy`/`copy_overlapping`.Felix S. Klock II-7/+7
Test was added in PR #84404. The intent here is: The `copy`/`copy_overlapping` intrinsics are going through some flip-flopping now of "are they intrinsics or not". We can achieve the same effect that the test intended by using `likely`/`unlikely`.
2021-06-10Remove tests that were also added in PR 79684.Felix S. Klock II-75/+0
2021-06-10Revert PRs 81238 and 82967 (which made copy and copy_nonoverlapping intrinsics).Felix S. Klock II-114/+0
This is to address issue 84297.
2021-06-01no thir-unsafeck in betaFelix S Klock II-2/+0
remove testing via `-Z thir-unsafeck`, since it is not appropriate for beta branch.
2021-06-01Regression test for issue 85435.Felix S. Klock II-0/+27
Apply suggestions from code review: 1. (removing confusing comment from my test, since the comment reflects the bad undesirable behavior that is being fixed here.) 2. test THIR unsafeck too. Co-authored-by: Léo Lanteri Thauvin <leseulartichaut@gmail.com>
2021-05-22Disallows `#![feature(no_coverage)]` on stable and betaRich Kadel-6/+10
using allow_internal_unstable (as recommended) Fixes: #84836 ```shell $ ./build/x86_64-unknown-linux-gnu/stage1/bin/rustc src/test/run-make-fulldeps/coverage/no_cov_crate.rs error[E0554]: `#![feature]` may not be used on the dev release channel --> src/test/run-make-fulldeps/coverage/no_cov_crate.rs:2:1 | 2 | #![feature(no_coverage)] | ^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error For more information about this error, try `rustc --explain E0554`. ```
2021-05-22Do not ICE on invalid const paramEsteban Küber-0/+35
When encountering a path that can't have generics, do not call `generics_of`. This would happen when writing something like `path::this_is_a_mod<const_val>`. Fix #84831.
2021-05-06Account for unsatisfied bounds in E0599Esteban Küber-2/+25
Fix #84769, follow up to #84499, #83667.
2021-05-06Deduplicate ParamCandidates with the same value except for bound varsJack Huey-0/+20
2021-05-04Revert PR 81473 to resolve (on beta) issues 81626 and 81658.Felix S. Klock II-114/+0
Revert "Add missing brace" This reverts commit 85ad773049536d7fed9a94ae0ac74f97135c8655. Revert "Simplify base_expr" This reverts commit 899aae465eb4ef295dc1eeb2603f744568e0768c. Revert "Warn write-only fields" This reverts commit d3c69a4c0dd98af2611b7553d1a65afef6a6ccb0.
2021-05-04Remove assert_matches usersMark Rousskov-11/+0
2021-04-30Update LLVM submoduleAmanieu d'Antras-2/+0
Fixes #84025
2021-04-30Auto merge of #84401 - crlf0710:impl_main_by_path, r=petrochenkovbors-24/+140
Implement RFC 1260 with feature_name `imported_main`. This is the second extraction part of #84062 plus additional adjustments. This (mostly) implements RFC 1260. However there's still one test case failure in the extern crate case. Maybe `LocalDefId` doesn't work here? I'm not sure. cc https://github.com/rust-lang/rust/issues/28937 r? `@petrochenkov`
2021-04-29Rollup merge of #84682 - jackh726:transitive_bounds_rebind, r=nikomatsakisJack Huey-0/+23
Don't rebind in `transitive_bounds_that_define_assoc_type` Fixes #83737 Fixes #84604 Also fixes another issue that I don't have a test for, popped up in [zulip](https://rust-lang.zulipchat.com/#narrow/stream/144729-wg-traits/topic/Duplicate.20symbol.20error.20.2384604/near/236570445) r? `````@nikomatsakis`````
2021-04-29Auto merge of #84556 - RalfJung:const-fn-trait-bound, r=oli-obkbors-121/+81
use correct feature flag for impl-block-level trait bounds on const fn I am not sure what that special hack was needed for, but it doesn't seem needed any more... This removes the last use of the `const_fn` feature flag -- Cc https://github.com/rust-lang/rust/issues/84510 r? `@oli-obk`
2021-04-29re-bless on 32bitRalf Jung-7/+7
2021-04-29remove const_fn feature gate from const testsRalf Jung-105/+69
2021-04-29don't let const_fn feature flag affect impl-block-level trait boundsRalf Jung-9/+5
2021-04-28Rollup merge of #84646 - JohnTitor:add-some-bad-placeholder-tests, r=Dylan-DPCJack Huey-0/+108
Add some regression tests related to #82494 Closes #75883, closes #80779 r? ````@estebank````
2021-04-29Implement RFC 1260 with feature_name `imported_main`.Charles Lew-24/+140
2021-04-28Auto merge of #83386 - mark-i-m:stabilize-pat2015, r=nikomatsakisbors-72/+41
Stabilize `:pat_param` and remove `:pat2021` Blocked on #83384 cc `@rust-lang/lang` #79278 If I understand `@nikomatsakis` in https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/or.20patterns/near/231133873, another FCP is not needed. r? `@nikomatsakis`
2021-04-28Add HAS_RE_LATE_BOUND if there are bound varsJack Huey-0/+23
2021-04-28Auto merge of #84562 - richkadel:issue-83601, r=tmandrybors-0/+21
Adds feature-gated `#[no_coverage]` function attribute, to fix derived Eq `0` coverage issue #83601 Derived Eq no longer shows uncovered The Eq trait has a special hidden function. MIR `InstrumentCoverage` would add this function to the coverage map, but it is never called, so the `Eq` trait would always appear uncovered. Fixes: #83601 The fix required creating a new function attribute `no_coverage` to mark functions that should be ignored by `InstrumentCoverage` and the coverage `mapgen` (during codegen). Adding a `no_coverage` feature gate with tracking issue #84605. r? `@tmandry` cc: `@wesleywiser`
2021-04-28Auto merge of #83401 - fee1-dead:master, r=davidtwcobors-0/+44
Fix ICE of for-loop mut borrowck where no suggestions are available Fixes #83309.
2021-04-28Add a regression test for #80779Yuki Okushi-0/+34
2021-04-28Add a regression test for #75883Yuki Okushi-0/+74
2021-04-28Auto merge of #84644 - JohnTitor:rollup-nzq9rjz, r=JohnTitorbors-21/+160
Rollup of 5 pull requests Successful merges: - #84529 (Improve coverage spans for chained function calls) - #84616 (Fix empty dom toggle) - #84622 (Make traits with GATs not object safe) - #84624 (Make sentence in env::args_os' docs plain and simple) - #84642 (Stabilize vec_extend_from_within) Failed merges: - #84636 (rustdoc: change aliases attribute to data-aliases) r? `@ghost` `@rustbot` modify labels: rollup
2021-04-28Auto merge of #83713 - spastorino:revert-pub-macro-rules, r=nikomatsakisbors-170/+24
Revert "Rollup merge of #82296 - spastorino:pubrules, r=nikomatsakis" This reverts commit e2561c58a41023a14e0e583113dcf55e1ecb236a, reversing changes made to 2982ba50fc4bb629b8fe4108a81cb2f9b053510b. As discussed in #83641 this feature is not complete and in particular doesn't work cross macros and given that this is not going to be included in edition 2021 nobody seems to be trying to fix the underlying problem. When can add this again I guess, whenever somebody has the time to make it work cross crates. r? `@nikomatsakis`
2021-04-27remove pat2021mark-47/+25
2021-04-27adds feature gating of `no_coverage` at either crate- or function-levelRich Kadel-0/+21
2021-04-27Make traits with GATs not object safeJack Huey-21/+160
2021-04-27Auto merge of #84606 - JohnTitor:test-84408, r=lcnrbors-0/+38
Add a regression test for issue-84408 Closes #84408 r? `@lcnr`
2021-04-27Auto merge of #77246 - yaahc:typeof-errors, r=oli-obkbors-0/+32
try enabling typeof for fun error messages
2021-04-27Rename a test for consistencyYuki Okushi-0/+0
2021-04-27Add a regression test for issue-84408Yuki Okushi-0/+38
2021-04-26add ui test for new typeof error messagesJane Lusby-0/+32
2021-04-26Auto merge of #84544 - RalfJung:const_fn_in_trait, r=oli-obkbors-55/+13
Always reject `const fn` in `trait` during parsing. 'const fn' in trait are rejected in the AST: https://github.com/rust-lang/rust/blob/b78c0d8a4d5af91a4a55d029293e3ecb879ec142/compiler/rustc_ast_passes/src/ast_validation.rs#L1411 So this feature gate check is a NOP and we can just remove it. The src/test/ui/feature-gates/feature-gate-min_const_fn.rs and src/test/ui/feature-gates/feature-gate-const_fn.rs tests ensure that we still reject `const fn` in `trait` Cc https://github.com/rust-lang/rust/issues/84510 r? `@oli-obk`
2021-04-25Rollup merge of #84547 - RalfJung:max_const_fn, r=oli-obkDylan DPC-25/+76
Get rid of is_min_const_fn This removes the last trace of the min_const_fn mechanism by making the unsafety checker agnostic about whether something is a min or "non-min" const fn. It seems this distinction was used to disallow some features inside `const fn`, but that is the responsibility of the const checker, not of the unsafety checker. No test seems to even notice this change in the unsafety checker so I guess we are good... r? `@oli-obk` Cc https://github.com/rust-lang/rust/issues/84510
2021-04-25Rollup merge of #84520 - hameerabbasi:fn-as-ty, r=lcnrDylan DPC-0/+27
Improve diagnostics for function passed when a type was expected. This PR improves diagnostics, it provides more information when a function is passed where a type is expected. r? `@lcnr`
2021-04-25Rollup merge of #84516 - torhovland:issue-84114, r=estebankDylan DPC-0/+78
Add suggestion to "use break" when attempting to implicit-break a loop Fixes #84114
2021-04-25Rollup merge of #84499 - estebank:issue-84272, r=jackh726Dylan DPC-0/+67
Tweak trait not `use`d suggestion Fix #84272. Follow up to #83667.
2021-04-25Rollup merge of #84486 - Smittyvb:else-if-let-hir-pretty-print, r=petrochenkovDylan DPC-0/+47
Handle pretty printing of `else if let` clauses without ICEing When pretty printing the HIR of `if ... {} else if let ... {}` clauses, this displays it the `else if let` part as `match` it gets desugared to, the same way normal `if let` statements are currently displayed, instead of ICEing. ```rust pub fn main() { if true { // 1 } else if let a = 1 { // 2 } else { // 3 } } ``` now gets desugared (via `rustc -Zunpretty=hir,typed src/x.rs`) to: ```rust #[prelude_import] use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; pub fn main() ({ (if (true as bool) ({ // 1 } as ()) else {match (1 as i32) { a => { // 2 } _ => { // 3 } }} as ()) } as ()) ``` For comparison, this code gets HIR prettyprinted the same way before and after this change: ```rust pub fn main() { if let a = 1 { // 2 } else { // 3 } } ``` turns into ```rust #[prelude_import] use ::std::prelude::rust_2015::*; #[macro_use] extern crate std; pub fn main() ({ (match (1 as i32) { a => { // 2 } _ => { // 3 } } as ()) } as ()) ``` This closes #82329. It closes #84434 as well, due to having the same root cause.
2021-04-25Rollup merge of #84450 - jyn514:missing-std, r=petrochenkovDylan DPC-0/+24
Give a better error when `std` or `core` are missing - Suggest using `rustup target add` if `RUSTUP_HOME` is set. I don't know if there's any precedent for doing this, but it seems harmless enough and it will be a big help. - On nightly, suggest using `cargo build -Z build-std` if `CARGO` is set - Add a note about `#![no_std]` if `std` is missing but not core - Add a note that std may be unsupported if `std` is missing but not core Fixes https://github.com/rust-lang/rust/issues/84418. r? `@petrochenkov`
2021-04-25Give a better error when std or core are missingJoshua Nelson-0/+24
- Suggest using `rustup target add` if `RUSTUP_HOME` is set. I don't know if there's any precedent for doing this, but it seems harmless enough and it will be a big help. - Add a note about `#![no_std]` if `std` is missing but not core - On nightly, suggest using `cargo build -Z build-std` if `CARGO` is set - Add a note that std may be unsupported if `std` is missing but not core - Don't suggest `#![no_std]` when the load isn't injected by the compiler
2021-04-25make sure raw ptr casts in 'const' context are unsafeRalf Jung-25/+76
2021-04-25Auto merge of #84299 - lcnr:const-generics-defaults-name-res, r=varkorbors-88/+260
various const parameter defaults improvements Actually resolve names in const parameter defaults, fixing `struct Foo<const N: usize = { usize::MAX }>`. --- Split generic parameter ban rib for types and consts, allowing ```rust #![feature(const_generics_defaults)] struct Q; struct Foo<T = Q, const Q: usize = 3>(T); ``` --- Remove the type/const ordering restriction if `const_generics_defaults` is active, even if `const_generics` is not. allowing us to stabilize and test const param defaults separately. --- Check well formedness of const parameter defaults, eagerly emitting an error for `struct Foo<const N: usize = { 0 - 1 }>` --- Do not forbid const parameters in param defaults, allowing `struct Foo<const N: usize, T = [u8; N]>(T)` and `struct Foo<const N: usize, const M: usize = N>`. Note that this should not change anything which is stabilized, as on stable, type parameters must be in front of const parameters, which means that type parameter defaults are only allowed if no const parameters exist. We still forbid generic parameters inside of const param types. r? `@varkor` `@petrochenkov`