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

Can't use left shift on enum discriminants #1659

Closed
brson opened this issue Jan 25, 2012 · 2 comments
Closed

Can't use left shift on enum discriminants #1659

brson opened this issue Jan 25, 2012 · 2 comments
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@brson
Copy link
Contributor

brson commented Jan 25, 2012

enum LLVMAttribute {                                                                                                                               
    LLVMExtAttribute = 1<<0
}
error: internal compiler error unexpected failure
note: The compiler hit an unexpected failure path. This is a bug. Try running with RUST_LOG=rustc=0,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
brian@axis:~/dev/rust-llvm$ PATH=$PATH:~/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin rustc llvm.rc --test
brian@axis:~/dev/rust-llvm$ RUST_LOG=rustc=0,::rt::backtrace PATH=$PATH:~/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin rustc llvm.rc --test
rust: upcall fail 'non-exhaustive match failure', ../src/comp/syntax/ast_util.rs:263
/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustrt.so(_ZN9rust_task4failEv+0x78)[0x7fa4555da4ea]
/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustrt.so(upcall_s_fail+0xe5)[0x7fa4555dffd2]
/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustrt.so(+0x76fd1)[0x7fa45560bfd1]
/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustrt.so(_ZN7context20call_shim_on_c_stackEPvS0_+0x2f)[0x7fa4555dbcaf]
/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustrt.so(_Z22call_upcall_on_c_stackPvS_+0x4b)[0x7fa4555e15cc]
/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustrt.so(upcall_fail+0x42)[0x7fa4555e0016]
/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-4171d83aef249987-0.1.so(_ZN6syntax8ast_util15eval_const_expr17_50f77d1e5e3cdfe0E+0xba2)[0x7fa455b30a32]
/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-4171d83aef249987-0.1.so(_ZN6middle6typeck18check_tag_variants17_f2f8585171cf45a5E+0x6a0)[0x7fa455a7ff10]
/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-4171d83aef249987-0.1.so(_ZN6middle6typeck10check_item17_96921d6fcc90b518E+0x289)[0x7fa455a832f9]
/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-4171d83aef249987-0.1.so(+0x4d427e)[0x7fa455d2627e]
/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-4171d83aef249987-0.1.so(_ZN6syntax5visit17mk_simple_visitor6v_item17_e0294ec538c37498E+0x56)[0x7fa455b48066]
/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-4171d83aef249987-0.1.so(+0x512663)[0x7fa455d64663]
/home/brian/dev/rust/build/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-4171d83aef249987-0.1.so(_ZN6syntax5visit9visit_mod17_7ea3d96fba9888e
@marijnh
Copy link
Contributor

marijnh commented Jan 25, 2012

The shift operators are missing from eval_const_expr. Shall I add them, or are you on it?

@brson
Copy link
Contributor Author

brson commented Jan 25, 2012

Thanks, marijnh

brson added a commit that referenced this issue Jan 25, 2012
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Kani compiler used to generate one `goto-program` for all harnesses in one crate. In some cases, this actually had a negative impact on the harness verification time. This was first reported in rust-lang#1659

The main changes were done in the compiler's module `compiler_interface` and the module `project` from the driver. The compiler will now gather all the harnesses beforehand and it will perform reachability + codegen steps for each harness. All files related to a harness `goto-program` will follow the naming convention bellow:
```
<BASE_NAME>_<MANGLED_NAME>.<EXTENSION>
```
This applies to symtab / goto / type_map / restriction files.

The metadata file is still generated once per target crate, and its name is still the same (`<BASE_NAME>.kani-metadata.json`).

On the driver side, the way we process the artifacts have changed. The driver will now read the metadata for each crate, and collect all artifacts based on the symtab goto file that is recorded in the metadata of each harness.

These changes do not apply for `--function`. We still keep all artifacts based on the crate's `<BASE_NAME>` and we have a separate logic to handle that. Fixing this is captured by rust-lang#2129.
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
This adds an executor (scheduler for async futures) to the Kani library, thus supporting `kani::spawn` as a replacement for `tokio::spawn`.

It also includes `kani::yield_now` which is similar to `tokio::yield_now`.

Co-authored-by: Celina G. Val <celinval@amazon.com>
celinval added a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
…unctions (rust-lang#1661)

Instead of having to manually wrap the code in `kani::spawnable_block_on` as in rust-lang#1659, this PR allows `#[kani::proof]` to be applied to harnesses that use `spawn` as well. For this to happen, the user has to specify a scheduling strategy.

Co-authored-by: Celina G. Val <celinval@amazon.com>
bors pushed a commit to rust-lang-ci/rust that referenced this issue Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

2 participants