Comments (7)
These kinds of things can be filtered via this flotilla of lints: rust-lang/rust#82499
from plrust.
I probably need to redesign the unsafe detection, there was an alternate design that used a shell-game around building the code without the #[pg_extern]
annotation, which would allow straightforward usage of #[forbid(unsafe_code)]
and a few other lints, as a verification step, and then rebuilding the code with it (and with less lints), and then skipped using geiger.
from plrust.
The naive solution might be to just scan for #[ and error during parsing the code, but I'm not familiar with how Rust interprets Attributes, it seems something like works as well.
To address this part of your question more directly: Rust is very, very lax about whitespace in most cases where a logical segment in the parse could be interpreted as existing.
from plrust.
What lints can we add to Cargo.toml to validate that they will actually catch this behavior?
from plrust.
It involves restructuring the build a bit to let us do a "dry run" pre-build and then do it "for real", as mentioned. I am working on that PR.
from plrust.
I have a draft branch for this that successfully catches this specific example, but it is still technically possible to get #[link_section]
without #[no_mangle]
by, unless using a higher rustc version than 1.61.0, so I will polish it up and submit it next week but it will contain an ignored test unless we also have consensus on raising MSRV.
from plrust.
TODO:
- Test for
#[no_mangle]
- ...passes
- ...on main
- Test for
#[link_section]
- ...passes
- ...on main
from plrust.
Related Issues (20)
- Plrustc will not compile on alpine/postgres. HOT 3
- Compiling multiple functions together HOT 7
- fix `plrust/build` to dynamically determine pgrx version HOT 1
- Some examples appear to always ERROR HOT 4
- Support for custom (opaque) type HOT 5
- plrustc does not seem to catch `include!` macro properly HOT 3
- env/option_env failing to be linted by plrustc HOT 7
- Accessing JsonbContainer HOT 12
- UDF load time is high when compared to PL/PGSQL HOT 2
- How to return an array of any dimenion from pl/rust function.
- Enhancement to prevent cargo from recompiling allowlisted dependencies. HOT 7
- plrust installation fails when postgres 15 compiled with gprof profiler HOT 2
- Publish to https://database.dev/ HOT 9
- enumerated type as function arg? HOT 7
- JSonb extract slower in Pl/Rust than in Pl/PgSql HOT 3
- Postgres Triggers, achieve different behaviour on INSERT, UPDATE, etc.
- Problem with clap v4.5.4 HOT 5
- seg faults when working with composite types HOT 2
- Support for Postgres 17 HOT 3
- Statement timeout during `cargo build` leads to crash HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plrust.