(control.$point.callback)(state);
if control.$point.stop == Compilation::Stop {
+ $tsess.abort_if_errors();
return;
}
})}
let mut feature_gated_cfgs = vec![];
krate = time(time_passes, "configuration 1", || {
- syntax::config::strip_unconfigured_items(sess.diagnostic(), krate, &mut feature_gated_cfgs)
+ sess.abort_if_new_errors(|| {
+ syntax::config::strip_unconfigured_items(sess.diagnostic(),
+ krate,
+ &mut feature_gated_cfgs)
+ })
});
*sess.crate_types.borrow_mut() = collect_crate_types(sess, &krate.attrs);
// JBC: make CFG processing part of expansion to avoid this problem:
// strip again, in case expansion added anything with a #[cfg].
- krate = time(time_passes, "configuration 2", || {
- syntax::config::strip_unconfigured_items(sess.diagnostic(), krate, &mut feature_gated_cfgs)
- });
+ krate = sess.abort_if_new_errors(|| {
+ let krate = time(time_passes, "configuration 2", || {
+ syntax::config::strip_unconfigured_items(sess.diagnostic(),
+ krate,
+ &mut feature_gated_cfgs)
+ });
- time(time_passes, "gated configuration checking", || {
- let features = sess.features.borrow();
- feature_gated_cfgs.sort();
- feature_gated_cfgs.dedup();
- for cfg in &feature_gated_cfgs {
- cfg.check_and_emit(sess.diagnostic(), &features, sess.codemap());
- }
+ time(time_passes, "gated configuration checking", || {
+ let features = sess.features.borrow();
+ feature_gated_cfgs.sort();
+ feature_gated_cfgs.dedup();
+ for cfg in &feature_gated_cfgs {
+ cfg.check_and_emit(sess.diagnostic(), &features, sess.codemap());
+ }
+ });
+
+ krate
});
krate = time(time_passes, "maybe building test harness", || {
}
// Check for unrepresentable discriminant values
match hint {
- attr::ReprAny | attr::ReprExtern => (),
+ attr::ReprAny | attr::ReprExtern => {
+ disr_vals.push(current_disr_val);
+ }
attr::ReprInt(sp, ity) => {
if !disr_in_range(ccx, ity, current_disr_val) {
let mut err = struct_span_err!(ccx.tcx.sess, v.span, E0082,
err.emit();
}
}
- attr::ReprSimd => {
- ccx.tcx.sess.bug("range_to_inttype: found ReprSimd on an enum");
- }
- attr::ReprPacked => {
- ccx.tcx.sess.bug("range_to_inttype: found ReprPacked on an enum");
- }
+ // Error reported elsewhere.
+ attr::ReprSimd | attr::ReprPacked => {}
}
- disr_vals.push(current_disr_val);
}
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![feature(stmt_expr_attributes)]
+
fn main() {
let _ = #[cfg(unset)] ();
//~^ ERROR removing an expression is not supported in this position
}
fn main() {
- let _ = foo::X;
+ let _ = foo::X; //~ ERROR unresolved name `foo::X`
}
}
fn main() { ham(); eggs(); }
+//~^ ERROR unresolved name `eggs`
mod zed {
pub fn bar() { println!("bar"); }
}
-fn main(args: Vec<String>) { bar(); }
+fn main() { bar(); }
mod zed {
pub fn bar() { println!("bar3"); }
}
-fn main(args: Vec<String>) { bar(); }
+fn main() { bar(); }
+//~^ ERROR unresolved name `bar`
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![no_std]
#![feature(macro_reexport)]
#[macro_reexport] //~ ERROR bad macro reexport
extern crate std;
-
-fn main() { }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![no_std]
#![feature(macro_reexport)]
#[macro_reexport="foo"] //~ ERROR bad macro reexport
extern crate std;
-
-fn main() { }
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![no_std]
#![feature(macro_reexport)]
#[macro_reexport(foo="bar")] //~ ERROR bad macro reexport
extern crate std;
-
-fn main() { }
// aux-build:two_macros.rs
+#![feature(macro_reexport)]
+
#[macro_use(macro_two)]
#[macro_reexport(no_way)] //~ ERROR reexported macro not found
extern crate two_macros;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![no_std]
+
#[macro_use(foo(bar))] //~ ERROR bad macro import
extern crate std;
-
-fn main() {
-}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#![no_std]
+
#[macro_use(foo="bar")] //~ ERROR bad macro import
extern crate std;
-
-fn main() {
-}
use bar::gpriv;
//~^ ERROR unresolved import `bar::gpriv`. There is no `gpriv` in `bar`
gpriv();
+ //~^ ERROR unresolved name `gpriv`
}
#[start] fn main(_: isize, _: *const *const u8) -> isize { 3 }
//~^ ERROR expected identifier, found keyword `Self`
Self!() => (),
//~^ ERROR expected identifier, found keyword `Self`
+ //~^^ ERROR macro undefined: 'Self!'
Foo { x: Self } => (),
//~^ ERROR expected identifier, found keyword `Self`
Foo { Self } => (),
Bar,
self
//~^ NOTE another `self` import appears here
+//~^^ ERROR a module named `bar` has already been imported in this module
};
use {self};