Commit graph

1476 commits

Author SHA1 Message Date
Niko Matsakis
9dfa84b693 improve doc comments 2024-04-03 06:30:31 -04:00
Niko Matsakis
fd15c3a600 support customizing the DebugWithDb impl 2024-04-03 06:23:43 -04:00
Niko Matsakis
389aa66bcf print all fields in debug() but ignore deps
In a previous PR we added the `include_all_fields`
parameter to `DebugWithDb` to allow it to
not create spurious dependencies.

This PR takes a different approach: we simply
ignore the dependencies created during debug
operations. This is risky as it can create
incorrect dependencies, but it is way more
convenient and seems like what users probably
want.

It also means that `DebugWithDb` has a simpler
signature that matches the `Debug` trait again,
which seems good to me.
2024-04-03 05:59:11 -04:00
Niko Matsakis
b5aa4294bd
Merge pull request #481 from nikomatsakis/struct-field-ingredients
Struct field ingredients
2024-04-02 22:06:51 +00:00
Niko Matsakis
8772961573 clippy, you are truly righteous and exacting 2024-04-02 07:05:17 -04:00
Niko Matsakis
6eb9cb0d1b complete comment 2024-04-02 06:52:38 -04:00
Niko Matsakis
afd9b72203 pacify the merciless clippy 2024-04-02 06:51:39 -04:00
Niko Matsakis
e81b22315b driveby: fix use of indexmap remove
We do care about the order of things in this
set, in general, so use `shift_remove`.
2024-04-02 06:30:53 -04:00
Niko Matsakis
39321ed920 fix clippy warnings 2024-04-02 06:29:44 -04:00
Niko Matsakis
9a0a6518e7
Merge pull request #474 from Chronostasys/master
fix: wrong condvar usage
2024-04-02 10:15:49 +00:00
Niko Matsakis
9deaf3e149
Update components/salsa-2022/src/storage.rs 2024-04-02 06:15:43 -04:00
Niko Matsakis
3a15db7f36 book chapter 2024-04-02 06:08:55 -04:00
Niko Matsakis
54b33c335a create tracked field-ingredients 2024-04-02 06:08:55 -04:00
Niko Matsakis
796dc004f2 remove "id" fields from interned table
First step towards the new tracked struct design.

