Skip to content

Subtree update of rust-analyzer #131399

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 56 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
008d513
Prepare for omittiong parts of completion data that need to be resolved
SomeoneToIgnore Sep 22, 2024
cc2686c
Omit completion fields to be resolved later
SomeoneToIgnore Sep 23, 2024
ecae5a8
Resolve completion items
SomeoneToIgnore Sep 23, 2024
b82c5ce
Less clones
SomeoneToIgnore Sep 23, 2024
b24723a
Fix the test
SomeoneToIgnore Sep 23, 2024
536ac47
Small fixes
SomeoneToIgnore Sep 23, 2024
b204f48
Changes for debug restarting
basvandriel Sep 25, 2024
4e4f016
internal: add tracing to project discovery and VFS loading
davidbarsky Sep 13, 2024
83a371a
Prime caches for symbol search too.
kpreid Sep 24, 2024
1de266f
Auto merge of #18181 - davidbarsky:davidbarsky/push-nzstpumovmmx, r=d…
bors Sep 25, 2024
14a14b5
Auto merge of #18180 - kpreid:search, r=davidbarsky
bors Sep 25, 2024
6e4f572
Require rust 1.81
darichey Sep 25, 2024
2904b35
Auto merge of #18188 - darichey:msrv, r=lnicola
bors Sep 26, 2024
75ca498
Include buildfiles in vfs
darichey Sep 26, 2024
933b507
fix: Don't report a startup error when a discover command is configured
Wilfred Sep 26, 2024
a547bae
Auto merge of #18193 - Wilfred:startup_error, r=lnicola
bors Sep 26, 2024
b9a0502
internal: Add `SyntaxFactory` to ease generating nodes with syntax ma…
DropDemBits Sep 26, 2024
d6d1b4a
minor: Use `SyntaxEditor` in `extract_variable`
DropDemBits Sep 26, 2024
99de851
minor: Require both the existence of a target and check_workspace to …
alibektas Sep 27, 2024
5fcfd95
Auto merge of #18197 - alibektas:buggy_flycheck_message, r=Veykril
bors Sep 27, 2024
0d70f9f
Auto merge of #18196 - DropDemBits:sed-syntax-factory, r=Veykril
bors Sep 27, 2024
3f22f7d
Auto merge of #17923 - basvandriel:feature/build-before-restart-debug…
bors Sep 27, 2024
9114a49
Update cc to 1.1.22
ChrisDenton Sep 27, 2024
235809d
Auto merge of #18204 - ChrisDenton:cc, r=lnicola
bors Sep 27, 2024
46fe025
Auto merge of #18192 - darichey:read-buildfile-into-vfs, r=Veykril
bors Sep 27, 2024
99b2638
Update handlers.rs to handlers/requests.rs
noahmbright Sep 28, 2024
d8fb793
Fix ambiguity with CamelCase diagnostic messages
mbwilding Sep 29, 2024
7b757b3
Rename object_safety to dyn_compatibility
noahmbright Sep 28, 2024
490df54
internal: allow overriding proc macro server in analysis-stats
davidbarsky Sep 27, 2024
8f3c0f1
Auto merge of #18208 - davidbarsky:davidbarsky/push-qkwkmttnukqt, r=l…
bors Sep 29, 2024
8e4570a
When glueing together tokens from macros, merge their spans
ChayimFriedman2 Sep 29, 2024
e50339a
Auto merge of #18205 - noahmbright:object_safety, r=HKalbasi
bors Sep 29, 2024
923cb99
Provide an config option to not set `cfg(test)`
ChayimFriedman2 Sep 9, 2024
91834ec
Gate `#[test]` expansion under `cfg(test)`.
ChayimFriedman2 Sep 9, 2024
1ca85ac
Auto merge of #18085 - ChayimFriedman2:gate-test, r=Veykril
bors Sep 30, 2024
6938084
Auto merge of #18207 - mbwilding:master, r=Veykril
bors Sep 30, 2024
4800a0e
Auto merge of #18167 - SomeoneToIgnore:fat-completions, r=Veykril
bors Sep 30, 2024
d073a85
When resolving labels in `break` and `continue` for the IDE, do not r…
ChayimFriedman2 Sep 29, 2024
52e8eaa
Auto merge of #18210 - ChayimFriedman2:label-macro, r=Veykril
bors Sep 30, 2024
d7440d7
internal: remove `Default` from OpQueue
davidbarsky Sep 26, 2024
8621cbe
Auto merge of #18195 - davidbarsky:davidbarsky/push-xkqnsyksmzqv, r=V…
bors Sep 30, 2024
2064874
Fix: Handle block exprs as modules when finding their parents
ShoyuVanilla Sep 29, 2024
00399ab
Auto merge of #18206 - ShoyuVanilla:issue-18187, r=Veykril
bors Oct 1, 2024
7f8bd7e
fix: Fix bootstrap error message being incorrect
Veykril Oct 1, 2024
b91eeae
Auto merge of #18219 - Veykril:veykril/push-ytnzuvtoswqz, r=Veykril
bors Oct 1, 2024
0301368
internal: Filter out opaque tokens in some of IDE feature macro desce…
Veykril Oct 4, 2024
fae34e0
Auto merge of #18234 - Veykril:veykril/push-vzynqtlxmrnl, r=Veykril
bors Oct 4, 2024
a5a4d1a
internal: add JSON formatting for hprof
davidbarsky Sep 30, 2024
fe2b453
Auto merge of #18227 - davidbarsky:davidbarsky/push-lmntvwvznyyx, r=d…
bors Oct 4, 2024
0e96fd0
Use external stack in borrowck DFS
ChayimFriedman2 Oct 6, 2024
d5984c7
Auto merge of #18255 - ChayimFriedman2:stack-overflow, r=HKalbasi
bors Oct 6, 2024
ac5361f
Use macos-13 runners and bump MACOSX_DEPLOYMENT_TARGET
lnicola Oct 8, 2024
76fc27a
Auto merge of #18266 - lnicola:macos-13, r=lnicola
bors Oct 8, 2024
537fb8d
Preparing for merge from rust-lang/rust
lnicola Oct 8, 2024
4316aff
Merge from rust-lang/rust
lnicola Oct 8, 2024
84a16c4
Auto merge of #18267 - lnicola:sync-from-rust, r=lnicola
bors Oct 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/tools/rust-analyzer/.github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ env:
RUSTFLAGS: "-D warnings -W unreachable-pub"
RUSTUP_MAX_RETRIES: 10
FETCH_DEPTH: 0 # pull in the tags for the version string
MACOSX_DEPLOYMENT_TARGET: 10.15
MACOSX_DEPLOYMENT_TARGET: 13.0
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc
CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER: arm-linux-gnueabihf-gcc

