From 8dbe79ae5e2e299959b9dbd20074d348266a91ed Mon Sep 17 00:00:00 2001 From: Jeffrey Seyfried Date: Wed, 6 Dec 2017 18:30:20 -0800 Subject: Fix fallout in tests. --- .../derive-no-std-not-supported.rs | 29 ---------------------- src/test/pretty/issue-4264.pp | 2 +- .../auxiliary/custom_derive_partial_eq.rs | 2 +- .../auxiliary/custom_derive_plugin.rs | 2 +- .../auxiliary/custom_derive_plugin_attr.rs | 2 +- .../derive-no-std-not-supported.rs | 29 ++++++++++++++++++++++ 6 files changed, 33 insertions(+), 33 deletions(-) delete mode 100644 src/test/compile-fail-fulldeps/derive-no-std-not-supported.rs create mode 100644 src/test/run-pass-fulldeps/derive-no-std-not-supported.rs (limited to 'src/test') diff --git a/src/test/compile-fail-fulldeps/derive-no-std-not-supported.rs b/src/test/compile-fail-fulldeps/derive-no-std-not-supported.rs deleted file mode 100644 index 1e97cb07f89..00000000000 --- a/src/test/compile-fail-fulldeps/derive-no-std-not-supported.rs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2015 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. - -#![no_std] - -extern crate serialize as rustc_serialize; - -#[derive(RustcEncodable)] //~ ERROR this trait cannot be derived -struct Bar { - x: u32, -} - -#[derive(RustcDecodable)] //~ ERROR this trait cannot be derived -struct Baz { - x: u32, -} - -fn main() { - Foo { x: 0 }; - Bar { x: 0 }; - Baz { x: 0 }; -} diff --git a/src/test/pretty/issue-4264.pp b/src/test/pretty/issue-4264.pp index 02b8425d88b..81518b0b872 100644 --- a/src/test/pretty/issue-4264.pp +++ b/src/test/pretty/issue-4264.pp @@ -40,7 +40,7 @@ pub fn bar() ({ ((::fmt::format as - for<'r> fn(std::fmt::Arguments<'r>) -> std::string::String {std::fmt::format})(((<::std::fmt::Arguments>::new_v1 + for<'r> fn(std::fmt::Arguments<'r>) -> std::string::String {std::fmt::format})(((<::fmt::Arguments>::new_v1 as fn(&[&str], &[std::fmt::ArgumentV1<'_>]) -> std::fmt::Arguments<'_> {std::fmt::Arguments<'_>::new_v1})((&([("test" as diff --git a/src/test/run-pass-fulldeps/auxiliary/custom_derive_partial_eq.rs b/src/test/run-pass-fulldeps/auxiliary/custom_derive_partial_eq.rs index 63dbd4d5bed..f485982e2d3 100644 --- a/src/test/run-pass-fulldeps/auxiliary/custom_derive_partial_eq.rs +++ b/src/test/run-pass-fulldeps/auxiliary/custom_derive_partial_eq.rs @@ -69,7 +69,7 @@ fn expand_deriving_partial_eq(cx: &mut ExtCtxt, span: Span, mitem: &MetaItem, it let trait_def = TraitDef { span: span, attributes: Vec::new(), - path: deriving::generic::ty::Path::new(vec!["std", "cmp", "PartialEq"]), + path: deriving::generic::ty::Path::new(vec!["cmp", "PartialEq"]), additional_bounds: Vec::new(), generics: LifetimeBounds::empty(), is_unsafe: false, diff --git a/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin.rs b/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin.rs index 16856d30417..449cd29ada3 100644 --- a/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin.rs +++ b/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin.rs @@ -50,7 +50,7 @@ fn expand(cx: &mut ExtCtxt, let trait_def = TraitDef { span: span, attributes: vec![], - path: Path::new(vec!["TotalSum"]), + path: Path::new_local("TotalSum"), additional_bounds: vec![], generics: LifetimeBounds::empty(), associated_types: vec![], diff --git a/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin_attr.rs b/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin_attr.rs index 50b16a0e26f..1a9358f22bf 100644 --- a/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin_attr.rs +++ b/src/test/run-pass-fulldeps/auxiliary/custom_derive_plugin_attr.rs @@ -46,7 +46,7 @@ fn expand(cx: &mut ExtCtxt, let trait_def = TraitDef { span: span, attributes: vec![], - path: Path::new(vec!["TotalSum"]), + path: Path::new_local("TotalSum"), additional_bounds: vec![], generics: LifetimeBounds::empty(), associated_types: vec![], diff --git a/src/test/run-pass-fulldeps/derive-no-std-not-supported.rs b/src/test/run-pass-fulldeps/derive-no-std-not-supported.rs new file mode 100644 index 00000000000..a0747e0fbf5 --- /dev/null +++ b/src/test/run-pass-fulldeps/derive-no-std-not-supported.rs @@ -0,0 +1,29 @@ +// Copyright 2015 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. + +#![feature(rustc_private)] +#![no_std] + +extern crate serialize as rustc_serialize; + +#[derive(RustcEncodable)] +struct Bar { + x: u32, +} + +#[derive(RustcDecodable)] +struct Baz { + x: u32, +} + +fn main() { + Bar { x: 0 }; + Baz { x: 0 }; +} -- cgit 1.4.1-3-g733a5