From b23648fe4aa46e9a2bf72c6f68590e799c4cdb07 Mon Sep 17 00:00:00 2001 From: Ariel Ben-Yehuda Date: Tue, 5 Apr 2016 22:56:23 +0300 Subject: [PATCH] improve the printing of substs and trait-refs --- src/librustc/util/ppaux.rs | 194 ++++++++++-------- .../associated-types-for-unimpl-trait.rs | 2 +- ...ted-types-invalid-trait-ref-issue-18865.rs | 2 +- .../associated-types-no-suitable-bound.rs | 2 +- ...sociated-types-no-suitable-supertrait-2.rs | 2 +- ...associated-types-no-suitable-supertrait.rs | 4 +- .../compile-fail/associated-types-path-2.rs | 4 +- .../compile-fail/associated-types-unsized.rs | 2 +- .../compile-fail/bad-method-typaram-kind.rs | 2 +- src/test/compile-fail/bad-sized.rs | 6 +- .../builtin-superkinds-double-superkind.rs | 4 +- .../builtin-superkinds-in-metadata.rs | 2 +- .../compile-fail/builtin-superkinds-simple.rs | 2 +- .../builtin-superkinds-typaram-not-send.rs | 2 +- src/test/compile-fail/cast-rfc0401.rs | 4 +- ...bounds-cant-promote-superkind-in-struct.rs | 2 +- .../compile-fail/closure-bounds-subtype.rs | 2 +- src/test/compile-fail/cross-fn-cache-hole.rs | 2 +- .../deriving-no-inner-impl-error-message.rs | 2 +- .../deriving-span-Default-struct.rs | 2 +- .../compile-fail/destructure-trait-ref.rs | 2 +- src/test/compile-fail/dst-bad-assign-2.rs | 2 +- src/test/compile-fail/dst-bad-assign.rs | 2 +- src/test/compile-fail/dst-bad-coerce1.rs | 2 +- src/test/compile-fail/dst-bad-deep.rs | 2 +- .../dst-object-from-unsized-type.rs | 8 +- .../compile-fail/dst-sized-trait-param.rs | 4 +- .../compile-fail/extern-wrong-value-type.rs | 4 +- src/test/compile-fail/for-loop-bogosity.rs | 2 +- src/test/compile-fail/hrtb-just-for-static.rs | 2 +- .../compile-fail/hrtb-perfect-forwarding.rs | 2 +- src/test/compile-fail/ifmt-unimpl.rs | 2 +- src/test/compile-fail/impl-bounds-checking.rs | 2 +- .../compile-fail/indexing-requires-a-uint.rs | 2 +- src/test/compile-fail/issue-14084.rs | 2 +- src/test/compile-fail/issue-14366.rs | 2 +- src/test/compile-fail/issue-14853.rs | 2 +- src/test/compile-fail/issue-15756.rs | 2 +- src/test/compile-fail/issue-16538.rs | 2 +- src/test/compile-fail/issue-17651.rs | 2 +- .../compile-fail/issue-17718-static-sync.rs | 2 +- src/test/compile-fail/issue-17959.rs | 2 +- src/test/compile-fail/issue-18107.rs | 2 +- src/test/compile-fail/issue-18611.rs | 2 +- src/test/compile-fail/issue-18919.rs | 2 +- src/test/compile-fail/issue-1920-1.rs | 2 +- src/test/compile-fail/issue-1920-2.rs | 2 +- src/test/compile-fail/issue-1920-3.rs | 2 +- src/test/compile-fail/issue-20005.rs | 2 +- src/test/compile-fail/issue-20162.rs | 2 +- src/test/compile-fail/issue-20605.rs | 2 +- src/test/compile-fail/issue-21160.rs | 2 +- ...issue-21659-show-relevant-trait-impls-1.rs | 2 +- ...issue-21659-show-relevant-trait-impls-2.rs | 2 +- src/test/compile-fail/issue-21763.rs | 2 +- src/test/compile-fail/issue-22034.rs | 4 +- src/test/compile-fail/issue-25076.rs | 2 +- src/test/compile-fail/issue-2611-4.rs | 2 +- src/test/compile-fail/issue-28098.rs | 12 +- src/test/compile-fail/issue-29147.rs | 2 +- src/test/compile-fail/issue-5035-2.rs | 2 +- src/test/compile-fail/issue-5883.rs | 4 +- src/test/compile-fail/issue-7013.rs | 2 +- src/test/compile-fail/issue-7364.rs | 2 +- .../compile-fail/kindck-impl-type-params-2.rs | 2 +- src/test/compile-fail/kindck-send-unsafe.rs | 2 +- src/test/compile-fail/map-types.rs | 2 +- .../compile-fail/mutable-enum-indirect.rs | 2 +- src/test/compile-fail/no-send-res-ports.rs | 2 +- src/test/compile-fail/no_send-enum.rs | 2 +- src/test/compile-fail/no_send-rc.rs | 2 +- src/test/compile-fail/no_send-struct.rs | 2 +- src/test/compile-fail/no_share-enum.rs | 2 +- src/test/compile-fail/no_share-struct.rs | 2 +- src/test/compile-fail/not-sync.rs | 14 +- .../object-does-not-impl-trait.rs | 2 +- src/test/compile-fail/phantom-oibit.rs | 4 +- src/test/compile-fail/range-1.rs | 4 +- .../reject-specialized-drops-8142.rs | 2 +- .../compile-fail/repeat-to-run-dtor-twice.rs | 2 +- src/test/compile-fail/str-idx.rs | 2 +- src/test/compile-fail/str-mut-idx.rs | 8 +- src/test/compile-fail/substs-verbose.rs | 47 +++++ .../trait-bounds-impl-comparison-1.rs | 12 +- .../trait-bounds-impl-comparison-2.rs | 2 +- .../trait-bounds-not-on-bare-trait.rs | 2 +- .../trait-bounds-on-structs-and-enums.rs | 2 +- .../trait-coercion-generic-bad.rs | 2 +- .../trait-suggest-where-clause.rs | 22 +- .../compile-fail/traits-negative-impls.rs | 14 +- .../traits-repeated-supertrait-ambig.rs | 10 +- ...-default-trait-impl-constituent-types-2.rs | 2 +- ...ck-default-trait-impl-constituent-types.rs | 2 +- ...typeck-default-trait-impl-negation-send.rs | 2 +- ...typeck-default-trait-impl-negation-sync.rs | 6 +- .../typeck-default-trait-impl-negation.rs | 4 +- .../typeck-default-trait-impl-precedence.rs | 2 +- .../typeck-default-trait-impl-supertrait.rs | 4 +- ...default-trait-impl-trait-where-clause-2.rs | 2 +- ...k-default-trait-impl-trait-where-clause.rs | 2 +- .../typeck-unsafe-always-share.rs | 8 +- .../compile-fail/ufcs-qpath-self-mismatch.rs | 2 +- src/test/compile-fail/unsized-bare-typaram.rs | 2 +- src/test/compile-fail/unsized-enum.rs | 4 +- src/test/compile-fail/unsized-struct.rs | 4 +- .../unsized-trait-impl-trait-arg.rs | 2 +- src/test/compile-fail/unsized3.rs | 12 +- src/test/compile-fail/unsized5.rs | 12 +- src/test/compile-fail/unsized6.rs | 24 +-- src/test/compile-fail/unsized7.rs | 2 +- .../compile-fail/vtable-res-trait-param.rs | 2 +- .../wf-impl-associated-type-trait.rs | 2 +- ...constraints-are-local-for-inherent-impl.rs | 2 +- ...se-constraints-are-local-for-trait-impl.rs | 2 +- .../where-clause-method-substituion.rs | 2 +- .../where-clauses-method-unsatisfied.rs | 2 +- .../compile-fail/where-clauses-unsatisfied.rs | 2 +- src/test/compile-fail/where-for-self-2.rs | 2 +- 118 files changed, 350 insertions(+), 291 deletions(-) create mode 100644 src/test/compile-fail/substs-verbose.rs diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index 20f16a1d255c..b75f7965d1a0 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -19,6 +19,7 @@ use ty::TyClosure; use ty::{TyBox, TyTrait, TyInt, TyUint, TyInfer}; use ty::{self, Ty, TyCtxt, TypeFoldable}; +use std::cell::Cell; use std::fmt; use syntax::abi::Abi; use syntax::parse::token; @@ -67,6 +68,45 @@ pub enum Ns { Value } +fn number_of_supplied_defaults<'tcx, GG>(tcx: &ty::TyCtxt<'tcx>, + substs: &subst::Substs, + space: subst::ParamSpace, + get_generics: GG) + -> usize + where GG: FnOnce(&TyCtxt<'tcx>) -> ty::Generics<'tcx> +{ + let generics = get_generics(tcx); + + let has_self = substs.self_ty().is_some(); + let ty_params = generics.types.get_slice(space); + let tps = substs.types.get_slice(space); + if ty_params.last().map_or(false, |def| def.default.is_some()) { + let substs = tcx.lift(&substs); + ty_params.iter().zip(tps).rev().take_while(|&(def, &actual)| { + match def.default { + Some(default) => { + if !has_self && default.has_self_ty() { + // In an object type, there is no `Self`, and + // thus if the default value references Self, + // the user will be required to give an + // explicit value. We can't even do the + // substitution below to check without causing + // an ICE. (#18956). + false + } else { + let default = tcx.lift(&default); + substs.and_then(|substs| default.subst(tcx, substs)) + == Some(actual) + } + } + None => false + } + }).count() + } else { + 0 + } +} + pub fn parameterized(f: &mut fmt::Formatter, substs: &subst::Substs, did: DefId, @@ -80,8 +120,8 @@ pub fn parameterized(f: &mut fmt::Formatter, write!(f, "<{} as ", self_ty)?; } - let (fn_trait_kind, verbose, last_name) = ty::tls::with(|tcx| { - let (did, last_name) = if ns == Ns::Value { + let (fn_trait_kind, verbose, item_name) = ty::tls::with(|tcx| { + let (did, item_name) = if ns == Ns::Value { // Try to get the impl/trait parent, if this is an // associated value item (method or constant). tcx.trait_of_item(did).or_else(|| tcx.impl_of_method(did)) @@ -90,97 +130,64 @@ pub fn parameterized(f: &mut fmt::Formatter, (did, None) }; write!(f, "{}", tcx.item_path_str(did))?; - Ok((tcx.lang_items.fn_trait_kind(did), tcx.sess.verbose(), last_name)) + Ok((tcx.lang_items.fn_trait_kind(did), tcx.sess.verbose(), item_name)) })?; - let mut empty = true; - let mut start_or_continue = |f: &mut fmt::Formatter, start: &str, cont: &str| { - if empty { - empty = false; - write!(f, "{}", start) - } else { - write!(f, "{}", cont) - } - }; - - if verbose { - for region in &substs.regions { - start_or_continue(f, "<", ", ")?; - write!(f, "{:?}", region)?; - } - for &ty in &substs.types { - start_or_continue(f, "<", ", ")?; - write!(f, "{}", ty)?; - } - for projection in projections { - start_or_continue(f, "<", ", ")?; - write!(f, "{}={}", - projection.projection_ty.item_name, - projection.ty)?; - } - return start_or_continue(f, "", ">"); - } - - if fn_trait_kind.is_some() && projections.len() == 1 { + if !verbose && fn_trait_kind.is_some() && projections.len() == 1 { let projection_ty = projections[0].ty; if let TyTuple(ref args) = substs.types.get_slice(subst::TypeSpace)[0].sty { return fn_sig(f, args, false, ty::FnConverging(projection_ty)); } } - for &r in &substs.regions { - start_or_continue(f, "<", ", ")?; - let s = r.to_string(); - if s.is_empty() { - // This happens when the value of the region - // parameter is not easily serialized. This may be - // because the user omitted it in the first place, - // or because it refers to some block in the code, - // etc. I'm not sure how best to serialize this. - write!(f, "'_")?; + let empty = Cell::new(true); + let start_or_continue = |f: &mut fmt::Formatter, start: &str, cont: &str| { + if empty.get() { + empty.set(false); + write!(f, "{}", start) } else { - write!(f, "{}", s)?; + write!(f, "{}", cont) } + }; + let print_region = |f: &mut fmt::Formatter, region: &ty::Region| -> _ { + if verbose { + write!(f, "{:?}", region) + } else { + let s = region.to_string(); + if s.is_empty() { + // This happens when the value of the region + // parameter is not easily serialized. This may be + // because the user omitted it in the first place, + // or because it refers to some block in the code, + // etc. I'm not sure how best to serialize this. + write!(f, "'_") + } else { + write!(f, "{}", s) + } + } + }; + + for region in substs.regions.get_slice(subst::TypeSpace) { + start_or_continue(f, "<", ", ")?; + print_region(f, region)?; } - // It is important to execute this conditionally, only if -Z - // verbose is false. Otherwise, debug logs can sometimes cause - // ICEs trying to fetch the generics early in the pipeline. This - // is kind of a hacky workaround in that -Z verbose is required to - // avoid those ICEs. + let num_supplied_defaults = if verbose { + 0 + } else { + // It is important to execute this conditionally, only if -Z + // verbose is false. Otherwise, debug logs can sometimes cause + // ICEs trying to fetch the generics early in the pipeline. This + // is kind of a hacky workaround in that -Z verbose is required to + // avoid those ICEs. + ty::tls::with(|tcx| { + number_of_supplied_defaults(tcx, substs, subst::TypeSpace, get_generics) + }) + }; + let tps = substs.types.get_slice(subst::TypeSpace); - let num_defaults = ty::tls::with(|tcx| { - let generics = get_generics(tcx); - let has_self = substs.self_ty().is_some(); - let ty_params = generics.types.get_slice(subst::TypeSpace); - if ty_params.last().map_or(false, |def| def.default.is_some()) { - let substs = tcx.lift(&substs); - ty_params.iter().zip(tps).rev().take_while(|&(def, &actual)| { - match def.default { - Some(default) => { - if !has_self && default.has_self_ty() { - // In an object type, there is no `Self`, and - // thus if the default value references Self, - // the user will be required to give an - // explicit value. We can't even do the - // substitution below to check without causing - // an ICE. (#18956). - false - } else { - let default = tcx.lift(&default); - substs.and_then(|substs| default.subst(tcx, substs)) == Some(actual) - } - } - None => false - } - }).count() - } else { - 0 - } - }); - - for &ty in &tps[..tps.len() - num_defaults] { + for &ty in &tps[..tps.len() - num_supplied_defaults] { start_or_continue(f, "<", ", ")?; write!(f, "{}", ty)?; } @@ -196,21 +203,28 @@ pub fn parameterized(f: &mut fmt::Formatter, // For values, also print their name and type parameters. if ns == Ns::Value { + empty.set(true); + if substs.self_ty().is_some() { write!(f, ">")?; } - if let Some(name) = last_name { - write!(f, "::{}", name)?; + if let Some(item_name) = item_name { + write!(f, "::{}", item_name)?; } - let tps = substs.types.get_slice(subst::FnSpace); - if !tps.is_empty() { - write!(f, "::<{}", tps[0])?; - for ty in &tps[1..] { - write!(f, ", {}", ty)?; - } - write!(f, ">")?; + + for region in substs.regions.get_slice(subst::FnSpace) { + start_or_continue(f, "::<", ", ")?; + print_region(f, region)?; } + + // FIXME: consider being smart with defaults here too + for ty in substs.types.get_slice(subst::FnSpace) { + start_or_continue(f, "::<", ", ")?; + write!(f, "{}", ty)?; + } + + start_or_continue(f, "", ">")?; } Ok(()) @@ -997,9 +1011,7 @@ impl<'tcx> fmt::Debug for ty::TraitPredicate<'tcx> { impl<'tcx> fmt::Display for ty::TraitPredicate<'tcx> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{} : {}", - self.trait_ref.self_ty(), - self.trait_ref) + write!(f, "{}: {}", self.trait_ref.self_ty(), self.trait_ref) } } diff --git a/src/test/compile-fail/associated-types-for-unimpl-trait.rs b/src/test/compile-fail/associated-types-for-unimpl-trait.rs index 9fa24850e037..a6fcb9cff13e 100644 --- a/src/test/compile-fail/associated-types-for-unimpl-trait.rs +++ b/src/test/compile-fail/associated-types-for-unimpl-trait.rs @@ -15,7 +15,7 @@ trait Get { trait Other { fn uhoh(&self, foo: U, bar: ::Value) {} - //~^ ERROR the trait bound `Self : Get` is not satisfied + //~^ ERROR the trait bound `Self: Get` is not satisfied } fn main() { diff --git a/src/test/compile-fail/associated-types-invalid-trait-ref-issue-18865.rs b/src/test/compile-fail/associated-types-invalid-trait-ref-issue-18865.rs index 18d9ea52ff25..83726a1676d2 100644 --- a/src/test/compile-fail/associated-types-invalid-trait-ref-issue-18865.rs +++ b/src/test/compile-fail/associated-types-invalid-trait-ref-issue-18865.rs @@ -18,7 +18,7 @@ trait Foo { fn f>(t: &T) { let u: >::Bar = t.get_bar(); - //~^ ERROR the trait bound `T : Foo` is not satisfied + //~^ ERROR the trait bound `T: Foo` is not satisfied } fn main() { } diff --git a/src/test/compile-fail/associated-types-no-suitable-bound.rs b/src/test/compile-fail/associated-types-no-suitable-bound.rs index 0aafd193c90d..baf56ffec869 100644 --- a/src/test/compile-fail/associated-types-no-suitable-bound.rs +++ b/src/test/compile-fail/associated-types-no-suitable-bound.rs @@ -19,7 +19,7 @@ struct Struct { impl Struct { fn uhoh(foo: ::Value) {} - //~^ ERROR the trait bound `T : Get` is not satisfied + //~^ ERROR the trait bound `T: Get` is not satisfied } fn main() { diff --git a/src/test/compile-fail/associated-types-no-suitable-supertrait-2.rs b/src/test/compile-fail/associated-types-no-suitable-supertrait-2.rs index 225ee0857013..e0f0f3c47ae5 100644 --- a/src/test/compile-fail/associated-types-no-suitable-supertrait-2.rs +++ b/src/test/compile-fail/associated-types-no-suitable-supertrait-2.rs @@ -25,7 +25,7 @@ trait Get { trait Other { fn uhoh(&self, foo: U, bar: ::Value) {} - //~^ ERROR the trait bound `Self : Get` is not satisfied + //~^ ERROR the trait bound `Self: Get` is not satisfied } fn main() { } diff --git a/src/test/compile-fail/associated-types-no-suitable-supertrait.rs b/src/test/compile-fail/associated-types-no-suitable-supertrait.rs index fe519beef672..ec38595e8fe0 100644 --- a/src/test/compile-fail/associated-types-no-suitable-supertrait.rs +++ b/src/test/compile-fail/associated-types-no-suitable-supertrait.rs @@ -25,12 +25,12 @@ trait Get { trait Other { fn uhoh(&self, foo: U, bar: ::Value) {} - //~^ ERROR the trait bound `Self : Get` is not satisfied + //~^ ERROR the trait bound `Self: Get` is not satisfied } impl Other for T { fn uhoh(&self, foo: U, bar: <(T, U) as Get>::Value) {} - //~^ ERROR the trait bound `(T, U) : Get` is not satisfied + //~^ ERROR the trait bound `(T, U): Get` is not satisfied } fn main() { } diff --git a/src/test/compile-fail/associated-types-path-2.rs b/src/test/compile-fail/associated-types-path-2.rs index ee228899bb37..0c077e37e43b 100644 --- a/src/test/compile-fail/associated-types-path-2.rs +++ b/src/test/compile-fail/associated-types-path-2.rs @@ -38,12 +38,12 @@ pub fn f1_int_uint() { pub fn f1_uint_uint() { f1(2u32, 4u32); - //~^ ERROR `u32 : Foo` is not satisfied + //~^ ERROR `u32: Foo` is not satisfied } pub fn f1_uint_int() { f1(2u32, 4i32); - //~^ ERROR `u32 : Foo` is not satisfied + //~^ ERROR `u32: Foo` is not satisfied } pub fn f2_int() { diff --git a/src/test/compile-fail/associated-types-unsized.rs b/src/test/compile-fail/associated-types-unsized.rs index 468b40e69718..f18270229641 100644 --- a/src/test/compile-fail/associated-types-unsized.rs +++ b/src/test/compile-fail/associated-types-unsized.rs @@ -14,7 +14,7 @@ trait Get { } fn foo(t: T) { - let x = t.get(); //~ ERROR `::Value : std::marker::Sized` is not + let x = t.get(); //~ ERROR `::Value: std::marker::Sized` is not } fn main() { diff --git a/src/test/compile-fail/bad-method-typaram-kind.rs b/src/test/compile-fail/bad-method-typaram-kind.rs index 4de6600f2d24..5be90f050183 100644 --- a/src/test/compile-fail/bad-method-typaram-kind.rs +++ b/src/test/compile-fail/bad-method-typaram-kind.rs @@ -9,7 +9,7 @@ // except according to those terms. fn foo() { - 1.bar::(); //~ ERROR `T : std::marker::Send` is not satisfied + 1.bar::(); //~ ERROR `T: std::marker::Send` is not satisfied } trait bar { diff --git a/src/test/compile-fail/bad-sized.rs b/src/test/compile-fail/bad-sized.rs index d25d0081c566..f62404e60e69 100644 --- a/src/test/compile-fail/bad-sized.rs +++ b/src/test/compile-fail/bad-sized.rs @@ -12,7 +12,7 @@ trait Trait {} pub fn main() { let x: Vec = Vec::new(); - //~^ ERROR `Trait + Sized : std::marker::Sized` is not satisfied - //~| ERROR `Trait + Sized : std::marker::Sized` is not satisfied - //~| ERROR `Trait + Sized : std::marker::Sized` is not satisfied + //~^ ERROR `Trait + Sized: std::marker::Sized` is not satisfied + //~| ERROR `Trait + Sized: std::marker::Sized` is not satisfied + //~| ERROR `Trait + Sized: std::marker::Sized` is not satisfied } diff --git a/src/test/compile-fail/builtin-superkinds-double-superkind.rs b/src/test/compile-fail/builtin-superkinds-double-superkind.rs index 03ab94e5908f..8d5d8e8dc9b7 100644 --- a/src/test/compile-fail/builtin-superkinds-double-superkind.rs +++ b/src/test/compile-fail/builtin-superkinds-double-superkind.rs @@ -13,9 +13,9 @@ trait Foo : Send+Sync { } -impl Foo for (T,) { } //~ ERROR `T : std::marker::Send` is not satisfied +impl Foo for (T,) { } //~ ERROR `T: std::marker::Send` is not satisfied -impl Foo for (T,T) { } //~ ERROR `T : std::marker::Sync` is not satisfied +impl Foo for (T,T) { } //~ ERROR `T: std::marker::Sync` is not satisfied impl Foo for (T,T,T) { } // (ok) diff --git a/src/test/compile-fail/builtin-superkinds-in-metadata.rs b/src/test/compile-fail/builtin-superkinds-in-metadata.rs index 1063280ea265..de2084c4e818 100644 --- a/src/test/compile-fail/builtin-superkinds-in-metadata.rs +++ b/src/test/compile-fail/builtin-superkinds-in-metadata.rs @@ -22,6 +22,6 @@ struct X(T); impl RequiresShare for X { } impl RequiresRequiresShareAndSend for X { } -//~^ ERROR `T : std::marker::Send` is not satisfied +//~^ ERROR `T: std::marker::Send` is not satisfied fn main() { } diff --git a/src/test/compile-fail/builtin-superkinds-simple.rs b/src/test/compile-fail/builtin-superkinds-simple.rs index 40625fc82aa9..6dc5f39cb30d 100644 --- a/src/test/compile-fail/builtin-superkinds-simple.rs +++ b/src/test/compile-fail/builtin-superkinds-simple.rs @@ -14,6 +14,6 @@ trait Foo : Send { } impl Foo for std::rc::Rc { } -//~^ ERROR `std::rc::Rc : std::marker::Send` is not satisfied +//~^ ERROR `std::rc::Rc: std::marker::Send` is not satisfied fn main() { } diff --git a/src/test/compile-fail/builtin-superkinds-typaram-not-send.rs b/src/test/compile-fail/builtin-superkinds-typaram-not-send.rs index 7e05c6462ffa..d4bb8de13d05 100644 --- a/src/test/compile-fail/builtin-superkinds-typaram-not-send.rs +++ b/src/test/compile-fail/builtin-superkinds-typaram-not-send.rs @@ -12,6 +12,6 @@ trait Foo : Send { } -impl Foo for T { } //~ ERROR `T : std::marker::Send` is not satisfied +impl Foo for T { } //~ ERROR `T: std::marker::Send` is not satisfied fn main() { } diff --git a/src/test/compile-fail/cast-rfc0401.rs b/src/test/compile-fail/cast-rfc0401.rs index c032fb43402f..dcd49e34bb26 100644 --- a/src/test/compile-fail/cast-rfc0401.rs +++ b/src/test/compile-fail/cast-rfc0401.rs @@ -91,7 +91,7 @@ fn main() let _ = 42usize as *const [u8]; //~ ERROR casting let _ = v as *const [u8]; //~ ERROR cannot cast let _ = fat_v as *const Foo; - //~^ ERROR the trait bound `[u8] : std::marker::Sized` is not satisfied + //~^ ERROR the trait bound `[u8]: std::marker::Sized` is not satisfied //~^^ HELP run `rustc --explain E0277` to see a detailed explanation //~^^^ NOTE `[u8]` does not have a constant size known at compile-time //~^^^^ NOTE required for the cast to the object type `Foo` @@ -106,7 +106,7 @@ fn main() let a : *const str = "hello"; let _ = a as *const Foo; - //~^ ERROR the trait bound `str : std::marker::Sized` is not satisfied + //~^ ERROR the trait bound `str: std::marker::Sized` is not satisfied //~^^ HELP run `rustc --explain E0277` to see a detailed explanation //~^^^ NOTE `str` does not have a constant size known at compile-time //~^^^^ NOTE required for the cast to the object type `Foo` diff --git a/src/test/compile-fail/closure-bounds-cant-promote-superkind-in-struct.rs b/src/test/compile-fail/closure-bounds-cant-promote-superkind-in-struct.rs index ed18ed62111c..b9224e7be7f1 100644 --- a/src/test/compile-fail/closure-bounds-cant-promote-superkind-in-struct.rs +++ b/src/test/compile-fail/closure-bounds-cant-promote-superkind-in-struct.rs @@ -13,7 +13,7 @@ struct X where F: FnOnce() + 'static + Send { } fn foo(blk: F) -> X where F: FnOnce() + 'static { - //~^ ERROR `F : std::marker::Send` is not satisfied + //~^ ERROR `F: std::marker::Send` is not satisfied return X { field: blk }; } diff --git a/src/test/compile-fail/closure-bounds-subtype.rs b/src/test/compile-fail/closure-bounds-subtype.rs index b618cd07760d..d3339c4845ab 100644 --- a/src/test/compile-fail/closure-bounds-subtype.rs +++ b/src/test/compile-fail/closure-bounds-subtype.rs @@ -21,7 +21,7 @@ fn give_any(f: F) where F: FnOnce() { fn give_owned(f: F) where F: FnOnce() + Send { take_any(f); - take_const_owned(f); //~ ERROR `F : std::marker::Sync` is not satisfied + take_const_owned(f); //~ ERROR `F: std::marker::Sync` is not satisfied } fn main() {} diff --git a/src/test/compile-fail/cross-fn-cache-hole.rs b/src/test/compile-fail/cross-fn-cache-hole.rs index 0a3ce03f27bf..b034fedb805e 100644 --- a/src/test/compile-fail/cross-fn-cache-hole.rs +++ b/src/test/compile-fail/cross-fn-cache-hole.rs @@ -23,7 +23,7 @@ trait Bar { } // We don't always check where clauses for sanity, but in this case // wfcheck does report an error here: -fn vacuous() //~ ERROR the trait bound `i32 : Bar` is not satisfied +fn vacuous() //~ ERROR the trait bound `i32: Bar` is not satisfied where i32: Foo { // ... the original intention was to check that we don't use that diff --git a/src/test/compile-fail/deriving-no-inner-impl-error-message.rs b/src/test/compile-fail/deriving-no-inner-impl-error-message.rs index d767fc326362..129c859b9195 100644 --- a/src/test/compile-fail/deriving-no-inner-impl-error-message.rs +++ b/src/test/compile-fail/deriving-no-inner-impl-error-message.rs @@ -18,7 +18,7 @@ struct E { #[derive(Clone)] struct C { x: NoCloneOrEq - //~^ ERROR `NoCloneOrEq : std::clone::Clone` is not satisfied + //~^ ERROR `NoCloneOrEq: std::clone::Clone` is not satisfied } diff --git a/src/test/compile-fail/deriving-span-Default-struct.rs b/src/test/compile-fail/deriving-span-Default-struct.rs index 6b81804e028b..56fb38611735 100644 --- a/src/test/compile-fail/deriving-span-Default-struct.rs +++ b/src/test/compile-fail/deriving-span-Default-struct.rs @@ -17,7 +17,7 @@ struct Error; #[derive(Default)] struct Struct { - x: Error //~ ERROR `Error : std::default::Default` is not satisfied + x: Error //~ ERROR `Error: std::default::Default` is not satisfied } fn main() {} diff --git a/src/test/compile-fail/destructure-trait-ref.rs b/src/test/compile-fail/destructure-trait-ref.rs index 3e6428c7d579..68d979571024 100644 --- a/src/test/compile-fail/destructure-trait-ref.rs +++ b/src/test/compile-fail/destructure-trait-ref.rs @@ -35,7 +35,7 @@ fn main() { // n == m let &x = &1isize as &T; //~ ERROR type `&T` cannot be dereferenced let &&x = &(&1isize as &T); //~ ERROR type `&T` cannot be dereferenced - let box x = box 1isize as Box; //~ ERROR `T : std::marker::Sized` is not satisfied + let box x = box 1isize as Box; //~ ERROR `T: std::marker::Sized` is not satisfied // n > m let &&x = &1isize as &T; diff --git a/src/test/compile-fail/dst-bad-assign-2.rs b/src/test/compile-fail/dst-bad-assign-2.rs index 6e2380da6a13..241fabf053c0 100644 --- a/src/test/compile-fail/dst-bad-assign-2.rs +++ b/src/test/compile-fail/dst-bad-assign-2.rs @@ -44,5 +44,5 @@ pub fn main() { // FIXME (#22405): Replace `Box::new` with `box` here when/if possible. let z: Box = Box::new(Bar1 {f: 36}); f5.ptr = *z; - //~^ ERROR `ToBar : std::marker::Sized` is not satisfied + //~^ ERROR `ToBar: std::marker::Sized` is not satisfied } diff --git a/src/test/compile-fail/dst-bad-assign.rs b/src/test/compile-fail/dst-bad-assign.rs index ab874d4e877c..2d21d0ebc760 100644 --- a/src/test/compile-fail/dst-bad-assign.rs +++ b/src/test/compile-fail/dst-bad-assign.rs @@ -49,5 +49,5 @@ pub fn main() { //~| found `Bar1` //~| expected trait ToBar //~| found struct `Bar1` - //~| ERROR `ToBar : std::marker::Sized` is not satisfied + //~| ERROR `ToBar: std::marker::Sized` is not satisfied } diff --git a/src/test/compile-fail/dst-bad-coerce1.rs b/src/test/compile-fail/dst-bad-coerce1.rs index 2413bbae84c0..9a3ea54a3a45 100644 --- a/src/test/compile-fail/dst-bad-coerce1.rs +++ b/src/test/compile-fail/dst-bad-coerce1.rs @@ -28,5 +28,5 @@ pub fn main() { let f1 = Fat { ptr: Foo }; let f2: &Fat = &f1; let f3: &Fat = f2; - //~^ ERROR `Foo : Bar` is not satisfied + //~^ ERROR `Foo: Bar` is not satisfied } diff --git a/src/test/compile-fail/dst-bad-deep.rs b/src/test/compile-fail/dst-bad-deep.rs index 0b9d99396f7c..f508364d7511 100644 --- a/src/test/compile-fail/dst-bad-deep.rs +++ b/src/test/compile-fail/dst-bad-deep.rs @@ -21,5 +21,5 @@ pub fn main() { let f: Fat<[isize; 3]> = Fat { ptr: [5, 6, 7] }; let g: &Fat<[isize]> = &f; let h: &Fat> = &Fat { ptr: *g }; - //~^ ERROR `[isize] : std::marker::Sized` is not satisfied + //~^ ERROR `[isize]: std::marker::Sized` is not satisfied } diff --git a/src/test/compile-fail/dst-object-from-unsized-type.rs b/src/test/compile-fail/dst-object-from-unsized-type.rs index 36bd1a98ca91..8fafd78d4079 100644 --- a/src/test/compile-fail/dst-object-from-unsized-type.rs +++ b/src/test/compile-fail/dst-object-from-unsized-type.rs @@ -16,22 +16,22 @@ impl Foo for [u8] {} fn test1(t: &T) { let u: &Foo = t; - //~^ ERROR `T : std::marker::Sized` is not satisfied + //~^ ERROR `T: std::marker::Sized` is not satisfied } fn test2(t: &T) { let v: &Foo = t as &Foo; - //~^ ERROR `T : std::marker::Sized` is not satisfied + //~^ ERROR `T: std::marker::Sized` is not satisfied } fn test3() { let _: &[&Foo] = &["hi"]; - //~^ ERROR `str : std::marker::Sized` is not satisfied + //~^ ERROR `str: std::marker::Sized` is not satisfied } fn test4(x: &[u8]) { let _: &Foo = x as &Foo; - //~^ ERROR `[u8] : std::marker::Sized` is not satisfied + //~^ ERROR `[u8]: std::marker::Sized` is not satisfied } fn main() { } diff --git a/src/test/compile-fail/dst-sized-trait-param.rs b/src/test/compile-fail/dst-sized-trait-param.rs index 375008715635..bd5fd3ee3b71 100644 --- a/src/test/compile-fail/dst-sized-trait-param.rs +++ b/src/test/compile-fail/dst-sized-trait-param.rs @@ -15,9 +15,9 @@ trait Foo : Sized { fn take(self, x: &T) { } } // Note: T is sized impl Foo<[isize]> for usize { } -//~^ ERROR `[isize] : std::marker::Sized` is not satisfied +//~^ ERROR `[isize]: std::marker::Sized` is not satisfied impl Foo for [usize] { } -//~^ ERROR `[usize] : std::marker::Sized` is not satisfied +//~^ ERROR `[usize]: std::marker::Sized` is not satisfied pub fn main() { } diff --git a/src/test/compile-fail/extern-wrong-value-type.rs b/src/test/compile-fail/extern-wrong-value-type.rs index 89ed960c8913..576368aef312 100644 --- a/src/test/compile-fail/extern-wrong-value-type.rs +++ b/src/test/compile-fail/extern-wrong-value-type.rs @@ -17,6 +17,6 @@ fn main() { // extern functions are extern "C" fn let _x: extern "C" fn() = f; // OK is_fn(f); - //~^ ERROR `extern "C" fn() {f} : std::ops::Fn<()>` is not satisfied - //~| ERROR `extern "C" fn() {f} : std::ops::FnOnce<()>` is not satisfied + //~^ ERROR `extern "C" fn() {f}: std::ops::Fn<()>` is not satisfied + //~| ERROR `extern "C" fn() {f}: std::ops::FnOnce<()>` is not satisfied } diff --git a/src/test/compile-fail/for-loop-bogosity.rs b/src/test/compile-fail/for-loop-bogosity.rs index 8b127ca17958..96ad184fd355 100644 --- a/src/test/compile-fail/for-loop-bogosity.rs +++ b/src/test/compile-fail/for-loop-bogosity.rs @@ -24,7 +24,7 @@ pub fn main() { x: 1, y: 2, }; - for x in bogus { //~ ERROR `MyStruct : std::iter::Iterator` + for x in bogus { //~ ERROR `MyStruct: std::iter::Iterator` is not satisfied drop(x); } } diff --git a/src/test/compile-fail/hrtb-just-for-static.rs b/src/test/compile-fail/hrtb-just-for-static.rs index 270e6b9f183a..aec950f992cf 100644 --- a/src/test/compile-fail/hrtb-just-for-static.rs +++ b/src/test/compile-fail/hrtb-just-for-static.rs @@ -31,7 +31,7 @@ fn give_any() { struct StaticInt; impl Foo<&'static isize> for StaticInt { } fn give_static() { - want_hrtb::() //~ ERROR `for<'a> StaticInt : Foo<&'a isize>` is not satisfied + want_hrtb::() //~ ERROR `for<'a> StaticInt: Foo<&'a isize>` is not satisfied } fn main() { } diff --git a/src/test/compile-fail/hrtb-perfect-forwarding.rs b/src/test/compile-fail/hrtb-perfect-forwarding.rs index 24e59e6c29e3..fcfbeefced06 100644 --- a/src/test/compile-fail/hrtb-perfect-forwarding.rs +++ b/src/test/compile-fail/hrtb-perfect-forwarding.rs @@ -53,7 +53,7 @@ fn foo_hrtb_bar_not<'b,T>(mut t: T) // be implemented. Thus to satisfy `&mut T : for<'a> Foo<&'a // isize>`, we require `T : for<'a> Bar<&'a isize>`, but the where // clause only specifies `T : Bar<&'b isize>`. - foo_hrtb_bar_not(&mut t); //~ ERROR `for<'a> T : Bar<&'a isize>` is not satisfied + foo_hrtb_bar_not(&mut t); //~ ERROR `for<'a> T: Bar<&'a isize>` is not satisfied } fn foo_hrtb_bar_hrtb(mut t: T) diff --git a/src/test/compile-fail/ifmt-unimpl.rs b/src/test/compile-fail/ifmt-unimpl.rs index dd14d0c91545..9b9bae92c33c 100644 --- a/src/test/compile-fail/ifmt-unimpl.rs +++ b/src/test/compile-fail/ifmt-unimpl.rs @@ -10,5 +10,5 @@ fn main() { format!("{:X}", "3"); - //~^ ERROR: `str : std::fmt::UpperHex` is not satisfied + //~^ ERROR: `str: std::fmt::UpperHex` is not satisfied } diff --git a/src/test/compile-fail/impl-bounds-checking.rs b/src/test/compile-fail/impl-bounds-checking.rs index 12696585a9e6..f90365b71ae5 100644 --- a/src/test/compile-fail/impl-bounds-checking.rs +++ b/src/test/compile-fail/impl-bounds-checking.rs @@ -17,7 +17,7 @@ trait Getter { fn get(&self) -> T; } -impl Getter for isize { //~ ERROR `isize : Clone2` is not satisfied +impl Getter for isize { //~ ERROR `isize: Clone2` is not satisfied fn get(&self) -> isize { *self } } diff --git a/src/test/compile-fail/indexing-requires-a-uint.rs b/src/test/compile-fail/indexing-requires-a-uint.rs index f8979686038b..354d7b936485 100644 --- a/src/test/compile-fail/indexing-requires-a-uint.rs +++ b/src/test/compile-fail/indexing-requires-a-uint.rs @@ -13,7 +13,7 @@ fn main() { fn bar(_: T) {} - [0][0u8]; //~ ERROR: `[_] : std::ops::Index` is not satisfied + [0][0u8]; //~ ERROR: `[_]: std::ops::Index` is not satisfied [0][0]; // should infer to be a usize diff --git a/src/test/compile-fail/issue-14084.rs b/src/test/compile-fail/issue-14084.rs index 20da46dcaa29..446514c8dd45 100644 --- a/src/test/compile-fail/issue-14084.rs +++ b/src/test/compile-fail/issue-14084.rs @@ -13,5 +13,5 @@ fn main() { () <- 0; - //~^ ERROR: `() : std::ops::Placer<_>` is not satisfied + //~^ ERROR: `(): std::ops::Placer<_>` is not satisfied } diff --git a/src/test/compile-fail/issue-14366.rs b/src/test/compile-fail/issue-14366.rs index 6f4e9887dc6e..84452accc9a4 100644 --- a/src/test/compile-fail/issue-14366.rs +++ b/src/test/compile-fail/issue-14366.rs @@ -10,5 +10,5 @@ fn main() { let _x = "test" as &::std::any::Any; -//~^ ERROR `str : std::marker::Sized` is not satisfied +//~^ ERROR `str: std::marker::Sized` is not satisfied } diff --git a/src/test/compile-fail/issue-14853.rs b/src/test/compile-fail/issue-14853.rs index c6c1a0fd1778..c4d882670329 100644 --- a/src/test/compile-fail/issue-14853.rs +++ b/src/test/compile-fail/issue-14853.rs @@ -20,7 +20,7 @@ struct X { data: u32 } impl Something for X { fn yay(_:Option, thing: &[T]) { - //~^ ERROR the requirement `T : Str` appears on the impl method + //~^ ERROR the requirement `T: Str` appears on the impl method } } diff --git a/src/test/compile-fail/issue-15756.rs b/src/test/compile-fail/issue-15756.rs index 790000a3f923..41349d7d7443 100644 --- a/src/test/compile-fail/issue-15756.rs +++ b/src/test/compile-fail/issue-15756.rs @@ -15,7 +15,7 @@ fn dft_iter<'a, T>(arg1: Chunks<'a,T>, arg2: ChunksMut<'a,T>) { for &mut something -//~^ ERROR `[T] : std::marker::Sized` is not satisfied +//~^ ERROR `[T]: std::marker::Sized` is not satisfied in arg2 { } diff --git a/src/test/compile-fail/issue-16538.rs b/src/test/compile-fail/issue-16538.rs index 79d2224aad6f..6c41450796c7 100644 --- a/src/test/compile-fail/issue-16538.rs +++ b/src/test/compile-fail/issue-16538.rs @@ -19,7 +19,7 @@ mod Y { } static foo: *const Y::X = Y::foo(Y::x as *const Y::X); -//~^ ERROR `*const usize : std::marker::Sync` is not satisfied +//~^ ERROR `*const usize: std::marker::Sync` is not satisfied //~| ERROR cannot refer to other statics by value, use the address-of operator or a constant instead //~| ERROR E0015 diff --git a/src/test/compile-fail/issue-17651.rs b/src/test/compile-fail/issue-17651.rs index edd9b6e0c066..0fe01ece558e 100644 --- a/src/test/compile-fail/issue-17651.rs +++ b/src/test/compile-fail/issue-17651.rs @@ -14,5 +14,5 @@ fn main() { // FIXME (#22405): Replace `Box::new` with `box` here when/if possible. (|| Box::new(*(&[0][..])))(); - //~^ ERROR `[_] : std::marker::Sized` is not satisfied + //~^ ERROR `[_]: std::marker::Sized` is not satisfied } diff --git a/src/test/compile-fail/issue-17718-static-sync.rs b/src/test/compile-fail/issue-17718-static-sync.rs index 1bb3b7941352..790329cd2e42 100644 --- a/src/test/compile-fail/issue-17718-static-sync.rs +++ b/src/test/compile-fail/issue-17718-static-sync.rs @@ -17,6 +17,6 @@ impl !Sync for Foo {} static FOO: usize = 3; static BAR: Foo = Foo; -//~^ ERROR: `Foo : std::marker::Sync` is not satisfied +//~^ ERROR: `Foo: std::marker::Sync` is not satisfied fn main() {} diff --git a/src/test/compile-fail/issue-17959.rs b/src/test/compile-fail/issue-17959.rs index 56a66ecc8aa4..23be4d353611 100644 --- a/src/test/compile-fail/issue-17959.rs +++ b/src/test/compile-fail/issue-17959.rs @@ -19,7 +19,7 @@ struct G { } impl Drop for G { -//~^ ERROR: The requirement `T : core::marker::Sized` is added only by the Drop impl. [E0367] +//~^ ERROR: The requirement `T: core::marker::Sized` is added only by the Drop impl. [E0367] fn drop(&mut self) { if !self._ptr.is_null() { } diff --git a/src/test/compile-fail/issue-18107.rs b/src/test/compile-fail/issue-18107.rs index 6b40811bf04f..33d68c121bf2 100644 --- a/src/test/compile-fail/issue-18107.rs +++ b/src/test/compile-fail/issue-18107.rs @@ -12,7 +12,7 @@ pub trait AbstractRenderer {} fn _create_render(_: &()) -> AbstractRenderer -//~^ ERROR: `AbstractRenderer + 'static : std::marker::Sized` is not satisfied +//~^ ERROR: `AbstractRenderer + 'static: std::marker::Sized` is not satisfied { match 0 { _ => unimplemented!() diff --git a/src/test/compile-fail/issue-18611.rs b/src/test/compile-fail/issue-18611.rs index 5318b18be5c7..a3ad76e1be06 100644 --- a/src/test/compile-fail/issue-18611.rs +++ b/src/test/compile-fail/issue-18611.rs @@ -9,7 +9,7 @@ // except according to those terms. fn add_state(op: ::State) { -//~^ ERROR `isize : HasState` is not satisfied +//~^ ERROR `isize: HasState` is not satisfied } trait HasState { diff --git a/src/test/compile-fail/issue-18919.rs b/src/test/compile-fail/issue-18919.rs index 2742162de531..3e21360721b6 100644 --- a/src/test/compile-fail/issue-18919.rs +++ b/src/test/compile-fail/issue-18919.rs @@ -11,7 +11,7 @@ type FuncType<'f> = Fn(&isize) -> isize + 'f; fn ho_func(f: Option) { - //~^ ERROR: `for<'r> std::ops::Fn(&'r isize) -> isize : std::marker::Sized` is not satisfied + //~^ ERROR: `for<'r> std::ops::Fn(&'r isize) -> isize: std::marker::Sized` is not satisfied } fn main() {} diff --git a/src/test/compile-fail/issue-1920-1.rs b/src/test/compile-fail/issue-1920-1.rs index f37693d8a584..8fbe4432204a 100644 --- a/src/test/compile-fail/issue-1920-1.rs +++ b/src/test/compile-fail/issue-1920-1.rs @@ -18,5 +18,5 @@ fn assert_clone() where T : Clone { } fn main() { assert_clone::(); - //~^ ERROR `foo::core::sync::atomic::AtomicBool : foo::core::clone::Clone` is not satisfied + //~^ ERROR `foo::core::sync::atomic::AtomicBool: foo::core::clone::Clone` is not satisfied } diff --git a/src/test/compile-fail/issue-1920-2.rs b/src/test/compile-fail/issue-1920-2.rs index c8d7bcaecf93..02c925f336ea 100644 --- a/src/test/compile-fail/issue-1920-2.rs +++ b/src/test/compile-fail/issue-1920-2.rs @@ -16,5 +16,5 @@ fn assert_clone() where T : Clone { } fn main() { assert_clone::(); - //~^ ERROR `bar::sync::atomic::AtomicBool : bar::clone::Clone` is not satisfied + //~^ ERROR `bar::sync::atomic::AtomicBool: bar::clone::Clone` is not satisfied } diff --git a/src/test/compile-fail/issue-1920-3.rs b/src/test/compile-fail/issue-1920-3.rs index c0252deda24c..dfec48e0a83c 100644 --- a/src/test/compile-fail/issue-1920-3.rs +++ b/src/test/compile-fail/issue-1920-3.rs @@ -20,5 +20,5 @@ fn assert_clone() where T : Clone { } fn main() { assert_clone::(); - //~^ ERROR `core::sync::atomic::AtomicBool : core::clone::Clone` is not satisfied + //~^ ERROR `core::sync::atomic::AtomicBool: core::clone::Clone` is not satisfied } diff --git a/src/test/compile-fail/issue-20005.rs b/src/test/compile-fail/issue-20005.rs index a54fc0a314b6..b02757fb5a31 100644 --- a/src/test/compile-fail/issue-20005.rs +++ b/src/test/compile-fail/issue-20005.rs @@ -15,7 +15,7 @@ trait From { } trait To { - fn to( //~ ERROR `Self : std::marker::Sized` is not satisfied + fn to( //~ ERROR `Self: std::marker::Sized` is not satisfied self ) -> >::Result where Dst: From { From::from(self) diff --git a/src/test/compile-fail/issue-20162.rs b/src/test/compile-fail/issue-20162.rs index 5e60e2a36f62..b2f3a2da5161 100644 --- a/src/test/compile-fail/issue-20162.rs +++ b/src/test/compile-fail/issue-20162.rs @@ -13,5 +13,5 @@ struct X { x: i32 } fn main() { let mut b: Vec = vec![]; b.sort(); - //~^ ERROR `X : std::cmp::Ord` is not satisfied + //~^ ERROR `X: std::cmp::Ord` is not satisfied } diff --git a/src/test/compile-fail/issue-20605.rs b/src/test/compile-fail/issue-20605.rs index 2634370fe902..b7c544c78483 100644 --- a/src/test/compile-fail/issue-20605.rs +++ b/src/test/compile-fail/issue-20605.rs @@ -10,7 +10,7 @@ fn changer<'a>(mut things: Box>) { for item in *things { *item = 0 } -//~^ ERROR `std::iter::Iterator : std::marker::Sized` is not satisfied +//~^ ERROR `std::iter::Iterator: std::marker::Sized` is not satisfied } fn main() {} diff --git a/src/test/compile-fail/issue-21160.rs b/src/test/compile-fail/issue-21160.rs index 7d9ae0543c75..0de0ab2269bf 100644 --- a/src/test/compile-fail/issue-21160.rs +++ b/src/test/compile-fail/issue-21160.rs @@ -16,6 +16,6 @@ impl Bar { #[derive(Hash)] struct Foo(Bar); -//~^ error: `Bar : std::hash::Hash` is not satisfied +//~^ error: `Bar: std::hash::Hash` is not satisfied fn main() {} diff --git a/src/test/compile-fail/issue-21659-show-relevant-trait-impls-1.rs b/src/test/compile-fail/issue-21659-show-relevant-trait-impls-1.rs index 7bc4adfa85d0..e880a8b212bb 100644 --- a/src/test/compile-fail/issue-21659-show-relevant-trait-impls-1.rs +++ b/src/test/compile-fail/issue-21659-show-relevant-trait-impls-1.rs @@ -32,7 +32,7 @@ fn main() { let f1 = Bar; f1.foo(1usize); - //~^ error: the trait bound `Bar : Foo` is not satisfied + //~^ error: the trait bound `Bar: Foo` is not satisfied //~| help: the following implementations were found: //~| help: > //~| help: > diff --git a/src/test/compile-fail/issue-21659-show-relevant-trait-impls-2.rs b/src/test/compile-fail/issue-21659-show-relevant-trait-impls-2.rs index f4e536144720..2c5b18a8113f 100644 --- a/src/test/compile-fail/issue-21659-show-relevant-trait-impls-2.rs +++ b/src/test/compile-fail/issue-21659-show-relevant-trait-impls-2.rs @@ -36,7 +36,7 @@ fn main() { let f1 = Bar; f1.foo(1usize); - //~^ error: the trait bound `Bar : Foo` is not satisfied + //~^ error: the trait bound `Bar: Foo` is not satisfied //~| help: the following implementations were found: //~| help: > //~| help: > diff --git a/src/test/compile-fail/issue-21763.rs b/src/test/compile-fail/issue-21763.rs index 2f0611a2086e..cb0baee0a878 100644 --- a/src/test/compile-fail/issue-21763.rs +++ b/src/test/compile-fail/issue-21763.rs @@ -17,5 +17,5 @@ fn foo() {} fn main() { foo::, Rc<()>>>(); - //~^ ERROR: `std::rc::Rc<()> : std::marker::Send` is not satisfied + //~^ ERROR: `std::rc::Rc<()>: std::marker::Send` is not satisfied } diff --git a/src/test/compile-fail/issue-22034.rs b/src/test/compile-fail/issue-22034.rs index 29bef8c966a4..3e0ab6d89212 100644 --- a/src/test/compile-fail/issue-22034.rs +++ b/src/test/compile-fail/issue-22034.rs @@ -14,7 +14,7 @@ fn main() { let ptr: *mut () = 0 as *mut _; let _: &mut Fn() = unsafe { &mut *(ptr as *mut Fn()) - //~^ ERROR `() : std::ops::Fn<()>` is not satisfied - //~| ERROR `() : std::ops::FnOnce<()>` is not satisfied + //~^ ERROR `(): std::ops::Fn<()>` is not satisfied + //~| ERROR `(): std::ops::FnOnce<()>` is not satisfied }; } diff --git a/src/test/compile-fail/issue-25076.rs b/src/test/compile-fail/issue-25076.rs index 9d0b559d13d3..1c255b4e6314 100644 --- a/src/test/compile-fail/issue-25076.rs +++ b/src/test/compile-fail/issue-25076.rs @@ -17,5 +17,5 @@ fn do_fold>(init: B, f: F) {} fn bot() -> T { loop {} } fn main() { - do_fold(bot(), ()); //~ ERROR `() : InOut<_>` is not satisfied + do_fold(bot(), ()); //~ ERROR `(): InOut<_>` is not satisfied } diff --git a/src/test/compile-fail/issue-2611-4.rs b/src/test/compile-fail/issue-2611-4.rs index 49f024399c7e..16d7ea468466 100644 --- a/src/test/compile-fail/issue-2611-4.rs +++ b/src/test/compile-fail/issue-2611-4.rs @@ -21,7 +21,7 @@ struct E { impl A for E { fn b(&self, _x: F) -> F { panic!() } - //~^ ERROR `F : std::marker::Sync` appears on the impl method + //~^ ERROR `F: std::marker::Sync` appears on the impl method } fn main() {} diff --git a/src/test/compile-fail/issue-28098.rs b/src/test/compile-fail/issue-28098.rs index aac282370c64..5dded2b1e169 100644 --- a/src/test/compile-fail/issue-28098.rs +++ b/src/test/compile-fail/issue-28098.rs @@ -10,13 +10,13 @@ fn main() { let _ = Iterator::next(&mut ()); - //~^ ERROR `() : std::iter::Iterator` is not satisfied + //~^ ERROR `(): std::iter::Iterator` is not satisfied for _ in false {} - //~^ ERROR `bool : std::iter::Iterator` is not satisfied + //~^ ERROR `bool: std::iter::Iterator` is not satisfied let _ = Iterator::next(&mut ()); - //~^ ERROR `() : std::iter::Iterator` is not satisfied + //~^ ERROR `(): std::iter::Iterator` is not satisfied other() } @@ -25,11 +25,11 @@ pub fn other() { // check errors are still reported globally let _ = Iterator::next(&mut ()); - //~^ ERROR `() : std::iter::Iterator` is not satisfied + //~^ ERROR `(): std::iter::Iterator` is not satisfied let _ = Iterator::next(&mut ()); - //~^ ERROR `() : std::iter::Iterator` is not satisfied + //~^ ERROR `(): std::iter::Iterator` is not satisfied for _ in false {} - //~^ ERROR `bool : std::iter::Iterator` is not satisfied + //~^ ERROR `bool: std::iter::Iterator` is not satisfied } diff --git a/src/test/compile-fail/issue-29147.rs b/src/test/compile-fail/issue-29147.rs index 64bfa232f3ff..0ecaa409412a 100644 --- a/src/test/compile-fail/issue-29147.rs +++ b/src/test/compile-fail/issue-29147.rs @@ -28,5 +28,5 @@ impl Foo for S5 { fn xxx(&self) {} } impl Foo for S5 { fn xxx(&self) {} } fn main() { - let _ = >::xxx; //~ ERROR cannot resolve `S5<_> : Foo` + let _ = >::xxx; //~ ERROR cannot resolve `S5<_>: Foo` } diff --git a/src/test/compile-fail/issue-5035-2.rs b/src/test/compile-fail/issue-5035-2.rs index 118644ef2cb6..83ff95cc2ea4 100644 --- a/src/test/compile-fail/issue-5035-2.rs +++ b/src/test/compile-fail/issue-5035-2.rs @@ -11,6 +11,6 @@ trait I {} type K = I+'static; -fn foo(_x: K) {} //~ ERROR: `I + 'static : std::marker::Sized` is not satisfied +fn foo(_x: K) {} //~ ERROR: `I + 'static: std::marker::Sized` is not satisfied fn main() {} diff --git a/src/test/compile-fail/issue-5883.rs b/src/test/compile-fail/issue-5883.rs index 0058d5af62e4..019a7bdc734d 100644 --- a/src/test/compile-fail/issue-5883.rs +++ b/src/test/compile-fail/issue-5883.rs @@ -15,8 +15,8 @@ struct Struct { } fn new_struct(r: A+'static) - -> Struct { //~^ ERROR `A + 'static : std::marker::Sized` is not satisfied - //~^ ERROR `A + 'static : std::marker::Sized` is not satisfied + -> Struct { //~^ ERROR `A + 'static: std::marker::Sized` is not satisfied + //~^ ERROR `A + 'static: std::marker::Sized` is not satisfied Struct { r: r } } diff --git a/src/test/compile-fail/issue-7013.rs b/src/test/compile-fail/issue-7013.rs index c676c95ad25e..95bbd4eccf4f 100644 --- a/src/test/compile-fail/issue-7013.rs +++ b/src/test/compile-fail/issue-7013.rs @@ -34,5 +34,5 @@ struct A { fn main() { let a = A {v: box B{v: None} as Box}; - //~^ ERROR `std::rc::Rc> : std::marker::Send` is not satisfied + //~^ ERROR `std::rc::Rc>: std::marker::Send` is not satisfied } diff --git a/src/test/compile-fail/issue-7364.rs b/src/test/compile-fail/issue-7364.rs index 8d4ebbe72071..16b407baad17 100644 --- a/src/test/compile-fail/issue-7364.rs +++ b/src/test/compile-fail/issue-7364.rs @@ -16,6 +16,6 @@ use std::cell::RefCell; // Regression test for issue 7364 static boxed: Box> = box RefCell::new(0); //~^ ERROR allocations are not allowed in statics -//~| ERROR `std::cell::RefCell : std::marker::Sync` is not satisfied +//~| ERROR `std::cell::RefCell: std::marker::Sync` is not satisfied fn main() { } diff --git a/src/test/compile-fail/kindck-impl-type-params-2.rs b/src/test/compile-fail/kindck-impl-type-params-2.rs index cf51e9bd6081..1cf970e150d7 100644 --- a/src/test/compile-fail/kindck-impl-type-params-2.rs +++ b/src/test/compile-fail/kindck-impl-type-params-2.rs @@ -21,5 +21,5 @@ fn take_param(foo: &T) { } fn main() { let x: Box<_> = box 3; take_param(&x); - //~^ ERROR `Box<_> : std::marker::Copy` is not satisfied + //~^ ERROR `Box<_>: std::marker::Copy` is not satisfied } diff --git a/src/test/compile-fail/kindck-send-unsafe.rs b/src/test/compile-fail/kindck-send-unsafe.rs index c7eca74f7800..ecee2e0a4c63 100644 --- a/src/test/compile-fail/kindck-send-unsafe.rs +++ b/src/test/compile-fail/kindck-send-unsafe.rs @@ -14,7 +14,7 @@ fn assert_send() { } fn test71<'a>() { assert_send::<*mut &'a isize>(); - //~^ ERROR `*mut &'a isize : core::marker::Send` is not satisfied + //~^ ERROR `*mut &'a isize: core::marker::Send` is not satisfied } fn main() { diff --git a/src/test/compile-fail/map-types.rs b/src/test/compile-fail/map-types.rs index b2957a71a56c..a419c6480e6a 100644 --- a/src/test/compile-fail/map-types.rs +++ b/src/test/compile-fail/map-types.rs @@ -28,5 +28,5 @@ fn main() { let x: Box> = x; // FIXME (#22405): Replace `Box::new` with `box` here when/if possible. let y: Box> = Box::new(x); - //~^ ERROR `Box> : Map` is not satisfied + //~^ ERROR `Box>: Map` is not satisfied } diff --git a/src/test/compile-fail/mutable-enum-indirect.rs b/src/test/compile-fail/mutable-enum-indirect.rs index bb2fdbc555b7..cafcabe6279b 100644 --- a/src/test/compile-fail/mutable-enum-indirect.rs +++ b/src/test/compile-fail/mutable-enum-indirect.rs @@ -24,5 +24,5 @@ fn bar(_: T) {} fn main() { let x = Foo::A(NoSync); - bar(&x); //~ ERROR `NoSync : std::marker::Sync` is not satisfied + bar(&x); //~ ERROR `NoSync: std::marker::Sync` is not satisfied } diff --git a/src/test/compile-fail/no-send-res-ports.rs b/src/test/compile-fail/no-send-res-ports.rs index 81d174256ee2..334952cefa6e 100644 --- a/src/test/compile-fail/no-send-res-ports.rs +++ b/src/test/compile-fail/no-send-res-ports.rs @@ -33,7 +33,7 @@ fn main() { let x = foo(Port(Rc::new(()))); thread::spawn(move|| { - //~^ ERROR `std::rc::Rc<()> : std::marker::Send` is not satisfied + //~^ ERROR `std::rc::Rc<()>: std::marker::Send` is not satisfied let y = x; println!("{:?}", y); }); diff --git a/src/test/compile-fail/no_send-enum.rs b/src/test/compile-fail/no_send-enum.rs index 966d932f2a41..902710e96e27 100644 --- a/src/test/compile-fail/no_send-enum.rs +++ b/src/test/compile-fail/no_send-enum.rs @@ -24,5 +24,5 @@ fn bar(_: T) {} fn main() { let x = Foo::A(NoSend); bar(x); - //~^ ERROR `NoSend : std::marker::Send` is not satisfied + //~^ ERROR `NoSend: std::marker::Send` is not satisfied } diff --git a/src/test/compile-fail/no_send-rc.rs b/src/test/compile-fail/no_send-rc.rs index b6c7e1ad05af..69f6fcdc4afa 100644 --- a/src/test/compile-fail/no_send-rc.rs +++ b/src/test/compile-fail/no_send-rc.rs @@ -15,5 +15,5 @@ fn bar(_: T) {} fn main() { let x = Rc::new(5); bar(x); - //~^ ERROR `std::rc::Rc<_> : std::marker::Send` is not satisfied + //~^ ERROR `std::rc::Rc<_>: std::marker::Send` is not satisfied } diff --git a/src/test/compile-fail/no_send-struct.rs b/src/test/compile-fail/no_send-struct.rs index 037753e6c5fa..b2ca4f9f5db1 100644 --- a/src/test/compile-fail/no_send-struct.rs +++ b/src/test/compile-fail/no_send-struct.rs @@ -23,5 +23,5 @@ fn bar(_: T) {} fn main() { let x = Foo { a: 5 }; bar(x); - //~^ ERROR `Foo : std::marker::Send` is not satisfied + //~^ ERROR `Foo: std::marker::Send` is not satisfied } diff --git a/src/test/compile-fail/no_share-enum.rs b/src/test/compile-fail/no_share-enum.rs index be52dd418264..ae9a25a95b4e 100644 --- a/src/test/compile-fail/no_share-enum.rs +++ b/src/test/compile-fail/no_share-enum.rs @@ -22,5 +22,5 @@ fn bar(_: T) {} fn main() { let x = Foo::A(NoSync); bar(x); - //~^ ERROR `NoSync : std::marker::Sync` is not satisfied + //~^ ERROR `NoSync: std::marker::Sync` is not satisfied } diff --git a/src/test/compile-fail/no_share-struct.rs b/src/test/compile-fail/no_share-struct.rs index 944bcb48ab05..d64d37a2f6c3 100644 --- a/src/test/compile-fail/no_share-struct.rs +++ b/src/test/compile-fail/no_share-struct.rs @@ -20,5 +20,5 @@ fn bar(_: T) {} fn main() { let x = Foo { a: 5 }; bar(x); - //~^ ERROR `Foo : std::marker::Sync` is not satisfied + //~^ ERROR `Foo: std::marker::Sync` is not satisfied } diff --git a/src/test/compile-fail/not-sync.rs b/src/test/compile-fail/not-sync.rs index 3955e3a040c5..aa7a83a7baac 100644 --- a/src/test/compile-fail/not-sync.rs +++ b/src/test/compile-fail/not-sync.rs @@ -16,19 +16,19 @@ fn test() {} fn main() { test::>(); - //~^ ERROR `std::cell::Cell : std::marker::Sync` is not satisfied + //~^ ERROR `std::cell::Cell: std::marker::Sync` is not satisfied test::>(); - //~^ ERROR `std::cell::RefCell : std::marker::Sync` is not satisfied + //~^ ERROR `std::cell::RefCell: std::marker::Sync` is not satisfied test::>(); - //~^ ERROR `std::rc::Rc : std::marker::Sync` is not satisfied + //~^ ERROR `std::rc::Rc: std::marker::Sync` is not satisfied test::>(); - //~^ ERROR `std::rc::Weak : std::marker::Sync` is not satisfied + //~^ ERROR `std::rc::Weak: std::marker::Sync` is not satisfied test::>(); - //~^ ERROR `std::sync::mpsc::Receiver : std::marker::Sync` is not satisfied + //~^ ERROR `std::sync::mpsc::Receiver: std::marker::Sync` is not satisfied test::>(); - //~^ ERROR `std::sync::mpsc::Sender : std::marker::Sync` is not satisfied + //~^ ERROR `std::sync::mpsc::Sender: std::marker::Sync` is not satisfied test::>(); - //~^ ERROR `std::sync::mpsc::SyncSender : std::marker::Sync` is not satisfied + //~^ ERROR `std::sync::mpsc::SyncSender: std::marker::Sync` is not satisfied } diff --git a/src/test/compile-fail/object-does-not-impl-trait.rs b/src/test/compile-fail/object-does-not-impl-trait.rs index 6673a87e9e4e..6fa261dea71c 100644 --- a/src/test/compile-fail/object-does-not-impl-trait.rs +++ b/src/test/compile-fail/object-does-not-impl-trait.rs @@ -14,5 +14,5 @@ trait Foo {} fn take_foo(f: F) {} fn take_object(f: Box) { take_foo(f); } -//~^ ERROR `Box : Foo` is not satisfied +//~^ ERROR `Box: Foo` is not satisfied fn main() {} diff --git a/src/test/compile-fail/phantom-oibit.rs b/src/test/compile-fail/phantom-oibit.rs index 0006b29979ca..c84927ea2663 100644 --- a/src/test/compile-fail/phantom-oibit.rs +++ b/src/test/compile-fail/phantom-oibit.rs @@ -31,11 +31,11 @@ struct Nested(T); fn is_zen(_: T) {} fn not_sync(x: Guard) { - is_zen(x) //~ error: `T : std::marker::Sync` is not satisfied + is_zen(x) //~ error: `T: std::marker::Sync` is not satisfied } fn nested_not_sync(x: Nested>) { - is_zen(x) //~ error: `T : std::marker::Sync` is not satisfied + is_zen(x) //~ error: `T: std::marker::Sync` is not satisfied } fn main() {} diff --git a/src/test/compile-fail/range-1.rs b/src/test/compile-fail/range-1.rs index 25b7465a1641..895d2450cfed 100644 --- a/src/test/compile-fail/range-1.rs +++ b/src/test/compile-fail/range-1.rs @@ -22,6 +22,6 @@ pub fn main() { // Unsized type. let arr: &[_] = &[1, 2, 3]; let range = *arr..; - //~^ ERROR `[_] : std::marker::Sized` is not satisfied - //~| ERROR `[_] : std::marker::Sized` is not satisfied + //~^ ERROR `[_]: std::marker::Sized` is not satisfied + //~| ERROR `[_]: std::marker::Sized` is not satisfied } diff --git a/src/test/compile-fail/reject-specialized-drops-8142.rs b/src/test/compile-fail/reject-specialized-drops-8142.rs index b12e26fddf6d..adc870224037 100644 --- a/src/test/compile-fail/reject-specialized-drops-8142.rs +++ b/src/test/compile-fail/reject-specialized-drops-8142.rs @@ -47,7 +47,7 @@ impl Drop for P { fn drop(&mut self) { } } // REJECT //~^ ERROR Implementations of Drop cannot be specialized impl Drop for Q { fn drop(&mut self) { } } // REJECT -//~^ ERROR The requirement `Adds_bnd : Bound` is added only by the Drop impl. +//~^ ERROR The requirement `Adds_bnd: Bound` is added only by the Drop impl. impl<'rbnd,Adds_rbnd:'rbnd> Drop for R { fn drop(&mut self) { } } // REJECT //~^ ERROR The requirement `Adds_rbnd : 'rbnd` is added only by the Drop impl. diff --git a/src/test/compile-fail/repeat-to-run-dtor-twice.rs b/src/test/compile-fail/repeat-to-run-dtor-twice.rs index 3553d0dab312..88441594a7e9 100644 --- a/src/test/compile-fail/repeat-to-run-dtor-twice.rs +++ b/src/test/compile-fail/repeat-to-run-dtor-twice.rs @@ -25,5 +25,5 @@ impl Drop for Foo { fn main() { let a = Foo { x: 3 }; let _ = [ a; 5 ]; - //~^ ERROR `Foo : std::marker::Copy` is not satisfied + //~^ ERROR `Foo: std::marker::Copy` is not satisfied } diff --git a/src/test/compile-fail/str-idx.rs b/src/test/compile-fail/str-idx.rs index 61fa3cbfe69e..b972a09b5c49 100644 --- a/src/test/compile-fail/str-idx.rs +++ b/src/test/compile-fail/str-idx.rs @@ -10,5 +10,5 @@ pub fn main() { let s: &str = "hello"; - let c: u8 = s[4]; //~ ERROR `str : std::ops::Index<_>` is not satisfied + let c: u8 = s[4]; //~ ERROR `str: std::ops::Index<_>` is not satisfied } diff --git a/src/test/compile-fail/str-mut-idx.rs b/src/test/compile-fail/str-mut-idx.rs index f372a17e045c..8851e5e07973 100644 --- a/src/test/compile-fail/str-mut-idx.rs +++ b/src/test/compile-fail/str-mut-idx.rs @@ -12,11 +12,11 @@ fn bot() -> T { loop {} } fn mutate(s: &mut str) { s[1..2] = bot(); - //~^ ERROR `str : std::marker::Sized` is not satisfied - //~| ERROR `str : std::marker::Sized` is not satisfied + //~^ ERROR `str: std::marker::Sized` is not satisfied + //~| ERROR `str: std::marker::Sized` is not satisfied s[1usize] = bot(); - //~^ ERROR `str : std::ops::Index` is not satisfied - //~| ERROR `str : std::ops::IndexMut` is not satisfied + //~^ ERROR `str: std::ops::Index` is not satisfied + //~| ERROR `str: std::ops::IndexMut` is not satisfied } pub fn main() {} diff --git a/src/test/compile-fail/substs-verbose.rs b/src/test/compile-fail/substs-verbose.rs new file mode 100644 index 000000000000..0ee7e67bebb1 --- /dev/null +++ b/src/test/compile-fail/substs-verbose.rs @@ -0,0 +1,47 @@ +// Copyright 2016 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 or the MIT license +// , at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. +// +// compile-flags: -Z verbose + +// TODO nikomatsakis: test with both verbose and without + +trait Foo<'b, 'c, S=u32> { + fn bar<'a, T>() where T: 'a {} + fn baz() {} +} + +impl<'a,'b,T,S> Foo<'a, 'b, S> for T {} + +fn main() {} + +fn foo<'z>() where &'z (): Sized { + let x: () = >::bar::<'static, char>; + //~^ ERROR mismatched types + //~| expected `()` + //~| found `fn() {>::bar::}` + + let x: () = >::bar::<'static, char>; + //~^ ERROR mismatched types + //~| expected `()` + //~| found `fn() {>::bar::}` + + let x: () = >::baz; + //~^ ERROR mismatched types + //~| expected `()` + //~| found `fn() {>::baz}` + + let x: () = foo::<'static>; + //~^ ERROR mismatched types + //~| expected `()` + //~| found `fn() {foo::}` + + >::bar; + //~^ ERROR `str: std::marker::Sized` is not satisfied +} diff --git a/src/test/compile-fail/trait-bounds-impl-comparison-1.rs b/src/test/compile-fail/trait-bounds-impl-comparison-1.rs index fd0c2ddb5025..3fffb2e19f28 100644 --- a/src/test/compile-fail/trait-bounds-impl-comparison-1.rs +++ b/src/test/compile-fail/trait-bounds-impl-comparison-1.rs @@ -34,15 +34,15 @@ trait Foo { impl Foo for isize { // invalid bound for T, was defined as Eq in trait fn test_error1_fn(&self) {} - //~^ ERROR the requirement `T : std::cmp::Ord` appears on the impl + //~^ ERROR the requirement `T: std::cmp::Ord` appears on the impl // invalid bound for T, was defined as Eq + Ord in trait fn test_error2_fn(&self) {} - //~^ ERROR the requirement `T : B` appears on the impl + //~^ ERROR the requirement `T: B` appears on the impl // invalid bound for T, was defined as Eq + Ord in trait fn test_error3_fn(&self) {} - //~^ ERROR the requirement `T : B` appears on the impl + //~^ ERROR the requirement `T: B` appears on the impl // multiple bounds, same order as in trait fn test3_fn(&self) {} @@ -52,16 +52,16 @@ impl Foo for isize { // parameters in impls must be equal or more general than in the defining trait fn test_error5_fn(&self) {} - //~^ ERROR the requirement `T : B` appears on the impl + //~^ ERROR the requirement `T: B` appears on the impl // bound `std::cmp::Eq` not enforced by this implementation, but this is OK fn test6_fn(&self) {} fn test_error7_fn(&self) {} - //~^ ERROR the requirement `T : std::cmp::Eq` appears on the impl + //~^ ERROR the requirement `T: std::cmp::Eq` appears on the impl fn test_error8_fn(&self) {} - //~^ ERROR the requirement `T : C` appears on the impl + //~^ ERROR the requirement `T: C` appears on the impl } trait Getter { diff --git a/src/test/compile-fail/trait-bounds-impl-comparison-2.rs b/src/test/compile-fail/trait-bounds-impl-comparison-2.rs index 01910939a80e..8d587b29ba98 100644 --- a/src/test/compile-fail/trait-bounds-impl-comparison-2.rs +++ b/src/test/compile-fail/trait-bounds-impl-comparison-2.rs @@ -21,7 +21,7 @@ trait IteratorUtil: Sized impl> IteratorUtil for T { fn zip>(self, other: U) -> ZipIterator { - //~^ ERROR the requirement `U : Iterator` appears on the impl method + //~^ ERROR the requirement `U: Iterator` appears on the impl method ZipIterator{a: self, b: other} } } diff --git a/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs b/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs index 0a771ecf63f1..fd46d1a62962 100644 --- a/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs +++ b/src/test/compile-fail/trait-bounds-not-on-bare-trait.rs @@ -15,7 +15,7 @@ trait Foo { // This should emit the less confusing error, not the more confusing one. fn foo(_x: Foo + Send) { - //~^ ERROR `Foo + Send + 'static : std::marker::Sized` is not satisfied + //~^ ERROR `Foo + Send + 'static: std::marker::Sized` is not satisfied } fn main() { } diff --git a/src/test/compile-fail/trait-bounds-on-structs-and-enums.rs b/src/test/compile-fail/trait-bounds-on-structs-and-enums.rs index 8dd38544d3c9..24e2418e8d45 100644 --- a/src/test/compile-fail/trait-bounds-on-structs-and-enums.rs +++ b/src/test/compile-fail/trait-bounds-on-structs-and-enums.rs @@ -21,7 +21,7 @@ enum Bar { } impl Foo { -//~^ ERROR `T : Trait` is not satisfied +//~^ ERROR `T: Trait` is not satisfied fn uhoh() {} } diff --git a/src/test/compile-fail/trait-coercion-generic-bad.rs b/src/test/compile-fail/trait-coercion-generic-bad.rs index 85c26368f9f2..dd64085f6f66 100644 --- a/src/test/compile-fail/trait-coercion-generic-bad.rs +++ b/src/test/compile-fail/trait-coercion-generic-bad.rs @@ -25,6 +25,6 @@ impl Trait<&'static str> for Struct { fn main() { // FIXME (#22405): Replace `Box::new` with `box` here when/if possible. let s: Box> = Box::new(Struct { person: "Fred" }); - //~^ ERROR `Struct : Trait` is not satisfied + //~^ ERROR `Struct: Trait` is not satisfied s.f(1); } diff --git a/src/test/compile-fail/trait-suggest-where-clause.rs b/src/test/compile-fail/trait-suggest-where-clause.rs index 8827cccd0f36..6950bce7304c 100644 --- a/src/test/compile-fail/trait-suggest-where-clause.rs +++ b/src/test/compile-fail/trait-suggest-where-clause.rs @@ -15,49 +15,49 @@ struct Misc(T); fn check() { // suggest a where-clause, if needed mem::size_of::(); - //~^ ERROR `U : std::marker::Sized` is not satisfied + //~^ ERROR `U: std::marker::Sized` is not satisfied //~| HELP E0277 - //~| HELP consider adding a `where U : std::marker::Sized` bound + //~| HELP consider adding a `where U: std::marker::Sized` bound //~| NOTE required by `std::mem::size_of` mem::size_of::>(); - //~^ ERROR `U : std::marker::Sized` is not satisfied + //~^ ERROR `U: std::marker::Sized` is not satisfied //~| HELP E0277 - //~| HELP consider adding a `where U : std::marker::Sized` bound + //~| HELP consider adding a `where U: std::marker::Sized` bound //~| NOTE required because it appears within the type `Misc` //~| NOTE required by `std::mem::size_of` // ... even if T occurs as a type parameter >::from; - //~^ ERROR `u64 : std::convert::From` is not satisfied + //~^ ERROR `u64: std::convert::From` is not satisfied //~| HELP E0277 - //~| HELP consider adding a `where u64 : std::convert::From` bound + //~| HELP consider adding a `where u64: std::convert::From` bound //~| NOTE required by `std::convert::From::from` ::Item>>::from; - //~^ ERROR `u64 : std::convert::From<::Item>` is not satisfied + //~^ ERROR `u64: std::convert::From<::Item>` is not satisfied //~| HELP E0277 - //~| HELP consider adding a `where u64 : + //~| HELP consider adding a `where u64: //~| NOTE required by `std::convert::From::from` // ... but not if there are inference variables as From>::from; - //~^ ERROR `Misc<_> : std::convert::From` is not satisfied + //~^ ERROR `Misc<_>: std::convert::From` is not satisfied //~| HELP E0277 //~| NOTE required by `std::convert::From::from` // ... and also not if the error is not related to the type mem::size_of::<[T]>(); - //~^ ERROR `[T] : std::marker::Sized` is not satisfied + //~^ ERROR `[T]: std::marker::Sized` is not satisfied //~| HELP E0277 //~| NOTE `[T]` does not have a constant size //~| NOTE required by `std::mem::size_of` mem::size_of::<[&U]>(); - //~^ ERROR `[&U] : std::marker::Sized` is not satisfied + //~^ ERROR `[&U]: std::marker::Sized` is not satisfied //~| HELP E0277 //~| NOTE `[&U]` does not have a constant size //~| NOTE required by `std::mem::size_of` diff --git a/src/test/compile-fail/traits-negative-impls.rs b/src/test/compile-fail/traits-negative-impls.rs index 4a266dd07e6b..8014f92e1734 100644 --- a/src/test/compile-fail/traits-negative-impls.rs +++ b/src/test/compile-fail/traits-negative-impls.rs @@ -31,8 +31,8 @@ fn dummy() { impl !Send for TestType {} Outer(TestType); - //~^ ERROR `dummy::TestType : std::marker::Send` is not satisfied - //~| ERROR `dummy::TestType : std::marker::Send` is not satisfied + //~^ ERROR `dummy::TestType: std::marker::Send` is not satisfied + //~| ERROR `dummy::TestType: std::marker::Send` is not satisfied } fn dummy1b() { @@ -40,7 +40,7 @@ fn dummy1b() { impl !Send for TestType {} is_send(TestType); - //~^ ERROR `dummy1b::TestType : std::marker::Send` is not satisfied + //~^ ERROR `dummy1b::TestType: std::marker::Send` is not satisfied } fn dummy1c() { @@ -48,7 +48,7 @@ fn dummy1c() { impl !Send for TestType {} is_send((8, TestType)); - //~^ ERROR `dummy1c::TestType : std::marker::Send` is not satisfied + //~^ ERROR `dummy1c::TestType: std::marker::Send` is not satisfied } fn dummy2() { @@ -56,7 +56,7 @@ fn dummy2() { impl !Send for TestType {} is_send(Box::new(TestType)); - //~^ ERROR `dummy2::TestType : std::marker::Send` is not satisfied + //~^ ERROR `dummy2::TestType: std::marker::Send` is not satisfied } fn dummy3() { @@ -64,7 +64,7 @@ fn dummy3() { impl !Send for TestType {} is_send(Box::new(Outer2(TestType))); - //~^ ERROR `dummy3::TestType : std::marker::Send` is not satisfied + //~^ ERROR `dummy3::TestType: std::marker::Send` is not satisfied } fn main() { @@ -74,5 +74,5 @@ fn main() { // This will complain about a missing Send impl because `Sync` is implement *just* // for T that are `Send`. Look at #20366 and #19950 is_sync(Outer2(TestType)); - //~^ ERROR `main::TestType : std::marker::Send` is not satisfied + //~^ ERROR `main::TestType: std::marker::Send` is not satisfied } diff --git a/src/test/compile-fail/traits-repeated-supertrait-ambig.rs b/src/test/compile-fail/traits-repeated-supertrait-ambig.rs index 244f75a35926..3fc0d638dd6f 100644 --- a/src/test/compile-fail/traits-repeated-supertrait-ambig.rs +++ b/src/test/compile-fail/traits-repeated-supertrait-ambig.rs @@ -33,21 +33,21 @@ impl CompareTo for i64 { impl CompareToInts for i64 { } fn with_obj(c: &CompareToInts) -> bool { - c.same_as(22) //~ ERROR `CompareToInts : CompareTo` is not satisfied + c.same_as(22) //~ ERROR `CompareToInts: CompareTo` is not satisfied } fn with_trait(c: &C) -> bool { - c.same_as(22) //~ ERROR `C : CompareTo` is not satisfied + c.same_as(22) //~ ERROR `C: CompareTo` is not satisfied } fn with_ufcs1(c: &C) -> bool { - CompareToInts::same_as(c, 22) //~ ERROR `CompareToInts : CompareTo` is not satisfied + CompareToInts::same_as(c, 22) //~ ERROR `CompareToInts: CompareTo` is not satisfied } fn with_ufcs2(c: &C) -> bool { - CompareTo::same_as(c, 22) //~ ERROR `C : CompareTo` is not satisfied + CompareTo::same_as(c, 22) //~ ERROR `C: CompareTo` is not satisfied } fn main() { - assert_eq!(22_i64.same_as(22), true); //~ ERROR `i64 : CompareTo` is not satisfied + assert_eq!(22_i64.same_as(22), true); //~ ERROR `i64: CompareTo` is not satisfied } diff --git a/src/test/compile-fail/typeck-default-trait-impl-constituent-types-2.rs b/src/test/compile-fail/typeck-default-trait-impl-constituent-types-2.rs index 93800d3907a6..8a46d6c76c30 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-constituent-types-2.rs +++ b/src/test/compile-fail/typeck-default-trait-impl-constituent-types-2.rs @@ -26,5 +26,5 @@ fn main() { is_mytrait::(); is_mytrait::<(MyS2, MyS)>(); - //~^ ERROR `MyS2 : MyTrait` is not satisfied + //~^ ERROR `MyS2: MyTrait` is not satisfied } diff --git a/src/test/compile-fail/typeck-default-trait-impl-constituent-types.rs b/src/test/compile-fail/typeck-default-trait-impl-constituent-types.rs index a49047524e66..3d7746b369cc 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-constituent-types.rs +++ b/src/test/compile-fail/typeck-default-trait-impl-constituent-types.rs @@ -29,5 +29,5 @@ fn main() { is_mytrait::(); is_mytrait::(); - //~^ ERROR `MyS2 : MyTrait` is not satisfied + //~^ ERROR `MyS2: MyTrait` is not satisfied } diff --git a/src/test/compile-fail/typeck-default-trait-impl-negation-send.rs b/src/test/compile-fail/typeck-default-trait-impl-negation-send.rs index 0158cbcfcda8..853718f1e77d 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-negation-send.rs +++ b/src/test/compile-fail/typeck-default-trait-impl-negation-send.rs @@ -27,5 +27,5 @@ fn is_send() {} fn main() { is_send::(); is_send::(); - //~^ ERROR `MyNotSendable : std::marker::Send` is not satisfied + //~^ ERROR `MyNotSendable: std::marker::Send` is not satisfied } diff --git a/src/test/compile-fail/typeck-default-trait-impl-negation-sync.rs b/src/test/compile-fail/typeck-default-trait-impl-negation-sync.rs index 6cfc9bc5f5ec..cdf787a60ad4 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-negation-sync.rs +++ b/src/test/compile-fail/typeck-default-trait-impl-negation-sync.rs @@ -43,11 +43,11 @@ fn is_sync() {} fn main() { is_sync::(); is_sync::(); - //~^ ERROR `MyNotSync : std::marker::Sync` is not satisfied + //~^ ERROR `MyNotSync: std::marker::Sync` is not satisfied is_sync::(); - //~^ ERROR `std::cell::UnsafeCell : std::marker::Sync` is not satisfied + //~^ ERROR `std::cell::UnsafeCell: std::marker::Sync` is not satisfied is_sync::(); - //~^ ERROR `Managed : std::marker::Sync` is not satisfied + //~^ ERROR `Managed: std::marker::Sync` is not satisfied } diff --git a/src/test/compile-fail/typeck-default-trait-impl-negation.rs b/src/test/compile-fail/typeck-default-trait-impl-negation.rs index 98e617ee6659..8c2658b89a50 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-negation.rs +++ b/src/test/compile-fail/typeck-default-trait-impl-negation.rs @@ -33,10 +33,10 @@ fn is_my_unsafe_trait() {} fn main() { is_my_trait::(); is_my_trait::(); - //~^ ERROR `ThisImplsUnsafeTrait : MyTrait` is not satisfied + //~^ ERROR `ThisImplsUnsafeTrait: MyTrait` is not satisfied is_my_unsafe_trait::(); - //~^ ERROR `ThisImplsTrait : MyUnsafeTrait` is not satisfied + //~^ ERROR `ThisImplsTrait: MyUnsafeTrait` is not satisfied is_my_unsafe_trait::(); } diff --git a/src/test/compile-fail/typeck-default-trait-impl-precedence.rs b/src/test/compile-fail/typeck-default-trait-impl-precedence.rs index 109b2ed24ea1..66c7a1c75ffe 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-precedence.rs +++ b/src/test/compile-fail/typeck-default-trait-impl-precedence.rs @@ -27,5 +27,5 @@ impl Signed for i32 { } fn main() { is_defaulted::<&'static i32>(); is_defaulted::<&'static u32>(); - //~^ ERROR `u32 : Signed` is not satisfied + //~^ ERROR `u32: Signed` is not satisfied } diff --git a/src/test/compile-fail/typeck-default-trait-impl-supertrait.rs b/src/test/compile-fail/typeck-default-trait-impl-supertrait.rs index 81c4a3c5a519..0b071a9acd09 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-supertrait.rs +++ b/src/test/compile-fail/typeck-default-trait-impl-supertrait.rs @@ -24,6 +24,6 @@ fn foo() { bar::() } fn bar() { } fn main() { - foo::(); //~ ERROR `i32 : NotImplemented` is not satisfied - bar::(); //~ ERROR `i64 : NotImplemented` is not satisfied + foo::(); //~ ERROR `i32: NotImplemented` is not satisfied + bar::(); //~ ERROR `i64: NotImplemented` is not satisfied } diff --git a/src/test/compile-fail/typeck-default-trait-impl-trait-where-clause-2.rs b/src/test/compile-fail/typeck-default-trait-impl-trait-where-clause-2.rs index 29379d549611..3085f45a83dd 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-trait-where-clause-2.rs +++ b/src/test/compile-fail/typeck-default-trait-impl-trait-where-clause-2.rs @@ -29,7 +29,7 @@ fn bar() { } fn test() { bar::>(); - //~^ ERROR `std::option::Option : NotImplemented` is not satisfied + //~^ ERROR `std::option::Option: NotImplemented` is not satisfied } fn main() { diff --git a/src/test/compile-fail/typeck-default-trait-impl-trait-where-clause.rs b/src/test/compile-fail/typeck-default-trait-impl-trait-where-clause.rs index a3a80e17e403..47e87c09d12b 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-trait-where-clause.rs +++ b/src/test/compile-fail/typeck-default-trait-impl-trait-where-clause.rs @@ -26,7 +26,7 @@ impl NotImplemented for i32 {} impl MyTrait for .. {} fn foo() { - //~^ ERROR `std::option::Option : NotImplemented` is not satisfied + //~^ ERROR `std::option::Option: NotImplemented` is not satisfied // This should probably typecheck. This is #20671. } diff --git a/src/test/compile-fail/typeck-unsafe-always-share.rs b/src/test/compile-fail/typeck-unsafe-always-share.rs index f34bae3be3ca..6047f6770a7b 100644 --- a/src/test/compile-fail/typeck-unsafe-always-share.rs +++ b/src/test/compile-fail/typeck-unsafe-always-share.rs @@ -27,16 +27,16 @@ fn test(s: T) {} fn main() { let us = UnsafeCell::new(MySync{u: UnsafeCell::new(0)}); test(us); - //~^ ERROR `std::cell::UnsafeCell> : std::marker::Sync` is not satisfied + //~^ ERROR `std::cell::UnsafeCell>: std::marker::Sync` is not satisfied let uns = UnsafeCell::new(NoSync); test(uns); - //~^ ERROR `std::cell::UnsafeCell : std::marker::Sync` is not satisfied + //~^ ERROR `std::cell::UnsafeCell: std::marker::Sync` is not satisfied let ms = MySync{u: uns}; test(ms); - //~^ ERROR `std::cell::UnsafeCell : std::marker::Sync` is not satisfied + //~^ ERROR `std::cell::UnsafeCell: std::marker::Sync` is not satisfied test(NoSync); - //~^ ERROR `NoSync : std::marker::Sync` is not satisfied + //~^ ERROR `NoSync: std::marker::Sync` is not satisfied } diff --git a/src/test/compile-fail/ufcs-qpath-self-mismatch.rs b/src/test/compile-fail/ufcs-qpath-self-mismatch.rs index 792c4a8ca3c7..94a98b1582af 100644 --- a/src/test/compile-fail/ufcs-qpath-self-mismatch.rs +++ b/src/test/compile-fail/ufcs-qpath-self-mismatch.rs @@ -12,7 +12,7 @@ use std::ops::Add; fn main() { >::add(1, 2); - //~^ ERROR `i32 : std::ops::Add` is not satisfied + //~^ ERROR `i32: std::ops::Add` is not satisfied >::add(1u32, 2); //~^ ERROR mismatched types >::add(1, 2u32); diff --git a/src/test/compile-fail/unsized-bare-typaram.rs b/src/test/compile-fail/unsized-bare-typaram.rs index 49642ac1490c..3dcc7d248d72 100644 --- a/src/test/compile-fail/unsized-bare-typaram.rs +++ b/src/test/compile-fail/unsized-bare-typaram.rs @@ -9,5 +9,5 @@ // except according to those terms. fn bar() { } -fn foo() { bar::() } //~ ERROR `T : std::marker::Sized` is not satisfied +fn foo() { bar::() } //~ ERROR `T: std::marker::Sized` is not satisfied fn main() { } diff --git a/src/test/compile-fail/unsized-enum.rs b/src/test/compile-fail/unsized-enum.rs index bd5b705511d4..61b2b01b3558 100644 --- a/src/test/compile-fail/unsized-enum.rs +++ b/src/test/compile-fail/unsized-enum.rs @@ -15,14 +15,14 @@ fn not_sized() { } enum Foo { FooSome(U), FooNone } fn foo1() { not_sized::>() } // Hunky dory. fn foo2() { not_sized::>() } -//~^ ERROR `T : std::marker::Sized` is not satisfied +//~^ ERROR `T: std::marker::Sized` is not satisfied // // Not OK: `T` is not sized. enum Bar { BarSome(U), BarNone } fn bar1() { not_sized::>() } fn bar2() { is_sized::>() } -//~^ ERROR `T : std::marker::Sized` is not satisfied +//~^ ERROR `T: std::marker::Sized` is not satisfied // // Not OK: `Bar` is not sized, but it should be. diff --git a/src/test/compile-fail/unsized-struct.rs b/src/test/compile-fail/unsized-struct.rs index 94f15033cb70..bbefb2fcecd8 100644 --- a/src/test/compile-fail/unsized-struct.rs +++ b/src/test/compile-fail/unsized-struct.rs @@ -15,14 +15,14 @@ fn not_sized() { } struct Foo { data: T } fn foo1() { not_sized::>() } // Hunky dory. fn foo2() { not_sized::>() } -//~^ ERROR `T : std::marker::Sized` is not satisfied +//~^ ERROR `T: std::marker::Sized` is not satisfied // // Not OK: `T` is not sized. struct Bar { data: T } fn bar1() { not_sized::>() } fn bar2() { is_sized::>() } -//~^ ERROR `T : std::marker::Sized` is not satisfied +//~^ ERROR `T: std::marker::Sized` is not satisfied // // Not OK: `Bar` is not sized, but it should be. diff --git a/src/test/compile-fail/unsized-trait-impl-trait-arg.rs b/src/test/compile-fail/unsized-trait-impl-trait-arg.rs index bd420d940d51..ad5e4c2daef9 100644 --- a/src/test/compile-fail/unsized-trait-impl-trait-arg.rs +++ b/src/test/compile-fail/unsized-trait-impl-trait-arg.rs @@ -16,7 +16,7 @@ trait T2 { } struct S4(Box); impl T2 for S4 { - //~^ ERROR `X : std::marker::Sized` is not satisfied + //~^ ERROR `X: std::marker::Sized` is not satisfied } fn main() { } diff --git a/src/test/compile-fail/unsized3.rs b/src/test/compile-fail/unsized3.rs index 061f0695df7d..f88165c02e98 100644 --- a/src/test/compile-fail/unsized3.rs +++ b/src/test/compile-fail/unsized3.rs @@ -15,7 +15,7 @@ use std::marker; // Unbounded. fn f1(x: &X) { f2::(x); - //~^ ERROR `X : std::marker::Sized` is not satisfied + //~^ ERROR `X: std::marker::Sized` is not satisfied } fn f2(x: &X) { } @@ -26,7 +26,7 @@ trait T { } fn f3(x: &X) { f4::(x); - //~^ ERROR `X : std::marker::Sized` is not satisfied + //~^ ERROR `X: std::marker::Sized` is not satisfied } fn f4(x: &X) { } @@ -40,7 +40,7 @@ fn f5(x: &Y) {} fn f6(x: &X) {} fn f7(x1: &E, x2: &E) { f5(x1); - //~^ ERROR `X : std::marker::Sized` is not satisfied + //~^ ERROR `X: std::marker::Sized` is not satisfied f6(x2); // ok } @@ -52,19 +52,19 @@ struct S { fn f8(x1: &S, x2: &S) { f5(x1); - //~^ ERROR `X : std::marker::Sized` is not satisfied + //~^ ERROR `X: std::marker::Sized` is not satisfied f6(x2); // ok } // Test some tuples. fn f9(x1: Box>, x2: Box>) { f5(&(*x1, 34)); - //~^ ERROR `X : std::marker::Sized` is not satisfied + //~^ ERROR `X: std::marker::Sized` is not satisfied } fn f10(x1: Box>, x2: Box>) { f5(&(32, *x2)); - //~^ ERROR `X : std::marker::Sized` is not satisfied + //~^ ERROR `X: std::marker::Sized` is not satisfied } pub fn main() { diff --git a/src/test/compile-fail/unsized5.rs b/src/test/compile-fail/unsized5.rs index 1abc45d5df81..3e6c9cc4061e 100644 --- a/src/test/compile-fail/unsized5.rs +++ b/src/test/compile-fail/unsized5.rs @@ -11,27 +11,27 @@ // Test `?Sized` types not allowed in fields (except the last one). struct S1 { - f1: X, //~ ERROR `X : std::marker::Sized` is not satisfied + f1: X, //~ ERROR `X: std::marker::Sized` is not satisfied f2: isize, } struct S2 { f: isize, - g: X, //~ ERROR `X : std::marker::Sized` is not satisfied + g: X, //~ ERROR `X: std::marker::Sized` is not satisfied h: isize, } struct S3 { - f: str, //~ ERROR `str : std::marker::Sized` is not satisfied + f: str, //~ ERROR `str: std::marker::Sized` is not satisfied g: [usize] } struct S4 { - f: [u8], //~ ERROR `[u8] : std::marker::Sized` is not satisfied + f: [u8], //~ ERROR `[u8]: std::marker::Sized` is not satisfied g: usize } enum E { - V1(X, isize), //~ERROR `X : std::marker::Sized` is not satisfied + V1(X, isize), //~ERROR `X: std::marker::Sized` is not satisfied } enum F { - V2{f1: X, f: isize}, //~ERROR `X : std::marker::Sized` is not satisfied + V2{f1: X, f: isize}, //~ERROR `X: std::marker::Sized` is not satisfied } pub fn main() { diff --git a/src/test/compile-fail/unsized6.rs b/src/test/compile-fail/unsized6.rs index 7545794bd23e..663cb0a17161 100644 --- a/src/test/compile-fail/unsized6.rs +++ b/src/test/compile-fail/unsized6.rs @@ -15,27 +15,27 @@ trait T {} fn f1(x: &X) { let _: X; // <-- this is OK, no bindings created, no initializer. let _: (isize, (X, isize)); // same - let y: X; //~ERROR `X : std::marker::Sized` is not satisfied - let y: (isize, (X, isize)); //~ERROR `X : std::marker::Sized` is not satisfied + let y: X; //~ERROR `X: std::marker::Sized` is not satisfied + let y: (isize, (X, isize)); //~ERROR `X: std::marker::Sized` is not satisfied } fn f2(x: &X) { - let y: X; //~ERROR `X : std::marker::Sized` is not satisfied - let y: (isize, (X, isize)); //~ERROR `X : std::marker::Sized` is not satisfied + let y: X; //~ERROR `X: std::marker::Sized` is not satisfied + let y: (isize, (X, isize)); //~ERROR `X: std::marker::Sized` is not satisfied } fn f3(x1: Box, x2: Box, x3: Box) { - let y: X = *x1; //~ERROR `X : std::marker::Sized` is not satisfied - let y = *x2; //~ERROR `X : std::marker::Sized` is not satisfied - let (y, z) = (*x3, 4); //~ERROR `X : std::marker::Sized` is not satisfied + let y: X = *x1; //~ERROR `X: std::marker::Sized` is not satisfied + let y = *x2; //~ERROR `X: std::marker::Sized` is not satisfied + let (y, z) = (*x3, 4); //~ERROR `X: std::marker::Sized` is not satisfied } fn f4(x1: Box, x2: Box, x3: Box) { - let y: X = *x1; //~ERROR `X : std::marker::Sized` is not satisfied - let y = *x2; //~ERROR `X : std::marker::Sized` is not satisfied - let (y, z) = (*x3, 4); //~ERROR `X : std::marker::Sized` is not satisfied + let y: X = *x1; //~ERROR `X: std::marker::Sized` is not satisfied + let y = *x2; //~ERROR `X: std::marker::Sized` is not satisfied + let (y, z) = (*x3, 4); //~ERROR `X: std::marker::Sized` is not satisfied } -fn g1(x: X) {} //~ERROR `X : std::marker::Sized` is not satisfied -fn g2(x: X) {} //~ERROR `X : std::marker::Sized` is not satisfied +fn g1(x: X) {} //~ERROR `X: std::marker::Sized` is not satisfied +fn g2(x: X) {} //~ERROR `X: std::marker::Sized` is not satisfied pub fn main() { } diff --git a/src/test/compile-fail/unsized7.rs b/src/test/compile-fail/unsized7.rs index 5aa1f1336796..25868c594feb 100644 --- a/src/test/compile-fail/unsized7.rs +++ b/src/test/compile-fail/unsized7.rs @@ -20,7 +20,7 @@ trait T1 { struct S3(Box); impl T1 for S3 { - //~^ ERROR `X : std::marker::Sized` is not satisfied + //~^ ERROR `X: std::marker::Sized` is not satisfied } fn main() { } diff --git a/src/test/compile-fail/vtable-res-trait-param.rs b/src/test/compile-fail/vtable-res-trait-param.rs index e32cb32a74d6..eb0baff0005d 100644 --- a/src/test/compile-fail/vtable-res-trait-param.rs +++ b/src/test/compile-fail/vtable-res-trait-param.rs @@ -24,7 +24,7 @@ impl TraitB for isize { fn call_it(b: B) -> isize { let y = 4; - b.gimme_an_a(y) //~ ERROR `_ : TraitA` is not satisfied + b.gimme_an_a(y) //~ ERROR `_: TraitA` is not satisfied } fn main() { diff --git a/src/test/compile-fail/wf-impl-associated-type-trait.rs b/src/test/compile-fail/wf-impl-associated-type-trait.rs index 2fee2604a8a8..1e82f609d2a7 100644 --- a/src/test/compile-fail/wf-impl-associated-type-trait.rs +++ b/src/test/compile-fail/wf-impl-associated-type-trait.rs @@ -25,7 +25,7 @@ pub trait Foo { impl Foo for T { type Bar = MySet; - //~^ ERROR the trait bound `T : MyHash` is not satisfied + //~^ ERROR the trait bound `T: MyHash` is not satisfied } #[rustc_error] diff --git a/src/test/compile-fail/where-clause-constraints-are-local-for-inherent-impl.rs b/src/test/compile-fail/where-clause-constraints-are-local-for-inherent-impl.rs index 4b85f2275a75..458ee6694247 100644 --- a/src/test/compile-fail/where-clause-constraints-are-local-for-inherent-impl.rs +++ b/src/test/compile-fail/where-clause-constraints-are-local-for-inherent-impl.rs @@ -21,7 +21,7 @@ impl Foo { fn fails_copy(self) { require_copy(self.x); - //~^ ERROR the trait bound `T : std::marker::Copy` is not satisfied + //~^ ERROR the trait bound `T: std::marker::Copy` is not satisfied } } diff --git a/src/test/compile-fail/where-clause-constraints-are-local-for-trait-impl.rs b/src/test/compile-fail/where-clause-constraints-are-local-for-trait-impl.rs index f55586982bee..b3f99f2ae253 100644 --- a/src/test/compile-fail/where-clause-constraints-are-local-for-trait-impl.rs +++ b/src/test/compile-fail/where-clause-constraints-are-local-for-trait-impl.rs @@ -26,7 +26,7 @@ impl Foo for Bar { fn fails_copy(self) { require_copy(self.x); - //~^ ERROR the trait bound `T : std::marker::Copy` is not satisfied + //~^ ERROR the trait bound `T: std::marker::Copy` is not satisfied } } diff --git a/src/test/compile-fail/where-clause-method-substituion.rs b/src/test/compile-fail/where-clause-method-substituion.rs index 9f217f29bd18..05a58daf9068 100644 --- a/src/test/compile-fail/where-clause-method-substituion.rs +++ b/src/test/compile-fail/where-clause-method-substituion.rs @@ -28,5 +28,5 @@ impl Bar for isize { fn main() { 1.method::(); - //~^ ERROR the trait bound `X : Foo` is not satisfied + //~^ ERROR the trait bound `X: Foo` is not satisfied } diff --git a/src/test/compile-fail/where-clauses-method-unsatisfied.rs b/src/test/compile-fail/where-clauses-method-unsatisfied.rs index 34ff872ac15f..1ac03330afd1 100644 --- a/src/test/compile-fail/where-clauses-method-unsatisfied.rs +++ b/src/test/compile-fail/where-clauses-method-unsatisfied.rs @@ -26,5 +26,5 @@ impl Foo { fn main() { let x = Foo { value: Bar }; x.equals(&x); - //~^ ERROR `Bar : std::cmp::Eq` is not satisfied + //~^ ERROR `Bar: std::cmp::Eq` is not satisfied } diff --git a/src/test/compile-fail/where-clauses-unsatisfied.rs b/src/test/compile-fail/where-clauses-unsatisfied.rs index 38470bc3de67..278a8db4e1ad 100644 --- a/src/test/compile-fail/where-clauses-unsatisfied.rs +++ b/src/test/compile-fail/where-clauses-unsatisfied.rs @@ -15,5 +15,5 @@ struct Struct; fn main() { drop(equal(&Struct, &Struct)) - //~^ ERROR the trait bound `Struct : std::cmp::Eq` is not satisfied + //~^ ERROR the trait bound `Struct: std::cmp::Eq` is not satisfied } diff --git a/src/test/compile-fail/where-for-self-2.rs b/src/test/compile-fail/where-for-self-2.rs index 1baaed3dd378..bf8fc2921733 100644 --- a/src/test/compile-fail/where-for-self-2.rs +++ b/src/test/compile-fail/where-for-self-2.rs @@ -29,5 +29,5 @@ fn foo(x: &T) fn main() { foo(&X); - //~^ error: `for<'a> &'a _ : Bar` is not satisfied + //~^ error: `for<'a> &'a _: Bar` is not satisfied }