Expand All @@ -43,10 +43,10 @@ jobs:
- os: ubuntu-20.04
target: arm-unknown-linux-gnueabihf
code-target: linux-armhf
- os: macos-12
- os: macos-13
target: x86_64-apple-darwin
code-target: darwin-x64
- os: macos-12
- os: macos-13
target: aarch64-apple-darwin
code-target: darwin-arm64

Expand Down
13 changes: 11 additions & 2 deletions src/tools/rust-analyzer/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,12 @@ dependencies = [

[[package]]
name = "cc"
version = "1.1.10"
version = "1.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e9e8aabfac534be767c909e0690571677d49f41bd8465ae876fe043d52ba5292"
checksum = "9540e661f81799159abee814118cc139a2004b3a3aa3ea37724a1b66530b90e0"
dependencies = [
"shlex",
]

[[package]]
name = "cfg"
Expand Down Expand Up @@ -1852,6 +1855,12 @@ dependencies = [
"lazy_static",
]

[[package]]
name = "shlex"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"

[[package]]
name = "smallvec"
version = "1.13.2"
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exclude = ["crates/proc-macro-srv/proc-macro-test/imp"]
resolver = "2"

[workspace.package]
rust-version = "1.80"
rust-version = "1.81"
edition = "2021"
license = "MIT OR Apache-2.0"
authors = ["rust-analyzer team"]
Expand Down
4 changes: 4 additions & 0 deletions src/tools/rust-analyzer/crates/cfg/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,10 @@ impl CfgOptions {
cfg.fold(&|atom| self.enabled.contains(atom))
}

pub fn check_atom(&self, cfg: &CfgAtom) -> bool {
self.enabled.contains(cfg)
}

pub fn insert_atom(&mut self, key: Symbol) {
self.enabled.insert(CfgAtom::Flag(key));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ macro_rules! f {
}

struct#0:[email protected]#1# MyTraitMap2#0:[email protected]#0# {#0:[email protected]#1#
map#0:[email protected]#1#:#0:[email protected]#1# #0:[email protected]#1#::#0:1@91..92#1#std#0:[email protected]#1#::#0:1@96..97#1#collections#0:[email protected]#1#::#0:1@109..110#1#HashSet#0:[email protected]#1#<#0:[email protected]#1#(#0:[email protected]#1#)#0:[email protected]#1#>#0:[email protected]#1#,#0:[email protected]#1#
map#0:[email protected]#1#:#0:[email protected]#1# #0:[email protected]#1#::#0:1@91..93#1#std#0:[email protected]#1#::#0:1@96..98#1#collections#0:[email protected]#1#::#0:1@109..111#1#HashSet#0:[email protected]#1#<#0:[email protected]#1#(#0:[email protected]#1#)#0:[email protected]#1#>#0:[email protected]#1#,#0:[email protected]#1#
}#0:[email protected]#1#
"#]],
);
Expand Down
14 changes: 11 additions & 3 deletions src/tools/rust-analyzer/crates/hir-def/src/nameres/collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use std::{cmp::Ordering, iter, mem, ops::Not};

