Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changed array size to be 40 for E0308 #958

Closed
wants to merge 14 commits into from

Conversation

rowanfr
Copy link
Contributor

@rowanfr rowanfr commented Aug 31, 2023

This changes the array size to be 40 within the test to resolve the error E0308. This will close #957

@rowanfr
Copy link
Contributor Author

rowanfr commented Aug 31, 2023

Now there's the issue of:

error[E0793]: reference to packed field is unaligned
    --> C:\Users\appveyor\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ntapi-0.3.6\src\ntexapi.rs:2785:52
     |
2785 |         *tick_count.QuadPart_mut() = read_volatile(&(*USER_SHARED_DATA).u.TickCountQuad);
     |                                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
     = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
     = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)
error[E0793]: reference to packed field is unaligned
    --> C:\Users\appveyor\.cargo\registry\src\index.crates.io-6f17d22bba15001f\ntapi-0.3.6\src\ntexapi.rs:2809:25
     |
2809 |         ((read_volatile(&(*USER_SHARED_DATA).u.TickCountQuad)
     |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: packed structs are only aligned by one byte, and many modern architectures penalize unaligned field accesses
     = note: creating a misaligned reference is undefined behavior (even if that reference is never dereferenced)
     = help: copy the field contents to a local variable, or replace the reference with a raw pointer and use `read_unaligned`/`write_unaligned` (loads and stores via `*p` must be properly aligned even when using raw pointers)

I'm working to try to resolve it

@rowanfr
Copy link
Contributor Author

rowanfr commented Sep 1, 2023

The previous error was caused by an outdated Tokio dependency as shown here: My Rust project is broken all of the sudden (StackOverflow). After using cargo-edit for upgrade, the output is attached.
cargoupgrade.txt

The new error is:

error[E0491]: in type `&mut QueryTable<'me, Q, <Q as AsyncQueryFunction<'_, 'me>>::SendDb>`, reference has a longer lifetime than the data it references
   --> ~\.cargo\registry\src\index.crates.io-6f17d22bba15001f\gluon-salsa-0.15.2\src\lib.rs:696:28
    |
696 |     pub async fn get_async(&mut self, key: Q::Key) -> Q::Value {
    |                            ^^^^^^^^^
    |
note: the pointer is valid for the anonymous lifetime defined here
   --> ~\.cargo\registry\src\index.crates.io-6f17d22bba15001f\gluon-salsa-0.15.2\src\lib.rs:696:28
    |
696 |     pub async fn get_async(&mut self, key: Q::Key) -> Q::Value {
    |                            ^^^^^^^^^
note: but the referenced data is only valid for the lifetime `'me` as defined here
   --> ~\.cargo\registry\src\index.crates.io-6f17d22bba15001f\gluon-salsa-0.15.2\src\lib.rs:684:6
    |
684 | impl<'me, Q> QueryTable<'me, Q, <Q as QueryDb<'me>>::Db>
    |      ^^^

error[E0491]: in type `&mut QueryTable<'me, Q, <Q as AsyncQueryFunction<'_, 'me>>::SendDb>`, reference has a longer lifetime than the data it references
   --> ~\.cargo\registry\src\index.crates.io-6f17d22bba15001f\gluon-salsa-0.15.2\src\lib.rs:703:9
    |
703 |         &mut self,
    |         ^^^^^^^^^
    |
note: the pointer is valid for the anonymous lifetime defined here
   --> ~\.cargo\registry\src\index.crates.io-6f17d22bba15001f\gluon-salsa-0.15.2\src\lib.rs:703:9
    |
703 |         &mut self,
    |         ^^^^^^^^^
note: but the referenced data is only valid for the lifetime `'me` as defined here
   --> ~\.cargo\registry\src\index.crates.io-6f17d22bba15001f\gluon-salsa-0.15.2\src\lib.rs:684:6
    |
684 | impl<'me, Q> QueryTable<'me, Q, <Q as QueryDb<'me>>::Db>
    |      ^^^

error[E0491]: in type `&QueryTable<'me, Q, <Q as AsyncQueryFunction<'_, 'me>>::SendDb>`, reference has a longer lifetime than the data it references
   --> ~\.cargo\registry\src\index.crates.io-6f17d22bba15001f\gluon-salsa-0.15.2\src\lib.rs:714:18
    |
714 |     pub fn purge(&self)
    |                  ^^^^^
    |
note: the pointer is valid for the anonymous lifetime defined here
   --> ~\.cargo\registry\src\index.crates.io-6f17d22bba15001f\gluon-salsa-0.15.2\src\lib.rs:714:18
    |
714 |     pub fn purge(&self)
    |                  ^^^^^
note: but the referenced data is only valid for the lifetime `'me` as defined here
   --> ~\.cargo\registry\src\index.crates.io-6f17d22bba15001f\gluon-salsa-0.15.2\src\lib.rs:684:6
    |
684 | impl<'me, Q> QueryTable<'me, Q, <Q as QueryDb<'me>>::Db>
    |      ^^^

For more information about this error, try `rustc --explain E0491`.
error: could not compile `gluon-salsa` (lib) due to 3 previous errors
warning: build failed, waiting for other jobs to finish...

I'm working on that now

Upgraded all dependencies using cargo-edit upgrade to solve previous errors in compilation
This commit added should_panic to tests which indicated by their context that they should panic given that they have the panic message in the comments. The only issue is not all of them panic but that should be solved in a separate fork
This changes appveyor configuration to use the nightly rustc compiler in order to use the recent stable-to-stable regression to compile
@rowanfr
Copy link
Contributor Author

rowanfr commented Sep 6, 2023

The previously mentioned issue was caused by an Internal Compilation Error (ICE) in rustc detailed in rust-lang/rust#112832 which has been resolved now thanks to rust-lang/rust#115559. This fork should be able to be merged to resolve the other mentioned issues.
After attempting to run cargo test --all-features --all-targets 3 tests don't pass, specifically:

running 5 tests
test [compile-fail] compile-fail\getable-reference.rs ... FAILED
test [compile-fail] compile-fail\store-ref.rs ... FAILED
test [compile-fail] compile-fail\get-reference.rs ... ok
test [compile-fail] compile-fail\run_expr_str_ref.rs ... ok
test [compile-fail] compile-fail\getable-reference-str.rs ... FAILED

but that seems to be somewhat deliberate given that their error message is included as a comment and their tested as "compile-fail". As a result I added the should_panic attribute to that particular batch of tests.
Lastly I changed appveyor to use the nightly rustc compiler instead of the stable version due to the ICE only being resolved in the nightly version.

@rowanfr
Copy link
Contributor Author

rowanfr commented Sep 6, 2023

alt-text
IT COMPILED

Separately their are a few other issues that were shown in the compilation such as cloning static references, unnecessary muts, etc... but those can be resolved later. At this point I think this is ready to merge

Temporarily removed stable as a rust option for github actions. This should be reverted when 1.74 is made the rustc stable version and is only due to the ICE error being presently resolved in nightly. This leads to some clear instability with nightly features, but it's currently the only option
Removed the stable requirement from .travis.yml for the rustc compiler
Updated nightly version in .travis.yml and fixed errors in previous commit regarding using solely the nightly version of rustc
Updated sccache install script to use version v0.5.4
Clear tmp file recursively to prevent cargo artifacts from interfering
@rowanfr
Copy link
Contributor Author

rowanfr commented Sep 8, 2023

I'm going to work on it a bit using my own appveyor so I don't continue to waste CI time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cargo install gluon_repl fails to compile
1 participant