about summary refs log tree commit diff
path: root/src/test/ui
AgeCommit message (Collapse)AuthorLines
2021-05-07Rollup merge of #84991 - alexcrichton:target-feature-remap, r=nagisaDylan DPC-0/+5
rustc: Support Rust-specific features in -Ctarget-feature Since the beginning of time the `-Ctarget-feature` flag on the command line has largely been passed unmodified to LLVM. Afterwards, though, the `#[target_feature]` attribute was stabilized and some of the names in this attribute do not match the corresponding LLVM name. This is because Rust doesn't always want to stabilize the exact feature name in LLVM for the equivalent functionality in Rust. This creates a situation, however, where in Rust you'd write: #[target_feature(enable = "pclmulqdq")] unsafe fn foo() { // ... } but on the command line you would write: RUSTFLAGS="-Ctarget-feature=+pclmul" cargo build --release This difference is somewhat odd to deal with if you're a newcomer and the situation may be made worse with upcoming features like [WebAssembly SIMD](https://github.com/rust-lang/rust/issues/74372) which may be more prevalent. This commit implements a mapping to translate requests via `-Ctarget-feature` through the same name-mapping functionality that's present for attributes in Rust going to LLVM. This means that `+pclmulqdq` will work on x86 targets where as previously it did not. I've attempted to keep this backwards-compatible where the compiler will just opportunistically attempt to remap features found in `-Ctarget-feature`, but if there's something it doesn't understand it gets passed unmodified to LLVM just as it was before.
2021-05-07Rollup merge of #84972 - RalfJung:null-ptr-msg, r=oli-obkYuki Okushi-8/+8
CTFE inbounds-error-messages tweak * use CheckInAllocMsg::PointerArithmeticTest for ptr_offset error * nicer errors for some null pointer cases r? `@oli-obk`
2021-05-07Rollup merge of #84896 - estebank:issue-84772, r=jackh726Dylan DPC-0/+94
Handle incorrect placement of parentheses in trait bounds more gracefully Fix #84772. CC ``````@jonhoo``````
2021-05-07Rollup merge of #84871 - richkadel:no-coverage-unstable-only, r=nagisaDylan DPC-6/+10
Disallows `#![feature(no_coverage)]` on stable and beta (using standard crate-level gating) Fixes: #84836 Removes the function-level feature gating solution originally implemented, and solves the same problem using `allow_internal_unstable`, so normal crate-level feature gating mechanism can still be used (which disallows the feature on stable and beta). I tested this, building the compiler with and without `CFG_DISABLE_UNSTABLE_FEATURES=1` With unstable features disabled, I get the expected result as shown here: ```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`. ``` r? ````@Mark-Simulacrum```` cc: ````@tmandry```` ````@wesleywiser````
2021-05-07Rollup merge of #84734 - tmandry:compiletest-needs-unwind, r=Mark-SimulacrumDylan DPC-2/+14
Add `needs-unwind` and beginning of support for testing `panic=abort` std to compiletest For the Fuchsia platform we build libstd with `panic=abort` and would like a way to run tests with that enabled. This adds low-level support for this directly to compiletest. In the future I'd like to add high-level support in rustbuild, e.g. having target-specific flags that allow configuring a panic strategy. (Side note: It would be nice if we could also build multiple configurations for the same target, but I'm getting ahead of myself.) This plus #84500 have everything that's needed to get ui tests passing on fuchsia targets. Part of #84766. Note that this change only includes the header on tests which need an unwinder to _build_, not those which need it to _run_. r? ````@Mark-Simulacrum````
2021-05-07Rollup merge of #84728 - camelid:sized-param-sugg-test, r=Mark-SimulacrumDylan DPC-0/+88
Add test for suggestion to borrow unsized function parameters Closes #82820. This is a regression test for #82820. This test case is included in more general tests, but I think the error regressed because there were a bunch of other diagnostic changes in the test that obscured this regression. Hopefully, having a test specific to the suggestion, and running rustfix for the test, will prevent this error from regressing in the future.
2021-05-07Rollup merge of #84500 - tmandry:compiletest-run-flag, r=Mark-SimulacrumDylan DPC-0/+1
Add --run flag to compiletest This controls whether run-* tests actually get run. r? ```@Mark-Simulacrum```
2021-05-06Add test for suggestion to borrow unsized function parametersCamelid-0/+88
This is a regression test for #82820. This test case is included in more general tests, but I think the error regressed because there were a bunch of other diagnostic changes in the test that obscured this regression. Hopefully, having a test specific to the suggestion, and running rustfix for the test, will prevent this error from regressing in the future.
2021-05-06Auto merge of #84559 - jackh726:issue-84398, r=nikomatsakisbors-0/+20
Deduplicate ParamCandidates with the same value except for bound vars Fixes #84398 This is kind of a hack. I wonder if we can get other types of candidates that are the same except for bound vars. This won't be a problem with Chalk, since we don't really need to know that there are two different "candidates" if they both give the same final substitution. r? `@nikomatsakis`
2021-05-06rustc: Support Rust-specific features in -Ctarget-featureAlex Crichton-0/+5
Since the beginning of time the `-Ctarget-feature` flag on the command line has largely been passed unmodified to LLVM. Afterwards, though, the `#[target_feature]` attribute was stabilized and some of the names in this attribute do not match the corresponding LLVM name. This is because Rust doesn't always want to stabilize the exact feature name in LLVM for the equivalent functionality in Rust. This creates a situation, however, where in Rust you'd write: #[target_feature(enable = "pclmulqdq")] unsafe fn foo() { // ... } but on the command line you would write: RUSTFLAGS="-Ctarget-feature=+pclmul" cargo build --release This difference is somewhat odd to deal with if you're a newcomer and the situation may be made worse with upcoming features like [WebAssembly SIMD](https://github.com/rust-lang/rust/issues/74372) which may be more prevalent. This commit implements a mapping to translate requests via `-Ctarget-feature` through the same name-mapping functionality that's present for attributes in Rust going to LLVM. This means that `+pclmulqdq` will work on x86 targets where as previously it did not. I've attempted to keep this backwards-compatible where the compiler will just opportunistically attempt to remap features found in `-Ctarget-feature`, but if there's something it doesn't understand it gets passed unmodified to LLVM just as it was before.
2021-05-06Rollup merge of #84945 - fee1-dead:E0583-better-message, r=petrochenkovDylan DPC-8/+8
E0583: Include secondary path in error message Fixes #84819.
2021-05-0632bit blessRalf Jung-1/+1
2021-05-06use CheckInAllocMsg::PointerArithmeticTest for ptr_offset errorRalf Jung-7/+7
2021-05-06Fix up/ignore failing ui tests on fuchsiaTyler Mandry-0/+4
2021-05-06Support multi target-rustcflags for -Zpanic-abort-testsTyler Mandry-1/+1
I just need this until rustbuild supports -Cpanic=abort std directly.
2021-05-06Add needs-unwind to testsTyler Mandry-1/+9
2021-05-06E0583: Include secondary path in error messageDeadbeef-8/+8
2021-05-05Implement RFC 2951: Native link modifiersLuqman Aden-2/+124
This commit implements both the native linking modifiers infrastructure as well as an initial attempt at the individual modifiers from the RFC. It also introduces a feature flag for the general syntax along with individual feature flags for each modifier.
2021-05-05Rollup merge of #84913 - estebank:issue-84831, r=varkorRalf Jung-0/+35
Do not ICE on invalid const param 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-05Rollup merge of #84808 - estebank:issue-84769, r=petrochenkovRalf Jung-2/+25
Account for unsatisfied bounds in E0599 Fix #84769, follow up to #84499, #83667.
2021-05-05Disallows `#![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-04Do 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-04Auto merge of #83213 - rylev:update-lints-to-errors, r=nikomatsakisbors-142/+353
Update BARE_TRAIT_OBJECT and ELLIPSIS_INCLUSIVE_RANGE_PATTERNS to errors in Rust 2021 This addresses https://github.com/rust-lang/rust/pull/81244 by updating two lints to errors in the Rust 2021 edition. r? `@estebank`
2021-05-03Handle incorrect placement of parentheses in trait bounds more gracefullyEsteban Küber-0/+94
Fix #84772.
2021-05-04Auto merge of #84472 - Aaron1011:conservative-paramenv-and, r=lcnrbors-0/+55
Be more conservative about discarding caller_bound in `ParamEnv::and`
2021-05-03Auto merge of #84862 - GuillaumeGomez:rollup-cbc93h4, r=GuillaumeGomezbors-1/+1
Rollup of 6 pull requests Successful merges: - #84835 (Add link to Issue #34202 in udp docs) - #84852 (Change librustdoc write!(.. \n) to writeln!(..); fix comment grammar) - #84854 (use double quotes and full path for E0761) - #84856 (Correct stability of ErrorKind::OutOfMemory) - #84858 (Fix stability attributes of byte-to-string specialization) - #84860 (Link to MCP from target tier policy) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2021-05-03Rollup merge of #84854 - hi-rustin:rustin-patch-E0761, r=varkorGuillaume Gomez-1/+1
use double quotes and full path for E0761 close https://github.com/rust-lang/rust/issues/84828
2021-05-03use full path for E0761hi-rustin-1/+1
2021-05-03parser: Remove support for inner attributes on non-block expressionsVadim Petrochenkov-551/+264
2021-05-03use double quotes for E0761hi-rustin-1/+1
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-01Account for unsatisfied bounds in E0599Esteban Küber-2/+25
Fix #84769, follow up to #84499, #83667.
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-01Add regression testAaron Hill-0/+55
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-30Add needs-run-enabled directive for should-fail testsTyler Mandry-0/+1
I was wary of doing any automatic disabling here, since should-fail is how we test compiletest itself.
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`````