repo
string
pull_number
int64
instance_id
string
issue_numbers
list
base_commit
string
patch
string
test_patch
string
problem_statement
string
hints_text
string
created_at
string
version
string
updated_at
string
environment_setup_commit
string
FAIL_TO_PASS
list
PASS_TO_PASS
list
FAIL_TO_FAIL
list
PASS_TO_FAIL
list
source_dir
string
aya-rs/aya
774
aya-rs__aya-774
[ "636" ]
792f467d40dc4c6c543c62dda7a608863fc364dc
diff --git a/aya/src/maps/mod.rs b/aya/src/maps/mod.rs --- a/aya/src/maps/mod.rs +++ b/aya/src/maps/mod.rs @@ -291,9 +291,9 @@ macro_rules! impl_try_from_map { // rather than the repeated idents used later because the macro language does not allow one // repetition to be pasted inside another. ($ty_param...
diff --git a/aya/src/maps/hash_map/hash_map.rs b/aya/src/maps/hash_map/hash_map.rs --- a/aya/src/maps/hash_map/hash_map.rs +++ b/aya/src/maps/hash_map/hash_map.rs @@ -108,43 +108,22 @@ mod tests { use libc::{EFAULT, ENOENT}; use crate::{ - bpf_map_def, generated::{ bpf_attr, bpf...
cant' use LruHashMap in userspace the userspace HashMap try_from impl ```rust impl<'a, V: Pod, K: Pod> TryFrom<&'a mut Map> for HashMap<&'a mut MapData, V, K> { type Error = MapError; fn try_from(map: &'a mut Map) -> Result<HashMap<&'a mut MapData, V, K>, MapError> { match map { Ma...
https://docs.rs/aya/latest/src/aya/maps/hash_map/hash_map.rs.html#48 the crates.io version handled the lruhashmap maybe we can add a new type LruHashMap to fix this problem Do you have a test? I don't understand this issue. sorry for the late reply kernel space codes main.rs ```rust #[xdp(name = "lru_test")]...
2023-08-31T01:49:22Z
1.5
2023-09-01T15:30:33Z
1d272f38bd19f64652ac8a278948f61e66164856
[ "maps::hash_map::hash_map::tests::test_try_from_ok_lru", "maps::hash_map::per_cpu_hash_map::tests::test_try_from_ok_lru" ]
[ "maps::bloom_filter::tests::test_contains_not_found", "maps::bloom_filter::tests::test_contains_syscall_error", "maps::bloom_filter::tests::test_insert_ok", "maps::bloom_filter::tests::test_insert_syscall_error", "maps::bloom_filter::tests::test_new_ok", "maps::bloom_filter::tests::test_try_from_ok", "m...
[]
[]
auto_2025-06-07
aya-rs/aya
656
aya-rs__aya-656
[ "654" ]
61608e64583f9dc599eef9b8db098f38a765b285
diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,6 @@ resolver = "2" default-members = [ "aya", - "aya-bpf-macros", "aya-log", "aya-log-common", "aya-log-parser", diff --git a/aya-obj/Cargo.toml b/aya-obj/Cargo.toml --- a/aya-obj/Cargo.toml +++ b/aya-obj/Carg...
diff --git a/aya-obj/src/obj.rs b/aya-obj/src/obj.rs --- a/aya-obj/src/obj.rs +++ b/aya-obj/src/obj.rs @@ -1486,7 +1486,7 @@ pub fn copy_instructions(data: &[u8]) -> Result<Vec<bpf_insn>, ParseError> { #[cfg(test)] mod tests { use alloc::vec; - use matches::assert_matches; + use assert_matches::assert_matc...
Kernel version detection is broken on WSL Using aya from with the yesterday's commit fails with ``` thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseError(Parse("90.1", "patch"))', /home/debian/.cargo/git/checkouts/aya-c55fbc69175ac116/242d8c3/aya/src/maps/mod.rs:504:55 ``` when runnin...
2023-07-14T14:51:06Z
0.11
2023-07-15T03:18:35Z
61608e64583f9dc599eef9b8db098f38a765b285
[ "btf::btf::tests::parsing_older_ext_data", "btf::btf::tests::test_fixup_ptr", "btf::btf::tests::test_fixup_func_proto", "btf::btf::tests::test_fixup_datasec", "btf::btf::tests::test_parse_header", "btf::btf::tests::test_sanitize_datasec", "btf::btf::tests::test_parse_btf", "btf::btf::tests::test_sanit...
[ "tests::btf_relocations::relocate_enum64", "tests::btf_relocations::relocate_enum64_signed", "tests::btf_relocations::relocate_enum_signed", "tests::load::pin_lifecycle", "tests::smoke::xdp" ]
[ "tests::btf_relocations::relocate_pointer", "tests::elf::test_maps", "tests::btf_relocations::relocate_field", "tests::btf_relocations::relocate_struct_flavors", "tests::btf_relocations::relocate_enum", "tests::rbpf::use_map_with_rbpf", "tests::rbpf::run_with_rbpf", "tests::load::pin_lifecycle_kprobe"...
[]
auto_2025-06-07
aya-rs/aya
921
aya-rs__aya-921
[ "918" ]
1d272f38bd19f64652ac8a278948f61e66164856
diff --git a/aya/src/programs/cgroup_device.rs b/aya/src/programs/cgroup_device.rs --- a/aya/src/programs/cgroup_device.rs +++ b/aya/src/programs/cgroup_device.rs @@ -8,7 +8,7 @@ use crate::{ bpf_prog_get_fd_by_id, define_link_wrapper, load_program, query, CgroupAttachMode, FdLink, Link, ProgAttachLin...
diff --git a/aya/src/programs/links.rs b/aya/src/programs/links.rs --- a/aya/src/programs/links.rs +++ b/aya/src/programs/links.rs @@ -394,6 +397,125 @@ pub enum LinkError { SyscallError(#[from] SyscallError), } +#[derive(Debug)] +pub(crate) enum LinkRef { + Id(u32), + Fd(RawFd), +} + +bitflags::bitflags!...
Add TCX link support Following the recent addition of [link support for TC programs](https://lwn.net/Articles/938632/) we should add the necessary bits to support this in aya as well. The [commit adding support to the cilium ebpf library](https://github.com/cilium/ebpf/commit/417f8a264d2e691649ede9b995fb334e6c58ca...
2024-04-05T15:21:29Z
1.5
2024-10-09T09:31:40Z
1d272f38bd19f64652ac8a278948f61e66164856
[ "bpf::tests::test_adjust_to_page_size", "bpf::tests::test_max_entries_override", "maps::bloom_filter::tests::test_contains_syscall_error", "maps::bloom_filter::tests::test_contains_not_found", "maps::bloom_filter::tests::test_insert_ok", "maps::bloom_filter::tests::test_insert_syscall_error", "maps::blo...
[]
[]
[]
auto_2025-06-07
aya-rs/aya
897
aya-rs__aya-897
[ "896" ]
b6a84b658ae00f23d0f1721c30d11f2e57f99eab
diff --git a/aya-bpf-macros/src/cgroup_skb.rs b/aya-bpf-macros/src/cgroup_skb.rs --- a/aya-bpf-macros/src/cgroup_skb.rs +++ b/aya-bpf-macros/src/cgroup_skb.rs @@ -29,7 +29,7 @@ impl CgroupSkb { let section_name: Cow<'_, _> = if self.attach_type.is_some() { format!("cgroup_skb/{}", self.attach_type...
diff --git a/aya-bpf-macros/src/cgroup_skb.rs b/aya-bpf-macros/src/cgroup_skb.rs --- a/aya-bpf-macros/src/cgroup_skb.rs +++ b/aya-bpf-macros/src/cgroup_skb.rs @@ -66,7 +66,7 @@ mod tests { let expanded = prog.expand().unwrap(); let expected = quote! { #[no_mangle] - #[link_sect...
Error: error parsing BPF object: invalid program section `cgroup_skb` **My program code: ``` #[cgroup_skb] pub fn cg01(ctx: SkBuffContext) -> i32 { match try_cg02(ctx) { Ok(ret) => ret, Err(ret) => ret, } } fn try_cg01(ctx: SkBuffContext) -> Result<i32, i32> { info!(&ctx, "received...
Change ``` #[cgroup_skb] ``` to ``` #[cgroup_skb(ingress)] ``` if you want to hook to ingress or ``` #[cgroup_skb(egress)] ``` if you want to hook to egress @dave-tucker looks like this was broken in https://github.com/aya-rs/aya/commit/c72aab5f7b809b48273cd2fed4554ddff6b66bdf#diff-748602d38469...
2024-03-04T07:45:13Z
1.5
2024-03-04T08:53:45Z
1d272f38bd19f64652ac8a278948f61e66164856
[ "cgroup_skb::tests::cgroup_skb" ]
[ "cgroup_device::tests::test_cgroup_device", "btf_tracepoint::tests::test_btf_tracepoint", "cgroup_skb::tests::cgroup_skb_egress", "btf_tracepoint::tests::test_btf_tracepoint_with_function", "cgroup_skb::tests::cgroup_skb_ingress", "cgroup_skb::tests::priv_function", "cgroup_skb::tests::pub_crate_functio...
[]
[]
auto_2025-06-07
aya-rs/aya
431
aya-rs__aya-431
[ "427" ]
82773f46c8cff830b36b8b4f57100952eb6ec8d2
diff --git a/aya/src/maps/array/array.rs b/aya/src/maps/array/array.rs --- a/aya/src/maps/array/array.rs +++ b/aya/src/maps/array/array.rs @@ -1,4 +1,5 @@ use std::{ + borrow::Borrow, convert::{AsMut, AsRef}, marker::PhantomData, }; diff --git a/aya/src/maps/array/array.rs b/aya/src/maps/array/array.rs -...
diff --git a/aya/src/maps/hash_map/hash_map.rs b/aya/src/maps/hash_map/hash_map.rs --- a/aya/src/maps/hash_map/hash_map.rs +++ b/aya/src/maps/hash_map/hash_map.rs @@ -311,6 +317,27 @@ mod tests { assert!(hm.insert(1, 42, 0).is_ok()); } + #[test] + fn test_insert_boxed_ok() { + override_sysc...
API for updating maps with large Pod Although Rust is memory safe, it does not have any stack overflow protection. The default Rust stack is 2MB which is plenty for most applications. However, when dealing with Pod with large arrays embedded, it's possible to overflow the user space Rust stack. Here's an example: ...
We can change the insert() calls to take `AsRef<K>` and `AsRef<V>` so they work with both values and references (including boxes)
2022-11-01T20:35:41Z
0.11
2023-02-23T09:59:02Z
61608e64583f9dc599eef9b8db098f38a765b285
[ "maps::bloom_filter::tests::test_contains_syscall_error", "maps::bloom_filter::tests::test_contains_not_found", "maps::bloom_filter::tests::test_insert_ok", "maps::bloom_filter::tests::test_insert_syscall_error", "maps::bloom_filter::tests::test_new_not_created", "maps::bloom_filter::tests::test_new_ok", ...
[]
[]
[]
auto_2025-06-07
aya-rs/aya
90
aya-rs__aya-90
[ "88" ]
3a8e4fe9b91538a0fafd8c91ae96185c1a017651
diff --git a/aya/src/obj/mod.rs b/aya/src/obj/mod.rs --- a/aya/src/obj/mod.rs +++ b/aya/src/obj/mod.rs @@ -410,6 +410,7 @@ struct Section<'a> { address: u64, name: &'a str, data: &'a [u8], + size: u64, relocations: Vec<Relocation>, } diff --git a/aya/src/obj/mod.rs b/aya/src/obj/mod.rs --- a/a...
diff --git a/aya/src/obj/mod.rs b/aya/src/obj/mod.rs --- a/aya/src/obj/mod.rs +++ b/aya/src/obj/mod.rs @@ -607,6 +611,7 @@ mod tests { address: 0, name, data, + size: data.len() as u64, relocations: Vec::new(), } }
bpf(2) fails with invalid argument when creating .bss map I wanted to test out a simple example of using .data, .rodata, and .bss maps in Aya. It seems that .data and .rodata work just fine, but creating the .bss map always seems to fail with an invalid argument error. Inspecting the strace dump (shown below), the offe...
2021-10-31T00:02:13Z
0.10
2021-11-04T06:00:06Z
b9a544831c5b4cd8728e9cca6580c14a623b7793
[ "maps::hash_map::hash_map::tests::test_get_syscall_error", "maps::hash_map::hash_map::tests::test_insert_ok", "maps::hash_map::hash_map::tests::test_get_not_found", "maps::hash_map::hash_map::tests::test_insert_syscall_error", "maps::hash_map::hash_map::tests::test_iter", "maps::hash_map::hash_map::tests:...
[]
[]
[]
auto_2025-06-07
aya-rs/aya
85
aya-rs__aya-85
[ "84" ]
c4b6970774930540ece21df329a1abd8dcb4ceb7
diff --git a/aya/src/bpf.rs b/aya/src/bpf.rs --- a/aya/src/bpf.rs +++ b/aya/src/bpf.rs @@ -20,9 +20,9 @@ use crate::{ Object, ParseError, ProgramSection, }, programs::{ - CgroupSkb, CgroupSkbAttachType, KProbe, LircMode2, Lsm, PerfEvent, ProbeKind, Program, - ProgramData, ProgramError, ...
diff --git a/aya/src/obj/mod.rs b/aya/src/obj/mod.rs --- a/aya/src/obj/mod.rs +++ b/aya/src/obj/mod.rs @@ -1046,4 +1050,21 @@ mod tests { }) ); } + + #[test] + fn test_parse_section_btf_tracepoint() { + let mut obj = fake_obj(); + + assert_matches!( + obj.parse_...
Support BTF tracepoints (tp_btf/*, also called "BTF-enabled raw tracepoints") #68 added support for raw tracepoints (raw_tp/*). However, there's another variant of raw tracepoints which uses tp_btf/*. I don't fully understand how it work but I think it makes it so that you can access the arguments of the traced hook po...
2021-10-28T21:14:42Z
0.10
2021-10-29T16:37:08Z
b9a544831c5b4cd8728e9cca6580c14a623b7793
[ "maps::hash_map::hash_map::tests::test_get_syscall_error", "maps::hash_map::hash_map::tests::test_get_not_found", "maps::hash_map::hash_map::tests::test_insert_ok", "maps::hash_map::hash_map::tests::test_insert_syscall_error", "maps::hash_map::hash_map::tests::test_iter", "maps::hash_map::hash_map::tests:...
[]
[]
[]
auto_2025-06-07
aya-rs/aya
253
aya-rs__aya-253
[ "51" ]
b9a544831c5b4cd8728e9cca6580c14a623b7793
diff --git a/aya/src/programs/cgroup_skb.rs b/aya/src/programs/cgroup_skb.rs --- a/aya/src/programs/cgroup_skb.rs +++ b/aya/src/programs/cgroup_skb.rs @@ -9,7 +9,8 @@ use crate::{ bpf_prog_type::BPF_PROG_TYPE_CGROUP_SKB, }, programs::{ - define_link_wrapper, load_program, FdLink, Link, ProgAtt...
diff --git a/aya/src/programs/links.rs b/aya/src/programs/links.rs --- a/aya/src/programs/links.rs +++ b/aya/src/programs/links.rs @@ -153,7 +192,7 @@ pub(crate) use define_link_wrapper; mod tests { use std::{cell::RefCell, rc::Rc}; - use crate::programs::ProgramError; + use crate::programs::{OwnedLink, P...
lifecyle: Add a `forget()` API for `Link` Default behaviour is that the `Drop` trait calls `detach()` when the program is terminated (or panics). For some types of long running programs you may wish to intentionally `forget()` the fd wrapped by `Link`, so you can keep the program running after exit. Query and detach c...
I'm not sure it should be called `forget()`, but then again I am struggling to come up with a better name. Maybe something like `keep_program_attached()`, `disown()`, or `keep_attached()`. Maybe I'll come up with a better name.
2022-05-06T23:27:37Z
0.10
2022-05-12T18:56:36Z
b9a544831c5b4cd8728e9cca6580c14a623b7793
[ "maps::hash_map::hash_map::tests::test_insert_ok", "maps::hash_map::hash_map::tests::test_get_not_found", "maps::hash_map::hash_map::tests::test_get_syscall_error", "maps::hash_map::hash_map::tests::test_insert_syscall_error", "maps::hash_map::hash_map::tests::test_iter", "maps::hash_map::hash_map::tests:...
[]
[]
[]
auto_2025-06-07
sharkdp/bat
1,017
sharkdp__bat-1017
[ "1008" ]
d6abad908a51cf9396cc8521a5ec94b1fc9206ea
diff --git a/src/syntax_mapping.rs b/src/syntax_mapping.rs --- a/src/syntax_mapping.rs +++ b/src/syntax_mapping.rs @@ -42,6 +42,11 @@ impl<'a> SyntaxMapping<'a> { ) .unwrap(); + // See #1008 + mapping + .insert("rails", MappingTarget::MapToUnknown) + .unwr...
diff --git a/src/assets.rs b/src/assets.rs --- a/src/assets.rs +++ b/src/assets.rs @@ -481,4 +481,15 @@ mod tests { "Bourne Again Shell (bash)" ); } + + #[test] + fn issue_1008() { + let test = SyntaxDetectionTest::new(); + + assert_eq!( + test.syntax_for_file_w...
bin/rails script highlighted as HTML (Rails) instead of Ruby <!-- Hey there, thanks for creating an issue! In order to reproduce your issue, we might need to know a little bit more about the environment which you're running `bat` on. If you're on Linux or MacOS: Please run the script at https://github.com/sh...
Thank you for reporting this! We recently discussed whether first-line syntax detection should take precedence over the filename syntax detection: see #685 and https://github.com/sharkdp/bat/issues/891#issuecomment-604617183 Unfortunately, there are some cases where it's not favorable to rely on first-line detect...
2020-05-24T08:23:09Z
0.15
2020-05-24T09:27:48Z
2d1a92b7cc2af6c35f868cbefe9dbfe466c59fcb
[ "config::default_config_should_highlight_no_lines", "config::default_config_should_include_all_lines", "less::test_parse_less_version_487", "less::test_parse_less_version_551", "less::test_parse_less_version_529", "line_range::test_parse_partial_min", "less::test_parse_less_version_wrong_program", "li...
[]
[]
[]
auto_2025-06-07
sharkdp/bat
1,556
sharkdp__bat-1556
[ "1550" ]
c569774e1a8528fab91225dabdadf53fde3916ea
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ - If `PAGER` (but not `BAT_PAGER` or `--pager`) is `more` or `most`, silently use `less` instead to ensure support for colors, see #1063 (@Enselic) - If `PAGER` is `bat`, silently use `less` to prevent recursion. For `BAT...
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -652,6 +652,13 @@ fn config_location_test() { .assert() .success() .stdout("bat.conf\n"); + + bat_with_config() + .env("BAT_CONFIG_PATH", "not-ex...
BAT_CONFIG_PATH ignored by --generate-config-file <!-- Hey there, thank you for creating an issue! --> **What version of `bat` are you using?** <!-- Output of `bat --version` --> Newest **Describe the bug you encountered:** ![image](https://user-images.githubusercontent.com/55729509/108675764-3694ee80-7522-1...
Thank you for reporting this. Looks like a bug indeed. I can confirm this bug, which is generic. It is caused by ``` .filter(|config_path| config_path.is_file()) ``` in ``` pub fn config_file() -> PathBuf { env::var("BAT_CONFIG_PATH") .ok() .map(PathBuf::from) .filter(|conf...
2021-02-27T11:22:32Z
0.17
2021-02-28T14:19:15Z
c569774e1a8528fab91225dabdadf53fde3916ea
[ "config_location_test" ]
[ "line_range::test_ranges_open_low", "input::utf16le", "less::test_parse_less_version_487", "less::test_parse_less_version_551", "config::default_config_should_include_all_lines", "line_range::test_ranges_simple", "line_range::test_parse_full", "input::basic", "line_range::test_ranges_advanced", "p...
[]
[]
auto_2025-06-07
sharkdp/bat
1,522
sharkdp__bat-1522
[ "1521" ]
d36b091fd7c9050c80078c0fe286d09dbab0f45a
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -17,9 +17,9 @@ dependencies = [ [[package]] name = "ansi_colours" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d0f302a81afc6a7f4350c04f0ba7cfab529cc009bca3324b3fb5764e6a...
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -117,7 +106,7 @@ dependencies = [ "serial_test", "shell-words", "syntect", - "tempdir", + "tempfile", "unicode-width", "wait-timeout", "wild", diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -76,11 +73,11 @@ ...
RUSTSEC-2020-0053: dirs: dirs is unmaintained, use dirs-next instead When `cargo-audit` is run on any crate that depends directly or indirectly on bat, the following is output (for more info, see https://rustsec.org/advisories/RUSTSEC-2020-0053): ``` Crate: dirs Version: 3.0.1 Warning: unmaint...
2021-01-17T22:23:01Z
0.17
2021-02-16T16:42:31Z
c569774e1a8528fab91225dabdadf53fde3916ea
[ "config::default_config_should_highlight_no_lines", "config::default_config_should_include_all_lines", "less::test_parse_less_version_487", "input::utf16le", "input::basic", "less::test_parse_less_version_wrong_program", "less::test_parse_less_version_529", "line_range::test_parse_fail", "line_range...
[]
[]
[]
auto_2025-06-07
sharkdp/bat
1,518
sharkdp__bat-1518
[ "1503" ]
3af35492320077b2abf7cc70117ea02aa24389a3
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -98,6 +98,7 @@ dependencies = [ "git2", "globset", "lazy_static", + "nix", "path_abs", "predicates", "semver", diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -213,12 +214,12 @@ dependencies = [ [[package]...
diff --git a/src/assets.rs b/src/assets.rs --- a/src/assets.rs +++ b/src/assets.rs @@ -329,7 +329,7 @@ mod tests { let input = Input::ordinary_file(file_path.as_os_str()); let dummy_stdin: &[u8] = &[]; - let mut opened_input = input.open(dummy_stdin).unwrap(); + let mut...
Can not run bat with input and output attached to /dev/null **Describe the bug you encountered:** ``` ▶ bat > /dev/null < /dev/null [bat error]: The output file is also an input! ``` **What did you expect to happen instead?** This is kind of a weird edge case, but running `bat` like this is actually useful ...
I looked into the `cat` source code again and I found that we missed a detail when this feature was sketched out for the first time. `cat` always checks, that the output is a "regular file", according to the filetype encoded in the `st_mode` field: ```c out_isreg = S_ISREG (stat_buf.st_mode) != 0; // ... /*...
2021-01-14T19:34:00Z
0.17
2021-02-28T22:04:49Z
c569774e1a8528fab91225dabdadf53fde3916ea
[ "input::basic", "preprocessor::test_try_parse_utf8_char", "line_range::test_ranges_all", "line_range::test_parse_partial_min", "line_range::test_ranges_advanced", "input::utf16le", "less::test_parse_less_version_wrong_program", "config::default_config_should_include_all_lines", "config::default_conf...
[]
[]
[]
auto_2025-06-07
sharkdp/bat
1,506
sharkdp__bat-1506
[ "1413" ]
b25713938d23b0ff59e82e3e969b56423028ce53
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ - Print an 'Invalid syntax theme settings' error message if a custom theme is broken, see #614 (@Enselic) - If plain mode is set and wrap is not explicitly opted in, long lines will no be truncated, see #1426 - If `PAGER...
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -499,6 +499,28 @@ fn pager_disable() { .stdout(predicate::eq("hello world\n").normalize()); } +#[test] +fn env_var_pager_value_bat() { + bat() + .env("PAGER", "...
Can't use `bat` at all! (Error: Use of bat as a pager is disallowed...) **What version of `bat` are you using?** bat 0.17.1 **Describe the bug you encountered:** Whenever I use `bat`, I'm shown the following error message: > [bat error]: Use of bat as a pager is disallowed in order to avoid infinite recursion...
That's intentional, see https://github.com/sharkdp/bat/pull/1343 Personally, I don't like this restriction too (but it's not hard to overcome). > That's intentional, see #1343 Hm. Kind of, but not to the extent documented here, actually. What we really want to avoid is infinite recursion (`bat` calls `bat` as pag...
2021-01-10T16:13:16Z
0.17
2021-08-20T04:48:10Z
c569774e1a8528fab91225dabdadf53fde3916ea
[ "env_var_pager_value_bat" ]
[ "config::default_config_should_include_all_lines", "less::test_parse_less_version_529", "config::default_config_should_highlight_no_lines", "less::test_parse_less_version_551", "input::basic", "input::utf16le", "less::test_parse_less_version_487", "less::test_parse_less_version_wrong_program", "line...
[]
[]
auto_2025-06-07
sharkdp/bat
1,889
sharkdp__bat-1889
[ "1703" ]
ed3246c423932561435d45c50fd8cd9e06add7f5
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ - Python syntax highlighting no longer suffers from abysmal performance in specific scenarios. See #1688 (@keith-hall) - First line not shown in diff context. See #1891 (@divagant-martian) +- Do not ignore syntaxes that h...
diff --git a/src/assets.rs b/src/assets.rs --- a/src/assets.rs +++ b/src/assets.rs @@ -530,6 +554,42 @@ mod tests { assert_eq!(test.syntax_for_file("test.h"), "C"); } + #[test] + fn syntax_detection_with_extension_mapping_to_unknown() { + let mut test = SyntaxDetectionTest::new(); + + ...
Some *.conf files not highlighted I wanted to add syntax highlighting for for .tmux.conf file, so I add this file to `bat/syntaxes/` https://raw.githubusercontent.com/gerardroche/sublime-tmux/master/Tmux.sublime-syntax I then `bat cache -b` and try viewing my `.tmux.conf` file, but it is still plain with no synta...
I just realised that it works when I force it like this: `$ bat -l Tmux .tmux.conf` So why is it not detecting the file when it is named in the same way that the `bat -L` mentions? ie. `Tmux tmux.conf, tmux, .tmux.conf, .tmux` likely related: https://github.com/sharkdp/bat/...
2021-10-06T21:46:39Z
0.18
2021-10-25T15:59:13Z
8072d5a3e34494c80f10396481703a96997bb893
[ "assets::build_assets::tests::remove_explicit_context_sanity", "config::default_config_should_highlight_no_lines", "config::default_config_should_include_all_lines", "input::basic", "input::utf16le", "less::test_parse_less_version_487", "less::test_parse_less_version_529", "less::test_parse_less_versi...
[]
[]
[]
auto_2025-06-07
sharkdp/bat
1,440
sharkdp__bat-1440
[ "1438", "1438" ]
60e00d49a99f33eb90397c6932c770d82fd481ec
diff --git a/src/preprocessor.rs b/src/preprocessor.rs --- a/src/preprocessor.rs +++ b/src/preprocessor.rs @@ -72,7 +72,7 @@ pub fn replace_nonprintable(input: &[u8], tab_width: usize) -> String { } } // line feed - '\x0A' => output.push('␊'), + ...
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,8 @@ ## Bugfixes -- only print themes hint in interactive mode (`bat --list-themes`), see #1439 (@rsteube) +- If the last line doesn't end with a newline character, don't add it if `--style=plain`, see #1438 (@Enselic) +- Onl...
Newline can be added even if --style=plain In #975 @sharkdp said this: > The fact that bat -p prints a trailing newline (even if there is no newline at the end of the file) should be considered a bug, I believe (but we should check older tickets, if there was a reason for this behavior). And I completely agree. T...
Thank you for taking the time to write this down in detail! Thank you for taking the time to write this down in detail!
2020-12-16T19:47:12Z
0.17
2021-01-06T21:41:06Z
c569774e1a8528fab91225dabdadf53fde3916ea
[ "plain_mode_does_not_add_nonexisting_newline" ]
[ "config::default_config_should_highlight_no_lines", "config::default_config_should_include_all_lines", "input::basic", "less::test_parse_less_version_487", "input::utf16le", "less::test_parse_less_version_529", "less::test_parse_less_version_wrong_program", "less::test_parse_less_version_551", "line...
[]
[]
auto_2025-06-07
sharkdp/bat
1,398
sharkdp__bat-1398
[ "1193" ]
8381945cb59aac45e4a60c597f114dbf0102cfcf
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -99,6 +99,7 @@ dependencies = [ "assert_cmd", "atty", "clap", + "clircle", "console", "content_inspector", "dirs", diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -116,6 +117,7 @@ dependencies = [ "syntect"...
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -1,11 +1,17 @@ -use assert_cmd::Command; +use assert_cmd::assert::OutputAssertExt; +use assert_cmd::cargo::CommandCargoExt; use predicates::{prelude::predicate, str::PredicateStrExt...
Infinite loop when "input file is output file" <!-- Hey there, thanks for creating an issue! In order to reproduce your issue, we might need to know a little bit more about the environment which you're running `bat` on. If you're on Linux or MacOS: Please run the script at https://github.com/sharkdp/bat/blob...
Thank you very much for reporting this! This should be fixed. I wonder how `cat` implements this feature? Apparently, it detects that file/inode behind the stdout file descriptor is the same as one of the input files. yes. it's comparing inodes: ```c if (out_isreg && stat_buf.st_dev == out_dev && ...
2020-11-24T23:38:38Z
0.17
2021-01-14T19:18:09Z
c569774e1a8528fab91225dabdadf53fde3916ea
[ "config::default_config_should_include_all_lines", "config::default_config_should_highlight_no_lines", "input::utf16le", "input::basic", "less::test_parse_less_version_487", "less::test_parse_less_version_529", "less::test_parse_less_version_wrong_program", "line_range::test_parse_partial_max", "lin...
[]
[]
[]
auto_2025-06-07
sharkdp/bat
1,276
sharkdp__bat-1276
[ "1163" ]
33128d75f22a7c029df17b1ee595865933551469
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ## Features - Adjust pager configuration to comply with `--wrap=never`, see #1255 (@gahag) +- Added a new `--style` value, `rule`, which adds a simple horizontal ruled line between files, see #1276 (@tommilligan) ## Bu...
diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -570,6 +570,18 @@ fn empty_file_leads_to_empty_output_with_grid_enabled() { .stdout(""); } +#[test] +fn empty_file_leads_to_empty_output_with_rule_enabled() { + bat() ...
Alternative to `grid` for style which only draws a line between files I'm not a fan of having my `cat`-alike draw a full-blown table, but I would like to have some visible "end of file, beginning of next file" separation. Unfortunately, `--style=header,grid` still draws the horizontal lines as if they were part of a...
Thank you for the feedback. Sounds good to me. Maybe we could also change the `grid` style whenever the sidebar is not visible? Instead of introducing a new style? > Maybe we could also change the grid style whenever the sidebar is not visible? Instead of introducing a new style? I considered that, but I proposed...
2020-10-06T16:29:46Z
0.16
2020-11-23T18:09:48Z
33128d75f22a7c029df17b1ee595865933551469
[ "grid_overrides_rule", "header_padding_rule", "empty_file_leads_to_empty_output_with_rule_enabled", "changes_header_rule", "changes_grid_header_numbers_rule", "header_numbers_rule", "rule", "changes_grid_header_rule", "changes_rule", "grid_header_rule", "grid_rule", "header_rule", "changes_g...
[ "config::default_config_should_highlight_no_lines", "config::default_config_should_include_all_lines", "input::basic", "input::utf16le", "less::test_parse_less_version_487", "less::test_parse_less_version_529", "less::test_parse_less_version_wrong_program", "less::test_parse_less_version_551", "line...
[]
[]
auto_2025-06-07
sharkdp/bat
562
sharkdp__bat-562
[ "557" ]
1ce0bc8e0d6364b3dbac07158ad6343f3d5769a3
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -1,3 +1,5 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. [[package]] name = "adler32" version = "1.0.3" diff --git a/src/clap_app.rs b/src/clap_app.rs --- a/src/clap_app.rs +++ b/src/clap_app.rs...
diff --git /dev/null b/tests/examples/cache new file mode 100644 --- /dev/null +++ b/tests/examples/cache @@ -0,0 +1,1 @@ +test diff --git a/tests/integration_tests.rs b/tests/integration_tests.rs --- a/tests/integration_tests.rs +++ b/tests/integration_tests.rs @@ -448,3 +448,18 @@ fn utf16() { .success() ...
Bat is broken for filenames that are prefixes of "cache" The issue with files named "cache" was already identified in #245 and fixed in #275. However, the `clap` parser doesn't require an exact match: any prefix of the subcommand "cache" will do. So if you try `bat c` (or "ca", "cac", "cach"), one of the following will...
Which version of `bat` are you using? This should have been fixed and I can not reproduce this. I just discovered this myself. Version 0.10.0 I did `bat c` where c was a file and got the error ```bash ~ > bat c error: The following required arguments were not provided: <--build|--clear> USAGE: ...
2019-05-10T19:03:15Z
0.10
2019-05-10T22:55:52Z
1ce0bc8e0d6364b3dbac07158ad6343f3d5769a3
[ "does_not_print_unwanted_file_named_cache" ]
[ "config::empty", "config::comments", "config::multi_line", "config::quotes", "config::multiple", "inputfile::utf16le", "inputfile::basic", "config::single", "line_range::test_parse_fail", "line_range::test_parse_partial_max", "line_range::test_parse_full", "line_range::test_parse_partial_min",...
[]
[]
auto_2025-06-07
cargo-generate/cargo-generate
785
cargo-generate__cargo-generate-785
[ "784" ]
15b2143c1c5520cdd378c762769eacf55d2853e4
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -171,23 +171,21 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "3.2.23" +version = "4.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "...
diff --git a/src/args.rs b/src/args.rs --- a/src/args.rs +++ b/src/args.rs @@ -42,8 +42,8 @@ pub struct GenerateArgs { "bin", "define", "init", - "template-values-file", - "ssh-identity", + "template_values_file", + "ssh_identity", ...
chore(deps): bump clap from 3.2.23 to 4.0.19 Bumps [clap](https://github.com/clap-rs/clap) from 3.2.23 to 4.0.19. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/clap-rs/clap/releases">clap's releases</a>.</em></p> <blockquote> <h2>v4.0.19</h2> <h2>[4.0.19] - 2022-11-04</h2> <...
2022-11-07T12:22:15Z
0.16
2022-11-07T15:33:38Z
15b2143c1c5520cdd378c762769eacf55d2853e4
[ "basics::error_message_for_invalid_repo_or_user" ]
[ "config::tests::config_try_from_errors_on_invalid_keys", "config::tests::locate_configs_returns_empty_upon_failure", "config::tests::config_try_from_handles_empty", "config::tests::locate_configs_doesnt_look_past_cargo_generate", "config::tests::config_try_from_handles_placeholders", "filenames::tests::sh...
[ "basics::it_processes_dot_github_directory_files", "basics::it_provides_crate_type_lib", "basics::it_allows_user_defined_projectname_when_passing_force_flag", "basics::it_ignore_tags_inside_raw_block", "basics::it_kebabcases_projectname_when_passed_to_flag", "basics::it_removes_genignore_files_before_subs...
[]
auto_2025-06-12
cargo-generate/cargo-generate
693
cargo-generate__cargo-generate-693
[ "636" ]
422da4742fdae5475206f588c5dbe45e1667527e
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,13 +6,25 @@ - [fix(#514): boolean value being ignored](https://github.com/cargo-generate/cargo-generate/issues/514) ### ✨ Features -- [Test for file existance from rhai scripts](https://github.com/cargo-generate/cargo-generate/pull...
diff --git a/src/config.rs b/src/config.rs --- a/src/config.rs +++ b/src/config.rs @@ -89,30 +90,38 @@ impl Config { } } -pub fn locate_template_configs(dir: &Path) -> Result<Vec<String>> { - let mut result = vec![]; - - for entry in WalkDir::new(dir) { - let entry = entry?; - if entry.file_...
Feat: when pointing to a multi-template repo, it should be possible to explicitly specify the default template When using `cargo-generate` with a multi template repository, `cargo-generate` creates a `choice` prompt for the user to select a template to expand. It would help on usability if it was possible to influ...
> When using cargo-generate with a multi template repository, cargo-generate creates a choice prompt for the user to select a template to expand. The choices presented to the users, should be based on the first level of directories in the template repository? Currently we find all sub-folders that has a `cargo-gene...
2022-07-09T18:53:37Z
0.15
2022-07-13T07:06:10Z
9bdf3ab592e2431309929ff57d7a525a4182a8cf
[ "config::tests::config_try_from_handles_empty", "config::tests::config_try_from_errors_on_invalid_keys", "config::tests::config_try_from_handles_placeholders", "git::utils::should_canonicalize", "git::identity_path::tests::should_pretty_path", "project_variables::tests::block_invalid_key_names", "projec...
[]
[]
[]
auto_2025-06-12
cargo-generate/cargo-generate
511
cargo-generate__cargo-generate-511
[ "391" ]
dbc133f2287b4b19f65facd6e7fcbbe94c73f101
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -130,6 +130,7 @@ version = "0.11.1" dependencies = [ "anyhow", "assert_cmd", + "cargo-husky", "console", "dialoguer", "dirs", diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -161,6 +162,12 @@ dependencies = [ ...
diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -54,6 +54,11 @@ predicates = "2.1" assert_cmd = "2.0" indoc = "1.0" +[dev-dependencies.cargo-husky] +version = "1" +default-features = false +features = ["prepush-hook", "run-cargo-test", "run-cargo-clippy", "run-cargo-fmt"] + [features] ve...
abbreviation support for gitlab and bitbucket users At the moment I can point to a github repo like this: ```sh cargo generate --git rustwasm/wasm-pack-template # or even shorter: cargo generate rustwasm/wasm-pack-template ``` In order to support also gitlab and bitbucket users I'm proposing a prefix that w...
2022-01-04T13:25:19Z
0.11
2022-01-04T18:16:12Z
dbc133f2287b4b19f65facd6e7fcbbe94c73f101
[ "config::tests::config_try_from_handles_empty", "config::tests::config_try_from_errors_on_invalid_keys", "config::tests::config_try_from_handles_placeholders", "git::should_canonicalize", "git::tests::should_determine_repo_kind", "git::tests::should_not_fail_for_ssh_remote_urls", "git::should_pretty_pat...
[]
[]
[]
auto_2025-06-12
cargo-generate/cargo-generate
474
cargo-generate__cargo-generate-474
[ "473" ]
86bd44b49a0b9acf0fa09bdbdd49db7fcc88abf8
diff --git a/src/hooks/variable_mod.rs b/src/hooks/variable_mod.rs --- a/src/hooks/variable_mod.rs +++ b/src/hooks/variable_mod.rs @@ -1,7 +1,7 @@ use liquid::{Object, ValueView}; use liquid_core::Value; use regex::Regex; -use rhai::{Dynamic, EvalAltResult, Module}; +use rhai::{Array, Dynamic, EvalAltResult, Module}...
diff --git a/src/hooks/variable_mod.rs b/src/hooks/variable_mod.rs --- a/src/hooks/variable_mod.rs +++ b/src/hooks/variable_mod.rs @@ -203,3 +220,61 @@ impl GetNamedValue for Rc<RefCell<Object>> { } } } + +fn rhai_to_liquid_value(val: Dynamic) -> Result<Value> { + val.as_bool() + .map(Into::int...
feature: in Rhai script, add support for array in variable::set This feature is not an addition to the types of placeholders in general. Instead it aims only to allow the usage of arrays through Rhai scripts. Rhai already has support for arrays and so does Liquid, so the implementation is simple and minimal changes wou...
2021-10-02T14:55:51Z
0.10
2021-11-07T11:35:35Z
86bd44b49a0b9acf0fa09bdbdd49db7fcc88abf8
[ "config::tests::config_try_from_handles_empty", "config::tests::config_try_from_errors_on_invalid_keys", "git::should_canonicalize", "config::tests::config_try_from_handles_placeholders", "git::tests::should_determine_repo_kind", "git::tests::should_not_fail_for_ssh_remote_urls", "git::should_pretty_pat...
[]
[]
[]
auto_2025-06-12
cargo-generate/cargo-generate
445
cargo-generate__cargo-generate-445
[ "18" ]
81622ba05aac86dc08625a24b04639941d2e6643
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,14 @@ # Changelog ## [Unreleased] - +- [enable pre/post hooks](https://github.com/cargo-generate/cargo-generate/issues/18) + + Support for template hooks written in [rhai](https://rhai.rs/book/about/index.html). + + Enab...
diff --git a/src/config.rs b/src/config.rs --- a/src/config.rs +++ b/src/config.rs @@ -170,6 +197,7 @@ mod tests { result, Config { template: None, + hooks: None, placeholders: None, conditional: Default::default(), ...
Pre/Post Hooks This is something else that has been handy from [cookiecutter](https://cookiecutter.readthedocs.io/en/latest/advanced/hooks.html) but is more questionable due to security. Use cases from my python cookiecutter translated to Rust. - Custom SCM support - Verifying ident (see #17) - `cargo update && g...
I did a little research of what projects allow to run rust code. Here is what I found: - https://crates.io/crates/rust-script - https://crates.io/crates/cargo-play - https://crates.io/crates/runner - https://crates.io/crates/cargo-eval (fork of cargo-script which wasn't updated in 4 years)
2021-09-04T18:14:40Z
0.9
2021-09-19T21:21:05Z
81622ba05aac86dc08625a24b04639941d2e6643
[ "config::tests::config_try_from_handles_empty", "config::tests::config_try_from_errors_on_invalid_keys", "config::tests::config_try_from_handles_placeholders", "git::should_canonicalize", "git::should_pretty_path", "git::tests::should_determine_repo_kind", "git::tests::should_not_fail_for_ssh_remote_url...
[]
[]
[]
auto_2025-06-12
cargo-generate/cargo-generate
525
cargo-generate__cargo-generate-525
[ "516" ]
3853b4c68a4440578e243ede86244a431a6ac5f2
diff --git a/src/app_config.rs b/src/app_config.rs --- a/src/app_config.rs +++ b/src/app_config.rs @@ -7,7 +7,7 @@ use std::{ path::{Path, PathBuf}, }; -use crate::emoji; +use crate::info; pub const CONFIG_FILE_NAME: &str = "cargo-generate.toml"; diff --git a/src/app_config.rs b/src/app_config.rs --- a/src...
diff --git a/tests/integration/basics.rs b/tests/integration/basics.rs --- a/tests/integration/basics.rs +++ b/tests/integration/basics.rs @@ -73,70 +73,6 @@ version = "0.1.0" assert_eq!(0, references); } -#[test] -fn it_removes_git_history() { - let template = tmp_dir() - .file( - "Cargo.t...
forcing git initialisation by a new flag `--force-git-init` It seems cargo-generate ignores any and all attempts to allow for git initialization when the target directory is already inside an existing git repository. I use git for the config files in my home directory and so it seems I can not create any git initial...
That's an interesting issue. > I use git for the config files in my home directory Are you not using a `.dotfiles` folder where the git checkout of your dot files lives, and then symlink e.g. `ln -s ~/.dotfiles/.bashrc ~/` it over into your home? No, I am not using a .dotfiles folder and symlinking the files sinc...
2022-01-17T01:26:11Z
0.12
2022-01-17T01:46:17Z
a24f4d14e7c4d9b68aeb23e5657f41c05a0374a4
[ "config::tests::config_try_from_handles_placeholders", "config::tests::config_try_from_handles_empty", "git::should_pretty_path", "config::tests::config_try_from_errors_on_invalid_keys", "config::tests::test_deserializes_config", "git::tests::should_not_fail_for_ssh_remote_urls", "project_variables::tes...
[]
[]
[]
auto_2025-06-12
cargo-generate/cargo-generate
1,172
cargo-generate__cargo-generate-1172
[ "1152" ]
26427861bddd32bc2fdca354a76bc7b093871084
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -175,7 +175,6 @@ dependencies = [ "assert_cmd", "auth-git2", "bstr", - "cargo-husky", "clap", "console", "dialoguer", diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -212,12 +211,6 @@ dependencies = [ "walk...
diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -61,16 +61,6 @@ indoc = "~2.0" url = "~2.5" bstr = "~1.9" -[dev-dependencies.cargo-husky] -version = "~1.5" -default-features = false -features = [ - "prepush-hook", - "run-cargo-test", - "run-cargo-clippy", - "run-cargo-fmt", -] ...
Don't rename underscores to hyphens in project names `cargo-generate` swaps underscores to hyphens in project names: ``` 🤷 Project Name: lock_firmware ⚠️ Renaming project called `lock_firmware` to `lock-firmware`... ``` I'm not aware of any requirement that Rust projects use hyphens, so this seems unneces...
That's actually a fair point. Underscore to dash is not necessary. Dash to underscore is necessary on the module level. I will prepare a fix.
2024-04-10T12:43:38Z
0.20
2024-04-10T20:56:02Z
26427861bddd32bc2fdca354a76bc7b093871084
[ "config::tests::config_try_from_handles_empty", "config::tests::config_try_from_errors_on_invalid_keys", "config::tests::config_try_from_handles_placeholders", "config::tests::locate_configs_doesnt_look_past_cargo_generate", "git::utils::should_canonicalize", "config::tests::locate_configs_returns_empty_u...
[]
[]
[]
auto_2025-06-12
cargo-generate/cargo-generate
880
cargo-generate__cargo-generate-880
[ "879" ]
faf3d01b1e1af968ec2a17a80849193c70657f8a
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -73,9 +73,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7f0778972c64420fdedc63f09919c8a88bda7b25135357fd25a5d9f3257e832" +...
diff --git a/tests/integration/git.rs b/tests/integration/git.rs --- a/tests/integration/git.rs +++ b/tests/integration/git.rs @@ -1,7 +1,7 @@ use assert_cmd::prelude::*; use bstr::ByteSlice; use git2::Repository; -use git_config::File as GitConfig; +use gix_config::File as GitConfig; use predicates::prelude::*; u...
Cannot install on Rust 1.67 **Describe the bug** Running `cargo install cargo-generate` failed with rustc 1.67.0. Specifically, it fails to build git-ref 0.23.1, which is a dependency of git-config. **Desktop (please complete the following information):** - OS: Windows 10 - `rustc --version`: 1.67.0 **Additi...
Can confirm for rustc 1.67.1 on Manjaro Confirming too, wasnt able to install it today Same for me on macos. ```Rust error[E0277]: the trait bound `BStr: AsRef<[_; 0]>` is not satisfied --> /Users/l1x/.cargo/registry/src/github.com-1ecc6299db9ec823/git-ref-0.23.1/src/store/packed/find.rs:95:35 | 95 | ...
2023-02-21T19:10:17Z
0.17
2023-02-22T11:46:49Z
faf3d01b1e1af968ec2a17a80849193c70657f8a
[ "git::identity_path::tests::should_pretty_path", "config::tests::locate_configs_can_locate_paths_with_cargo_generate", "config::tests::locate_configs_returns_empty_upon_failure", "config::tests::locate_configs_doesnt_look_past_cargo_generate", "project_variables::tests::choices_is_array_string_no_regex_is_f...
[]
[]
[]
auto_2025-06-12
cargo-generate/cargo-generate
691
cargo-generate__cargo-generate-691
[ "569" ]
e9fcff0cdd84481fd8bcb85a46ce7a92abe2d74c
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ If a selected template doesn't have a `cargo-generate.toml` file, but a parent one exists, any configured sub-templates will be ignored. Further implication is that sub-templates no longer needs to have a `cargo-g...
diff --git a/tests/integration/basics.rs b/tests/integration/basics.rs --- a/tests/integration/basics.rs +++ b/tests/integration/basics.rs @@ -462,6 +462,44 @@ version = "0.1.0" Ok(()) } +#[test] +fn it_can_overwrite_files() -> anyhow::Result<()> { + let template = tmp_dir() + .file( + "Car...
Add option to overwrite files in existing project [The book has the following to say](https://cargo-generate.github.io/cargo-generate/usage.html#generating-into-current-dir) about this: > `cargo-generate` will not allow any existing files to be overwritten and will fail to generate any files should there be any conf...
maybe a `-f | --force` flag would be more reasonable for this sort of behaviour? If anyone wants to work on this - I'm available to guide as needed. > maybe a `-f | --force` flag would be more reasonable for this sort of behaviour? I would have liked this option better too but it's already taken: https://github.com/...
2022-07-07T10:06:22Z
0.15
2022-07-14T07:30:25Z
9bdf3ab592e2431309929ff57d7a525a4182a8cf
[ "config::tests::config_try_from_handles_empty", "config::tests::config_try_from_errors_on_invalid_keys", "config::tests::config_try_from_handles_placeholders", "git::utils::should_canonicalize", "project_variables::tests::block_invalid_key_names", "config::tests::locate_configs_can_doesnt_look_past_cargo_...
[]
[]
[]
auto_2025-06-12
cargo-generate/cargo-generate
680
cargo-generate__cargo-generate-680
[ "679" ]
7692e625993c5e18a8cea35858bccc4b82afbe14
diff --git a/guide/src/favorites.md b/guide/src/favorites.md --- a/guide/src/favorites.md +++ b/guide/src/favorites.md @@ -13,10 +13,14 @@ description = "<optional description, visible with --list-favorites>" git = "https://github.com/ashleygwilliams/wasm-pack-template" branch = "<optional-branch>" subfolder = "<opt...
diff --git a/src/config.rs b/src/config.rs --- a/src/config.rs +++ b/src/config.rs @@ -183,6 +184,7 @@ mod tests { include: Some(vec!["Cargo.toml".into()]), exclude: None, ignore: None, + init: None, }) ); assert!(config.pl...
feat: let template specify it is designed to NOT go into a sub-folder (aka. the template always has --init behaviour) By specifying ```toml [template] init = true ``` in `cargo-generate` of a template (or for a favorite in the global config), the template will always behave as if the user specified `--init` o...
2022-07-03T19:44:07Z
0.15
2022-07-05T17:27:35Z
9bdf3ab592e2431309929ff57d7a525a4182a8cf
[ "project_variables::tests::default_for_string_with_no_choices_and_matching_regex", "project_variables::tests::default_for_string_only_accepts_strings", "config::tests::config_try_from_handles_empty", "config::tests::test_deserializes_config", "config::tests::locate_configs_returns_empty_upon_failure", "co...
[]
[]
[]
auto_2025-06-12
cargo-generate/cargo-generate
677
cargo-generate__cargo-generate-677
[ "635" ]
1098c62c7f86956ba0c09be314533eaabf9822d5
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ # Changelog ## [Unreleased](https://github.com/cargo-generate/cargo-generate/compare/v0.15.2...HEAD) - ### ✨ Features +- [Set default VCS in the favorite or template config](https://github.com/cargo-generate/cargo-genera...
diff --git a/src/config.rs b/src/config.rs --- a/src/config.rs +++ b/src/config.rs @@ -184,6 +187,7 @@ mod tests { include: Some(vec!["Cargo.toml".into()]), exclude: None, ignore: None, + vcs: None, init: None, }) )...
Feature request: Set default VCS from within templates It would be nice if it was possible to make templates default to a different or no VCS initialisation. In my case this would be useful for a "minimal" template meant for messing around inside. Could also be useful for templates which are meant to be a smaller part ...
Hey, for rhai scripts there are pre and post hook scripts. A post hook script should provide what you need. I tested with a post hook script. It prints before the VCS initialisation, and cannot delete the vcs folder since it doesn't exist yet. Ok, I think that is probably a bug or a debatable issue of the post hooks. ...
2022-07-03T15:41:24Z
0.15
2022-07-05T18:31:25Z
9bdf3ab592e2431309929ff57d7a525a4182a8cf
[ "config::tests::config_try_from_handles_empty", "config::tests::config_try_from_errors_on_invalid_keys", "config::tests::config_try_from_handles_placeholders", "git::utils::should_canonicalize", "project_variables::tests::boolean_cant_have_choices", "project_variables::tests::block_invalid_key_names", "...
[]
[]
[]
auto_2025-06-12
cargo-generate/cargo-generate
671
cargo-generate__cargo-generate-671
[ "647" ]
d95b96ddbec990289327ba9ba6ee0a0d51685ece
diff --git a/src/app_config.rs b/src/app_config.rs --- a/src/app_config.rs +++ b/src/app_config.rs @@ -29,6 +29,7 @@ pub struct FavoriteConfig { pub description: Option<String>, pub git: Option<String>, pub branch: Option<String>, + pub tag: Option<String>, pub subfolder: Option<String>, pub...
diff --git a/tests/integration/git.rs b/tests/integration/git.rs --- a/tests/integration/git.rs +++ b/tests/integration/git.rs @@ -32,6 +32,29 @@ fn it_allows_a_git_branch_to_be_specified() { .contains("foobar-project")); } +#[test] +fn it_allows_a_git_tag_to_be_specified() { + let template = tmp_dir().i...
feat: support `--tag` in addition to `--branch` It's really difficult right now to expand a specific tagged version of a template. We really should allow to use tagged versions!
2022-06-27T17:40:01Z
0.15
2022-07-04T21:52:43Z
9bdf3ab592e2431309929ff57d7a525a4182a8cf
[ "config::tests::config_try_from_handles_empty", "config::tests::config_try_from_errors_on_invalid_keys", "config::tests::config_try_from_handles_placeholders", "project_variables::tests::block_invalid_key_names", "git::utils::should_canonicalize", "project_variables::tests::boolean_cant_have_choices", "...
[]
[]
[]
auto_2025-06-12
cargo-generate/cargo-generate
372
cargo-generate__cargo-generate-372
[ "325" ]
4daf0d95d5238250edbcb4a596b1c85ae25faec7
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -199,6 +199,7 @@ dependencies = [ "cargo", "console", "dialoguer", + "dirs", "git2", "heck", "home", diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -482,6 +483,26 @@ dependencies = [ "generic-array", ] ...
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -79,6 +79,12 @@ jobs: run: | git config --global user.email "you@example.com" git config --global user.name "Your Name" + - name: Install SSH ...
Git SSH URL Support The [Github Docs](https://docs.github.com/en/enterprise-server@3.0/github/getting-started-with-github/about-remote-repositories#about-remote-repositories) specify that a remote repository URL must have one of the following forms - https://[hostname]/user/repo.git - git@[hostname]:user/repo.git ...
this also slightly relates to #302. It might be possible to implement the https and ssh/git urls with [RepoBuilder](https://docs.rs/git2/0.13.17/git2/build/struct.RepoBuilder.html) and in the best case both issues are solved. @SkamDart your contributions are appreciated.
2021-07-13T14:17:48Z
0.6
2021-07-13T16:14:07Z
4daf0d95d5238250edbcb4a596b1c85ae25faec7
[ "config::tests::config_try_from_handles_empty", "config::tests::config_try_from_errors_on_invalid_keys", "git::tests::should_fail_for_non_existing_local_path", "git::tests::should_support_a_local_relative_path", "git::tests::should_support_a_local_absolute_path", "project_variables::tests::block_invalid_k...
[]
[]
[]
auto_2025-06-12
rust-lang/cc-rs
1,212
rust-lang__cc-rs-1212
[ "1211" ]
92a5e28c084aefc101d2f71f236614d9fcaa1f9e
diff --git a/src/lib.rs b/src/lib.rs --- a/src/lib.rs +++ b/src/lib.rs @@ -1983,6 +1983,7 @@ impl Build { if self.pic.unwrap_or( !target.contains("windows") && !target.contains("-none-") + && !target.ends_with("-none") ...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -269,6 +269,20 @@ fn gnu_x86_64_no_plt() { test.cmd(0).must_have("-fno-plt"); } +#[test] +fn gnu_aarch64_none_no_pic() { + for target in &["aarch64-unknown-none-gnu", "aarch64-unknown-none"] { + let test = Test::gnu(...
Target strings that end in -none (such as aarch64-unknown-none) should not default to -fPIC According to the [docs](https://docs.rs/cc/latest/cc/struct.Build.html#method.pic) > This [pic] option defaults to false for windows-gnu and bare metal targets and to true for all other targets. This means the bare metal targe...
2024-09-17T21:22:26Z
1.1
2024-09-18T06:52:02Z
1d566d4287c428491d8037a561ae195c1bfc6f7a
[ "gnu_aarch64_none_no_pic" ]
[ "tests::test_android_clang_compiler_uses_target_arg_internally", "main", "gnu_no_warnings_if_cflags", "gnu_test_parse_shell_escaped_flags", "gnu_no_warnings_if_cxxflags", "msvc_no_dash_dash", "msvc_debug", "clang_android", "msvc_smoke", "msvc_static_crt", "msvc_std_c", "msvc_opt_level_0", "m...
[]
[]
auto_2025-06-12
rust-lang/cc-rs
1,181
rust-lang__cc-rs-1181
[ "847" ]
eb3390615747fde57f7098797b2acb1aec80f539
diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,7 @@ rust-version = "1.63" [dependencies] jobserver = { version = "0.1.30", default-features = false, optional = true } +shlex = "1.3.0" [target.'cfg(unix)'.dependencies] # Don't turn on the feature "std" for this, see https://g...
diff --git /dev/null b/tests/cflags_shell_escaped.rs new file mode 100644 --- /dev/null +++ b/tests/cflags_shell_escaped.rs @@ -0,0 +1,24 @@ +mod support; + +use crate::support::Test; +use std::env; + +/// This test is in its own module because it modifies the environment and would affect other tests +/// when run in p...
Encoded `CFLAGS` for supporting spaces According to https://github.com/rust-lang/cc-rs/#external-configuration-via-environment-variables spaces nor escapes for spaces are not supported in e.g. `C(XX)FLAGS`. In [`xbuild`](https://github.com/rust-mobile/xbuild) we [use `CFLAGS` to set a `--sysroot` path](https://github.c...
While that might be possible to address in cc-rs, it still seems likely to break in other build systems, such as invocations of make, which don't have a solution to this problem. @joshtriplett does `cc` forward to other build systems or only expand these flags into `argv` before invoking the compiler (which _should_ be...
2024-08-12T01:19:17Z
1.1
2024-08-14T08:41:29Z
1d566d4287c428491d8037a561ae195c1bfc6f7a
[ "gnu_test_parse_shell_escaped_flags" ]
[ "tests::test_android_clang_compiler_uses_target_arg_internally", "main", "gnu_no_warnings_if_cflags", "gnu_no_warnings_if_cxxflags", "msvc_static_crt", "msvc_define", "msvc_debug", "msvc_include", "clang_android", "msvc_std_c", "msvc_no_dash_dash", "msvc_smoke", "msvc_no_static_crt", "msvc...
[]
[]
auto_2025-06-12
rust-lang/cc-rs
1,279
rust-lang__cc-rs-1279
[ "1254" ]
4f312e3f3b2b4623e84518582a3ff17bbae70906
diff --git a/src/lib.rs b/src/lib.rs --- a/src/lib.rs +++ b/src/lib.rs @@ -261,6 +261,9 @@ mod tempfile; mod utilities; use utilities::*; +mod flags; +use flags::*; + #[derive(Debug, Eq, PartialEq, Hash)] struct CompilerFlag { compiler: Box<Path>, diff --git a/src/lib.rs b/src/lib.rs --- a/src/lib.rs +++ b/s...
diff --git /dev/null b/src/flags.rs new file mode 100644 --- /dev/null +++ b/src/flags.rs @@ -0,0 +1,482 @@ +use crate::target::TargetInfo; +use crate::{Build, Error, ErrorKind, ToolFamily}; +use std::borrow::Cow; +use std::ffi::OsString; +use std::path::Path; + +#[derive(Debug, PartialEq, Default)] +pub(crate) struct ...
Mechanism for automatically passing flags used by rustc When cc-rs is running in a build script, it currently does not check which flags were passed to rustc. There are some flags which in order to be fully effective need to be passed to both rustc and cc, a good example being AArch64 branch protection - if the Rust c...
Thanks, we definitely want more data to be fetcher from cargoz Can you provide more details on what rustc/cargo flags it is? The specific case I'm coming at this with is `-Z branch-protection`, e.g. `-Z branch-protection=pac-ret,bti`. The corresponding cc flag would be `-mbranch-protection=pac-ret+bti`. I imagine this...
2024-11-07T17:09:12Z
1.2
2024-11-27T23:25:48Z
29d6ca194cca33f96071355764da436e21c34d12
[ "inherits_rustflags" ]
[ "target::llvm::tests::test_basic_llvm_triple_guessing", "target::tests::cannot_parse_extra", "target::tests::tier1", "tests::test_android_clang_compiler_uses_target_arg_internally", "main", "gnu_no_warnings_if_cflags", "gnu_test_parse_shell_escaped_flags", "gnu_no_warnings_if_cxxflags", "compile_int...
[]
[]
auto_2025-06-12
rust-lang/cc-rs
227
rust-lang__cc-rs-227
[ "224" ]
88ac58e25c673adbf30fec17efd67011c105b44a
diff --git a/src/lib.rs b/src/lib.rs --- a/src/lib.rs +++ b/src/lib.rs @@ -240,8 +240,8 @@ impl Config { /// .define("BAZ", None) /// .compile("foo"); /// ``` - pub fn define(&mut self, var: &str, val: Option<&str>) -> &mut Config { - self.definitions.push((var.to_string...
diff --git a/gcc-test/build.rs b/gcc-test/build.rs --- a/gcc-test/build.rs +++ b/gcc-test/build.rs @@ -14,7 +14,7 @@ fn main() { .flag_if_supported("-Wall") .flag_if_supported("-Wfoo-bar-this-flag-does-not-exist") .define("FOO", None) - .define("BAR", Some("1")) + .define("BAR",...
Accept Into<Option<&str>> rather than Option<&str> in Config methods There are currently three Config methods that take Option\<&str\>. It seems like they are commonly going to be called with Some string. ```rust define("FOO", Some("BAR")) ``` Into\<Option\<&str\>\> could make the calls look neater. ```rust ...
👍
2017-08-08T03:54:40Z
0.3
2017-08-09T23:16:44Z
5cbb921bb6e9f26c5025adebab2e157fc293fd4a
[ "asm_here", "foo_here", "bar_here", "baz_here", "opt_linkage", "main", "msvc_opt_level_0", "msvc_static_crt", "msvc_debug", "msvc_define", "msvc_include", "gnu_include", "msvc_no_static_crt", "gnu_shared", "gnu_opt_level_s", "gnu_opt_level_1", "gnu_smoke", "msvc_smoke", "gnu_set_...
[]
[]
[]
auto_2025-06-12
rust-lang/cc-rs
167
rust-lang__cc-rs-167
[ "165" ]
0f6c1424aec4994cb6736226b400e88f56fd829e
diff --git a/src/lib.rs b/src/lib.rs --- a/src/lib.rs +++ b/src/lib.rs @@ -92,6 +92,8 @@ pub struct Config { cargo_metadata: bool, pic: Option<bool>, static_crt: Option<bool>, + shared_flag: Option<bool>, + static_flag: Option<bool>, } /// Configuration used to represent an invocation of a C co...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -169,6 +169,34 @@ fn gnu_compile_assembly() { test.cmd(0).must_have("foo.S"); } +#[test] +fn gnu_shared() { + let test = Test::gnu(); + test.gcc() + .file("foo.c") + .shared_flag(true) + .static_flag...
musl: hardcoded `-static` causes issues with library objects Capturing an issue first reported at https://github.com/briansmith/ring/issues/544 It looks like https://github.com/alexcrichton/gcc-rs/commit/f308ef2121a812c07718e15e689cbb1c90778513 introduced an hardcoded `-static` flag for musl-gcc invocation. This se...
Would be good to fix! It seems like an application of something like `-fpic` would help here? I'm not really privvy to a number of the details here. `-fPIC` would help, but as shown in the initial ticket it is not enough. `ring` already passes it as part of its custom build.rs logic, but the the static flag is still ca...
2017-06-08T09:38:44Z
0.3
2017-06-14T07:24:38Z
5cbb921bb6e9f26c5025adebab2e157fc293fd4a
[ "main", "msvc_debug", "msvc_include", "gnu_compile_assembly", "msvc_opt_level_0", "msvc_static_crt", "gnu_include", "gnu_opt_level_1", "msvc_define", "msvc_smoke", "gnu_opt_level_s", "gnu_debug", "msvc_no_static_crt", "gnu_set_stdlib", "gnu_smoke", "gnu_define", "gnu_x86_64", "gnu_...
[]
[]
[]
auto_2025-06-12
rust-lang/cc-rs
226
rust-lang__cc-rs-226
[ "189" ]
5824f286a3547badb18962965ac9d1d0a8a1a4d4
diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Next up, you'll want to write a build script like so: extern crate gcc; fn main() { - gcc::Config::new() + gcc::Build::new() .file("foo.c") .file("bar.c") .compile("foo"); diff --git a/README.md b/R...
diff --git a/gcc-test/build.rs b/gcc-test/build.rs --- a/gcc-test/build.rs +++ b/gcc-test/build.rs @@ -9,7 +9,7 @@ fn main() { fs::remove_dir_all(&out).unwrap(); fs::create_dir(&out).unwrap(); - gcc::Config::new() + gcc::Build::new() .file("src/foo.c") .flag_if_supported("-Wall") ...
Rename `Config` type This is not all that descriptive a name, though we're not sure what a better name is. I suggest `Builder`. If nothing better comes up, pick that and we'll bikeshed it on the PR. cc @alexcrichton @sfackler @dtolnay @kimundi @burntsushi bikeshedding.
+1 for `Builder` I am not a fan of `Builder` because it makes me expect a `build()` method that gives me back some object that I used it to build. Some alternatives to explore: - `gcc::Orchestrator`⸻https://en.wikipedia.org/wiki/Orchestration_(computing) - `gcc::Invocation`⸻like Clang's `clang::CompilerInvocatio...
2017-08-08T03:35:08Z
0.3
2017-08-10T01:03:54Z
5cbb921bb6e9f26c5025adebab2e157fc293fd4a
[ "asm_here", "bar_here", "baz_here", "foo_here", "opt_linkage", "main", "msvc_smoke", "msvc_static_crt", "gnu_opt_level_s", "msvc_no_static_crt", "msvc_include", "gnu_static", "msvc_debug", "gnu_smoke", "msvc_opt_level_0", "msvc_define", "gnu_warnings_into_errors", "gnu_shared", "...
[]
[]
[]
auto_2025-06-12
rust-lang/cc-rs
991
rust-lang__cc-rs-991
[ "990" ]
915420c16c134e6bb458ce634c663305a0ef2504
diff --git a/src/lib.rs b/src/lib.rs --- a/src/lib.rs +++ b/src/lib.rs @@ -1894,7 +1894,10 @@ impl Build { // Target flags match cmd.family { ToolFamily::Clang => { - if !(target.contains("android") && cmd.has_internal_target_arg) { + if !cmd.has_internal_tar...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -617,3 +617,33 @@ fn compile_intermediates() { assert!(intermediates[1].display().to_string().contains("x86_64")); assert!(intermediates[2].display().to_string().contains("x86_64")); } + +#[test] +fn clang_android() { + ...
1.0.88 breaks the Rust compile-ui tests for arm-android When trying to update cc-rs to 1.0.88 in the Rust repo, we hit an error with the compile-ui test for arm-android: <https://github.com/rust-lang/rust/pull/121854#issuecomment-1973518078> ``` 2024-03-01T16:42:03.5816834Z ---- [ui] tests/ui/thread-local/tls.rs std...
2024-03-04T20:08:43Z
1.0
2024-03-06T23:22:00Z
2a0bf2b0234a538f96a064bde2b50e6677b27c9c
[ "clang_android" ]
[ "test_android_clang_compiler_uses_target_arg_internally", "main", "gnu_no_warnings_if_cflags", "gnu_no_warnings_if_cxxflags", "msvc_include", "msvc_debug", "msvc_opt_level_0", "msvc_no_static_crt", "msvc_no_dash_dash", "msvc_smoke", "msvc_define", "gnu_x86_64_no_plt", "msvc_static_crt", "m...
[]
[]
auto_2025-06-12
rust-lang/cc-rs
914
rust-lang__cc-rs-914
[ "912" ]
f17047de579adbe1c3a562b87cf9c0376a8e66cc
diff --git a/src/lib.rs b/src/lib.rs --- a/src/lib.rs +++ b/src/lib.rs @@ -1131,48 +1131,7 @@ impl Build { }; let dst = self.get_out_dir()?; - let mut objects = Vec::new(); - for file in self.files.iter() { - let obj = if file.has_root() || file.components().any(|x| x == Com...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -24,7 +24,8 @@ fn gnu_smoke() { .must_have("-c") .must_have("-ffunction-sections") .must_have("-fdata-sections"); - test.cmd(1).must_have(test.td.path().join("foo.o")); + test.cmd(1) + .must_hav...
Expose function compile to an object file Currently, rustc's bootstrap uses `cc` to generate object file by asking it to generate a `.a` archive, discard the archive, and "guessing" where the temporary object files are to use them. Things like [this](https://github.com/rust-lang/rust/blob/c5208518faa423b96e6d1fecaa6428...
I think you'd want a different name. > I wonder if cc would accept a PR adding a public Build::compile_objects() function that would return a Vec<Path> of all the object files? Yes, we would. I don't have strong feelings about the name.
2024-01-02T18:41:31Z
1.0
2024-01-24T23:00:51Z
2a0bf2b0234a538f96a064bde2b50e6677b27c9c
[ "test_android_clang_compiler_uses_target_arg_internally", "main", "gnu_no_warnings_if_cflags", "gnu_no_warnings_if_cxxflags", "msvc_no_dash_dash", "msvc_debug", "msvc_include", "msvc_define", "msvc_opt_level_0", "msvc_no_static_crt", "msvc_smoke", "msvc_static_crt", "msvc_std_c", "gnu_debu...
[]
[]
[]
auto_2025-06-12
rcoh/angle-grinder
67
rcoh__angle-grinder-67
[ "66" ]
b264366cb68b0f649486d70b8522b43bb3392865
diff --git a/src/lib.rs b/src/lib.rs --- a/src/lib.rs +++ b/src/lib.rs @@ -243,7 +243,10 @@ pub mod pipeline { // Drop tx when causes the thread to exit. drop(tx); - t.join().unwrap(); + match t.join() { + Ok(_) => (), + Err(e) => println!(...
diff --git a/tests/integration.rs b/tests/integration.rs --- a/tests/integration.rs +++ b/tests/integration.rs @@ -101,6 +101,11 @@ mod integration { structured_test(include_str!("structured_tests/total_agg.toml")); } + #[test] + fn fields_after_agg_bug() { + structured_test(include_str!("s...
fields after count causes panic ```sudo lsof -i -P | grep '(LISTEN)' | agrind '* | parse ":* (" as port | count by port | fields port'``` leads to a panic. Probably a bug in the pre-aggregate adapter.
2019-03-12T05:32:19Z
0.9
2019-03-12T06:12:05Z
b264366cb68b0f649486d70b8522b43bb3392865
[ "integration::fields_after_agg_bug" ]
[ "data::tests::agg", "data::tests::from_string", "data::tests::ordering", "lang::tests::parse_parses", "lang::tests::query_operators", "lang::tests::parse_quoted_string", "lang::tests::query_no_operators", "data::tests::record_put_get", "lang::tests::parse_percentile", "lang::tests::parse_var_list"...
[]
[]
auto_2025-05-31
rcoh/angle-grinder
37
rcoh__angle-grinder-37
[ "30" ]
c3a24bd096813cb9d2fe2c051ec01024182e1134
diff --git a/README.md b/README.md --- a/README.md +++ b/README.md @@ -181,6 +181,13 @@ Count number of source_hosts: * | json | count by endpoint_url, status_code | sort by endpoint_url desc ``` +##### Total +`total(a)`: Compute the running total of a given field +*Examples*: +```agrind +* | json | total(num_reque...
diff --git a/src/data.rs b/src/data.rs --- a/src/data.rs +++ b/src/data.rs @@ -205,15 +211,13 @@ mod tests { let agg = Aggregate::new( &["kc1".to_string(), "kc2".to_string()], "count".to_string(), - &[ - ( - hashmap!{ - ...
Support a "running total" operator (Like `accum`) in SumoLogic. Requested by @tallpsmith
2018-12-26T22:15:53Z
0.7
2018-12-26T22:42:23Z
c3a24bd096813cb9d2fe2c051ec01024182e1134
[ "lang::tests::parse_expr_ident", "lang::tests::parse_expr", "lang::tests::query_no_operators", "lang::tests::parse_operator", "data::tests::ordering", "lang::tests::parse_keyword_string", "lang::tests::parse_expr_value", "data::tests::panic_on_invalid_row", "data::tests::record_put_get", "operator...
[]
[]
[]
auto_2025-05-31
rcoh/angle-grinder
191
rcoh__angle-grinder-191
[ "189" ]
27c2c38eceae75a194c7d5587201ea7cad023613
diff --git a/src/lib.rs b/src/lib.rs --- a/src/lib.rs +++ b/src/lib.rs @@ -283,8 +283,8 @@ pub mod pipeline { if ct == 0 { break; } - let data = std::str::from_utf8(&line[..ct]).unwrap(); - if self.filter.matches(data) + ...
diff --git /dev/null b/test_files/binary_data.bin new file mode 100644 --- /dev/null +++ b/test_files/binary_data.bin @@ -0,0 +1,3 @@ +line of regular text k=v2 +�K���@�V ���+P��Q�Þ�0����S��oU�!+��X-!����޴A�� �r��[�OC��j_kΕ����V����5; �x1rYuV��� +line of regular text k=v diff --git a/tests/integration.rs b...
Crash while parsing syslog for netfilter logs I got the attached crash while trying to parse netfilter (iptables) logs from `/var/log/syslog`. Full command and output below. Crash report (renamed to .txt. because GitHub won't permit .toml files as attachments): [report-79c5d249-00d8-4ad4-bfbe-29b534be5307.txt](https...
FWIW, I get the same crash if I `cat /var/log/syslog | ./agrind ....` instead of making ag read it using `-f` argument. Using `grep kernel: /var/log/syslog | ./agrind '* | parse ....` does NOT crash. I'm guessing some kind of weird character in one of the log lines that ag isn't handling nicely. Hopefully the crash ...
2023-05-19T18:56:53Z
0.19
2023-05-19T19:16:10Z
fca19ae150d804e2b8998e21f074401a5c508eca
[ "lang::tests::parse_parses" ]
[ "data::tests::record_put_get", "data::tests::from_string", "data::tests::record_ordering_matching_prefix", "data::tests::arithmetic", "data::tests::record_ordering", "data::tests::agg", "data::tests::render_duration", "data::tests::panic_on_invalid_row - should panic", "data::tests::test_aggresively...
[]
[]
auto_2025-05-31
rcoh/angle-grinder
8
rcoh__angle-grinder-8
[ "4" ]
b33c72ef9aedb4c2744b030290ecb5d29694245a
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,7 @@ name = "ag" version = "0.3.3" dependencies = [ + "assert_cli 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "clap 2.30.0 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.7.6 (registry+htt...
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -295,14 +552,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] "checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa8...
Support outputs that aren't a TTY `ag '....' > some_file`
2018-03-18T02:11:42Z
0.3
2018-03-18T02:23:43Z
176dc55e0ec8e02507cdb6c6520844ccb0809638
[ "render::tests::test_pretty_print_record_too_long", "data::tests::test_agg", "lang::tests::test_var_list", "lang::tests::test_quoted_string", "lang::tests::test_query_operators", "lang::tests::test_operator", "lang::tests::test_query_no_operators", "render::tests::test_pretty_print_record", "lang::t...
[]
[]
[]
auto_2025-05-31
rcoh/angle-grinder
104
rcoh__angle-grinder-104
[ "101" ]
8df4ddecc440ba995b1b6b31a44ec589938cd6b0
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -12,6 +12,7 @@ dependencies = [ "annotate-snippets 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "assert_cli 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)", "atty 0.2.14 (registry+https://github.com/rust-la...
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -39,6 +40,7 @@ dependencies = [ "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "structopt 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)", "terminal_size 0.1.12 (registry+https://github.com/rust-lang...
Support parsing tabs It would be useful to be able to parse tabs. For example, I have logs like: ``` [WARNING]2020-01-01T00:00:00.000Z 1e4cd606-a550-4d41-b013-f61a4a3d959d init_attendance no students user='kennimrod' /aws/lambda/function-4TPZE69CJ8X7 2020/01/01/[$LATEST]e75d9ab689c4457da0a79316cf624c...
Did you try putting a literal tab in the pattern? I agree this is needed either way though I didn't try that because it is not easy to put a literal tab here, I forgot to think about using edit mode to add a literal tab.
2020-06-13T14:55:04Z
0.13
2020-06-13T15:47:14Z
8df4ddecc440ba995b1b6b31a44ec589938cd6b0
[ "data::tests::agg", "data::tests::from_string", "data::tests::record_ordering", "data::tests::record_put_get", "data::tests::record_ordering_matching_prefix", "data::tests::test_aggresively_to_num", "errors::tests::did_you_mean", "filter::tests::filter_wildcard", "data::tests::value_ordering", "la...
[]
[]
[]
auto_2025-05-31
rcoh/angle-grinder
77
rcoh__angle-grinder-77
[ "76" ]
764599d7932ec195be6ad1247923aa52ec99eb05
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -41,6 +41,7 @@ dependencies = [ "serde 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.82 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.33 (registry+https://github.com/rust-lang...
diff --git a/src/render.rs b/src/render.rs --- a/src/render.rs +++ b/src/render.rs @@ -328,6 +343,7 @@ mod tests { floating_points: 2, min_buffer: 1, max_buffer: 4, + format: None, }, None, ); diff --git a/src/render.rs...
More control over human-formatted output I'd like to use agrind to transform structured log output into something that's easy to read while tailing some logs Currently agrind's human-formatted output looks something like ``` [id=ConsumerFetcherManager-1382721708341][level=info][module=kafka.consumer.ConsumerFetche...
This seems related to #71 but with a different goal.
2019-07-23T22:00:33Z
0.10
2019-07-25T15:12:45Z
764599d7932ec195be6ad1247923aa52ec99eb05
[ "data::tests::agg", "data::tests::from_string", "data::tests::record_ordering", "data::tests::value_ordering", "data::tests::record_ordering_matching_prefix", "data::tests::panic_on_invalid_row", "lang::tests::parse_percentile", "lang::tests::parse_ident", "lang::tests::parse_expr", "errors::tests...
[]
[]
[]
auto_2025-05-31
rcoh/angle-grinder
75
rcoh__angle-grinder-75
[ "74" ]
4c67c65113ddb7d3975a94e5bbfe71b19ac74abb
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -26,6 +26,7 @@ dependencies = [ "im 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates...
diff --git a/src/lang.rs b/src/lang.rs --- a/src/lang.rs +++ b/src/lang.rs @@ -939,6 +950,15 @@ mod tests { value: InlineOperator::Json { input_column: None } }) ); + expect!( + operator, + " logfmt", + Operator::Inline(Positioned { + ...
Support logfmt input https://www.brandur.org/logfmt describes the logfmt input, which is supported by a variety of platforms and logging libraries. I'd like to consume them with angle-grinder.
2019-07-02T21:36:36Z
0.10
2019-07-08T18:28:50Z
764599d7932ec195be6ad1247923aa52ec99eb05
[ "data::tests::from_string", "data::tests::record_ordering_matching_prefix", "data::tests::record_ordering", "data::tests::agg", "data::tests::record_put_get", "data::tests::value_ordering", "data::tests::panic_on_invalid_row", "filter::tests::filter_wildcard", "errors::tests::did_you_mean", "lang:...
[]
[]
[]
auto_2025-05-31
rcoh/angle-grinder
139
rcoh__angle-grinder-139
[ "138" ]
6bd07f2b35ac68b3a0fe5960a465b3ea07ad7f26
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -2,18 +2,18 @@ # It is not intended for manual editing. [[package]] name = "addr2line" -version = "0.14.1" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55f82cfe485775d02112886f4169bde0c589...
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -170,9 +172,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.4.0" +version = "3.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b58...
ag Crash Report Hello there! I'm trying ag to explore some logs, thanks for this tool <3. It had a problem and crashed so here I am reporting it. Generated report file content: ```toml name = 'ag' operating_system = 'unix:Unknown' crate_version = '0.16.0' explanation = ''' Panic occurred in file '/rustc/d...
thanks! Looks like this line is wrong: https://github.com/rcoh/angle-grinder/blob/main/src/operator/split.rs#L25 it needs to account for the width of the codepoint
2021-05-17T00:20:12Z
0.16
2021-05-17T00:35:21Z
6bd07f2b35ac68b3a0fe5960a465b3ea07ad7f26
[ "data::tests::arithmetic", "data::tests::panic_on_invalid_row", "data::tests::record_ordering", "funcs::tests::substring_of_num", "lang::tests::parse_expr", "funcs::tests::int_length", "filter::tests::filter_wildcard", "data::tests::test_aggresively_to_num", "data::tests::value_ordering", "funcs::...
[]
[]
[]
auto_2025-05-31
starkware-libs/cairo
3,132
starkware-libs__cairo-3132
[ "3130" ]
5c98cf17854f2bec359077daa610a72453f04b7f
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -603,6 +603,7 @@ dependencies = [ "env_logger", "indoc", "itertools", + "num-bigint", "salsa", "serde_json", "smol_str", diff --git a/crates/cairo-lang-plugins/Cargo.toml b/crates/cairo-lang-plugins/Cargo.toml --- a/crates/cairo-lang-...
diff --git a/crates/cairo-lang-plugins/src/lib.rs b/crates/cairo-lang-plugins/src/lib.rs --- a/crates/cairo-lang-plugins/src/lib.rs +++ b/crates/cairo-lang-plugins/src/lib.rs @@ -13,6 +15,7 @@ mod test; /// Gets the list of default plugins to load into the Cairo compiler. pub fn get_default_plugins() -> Vec<Arc<dyn S...
feat: compile-time arithmetic for constants # Feature Request **Describe the Feature Request** The Cairo compiler should be able to calculate the compile-time value of constants, to make it easier to write such constants, e.g.: ``` const some_value = (256 * 1080) & 0xfaff + 1234; // should become 14336 const s...
2023-05-12T09:12:14Z
1.3
2023-06-13T14:38:53Z
2dca6e26696859c0e70910023110500d6bc2671b
[ "test::expand_plugin::config", "test::expand_plugin::derive", "test::expand_plugin::panicable", "test::expand_plugin::generate_trait" ]
[]
[]
[]
auto_2025-06-10
starkware-libs/cairo
5,683
starkware-libs__cairo-5683
[ "5680" ]
576ddd1b38abe25af1e204cb77ea039b7c46d05e
diff --git a/crates/cairo-lang-semantic/src/expr/compute.rs b/crates/cairo-lang-semantic/src/expr/compute.rs --- a/crates/cairo-lang-semantic/src/expr/compute.rs +++ b/crates/cairo-lang-semantic/src/expr/compute.rs @@ -1773,7 +1773,7 @@ fn maybe_compute_tuple_like_pattern_semantic( unexpected_pattern: fn(TypeId) -...
diff --git a/crates/cairo-lang-semantic/src/expr/compute.rs b/crates/cairo-lang-semantic/src/expr/compute.rs --- a/crates/cairo-lang-semantic/src/expr/compute.rs +++ b/crates/cairo-lang-semantic/src/expr/compute.rs @@ -2279,30 +2279,13 @@ fn member_access_expr( // Find MemberId. let member_name = expr_as_id...
bug: weak inference on simple type # Bug Report **Cairo version:** On commit `8d6b690cb1401e682a0aba7bcda3b40f00482572`. **Current behavior:** The inference of very simple types seems to not be supported anymore, at least on `LegacyMap` that we had into the storage. It this expected as `LegacyMap` should be...
2024-05-29T16:31:46Z
2.6
2024-06-10T16:00:00Z
a767ed09cf460ba70c689abc2cfd18c0a581fc6c
[ "diagnostic::test::test_missing_module_file", "diagnostic::test::test_inline_module_diagnostics", "resolve::test::test_resolve_path_super", "diagnostic::test::test_analyzer_diagnostics", "items::extern_type::test::test_extern_type", "items::extern_function::test::test_extern_function", "expr::test::test...
[]
[]
[]
auto_2025-06-10
starkware-libs/cairo
5,539
starkware-libs__cairo-5539
[ "5524" ]
2b8bd3da33176c38e92e660d8c94f8b6df05f0b1
diff --git a/crates/cairo-lang-lowering/src/graph_algorithms/feedback_set.rs b/crates/cairo-lang-lowering/src/graph_algorithms/feedback_set.rs --- a/crates/cairo-lang-lowering/src/graph_algorithms/feedback_set.rs +++ b/crates/cairo-lang-lowering/src/graph_algorithms/feedback_set.rs @@ -41,7 +41,7 @@ pub fn priv_functio...
diff --git a/crates/cairo-lang-utils/src/graph_algos/feedback_set.rs b/crates/cairo-lang-utils/src/graph_algos/feedback_set.rs --- a/crates/cairo-lang-utils/src/graph_algos/feedback_set.rs +++ b/crates/cairo-lang-utils/src/graph_algos/feedback_set.rs @@ -19,45 +21,55 @@ mod feedback_set_test; /// Context for the fee...
bug: gas computation / unexpected cycle in computation issue with recursive type definition # Bug Report **Cairo version:** At least on `2.5.4` and `2.6.3` **Current behavior:** For the Dojo project, we use the following types to define the layout of our data that will be stored in a dedicated smart contrac...
Tell me if you need more explanation, context or whatever ! Thank you for the report! managed to minimally recreate an example now as well. For your specific usecase you can even reorder your function definitions - and your code would fully compile. will be taking care of it soon.
2024-05-09T18:35:22Z
2.6
2024-05-20T04:05:02Z
a767ed09cf460ba70c689abc2cfd18c0a581fc6c
[ "bigint::test::serde::test_bigint_serde::zero", "bigint::test::serde::test_bigint_serde::negative", "bigint::test::serde::test_bigint_serde::positive", "bigint::test::parity_scale_codec::encode_bigint", "collection_arithmetics::test::test_add_map_and_sub_map", "graph_algos::feedback_set::feedback_set_test...
[]
[]
[]
auto_2025-06-10
starkware-libs/cairo
4,777
starkware-libs__cairo-4777
[ "4744" ]
75f779e8553d28e4bfff3b23f140ccc781c9dab0
diff --git a/crates/cairo-lang-sierra-generator/src/store_variables/known_stack.rs b/crates/cairo-lang-sierra-generator/src/store_variables/known_stack.rs --- a/crates/cairo-lang-sierra-generator/src/store_variables/known_stack.rs +++ b/crates/cairo-lang-sierra-generator/src/store_variables/known_stack.rs @@ -70,9 +70,...
diff --git a/crates/cairo-lang-sierra-generator/src/store_variables/test.rs b/crates/cairo-lang-sierra-generator/src/store_variables/test.rs --- a/crates/cairo-lang-sierra-generator/src/store_variables/test.rs +++ b/crates/cairo-lang-sierra-generator/src/store_variables/test.rs @@ -207,6 +207,11 @@ fn get_lib_func_sign...
bug: One of the arguments does not satisfy the requirements of the libfunc. # Bug Report **Cairo version: 2.3.0-rc0** <!-- Please specify commit or tag version. --> **Current behavior:** ```cairo fn g(ref v: Felt252Vec<u64>, a: usize, b: usize, c: usize, d: usize, x: u64, y: u64) { let mut v_a = v[a];...
I suggested a temporary workaround as you suggested to me last time @orizi, which is ```rust #[inline(never)] fn no_op() {} fn g(ref v: Felt252Vec<u64>, a: usize, b: usize, c: usize, d: usize, x: u64, y: u64) { let mut v_a = v[a]; let mut v_b = v[b]; let mut v_c = v[c]; let mut v_d = v[d];...
2024-01-10T09:30:48Z
2.4
2024-01-15T08:20:26Z
75f779e8553d28e4bfff3b23f140ccc781c9dab0
[ "store_variables::test::push_values_with_hole" ]
[ "store_variables::known_stack::test::merge_stacks", "resolve_labels::test::test_resolve_labels", "canonical_id_replacer::test::test_replacer", "store_variables::test::consecutive_push_values", "store_variables::test::push_values_temp_not_on_top", "store_variables::test::push_values_optimization", "store...
[]
[]
auto_2025-06-10
starkware-libs/cairo
4,391
starkware-libs__cairo-4391
[ "4375" ]
45f9bc8ad931e1568ad3704efa49419a99572e2a
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -1065,7 +1066,7 @@ dependencies = [ "serde_json", "sha2", "sha3", - "starknet-crypto", + "starknet-crypto 0.5.2", "thiserror-no-std", ] diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -2884,6 +2885,26 @@ depen...
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -708,6 +708,7 @@ dependencies = [ "num-bigint", "num-integer", "num-traits 0.2.17", + "starknet-crypto 0.6.1", "test-case", "thiserror", ] diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -105,6 +105,7 @@ serde...
bug: CASM runner assigns arbitrary contract addresses instead of using correct address computation # Bug Report **Cairo version:** 2.3.1 <!-- Please specify commit or tag version. --> **Current behavior:** Currently, the casm runner assigns arbitrary addresses to contracts deployed using `deploy_syscall`, incr...
If these are the specifications - feel free to open a PR. Make sure to include a test. @orizi am I allowed to use the `calculate_contract_address` function from the `starknet_api` crate? Or do you not want dependencies external to the compiler? In any case, I need access to pedersen hash which is available in `starkne...
2023-11-10T08:51:39Z
2.3
2023-11-19T18:53:57Z
02b6ce71cf1d0ca226ba615ce363d71eb2340df4
[ "casm_run::test::test_as_cairo_short_string_ex", "casm_run::test::test_as_cairo_short_string", "casm_run::test::test_runner::jumps", "casm_run::test::test_format_for_debug", "casm_run::test::test_allocate_segment", "casm_run::test::test_runner::divmod_hint", "casm_run::test::test_runner::fib_1_1_13_", ...
[]
[]
[]
auto_2025-06-10
starkware-libs/cairo
6,317
starkware-libs__cairo-6317
[ "6080" ]
d22835b5494e976dbff7b967f3027cc04a7a04a6
diff --git a/crates/cairo-lang-defs/src/db.rs b/crates/cairo-lang-defs/src/db.rs --- a/crates/cairo-lang-defs/src/db.rs +++ b/crates/cairo-lang-defs/src/db.rs @@ -114,6 +114,9 @@ pub trait DefsGroup: /// i.e. a type marked with this attribute is considered a phantom type. fn declared_phantom_type_attributes(&...
diff --git a/Cargo.lock b/Cargo.lock --- a/Cargo.lock +++ b/Cargo.lock @@ -580,14 +580,19 @@ dependencies = [ name = "cairo-lang-doc" version = "2.8.2" dependencies = [ + "anyhow", "cairo-lang-defs", + "cairo-lang-filesystem", "cairo-lang-formatter", "cairo-lang-parser", + "cairo-lang-semantic", "cairo-lang-...
Implement `//!` comments Add support for `//!` comments that are handled analogously to Rust ones. Follow implementation of `///` comments.
Hey @mkaput I'll like to take up this issue. Can you provide more context to this issue? like where can I find the implementation of `///` this is trivially greppable https://github.com/starkware-libs/cairo/blob/e60c298fd7a10c4e40a63a066f25e972417a6847/crates/cairo-lang-doc/src/db.rs#L25 you will need to test...
2024-08-30T08:46:14Z
2.8
2024-09-09T12:47:54Z
47fe5bf462ab3a388f2c03535846a8c3a7873337
[ "markdown::test::fenced_code_blocks" ]
[]
[]
[]
auto_2025-06-10
starkware-libs/cairo
4,909
starkware-libs__cairo-4909
[ "4897" ]
7e0dceb788114a0f7e201801a03c034b52c19679
diff --git a/crates/cairo-lang-plugins/src/plugins/config.rs b/crates/cairo-lang-plugins/src/plugins/config.rs --- a/crates/cairo-lang-plugins/src/plugins/config.rs +++ b/crates/cairo-lang-plugins/src/plugins/config.rs @@ -9,7 +9,7 @@ use cairo_lang_syntax::attribute::structured::{ Attribute, AttributeArg, Attribu...
diff --git a/crates/cairo-lang-starknet/src/plugin/starknet_module/contract.rs b/crates/cairo-lang-starknet/src/plugin/starknet_module/contract.rs --- a/crates/cairo-lang-starknet/src/plugin/starknet_module/contract.rs +++ b/crates/cairo-lang-starknet/src/plugin/starknet_module/contract.rs @@ -302,12 +310,13 @@ pub(sup...
bug: code annotated with cfg(test) included in build # Bug Report **Cairo version:** 2.5.0 (was fine in 2.2.0) **Current behavior:** Contract that includes implementation annotated with `#[cfg(test)]` doesn't compile. Works fine when running `scarb test` **Related code:** Code example: ``` #[cfg...
2024-01-24T18:05:48Z
2.5
2024-02-04T08:34:08Z
600553d34a1af93ff7fb038ac677efdd3fd07010
[ "contract::test::test_starknet_keccak", "allowed_libfuncs::test::all_list_includes_all_supported", "allowed_libfuncs::test::libfunc_lists_include_only_supported_libfuncs", "contract_class::test::test_serialization", "felt252_serde::test::test_long_ids", "felt252_serde::test::test_libfunc_serde", "casm_c...
[]
[]
[]
auto_2025-06-10
starkware-libs/cairo
6,649
starkware-libs__cairo-6649
[ "6540" ]
47fe5bf462ab3a388f2c03535846a8c3a7873337
diff --git a/crates/cairo-lang-language-server/src/ide/hover/render/definition.rs b/crates/cairo-lang-language-server/src/ide/hover/render/definition.rs --- a/crates/cairo-lang-language-server/src/ide/hover/render/definition.rs +++ b/crates/cairo-lang-language-server/src/ide/hover/render/definition.rs @@ -32,6 +32,17 @...
diff --git a/crates/cairo-lang-language-server/tests/e2e/hover.rs b/crates/cairo-lang-language-server/tests/e2e/hover.rs --- a/crates/cairo-lang-language-server/tests/e2e/hover.rs +++ b/crates/cairo-lang-language-server/tests/e2e/hover.rs @@ -17,7 +17,8 @@ cairo_lang_test_utils::test_file_test!( partial: "part...
LS: Incorrect hovers for path segments Path segments in import statements don't have hovers by themselves ![Image](https://github.com/user-attachments/assets/f0cdd5ff-380b-42f6-b882-1efc7200ed04) However, when they appear in e.g. function call context, they inherit hover of the called function: ![Image](https://github...
2024-11-13T11:29:13Z
2.8
2024-11-18T11:15:41Z
47fe5bf462ab3a388f2c03535846a8c3a7873337
[ "hover::hover::basic", "hover::hover::paths" ]
[ "lang::diagnostics::trigger::test::test_drop_receiver", "lang::diagnostics::trigger::test::test_sync", "project::project_manifest_path::project_manifest_path_test::discover_cairo_project_toml", "project::project_manifest_path::project_manifest_path_test::discover_no_manifest", "lang::lsp::ls_proto_group::te...
[]
[]
auto_2025-06-10
starkware-libs/cairo
6,632
starkware-libs__cairo-6632
[ "6537" ]
893838229215c21471d2e9deacab7a37bc13f02b
diff --git a/crates/cairo-lang-language-server/src/lang/inspect/defs.rs b/crates/cairo-lang-language-server/src/lang/inspect/defs.rs --- a/crates/cairo-lang-language-server/src/lang/inspect/defs.rs +++ b/crates/cairo-lang-language-server/src/lang/inspect/defs.rs @@ -3,7 +3,7 @@ use std::iter; use cairo_lang_defs::db::...
diff --git a/crates/cairo-lang-language-server/tests/e2e/hover.rs b/crates/cairo-lang-language-server/tests/e2e/hover.rs --- a/crates/cairo-lang-language-server/tests/e2e/hover.rs +++ b/crates/cairo-lang-language-server/tests/e2e/hover.rs @@ -17,6 +17,7 @@ cairo_lang_test_utils::test_file_test!( partial: "part...
LS: Incorrect hover when used on member of struct llteral ![image](https://github.com/user-attachments/assets/1bac8b92-2c3e-4604-836d-89e37dc5bd75) ![image](https://github.com/user-attachments/assets/cafb3270-80ce-46bf-bfcc-968cd4b0851a) But not always ![image](https://github.com/user-attachments/assets/ddc3e628...
2024-11-12T10:49:03Z
2.8
2024-11-18T09:44:11Z
47fe5bf462ab3a388f2c03535846a8c3a7873337
[ "hover::hover::structs", "hover::hover::basic" ]
[ "lang::diagnostics::trigger::test::test_drop_receiver", "lang::diagnostics::trigger::test::test_sync", "lang::lsp::ls_proto_group::test::file_url", "project::project_manifest_path::project_manifest_path_test::discover_no_manifest", "project::project_manifest_path::project_manifest_path_test::discover_cairo_...
[]
[]
auto_2025-06-10
starkware-libs/cairo
2,289
starkware-libs__cairo-2289
[ "1672" ]
8f433e752a78afc017d0f08c9e21b966acfe1c11
diff --git a/crates/cairo-lang-parser/src/colored_printer.rs b/crates/cairo-lang-parser/src/colored_printer.rs --- a/crates/cairo-lang-parser/src/colored_printer.rs +++ b/crates/cairo-lang-parser/src/colored_printer.rs @@ -50,6 +50,7 @@ pub fn is_empty_kind(kind: SyntaxKind) -> bool { | SyntaxKind::OptionT...
diff --git a/crates/cairo-lang-parser/src/parser_test.rs b/crates/cairo-lang-parser/src/parser_test.rs --- a/crates/cairo-lang-parser/src/parser_test.rs +++ b/crates/cairo-lang-parser/src/parser_test.rs @@ -62,14 +62,30 @@ const TEST_test2_tree_with_trivia: ParserTreeTestParams = ParserTreeTestParams { print_color...
dev: generics type syntax contains turbofish ``` fn main() -> Option::<felt> { fib(1, 1, 13) } /// Calculates fib... fn fib(a: felt, b: felt, n: felt) -> Option::<felt> { get_gas()?; match n { 0 => Option::<felt>::Some(a), _ => fib(b, a + b, n - 1), } } ``` I hate to bik...
If anyone wants to contribute in this matter, it would be helpful:) Would love to contribute to this, if no one picked it up yet. Am a bit new to this so will be a bit slow when working on this, so if its urgent then I'll leave it to someone else. Sure, you are more than welcome. Not urgent at all. The main issue r...
2023-02-26T20:22:22Z
1.3
2023-02-28T15:48:46Z
2dca6e26696859c0e70910023110500d6bc2671b
[ "parser::test::partial_parser_tree_with_trivia::path", "parser::test::parse_and_compare_tree::test3_tree_no_trivia", "parser::test::parse_and_compare_tree::test3_tree_with_trivia", "parser::test::parse_and_compare_tree::test1_tree_no_trivia", "parser::test::parse_and_compare_tree::test1_tree_with_trivia" ]
[ "lexer::test::test_bad_character", "lexer::test::test_cases", "lexer::test::test_lex_single_token", "db::db_test::test_parser", "parser::test::diagnostic::fn_", "parser::test::diagnostic::pattern", "parser::test::diagnostic::semicolon", "parser::test::diagnostic::module_diagnostics", "parser::test::...
[]
[]
auto_2025-06-10
starkware-libs/cairo
3,264
starkware-libs__cairo-3264
[ "3211" ]
fecc9dc533ba78bb333d8f444d86ad9dd9b61e82
diff --git a/crates/cairo-lang-lowering/src/optimizations/match_optimizer.rs b/crates/cairo-lang-lowering/src/optimizations/match_optimizer.rs --- a/crates/cairo-lang-lowering/src/optimizations/match_optimizer.rs +++ b/crates/cairo-lang-lowering/src/optimizations/match_optimizer.rs @@ -22,6 +23,7 @@ pub fn optimize_mat...
diff --git a/crates/cairo-lang-lowering/src/optimizations/match_optimizer.rs b/crates/cairo-lang-lowering/src/optimizations/match_optimizer.rs --- a/crates/cairo-lang-lowering/src/optimizations/match_optimizer.rs +++ b/crates/cairo-lang-lowering/src/optimizations/match_optimizer.rs @@ -2,13 +2,14 @@ #[path = "match_op...
bug: Multiple jumps to arm blocks are not allowed. # Bug Report **Cairo version:** bcebb2e3 <!-- Please specify commit or tag version. --> **Current behavior:** The compiler panics when trying to compile and run this test: ```rust impl U256TryIntoU64 of TryInto<u256, u64> { #[inline(always)] ...
this is definitely a bug - it also happens when we inline the code "by hand" .
2023-05-30T08:30:01Z
1.3
2023-06-28T05:25:25Z
2dca6e26696859c0e70910023110500d6bc2671b
[ "optimizations::match_optimizer::test::match_optimizer::arm_pattern_destructure", "test::lowering::implicits", "optimizations::match_optimizer::test::match_optimizer::option" ]
[ "test::lowering_phases::tests", "test::lowering::rebindings", "test::lowering::assignment", "test::lowering::tuple", "test::lowering::enums", "test::lowering::error_propagate", "test::lowering::constant", "optimizations::delay_var_def::test::delay_var_def::move_literals", "lower::usage::test::inlini...
[]
[]
auto_2025-06-10
bincode-org/bincode
261
bincode-org__bincode-261
[ "250" ]
0c519bb19dffc5ded3b04525070c0afeb38fdbc3
diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -11,6 +11,7 @@ documentation = "https://docs.rs/bincode" readme = "./readme.md" categories = ["network-programming"] keywords = ["binary", "encode", "decode", "serialize", "deserialize"] +build = "build.rs" license = "MIT" description = "A...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -72,7 +72,7 @@ fn test_numbers() { the_same(5f64); } -#[cfg(feature = "i128")] +#[cfg(has_i128)] #[test] fn test_numbers_128bit() { // unsigned positive
Make `i128` support automatic To revisit #236, it would be more convenient for users if `i128` support was enabled automatically on compatible compilers. We [already argued in July](https://github.com/rust-random/rand/pull/571) that this was the best option for Rand. The linked PR shows how this can be achieved with...
Since build scripts cannot enable features, this would actually require that @BurntSushi's [byteorder](https://github.com/BurntSushi/byteorder) also use auto-detection, and then that `bincode` depend on the new version of `byteorder`. I agree it would be nice to have auto detection here. It looks like `i128` wasn't sta...
2019-01-28T10:43:19Z
1.0
2019-01-28T17:07:59Z
f33abb21b45ff20b63be2a5ab134fce0d6d86d59
[ "test_numbers_128bit" ]
[ "char_serialization", "endian_difference", "bytes", "encode_box", "path_buf", "deserializing_errors", "not_human_readable", "serde_bytes", "test_basic_struct", "test_bool", "test_big_endian_deserialize_seed", "test_cow_serialize", "test_multi_strings_serialize", "test_enum", "test_defaul...
[]
[]
auto_2025-06-08
bincode-org/bincode
217
bincode-org__bincode-217
[ "215" ]
882224363716621d4c9bbbbcc4bde8b4f7e1ba68
diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -18,8 +18,9 @@ description = "A binary serialization / deserialization strategy that uses Serde [dependencies] byteorder = "1.0.0" -serde = "1.*.*" +serde = "1.0.16" [dev-dependencies] serde_bytes = "0.10.*" -serde_derive = "1.*.*" +serde...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -457,3 +457,12 @@ fn test_zero_copy_parse() { assert_eq!(out, f); } } + +#[test] +fn not_human_readable() { + use std::net::Ipv4Addr; + let ip = Ipv4Addr::new(1, 2, 3, 4); + the_same(ip); + assert_eq!(&ip.oc...
Set is_human_readable to false I have not released this yet but I will in the next few days. https://github.com/serde-rs/serde/pull/1044 ```rust trait Serializer { /* ... */ fn is_human_readable(&self) -> bool { true } } trait Deserializer<'de> { /* ... */ fn is_human_readable(&self) -> ...
2017-11-02T10:16:55Z
0.9
2017-11-20T17:56:37Z
882224363716621d4c9bbbbcc4bde8b4f7e1ba68
[ "not_human_readable" ]
[ "bytes", "encode_box", "char_serialization", "endian_difference", "path_buf", "deserializing_errors", "serde_bytes", "test_bool", "test_basic_struct", "test_enum", "test_cow_serialize", "test_multi_strings_serialize", "test_map", "test_fixed_size_array", "test_nested_struct", "test_num...
[]
[]
auto_2025-06-08
bincode-org/bincode
212
bincode-org__bincode-212
[ "177" ]
8f7501431d9fd22424ef3ef206d87953780e0501
diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ name = "bincode" version = "0.8.1" authors = ["Ty Overby <ty@pre-alpha.com>", "Francesco Mazzoli <f@mazzo.li>", "David Tolnay <dtolnay@gmail.com>", "Daniel Griffen"] +# Adding ErrorKind::Invalid*Encoding is a breaking change # A...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -195,25 +195,32 @@ fn test_fixed_size_array() { #[test] fn deserializing_errors() { - fn isize_invalid_deserialize<T: Debug>(res: Result<T>) { - match res.map_err(|e| *e) { - Err(ErrorKind::InvalidEncoding{..}...
InvalidEncoding representation It looks like this is used for a very limited set of situations. It should be possible to represent them in a nicer way than `{ desc: &'static str, detail: Option<String> }`. ```rust InvalidEncoding { desc: "string was not valid utf8", detail: None, } InvalidEncoding { ...
2017-10-12T15:48:34Z
0.8
2020-03-17T16:21:14Z
8f7501431d9fd22424ef3ef206d87953780e0501
[ "bytes", "char_serialization", "encode_box", "deserializing_errors", "endian_difference", "path_buf", "serde_bytes", "test_bool", "test_basic_struct", "test_cow_serialize", "test_multi_strings_serialize", "test_enum", "test_map", "test_nested_struct", "test_option", "test_proxy_encoded...
[]
[]
[]
auto_2025-06-08
bincode-org/bincode
475
bincode-org__bincode-475
[ "474" ]
f33abb21b45ff20b63be2a5ab134fce0d6d86d59
diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -45,6 +45,8 @@ serde_json = "1.0.68" tempfile = "3.2.0" criterion = "0.3" rand = "0.8" +uuid = { version = "0.8", features = ["serde"] } +chrono = { version = "0.4", features = ["serde"] } [[bench]] name = "varint" diff --git a/src...
diff --git a/tests/issues.rs b/tests/issues.rs --- a/tests/issues.rs +++ b/tests/issues.rs @@ -11,3 +11,6 @@ mod issue_467; #[path = "issues/issue_459.rs"] mod issue_459; + +#[path = "issues/issue_474.rs"] +mod issue_474; diff --git /dev/null b/tests/issues/issue_474.rs new file mode 100644 --- /dev/null +++ b/test...
CannotBorrowOwnedData on decode_from_slice for some types that implement Serialize/Deserialize - bincode::serde Thanks for the excellent work on bincode. I'm currently testing a simple memory based cache for a system I'm writing. In various places I'm calling `serde::encode_to_vec` and `serde::decode_from_slice`. I'm r...
2022-01-17T13:30:05Z
1.0
2022-01-17T16:16:17Z
f33abb21b45ff20b63be2a5ab134fce0d6d86d59
[ "varint::decode_unsigned::test_decode_u32", "varint::decode_unsigned::test_decode_u16", "varint::decode_unsigned::test_decode_u128", "varint::decode_unsigned::test_decode_u64", "varint::encode_signed::test_encode_i128", "varint::encode_signed::test_encode_i16", "varint::encode_signed::test_encode_i32", ...
[]
[]
[]
auto_2025-06-08
bincode-org/bincode
470
bincode-org__bincode-470
[ "467" ]
6d386492d5b51712c6a4dfe901c1665c9bef6bfc
diff --git a/derive/src/derive_enum.rs b/derive/src/derive_enum.rs --- a/derive/src/derive_enum.rs +++ b/derive/src/derive_enum.rs @@ -201,7 +201,7 @@ impl DeriveEnum { }) .generate_fn("decode") .with_generic("D", ["bincode::de::Decoder"]) - .with_arg("mut decoder", "D"...
diff --git a/tests/alloc.rs b/tests/alloc.rs --- a/tests/alloc.rs +++ b/tests/alloc.rs @@ -30,11 +30,11 @@ impl bincode::enc::Encode for Foo { impl bincode::Decode for Foo { fn decode<D: bincode::de::Decoder>( - mut decoder: D, + decoder: &mut D, ) -> Result<Self, bincode::error::DecodeError>...
recursive struct gives: overflow evaluating the requirement SliceReader: Sized ```rust use std::collections::BTreeMap; #[derive(bincode::Decode)] struct AllTypes(BTreeMap<u8, AllTypes>); fn main() { let result: Result<(AllTypes, _), _> = bincode::decode_from_slice( &[], bincode::config::C...
2022-01-10T18:31:18Z
1.0
2022-01-11T19:23:49Z
f33abb21b45ff20b63be2a5ab134fce0d6d86d59
[ "varint::decode_unsigned::test_decode_u128", "varint::decode_unsigned::test_decode_u16", "varint::decode_unsigned::test_decode_u32", "varint::encode_signed::test_encode_i128", "varint::decode_unsigned::test_decode_u64", "varint::encode_signed::test_encode_i16", "varint::encode_signed::test_encode_i32", ...
[]
[]
[]
auto_2025-06-08
bincode-org/bincode
198
bincode-org__bincode-198
[ "193" ]
131b2b213dedc34bea0edc98298770eb4eb0c74a
diff --git a/src/config/legacy.rs b/src/config/legacy.rs --- a/src/config/legacy.rs +++ b/src/config/legacy.rs @@ -49,6 +49,7 @@ macro_rules! config_map { (Unlimited, Little) => { let $opts = DefaultOptions::new() .with_fixint_encoding() + .allow_tra...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -277,6 +277,17 @@ fn deserializing_errors() { } } +#[test] +fn trailing_bytes() { + match DefaultOptions::new() + .deserialize::<char>(b"1x") + .map_err(|e| *e) + { + Err(ErrorKind::Custom(_)) => {} ...
Reject trailing bytes when deserializing from &[u8] In `deserialize_from`, it makes sense to allow deserializing multiple values from the same io::Read. But in `deserialize`, I think trailing data should be an error. I would expect this to be an error rather than ignoring `b"x"`: ```rust extern crate bincode; ...
@dtolnay Is this issue in response to my question: https://github.com/TyOverby/bincode/issues/192 ? Does it mean that multiple serialised messages (differing by trailing bytes) can deserialise to the same content? https://github.com/TyOverby/bincode/issues/192#issuecomment-313660286 gives a workaround to detect trai...
2017-07-24T00:07:44Z
1.2
2020-05-26T19:40:05Z
263fb948aca86d3ac5dfa5bc4f345b44ed8bb8f8
[ "trailing_bytes" ]
[ "config::int::test::test_zigzag_edge_cases", "config::int::test::test_zigzag_decode", "config::int::test::test_zigzag_encode", "char_serialization", "bytes", "deserializing_errors", "endian_difference", "path_buf", "encode_box", "not_human_readable", "serde_bytes", "test_basic_struct", "test...
[]
[]
auto_2025-06-08
bincode-org/bincode
434
bincode-org__bincode-434
[ "433" ]
a2e7e0e3fc7b838dae9df3b6c358acb2725f5f52
diff --git a/derive/src/derive_enum.rs b/derive/src/derive_enum.rs --- a/derive/src/derive_enum.rs +++ b/derive/src/derive_enum.rs @@ -1,5 +1,5 @@ use crate::generate::{FnSelfArg, Generator, StreamBuilder}; -use crate::parse::{EnumVariant, Fields}; +use crate::parse::{EnumVariant, FieldAttribute, Fields}; use crate::...
diff --git a/derive/src/parse/attributes.rs b/derive/src/parse/attributes.rs --- a/derive/src/parse/attributes.rs +++ b/derive/src/parse/attributes.rs @@ -44,6 +78,27 @@ impl Attribute { } Ok(result) } + + fn parse_bincode_attribute( + loc: AttributeLocation, + stream: &mut Peeka...
Figure out bincode Decode/Encode interop with serde Currently bincode 2 only allows either `Decode/Encode`, or serde's traits. It would be nice to have a way to use serde types while using `Decode/Encode` Some ideas: - Add an `#[serde_interop]` attribute to `bincode_derive` - Add a `WithSerde<T>` that implements `...
2021-11-08T12:40:52Z
1.0
2021-11-09T09:08:50Z
f33abb21b45ff20b63be2a5ab134fce0d6d86d59
[ "parse::body::test_enum_body_take", "parse::visibility::test_visibility_try_take", "parse::attributes::test_attributes_try_take", "parse::body::test_struct_body_take", "parse::generics::test_generics_try_take", "parse::generics::test_lifetime_take", "parse::generics::test_generic_constraints_try_take", ...
[]
[]
[]
auto_2025-06-08
bincode-org/bincode
336
bincode-org__bincode-336
[ "335" ]
f5fa06e761646ba083c1317a4ba0dcd58eefe99b
diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bincode" -version = "1.3.0" # remember to update html_root_url +version = "1.3.1" # remember to update html_root_url authors = ["Ty Overby <ty@pre-alpha.com>", "Francesco Mazzoli <f@mazzo.li>", "David Tolnay <dto...
diff --git a/src/de/read.rs b/src/de/read.rs --- a/src/de/read.rs +++ b/src/de/read.rs @@ -185,3 +180,23 @@ where visitor.visit_bytes(&self.temp_buffer[..]) } } + +#[cfg(test)] +mod test { + use super::IoReader; + + #[test] + fn test_fill_buffer() { + let buffer = vec![0u8; 64]; + ...
Regression in 1.3.0: memory allocation of 8391155392347897856 bytes failed Can be reproduced by adding the following test to the bottom of src/lib.rs in https://github.com/sharkdp/bat/tree/b09d245dea7e2f45cf461fda978f3256e7162465 and running `cargo update` and `cargo test --lib bincode_repro`. It succeeds with bincode ...
The regression seems to start with https://github.com/servo/bincode/pull/309. I'm uncertain, but it seems like [`fill_buffer`](https://github.com/servo/bincode/blob/f5fa06e761646ba083c1317a4ba0dcd58eefe99b/src/de/read.rs#L143-L154) was written to assume that it will only add at most `length` bytes to the buffer. Howev...
2020-06-24T05:33:27Z
1.3
2020-06-24T06:42:46Z
f5fa06e761646ba083c1317a4ba0dcd58eefe99b
[ "de::read::test::test_fill_buffer" ]
[ "config::int::test::test_zigzag_edge_cases", "config::int::test::test_zigzag_decode", "config::int::test::test_zigzag_encode", "bytes", "char_serialization", "endian_difference", "deserializing_errors", "encode_box", "path_buf", "serde_bytes", "not_human_readable", "test_basic_struct", "test...
[]
[]
auto_2025-06-08
ast-grep/ast-grep
1,086
ast-grep__ast-grep-1086
[ "1070" ]
02f2467d37d85cdb58f0cd0ca3426ca494724975
diff --git a/crates/config/src/fixer.rs b/crates/config/src/fixer.rs --- a/crates/config/src/fixer.rs +++ b/crates/config/src/fixer.rs @@ -8,7 +8,7 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use thiserror::Error; -use std::collections::HashMap; +use std::collections::{HashMap, HashSet}; use ...
diff --git a/crates/config/src/rule_core.rs b/crates/config/src/rule_core.rs --- a/crates/config/src/rule_core.rs +++ b/crates/config/src/rule_core.rs @@ -416,4 +429,56 @@ transform: ["A", "B", "C", "D", "E"].into_iter().collect() ); } + + fn get_undefined(src: &str) -> (String, &str) { + let env = D...
report undefined meta-var in fix
2024-04-23T04:47:18Z
0.20
2024-04-23T05:40:39Z
02f2467d37d85cdb58f0cd0ca3426ca494724975
[ "rule_core::test::test_undefined_vars_in_fix", "match_tree::test::test_ellipsis_end", "match_tree::test::test_match_end", "match_tree::test::test_leading_ellipsis", "match_tree::test::test_meta_var_named", "match_tree::test::test_match_inner", "match_tree::test::test_simple_match", "match_tree::test::...
[ "fixer::test::test_parse", "maybe::test::test_de_correct_err", "fixer::test::test_parse_str", "maybe::test::test_from_optio", "fixer::test::test_deserialize_object", "maybe::test::test_de_correct_ok", "maybe::test::test_de_wrong_err", "maybe::test::test_unwrap_absent - should panic", "rule::deserial...
[]
[]
auto_2025-06-05
ast-grep/ast-grep
1,560
ast-grep__ast-grep-1560
[ "1557" ]
d9014f979fd7ee34cd9f449449a32f25296c34f4
diff --git a/crates/cli/src/config.rs b/crates/cli/src/config.rs --- a/crates/cli/src/config.rs +++ b/crates/cli/src/config.rs @@ -90,9 +90,9 @@ impl ProjectConfig { read_directory_yaml(self, global_rules, rule_overwrite) } // do not report error if no sgconfig.yml is found - pub fn setup(config_path: Optio...
diff --git a/crates/cli/src/config.rs b/crates/cli/src/config.rs --- a/crates/cli/src/config.rs +++ b/crates/cli/src/config.rs @@ -102,7 +102,7 @@ impl ProjectConfig { }; // sg_config will not use rule dirs and test configs anymore register_custom_language(&config.project_dir, sg_config)?; - Ok(Some(c...
[refactor] unify configuration discovery for different subcommands probably by a new global arg --config
2024-10-28T03:30:11Z
0.28
2024-10-28T04:42:20Z
d9014f979fd7ee34cd9f449449a32f25296c34f4
[ "lang::test::test_sg_lang_size", "lang::lang_globs::test::test_parse_globs", "lang::custom_lang::test::test_custom_lang", "lang::injection::test::test_deserialize", "lang::injection::test::test_bad_inject", "print::colored_print::test::test_empty_printer", "print::cloud_print::test::test_hint_output", ...
[]
[]
[]
auto_2025-06-05
ast-grep/ast-grep
1,558
ast-grep__ast-grep-1558
[ "1557" ]
cfe472f63c7011ef5635ca38fea4846c871a1177
diff --git a/crates/cli/src/config.rs b/crates/cli/src/config.rs --- a/crates/cli/src/config.rs +++ b/crates/cli/src/config.rs @@ -60,12 +60,6 @@ pub struct ProjectConfig { } impl ProjectConfig { - pub fn by_config_path_must(config_path: Option<PathBuf>) -> Result<Self> { - Self::discover_project(config_path, N...
diff --git a/crates/cli/src/lib.rs b/crates/cli/src/lib.rs --- a/crates/cli/src/lib.rs +++ b/crates/cli/src/lib.rs @@ -88,7 +88,6 @@ pub fn main_with_args(args: impl Iterator<Item = String>) -> Result<()> { } let app = App::try_parse_from(args)?; - // TODO: add test for app parse match app.command { Co...
[refactor] unify configuration discovery for different subcommands probably by a new global arg --config
2024-10-26T23:30:34Z
0.28
2024-10-27T00:34:04Z
d9014f979fd7ee34cd9f449449a32f25296c34f4
[ "lang::test::test_sg_lang_size", "lang::custom_lang::test::test_custom_lang", "lang::lang_globs::test::test_parse_globs", "lang::lang_globs::test::test_invalid_language", "lang::injection::test::test_bad_inject", "lang::injection::test::test_deserialize", "print::colored_print::test::test_empty_printer"...
[]
[]
[]
auto_2025-06-05
ast-grep/ast-grep
1,323
ast-grep__ast-grep-1323
[ "1310" ]
0e06966f429f44340a0599f2ca5c3b0f8957bed6
diff --git a/crates/cli/src/scan.rs b/crates/cli/src/scan.rs --- a/crates/cli/src/scan.rs +++ b/crates/cli/src/scan.rs @@ -128,7 +128,7 @@ impl<P: Printer> Worker for ScanWithConfig<P> { for (path, grep, hit_set) in items { let file_content = grep.source().to_string(); let path = &path; - let ru...
diff --git a/crates/cli/src/run.rs b/crates/cli/src/run.rs --- a/crates/cli/src/run.rs +++ b/crates/cli/src/run.rs @@ -383,6 +383,16 @@ mod test { assert!(run_with_pattern(arg).is_ok()) } + #[test] + fn test_run_with_strictness() { + let arg = RunArg { + pattern: "console.log".to_string(), + st...
support report injected language issue in `scan`
2024-07-14T00:02:39Z
0.24
2024-07-14T06:05:31Z
0e06966f429f44340a0599f2ca5c3b0f8957bed6
[ "test_sg_scan_html" ]
[ "error::test::test_display_error", "error::test::test_bare_anyhow", "error::test::test_display_warning", "lang::lang_globs::test::test_parse_globs", "lang::test::test_sg_lang_size", "lang::lang_globs::test::test_invalid_language", "lang::custom_lang::test::test_custom_lang", "print::colored_print::tes...
[]
[]
auto_2025-06-05
ast-grep/ast-grep
1,707
ast-grep__ast-grep-1707
[ "1624" ]
1c68280bfb9fd2614cab19b4cda47d2bf6570626
diff --git a/crates/cli/src/scan.rs b/crates/cli/src/scan.rs --- a/crates/cli/src/scan.rs +++ b/crates/cli/src/scan.rs @@ -146,23 +146,16 @@ impl<P: Printer> Worker for ScanWithConfig<P> { let file_content = grep.source().to_string(); let path = &path; let rules = self.configs.get_rule_from_lang(pa...
diff --git a/crates/config/src/combined.rs b/crates/config/src/combined.rs --- a/crates/config/src/combined.rs +++ b/crates/config/src/combined.rs @@ -272,10 +321,10 @@ language: Tsx", let pre = scan.find(&root); assert_eq!(pre.suppressions.0.len(), 4); let scanned = scan.scan(&root, pre, false); - le...
[feature] Combining `--error=unused-suppression` and `--update-all` should remove unused suppressions # ⭐ Suggestion <!-- A summary of what you'd like to see added or changed --> When running `ast-grep scan --update-all --error=unused-suppression`, unused suppressions should be automatically removed. # 💻 Use Ca...
2024-12-28T21:23:39Z
0.32
2024-12-29T06:19:54Z
1c68280bfb9fd2614cab19b4cda47d2bf6570626
[ "maybe::test::test_unwrap_absent - should panic", "rule::deserialize_env::test::test_using_global_rule_in_local", "rule::nth_child::test::test_positional", "rule::nth_child::test::test_serialize", "rule::nth_child::test::test_error", "rule::nth_child::test::test_find_index_simple", "rule::range::test::t...
[]
[]
[]
auto_2025-06-05
ast-grep/ast-grep
1,664
ast-grep__ast-grep-1664
[ "1663" ]
bfd4945591b9959ba59309eaa7d2e8f7861f163b
diff --git a/crates/cli/src/print/cloud_print.rs b/crates/cli/src/print/cloud_print.rs --- a/crates/cli/src/print/cloud_print.rs +++ b/crates/cli/src/print/cloud_print.rs @@ -94,8 +94,8 @@ fn print_rule<'a, W: Write + Send + Sync>( let title = &rule.id; let name = path.display(); for m in matches { - let li...
diff --git a/crates/config/src/rule/range.rs b/crates/config/src/rule/range.rs --- a/crates/config/src/rule/range.rs +++ b/crates/config/src/rule/range.rs @@ -102,8 +102,11 @@ mod test { #[test] fn test_invalid_range() { let range = RangeMatcher::<TS>::try_new( - SerializablePosition { row: 0, column: 1...
Inconsistent naming: 'line' vs 'row' in ast-grep node's interface and rule There is an inconsistency between the use of `line` and `row` in the ast-grep node's interface and rule parameters. The node uses `line`, while the rule uses `row`, which may lead to confusion. This inconsistency should be addressed. **Referenc...
2024-12-14T21:19:28Z
0.31
2024-12-14T21:39:10Z
bfd4945591b9959ba59309eaa7d2e8f7861f163b
[ "fixer::test::test_replace_fixer", "check_var::test::test_transform_already_defined", "check_var::test::test_undefined_vars_in_fix", "maybe::test::test_de_wrong_err", "rule::deserialize_env::test::test_local_util_matches", "maybe::test::test_from_optio", "rule::deserialize_env::test::test_local_util_kin...
[]
[]
[]
auto_2025-06-05
ast-grep/ast-grep
1,634
ast-grep__ast-grep-1634
[ "1594" ]
b87dad753fb2ce87cae17d488bac4da3fd62a5a7
diff --git a/crates/core/src/node.rs b/crates/core/src/node.rs --- a/crates/core/src/node.rs +++ b/crates/core/src/node.rs @@ -19,21 +19,25 @@ pub struct Position { row: usize, /// zero-based BYTE offset instead of character offset byte_column: usize, + /// byte offset of this position + byte_offset: usize, ...
diff --git a/crates/core/src/node.rs b/crates/core/src/node.rs --- a/crates/core/src/node.rs +++ b/crates/core/src/node.rs @@ -742,7 +748,6 @@ if (a) { } #[test] - #[ignore = "TODO: fix column to be unicode character"] fn test_unicode_pos() { let root = Tsx.ast_grep("🦀"); let root = root.root(); ...
[bug] ast-grep scan: special characters lead to different end columns ### Please read the FAQ for the bug you encountered. - [X] I have read the existing FAQ ### ⏯ Playground Link https://ast-grep.github.io/playground.html#eyJtb2RlIjoiQ29uZmlnIiwibGFuZyI6ImNwcCIsInF1ZXJ5IjoiY29uc29sZS5sb2coJE1BVENIKSIsInJld3JpdGUiOi...
This is because `ts_node_start_point` returns zero-based byte offset column. Using tree-sitter-json as an example, the test case ```json "Übergänge" ``` returns the `string_content` ending at 12 <img width="502" alt="image" src="https://github.com/user-attachments/assets/fa2625e0-3b47-4eea-a2b9-0e43cea892...
2024-12-01T03:40:21Z
0.30
2024-12-01T04:28:46Z
7316d2fcdbb5859961a23499adbfe72a16bc83a6
[ "match_tree::test::test_ellipsis_end", "match_tree::match_node::test::test_signature_match", "match_tree::match_node::test::test_relaxed_match", "match_tree::match_node::test::test_cst_match", "match_tree::test::test_gh_1087", "match_tree::test::test_leading_ellipsis", "match_tree::test::test_match_end"...
[]
[]
[]
auto_2025-06-05
ast-grep/ast-grep
1,588
ast-grep__ast-grep-1588
[ "1574" ]
ccdc53168d6fbcff91e9ac095a3ef49eb847a410
diff --git a/crates/cli/src/utils/inspect.rs b/crates/cli/src/utils/inspect.rs --- a/crates/cli/src/utils/inspect.rs +++ b/crates/cli/src/utils/inspect.rs @@ -16,12 +16,13 @@ use ast_grep_config::RuleConfig; use anyhow::Result; use clap::ValueEnum; +use std::fmt; use std::io::{Stderr, Write}; use std::path::Path;...
diff --git a/crates/cli/src/utils/inspect.rs b/crates/cli/src/utils/inspect.rs --- a/crates/cli/src/utils/inspect.rs +++ b/crates/cli/src/utils/inspect.rs @@ -186,7 +212,10 @@ mod test { 0 ); assert!(run_trace.print().is_ok()); - assert_eq!(ret, "Files scanned: 0, Files skipped: 0\n"); + assert_e...
[refactor] have a semi-structured tracing output Example ``` sg: summary|file: scannedCount=199 sg: entity|file|src/cli/scan.rs: skippedCount=47 sg: entity|rule|my-rule-id: finalSeverity=off sg: entity|rule|my-rule-id: skipReason=ruleFilter sg: entity|rule|my-rule-id: skipReason=severityOff sg: detail|file*rul...
2024-11-10T02:38:00Z
0.29
2024-11-10T02:48:42Z
ccdc53168d6fbcff91e9ac095a3ef49eb847a410
[ "utils::inspect::test::test_tracing", "test_inspect" ]
[ "lang::test::test_sg_lang_size", "lang::custom_lang::test::test_custom_lang", "lang::lang_globs::test::test_parse_globs", "lang::lang_globs::test::test_invalid_language", "lang::injection::test::test_bad_inject", "lang::injection::test::test_deserialize", "print::colored_print::test::test_empty_printer"...
[]
[]
auto_2025-06-05
async-graphql/async-graphql
1,346
async-graphql__async-graphql-1346
[ "1238" ]
b0e2c7494bf7c8bfdc00692a9cf41f4ca7d5a676
diff --git a/derive/src/args.rs b/derive/src/args.rs --- a/derive/src/args.rs +++ b/derive/src/args.rs @@ -207,6 +207,8 @@ pub struct SimpleObject { pub shareable: bool, #[darling(default)] pub inaccessible: bool, + #[darling(default)] + pub interface_object: bool, #[darling(default, multiple,...
diff --git a/src/registry/export_sdl.rs b/src/registry/export_sdl.rs --- a/src/registry/export_sdl.rs +++ b/src/registry/export_sdl.rs @@ -644,8 +649,8 @@ mod tests { #[test] fn test_compose_directive_dsl() { let expected = r#"extend schema @link( - url: "https://specs.apollo.dev/federation/v2.1", - ...
Support for `@interfaceObject` and `@key` on interfaces ## Description of the feature Add support for `@interfaceObject` and `@key` on interfaces that was added to the federation spec in v2.3. You can read more about this [here](https://github.com/apollographql/federation/issues/2277).
any updates/thoughts on this? cc @sunli829
2023-08-14T18:28:08Z
6.0
2023-08-15T01:51:06Z
d3a4c64b57455f48e7a7b800d5235d258c9540f0
[ "dataloader::tests::test_dataloader_load_empty", "dataloader::tests::test_dataloader_disable_cache", "dataloader::tests::test_dataloader_disable_all_cache", "dataloader::tests::test_duplicate_keys", "dataloader::tests::test_dataloader_with_cache_hashmap_fnv", "dataloader::tests::test_dataloader_with_cache...
[]
[]
[]
auto_2025-06-06
async-graphql/async-graphql
1,228
async-graphql__async-graphql-1228
[ "1223" ]
dc140a55012ab4fd671fc4974f3aed7b0de23c7a
diff --git a/src/dynamic/resolve.rs b/src/dynamic/resolve.rs --- a/src/dynamic/resolve.rs +++ b/src/dynamic/resolve.rs @@ -336,7 +336,13 @@ fn collect_fields<'a>( type_condition.map(|condition| condition.node.on.node.as_str()); let introspection_type_name = &object.name; - ...
diff --git a/src/dynamic/interface.rs b/src/dynamic/interface.rs --- a/src/dynamic/interface.rs +++ b/src/dynamic/interface.rs @@ -389,4 +389,47 @@ mod tests { }] ); } + #[tokio::test] + async fn query_type_condition() { + struct MyObjA; + let obj_a = Object::new("MyObjA")...
dynamic schema: query interface on union not working ## Expected Behavior when we have a union of objects that some of which implements an interface, we should be able to query the union by the interface. In the following example, if the `pet` is queried by the `Named` interface, we expect the `name` field and `__ty...
2023-02-07T09:56:55Z
5.0
2023-02-09T17:25:24Z
dc140a55012ab4fd671fc4974f3aed7b0de23c7a
[ "dynamic::interface::tests::query_type_condition", "dynamic::union::tests::test_query" ]
[ "dataloader::tests::test_dataloader_load_empty", "dataloader::tests::test_dataloader_disable_cache", "dataloader::tests::test_dataloader_disable_all_cache", "dataloader::tests::test_duplicate_keys", "dataloader::tests::test_dataloader_with_cache", "dataloader::tests::test_dataloader_with_cache_hashmap_fnv...
[]
[]
auto_2025-06-06
async-graphql/async-graphql
1,099
async-graphql__async-graphql-1099
[ "1098" ]
49b6fa4f9f3a679a318fb489fe2d017c38b09237
diff --git a/src/http/graphiql_v2_source.rs b/src/http/graphiql_v2_source.rs --- a/src/http/graphiql_v2_source.rs +++ b/src/http/graphiql_v2_source.rs @@ -18,6 +18,7 @@ pub struct GraphiQLSource<'a> { endpoint: &'a str, subscription_endpoint: Option<&'a str>, headers: Option<HashMap<&'a str, &'a str>>, +...
diff --git a/src/http/graphiql_v2_source.rs b/src/http/graphiql_v2_source.rs --- a/src/http/graphiql_v2_source.rs +++ b/src/http/graphiql_v2_source.rs @@ -275,6 +286,7 @@ mod tests { .endpoint("http://localhost:8000") .subscription_endpoint("ws://localhost:8000/ws") .header("Autho...
Ability to change Document Title in GraphiQL v2 and GraphQL Playground ## Description of the feature I would like to be able to change the html document title in the GraphiQL v2 and GraphQL Playground responses. I would like to implement this myself as part of my [Hacktoberfest](https://hacktoberfest.com) contribut...
2022-09-30T14:21:43Z
4.0
2022-10-07T09:05:48Z
49b6fa4f9f3a679a318fb489fe2d017c38b09237
[ "dataloader::tests::test_dataloader_load_empty", "http::graphiql_v2_source::tests::test_with_both_urls", "http::graphiql_v2_source::tests::test_with_all_options", "http::graphiql_v2_source::tests::test_with_only_url", "registry::cache_control::tests::to_value", "dataloader::tests::test_dataloader_disable_...
[]
[]
[]
auto_2025-06-06
async-graphql/async-graphql
1,048
async-graphql__async-graphql-1048
[ "1045" ]
b2acefdf602e91d451ba01730c8a38a8f9d30abc
diff --git a/src/registry/export_sdl.rs b/src/registry/export_sdl.rs --- a/src/registry/export_sdl.rs +++ b/src/registry/export_sdl.rs @@ -367,7 +367,7 @@ impl Registry { write!(sdl, " @tag(name: \"{}\")", tag.replace('"', "\\\"")).ok(); } } - ...
diff --git a/tests/federation.rs b/tests/federation.rs --- a/tests/federation.rs +++ b/tests/federation.rs @@ -536,6 +536,15 @@ pub async fn test_entity_inaccessible() { assert!(schema_sdl.contains("inputFieldInaccessibleA: Int! @inaccessible")); // no trailing spaces assert!(!schema_sdl.contains(" \n"))...
SDL: missing space after input type name before open brace (without annotations) Old is expected, new is actual: ```diff @@ -175,9 +175,9 @@ type DomainConnection { pageInfo: PageInfo! } -input DomainContactInput { - domain: String! - message: String! +input DomainContactInput{ + ...
2022-08-29T20:26:17Z
4.0
2022-08-30T01:33:28Z
49b6fa4f9f3a679a318fb489fe2d017c38b09237
[ "test_entity_tag", "test_entity_inaccessible" ]
[ "dataloader::tests::test_dataloader_load_empty", "http::graphiql_v2_source::tests::test_with_both_urls", "http::graphiql_v2_source::tests::test_with_all_options", "http::graphiql_v2_source::tests::test_with_only_url", "registry::export_sdl::tests::test_escape_string", "dataloader::tests::test_dataloader_d...
[]
[]
auto_2025-06-06
async-graphql/async-graphql
1,043
async-graphql__async-graphql-1043
[ "1037" ]
337279f6c76885e1f792cff50e3e455efd664812
diff --git a/src/registry/export_sdl.rs b/src/registry/export_sdl.rs --- a/src/registry/export_sdl.rs +++ b/src/registry/export_sdl.rs @@ -271,29 +271,29 @@ impl Registry { write!(sdl, "extend ").ok(); } - write!(sdl, "type {} ", name).ok(); + write!...
diff --git a/tests/federation.rs b/tests/federation.rs --- a/tests/federation.rs +++ b/tests/federation.rs @@ -534,6 +534,8 @@ pub async fn test_entity_inaccessible() { assert!(schema_sdl.contains("input MyInputObjInaccessible @inaccessible")); // INPUT_FIELD_DEFINITION assert!(schema_sdl.contains("input...
4.0.10 adds trailing spaces in schema output After upgrading to 4.0.10, the schema output changed to include trailing spaces after input type fields. Would be nice to avoid this (and other unnecessary changes to schema output, ideally).
There is an MR to fix this: https://github.com/async-graphql/async-graphql/pull/1036
2022-08-25T13:37:40Z
4.0
2022-08-29T05:50:02Z
49b6fa4f9f3a679a318fb489fe2d017c38b09237
[ "test_entity_inaccessible", "test_entity_tag" ]
[ "dataloader::tests::test_dataloader_load_empty", "registry::export_sdl::tests::test_escape_string", "dataloader::tests::test_dataloader_disable_cache", "http::playground_source::tests::test_with_setting_can_use_any_json_value", "dataloader::tests::test_dataloader_disable_all_cache", "dataloader::tests::te...
[]
[]
auto_2025-06-06
async-graphql/async-graphql
741
async-graphql__async-graphql-741
[ "740" ]
d2a71377a933eb32f8f3f0e23854638ac52ca927
diff --git a/src/registry/mod.rs b/src/registry/mod.rs --- a/src/registry/mod.rs +++ b/src/registry/mod.rs @@ -922,6 +922,19 @@ impl Registry { traverse_type(ctx, &self.types, &mut visible_types, ty.name()); } + for ty in self.types.values() { + if let MetaType::Interface { pos...
diff --git /dev/null b/tests/interface_exporting.rs new file mode 100644 --- /dev/null +++ b/tests/interface_exporting.rs @@ -0,0 +1,203 @@ +use async_graphql::*; +use serde::Deserialize; + +#[derive(SimpleObject)] +struct ObjectA { + id: i32, + title: String, +} + +#[derive(SimpleObject)] +struct ObjectB { + ...
Interfaces not being exported via schema in Async GraphQL 3.x ## Expected Behavior registering an interface to properly expose it via the __schema API. ## Actual Behavior The interface is not accessible via the __schema API. ## Steps to Reproduce the Problem 1. I have two types that implement an interface `...
2021-12-04T18:40:16Z
3.0
2022-05-31T22:21:25Z
5c4289e442d6e56bcc3239b742e1534800adbe1b
[ "test_interface_exports_interfaces_on_object_type", "test_interface_exports_implicit_interface_type" ]
[ "dataloader::tests::test_dataloader_load_empty", "http::playground_source::tests::test_with_setting_can_use_any_json_value", "request::tests::test_deserialize_request_with_null_variables", "request::tests::test_request", "request::tests::test_batch_request_single", "dataloader::tests::test_dataloader_disa...
[]
[]
auto_2025-06-06
async-graphql/async-graphql
584
async-graphql__async-graphql-584
[ "583" ]
06a5eb298365b741187baec5b7bc6aec0ad3abab
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spe...
diff --git a/src/http/playground_source.rs b/src/http/playground_source.rs --- a/src/http/playground_source.rs +++ b/src/http/playground_source.rs @@ -608,3 +620,30 @@ impl<'a> GraphQLPlaygroundConfig<'a> { self } } + +#[cfg(test)] +mod tests { + use super::*; + use std::collections::BTreeMap; + + ...
Playground settings can only be &str ## Expected Behavior Playground settings should be able to accept any JSON type (although maybe not Object or Array?). ## Actual Behavior [`with_setting`](https://docs.rs/async-graphql/2.9.9/async_graphql/http/struct.GraphQLPlaygroundConfig.html#method.with_setting) can onl...
Good idea,welcome to PR.👏
2021-07-23T08:47:32Z
2.9
2021-07-23T10:30:33Z
06a5eb298365b741187baec5b7bc6aec0ad3abab
[ "dataloader::tests::test_dataloader_load_empty", "request::tests::test_batch_request_single", "request::tests::test_batch_request_batch", "request::tests::test_request", "request::tests::test_deserialize_request_with_null_variables", "response::tests::test_batch_response_batch", "request::tests::test_re...
[]
[]
[]
auto_2025-06-06
async-graphql/async-graphql
574
async-graphql__async-graphql-574
[ "573" ]
c1f651254ec0c92cc632ae86c2ac2060ba8f678d
diff --git a/CHANGELOG.md b/CHANGELOG.md --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - Add binary types to `ConstValue` and `Value`. [#569](https://github.com/async-graphql/async-graphql/issues/569) +- Changed...
diff --git a/src/look_ahead.rs b/src/look_ahead.rs --- a/src/look_ahead.rs +++ b/src/look_ahead.rs @@ -45,34 +48,36 @@ impl<'a> From<SelectionField<'a>> for Lookahead<'a> { fn from(selection_field: SelectionField<'a>) -> Self { Lookahead { fragments: selection_field.fragments, - fi...
Lookahead doesn't allow multiple instances of a subfield I've encountered a limitation to `Lookahead` that I think severely limits their usability, particularly when used in public facing APIs. For internal only APIs you can (sometimes) get around this if aware of the limitations, but I feel it'd be inadvisable to use ...
2021-07-15T01:17:49Z
2.9
2021-07-15T02:00:39Z
06a5eb298365b741187baec5b7bc6aec0ad3abab
[ "dataloader::tests::test_dataloader_load_empty", "request::tests::test_batch_request_batch", "request::tests::test_deserialize_request_with_null_variables", "request::tests::test_batch_request_single", "request::tests::test_request_with_operation_name", "request::tests::test_request", "dataloader::tests...
[]
[]
[]
auto_2025-06-06
async-graphql/async-graphql
562
async-graphql__async-graphql-562
[ "550" ]
f1dd3f380cd374a357908c9c8f11248713da2606
diff --git a/derive/src/complex_object.rs b/derive/src/complex_object.rs --- a/derive/src/complex_object.rs +++ b/derive/src/complex_object.rs @@ -18,7 +18,6 @@ pub fn generate( let crate_name = get_crate_name(object_args.internal); let (self_ty, _) = get_type_path_and_name(item_impl.self_ty.as_ref())?; ...
diff --git a/tests/complex_object.rs b/tests/complex_object.rs --- a/tests/complex_object.rs +++ b/tests/complex_object.rs @@ -1,4 +1,5 @@ use async_graphql::*; +use core::marker::PhantomData; #[tokio::test] pub async fn test_complex_object() { diff --git a/tests/complex_object.rs b/tests/complex_object.rs --- a/t...
[Question] Generics and context Hello 👋 First of all thank you for this amazing crate. I'm having issues achieving a particular use case and I'm curious if its at all possible or I'm looking at the problem from the wrong perspective. In my application I have service structs that look like this: ```rust #[de...
I am trying to do the same thing as you do, and this approach works: ```rust use std::marker::PhantomData; use async_graphql::{Object, SimpleObject, ComplexObject, Context, ID, Error, Result, Schema, EmptyMutation, EmptySubscription}; pub trait MyData: Send + Sync {} struct DefaultMyData {} impl MyData for ...
2021-07-03T16:10:45Z
2.9
2021-07-04T06:10:20Z
06a5eb298365b741187baec5b7bc6aec0ad3abab
[ "dataloader::tests::test_dataloader_load_empty", "request::tests::test_batch_request_batch", "request::tests::test_batch_request_single", "request::tests::test_request_with_operation_name", "dataloader::tests::test_duplicate_keys", "request::tests::test_request", "request::tests::test_deserialize_reques...
[]
[]
[]
auto_2025-06-06
async-graphql/async-graphql
1,559
async-graphql__async-graphql-1559
[ "1558" ]
faa78d071cfae795dacc39fd46900fdfb6157d0d
diff --git a/src/registry/export_sdl.rs b/src/registry/export_sdl.rs --- a/src/registry/export_sdl.rs +++ b/src/registry/export_sdl.rs @@ -259,10 +259,8 @@ impl Registry { write!(sdl, " @tag(name: \"{}\")", tag.replace('"', "\\\"")).ok(); } } - ...
diff --git a/tests/schemas/test_fed2_compose_2.schema.graphql b/tests/schemas/test_fed2_compose_2.schema.graphql --- a/tests/schemas/test_fed2_compose_2.schema.graphql +++ b/tests/schemas/test_fed2_compose_2.schema.graphql @@ -3,7 +3,7 @@ type Query { - testArgument(arg: String! @type_directive_argument_definition...
The custom directive ARGUMENT_DEFINITION is not being output at the appropriate location in SDL ## Rust Code ```rust use async_graphql::*; #[TypeDirective(location = "ArgumentDefinition")] fn testDirective(desc: String) {} struct Query; #[Object] impl Query { async fn add( &self, #...
2024-07-09T10:56:37Z
7.0
2024-07-14T02:17:22Z
faa78d071cfae795dacc39fd46900fdfb6157d0d
[ "test_type_directive_2" ]
[ "dataloader::tests::test_dataloader_load_empty", "dataloader::tests::test_dataloader_disable_all_cache", "dataloader::tests::test_dataloader_disable_cache", "dataloader::tests::test_duplicate_keys", "dataloader::tests::test_dataloader_with_cache", "dynamic::check::tests::test_recursive_input_objects_bad",...
[]
[]
auto_2025-06-06
async-graphql/async-graphql
1,524
async-graphql__async-graphql-1524
[ "1187" ]
9d1befde1444a3d6a9dfdc62750ba271159c7173
diff --git a/src/registry/export_sdl.rs b/src/registry/export_sdl.rs --- a/src/registry/export_sdl.rs +++ b/src/registry/export_sdl.rs @@ -95,15 +95,6 @@ impl Registry { pub(crate) fn export_sdl(&self, options: SDLExportOptions) -> String { let mut sdl = String::new(); - let has_oneof = self - ...
diff --git a/tests/directive.rs b/tests/directive.rs --- a/tests/directive.rs +++ b/tests/directive.rs @@ -1,4 +1,5 @@ use async_graphql::*; +use serde::{Deserialize, Serialize}; #[tokio::test] pub async fn test_directive_skip() { diff --git a/tests/directive.rs b/tests/directive.rs --- a/tests/directive.rs +++ b/...
Oneof directive not included in introspection result ## Expected Behavior I would expect the `@oneof` directive to be included in the result of an introspection query whenever the `#[derive(OneofObject)]` macro is used on a struct. ## Actual Behavior The directive is not listed in the introspection query result: ...
GraphiQL doesn't seem to support oneof. `Type` contains `oneOf` field, but GraphiQL is not querying it. https://github.com/async-graphql/async-graphql/blob/e2e35ce93f1032d6467144c7fa8f0783e1dde04b/src/model/type.rs#L241 Yes, that is true. Probably because it is still in RFC2 (Draft) phase. They renamed it to `isO...
2024-05-18T14:33:38Z
7.0
2024-05-19T00:59:07Z
faa78d071cfae795dacc39fd46900fdfb6157d0d
[ "test_includes_deprecated_directive", "test_includes_specified_by_directive", "test_introspection_directives", "test_type_directive_2" ]
[ "dataloader::tests::test_dataloader_load_empty", "dataloader::tests::test_dataloader_disable_cache", "dataloader::tests::test_duplicate_keys", "dataloader::tests::test_dataloader_disable_all_cache", "dynamic::check::tests::test_recursive_input_objects_bad", "dynamic::check::tests::test_recursive_input_obj...
[]
[]
auto_2025-06-06
async-graphql/async-graphql
1,491
async-graphql__async-graphql-1491
[ "1486" ]
759fb0e594606aecf4a239b00d6f3f8aeb22d885
diff --git a/src/validation/rules/default_values_of_correct_type.rs b/src/validation/rules/default_values_of_correct_type.rs --- a/src/validation/rules/default_values_of_correct_type.rs +++ b/src/validation/rules/default_values_of_correct_type.rs @@ -29,12 +29,7 @@ impl<'a> Visitor<'a> for DefaultValuesOfCorrectType { ...
diff --git a/src/validation/rules/default_values_of_correct_type.rs b/src/validation/rules/default_values_of_correct_type.rs --- a/src/validation/rules/default_values_of_correct_type.rs +++ b/src/validation/rules/default_values_of_correct_type.rs @@ -101,8 +96,8 @@ mod tests { } #[test] - fn no_required_...
Non nullable variables should allow default values ## Expected Behavior Queries should be able to define non-nullable variables with default variables. This is currently prevented by the check here: https://github.com/async-graphql/async-graphql/blob/759fb0e594606aecf4a239b00d6f3f8aeb22d885/src/validation/rules/de...
Here's a quick example of this working using the reference graphql-js implementation: https://stackblitz.com/edit/typescript-5qrssw?file=index.ts Could you be so kind to share a snippet of the source code, that raises the error above? Here's a simple reproduction: https://github.com/hayes/repro-async-graphql-non-null-v...
2024-03-13T23:43:22Z
7.0
2024-03-16T01:52:32Z
faa78d071cfae795dacc39fd46900fdfb6157d0d
[ "validation::rules::default_values_of_correct_type::tests::required_variables_with_default_values", "test_required_variable_with_default" ]
[ "dataloader::tests::test_dataloader_load_empty", "dataloader::tests::test_dataloader_disable_cache", "dataloader::tests::test_dataloader_disable_all_cache", "dataloader::tests::test_duplicate_keys", "dynamic::check::tests::test_recursive_input_objects_bad", "dynamic::check::tests::test_recursive_input_obj...
[]
[]
auto_2025-06-06
async-graphql/async-graphql
10
async-graphql__async-graphql-10
[ "9" ]
ba64ecc31d8c94b29b481a4c6a6573e397a1a132
diff --git /dev/null b/examples/error_extensions.rs new file mode 100644 --- /dev/null +++ b/examples/error_extensions.rs @@ -0,0 +1,108 @@ +use actix_rt; +use actix_web::{guard, web, App, HttpResponse, HttpServer}; +use async_graphql::http::{graphiql_source, playground_source, GQLRequest, GQLResponse}; +use async_grap...
diff --git a/src/http/mod.rs b/src/http/mod.rs --- a/src/http/mod.rs +++ b/src/http/mod.rs @@ -259,6 +270,30 @@ mod tests { ); } + #[test] + fn test_response_error_with_extension() { + let err = ExtendedError( + "MyErrorMessage".to_owned(), + json!({ + "...
Support Error Extensions Hey, first of all, I really enjoy using your library so far. I think it is already very comprehensive. One thing I am missing though is returning extensions for errors as described [here](https://github.com/graphql/graphql-spec/blob/master/spec/Section%207%20--%20Response.md) in the spec. Some...
Thank you for your advice, that's a great idea, and I really need your help. These days I want to optimize the code in the subscription to make it easier to use, so our work doesn't conflict.If you have time, you can help implement `ErrorExtensions'.😁 Thanks again! I thought a little about it and started implementing...
2020-03-29T15:00:42Z
1.6
2020-03-30T06:36:27Z
ba64ecc31d8c94b29b481a4c6a6573e397a1a132
[ "http::tests::test_request", "http::tests::test_request_with_operation_name", "http::tests::test_response_data", "http::tests::test_request_with_variables", "http::tests::test_response_error", "scalars::tests::test_scalar_type", "types::list::tests::test_list_type", "http::tests::test_response_error_w...
[]
[]
[]
auto_2025-06-06
async-graphql/async-graphql
170
async-graphql__async-graphql-170
[ "169" ]
2e9557ff1c1482acce1337508b81ccdde09009a9
diff --git a/src/context.rs b/src/context.rs --- a/src/context.rs +++ b/src/context.rs @@ -424,6 +424,16 @@ impl<'a, T> ContextBase<'a, T> { } else if let Some(default) = &def.default_value { return Ok(default.clone_inner()); } + match def.var_type.deref() { + ...
diff --git a/tests/variables.rs b/tests/variables.rs --- a/tests/variables.rs +++ b/tests/variables.rs @@ -71,6 +71,69 @@ pub async fn test_variable_default_value() { ); } +#[async_std::test] +pub async fn test_variable_no_value() { + struct QueryRoot; + + #[Object] + impl QueryRoot { + pub asyn...
invalid: Variable "$var" is not defined When executing a query in async-graphql, I'm getting a "Variable ... is not defined" error when I don't think I should be. A query like ```graphql query TestQuery($var: Boolean) { test(var: $var) { id } } ``` with no variables ```json {} ``` ...
2020-06-11T15:33:20Z
1.15
2020-06-12T01:35:38Z
2e9557ff1c1482acce1337508b81ccdde09009a9
[ "test_variable_no_value" ]
[ "validation::rules::arguments_of_correct_type::tests::incorrect_item_type", "validation::rules::arguments_of_correct_type::tests::incorrect_value_and_missing_argument", "types::list::tests::test_list_type", "http::tests::test_request", "validation::rules::arguments_of_correct_type::tests::boolean_into_id", ...
[]
[]
auto_2025-06-06
dtolnay/async-trait
233
dtolnay__async-trait-233
[ "232" ]
d71c74de7b445060462c40f223f10cbe270c5250
diff --git a/src/expand.rs b/src/expand.rs --- a/src/expand.rs +++ b/src/expand.rs @@ -297,10 +297,16 @@ fn transform_sig( }) => {} FnArg::Receiver(arg) => arg.mutability = None, FnArg::Typed(arg) => { - if let Pat::Ident(ident) = &mut *arg.pat { - ...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -1489,3 +1489,37 @@ pub mod issue226 { } } } + +// https://github.com/dtolnay/async-trait/issues/232 +pub mod issue232 { + use async_trait::async_trait; + + #[async_trait] + pub trait Generic<T> { + asyn...
Do not require Sync on unused shared reference arguments ```rust use async_trait::async_trait; #[async_trait] trait Generic<T> { async fn takes_ref(&self, thing: &T); } #[async_trait] impl<T> Generic<T> for () { async fn takes_ref(&self, _: &T) {} } ``` This currently fails because it expands t...
2023-01-22T21:22:12Z
0.1
2023-01-22T21:25:44Z
f8e5bb43181450a17068f160e8a51d410ede1705
[ "issue199::test", "drop_order::test_drop_order", "issue45::tracing", "src/lib.rs - (line 165) - compile fail", "src/lib.rs - (line 15) - compile fail", "src/lib.rs - (line 186)", "src/lib.rs - (line 47)", "src/lib.rs - (line 211)", "src/lib.rs - (line 286)", "src/lib.rs - (line 265)", "src/lib.r...
[]
[]
[]
auto_2025-06-06
dtolnay/async-trait
107
dtolnay__async-trait-107
[ "106" ]
7c746b6ee601c51c557c9f4c32230f5c9a9934be
diff --git a/src/expand.rs b/src/expand.rs --- a/src/expand.rs +++ b/src/expand.rs @@ -81,6 +81,13 @@ pub fn expand(input: &mut Item, is_local: bool) { } } Item::Impl(input) => { + let mut lifetimes = CollectLifetimes::with("'impl_life"); + lifetimes.visit_type_mut(&...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -905,3 +905,35 @@ mod issue104 { impl_t1!(Foo, 1); } + +// https://github.com/dtolnay/async-trait/issues/106 +mod issue106 { + use async_trait::async_trait; + use std::future::Future; + + #[async_trait] + pub trait...
Translation of lifetimes in Fn trait input parameters I think this is a fairly niche and easy to work around case but it's a surprising footgun that might be worth a fix? ```rust use async_trait::async_trait; use core::future::Future; #[async_trait] pub trait ProcessPool: Send + Sync { type ThreadPool; ...
EDIT: Sorry, this comment is incorrect. I was trying to convert an irrelevant lifetime to `'static`. EDIT2: See https://github.com/dtolnay/async-trait/issues/106#issuecomment-640927871 > This can be resolved by translating instead to `<&'static P as ProcessPool>::ThreadPool`. I don't know if this breaks other use c...
2020-06-09T01:15:55Z
0.1
2020-06-09T01:33:55Z
f8e5bb43181450a17068f160e8a51d410ede1705
[ "issue45::tracing", "src/lib.rs - (line 15)", "src/lib.rs - (line 165)", "src/lib.rs - (line 126)", "src/lib.rs - (line 286)", "src/lib.rs - (line 265)", "src/lib.rs - (line 186)", "src/lib.rs - (line 211)", "src/lib.rs - (line 47)" ]
[]
[]
[]
auto_2025-06-06
dtolnay/async-trait
105
dtolnay__async-trait-105
[ "104" ]
5220bbd2bdf30fa43c78d08a8e9a9f311a239cf8
diff --git a/src/expand.rs b/src/expand.rs --- a/src/expand.rs +++ b/src/expand.rs @@ -258,7 +258,7 @@ fn transform_block( let inner = format_ident!("__{}", sig.ident); let args = sig.inputs.iter().enumerate().map(|(i, arg)| match arg { - FnArg::Receiver(_) => quote!(self), + FnArg::Receiver(R...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -556,10 +556,10 @@ pub mod issue45 { pub mod issue46 { use async_trait::async_trait; - macro_rules! implement_commands { + macro_rules! implement_commands_workaround { ($tyargs:tt : $ty:tt) => { #[a...
Problem with declarative macros Hello there. I have problem with declarative macros. The code is simplified as below: ```Rust use async_trait::async_trait; #[async_trait] trait T1 { async fn id(&self) -> i32; } macro_rules! impl_t1 { ($ty: ty, $id: expr) => { #[async_trait] impl ...
This is a compiler bug (https://github.com/rust-lang/rust/issues/43081). You can work around it by writing the decl macro as: ```rust macro_rules! impl_t1 { ($ty:tt, $($id:tt)*) => { #[async_trait] impl T1 for $ty { async fn id(&self) -> i32 { $($id)* ...
2020-06-08T03:01:30Z
0.1
2020-06-08T23:44:42Z
f8e5bb43181450a17068f160e8a51d410ede1705
[ "issue45::tracing", "src/lib.rs - (line 15)", "src/lib.rs - (line 165)", "src/lib.rs - (line 126)", "src/lib.rs - (line 286)", "src/lib.rs - (line 186)", "src/lib.rs - (line 211)", "src/lib.rs - (line 265)", "src/lib.rs - (line 47)" ]
[]
[]
[]
auto_2025-06-06
dtolnay/async-trait
100
dtolnay__async-trait-100
[ "92" ]
bee997398ff951b505f251b237dd08eeddd8e9c7
diff --git a/src/receiver.rs b/src/receiver.rs --- a/src/receiver.rs +++ b/src/receiver.rs @@ -1,4 +1,5 @@ use proc_macro2::{Group, TokenStream, TokenTree}; +use quote::quote; use std::iter::FromIterator; use std::mem; use syn::punctuated::Punctuated; diff --git a/src/receiver.rs b/src/receiver.rs --- a/src/receive...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -785,3 +785,85 @@ pub mod issue89 { async fn f(&self) {} } } + +// https://github.com/dtolnay/async-trait/issues/92 +pub mod issue92 { + use async_trait::async_trait; + + macro_rules! mac { + ($($tt:tt)*) =...
Self keyword inside macro invocations in trait impl Issue #73 only revealed part of the problem, and only part of it was fixed. Since Merge Request #74 `Self` inside macro invocation works when used in the trait declaration, but the issue persists in the trait impl. See this example: ```rust use async_trait::asy...
I ran into the same bug, it's still present in 0.1.31 and the workaround still works.
2020-05-25T12:31:51Z
0.1
2020-06-01T05:15:59Z
f8e5bb43181450a17068f160e8a51d410ede1705
[ "issue45::tracing", "src/lib.rs - (line 15)", "src/lib.rs - (line 165)", "src/lib.rs - (line 126)", "src/lib.rs - (line 186)", "src/lib.rs - (line 211)", "src/lib.rs - (line 286)", "src/lib.rs - (line 265)", "src/lib.rs - (line 47)" ]
[]
[]
[]
auto_2025-06-06
dtolnay/async-trait
90
dtolnay__async-trait-90
[ "89" ]
05c24928d08c46ee1a916b1dff7f6dd389b21c94
diff --git a/src/expand.rs b/src/expand.rs --- a/src/expand.rs +++ b/src/expand.rs @@ -342,8 +342,17 @@ fn transform_block( }; } Context::Impl { receiver, .. } => { + let mut ty = quote!(#receiver); + if let Type::TraitObject(t...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -622,3 +622,30 @@ pub mod issue87 { } } } + +// https://github.com/dtolnay/async-trait/issues/89 +pub mod issue89 { + #![allow(bare_trait_objects)] + + use async_trait::async_trait; + + #[async_trait] + trai...
Forgetting "dyn" before Fn() + Trait causes panic In non-async-trait code, this is currently legal, though it emits a warning that it should have the `dyn` keyword: ``` impl<F> Foo for Fn(i8) -> F + Send + Sync where F: ... {} ``` In async-trait code, this causes a panic: ``` #[async_trait::async_trait] i...
2020-04-07T03:09:00Z
0.1
2020-04-07T03:12:34Z
f8e5bb43181450a17068f160e8a51d410ede1705
[ "src/lib.rs - (line 10)", "src/lib.rs - (line 160)", "src/lib.rs - (line 121)", "src/lib.rs - (line 281)", "src/lib.rs - (line 181)", "src/lib.rs - (line 260)", "src/lib.rs - (line 42)", "src/lib.rs - (line 206)" ]
[]
[]
[]
auto_2025-06-06
dtolnay/async-trait
160
dtolnay__async-trait-160
[ "158" ]
6bff4e0c5935b30b4d5af42bb06d9972866c752d
diff --git a/src/receiver.rs b/src/receiver.rs --- a/src/receiver.rs +++ b/src/receiver.rs @@ -2,7 +2,7 @@ use proc_macro2::{Group, Span, TokenStream, TokenTree}; use std::iter::FromIterator; use syn::visit_mut::{self, VisitMut}; use syn::{ - Block, ExprPath, Ident, Item, Macro, Pat, PatIdent, PatPath, Receiver, ...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -1321,3 +1321,17 @@ pub mod issue154 { } } } + +// https://github.com/dtolnay/async-trait/issues/158 +pub mod issue158 { + use async_trait::async_trait; + + fn f() {} + + #[async_trait] + pub trait Trait { +...
Failed to resolve `self` in path Macro doesn't handle when `self` is used as path. ```rust use async_trait::async_trait; // 0.1.48 fn bar() {} #[async_trait] trait Foo { async fn bar(&self) { self::bar() } } ``` ```rust error[E0433]: failed to resolve: use of undeclared crate or module `...
2021-04-14T06:06:02Z
0.1
2021-04-14T06:09:19Z
f8e5bb43181450a17068f160e8a51d410ede1705
[ "drop_order::test_drop_order", "issue45::tracing", "src/lib.rs - (line 15)", "src/lib.rs - (line 165)", "src/lib.rs - (line 126)", "src/lib.rs - (line 186)", "src/lib.rs - (line 286)", "src/lib.rs - (line 265)", "src/lib.rs - (line 47)", "src/lib.rs - (line 211)" ]
[]
[]
[]
auto_2025-06-06
dtolnay/async-trait
150
dtolnay__async-trait-150
[ "149" ]
2c4cde7ce826c77fe08a8f67d6fdc47b023adf0f
diff --git a/src/expand.rs b/src/expand.rs --- a/src/expand.rs +++ b/src/expand.rs @@ -350,6 +350,9 @@ fn transform_block(sig: &mut Signature, block: &mut Block) { let _: () = { #(#decls)* #(#stmts)* }; }, ReturnType::Type(_, ret) => quote_spanned! {block.brace_token.span=> + i...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -1258,3 +1258,23 @@ pub mod issue147 { } } } + +// https://github.com/dtolnay/async-trait/issues/149 +pub mod issue149 { + use async_trait::async_trait; + + pub struct Thing; + pub trait Ret {} + impl Ret fo...
Unsize coercion fails if end of method is unreachable The following async trait fails to compile. Notice that the same method body is fine in an ordinary async fn outside of an async trait. This worked prior to #143. ```rust use async_trait::async_trait; struct Thing; trait Ret {} impl Ret for Thing {} a...
2021-03-07T05:06:30Z
0.1
2021-03-07T05:12:13Z
f8e5bb43181450a17068f160e8a51d410ede1705
[ "issue45::tracing", "drop_order::test_drop_order", "src/lib.rs - (line 15)", "src/lib.rs - (line 165)", "src/lib.rs - (line 286)", "src/lib.rs - (line 211)", "src/lib.rs - (line 186)", "src/lib.rs - (line 47)", "src/lib.rs - (line 265)", "src/lib.rs - (line 126)" ]
[]
[]
[]
auto_2025-06-06
dtolnay/async-trait
227
dtolnay__async-trait-227
[ "226" ]
6050c94ca7be287be1657fcefd299165e39c7ef2
diff --git a/src/expand.rs b/src/expand.rs --- a/src/expand.rs +++ b/src/expand.rs @@ -362,6 +362,12 @@ fn transform_block(context: Context, sig: &mut Signature, block: &mut Block) { quote!(let #mutability #ident = #self_token;) } FnArg::Typed(arg) => { + // If ...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -54,6 +54,10 @@ trait Trait { async fn calls_mut(&mut self) { self.selfmut().await; } + + async fn cfg_param(&self, param: u8); + async fn cfg_param_wildcard(&self, _: u8); + async fn cfg_param_tuple(&self,...
Attributes on impl parameters are not forwarded to body Heya, I was implementing a trait function with `#[cfg(..)]` in its parameters, and encountered the following error: ```rust // within trait impl async fn cfg_param( &self, #[cfg(not(feature = "something"))] param: u8, #[cfg(feature = "something...
2023-01-06T01:44:31Z
0.1
2023-01-06T22:57:17Z
f8e5bb43181450a17068f160e8a51d410ede1705
[ "drop_order::test_drop_order", "issue199::test", "issue45::tracing", "src/lib.rs - (line 15) - compile fail", "src/lib.rs - (line 165) - compile fail", "src/lib.rs - (line 126)", "src/lib.rs - (line 186)", "src/lib.rs - (line 265)", "src/lib.rs - (line 286)", "src/lib.rs - (line 47)", "src/lib.r...
[]
[]
[]
auto_2025-06-06
dtolnay/async-trait
223
dtolnay__async-trait-223
[ "210" ]
9ed6489ee0cedf31fef8a06a1dcd1f18b4afdd39
diff --git a/src/expand.rs b/src/expand.rs --- a/src/expand.rs +++ b/src/expand.rs @@ -9,9 +9,9 @@ use std::mem; use syn::punctuated::Punctuated; use syn::visit_mut::{self, VisitMut}; use syn::{ - parse_quote, parse_quote_spanned, Attribute, Block, FnArg, GenericParam, Generics, Ident, - ImplItem, Lifetime, Li...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -1450,3 +1450,14 @@ pub mod issue204 { async fn g(arg: *const impl Trait); } } + +// https://github.com/dtolnay/async-trait/issues/210 +pub mod issue210 { + use async_trait::async_trait; + use std::sync::Arc; + + ...
Defaulted method with `self: Arc<Self>` doesn't work `Arc` generates a `where Self: Send` bound, but for `Arc` it is not enough - it requires also `T: Sync` to be `Send`. This make the following code failing to compile: ```rust #[async_trait] trait Trait { async fn foo(self: Arc<Self>) {} } ``` https://play...
2022-11-29T08:05:19Z
0.1
2022-11-29T08:11:36Z
f8e5bb43181450a17068f160e8a51d410ede1705
[ "drop_order::test_drop_order", "issue199::test", "issue45::tracing", "src/lib.rs - (line 165) - compile fail", "src/lib.rs - (line 15) - compile fail", "src/lib.rs - (line 126)", "src/lib.rs - (line 286)", "src/lib.rs - (line 265)", "src/lib.rs - (line 186)", "src/lib.rs - (line 47)", "src/lib.r...
[]
[]
[]
auto_2025-06-06
dtolnay/async-trait
201
dtolnay__async-trait-201
[ "177" ]
9a323ed6dad1dfc651147814d4d418cf09d6e17b
diff --git a/Cargo.toml b/Cargo.toml --- a/Cargo.toml +++ b/Cargo.toml @@ -17,7 +17,7 @@ proc-macro = true [dependencies] proc-macro2 = "1.0" quote = "1.0" -syn = { version = "1.0.84", features = ["full", "visit-mut"] } +syn = { version = "1.0.96", features = ["full", "visit-mut"] } [dev-dependencies] futures = ...
diff --git a/tests/test.rs b/tests/test.rs --- a/tests/test.rs +++ b/tests/test.rs @@ -1374,6 +1374,23 @@ pub mod issue169 { pub fn test(_t: &dyn Trait) {} } +// https://github.com/dtolnay/async-trait/issues/177 +pub mod issue177 { + use async_trait::async_trait; + + #[async_trait] + pub trait Trait { ...
Lifetime issue when using "impl FnMut" as argument type **Case 1:** ```rust async fn foo(&self, mut callback: impl FnMut(&str) + Send) ``` expands to: ```rust fn foo<'life0, 'life1, 'async_trait>( &'life0 self, callback: impl FnMut(&'life1 str) + Send, ) -> ::core::pin::Pin< B...
I would accept a PR to support this as suggested in the forum thread (`callback: impl 'async_trait + FnMut(&str) + Send`).
2022-06-02T20:27:22Z
0.1
2022-06-02T20:33:38Z
f8e5bb43181450a17068f160e8a51d410ede1705
[ "drop_order::test_drop_order", "issue45::tracing", "src/lib.rs - (line 15) - compile fail", "src/lib.rs - (line 165) - compile fail", "src/lib.rs - (line 126)", "src/lib.rs - (line 186)", "src/lib.rs - (line 286)", "src/lib.rs - (line 265)", "src/lib.rs - (line 47)", "src/lib.rs - (line 211)" ]
[]
[]
[]
auto_2025-06-06
google/autocxx
129
google__autocxx-129
[ "115" ]
1ce47156f3fe4bbfc013c37616efa77e9577d85f
diff --git a/engine/src/additional_cpp_generator.rs b/engine/src/additional_cpp_generator.rs --- a/engine/src/additional_cpp_generator.rs +++ b/engine/src/additional_cpp_generator.rs @@ -12,7 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crat...
diff --git a/engine/src/integration_tests.rs b/engine/src/integration_tests.rs --- a/engine/src/integration_tests.rs +++ b/engine/src/integration_tests.rs @@ -113,6 +113,29 @@ fn run_test( generate, generate_pods, TestMethod::BeQuick, + None, + ) + .unwrap() +} + +/// A positive ...
Nested types don't work ```c++ class A { class B { ... }; }; ``` is generated by `bindgen` as ```rust pub struct A { ... } pub struct A_B { ... } ``` This then gives errors when we refer to `A_B` in generated C++.
2020-11-25T22:19:42Z
0.4
2020-11-25T22:48:38Z
3136e0df01dfe15251b9e796de0e9a46d38a1ba7
[ "bridge_name_tracker::tests::test", "byvalue_checker::tests::test_primitive_by_itself", "byvalue_checker::tests::test_with_cxxstring", "byvalue_checker::tests::test_primitives", "byvalue_checker::tests::test_nested_primitives", "byvalue_checker::tests::test_with_up", "integration_tests::test_negative_rs...
[]
[]
[]
auto_2025-06-06
google/autocxx
105
google__autocxx-105
[ "103" ]
88ca58b4391fd8e66c3994f6b7355c8aa36cb2e8
diff --git a/engine/src/additional_cpp_generator.rs b/engine/src/additional_cpp_generator.rs --- a/engine/src/additional_cpp_generator.rs +++ b/engine/src/additional_cpp_generator.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use crate...
diff --git a/engine/src/bridge_converter.rs b/engine/src/bridge_converter.rs --- a/engine/src/bridge_converter.rs +++ b/engine/src/bridge_converter.rs @@ -654,7 +673,7 @@ impl<'a> BridgeConversion<'a> { // We want to feed cxx methods with just the method name, so let's // strip off the class n...
std::unique_ptr<T> doesn't appear to qualify T with namespaces Reproduced on a complex codebase. Need to come up with a test case.
2020-11-17T23:50:41Z
0.4
2020-11-17T23:56:59Z
3136e0df01dfe15251b9e796de0e9a46d38a1ba7
[ "byvalue_checker::tests::test_with_up", "byvalue_checker::tests::test_with_cxxstring", "byvalue_checker::tests::test_primitives", "byvalue_checker::tests::test_nested_primitives", "byvalue_checker::tests::test_primitive_by_itself", "integration_tests::test_negative_rs_nonsense::f", "types::tests::test_i...
[]
[]
[]
auto_2025-06-06