diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:18:58 +0000 |
commit | a4b7ed7a42c716ab9f05e351f003d589124fd55d (patch) | |
tree | b620cd3f223850b28716e474e80c58059dca5dd4 /src/test/ui/regions/region-bounds-on-objects-and-type-parameters.rs | |
parent | Adding upstream version 1.67.1+dfsg1. (diff) | |
download | rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.tar.xz rustc-a4b7ed7a42c716ab9f05e351f003d589124fd55d.zip |
Adding upstream version 1.68.2+dfsg1.upstream/1.68.2+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/regions/region-bounds-on-objects-and-type-parameters.rs')
-rw-r--r-- | src/test/ui/regions/region-bounds-on-objects-and-type-parameters.rs | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/test/ui/regions/region-bounds-on-objects-and-type-parameters.rs b/src/test/ui/regions/region-bounds-on-objects-and-type-parameters.rs deleted file mode 100644 index 40d2b740b..000000000 --- a/src/test/ui/regions/region-bounds-on-objects-and-type-parameters.rs +++ /dev/null @@ -1,36 +0,0 @@ -// Test related to when a region bound is required to be specified. - -trait IsStatic : 'static { } -trait IsSend : Send { } -trait Is<'a> : 'a { } -trait Is2<'a> : 'a { } -trait SomeTrait { } - -// Bounds on object types: - -struct Foo<'a,'b,'c> { //~ ERROR parameter `'c` is never used - // All of these are ok, because we can derive exactly one bound: - a: Box<dyn IsStatic>, - b: Box<dyn Is<'static>>, - c: Box<dyn Is<'a>>, - d: Box<dyn IsSend>, - e: Box<dyn Is<'a>+Send>, // we can derive two bounds, but one is 'static, so ok - f: Box<dyn SomeTrait>, // OK, defaults to 'static due to RFC 599. - g: Box<dyn SomeTrait+'a>, - - z: Box<dyn Is<'a>+'b+'c>, - //~^ ERROR only a single explicit lifetime bound is permitted - //~| ERROR lifetime bound not satisfied -} - -fn test< - 'a, - 'b, - A:IsStatic, - B:Is<'a>+Is2<'b>, // OK in a parameter, but not an object type. - C:'b+Is<'a>+Is2<'b>, - D:Is<'a>+Is2<'static>, - E:'a+'b // OK in a parameter, but not an object type. ->() { } - -fn main() { } |