Comments (5)
I will look into this later. Note that the current orphan rules are unsound.
It's possible that the warning emitted for diesel
are false positives (FPs) because the fix / lint for this unsoundness that is implemented on nightly (normalizing alias types in a certain way) is constrained by some known limitations of both trait solvers and that may lead to FPs.
Let me see what is the case for diesel
.
from rust.
This change affects diesel in a major feature breaking way 😞
You can reproduce this by using the following steps:
git clone https://github.com/diesel-rs/diesel
cd diesel
cargo +nightly check -p diesel_cli
Which produces the following warning:
warning[E0210]: type parameter `Col` must be covered by another type when it appears before the first local type (`database::multi_connection_impl::backend::MultiBackend`)
--> diesel_cli/src/database.rs:109:10
|
109 | #[derive(diesel::MultiConnection)]
| ^^^^^^^^^^^^^^^^^^^^^^^ type parameter `Col` must be covered by another type when it appears before the first local type (`database::multi_connection_impl::backend::MultiBackend`)
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #124559 <https://github.com/rust-lang/rust/issues/124559>
= note: implementing a foreign trait is only possible if at least one of the types for which it is implemented is local, and no uncovered type parameters appear before that first local type
= note: in this case, 'before' refers to the following order: `impl<..> ForeignTrait<T1, ..., Tn> for T0`, where `T0` is the first and `Tn` is the last
= note: `#[warn(uncovered_param_in_projection)]` on by default
= note: this warning originates in the derive macro `diesel::MultiConnection` (in Nightly builds, run with -Z macro-backtrace for more info)
The relevant impl generated by the proc macro looks like this:
impl<Col, Expr>
diesel::insertable::InsertValues<
Col::Table,
super::multi_connection_impl::backend::MultiBackend,
>
for diesel::insertable::DefaultableColumnInsertValue<
diesel::insertable::ColumnInsertValue<Col, Expr>,
>
where
Col: diesel::prelude::Column,
Expr: diesel::prelude::Expression<SqlType = Col::SqlType>,
Expr: diesel::prelude::AppearsOnTable<
diesel::internal::derives::multiconnection::NoFromClause,
>,
Self: diesel::query_builder::QueryFragment<
super::multi_connection_impl::backend::MultiBackend,
>,
diesel::insertable::DefaultableColumnInsertValue<
diesel::insertable::ColumnInsertValue<Col, Expr>,
>: diesel::insertable::InsertValues<
Col::Table,
<PgConnection as diesel::connection::Connection>::Backend,
>,
diesel::insertable::DefaultableColumnInsertValue<
diesel::insertable::ColumnInsertValue<Col, Expr>,
>: diesel::insertable::InsertValues<
Col::Table,
<SqliteConnection as diesel::connection::Connection>::Backend,
>,
{
fn column_names(
&self,
mut out: diesel::query_builder::AstPass<
'_,
'_,
super::multi_connection_impl::backend::MultiBackend,
>,
) -> QueryResult<()> {
use diesel::internal::derives::multiconnection::AstPassHelper;
match out.backend(){
super::backend::MultiBackend::Pg(_) => {
<Self as diesel::insertable::InsertValues<Col::Table, <PgConnection as diesel::connection::Connection> ::Backend>> ::column_names(&self,out.cast_database(super::bind_collector::MultiBindCollector::pg,super::query_builder::MultiQueryBuilder::pg,super::backend::MultiBackend::pg, |l|{
<PgConnection as diesel::internal::derives::multiconnection::MultiConnectionHelper> ::from_any(l).expect("It's possible to downcast the metadata lookup type to the correct type")
},),)
},
super::backend::MultiBackend::Sqlite(_) => {
<Self as diesel::insertable::InsertValues<Col::Table, <SqliteConnection as diesel::connection::Connection> ::Backend>> ::column_names(&self,out.cast_database(super::bind_collector::MultiBindCollector::sqlite,super::query_builder::MultiQueryBuilder::sqlite,super::backend::MultiBackend::sqlite, |l|{
<SqliteConnection as diesel::internal::derives::multiconnection::MultiConnectionHelper> ::from_any(l).expect("It's possible to downcast the metadata lookup type to the correct type")
},),)
},
}
}
}
As far as I understand this issue this is the desired behavior that these impls are no longer valid . Removing this behavior is highly problematic for diesel as I do not see any other way to write that impl without major breaking changes to diesel itself. It's even likely that this would force us to remove a large popular feature from diesel itself in response to this breaking change.
from rust.
I'm curious as to why diesel
didn't show up in the various crater runs we did, let me double-check.
from rust.
@fmease Did you already had some time to investigate that. I would like to resolve this before cutting a new diesel release.
from rust.
Did you already had some time to investigate that. I would like to resolve this before cutting a new diesel release.
I've pm'ed you.
from rust.
Related Issues (20)
- Calling non-const function `core::slice::iter::<impl IntoIterator for &[u8]>::into_iter` HOT 3
- Tests fail with LLVM 19 due to unexpected "'+avx512er' is not a recognized feature for this target (ignoring feature)" output HOT 1
- `cargo test`: `thread 'coordinator' panicked at compiler\rustc_middle\src\util\bug.rs:36:26:` when building on a drive with low storage HOT 4
- ICE: You can't project to field 0 of `DynMetadata` because layout is weird and thinks it doesn't have fields. HOT 2
- ICE: trivial bounds : `Failed to normalize Alias(Projection` HOT 1
- Confusing rustdoc layout for `const` functions that are unstable even in non-`const` contexts HOT 2
- ICE: `cycle detected when computing function signature of`
- ICE: Opaque types got hidden types registered from within subtype predicate HOT 2
- Why don't slices use dedicated metadata structs? HOT 13
- ICE: `layout mismatch for result of MulWithOverflow` HOT 4
- ReentrantLockGuard's Sync impl is unsound HOT 2
- use osc 8 hyperlinks to link to the reference for lints when they are printed HOT 1
- frameworks not supported error HOT 6
- compiletest should note when test output is normalized HOT 1
- Uncredible virtual memory usage when compile, maybe memory leak HOT 1
- PhantomData confusing documentation
- Performance regression between v1.76.0 and v1.77.2 HOT 10
- Nightly rustc panic when compiling a simple no_std program HOT 4
- Wrong import hint HOT 1
- add a custom diagnostic for type mismatches of constants
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 rust.