-
Notifications
You must be signed in to change notification settings - Fork 13.4k
compiletest: Require //~
annotations even if error-pattern
is specified
#139137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// test the behavior of the --no-run flag without the --test flag | ||
|
||
//@ compile-flags:-Z unstable-options --no-run --test-args=--test-threads=1 | ||
//@ error-pattern: the `--test` flag must be passed | ||
|
||
pub fn f() {} | ||
|
||
//~? ERROR the `--test` flag must be passed to enable `--no-run` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
//@ compile-flags:--theme {{src-base}}/invalid-theme-name.rs | ||
//@ error-pattern: invalid argument | ||
//@ error-pattern: must have a .css extension | ||
|
||
//~? ERROR invalid argument: "$DIR/invalid-theme-name.rs" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
//@ check-pass | ||
//@ compile-flags: --passes list | ||
//@ error-pattern: the `passes` flag no longer functions | ||
|
||
//~? WARN the `passes` flag no longer functions |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
//@ error-pattern: no documentation found | ||
//@ normalize-stderr: "nightly|beta|1\.[0-9][0-9]\.[0-9]" -> "$$CHANNEL" | ||
#![deny(rustdoc::missing_crate_level_docs)] | ||
//^~ NOTE defined here | ||
|
||
pub fn foo() {} | ||
|
||
//~? ERROR no documentation found for this crate's top-level module |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,4 +8,4 @@ | |
struct A; | ||
struct B; | ||
|
||
pub const S: A = B; | ||
pub const S: A = B; //~ ERROR mismatched types |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,3 +23,5 @@ | |
|
||
#[lang = "sized"] | ||
trait Sized {} | ||
|
||
//~? ERROR the `-Zfixed-x18` flag is not supported on the ` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
//@ aux-build:system-allocator.rs | ||
//@ aux-build:system-allocator2.rs | ||
//@ no-prefer-dynamic | ||
//@ error-pattern: the `#[global_allocator]` in | ||
|
||
|
||
extern crate system_allocator; | ||
extern crate system_allocator2; | ||
|
||
fn main() {} | ||
|
||
//~? ERROR the `#[global_allocator]` in system_allocator conflicts with global allocator in: system_allocator2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
//@ error-pattern: aborting due to 1 previous error | ||
|
||
fn main() { | ||
2 + +2; | ||
2 + +2; //~ ERROR leading `+` is not supported | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
// Show diagnostics for invalid tokens | ||
//@ compile-flags: -Zcrate-attr=`%~@$# | ||
//@ error-pattern:unknown start of token | ||
|
||
fn main() {} | ||
|
||
//~? ERROR unknown start of token: ` | ||
//~? ERROR expected identifier, found `%` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//@ compile-flags: '-Zcrate-attr=feature(yeet_expr)]fn main(){}#[inline' | ||
//@ error-pattern:unexpected closing delimiter | ||
|
||
fn foo() {} | ||
|
||
//~? ERROR unexpected closing delimiter: `]` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
//@ compile-flags: -Zcrate-attr=#![feature(foo)] | ||
//@ error-pattern:expected identifier | ||
|
||
fn main() {} | ||
|
||
//~? ERROR expected identifier, found `#` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//@ compile-flags: -Zcrate-attr=feature(foo),feature(bar) | ||
//@ error-pattern:invalid crate attr | ||
|
||
fn main() {} | ||
|
||
//~? ERROR invalid crate attribute |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
// Show diagnostics for unbalanced parens. | ||
//@ compile-flags: -Zcrate-attr=( | ||
//@ error-pattern:unclosed delimiter | ||
|
||
fn main() {} | ||
|
||
//~? ERROR this file contains an unclosed delimiter |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
//@ error-pattern:no implementation for `String ^ String` | ||
|
||
fn main() { let x = "a".to_string() ^ "b".to_string(); } | ||
//~^ ERROR no implementation for `String ^ String` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
//@ error-pattern:cannot multiply `bool` by `bool` | ||
|
||
fn main() { let x = true * false; } | ||
fn main() { let x = true * false; } //~ ERROR cannot multiply `bool` by `bool` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
// Regression test for the ICE described in issue #86053. | ||
//@ error-pattern:unexpected `self` parameter in function | ||
//@ error-pattern:`...` must be the last argument of a C-variadic function | ||
//@ error-pattern:cannot find type `F` in this scope | ||
|
||
|
||
#![feature(c_variadic)] | ||
#![crate_type="lib"] | ||
|
||
fn ordering4 < 'a , 'b > ( a : , self , self , self , | ||
//~^ ERROR expected type, found `,` | ||
//~| ERROR unexpected `self` parameter in function | ||
//~| ERROR unexpected `self` parameter in function | ||
//~| ERROR unexpected `self` parameter in function | ||
self , ... , self , self , ... ) where F : FnOnce ( & 'a & 'b usize ) { | ||
//~^ ERROR unexpected `self` parameter in function | ||
//~| ERROR unexpected `self` parameter in function | ||
//~| ERROR unexpected `self` parameter in function | ||
//~| ERROR `...` must be the last argument of a C-variadic function | ||
//~| ERROR only foreign, `unsafe extern "C"`, or `unsafe extern "C-unwind"` functions may have a C-variadic arg | ||
//~| ERROR cannot find type `F` in this scope | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,4 @@ | ||
//@ error-pattern: can't capture dynamic environment in a fn item | ||
|
||
fn main() { | ||
let bar: isize = 5; | ||
fn foo() -> isize { return bar; } | ||
fn foo() -> isize { return bar; } //~ ERROR can't capture dynamic environment in a fn item | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
//@ error-pattern: non-primitive cast: `()` as `u32` | ||
fn main() { let u = (assert!(true) as u32); } | ||
fn main() { let u = (assert!(true) as u32); } //~ ERROR non-primitive cast: `()` as `u32` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
//@ error-pattern: non-primitive cast: `u32` as `()` | ||
fn main() { let u = 0u32 as (); } | ||
fn main() { let u = 0u32 as (); } //~ ERROR non-primitive cast: `u32` as `()` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
// Error, the linked empty library is `no_std` and doesn't provide a panic handler. | ||
|
||
//@ dont-check-compiler-stderr | ||
//@ compile-flags: --error-format=human | ||
//@ error-pattern: `#[panic_handler]` function required, but not found | ||
//@ dont-check-compiler-stderr | ||
//@ aux-build: cfg_false_lib_no_std_before.rs | ||
|
||
#![no_std] | ||
|
||
extern crate cfg_false_lib_no_std_before as _; | ||
|
||
fn main() {} | ||
|
||
// FIXME: The second error is target-dependent. | ||
//FIXME~? ERROR `#[panic_handler]` function required, but not found | ||
//FIXME~? ERROR unwinding panics are not supported without std |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//@ compile-flags: --cfg a::b | ||
//@ error-pattern: invalid `--cfg` argument: `a::b` (argument key must be an identifier) | ||
|
||
fn main() {} | ||
|
||
//~? ERROR invalid `--cfg` argument: `a::b` (argument key must be an identifier) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
//@ compile-flags: --cfg a=10 | ||
//@ error-pattern: invalid `--cfg` argument: `a=10` (argument value must be a string) | ||
|
||
fn main() {} | ||
|
||
//~? ERROR invalid `--cfg` argument: `a=10` (argument value must be a string) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
//@ error-pattern: `main` function not found | ||
//@ compile-flags: --cfg foo --check-cfg=cfg(foo,bar) | ||
|
||
// main is conditionally compiled, but the conditional compilation | ||
// is conditional too! | ||
|
||
#[cfg_attr(foo, cfg(bar))] | ||
fn main() { } | ||
fn main() { } //~ ERROR `main` function not found in crate `cfg_attr_cfg_2` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1 @@ | ||
//@ error-pattern: `main` function not found | ||
|
||
#![cfg(FALSE)] | ||
#![cfg(FALSE)] //~ ERROR `main` function not found in crate `cfg_in_crate_1` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.