Skip to content

Commit

Permalink
s/HARD ERROR/hard error/ -- perhaps the warning is enough
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Jan 13, 2016
1 parent 0254f69 commit 5580b90
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 44 deletions.
2 changes: 1 addition & 1 deletion src/librustc/lint/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ pub fn raw_struct_lint<'a>(sess: &'a Session,
if let Some(future_incompatible) = lints.future_incompatible(LintId::of(lint)) {
let explanation = format!("this was previously accepted by the compiler \
but is being phased out, \
and will become a HARD ERROR in a future release!");
and will become a hard error in a future release!");
let citation = format!("for more information, see {}",
future_incompatible.reference);
if let Some(sp) = span {
Expand Down
4 changes: 2 additions & 2 deletions src/test/compile-fail/empty-struct-unit-pat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ fn main() { //~ ERROR: compilation successful
// }
match e1 {
Empty1(..) => () //~ WARN `Empty1` does not name a tuple variant or a tuple struct
//~^ WARN HARD ERROR
//~^ WARN hard error
}
// Rejected by parser as yet
// match e2 {
// E::Empty2() => () // ERROR `E::Empty2` does not name a tuple variant or a tuple struct
// }
match e2 {
E::Empty2(..) => () //~ WARN `E::Empty2` does not name a tuple variant or a tuple struct
//~^ WARN HARD ERROR
//~^ WARN hard error
}
}
72 changes: 36 additions & 36 deletions src/test/compile-fail/private-in-public-warn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,34 @@ mod types {
}

pub type Alias = Priv; //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
pub enum E {
V1(Priv), //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
V2 { field: Priv }, //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
}
pub trait Tr {
const C: Priv = Priv; //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
type Alias = Priv; //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
fn f1(arg: Priv) {} //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
fn f2() -> Priv { panic!() } //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
}
extern {
pub static ES: Priv; //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
pub fn ef1(arg: Priv); //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
pub fn ef2() -> Priv; //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
}
impl PubTr for Pub {
type Alias = Priv; //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
}
}

Expand All @@ -64,21 +64,21 @@ mod traits {

pub type Alias<T: PrivTr> = T; //~ WARN private trait in public interface
//~^ WARN trait bounds are not (yet) enforced in type definitions
//~| WARNING HARD ERROR
//~| WARNING hard error
pub trait Tr1: PrivTr {} //~ WARN private trait in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
pub trait Tr2<T: PrivTr> {} //~ WARN private trait in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
pub trait Tr3 {
type Alias: PrivTr; //~ WARN private trait in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
fn f<T: PrivTr>(arg: T) {} //~ WARN private trait in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
}
impl<T: PrivTr> Pub<T> {} //~ WARN private trait in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
impl<T: PrivTr> PubTr for Pub<T> {} //~ WARN private trait in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
}

mod traits_where {
Expand All @@ -87,17 +87,17 @@ mod traits_where {
pub trait PubTr {}

pub type Alias<T> where T: PrivTr = T; //~ WARN private trait in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
pub trait Tr2<T> where T: PrivTr {} //~ WARN private trait in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
pub trait Tr3 {
fn f<T>(arg: T) where T: PrivTr {} //~ WARN private trait in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
}
impl<T> Pub<T> where T: PrivTr {} //~ WARN private trait in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
impl<T> PubTr for Pub<T> where T: PrivTr {} //~ WARN private trait in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
}

mod generics {
Expand All @@ -107,13 +107,13 @@ mod generics {
pub trait PubTr<T> {}

pub trait Tr1: PrivTr<Pub> {} //~ WARN private trait in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
pub trait Tr2: PubTr<Priv> {} //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
pub trait Tr3: PubTr<[Priv; 1]> {} //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
pub trait Tr4: PubTr<Pub<Priv>> {} //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
}

mod impls {
Expand All @@ -140,7 +140,7 @@ mod impls {
}
impl PubTr for Pub {
type Alias = Priv; //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
}
}

Expand Down Expand Up @@ -207,27 +207,27 @@ mod aliases_pub {
pub trait Tr1: PrivUseAliasTr {} // OK
// This should be OK, if type aliases are substituted
pub trait Tr2: PrivUseAliasTr<PrivAlias> {} //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error

impl PrivAlias {
pub fn f(arg: Priv) {} //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
}
// This doesn't even parse
// impl <Priv as PrivTr>::AssocAlias {
// pub fn f(arg: Priv) {} // WARN private type in public interface
// }
impl PrivUseAliasTr for PrivUseAlias {
type Check = Priv; //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
}
impl PrivUseAliasTr for PrivAlias {
type Check = Priv; //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
}
impl PrivUseAliasTr for <Priv as PrivTr>::AssocAlias {
type Check = Priv; //~ WARN private type in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
}
}

Expand All @@ -250,11 +250,11 @@ mod aliases_priv {
impl PrivTr for Priv {}

pub trait Tr1: PrivUseAliasTr {} //~ WARN private trait in public interface
//~^ WARNING HARD ERROR
//~^ WARNING hard error
pub trait Tr2: PrivUseAliasTr<PrivAlias> {} //~ WARN private trait in public interface
//~^ WARN private type in public interface
//~| WARNING HARD ERROR
//~| WARNING HARD ERROR
//~| WARNING hard error
//~| WARNING hard error

impl PrivUseAlias {
pub fn f(arg: Priv) {} // OK
Expand Down
8 changes: 4 additions & 4 deletions src/test/compile-fail/private-variant-reexport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@

mod m1 {
pub use ::E::V; //~ WARN variant `V` is private, and cannot be reexported
//~^ WARNING HARD ERROR
//~^ WARNING hard error
}

mod m2 {
pub use ::E::{V}; //~ WARN variant `V` is private, and cannot be reexported
//~^ WARNING HARD ERROR
//~^ WARNING hard error
}

mod m3 {
pub use ::E::V::{self}; //~ WARN variant `V` is private, and cannot be reexported
//~^ WARNING HARD ERROR
//~^ WARNING hard error
}

mod m4 {
pub use ::E::*; //~ WARN variant `V` is private, and cannot be reexported
//~^ WARNING HARD ERROR
//~^ WARNING hard error
}

enum E { V }
Expand Down
2 changes: 1 addition & 1 deletion src/test/compile-fail/type-parameter-invalid-lint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@

fn avg<T=i32>(_: T) {}
//~^ ERROR defaults for type parameters are only allowed
//~| WARNING HARD ERROR
//~| WARNING hard error
fn main() {}

0 comments on commit 5580b90

Please sign in to comment.