-
-
Notifications
You must be signed in to change notification settings - Fork 255
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
acec299
commit f6edb6f
Showing
4 changed files
with
53 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
129 changes: 27 additions & 102 deletions
129
pgrx-tests/tests/compile-fail/aggregate-functions-dont-run-forever.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,102 +1,27 @@ | ||
error: cannot find attribute `pg_aggregate` in this scope | ||
--> tests/compile-fail/aggregate-functions-dont-run-forever.rs:38:3 | ||
| | ||
38 | #[pg_aggregate] | ||
| ^^^^^^^^^^^^ | ||
| | ||
help: consider importing one of these items | ||
| | ||
1 + use pgrx::pg_aggregate; | ||
| | ||
1 + use pgrx_macros::pg_aggregate; | ||
| | ||
|
||
error: cannot find attribute `pg_aggregate` in this scope | ||
--> tests/compile-fail/aggregate-functions-dont-run-forever.rs:1:3 | ||
| | ||
1 | #[pg_aggregate] | ||
| ^^^^^^^^^^^^ | ||
| | ||
help: consider importing one of these items | ||
| | ||
1 + use pgrx::pg_aggregate; | ||
| | ||
1 + use pgrx_macros::pg_aggregate; | ||
| | ||
|
||
error[E0405]: cannot find trait `Aggregate` in this scope | ||
--> tests/compile-fail/aggregate-functions-dont-run-forever.rs:2:6 | ||
| | ||
2 | impl Aggregate for SumScritches { | ||
| ^^^^^^^^^ not found in this scope | ||
| | ||
help: consider importing this trait | ||
| | ||
1 + use pgrx::Aggregate; | ||
| | ||
|
||
error[E0412]: cannot find type `SumScritches` in this scope | ||
--> tests/compile-fail/aggregate-functions-dont-run-forever.rs:2:20 | ||
| | ||
2 | impl Aggregate for SumScritches { | ||
| ^^^^^^^^^^^^ not found in this scope | ||
|
||
error[E0433]: failed to resolve: use of undeclared crate or module `pg_sys` | ||
--> tests/compile-fail/aggregate-functions-dont-run-forever.rs:10:18 | ||
| | ||
10 | _fcinfo: pg_sys::FunctionCallInfo, | ||
| ^^^^^^ use of undeclared crate or module `pg_sys` | ||
| | ||
help: consider importing one of these items | ||
| | ||
1 + use pgrx::pg_sys; | ||
| | ||
1 + use pgrx::prelude::pg_sys; | ||
| | ||
|
||
error[E0405]: cannot find trait `Aggregate` in this scope | ||
--> tests/compile-fail/aggregate-functions-dont-run-forever.rs:39:6 | ||
| | ||
39 | impl Aggregate for ScritchCollector { | ||
| ^^^^^^^^^ not found in this scope | ||
| | ||
help: consider importing this trait | ||
| | ||
1 + use pgrx::Aggregate; | ||
| | ||
|
||
error[E0433]: failed to resolve: use of undeclared crate or module `pg_sys` | ||
--> tests/compile-fail/aggregate-functions-dont-run-forever.rs:46:18 | ||
| | ||
46 | _fcinfo: pg_sys::FunctionCallInfo, | ||
| ^^^^^^ use of undeclared crate or module `pg_sys` | ||
| | ||
help: consider importing one of these items | ||
| | ||
1 + use pgrx::pg_sys; | ||
| | ||
1 + use pgrx::prelude::pg_sys; | ||
| | ||
|
||
error[E0433]: failed to resolve: use of undeclared type `PgHeapTuple` | ||
--> tests/compile-fail/aggregate-functions-dont-run-forever.rs:50:21 | ||
| | ||
50 | None => PgHeapTuple::new_composite_type(DOG_COMPOSITE_TYPE).unwrap(), | ||
| ^^^^^^^^^^^ use of undeclared type `PgHeapTuple` | ||
| | ||
help: consider importing this struct | ||
| | ||
1 + use pgrx::heap_tuple::PgHeapTuple; | ||
| | ||
|
||
error[E0425]: cannot find value `DOG_COMPOSITE_TYPE` in this scope | ||
--> tests/compile-fail/aggregate-functions-dont-run-forever.rs:50:53 | ||
| | ||
50 | None => PgHeapTuple::new_composite_type(DOG_COMPOSITE_TYPE).unwrap(), | ||
| ^^^^^^^^^^^^^^^^^^ not found in this scope | ||
|
||
error[E0601]: `main` function not found in crate `$CRATE` | ||
--> tests/compile-fail/aggregate-functions-dont-run-forever.rs:56:2 | ||
| | ||
56 | } | ||
| ^ consider adding a `main` function to `$DIR/tests/compile-fail/aggregate-functions-dont-run-forever.rs` | ||
error[E0521]: borrowed data escapes outside of function | ||
--> tests/compile-fail/aggregate-functions-dont-run-forever.rs:12:36 | ||
| | ||
8 | #[pg_aggregate] | ||
| --------------- | ||
| | | ||
| `fcinfo` is a reference that is only valid in the function body | ||
| lifetime `'fcx` defined here | ||
... | ||
12 | type Args = pgrx::name!(value, pgrx::composite_type!('static, "Dog")); | ||
| ^^^^ | ||
| | | ||
| `fcinfo` escapes the function body here | ||
| argument requires that `'fcx` must outlive `'static` | ||
|
||
error[E0521]: borrowed data escapes outside of function | ||
--> tests/compile-fail/aggregate-functions-dont-run-forever.rs:45:1 | ||
| | ||
45 | #[pg_aggregate] | ||
| ^^^^^^^^^^^^^^^ | ||
| | | ||
| `fcinfo` is a reference that is only valid in the function body | ||
| `fcinfo` escapes the function body here | ||
| lifetime `'fcx` defined here | ||
| argument requires that `'fcx` must outlive `'static` | ||
| | ||
= note: this error originates in the attribute macro `pg_aggregate` (in Nightly builds, run with -Z macro-backtrace for more info) |
4 changes: 4 additions & 0 deletions
4
pgrx-tests/tests/compile-fail/postgres-strings-arent-immortal.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
use pgrx::prelude::*; | ||
|
||
#[pg_extern] | ||
fn split(input: &'static str, pattern: &str) -> Vec<&'static str> { | ||
input.split_terminator(pattern).collect() | ||
} | ||
|
||
fn main() {} |
31 changes: 13 additions & 18 deletions
31
pgrx-tests/tests/compile-fail/postgres-strings-arent-immortal.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,13 @@ | ||
error: cannot find attribute `pg_extern` in this scope | ||
--> tests/compile-fail/postgres-strings-arent-immortal.rs:1:3 | ||
| | ||
1 | #[pg_extern] | ||
| ^^^^^^^^^ | ||
| | ||
help: consider importing one of these items | ||
| | ||
1 + use pgrx::pg_extern; | ||
| | ||
1 + use pgrx_macros::pg_extern; | ||
| | ||
|
||
error[E0601]: `main` function not found in crate `$CRATE` | ||
--> tests/compile-fail/postgres-strings-arent-immortal.rs:4:2 | ||
| | ||
4 | } | ||
| ^ consider adding a `main` function to `$DIR/tests/compile-fail/postgres-strings-arent-immortal.rs` | ||
error[E0521]: borrowed data escapes outside of function | ||
--> tests/compile-fail/postgres-strings-arent-immortal.rs:4:10 | ||
| | ||
3 | #[pg_extern] | ||
| ------------ lifetime `'fcx` defined here | ||
4 | fn split(input: &'static str, pattern: &str) -> Vec<&'static str> { | ||
| __________^^^^^____________________________________________________- | ||
| | | | ||
| | `fcinfo` escapes the function body here | ||
| | argument requires that `'fcx` must outlive `'static` | ||
5 | | input.split_terminator(pattern).collect() | ||
6 | | } | ||
| |_- `fcinfo` is a reference that is only valid in the function body |