提交 653da4fd 编写于 作者: B bors

Auto merge of #55532 - pnkfelix:rustc_error-survey, r=nikomatsakis

#[rustc_error] survey

Fix #55505
......@@ -21,11 +21,11 @@
// ignore-mips
// ignore-mips64
#![feature(asm, rustc_attrs)]
#![feature(asm)]
#[cfg(any(target_arch = "x86",
target_arch = "x86_64"))]
#[rustc_error]
pub fn main() {
unsafe {
// clobber formatted as register input/output
......
......@@ -21,14 +21,14 @@
// ignore-mips
// ignore-mips64
#![feature(asm, rustc_attrs)]
// compile-pass
// skip-codegen
#![feature(asm)]
#![allow(dead_code, non_upper_case_globals)]
#[cfg(any(target_arch = "x86",
target_arch = "x86_64"))]
#[rustc_error]
pub fn main() { //~ ERROR compilation successful
pub fn main() {
// assignment not dead
let mut x: isize = 0;
unsafe {
......
......@@ -10,17 +10,3 @@ warning: expected a clobber, found an option
LL | asm!("add $2, $1; mov $1, $0" : "=r"(x) : "r"(x), "r"(8_usize) : "cc", "volatile");
| ^^^^^^^^^^
error: compilation successful
--> $DIR/asm-misplaced-option.rs:31:1
|
LL | / pub fn main() { //~ ERROR compilation successful
LL | | // assignment not dead
LL | | let mut x: isize = 0;
LL | | unsafe {
... |
LL | | assert_eq!(x, 13);
LL | | }
| |_^
error: aborting due to previous error
......@@ -8,9 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(warnings)]
pub type ParseResult<T> = Result<T, ()>;
pub enum Item<'a> { Literal(&'a str),
......@@ -35,5 +35,5 @@ pub fn parse<'a, I>(mut s: &str, items: I) -> ParseResult<()>
Ok(())
}
#[rustc_error]
fn main() { } //~ ERROR compilation successful
fn main() { }
error: compilation successful
--> $DIR/chrono-scan.rs:39:1
|
LL | fn main() { } //~ ERROR compilation successful
| ^^^^^^^^^^^^^
error: aborting due to previous error
......@@ -8,9 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(warnings)]
// Check that you are allowed to implement using elision but write
// trait without elision (a bug in this cropped up during
// bootstrapping, so this is a regression test).
......@@ -30,5 +30,5 @@ fn split_whitespace(&self) -> SplitWhitespace {
}
}
#[rustc_error]
fn main() { } //~ ERROR compilation successful
fn main() { }
error: compilation successful
--> $DIR/elision.rs:34:1
|
LL | fn main() { } //~ ERROR compilation successful
| ^^^^^^^^^^^^^
error: aborting due to previous error
......@@ -12,10 +12,10 @@
#![warn(unused)]
#![deny(warnings)]
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
use std::option; //~ WARN
#[rustc_error]
fn main() {} //~ ERROR: compilation successful
fn main() {}
......@@ -11,11 +11,3 @@ LL | #![deny(warnings)]
| ^^^^^^^^
= note: #[warn(unused_imports)] implied by #[warn(warnings)]
error: compilation successful
--> $DIR/bad-lint-cap3.rs:20:1
|
LL | fn main() {} //~ ERROR: compilation successful
| ^^^^^^^^^^^^
error: aborting due to previous error
......@@ -8,9 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(dead_code)]
// Here we do not get a coherence conflict because `Baz: Iterator`
// does not hold and (due to the orphan rules), we can rely on that.
......@@ -25,5 +25,5 @@ impl Foo<i32> for Baz { }
impl<A:Iterator> Foo<A::Item> for A { }
#[rustc_error]
fn main() {} //~ ERROR compilation successful
fn main() {}
error: compilation successful
--> $DIR/coherence-projection-ok-orphan.rs:29:1
|
LL | fn main() {} //~ ERROR compilation successful
| ^^^^^^^^^^^^
error: aborting due to previous error
......@@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
pub trait Foo<P> {}
pub trait Bar {
......@@ -24,5 +24,5 @@ impl Bar for i32 {
type Output = u32;
}
#[rustc_error]
fn main() {} //~ ERROR compilation successful
fn main() {}
error: compilation successful
--> $DIR/coherence-projection-ok.rs:28:1
|
LL | fn main() {} //~ ERROR compilation successful
| ^^^^^^^^^^^^
error: aborting due to previous error
......@@ -12,8 +12,8 @@
// `MyType: !MyTrait` along with other "fundamental" wrappers.
// aux-build:coherence_copy_like_lib.rs
#![feature(rustc_attrs)]
// compile-pass
// skip-codgen
#![allow(dead_code)]
extern crate coherence_copy_like_lib as lib;
......@@ -30,5 +30,5 @@ impl<T: lib::MyCopy> MyTrait for T { }
// Huzzah.
impl MyTrait for lib::MyFundamentalStruct<MyType> { }
#[rustc_error]
fn main() { } //~ ERROR compilation successful
fn main() { }
error: compilation successful
--> $DIR/coherence_copy_like_err_fundamental_struct.rs:34:1
|
LL | fn main() { } //~ ERROR compilation successful
| ^^^^^^^^^^^^^
error: aborting due to previous error
......@@ -12,8 +12,8 @@
// `MyType: !MyTrait` along with other "fundamental" wrappers.
// aux-build:coherence_copy_like_lib.rs
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(dead_code)]
extern crate coherence_copy_like_lib as lib;
......@@ -30,5 +30,5 @@ impl<T: lib::MyCopy> MyTrait for T { }
// Huzzah.
impl<'a> MyTrait for lib::MyFundamentalStruct<&'a MyType> { }
#[rustc_error]
fn main() { } //~ ERROR compilation successful
fn main() { }
error: compilation successful
--> $DIR/coherence_copy_like_err_fundamental_struct_ref.rs:34:1
|
LL | fn main() { } //~ ERROR compilation successful
| ^^^^^^^^^^^^^
error: aborting due to previous error
......@@ -13,7 +13,7 @@
// aux-build:coherence_copy_like_lib.rs
#![feature(rustc_attrs)]
extern crate coherence_copy_like_lib as lib;
......@@ -26,5 +26,5 @@ impl<T: lib::MyCopy> MyTrait for T { }
// Tuples are not fundamental.
impl MyTrait for lib::MyFundamentalStruct<(MyType,)> { } //~ ERROR E0119
#[rustc_error]
fn main() { }
......@@ -12,8 +12,8 @@
// `MyType: !MyTrait` along with other "fundamental" wrappers.
// aux-build:coherence_copy_like_lib.rs
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(dead_code)]
extern crate coherence_copy_like_lib as lib;
......@@ -29,5 +29,5 @@ impl lib::MyCopy for Box<MyType> { }
impl lib::MyCopy for lib::MyFundamentalStruct<MyType> { }
impl lib::MyCopy for lib::MyFundamentalStruct<Box<MyType>> { }
#[rustc_error]
fn main() { } //~ ERROR compilation successful
fn main() { }
error: compilation successful
--> $DIR/coherence_local.rs:33:1
|
LL | fn main() { } //~ ERROR compilation successful
| ^^^^^^^^^^^^^
error: aborting due to previous error
......@@ -13,7 +13,7 @@
// aux-build:coherence_copy_like_lib.rs
#![feature(rustc_attrs)]
#![allow(dead_code)]
extern crate coherence_copy_like_lib as lib;
......@@ -25,5 +25,5 @@ struct MyType { x: i32 }
// MyStruct is not fundamental.
impl lib::MyCopy for lib::MyStruct<MyType> { } //~ ERROR E0117
#[rustc_error]
fn main() { }
......@@ -13,7 +13,7 @@
// aux-build:coherence_copy_like_lib.rs
#![feature(rustc_attrs)]
#![allow(dead_code)]
extern crate coherence_copy_like_lib as lib;
......@@ -25,5 +25,5 @@ struct MyType { x: i32 }
// Tuples are not fundamental, so this is not a local impl.
impl lib::MyCopy for (MyType,) { } //~ ERROR E0117
#[rustc_error]
fn main() { }
......@@ -12,8 +12,8 @@
// `MyType: !MyTrait` along with other "fundamental" wrappers.
// aux-build:coherence_copy_like_lib.rs
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(dead_code)]
extern crate coherence_copy_like_lib as lib;
......@@ -23,5 +23,5 @@ struct MyType { x: i32 }
// naturally, legal
impl lib::MyCopy for MyType { }
#[rustc_error]
fn main() { } //~ ERROR compilation successful
fn main() { }
error: compilation successful
--> $DIR/coherence_local_ref.rs:27:1
|
LL | fn main() { } //~ ERROR compilation successful
| ^^^^^^^^^^^^^
error: aborting due to previous error
......@@ -8,17 +8,17 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(dead_code)]
#![deny(unused_attributes)] // c.f #35584
mod auxiliary {
#[cfg_attr(any(), path = "nonexistent_file.rs")] pub mod namespaced_enums;
#[cfg_attr(all(), path = "namespaced_enums.rs")] pub mod nonexistent_file;
}
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
let _ = auxiliary::namespaced_enums::Foo::A;
let _ = auxiliary::nonexistent_file::Foo::A;
}
error: compilation successful
--> $DIR/cfg_attr_path.rs:21:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | let _ = auxiliary::namespaced_enums::Foo::A;
LL | | let _ = auxiliary::nonexistent_file::Foo::A;
LL | | }
| |_^
error: aborting due to previous error
......@@ -10,16 +10,16 @@
// Test use of const fn from another crate without a feature gate.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(unused_variables)]
// aux-build:const_fn_lib.rs
extern crate const_fn_lib;
use const_fn_lib::foo;
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
let x = foo(); // use outside a constant is ok
}
error: compilation successful
--> $DIR/const-fn-stability-calls-3.rs:23:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | let x = foo(); // use outside a constant is ok
LL | | }
| |_^
error: aborting due to previous error
......@@ -7,9 +7,9 @@
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(custom_attribute, rustc_attrs)]
// skip-codegen
// compile-pass
#![feature(custom_attribute)]
macro_rules! mac {
{} => {
#[cfg(attr)]
......@@ -28,5 +28,5 @@ fn g() {}
mac! {}
#[rustc_error]
fn main() {} //~ ERROR compilation successful
fn main() {}
error: compilation successful
--> $DIR/expanded-cfg.rs:32:1
|
LL | fn main() {} //~ ERROR compilation successful
| ^^^^^^^^^^^^
error: aborting due to previous error
......@@ -40,7 +40,7 @@
// inputs are handled by each, and (2.) to ease searching for related
// occurrences in the source text.
#![feature(rustc_attrs)] // For `rustc_error`; see note below.
// skip-codegen
#![warn(unused_attributes, unknown_lints)]
#![allow(dead_code)]
#![allow(stable_features)]
......@@ -584,7 +584,7 @@ mod inner { #![export_name="2200"] }
#[export_name = "2200"] impl S { }
}
// Note that this test ends with a `#[rustc_error] fn main()`, so it
// Note that this test has a `skip-codegen`, so it
// will never invoke the linker. These are here nonetheless to point
// out that we allow them at non-crate-level (though I do not know
// whether they have the same effect here as at crate-level).
......@@ -835,12 +835,12 @@ mod inner { #![type_length_limit="0100"] }
//~| WARN crate-level attribute should be an inner attribute
}
// Since we expect for the mix of attributes used here to compile
// successfully, and we are just testing for the expected warnings of
// various (mis)uses of attributes, we use the `rustc_error` attribute
// on the `fn main()`.
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
println!("Hello World");
}
......@@ -1303,13 +1303,7 @@ warning: unused attribute
LL | #![proc_macro_derive = "2500"] //~ WARN unused attribute
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: compilation successful
--> $DIR/issue-43106-gating-of-builtin-attrs.rs:844:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | println!("Hello World");
LL | | }
| |_^
error: invalid windows subsystem `1000`, only `windows` and `console` are allowed
error: aborting due to previous error
......@@ -15,9 +15,9 @@
//
// (For non-crate-level cases, see issue-43106-gating-of-builtin-attrs.rs)
#![feature(rustc_attrs)] // For `rustc_error`; see note below.
// compile-pass
// skip-codegen
#![allow(dead_code)]
#![deprecated = "1100"]
// Since we expect for the mix of attributes used here to compile
......@@ -25,7 +25,7 @@
// various (mis)uses of attributes, we use the `rustc_error` attribute
// on the `fn main()`.
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
println!("Hello World");
}
error: compilation successful
--> $DIR/issue-43106-gating-of-deprecated.rs:29:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | println!("Hello World");
LL | | }
| |_^
error: aborting due to previous error
......@@ -10,7 +10,7 @@
// Check that literals in attributes parse just fine.
#![feature(rustc_attrs)]
#![allow(dead_code)]
#![allow(unused_variables)]
......@@ -29,5 +29,5 @@
#[fake_doc(r"doc")] //~ ERROR attribute `fake_doc` is currently unknown
struct Q { }
#[rustc_error]
fn main() { }
......@@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
mod foo {
pub use bar::*;
pub use main as f;
......@@ -25,5 +25,5 @@ mod baz {
pub use super::*;
}
#[rustc_error]
pub fn main() {} //~ ERROR compilation successful
pub fn main() {}
error: compilation successful
--> $DIR/glob-cycles.rs:29:1
|
LL | pub fn main() {} //~ ERROR compilation successful
| ^^^^^^^^^^^^^^^^
error: aborting due to previous error
......@@ -11,8 +11,8 @@
// ignore-pretty pretty-printing is unhygienic
#![feature(decl_macro, associated_type_defaults)]
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
trait Base {
type AssocTy;
fn f();
......@@ -45,5 +45,5 @@ fn h<T: Base, U: Derived>() {
mac!();
#[rustc_error]
fn main() {} //~ ERROR compilation successful
fn main() {}
error: compilation successful
--> $DIR/assoc_ty_bindings.rs:49:1
|
LL | fn main() {} //~ ERROR compilation successful
| ^^^^^^^^^^^^
error: aborting due to previous error
......@@ -8,13 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(warnings)]
// This used to ICE because the "if" being unreachable was not handled correctly
fn err() {
if loop {} {}
}
#[rustc_error]
fn main() {} //~ ERROR compilation successful
fn main() {}
error: compilation successful
--> $DIR/if-loop.rs:20:1
|
LL | fn main() {} //~ ERROR compilation successful
| ^^^^^^^^^^^^
error: aborting due to previous error
......@@ -10,12 +10,12 @@
// aux-build:import_crate_var.rs
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#[macro_use] extern crate import_crate_var;
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
m!();
//~^ WARN `$crate` may not be imported
//~| NOTE `use $crate;` was erroneously allowed and will become a hard error
......
......@@ -7,15 +7,3 @@ LL | m!();
= note: `use $crate;` was erroneously allowed and will become a hard error in a future release
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
error: compilation successful
--> $DIR/import-crate-var.rs:18:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | m!();
LL | | //~^ WARN `$crate` may not be imported
LL | | //~| NOTE `use $crate;` was erroneously allowed and will become a hard error
LL | | }
| |_^
error: aborting due to previous error
......@@ -8,9 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(warnings)]
struct Attr {
name: String,
value: String,
......@@ -31,8 +31,8 @@ pub unsafe fn get_attr<'a>(&'a self, name: &str) {
}
}
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
let element = Element { attrs: Vec::new() };
let _ = unsafe { element.get_attr("foo") };
}
error: compilation successful
--> $DIR/issue-11740.rs:35:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | let element = Element { attrs: Vec::new() };
LL | | let _ = unsafe { element.get_attr("foo") };
LL | | }
| |_^
error: aborting due to previous error
......@@ -8,13 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
fn cb<'a,T>(_x: Box<Fn((&'a i32, &'a (Vec<&'static i32>, bool))) -> T>) -> T {
panic!()
}
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
cb(Box::new(|(k, &(ref v, b))| (*k, v.clone(), b)));
}
error: compilation successful
--> $DIR/issue-16994.rs:18:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | cb(Box::new(|(k, &(ref v, b))| (*k, v.clone(), b)));
LL | | }
| |_^
error: aborting due to previous error
......@@ -8,12 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(warnings)]
trait A<T> {}
struct B<T> where B<T>: A<B<T>> { t: T }
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
}
error: compilation successful
--> $DIR/issue-19601.rs:18:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | }
| |_^
error: aborting due to previous error
......@@ -7,9 +7,9 @@
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unboxed_closures, fn_traits, rustc_attrs)]
// skip-codegen
// compile-pass
#![feature(unboxed_closures, fn_traits)]
struct Foo;
impl<A> FnOnce<(A,)> for Foo {
......@@ -17,7 +17,7 @@ impl<A> FnOnce<(A,)> for Foo {
extern "rust-call" fn call_once(self, (_,): (A,)) {
}
}
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
println!("{:?}", Foo("bar"));
}
error: compilation successful
--> $DIR/issue-22603.rs:21:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | println!("{:?}", Foo("bar"));
LL | | }
| |_^
error: aborting due to previous error
......@@ -8,10 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unboxed_closures, fn_traits, rustc_attrs)]
#[rustc_error]
fn main() { //~ ERROR compilation successful
// compile-pass
// skip-codegen
#![feature(unboxed_closures, fn_traits)]
fn main() {
let k = |x: i32| { x + 1 };
Fn::call(&k, (0,));
}
error: compilation successful
--> $DIR/issue-22789.rs:14:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | let k = |x: i32| { x + 1 };
LL | | Fn::call(&k, (0,));
LL | | }
| |_^
error: aborting due to previous error
......@@ -8,9 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(warnings)]
struct CNFParser {
token: char,
}
......@@ -31,5 +31,5 @@ fn consume_while(&mut self, p: &Fn(char) -> bool) {
}
}
#[rustc_error]
fn main() {} //~ ERROR compilation successful
fn main() {}
error: compilation successful
--> $DIR/issue-22933-1.rs:35:1
|
LL | fn main() {} //~ ERROR compilation successful
| ^^^^^^^^^^^^
error: aborting due to previous error
......@@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
mod a {
pub mod b { pub struct Foo; }
......@@ -21,8 +21,8 @@ pub mod c {
pub use self::c::*;
}
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
let _ = a::c::Bar(a::b::Foo);
let _ = a::Bar(a::b::Foo);
}
error: compilation successful
--> $DIR/issue-24883.rs:25:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | let _ = a::c::Bar(a::b::Foo);
LL | | let _ = a::Bar(a::b::Foo);
LL | | }
| |_^
error: aborting due to previous error
......@@ -8,9 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(warnings)]
trait Mirror {
type It;
}
......@@ -20,8 +20,8 @@ impl<T> Mirror for T {
}
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
let c: <u32 as Mirror>::It = 5;
const CCCC: <u32 as Mirror>::It = 5;
}
error: compilation successful
--> $DIR/issue-26614.rs:24:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | let c: <u32 as Mirror>::It = 5;
LL | | const CCCC: <u32 as Mirror>::It = 5;
LL | | }
| |_^
error: aborting due to previous error
......@@ -8,13 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(unused)]
extern crate core;
use core as core_export;
use self::x::*;
mod x {}
#[rustc_error]
fn main() {} //~ ERROR compilation successful
fn main() {}
error: compilation successful
--> $DIR/issue-26930.rs:20:1
|
LL | fn main() {} //~ ERROR compilation successful
| ^^^^^^^^^^^^
error: aborting due to previous error
......@@ -8,8 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
use std::marker::PhantomData;
......@@ -27,5 +27,5 @@ pub trait Bar {
impl<T: 'static, W: Bar<Output = T>> Foo<*mut T> for W {}
#[rustc_error]
fn main() {} //~ ERROR compilation successful
fn main() {}
error: compilation successful
--> $DIR/issue-29857.rs:31:1
|
LL | fn main() {} //~ ERROR compilation successful
| ^^^^^^^^^^^^
error: aborting due to previous error
......@@ -8,11 +8,11 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![deny(non_snake_case)]
#[no_mangle]
pub extern "C" fn SparklingGenerationForeignFunctionInterface() {}
#[rustc_error]
fn main() {} //~ ERROR compilation successful
fn main() {}
error: compilation successful
--> $DIR/issue-31924-non-snake-ffi.rs:18:1
|
LL | fn main() {} //~ ERROR compilation successful
| ^^^^^^^^^^^^
error: aborting due to previous error
......@@ -8,9 +8,9 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(dead_code)]
pub type T = ();
mod foo { pub use super::T; }
mod bar { pub use super::T; }
......@@ -25,5 +25,5 @@ mod baz {
pub use self::bar::*;
}
#[rustc_error]
fn main() {} //~ ERROR compilation successful
fn main() {}
error: compilation successful
--> $DIR/issue-32119.rs:29:1
|
LL | fn main() {} //~ ERROR compilation successful
| ^^^^^^^^^^^^
error: aborting due to previous error
......@@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(warnings)]
mod foo {
......@@ -30,5 +31,5 @@ mod b {
pub use a::bar;
}
#[rustc_error]
fn main() {} //~ ERROR compilation successful
fn main() {}
error: compilation successful
--> $DIR/issue-32222.rs:34:1
|
LL | fn main() {} //~ ERROR compilation successful
| ^^^^^^^^^^^^
error: aborting due to previous error
......@@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
pub use bar::*;
mod bar {
......@@ -20,5 +21,5 @@ mod baz {
pub use main as f;
}
#[rustc_error]
pub fn main() {} //~ ERROR compilation successful
pub fn main() {}
error: compilation successful
--> $DIR/issue-32797.rs:24:1
|
LL | pub fn main() {} //~ ERROR compilation successful
| ^^^^^^^^^^^^^^^^
error: aborting due to previous error
......@@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(warnings)]
macro_rules! foo { () => {
......@@ -31,8 +32,8 @@
}
}
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
foo! {};
bar! {};
......
error: compilation successful
--> $DIR/issue-32922.rs:35:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | foo! {};
LL | | bar! {};
LL | |
LL | | let mut a = true;
LL | | baz!(a);
LL | | }
| |_^
error: aborting due to previous error
......@@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
use std::fmt;
......@@ -16,8 +17,8 @@
// an unsized tuple by transmuting a trait object.
fn any<T>() -> T { unreachable!() }
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
let t: &(u8, fmt::Debug) = any();
println!("{:?}", &t.1);
}
error: compilation successful
--> $DIR/issue-33241.rs:20:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | let t: &(u8, fmt::Debug) = any();
LL | | println!("{:?}", &t.1);
LL | | }
| |_^
error: aborting due to previous error
......@@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
macro_rules! m {
() => { #[cfg(any())] fn f() {} }
......@@ -17,5 +18,5 @@
trait T {}
impl T for () { m!(); }
#[rustc_error]
fn main() {} //~ ERROR compilation successful
fn main() {}
error: compilation successful
--> $DIR/issue-34028.rs:21:1
|
LL | fn main() {} //~ ERROR compilation successful
| ^^^^^^^^^^^^
error: aborting due to previous error
......@@ -8,14 +8,15 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
macro_rules! null { ($i:tt) => {} }
macro_rules! apply_null {
($i:item) => { null! { $i } }
}
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
apply_null!(#[cfg(all())] fn f() {});
}
error: compilation successful
--> $DIR/issue-34171.rs:19:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | apply_null!(#[cfg(all())] fn f() {});
LL | | }
| |_^
error: aborting due to previous error
......@@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(unused)]
macro_rules! make_item {
......@@ -27,5 +28,5 @@ fn g() {
make_stmt! {}
}
#[rustc_error]
fn main() {} //~ ERROR compilation successful
fn main() {}
error: compilation successful
--> $DIR/issue-34418.rs:31:1
|
LL | fn main() {} //~ ERROR compilation successful
| ^^^^^^^^^^^^
error: aborting due to previous error
......@@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(dead_code)]
trait RegularExpression: Sized {
......@@ -27,5 +28,5 @@ enum FindCapturesInner<'r, 't> {
Dynamic(FindCaptures<'t, ExecNoSyncStr<'r>>),
}
#[rustc_error]
fn main() {} //~ ERROR compilation successful
fn main() {}
error: compilation successful
--> $DIR/issue-34839.rs:31:1
|
LL | fn main() {} //~ ERROR compilation successful
| ^^^^^^^^^^^^
error: aborting due to previous error
......@@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
use std::mem;
......@@ -34,7 +35,7 @@ fn foo<'a>(x: &'a ()) -> <() as Lifetime<'a>>::Out {
fn takes_lifetime(_f: for<'a> fn(&'a ()) -> <() as Lifetime<'a>>::Out) {
}
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
takes_lifetime(foo);
}
error: compilation successful
--> $DIR/issue-35570.rs:38:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | takes_lifetime(foo);
LL | | }
| |_^
error: aborting due to previous error
......@@ -10,9 +10,9 @@
// Unnecessary path disambiguator is ok
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
#![allow(unused)]
macro_rules! m {
($p: path) => {
let _ = $p(0);
......@@ -33,5 +33,5 @@ fn f() {
m!(S::<u8>); // OK, no warning
}
#[rustc_error]
fn main() {} //~ ERROR compilation successful
fn main() {}
......@@ -10,11 +10,3 @@ warning: unnecessary path disambiguator
LL | let g: Foo::<i32> = Foo { _a: 42 }; //~ WARN unnecessary path disambiguator
| ^^ try removing `::`
error: compilation successful
--> $DIR/issue-36116.rs:37:1
|
LL | fn main() {} //~ ERROR compilation successful
| ^^^^^^^^^^^^
error: aborting due to previous error
......@@ -8,9 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
fn _test() -> impl Default { }
#[rustc_error]
fn main() { } //~ ERROR compilation successful
fn main() { }
error: compilation successful
--> $DIR/issue-36379.rs:16:1
|
LL | fn main() { } //~ ERROR compilation successful
| ^^^^^^^^^^^^^
error: aborting due to previous error
......@@ -8,7 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
pub trait Foo {
type Bar;
......@@ -26,7 +27,7 @@ fn broken(&self) where Self::Assoc: Foo {
}
}
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
let _m: &Broken<Assoc=()> = &();
}
error: compilation successful
--> $DIR/issue-36839.rs:30:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | let _m: &Broken<Assoc=()> = &();
LL | | }
| |_^
error: aborting due to previous error
......@@ -8,9 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs, associated_type_defaults)]
// compile-pass
// skip-codegen
#![feature(associated_type_defaults)]
#![allow(warnings)]
trait State: Sized {
type NextState: State = StateMachineEnded;
fn execute(self) -> Option<Self::NextState>;
......@@ -24,6 +25,6 @@ fn execute(self) -> Option<Self::NextState> {
}
}
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
}
error: compilation successful
--> $DIR/issue-37051.rs:28:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | }
| |_^
error: aborting due to previous error
......@@ -9,8 +9,9 @@
// except according to those terms.
// ignore-emscripten
#![feature(rustc_attrs, asm)]
// compile-pass
// skip-codegen
#![feature(asm)]
macro_rules! interrupt_handler {
() => {
......@@ -21,6 +22,6 @@ unsafe fn _interrupt_handler() {
}
interrupt_handler!{}
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
}
error: compilation successful
--> $DIR/issue-37366.rs:25:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | }
| |_^
error: aborting due to previous error
......@@ -8,12 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// compile-pass
// skip-codegen
fn foo(_: &mut i32) -> bool { true }
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
let opt = Some(92);
let mut x = 62;
......
error: compilation successful
--> $DIR/issue-37510.rs:16:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | let opt = Some(92);
LL | | let mut x = 62;
LL | |
... |
LL | | }
LL | | }
| |_^
error: aborting due to previous error
......@@ -7,13 +7,13 @@
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(rustc_attrs)]
// skip-codegen
// compile-pass
#![warn(unused)]
type Z = for<'x> Send;
//~^ WARN type alias is never used
#[rustc_error]
fn main() { //~ ERROR compilation successful
fn main() {
}
......@@ -11,12 +11,3 @@ LL | #![warn(unused)]
| ^^^^^^
= note: #[warn(dead_code)] implied by #[warn(unused)]
error: compilation successful
--> $DIR/issue-37515.rs:18:1
|
LL | / fn main() { //~ ERROR compilation successful
LL | | }
| |_^
error: aborting due to previous error
......@@ -8,9 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(associated_consts, rustc_attrs)]
// compile-pass
// skip-codegen
#![feature(associated_consts)]
#![allow(warnings)]
trait MyTrait {
const MY_CONST: &'static str;
}
......@@ -27,5 +28,5 @@ impl MyTrait for MyStruct {
my_macro!();
#[rustc_error]
fn main() {} //~ ERROR compilation successful
fn main() {}
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册