use base_db::{CrateId, CrateOrigin, Dependency, LangCrateOrigin};
use cfg::{CfgExpr, CfgOptions};
use cfg::{CfgAtom, CfgExpr, CfgOptions};
use either::Either;
use hir_expand::{
attrs::{Attr, AttrId},
Expand Down Expand Up @@ -1324,13 +1324,21 @@ impl DefCollector<'_> {
};

// Skip #[test]/#[bench] expansion, which would merely result in more memory usage
// due to duplicating functions into macro expansions
// due to duplicating functions into macro expansions, but only if `cfg(test)` is active,
// otherwise they are expanded to nothing and this can impact e.g. diagnostics (due to things
// being cfg'ed out).
// Ideally we will just expand them to nothing here. But we are only collecting macro calls,
// not expanding them, so we have no way to do that.
if matches!(
def.kind,
MacroDefKind::BuiltInAttr(_, expander)
if expander.is_test() || expander.is_bench()
) {
return recollect_without(self);
let test_is_active =
self.cfg_options.check_atom(&CfgAtom::Flag(sym::test.clone()));
if test_is_active {
return recollect_without(self);
}
}

let call_id = || {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use span::{MacroCallId, Span};

use crate::{db::ExpandDatabase, name, tt, ExpandResult, MacroCallKind};

use super::quote;

macro_rules! register_builtin {
($(($name:ident, $variant:ident) => $expand:ident),* ) => {
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
Expand Down Expand Up @@ -52,15 +54,15 @@ impl BuiltinAttrExpander {
}

register_builtin! {
(bench, Bench) => dummy_attr_expand,
(bench, Bench) => dummy_gate_test_expand,
(cfg_accessible, CfgAccessible) => dummy_attr_expand,
(cfg_eval, CfgEval) => dummy_attr_expand,
(derive, Derive) => derive_expand,
// derive const is equivalent to derive for our proposes.
(derive_const, DeriveConst) => derive_expand,
(global_allocator, GlobalAllocator) => dummy_attr_expand,
(test, Test) => dummy_attr_expand,
(test_case, TestCase) => dummy_attr_expand
(test, Test) => dummy_gate_test_expand,
(test_case, TestCase) => dummy_gate_test_expand
}

pub fn find_builtin_attr(ident: &name::Name) -> Option<BuiltinAttrExpander> {
Expand All @@ -76,6 +78,19 @@ fn dummy_attr_expand(
ExpandResult::ok(tt.clone())
}

fn dummy_gate_test_expand(
_db: &dyn ExpandDatabase,
_id: MacroCallId,
tt: &tt::Subtree,
span: Span,
) -> ExpandResult<tt::Subtree> {
let result = quote::quote! { span=>
#[cfg(test)]
#tt
};
ExpandResult::ok(result)
}

/// We generate a very specific expansion here, as we do not actually expand the `#[derive]` attribute
/// itself in name res, but we do want to expand it to something for the IDE layer, so that the input
/// derive attributes can be downmapped, and resolved as proper paths.
Expand Down
17 changes: 11 additions & 6 deletions src/tools/rust-analyzer/crates/hir-expand/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ use crate::{
cfg_process,
declarative::DeclarativeMacroExpander,
fixup::{self, SyntaxFixupUndoInfo},
hygiene::{span_with_call_site_ctxt, span_with_def_site_ctxt, span_with_mixed_site_ctxt},
hygiene::{
span_with_call_site_ctxt, span_with_def_site_ctxt, span_with_mixed_site_ctxt,
SyntaxContextExt as _,
},
proc_macro::ProcMacros,
span_map::{RealSpanMap, SpanMap, SpanMapRef},
tt, AstId, BuiltinAttrExpander, BuiltinDeriveExpander, BuiltinFnLikeExpander,
Expand Down Expand Up @@ -300,14 +303,16 @@ pub fn expand_speculative(
token_tree_to_syntax_node(&speculative_expansion.value, expand_to, loc.def.edition);

let syntax_node = node.syntax_node();
let token = rev_tmap
let (token, _) = rev_tmap
.ranges_with_span(span_map.span_for_range(token_to_map.text_range()))
.filter_map(|range| syntax_node.covering_element(range).into_token())
.min_by_key(|t| {
// prefer tokens of the same kind and text
.filter_map(|(range, ctx)| syntax_node.covering_element(range).into_token().zip(Some(ctx)))
.min_by_key(|(t, ctx)| {
// prefer tokens of the same kind and text, as well as non opaque marked ones
// Note the inversion of the score here, as we want to prefer the first token in case
// of all tokens having the same score
(t.kind() != token_to_map.kind()) as u8 + 2 * ((t.text() != token_to_map.text()) as u8)
ctx.is_opaque(db) as u8
+ 2 * (t.kind() != token_to_map.kind()) as u8
+ 4 * ((t.text() != token_to_map.text()) as u8)
})?;
Some((node.syntax_node(), token))
}
Expand Down
4 changes: 4 additions & 0 deletions src/tools/rust-analyzer/crates/hir-expand/src/hygiene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ pub trait SyntaxContextExt {
fn remove_mark(&mut self, db: &dyn ExpandDatabase) -> (Option<MacroCallId>, Transparency);
fn outer_mark(self, db: &dyn ExpandDatabase) -> (Option<MacroCallId>, Transparency);
fn marks(self, db: &dyn ExpandDatabase) -> Vec<(MacroCallId, Transparency)>;
fn is_opaque(self, db: &dyn ExpandDatabase) -> bool;
}

impl SyntaxContextExt for SyntaxContextId {
Expand All @@ -177,6 +178,9 @@ impl SyntaxContextExt for SyntaxContextId {
marks.reverse();
marks
}
fn is_opaque(self, db: &dyn ExpandDatabase) -> bool {
!self.is_root() && db.lookup_intern_syntax_context(self).outer_transparency.is_opaque()
}
}

// FIXME: Make this a SyntaxContextExt method once we have RPIT
Expand Down
24 changes: 13 additions & 11 deletions src/tools/rust-analyzer/crates/hir-expand/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ mod prettify_macro_expansion_;

use attrs::collect_attrs;
use rustc_hash::FxHashMap;
use stdx::TupleExt;
use triomphe::Arc;

use std::hash::Hash;
Expand Down Expand Up @@ -772,14 +773,15 @@ impl ExpansionInfo {
/// Maps the passed in file range down into a macro expansion if it is the input to a macro call.
///
/// Note this does a linear search through the entire backing vector of the spanmap.
// FIXME: Consider adding a reverse map to ExpansionInfo to get rid of the linear search which
// potentially results in quadratic look ups (notably this might improve semantic highlighting perf)
pub fn map_range_down_exact(
&self,
span: Span,
) -> Option<InMacroFile<impl Iterator<Item = SyntaxToken> + '_>> {
let tokens = self
.exp_map
.ranges_with_span_exact(span)
.flat_map(move |range| self.expanded.value.covering_element(range).into_token());
) -> Option<InMacroFile<impl Iterator<Item = (SyntaxToken, SyntaxContextId)> + '_>> {
let tokens = self.exp_map.ranges_with_span_exact(span).flat_map(move |(range, ctx)| {
self.expanded.value.covering_element(range).into_token().zip(Some(ctx))
});

Some(InMacroFile::new(self.expanded.file_id, tokens))
}
Expand All @@ -791,11 +793,10 @@ impl ExpansionInfo {
pub fn map_range_down(
&self,
span: Span,
) -> Option<InMacroFile<impl Iterator<Item = SyntaxToken> + '_>> {
let tokens = self
.exp_map
.ranges_with_span(span)
.flat_map(move |range| self.expanded.value.covering_element(range).into_token());
) -> Option<InMacroFile<impl Iterator<Item = (SyntaxToken, SyntaxContextId)> + '_>> {
let tokens = self.exp_map.ranges_with_span(span).flat_map(move |(range, ctx)| {
self.expanded.value.covering_element(range).into_token().zip(Some(ctx))
});

Some(InMacroFile::new(self.expanded.file_id, tokens))
}
Expand Down Expand Up @@ -845,7 +846,8 @@ impl ExpansionInfo {
self.arg.file_id,
arg_map
.ranges_with_span_exact(span)
.filter(|range| range.intersect(arg_range).is_some())
.filter(|(range, _)| range.intersect(arg_range).is_some())
.map(TupleExt::head)
.collect(),
)
}
Expand Down
3 changes: 2 additions & 1 deletion src/tools/rust-analyzer/crates/hir-ty/src/chalk_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,8 +382,9 @@ impl chalk_solve::RustIrDatabase<Interner> for ChalkContext<'_> {
}

fn is_object_safe(&self, trait_id: chalk_ir::TraitId<Interner>) -> bool {
// FIXME: When cargo is updated, change to dyn_compatibility
let trait_ = from_chalk_trait_id(trait_id);
crate::object_safety::object_safety(self.db, trait_).is_none()
crate::dyn_compatibility::dyn_compatibility(self.db, trait_).is_none()
}

fn closure_kind(
Expand Down
10 changes: 5 additions & 5 deletions src/tools/rust-analyzer/crates/hir-ty/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ use triomphe::Arc;
use crate::{
chalk_db,
consteval::ConstEvalError,
dyn_compatibility::DynCompatibilityViolation,
layout::{Layout, LayoutError},
lower::{GenericDefaults, GenericPredicates},
method_resolution::{InherentImpls, TraitImpls, TyFingerprint},
mir::{BorrowckResult, MirBody, MirLowerError},
object_safety::ObjectSafetyViolation,
Binders, ClosureId, Const, FnDefId, ImplTraitId, ImplTraits, InferenceResult, Interner,
PolyFnSig, Substitution, TraitEnvironment, TraitRef, Ty, TyDefId, ValueTyDefId,
};
Expand Down Expand Up @@ -108,8 +108,8 @@ pub trait HirDatabase: DefDatabase + Upcast<dyn DefDatabase> {
#[salsa::invoke(crate::layout::target_data_layout_query)]
fn target_data_layout(&self, krate: CrateId) -> Result<Arc<TargetDataLayout>, Arc<str>>;

#[salsa::invoke(crate::object_safety::object_safety_of_trait_query)]
fn object_safety_of_trait(&self, trait_: TraitId) -> Option<ObjectSafetyViolation>;
#[salsa::invoke(crate::dyn_compatibility::dyn_compatibility_of_trait_query)]
fn dyn_compatibility_of_trait(&self, trait_: TraitId) -> Option<DynCompatibilityViolation>;

#[salsa::invoke(crate::lower::ty_query)]
#[salsa::cycle(crate::lower::ty_recover)]
Expand Down Expand Up @@ -280,8 +280,8 @@ pub trait HirDatabase: DefDatabase + Upcast<dyn DefDatabase> {
}

#[test]
fn hir_database_is_object_safe() {
fn _assert_object_safe(_: &dyn HirDatabase) {}
fn hir_database_is_dyn_compatible() {
fn _assert_dyn_compatible(_: &dyn HirDatabase) {}
}

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl fmt::Display for CaseType {
let repr = match self {
CaseType::LowerSnakeCase => "snake_case",
CaseType::UpperSnakeCase => "UPPER_SNAKE_CASE",
CaseType::UpperCamelCase => "CamelCase",
CaseType::UpperCamelCase => "UpperCamelCase",
};

repr.fmt(f)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ mod tests {
check(to_lower_snake_case, "lower_snake_case", expect![[""]]);
check(to_lower_snake_case, "UPPER_SNAKE_CASE", expect![["upper_snake_case"]]);
check(to_lower_snake_case, "Weird_Case", expect![["weird_case"]]);
check(to_lower_snake_case, "CamelCase", expect![["camel_case"]]);
check(to_lower_snake_case, "UpperCamelCase", expect![["upper_camel_case"]]);
check(to_lower_snake_case, "lowerCamelCase", expect![["lower_camel_case"]]);
check(to_lower_snake_case, "a", expect![[""]]);
check(to_lower_snake_case, "abc", expect![[""]]);
Expand All @@ -121,8 +121,8 @@ mod tests {

#[test]
fn test_to_camel_case() {
check(to_camel_case, "CamelCase", expect![[""]]);
check(to_camel_case, "CamelCase_", expect![[""]]);
check(to_camel_case, "UpperCamelCase", expect![[""]]);
check(to_camel_case, "UpperCamelCase_", expect![[""]]);
check(to_camel_case, "_CamelCase", expect![[""]]);
check(to_camel_case, "lowerCamelCase", expect![["LowerCamelCase"]]);
check(to_camel_case, "lower_snake_case", expect![["LowerSnakeCase"]]);
Expand All @@ -143,7 +143,7 @@ mod tests {
check(to_upper_snake_case, "UPPER_SNAKE_CASE", expect![[""]]);
check(to_upper_snake_case, "lower_snake_case", expect![["LOWER_SNAKE_CASE"]]);
check(to_upper_snake_case, "Weird_Case", expect![["WEIRD_CASE"]]);
check(to_upper_snake_case, "CamelCase", expect![["CAMEL_CASE"]]);
check(to_upper_snake_case, "UpperCamelCase", expect![["UPPER_CAMEL_CASE"]]);
check(to_upper_snake_case, "lowerCamelCase", expect![["LOWER_CAMEL_CASE"]]);
check(to_upper_snake_case, "A", expect![[""]]);
check(to_upper_snake_case, "ABC", expect![[""]]);
Expand Down
Loading
Loading