Skip to content

Commit

Permalink
Bless tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Jan 12, 2022
1 parent 2e0a80c commit 441c1a6
Show file tree
Hide file tree
Showing 7 changed files with 216 additions and 199 deletions.
168 changes: 84 additions & 84 deletions src/test/ui/feature-gates/feature-gate-in_band_lifetimes.stderr
Original file line number Diff line number Diff line change
@@ -1,87 +1,3 @@
error[E0261]: use of undeclared lifetime name `'a`
--> $DIR/feature-gate-in_band_lifetimes.rs:50:14
|
LL | impl MyTrait<'a> for Y<&'a u8> {
| - ^^ undeclared lifetime
| |
| help: consider introducing lifetime `'a` here: `<'a>`
|
= help: if you want to experiment with in-band lifetime bindings, add `#![feature(in_band_lifetimes)]` to the crate attributes

error[E0261]: use of undeclared lifetime name `'a`
--> $DIR/feature-gate-in_band_lifetimes.rs:50:25
|
LL | impl MyTrait<'a> for Y<&'a u8> {
| - ^^ undeclared lifetime
| |
| help: consider introducing lifetime `'a` here: `<'a>`
|
= help: if you want to experiment with in-band lifetime bindings, add `#![feature(in_band_lifetimes)]` to the crate attributes

error[E0261]: use of undeclared lifetime name `'a`
--> $DIR/feature-gate-in_band_lifetimes.rs:53:31
|
LL | fn my_lifetime(&self) -> &'a u8 { self.0 }
| ^^ undeclared lifetime
|
= help: if you want to experiment with in-band lifetime bindings, add `#![feature(in_band_lifetimes)]` to the crate attributes
help: consider introducing lifetime `'a` here
|
LL | impl<'a> MyTrait<'a> for Y<&'a u8> {
| ++++
help: consider introducing lifetime `'a` here
|
LL | fn my_lifetime<'a>(&self) -> &'a u8 { self.0 }
| ++++

error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:55:27
|
LL | fn any_lifetime() -> &'b u8 { &0 }
| ^^ undeclared lifetime
|
= help: if you want to experiment with in-band lifetime bindings, add `#![feature(in_band_lifetimes)]` to the crate attributes
help: consider introducing lifetime `'b` here
|
LL | impl<'b> MyTrait<'a> for Y<&'a u8> {
| ++++
help: consider introducing lifetime `'b` here
|
LL | fn any_lifetime<'b>() -> &'b u8 { &0 }
| ++++

error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:57:27
|
LL | fn borrowed_lifetime(&'b self) -> &'b u8 { &*self.0 }
| ^^ undeclared lifetime
|
= help: if you want to experiment with in-band lifetime bindings, add `#![feature(in_band_lifetimes)]` to the crate attributes
help: consider introducing lifetime `'b` here
|
LL | impl<'b> MyTrait<'a> for Y<&'a u8> {
| ++++
help: consider introducing lifetime `'b` here
|
LL | fn borrowed_lifetime<'b>(&'b self) -> &'b u8 { &*self.0 }
| ++++

error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:57:40
|
LL | fn borrowed_lifetime(&'b self) -> &'b u8 { &*self.0 }
| ^^ undeclared lifetime
|
= help: if you want to experiment with in-band lifetime bindings, add `#![feature(in_band_lifetimes)]` to the crate attributes
help: consider introducing lifetime `'b` here
|
LL | impl<'b> MyTrait<'a> for Y<&'a u8> {
| ++++
help: consider introducing lifetime `'b` here
|
LL | fn borrowed_lifetime<'b>(&'b self) -> &'b u8 { &*self.0 }
| ++++

error[E0261]: use of undeclared lifetime name `'x`
--> $DIR/feature-gate-in_band_lifetimes.rs:3:12
|
Expand Down Expand Up @@ -178,6 +94,90 @@ help: consider introducing lifetime `'a` here
LL | fn inner<'a>(&self) -> &'a u8 {
| ++++

error[E0261]: use of undeclared lifetime name `'a`
--> $DIR/feature-gate-in_band_lifetimes.rs:50:14
|
LL | impl MyTrait<'a> for Y<&'a u8> {
| - ^^ undeclared lifetime
| |
| help: consider introducing lifetime `'a` here: `<'a>`
|
= help: if you want to experiment with in-band lifetime bindings, add `#![feature(in_band_lifetimes)]` to the crate attributes

error[E0261]: use of undeclared lifetime name `'a`
--> $DIR/feature-gate-in_band_lifetimes.rs:50:25
|
LL | impl MyTrait<'a> for Y<&'a u8> {
| - ^^ undeclared lifetime
| |
| help: consider introducing lifetime `'a` here: `<'a>`
|
= help: if you want to experiment with in-band lifetime bindings, add `#![feature(in_band_lifetimes)]` to the crate attributes

error[E0261]: use of undeclared lifetime name `'a`
--> $DIR/feature-gate-in_band_lifetimes.rs:53:31
|
LL | fn my_lifetime(&self) -> &'a u8 { self.0 }
| ^^ undeclared lifetime
|
= help: if you want to experiment with in-band lifetime bindings, add `#![feature(in_band_lifetimes)]` to the crate attributes
help: consider introducing lifetime `'a` here
|
LL | impl<'a> MyTrait<'a> for Y<&'a u8> {
| ++++
help: consider introducing lifetime `'a` here
|
LL | fn my_lifetime<'a>(&self) -> &'a u8 { self.0 }
| ++++

error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:55:27
|
LL | fn any_lifetime() -> &'b u8 { &0 }
| ^^ undeclared lifetime
|
= help: if you want to experiment with in-band lifetime bindings, add `#![feature(in_band_lifetimes)]` to the crate attributes
help: consider introducing lifetime `'b` here
|
LL | impl<'b> MyTrait<'a> for Y<&'a u8> {
| ++++
help: consider introducing lifetime `'b` here
|
LL | fn any_lifetime<'b>() -> &'b u8 { &0 }
| ++++

error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:57:27
|
LL | fn borrowed_lifetime(&'b self) -> &'b u8 { &*self.0 }
| ^^ undeclared lifetime
|
= help: if you want to experiment with in-band lifetime bindings, add `#![feature(in_band_lifetimes)]` to the crate attributes
help: consider introducing lifetime `'b` here
|
LL | impl<'b> MyTrait<'a> for Y<&'a u8> {
| ++++
help: consider introducing lifetime `'b` here
|
LL | fn borrowed_lifetime<'b>(&'b self) -> &'b u8 { &*self.0 }
| ++++

error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:57:40
|
LL | fn borrowed_lifetime(&'b self) -> &'b u8 { &*self.0 }
| ^^ undeclared lifetime
|
= help: if you want to experiment with in-band lifetime bindings, add `#![feature(in_band_lifetimes)]` to the crate attributes
help: consider introducing lifetime `'b` here
|
LL | impl<'b> MyTrait<'a> for Y<&'a u8> {
| ++++
help: consider introducing lifetime `'b` here
|
LL | fn borrowed_lifetime<'b>(&'b self) -> &'b u8 { &*self.0 }
| ++++

error[E0261]: use of undeclared lifetime name `'b`
--> $DIR/feature-gate-in_band_lifetimes.rs:43:27
|
Expand Down
3 changes: 1 addition & 2 deletions src/test/ui/issues/issue-3214.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ fn foo<T>() {

impl<T> Drop for Foo<T> {
//~^ ERROR this struct takes 0 generic arguments but 1 generic argument
//~| ERROR the type parameter `T` is not constrained by the impl trait, self type, or predicates
fn drop(&mut self) {}
}
}
fn main() { }
fn main() {}
10 changes: 2 additions & 8 deletions src/test/ui/issues/issue-3214.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@ note: struct defined here, with 0 generic parameters
LL | struct Foo {
| ^^^

error[E0207]: the type parameter `T` is not constrained by the impl trait, self type, or predicates
--> $DIR/issue-3214.rs:6:10
|
LL | impl<T> Drop for Foo<T> {
| ^ unconstrained type parameter

error: aborting due to 3 previous errors
error: aborting due to 2 previous errors

Some errors have detailed explanations: E0107, E0207, E0401.
Some errors have detailed explanations: E0107, E0401.
For more information about an error, try `rustc --explain E0107`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// aux-build:unstable_generic_param.rs
#![feature(unstable_default6)]

extern crate unstable_generic_param;

use unstable_generic_param::*;

struct R;

impl Trait1 for S {
fn foo() -> () { () } // ok
}

struct S;

impl Trait1<usize> for S { //~ ERROR use of unstable library feature 'unstable_default'
fn foo() -> usize { 0 }
}

impl Trait1<isize> for S { //~ ERROR use of unstable library feature 'unstable_default'
fn foo() -> isize { 0 }
}

impl Trait2<usize> for S { //~ ERROR use of unstable library feature 'unstable_default'
fn foo() -> usize { 0 }
}

impl Trait3<usize> for S {
fn foo() -> usize { 0 } // ok
}

fn main() {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
error[E0658]: use of unstable library feature 'unstable_default'
--> $DIR/generics-default-stability-trait.rs:16:13
|
LL | impl Trait1<usize> for S {
| ^^^^^
|
= help: add `#![feature(unstable_default)]` to the crate attributes to enable

error[E0658]: use of unstable library feature 'unstable_default'
--> $DIR/generics-default-stability-trait.rs:20:13
|
LL | impl Trait1<isize> for S {
| ^^^^^
|
= help: add `#![feature(unstable_default)]` to the crate attributes to enable

error[E0658]: use of unstable library feature 'unstable_default'
--> $DIR/generics-default-stability-trait.rs:24:13
|
LL | impl Trait2<usize> for S {
| ^^^^^
|
= help: add `#![feature(unstable_default)]` to the crate attributes to enable

error: aborting due to 3 previous errors

For more information about this error, try `rustc --explain E0658`.
12 changes: 0 additions & 12 deletions src/test/ui/stability-attribute/generics-default-stability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,6 @@ impl Trait1 for S {

struct S;

impl Trait1<usize> for S { //~ ERROR use of unstable library feature 'unstable_default'
fn foo() -> usize { 0 }
}

impl Trait1<isize> for S { //~ ERROR use of unstable library feature 'unstable_default'
fn foo() -> isize { 0 }
}

impl Trait2<usize> for S { //~ ERROR use of unstable library feature 'unstable_default'
fn foo() -> usize { 0 }
}

impl Trait3<usize> for S {
fn foo() -> usize { 0 } // ok
}
Expand Down
Loading

0 comments on commit 441c1a6

Please sign in to comment.