Commit graph

31 commits

Author SHA1 Message Date
Josh Matthews
875e387004
script: Feature-gate all crown support. (#35055)
* script: Feature-gate all crown support.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

* script: Use cfg(crown) instead of a cargo feature.

Signed-off-by: Josh Matthews <josh@joshmatthews.net>

---------

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
2025-01-18 21:36:15 +00:00
Martin Robinson
aa0029c11c
Add rust-version to all Cargo.toml files (#33483)
This is another step preparing for building Servo without `mach`.

Fixes #33430.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
2024-09-17 16:39:07 +00:00
Samson
88d8770214
Use global exports from derives (#33169)
* pub reexport *Traceable

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* reexport `HasParent` for derives

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* reexport DomObject, Reflector, MutDomObject

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* fmt

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>

* Update lib.rs

Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>

* Update lib.rs

Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>

* Update lib.rs

Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>

---------

Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Signed-off-by: Samson <16504129+sagudev@users.noreply.github.com>
2024-08-25 13:58:09 +00:00
Martin Robinson
4a7f3bac7c
Use workspace definitions for all crates and update to the 2021 edition (#32544) 2024-06-18 09:22:08 +00:00
eri
3a5ca785d3
clippy: fix warnings in various modules in components (#31568)
* clippy: fix warnings in various modules in components

* fix: unit tests

* fix: build on android

* fix: all samplers use new_boxed
2024-03-08 14:28:04 +00:00
Samson
604979e367
Replace script_plugins with a clippy like rustc driver (named crown) (#30508)
* Remove script_plugins

* Use crown instead of script_plugins

* crown_is_not_used

* Use crown in command base

* bootstrap crown

* tidy happy

* disable sccache

* Bring crown in tree

* Install crown from tree

* fix windows ci

* fix warning

* fix mac

libscript_plugins.dylib is not available anymore

* Update components/script/lib.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

* Update for nightly-2023-03-18

Mostly just based off https://github.com/servo/servo/pull/30630

* Always install crown

it's slow only when there is new version

* Run crown test with `mach test-unit`

* Small fixups; better trace_in_no_trace tests

* Better doc

* crown in config.toml

* Fix tidy for real

* no sccache on rustc_wrapper

* document rustc overrides

* fixup of compiletest

* Make a few minor comment adjustments

* Fix a typo in python/servo/platform/base.py

Co-authored-by: Samson <16504129+sagudev@users.noreply.github.com>

* Proper test types

* Ignore tidy on crown/tests

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-12-01 15:50:52 +00:00
Samson
711dbbd4af
remove extern crate (#30311)
* remove extern crate

* Update components/script_plugins/lib.rs

Co-authored-by: Martin Robinson <mrobinson@igalia.com>

---------

Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2023-09-08 12:11:31 +00:00
Martin Robinson
2f4c47bfe7 Start the transition to workspace dependencies
This will ultimately make it simpler to update crate dependencies and
reduce duplicate when specifying requirements. Generally, this change
does not touch dependencies that are only used by a single crate. We
could consider moving them to workspace dependencies in the future.
2023-05-17 11:59:35 +02:00
sagudev
9c2cc05a8e Upgrade remaining components to edition 2018 2023-02-18 09:42:37 +01:00
Simon Sapin
bea73951db Use #![register_tool] instead of #![register_attr]
CC https://github.com/rust-lang/rust/issues/66079
2019-11-15 17:24:42 +01:00
Simon Sapin
47c269360c Remove redundant webidl_must_inherit compiler plugin lint
At first I was considering moving it to a procedural macro
(source-level information should be sufficient),
and started by trying to reproduce the error case
by changing `htmldivelement.rs` to use `Element` instead of `HTMLElement`
as the first field.

The output was:

```rust
error[E0308]: mismatched types
   --> /home/simon/servo2/target/debug/build/script-4caa244faca7d10f/out/Bindings/HTMLDivElementBinding.rs:665:31
    |
665 |         let _: &HTMLElement = self.as_parent();
    |                               ^^^^^^^^^^^^^^^^ expected struct `dom::htmlelement::HTMLElement`, found struct `dom::element::Element`
    |
    = note: expected type `&dom::htmlelement::HTMLElement`
               found type `&dom::element::Element`
```

This line number is inside a generated method called `__assert_parent_type`.
As far as I can tell, any case where this lint would error is already caught
by such methods. The lint is therefore redundant and can safely be removed.
2019-09-29 23:11:40 +02:00
Anthony Ramine
99ef7813f2 Bump all in-tree components to syn 1 2019-09-27 13:29:55 +02:00
Anthony Ramine
423cb124ba Restrict syn features for in-tree components 2019-09-27 11:55:38 +02:00
krk
dfca8ec913 Can collect webidl paths. 2019-04-20 22:39:22 +02:00
Bastien Orivel
e94de4e1bd Update syn and related dependencies 2018-11-30 17:48:41 +01:00
Jan Andre Ikenmeyer
1d6fe65401
Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
Simon Sapin
2012be4a8b cargo fix --edition-idioms 2018-11-08 09:28:00 +01:00
Pyfisch
cb07debcb6 Format remaining files 2018-11-06 22:30:31 +01:00
Simon Sapin
86f148fb97 Use 2018-style paths in code generated by proc-macro derives 2018-11-06 15:26:02 +01:00
kingdido999
d76ddabba4 Format components dom_struct, domobject_derive and embedder_traits #21373 2018-09-03 08:19:25 +08:00
Simon Sapin
3509bcb531 Upgrade to rustc 1.29.0-nightly (1ecf6929d 2018-07-16) 2018-07-18 11:25:30 +02:00
Manish Goregaokar
ad198993b1 Assert that DOM structs have the correct first field
DOM structs embed their parent type as their first field. This
introduces a `.parent()` method to the DOM struct that returns its first
field, and codegens a type assert that ensures that `.parent()` returns
the parent struct.

This generates:

On `#[dom_struct]`:

```rust
impl HasParent for Type {
    type Parent = ParentType;
    fn as_parent(&self) -> ParentType {
        &self.first_field
    }
}
```

In the codegen files:

```rust
impl Type {
    fn __assert_parent_type(&self) {
        let _: &ParentType = self.as_parent();
    }
}
````
2018-07-03 09:39:29 -07:00
Anthony Ramine
a553964123 Upgrade to rustc 1.28.0-nightly (524ad9b9e 2018-05-29)
Fixes https://github.com/servo/servo/issues/20844
2018-05-30 10:50:59 +02:00
Josh Matthews
e7979380ba Revert "Upgrade to rustc 1.27.0-nightly (8a37c75a3 2018-05-02)"
This reverts commit 46ad811017.
2018-05-18 11:44:47 -05:00
Simon Sapin
46ad811017 Upgrade to rustc 1.27.0-nightly (8a37c75a3 2018-05-02) 2018-05-04 11:38:45 +02:00
Simon Sapin
3d6614e314 Upgrade to rustc 1.27.0-nightly (056f589fb 2018-04-07) 2018-04-09 21:43:25 +02:00
Simon Sapin
1a950d263a Upgrade to rustc 1.24.0-nightly (5a2465e2b 2017-12-06) 2017-12-07 13:50:09 +01:00
Nicholas Nethercote
4506f0d30c Replace all uses of the heapsize crate with malloc_size_of.
Servo currently uses `heapsize`, but Stylo/Gecko use `malloc_size_of`.
`malloc_size_of` is better -- it handles various cases that `heapsize` does not
-- so this patch changes Servo to use `malloc_size_of`.

This patch makes the following changes to the `malloc_size_of` crate.

- Adds `MallocSizeOf` trait implementations for numerous types, some built-in
  (e.g. `VecDeque`), some external and Servo-only (e.g. `string_cache`).

- Makes `enclosing_size_of_op` optional, because vanilla jemalloc doesn't
  support that operation.

- For `HashSet`/`HashMap`, falls back to a computed estimate when
  `enclosing_size_of_op` isn't available.

- Adds an extern "C" `malloc_size_of` function that does the actual heap
  measurement; this is based on the same functions from the `heapsize` crate.

This patch makes the following changes elsewhere.

- Converts all the uses of `heapsize` to instead use `malloc_size_of`.

- Disables the "heapsize"/"heap_size" feature for the external crates that
  provide it.

- Removes the `HeapSizeOf` implementation from `hashglobe`.

- Adds `ignore` annotations to a few `Rc`/`Arc`, because `malloc_size_of`
  doesn't derive those types, unlike `heapsize`.
2017-10-18 22:20:37 +11:00
Anthony Ramine
5dad4c826d Use the better TokenStream API in dom_struct
Before:

```
error[E0412]: cannot find type `SourceBuffer` in this scope
  --> /Users/nox/src/servo/components/script/dom/mediasource.rs:25:1
   |
25 | #[dom_struct]
   | ^^^^^^^^^^^^^ did you mean `SourceBufferList`?
```

After:

```
error[E0412]: cannot find type `SourceBuffer` in this scope
  --> /Users/nox/src/servo/components/script/dom/mediasource.rs:28:39
   |
28 |     source_buffers: DOMRefCell<Vec<JS<SourceBuffer>>>,
   |                                       ^^^^^^^^^^^^ did you mean `SourceBufferList`?
```
2017-09-01 12:15:12 +02:00
Anthony Ramine
12b9a42774 Fix quote dependency version 2017-08-23 18:35:42 +02:00
Anthony Ramine
31e9d81c0f Make #[dom_struct] a proc_macro attribute 2017-02-24 01:50:51 +01:00