SUBTLE: This is actually broken if the `#[id]`
fields have a broken hash. We'll fix that in the
next commit and add a test.
2024-04-02 06:08:33 -04:00
Mona Lisa
998bcf606a chore: fmt 2024-03-15 23:01:30 +08:00
Mona Lisa
864344addb fix: wrong condvar usage 2024-03-15 22:44:09 +08:00
Niko Matsakis
0543972429 extract transmute_lifetime into plumbing module 2024-03-14 05:44:15 -04:00
Niko Matsakis
4142ebca97 remove unnecessary Option 2024-03-13 05:37:53 -04:00
Niko Matsakis
e909ca5c97 add a comment clarifying 2024-03-12 06:30:54 -04:00
Niko Matsakis
4151b09d3c
Merge pull request #443 from Veykril/self-span
Preserve span of receiver for query trait functions
2024-03-11 09:58:15 +00:00
Niko Matsakis
c38077fb6f
Merge pull request #470 from nodir-t/master
Remove `Implementing the Default trait` book section
2024-03-11 09:57:33 +00:00
Niko Matsakis
4a13020e61
Merge pull request #464 from DropDemBits/miri-ci
Add miri to CI
2024-03-11 09:57:07 +00:00
Nodir Turakulov
eeac4f8d33
Implementing the Default trait 2024-01-08 18:25:30 -08:00
DropDemBits
407d6bcaa7
Bump arc-swap to 1.6.0
1.6.0 fixes some UB in previous versions of `arc-swap`.
2023-11-11 00:42:47 -05:00
DropDemBits
e8fe17e638
Only execute miri on the salsa-2022 packages
These don't need to disable isolation so the `-Zmiri-isolation-error` flag can be removed.
2023-11-10 19:41:30 -05:00
DropDemBits
95d5fc2211
Add -Zmiri-isolation-error=warn miri flag
`-Zmiri-disable-isolation` can't be used since `insta` eventually ends up
calling `pipe2`, which currently doesn't have a shim in miri.
2023-11-09 23:36:23 -05:00
DropDemBits
8eadaf35dc
Add miri to CI 2023-11-09 17:50:40 -05:00
Niko Matsakis
f1d318a279
Merge pull request #450 from DropDemBits/placement-new-jars
Initialize jars in-place
2023-11-09 10:25:26 +00:00
Niko Matsakis
741a2c0e77
enable merge queues 2023-11-09 05:22:08 -05:00
Niko Matsakis
703794b1c7
Merge pull request #461 from Y-Nak/provide-access-to-ingredient-index
Provide a public API to obtain `IngredientIndex`
2023-11-09 10:21:37 +00:00
Niko Matsakis
143cd8ace5
Merge pull request #451 from xffxff/old_salsa_link
add a link to the older version of Salsa in the document
2023-11-09 05:09:53 -05:00
XFFXFF
fa4dc3ccfe update the link to old salsa 2023-10-29 10:05:08 +08:00
XFFXFF
c3a979f72c deploy both the latest and specified older version of salsa book 2023-10-29 10:02:29 +08:00
xffxff
739d0da4e3 add a link to the old version of Salsa in the document 2023-10-29 10:02:08 +08:00
Niko Matsakis
6ac3724e0a
Merge pull request #449 from DropDemBits/assert-on-tracked-struct-outside-of-tracked-fn
Improve assert message when creating a tracked struct outside of a tracked function
2023-10-28 06:58:14 -04:00
Niko Matsakis
c6ab69196a
Merge pull request #460 from cuviper/indexmap-2
Upgrade to indexmap 2
2023-10-28 06:57:23 -04:00
Yoshitomo Nakanishi
d0ca81e58f Update macro test fixtures to reflect rustc diagnostics updates 2023-10-08 21:47:01 +02:00
Yoshitomo Nakanishi
b295f5aef7 Remove unnecessary mut from make_fn_return_ref 2023-10-08 20:41:55 +02:00
Yoshitomo Nakanishi
59f094f512 Provide public API to get IngredientIndex 2023-10-08 20:40:52 +02:00
Josh Stone
db3ef9a2ba Upgrade to indexmap 2 2023-09-29 17:11:34 -07:00
DropDemBits
f1a141a6c0
Update "Jars and Ingredients" to reflect the in-place init changes 2023-06-18 00:13:54 -04:00
DropDemBits
5b8412656c
Initialize jars in-place
Requires unsafe, since Rust currently doesn't have built-in
support for guaranteed in-place initialization. Unfortunately,
this unsafety propagates to making `Jar` unsafe to implement
in order to guarantee that the jar is initialized, but since
the preferred way to implement it is via `salsa::jar`, this
won't impact most users.
2023-06-14 01:09:58 -04:00
DropDemBits
22646a8fb4
Improve assert message when creating a tracked struct outside of a tracked function 2023-06-13 16:35:28 -04:00
Lukas Wirth
0038ae2f5e Presere span of receiver for query trait functions 2023-05-02 09:46:39 +02:00
bors[bot]
d4a94fbf07
Merge #440
440: Change the constructor of `salsa::Id` to const fn r=XFFXFF a=Y-Nak

This change is motivated to allow interned structs to have default const instances and prefill them in db initialization.

A specific example is managing symbols as a salsa interned struct in a compiler implementation. By declaring keywords as `const` symbols, we can handle keywords without going through their internal representation as rustc does (ref: [rustc_span::symbol](https://github.com/rust-lang/rust/blob/master/compiler/rustc_span/src/symbol.rs)). 
Conceptually, it'd look like the one below.

```rust
#[salsa::interned]
pub struct Symbol {
    data: String,
}

const SELF_SYM: Symbol = Symbol(salsa::Id::from_u32(1))
...

/// This function is called in db initialization.
fn prefill(db: &dyn HirDb) {
       Symbol::new(db, "self".to_string());
       ...
}
```

Co-authored-by: Yoshitomo Nakanishi <yurayura.rounin.3@gmail.com>
2023-04-24 08:45:47 +00:00
Yoshitomo Nakanishi
cbafc307fc Fix trybuild ui test to adapt the change of rustc error message 2023-04-22 11:16:51 +02:00
Yoshitomo Nakanishi
5718229882 Change the constructor of salsa::Id to const fn 2023-04-12 13:36:17 +02:00
bors[bot]
67d290dc26
Merge #439
439: Run CI on trybuild test updates r=XFFXFF a=DropDemBits

See https://github.com/salsa-rs/salsa/pull/436#issuecomment-1473737721

Co-authored-by: DropDemBits <r3usrlnd@gmail.com>
2023-03-23 00:45:53 +00:00
DropDemBits
968f84d244
Run CI on trybuild test updates 2023-03-21 11:55:20 -04:00
bors[bot]
a327acc126
Merge #435
435: Allow `clippy::needless_lifetimes` on tracked method getters r=XFFXFF a=DropDemBits

The tracked method generation adds an extra `__db` lifetime to the signature, but clippy complains that this lifetime can be elided in some cases, so add an allow to silence this warning.

Unfortunately clippy doesn't lint inside of the warning tests, so those tests don't do anything to check that no clippy warnings are generated.

Co-authored-by: DropDemBits <r3usrlnd@gmail.com>
2023-03-17 12:32:20 +00:00