+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-use std::rc::Rc;
-use std::sync::Arc;
-
-struct Foo(Arc<Bar>);
-
-enum Bar {
- A(Rc<Foo>),
- B(Option<Foo>),
-}
-
-fn f<T: Send>(_: T) {}
-
-fn main() {
- f(Foo(Arc::new(Bar::B(None))));
- //~^ ERROR E0277
- //~| ERROR E0277
-}
+++ /dev/null
-error[E0277]: `std::rc::Rc<Foo>` cannot be sent between threads safely
- --> $DIR/issue-40827.rs:24:5
- |
-LL | f(Foo(Arc::new(Bar::B(None))));
- | ^ `std::rc::Rc<Foo>` cannot be sent between threads safely
- |
- = help: within `Bar`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<Foo>`
- = note: required because it appears within the type `Bar`
- = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc<Bar>`
- = note: required because it appears within the type `Foo`
-note: required by `f`
- --> $DIR/issue-40827.rs:21:1
- |
-LL | fn f<T: Send>(_: T) {}
- | ^^^^^^^^^^^^^^^^^^^
-
-error[E0277]: `std::rc::Rc<Foo>` cannot be shared between threads safely
- --> $DIR/issue-40827.rs:24:5
- |
-LL | f(Foo(Arc::new(Bar::B(None))));
- | ^ `std::rc::Rc<Foo>` cannot be shared between threads safely
- |
- = help: within `Bar`, the trait `std::marker::Sync` is not implemented for `std::rc::Rc<Foo>`
- = note: required because it appears within the type `Bar`
- = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc<Bar>`
- = note: required because it appears within the type `Foo`
-note: required by `f`
- --> $DIR/issue-40827.rs:21:1
- |
-LL | fn f<T: Send>(_: T) {}
- | ^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0277`.
+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// compile-pass
-fn iter<'a>(data: &'a [usize]) -> impl Iterator<Item = usize> + 'a {
- data.iter()
- .map(
- |x| x // fn(&'a usize) -> &'(ReScope) usize
- )
- .map(
- |x| *x // fn(&'(ReScope) usize) -> usize
- )
-}
-
-fn main() {
-}
+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-fn main(){
- if i in 1..10 {
- break;
- }
-}
+++ /dev/null
-error: expected `{`, found keyword `in`
- --> $DIR/issue-51602.rs:12:10
- |
-LL | if i in 1..10 {
- | -- ^^ expected `{`
- | |
- | this `if` statement has a condition, but no block
-
-error: aborting due to previous error
-
+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-enum A {
- A {
- foo: usize,
- }
-}
-
-fn main() {
- let x = A::A { foo: 3 };
- match x {
- A::A { fob } => { println!("{}", fob); }
- }
-}
+++ /dev/null
-error[E0026]: variant `A::A` does not have a field named `fob`
- --> $DIR/issue-52717.rs:19:12
- |
-LL | A::A { fob } => { println!("{}", fob); }
- | ^^^
- | |
- | variant `A::A` does not have this field
- | help: did you mean: `foo`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0026`.
+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Regression test for an NLL-related ICE (#52992) -- computing
-// implied bounds was causing outlives relations that were not
-// properly handled.
-//
-// compile-pass
-
-#![feature(nll)]
-
-fn main() {}
-
-fn fail<'a>() -> Struct<'a, Generic<()>> {
- Struct(&Generic(()))
-}
-
-struct Struct<'a, T>(&'a T) where
- T: Trait + 'a,
- T::AT: 'a; // only fails with this bound
-
-struct Generic<T>(T);
-
-trait Trait {
- type AT;
-}
-
-impl<T> Trait for Generic<T> {
- type AT = T; // only fails with a generic AT
-}
+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-struct S;
-
-impl S {
- fn f() {}
-}
-
-macro_rules! impl_add {
- ($($n:ident)*) => {
- $(
- fn $n() {
- S::f::<i64>();
- //~^ ERROR wrong number of type arguments
- }
- )*
- }
-}
-
-impl_add!(a b);
-
-fn main() {}
+++ /dev/null
-error[E0107]: wrong number of type arguments: expected 0, found 1
- --> $DIR/issue-53251.rs:21:24
- |
-LL | S::f::<i64>();
- | ^^^ unexpected type argument
-...
-LL | impl_add!(a b);
- | --------------- in this macro invocation
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0107`.
+++ /dev/null
-// Copyright 2012-2014 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// issue 53300
-
-pub trait A {
- fn add(&self, b: i32) -> i32;
-}
-
-fn addition() -> Wrapper<impl A> {}
-//~^ ERROR cannot find type `Wrapper` in this scope [E0412]
-
-fn main() {
- let res = addition();
-}
+++ /dev/null
-error[E0412]: cannot find type `Wrapper` in this scope
- --> $DIR/issue-53300.rs:17:18
- |
-LL | fn addition() -> Wrapper<impl A> {}
- | ^^^^^^^ not found in this scope
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0412`.
+++ /dev/null
-// Copyright 2012 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-//compile-pass
-
-struct Foo {
- bar: for<'r> Fn(usize, &'r FnMut())
-}
-
-fn main() {
-}
-
+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-use std::time::{foo, bar, buzz};
-use std::time::{abc, def};
-fn main(){
- println!("Hello World!");
-}
+++ /dev/null
-error[E0432]: unresolved imports `std::time::foo`, `std::time::bar`, `std::time::buzz`
- --> $DIR/issue-53565.rs:10:17
- |
-LL | use std::time::{foo, bar, buzz};
- | ^^^ ^^^ ^^^^ no `buzz` in `time`
- | | |
- | | no `bar` in `time`
- | no `foo` in `time`
-
-error[E0432]: unresolved imports `std::time::abc`, `std::time::def`
- --> $DIR/issue-53565.rs:11:17
- |
-LL | use std::time::{abc, def};
- | ^^^ ^^^ no `def` in `time`
- | |
- | no `abc` in `time`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0432`.
+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Regression test for an NLL-related ICE (#53568) -- we failed to
-// resolve inference variables in "custom type-ops".
-//
-// compile-pass
-
-#![feature(nll)]
-#![allow(dead_code)]
-
-trait Future {
- type Item;
-}
-
-impl<F, T> Future for F
-where F: Fn() -> T
-{
- type Item = T;
-}
-
-trait Connect {}
-
-struct Connector<H> {
- handler: H,
-}
-
-impl<H, T> Connect for Connector<H>
-where
- T: 'static,
- H: Future<Item = T>
-{
-}
-
-struct Client<C> {
- connector: C,
-}
-
-fn build<C>(_connector: C) -> Client<C> {
- unimplemented!()
-}
-
-fn client<H>(handler: H) -> Client<impl Connect>
-where H: Fn() + Copy
-{
- let connector = Connector {
- handler,
- };
- let client = build(connector);
- client
-}
-
-fn main() { }
-
+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-fn main() {
- let items = vec![1, 2, 3];
- let ref_items: &[i32] = &items;
- let items_clone: Vec<i32> = ref_items.clone();
-
- // in that case no suggestion will be triggered
- let items_clone_2:Vec<i32> = items.clone();
-
- let s = "hi";
- let string: String = s.clone();
-
- // in that case no suggestion will be triggered
- let s2 = "hi";
- let string_2: String = s2.to_string();
-}
+++ /dev/null
-error[E0308]: mismatched types
- --> $DIR/issue-53692.rs:13:37
- |
-LL | let items_clone: Vec<i32> = ref_items.clone();
- | ^^^^^^^^^^^^^^^^^
- | |
- | expected struct `std::vec::Vec`, found &[i32]
- | help: try using a conversion method: `ref_items.to_vec()`
- |
- = note: expected type `std::vec::Vec<i32>`
- found type `&[i32]`
-
-error[E0308]: mismatched types
- --> $DIR/issue-53692.rs:19:30
- |
-LL | let string: String = s.clone();
- | ^^^^^^^^^
- | |
- | expected struct `std::string::String`, found &str
- | help: try using a conversion method: `s.to_string()`
- |
- = note: expected type `std::string::String`
- found type `&str`
-
-error: aborting due to 2 previous errors
-
-For more information about this error, try `rustc --explain E0308`.
+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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} => {}
- }
-}
+++ /dev/null
-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`.
+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait Mirror {
- type Image;
- fn coerce(self) -> Self::Image;
-}
-
-impl<T> Mirror for T {
- type Image = T;
- fn coerce(self) -> Self { self }
-}
-
-trait Foo<'x, T> {
- fn foo(self) -> &'x T;
-}
-
-impl<'s, 'x, T: 'x> Foo<'x, T> for &'s T where &'s T: Foo2<'x, T> {
- fn foo(self) -> &'x T { self.foo2() }
-}
-
-trait Foo2<'x, T> {
- fn foo2(self) -> &'x T;
-}
-
-// example 1 - fails leak check
-impl<'x> Foo2<'x, u32> for &'x u32
-{
- fn foo2(self) -> &'x u32 { self }
-}
-
-// example 2 - OK with this issue
-impl<'x, 'a: 'x> Foo2<'x, i32> for &'a i32
-{
- fn foo2(self) -> &'x i32 { self }
-}
-
-// example 3 - fails due to issue #XYZ + Leak-check
-impl<'x, T> Foo2<'x, u64> for T
- where T: Mirror<Image=&'x u64>
-{
- fn foo2(self) -> &'x u64 { self.coerce() }
-}
-
-// example 4 - fails due to issue #XYZ
-impl<'x, 'a: 'x, T> Foo2<'x, i64> for T
- where T: Mirror<Image=&'a i64>
-{
- fn foo2(self) -> &'x i64 { self.coerce() }
-}
-
-
-trait RefFoo<T> {
- fn ref_foo(&self) -> &'static T;
-}
-
-impl<T> RefFoo<T> for T where for<'a> &'a T: Foo<'static, T> {
- fn ref_foo(&self) -> &'static T {
- self.foo()
- }
-}
-
-
-fn coerce_lifetime1(a: &u32) -> &'static u32
-{
- <u32 as RefFoo<u32>>::ref_foo(a)
- //~^ ERROR the trait bound `for<'a> &'a u32: Foo2<'_, u32>` is not satisfied
-}
-
-fn coerce_lifetime2(a: &i32) -> &'static i32
-{
- <i32 as RefFoo<i32>>::ref_foo(a)
- //~^ ERROR the requirement `for<'a> 'a : ` is not satisfied
-}
-
-fn coerce_lifetime3(a: &u64) -> &'static u64
-{
- <u64 as RefFoo<u64>>::ref_foo(a)
- //~^ ERROR type mismatch resolving `for<'a> <&'a u64 as Mirror>::Image == &u64`
-}
-
-fn coerce_lifetime4(a: &i64) -> &'static i64
-{
- <i64 as RefFoo<i64>>::ref_foo(a)
- //~^ ERROR type mismatch resolving `for<'a> <&'a i64 as Mirror>::Image == &i64`
-}
-
-fn main() {}
+++ /dev/null
-error[E0277]: the trait bound `for<'a> &'a u32: Foo2<'_, u32>` is not satisfied
- --> $DIR/issue-54302-cases.rs:73:5
- |
-LL | <u32 as RefFoo<u32>>::ref_foo(a)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Foo2<'_, u32>` is not implemented for `&'a u32`
- |
- = help: the following implementations were found:
- <&'x u32 as Foo2<'x, u32>>
- = note: required because of the requirements on the impl of `for<'a> Foo<'static, u32>` for `&'a u32`
- = note: required because of the requirements on the impl of `RefFoo<u32>` for `u32`
-note: required by `RefFoo::ref_foo`
- --> $DIR/issue-54302-cases.rs:61:5
- |
-LL | fn ref_foo(&self) -> &'static T;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0279]: the requirement `for<'a> 'a : ` is not satisfied (`expected bound lifetime parameter 'a, found concrete lifetime`)
- --> $DIR/issue-54302-cases.rs:79:5
- |
-LL | <i32 as RefFoo<i32>>::ref_foo(a)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: required because of the requirements on the impl of `for<'a> Foo2<'_, i32>` for `&'a i32`
- = note: required because of the requirements on the impl of `for<'a> Foo<'static, i32>` for `&'a i32`
- = note: required because of the requirements on the impl of `RefFoo<i32>` for `i32`
-note: required by `RefFoo::ref_foo`
- --> $DIR/issue-54302-cases.rs:61:5
- |
-LL | fn ref_foo(&self) -> &'static T;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0271]: type mismatch resolving `for<'a> <&'a u64 as Mirror>::Image == &u64`
- --> $DIR/issue-54302-cases.rs:85:5
- |
-LL | <u64 as RefFoo<u64>>::ref_foo(a)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'a, found concrete lifetime
- |
- = note: required because of the requirements on the impl of `for<'a> Foo2<'_, u64>` for `&'a u64`
- = note: required because of the requirements on the impl of `for<'a> Foo<'static, u64>` for `&'a u64`
- = note: required because of the requirements on the impl of `RefFoo<u64>` for `u64`
-note: required by `RefFoo::ref_foo`
- --> $DIR/issue-54302-cases.rs:61:5
- |
-LL | fn ref_foo(&self) -> &'static T;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error[E0271]: type mismatch resolving `for<'a> <&'a i64 as Mirror>::Image == &i64`
- --> $DIR/issue-54302-cases.rs:91:5
- |
-LL | <i64 as RefFoo<i64>>::ref_foo(a)
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'a, found concrete lifetime
- |
- = note: required because of the requirements on the impl of `for<'a> Foo2<'_, i64>` for `&'a i64`
- = note: required because of the requirements on the impl of `for<'a> Foo<'static, i64>` for `&'a i64`
- = note: required because of the requirements on the impl of `RefFoo<i64>` for `i64`
-note: required by `RefFoo::ref_foo`
- --> $DIR/issue-54302-cases.rs:61:5
- |
-LL | fn ref_foo(&self) -> &'static T;
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to 4 previous errors
-
-Some errors occurred: E0271, E0277, E0279.
-For more information about an error, try `rustc --explain E0271`.
+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait Deserialize<'de> {}
-
-trait DeserializeOwned: for<'de> Deserialize<'de> {}
-impl<T> DeserializeOwned for T where T: for<'de> Deserialize<'de> {}
-
-// Based on this impl, `&'static str` only implements Deserialize<'static>.
-// It does not implement for<'de> Deserialize<'de>.
-impl<'de: 'a, 'a> Deserialize<'de> for &'a str {}
-
-fn main() {
- // Then why does it implement DeserializeOwned? This compiles.
- fn assert_deserialize_owned<T: DeserializeOwned>() {}
- assert_deserialize_owned::<&'static str>();
- //~^ ERROR the requirement `for<'de> 'de : ` is not satisfied
-
- // It correctly does not implement for<'de> Deserialize<'de>.
- //fn assert_hrtb<T: for<'de> Deserialize<'de>>() {}
- //assert_hrtb::<&'static str>();
-}
+++ /dev/null
-error[E0279]: the requirement `for<'de> 'de : ` is not satisfied (`expected bound lifetime parameter 'de, found concrete lifetime`)
- --> $DIR/issue-54302.rs:23:5
- |
-LL | assert_deserialize_owned::<&'static str>();
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: required because of the requirements on the impl of `for<'de> Deserialize<'de>` for `&'static str`
- = note: required because of the requirements on the impl of `DeserializeOwned` for `&'static str`
-note: required by `main::assert_deserialize_owned`
- --> $DIR/issue-54302.rs:22:5
- |
-LL | fn assert_deserialize_owned<T: DeserializeOwned>() {}
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0279`.
--- /dev/null
+// Copyright 2014 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+enum Foo {
+ Bar(isize)
+}
+
+pub mod test {
+ enum Foo {
+ Bar(isize)
+ }
+}
--- /dev/null
+// Copyright 2014 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+extern {
+ fn bar();
+}
--- /dev/null
+// Copyright 2014 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub use foo::FOO2;
+
+pub const FOO: usize = 3;
+const BAR: usize = 3;
+
+mod foo {
+ pub const FOO2: usize = 3;
+}
--- /dev/null
+// Copyright 2017 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Just exporting some type to test for correct diagnostics when this
+// crate is pulled in at a non-root location in client crate.
+
+pub struct S;
--- /dev/null
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub mod A {
+ pub struct Foo;
+ impl Foo {
+ fn foo(&self) { }
+ }
+}
--- /dev/null
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use std::marker::PhantomData;
+
+pub struct Directed;
+pub struct Undirected;
+
+pub struct Graph<N, E, Ty = Directed> {
+ nodes: Vec<PhantomData<N>>,
+ edges: Vec<PhantomData<E>>,
+ ty: PhantomData<Ty>,
+}
+
+
+impl<N, E> Graph<N, E, Directed> {
+ pub fn new() -> Self {
+ Graph{nodes: Vec::new(), edges: Vec::new(), ty: PhantomData}
+ }
+}
+
+impl<N, E> Graph<N, E, Undirected> {
+ pub fn new_undirected() -> Self {
+ Graph{nodes: Vec::new(), edges: Vec::new(), ty: PhantomData}
+ }
+}
--- /dev/null
+// Copyright 2017 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+
+pub trait Trait {
+ const CONST: u32;
+}
--- /dev/null
+// Copyright 2013 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+extern "C" {
+ pub fn rand() -> u32;
+}
+++ /dev/null
-// Copyright 2014 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-enum Foo {
- Bar(isize)
-}
-
-pub mod test {
- enum Foo {
- Bar(isize)
- }
-}
+++ /dev/null
-// Copyright 2014 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-extern {
- fn bar();
-}
+++ /dev/null
-// Copyright 2014 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-pub use foo::FOO2;
-
-pub const FOO: usize = 3;
-const BAR: usize = 3;
-
-mod foo {
- pub const FOO2: usize = 3;
-}
+++ /dev/null
-// Copyright 2017 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Just exporting some type to test for correct diagnostics when this
-// crate is pulled in at a non-root location in client crate.
-
-pub struct S;
+++ /dev/null
-// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-pub mod A {
- pub struct Foo;
- impl Foo {
- fn foo(&self) { }
- }
-}
+++ /dev/null
-// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-use std::marker::PhantomData;
-
-pub struct Directed;
-pub struct Undirected;
-
-pub struct Graph<N, E, Ty = Directed> {
- nodes: Vec<PhantomData<N>>,
- edges: Vec<PhantomData<E>>,
- ty: PhantomData<Ty>,
-}
-
-
-impl<N, E> Graph<N, E, Directed> {
- pub fn new() -> Self {
- Graph{nodes: Vec::new(), edges: Vec::new(), ty: PhantomData}
- }
-}
-
-impl<N, E> Graph<N, E, Undirected> {
- pub fn new_undirected() -> Self {
- Graph{nodes: Vec::new(), edges: Vec::new(), ty: PhantomData}
- }
-}
+++ /dev/null
-// Copyright 2017 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-
-pub trait Trait {
- const CONST: u32;
-}
+++ /dev/null
-// Copyright 2013 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-extern "C" {
- pub fn rand() -> u32;
-}
--- /dev/null
+// Copyright 2013 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![crate_name="lint_stability"]
+#![crate_type = "lib"]
+#![feature(staged_api)]
+#![feature(associated_type_defaults)]
+#![stable(feature = "lint_stability", since = "1.0.0")]
+
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
+#[rustc_deprecated(since = "1.0.0", reason = "text")]
+pub fn deprecated() {}
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
+#[rustc_deprecated(since = "1.0.0", reason = "text")]
+pub fn deprecated_text() {}
+
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
+#[rustc_deprecated(since = "99.99.99", reason = "text")]
+pub fn deprecated_future() {}
+
+#[unstable(feature = "unstable_test_feature", issue = "0")]
+#[rustc_deprecated(since = "1.0.0", reason = "text")]
+pub fn deprecated_unstable() {}
+#[unstable(feature = "unstable_test_feature", issue = "0")]
+#[rustc_deprecated(since = "1.0.0", reason = "text")]
+pub fn deprecated_unstable_text() {}
+
+#[unstable(feature = "unstable_test_feature", issue = "0")]
+pub fn unstable() {}
+#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
+pub fn unstable_text() {}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+pub fn stable() {}
+#[stable(feature = "rust1", since = "1.0.0")]
+pub fn stable_text() {}
+
+#[stable(feature = "rust1", since = "1.0.0")]
+pub struct MethodTester;
+
+impl MethodTester {
+ #[stable(feature = "stable_test_feature", since = "1.0.0")]
+ #[rustc_deprecated(since = "1.0.0", reason = "text")]
+ pub fn method_deprecated(&self) {}
+ #[stable(feature = "stable_test_feature", since = "1.0.0")]
+ #[rustc_deprecated(since = "1.0.0", reason = "text")]
+ pub fn method_deprecated_text(&self) {}
+
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
+ #[rustc_deprecated(since = "1.0.0", reason = "text")]
+ pub fn method_deprecated_unstable(&self) {}
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
+ #[rustc_deprecated(since = "1.0.0", reason = "text")]
+ pub fn method_deprecated_unstable_text(&self) {}
+
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
+ pub fn method_unstable(&self) {}
+ #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
+ pub fn method_unstable_text(&self) {}
+
+ #[stable(feature = "rust1", since = "1.0.0")]
+ pub fn method_stable(&self) {}
+ #[stable(feature = "rust1", since = "1.0.0")]
+ pub fn method_stable_text(&self) {}
+}
+
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
+pub trait Trait {
+ #[stable(feature = "stable_test_feature", since = "1.0.0")]
+ #[rustc_deprecated(since = "1.0.0", reason = "text")]
+ fn trait_deprecated(&self) {}
+ #[stable(feature = "stable_test_feature", since = "1.0.0")]
+ #[rustc_deprecated(since = "1.0.0", reason = "text")]
+ fn trait_deprecated_text(&self) {}
+
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
+ #[rustc_deprecated(since = "1.0.0", reason = "text")]
+ fn trait_deprecated_unstable(&self) {}
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
+ #[rustc_deprecated(since = "1.0.0", reason = "text")]
+ fn trait_deprecated_unstable_text(&self) {}
+
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
+ fn trait_unstable(&self) {}
+ #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
+ fn trait_unstable_text(&self) {}
+
+ #[stable(feature = "rust1", since = "1.0.0")]
+ fn trait_stable(&self) {}
+ #[stable(feature = "rust1", since = "1.0.0")]
+ fn trait_stable_text(&self) {}
+}
+
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
+pub trait TraitWithAssociatedTypes {
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
+ type TypeUnstable = u8;
+ #[stable(feature = "stable_test_feature", since = "1.0.0")]
+ #[rustc_deprecated(since = "1.0.0", reason = "text")]
+ type TypeDeprecated = u8;
+}
+
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
+impl Trait for MethodTester {}
+
+#[unstable(feature = "unstable_test_feature", issue = "0")]
+pub trait UnstableTrait { fn dummy(&self) { } }
+
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
+#[rustc_deprecated(since = "1.0.0", reason = "text")]
+pub trait DeprecatedTrait {
+ #[stable(feature = "stable_test_feature", since = "1.0.0")] fn dummy(&self) { }
+}
+
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
+#[rustc_deprecated(since = "1.0.0", reason = "text")]
+pub struct DeprecatedStruct {
+ #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
+}
+#[unstable(feature = "unstable_test_feature", issue = "0")]
+#[rustc_deprecated(since = "1.0.0", reason = "text")]
+pub struct DeprecatedUnstableStruct {
+ #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
+}
+#[unstable(feature = "unstable_test_feature", issue = "0")]
+pub struct UnstableStruct {
+ #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
+}
+#[stable(feature = "rust1", since = "1.0.0")]
+pub struct StableStruct {
+ #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
+}
+#[unstable(feature = "unstable_test_feature", issue = "0")]
+pub enum UnstableEnum {}
+#[stable(feature = "rust1", since = "1.0.0")]
+pub enum StableEnum {}
+
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
+#[rustc_deprecated(since = "1.0.0", reason = "text")]
+pub struct DeprecatedUnitStruct;
+#[unstable(feature = "unstable_test_feature", issue = "0")]
+#[rustc_deprecated(since = "1.0.0", reason = "text")]
+pub struct DeprecatedUnstableUnitStruct;
+#[unstable(feature = "unstable_test_feature", issue = "0")]
+pub struct UnstableUnitStruct;
+#[stable(feature = "rust1", since = "1.0.0")]
+pub struct StableUnitStruct;
+
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
+pub enum Enum {
+ #[stable(feature = "stable_test_feature", since = "1.0.0")]
+ #[rustc_deprecated(since = "1.0.0", reason = "text")]
+ DeprecatedVariant,
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
+ #[rustc_deprecated(since = "1.0.0", reason = "text")]
+ DeprecatedUnstableVariant,
+ #[unstable(feature = "unstable_test_feature", issue = "0")]
+ UnstableVariant,
+
+ #[stable(feature = "rust1", since = "1.0.0")]
+ StableVariant,
+}
+
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
+#[rustc_deprecated(since = "1.0.0", reason = "text")]
+pub struct DeprecatedTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
+#[unstable(feature = "unstable_test_feature", issue = "0")]
+#[rustc_deprecated(since = "1.0.0", reason = "text")]
+pub struct DeprecatedUnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
+#[unstable(feature = "unstable_test_feature", issue = "0")]
+pub struct UnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
+#[stable(feature = "rust1", since = "1.0.0")]
+pub struct StableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
+
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
+#[macro_export]
+macro_rules! macro_test {
+ () => (deprecated());
+}
+
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
+#[macro_export]
+macro_rules! macro_test_arg {
+ ($func:expr) => ($func);
+}
+
+#[stable(feature = "stable_test_feature", since = "1.0.0")]
+#[macro_export]
+macro_rules! macro_test_arg_nested {
+ ($func:ident) => (macro_test_arg!($func()));
+}
+++ /dev/null
-// Copyright 2013 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![crate_name="lint_stability"]
-#![crate_type = "lib"]
-#![feature(staged_api)]
-#![feature(associated_type_defaults)]
-#![stable(feature = "lint_stability", since = "1.0.0")]
-
-#[stable(feature = "stable_test_feature", since = "1.0.0")]
-#[rustc_deprecated(since = "1.0.0", reason = "text")]
-pub fn deprecated() {}
-#[stable(feature = "stable_test_feature", since = "1.0.0")]
-#[rustc_deprecated(since = "1.0.0", reason = "text")]
-pub fn deprecated_text() {}
-
-#[stable(feature = "stable_test_feature", since = "1.0.0")]
-#[rustc_deprecated(since = "99.99.99", reason = "text")]
-pub fn deprecated_future() {}
-
-#[unstable(feature = "unstable_test_feature", issue = "0")]
-#[rustc_deprecated(since = "1.0.0", reason = "text")]
-pub fn deprecated_unstable() {}
-#[unstable(feature = "unstable_test_feature", issue = "0")]
-#[rustc_deprecated(since = "1.0.0", reason = "text")]
-pub fn deprecated_unstable_text() {}
-
-#[unstable(feature = "unstable_test_feature", issue = "0")]
-pub fn unstable() {}
-#[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
-pub fn unstable_text() {}
-
-#[stable(feature = "rust1", since = "1.0.0")]
-pub fn stable() {}
-#[stable(feature = "rust1", since = "1.0.0")]
-pub fn stable_text() {}
-
-#[stable(feature = "rust1", since = "1.0.0")]
-pub struct MethodTester;
-
-impl MethodTester {
- #[stable(feature = "stable_test_feature", since = "1.0.0")]
- #[rustc_deprecated(since = "1.0.0", reason = "text")]
- pub fn method_deprecated(&self) {}
- #[stable(feature = "stable_test_feature", since = "1.0.0")]
- #[rustc_deprecated(since = "1.0.0", reason = "text")]
- pub fn method_deprecated_text(&self) {}
-
- #[unstable(feature = "unstable_test_feature", issue = "0")]
- #[rustc_deprecated(since = "1.0.0", reason = "text")]
- pub fn method_deprecated_unstable(&self) {}
- #[unstable(feature = "unstable_test_feature", issue = "0")]
- #[rustc_deprecated(since = "1.0.0", reason = "text")]
- pub fn method_deprecated_unstable_text(&self) {}
-
- #[unstable(feature = "unstable_test_feature", issue = "0")]
- pub fn method_unstable(&self) {}
- #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
- pub fn method_unstable_text(&self) {}
-
- #[stable(feature = "rust1", since = "1.0.0")]
- pub fn method_stable(&self) {}
- #[stable(feature = "rust1", since = "1.0.0")]
- pub fn method_stable_text(&self) {}
-}
-
-#[stable(feature = "stable_test_feature", since = "1.0.0")]
-pub trait Trait {
- #[stable(feature = "stable_test_feature", since = "1.0.0")]
- #[rustc_deprecated(since = "1.0.0", reason = "text")]
- fn trait_deprecated(&self) {}
- #[stable(feature = "stable_test_feature", since = "1.0.0")]
- #[rustc_deprecated(since = "1.0.0", reason = "text")]
- fn trait_deprecated_text(&self) {}
-
- #[unstable(feature = "unstable_test_feature", issue = "0")]
- #[rustc_deprecated(since = "1.0.0", reason = "text")]
- fn trait_deprecated_unstable(&self) {}
- #[unstable(feature = "unstable_test_feature", issue = "0")]
- #[rustc_deprecated(since = "1.0.0", reason = "text")]
- fn trait_deprecated_unstable_text(&self) {}
-
- #[unstable(feature = "unstable_test_feature", issue = "0")]
- fn trait_unstable(&self) {}
- #[unstable(feature = "unstable_test_feature", reason = "text", issue = "0")]
- fn trait_unstable_text(&self) {}
-
- #[stable(feature = "rust1", since = "1.0.0")]
- fn trait_stable(&self) {}
- #[stable(feature = "rust1", since = "1.0.0")]
- fn trait_stable_text(&self) {}
-}
-
-#[stable(feature = "stable_test_feature", since = "1.0.0")]
-pub trait TraitWithAssociatedTypes {
- #[unstable(feature = "unstable_test_feature", issue = "0")]
- type TypeUnstable = u8;
- #[stable(feature = "stable_test_feature", since = "1.0.0")]
- #[rustc_deprecated(since = "1.0.0", reason = "text")]
- type TypeDeprecated = u8;
-}
-
-#[stable(feature = "stable_test_feature", since = "1.0.0")]
-impl Trait for MethodTester {}
-
-#[unstable(feature = "unstable_test_feature", issue = "0")]
-pub trait UnstableTrait { fn dummy(&self) { } }
-
-#[stable(feature = "stable_test_feature", since = "1.0.0")]
-#[rustc_deprecated(since = "1.0.0", reason = "text")]
-pub trait DeprecatedTrait {
- #[stable(feature = "stable_test_feature", since = "1.0.0")] fn dummy(&self) { }
-}
-
-#[stable(feature = "stable_test_feature", since = "1.0.0")]
-#[rustc_deprecated(since = "1.0.0", reason = "text")]
-pub struct DeprecatedStruct {
- #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
-}
-#[unstable(feature = "unstable_test_feature", issue = "0")]
-#[rustc_deprecated(since = "1.0.0", reason = "text")]
-pub struct DeprecatedUnstableStruct {
- #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
-}
-#[unstable(feature = "unstable_test_feature", issue = "0")]
-pub struct UnstableStruct {
- #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
-}
-#[stable(feature = "rust1", since = "1.0.0")]
-pub struct StableStruct {
- #[stable(feature = "stable_test_feature", since = "1.0.0")] pub i: isize
-}
-#[unstable(feature = "unstable_test_feature", issue = "0")]
-pub enum UnstableEnum {}
-#[stable(feature = "rust1", since = "1.0.0")]
-pub enum StableEnum {}
-
-#[stable(feature = "stable_test_feature", since = "1.0.0")]
-#[rustc_deprecated(since = "1.0.0", reason = "text")]
-pub struct DeprecatedUnitStruct;
-#[unstable(feature = "unstable_test_feature", issue = "0")]
-#[rustc_deprecated(since = "1.0.0", reason = "text")]
-pub struct DeprecatedUnstableUnitStruct;
-#[unstable(feature = "unstable_test_feature", issue = "0")]
-pub struct UnstableUnitStruct;
-#[stable(feature = "rust1", since = "1.0.0")]
-pub struct StableUnitStruct;
-
-#[stable(feature = "stable_test_feature", since = "1.0.0")]
-pub enum Enum {
- #[stable(feature = "stable_test_feature", since = "1.0.0")]
- #[rustc_deprecated(since = "1.0.0", reason = "text")]
- DeprecatedVariant,
- #[unstable(feature = "unstable_test_feature", issue = "0")]
- #[rustc_deprecated(since = "1.0.0", reason = "text")]
- DeprecatedUnstableVariant,
- #[unstable(feature = "unstable_test_feature", issue = "0")]
- UnstableVariant,
-
- #[stable(feature = "rust1", since = "1.0.0")]
- StableVariant,
-}
-
-#[stable(feature = "stable_test_feature", since = "1.0.0")]
-#[rustc_deprecated(since = "1.0.0", reason = "text")]
-pub struct DeprecatedTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
-#[unstable(feature = "unstable_test_feature", issue = "0")]
-#[rustc_deprecated(since = "1.0.0", reason = "text")]
-pub struct DeprecatedUnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
-#[unstable(feature = "unstable_test_feature", issue = "0")]
-pub struct UnstableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
-#[stable(feature = "rust1", since = "1.0.0")]
-pub struct StableTupleStruct(#[stable(feature = "rust1", since = "1.0.0")] pub isize);
-
-#[stable(feature = "stable_test_feature", since = "1.0.0")]
-#[macro_export]
-macro_rules! macro_test {
- () => (deprecated());
-}
-
-#[stable(feature = "stable_test_feature", since = "1.0.0")]
-#[macro_export]
-macro_rules! macro_test_arg {
- ($func:expr) => ($func);
-}
-
-#[stable(feature = "stable_test_feature", since = "1.0.0")]
-#[macro_export]
-macro_rules! macro_test_arg_nested {
- ($func:ident) => (macro_test_arg!($func()));
-}
--- /dev/null
+// Copyright 2014 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Foo {}
+++ /dev/null
-// Copyright 2014 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-trait Foo {}
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![crate_type="lib"]
+
+
+pub trait A {
+ fn a(&self) {}
+}
+impl A for () {}
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![crate_type="lib"]
+
+pub extern crate xcrate_issue_43189_a;
--- /dev/null
+// Copyright 2017 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![crate_type="lib"]
+
+pub extern crate core;
+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![crate_type="lib"]
-
-
-pub trait A {
- fn a(&self) {}
-}
-impl A for () {}
+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![crate_type="lib"]
-
-pub extern crate xcrate_issue_43189_a;
+++ /dev/null
-// Copyright 2017 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![crate_type="lib"]
-
-pub extern crate core;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// aux-build:private_trait_xc.rs
+// aux-build:private-trait-xc.rs
extern crate private_trait_xc;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// aux-build:issue_11680.rs
+// aux-build:issue-11680.rs
extern crate issue_11680 as other;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// aux-build:issue_16725.rs
+// aux-build:issue-16725.rs
extern crate issue_16725 as foo;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// aux-build:issue_17718_const_privacy.rs
+// aux-build:issue-17718-const-privacy.rs
extern crate issue_17718_const_privacy as other;
//! Test that absolute path names are correct when a crate is not linked into the root namespace
-// aux-build:issue_1920.rs
+// aux-build:issue-1920.rs
mod foo {
pub extern crate issue_1920;
//! Test that when a crate is linked under another name that name is used in global paths
-// aux-build:issue_1920.rs
+// aux-build:issue-1920.rs
extern crate issue_1920 as bar;
//! Test that when a crate is linked multiple times that the shortest absolute path name is used
-// aux-build:issue_1920.rs
+// aux-build:issue-1920.rs
mod foo {
pub extern crate issue_1920;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// aux-build:issue_21202.rs
+// aux-build:issue-21202.rs
extern crate issue_21202 as crate1;
// Unstable entities should be caught in import lists
-// aux-build:lint_stability.rs
+// aux-build:lint-stability.rs
#![allow(warnings)]
// Prefix in imports with empty braces should be resolved and checked privacy, stability, etc.
-// aux-build:lint_stability.rs
+// aux-build:lint-stability.rs
extern crate lint_stability;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// aux-build:issue_30123_aux.rs
+// aux-build:issue-30123-aux.rs
extern crate issue_30123_aux;
use issue_30123_aux::*;
--- /dev/null
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// ignore-tidy-linelength
+
+#![feature(const_fn)]
+
+const bad : u32 = {
+ {
+ 5;
+ //~^ ERROR statements in constants are unstable
+ 0
+ }
+};
+
+const bad_two : u32 = {
+ {
+ invalid();
+ //~^ ERROR statements in constants are unstable
+ //~^^ ERROR: calls in constants are limited to constant functions, tuple structs and tuple variants
+ 0
+ }
+};
+
+const bad_three : u32 = {
+ {
+ valid();
+ //~^ ERROR statements in constants are unstable
+ 0
+ }
+};
+
+static bad_four : u32 = {
+ {
+ 5;
+ //~^ ERROR statements in statics are unstable
+ 0
+ }
+};
+
+static bad_five : u32 = {
+ {
+ invalid();
+ //~^ ERROR: calls in statics are limited to constant functions, tuple structs and tuple variants
+ //~| ERROR statements in statics are unstable
+ 0
+ }
+};
+
+static bad_six : u32 = {
+ {
+ valid();
+ //~^ ERROR statements in statics are unstable
+ 0
+ }
+};
+
+static mut bad_seven : u32 = {
+ {
+ 5;
+ //~^ ERROR statements in statics are unstable
+ 0
+ }
+};
+
+static mut bad_eight : u32 = {
+ {
+ invalid();
+ //~^ ERROR statements in statics are unstable
+ //~| ERROR: calls in statics are limited to constant functions, tuple structs and tuple variants
+ 0
+ }
+};
+
+static mut bad_nine : u32 = {
+ {
+ valid();
+ //~^ ERROR statements in statics are unstable
+ 0
+ }
+};
+
+
+fn invalid() {}
+const fn valid() {}
+
+fn main() {}
--- /dev/null
+error[E0658]: statements in constants are unstable (see issue #48821)
+ --> $DIR/issue-32829-2.rs:17:9
+ |
+LL | 5;
+ | ^
+ |
+ = help: add #![feature(const_let)] to the crate attributes to enable
+
+error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
+ --> $DIR/issue-32829-2.rs:25:9
+ |
+LL | invalid();
+ | ^^^^^^^^^
+
+error[E0658]: statements in constants are unstable (see issue #48821)
+ --> $DIR/issue-32829-2.rs:25:9
+ |
+LL | invalid();
+ | ^^^^^^^^^
+ |
+ = help: add #![feature(const_let)] to the crate attributes to enable
+
+error[E0658]: statements in constants are unstable (see issue #48821)
+ --> $DIR/issue-32829-2.rs:34:9
+ |
+LL | valid();
+ | ^^^^^^^
+ |
+ = help: add #![feature(const_let)] to the crate attributes to enable
+
+error[E0658]: statements in statics are unstable (see issue #48821)
+ --> $DIR/issue-32829-2.rs:42:9
+ |
+LL | 5;
+ | ^
+ |
+ = help: add #![feature(const_let)] to the crate attributes to enable
+
+error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
+ --> $DIR/issue-32829-2.rs:50:9
+ |
+LL | invalid();
+ | ^^^^^^^^^
+
+error[E0658]: statements in statics are unstable (see issue #48821)
+ --> $DIR/issue-32829-2.rs:50:9
+ |
+LL | invalid();
+ | ^^^^^^^^^
+ |
+ = help: add #![feature(const_let)] to the crate attributes to enable
+
+error[E0658]: statements in statics are unstable (see issue #48821)
+ --> $DIR/issue-32829-2.rs:59:9
+ |
+LL | valid();
+ | ^^^^^^^
+ |
+ = help: add #![feature(const_let)] to the crate attributes to enable
+
+error[E0658]: statements in statics are unstable (see issue #48821)
+ --> $DIR/issue-32829-2.rs:67:9
+ |
+LL | 5;
+ | ^
+ |
+ = help: add #![feature(const_let)] to the crate attributes to enable
+
+error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
+ --> $DIR/issue-32829-2.rs:75:9
+ |
+LL | invalid();
+ | ^^^^^^^^^
+
+error[E0658]: statements in statics are unstable (see issue #48821)
+ --> $DIR/issue-32829-2.rs:75:9
+ |
+LL | invalid();
+ | ^^^^^^^^^
+ |
+ = help: add #![feature(const_let)] to the crate attributes to enable
+
+error[E0658]: statements in statics are unstable (see issue #48821)
+ --> $DIR/issue-32829-2.rs:84:9
+ |
+LL | valid();
+ | ^^^^^^^
+ |
+ = help: add #![feature(const_let)] to the crate attributes to enable
+
+error: aborting due to 12 previous errors
+
+Some errors occurred: E0015, E0658.
+For more information about an error, try `rustc --explain E0015`.
--- /dev/null
+// Copyright 2017 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub const FOO: usize = *&0;
+++ /dev/null
-// Copyright 2017 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-pub const FOO: usize = *&0;
--- /dev/null
+// Copyright 2017 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// aux-build:issue-38875-b.rs
+// compile-pass
+
+extern crate issue_38875_b;
+
+fn main() {
+ let test_x = [0; issue_38875_b::FOO];
+}
+++ /dev/null
-// Copyright 2017 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// aux-build:issue_38875_b.rs
-// compile-pass
-
-extern crate issue_38875_b;
-
-fn main() {
- let test_x = [0; issue_38875_b::FOO];
-}
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use std::rc::Rc;
+use std::sync::Arc;
+
+struct Foo(Arc<Bar>);
+
+enum Bar {
+ A(Rc<Foo>),
+ B(Option<Foo>),
+}
+
+fn f<T: Send>(_: T) {}
+
+fn main() {
+ f(Foo(Arc::new(Bar::B(None))));
+ //~^ ERROR E0277
+ //~| ERROR E0277
+}
--- /dev/null
+error[E0277]: `std::rc::Rc<Foo>` cannot be sent between threads safely
+ --> $DIR/issue-40827.rs:24:5
+ |
+LL | f(Foo(Arc::new(Bar::B(None))));
+ | ^ `std::rc::Rc<Foo>` cannot be sent between threads safely
+ |
+ = help: within `Bar`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<Foo>`
+ = note: required because it appears within the type `Bar`
+ = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc<Bar>`
+ = note: required because it appears within the type `Foo`
+note: required by `f`
+ --> $DIR/issue-40827.rs:21:1
+ |
+LL | fn f<T: Send>(_: T) {}
+ | ^^^^^^^^^^^^^^^^^^^
+
+error[E0277]: `std::rc::Rc<Foo>` cannot be shared between threads safely
+ --> $DIR/issue-40827.rs:24:5
+ |
+LL | f(Foo(Arc::new(Bar::B(None))));
+ | ^ `std::rc::Rc<Foo>` cannot be shared between threads safely
+ |
+ = help: within `Bar`, the trait `std::marker::Sync` is not implemented for `std::rc::Rc<Foo>`
+ = note: required because it appears within the type `Bar`
+ = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc<Bar>`
+ = note: required because it appears within the type `Foo`
+note: required by `f`
+ --> $DIR/issue-40827.rs:21:1
+ |
+LL | fn f<T: Send>(_: T) {}
+ | ^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// aux-build:issue_41549.rs
+// aux-build:issue-41549.rs
extern crate issue_41549;
--- /dev/null
+// Copyright 2017 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub trait Tr {
+ // Note: The function needs to be declared over multiple lines to reproduce
+ // the crash. DO NOT reformat.
+ fn f()
+ where Self: Sized;
+}
+++ /dev/null
-// Copyright 2017 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-pub trait Tr {
- // Note: The function needs to be declared over multiple lines to reproduce
- // the crash. DO NOT reformat.
- fn f()
- where Self: Sized;
-}
--- /dev/null
+// Copyright 2017 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// aux-build:issue-41652-b.rs
+
+extern crate issue_41652_b;
+
+struct S;
+
+impl issue_41652_b::Tr for S {
+ fn f() {
+ 3.f()
+ //~^ ERROR can't call method `f` on ambiguous numeric type `{integer}`
+ }
+}
+
+fn main() {}
--- /dev/null
+error[E0689]: can't call method `f` on ambiguous numeric type `{integer}`
+ --> $DIR/issue-41652.rs:19:11
+ |
+LL | 3.f()
+ | ^
+help: you must specify a concrete type for this numeric value, like `i32`
+ |
+LL | 3_i32.f()
+ | ^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0689`.
+++ /dev/null
-// Copyright 2017 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// aux-build:issue_41652_b.rs
-
-extern crate issue_41652_b;
-
-struct S;
-
-impl issue_41652_b::Tr for S {
- fn f() {
- 3.f()
- //~^ ERROR can't call method `f` on ambiguous numeric type `{integer}`
- }
-}
-
-fn main() {}
+++ /dev/null
-error[E0689]: can't call method `f` on ambiguous numeric type `{integer}`
- --> $DIR/issue_41652.rs:19:11
- |
-LL | 3.f()
- | ^
-help: you must specify a concrete type for this numeric value, like `i32`
- |
-LL | 3_i32.f()
- | ^^^^^
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0689`.
// paths rooted from `std` to be misrendered in the diagnostic output.
// ignore-windows
-// aux-build:xcrate_issue_43189_a.rs
-// aux-build:xcrate_issue_43189_b.rs
+// aux-build:xcrate-issue-43189-a.rs
+// aux-build:xcrate-issue-43189-b.rs
extern crate xcrate_issue_43189_b;
fn main() {
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub const FOO: usize = *&0;
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+pub const FOO: usize = *&0;
+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-pub const FOO: usize = *&0;
+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-pub const FOO: usize = *&0;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// aux-build:issue_45829_b.rs
+// aux-build:issue-45829-b.rs
mod foo {
pub mod bar {}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// aux-build:issue_45829_a.rs
-// aux-build:issue_45829_b.rs
+// aux-build:issue-45829-a.rs
+// aux-build:issue-45829-b.rs
extern crate issue_45829_a;
extern crate issue_45829_b as issue_45829_a;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// aux-build:issue_45829_a.rs
-// aux-build:issue_45829_b.rs
+// aux-build:issue-45829-a.rs
+// aux-build:issue-45829-b.rs
extern crate issue_45829_a;
extern crate issue_45829_b as issue_45829_a;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-// aux-build:issue_45829_b.rs
+// aux-build:issue-45829-b.rs
extern crate issue_45829_b;
use std as issue_45829_b;
// paths rooted from `std` to be misrendered in the diagnostic output.
// ignore-windows
-// aux-build:xcrate_issue_46112_rexport_core.rs
+// aux-build:xcrate-issue-46112-rexport-core.rs
extern crate xcrate_issue_46112_rexport_core;
fn test(r: Result<Option<()>, &'static str>) { }
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// compile-pass
+fn iter<'a>(data: &'a [usize]) -> impl Iterator<Item = usize> + 'a {
+ data.iter()
+ .map(
+ |x| x // fn(&'a usize) -> &'(ReScope) usize
+ )
+ .map(
+ |x| *x // fn(&'(ReScope) usize) -> usize
+ )
+}
+
+fn main() {
+}
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(inner_deref)]
+
+fn main() {
+ let _result = &Some(42).deref();
+//~^ ERROR no method named `deref` found for type `std::option::Option<{integer}>`
+}
--- /dev/null
+error[E0599]: no method named `deref` found for type `std::option::Option<{integer}>` in the current scope
+ --> $DIR/option-deref.rs:14:29
+ |
+LL | let _result = &Some(42).deref();
+ | ^^^^^
+ |
+ = note: the method `deref` exists but the following trait bounds were not satisfied:
+ `{integer} : std::ops::Deref`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0599`.
+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(inner_deref)]
-
-fn main() {
- let _result = &Some(42).deref();
-//~^ ERROR no method named `deref` found for type `std::option::Option<{integer}>`
-}
+++ /dev/null
-error[E0599]: no method named `deref` found for type `std::option::Option<{integer}>` in the current scope
- --> $DIR/option_deref.rs:14:29
- |
-LL | let _result = &Some(42).deref();
- | ^^^^^
- |
- = note: the method `deref` exists but the following trait bounds were not satisfied:
- `{integer} : std::ops::Deref`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0599`.
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(inner_deref)]
+
+fn main() {
+ let _result = &Err(41).deref_err();
+//~^ ERROR no method named `deref_err` found
+}
--- /dev/null
+error[E0599]: no method named `deref_err` found for type `std::result::Result<_, {integer}>` in the current scope
+ --> $DIR/result-deref-err.rs:14:28
+ |
+LL | let _result = &Err(41).deref_err();
+ | ^^^^^^^^^
+ |
+ = note: the method `deref_err` exists but the following trait bounds were not satisfied:
+ `{integer} : std::ops::Deref`
+ = help: did you mean `deref_ok`?
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0599`.
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(inner_deref)]
+
+fn main() {
+ let _result = &Ok(42).deref_ok();
+//~^ ERROR no method named `deref_ok` found
+}
--- /dev/null
+error[E0599]: no method named `deref_ok` found for type `std::result::Result<{integer}, _>` in the current scope
+ --> $DIR/result-deref-ok.rs:14:27
+ |
+LL | let _result = &Ok(42).deref_ok();
+ | ^^^^^^^^
+ |
+ = note: the method `deref_ok` exists but the following trait bounds were not satisfied:
+ `{integer} : std::ops::Deref`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0599`.
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![feature(inner_deref)]
+
+fn main() {
+ let _result = &Ok(42).deref();
+//~^ ERROR no method named `deref` found
+}
--- /dev/null
+error[E0599]: no method named `deref` found for type `std::result::Result<{integer}, _>` in the current scope
+ --> $DIR/result-deref.rs:14:27
+ |
+LL | let _result = &Ok(42).deref();
+ | ^^^^^
+ |
+ = note: the method `deref` exists but the following trait bounds were not satisfied:
+ `{integer} : std::ops::Deref`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0599`.
+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(inner_deref)]
-
-fn main() {
- let _result = &Ok(42).deref();
-//~^ ERROR no method named `deref` found
-}
+++ /dev/null
-error[E0599]: no method named `deref` found for type `std::result::Result<{integer}, _>` in the current scope
- --> $DIR/result_deref.rs:14:27
- |
-LL | let _result = &Ok(42).deref();
- | ^^^^^
- |
- = note: the method `deref` exists but the following trait bounds were not satisfied:
- `{integer} : std::ops::Deref`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0599`.
+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(inner_deref)]
-
-fn main() {
- let _result = &Err(41).deref_err();
-//~^ ERROR no method named `deref_err` found
-}
+++ /dev/null
-error[E0599]: no method named `deref_err` found for type `std::result::Result<_, {integer}>` in the current scope
- --> $DIR/result_deref_err.rs:14:28
- |
-LL | let _result = &Err(41).deref_err();
- | ^^^^^^^^^
- |
- = note: the method `deref_err` exists but the following trait bounds were not satisfied:
- `{integer} : std::ops::Deref`
- = help: did you mean `deref_ok`?
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0599`.
+++ /dev/null
-// 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 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(inner_deref)]
-
-fn main() {
- let _result = &Ok(42).deref_ok();
-//~^ ERROR no method named `deref_ok` found
-}
+++ /dev/null
-error[E0599]: no method named `deref_ok` found for type `std::result::Result<{integer}, _>` in the current scope
- --> $DIR/result_deref_ok.rs:14:27
- |
-LL | let _result = &Ok(42).deref_ok();
- | ^^^^^^^^
- |
- = note: the method `deref_ok` exists but the following trait bounds were not satisfied:
- `{integer} : std::ops::Deref`
-
-error: aborting due to previous error
-
-For more information about this error, try `rustc --explain E0599`.
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+fn main(){
+ if i in 1..10 {
+ break;
+ }
+}
--- /dev/null
+error: expected `{`, found keyword `in`
+ --> $DIR/issue-51602.rs:12:10
+ |
+LL | if i in 1..10 {
+ | -- ^^ expected `{`
+ | |
+ | this `if` statement has a condition, but no block
+
+error: aborting due to previous error
+
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+enum A {
+ A {
+ foo: usize,
+ }
+}
+
+fn main() {
+ let x = A::A { foo: 3 };
+ match x {
+ A::A { fob } => { println!("{}", fob); }
+ }
+}
--- /dev/null
+error[E0026]: variant `A::A` does not have a field named `fob`
+ --> $DIR/issue-52717.rs:19:12
+ |
+LL | A::A { fob } => { println!("{}", fob); }
+ | ^^^
+ | |
+ | variant `A::A` does not have this field
+ | help: did you mean: `foo`
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0026`.
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Regression test for an NLL-related ICE (#52992) -- computing
+// implied bounds was causing outlives relations that were not
+// properly handled.
+//
+// compile-pass
+
+#![feature(nll)]
+
+fn main() {}
+
+fn fail<'a>() -> Struct<'a, Generic<()>> {
+ Struct(&Generic(()))
+}
+
+struct Struct<'a, T>(&'a T) where
+ T: Trait + 'a,
+ T::AT: 'a; // only fails with this bound
+
+struct Generic<T>(T);
+
+trait Trait {
+ type AT;
+}
+
+impl<T> Trait for Generic<T> {
+ type AT = T; // only fails with a generic AT
+}
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+struct S;
+
+impl S {
+ fn f() {}
+}
+
+macro_rules! impl_add {
+ ($($n:ident)*) => {
+ $(
+ fn $n() {
+ S::f::<i64>();
+ //~^ ERROR wrong number of type arguments
+ }
+ )*
+ }
+}
+
+impl_add!(a b);
+
+fn main() {}
--- /dev/null
+error[E0107]: wrong number of type arguments: expected 0, found 1
+ --> $DIR/issue-53251.rs:21:24
+ |
+LL | S::f::<i64>();
+ | ^^^ unexpected type argument
+...
+LL | impl_add!(a b);
+ | --------------- in this macro invocation
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0107`.
--- /dev/null
+// Copyright 2012-2014 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// issue 53300
+
+pub trait A {
+ fn add(&self, b: i32) -> i32;
+}
+
+fn addition() -> Wrapper<impl A> {}
+//~^ ERROR cannot find type `Wrapper` in this scope [E0412]
+
+fn main() {
+ let res = addition();
+}
--- /dev/null
+error[E0412]: cannot find type `Wrapper` in this scope
+ --> $DIR/issue-53300.rs:17:18
+ |
+LL | fn addition() -> Wrapper<impl A> {}
+ | ^^^^^^^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0412`.
--- /dev/null
+// Copyright 2012 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//compile-pass
+
+struct Foo {
+ bar: for<'r> Fn(usize, &'r FnMut())
+}
+
+fn main() {
+}
+
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+use std::time::{foo, bar, buzz};
+use std::time::{abc, def};
+fn main(){
+ println!("Hello World!");
+}
--- /dev/null
+error[E0432]: unresolved imports `std::time::foo`, `std::time::bar`, `std::time::buzz`
+ --> $DIR/issue-53565.rs:10:17
+ |
+LL | use std::time::{foo, bar, buzz};
+ | ^^^ ^^^ ^^^^ no `buzz` in `time`
+ | | |
+ | | no `bar` in `time`
+ | no `foo` in `time`
+
+error[E0432]: unresolved imports `std::time::abc`, `std::time::def`
+ --> $DIR/issue-53565.rs:11:17
+ |
+LL | use std::time::{abc, def};
+ | ^^^ ^^^ no `def` in `time`
+ | |
+ | no `abc` in `time`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0432`.
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Regression test for an NLL-related ICE (#53568) -- we failed to
+// resolve inference variables in "custom type-ops".
+//
+// compile-pass
+
+#![feature(nll)]
+#![allow(dead_code)]
+
+trait Future {
+ type Item;
+}
+
+impl<F, T> Future for F
+where F: Fn() -> T
+{
+ type Item = T;
+}
+
+trait Connect {}
+
+struct Connector<H> {
+ handler: H,
+}
+
+impl<H, T> Connect for Connector<H>
+where
+ T: 'static,
+ H: Future<Item = T>
+{
+}
+
+struct Client<C> {
+ connector: C,
+}
+
+fn build<C>(_connector: C) -> Client<C> {
+ unimplemented!()
+}
+
+fn client<H>(handler: H) -> Client<impl Connect>
+where H: Fn() + Copy
+{
+ let connector = Connector {
+ handler,
+ };
+ let client = build(connector);
+ client
+}
+
+fn main() { }
+
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+fn main() {
+ let items = vec![1, 2, 3];
+ let ref_items: &[i32] = &items;
+ let items_clone: Vec<i32> = ref_items.clone();
+
+ // in that case no suggestion will be triggered
+ let items_clone_2:Vec<i32> = items.clone();
+
+ let s = "hi";
+ let string: String = s.clone();
+
+ // in that case no suggestion will be triggered
+ let s2 = "hi";
+ let string_2: String = s2.to_string();
+}
--- /dev/null
+error[E0308]: mismatched types
+ --> $DIR/issue-53692.rs:13:37
+ |
+LL | let items_clone: Vec<i32> = ref_items.clone();
+ | ^^^^^^^^^^^^^^^^^
+ | |
+ | expected struct `std::vec::Vec`, found &[i32]
+ | help: try using a conversion method: `ref_items.to_vec()`
+ |
+ = note: expected type `std::vec::Vec<i32>`
+ found type `&[i32]`
+
+error[E0308]: mismatched types
+ --> $DIR/issue-53692.rs:19:30
+ |
+LL | let string: String = s.clone();
+ | ^^^^^^^^^
+ | |
+ | expected struct `std::string::String`, found &str
+ | help: try using a conversion method: `s.to_string()`
+ |
+ = note: expected type `std::string::String`
+ found type `&str`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0308`.
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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} => {}
+ }
+}
--- /dev/null
+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`.
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Mirror {
+ type Image;
+ fn coerce(self) -> Self::Image;
+}
+
+impl<T> Mirror for T {
+ type Image = T;
+ fn coerce(self) -> Self { self }
+}
+
+trait Foo<'x, T> {
+ fn foo(self) -> &'x T;
+}
+
+impl<'s, 'x, T: 'x> Foo<'x, T> for &'s T where &'s T: Foo2<'x, T> {
+ fn foo(self) -> &'x T { self.foo2() }
+}
+
+trait Foo2<'x, T> {
+ fn foo2(self) -> &'x T;
+}
+
+// example 1 - fails leak check
+impl<'x> Foo2<'x, u32> for &'x u32
+{
+ fn foo2(self) -> &'x u32 { self }
+}
+
+// example 2 - OK with this issue
+impl<'x, 'a: 'x> Foo2<'x, i32> for &'a i32
+{
+ fn foo2(self) -> &'x i32 { self }
+}
+
+// example 3 - fails due to issue #XYZ + Leak-check
+impl<'x, T> Foo2<'x, u64> for T
+ where T: Mirror<Image=&'x u64>
+{
+ fn foo2(self) -> &'x u64 { self.coerce() }
+}
+
+// example 4 - fails due to issue #XYZ
+impl<'x, 'a: 'x, T> Foo2<'x, i64> for T
+ where T: Mirror<Image=&'a i64>
+{
+ fn foo2(self) -> &'x i64 { self.coerce() }
+}
+
+
+trait RefFoo<T> {
+ fn ref_foo(&self) -> &'static T;
+}
+
+impl<T> RefFoo<T> for T where for<'a> &'a T: Foo<'static, T> {
+ fn ref_foo(&self) -> &'static T {
+ self.foo()
+ }
+}
+
+
+fn coerce_lifetime1(a: &u32) -> &'static u32
+{
+ <u32 as RefFoo<u32>>::ref_foo(a)
+ //~^ ERROR the trait bound `for<'a> &'a u32: Foo2<'_, u32>` is not satisfied
+}
+
+fn coerce_lifetime2(a: &i32) -> &'static i32
+{
+ <i32 as RefFoo<i32>>::ref_foo(a)
+ //~^ ERROR the requirement `for<'a> 'a : ` is not satisfied
+}
+
+fn coerce_lifetime3(a: &u64) -> &'static u64
+{
+ <u64 as RefFoo<u64>>::ref_foo(a)
+ //~^ ERROR type mismatch resolving `for<'a> <&'a u64 as Mirror>::Image == &u64`
+}
+
+fn coerce_lifetime4(a: &i64) -> &'static i64
+{
+ <i64 as RefFoo<i64>>::ref_foo(a)
+ //~^ ERROR type mismatch resolving `for<'a> <&'a i64 as Mirror>::Image == &i64`
+}
+
+fn main() {}
--- /dev/null
+error[E0277]: the trait bound `for<'a> &'a u32: Foo2<'_, u32>` is not satisfied
+ --> $DIR/issue-54302-cases.rs:73:5
+ |
+LL | <u32 as RefFoo<u32>>::ref_foo(a)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `for<'a> Foo2<'_, u32>` is not implemented for `&'a u32`
+ |
+ = help: the following implementations were found:
+ <&'x u32 as Foo2<'x, u32>>
+ = note: required because of the requirements on the impl of `for<'a> Foo<'static, u32>` for `&'a u32`
+ = note: required because of the requirements on the impl of `RefFoo<u32>` for `u32`
+note: required by `RefFoo::ref_foo`
+ --> $DIR/issue-54302-cases.rs:61:5
+ |
+LL | fn ref_foo(&self) -> &'static T;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0279]: the requirement `for<'a> 'a : ` is not satisfied (`expected bound lifetime parameter 'a, found concrete lifetime`)
+ --> $DIR/issue-54302-cases.rs:79:5
+ |
+LL | <i32 as RefFoo<i32>>::ref_foo(a)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: required because of the requirements on the impl of `for<'a> Foo2<'_, i32>` for `&'a i32`
+ = note: required because of the requirements on the impl of `for<'a> Foo<'static, i32>` for `&'a i32`
+ = note: required because of the requirements on the impl of `RefFoo<i32>` for `i32`
+note: required by `RefFoo::ref_foo`
+ --> $DIR/issue-54302-cases.rs:61:5
+ |
+LL | fn ref_foo(&self) -> &'static T;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0271]: type mismatch resolving `for<'a> <&'a u64 as Mirror>::Image == &u64`
+ --> $DIR/issue-54302-cases.rs:85:5
+ |
+LL | <u64 as RefFoo<u64>>::ref_foo(a)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'a, found concrete lifetime
+ |
+ = note: required because of the requirements on the impl of `for<'a> Foo2<'_, u64>` for `&'a u64`
+ = note: required because of the requirements on the impl of `for<'a> Foo<'static, u64>` for `&'a u64`
+ = note: required because of the requirements on the impl of `RefFoo<u64>` for `u64`
+note: required by `RefFoo::ref_foo`
+ --> $DIR/issue-54302-cases.rs:61:5
+ |
+LL | fn ref_foo(&self) -> &'static T;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error[E0271]: type mismatch resolving `for<'a> <&'a i64 as Mirror>::Image == &i64`
+ --> $DIR/issue-54302-cases.rs:91:5
+ |
+LL | <i64 as RefFoo<i64>>::ref_foo(a)
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected bound lifetime parameter 'a, found concrete lifetime
+ |
+ = note: required because of the requirements on the impl of `for<'a> Foo2<'_, i64>` for `&'a i64`
+ = note: required because of the requirements on the impl of `for<'a> Foo<'static, i64>` for `&'a i64`
+ = note: required because of the requirements on the impl of `RefFoo<i64>` for `i64`
+note: required by `RefFoo::ref_foo`
+ --> $DIR/issue-54302-cases.rs:61:5
+ |
+LL | fn ref_foo(&self) -> &'static T;
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to 4 previous errors
+
+Some errors occurred: E0271, E0277, E0279.
+For more information about an error, try `rustc --explain E0271`.
--- /dev/null
+// 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 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+trait Deserialize<'de> {}
+
+trait DeserializeOwned: for<'de> Deserialize<'de> {}
+impl<T> DeserializeOwned for T where T: for<'de> Deserialize<'de> {}
+
+// Based on this impl, `&'static str` only implements Deserialize<'static>.
+// It does not implement for<'de> Deserialize<'de>.
+impl<'de: 'a, 'a> Deserialize<'de> for &'a str {}
+
+fn main() {
+ // Then why does it implement DeserializeOwned? This compiles.
+ fn assert_deserialize_owned<T: DeserializeOwned>() {}
+ assert_deserialize_owned::<&'static str>();
+ //~^ ERROR the requirement `for<'de> 'de : ` is not satisfied
+
+ // It correctly does not implement for<'de> Deserialize<'de>.
+ //fn assert_hrtb<T: for<'de> Deserialize<'de>>() {}
+ //assert_hrtb::<&'static str>();
+}
--- /dev/null
+error[E0279]: the requirement `for<'de> 'de : ` is not satisfied (`expected bound lifetime parameter 'de, found concrete lifetime`)
+ --> $DIR/issue-54302.rs:23:5
+ |
+LL | assert_deserialize_owned::<&'static str>();
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ |
+ = note: required because of the requirements on the impl of `for<'de> Deserialize<'de>` for `&'static str`
+ = note: required because of the requirements on the impl of `DeserializeOwned` for `&'static str`
+note: required by `main::assert_deserialize_owned`
+ --> $DIR/issue-54302.rs:22:5
+ |
+LL | fn assert_deserialize_owned<T: DeserializeOwned>() {}
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0279`.
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-//aux-build:issue_5844_aux.rs
+//aux-build:issue-5844-aux.rs
extern crate issue_5844_aux;
+++ /dev/null
-// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// ignore-tidy-linelength
-
-#![feature(const_fn)]
-
-const bad : u32 = {
- {
- 5;
- //~^ ERROR statements in constants are unstable
- 0
- }
-};
-
-const bad_two : u32 = {
- {
- invalid();
- //~^ ERROR statements in constants are unstable
- //~^^ ERROR: calls in constants are limited to constant functions, tuple structs and tuple variants
- 0
- }
-};
-
-const bad_three : u32 = {
- {
- valid();
- //~^ ERROR statements in constants are unstable
- 0
- }
-};
-
-static bad_four : u32 = {
- {
- 5;
- //~^ ERROR statements in statics are unstable
- 0
- }
-};
-
-static bad_five : u32 = {
- {
- invalid();
- //~^ ERROR: calls in statics are limited to constant functions, tuple structs and tuple variants
- //~| ERROR statements in statics are unstable
- 0
- }
-};
-
-static bad_six : u32 = {
- {
- valid();
- //~^ ERROR statements in statics are unstable
- 0
- }
-};
-
-static mut bad_seven : u32 = {
- {
- 5;
- //~^ ERROR statements in statics are unstable
- 0
- }
-};
-
-static mut bad_eight : u32 = {
- {
- invalid();
- //~^ ERROR statements in statics are unstable
- //~| ERROR: calls in statics are limited to constant functions, tuple structs and tuple variants
- 0
- }
-};
-
-static mut bad_nine : u32 = {
- {
- valid();
- //~^ ERROR statements in statics are unstable
- 0
- }
-};
-
-
-fn invalid() {}
-const fn valid() {}
-
-fn main() {}
+++ /dev/null
-error[E0658]: statements in constants are unstable (see issue #48821)
- --> $DIR/issue32829.rs:17:9
- |
-LL | 5;
- | ^
- |
- = help: add #![feature(const_let)] to the crate attributes to enable
-
-error[E0015]: calls in constants are limited to constant functions, tuple structs and tuple variants
- --> $DIR/issue32829.rs:25:9
- |
-LL | invalid();
- | ^^^^^^^^^
-
-error[E0658]: statements in constants are unstable (see issue #48821)
- --> $DIR/issue32829.rs:25:9
- |
-LL | invalid();
- | ^^^^^^^^^
- |
- = help: add #![feature(const_let)] to the crate attributes to enable
-
-error[E0658]: statements in constants are unstable (see issue #48821)
- --> $DIR/issue32829.rs:34:9
- |
-LL | valid();
- | ^^^^^^^
- |
- = help: add #![feature(const_let)] to the crate attributes to enable
-
-error[E0658]: statements in statics are unstable (see issue #48821)
- --> $DIR/issue32829.rs:42:9
- |
-LL | 5;
- | ^
- |
- = help: add #![feature(const_let)] to the crate attributes to enable
-
-error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
- --> $DIR/issue32829.rs:50:9
- |
-LL | invalid();
- | ^^^^^^^^^
-
-error[E0658]: statements in statics are unstable (see issue #48821)
- --> $DIR/issue32829.rs:50:9
- |
-LL | invalid();
- | ^^^^^^^^^
- |
- = help: add #![feature(const_let)] to the crate attributes to enable
-
-error[E0658]: statements in statics are unstable (see issue #48821)
- --> $DIR/issue32829.rs:59:9
- |
-LL | valid();
- | ^^^^^^^
- |
- = help: add #![feature(const_let)] to the crate attributes to enable
-
-error[E0658]: statements in statics are unstable (see issue #48821)
- --> $DIR/issue32829.rs:67:9
- |
-LL | 5;
- | ^
- |
- = help: add #![feature(const_let)] to the crate attributes to enable
-
-error[E0015]: calls in statics are limited to constant functions, tuple structs and tuple variants
- --> $DIR/issue32829.rs:75:9
- |
-LL | invalid();
- | ^^^^^^^^^
-
-error[E0658]: statements in statics are unstable (see issue #48821)
- --> $DIR/issue32829.rs:75:9
- |
-LL | invalid();
- | ^^^^^^^^^
- |
- = help: add #![feature(const_let)] to the crate attributes to enable
-
-error[E0658]: statements in statics are unstable (see issue #48821)
- --> $DIR/issue32829.rs:84:9
- |
-LL | valid();
- | ^^^^^^^
- |
- = help: add #![feature(const_let)] to the crate attributes to enable
-
-error: aborting due to 12 previous errors
-
-Some errors occurred: E0015, E0658.
-For more information about an error, try `rustc --explain E0015`.