diff options
| author | Rémy Rakic <remy.rakic+github@gmail.com> | 2021-08-03 18:54:15 +0200 |
|---|---|---|
| committer | Rémy Rakic <remy.rakic+github@gmail.com> | 2021-08-03 20:29:30 +0200 |
| commit | 1392842966f1ee58bf03da26648a0483941844ac (patch) | |
| tree | 1eae6b382e2b38a07900f9781e121f89824f711e | |
| parent | f252ab15651e82ab51a9173ba955d03799695247 (diff) | |
| download | rust-1392842966f1ee58bf03da26648a0483941844ac.tar.gz rust-1392842966f1ee58bf03da26648a0483941844ac.zip | |
bless a few trivial tests under polonius
These are all about reaching some type and recursion limits and saving the full type in a file, whose folder changes in this compare-mode.
8 files changed, 129 insertions, 0 deletions
diff --git a/src/test/ui/infinite/infinite-instantiation.polonius.stderr b/src/test/ui/infinite/infinite-instantiation.polonius.stderr new file mode 100644 index 00000000000..29eb8c481cd --- /dev/null +++ b/src/test/ui/infinite/infinite-instantiation.polonius.stderr @@ -0,0 +1,15 @@ +error: reached the recursion limit while instantiating `function::<Option<Option<Option<...>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/infinite-instantiation.rs:22:9 + | +LL | function(counter - 1, t.to_option()); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: `function` defined here + --> $DIR/infinite-instantiation.rs:20:1 + | +LL | fn function<T:ToOpt + Clone>(counter: usize, t: T) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: the full type name has been written to '$TEST_BUILD_DIR/infinite/infinite-instantiation.polonius/infinite-instantiation.long-type.txt' + +error: aborting due to previous error + diff --git a/src/test/ui/issues/issue-22638.polonius.stderr b/src/test/ui/issues/issue-22638.polonius.stderr new file mode 100644 index 00000000000..87a7c00e410 --- /dev/null +++ b/src/test/ui/issues/issue-22638.polonius.stderr @@ -0,0 +1,15 @@ +error: reached the recursion limit while instantiating `A::matches::$CLOSURE` + --> $DIR/issue-22638.rs:56:9 + | +LL | a.matches(f) + | ^^^^^^^^^^^^ + | +note: `A::matches` defined here + --> $DIR/issue-22638.rs:15:5 + | +LL | pub fn matches<F: Fn()>(&self, f: &F) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-22638.polonius/issue-22638.long-type.txt' + +error: aborting due to previous error + diff --git a/src/test/ui/issues/issue-37311-type-length-limit/issue-37311.polonius.stderr b/src/test/ui/issues/issue-37311-type-length-limit/issue-37311.polonius.stderr new file mode 100644 index 00000000000..3a1c0b82c22 --- /dev/null +++ b/src/test/ui/issues/issue-37311-type-length-limit/issue-37311.polonius.stderr @@ -0,0 +1,15 @@ +error: reached the recursion limit while instantiating `<(&(&(&(&(&(&(&(&(&(&(&(&(&(&(&(.....), ...), ...) as Foo>::recurse` + --> $DIR/issue-37311.rs:17:9 + | +LL | (self, self).recurse(); + | ^^^^^^^^^^^^^^^^^^^^^^ + | +note: `<T as Foo>::recurse` defined here + --> $DIR/issue-37311.rs:16:5 + | +LL | fn recurse(&self) { + | ^^^^^^^^^^^^^^^^^ + = note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-37311-type-length-limit/issue-37311.polonius/issue-37311.long-type.txt' + +error: aborting due to previous error + diff --git a/src/test/ui/issues/issue-67552.polonius.stderr b/src/test/ui/issues/issue-67552.polonius.stderr new file mode 100644 index 00000000000..9ab77d3444d --- /dev/null +++ b/src/test/ui/issues/issue-67552.polonius.stderr @@ -0,0 +1,17 @@ +error: reached the recursion limit while instantiating `rec::<&mut &mut &mut &mut &mut &... &mut &mut &mut &mut &mut Empty>` + --> $DIR/issue-67552.rs:28:9 + | +LL | rec(identity(&mut it)) + | ^^^^^^^^^^^^^^^^^^^^^^ + | +note: `rec` defined here + --> $DIR/issue-67552.rs:21:1 + | +LL | / fn rec<T>(mut it: T) +LL | | where +LL | | T: Iterator, + | |________________^ + = note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-67552.polonius/issue-67552.long-type.txt' + +error: aborting due to previous error + diff --git a/src/test/ui/issues/issue-8727.polonius.stderr b/src/test/ui/issues/issue-8727.polonius.stderr new file mode 100644 index 00000000000..283c01b6b62 --- /dev/null +++ b/src/test/ui/issues/issue-8727.polonius.stderr @@ -0,0 +1,26 @@ +warning: function cannot return without recursing + --> $DIR/issue-8727.rs:7:1 + | +LL | fn generic<T>() { + | ^^^^^^^^^^^^^^^ cannot return without recursing +LL | generic::<Option<T>>(); + | ---------------------- recursive call site + | + = note: `#[warn(unconditional_recursion)]` on by default + = help: a `loop` may express intention better if this is on purpose + +error: reached the recursion limit while instantiating `generic::<Option<Option<Option<O...>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/issue-8727.rs:8:5 + | +LL | generic::<Option<T>>(); + | ^^^^^^^^^^^^^^^^^^^^^^ + | +note: `generic` defined here + --> $DIR/issue-8727.rs:7:1 + | +LL | fn generic<T>() { + | ^^^^^^^^^^^^^^^ + = note: the full type name has been written to '$TEST_BUILD_DIR/issues/issue-8727.polonius/issue-8727.long-type.txt' + +error: aborting due to previous error; 1 warning emitted + diff --git a/src/test/ui/recursion/issue-38591-non-regular-dropck-recursion.polonius.stderr b/src/test/ui/recursion/issue-38591-non-regular-dropck-recursion.polonius.stderr new file mode 100644 index 00000000000..4b4fc4fb7d1 --- /dev/null +++ b/src/test/ui/recursion/issue-38591-non-regular-dropck-recursion.polonius.stderr @@ -0,0 +1,15 @@ +error: reached the recursion limit while instantiating `std::ptr::drop_in_place::<S<fn(f...)))))))))))))))))))))))))))))>))` + --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL + | +LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: `std::ptr::drop_in_place` defined here + --> $SRC_DIR/core/src/ptr/mod.rs:LL:COL + | +LL | pub unsafe fn drop_in_place<T: ?Sized>(to_drop: *mut T) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: the full type name has been written to '$TEST_BUILD_DIR/recursion/issue-38591-non-regular-dropck-recursion.polonius/issue-38591-non-regular-dropck-recursion.long-type.txt' + +error: aborting due to previous error + diff --git a/src/test/ui/recursion/recursion.polonius.stderr b/src/test/ui/recursion/recursion.polonius.stderr new file mode 100644 index 00000000000..c727fe551e3 --- /dev/null +++ b/src/test/ui/recursion/recursion.polonius.stderr @@ -0,0 +1,15 @@ +error: reached the recursion limit while instantiating `test::<Cons<Cons<Cons<Cons<Cons<...>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` + --> $DIR/recursion.rs:18:11 + | +LL | _ => {test (n-1, i+1, Cons {head:2*i+1, tail:first}, Cons{head:i*i, tail:second})} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | +note: `test` defined here + --> $DIR/recursion.rs:16:1 + | +LL | fn test<T:Dot> (n:isize, i:isize, first:T, second:T) ->isize { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + = note: the full type name has been written to '$TEST_BUILD_DIR/recursion/recursion.polonius/recursion.long-type.txt' + +error: aborting due to previous error + diff --git a/src/test/ui/type_length_limit.polonius.stderr b/src/test/ui/type_length_limit.polonius.stderr new file mode 100644 index 00000000000..82d066b2a2f --- /dev/null +++ b/src/test/ui/type_length_limit.polonius.stderr @@ -0,0 +1,11 @@ +error: reached the type-length limit while instantiating `std::mem::drop::<Option<((((...,....., ...), ..., ...), ..., ...)>>` + --> $SRC_DIR/core/src/mem/mod.rs:LL:COL + | +LL | pub fn drop<T>(_x: T) {} + | ^^^^^^^^^^^^^^^^^^^^^ + | + = note: the full type name has been written to '$TEST_BUILD_DIR/type_length_limit.polonius/type_length_limit.long-type.txt' + = help: consider adding a `#![type_length_limit="8"]` attribute to your crate + +error: aborting due to previous error + |
