about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2021-05-03parser: Remove support for inner attributes on non-block expressionsVadim Petrochenkov-551/+264
2021-05-03Auto merge of #84842 - blkerby:null_lowercase, r=joshtriplettbors-18/+18
Replace 'NULL' with 'null' This replaces occurrences of "NULL" with "null" in docs, comments, and compiler error/lint messages. This is for the sake of consistency, as the lowercase "null" is already the dominant form in Rust. The all-caps NULL looks like the C macro (or SQL keyword), which seems out of place in a Rust context, given that NULL does not exist in the Rust language or standard library (instead having [`ptr::null()`](https://doc.rust-lang.org/stable/std/ptr/fn.null.html)).
2021-05-02Change 'NULL' to 'null'Brent Kerby-18/+18
2021-05-03Rollup merge of #84818 - ABouttefeux:enum-suggest, r=jackh726Dylan DPC-23/+162
suggestion for unit enum variant when matched with a patern resolve #84700 add suggestion for code like ```rust enum FarmAnimal { Worm, Cow, Bull, Chicken { num_eggs: usize }, Dog (String), } fn what_does_the_animal_say(animal: &FarmAnimal) { let noise = match animal { FarmAnimal::Cow(_) => "moo".to_string(), _ => todo!() }; println!("{:?} says: {:?}", animal, noise); } ``` ``` error[E0532]: expected tuple struct or tuple variant, found unit variant `FarmAnimal::Cow` --> $DIR/issue-84700.rs:15:9 | LL | Cow, | --- `FarmAnimal::Cow` defined here ... LL | FarmAnimal::Cow(_) => "moo".to_string(), | ^^^^^^^^^^^^^^^^^^ help: use this syntax instead: `FarmAnimal::Cow` ```
2021-05-03Rollup merge of #84784 - JulianKnodt:suggest_const, r=lcnrDylan DPC-0/+37
Add help message to suggest const for unused type param r? `@lcnr`
2021-05-03Rollup merge of #84072 - nagisa:target-family-two-the-movie, r=petrochenkovDylan DPC-4/+7
Allow setting `target_family` to multiple values, and implement `target_family="wasm"` As per the conclusion in [this thread](https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Are.20we.20comfortable.20with.20adding.20an.20insta-stable.20cfg.28wasm.29.3F/near/233158441), this implements an ability to specify any number of `target_family` values, allowing for more flexible generic groups, or "families", to be created than just the OS-based unix/windows dichotomy. cc https://github.com/rust-lang/reference/pull/1006
2021-05-03Set target_family="wasm" for wasm targetsSimonas Kazlauskas-4/+7
2021-05-02Rollup merge of #84358 - sexxi-goose:print_captures_borrowck_rebased, ↵Dylan DPC-72/+324
r=nikomatsakis Update closure capture error logging for disjoint captures for disjoint captures Improved error logging when `#![feature(capture_disjoint_fields)]` is used. Closes https://github.com/rust-lang/project-rfc-2229/issues/8 Closes https://github.com/rust-lang/project-rfc-2229/issues/36 Closes https://github.com/rust-lang/project-rfc-2229/issues/39 Closes #76005
2021-05-02add suggestion for unit enum variant when matched with a paternAliénore Bouttefeux-23/+162
2021-05-02fix nll test stderrChris Pardy-1/+1
2021-05-02Auto merge of #84638 - mark-i-m:unignore-tests, r=Mark-Simulacrumbors-4/+1
Unignore a couple of tests
2021-05-01Closure capture borrow diagnostics for disjoint capturesChris Pardy-71/+323
2021-05-01Add help message for unused type paramkadmin-0/+37
2021-05-01Auto merge of #84410 - BoxyUwU:blue, r=varkorbors-0/+39
Fix generic arg mismatch errors being ignored with explicit late bound lifetimes Fixes #83466 r? `@varkor`
2021-05-01test: *sneezes*Ellen-0/+39
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-28fix testmark-0/+1
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-27unignore a couple of testsmark-4/+0
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