Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plrustc/plrustc/src/lints/builtin_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl PlrustBuiltinMacros {
fn lint_fs(&self, cx: &LateContext<'_>, sp: Span) {
cx.lint(
PLRUST_FILESYSTEM_MACROS,
"the `include_str`, `include_bytes`, and `include` macros are forbidden",
"the `include_str`, `include_bytes`, and `include` macros are forbidden in PL/Rust",
|b| b.set_span(sp),
);
}
Expand Down
2 changes: 1 addition & 1 deletion plrustc/plrustc/src/lints/extern_blocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ impl<'tcx> LateLintPass<'tcx> for NoExternBlockPass {
// TODO: Do we need to allow ones from macros from pgrx?
cx.lint(
PLRUST_EXTERN_BLOCKS,
"`extern` blocks are not allowed",
"`extern` blocks are not allowed in PL/Rust",
|b| b.set_span(item.span),
)
}
Expand Down
2 changes: 1 addition & 1 deletion plrustc/plrustc/src/lints/lifetime_param_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ impl<'tcx> LateLintPass<'tcx> for LifetimeParamTraitPass {
if let hir::GenericParamKind::Lifetime { .. } = param.kind {
cx.lint(
PLRUST_LIFETIME_PARAMETERIZED_TRAITS,
"Trait is parameterize by lifetime.",
"PL/Rust forbids declaring traits with generic lifetime parameters",
|b| b.set_span(item.span),
)
}
Expand Down
3 changes: 2 additions & 1 deletion plrustc/plrustc/src/lints/print_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ impl PlrustPrintMacros {
fn fire(&self, cx: &LateContext<'_>, span: Span) {
cx.lint(
PLRUST_PRINT_MACROS,
"the printing macros are forbidden, consider using `log!()` instead",
"the printing macros are forbidden in PL/Rust, \
consider using `pgrx::log!()` instead",
|b| b.set_span(span),
);
}
Expand Down
3 changes: 2 additions & 1 deletion plrustc/plrustc/src/lints/static_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ impl<'tcx> LateLintPass<'tcx> for PlrustStaticImpls {
if self.has_static(imp.self_ty) {
cx.lint(
PLRUST_STATIC_IMPLS,
"`impl` blocks for types containing `'static` references are not allowed",
"`impl` blocks for types containing `'static` references \
are not allowed in PL/Rust",
|b| b.set_span(imp.self_ty.span),
)
}
Expand Down
3 changes: 2 additions & 1 deletion plrustc/plrustc/src/lints/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ impl<'tcx> LateLintPass<'tcx> for PlrustPrintFunctions {
if super::utils::does_expr_call_path(cx, expr, path) {
cx.lint(
PLRUST_STDIO,
"the standard streams are forbidden, consider using `log!()` instead",
"the standard streams are forbidden in PL/Rust, \
consider using `pgrx::log!()` instead",
|b| b.set_span(expr.span),
);
}
Expand Down
2 changes: 1 addition & 1 deletion plrustc/plrustc/src/lints/sus_trait_object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl<'tcx> LateLintPass<'tcx> for PlrustSuspiciousTraitObject {
if let hir::TyKind::TraitObject(..) = &ty.kind {
cx.lint(
PLRUST_SUSPICIOUS_TRAIT_OBJECT,
"trait objects in turbofish are forbidden",
"using trait objects in turbofish position is forbidden by PL/Rust",
|b| b.set_span(expr.span),
);
}
Expand Down
8 changes: 4 additions & 4 deletions plrustc/plrustc/uitests/extern_block.stderr
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
error: `extern` blocks are not allowed
error: `extern` blocks are not allowed in PL/Rust
--> $DIR/extern_block.rs:2:1
|
LL | extern "C" {}
| ^^^^^^^^^^^^^
|
= note: `-F plrust-extern-blocks` implied by `-F plrust-lints`

error: `extern` blocks are not allowed
error: `extern` blocks are not allowed in PL/Rust
--> $DIR/extern_block.rs:3:1
|
LL | extern "Rust" {}
| ^^^^^^^^^^^^^^^^

error: `extern` blocks are not allowed
error: `extern` blocks are not allowed in PL/Rust
--> $DIR/extern_block.rs:5:1
|
LL | extern {}
| ^^^^^^^^^

error: `extern` blocks are not allowed
error: `extern` blocks are not allowed in PL/Rust
--> $DIR/extern_block.rs:9:9
|
LL | extern "C" {}
Expand Down
26 changes: 13 additions & 13 deletions plrustc/plrustc/uitests/fs_macros.stderr
Original file line number Diff line number Diff line change
@@ -1,78 +1,78 @@
error: the `include_str`, `include_bytes`, and `include` macros are forbidden
error: the `include_str`, `include_bytes`, and `include` macros are forbidden in PL/Rust
--> $DIR/fs_macros.rs:3:18
|
LL | const _A: &str = include_str!("fs_macros_included_file.txt");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-F plrust-filesystem-macros` implied by `-F plrust-lints`

error: the `include_str`, `include_bytes`, and `include` macros are forbidden
error: the `include_str`, `include_bytes`, and `include` macros are forbidden in PL/Rust
--> $DIR/fs_macros.rs:5:19
|
LL | const _B: &[u8] = include_bytes!("fs_macros_included_file.txt");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: the `include_str`, `include_bytes`, and `include` macros are forbidden
error: the `include_str`, `include_bytes`, and `include` macros are forbidden in PL/Rust
--> $DIR/fs_macros.rs:7:18
|
LL | const _C: &str = core::include_str!("fs_macros_included_file.txt");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: the `include_str`, `include_bytes`, and `include` macros are forbidden
error: the `include_str`, `include_bytes`, and `include` macros are forbidden in PL/Rust
--> $DIR/fs_macros.rs:8:19
|
LL | const _D: &[u8] = core::include_bytes!("fs_macros_included_file.txt");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: the `include_str`, `include_bytes`, and `include` macros are forbidden
error: the `include_str`, `include_bytes`, and `include` macros are forbidden in PL/Rust
--> $DIR/fs_macros.rs:16:18
|
LL | const _E: &str = indirect!(include_str);
| ^^^^^^^^^^^^^^^^^^^^^^

error: the `include_str`, `include_bytes`, and `include` macros are forbidden
error: the `include_str`, `include_bytes`, and `include` macros are forbidden in PL/Rust
--> $DIR/fs_macros.rs:17:19
|
LL | const _F: &[u8] = indirect!(include_bytes);
| ^^^^^^^^^^^^^^^^^^^^^^^^

error: the `include_str`, `include_bytes`, and `include` macros are forbidden
error: the `include_str`, `include_bytes`, and `include` macros are forbidden in PL/Rust
--> $DIR/fs_macros.rs:31:18
|
LL | const _G: &str = in_macro!();
| ^^^^^^^^^^^

error: the `include_str`, `include_bytes`, and `include` macros are forbidden
error: the `include_str`, `include_bytes`, and `include` macros are forbidden in PL/Rust
--> $DIR/fs_macros.rs:32:28
|
LL | const _H: &str = in_macro!(include_str!("fs_macros_included_file.txt"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: the `include_str`, `include_bytes`, and `include` macros are forbidden
error: the `include_str`, `include_bytes`, and `include` macros are forbidden in PL/Rust
--> $DIR/fs_macros.rs:33:29
|
LL | const _I: &[u8] = in_macro!(include_bytes!("fs_macros_included_file.txt"));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: the `include_str`, `include_bytes`, and `include` macros are forbidden
error: the `include_str`, `include_bytes`, and `include` macros are forbidden in PL/Rust
--> $DIR/fs_macros.rs:34:19
|
LL | const _J: &[u8] = in_macro!(include_bytes, "fs_macros_included_file.txt");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: the `include_str`, `include_bytes`, and `include` macros are forbidden
error: the `include_str`, `include_bytes`, and `include` macros are forbidden in PL/Rust
--> $DIR/fs_macros.rs:37:18
|
LL | const _L: &str = sneaky!("fs_macros_included_file.txt");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: the `include_str`, `include_bytes`, and `include` macros are forbidden
error: the `include_str`, `include_bytes`, and `include` macros are forbidden in PL/Rust
--> $DIR/fs_macros.rs:38:18
|
LL | const _M: &str = in_macro!(sneaky, "fs_macros_included_file.txt");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: the `include_str`, `include_bytes`, and `include` macros are forbidden
error: the `include_str`, `include_bytes`, and `include` macros are forbidden in PL/Rust
--> $DIR/fs_macros.rs:41:21
|
LL | format!("{:?}", in_macro!())
Expand Down
4 changes: 2 additions & 2 deletions plrustc/plrustc/uitests/lifetime_trait.stderr
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
error: Trait is parameterize by lifetime.
error: PL/Rust forbids declaring traits with generic lifetime parameters
--> $DIR/lifetime_trait.rs:3:1
|
LL | trait Foo<'a> {}
| ^^^^^^^^^^^^^^^^
|
= note: `-F plrust-lifetime-parameterized-traits` implied by `-F plrust-lints`

error: Trait is parameterize by lifetime.
error: PL/Rust forbids declaring traits with generic lifetime parameters
--> $DIR/lifetime_trait.rs:9:9
|
LL | trait Foobar<'a> {}
Expand Down
Loading