From 003c4ffa836acd6901fa0d4b00624fc012bd5bd3 Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Sat, 22 Sep 2018 01:45:42 -0700 Subject: [PATCH 01/21] Allow both explicit and elided lifetimes in the same impl header (While still prohibiting explicit and in-band in the same header.) --- src/librustc/hir/lowering.rs | 36 ++++++++++++------- src/librustc/hir/mod.rs | 21 ++++++++--- src/librustc/ich/impls_hir.rs | 10 ++++-- src/librustc/middle/resolve_lifetime.rs | 20 +++++------ .../explicit-and-elided-same-header.rs | 25 +++++++++++++ 5 files changed, 83 insertions(+), 29 deletions(-) create mode 100644 src/test/ui/impl-header-lifetime-elision/explicit-and-elided-same-header.rs diff --git a/src/librustc/hir/lowering.rs b/src/librustc/hir/lowering.rs index bd8770abb135c..d237632cf36a4 100644 --- a/src/librustc/hir/lowering.rs +++ b/src/librustc/hir/lowering.rs @@ -683,9 +683,15 @@ impl<'a> LoweringContext<'a> { // Get the name we'll use to make the def-path. Note // that collisions are ok here and this shouldn't // really show up for end-user. - let str_name = match hir_name { - ParamName::Plain(ident) => ident.as_interned_str(), - ParamName::Fresh(_) => keywords::UnderscoreLifetime.name().as_interned_str(), + let (str_name, kind) = match hir_name { + ParamName::Plain(ident) => ( + ident.as_interned_str(), + hir::LifetimeParamKind::InBand, + ), + ParamName::Fresh(_) => ( + keywords::UnderscoreLifetime.name().as_interned_str(), + hir::LifetimeParamKind::Elided, + ), }; // Add a definition for the in-band lifetime def @@ -705,7 +711,7 @@ impl<'a> LoweringContext<'a> { bounds: hir_vec![], span, pure_wrt_drop: false, - kind: hir::GenericParamKind::Lifetime { in_band: true } + kind: hir::GenericParamKind::Lifetime { kind } } }) .chain(in_band_ty_params.into_iter()) @@ -1452,11 +1458,15 @@ impl<'a> LoweringContext<'a> { lifetime.span, ); - let name = match name { - hir::LifetimeName::Underscore => { - hir::ParamName::Plain(keywords::UnderscoreLifetime.ident()) - } - hir::LifetimeName::Param(param_name) => param_name, + let (name, kind) = match name { + hir::LifetimeName::Underscore => ( + hir::ParamName::Plain(keywords::UnderscoreLifetime.ident()), + hir::LifetimeParamKind::Elided, + ), + hir::LifetimeName::Param(param_name) => ( + param_name, + hir::LifetimeParamKind::Explicit, + ), _ => bug!("expected LifetimeName::Param or ParamName::Plain"), }; @@ -1467,9 +1477,7 @@ impl<'a> LoweringContext<'a> { pure_wrt_drop: false, attrs: hir_vec![], bounds: hir_vec![], - kind: hir::GenericParamKind::Lifetime { - in_band: false, - } + kind: hir::GenericParamKind::Lifetime { kind } }); } } @@ -2283,7 +2291,9 @@ impl<'a> LoweringContext<'a> { pure_wrt_drop: attr::contains_name(¶m.attrs, "may_dangle"), attrs: self.lower_attrs(¶m.attrs), bounds, - kind: hir::GenericParamKind::Lifetime { in_band: false } + kind: hir::GenericParamKind::Lifetime { + kind: hir::LifetimeParamKind::Explicit, + } }; self.is_collecting_in_band_lifetimes = was_collecting_in_band; diff --git a/src/librustc/hir/mod.rs b/src/librustc/hir/mod.rs index de9808ffe7001..ee8e64b2e206f 100644 --- a/src/librustc/hir/mod.rs +++ b/src/librustc/hir/mod.rs @@ -499,14 +499,27 @@ impl GenericBound { pub type GenericBounds = HirVec; +#[derive(Copy, Clone, PartialEq, Eq, RustcEncodable, RustcDecodable, Debug)] +pub enum LifetimeParamKind { + // Indicates that the lifetime definition was explicitly declared, like: + // `fn foo<'a>(x: &'a u8) -> &'a u8 { x }` + Explicit, + + // Indicates that the lifetime definition was synthetically added + // as a result of an in-band lifetime usage like: + // `fn foo(x: &'a u8) -> &'a u8 { x }` + InBand, + + // Indication that the lifetime was elided like both cases here: + // `fn foo(x: &u8) -> &'_ u8 { x }` + Elided, +} + #[derive(Clone, RustcEncodable, RustcDecodable, Debug)] pub enum GenericParamKind { /// A lifetime definition, eg `'a: 'b + 'c + 'd`. Lifetime { - // Indicates that the lifetime definition was synthetically added - // as a result of an in-band lifetime usage like: - // `fn foo(x: &'a u8) -> &'a u8 { x }` - in_band: bool, + kind: LifetimeParamKind, }, Type { default: Option>, diff --git a/src/librustc/ich/impls_hir.rs b/src/librustc/ich/impls_hir.rs index bc2eb5f442b47..676c24a8d3dff 100644 --- a/src/librustc/ich/impls_hir.rs +++ b/src/librustc/ich/impls_hir.rs @@ -207,14 +207,20 @@ impl_stable_hash_for!(struct hir::GenericParam { kind }); +impl_stable_hash_for!(enum hir::LifetimeParamKind { + Explicit, + InBand, + Elided +}); + impl<'a> HashStable> for hir::GenericParamKind { fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) { mem::discriminant(self).hash_stable(hcx, hasher); match self { - hir::GenericParamKind::Lifetime { in_band } => { - in_band.hash_stable(hcx, hasher); + hir::GenericParamKind::Lifetime { kind } => { + kind.hash_stable(hcx, hasher); } hir::GenericParamKind::Type { ref default, synthetic } => { default.hash_stable(hcx, hasher); diff --git a/src/librustc/middle/resolve_lifetime.rs b/src/librustc/middle/resolve_lifetime.rs index db931d0a739ff..fb1cd4ce06419 100644 --- a/src/librustc/middle/resolve_lifetime.rs +++ b/src/librustc/middle/resolve_lifetime.rs @@ -35,7 +35,7 @@ use syntax_pos::Span; use util::nodemap::{DefIdMap, FxHashMap, FxHashSet, NodeMap, NodeSet}; use hir::intravisit::{self, NestedVisitorMap, Visitor}; -use hir::{self, GenericParamKind}; +use hir::{self, GenericParamKind, LifetimeParamKind}; /// The origin of a named lifetime definition. /// @@ -51,8 +51,8 @@ pub enum LifetimeDefOrigin { impl LifetimeDefOrigin { fn from_param(param: &GenericParam) -> Self { match param.kind { - GenericParamKind::Lifetime { in_band } => { - if in_band { + GenericParamKind::Lifetime { kind } => { + if kind == LifetimeParamKind::InBand { LifetimeDefOrigin::InBand } else { LifetimeDefOrigin::Explicit @@ -1087,15 +1087,15 @@ fn check_mixed_explicit_and_in_band_defs( tcx: TyCtxt<'_, '_, '_>, params: &P<[hir::GenericParam]>, ) { - let in_bands: Vec<_> = params.iter().filter_map(|param| match param.kind { - GenericParamKind::Lifetime { in_band, .. } => Some((in_band, param.span)), + let lifetime_params: Vec<_> = params.iter().filter_map(|param| match param.kind { + GenericParamKind::Lifetime { kind, .. } => Some((kind, param.span)), _ => None, }).collect(); - let out_of_band = in_bands.iter().find(|(in_band, _)| !in_band); - let in_band = in_bands.iter().find(|(in_band, _)| *in_band); + let explicit = lifetime_params.iter().find(|(kind, _)| *kind == LifetimeParamKind::Explicit); + let in_band = lifetime_params.iter().find(|(kind, _)| *kind == LifetimeParamKind::InBand); - if let (Some((_, out_of_band_span)), Some((_, in_band_span))) - = (out_of_band, in_band) { + if let (Some((_, explicit_span)), Some((_, in_band_span))) + = (explicit, in_band) { struct_span_err!( tcx.sess, *in_band_span, @@ -1104,7 +1104,7 @@ fn check_mixed_explicit_and_in_band_defs( ).span_label( *in_band_span, "in-band lifetime definition here", - ).span_label(*out_of_band_span, "explicit lifetime definition here") + ).span_label(*explicit_span, "explicit lifetime definition here") .emit(); } } diff --git a/src/test/ui/impl-header-lifetime-elision/explicit-and-elided-same-header.rs b/src/test/ui/impl-header-lifetime-elision/explicit-and-elided-same-header.rs new file mode 100644 index 0000000000000..56dd6691abbe5 --- /dev/null +++ b/src/test/ui/impl-header-lifetime-elision/explicit-and-elided-same-header.rs @@ -0,0 +1,25 @@ +// Copyright 2018 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. + +// run-pass + +#![allow(warnings)] + +#![feature(impl_header_lifetime_elision)] + +// This works for functions... +fn foo<'a>(x: &str, y: &'a str) {} + +// ...so this should work for impls +impl<'a> Foo<&str> for &'a str {} +trait Foo {} + +fn main() { +} From d99e7c2dae1109ed1b92bebe924b854338bfaad2 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 28 Sep 2018 11:27:30 -0700 Subject: [PATCH 02/21] Update Cargo's submodule Bring in a few updates and fixes, mostly a standard update. --- src/Cargo.lock | 107 ++++++++++++++++++++++++++++++++++++------------ src/tools/cargo | 2 +- 2 files changed, 82 insertions(+), 27 deletions(-) diff --git a/src/Cargo.lock b/src/Cargo.lock index 9a383a381d5fb..526b2209de8fe 100644 --- a/src/Cargo.lock +++ b/src/Cargo.lock @@ -82,7 +82,7 @@ dependencies = [ "environment 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -116,6 +116,19 @@ dependencies = [ "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "bit-set" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bit-vec 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "bit-vec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "bitflags" version = "0.9.1" @@ -142,7 +155,7 @@ dependencies = [ "pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -202,7 +215,7 @@ dependencies = [ "ignore 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "lazycell 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", "libgit2-sys 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -210,6 +223,7 @@ dependencies = [ "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "opener 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.10.11 (registry+https://github.com/rust-lang/crates.io-index)", + "proptest 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)", "rustc-workspace-hack 1.0.0", "rustfix 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "same-file 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -217,7 +231,7 @@ dependencies = [ "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde_ignored 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "shell-escape 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "tar 0.4.16 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)", @@ -237,7 +251,7 @@ dependencies = [ "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -414,7 +428,7 @@ dependencies = [ "rustfix 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -431,7 +445,7 @@ dependencies = [ "miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -465,7 +479,7 @@ dependencies = [ "failure 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -633,7 +647,7 @@ dependencies = [ "regex 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "strum 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "strum_macros 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -879,7 +893,7 @@ dependencies = [ "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "regex 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -989,7 +1003,7 @@ dependencies = [ [[package]] name = "itoa" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1016,7 +1030,7 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1038,7 +1052,7 @@ dependencies = [ "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1058,7 +1072,7 @@ dependencies = [ [[package]] name = "lazycell" -version = "1.0.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -1192,7 +1206,7 @@ dependencies = [ "phf_codegen 0.7.22 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "string_cache_codegen 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "tendril 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1224,7 +1238,7 @@ dependencies = [ "regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1586,6 +1600,23 @@ dependencies = [ "core 0.0.0", ] +[[package]] +name = "proptest" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bit-set 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", + "rusty-fork 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "pulldown-cmark" version = "0.1.2" @@ -1792,7 +1823,7 @@ dependencies = [ "rustfmt-nightly 0.99.5", "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "url 1.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "walkdir 2.2.5 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2475,7 +2506,7 @@ dependencies = [ "log 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -2499,12 +2530,23 @@ dependencies = [ "rustc-ap-syntax_pos 263.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", "term 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "toml 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-segmentation 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "rusty-fork" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tempfile 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)", + "wait-timeout 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ryu" version = "0.2.6" @@ -2576,10 +2618,10 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.26" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "itoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -2889,7 +2931,7 @@ version = "0.1.0" dependencies = [ "serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -3031,7 +3073,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", "chrono 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", - "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", + "error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "getset 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3045,6 +3087,14 @@ name = "void" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "wait-timeout" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "walkdir" version = "2.2.5" @@ -3131,6 +3181,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" "checksum backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "89a47830402e9981c5c41223151efcced65a0510c13097c769cede7efb34782a" "checksum backtrace-sys 0.1.24 (registry+https://github.com/rust-lang/crates.io-index)" = "c66d56ac8dabd07f6aacdaf633f4b8262f5b3601a810a0dcddffd5c22c69daa0" +"checksum bit-set 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6f1efcc46c18245a69c38fcc5cc650f16d3a59d034f3106e9ed63748f695730a" +"checksum bit-vec 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4440d5cb623bb7390ae27fec0bb6c61111969860f8e3ae198bfa0663645e67cf" "checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" "checksum bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f2f382711e76b9de6c744cc00d0497baba02fb00a787f088c879f01d09468e32" @@ -3205,7 +3257,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum is-match 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7e5b386aef33a1c677be65237cb9d32c3f3ef56bd035949710c4bb13083eb053" "checksum isatty 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6c324313540cd4d7ba008d43dc6606a32a5579f13cc17b2804c13096f0a5c522" "checksum itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)" = "f58856976b776fedd95533137617a02fb25719f40e7d9b01c7043cd65474f450" -"checksum itoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "5adb58558dcd1d786b5f0bd15f3226ee23486e24b7b58304b60f64dc68e62606" +"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" "checksum jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "60af5f849e1981434e4a31d3d782c4774ae9b434ce55b101a96ecfd09147e8be" "checksum json 0.11.13 (registry+https://github.com/rust-lang/crates.io-index)" = "9ad0485404155f45cce53a40d4b2d6ac356418300daed05273d9e26f91c390be" "checksum jsonrpc-core 8.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ddf83704f4e79979a424d1082dd2c1e52683058056c9280efa19ac5f6bc9033c" @@ -3213,7 +3265,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum languageserver-types 0.45.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9d91d91d1c23db74187096d191967cb49f49bb175ad6d855fa9229d16ef2c982" "checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" "checksum lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca488b89a5657b0a2ecd45b95609b3e848cf1755da332a0da46e2b2b1cb371a7" -"checksum lazycell 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d33a48d0365c96081958cc663eef834975cb1e8d8bea3378513fc72bdbf11e50" +"checksum lazycell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ddba4c30a78328befecec92fc94970e53b3ae385827d28620f0f5bb2493081e0" "checksum libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)" = "76e3a3ef172f1a0b9a9ff0dd1491ae5e6c948b94479a3021819ba7d860c8645d" "checksum libgit2-sys 0.7.9 (registry+https://github.com/rust-lang/crates.io-index)" = "93f2b22fce91fb820363cf88a849a8f8fdfd8be37774b6a9dd6cbda05cf940e6" "checksum libnghttp2-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ffbfb81475cc9f625e44f3a8f8b9cf7173815ae1c7cc2fa91853ec009e38198" @@ -3268,6 +3320,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum pretty_assertions 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a029430f0d744bc3d15dd474d591bed2402b645d024583082b9f63bb936dac6" "checksum proc-macro2 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1b06e2f335f48d24442b35a19df506a835fb3547bc3c06ef27340da9acf5cae7" "checksum proc-macro2 0.4.13 (registry+https://github.com/rust-lang/crates.io-index)" = "ee5697238f0d893c7f0ecc59c0999f18d2af85e424de441178bcacc9f9e6cf67" +"checksum proptest 0.8.7 (registry+https://github.com/rust-lang/crates.io-index)" = "926d0604475349f463fe44130aae73f2294b5309ab2ca0310b998bd334ef191f" "checksum pulldown-cmark 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d6fdf85cda6cadfae5428a54661d431330b312bc767ddbc57adbedc24da66e32" "checksum quick-error 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9274b940887ce9addde99c4eee6b5c44cc494b182b97e73dc8ffdcb3397fd3f0" "checksum quine-mc_cluskey 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "07589615d719a60c8dd8a4622e7946465dfef20d1a428f969e3443e7386d5f45" @@ -3308,6 +3361,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" "checksum rustc_version 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a54aa04a10c68c1c4eacb4337fd883b435997ede17a9385784b990777686b09a" "checksum rustfix 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "756567f00f7d89c9f89a5c401b8b1caaa122e27240b9eaadd0bb52ee0b680b1b" +"checksum rusty-fork 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9591f190d2852720b679c21f66ad929f9f1d7bb09d1193c26167586029d8489c" "checksum ryu 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7153dd96dade874ab973e098cb62fcdbb89a03682e46b144fd09550998d4a4a7" "checksum same-file 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10f7794e2fda7f594866840e95f5c5962e886e228e68b6505885811a94dd728c" "checksum schannel 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "dc1fabf2a7b6483a141426e1afd09ad543520a77ac49bd03c286e7696ccfd77f" @@ -3318,7 +3372,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum serde 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)" = "22d340507cea0b7e6632900a176101fea959c7065d93ba555072da90aaaafc87" "checksum serde_derive 1.0.75 (registry+https://github.com/rust-lang/crates.io-index)" = "234fc8b737737b148ccd625175fc6390f5e4dacfdaa543cb93a3430d984a9119" "checksum serde_ignored 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "190e9765dcedb56be63b6e0993a006c7e3b071a016a304736e4a315dc01fb142" -"checksum serde_json 1.0.26 (registry+https://github.com/rust-lang/crates.io-index)" = "44dd2cfde475037451fa99b7e5df77aa3cfd1536575fa8e7a538ab36dcde49ae" +"checksum serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)" = "bb47a3d5c84320222f66d7db21157c4a7407755de41798f9b4c1c40593397b1a" "checksum shell-escape 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "170a13e64f2a51b77a45702ba77287f5c6829375b04a69cf2222acd17d0cfab9" "checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" "checksum siphasher 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0df90a788073e8d0235a67e50441d47db7c8ad9debd91cbf43736a2a92d36537" @@ -3364,6 +3418,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum vergen 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9a16834fc61e1492c07dae49b6c14b55f8b1d43a5f5f9e9a2ecc063f47b9f93c" "checksum version_check 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "7716c242968ee87e5542f8021178248f267f295a5c4803beae8b8b7fd9bc6051" "checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +"checksum wait-timeout 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b9f3bf741a801531993db6478b95682117471f76916f5e690dd8d45395b09349" "checksum walkdir 2.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "af464bc7be7b785c7ac72e266a6b67c4c9070155606f51655a650a6686204e35" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "773ef9dcc5f24b7d850d0ff101e542ff24c3b090a9768e03ff889fdef41f00fd" diff --git a/src/tools/cargo b/src/tools/cargo index de314a8b2d45b..ad6e5c0037d88 160000 --- a/src/tools/cargo +++ b/src/tools/cargo @@ -1 +1 @@ -Subproject commit de314a8b2d45bce4958fc23939c5e4286e31621c +Subproject commit ad6e5c0037d88602a1c95051e42b392ed5ffcbe8 From 0a3bd9b6abe1191121f0f6c3fab73dd388e62654 Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Mon, 3 Sep 2018 04:50:14 -0700 Subject: [PATCH 03/21] Use impl_header_lifetime_elision in libcore --- src/libcore/borrow.rs | 6 +-- src/libcore/cell.rs | 18 +++---- src/libcore/clone.rs | 2 +- src/libcore/cmp.rs | 12 ++--- src/libcore/convert.rs | 6 +-- src/libcore/fmt/builders.rs | 2 +- src/libcore/fmt/mod.rs | 26 +++++----- src/libcore/hash/mod.rs | 6 +-- src/libcore/iter/iterator.rs | 2 +- src/libcore/iter/traits.rs | 6 +-- src/libcore/lib.rs | 1 + src/libcore/marker.rs | 10 ++-- src/libcore/ops/deref.rs | 6 +-- src/libcore/ops/function.rs | 10 ++-- src/libcore/ops/generator.rs | 2 +- src/libcore/ops/range.rs | 10 ++-- src/libcore/option.rs | 16 +++--- src/libcore/panic.rs | 4 +- src/libcore/result.rs | 16 +++--- src/libcore/slice/mod.rs | 96 ++++++++++++++++++------------------ src/libcore/str/mod.rs | 34 ++++++------- src/libcore/str/pattern.rs | 4 +- src/libcore/tests/iter.rs | 2 +- 23 files changed, 149 insertions(+), 148 deletions(-) diff --git a/src/libcore/borrow.rs b/src/libcore/borrow.rs index f45a32d4b94ac..84d4b21784180 100644 --- a/src/libcore/borrow.rs +++ b/src/libcore/borrow.rs @@ -226,16 +226,16 @@ impl BorrowMut for T { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T: ?Sized> Borrow for &'a T { +impl Borrow for &T { fn borrow(&self) -> &T { &**self } } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T: ?Sized> Borrow for &'a mut T { +impl Borrow for &mut T { fn borrow(&self) -> &T { &**self } } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T: ?Sized> BorrowMut for &'a mut T { +impl BorrowMut for &mut T { fn borrow_mut(&mut self) -> &mut T { &mut **self } } diff --git a/src/libcore/cell.rs b/src/libcore/cell.rs index 009aba5f59869..ec7d366c3f5ce 100644 --- a/src/libcore/cell.rs +++ b/src/libcore/cell.rs @@ -1092,7 +1092,7 @@ impl<'b> BorrowRef<'b> { } } -impl<'b> Drop for BorrowRef<'b> { +impl Drop for BorrowRef<'_> { #[inline] fn drop(&mut self) { let borrow = self.borrow.get(); @@ -1101,9 +1101,9 @@ impl<'b> Drop for BorrowRef<'b> { } } -impl<'b> Clone for BorrowRef<'b> { +impl Clone for BorrowRef<'_> { #[inline] - fn clone(&self) -> BorrowRef<'b> { + fn clone(&self) -> Self { // Since this Ref exists, we know the borrow flag // is a reading borrow. let borrow = self.borrow.get(); @@ -1127,7 +1127,7 @@ pub struct Ref<'b, T: ?Sized + 'b> { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'b, T: ?Sized> Deref for Ref<'b, T> { +impl Deref for Ref<'_, T> { type Target = T; #[inline] @@ -1219,7 +1219,7 @@ impl<'b, T: ?Sized> Ref<'b, T> { impl<'b, T: ?Sized + Unsize, U: ?Sized> CoerceUnsized> for Ref<'b, T> {} #[stable(feature = "std_guard_impls", since = "1.20.0")] -impl<'a, T: ?Sized + fmt::Display> fmt::Display for Ref<'a, T> { +impl fmt::Display for Ref<'_, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.value.fmt(f) } @@ -1305,7 +1305,7 @@ struct BorrowRefMut<'b> { borrow: &'b Cell, } -impl<'b> Drop for BorrowRefMut<'b> { +impl Drop for BorrowRefMut<'_> { #[inline] fn drop(&mut self) { let borrow = self.borrow.get(); @@ -1356,7 +1356,7 @@ pub struct RefMut<'b, T: ?Sized + 'b> { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'b, T: ?Sized> Deref for RefMut<'b, T> { +impl Deref for RefMut<'_, T> { type Target = T; #[inline] @@ -1366,7 +1366,7 @@ impl<'b, T: ?Sized> Deref for RefMut<'b, T> { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'b, T: ?Sized> DerefMut for RefMut<'b, T> { +impl DerefMut for RefMut<'_, T> { #[inline] fn deref_mut(&mut self) -> &mut T { self.value @@ -1377,7 +1377,7 @@ impl<'b, T: ?Sized> DerefMut for RefMut<'b, T> { impl<'b, T: ?Sized + Unsize, U: ?Sized> CoerceUnsized> for RefMut<'b, T> {} #[stable(feature = "std_guard_impls", since = "1.20.0")] -impl<'a, T: ?Sized + fmt::Display> fmt::Display for RefMut<'a, T> { +impl fmt::Display for RefMut<'_, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { self.value.fmt(f) } diff --git a/src/libcore/clone.rs b/src/libcore/clone.rs index 3b15ba2b4ab1f..46bb580dcddb1 100644 --- a/src/libcore/clone.rs +++ b/src/libcore/clone.rs @@ -204,7 +204,7 @@ mod impls { // Shared references can be cloned, but mutable references *cannot*! #[stable(feature = "rust1", since = "1.0.0")] - impl<'a, T: ?Sized> Clone for &'a T { + impl Clone for &T { #[inline] fn clone(&self) -> Self { *self diff --git a/src/libcore/cmp.rs b/src/libcore/cmp.rs index ef7d83a0993da..33881de30527e 100644 --- a/src/libcore/cmp.rs +++ b/src/libcore/cmp.rs @@ -1033,12 +1033,12 @@ mod impls { fn gt(&self, other: & &'b B) -> bool { PartialOrd::gt(*self, *other) } } #[stable(feature = "rust1", since = "1.0.0")] - impl<'a, A: ?Sized> Ord for &'a A where A: Ord { + impl Ord for &A where A: Ord { #[inline] - fn cmp(&self, other: & &'a A) -> Ordering { Ord::cmp(*self, *other) } + fn cmp(&self, other: &Self) -> Ordering { Ord::cmp(*self, *other) } } #[stable(feature = "rust1", since = "1.0.0")] - impl<'a, A: ?Sized> Eq for &'a A where A: Eq {} + impl Eq for &A where A: Eq {} // &mut pointers @@ -1065,12 +1065,12 @@ mod impls { fn gt(&self, other: &&'b mut B) -> bool { PartialOrd::gt(*self, *other) } } #[stable(feature = "rust1", since = "1.0.0")] - impl<'a, A: ?Sized> Ord for &'a mut A where A: Ord { + impl Ord for &mut A where A: Ord { #[inline] - fn cmp(&self, other: &&'a mut A) -> Ordering { Ord::cmp(*self, *other) } + fn cmp(&self, other: &Self) -> Ordering { Ord::cmp(*self, *other) } } #[stable(feature = "rust1", since = "1.0.0")] - impl<'a, A: ?Sized> Eq for &'a mut A where A: Eq {} + impl Eq for &mut A where A: Eq {} #[stable(feature = "rust1", since = "1.0.0")] impl<'a, 'b, A: ?Sized, B: ?Sized> PartialEq<&'b mut B> for &'a A where A: PartialEq { diff --git a/src/libcore/convert.rs b/src/libcore/convert.rs index d5337868843df..b900990d0a726 100644 --- a/src/libcore/convert.rs +++ b/src/libcore/convert.rs @@ -407,7 +407,7 @@ pub trait TryFrom: Sized { // As lifts over & #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T: ?Sized, U: ?Sized> AsRef for &'a T where T: AsRef +impl AsRef for &T where T: AsRef { fn as_ref(&self) -> &U { >::as_ref(*self) @@ -416,7 +416,7 @@ impl<'a, T: ?Sized, U: ?Sized> AsRef for &'a T where T: AsRef // As lifts over &mut #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T: ?Sized, U: ?Sized> AsRef for &'a mut T where T: AsRef +impl AsRef for &mut T where T: AsRef { fn as_ref(&self) -> &U { >::as_ref(*self) @@ -433,7 +433,7 @@ impl<'a, T: ?Sized, U: ?Sized> AsRef for &'a mut T where T: AsRef // AsMut lifts over &mut #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T: ?Sized, U: ?Sized> AsMut for &'a mut T where T: AsMut +impl AsMut for &mut T where T: AsMut { fn as_mut(&mut self) -> &mut U { (*self).as_mut() diff --git a/src/libcore/fmt/builders.rs b/src/libcore/fmt/builders.rs index 3c5f934d4d8c7..4bc5b36d82ba2 100644 --- a/src/libcore/fmt/builders.rs +++ b/src/libcore/fmt/builders.rs @@ -28,7 +28,7 @@ impl<'a> PadAdapter<'a> { } } -impl<'a> fmt::Write for PadAdapter<'a> { +impl fmt::Write for PadAdapter<'_> { fn write_str(&mut self, mut s: &str) -> fmt::Result { while !s.is_empty() { if self.on_newline { diff --git a/src/libcore/fmt/mod.rs b/src/libcore/fmt/mod.rs index 7d131b5c99dc0..bd253e69db319 100644 --- a/src/libcore/fmt/mod.rs +++ b/src/libcore/fmt/mod.rs @@ -208,7 +208,7 @@ pub trait Write { // requiring a `Sized` bound. struct Adapter<'a,T: ?Sized +'a>(&'a mut T); - impl<'a, T: ?Sized> Write for Adapter<'a, T> + impl Write for Adapter<'_, T> where T: Write { fn write_str(&mut self, s: &str) -> Result { @@ -229,7 +229,7 @@ pub trait Write { } #[stable(feature = "fmt_write_blanket_impl", since = "1.4.0")] -impl<'a, W: Write + ?Sized> Write for &'a mut W { +impl Write for &mut W { fn write_str(&mut self, s: &str) -> Result { (**self).write_str(s) } @@ -291,8 +291,8 @@ pub struct ArgumentV1<'a> { #[unstable(feature = "fmt_internals", reason = "internal to format_args!", issue = "0")] -impl<'a> Clone for ArgumentV1<'a> { - fn clone(&self) -> ArgumentV1<'a> { +impl Clone for ArgumentV1<'_> { + fn clone(&self) -> Self { *self } } @@ -436,14 +436,14 @@ pub struct Arguments<'a> { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a> Debug for Arguments<'a> { +impl Debug for Arguments<'_> { fn fmt(&self, fmt: &mut Formatter) -> Result { Display::fmt(self, fmt) } } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a> Display for Arguments<'a> { +impl Display for Arguments<'_> { fn fmt(&self, fmt: &mut Formatter) -> Result { write(fmt.buf, *self) } @@ -1884,7 +1884,7 @@ impl<'a> Formatter<'a> { } #[stable(since = "1.2.0", feature = "formatter_write")] -impl<'a> Write for Formatter<'a> { +impl Write for Formatter<'_> { fn write_str(&mut self, s: &str) -> Result { self.buf.write_str(s) } @@ -1911,11 +1911,11 @@ macro_rules! fmt_refs { ($($tr:ident),*) => { $( #[stable(feature = "rust1", since = "1.0.0")] - impl<'a, T: ?Sized + $tr> $tr for &'a T { + impl $tr for &T { fn fmt(&self, f: &mut Formatter) -> Result { $tr::fmt(&**self, f) } } #[stable(feature = "rust1", since = "1.0.0")] - impl<'a, T: ?Sized + $tr> $tr for &'a mut T { + impl $tr for &mut T { fn fmt(&self, f: &mut Formatter) -> Result { $tr::fmt(&**self, f) } } )* @@ -2039,14 +2039,14 @@ impl Pointer for *mut T { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T: ?Sized> Pointer for &'a T { +impl Pointer for &T { fn fmt(&self, f: &mut Formatter) -> Result { Pointer::fmt(&(*self as *const T), f) } } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T: ?Sized> Pointer for &'a mut T { +impl Pointer for &mut T { fn fmt(&self, f: &mut Formatter) -> Result { Pointer::fmt(&(&**self as *const T), f) } @@ -2153,14 +2153,14 @@ impl Debug for RefCell { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'b, T: ?Sized + Debug> Debug for Ref<'b, T> { +impl Debug for Ref<'_, T> { fn fmt(&self, f: &mut Formatter) -> Result { Debug::fmt(&**self, f) } } #[stable(feature = "rust1", since = "1.0.0")] -impl<'b, T: ?Sized + Debug> Debug for RefMut<'b, T> { +impl Debug for RefMut<'_, T> { fn fmt(&self, f: &mut Formatter) -> Result { Debug::fmt(&*(self.deref()), f) } diff --git a/src/libcore/hash/mod.rs b/src/libcore/hash/mod.rs index e7907e0344493..bbebadd452a26 100644 --- a/src/libcore/hash/mod.rs +++ b/src/libcore/hash/mod.rs @@ -361,7 +361,7 @@ pub trait Hasher { } #[stable(feature = "indirect_hasher_impl", since = "1.22.0")] -impl<'a, H: Hasher + ?Sized> Hasher for &'a mut H { +impl Hasher for &mut H { fn finish(&self) -> u64 { (**self).finish() } @@ -669,14 +669,14 @@ mod impls { #[stable(feature = "rust1", since = "1.0.0")] - impl<'a, T: ?Sized + Hash> Hash for &'a T { + impl Hash for &T { fn hash(&self, state: &mut H) { (**self).hash(state); } } #[stable(feature = "rust1", since = "1.0.0")] - impl<'a, T: ?Sized + Hash> Hash for &'a mut T { + impl Hash for &mut T { fn hash(&self, state: &mut H) { (**self).hash(state); } diff --git a/src/libcore/iter/iterator.rs b/src/libcore/iter/iterator.rs index d45c123d332eb..4ed4ddb5b656f 100644 --- a/src/libcore/iter/iterator.rs +++ b/src/libcore/iter/iterator.rs @@ -2557,7 +2557,7 @@ fn select_fold1(mut it: I, } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, I: Iterator + ?Sized> Iterator for &'a mut I { +impl Iterator for &mut I { type Item = I::Item; fn next(&mut self) -> Option { (**self).next() } fn size_hint(&self) -> (usize, Option) { (**self).size_hint() } diff --git a/src/libcore/iter/traits.rs b/src/libcore/iter/traits.rs index 4b2c1aa551e99..f95f8e7dbcbb6 100644 --- a/src/libcore/iter/traits.rs +++ b/src/libcore/iter/traits.rs @@ -724,7 +724,7 @@ pub trait ExactSizeIterator: Iterator { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, I: ExactSizeIterator + ?Sized> ExactSizeIterator for &'a mut I { +impl ExactSizeIterator for &mut I { fn len(&self) -> usize { (**self).len() } @@ -974,7 +974,7 @@ impl Product> for Result pub trait FusedIterator: Iterator {} #[stable(feature = "fused", since = "1.26.0")] -impl<'a, I: FusedIterator + ?Sized> FusedIterator for &'a mut I {} +impl FusedIterator for &mut I {} /// An iterator that reports an accurate length using size_hint. /// @@ -999,4 +999,4 @@ impl<'a, I: FusedIterator + ?Sized> FusedIterator for &'a mut I {} pub unsafe trait TrustedLen : Iterator {} #[unstable(feature = "trusted_len", issue = "37572")] -unsafe impl<'a, I: TrustedLen + ?Sized> TrustedLen for &'a mut I {} +unsafe impl TrustedLen for &mut I {} diff --git a/src/libcore/lib.rs b/src/libcore/lib.rs index 94e84106328e2..184ed19da9524 100644 --- a/src/libcore/lib.rs +++ b/src/libcore/lib.rs @@ -87,6 +87,7 @@ #![feature(doc_spotlight)] #![feature(extern_types)] #![feature(fundamental)] +#![feature(impl_header_lifetime_elision)] #![feature(intrinsics)] #![feature(lang_items)] #![feature(link_llvm_intrinsics)] diff --git a/src/libcore/marker.rs b/src/libcore/marker.rs index 5572fe1512cbb..266c6913747f1 100644 --- a/src/libcore/marker.rs +++ b/src/libcore/marker.rs @@ -584,9 +584,9 @@ impls! { PhantomData } mod impls { #[stable(feature = "rust1", since = "1.0.0")] - unsafe impl<'a, T: Sync + ?Sized> Send for &'a T {} + unsafe impl Send for &T {} #[stable(feature = "rust1", since = "1.0.0")] - unsafe impl<'a, T: Send + ?Sized> Send for &'a mut T {} + unsafe impl Send for &mut T {} } /// Compiler-internal trait used to determine whether a type contains @@ -600,8 +600,8 @@ impl !Freeze for UnsafeCell {} unsafe impl Freeze for PhantomData {} unsafe impl Freeze for *const T {} unsafe impl Freeze for *mut T {} -unsafe impl<'a, T: ?Sized> Freeze for &'a T {} -unsafe impl<'a, T: ?Sized> Freeze for &'a mut T {} +unsafe impl Freeze for &T {} +unsafe impl Freeze for &mut T {} /// Types which can be safely moved after being pinned. /// @@ -689,6 +689,6 @@ mod copy_impls { // Shared references can be copied, but mutable references *cannot*! #[stable(feature = "rust1", since = "1.0.0")] - impl<'a, T: ?Sized> Copy for &'a T {} + impl Copy for &T {} } diff --git a/src/libcore/ops/deref.rs b/src/libcore/ops/deref.rs index 54eecc82e19ef..91a3d77e8b2ef 100644 --- a/src/libcore/ops/deref.rs +++ b/src/libcore/ops/deref.rs @@ -83,14 +83,14 @@ pub trait Deref { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T: ?Sized> Deref for &'a T { +impl Deref for &T { type Target = T; fn deref(&self) -> &T { *self } } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T: ?Sized> Deref for &'a mut T { +impl Deref for &mut T { type Target = T; fn deref(&self) -> &T { *self } @@ -174,6 +174,6 @@ pub trait DerefMut: Deref { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T: ?Sized> DerefMut for &'a mut T { +impl DerefMut for &mut T { fn deref_mut(&mut self) -> &mut T { *self } } diff --git a/src/libcore/ops/function.rs b/src/libcore/ops/function.rs index 3ebd10a920919..c9591c3f57bb0 100644 --- a/src/libcore/ops/function.rs +++ b/src/libcore/ops/function.rs @@ -240,7 +240,7 @@ pub trait FnOnce { mod impls { #[stable(feature = "rust1", since = "1.0.0")] - impl<'a,A,F:?Sized> Fn for &'a F + impl Fn for &F where F : Fn { extern "rust-call" fn call(&self, args: A) -> F::Output { @@ -249,7 +249,7 @@ mod impls { } #[stable(feature = "rust1", since = "1.0.0")] - impl<'a,A,F:?Sized> FnMut for &'a F + impl FnMut for &F where F : Fn { extern "rust-call" fn call_mut(&mut self, args: A) -> F::Output { @@ -258,7 +258,7 @@ mod impls { } #[stable(feature = "rust1", since = "1.0.0")] - impl<'a,A,F:?Sized> FnOnce for &'a F + impl FnOnce for &F where F : Fn { type Output = F::Output; @@ -269,7 +269,7 @@ mod impls { } #[stable(feature = "rust1", since = "1.0.0")] - impl<'a,A,F:?Sized> FnMut for &'a mut F + impl FnMut for &mut F where F : FnMut { extern "rust-call" fn call_mut(&mut self, args: A) -> F::Output { @@ -278,7 +278,7 @@ mod impls { } #[stable(feature = "rust1", since = "1.0.0")] - impl<'a,A,F:?Sized> FnOnce for &'a mut F + impl FnOnce for &mut F where F : FnMut { type Output = F::Output; diff --git a/src/libcore/ops/generator.rs b/src/libcore/ops/generator.rs index 4b70c5398be4f..297089926b536 100644 --- a/src/libcore/ops/generator.rs +++ b/src/libcore/ops/generator.rs @@ -124,7 +124,7 @@ pub trait Generator { } #[unstable(feature = "generator_trait", issue = "43122")] -impl<'a, T> Generator for &'a mut T +impl Generator for &mut T where T: Generator + ?Sized { type Yield = T::Yield; diff --git a/src/libcore/ops/range.rs b/src/libcore/ops/range.rs index 9c635678d7aa0..f7e5a89a7aae1 100644 --- a/src/libcore/ops/range.rs +++ b/src/libcore/ops/range.rs @@ -851,7 +851,7 @@ impl<'a, T: ?Sized + 'a> RangeBounds for (Bound<&'a T>, Bound<&'a T>) { } #[stable(feature = "collections_range", since = "1.28.0")] -impl<'a, T> RangeBounds for RangeFrom<&'a T> { +impl RangeBounds for RangeFrom<&T> { fn start_bound(&self) -> Bound<&T> { Included(self.start) } @@ -861,7 +861,7 @@ impl<'a, T> RangeBounds for RangeFrom<&'a T> { } #[stable(feature = "collections_range", since = "1.28.0")] -impl<'a, T> RangeBounds for RangeTo<&'a T> { +impl RangeBounds for RangeTo<&T> { fn start_bound(&self) -> Bound<&T> { Unbounded } @@ -871,7 +871,7 @@ impl<'a, T> RangeBounds for RangeTo<&'a T> { } #[stable(feature = "collections_range", since = "1.28.0")] -impl<'a, T> RangeBounds for Range<&'a T> { +impl RangeBounds for Range<&T> { fn start_bound(&self) -> Bound<&T> { Included(self.start) } @@ -881,7 +881,7 @@ impl<'a, T> RangeBounds for Range<&'a T> { } #[stable(feature = "collections_range", since = "1.28.0")] -impl<'a, T> RangeBounds for RangeInclusive<&'a T> { +impl RangeBounds for RangeInclusive<&T> { fn start_bound(&self) -> Bound<&T> { Included(self.start) } @@ -891,7 +891,7 @@ impl<'a, T> RangeBounds for RangeInclusive<&'a T> { } #[stable(feature = "collections_range", since = "1.28.0")] -impl<'a, T> RangeBounds for RangeToInclusive<&'a T> { +impl RangeBounds for RangeToInclusive<&T> { fn start_bound(&self) -> Bound<&T> { Unbounded } diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 58bf6be834d46..0255f7a0885ea 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -1153,18 +1153,18 @@ impl<'a, A> DoubleEndedIterator for Iter<'a, A> { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, A> ExactSizeIterator for Iter<'a, A> {} +impl ExactSizeIterator for Iter<'_, A> {} #[stable(feature = "fused", since = "1.26.0")] -impl<'a, A> FusedIterator for Iter<'a, A> {} +impl FusedIterator for Iter<'_, A> {} #[unstable(feature = "trusted_len", issue = "37572")] -unsafe impl<'a, A> TrustedLen for Iter<'a, A> {} +unsafe impl TrustedLen for Iter<'_, A> {} #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, A> Clone for Iter<'a, A> { +impl Clone for Iter<'_, A> { #[inline] - fn clone(&self) -> Iter<'a, A> { + fn clone(&self) -> Self { Iter { inner: self.inner.clone() } } } @@ -1199,12 +1199,12 @@ impl<'a, A> DoubleEndedIterator for IterMut<'a, A> { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, A> ExactSizeIterator for IterMut<'a, A> {} +impl ExactSizeIterator for IterMut<'_, A> {} #[stable(feature = "fused", since = "1.26.0")] -impl<'a, A> FusedIterator for IterMut<'a, A> {} +impl FusedIterator for IterMut<'_, A> {} #[unstable(feature = "trusted_len", issue = "37572")] -unsafe impl<'a, A> TrustedLen for IterMut<'a, A> {} +unsafe impl TrustedLen for IterMut<'_, A> {} /// An iterator over the value in [`Some`] variant of an [`Option`]. /// diff --git a/src/libcore/panic.rs b/src/libcore/panic.rs index 17cac5aa0a05f..f0efeb59e8d6e 100644 --- a/src/libcore/panic.rs +++ b/src/libcore/panic.rs @@ -133,7 +133,7 @@ impl<'a> PanicInfo<'a> { } #[stable(feature = "panic_hook_display", since = "1.26.0")] -impl<'a> fmt::Display for PanicInfo<'a> { +impl fmt::Display for PanicInfo<'_> { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { formatter.write_str("panicked at ")?; if let Some(message) = self.message { @@ -258,7 +258,7 @@ impl<'a> Location<'a> { } #[stable(feature = "panic_hook_display", since = "1.26.0")] -impl<'a> fmt::Display for Location<'a> { +impl fmt::Display for Location<'_> { fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { write!(formatter, "{}:{}:{}", self.file, self.line, self.col) } diff --git a/src/libcore/result.rs b/src/libcore/result.rs index 93ee11aac36b0..3484664c24205 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -1098,18 +1098,18 @@ impl<'a, T> DoubleEndedIterator for Iter<'a, T> { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T> ExactSizeIterator for Iter<'a, T> {} +impl ExactSizeIterator for Iter<'_, T> {} #[stable(feature = "fused", since = "1.26.0")] -impl<'a, T> FusedIterator for Iter<'a, T> {} +impl FusedIterator for Iter<'_, T> {} #[unstable(feature = "trusted_len", issue = "37572")] -unsafe impl<'a, A> TrustedLen for Iter<'a, A> {} +unsafe impl TrustedLen for Iter<'_, A> {} #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T> Clone for Iter<'a, T> { +impl Clone for Iter<'_, T> { #[inline] - fn clone(&self) -> Iter<'a, T> { Iter { inner: self.inner } } + fn clone(&self) -> Self { Iter { inner: self.inner } } } /// An iterator over a mutable reference to the [`Ok`] variant of a [`Result`]. @@ -1143,13 +1143,13 @@ impl<'a, T> DoubleEndedIterator for IterMut<'a, T> { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T> ExactSizeIterator for IterMut<'a, T> {} +impl ExactSizeIterator for IterMut<'_, T> {} #[stable(feature = "fused", since = "1.26.0")] -impl<'a, T> FusedIterator for IterMut<'a, T> {} +impl FusedIterator for IterMut<'_, T> {} #[unstable(feature = "trusted_len", issue = "37572")] -unsafe impl<'a, A> TrustedLen for IterMut<'a, A> {} +unsafe impl TrustedLen for IterMut<'_, A> {} /// An iterator over the value in a [`Ok`] variant of a [`Result`]. /// diff --git a/src/libcore/slice/mod.rs b/src/libcore/slice/mod.rs index 05027bbe89890..a51c641cf35ad 100644 --- a/src/libcore/slice/mod.rs +++ b/src/libcore/slice/mod.rs @@ -2528,15 +2528,15 @@ impl SliceIndex<[T]> for ops::RangeToInclusive { //////////////////////////////////////////////////////////////////////////////// #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T> Default for &'a [T] { +impl Default for &[T] { /// Creates an empty slice. - fn default() -> &'a [T] { &[] } + fn default() -> Self { &[] } } #[stable(feature = "mut_slice_default", since = "1.5.0")] -impl<'a, T> Default for &'a mut [T] { +impl Default for &mut [T] { /// Creates a mutable empty slice. - fn default() -> &'a mut [T] { &mut [] } + fn default() -> Self { &mut [] } } // @@ -2863,7 +2863,7 @@ pub struct Iter<'a, T: 'a> { } #[stable(feature = "core_impl_debug", since = "1.9.0")] -impl<'a, T: 'a + fmt::Debug> fmt::Debug for Iter<'a, T> { +impl fmt::Debug for Iter<'_, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_tuple("Iter") .field(&self.as_slice()) @@ -2872,9 +2872,9 @@ impl<'a, T: 'a + fmt::Debug> fmt::Debug for Iter<'a, T> { } #[stable(feature = "rust1", since = "1.0.0")] -unsafe impl<'a, T: Sync> Sync for Iter<'a, T> {} +unsafe impl Sync for Iter<'_, T> {} #[stable(feature = "rust1", since = "1.0.0")] -unsafe impl<'a, T: Sync> Send for Iter<'a, T> {} +unsafe impl Send for Iter<'_, T> {} impl<'a, T> Iter<'a, T> { /// View the underlying data as a subslice of the original data. @@ -2910,12 +2910,12 @@ impl<'a, T> Iter<'a, T> { iterator!{struct Iter -> *const T, &'a T, const, /* no mut */} #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T> Clone for Iter<'a, T> { - fn clone(&self) -> Iter<'a, T> { Iter { ptr: self.ptr, end: self.end, _marker: self._marker } } +impl Clone for Iter<'_, T> { + fn clone(&self) -> Self { Iter { ptr: self.ptr, end: self.end, _marker: self._marker } } } #[stable(feature = "slice_iter_as_ref", since = "1.13.0")] -impl<'a, T> AsRef<[T]> for Iter<'a, T> { +impl AsRef<[T]> for Iter<'_, T> { fn as_ref(&self) -> &[T] { self.as_slice() } @@ -2955,7 +2955,7 @@ pub struct IterMut<'a, T: 'a> { } #[stable(feature = "core_impl_debug", since = "1.9.0")] -impl<'a, T: 'a + fmt::Debug> fmt::Debug for IterMut<'a, T> { +impl fmt::Debug for IterMut<'_, T> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_tuple("IterMut") .field(&self.make_slice()) @@ -2964,9 +2964,9 @@ impl<'a, T: 'a + fmt::Debug> fmt::Debug for IterMut<'a, T> { } #[stable(feature = "rust1", since = "1.0.0")] -unsafe impl<'a, T: Sync> Sync for IterMut<'a, T> {} +unsafe impl Sync for IterMut<'_, T> {} #[stable(feature = "rust1", since = "1.0.0")] -unsafe impl<'a, T: Send> Send for IterMut<'a, T> {} +unsafe impl Send for IterMut<'_, T> {} impl<'a, T> IterMut<'a, T> { /// View the underlying data as a subslice of the original data. @@ -3034,7 +3034,7 @@ pub struct Split<'a, T:'a, P> where P: FnMut(&T) -> bool { } #[stable(feature = "core_impl_debug", since = "1.9.0")] -impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for Split<'a, T, P> where P: FnMut(&T) -> bool { +impl fmt::Debug for Split<'_, T, P> where P: FnMut(&T) -> bool { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("Split") .field("v", &self.v) @@ -3045,8 +3045,8 @@ impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for Split<'a, T, P> where P: FnMut(&T // FIXME(#26925) Remove in favor of `#[derive(Clone)]` #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T, P> Clone for Split<'a, T, P> where P: Clone + FnMut(&T) -> bool { - fn clone(&self) -> Split<'a, T, P> { +impl Clone for Split<'_, T, P> where P: Clone + FnMut(&T) -> bool { + fn clone(&self) -> Self { Split { v: self.v, pred: self.pred.clone(), @@ -3108,7 +3108,7 @@ impl<'a, T, P> SplitIter for Split<'a, T, P> where P: FnMut(&T) -> bool { } #[stable(feature = "fused", since = "1.26.0")] -impl<'a, T, P> FusedIterator for Split<'a, T, P> where P: FnMut(&T) -> bool {} +impl FusedIterator for Split<'_, T, P> where P: FnMut(&T) -> bool {} /// An iterator over the subslices of the vector which are separated /// by elements that match `pred`. @@ -3125,7 +3125,7 @@ pub struct SplitMut<'a, T:'a, P> where P: FnMut(&T) -> bool { } #[stable(feature = "core_impl_debug", since = "1.9.0")] -impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for SplitMut<'a, T, P> where P: FnMut(&T) -> bool { +impl fmt::Debug for SplitMut<'_, T, P> where P: FnMut(&T) -> bool { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("SplitMut") .field("v", &self.v) @@ -3206,7 +3206,7 @@ impl<'a, T, P> DoubleEndedIterator for SplitMut<'a, T, P> where } #[stable(feature = "fused", since = "1.26.0")] -impl<'a, T, P> FusedIterator for SplitMut<'a, T, P> where P: FnMut(&T) -> bool {} +impl FusedIterator for SplitMut<'_, T, P> where P: FnMut(&T) -> bool {} /// An iterator over subslices separated by elements that match a predicate /// function, starting from the end of the slice. @@ -3222,7 +3222,7 @@ pub struct RSplit<'a, T:'a, P> where P: FnMut(&T) -> bool { } #[stable(feature = "slice_rsplit", since = "1.27.0")] -impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for RSplit<'a, T, P> where P: FnMut(&T) -> bool { +impl fmt::Debug for RSplit<'_, T, P> where P: FnMut(&T) -> bool { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("RSplit") .field("v", &self.inner.v) @@ -3263,7 +3263,7 @@ impl<'a, T, P> SplitIter for RSplit<'a, T, P> where P: FnMut(&T) -> bool { } #[stable(feature = "slice_rsplit", since = "1.27.0")] -impl<'a, T, P> FusedIterator for RSplit<'a, T, P> where P: FnMut(&T) -> bool {} +impl FusedIterator for RSplit<'_, T, P> where P: FnMut(&T) -> bool {} /// An iterator over the subslices of the vector which are separated /// by elements that match `pred`, starting from the end of the slice. @@ -3278,7 +3278,7 @@ pub struct RSplitMut<'a, T:'a, P> where P: FnMut(&T) -> bool { } #[stable(feature = "slice_rsplit", since = "1.27.0")] -impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for RSplitMut<'a, T, P> where P: FnMut(&T) -> bool { +impl fmt::Debug for RSplitMut<'_, T, P> where P: FnMut(&T) -> bool { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("RSplitMut") .field("v", &self.inner.v) @@ -3321,7 +3321,7 @@ impl<'a, T, P> DoubleEndedIterator for RSplitMut<'a, T, P> where } #[stable(feature = "slice_rsplit", since = "1.27.0")] -impl<'a, T, P> FusedIterator for RSplitMut<'a, T, P> where P: FnMut(&T) -> bool {} +impl FusedIterator for RSplitMut<'_, T, P> where P: FnMut(&T) -> bool {} /// An private iterator over subslices separated by elements that /// match a predicate function, splitting at most a fixed number of @@ -3364,7 +3364,7 @@ pub struct SplitN<'a, T: 'a, P> where P: FnMut(&T) -> bool { } #[stable(feature = "core_impl_debug", since = "1.9.0")] -impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for SplitN<'a, T, P> where P: FnMut(&T) -> bool { +impl fmt::Debug for SplitN<'_, T, P> where P: FnMut(&T) -> bool { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("SplitN") .field("inner", &self.inner) @@ -3386,7 +3386,7 @@ pub struct RSplitN<'a, T: 'a, P> where P: FnMut(&T) -> bool { } #[stable(feature = "core_impl_debug", since = "1.9.0")] -impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for RSplitN<'a, T, P> where P: FnMut(&T) -> bool { +impl fmt::Debug for RSplitN<'_, T, P> where P: FnMut(&T) -> bool { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("RSplitN") .field("inner", &self.inner) @@ -3407,7 +3407,7 @@ pub struct SplitNMut<'a, T: 'a, P> where P: FnMut(&T) -> bool { } #[stable(feature = "core_impl_debug", since = "1.9.0")] -impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for SplitNMut<'a, T, P> where P: FnMut(&T) -> bool { +impl fmt::Debug for SplitNMut<'_, T, P> where P: FnMut(&T) -> bool { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("SplitNMut") .field("inner", &self.inner) @@ -3429,7 +3429,7 @@ pub struct RSplitNMut<'a, T: 'a, P> where P: FnMut(&T) -> bool { } #[stable(feature = "core_impl_debug", since = "1.9.0")] -impl<'a, T: 'a + fmt::Debug, P> fmt::Debug for RSplitNMut<'a, T, P> where P: FnMut(&T) -> bool { +impl fmt::Debug for RSplitNMut<'_, T, P> where P: FnMut(&T) -> bool { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("RSplitNMut") .field("inner", &self.inner) @@ -3482,8 +3482,8 @@ pub struct Windows<'a, T:'a> { // FIXME(#26925) Remove in favor of `#[derive(Clone)]` #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T> Clone for Windows<'a, T> { - fn clone(&self) -> Windows<'a, T> { +impl Clone for Windows<'_, T> { + fn clone(&self) -> Self { Windows { v: self.v, size: self.size, @@ -3560,13 +3560,13 @@ impl<'a, T> DoubleEndedIterator for Windows<'a, T> { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T> ExactSizeIterator for Windows<'a, T> {} +impl ExactSizeIterator for Windows<'_, T> {} #[unstable(feature = "trusted_len", issue = "37572")] -unsafe impl<'a, T> TrustedLen for Windows<'a, T> {} +unsafe impl TrustedLen for Windows<'_, T> {} #[stable(feature = "fused", since = "1.26.0")] -impl<'a, T> FusedIterator for Windows<'a, T> {} +impl FusedIterator for Windows<'_, T> {} #[doc(hidden)] unsafe impl<'a, T> TrustedRandomAccess for Windows<'a, T> { @@ -3595,8 +3595,8 @@ pub struct Chunks<'a, T:'a> { // FIXME(#26925) Remove in favor of `#[derive(Clone)]` #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T> Clone for Chunks<'a, T> { - fn clone(&self) -> Chunks<'a, T> { +impl Clone for Chunks<'_, T> { + fn clone(&self) -> Self { Chunks { v: self.v, chunk_size: self.chunk_size, @@ -3682,13 +3682,13 @@ impl<'a, T> DoubleEndedIterator for Chunks<'a, T> { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T> ExactSizeIterator for Chunks<'a, T> {} +impl ExactSizeIterator for Chunks<'_, T> {} #[unstable(feature = "trusted_len", issue = "37572")] -unsafe impl<'a, T> TrustedLen for Chunks<'a, T> {} +unsafe impl TrustedLen for Chunks<'_, T> {} #[stable(feature = "fused", since = "1.26.0")] -impl<'a, T> FusedIterator for Chunks<'a, T> {} +impl FusedIterator for Chunks<'_, T> {} #[doc(hidden)] unsafe impl<'a, T> TrustedRandomAccess for Chunks<'a, T> { @@ -3801,13 +3801,13 @@ impl<'a, T> DoubleEndedIterator for ChunksMut<'a, T> { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a, T> ExactSizeIterator for ChunksMut<'a, T> {} +impl ExactSizeIterator for ChunksMut<'_, T> {} #[unstable(feature = "trusted_len", issue = "37572")] -unsafe impl<'a, T> TrustedLen for ChunksMut<'a, T> {} +unsafe impl TrustedLen for ChunksMut<'_, T> {} #[stable(feature = "fused", since = "1.26.0")] -impl<'a, T> FusedIterator for ChunksMut<'a, T> {} +impl FusedIterator for ChunksMut<'_, T> {} #[doc(hidden)] unsafe impl<'a, T> TrustedRandomAccess for ChunksMut<'a, T> { @@ -3854,8 +3854,8 @@ impl<'a, T> ChunksExact<'a, T> { // FIXME(#26925) Remove in favor of `#[derive(Clone)]` #[unstable(feature = "chunks_exact", issue = "47115")] -impl<'a, T> Clone for ChunksExact<'a, T> { - fn clone(&self) -> ChunksExact<'a, T> { +impl Clone for ChunksExact<'_, T> { + fn clone(&self) -> Self { ChunksExact { v: self.v, rem: self.rem, @@ -3924,17 +3924,17 @@ impl<'a, T> DoubleEndedIterator for ChunksExact<'a, T> { } #[unstable(feature = "chunks_exact", issue = "47115")] -impl<'a, T> ExactSizeIterator for ChunksExact<'a, T> { +impl ExactSizeIterator for ChunksExact<'_, T> { fn is_empty(&self) -> bool { self.v.is_empty() } } #[unstable(feature = "trusted_len", issue = "37572")] -unsafe impl<'a, T> TrustedLen for ChunksExact<'a, T> {} +unsafe impl TrustedLen for ChunksExact<'_, T> {} #[unstable(feature = "chunks_exact", issue = "47115")] -impl<'a, T> FusedIterator for ChunksExact<'a, T> {} +impl FusedIterator for ChunksExact<'_, T> {} #[doc(hidden)] unsafe impl<'a, T> TrustedRandomAccess for ChunksExact<'a, T> { @@ -4039,17 +4039,17 @@ impl<'a, T> DoubleEndedIterator for ChunksExactMut<'a, T> { } #[unstable(feature = "chunks_exact", issue = "47115")] -impl<'a, T> ExactSizeIterator for ChunksExactMut<'a, T> { +impl ExactSizeIterator for ChunksExactMut<'_, T> { fn is_empty(&self) -> bool { self.v.is_empty() } } #[unstable(feature = "trusted_len", issue = "37572")] -unsafe impl<'a, T> TrustedLen for ChunksExactMut<'a, T> {} +unsafe impl TrustedLen for ChunksExactMut<'_, T> {} #[unstable(feature = "chunks_exact", issue = "47115")] -impl<'a, T> FusedIterator for ChunksExactMut<'a, T> {} +impl FusedIterator for ChunksExactMut<'_, T> {} #[doc(hidden)] unsafe impl<'a, T> TrustedRandomAccess for ChunksExactMut<'a, T> { diff --git a/src/libcore/str/mod.rs b/src/libcore/str/mod.rs index 2c941c28d4b80..a2782dd8e2e43 100644 --- a/src/libcore/str/mod.rs +++ b/src/libcore/str/mod.rs @@ -617,7 +617,7 @@ impl<'a> DoubleEndedIterator for Chars<'a> { } #[stable(feature = "fused", since = "1.26.0")] -impl<'a> FusedIterator for Chars<'a> {} +impl FusedIterator for Chars<'_> {} impl<'a> Chars<'a> { /// View the underlying data as a subslice of the original data. @@ -707,7 +707,7 @@ impl<'a> DoubleEndedIterator for CharIndices<'a> { } #[stable(feature = "fused", since = "1.26.0")] -impl<'a> FusedIterator for CharIndices<'a> {} +impl FusedIterator for CharIndices<'_> {} impl<'a> CharIndices<'a> { /// View the underlying data as a subslice of the original data. @@ -733,7 +733,7 @@ impl<'a> CharIndices<'a> { pub struct Bytes<'a>(Cloned>); #[stable(feature = "rust1", since = "1.0.0")] -impl<'a> Iterator for Bytes<'a> { +impl Iterator for Bytes<'_> { type Item = u8; #[inline] @@ -794,7 +794,7 @@ impl<'a> Iterator for Bytes<'a> { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a> DoubleEndedIterator for Bytes<'a> { +impl DoubleEndedIterator for Bytes<'_> { #[inline] fn next_back(&mut self) -> Option { self.0.next_back() @@ -809,7 +809,7 @@ impl<'a> DoubleEndedIterator for Bytes<'a> { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a> ExactSizeIterator for Bytes<'a> { +impl ExactSizeIterator for Bytes<'_> { #[inline] fn len(&self) -> usize { self.0.len() @@ -822,10 +822,10 @@ impl<'a> ExactSizeIterator for Bytes<'a> { } #[stable(feature = "fused", since = "1.26.0")] -impl<'a> FusedIterator for Bytes<'a> {} +impl FusedIterator for Bytes<'_> {} #[unstable(feature = "trusted_len", issue = "37572")] -unsafe impl<'a> TrustedLen for Bytes<'a> {} +unsafe impl TrustedLen for Bytes<'_> {} #[doc(hidden)] unsafe impl<'a> TrustedRandomAccess for Bytes<'a> { @@ -1342,7 +1342,7 @@ impl<'a> DoubleEndedIterator for Lines<'a> { } #[stable(feature = "fused", since = "1.26.0")] -impl<'a> FusedIterator for Lines<'a> {} +impl FusedIterator for Lines<'_> {} /// Created with the method [`lines_any`]. /// @@ -1409,7 +1409,7 @@ impl<'a> DoubleEndedIterator for LinesAny<'a> { #[stable(feature = "fused", since = "1.26.0")] #[allow(deprecated)] -impl<'a> FusedIterator for LinesAny<'a> {} +impl FusedIterator for LinesAny<'_> {} /* Section: UTF-8 validation @@ -4033,15 +4033,15 @@ impl AsRef<[u8]> for str { } #[stable(feature = "rust1", since = "1.0.0")] -impl<'a> Default for &'a str { +impl Default for &str { /// Creates an empty str - fn default() -> &'a str { "" } + fn default() -> Self { "" } } #[stable(feature = "default_mut_str", since = "1.28.0")] -impl<'a> Default for &'a mut str { +impl Default for &mut str { /// Creates an empty mutable str - fn default() -> &'a mut str { unsafe { from_utf8_unchecked_mut(&mut []) } } + fn default() -> Self { unsafe { from_utf8_unchecked_mut(&mut []) } } } /// An iterator over the non-whitespace substrings of a string, @@ -4189,7 +4189,7 @@ impl<'a> DoubleEndedIterator for SplitWhitespace<'a> { } #[stable(feature = "fused", since = "1.26.0")] -impl<'a> FusedIterator for SplitWhitespace<'a> {} +impl FusedIterator for SplitWhitespace<'_> {} #[unstable(feature = "split_ascii_whitespace", issue = "48656")] impl<'a> Iterator for SplitAsciiWhitespace<'a> { @@ -4215,7 +4215,7 @@ impl<'a> DoubleEndedIterator for SplitAsciiWhitespace<'a> { } #[unstable(feature = "split_ascii_whitespace", issue = "48656")] -impl<'a> FusedIterator for SplitAsciiWhitespace<'a> {} +impl FusedIterator for SplitAsciiWhitespace<'_> {} /// An iterator of [`u16`] over the string encoded as UTF-16. /// @@ -4234,7 +4234,7 @@ pub struct EncodeUtf16<'a> { } #[stable(feature = "collection_debug", since = "1.17.0")] -impl<'a> fmt::Debug for EncodeUtf16<'a> { +impl fmt::Debug for EncodeUtf16<'_> { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.pad("EncodeUtf16 { .. }") } @@ -4273,4 +4273,4 @@ impl<'a> Iterator for EncodeUtf16<'a> { } #[stable(feature = "fused", since = "1.26.0")] -impl<'a> FusedIterator for EncodeUtf16<'a> {} +impl FusedIterator for EncodeUtf16<'_> {} diff --git a/src/libcore/str/pattern.rs b/src/libcore/str/pattern.rs index 5e63fa9ff354c..1c974533e10c8 100644 --- a/src/libcore/str/pattern.rs +++ b/src/libcore/str/pattern.rs @@ -491,7 +491,7 @@ impl MultiCharEq for F where F: FnMut(char) -> bool { fn matches(&mut self, c: char) -> bool { (*self)(c) } } -impl<'a> MultiCharEq for &'a [char] { +impl MultiCharEq for &[char] { #[inline] fn matches(&mut self, c: char) -> bool { self.iter().any(|&m| { m == c }) @@ -666,7 +666,7 @@ impl<'a, 'b> Pattern<'a> for &'b [char] { pub struct CharPredicateSearcher<'a, F>( as Pattern<'a>>::Searcher) where F: FnMut(char) -> bool; -impl<'a, F> fmt::Debug for CharPredicateSearcher<'a, F> +impl fmt::Debug for CharPredicateSearcher<'_, F> where F: FnMut(char) -> bool { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { diff --git a/src/libcore/tests/iter.rs b/src/libcore/tests/iter.rs index 72b115f8b5f77..2476c07cbd9ca 100644 --- a/src/libcore/tests/iter.rs +++ b/src/libcore/tests/iter.rs @@ -229,7 +229,7 @@ fn test_iterator_step_by_nth_overflow() { #[derive(Clone)] struct Test(Bigger); - impl<'a> Iterator for &'a mut Test { + impl Iterator for &mut Test { type Item = i32; fn next(&mut self) -> Option { Some(21) } fn nth(&mut self, n: usize) -> Option { From 8d6bee3442830cf7b420e8b1ad60fadee8336c0e Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Sat, 29 Sep 2018 22:05:07 -0700 Subject: [PATCH 04/21] UI test updates --- src/test/ui/coherence/coherence-impls-copy.stderr | 4 ++-- src/test/ui/e0119/issue-28981.stderr | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/ui/coherence/coherence-impls-copy.stderr b/src/test/ui/coherence/coherence-impls-copy.stderr index 24e7e85b1a961..613ee0a269e70 100644 --- a/src/test/ui/coherence/coherence-impls-copy.stderr +++ b/src/test/ui/coherence/coherence-impls-copy.stderr @@ -14,7 +14,7 @@ LL | impl Copy for &'static NotSync {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: conflicting implementation in crate `core`: - - impl<'a, T> std::marker::Copy for &'a T + - impl<'_, T> std::marker::Copy for &T where T: ?Sized; error[E0119]: conflicting implementations of trait `std::marker::Copy` for type `&[NotSync]`: @@ -24,7 +24,7 @@ LL | impl Copy for &'static [NotSync] {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: conflicting implementation in crate `core`: - - impl<'a, T> std::marker::Copy for &'a T + - impl<'_, T> std::marker::Copy for &T where T: ?Sized; error[E0206]: the trait `Copy` may not be implemented for this type diff --git a/src/test/ui/e0119/issue-28981.stderr b/src/test/ui/e0119/issue-28981.stderr index afcbab4a5c6c0..4886ad7717574 100644 --- a/src/test/ui/e0119/issue-28981.stderr +++ b/src/test/ui/e0119/issue-28981.stderr @@ -5,7 +5,7 @@ LL | impl Deref for Foo { } //~ ERROR must be used | ^^^^^^^^^^^^^^^^^^^^^^^ | = note: conflicting implementation in crate `core`: - - impl<'a, T> std::ops::Deref for &'a T + - impl<'_, T> std::ops::Deref for &T where T: ?Sized; error[E0210]: type parameter `Foo` must be used as the type parameter for some local type (e.g. `MyStruct`) From d4840da77993d052bae2a900163026602ac89d3c Mon Sep 17 00:00:00 2001 From: Scott McMurray Date: Sat, 29 Sep 2018 23:29:58 -0700 Subject: [PATCH 05/21] Activate the feature in the libcore tests too --- src/libcore/tests/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libcore/tests/lib.rs b/src/libcore/tests/lib.rs index e034ff8059349..ada61d8dfd873 100644 --- a/src/libcore/tests/lib.rs +++ b/src/libcore/tests/lib.rs @@ -19,6 +19,7 @@ #![feature(flt2dec)] #![feature(fmt_internals)] #![feature(hashmap_internals)] +#![feature(impl_header_lifetime_elision)] #![feature(pattern)] #![feature(range_is_empty)] #![feature(raw)] From 1b22befd36ab1337dacfe74666909922230e7834 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 30 Sep 2018 14:27:26 +0200 Subject: [PATCH 06/21] make run-pass tests with empty main just compile-pass tests --- src/test/{run-pass => ui}/issues/issue-10396.rs | 2 +- src/test/{run-pass => ui}/issues/issue-10456.rs | 2 +- src/test/{run-pass => ui}/issues/issue-10763.rs | 2 +- src/test/{run-pass => ui}/issues/issue-10902.rs | 2 +- src/test/{run-pass => ui}/issues/issue-11384.rs | 2 +- src/test/{run-pass => ui}/issues/issue-11592.rs | 2 +- src/test/{run-pass => ui}/issues/issue-11612.rs | 2 +- src/test/{run-pass => ui}/issues/issue-11869.rs | 2 +- src/test/{run-pass => ui}/issues/issue-12729.rs | 2 +- src/test/{run-pass => ui}/issues/issue-13105.rs | 2 +- src/test/{run-pass => ui}/issues/issue-13167.rs | 2 +- src/test/{run-pass => ui}/issues/issue-13214.rs | 2 +- src/test/{run-pass => ui}/issues/issue-13405.rs | 2 +- src/test/{run-pass => ui}/issues/issue-13703.rs | 2 +- src/test/{run-pass => ui}/issues/issue-13775.rs | 2 +- src/test/{run-pass => ui}/issues/issue-13837.rs | 2 +- src/test/{run-pass => ui}/issues/issue-14082.rs | 2 +- src/test/{run-pass => ui}/issues/issue-14254.rs | 2 +- src/test/{run-pass => ui}/issues/issue-14330.rs | 2 +- src/test/{run-pass => ui}/issues/issue-14837.rs | 2 +- src/test/{run-pass => ui}/issues/issue-14933.rs | 2 +- src/test/{run-pass => ui}/issues/issue-14959.rs | 2 +- src/test/{run-pass => ui}/issues/issue-15108.rs | 2 +- src/test/{run-pass => ui}/issues/issue-15261.rs | 2 +- src/test/{run-pass => ui}/issues/issue-15689-2.rs | 2 +- src/test/{run-pass => ui}/issues/issue-15735.rs | 2 +- src/test/{run-pass => ui}/issues/issue-16596.rs | 2 +- src/test/{run-pass => ui}/issues/issue-16668.rs | 2 +- src/test/{run-pass => ui}/issues/issue-17121.rs | 2 +- src/test/{run-pass => ui}/issues/issue-17336.rs | 2 +- src/test/{run-pass => ui}/issues/issue-17450.rs | 2 +- .../{run-pass => ui}/issues/issue-17718-const-destructors.rs | 2 +- src/test/{run-pass => ui}/issues/issue-17732.rs | 2 +- src/test/{run-pass => ui}/issues/issue-17746.rs | 2 +- src/test/{run-pass => ui}/issues/issue-17904.rs | 2 +- src/test/{run-pass => ui}/issues/issue-18083.rs | 2 +- src/test/{run-pass => ui}/issues/issue-18088.rs | 2 +- src/test/{run-pass => ui}/issues/issue-18188.rs | 2 +- .../issues/issue-18446.rs => ui/issues/issue-18446-2.rs} | 2 +- src/test/{run-pass => ui}/issues/issue-18738.rs | 2 +- src/test/{run-pass => ui}/issues/issue-18809.rs | 2 +- src/test/{run-pass => ui}/issues/issue-18906.rs | 2 +- src/test/{run-pass => ui}/issues/issue-19037.rs | 2 +- src/test/{run-pass => ui}/issues/issue-19081.rs | 2 +- src/test/{run-pass => ui}/issues/issue-19097.rs | 2 +- src/test/{run-pass => ui}/issues/issue-19098.rs | 2 +- src/test/{run-pass => ui}/issues/issue-19102.rs | 2 +- src/test/{run-pass => ui}/issues/issue-19129-1.rs | 2 +- src/test/{run-pass => ui}/issues/issue-19129-2.rs | 2 +- src/test/{run-pass => ui}/issues/issue-19398.rs | 2 +- src/test/{run-pass => ui}/issues/issue-19404.rs | 2 +- src/test/{run-pass => ui}/issues/issue-19479.rs | 2 +- src/test/{run-pass => ui}/issues/issue-19631.rs | 2 +- src/test/{run-pass => ui}/issues/issue-19632.rs | 2 +- src/test/{run-pass => ui}/issues/issue-19850.rs | 2 +- .../issues/issue-19982.rs => ui/issues/issue-19982-2.rs} | 2 +- src/test/{run-pass => ui}/issues/issue-20009.rs | 2 +- src/test/{run-pass => ui}/issues/issue-20091.rs | 2 +- src/test/{run-pass => ui}/issues/issue-20186.rs | 2 +- src/test/{run-pass => ui}/issues/issue-20396.rs | 2 +- src/test/{run-pass => ui}/issues/issue-20414.rs | 2 +- src/test/{run-pass => ui}/issues/issue-20454.rs | 2 +- src/test/{run-pass => ui}/issues/issue-2063-resource.rs | 2 +- src/test/{run-pass => ui}/issues/issue-20644.rs | 2 +- src/test/{run-pass => ui}/issues/issue-20763-1.rs | 2 +- src/test/{run-pass => ui}/issues/issue-20763-2.rs | 2 +- src/test/{run-pass => ui}/issues/issue-20797.rs | 2 +- .../issues/issue-20825.rs => ui/issues/issue-20825-2.rs} | 2 +- src/test/{run-pass => ui}/issues/issue-21140.rs | 2 +- .../issues/issue-21174.rs => ui/issues/issue-21174-2.rs} | 2 +- src/test/{run-pass => ui}/issues/issue-21245.rs | 2 +- src/test/{run-pass => ui}/issues/issue-21363.rs | 2 +- src/test/{run-pass => ui}/issues/issue-21402.rs | 2 +- src/test/{run-pass => ui}/issues/issue-21520.rs | 2 +- src/test/{run-pass => ui}/issues/issue-21562.rs | 2 +- src/test/{run-pass => ui}/issues/issue-21622.rs | 2 +- src/test/{run-pass => ui}/issues/issue-21634.rs | 2 +- src/test/{run-pass => ui}/issues/issue-21726.rs | 2 +- src/test/{run-pass => ui}/issues/issue-21891.rs | 2 +- src/test/{run-pass => ui}/issues/issue-22066.rs | 2 +- src/test/{run-pass => ui}/issues/issue-22356.rs | 2 +- src/test/{run-pass => ui}/issues/issue-22375.rs | 2 +- src/test/{run-pass => ui}/issues/issue-22471.rs | 2 +- src/test/{run-pass => ui}/issues/issue-22781.rs | 2 +- src/test/{run-pass => ui}/issues/issue-22814.rs | 2 +- src/test/{run-pass => ui}/issues/issue-22894.rs | 2 +- src/test/{run-pass => ui}/issues/issue-23406.rs | 2 +- src/test/{run-pass => ui}/issues/issue-23442.rs | 2 +- src/test/{run-pass => ui}/issues/issue-23477.rs | 2 +- src/test/{run-pass => ui}/issues/issue-23550.rs | 2 +- src/test/{run-pass => ui}/issues/issue-23649-3.rs | 2 +- src/test/{run-pass => ui}/issues/issue-24085.rs | 2 +- src/test/{run-pass => ui}/issues/issue-24227.rs | 2 +- src/test/{run-pass => ui}/issues/issue-24389.rs | 2 +- src/test/{run-pass => ui}/issues/issue-24434.rs | 2 +- src/test/{run-pass => ui}/issues/issue-25180.rs | 2 +- src/test/{run-pass => ui}/issues/issue-25394.rs | 2 +- src/test/{run-pass => ui}/issues/issue-26095.rs | 2 +- src/test/{run-pass => ui}/issues/issue-26205.rs | 2 +- src/test/{run-pass => ui}/issues/issue-26646.rs | 2 +- src/test/{run-pass => ui}/issues/issue-26997.rs | 2 +- src/test/{run-pass => ui}/issues/issue-27105.rs | 2 +- src/test/{run-pass => ui}/issues/issue-27281.rs | 2 +- src/test/{run-pass => ui}/issues/issue-27583.rs | 2 +- src/test/{run-pass => ui}/issues/issue-27889.rs | 2 +- src/test/{run-pass => ui}/issues/issue-28279.rs | 2 +- src/test/{run-pass => ui}/issues/issue-28561.rs | 2 +- src/test/{run-pass => ui}/issues/issue-28600.rs | 2 +- src/test/{run-pass => ui}/issues/issue-28822.rs | 2 +- src/test/{run-pass => ui}/issues/issue-28871.rs | 2 +- src/test/{run-pass => ui}/issues/issue-28936.rs | 2 +- src/test/{run-pass => ui}/issues/issue-28999.rs | 2 +- src/test/{run-pass => ui}/issues/issue-29030.rs | 2 +- src/test/{run-pass => ui}/issues/issue-29037.rs | 2 +- src/test/{run-pass => ui}/issues/issue-29048.rs | 2 +- src/test/{run-pass => ui}/issues/issue-29071.rs | 2 +- src/test/{run-pass => ui}/issues/issue-29276.rs | 2 +- src/test/{run-pass => ui}/issues/issue-29516.rs | 2 +- src/test/{run-pass => ui}/issues/issue-29540.rs | 2 +- src/test/{run-pass => ui}/issues/issue-29710.rs | 2 +- src/test/{run-pass => ui}/issues/issue-29740.rs | 2 +- src/test/{run-pass => ui}/issues/issue-31260.rs | 2 +- src/test/{run-pass => ui}/issues/issue-31597.rs | 2 +- src/test/{run-pass => ui}/issues/issue-32324.rs | 2 +- src/test/{run-pass => ui}/issues/issue-33264.rs | 2 +- src/test/{run-pass => ui}/issues/issue-33287.rs | 2 +- src/test/{run-pass => ui}/issues/issue-33903.rs | 2 +- src/test/{run-pass => ui}/issues/issue-34194.rs | 2 +- src/test/{run-pass => ui}/issues/issue-34751.rs | 2 +- src/test/{run-pass => ui}/issues/issue-34780.rs | 2 +- src/test/{run-pass => ui}/issues/issue-35376.rs | 2 +- src/test/{run-pass => ui}/issues/issue-35546.rs | 2 +- src/test/{run-pass => ui}/issues/issue-36075.rs | 2 +- src/test/{run-pass => ui}/issues/issue-36744-without-calls.rs | 2 +- src/test/{run-pass => ui}/issues/issue-37598.rs | 2 +- src/test/{run-pass => ui}/issues/issue-37655.rs | 2 +- src/test/{run-pass => ui}/issues/issue-37725.rs | 2 +- src/test/{run-pass => ui}/issues/issue-38727.rs | 2 +- src/test/{run-pass => ui}/issues/issue-39089.rs | 2 +- src/test/{run-pass => ui}/issues/issue-39467.rs | 2 +- src/test/{run-pass => ui}/issues/issue-39984.rs | 2 +- src/test/{run-pass => ui}/issues/issue-40136.rs | 2 +- src/test/{run-pass => ui}/issues/issue-40962.rs | 2 +- src/test/{run-pass => ui}/issues/issue-41272.rs | 2 +- src/test/{run-pass => ui}/issues/issue-41298.rs | 2 +- src/test/{run-pass => ui}/issues/issue-41628.rs | 2 +- .../issues/issue-41936-variance-coerce-unsized-cycle.rs | 2 +- src/test/{run-pass => ui}/issues/issue-42467.rs | 2 +- src/test/{run-pass => ui}/issues/issue-42956.rs | 2 +- src/test/{run-pass => ui}/issues/issue-43057.rs | 2 +- src/test/{run-pass => ui}/issues/issue-43357.rs | 2 +- src/test/{run-pass => ui}/issues/issue-43483.rs | 2 +- src/test/{run-pass => ui}/issues/issue-44005.rs | 2 +- src/test/{run-pass => ui}/issues/issue-44056.rs | 2 +- src/test/{run-pass => ui}/issues/issue-44247.rs | 2 +- .../issues/issue-44373.rs => ui/issues/issue-44373-2.rs} | 2 +- src/test/{run-pass => ui}/issues/issue-44402.rs | 2 +- src/test/{run-pass => ui}/issues/issue-44730.rs | 2 +- src/test/{run-pass => ui}/issues/issue-44851.rs | 2 +- src/test/{run-pass => ui}/issues/issue-45425.rs | 2 +- src/test/{run-pass => ui}/issues/issue-46959.rs | 2 +- src/test/{run-pass => ui}/issues/issue-46964.rs | 2 +- src/test/{run-pass => ui}/issues/issue-47673.rs | 2 +- src/test/{run-pass => ui}/issues/issue-47703-1.rs | 2 +- src/test/{run-pass => ui}/issues/issue-47703-tuple.rs | 2 +- src/test/{run-pass => ui}/issues/issue-47703.rs | 2 +- src/test/{run-pass => ui}/issues/issue-47722.rs | 2 +- src/test/{run-pass => ui}/issues/issue-47789.rs | 2 +- src/test/{run-pass => ui}/issues/issue-48551.rs | 2 +- src/test/{run-pass => ui}/issues/issue-51655.rs | 2 +- src/test/{run-pass => ui}/issues/issue-6991.rs | 2 +- src/test/{run-pass => ui}/issues/issue-7268.rs | 2 +- src/test/{run-pass => ui}/issues/issue-8521.rs | 2 +- src/test/{run-pass => ui}/issues/issue-9243.rs | 2 +- src/test/{run-pass => ui}/issues/issue-9249.rs | 2 +- 175 files changed, 175 insertions(+), 175 deletions(-) rename src/test/{run-pass => ui}/issues/issue-10396.rs (97%) rename src/test/{run-pass => ui}/issues/issue-10456.rs (98%) rename src/test/{run-pass => ui}/issues/issue-10763.rs (97%) rename src/test/{run-pass => ui}/issues/issue-10902.rs (98%) rename src/test/{run-pass => ui}/issues/issue-11384.rs (97%) rename src/test/{run-pass => ui}/issues/issue-11592.rs (97%) rename src/test/{run-pass => ui}/issues/issue-11612.rs (98%) rename src/test/{run-pass => ui}/issues/issue-11869.rs (97%) rename src/test/{run-pass => ui}/issues/issue-12729.rs (97%) rename src/test/{run-pass => ui}/issues/issue-13105.rs (97%) rename src/test/{run-pass => ui}/issues/issue-13167.rs (98%) rename src/test/{run-pass => ui}/issues/issue-13214.rs (98%) rename src/test/{run-pass => ui}/issues/issue-13405.rs (97%) rename src/test/{run-pass => ui}/issues/issue-13703.rs (97%) rename src/test/{run-pass => ui}/issues/issue-13775.rs (97%) rename src/test/{run-pass => ui}/issues/issue-13837.rs (97%) rename src/test/{run-pass => ui}/issues/issue-14082.rs (97%) rename src/test/{run-pass => ui}/issues/issue-14254.rs (99%) rename src/test/{run-pass => ui}/issues/issue-14330.rs (97%) rename src/test/{run-pass => ui}/issues/issue-14837.rs (97%) rename src/test/{run-pass => ui}/issues/issue-14933.rs (97%) rename src/test/{run-pass => ui}/issues/issue-14959.rs (99%) rename src/test/{run-pass => ui}/issues/issue-15108.rs (96%) rename src/test/{run-pass => ui}/issues/issue-15261.rs (97%) rename src/test/{run-pass => ui}/issues/issue-15689-2.rs (97%) rename src/test/{run-pass => ui}/issues/issue-15735.rs (97%) rename src/test/{run-pass => ui}/issues/issue-16596.rs (97%) rename src/test/{run-pass => ui}/issues/issue-16668.rs (98%) rename src/test/{run-pass => ui}/issues/issue-17121.rs (98%) rename src/test/{run-pass => ui}/issues/issue-17336.rs (97%) rename src/test/{run-pass => ui}/issues/issue-17450.rs (97%) rename src/test/{run-pass => ui}/issues/issue-17718-const-destructors.rs (97%) rename src/test/{run-pass => ui}/issues/issue-17732.rs (97%) rename src/test/{run-pass => ui}/issues/issue-17746.rs (97%) rename src/test/{run-pass => ui}/issues/issue-17904.rs (97%) rename src/test/{run-pass => ui}/issues/issue-18083.rs (98%) rename src/test/{run-pass => ui}/issues/issue-18088.rs (97%) rename src/test/{run-pass => ui}/issues/issue-18188.rs (98%) rename src/test/{run-pass/issues/issue-18446.rs => ui/issues/issue-18446-2.rs} (97%) rename src/test/{run-pass => ui}/issues/issue-18738.rs (97%) rename src/test/{run-pass => ui}/issues/issue-18809.rs (97%) rename src/test/{run-pass => ui}/issues/issue-18906.rs (98%) rename src/test/{run-pass => ui}/issues/issue-19037.rs (97%) rename src/test/{run-pass => ui}/issues/issue-19081.rs (97%) rename src/test/{run-pass => ui}/issues/issue-19097.rs (97%) rename src/test/{run-pass => ui}/issues/issue-19098.rs (97%) rename src/test/{run-pass => ui}/issues/issue-19102.rs (97%) rename src/test/{run-pass => ui}/issues/issue-19129-1.rs (97%) rename src/test/{run-pass => ui}/issues/issue-19129-2.rs (97%) rename src/test/{run-pass => ui}/issues/issue-19398.rs (97%) rename src/test/{run-pass => ui}/issues/issue-19404.rs (98%) rename src/test/{run-pass => ui}/issues/issue-19479.rs (97%) rename src/test/{run-pass => ui}/issues/issue-19631.rs (97%) rename src/test/{run-pass => ui}/issues/issue-19632.rs (97%) rename src/test/{run-pass => ui}/issues/issue-19850.rs (98%) rename src/test/{run-pass/issues/issue-19982.rs => ui/issues/issue-19982-2.rs} (98%) rename src/test/{run-pass => ui}/issues/issue-20009.rs (97%) rename src/test/{run-pass => ui}/issues/issue-20091.rs (98%) rename src/test/{run-pass => ui}/issues/issue-20186.rs (97%) rename src/test/{run-pass => ui}/issues/issue-20396.rs (97%) rename src/test/{run-pass => ui}/issues/issue-20414.rs (98%) rename src/test/{run-pass => ui}/issues/issue-20454.rs (97%) rename src/test/{run-pass => ui}/issues/issue-2063-resource.rs (97%) rename src/test/{run-pass => ui}/issues/issue-20644.rs (98%) rename src/test/{run-pass => ui}/issues/issue-20763-1.rs (98%) rename src/test/{run-pass => ui}/issues/issue-20763-2.rs (98%) rename src/test/{run-pass => ui}/issues/issue-20797.rs (99%) rename src/test/{run-pass/issues/issue-20825.rs => ui/issues/issue-20825-2.rs} (97%) rename src/test/{run-pass => ui}/issues/issue-21140.rs (97%) rename src/test/{run-pass/issues/issue-21174.rs => ui/issues/issue-21174-2.rs} (97%) rename src/test/{run-pass => ui}/issues/issue-21245.rs (99%) rename src/test/{run-pass => ui}/issues/issue-21363.rs (97%) rename src/test/{run-pass => ui}/issues/issue-21402.rs (97%) rename src/test/{run-pass => ui}/issues/issue-21520.rs (98%) rename src/test/{run-pass => ui}/issues/issue-21562.rs (97%) rename src/test/{run-pass => ui}/issues/issue-21622.rs (97%) rename src/test/{run-pass => ui}/issues/issue-21634.rs (98%) rename src/test/{run-pass => ui}/issues/issue-21726.rs (98%) rename src/test/{run-pass => ui}/issues/issue-21891.rs (97%) rename src/test/{run-pass => ui}/issues/issue-22066.rs (97%) rename src/test/{run-pass => ui}/issues/issue-22356.rs (98%) rename src/test/{run-pass => ui}/issues/issue-22375.rs (96%) rename src/test/{run-pass => ui}/issues/issue-22471.rs (97%) rename src/test/{run-pass => ui}/issues/issue-22781.rs (98%) rename src/test/{run-pass => ui}/issues/issue-22814.rs (97%) rename src/test/{run-pass => ui}/issues/issue-22894.rs (97%) rename src/test/{run-pass => ui}/issues/issue-23406.rs (97%) rename src/test/{run-pass => ui}/issues/issue-23442.rs (98%) rename src/test/{run-pass => ui}/issues/issue-23477.rs (97%) rename src/test/{run-pass => ui}/issues/issue-23550.rs (98%) rename src/test/{run-pass => ui}/issues/issue-23649-3.rs (97%) rename src/test/{run-pass => ui}/issues/issue-24085.rs (98%) rename src/test/{run-pass => ui}/issues/issue-24227.rs (97%) rename src/test/{run-pass => ui}/issues/issue-24389.rs (97%) rename src/test/{run-pass => ui}/issues/issue-24434.rs (97%) rename src/test/{run-pass => ui}/issues/issue-25180.rs (97%) rename src/test/{run-pass => ui}/issues/issue-25394.rs (97%) rename src/test/{run-pass => ui}/issues/issue-26095.rs (97%) rename src/test/{run-pass => ui}/issues/issue-26205.rs (98%) rename src/test/{run-pass => ui}/issues/issue-26646.rs (97%) rename src/test/{run-pass => ui}/issues/issue-26997.rs (97%) rename src/test/{run-pass => ui}/issues/issue-27105.rs (97%) rename src/test/{run-pass => ui}/issues/issue-27281.rs (97%) rename src/test/{run-pass => ui}/issues/issue-27583.rs (99%) rename src/test/{run-pass => ui}/issues/issue-27889.rs (98%) rename src/test/{run-pass => ui}/issues/issue-28279.rs (98%) rename src/test/{run-pass => ui}/issues/issue-28561.rs (99%) rename src/test/{run-pass => ui}/issues/issue-28600.rs (97%) rename src/test/{run-pass => ui}/issues/issue-28822.rs (97%) rename src/test/{run-pass => ui}/issues/issue-28871.rs (98%) rename src/test/{run-pass => ui}/issues/issue-28936.rs (98%) rename src/test/{run-pass => ui}/issues/issue-28999.rs (97%) rename src/test/{run-pass => ui}/issues/issue-29030.rs (97%) rename src/test/{run-pass => ui}/issues/issue-29037.rs (98%) rename src/test/{run-pass => ui}/issues/issue-29048.rs (97%) rename src/test/{run-pass => ui}/issues/issue-29071.rs (97%) rename src/test/{run-pass => ui}/issues/issue-29276.rs (97%) rename src/test/{run-pass => ui}/issues/issue-29516.rs (97%) rename src/test/{run-pass => ui}/issues/issue-29540.rs (99%) rename src/test/{run-pass => ui}/issues/issue-29710.rs (97%) rename src/test/{run-pass => ui}/issues/issue-29740.rs (99%) rename src/test/{run-pass => ui}/issues/issue-31260.rs (97%) rename src/test/{run-pass => ui}/issues/issue-31597.rs (98%) rename src/test/{run-pass => ui}/issues/issue-32324.rs (98%) rename src/test/{run-pass => ui}/issues/issue-33264.rs (98%) rename src/test/{run-pass => ui}/issues/issue-33287.rs (97%) rename src/test/{run-pass => ui}/issues/issue-33903.rs (97%) rename src/test/{run-pass => ui}/issues/issue-34194.rs (97%) rename src/test/{run-pass => ui}/issues/issue-34751.rs (97%) rename src/test/{run-pass => ui}/issues/issue-34780.rs (97%) rename src/test/{run-pass => ui}/issues/issue-35376.rs (98%) rename src/test/{run-pass => ui}/issues/issue-35546.rs (98%) rename src/test/{run-pass => ui}/issues/issue-36075.rs (97%) rename src/test/{run-pass => ui}/issues/issue-36744-without-calls.rs (97%) rename src/test/{run-pass => ui}/issues/issue-37598.rs (97%) rename src/test/{run-pass => ui}/issues/issue-37655.rs (98%) rename src/test/{run-pass => ui}/issues/issue-37725.rs (97%) rename src/test/{run-pass => ui}/issues/issue-38727.rs (97%) rename src/test/{run-pass => ui}/issues/issue-39089.rs (97%) rename src/test/{run-pass => ui}/issues/issue-39467.rs (97%) rename src/test/{run-pass => ui}/issues/issue-39984.rs (97%) rename src/test/{run-pass => ui}/issues/issue-40136.rs (97%) rename src/test/{run-pass => ui}/issues/issue-40962.rs (97%) rename src/test/{run-pass => ui}/issues/issue-41272.rs (97%) rename src/test/{run-pass => ui}/issues/issue-41298.rs (97%) rename src/test/{run-pass => ui}/issues/issue-41628.rs (97%) rename src/test/{run-pass => ui}/issues/issue-41936-variance-coerce-unsized-cycle.rs (98%) rename src/test/{run-pass => ui}/issues/issue-42467.rs (98%) rename src/test/{run-pass => ui}/issues/issue-42956.rs (98%) rename src/test/{run-pass => ui}/issues/issue-43057.rs (97%) rename src/test/{run-pass => ui}/issues/issue-43357.rs (97%) rename src/test/{run-pass => ui}/issues/issue-43483.rs (97%) rename src/test/{run-pass => ui}/issues/issue-44005.rs (98%) rename src/test/{run-pass => ui}/issues/issue-44056.rs (97%) rename src/test/{run-pass => ui}/issues/issue-44247.rs (97%) rename src/test/{run-pass/issues/issue-44373.rs => ui/issues/issue-44373-2.rs} (97%) rename src/test/{run-pass => ui}/issues/issue-44402.rs (98%) rename src/test/{run-pass => ui}/issues/issue-44730.rs (97%) rename src/test/{run-pass => ui}/issues/issue-44851.rs (97%) rename src/test/{run-pass => ui}/issues/issue-45425.rs (97%) rename src/test/{run-pass => ui}/issues/issue-46959.rs (97%) rename src/test/{run-pass => ui}/issues/issue-46964.rs (98%) rename src/test/{run-pass => ui}/issues/issue-47673.rs (97%) rename src/test/{run-pass => ui}/issues/issue-47703-1.rs (98%) rename src/test/{run-pass => ui}/issues/issue-47703-tuple.rs (97%) rename src/test/{run-pass => ui}/issues/issue-47703.rs (97%) rename src/test/{run-pass => ui}/issues/issue-47722.rs (98%) rename src/test/{run-pass => ui}/issues/issue-47789.rs (97%) rename src/test/{run-pass => ui}/issues/issue-48551.rs (98%) rename src/test/{run-pass => ui}/issues/issue-51655.rs (97%) rename src/test/{run-pass => ui}/issues/issue-6991.rs (97%) rename src/test/{run-pass => ui}/issues/issue-7268.rs (97%) rename src/test/{run-pass => ui}/issues/issue-8521.rs (97%) rename src/test/{run-pass => ui}/issues/issue-9243.rs (97%) rename src/test/{run-pass => ui}/issues/issue-9249.rs (97%) diff --git a/src/test/run-pass/issues/issue-10396.rs b/src/test/ui/issues/issue-10396.rs similarity index 97% rename from src/test/run-pass/issues/issue-10396.rs rename to src/test/ui/issues/issue-10396.rs index 5b7bfe1a02ec9..4b4571f99db87 100644 --- a/src/test/run-pass/issues/issue-10396.rs +++ b/src/test/ui/issues/issue-10396.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #[derive(Debug)] enum Foo<'s> { diff --git a/src/test/run-pass/issues/issue-10456.rs b/src/test/ui/issues/issue-10456.rs similarity index 98% rename from src/test/run-pass/issues/issue-10456.rs rename to src/test/ui/issues/issue-10456.rs index 66b813f82a4b5..ed8c5e9657067 100644 --- a/src/test/run-pass/issues/issue-10456.rs +++ b/src/test/ui/issues/issue-10456.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 pub struct Foo; diff --git a/src/test/run-pass/issues/issue-10763.rs b/src/test/ui/issues/issue-10763.rs similarity index 97% rename from src/test/run-pass/issues/issue-10763.rs rename to src/test/ui/issues/issue-10763.rs index 705cc3fad132c..08653b1c69698 100644 --- a/src/test/run-pass/issues/issue-10763.rs +++ b/src/test/ui/issues/issue-10763.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-10902.rs b/src/test/ui/issues/issue-10902.rs similarity index 98% rename from src/test/run-pass/issues/issue-10902.rs rename to src/test/ui/issues/issue-10902.rs index df9dc0b63d9ca..24bf90b2d9d9c 100644 --- a/src/test/run-pass/issues/issue-10902.rs +++ b/src/test/ui/issues/issue-10902.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-11384.rs b/src/test/ui/issues/issue-11384.rs similarity index 97% rename from src/test/run-pass/issues/issue-11384.rs rename to src/test/ui/issues/issue-11384.rs index 5f11bf2841ec5..af4e7fc389ed3 100644 --- a/src/test/run-pass/issues/issue-11384.rs +++ b/src/test/ui/issues/issue-11384.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 trait Common { fn dummy(&self) { } } diff --git a/src/test/run-pass/issues/issue-11592.rs b/src/test/ui/issues/issue-11592.rs similarity index 97% rename from src/test/run-pass/issues/issue-11592.rs rename to src/test/ui/issues/issue-11592.rs index 1157f9b7e76bb..11c6fecd78d41 100644 --- a/src/test/run-pass/issues/issue-11592.rs +++ b/src/test/ui/issues/issue-11592.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass //! Ensure the private trait Bar isn't complained about. #![deny(missing_docs)] diff --git a/src/test/run-pass/issues/issue-11612.rs b/src/test/ui/issues/issue-11612.rs similarity index 98% rename from src/test/run-pass/issues/issue-11612.rs rename to src/test/ui/issues/issue-11612.rs index ba17a02dd3875..293dd6dfaaa59 100644 --- a/src/test/run-pass/issues/issue-11612.rs +++ b/src/test/ui/issues/issue-11612.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // #11612 // We weren't updating the auto adjustments with all the resolved diff --git a/src/test/run-pass/issues/issue-11869.rs b/src/test/ui/issues/issue-11869.rs similarity index 97% rename from src/test/run-pass/issues/issue-11869.rs rename to src/test/ui/issues/issue-11869.rs index b3543f726daa7..102b79ac20382 100644 --- a/src/test/run-pass/issues/issue-11869.rs +++ b/src/test/ui/issues/issue-11869.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-12729.rs b/src/test/ui/issues/issue-12729.rs similarity index 97% rename from src/test/run-pass/issues/issue-12729.rs rename to src/test/ui/issues/issue-12729.rs index efcc05cc19641..2447bceeea6f1 100644 --- a/src/test/run-pass/issues/issue-12729.rs +++ b/src/test/ui/issues/issue-12729.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-13105.rs b/src/test/ui/issues/issue-13105.rs similarity index 97% rename from src/test/run-pass/issues/issue-13105.rs rename to src/test/ui/issues/issue-13105.rs index 906f8ca5e7d35..78e0caca0baf2 100644 --- a/src/test/run-pass/issues/issue-13105.rs +++ b/src/test/ui/issues/issue-13105.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 trait Foo { diff --git a/src/test/run-pass/issues/issue-13167.rs b/src/test/ui/issues/issue-13167.rs similarity index 98% rename from src/test/run-pass/issues/issue-13167.rs rename to src/test/ui/issues/issue-13167.rs index ac0645cd403a1..e44ac88566c41 100644 --- a/src/test/run-pass/issues/issue-13167.rs +++ b/src/test/ui/issues/issue-13167.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 use std::slice; diff --git a/src/test/run-pass/issues/issue-13214.rs b/src/test/ui/issues/issue-13214.rs similarity index 98% rename from src/test/run-pass/issues/issue-13214.rs rename to src/test/ui/issues/issue-13214.rs index 1c119bb634df4..b22942652c459 100644 --- a/src/test/run-pass/issues/issue-13214.rs +++ b/src/test/ui/issues/issue-13214.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // defining static with struct that contains enum // with &'static str variant used to cause ICE diff --git a/src/test/run-pass/issues/issue-13405.rs b/src/test/ui/issues/issue-13405.rs similarity index 97% rename from src/test/run-pass/issues/issue-13405.rs rename to src/test/ui/issues/issue-13405.rs index a8ca38838d19e..ed35d3edccfc2 100644 --- a/src/test/run-pass/issues/issue-13405.rs +++ b/src/test/ui/issues/issue-13405.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(unused_variables)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-13703.rs b/src/test/ui/issues/issue-13703.rs similarity index 97% rename from src/test/run-pass/issues/issue-13703.rs rename to src/test/ui/issues/issue-13703.rs index d0f8be64ef398..e954f94b664ac 100644 --- a/src/test/run-pass/issues/issue-13703.rs +++ b/src/test/ui/issues/issue-13703.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 pub struct Foo<'a, 'b: 'a> { foo: &'a &'b isize } diff --git a/src/test/run-pass/issues/issue-13775.rs b/src/test/ui/issues/issue-13775.rs similarity index 97% rename from src/test/run-pass/issues/issue-13775.rs rename to src/test/ui/issues/issue-13775.rs index ae49922991773..27fcbf7894188 100644 --- a/src/test/run-pass/issues/issue-13775.rs +++ b/src/test/ui/issues/issue-13775.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 trait Foo { diff --git a/src/test/run-pass/issues/issue-13837.rs b/src/test/ui/issues/issue-13837.rs similarity index 97% rename from src/test/run-pass/issues/issue-13837.rs rename to src/test/ui/issues/issue-13837.rs index 98a86748851a8..1e67964093bd3 100644 --- a/src/test/run-pass/issues/issue-13837.rs +++ b/src/test/ui/issues/issue-13837.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-14082.rs b/src/test/ui/issues/issue-14082.rs similarity index 97% rename from src/test/run-pass/issues/issue-14082.rs rename to src/test/ui/issues/issue-14082.rs index 01d3c9534f2fd..5a1452fe35746 100644 --- a/src/test/run-pass/issues/issue-14082.rs +++ b/src/test/ui/issues/issue-14082.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 #![allow(unused_imports, dead_code)] diff --git a/src/test/run-pass/issues/issue-14254.rs b/src/test/ui/issues/issue-14254.rs similarity index 99% rename from src/test/run-pass/issues/issue-14254.rs rename to src/test/ui/issues/issue-14254.rs index 4e03535f61333..033b7341db1ed 100644 --- a/src/test/run-pass/issues/issue-14254.rs +++ b/src/test/ui/issues/issue-14254.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 trait Foo: Sized { diff --git a/src/test/run-pass/issues/issue-14330.rs b/src/test/ui/issues/issue-14330.rs similarity index 97% rename from src/test/run-pass/issues/issue-14330.rs rename to src/test/ui/issues/issue-14330.rs index fe54c1cf05c8c..edba1a3bd8fbe 100644 --- a/src/test/run-pass/issues/issue-14330.rs +++ b/src/test/ui/issues/issue-14330.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(unused_imports)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-14837.rs b/src/test/ui/issues/issue-14837.rs similarity index 97% rename from src/test/run-pass/issues/issue-14837.rs rename to src/test/ui/issues/issue-14837.rs index 9945c6e4407ae..0c6617e0ab7b2 100644 --- a/src/test/run-pass/issues/issue-14837.rs +++ b/src/test/ui/issues/issue-14837.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 #[deny(dead_code)] diff --git a/src/test/run-pass/issues/issue-14933.rs b/src/test/ui/issues/issue-14933.rs similarity index 97% rename from src/test/run-pass/issues/issue-14933.rs rename to src/test/ui/issues/issue-14933.rs index 30365bb3e4f41..54a2ca8c9edaf 100644 --- a/src/test/run-pass/issues/issue-14933.rs +++ b/src/test/ui/issues/issue-14933.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 pub type BigRat = T; diff --git a/src/test/run-pass/issues/issue-14959.rs b/src/test/ui/issues/issue-14959.rs similarity index 99% rename from src/test/run-pass/issues/issue-14959.rs rename to src/test/ui/issues/issue-14959.rs index fc245fb424497..8b56b42401941 100644 --- a/src/test/run-pass/issues/issue-14959.rs +++ b/src/test/ui/issues/issue-14959.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 #![feature(fn_traits, unboxed_closures)] diff --git a/src/test/run-pass/issues/issue-15108.rs b/src/test/ui/issues/issue-15108.rs similarity index 96% rename from src/test/run-pass/issues/issue-15108.rs rename to src/test/ui/issues/issue-15108.rs index 7288ff23cb403..e650db05a6b21 100644 --- a/src/test/run-pass/issues/issue-15108.rs +++ b/src/test/ui/issues/issue-15108.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 fn main() {} diff --git a/src/test/run-pass/issues/issue-15261.rs b/src/test/ui/issues/issue-15261.rs similarity index 97% rename from src/test/run-pass/issues/issue-15261.rs rename to src/test/ui/issues/issue-15261.rs index 263f9b0bd4b2a..f5f9978ed9b14 100644 --- a/src/test/run-pass/issues/issue-15261.rs +++ b/src/test/ui/issues/issue-15261.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(non_upper_case_globals)] diff --git a/src/test/run-pass/issues/issue-15689-2.rs b/src/test/ui/issues/issue-15689-2.rs similarity index 97% rename from src/test/run-pass/issues/issue-15689-2.rs rename to src/test/ui/issues/issue-15689-2.rs index dedc66336e7be..30bde2aa85816 100644 --- a/src/test/run-pass/issues/issue-15689-2.rs +++ b/src/test/ui/issues/issue-15689-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-15735.rs b/src/test/ui/issues/issue-15735.rs similarity index 97% rename from src/test/run-pass/issues/issue-15735.rs rename to src/test/ui/issues/issue-15735.rs index 5ac47bd68bcf1..fbe39b27efc31 100644 --- a/src/test/run-pass/issues/issue-15735.rs +++ b/src/test/ui/issues/issue-15735.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] struct A<'a> { a: &'a i32, diff --git a/src/test/run-pass/issues/issue-16596.rs b/src/test/ui/issues/issue-16596.rs similarity index 97% rename from src/test/run-pass/issues/issue-16596.rs rename to src/test/ui/issues/issue-16596.rs index d9583809a89fc..01383c07806c2 100644 --- a/src/test/run-pass/issues/issue-16596.rs +++ b/src/test/ui/issues/issue-16596.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] trait MatrixRow { fn dummy(&self) { }} diff --git a/src/test/run-pass/issues/issue-16668.rs b/src/test/ui/issues/issue-16668.rs similarity index 98% rename from src/test/run-pass/issues/issue-16668.rs rename to src/test/ui/issues/issue-16668.rs index fdb49c6898430..d8af376217807 100644 --- a/src/test/run-pass/issues/issue-16668.rs +++ b/src/test/ui/issues/issue-16668.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] struct Parser<'a, I, O> { parse: Box Result + 'a> diff --git a/src/test/run-pass/issues/issue-17121.rs b/src/test/ui/issues/issue-17121.rs similarity index 98% rename from src/test/run-pass/issues/issue-17121.rs rename to src/test/ui/issues/issue-17121.rs index fafcdde2bbe3e..f280d60e1ce3e 100644 --- a/src/test/run-pass/issues/issue-17121.rs +++ b/src/test/ui/issues/issue-17121.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 // ignore-cloudabi no std::fs diff --git a/src/test/run-pass/issues/issue-17336.rs b/src/test/ui/issues/issue-17336.rs similarity index 97% rename from src/test/run-pass/issues/issue-17336.rs rename to src/test/ui/issues/issue-17336.rs index b1a77d73aa473..b1cbdb87bcd7d 100644 --- a/src/test/run-pass/issues/issue-17336.rs +++ b/src/test/ui/issues/issue-17336.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(unused_must_use)] #[allow(dead_code)] fn check(a: &str) { diff --git a/src/test/run-pass/issues/issue-17450.rs b/src/test/ui/issues/issue-17450.rs similarity index 97% rename from src/test/run-pass/issues/issue-17450.rs rename to src/test/ui/issues/issue-17450.rs index 67a44951ae038..f5af630cd184a 100644 --- a/src/test/run-pass/issues/issue-17450.rs +++ b/src/test/ui/issues/issue-17450.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code, warnings)] static mut x: isize = 3; diff --git a/src/test/run-pass/issues/issue-17718-const-destructors.rs b/src/test/ui/issues/issue-17718-const-destructors.rs similarity index 97% rename from src/test/run-pass/issues/issue-17718-const-destructors.rs rename to src/test/ui/issues/issue-17718-const-destructors.rs index 16f9cea82fa10..da7a9f13ef2fb 100644 --- a/src/test/run-pass/issues/issue-17718-const-destructors.rs +++ b/src/test/ui/issues/issue-17718-const-destructors.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] struct A; impl Drop for A { diff --git a/src/test/run-pass/issues/issue-17732.rs b/src/test/ui/issues/issue-17732.rs similarity index 97% rename from src/test/run-pass/issues/issue-17732.rs rename to src/test/ui/issues/issue-17732.rs index c0ab42b4264b4..e5b4a2e3edd3b 100644 --- a/src/test/run-pass/issues/issue-17732.rs +++ b/src/test/ui/issues/issue-17732.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-17746.rs b/src/test/ui/issues/issue-17746.rs similarity index 97% rename from src/test/run-pass/issues/issue-17746.rs rename to src/test/ui/issues/issue-17746.rs index 0cdefc290a860..18299c6acb39d 100644 --- a/src/test/run-pass/issues/issue-17746.rs +++ b/src/test/ui/issues/issue-17746.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // Regression test for #17746 diff --git a/src/test/run-pass/issues/issue-17904.rs b/src/test/ui/issues/issue-17904.rs similarity index 97% rename from src/test/run-pass/issues/issue-17904.rs rename to src/test/ui/issues/issue-17904.rs index 9b76c9fca2aed..8de0f6d2922c8 100644 --- a/src/test/run-pass/issues/issue-17904.rs +++ b/src/test/ui/issues/issue-17904.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // Test that we can parse where clauses on various forms of tuple // structs. diff --git a/src/test/run-pass/issues/issue-18083.rs b/src/test/ui/issues/issue-18083.rs similarity index 98% rename from src/test/run-pass/issues/issue-18083.rs rename to src/test/ui/issues/issue-18083.rs index 9118ad28493d5..c370b3605f81b 100644 --- a/src/test/run-pass/issues/issue-18083.rs +++ b/src/test/ui/issues/issue-18083.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(unused_imports)] // These crossed imports should resolve fine, and not block on diff --git a/src/test/run-pass/issues/issue-18088.rs b/src/test/ui/issues/issue-18088.rs similarity index 97% rename from src/test/run-pass/issues/issue-18088.rs rename to src/test/ui/issues/issue-18088.rs index cff5ba70128d7..74014fde36bab 100644 --- a/src/test/run-pass/issues/issue-18088.rs +++ b/src/test/ui/issues/issue-18088.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass pub trait Indexable: std::ops::Index { fn index2(&self, i: usize) -> &T { diff --git a/src/test/run-pass/issues/issue-18188.rs b/src/test/ui/issues/issue-18188.rs similarity index 98% rename from src/test/run-pass/issues/issue-18188.rs rename to src/test/ui/issues/issue-18188.rs index 60d8edc9d590b..b047ee4a4d6d2 100644 --- a/src/test/run-pass/issues/issue-18188.rs +++ b/src/test/ui/issues/issue-18188.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 pub trait Promisable: Send + Sync {} diff --git a/src/test/run-pass/issues/issue-18446.rs b/src/test/ui/issues/issue-18446-2.rs similarity index 97% rename from src/test/run-pass/issues/issue-18446.rs rename to src/test/ui/issues/issue-18446-2.rs index 09f3e451ad134..90cc9b4bc4335 100644 --- a/src/test/run-pass/issues/issue-18446.rs +++ b/src/test/ui/issues/issue-18446-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // Test that methods in trait impls should override default methods. diff --git a/src/test/run-pass/issues/issue-18738.rs b/src/test/ui/issues/issue-18738.rs similarity index 97% rename from src/test/run-pass/issues/issue-18738.rs rename to src/test/ui/issues/issue-18738.rs index 8ed663cbbd6f4..defd8f97cbcbd 100644 --- a/src/test/run-pass/issues/issue-18738.rs +++ b/src/test/ui/issues/issue-18738.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #[derive(Eq, PartialEq, PartialOrd, Ord)] enum Test<'a> { diff --git a/src/test/run-pass/issues/issue-18809.rs b/src/test/ui/issues/issue-18809.rs similarity index 97% rename from src/test/run-pass/issues/issue-18809.rs rename to src/test/ui/issues/issue-18809.rs index 1895b3bdfe456..f4ce51b677adc 100644 --- a/src/test/run-pass/issues/issue-18809.rs +++ b/src/test/ui/issues/issue-18809.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass trait Tup { type T0; type T1; diff --git a/src/test/run-pass/issues/issue-18906.rs b/src/test/ui/issues/issue-18906.rs similarity index 98% rename from src/test/run-pass/issues/issue-18906.rs rename to src/test/ui/issues/issue-18906.rs index 4f771752c865a..15701a2a45ab2 100644 --- a/src/test/run-pass/issues/issue-18906.rs +++ b/src/test/ui/issues/issue-18906.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-19037.rs b/src/test/ui/issues/issue-19037.rs similarity index 97% rename from src/test/run-pass/issues/issue-19037.rs rename to src/test/ui/issues/issue-19037.rs index 350c17415dacb..59b7d40ae0d84 100644 --- a/src/test/run-pass/issues/issue-19037.rs +++ b/src/test/ui/issues/issue-19037.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-19081.rs b/src/test/ui/issues/issue-19081.rs similarity index 97% rename from src/test/run-pass/issues/issue-19081.rs rename to src/test/ui/issues/issue-19081.rs index 56ceaaf9884a3..4188670f8f67a 100644 --- a/src/test/run-pass/issues/issue-19081.rs +++ b/src/test/ui/issues/issue-19081.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass pub trait Hasher { type State; diff --git a/src/test/run-pass/issues/issue-19097.rs b/src/test/ui/issues/issue-19097.rs similarity index 97% rename from src/test/run-pass/issues/issue-19097.rs rename to src/test/ui/issues/issue-19097.rs index 1ad7f524be462..8198a40b0c1d9 100644 --- a/src/test/run-pass/issues/issue-19097.rs +++ b/src/test/ui/issues/issue-19097.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // regression test for #19097 diff --git a/src/test/run-pass/issues/issue-19098.rs b/src/test/ui/issues/issue-19098.rs similarity index 97% rename from src/test/run-pass/issues/issue-19098.rs rename to src/test/ui/issues/issue-19098.rs index 5b114659ae9e0..c985f7aad1433 100644 --- a/src/test/run-pass/issues/issue-19098.rs +++ b/src/test/ui/issues/issue-19098.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass pub trait Handler { fn handle(&self, _: &mut String); } diff --git a/src/test/run-pass/issues/issue-19102.rs b/src/test/ui/issues/issue-19102.rs similarity index 97% rename from src/test/run-pass/issues/issue-19102.rs rename to src/test/ui/issues/issue-19102.rs index c26dca255b99e..48b5fece1dfc8 100644 --- a/src/test/run-pass/issues/issue-19102.rs +++ b/src/test/ui/issues/issue-19102.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(unused_imports)] #![deny(unused_qualifications)] diff --git a/src/test/run-pass/issues/issue-19129-1.rs b/src/test/ui/issues/issue-19129-1.rs similarity index 97% rename from src/test/run-pass/issues/issue-19129-1.rs rename to src/test/ui/issues/issue-19129-1.rs index cdb23e627c970..97bd20be7d712 100644 --- a/src/test/run-pass/issues/issue-19129-1.rs +++ b/src/test/ui/issues/issue-19129-1.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 trait Trait { diff --git a/src/test/run-pass/issues/issue-19129-2.rs b/src/test/ui/issues/issue-19129-2.rs similarity index 97% rename from src/test/run-pass/issues/issue-19129-2.rs rename to src/test/ui/issues/issue-19129-2.rs index 8d43ece368024..9b1bc2b8ec45b 100644 --- a/src/test/run-pass/issues/issue-19129-2.rs +++ b/src/test/ui/issues/issue-19129-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(unused_variables)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-19398.rs b/src/test/ui/issues/issue-19398.rs similarity index 97% rename from src/test/run-pass/issues/issue-19398.rs rename to src/test/ui/issues/issue-19398.rs index dd2a796dba348..c8a7292b24300 100644 --- a/src/test/run-pass/issues/issue-19398.rs +++ b/src/test/ui/issues/issue-19398.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 trait T { diff --git a/src/test/run-pass/issues/issue-19404.rs b/src/test/ui/issues/issue-19404.rs similarity index 98% rename from src/test/run-pass/issues/issue-19404.rs rename to src/test/ui/issues/issue-19404.rs index 3f8aad4e0b148..f74b2eb1065b9 100644 --- a/src/test/run-pass/issues/issue-19404.rs +++ b/src/test/ui/issues/issue-19404.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(unused_variables)] use std::any::TypeId; diff --git a/src/test/run-pass/issues/issue-19479.rs b/src/test/ui/issues/issue-19479.rs similarity index 97% rename from src/test/run-pass/issues/issue-19479.rs rename to src/test/ui/issues/issue-19479.rs index 6326dfd8fe050..fae040a092f63 100644 --- a/src/test/run-pass/issues/issue-19479.rs +++ b/src/test/ui/issues/issue-19479.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 trait Base { diff --git a/src/test/run-pass/issues/issue-19631.rs b/src/test/ui/issues/issue-19631.rs similarity index 97% rename from src/test/run-pass/issues/issue-19631.rs rename to src/test/ui/issues/issue-19631.rs index 604e3d608741a..c46cb2c87df98 100644 --- a/src/test/run-pass/issues/issue-19631.rs +++ b/src/test/ui/issues/issue-19631.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-19632.rs b/src/test/ui/issues/issue-19632.rs similarity index 97% rename from src/test/run-pass/issues/issue-19632.rs rename to src/test/ui/issues/issue-19632.rs index 5784886e94c95..c641aee29409d 100644 --- a/src/test/run-pass/issues/issue-19632.rs +++ b/src/test/ui/issues/issue-19632.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-19850.rs b/src/test/ui/issues/issue-19850.rs similarity index 98% rename from src/test/run-pass/issues/issue-19850.rs rename to src/test/ui/issues/issue-19850.rs index f5b1697528f04..179135baf2577 100644 --- a/src/test/run-pass/issues/issue-19850.rs +++ b/src/test/ui/issues/issue-19850.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(unused_variables)] // Test that `::Output` and `Self::Output` are accepted as type annotations in let // bindings diff --git a/src/test/run-pass/issues/issue-19982.rs b/src/test/ui/issues/issue-19982-2.rs similarity index 98% rename from src/test/run-pass/issues/issue-19982.rs rename to src/test/ui/issues/issue-19982-2.rs index 380cb3cac2285..8c3462dcf45d2 100644 --- a/src/test/run-pass/issues/issue-19982.rs +++ b/src/test/ui/issues/issue-19982-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 #![feature(fn_traits, unboxed_closures)] diff --git a/src/test/run-pass/issues/issue-20009.rs b/src/test/ui/issues/issue-20009.rs similarity index 97% rename from src/test/run-pass/issues/issue-20009.rs rename to src/test/ui/issues/issue-20009.rs index 604395b3dc7c6..a08bd49f599dd 100644 --- a/src/test/run-pass/issues/issue-20009.rs +++ b/src/test/ui/issues/issue-20009.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // Check that associated types are `Sized` // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-20091.rs b/src/test/ui/issues/issue-20091.rs similarity index 98% rename from src/test/run-pass/issues/issue-20091.rs rename to src/test/ui/issues/issue-20091.rs index 46d11b9d9b7d7..cd90e828889d5 100644 --- a/src/test/run-pass/issues/issue-20091.rs +++ b/src/test/ui/issues/issue-20091.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(stable_features)] // ignore-cloudabi no processes diff --git a/src/test/run-pass/issues/issue-20186.rs b/src/test/ui/issues/issue-20186.rs similarity index 97% rename from src/test/run-pass/issues/issue-20186.rs rename to src/test/ui/issues/issue-20186.rs index 16ac2babd4275..fddb1391017d3 100644 --- a/src/test/run-pass/issues/issue-20186.rs +++ b/src/test/ui/issues/issue-20186.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(unused_variables)] struct Foo; diff --git a/src/test/run-pass/issues/issue-20396.rs b/src/test/ui/issues/issue-20396.rs similarity index 97% rename from src/test/run-pass/issues/issue-20396.rs rename to src/test/ui/issues/issue-20396.rs index 6f0ce7ca2d469..13e0347cb0807 100644 --- a/src/test/run-pass/issues/issue-20396.rs +++ b/src/test/ui/issues/issue-20396.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 #![allow(dead_code)] diff --git a/src/test/run-pass/issues/issue-20414.rs b/src/test/ui/issues/issue-20414.rs similarity index 98% rename from src/test/run-pass/issues/issue-20414.rs rename to src/test/ui/issues/issue-20414.rs index f42ba1ff30365..72be151a3bc9b 100644 --- a/src/test/run-pass/issues/issue-20414.rs +++ b/src/test/ui/issues/issue-20414.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-20454.rs b/src/test/ui/issues/issue-20454.rs similarity index 97% rename from src/test/run-pass/issues/issue-20454.rs rename to src/test/ui/issues/issue-20454.rs index e00ddf4905fd8..ba15236324e32 100644 --- a/src/test/run-pass/issues/issue-20454.rs +++ b/src/test/ui/issues/issue-20454.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(unused_must_use)] use std::thread; diff --git a/src/test/run-pass/issues/issue-2063-resource.rs b/src/test/ui/issues/issue-2063-resource.rs similarity index 97% rename from src/test/run-pass/issues/issue-2063-resource.rs rename to src/test/ui/issues/issue-2063-resource.rs index 6e30c13204008..bfe2d7acde677 100644 --- a/src/test/run-pass/issues/issue-2063-resource.rs +++ b/src/test/ui/issues/issue-2063-resource.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // test that autoderef of a type like this does not // cause compiler to loop. Note that no instances diff --git a/src/test/run-pass/issues/issue-20644.rs b/src/test/ui/issues/issue-20644.rs similarity index 98% rename from src/test/run-pass/issues/issue-20644.rs rename to src/test/ui/issues/issue-20644.rs index c53565262e81e..8e50c0becb394 100644 --- a/src/test/run-pass/issues/issue-20644.rs +++ b/src/test/ui/issues/issue-20644.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(unused_imports)] #![allow(stable_features)] diff --git a/src/test/run-pass/issues/issue-20763-1.rs b/src/test/ui/issues/issue-20763-1.rs similarity index 98% rename from src/test/run-pass/issues/issue-20763-1.rs rename to src/test/ui/issues/issue-20763-1.rs index df85f615cd2a5..bebbc914a459c 100644 --- a/src/test/run-pass/issues/issue-20763-1.rs +++ b/src/test/ui/issues/issue-20763-1.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-20763-2.rs b/src/test/ui/issues/issue-20763-2.rs similarity index 98% rename from src/test/run-pass/issues/issue-20763-2.rs rename to src/test/ui/issues/issue-20763-2.rs index 489b87ce90f8d..87f4e54a6adae 100644 --- a/src/test/run-pass/issues/issue-20763-2.rs +++ b/src/test/ui/issues/issue-20763-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-20797.rs b/src/test/ui/issues/issue-20797.rs similarity index 99% rename from src/test/run-pass/issues/issue-20797.rs rename to src/test/ui/issues/issue-20797.rs index 9c8a2571deb4c..70be78ee7b2d4 100644 --- a/src/test/run-pass/issues/issue-20797.rs +++ b/src/test/ui/issues/issue-20797.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // ignore-cloudabi no std::fs // Regression test for #20797. diff --git a/src/test/run-pass/issues/issue-20825.rs b/src/test/ui/issues/issue-20825-2.rs similarity index 97% rename from src/test/run-pass/issues/issue-20825.rs rename to src/test/ui/issues/issue-20825-2.rs index 62435fd343e85..fe2756e281409 100644 --- a/src/test/run-pass/issues/issue-20825.rs +++ b/src/test/ui/issues/issue-20825-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass pub trait Subscriber { type Input; } diff --git a/src/test/run-pass/issues/issue-21140.rs b/src/test/ui/issues/issue-21140.rs similarity index 97% rename from src/test/run-pass/issues/issue-21140.rs rename to src/test/ui/issues/issue-21140.rs index ebd5f6752e3a8..fd04b7fcee8ee 100644 --- a/src/test/run-pass/issues/issue-21140.rs +++ b/src/test/ui/issues/issue-21140.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass pub trait Trait where Self::Out: std::fmt::Display { type Out; } diff --git a/src/test/run-pass/issues/issue-21174.rs b/src/test/ui/issues/issue-21174-2.rs similarity index 97% rename from src/test/run-pass/issues/issue-21174.rs rename to src/test/ui/issues/issue-21174-2.rs index f387b93d8f92a..e7524a942b224 100644 --- a/src/test/run-pass/issues/issue-21174.rs +++ b/src/test/ui/issues/issue-21174-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(unused_variables)] trait Trait<'a> { diff --git a/src/test/run-pass/issues/issue-21245.rs b/src/test/ui/issues/issue-21245.rs similarity index 99% rename from src/test/run-pass/issues/issue-21245.rs rename to src/test/ui/issues/issue-21245.rs index 234d70e4dd012..64b322f472bbd 100644 --- a/src/test/run-pass/issues/issue-21245.rs +++ b/src/test/ui/issues/issue-21245.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // Regression test for issue #21245. Check that we are able to infer // the types in these examples correctly. It used to be that diff --git a/src/test/run-pass/issues/issue-21363.rs b/src/test/ui/issues/issue-21363.rs similarity index 97% rename from src/test/run-pass/issues/issue-21363.rs rename to src/test/ui/issues/issue-21363.rs index e7f7a80a1deeb..06c5ccbb6ccdb 100644 --- a/src/test/run-pass/issues/issue-21363.rs +++ b/src/test/ui/issues/issue-21363.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 #![no_implicit_prelude] diff --git a/src/test/run-pass/issues/issue-21402.rs b/src/test/ui/issues/issue-21402.rs similarity index 97% rename from src/test/run-pass/issues/issue-21402.rs rename to src/test/ui/issues/issue-21402.rs index 041547a5728fe..32633469ea46f 100644 --- a/src/test/run-pass/issues/issue-21402.rs +++ b/src/test/ui/issues/issue-21402.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-21520.rs b/src/test/ui/issues/issue-21520.rs similarity index 98% rename from src/test/run-pass/issues/issue-21520.rs rename to src/test/ui/issues/issue-21520.rs index 33d79b6616296..aac41196215d2 100644 --- a/src/test/run-pass/issues/issue-21520.rs +++ b/src/test/ui/issues/issue-21520.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // Test that the requirement (in `Bar`) that `T::Bar : 'static` does // not wind up propagating to `T`. diff --git a/src/test/run-pass/issues/issue-21562.rs b/src/test/ui/issues/issue-21562.rs similarity index 97% rename from src/test/run-pass/issues/issue-21562.rs rename to src/test/ui/issues/issue-21562.rs index 4e90ed7c4473e..2cf97cec31c33 100644 --- a/src/test/run-pass/issues/issue-21562.rs +++ b/src/test/ui/issues/issue-21562.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(non_upper_case_globals)] diff --git a/src/test/run-pass/issues/issue-21622.rs b/src/test/ui/issues/issue-21622.rs similarity index 97% rename from src/test/run-pass/issues/issue-21622.rs rename to src/test/ui/issues/issue-21622.rs index 16db178452e7b..880b3524e1074 100644 --- a/src/test/run-pass/issues/issue-21622.rs +++ b/src/test/ui/issues/issue-21622.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(unused_variables)] diff --git a/src/test/run-pass/issues/issue-21634.rs b/src/test/ui/issues/issue-21634.rs similarity index 98% rename from src/test/run-pass/issues/issue-21634.rs rename to src/test/ui/issues/issue-21634.rs index 8c914ac5adc62..d21f562395313 100644 --- a/src/test/run-pass/issues/issue-21634.rs +++ b/src/test/ui/issues/issue-21634.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(stable_features)] #![feature(cfg_target_feature)] diff --git a/src/test/run-pass/issues/issue-21726.rs b/src/test/ui/issues/issue-21726.rs similarity index 98% rename from src/test/run-pass/issues/issue-21726.rs rename to src/test/ui/issues/issue-21726.rs index ffdff9aa2bafc..b25fe1bc9540c 100644 --- a/src/test/run-pass/issues/issue-21726.rs +++ b/src/test/ui/issues/issue-21726.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // Regression test for #21726: an issue arose around the rules for // subtyping of projection types that resulted in an unconstrained diff --git a/src/test/run-pass/issues/issue-21891.rs b/src/test/ui/issues/issue-21891.rs similarity index 97% rename from src/test/run-pass/issues/issue-21891.rs rename to src/test/ui/issues/issue-21891.rs index 90a496617b0ce..d83cf08d1733d 100644 --- a/src/test/run-pass/issues/issue-21891.rs +++ b/src/test/ui/issues/issue-21891.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(non_upper_case_globals)] diff --git a/src/test/run-pass/issues/issue-22066.rs b/src/test/ui/issues/issue-22066.rs similarity index 97% rename from src/test/run-pass/issues/issue-22066.rs rename to src/test/ui/issues/issue-22066.rs index ef4753703bf58..76dae2a2602e0 100644 --- a/src/test/run-pass/issues/issue-22066.rs +++ b/src/test/ui/issues/issue-22066.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass pub trait LineFormatter<'a> { type Iter: Iterator + 'a; fn iter(&'a self, line: &'a str) -> Self::Iter; diff --git a/src/test/run-pass/issues/issue-22356.rs b/src/test/ui/issues/issue-22356.rs similarity index 98% rename from src/test/run-pass/issues/issue-22356.rs rename to src/test/ui/issues/issue-22356.rs index 6e62ae069829e..87ea53a3f204b 100644 --- a/src/test/run-pass/issues/issue-22356.rs +++ b/src/test/ui/issues/issue-22356.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(type_alias_bounds)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-22375.rs b/src/test/ui/issues/issue-22375.rs similarity index 96% rename from src/test/run-pass/issues/issue-22375.rs rename to src/test/ui/issues/issue-22375.rs index cf7ff0c404c06..a30f5f7638750 100644 --- a/src/test/run-pass/issues/issue-22375.rs +++ b/src/test/ui/issues/issue-22375.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass trait A> {} fn main() {} diff --git a/src/test/run-pass/issues/issue-22471.rs b/src/test/ui/issues/issue-22471.rs similarity index 97% rename from src/test/run-pass/issues/issue-22471.rs rename to src/test/ui/issues/issue-22471.rs index b93f1f354c61a..c13b9dd9248a5 100644 --- a/src/test/run-pass/issues/issue-22471.rs +++ b/src/test/ui/issues/issue-22471.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(type_alias_bounds)] diff --git a/src/test/run-pass/issues/issue-22781.rs b/src/test/ui/issues/issue-22781.rs similarity index 98% rename from src/test/run-pass/issues/issue-22781.rs rename to src/test/ui/issues/issue-22781.rs index 8849b505e4b01..21e6138e4965d 100644 --- a/src/test/run-pass/issues/issue-22781.rs +++ b/src/test/ui/issues/issue-22781.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(unused_variables)] use std::collections::HashMap; use std::collections::hash_map::Entry::Vacant; diff --git a/src/test/run-pass/issues/issue-22814.rs b/src/test/ui/issues/issue-22814.rs similarity index 97% rename from src/test/run-pass/issues/issue-22814.rs rename to src/test/ui/issues/issue-22814.rs index 13c7dab375110..0d11484d96879 100644 --- a/src/test/run-pass/issues/issue-22814.rs +++ b/src/test/ui/issues/issue-22814.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass trait Test {} macro_rules! test { diff --git a/src/test/run-pass/issues/issue-22894.rs b/src/test/ui/issues/issue-22894.rs similarity index 97% rename from src/test/run-pass/issues/issue-22894.rs rename to src/test/ui/issues/issue-22894.rs index d1cd8efd73c26..f5ecd17d78816 100644 --- a/src/test/run-pass/issues/issue-22894.rs +++ b/src/test/ui/issues/issue-22894.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #[allow(dead_code)] static X: &'static str = &*""; fn main() {} diff --git a/src/test/run-pass/issues/issue-23406.rs b/src/test/ui/issues/issue-23406.rs similarity index 97% rename from src/test/run-pass/issues/issue-23406.rs rename to src/test/ui/issues/issue-23406.rs index 771f62a6323f4..eef35fe6f2484 100644 --- a/src/test/run-pass/issues/issue-23406.rs +++ b/src/test/ui/issues/issue-23406.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] trait Inner { type T; diff --git a/src/test/run-pass/issues/issue-23442.rs b/src/test/ui/issues/issue-23442.rs similarity index 98% rename from src/test/run-pass/issues/issue-23442.rs rename to src/test/ui/issues/issue-23442.rs index 1b31516be17f8..9907cf6b687eb 100644 --- a/src/test/run-pass/issues/issue-23442.rs +++ b/src/test/ui/issues/issue-23442.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] use std::marker::PhantomData; diff --git a/src/test/run-pass/issues/issue-23477.rs b/src/test/ui/issues/issue-23477.rs similarity index 97% rename from src/test/run-pass/issues/issue-23477.rs rename to src/test/ui/issues/issue-23477.rs index c862b0dbc2fa5..6d4fdcd08b64c 100644 --- a/src/test/run-pass/issues/issue-23477.rs +++ b/src/test/ui/issues/issue-23477.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // compiler-flags: -g pub struct Dst { diff --git a/src/test/run-pass/issues/issue-23550.rs b/src/test/ui/issues/issue-23550.rs similarity index 98% rename from src/test/run-pass/issues/issue-23550.rs rename to src/test/ui/issues/issue-23550.rs index 143e0babcd962..e5b672bc3e7c0 100644 --- a/src/test/run-pass/issues/issue-23550.rs +++ b/src/test/ui/issues/issue-23550.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![feature(core_intrinsics)] #![allow(warnings)] diff --git a/src/test/run-pass/issues/issue-23649-3.rs b/src/test/ui/issues/issue-23649-3.rs similarity index 97% rename from src/test/run-pass/issues/issue-23649-3.rs rename to src/test/ui/issues/issue-23649-3.rs index 067628ec12af9..b2c9183c16c93 100644 --- a/src/test/run-pass/issues/issue-23649-3.rs +++ b/src/test/ui/issues/issue-23649-3.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #[derive(PartialEq)] struct Slice { slice: [u8] } diff --git a/src/test/run-pass/issues/issue-24085.rs b/src/test/ui/issues/issue-24085.rs similarity index 98% rename from src/test/run-pass/issues/issue-24085.rs rename to src/test/ui/issues/issue-24085.rs index 06350a80730ad..e74f993df67db 100644 --- a/src/test/run-pass/issues/issue-24085.rs +++ b/src/test/ui/issues/issue-24085.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // Regression test for #24085. Errors were occurring in region // inference due to the requirement that `'a:b'`, which was getting diff --git a/src/test/run-pass/issues/issue-24227.rs b/src/test/ui/issues/issue-24227.rs similarity index 97% rename from src/test/run-pass/issues/issue-24227.rs rename to src/test/ui/issues/issue-24227.rs index 86241b1763aeb..f2c67e19eef7c 100644 --- a/src/test/run-pass/issues/issue-24227.rs +++ b/src/test/ui/issues/issue-24227.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // This resulted in an ICE. Test for future-proofing // Issue #24227 diff --git a/src/test/run-pass/issues/issue-24389.rs b/src/test/ui/issues/issue-24389.rs similarity index 97% rename from src/test/run-pass/issues/issue-24389.rs rename to src/test/ui/issues/issue-24389.rs index 5eb622bb932b9..704a71dbb1edc 100644 --- a/src/test/run-pass/issues/issue-24389.rs +++ b/src/test/ui/issues/issue-24389.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] struct Foo; diff --git a/src/test/run-pass/issues/issue-24434.rs b/src/test/ui/issues/issue-24434.rs similarity index 97% rename from src/test/run-pass/issues/issue-24434.rs rename to src/test/ui/issues/issue-24434.rs index 7fdd6f8ee8be3..490d6dfadec53 100644 --- a/src/test/run-pass/issues/issue-24434.rs +++ b/src/test/ui/issues/issue-24434.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(unused_attributes)] // compile-flags:--cfg set1 diff --git a/src/test/run-pass/issues/issue-25180.rs b/src/test/ui/issues/issue-25180.rs similarity index 97% rename from src/test/run-pass/issues/issue-25180.rs rename to src/test/ui/issues/issue-25180.rs index 04a28fb8f0a29..5f15393dacc12 100644 --- a/src/test/run-pass/issues/issue-25180.rs +++ b/src/test/ui/issues/issue-25180.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(non_upper_case_globals)] diff --git a/src/test/run-pass/issues/issue-25394.rs b/src/test/ui/issues/issue-25394.rs similarity index 97% rename from src/test/run-pass/issues/issue-25394.rs rename to src/test/ui/issues/issue-25394.rs index 4e7b6242712b9..eaa44623f40e6 100644 --- a/src/test/run-pass/issues/issue-25394.rs +++ b/src/test/ui/issues/issue-25394.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #[derive(Debug)] struct Row([T]); diff --git a/src/test/run-pass/issues/issue-26095.rs b/src/test/ui/issues/issue-26095.rs similarity index 97% rename from src/test/run-pass/issues/issue-26095.rs rename to src/test/ui/issues/issue-26095.rs index cc7f7cdbab1f7..cf33cf3cb6e17 100644 --- a/src/test/run-pass/issues/issue-26095.rs +++ b/src/test/ui/issues/issue-26095.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(non_upper_case_globals)] diff --git a/src/test/run-pass/issues/issue-26205.rs b/src/test/ui/issues/issue-26205.rs similarity index 98% rename from src/test/run-pass/issues/issue-26205.rs rename to src/test/ui/issues/issue-26205.rs index ce96c3dd5a2a3..ccadee457506e 100644 --- a/src/test/run-pass/issues/issue-26205.rs +++ b/src/test/ui/issues/issue-26205.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] use std::ops::{Deref, DerefMut}; diff --git a/src/test/run-pass/issues/issue-26646.rs b/src/test/ui/issues/issue-26646.rs similarity index 97% rename from src/test/run-pass/issues/issue-26646.rs rename to src/test/ui/issues/issue-26646.rs index 05602f7504eb8..a587db00dcf2d 100644 --- a/src/test/run-pass/issues/issue-26646.rs +++ b/src/test/ui/issues/issue-26646.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![deny(unused_attributes)] #[repr(C)] diff --git a/src/test/run-pass/issues/issue-26997.rs b/src/test/ui/issues/issue-26997.rs similarity index 97% rename from src/test/run-pass/issues/issue-26997.rs rename to src/test/ui/issues/issue-26997.rs index 03430e1ac687d..1a4850d245919 100644 --- a/src/test/run-pass/issues/issue-26997.rs +++ b/src/test/ui/issues/issue-26997.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] pub struct Foo { x: isize, diff --git a/src/test/run-pass/issues/issue-27105.rs b/src/test/ui/issues/issue-27105.rs similarity index 97% rename from src/test/run-pass/issues/issue-27105.rs rename to src/test/ui/issues/issue-27105.rs index e565acde2f01e..c2a0baaba2844 100644 --- a/src/test/run-pass/issues/issue-27105.rs +++ b/src/test/ui/issues/issue-27105.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass use std::cell::RefCell; use std::rc::Rc; diff --git a/src/test/run-pass/issues/issue-27281.rs b/src/test/ui/issues/issue-27281.rs similarity index 97% rename from src/test/run-pass/issues/issue-27281.rs rename to src/test/ui/issues/issue-27281.rs index 1dc4ac5cdcc91..1dfbe21921ec4 100644 --- a/src/test/run-pass/issues/issue-27281.rs +++ b/src/test/ui/issues/issue-27281.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass pub trait Trait<'a> { type T; type U; diff --git a/src/test/run-pass/issues/issue-27583.rs b/src/test/ui/issues/issue-27583.rs similarity index 99% rename from src/test/run-pass/issues/issue-27583.rs rename to src/test/ui/issues/issue-27583.rs index 1a1ad2bc1945b..c0a981f60ee00 100644 --- a/src/test/run-pass/issues/issue-27583.rs +++ b/src/test/ui/issues/issue-27583.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // Regression test for issue #27583. Unclear how useful this will be // going forward, since the issue in question was EXTREMELY sensitive // to compiler internals (like the precise numbering of nodes), but diff --git a/src/test/run-pass/issues/issue-27889.rs b/src/test/ui/issues/issue-27889.rs similarity index 98% rename from src/test/run-pass/issues/issue-27889.rs rename to src/test/ui/issues/issue-27889.rs index 82d178835e2d2..4e4ef64c5b683 100644 --- a/src/test/run-pass/issues/issue-27889.rs +++ b/src/test/ui/issues/issue-27889.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(unused_assignments)] #![allow(unused_variables)] // Test that a field can have the same name in different variants diff --git a/src/test/run-pass/issues/issue-28279.rs b/src/test/ui/issues/issue-28279.rs similarity index 98% rename from src/test/run-pass/issues/issue-28279.rs rename to src/test/ui/issues/issue-28279.rs index bd5129a8ae4d9..c3f2c73e845f5 100644 --- a/src/test/run-pass/issues/issue-28279.rs +++ b/src/test/ui/issues/issue-28279.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] use std::rc::Rc; diff --git a/src/test/run-pass/issues/issue-28561.rs b/src/test/ui/issues/issue-28561.rs similarity index 99% rename from src/test/run-pass/issues/issue-28561.rs rename to src/test/ui/issues/issue-28561.rs index 5927ce77f8eda..28fac2cba0fab 100644 --- a/src/test/run-pass/issues/issue-28561.rs +++ b/src/test/ui/issues/issue-28561.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #[derive(Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)] struct Array { f00: [T; 00], diff --git a/src/test/run-pass/issues/issue-28600.rs b/src/test/ui/issues/issue-28600.rs similarity index 97% rename from src/test/run-pass/issues/issue-28600.rs rename to src/test/ui/issues/issue-28600.rs index 0f3573f7e62ee..88842ad9ca59e 100644 --- a/src/test/run-pass/issues/issue-28600.rs +++ b/src/test/ui/issues/issue-28600.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // #28600 ICE: pub extern fn with parameter type &str inside struct impl struct Test; diff --git a/src/test/run-pass/issues/issue-28822.rs b/src/test/ui/issues/issue-28822.rs similarity index 97% rename from src/test/run-pass/issues/issue-28822.rs rename to src/test/ui/issues/issue-28822.rs index 1dda721295231..af8531feff23a 100644 --- a/src/test/run-pass/issues/issue-28822.rs +++ b/src/test/ui/issues/issue-28822.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![feature(min_const_fn)] diff --git a/src/test/run-pass/issues/issue-28871.rs b/src/test/ui/issues/issue-28871.rs similarity index 98% rename from src/test/run-pass/issues/issue-28871.rs rename to src/test/ui/issues/issue-28871.rs index 2be3240927420..0602b9b2297ee 100644 --- a/src/test/run-pass/issues/issue-28871.rs +++ b/src/test/ui/issues/issue-28871.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // Regression test for #28871. The problem is that rustc encountered // two ways to project, one from a where clause and one from the where // clauses on the trait definition. (In fact, in this case, the where diff --git a/src/test/run-pass/issues/issue-28936.rs b/src/test/ui/issues/issue-28936.rs similarity index 98% rename from src/test/run-pass/issues/issue-28936.rs rename to src/test/ui/issues/issue-28936.rs index 1e3e3474c171c..fd05383879577 100644 --- a/src/test/run-pass/issues/issue-28936.rs +++ b/src/test/ui/issues/issue-28936.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass pub type Session = i32; pub struct StreamParser<'a, T> { _tokens: T, diff --git a/src/test/run-pass/issues/issue-28999.rs b/src/test/ui/issues/issue-28999.rs similarity index 97% rename from src/test/run-pass/issues/issue-28999.rs rename to src/test/ui/issues/issue-28999.rs index bb5747ca7443a..7f4ccc971b77a 100644 --- a/src/test/run-pass/issues/issue-28999.rs +++ b/src/test/ui/issues/issue-28999.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass pub struct Xyz<'a, V> { pub v: (V, &'a u32), } diff --git a/src/test/run-pass/issues/issue-29030.rs b/src/test/ui/issues/issue-29030.rs similarity index 97% rename from src/test/run-pass/issues/issue-29030.rs rename to src/test/ui/issues/issue-29030.rs index 9f4b2cffbbb13..08460e18c1336 100644 --- a/src/test/run-pass/issues/issue-29030.rs +++ b/src/test/ui/issues/issue-29030.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #[derive(Debug)] struct Message<'a, P: 'a = &'a [u8]> { diff --git a/src/test/run-pass/issues/issue-29037.rs b/src/test/ui/issues/issue-29037.rs similarity index 98% rename from src/test/run-pass/issues/issue-29037.rs rename to src/test/ui/issues/issue-29037.rs index 3148e61827ff0..cb15e4048b959 100644 --- a/src/test/run-pass/issues/issue-29037.rs +++ b/src/test/ui/issues/issue-29037.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // This test ensures that each pointer type `P` is covariant in `X`. diff --git a/src/test/run-pass/issues/issue-29048.rs b/src/test/ui/issues/issue-29048.rs similarity index 97% rename from src/test/run-pass/issues/issue-29048.rs rename to src/test/ui/issues/issue-29048.rs index f889cd8af6170..cbd0eab8b1c51 100644 --- a/src/test/run-pass/issues/issue-29048.rs +++ b/src/test/ui/issues/issue-29048.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass pub struct Chan; pub struct ChanSelect<'c, T> { chans: Vec<(&'c Chan, T)>, diff --git a/src/test/run-pass/issues/issue-29071.rs b/src/test/ui/issues/issue-29071.rs similarity index 97% rename from src/test/run-pass/issues/issue-29071.rs rename to src/test/ui/issues/issue-29071.rs index 1eab5a7bbdad1..874978826cadd 100644 --- a/src/test/run-pass/issues/issue-29071.rs +++ b/src/test/ui/issues/issue-29071.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(non_upper_case_globals)] diff --git a/src/test/run-pass/issues/issue-29276.rs b/src/test/ui/issues/issue-29276.rs similarity index 97% rename from src/test/run-pass/issues/issue-29276.rs rename to src/test/ui/issues/issue-29276.rs index 9f2a0d6bc99b9..4ea720bfb7ca0 100644 --- a/src/test/run-pass/issues/issue-29276.rs +++ b/src/test/ui/issues/issue-29276.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] struct S([u8; { struct Z; 0 }]); diff --git a/src/test/run-pass/issues/issue-29516.rs b/src/test/ui/issues/issue-29516.rs similarity index 97% rename from src/test/run-pass/issues/issue-29516.rs rename to src/test/ui/issues/issue-29516.rs index 55caa65f1cfe3..8315585e15ed9 100644 --- a/src/test/run-pass/issues/issue-29516.rs +++ b/src/test/ui/issues/issue-29516.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![feature(optin_builtin_traits)] auto trait NotSame {} diff --git a/src/test/run-pass/issues/issue-29540.rs b/src/test/ui/issues/issue-29540.rs similarity index 99% rename from src/test/run-pass/issues/issue-29540.rs rename to src/test/ui/issues/issue-29540.rs index 7e01efcd05f3b..0dbd830c13501 100644 --- a/src/test/run-pass/issues/issue-29540.rs +++ b/src/test/ui/issues/issue-29540.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #[derive(Debug)] pub struct Config { pub name: String, diff --git a/src/test/run-pass/issues/issue-29710.rs b/src/test/ui/issues/issue-29710.rs similarity index 97% rename from src/test/run-pass/issues/issue-29710.rs rename to src/test/ui/issues/issue-29710.rs index fa768340b71ac..971aac8f694dd 100644 --- a/src/test/run-pass/issues/issue-29710.rs +++ b/src/test/ui/issues/issue-29710.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![deny(unused_results)] #![allow(dead_code)] diff --git a/src/test/run-pass/issues/issue-29740.rs b/src/test/ui/issues/issue-29740.rs similarity index 99% rename from src/test/run-pass/issues/issue-29740.rs rename to src/test/ui/issues/issue-29740.rs index 3854ad38bdcd2..e383b712f24a3 100644 --- a/src/test/run-pass/issues/issue-29740.rs +++ b/src/test/ui/issues/issue-29740.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // Regression test for #29740. Inefficient MIR matching algorithms // generated way too much code for this sort of case, leading to OOM. diff --git a/src/test/run-pass/issues/issue-31260.rs b/src/test/ui/issues/issue-31260.rs similarity index 97% rename from src/test/run-pass/issues/issue-31260.rs rename to src/test/ui/issues/issue-31260.rs index 82d0d5b5ffbb6..085a6e19eb158 100644 --- a/src/test/run-pass/issues/issue-31260.rs +++ b/src/test/ui/issues/issue-31260.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] pub struct Struct { pub field: K, diff --git a/src/test/run-pass/issues/issue-31597.rs b/src/test/ui/issues/issue-31597.rs similarity index 98% rename from src/test/run-pass/issues/issue-31597.rs rename to src/test/ui/issues/issue-31597.rs index f3995511b0fc9..163b7385c8bcb 100644 --- a/src/test/run-pass/issues/issue-31597.rs +++ b/src/test/ui/issues/issue-31597.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] trait Make { type Out; diff --git a/src/test/run-pass/issues/issue-32324.rs b/src/test/ui/issues/issue-32324.rs similarity index 98% rename from src/test/run-pass/issues/issue-32324.rs rename to src/test/ui/issues/issue-32324.rs index 483ddaeb9578d..92d88d543a58f 100644 --- a/src/test/run-pass/issues/issue-32324.rs +++ b/src/test/ui/issues/issue-32324.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] trait Resources { diff --git a/src/test/run-pass/issues/issue-33264.rs b/src/test/ui/issues/issue-33264.rs similarity index 98% rename from src/test/run-pass/issues/issue-33264.rs rename to src/test/ui/issues/issue-33264.rs index 1c0ad2a659e8d..9b17dae0eef94 100644 --- a/src/test/run-pass/issues/issue-33264.rs +++ b/src/test/ui/issues/issue-33264.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // only-x86_64 #![allow(dead_code, non_upper_case_globals)] diff --git a/src/test/run-pass/issues/issue-33287.rs b/src/test/ui/issues/issue-33287.rs similarity index 97% rename from src/test/run-pass/issues/issue-33287.rs rename to src/test/ui/issues/issue-33287.rs index 31f44ffa34db4..1816d7d4f8878 100644 --- a/src/test/run-pass/issues/issue-33287.rs +++ b/src/test/ui/issues/issue-33287.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(unused_variables)] const A: [u32; 1] = [0]; diff --git a/src/test/run-pass/issues/issue-33903.rs b/src/test/ui/issues/issue-33903.rs similarity index 97% rename from src/test/run-pass/issues/issue-33903.rs rename to src/test/ui/issues/issue-33903.rs index e521b594aa239..bcbb73ce65b96 100644 --- a/src/test/run-pass/issues/issue-33903.rs +++ b/src/test/ui/issues/issue-33903.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // Issue 33903: // Built-in indexing should be used even when the index is not diff --git a/src/test/run-pass/issues/issue-34194.rs b/src/test/ui/issues/issue-34194.rs similarity index 97% rename from src/test/run-pass/issues/issue-34194.rs rename to src/test/ui/issues/issue-34194.rs index dfc0a34651a31..986048a03ee11 100644 --- a/src/test/run-pass/issues/issue-34194.rs +++ b/src/test/ui/issues/issue-34194.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] struct A { diff --git a/src/test/run-pass/issues/issue-34751.rs b/src/test/ui/issues/issue-34751.rs similarity index 97% rename from src/test/run-pass/issues/issue-34751.rs rename to src/test/ui/issues/issue-34751.rs index d4758b80e9793..e39e3c3b309b8 100644 --- a/src/test/run-pass/issues/issue-34751.rs +++ b/src/test/ui/issues/issue-34751.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // #34751 ICE: 'rustc' panicked at 'assertion failed: !substs.has_regions_escaping_depth(0)' diff --git a/src/test/run-pass/issues/issue-34780.rs b/src/test/ui/issues/issue-34780.rs similarity index 97% rename from src/test/run-pass/issues/issue-34780.rs rename to src/test/ui/issues/issue-34780.rs index b7f2871a8d152..90b462a7432f3 100644 --- a/src/test/run-pass/issues/issue-34780.rs +++ b/src/test/ui/issues/issue-34780.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(stable_features)] #![feature(associated_consts)] diff --git a/src/test/run-pass/issues/issue-35376.rs b/src/test/ui/issues/issue-35376.rs similarity index 98% rename from src/test/run-pass/issues/issue-35376.rs rename to src/test/ui/issues/issue-35376.rs index ee8c6c9f35c20..0265a5845f988 100644 --- a/src/test/run-pass/issues/issue-35376.rs +++ b/src/test/ui/issues/issue-35376.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![feature(specialization)] fn main() {} diff --git a/src/test/run-pass/issues/issue-35546.rs b/src/test/ui/issues/issue-35546.rs similarity index 98% rename from src/test/run-pass/issues/issue-35546.rs rename to src/test/ui/issues/issue-35546.rs index 13d099081b05f..79680565ee178 100644 --- a/src/test/run-pass/issues/issue-35546.rs +++ b/src/test/ui/issues/issue-35546.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // Regression test for #35546. Check that we are able to codegen // this. Before we had problems because of the drop glue signature diff --git a/src/test/run-pass/issues/issue-36075.rs b/src/test/ui/issues/issue-36075.rs similarity index 97% rename from src/test/run-pass/issues/issue-36075.rs rename to src/test/ui/issues/issue-36075.rs index 4042bd1979498..fdc10ae936b9a 100644 --- a/src/test/run-pass/issues/issue-36075.rs +++ b/src/test/ui/issues/issue-36075.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] trait DeclarationParser { type Declaration; diff --git a/src/test/run-pass/issues/issue-36744-without-calls.rs b/src/test/ui/issues/issue-36744-without-calls.rs similarity index 97% rename from src/test/run-pass/issues/issue-36744-without-calls.rs rename to src/test/ui/issues/issue-36744-without-calls.rs index ad54d6e403cb4..8a47ebbd0a899 100644 --- a/src/test/run-pass/issues/issue-36744-without-calls.rs +++ b/src/test/ui/issues/issue-36744-without-calls.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // Tests for an LLVM abort when storing a lifetime-parametric fn into // context that is expecting one that is not lifetime-parametric // (i.e. has no `for <'_>`). diff --git a/src/test/run-pass/issues/issue-37598.rs b/src/test/ui/issues/issue-37598.rs similarity index 97% rename from src/test/run-pass/issues/issue-37598.rs rename to src/test/ui/issues/issue-37598.rs index 3001591c406e8..9956301dcc9b3 100644 --- a/src/test/run-pass/issues/issue-37598.rs +++ b/src/test/ui/issues/issue-37598.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![feature(slice_patterns)] diff --git a/src/test/run-pass/issues/issue-37655.rs b/src/test/ui/issues/issue-37655.rs similarity index 98% rename from src/test/run-pass/issues/issue-37655.rs rename to src/test/ui/issues/issue-37655.rs index 899686befc234..472b3383727ae 100644 --- a/src/test/run-pass/issues/issue-37655.rs +++ b/src/test/ui/issues/issue-37655.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // Regression test for #37655. The problem was a false edge created by // coercion that wound up requiring that `'a` (in `split()`) outlive // `'b`, which shouldn't be necessary. diff --git a/src/test/run-pass/issues/issue-37725.rs b/src/test/ui/issues/issue-37725.rs similarity index 97% rename from src/test/run-pass/issues/issue-37725.rs rename to src/test/ui/issues/issue-37725.rs index 8b29dad918d39..fa5bb362c9f6d 100644 --- a/src/test/run-pass/issues/issue-37725.rs +++ b/src/test/ui/issues/issue-37725.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] trait Foo { fn foo(&self); diff --git a/src/test/run-pass/issues/issue-38727.rs b/src/test/ui/issues/issue-38727.rs similarity index 97% rename from src/test/run-pass/issues/issue-38727.rs rename to src/test/ui/issues/issue-38727.rs index ccf0e1c2bdbd7..5774d08473add 100644 --- a/src/test/run-pass/issues/issue-38727.rs +++ b/src/test/ui/issues/issue-38727.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #[repr(u64)] enum A { diff --git a/src/test/run-pass/issues/issue-39089.rs b/src/test/ui/issues/issue-39089.rs similarity index 97% rename from src/test/run-pass/issues/issue-39089.rs rename to src/test/ui/issues/issue-39089.rs index 6908563a81ce5..f6acc4b814df1 100644 --- a/src/test/run-pass/issues/issue-39089.rs +++ b/src/test/ui/issues/issue-39089.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] fn f Sized>() {} diff --git a/src/test/run-pass/issues/issue-39467.rs b/src/test/ui/issues/issue-39467.rs similarity index 97% rename from src/test/run-pass/issues/issue-39467.rs rename to src/test/ui/issues/issue-39467.rs index d54cf3f27c51e..417b3160a4d9b 100644 --- a/src/test/run-pass/issues/issue-39467.rs +++ b/src/test/ui/issues/issue-39467.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] macro_rules! expr { () => { () } } diff --git a/src/test/run-pass/issues/issue-39984.rs b/src/test/ui/issues/issue-39984.rs similarity index 97% rename from src/test/run-pass/issues/issue-39984.rs rename to src/test/ui/issues/issue-39984.rs index c90585cb734ea..cd4b32688d35d 100644 --- a/src/test/run-pass/issues/issue-39984.rs +++ b/src/test/ui/issues/issue-39984.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(unreachable_code)] // Regression test for issue #39984. diff --git a/src/test/run-pass/issues/issue-40136.rs b/src/test/ui/issues/issue-40136.rs similarity index 97% rename from src/test/run-pass/issues/issue-40136.rs rename to src/test/ui/issues/issue-40136.rs index 00d33fae13c11..77f4466ae54e7 100644 --- a/src/test/run-pass/issues/issue-40136.rs +++ b/src/test/ui/issues/issue-40136.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] macro_rules! m { () => { 0 } } diff --git a/src/test/run-pass/issues/issue-40962.rs b/src/test/ui/issues/issue-40962.rs similarity index 97% rename from src/test/run-pass/issues/issue-40962.rs rename to src/test/ui/issues/issue-40962.rs index 9c9fb2ce9cbe0..8b2a53f4032e3 100644 --- a/src/test/run-pass/issues/issue-40962.rs +++ b/src/test/ui/issues/issue-40962.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass macro_rules! m { ($i:meta) => { #[derive($i)] diff --git a/src/test/run-pass/issues/issue-41272.rs b/src/test/ui/issues/issue-41272.rs similarity index 97% rename from src/test/run-pass/issues/issue-41272.rs rename to src/test/ui/issues/issue-41272.rs index 827edd39d2f91..ff8c234ae5ede 100644 --- a/src/test/run-pass/issues/issue-41272.rs +++ b/src/test/ui/issues/issue-41272.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] struct Foo; diff --git a/src/test/run-pass/issues/issue-41298.rs b/src/test/ui/issues/issue-41298.rs similarity index 97% rename from src/test/run-pass/issues/issue-41298.rs rename to src/test/ui/issues/issue-41298.rs index 189c419c5dbbd..808e6a7f05fa1 100644 --- a/src/test/run-pass/issues/issue-41298.rs +++ b/src/test/ui/issues/issue-41298.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] struct Function { t: T, f: F } diff --git a/src/test/run-pass/issues/issue-41628.rs b/src/test/ui/issues/issue-41628.rs similarity index 97% rename from src/test/run-pass/issues/issue-41628.rs rename to src/test/ui/issues/issue-41628.rs index f4b9588ff0567..ac626f0ba387e 100644 --- a/src/test/run-pass/issues/issue-41628.rs +++ b/src/test/ui/issues/issue-41628.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![deny(dead_code)] #[used] diff --git a/src/test/run-pass/issues/issue-41936-variance-coerce-unsized-cycle.rs b/src/test/ui/issues/issue-41936-variance-coerce-unsized-cycle.rs similarity index 98% rename from src/test/run-pass/issues/issue-41936-variance-coerce-unsized-cycle.rs rename to src/test/ui/issues/issue-41936-variance-coerce-unsized-cycle.rs index 1a4b283a81be5..96c9a565233f2 100644 --- a/src/test/run-pass/issues/issue-41936-variance-coerce-unsized-cycle.rs +++ b/src/test/ui/issues/issue-41936-variance-coerce-unsized-cycle.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // Regression test for #41936. The coerce-unsized trait check in // coherence was using subtyping, which triggered variance diff --git a/src/test/run-pass/issues/issue-42467.rs b/src/test/ui/issues/issue-42467.rs similarity index 98% rename from src/test/run-pass/issues/issue-42467.rs rename to src/test/ui/issues/issue-42467.rs index 82bab74a49b66..2acefd718c93c 100644 --- a/src/test/run-pass/issues/issue-42467.rs +++ b/src/test/ui/issues/issue-42467.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] struct Foo(T); diff --git a/src/test/run-pass/issues/issue-42956.rs b/src/test/ui/issues/issue-42956.rs similarity index 98% rename from src/test/run-pass/issues/issue-42956.rs rename to src/test/ui/issues/issue-42956.rs index 2210facf294a5..9dff9f6628206 100644 --- a/src/test/run-pass/issues/issue-42956.rs +++ b/src/test/ui/issues/issue-42956.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(stable_features)] #![feature(associated_consts)] diff --git a/src/test/run-pass/issues/issue-43057.rs b/src/test/ui/issues/issue-43057.rs similarity index 97% rename from src/test/run-pass/issues/issue-43057.rs rename to src/test/ui/issues/issue-43057.rs index 26140246a7f12..ba363e9e29e29 100644 --- a/src/test/run-pass/issues/issue-43057.rs +++ b/src/test/ui/issues/issue-43057.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(unused)] macro_rules! column { diff --git a/src/test/run-pass/issues/issue-43357.rs b/src/test/ui/issues/issue-43357.rs similarity index 97% rename from src/test/run-pass/issues/issue-43357.rs rename to src/test/ui/issues/issue-43357.rs index 558b0712bb1f3..d42f0de4849d1 100644 --- a/src/test/run-pass/issues/issue-43357.rs +++ b/src/test/ui/issues/issue-43357.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] trait Trait { type Output; diff --git a/src/test/run-pass/issues/issue-43483.rs b/src/test/ui/issues/issue-43483.rs similarity index 97% rename from src/test/run-pass/issues/issue-43483.rs rename to src/test/ui/issues/issue-43483.rs index 841bc629ce5b2..9622265ce2e01 100644 --- a/src/test/run-pass/issues/issue-43483.rs +++ b/src/test/ui/issues/issue-43483.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(unused_variables)] trait VecN { diff --git a/src/test/run-pass/issues/issue-44005.rs b/src/test/ui/issues/issue-44005.rs similarity index 98% rename from src/test/run-pass/issues/issue-44005.rs rename to src/test/ui/issues/issue-44005.rs index 699cb18ffc72f..c3599294e37e4 100644 --- a/src/test/run-pass/issues/issue-44005.rs +++ b/src/test/ui/issues/issue-44005.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass pub trait Foo<'a> { type Bar; fn foo(&'a self) -> Self::Bar; diff --git a/src/test/run-pass/issues/issue-44056.rs b/src/test/ui/issues/issue-44056.rs similarity index 97% rename from src/test/run-pass/issues/issue-44056.rs rename to src/test/ui/issues/issue-44056.rs index 50fe999706681..b2f0e917749d5 100644 --- a/src/test/run-pass/issues/issue-44056.rs +++ b/src/test/ui/issues/issue-44056.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // only-x86_64 // no-prefer-dynamic // compile-flags: -Ctarget-feature=+avx -Clto diff --git a/src/test/run-pass/issues/issue-44247.rs b/src/test/ui/issues/issue-44247.rs similarity index 97% rename from src/test/run-pass/issues/issue-44247.rs rename to src/test/ui/issues/issue-44247.rs index c1204aa43a224..29c4b977d65d9 100644 --- a/src/test/run-pass/issues/issue-44247.rs +++ b/src/test/ui/issues/issue-44247.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] trait T { type X; diff --git a/src/test/run-pass/issues/issue-44373.rs b/src/test/ui/issues/issue-44373-2.rs similarity index 97% rename from src/test/run-pass/issues/issue-44373.rs rename to src/test/ui/issues/issue-44373-2.rs index 2ed79dd89c8e6..ccc99f0ecc48e 100644 --- a/src/test/run-pass/issues/issue-44373.rs +++ b/src/test/ui/issues/issue-44373-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // compile-flags: -Z borrowck=compare diff --git a/src/test/run-pass/issues/issue-44402.rs b/src/test/ui/issues/issue-44402.rs similarity index 98% rename from src/test/run-pass/issues/issue-44402.rs rename to src/test/ui/issues/issue-44402.rs index 6863fdbb56692..f44f261041a37 100644 --- a/src/test/run-pass/issues/issue-44402.rs +++ b/src/test/ui/issues/issue-44402.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![feature(never_type)] #![feature(exhaustive_patterns)] diff --git a/src/test/run-pass/issues/issue-44730.rs b/src/test/ui/issues/issue-44730.rs similarity index 97% rename from src/test/run-pass/issues/issue-44730.rs rename to src/test/ui/issues/issue-44730.rs index 0f4d2e174fc09..61b266e2b7e25 100644 --- a/src/test/run-pass/issues/issue-44730.rs +++ b/src/test/ui/issues/issue-44730.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass //! dox #![deny(missing_docs)] diff --git a/src/test/run-pass/issues/issue-44851.rs b/src/test/ui/issues/issue-44851.rs similarity index 97% rename from src/test/run-pass/issues/issue-44851.rs rename to src/test/ui/issues/issue-44851.rs index 1e9f4d3e4e540..4a302be05e70a 100644 --- a/src/test/run-pass/issues/issue-44851.rs +++ b/src/test/ui/issues/issue-44851.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass macro_rules! a { () => { "a" } } diff --git a/src/test/run-pass/issues/issue-45425.rs b/src/test/ui/issues/issue-45425.rs similarity index 97% rename from src/test/run-pass/issues/issue-45425.rs rename to src/test/ui/issues/issue-45425.rs index dfc7c8a8795b8..2b5b7ff18155c 100644 --- a/src/test/run-pass/issues/issue-45425.rs +++ b/src/test/ui/issues/issue-45425.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] use std::ops::Add; diff --git a/src/test/run-pass/issues/issue-46959.rs b/src/test/ui/issues/issue-46959.rs similarity index 97% rename from src/test/run-pass/issues/issue-46959.rs rename to src/test/ui/issues/issue-46959.rs index baaff2d4581d9..0e585378fa7f4 100644 --- a/src/test/run-pass/issues/issue-46959.rs +++ b/src/test/ui/issues/issue-46959.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![deny(non_camel_case_types)] #[allow(dead_code)] diff --git a/src/test/run-pass/issues/issue-46964.rs b/src/test/ui/issues/issue-46964.rs similarity index 98% rename from src/test/run-pass/issues/issue-46964.rs rename to src/test/ui/issues/issue-46964.rs index ad4d6e3ac1a64..61c5a1a56cedf 100644 --- a/src/test/run-pass/issues/issue-46964.rs +++ b/src/test/ui/issues/issue-46964.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass mod my_mod { #[derive(Clone, Copy, Eq, PartialEq, PartialOrd, Ord, Hash)] pub struct Name<'a> { diff --git a/src/test/run-pass/issues/issue-47673.rs b/src/test/ui/issues/issue-47673.rs similarity index 97% rename from src/test/run-pass/issues/issue-47673.rs rename to src/test/ui/issues/issue-47673.rs index 1e733a0c4d6f9..7cef527acd795 100644 --- a/src/test/run-pass/issues/issue-47673.rs +++ b/src/test/ui/issues/issue-47673.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(unused_imports)] use {{}, {}}; diff --git a/src/test/run-pass/issues/issue-47703-1.rs b/src/test/ui/issues/issue-47703-1.rs similarity index 98% rename from src/test/run-pass/issues/issue-47703-1.rs rename to src/test/ui/issues/issue-47703-1.rs index 7cf34d3cd428e..446ca27a53e7c 100644 --- a/src/test/run-pass/issues/issue-47703-1.rs +++ b/src/test/ui/issues/issue-47703-1.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![feature(nll)] diff --git a/src/test/run-pass/issues/issue-47703-tuple.rs b/src/test/ui/issues/issue-47703-tuple.rs similarity index 97% rename from src/test/run-pass/issues/issue-47703-tuple.rs rename to src/test/ui/issues/issue-47703-tuple.rs index ee9d7f38dbea6..c2b4673a09fb5 100644 --- a/src/test/run-pass/issues/issue-47703-tuple.rs +++ b/src/test/ui/issues/issue-47703-tuple.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![feature(nll)] diff --git a/src/test/run-pass/issues/issue-47703.rs b/src/test/ui/issues/issue-47703.rs similarity index 97% rename from src/test/run-pass/issues/issue-47703.rs rename to src/test/ui/issues/issue-47703.rs index 17353c8e59f7c..084eab05d68e2 100644 --- a/src/test/run-pass/issues/issue-47703.rs +++ b/src/test/ui/issues/issue-47703.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![feature(nll)] diff --git a/src/test/run-pass/issues/issue-47722.rs b/src/test/ui/issues/issue-47722.rs similarity index 98% rename from src/test/run-pass/issues/issue-47722.rs rename to src/test/ui/issues/issue-47722.rs index a8e0faeed0601..39fbe33d823f4 100644 --- a/src/test/run-pass/issues/issue-47722.rs +++ b/src/test/ui/issues/issue-47722.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // Tests that automatic coercions from &mut T to *mut T diff --git a/src/test/run-pass/issues/issue-47789.rs b/src/test/ui/issues/issue-47789.rs similarity index 97% rename from src/test/run-pass/issues/issue-47789.rs rename to src/test/ui/issues/issue-47789.rs index 349aa4f73abc4..57957aed3db7e 100644 --- a/src/test/run-pass/issues/issue-47789.rs +++ b/src/test/ui/issues/issue-47789.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(non_upper_case_globals)] diff --git a/src/test/run-pass/issues/issue-48551.rs b/src/test/ui/issues/issue-48551.rs similarity index 98% rename from src/test/run-pass/issues/issue-48551.rs rename to src/test/ui/issues/issue-48551.rs index b4059d1fd7519..2da1059d74a1d 100644 --- a/src/test/run-pass/issues/issue-48551.rs +++ b/src/test/ui/issues/issue-48551.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // Regression test for #48551. Covers a case where duplicate candidates // arose during associated type projection. diff --git a/src/test/run-pass/issues/issue-51655.rs b/src/test/ui/issues/issue-51655.rs similarity index 97% rename from src/test/run-pass/issues/issue-51655.rs rename to src/test/ui/issues/issue-51655.rs index 17c04a4097a8d..d8c69fd3d55b7 100644 --- a/src/test/run-pass/issues/issue-51655.rs +++ b/src/test/ui/issues/issue-51655.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] const PATH_DOT: &[u8] = &[b'.']; diff --git a/src/test/run-pass/issues/issue-6991.rs b/src/test/ui/issues/issue-6991.rs similarity index 97% rename from src/test/run-pass/issues/issue-6991.rs rename to src/test/ui/issues/issue-6991.rs index 3d1108e84ad24..1de1f8b1a865e 100644 --- a/src/test/run-pass/issues/issue-6991.rs +++ b/src/test/ui/issues/issue-6991.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(non_upper_case_globals)] diff --git a/src/test/run-pass/issues/issue-7268.rs b/src/test/ui/issues/issue-7268.rs similarity index 97% rename from src/test/run-pass/issues/issue-7268.rs rename to src/test/ui/issues/issue-7268.rs index 961f90dfc377d..b4d0255fa10bf 100644 --- a/src/test/run-pass/issues/issue-7268.rs +++ b/src/test/ui/issues/issue-7268.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-8521.rs b/src/test/ui/issues/issue-8521.rs similarity index 97% rename from src/test/run-pass/issues/issue-8521.rs rename to src/test/ui/issues/issue-8521.rs index b70a79bed3cae..724ac962f3b33 100644 --- a/src/test/run-pass/issues/issue-8521.rs +++ b/src/test/ui/issues/issue-8521.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass trait Foo1 {} trait A {} diff --git a/src/test/run-pass/issues/issue-9243.rs b/src/test/ui/issues/issue-9243.rs similarity index 97% rename from src/test/run-pass/issues/issue-9243.rs rename to src/test/ui/issues/issue-9243.rs index f079268d6e10b..3f5721a3df7a0 100644 --- a/src/test/run-pass/issues/issue-9243.rs +++ b/src/test/ui/issues/issue-9243.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // Regression test for issue 9243 #![allow(non_upper_case_globals)] diff --git a/src/test/run-pass/issues/issue-9249.rs b/src/test/ui/issues/issue-9249.rs similarity index 97% rename from src/test/run-pass/issues/issue-9249.rs rename to src/test/ui/issues/issue-9249.rs index eb66c565a78c2..3013fde84dcc0 100644 --- a/src/test/run-pass/issues/issue-9249.rs +++ b/src/test/ui/issues/issue-9249.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 From 0b76a97793ddf7e249717507022fae6b6ecd2361 Mon Sep 17 00:00:00 2001 From: Richard Diamond Date: Sun, 30 Sep 2018 10:43:47 -0500 Subject: [PATCH 07/21] Re-export `getopts` so custom drivers can reference it. Otherwise, custom drivers will have to use their own copy of `getopts`, which won't match the types used in `CompilerCalls`. --- src/librustc_driver/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs index b97f5868079c4..4405c0aef9023 100644 --- a/src/librustc_driver/lib.rs +++ b/src/librustc_driver/lib.rs @@ -32,7 +32,7 @@ #![recursion_limit="256"] extern crate arena; -extern crate getopts; +pub extern crate getopts; extern crate graphviz; extern crate env_logger; #[cfg(unix)] From 1397836380555850ec4c34419682e312e41a4e26 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 30 Sep 2018 19:45:31 +0200 Subject: [PATCH 08/21] do not promote comparing function pointers --- src/librustc_mir/transform/qualify_consts.rs | 2 +- src/librustc_passes/rvalue_promotion.rs | 2 +- src/test/run-pass/issues/issue-54696.rs | 8 ++++++++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 src/test/run-pass/issues/issue-54696.rs diff --git a/src/librustc_mir/transform/qualify_consts.rs b/src/librustc_mir/transform/qualify_consts.rs index a6e2cad509408..2811848424b4e 100644 --- a/src/librustc_mir/transform/qualify_consts.rs +++ b/src/librustc_mir/transform/qualify_consts.rs @@ -750,7 +750,7 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> { } Rvalue::BinaryOp(op, ref lhs, _) => { - if let ty::RawPtr(_) = lhs.ty(self.mir, self.tcx).sty { + if let ty::RawPtr(_) | ty::FnPtr(..) = lhs.ty(self.mir, self.tcx).sty { assert!(op == BinOp::Eq || op == BinOp::Ne || op == BinOp::Le || op == BinOp::Lt || op == BinOp::Ge || op == BinOp::Gt || diff --git a/src/librustc_passes/rvalue_promotion.rs b/src/librustc_passes/rvalue_promotion.rs index 828800465209e..efe59e4face5e 100644 --- a/src/librustc_passes/rvalue_promotion.rs +++ b/src/librustc_passes/rvalue_promotion.rs @@ -348,7 +348,7 @@ fn check_expr_kind<'a, 'tcx>( return NotPromotable; } match v.tables.node_id_to_type(lhs.hir_id).sty { - ty::RawPtr(_) => { + ty::RawPtr(_) | ty::FnPtr(..) => { assert!(op.node == hir::BinOpKind::Eq || op.node == hir::BinOpKind::Ne || op.node == hir::BinOpKind::Le || op.node == hir::BinOpKind::Lt || op.node == hir::BinOpKind::Ge || op.node == hir::BinOpKind::Gt); diff --git a/src/test/run-pass/issues/issue-54696.rs b/src/test/run-pass/issues/issue-54696.rs new file mode 100644 index 0000000000000..d8408ed85491f --- /dev/null +++ b/src/test/run-pass/issues/issue-54696.rs @@ -0,0 +1,8 @@ +// run-pass + +fn main() { + // We shouldn't promote this + &(main as fn() == main as fn()); + // Also check nested case + &(&(main as fn()) == &(main as fn())); +} From 4cbfc9398d93d9eb0b1178b129f80de9be5c8ef9 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Sun, 30 Sep 2018 20:25:19 +0200 Subject: [PATCH 09/21] also compile-fail test fn ptr comparison promotion --- .../const-eval/promoted_raw_ptr_ops.nll.stderr | 15 +++++++++++++-- .../ui/consts/const-eval/promoted_raw_ptr_ops.rs | 1 + .../consts/const-eval/promoted_raw_ptr_ops.stderr | 15 +++++++++++++-- 3 files changed, 27 insertions(+), 4 deletions(-) diff --git a/src/test/ui/consts/const-eval/promoted_raw_ptr_ops.nll.stderr b/src/test/ui/consts/const-eval/promoted_raw_ptr_ops.nll.stderr index bc8a99f55483f..f31d962852e4a 100644 --- a/src/test/ui/consts/const-eval/promoted_raw_ptr_ops.nll.stderr +++ b/src/test/ui/consts/const-eval/promoted_raw_ptr_ops.nll.stderr @@ -14,7 +14,7 @@ error[E0716]: temporary value dropped while borrowed | LL | let y: &'static usize = &(&1 as *const i32 as usize + 1); //~ ERROR does not live long enough | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use -LL | let z: &'static i32 = &(unsafe { *(42 as *const i32) }); //~ ERROR does not live long enough +... LL | } | - temporary value is freed at the end of this statement | @@ -25,11 +25,22 @@ error[E0716]: temporary value dropped while borrowed | LL | let z: &'static i32 = &(unsafe { *(42 as *const i32) }); //~ ERROR does not live long enough | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use +LL | let a: &'static bool = &(main as fn() == main as fn()); //~ ERROR does not live long enough +LL | } + | - temporary value is freed at the end of this statement + | + = note: borrowed value must be valid for the static lifetime... + +error[E0716]: temporary value dropped while borrowed + --> $DIR/promoted_raw_ptr_ops.rs:18:29 + | +LL | let a: &'static bool = &(main as fn() == main as fn()); //~ ERROR does not live long enough + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use LL | } | - temporary value is freed at the end of this statement | = note: borrowed value must be valid for the static lifetime... -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0716`. diff --git a/src/test/ui/consts/const-eval/promoted_raw_ptr_ops.rs b/src/test/ui/consts/const-eval/promoted_raw_ptr_ops.rs index 3b437f69d8d63..c915886ca2592 100644 --- a/src/test/ui/consts/const-eval/promoted_raw_ptr_ops.rs +++ b/src/test/ui/consts/const-eval/promoted_raw_ptr_ops.rs @@ -15,4 +15,5 @@ fn main() { //~^ ERROR does not live long enough let y: &'static usize = &(&1 as *const i32 as usize + 1); //~ ERROR does not live long enough let z: &'static i32 = &(unsafe { *(42 as *const i32) }); //~ ERROR does not live long enough + let a: &'static bool = &(main as fn() == main as fn()); //~ ERROR does not live long enough } diff --git a/src/test/ui/consts/const-eval/promoted_raw_ptr_ops.stderr b/src/test/ui/consts/const-eval/promoted_raw_ptr_ops.stderr index 90c73c095fba1..baf12c5ac591d 100644 --- a/src/test/ui/consts/const-eval/promoted_raw_ptr_ops.stderr +++ b/src/test/ui/consts/const-eval/promoted_raw_ptr_ops.stderr @@ -14,7 +14,7 @@ error[E0597]: borrowed value does not live long enough | LL | let y: &'static usize = &(&1 as *const i32 as usize + 1); //~ ERROR does not live long enough | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough -LL | let z: &'static i32 = &(unsafe { *(42 as *const i32) }); //~ ERROR does not live long enough +... LL | } | - temporary value only lives until here | @@ -25,11 +25,22 @@ error[E0597]: borrowed value does not live long enough | LL | let z: &'static i32 = &(unsafe { *(42 as *const i32) }); //~ ERROR does not live long enough | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough +LL | let a: &'static bool = &(main as fn() == main as fn()); //~ ERROR does not live long enough +LL | } + | - temporary value only lives until here + | + = note: borrowed value must be valid for the static lifetime... + +error[E0597]: borrowed value does not live long enough + --> $DIR/promoted_raw_ptr_ops.rs:18:29 + | +LL | let a: &'static bool = &(main as fn() == main as fn()); //~ ERROR does not live long enough + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ temporary value does not live long enough LL | } | - temporary value only lives until here | = note: borrowed value must be valid for the static lifetime... -error: aborting due to 3 previous errors +error: aborting due to 4 previous errors For more information about this error, try `rustc --explain E0597`. From b871293cfdccbac795408a2bfc5110a54416c84d Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 1 Oct 2018 10:42:16 -0700 Subject: [PATCH 10/21] The `proc_macro_quote` feature now lives at #54722 --- src/libproc_macro/lib.rs | 4 ++-- src/libproc_macro/quote.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs index 34a44bd142148..41ef72049e31f 100644 --- a/src/libproc_macro/lib.rs +++ b/src/libproc_macro/lib.rs @@ -142,7 +142,7 @@ impl fmt::Debug for TokenStream { } } -#[unstable(feature = "proc_macro_quote", issue = "38356")] +#[unstable(feature = "proc_macro_quote", issue = "54722")] pub use quote::{quote, quote_span}; /// Creates a token stream containing a single token tree. @@ -252,7 +252,7 @@ pub mod token_stream { /// To quote `$` itself, use `$$`. /// /// This is a dummy macro, the actual implementation is in `quote::quote`.` -#[unstable(feature = "proc_macro_quote", issue = "38356")] +#[unstable(feature = "proc_macro_quote", issue = "54722")] #[macro_export] macro_rules! quote { () => {} } diff --git a/src/libproc_macro/quote.rs b/src/libproc_macro/quote.rs index 7ae7b13a15217..0f454a79055a0 100644 --- a/src/libproc_macro/quote.rs +++ b/src/libproc_macro/quote.rs @@ -70,7 +70,7 @@ macro_rules! quote { /// This is the actual `quote!()` proc macro. /// /// It is manually loaded in `CStore::load_macro_untracked`. -#[unstable(feature = "proc_macro_quote", issue = "38356")] +#[unstable(feature = "proc_macro_quote", issue = "54722")] pub fn quote(stream: TokenStream) -> TokenStream { if stream.is_empty() { return quote!(::TokenStream::new()); @@ -144,7 +144,7 @@ pub fn quote(stream: TokenStream) -> TokenStream { /// Quote a `Span` into a `TokenStream`. /// This is needed to implement a custom quoter. -#[unstable(feature = "proc_macro_quote", issue = "38356")] +#[unstable(feature = "proc_macro_quote", issue = "54722")] pub fn quote_span(_: Span) -> TokenStream { quote!(::Span::def_site()) } From 3ced475360795b46c0551d55a02b7d2504bdd526 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 1 Oct 2018 10:44:19 -0700 Subject: [PATCH 11/21] The `proc_macro_raw_ident` feature is now at #54723 --- src/libproc_macro/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs index 41ef72049e31f..5b3cb3562d165 100644 --- a/src/libproc_macro/lib.rs +++ b/src/libproc_macro/lib.rs @@ -881,7 +881,7 @@ impl Ident { } /// Same as `Ident::new`, but creates a raw identifier (`r#ident`). - #[unstable(feature = "proc_macro_raw_ident", issue = "38356")] + #[unstable(feature = "proc_macro_raw_ident", issue = "54723")] pub fn new_raw(string: &str, span: Span) -> Ident { if !Ident::is_valid(string) { panic!("`{:?}` is not a valid identifier", string) From 76625234924bb9dbdd9d4783c227999f7e352c73 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 1 Oct 2018 10:47:18 -0700 Subject: [PATCH 12/21] Span::def_site() is now at #54724 --- src/libproc_macro/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs index 5b3cb3562d165..74a1a1a037f32 100644 --- a/src/libproc_macro/lib.rs +++ b/src/libproc_macro/lib.rs @@ -283,7 +283,7 @@ macro_rules! diagnostic_method { impl Span { /// A span that resolves at the macro definition site. - #[unstable(feature = "proc_macro_span", issue = "38356")] + #[unstable(feature = "proc_macro_def_site", issue = "54724")] pub fn def_site() -> Span { ::__internal::with_sess(|_, data| data.def_site) } From 526ca7ce793f6e4749296b406a2854ac7cbf5554 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 1 Oct 2018 10:53:03 -0700 Subject: [PATCH 13/21] All `proc_macro_span` APIs tracked at #54725 now --- src/libproc_macro/lib.rs | 48 ++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/libproc_macro/lib.rs b/src/libproc_macro/lib.rs index 74a1a1a037f32..1a2b16a4fed06 100644 --- a/src/libproc_macro/lib.rs +++ b/src/libproc_macro/lib.rs @@ -298,7 +298,7 @@ impl Span { } /// The original source file into which this span points. - #[unstable(feature = "proc_macro_span", issue = "38356")] + #[unstable(feature = "proc_macro_span", issue = "54725")] pub fn source_file(&self) -> SourceFile { SourceFile { source_file: __internal::lookup_char_pos(self.0.lo()).file, @@ -307,7 +307,7 @@ impl Span { /// The `Span` for the tokens in the previous macro expansion from which /// `self` was generated from, if any. - #[unstable(feature = "proc_macro_span", issue = "38356")] + #[unstable(feature = "proc_macro_span", issue = "54725")] pub fn parent(&self) -> Option { self.0.parent().map(Span) } @@ -315,13 +315,13 @@ impl Span { /// The span for the origin source code that `self` was generated from. If /// this `Span` wasn't generated from other macro expansions then the return /// value is the same as `*self`. - #[unstable(feature = "proc_macro_span", issue = "38356")] + #[unstable(feature = "proc_macro_span", issue = "54725")] pub fn source(&self) -> Span { Span(self.0.source_callsite()) } /// Get the starting line/column in the source file for this span. - #[unstable(feature = "proc_macro_span", issue = "38356")] + #[unstable(feature = "proc_macro_span", issue = "54725")] pub fn start(&self) -> LineColumn { let loc = __internal::lookup_char_pos(self.0.lo()); LineColumn { @@ -331,7 +331,7 @@ impl Span { } /// Get the ending line/column in the source file for this span. - #[unstable(feature = "proc_macro_span", issue = "38356")] + #[unstable(feature = "proc_macro_span", issue = "54725")] pub fn end(&self) -> LineColumn { let loc = __internal::lookup_char_pos(self.0.hi()); LineColumn { @@ -343,7 +343,7 @@ impl Span { /// Create a new span encompassing `self` and `other`. /// /// Returns `None` if `self` and `other` are from different files. - #[unstable(feature = "proc_macro_span", issue = "38356")] + #[unstable(feature = "proc_macro_span", issue = "54725")] pub fn join(&self, other: Span) -> Option { let self_loc = __internal::lookup_char_pos(self.0.lo()); let other_loc = __internal::lookup_char_pos(other.0.lo()); @@ -355,20 +355,20 @@ impl Span { /// Creates a new span with the same line/column information as `self` but /// that resolves symbols as though it were at `other`. - #[unstable(feature = "proc_macro_span", issue = "38356")] + #[unstable(feature = "proc_macro_span", issue = "54725")] pub fn resolved_at(&self, other: Span) -> Span { Span(self.0.with_ctxt(other.0.ctxt())) } /// Creates a new span with the same name resolution behavior as `self` but /// with the line/column information of `other`. - #[unstable(feature = "proc_macro_span", issue = "38356")] + #[unstable(feature = "proc_macro_span", issue = "54725")] pub fn located_at(&self, other: Span) -> Span { other.resolved_at(*self) } /// Compares to spans to see if they're equal. - #[unstable(feature = "proc_macro_span", issue = "38356")] + #[unstable(feature = "proc_macro_span", issue = "54725")] pub fn eq(&self, other: &Span) -> bool { self.0 == other.0 } @@ -391,33 +391,33 @@ impl fmt::Debug for Span { } /// A line-column pair representing the start or end of a `Span`. -#[unstable(feature = "proc_macro_span", issue = "38356")] +#[unstable(feature = "proc_macro_span", issue = "54725")] #[derive(Copy, Clone, Debug, PartialEq, Eq)] pub struct LineColumn { /// The 1-indexed line in the source file on which the span starts or ends (inclusive). - #[unstable(feature = "proc_macro_span", issue = "38356")] + #[unstable(feature = "proc_macro_span", issue = "54725")] pub line: usize, /// The 0-indexed column (in UTF-8 characters) in the source file on which /// the span starts or ends (inclusive). - #[unstable(feature = "proc_macro_span", issue = "38356")] + #[unstable(feature = "proc_macro_span", issue = "54725")] pub column: usize } -#[unstable(feature = "proc_macro_span", issue = "38356")] +#[unstable(feature = "proc_macro_span", issue = "54725")] impl !Send for LineColumn {} -#[unstable(feature = "proc_macro_span", issue = "38356")] +#[unstable(feature = "proc_macro_span", issue = "54725")] impl !Sync for LineColumn {} /// The source file of a given `Span`. -#[unstable(feature = "proc_macro_span", issue = "38356")] +#[unstable(feature = "proc_macro_span", issue = "54725")] #[derive(Clone)] pub struct SourceFile { source_file: Lrc, } -#[unstable(feature = "proc_macro_span", issue = "38356")] +#[unstable(feature = "proc_macro_span", issue = "54725")] impl !Send for SourceFile {} -#[unstable(feature = "proc_macro_span", issue = "38356")] +#[unstable(feature = "proc_macro_span", issue = "54725")] impl !Sync for SourceFile {} impl SourceFile { @@ -431,7 +431,7 @@ impl SourceFile { /// the command line, the path as given may not actually be valid. /// /// [`is_real`]: #method.is_real - #[unstable(feature = "proc_macro_span", issue = "38356")] + #[unstable(feature = "proc_macro_span", issue = "54725")] pub fn path(&self) -> PathBuf { match self.source_file.name { FileName::Real(ref path) => path.clone(), @@ -441,7 +441,7 @@ impl SourceFile { /// Returns `true` if this source file is a real source file, and not generated by an external /// macro's expansion. - #[unstable(feature = "proc_macro_span", issue = "38356")] + #[unstable(feature = "proc_macro_span", issue = "54725")] pub fn is_real(&self) -> bool { // This is a hack until intercrate spans are implemented and we can have real source files // for spans generated in external macros. @@ -451,7 +451,7 @@ impl SourceFile { } -#[unstable(feature = "proc_macro_span", issue = "38356")] +#[unstable(feature = "proc_macro_span", issue = "54725")] impl fmt::Debug for SourceFile { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("SourceFile") @@ -461,14 +461,14 @@ impl fmt::Debug for SourceFile { } } -#[unstable(feature = "proc_macro_span", issue = "38356")] +#[unstable(feature = "proc_macro_span", issue = "54725")] impl PartialEq for SourceFile { fn eq(&self, other: &Self) -> bool { Lrc::ptr_eq(&self.source_file, &other.source_file) } } -#[unstable(feature = "proc_macro_span", issue = "38356")] +#[unstable(feature = "proc_macro_span", issue = "54725")] impl Eq for SourceFile {} /// A single token or a delimited sequence of token trees (e.g. `[1, (), ..]`). @@ -679,7 +679,7 @@ impl Group { /// pub fn span_open(&self) -> Span { /// ^ /// ``` - #[unstable(feature = "proc_macro_span", issue = "38356")] + #[unstable(feature = "proc_macro_span", issue = "54725")] pub fn span_open(&self) -> Span { Span(self.span.open) } @@ -690,7 +690,7 @@ impl Group { /// pub fn span_close(&self) -> Span { /// ^ /// ``` - #[unstable(feature = "proc_macro_span", issue = "38356")] + #[unstable(feature = "proc_macro_span", issue = "54725")] pub fn span_close(&self) -> Span { Span(self.span.close) } From 615214480a589426caf3121d9f68a7f6946b7126 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 1 Oct 2018 10:58:21 -0700 Subject: [PATCH 14/21] Extra proc macro gates are now at #54727 --- src/libsyntax/feature_gate.rs | 10 +++++----- src/test/ui-fulldeps/proc-macro/auxiliary/multispan.rs | 2 +- .../ui-fulldeps/proc-macro/auxiliary/three-equals.rs | 2 +- src/test/ui/span/issue-36530.stderr | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index bbadfa01221b9..adbe2f9d4393f 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -441,10 +441,10 @@ declare_features! ( // Allows macro invocations on modules expressions and statements and // procedural macros to expand to non-items. - (active, proc_macro_mod, "1.27.0", Some(38356), None), - (active, proc_macro_expr, "1.27.0", Some(38356), None), - (active, proc_macro_non_items, "1.27.0", Some(38356), None), - (active, proc_macro_gen, "1.27.0", Some(38356), None), + (active, proc_macro_mod, "1.27.0", Some(54727), None), + (active, proc_macro_expr, "1.27.0", Some(54727), None), + (active, proc_macro_non_items, "1.27.0", Some(54727), None), + (active, proc_macro_gen, "1.27.0", Some(54727), None), // #[doc(alias = "...")] (active, doc_alias, "1.27.0", Some(50146), None), @@ -502,7 +502,7 @@ declare_features! ( (active, custom_test_frameworks, "1.30.0", Some(50297), None), // Non-builtin attributes in inner attribute position - (active, custom_inner_attributes, "1.30.0", Some(38356), None), + (active, custom_inner_attributes, "1.30.0", Some(54726), None), // Self struct constructor (RFC 2302) (active, self_struct_ctor, "1.30.0", Some(51994), None), diff --git a/src/test/ui-fulldeps/proc-macro/auxiliary/multispan.rs b/src/test/ui-fulldeps/proc-macro/auxiliary/multispan.rs index cecd9ef4d994d..383016f990eb6 100644 --- a/src/test/ui-fulldeps/proc-macro/auxiliary/multispan.rs +++ b/src/test/ui-fulldeps/proc-macro/auxiliary/multispan.rs @@ -11,7 +11,7 @@ // no-prefer-dynamic #![crate_type = "proc-macro"] -#![feature(proc_macro_diagnostic, proc_macro_span)] +#![feature(proc_macro_diagnostic, proc_macro_span, proc_macro_def_site)] extern crate proc_macro; diff --git a/src/test/ui-fulldeps/proc-macro/auxiliary/three-equals.rs b/src/test/ui-fulldeps/proc-macro/auxiliary/three-equals.rs index 70151278947dd..569a458f55a44 100644 --- a/src/test/ui-fulldeps/proc-macro/auxiliary/three-equals.rs +++ b/src/test/ui-fulldeps/proc-macro/auxiliary/three-equals.rs @@ -11,7 +11,7 @@ // no-prefer-dynamic #![crate_type = "proc-macro"] -#![feature(proc_macro_diagnostic, proc_macro_span)] +#![feature(proc_macro_diagnostic, proc_macro_span, proc_macro_def_site)] extern crate proc_macro; diff --git a/src/test/ui/span/issue-36530.stderr b/src/test/ui/span/issue-36530.stderr index 78d81ad049306..98361c879ff68 100644 --- a/src/test/ui/span/issue-36530.stderr +++ b/src/test/ui/span/issue-36530.stderr @@ -6,7 +6,7 @@ LL | #[foo] //~ ERROR is currently unknown to the compiler | = help: add #![feature(custom_attribute)] to the crate attributes to enable -error[E0658]: non-builtin inner attributes are unstable (see issue #38356) +error[E0658]: non-builtin inner attributes are unstable (see issue #54726) --> $DIR/issue-36530.rs:15:5 | LL | #![foo] //~ ERROR is currently unknown to the compiler From 9e2d6e1e62802f7a42c900438b97fd3c5316dcb3 Mon Sep 17 00:00:00 2001 From: David Wood Date: Thu, 27 Sep 2018 01:17:54 +0200 Subject: [PATCH 15/21] Add `crate::` to trait suggestions in Rust 2018. In the 2018 edition, when suggesting traits to import that implement a given method that is being invoked, suggestions will now include the `crate::` prefix if the suggested trait is local to the current crate. --- src/librustc/ty/item_path.rs | 83 ++++++++++++++++--- src/librustc_codegen_utils/symbol_names.rs | 1 + src/librustc_typeck/check/method/suggest.rs | 25 ++++-- src/librustdoc/clean/mod.rs | 1 + .../auxiliary/trait-import-suggestions.rs | 15 ++++ .../ui/rust-2018/trait-import-suggestions.rs | 41 +++++++++ .../rust-2018/trait-import-suggestions.stderr | 43 ++++++++++ 7 files changed, 192 insertions(+), 17 deletions(-) create mode 100644 src/test/ui/rust-2018/auxiliary/trait-import-suggestions.rs create mode 100644 src/test/ui/rust-2018/trait-import-suggestions.rs create mode 100644 src/test/ui/rust-2018/trait-import-suggestions.stderr diff --git a/src/librustc/ty/item_path.rs b/src/librustc/ty/item_path.rs index 1b4ff18f6b8d8..41f908b4be6b5 100644 --- a/src/librustc/ty/item_path.rs +++ b/src/librustc/ty/item_path.rs @@ -13,14 +13,16 @@ use hir::def_id::{CrateNum, DefId, CRATE_DEF_INDEX, LOCAL_CRATE}; use ty::{self, Ty, TyCtxt}; use middle::cstore::{ExternCrate, ExternCrateSource}; use syntax::ast; -use syntax::symbol::Symbol; -use syntax::symbol::LocalInternedString; +use syntax::symbol::{keywords, LocalInternedString, Symbol}; +use syntax_pos::edition::Edition; use std::cell::Cell; +use std::fmt::Debug; thread_local! { static FORCE_ABSOLUTE: Cell = Cell::new(false); static FORCE_IMPL_FILENAME_LINE: Cell = Cell::new(false); + static SHOULD_PREFIX_WITH_CRATE: Cell = Cell::new(false); } /// Enforces that item_path_str always returns an absolute path and @@ -51,6 +53,17 @@ pub fn with_forced_impl_filename_line R, R>(f: F) -> R { }) } +/// Add the `crate::` prefix to paths where appropriate. +pub fn with_crate_prefix R, R>(f: F) -> R { + SHOULD_PREFIX_WITH_CRATE.with(|flag| { + let old = flag.get(); + flag.set(true); + let result = f(); + flag.set(old); + result + }) +} + impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { /// Returns a string identifying this def-id. This string is /// suitable for user output. It is relative to the current crate @@ -64,6 +77,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { } }); let mut buffer = LocalPathBuffer::new(mode); + debug!("item_path_str: buffer={:?} def_id={:?}", buffer, def_id); self.push_item_path(&mut buffer, def_id); buffer.into_string() } @@ -77,6 +91,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { /// suitable for user output. It always begins with a crate identifier. pub fn absolute_item_path_str(self, def_id: DefId) -> String { let mut buffer = LocalPathBuffer::new(RootMode::Absolute); + debug!("absolute_item_path_str: buffer={:?} def_id={:?}", buffer, def_id); self.push_item_path(&mut buffer, def_id); buffer.into_string() } @@ -85,8 +100,12 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { /// various ways, depending on the `root_mode` of the `buffer`. /// (See `RootMode` enum for more details.) pub fn push_krate_path(self, buffer: &mut T, cnum: CrateNum) - where T: ItemPathBuffer + where T: ItemPathBuffer + Debug { + debug!( + "push_krate_path: buffer={:?} cnum={:?} LOCAL_CRATE={:?}", + buffer, cnum, LOCAL_CRATE + ); match *buffer.root_mode() { RootMode::Local => { // In local mode, when we encounter a crate other than @@ -109,16 +128,32 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { .. }) = *opt_extern_crate { + debug!("push_krate_path: def_id={:?}", def_id); self.push_item_path(buffer, def_id); } else { - buffer.push(&self.crate_name(cnum).as_str()); + let name = self.crate_name(cnum).as_str(); + debug!("push_krate_path: name={:?}", name); + buffer.push(&name); } + } else if self.sess.edition() == Edition::Edition2018 { + SHOULD_PREFIX_WITH_CRATE.with(|flag| { + // We only add the `crate::` keyword where appropriate. This + // is only possible because of the invariant in `push_item_path` + // that this function will not be called after printing the path + // to an item in the standard library. Without this invariant, + // we would print `crate::std::..` here. + if flag.get() { + buffer.push(&keywords::Crate.name().as_str()) + } + }) } } RootMode::Absolute => { // In absolute mode, just write the crate name // unconditionally. - buffer.push(&self.original_crate_name(cnum).as_str()); + let name = self.original_crate_name(cnum).as_str(); + debug!("push_krate_path: original_name={:?}", name); + buffer.push(&name); } } } @@ -127,12 +162,20 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { /// from at least one local module and returns true. If the crate defining `external_def_id` is /// declared with an `extern crate`, the path is guaranteed to use the `extern crate`. pub fn try_push_visible_item_path(self, buffer: &mut T, external_def_id: DefId) -> bool - where T: ItemPathBuffer + where T: ItemPathBuffer + Debug { + debug!( + "try_push_visible_item_path: buffer={:?} external_def_id={:?}", + buffer, external_def_id + ); let visible_parent_map = self.visible_parent_map(LOCAL_CRATE); let (mut cur_def, mut cur_path) = (external_def_id, Vec::::new()); loop { + debug!( + "try_push_visible_item_path: cur_def={:?} cur_path={:?} CRATE_DEF_INDEX={:?}", + cur_def, cur_path, CRATE_DEF_INDEX, + ); // If `cur_def` is a direct or injected extern crate, push the path to the crate // followed by the path to the item within the crate and return. if cur_def.index == CRATE_DEF_INDEX { @@ -142,6 +185,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { direct: true, .. }) => { + debug!("try_push_visible_item_path: def_id={:?}", def_id); self.push_item_path(buffer, def_id); cur_path.iter().rev().for_each(|segment| buffer.push(&segment)); return true; @@ -156,6 +200,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { } let mut cur_def_key = self.def_key(cur_def); + debug!("try_push_visible_item_path: cur_def_key={:?}", cur_def_key); // For a UnitStruct or TupleStruct we want the name of its parent rather than . if let DefPathData::StructCtor = cur_def_key.disambiguated_data.data { @@ -175,6 +220,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { Symbol::intern("").as_str() } }); + debug!("try_push_visible_item_path: symbol={:?}", symbol); cur_path.push(symbol); match visible_parent_map.get(&cur_def) { @@ -185,8 +231,9 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { } pub fn push_item_path(self, buffer: &mut T, def_id: DefId) - where T: ItemPathBuffer + where T: ItemPathBuffer + Debug { + debug!("push_item_path: buffer={:?} def_id={:?}", buffer, def_id); match *buffer.root_mode() { RootMode::Local if !def_id.is_local() => if self.try_push_visible_item_path(buffer, def_id) { return }, @@ -194,6 +241,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { } let key = self.def_key(def_id); + debug!("push_item_path: key={:?}", key); match key.disambiguated_data.data { DefPathData::CrateRoot => { assert!(key.parent.is_none()); @@ -225,9 +273,21 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { data @ DefPathData::ImplTrait | data @ DefPathData::GlobalMetaData(..) => { let parent_def_id = self.parent_def_id(def_id).unwrap(); - self.push_item_path(buffer, parent_def_id); + + match self.def_key(parent_def_id).disambiguated_data.data { + // Skip recursing to print the crate root depending on the + // current name. + // + // In particular, don't recurse to print the crate root if we + // just printed `std`. In doing this, we are able to add + // `crate::` to trait import suggestions. + DefPathData::CrateRoot if data.as_interned_str() == "std" => {}, + _ => self.push_item_path(buffer, parent_def_id), + } + buffer.push(&data.as_interned_str().as_symbol().as_str()); - } + }, + DefPathData::StructCtor => { // present `X` instead of `X::{{constructor}}` let parent_def_id = self.parent_def_id(def_id).unwrap(); self.push_item_path(buffer, parent_def_id); @@ -238,8 +298,9 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { fn push_impl_path(self, buffer: &mut T, impl_def_id: DefId) - where T: ItemPathBuffer + where T: ItemPathBuffer + Debug { + debug!("push_impl_path: buffer={:?} impl_def_id={:?}", buffer, impl_def_id); let parent_def_id = self.parent_def_id(impl_def_id).unwrap(); // Always use types for non-local impls, where types are always @@ -327,7 +388,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { fn push_impl_path_fallback(self, buffer: &mut T, impl_def_id: DefId) - where T: ItemPathBuffer + where T: ItemPathBuffer + Debug { // If no type info is available, fall back to // pretty printing some span information. This should diff --git a/src/librustc_codegen_utils/symbol_names.rs b/src/librustc_codegen_utils/symbol_names.rs index 39b88b225edc7..7651dfe4f34e9 100644 --- a/src/librustc_codegen_utils/symbol_names.rs +++ b/src/librustc_codegen_utils/symbol_names.rs @@ -338,6 +338,7 @@ fn compute_symbol_name<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, instance: Instance // // To be able to work on all platforms and get *some* reasonable output, we // use C++ name-mangling. +#[derive(Debug)] struct SymbolPathBuffer { result: String, temp_buf: String, diff --git a/src/librustc_typeck/check/method/suggest.rs b/src/librustc_typeck/check/method/suggest.rs index f5d332521ff0b..28b9dcb9bfdd1 100644 --- a/src/librustc_typeck/check/method/suggest.rs +++ b/src/librustc_typeck/check/method/suggest.rs @@ -16,6 +16,7 @@ use rustc::hir::map as hir_map; use hir::Node; use rustc_data_structures::sync::Lrc; use rustc::ty::{self, Ty, TyCtxt, ToPolyTraitRef, ToPredicate, TypeFoldable}; +use rustc::ty::item_path::with_crate_prefix; use hir::def::Def; use hir::def_id::{CRATE_DEF_INDEX, DefId}; use middle::lang_items::FnOnceTraitLangItem; @@ -515,7 +516,11 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { } else { "\n" }; - format!("use {};\n{}", self.tcx.item_path_str(*did), additional_newline) + format!( + "use {};\n{}", + with_crate_prefix(|| self.tcx.item_path_str(*did)), + additional_newline + ) }).collect(); err.span_suggestions_with_applicability( @@ -528,12 +533,20 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> { let limit = if candidates.len() == 5 { 5 } else { 4 }; for (i, trait_did) in candidates.iter().take(limit).enumerate() { if candidates.len() > 1 { - msg.push_str(&format!("\ncandidate #{}: `use {};`", - i + 1, - self.tcx.item_path_str(*trait_did))); + msg.push_str( + &format!( + "\ncandidate #{}: `use {};`", + i + 1, + with_crate_prefix(|| self.tcx.item_path_str(*trait_did)) + ) + ); } else { - msg.push_str(&format!("\n`use {};`", - self.tcx.item_path_str(*trait_did))); + msg.push_str( + &format!( + "\n`use {};`", + with_crate_prefix(|| self.tcx.item_path_str(*trait_did)) + ) + ); } } if candidates.len() > limit { diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index a91f2fd7474f5..c0a8009e53688 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -3990,6 +3990,7 @@ pub fn path_to_def(tcx: &TyCtxt, path: &[&str]) -> Option { pub fn get_path_for_type(tcx: TyCtxt, def_id: DefId, def_ctor: F) -> hir::Path where F: Fn(DefId) -> Def { + #[derive(Debug)] struct AbsolutePathBuffer { names: Vec, } diff --git a/src/test/ui/rust-2018/auxiliary/trait-import-suggestions.rs b/src/test/ui/rust-2018/auxiliary/trait-import-suggestions.rs new file mode 100644 index 0000000000000..611fa83854b9b --- /dev/null +++ b/src/test/ui/rust-2018/auxiliary/trait-import-suggestions.rs @@ -0,0 +1,15 @@ +// Copyright 2018 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. + +pub trait Baz { + fn baz(&self) { } +} + +impl Baz for u32 { } diff --git a/src/test/ui/rust-2018/trait-import-suggestions.rs b/src/test/ui/rust-2018/trait-import-suggestions.rs new file mode 100644 index 0000000000000..d603d8212ed37 --- /dev/null +++ b/src/test/ui/rust-2018/trait-import-suggestions.rs @@ -0,0 +1,41 @@ +// Copyright 2018 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. + +// edition:2018 +// aux-build:trait-import-suggestions.rs +// compile-flags:--extern trait-import-suggestions + +mod foo { + mod foobar { + pub(crate) trait Foobar { + fn foobar(&self) { } + } + + impl Foobar for u32 { } + } + + pub(crate) trait Bar { + fn bar(&self) { } + } + + impl Bar for u32 { } + + fn in_foo() { + let x: u32 = 22; + x.foobar(); + } +} + +fn main() { + let x: u32 = 22; + x.bar(); + x.baz(); + let y = u32::from_str("33"); +} diff --git a/src/test/ui/rust-2018/trait-import-suggestions.stderr b/src/test/ui/rust-2018/trait-import-suggestions.stderr new file mode 100644 index 0000000000000..59fe7b958e345 --- /dev/null +++ b/src/test/ui/rust-2018/trait-import-suggestions.stderr @@ -0,0 +1,43 @@ +error[E0599]: no method named `foobar` found for type `u32` in the current scope + --> $DIR/trait-import-suggestions.rs:32:11 + | +LL | x.foobar(); + | ^^^^^^ + | + = help: items from traits can only be used if the trait is in scope + = note: the following trait is implemented but not in scope, perhaps add a `use` for it: + `use crate::foo::foobar::Foobar;` + +error[E0599]: no method named `bar` found for type `u32` in the current scope + --> $DIR/trait-import-suggestions.rs:38:7 + | +LL | x.bar(); + | ^^^ + | + = help: items from traits can only be used if the trait is in scope +help: the following trait is implemented but not in scope, perhaps add a `use` for it: + | +LL | use crate::foo::Bar; + | + +error[E0599]: no method named `baz` found for type `u32` in the current scope + --> $DIR/trait-import-suggestions.rs:39:7 + | +LL | x.baz(); + | ^^^ + +error[E0599]: no function or associated item named `from_str` found for type `u32` in the current scope + --> $DIR/trait-import-suggestions.rs:40:13 + | +LL | let y = u32::from_str("33"); + | ^^^^^^^^^^^^^ function or associated item not found in `u32` + | + = help: items from traits can only be used if the trait is in scope +help: the following trait is implemented but not in scope, perhaps add a `use` for it: + | +LL | use std::str::FromStr; + | + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0599`. From 4cbd397ce861ae0ee823ab56d1f797dee67e0b64 Mon Sep 17 00:00:00 2001 From: David Wood Date: Thu, 27 Sep 2018 21:38:11 +0200 Subject: [PATCH 16/21] Move prelude crate names into `Session`. Avoid hardcoding and special-casing the `std` crate name in the item path logic by moving the prelude crate name logic into the `Session` type so it can be reused in the item path logic and resolve module. --- src/librustc/session/mod.rs | 13 ++++++------- src/librustc/ty/item_path.rs | 4 +++- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/librustc/session/mod.rs b/src/librustc/session/mod.rs index 79d06cd7f1254..3c209a4324675 100644 --- a/src/librustc/session/mod.rs +++ b/src/librustc/session/mod.rs @@ -28,17 +28,16 @@ use util::common::ProfileQueriesMsg; use rustc_data_structures::base_n; use rustc_data_structures::sync::{self, Lrc, Lock, LockCell, OneThread, Once, RwLock}; -use syntax::ast::NodeId; use errors::{self, DiagnosticBuilder, DiagnosticId, Applicability}; use errors::emitter::{Emitter, EmitterWriter}; +use syntax::ast::{self, NodeId}; use syntax::edition::Edition; +use syntax::feature_gate::{self, AttributeType}; use syntax::json::JsonEmitter; -use syntax::feature_gate; -use syntax::parse; -use syntax::parse::ParseSess; -use syntax::{ast, source_map}; -use syntax::feature_gate::AttributeType; -use syntax_pos::{MultiSpan, Span, symbol::Symbol}; +use syntax::source_map; +use syntax::symbol::Symbol; +use syntax::parse::{self, ParseSess}; +use syntax_pos::{MultiSpan, Span}; use util::profiling::SelfProfiler; use rustc_target::spec::PanicStrategy; diff --git a/src/librustc/ty/item_path.rs b/src/librustc/ty/item_path.rs index 41f908b4be6b5..4e7783a00cb86 100644 --- a/src/librustc/ty/item_path.rs +++ b/src/librustc/ty/item_path.rs @@ -281,7 +281,9 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { // In particular, don't recurse to print the crate root if we // just printed `std`. In doing this, we are able to add // `crate::` to trait import suggestions. - DefPathData::CrateRoot if data.as_interned_str() == "std" => {}, + DefPathData::CrateRoot if self.sess.extern_prelude.contains( + &data.as_interned_str().as_symbol() + ) => {}, _ => self.push_item_path(buffer, parent_def_id), } From 02357e459be7fb2014f57f1a86b38897c2c0816b Mon Sep 17 00:00:00 2001 From: David Wood Date: Fri, 28 Sep 2018 00:56:41 +0200 Subject: [PATCH 17/21] Attempt to resolve linking issues. This commit takes a different approach to add the `crate::` prefix to item paths than previous commits. Previously, recursion was stopped after a prelude crate name was pushed to the path. It is theorized that this was the cause of the linking issues since the same path logic is used for symbol names and that not recursing meant that details were being missed that affect symbol names. As of this commit, instead of ceasing recursion, a flag is passed through to any subsequent recursive calls so that the same effect can be achieved by checking that flag. --- src/librustc/ty/item_path.rs | 100 ++++++++++++--------- src/librustc_codegen_utils/symbol_names.rs | 2 +- src/librustdoc/clean/mod.rs | 2 +- 3 files changed, 60 insertions(+), 44 deletions(-) diff --git a/src/librustc/ty/item_path.rs b/src/librustc/ty/item_path.rs index 4e7783a00cb86..c8d104e6c321f 100644 --- a/src/librustc/ty/item_path.rs +++ b/src/librustc/ty/item_path.rs @@ -78,7 +78,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { }); let mut buffer = LocalPathBuffer::new(mode); debug!("item_path_str: buffer={:?} def_id={:?}", buffer, def_id); - self.push_item_path(&mut buffer, def_id); + self.push_item_path(&mut buffer, def_id, false); buffer.into_string() } @@ -92,14 +92,19 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { pub fn absolute_item_path_str(self, def_id: DefId) -> String { let mut buffer = LocalPathBuffer::new(RootMode::Absolute); debug!("absolute_item_path_str: buffer={:?} def_id={:?}", buffer, def_id); - self.push_item_path(&mut buffer, def_id); + self.push_item_path(&mut buffer, def_id, false); buffer.into_string() } /// Returns the "path" to a particular crate. This can proceed in /// various ways, depending on the `root_mode` of the `buffer`. /// (See `RootMode` enum for more details.) - pub fn push_krate_path(self, buffer: &mut T, cnum: CrateNum) + /// + /// `pushed_prelude_crate` argument should be `true` when the buffer + /// has had a prelude crate pushed to it. If this is the case, then + /// we do not want to prepend `crate::` (as that would not be a valid + /// path). + pub fn push_krate_path(self, buffer: &mut T, cnum: CrateNum, pushed_prelude_crate: bool) where T: ItemPathBuffer + Debug { debug!( @@ -129,19 +134,16 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { }) = *opt_extern_crate { debug!("push_krate_path: def_id={:?}", def_id); - self.push_item_path(buffer, def_id); + self.push_item_path(buffer, def_id, pushed_prelude_crate); } else { let name = self.crate_name(cnum).as_str(); debug!("push_krate_path: name={:?}", name); buffer.push(&name); } - } else if self.sess.edition() == Edition::Edition2018 { + } else if self.sess.edition() == Edition::Edition2018 && !pushed_prelude_crate { SHOULD_PREFIX_WITH_CRATE.with(|flag| { - // We only add the `crate::` keyword where appropriate. This - // is only possible because of the invariant in `push_item_path` - // that this function will not be called after printing the path - // to an item in the standard library. Without this invariant, - // we would print `crate::std::..` here. + // We only add the `crate::` keyword where appropriate. In particular, + // when we've not previously pushed a prelude crate to this path. if flag.get() { buffer.push(&keywords::Crate.name().as_str()) } @@ -161,7 +163,12 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { /// If possible, this pushes a global path resolving to `external_def_id` that is visible /// from at least one local module and returns true. If the crate defining `external_def_id` is /// declared with an `extern crate`, the path is guaranteed to use the `extern crate`. - pub fn try_push_visible_item_path(self, buffer: &mut T, external_def_id: DefId) -> bool + pub fn try_push_visible_item_path( + self, + buffer: &mut T, + external_def_id: DefId, + pushed_prelude_crate: bool, + ) -> bool where T: ItemPathBuffer + Debug { debug!( @@ -186,7 +193,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { .. }) => { debug!("try_push_visible_item_path: def_id={:?}", def_id); - self.push_item_path(buffer, def_id); + self.push_item_path(buffer, def_id, pushed_prelude_crate); cur_path.iter().rev().for_each(|segment| buffer.push(&segment)); return true; } @@ -230,13 +237,16 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { } } - pub fn push_item_path(self, buffer: &mut T, def_id: DefId) + pub fn push_item_path(self, buffer: &mut T, def_id: DefId, pushed_prelude_crate: bool) where T: ItemPathBuffer + Debug { - debug!("push_item_path: buffer={:?} def_id={:?}", buffer, def_id); + debug!( + "push_item_path: buffer={:?} def_id={:?} pushed_prelude_crate={:?}", + buffer, def_id, pushed_prelude_crate + ); match *buffer.root_mode() { RootMode::Local if !def_id.is_local() => - if self.try_push_visible_item_path(buffer, def_id) { return }, + if self.try_push_visible_item_path(buffer, def_id, pushed_prelude_crate) { return }, _ => {} } @@ -245,11 +255,11 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { match key.disambiguated_data.data { DefPathData::CrateRoot => { assert!(key.parent.is_none()); - self.push_krate_path(buffer, def_id.krate); + self.push_krate_path(buffer, def_id.krate, pushed_prelude_crate); } DefPathData::Impl => { - self.push_impl_path(buffer, def_id); + self.push_impl_path(buffer, def_id, pushed_prelude_crate); } // Unclear if there is any value in distinguishing these. @@ -272,34 +282,37 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { data @ DefPathData::ClosureExpr | data @ DefPathData::ImplTrait | data @ DefPathData::GlobalMetaData(..) => { - let parent_def_id = self.parent_def_id(def_id).unwrap(); - - match self.def_key(parent_def_id).disambiguated_data.data { - // Skip recursing to print the crate root depending on the - // current name. - // - // In particular, don't recurse to print the crate root if we - // just printed `std`. In doing this, we are able to add - // `crate::` to trait import suggestions. - DefPathData::CrateRoot if self.sess.extern_prelude.contains( - &data.as_interned_str().as_symbol() - ) => {}, - _ => self.push_item_path(buffer, parent_def_id), + let parent_did = self.parent_def_id(def_id).unwrap(); + + // Keep track of whether we are one recursion away from the `CrateRoot` and + // pushing the name of a prelude crate. If we are, we'll want to know this when + // printing the `CrateRoot` so we don't prepend a `crate::` to paths. + let mut is_prelude_crate = false; + if let DefPathData::CrateRoot = self.def_key(parent_did).disambiguated_data.data { + if self.sess.extern_prelude.contains(&data.as_interned_str().as_symbol()) { + is_prelude_crate = true; + } } + self.push_item_path( + buffer, parent_did, pushed_prelude_crate || is_prelude_crate + ); buffer.push(&data.as_interned_str().as_symbol().as_str()); }, DefPathData::StructCtor => { // present `X` instead of `X::{{constructor}}` let parent_def_id = self.parent_def_id(def_id).unwrap(); - self.push_item_path(buffer, parent_def_id); + self.push_item_path(buffer, parent_def_id, pushed_prelude_crate); } } } - fn push_impl_path(self, - buffer: &mut T, - impl_def_id: DefId) + fn push_impl_path( + self, + buffer: &mut T, + impl_def_id: DefId, + pushed_prelude_crate: bool, + ) where T: ItemPathBuffer + Debug { debug!("push_impl_path: buffer={:?} impl_def_id={:?}", buffer, impl_def_id); @@ -314,7 +327,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { }; if !use_types { - return self.push_impl_path_fallback(buffer, impl_def_id); + return self.push_impl_path_fallback(buffer, impl_def_id, pushed_prelude_crate); } // Decide whether to print the parent path for the impl. @@ -338,7 +351,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { // If the impl is not co-located with either self-type or // trait-type, then fallback to a format that identifies // the module more clearly. - self.push_item_path(buffer, parent_def_id); + self.push_item_path(buffer, parent_def_id, pushed_prelude_crate); if let Some(trait_ref) = impl_trait_ref { buffer.push(&format!("", trait_ref, self_ty)); } else { @@ -364,13 +377,13 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { match self_ty.sty { ty::Adt(adt_def, substs) => { if substs.types().next().is_none() { // ignore regions - self.push_item_path(buffer, adt_def.did); + self.push_item_path(buffer, adt_def.did, pushed_prelude_crate); } else { buffer.push(&format!("<{}>", self_ty)); } } - ty::Foreign(did) => self.push_item_path(buffer, did), + ty::Foreign(did) => self.push_item_path(buffer, did, pushed_prelude_crate), ty::Bool | ty::Char | @@ -387,16 +400,19 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> { } } - fn push_impl_path_fallback(self, - buffer: &mut T, - impl_def_id: DefId) + fn push_impl_path_fallback( + self, + buffer: &mut T, + impl_def_id: DefId, + pushed_prelude_crate: bool, + ) where T: ItemPathBuffer + Debug { // If no type info is available, fall back to // pretty printing some span information. This should // only occur very early in the compiler pipeline. let parent_def_id = self.parent_def_id(impl_def_id).unwrap(); - self.push_item_path(buffer, parent_def_id); + self.push_item_path(buffer, parent_def_id, pushed_prelude_crate); let node_id = self.hir.as_local_node_id(impl_def_id).unwrap(); let item = self.hir.expect_item(node_id); let span_str = self.sess.source_map().span_to_string(item.span); diff --git a/src/librustc_codegen_utils/symbol_names.rs b/src/librustc_codegen_utils/symbol_names.rs index 7651dfe4f34e9..c1e80234a7750 100644 --- a/src/librustc_codegen_utils/symbol_names.rs +++ b/src/librustc_codegen_utils/symbol_names.rs @@ -228,7 +228,7 @@ fn get_symbol_hash<'a, 'tcx>( fn def_symbol_name<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> ty::SymbolName { let mut buffer = SymbolPathBuffer::new(); item_path::with_forced_absolute_paths(|| { - tcx.push_item_path(&mut buffer, def_id); + tcx.push_item_path(&mut buffer, def_id, false); }); buffer.into_interned() } diff --git a/src/librustdoc/clean/mod.rs b/src/librustdoc/clean/mod.rs index c0a8009e53688..371b631723a39 100644 --- a/src/librustdoc/clean/mod.rs +++ b/src/librustdoc/clean/mod.rs @@ -4008,7 +4008,7 @@ where F: Fn(DefId) -> Def { let mut apb = AbsolutePathBuffer { names: vec![] }; - tcx.push_item_path(&mut apb, def_id); + tcx.push_item_path(&mut apb, def_id, false); hir::Path { span: DUMMY_SP, From e536e64702a12898ba7156c66de40b652ac21db1 Mon Sep 17 00:00:00 2001 From: Pramod Bisht Date: Tue, 2 Oct 2018 05:51:02 +0000 Subject: [PATCH 18/21] Consolidate pattern check errors we are consolidating `cannot bind by-move and by-ref in the same pattern` message present on the different lines into single diagnostic message. To do this, we are first gathering those spans into the vector after that we are throwing them with the help of MultiSpan in a separate block. Addresses: #53840 --- src/librustc_mir/hair/pattern/check_match.rs | 34 ++++++++++++-------- src/test/ui/issue-53840.rs | 27 ++++++++++++++++ src/test/ui/issue-53840.stderr | 20 ++++++++++++ 3 files changed, 67 insertions(+), 14 deletions(-) create mode 100644 src/test/ui/issue-53840.rs create mode 100644 src/test/ui/issue-53840.stderr diff --git a/src/librustc_mir/hair/pattern/check_match.rs b/src/librustc_mir/hair/pattern/check_match.rs index 6187e091319e0..f2ae5774da875 100644 --- a/src/librustc_mir/hair/pattern/check_match.rs +++ b/src/librustc_mir/hair/pattern/check_match.rs @@ -35,7 +35,7 @@ use std::slice; use syntax::ast; use syntax::ptr::P; -use syntax_pos::{Span, DUMMY_SP}; +use syntax_pos::{Span, DUMMY_SP, MultiSpan}; struct OuterVisitor<'a, 'tcx: 'a> { tcx: TyCtxt<'a, 'tcx, 'tcx> } @@ -527,8 +527,8 @@ fn check_legality_of_move_bindings(cx: &MatchVisitor, } }) } - - let check_move = |p: &Pat, sub: Option<&Pat>| { + let span_vec = &mut Vec::new(); + let check_move = |p: &Pat, sub: Option<&Pat>, span_vec: &mut Vec| { // check legality of moving out of the enum // x @ Foo(..) is legal, but x @ Foo(y) isn't. @@ -546,16 +546,8 @@ fn check_legality_of_move_bindings(cx: &MatchVisitor, crate attributes to enable"); } err.emit(); - } else if let Some(by_ref_span) = by_ref_span { - struct_span_err!( - cx.tcx.sess, - p.span, - E0009, - "cannot bind by-move and by-ref in the same pattern", - ) - .span_label(p.span, "by-move pattern here") - .span_label(by_ref_span, "both by-ref and by-move used") - .emit(); + } else if let Some(_by_ref_span) = by_ref_span { + span_vec.push(p.span); } }; @@ -567,7 +559,7 @@ fn check_legality_of_move_bindings(cx: &MatchVisitor, ty::BindByValue(..) => { let pat_ty = cx.tables.node_id_to_type(p.hir_id); if pat_ty.moves_by_default(cx.tcx, cx.param_env, pat.span) { - check_move(p, sub.as_ref().map(|p| &**p)); + check_move(p, sub.as_ref().map(|p| &**p), span_vec); } } _ => {} @@ -579,6 +571,20 @@ fn check_legality_of_move_bindings(cx: &MatchVisitor, true }); } + if !span_vec.is_empty(){ + let span = MultiSpan::from_spans(span_vec.clone()); + let mut err = struct_span_err!( + cx.tcx.sess, + span, + E0009, + "cannot bind by-move and by-ref in the same pattern", + ); + err.span_label(by_ref_span.unwrap(), "both by-ref and by-move used"); + for span in span_vec.iter(){ + err.span_label(*span, "by-move pattern here"); + } + err.emit(); + } } /// Ensures that a pattern guard doesn't borrow by mutable reference or diff --git a/src/test/ui/issue-53840.rs b/src/test/ui/issue-53840.rs new file mode 100644 index 0000000000000..ece3caf78e218 --- /dev/null +++ b/src/test/ui/issue-53840.rs @@ -0,0 +1,27 @@ +// Copyright 2018 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. +enum E { + Foo(String, String, String), +} + +struct Bar { + a: String, + b: String, +} + +fn main() { + let bar = Bar { a: "1".to_string(), b: "2".to_string() }; + match E::Foo("".into(), "".into(), "".into()) { + E::Foo(a, b, ref c) => {} + } + match bar { + Bar {a, ref b} => {} + } +} diff --git a/src/test/ui/issue-53840.stderr b/src/test/ui/issue-53840.stderr new file mode 100644 index 0000000000000..961e4c0ff6286 --- /dev/null +++ b/src/test/ui/issue-53840.stderr @@ -0,0 +1,20 @@ +error[E0009]: cannot bind by-move and by-ref in the same pattern + --> $DIR/issue-53840.rs:22:16 + | +LL | E::Foo(a, b, ref c) => {} + | ^ ^ ----- both by-ref and by-move used + | | | + | | by-move pattern here + | by-move pattern here + +error[E0009]: cannot bind by-move and by-ref in the same pattern + --> $DIR/issue-53840.rs:25:14 + | +LL | Bar {a, ref b} => {} + | ^ ----- both by-ref and by-move used + | | + | by-move pattern here + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0009`. From 454b14a511d4a7aadb68152c78c06e1e893a0fb7 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Tue, 2 Oct 2018 13:14:19 +0200 Subject: [PATCH 19/21] move some more tests --- src/test/{run-pass => ui}/issues/issue-10853.rs | 2 +- src/test/{run-pass => ui}/issues/issue-1251.rs | 2 +- src/test/{run-pass => ui}/issues/issue-14901.rs | 2 +- src/test/{run-pass => ui}/issues/issue-14936.rs | 2 +- src/test/{run-pass => ui}/issues/issue-1821.rs | 2 +- src/test/{run-pass => ui}/issues/issue-1866.rs | 2 +- src/test/{run-pass => ui}/issues/issue-18988.rs | 2 +- src/test/{run-pass => ui}/issues/issue-22777.rs | 2 +- src/test/{run-pass => ui}/issues/issue-2311-2.rs | 2 +- src/test/{run-pass => ui}/issues/issue-2311.rs | 2 +- src/test/{run-pass => ui}/issues/issue-2312.rs | 2 +- src/test/{run-pass => ui}/issues/issue-24161.rs | 2 +- src/test/{run-pass => ui}/issues/issue-2487-a.rs | 2 +- src/test/{run-pass => ui}/issues/issue-2502.rs | 2 +- src/test/{run-pass => ui}/issues/issue-2611-3.rs | 2 +- src/test/{run-pass => ui}/issues/issue-2748-a.rs | 2 +- src/test/{run-pass => ui}/issues/issue-2804-2.rs | 2 +- src/test/{run-pass => ui}/issues/issue-2904.rs | 2 +- src/test/{run-pass => ui}/issues/issue-3149.rs | 2 +- src/test/{run-pass => ui}/issues/issue-3424.rs | 2 +- src/test/{run-pass => ui}/issues/issue-3563-2.rs | 2 +- src/test/{run-pass => ui}/issues/issue-3609.rs | 2 +- src/test/{run-pass => ui}/issues/issue-37733.rs | 2 +- src/test/{run-pass => ui}/issues/issue-3874.rs | 2 +- src/test/{run-pass => ui}/issues/issue-3888-2.rs | 2 +- src/test/{run-pass => ui}/issues/issue-3979-2.rs | 2 +- src/test/{run-pass => ui}/issues/issue-3991.rs | 2 +- src/test/{run-pass => ui}/issues/issue-4025.rs | 2 +- src/test/{run-pass => ui}/issues/issue-4464.rs | 2 +- src/test/{run-pass => ui}/issues/issue-4830.rs | 2 +- src/test/{run-pass => ui}/issues/issue-5353.rs | 2 +- src/test/{run-pass => ui}/issues/issue-5572.rs | 2 +- src/test/{run-pass => ui}/issues/issue-5754.rs | 2 +- src/test/{run-pass => ui}/issues/issue-5884.rs | 2 +- src/test/{run-pass => ui}/issues/issue-5900.rs | 2 +- src/test/{run-pass => ui}/issues/issue-5950.rs | 2 +- src/test/{run-pass => ui}/issues/issue-6341.rs | 2 +- src/test/{run-pass => ui}/issues/issue-6470.rs | 2 +- src/test/{run-pass => ui}/issues/issue-6557.rs | 2 +- src/test/{run-pass => ui}/issues/issue-6898.rs | 2 +- src/test/{run-pass => ui}/issues/issue-7607-2.rs | 2 +- .../issues/issue-7673-cast-generically-implemented-trait.rs | 2 +- .../issue-8171-default-method-self-inherit-builtin-trait.rs | 2 +- src/test/{run-pass => ui}/issues/issue-8398.rs | 2 +- src/test/{run-pass => ui}/issues/issue-8578.rs | 2 +- src/test/{run-pass => ui}/issues/issue-9110.rs | 2 +- src/test/{run-pass => ui}/issues/issue-9719.rs | 2 +- 47 files changed, 47 insertions(+), 47 deletions(-) rename src/test/{run-pass => ui}/issues/issue-10853.rs (97%) rename src/test/{run-pass => ui}/issues/issue-1251.rs (97%) rename src/test/{run-pass => ui}/issues/issue-14901.rs (97%) rename src/test/{run-pass => ui}/issues/issue-14936.rs (99%) rename src/test/{run-pass => ui}/issues/issue-1821.rs (97%) rename src/test/{run-pass => ui}/issues/issue-1866.rs (98%) rename src/test/{run-pass => ui}/issues/issue-18988.rs (97%) rename src/test/{run-pass => ui}/issues/issue-22777.rs (99%) rename src/test/{run-pass => ui}/issues/issue-2311-2.rs (97%) rename src/test/{run-pass => ui}/issues/issue-2311.rs (97%) rename src/test/{run-pass => ui}/issues/issue-2312.rs (97%) rename src/test/{run-pass => ui}/issues/issue-24161.rs (97%) rename src/test/{run-pass => ui}/issues/issue-2487-a.rs (98%) rename src/test/{run-pass => ui}/issues/issue-2502.rs (98%) rename src/test/{run-pass => ui}/issues/issue-2611-3.rs (97%) rename src/test/{run-pass => ui}/issues/issue-2748-a.rs (97%) rename src/test/{run-pass => ui}/issues/issue-2804-2.rs (98%) rename src/test/{run-pass => ui}/issues/issue-2904.rs (99%) rename src/test/{run-pass => ui}/issues/issue-3149.rs (98%) rename src/test/{run-pass => ui}/issues/issue-3424.rs (98%) rename src/test/{run-pass => ui}/issues/issue-3563-2.rs (97%) rename src/test/{run-pass => ui}/issues/issue-3609.rs (98%) rename src/test/{run-pass => ui}/issues/issue-37733.rs (97%) rename src/test/{run-pass => ui}/issues/issue-3874.rs (97%) rename src/test/{run-pass => ui}/issues/issue-3888-2.rs (97%) rename src/test/{run-pass => ui}/issues/issue-3979-2.rs (97%) rename src/test/{run-pass => ui}/issues/issue-3991.rs (97%) rename src/test/{run-pass => ui}/issues/issue-4025.rs (98%) rename src/test/{run-pass => ui}/issues/issue-4464.rs (97%) rename src/test/{run-pass => ui}/issues/issue-4830.rs (97%) rename src/test/{run-pass => ui}/issues/issue-5353.rs (98%) rename src/test/{run-pass => ui}/issues/issue-5572.rs (97%) rename src/test/{run-pass => ui}/issues/issue-5754.rs (97%) rename src/test/{run-pass => ui}/issues/issue-5884.rs (97%) rename src/test/{run-pass => ui}/issues/issue-5900.rs (97%) rename src/test/{run-pass => ui}/issues/issue-5950.rs (97%) rename src/test/{run-pass => ui}/issues/issue-6341.rs (97%) rename src/test/{run-pass => ui}/issues/issue-6470.rs (97%) rename src/test/{run-pass => ui}/issues/issue-6557.rs (97%) rename src/test/{run-pass => ui}/issues/issue-6898.rs (98%) rename src/test/{run-pass => ui}/issues/issue-7607-2.rs (97%) rename src/test/{run-pass => ui}/issues/issue-7673-cast-generically-implemented-trait.rs (98%) rename src/test/{run-pass => ui}/issues/issue-8171-default-method-self-inherit-builtin-trait.rs (97%) rename src/test/{run-pass => ui}/issues/issue-8398.rs (97%) rename src/test/{run-pass => ui}/issues/issue-8578.rs (98%) rename src/test/{run-pass => ui}/issues/issue-9110.rs (97%) rename src/test/{run-pass => ui}/issues/issue-9719.rs (98%) diff --git a/src/test/run-pass/issues/issue-10853.rs b/src/test/ui/issues/issue-10853.rs similarity index 97% rename from src/test/run-pass/issues/issue-10853.rs rename to src/test/ui/issues/issue-10853.rs index 4a67d256f5de5..6e2aea4d1ab42 100644 --- a/src/test/run-pass/issues/issue-10853.rs +++ b/src/test/ui/issues/issue-10853.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 #![deny(missing_docs)] diff --git a/src/test/run-pass/issues/issue-1251.rs b/src/test/ui/issues/issue-1251.rs similarity index 97% rename from src/test/run-pass/issues/issue-1251.rs rename to src/test/ui/issues/issue-1251.rs index f9d48b8c835a5..b42404ce7739b 100644 --- a/src/test/run-pass/issues/issue-1251.rs +++ b/src/test/ui/issues/issue-1251.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(unused_attributes)] #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-14901.rs b/src/test/ui/issues/issue-14901.rs similarity index 97% rename from src/test/run-pass/issues/issue-14901.rs rename to src/test/ui/issues/issue-14901.rs index 7612c5bc8557a..18a6cfde3bdf1 100644 --- a/src/test/run-pass/issues/issue-14901.rs +++ b/src/test/ui/issues/issue-14901.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass pub trait Reader {} enum Wrapper<'a> { diff --git a/src/test/run-pass/issues/issue-14936.rs b/src/test/ui/issues/issue-14936.rs similarity index 99% rename from src/test/run-pass/issues/issue-14936.rs rename to src/test/ui/issues/issue-14936.rs index 4249a83e3c22e..d90814daf5f28 100644 --- a/src/test/run-pass/issues/issue-14936.rs +++ b/src/test/ui/issues/issue-14936.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(unused_macros)] #![allow(dead_code)] #![feature(asm)] diff --git a/src/test/run-pass/issues/issue-1821.rs b/src/test/ui/issues/issue-1821.rs similarity index 97% rename from src/test/run-pass/issues/issue-1821.rs rename to src/test/ui/issues/issue-1821.rs index d37b6df6e34a8..8518547ac2559 100644 --- a/src/test/run-pass/issues/issue-1821.rs +++ b/src/test/ui/issues/issue-1821.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/run-pass/issues/issue-1866.rs b/src/test/ui/issues/issue-1866.rs similarity index 98% rename from src/test/run-pass/issues/issue-1866.rs rename to src/test/ui/issues/issue-1866.rs index f27d8032dd660..eb670b4a5828a 100644 --- a/src/test/run-pass/issues/issue-1866.rs +++ b/src/test/ui/issues/issue-1866.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/run-pass/issues/issue-18988.rs b/src/test/ui/issues/issue-18988.rs similarity index 97% rename from src/test/run-pass/issues/issue-18988.rs rename to src/test/ui/issues/issue-18988.rs index 691d41174303f..6aadef691387f 100644 --- a/src/test/run-pass/issues/issue-18988.rs +++ b/src/test/ui/issues/issue-18988.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] pub trait Foo : Send { } diff --git a/src/test/run-pass/issues/issue-22777.rs b/src/test/ui/issues/issue-22777.rs similarity index 99% rename from src/test/run-pass/issues/issue-22777.rs rename to src/test/ui/issues/issue-22777.rs index 92ad7a43d4d17..c97c10073e397 100644 --- a/src/test/run-pass/issues/issue-22777.rs +++ b/src/test/ui/issues/issue-22777.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // This test is reduced from libsyntax. It is just checking that we // can successfully deal with a "deep" structure, which the drop-check // was hitting a recursion limit on at one point. diff --git a/src/test/run-pass/issues/issue-2311-2.rs b/src/test/ui/issues/issue-2311-2.rs similarity index 97% rename from src/test/run-pass/issues/issue-2311-2.rs rename to src/test/ui/issues/issue-2311-2.rs index 493ff6f01cbe7..cc6376eb66895 100644 --- a/src/test/run-pass/issues/issue-2311-2.rs +++ b/src/test/ui/issues/issue-2311-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/run-pass/issues/issue-2311.rs b/src/test/ui/issues/issue-2311.rs similarity index 97% rename from src/test/run-pass/issues/issue-2311.rs rename to src/test/ui/issues/issue-2311.rs index 816754c4617e9..77e014e278598 100644 --- a/src/test/run-pass/issues/issue-2311.rs +++ b/src/test/ui/issues/issue-2311.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(non_camel_case_types)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-2312.rs b/src/test/ui/issues/issue-2312.rs similarity index 97% rename from src/test/run-pass/issues/issue-2312.rs rename to src/test/ui/issues/issue-2312.rs index 9975f8a5aa725..0de460a30ab40 100644 --- a/src/test/run-pass/issues/issue-2312.rs +++ b/src/test/ui/issues/issue-2312.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/run-pass/issues/issue-24161.rs b/src/test/ui/issues/issue-24161.rs similarity index 97% rename from src/test/run-pass/issues/issue-24161.rs rename to src/test/ui/issues/issue-24161.rs index 8bb88be7c5625..fb50f4dc8db0f 100644 --- a/src/test/run-pass/issues/issue-24161.rs +++ b/src/test/ui/issues/issue-24161.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #[derive(Copy,Clone)] struct Functions { diff --git a/src/test/run-pass/issues/issue-2487-a.rs b/src/test/ui/issues/issue-2487-a.rs similarity index 98% rename from src/test/run-pass/issues/issue-2487-a.rs rename to src/test/ui/issues/issue-2487-a.rs index 6bd1757f64cea..bff4eb92806d0 100644 --- a/src/test/run-pass/issues/issue-2487-a.rs +++ b/src/test/ui/issues/issue-2487-a.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/run-pass/issues/issue-2502.rs b/src/test/ui/issues/issue-2502.rs similarity index 98% rename from src/test/run-pass/issues/issue-2502.rs rename to src/test/ui/issues/issue-2502.rs index 938a8e290444b..24ba19c4b7f2a 100644 --- a/src/test/run-pass/issues/issue-2502.rs +++ b/src/test/ui/issues/issue-2502.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(non_camel_case_types)] diff --git a/src/test/run-pass/issues/issue-2611-3.rs b/src/test/ui/issues/issue-2611-3.rs similarity index 97% rename from src/test/run-pass/issues/issue-2611-3.rs rename to src/test/ui/issues/issue-2611-3.rs index 99fd1a727f55c..29a8200104ac0 100644 --- a/src/test/run-pass/issues/issue-2611-3.rs +++ b/src/test/ui/issues/issue-2611-3.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // Tests that impls are allowed to have looser, more permissive bounds // than the traits require. diff --git a/src/test/run-pass/issues/issue-2748-a.rs b/src/test/ui/issues/issue-2748-a.rs similarity index 97% rename from src/test/run-pass/issues/issue-2748-a.rs rename to src/test/ui/issues/issue-2748-a.rs index db7b46a4dc5af..8c8d3c557fc7d 100644 --- a/src/test/run-pass/issues/issue-2748-a.rs +++ b/src/test/ui/issues/issue-2748-a.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(non_snake_case)] diff --git a/src/test/run-pass/issues/issue-2804-2.rs b/src/test/ui/issues/issue-2804-2.rs similarity index 98% rename from src/test/run-pass/issues/issue-2804-2.rs rename to src/test/ui/issues/issue-2804-2.rs index 3e64d78ba0274..1894d50ed9921 100644 --- a/src/test/run-pass/issues/issue-2804-2.rs +++ b/src/test/ui/issues/issue-2804-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // Minimized version of issue-2804.rs. Both check that callee IDs don't // clobber the previous node ID in a macro expr diff --git a/src/test/run-pass/issues/issue-2904.rs b/src/test/ui/issues/issue-2904.rs similarity index 99% rename from src/test/run-pass/issues/issue-2904.rs rename to src/test/ui/issues/issue-2904.rs index ab40c2e0bbec5..2e91979a517d0 100644 --- a/src/test/run-pass/issues/issue-2904.rs +++ b/src/test/ui/issues/issue-2904.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(unused_must_use)] #![allow(dead_code)] #![allow(unused_mut)] diff --git a/src/test/run-pass/issues/issue-3149.rs b/src/test/ui/issues/issue-3149.rs similarity index 98% rename from src/test/run-pass/issues/issue-3149.rs rename to src/test/ui/issues/issue-3149.rs index 4eb3378a089ee..507af2f6c2a46 100644 --- a/src/test/run-pass/issues/issue-3149.rs +++ b/src/test/ui/issues/issue-3149.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(non_snake_case)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-3424.rs b/src/test/ui/issues/issue-3424.rs similarity index 98% rename from src/test/run-pass/issues/issue-3424.rs rename to src/test/ui/issues/issue-3424.rs index cf1b002266172..7bf0c4393c302 100644 --- a/src/test/run-pass/issues/issue-3424.rs +++ b/src/test/ui/issues/issue-3424.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(non_camel_case_types)] // rustc --test ignores2.rs && ./ignores2 diff --git a/src/test/run-pass/issues/issue-3563-2.rs b/src/test/ui/issues/issue-3563-2.rs similarity index 97% rename from src/test/run-pass/issues/issue-3563-2.rs rename to src/test/ui/issues/issue-3563-2.rs index 534bec59018e6..916adc83223ac 100644 --- a/src/test/run-pass/issues/issue-3563-2.rs +++ b/src/test/ui/issues/issue-3563-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 trait Canvas { diff --git a/src/test/run-pass/issues/issue-3609.rs b/src/test/ui/issues/issue-3609.rs similarity index 98% rename from src/test/run-pass/issues/issue-3609.rs rename to src/test/ui/issues/issue-3609.rs index abbaf630e78e0..070b2e538d7ba 100644 --- a/src/test/run-pass/issues/issue-3609.rs +++ b/src/test/ui/issues/issue-3609.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(unused_must_use)] #![allow(dead_code)] #![allow(unused_mut)] diff --git a/src/test/run-pass/issues/issue-37733.rs b/src/test/ui/issues/issue-37733.rs similarity index 97% rename from src/test/run-pass/issues/issue-37733.rs rename to src/test/ui/issues/issue-37733.rs index a982cae262120..04a4c19785b50 100644 --- a/src/test/run-pass/issues/issue-37733.rs +++ b/src/test/ui/issues/issue-37733.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] type A = for<> fn(); diff --git a/src/test/run-pass/issues/issue-3874.rs b/src/test/ui/issues/issue-3874.rs similarity index 97% rename from src/test/run-pass/issues/issue-3874.rs rename to src/test/ui/issues/issue-3874.rs index 2b1e25d2a1a7a..791a4bb8af0af 100644 --- a/src/test/run-pass/issues/issue-3874.rs +++ b/src/test/ui/issues/issue-3874.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-3888-2.rs b/src/test/ui/issues/issue-3888-2.rs similarity index 97% rename from src/test/run-pass/issues/issue-3888-2.rs rename to src/test/ui/issues/issue-3888-2.rs index 2d702dac0285a..79b206799ad24 100644 --- a/src/test/run-pass/issues/issue-3888-2.rs +++ b/src/test/ui/issues/issue-3888-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-3979-2.rs b/src/test/ui/issues/issue-3979-2.rs similarity index 97% rename from src/test/run-pass/issues/issue-3979-2.rs rename to src/test/ui/issues/issue-3979-2.rs index 9b8e5817c6c15..adfd5873ea77b 100644 --- a/src/test/run-pass/issues/issue-3979-2.rs +++ b/src/test/ui/issues/issue-3979-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 trait A { diff --git a/src/test/run-pass/issues/issue-3991.rs b/src/test/ui/issues/issue-3991.rs similarity index 97% rename from src/test/run-pass/issues/issue-3991.rs rename to src/test/ui/issues/issue-3991.rs index 9028066cfacd5..90fa1f8c3e09e 100644 --- a/src/test/run-pass/issues/issue-3991.rs +++ b/src/test/ui/issues/issue-3991.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-4025.rs b/src/test/ui/issues/issue-4025.rs similarity index 98% rename from src/test/run-pass/issues/issue-4025.rs rename to src/test/ui/issues/issue-4025.rs index 41af0826c00aa..470dd1e430f9c 100644 --- a/src/test/run-pass/issues/issue-4025.rs +++ b/src/test/ui/issues/issue-4025.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(unused_mut)] /* diff --git a/src/test/run-pass/issues/issue-4464.rs b/src/test/ui/issues/issue-4464.rs similarity index 97% rename from src/test/run-pass/issues/issue-4464.rs rename to src/test/ui/issues/issue-4464.rs index fda063e8ddd27..a1b2040450ad9 100644 --- a/src/test/run-pass/issues/issue-4464.rs +++ b/src/test/ui/issues/issue-4464.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-4830.rs b/src/test/ui/issues/issue-4830.rs similarity index 97% rename from src/test/run-pass/issues/issue-4830.rs rename to src/test/ui/issues/issue-4830.rs index 5140162ae4353..274305dfa78ed 100644 --- a/src/test/run-pass/issues/issue-4830.rs +++ b/src/test/ui/issues/issue-4830.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-5353.rs b/src/test/ui/issues/issue-5353.rs similarity index 98% rename from src/test/run-pass/issues/issue-5353.rs rename to src/test/ui/issues/issue-5353.rs index d9d0783133165..0c5de871f098c 100644 --- a/src/test/run-pass/issues/issue-5353.rs +++ b/src/test/ui/issues/issue-5353.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-5572.rs b/src/test/ui/issues/issue-5572.rs similarity index 97% rename from src/test/run-pass/issues/issue-5572.rs rename to src/test/ui/issues/issue-5572.rs index 02f12a0303a59..90465668d8100 100644 --- a/src/test/run-pass/issues/issue-5572.rs +++ b/src/test/ui/issues/issue-5572.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-5754.rs b/src/test/ui/issues/issue-5754.rs similarity index 97% rename from src/test/run-pass/issues/issue-5754.rs rename to src/test/ui/issues/issue-5754.rs index 9b9026304598e..d60edcad0db66 100644 --- a/src/test/run-pass/issues/issue-5754.rs +++ b/src/test/ui/issues/issue-5754.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(improper_ctypes)] diff --git a/src/test/run-pass/issues/issue-5884.rs b/src/test/ui/issues/issue-5884.rs similarity index 97% rename from src/test/run-pass/issues/issue-5884.rs rename to src/test/ui/issues/issue-5884.rs index 82d87d9d270a1..d0c898e3f36b8 100644 --- a/src/test/run-pass/issues/issue-5884.rs +++ b/src/test/ui/issues/issue-5884.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-5900.rs b/src/test/ui/issues/issue-5900.rs similarity index 97% rename from src/test/run-pass/issues/issue-5900.rs rename to src/test/ui/issues/issue-5900.rs index edb4ead53e42f..4dc5a61238832 100644 --- a/src/test/run-pass/issues/issue-5900.rs +++ b/src/test/ui/issues/issue-5900.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-5950.rs b/src/test/ui/issues/issue-5950.rs similarity index 97% rename from src/test/run-pass/issues/issue-5950.rs rename to src/test/ui/issues/issue-5950.rs index 239f968041392..6cdd36efaa719 100644 --- a/src/test/run-pass/issues/issue-5950.rs +++ b/src/test/ui/issues/issue-5950.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-6341.rs b/src/test/ui/issues/issue-6341.rs similarity index 97% rename from src/test/run-pass/issues/issue-6341.rs rename to src/test/ui/issues/issue-6341.rs index ca79e304b15fc..758e33536bd3e 100644 --- a/src/test/run-pass/issues/issue-6341.rs +++ b/src/test/ui/issues/issue-6341.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 #[derive(PartialEq)] diff --git a/src/test/run-pass/issues/issue-6470.rs b/src/test/ui/issues/issue-6470.rs similarity index 97% rename from src/test/run-pass/issues/issue-6470.rs rename to src/test/ui/issues/issue-6470.rs index a23a6532b1550..00eb3b6348d35 100644 --- a/src/test/run-pass/issues/issue-6470.rs +++ b/src/test/ui/issues/issue-6470.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(improper_ctypes)] diff --git a/src/test/run-pass/issues/issue-6557.rs b/src/test/ui/issues/issue-6557.rs similarity index 97% rename from src/test/run-pass/issues/issue-6557.rs rename to src/test/ui/issues/issue-6557.rs index 886d13c4c6f12..ddec8b3f93456 100644 --- a/src/test/run-pass/issues/issue-6557.rs +++ b/src/test/ui/issues/issue-6557.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-6898.rs b/src/test/ui/issues/issue-6898.rs similarity index 98% rename from src/test/run-pass/issues/issue-6898.rs rename to src/test/ui/issues/issue-6898.rs index b9a3a24585b5c..20174f241a409 100644 --- a/src/test/run-pass/issues/issue-6898.rs +++ b/src/test/ui/issues/issue-6898.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass // pretty-expanded FIXME #23616 use std::mem; diff --git a/src/test/run-pass/issues/issue-7607-2.rs b/src/test/ui/issues/issue-7607-2.rs similarity index 97% rename from src/test/run-pass/issues/issue-7607-2.rs rename to src/test/ui/issues/issue-7607-2.rs index fa97eae7cb33e..9c05717c1d712 100644 --- a/src/test/run-pass/issues/issue-7607-2.rs +++ b/src/test/ui/issues/issue-7607-2.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-7673-cast-generically-implemented-trait.rs b/src/test/ui/issues/issue-7673-cast-generically-implemented-trait.rs similarity index 98% rename from src/test/run-pass/issues/issue-7673-cast-generically-implemented-trait.rs rename to src/test/ui/issues/issue-7673-cast-generically-implemented-trait.rs index 6e5a6c551ebfe..d3af62e8836c6 100644 --- a/src/test/run-pass/issues/issue-7673-cast-generically-implemented-trait.rs +++ b/src/test/ui/issues/issue-7673-cast-generically-implemented-trait.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-8171-default-method-self-inherit-builtin-trait.rs b/src/test/ui/issues/issue-8171-default-method-self-inherit-builtin-trait.rs similarity index 97% rename from src/test/run-pass/issues/issue-8171-default-method-self-inherit-builtin-trait.rs rename to src/test/ui/issues/issue-8171-default-method-self-inherit-builtin-trait.rs index 9ddc63a208aed..27859e1a2aefd 100644 --- a/src/test/run-pass/issues/issue-8171-default-method-self-inherit-builtin-trait.rs +++ b/src/test/ui/issues/issue-8171-default-method-self-inherit-builtin-trait.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-8398.rs b/src/test/ui/issues/issue-8398.rs similarity index 97% rename from src/test/run-pass/issues/issue-8398.rs rename to src/test/ui/issues/issue-8398.rs index 2458e91daeb87..36c24be5fce31 100644 --- a/src/test/run-pass/issues/issue-8398.rs +++ b/src/test/ui/issues/issue-8398.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 diff --git a/src/test/run-pass/issues/issue-8578.rs b/src/test/ui/issues/issue-8578.rs similarity index 98% rename from src/test/run-pass/issues/issue-8578.rs rename to src/test/ui/issues/issue-8578.rs index 4cf39e3e5f055..0c5cbf24700af 100644 --- a/src/test/run-pass/issues/issue-8578.rs +++ b/src/test/ui/issues/issue-8578.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] #![allow(non_camel_case_types)] #![allow(non_upper_case_globals)] diff --git a/src/test/run-pass/issues/issue-9110.rs b/src/test/ui/issues/issue-9110.rs similarity index 97% rename from src/test/run-pass/issues/issue-9110.rs rename to src/test/ui/issues/issue-9110.rs index 150df681ea4d7..86314659fcbe9 100644 --- a/src/test/run-pass/issues/issue-9110.rs +++ b/src/test/ui/issues/issue-9110.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 #![allow(non_snake_case)] diff --git a/src/test/run-pass/issues/issue-9719.rs b/src/test/ui/issues/issue-9719.rs similarity index 98% rename from src/test/run-pass/issues/issue-9719.rs rename to src/test/ui/issues/issue-9719.rs index f98eba1cfdf8e..c3845dd61066c 100644 --- a/src/test/run-pass/issues/issue-9719.rs +++ b/src/test/ui/issues/issue-9719.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// run-pass +// compile-pass #![allow(dead_code)] // pretty-expanded FIXME #23616 From 092bf2b50067a92e03da024b0406dca1c0e05d12 Mon Sep 17 00:00:00 2001 From: Austin Bonander Date: Tue, 2 Oct 2018 03:42:01 -0700 Subject: [PATCH 20/21] make `CStr::from_bytes_with_nul_unchecked()` a const fn closes #54678 --- src/libstd/ffi/c_str.rs | 12 +++++++++++- src/libstd/lib.rs | 1 + 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/libstd/ffi/c_str.rs b/src/libstd/ffi/c_str.rs index 63dd12f782fda..dfec13cd2ec00 100644 --- a/src/libstd/ffi/c_str.rs +++ b/src/libstd/ffi/c_str.rs @@ -1040,7 +1040,8 @@ impl CStr { /// ``` #[inline] #[stable(feature = "cstr_from_bytes", since = "1.10.0")] - pub unsafe fn from_bytes_with_nul_unchecked(bytes: &[u8]) -> &CStr { + #[rustc_const_unstable(feature = "const_cstr_unchecked")] + pub const unsafe fn from_bytes_with_nul_unchecked(bytes: &[u8]) -> &CStr { &*(bytes as *const [u8] as *const CStr) } @@ -1471,4 +1472,13 @@ mod tests { assert_eq!(&*rc2, cstr); assert_eq!(&*arc2, cstr); } + + #[test] + fn cstr_const_constructor() { + const CSTR: &'static CStr = unsafe { + CStr::from_bytes_with_nul_unchecked(b"Hello, world!\0") + }; + + assert_eq!(CSTR.to_str().unwrap(), "Hello, world!"); + } } diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 7ae4f2de4c36d..f8b1760975ae4 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -253,6 +253,7 @@ #![feature(min_const_fn)] #![feature(const_int_ops)] #![feature(const_ip)] +#![feature(const_raw_ptr_deref)] #![feature(core_intrinsics)] #![feature(dropck_eyepatch)] #![feature(exact_size_is_empty)] From e0caaec6f92b7d9bf02278c6ed991cdb7139cd06 Mon Sep 17 00:00:00 2001 From: Austin Bonander Date: Tue, 2 Oct 2018 04:26:16 -0700 Subject: [PATCH 21/21] make `CStr::from_bytes_with_nul_unchecked()` a const fn closes #54678 --- src/libstd/lib.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index f8b1760975ae4..afe0b67e33020 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -254,6 +254,7 @@ #![feature(const_int_ops)] #![feature(const_ip)] #![feature(const_raw_ptr_deref)] +#![feature(const_cstr_unchecked)] #![feature(core_intrinsics)] #![feature(dropck_eyepatch)] #![feature(exact_size_is_empty)]