Commit graph

35 commits

Author SHA1 Message Date
Martin Robinson
a0640c8524
Address issues uncovered by rust-1.78 beta (#32130)
This change makes changes to allow Servo to compile with the 1.78
version of Rust:

 - Dead code is removd (Rust seems to have gotten better at detecting
   it).
 - The `FlowRef` `DerefMut` is updated according to @SimonSapin's advice
   [^1].
 - The `imports.rs` now explicitly silences warnings about unused
   imports.

[^1]: https://github.com/servo/servo/issues/6503#issuecomment-2066088179

<!-- Please describe your changes on the following line: -->


---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes do not require tests because they should not change
behavior.

<!-- Also, please make sure that "Allow edits from maintainers" checkbox
is checked, so that we can help you if you get stuck somewhere along the
way.-->

<!-- Pull requests that do not address these steps are welcome, but they
will require additional verification as part of the review process. -->
2024-04-22 18:20:47 +00:00
eri
a6e25d555b
clippy: Fix warnings in components/layout (#31612)
* clippy: fix warnings in components/layout

* fix: formatting
2024-03-11 10:24:36 +00:00
Martin Robinson
5c1723c983
rustdoc: Fix many rustdoc errors (#31147)
This fixes many rustdoc errors that occur due to raw URLs in rustdoc
comments as well as unescaped Rust code that should be in backticks.
2024-01-22 13:13:48 +00:00
Samson
aad2dccc9c
Strict import formatting (grouping and granularity) (#30325)
* strict imports formatting

* Reformat all imports
2023-09-11 19:16:54 +00: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
Simon Sapin
45f7199eee cargo fix --edition 2018-11-06 15:26:02 +01:00
Pyfisch
349047b096 Rustfmt layout crate 2018-09-01 13:24:57 +02:00
Clément DAVID
c5fe235112 order derivable traits lists
Ignoring :
 - **generated**.rs
 - python/tidy/servo_tidy_tests/rust_tidy.rs
2017-08-23 21:38:44 +02:00
Shing Lyu
8bea421329 Migrated -Z trace-layout to serde_json 2016-11-07 15:54:07 +08:00
Michael Howell
5f320bd2ca Make FlowRef a newtype
This creates a sharp distinction between `Arc<Flow>`s, which may be
owned by anyone, and `FlowRef`s, which may only be owned by the
traversal code. By checking the reference count, we ensure that a `Flow`
cannot be pointed to by `Arc`s and `FlowRef`s simultaneously.

This is not a complete fix for #6503, though it is a necessary start
(enforcing the no-aliasing rule of `FlowRef::deref_mut` will require far
more work).

Fixes #14014
2016-11-04 13:36:04 -07:00
Ms2ger
206d603f53 Correct the signature of flow_ref::deref_mut.
This also fixes Undefined Behavior in build_display_list_for_subtree.
2016-06-06 15:14:23 +02:00
Adam Szopa
88991013ab Remove explicit lifetimes which can be elided. 2015-10-21 01:27:48 +02:00
Simon Sapin
21d69314d4 Don’t mark flow_ref::deref_mut as unsafe.
See discussion in https://github.com/servo/servo/pull/7237
2015-08-21 21:16:25 +02:00
Simon Sapin
649250130b Replace FlowRef with Arc<Flow>, now that Arc supports DST.
… and WeakFlowRef with Weak<Flow>.
2015-08-20 16:49:48 +02:00
Simon Sapin
2d22aa8e7e Replace the unsound impl DerefMut for FlowRef with an unsafe function.
See #6503.
2015-08-20 16:24:26 +02:00
Johann Tuffe
ec07178b6f sort all uses 2015-08-20 20:47:12 +08:00
Ms2ger
b37d9cc173 Remove Deref and DerefMut implementations from WeakFlowRef.
By definition of a weak pointer, these implementations cannot be safe.
2015-06-27 18:09:14 +02:00
Ms2ger
d6aa0915c3 Use the heap module through its facade in libstd. 2015-06-26 20:52:28 +02:00
Simon Sapin
ef8edd4e87 Upgrade to rustc 551a74dddd84cf01440ee84148ebd18bc68bd7c8. 2015-05-05 10:07:34 -04:00
Manish Goregaokar
3479d3fa7f Replace unsafe_blocks by unsafe_code. 2015-03-21 10:27:32 +01:00
Ms2ger
1604515fd9 Fix various build warnings. 2015-03-20 17:57:49 +01:00
Jack Moffitt
237150fa49 Fix memory leak in flow tree by adding weak refs.
Cycles were being created in the flow tree since absolutely positioned
descendants had pointers to their containing blocks. This adds
WeakFlowRef (based on Weak<T>) and makes these backpointers weak
references. This also harmonizes our custom Arc<T>, FlowRef, to be
consistent with the upstream implementation.

Fixes #4915.
2015-03-16 12:53:16 -06:00
Ms2ger
7c6b03abfe Opt-in rather than opt-out to unsafe blocks in layout. 2015-02-08 20:03:27 +01:00
Ms2ger
a819b0b1b6 Fix the documentation comment syntax in flow_ref.rs. 2015-02-08 19:56:04 +01:00
Ms2ger
1b3e368bcd Don't shadow lifetimes in layout. 2015-01-28 14:44:32 +01:00
Josh Matthews
95fc29fa0d Update rustc to 00b112c45a604fa6f4b59af2a40c9deeadfdb7c6/rustc-1.0.0-dev. 2015-01-28 10:16:49 +10:00
Ms2ger
13c7cf928a Stop calling deref() and deref_mut() explicitly. 2015-01-22 16:04:21 +01:00
Ms2ger
faefb27f3e Use std::sync::atomic::Ordering explicitly. 2015-01-22 14:49:25 +01:00
Ms2ger
16c7060bc8 Update rustc to revision 2cfb5acb5a2751c759627377e602bac4f88f2d19. 2015-01-08 09:58:46 -05:00
Ms2ger
ac95d12037 Remove some manual deref() / deref_mut() calls. 2014-12-16 16:41:33 +01:00
Jack Moffitt
d1b433a3b3 Rust upgrade to rustc hash b03a2755193cd756583bcf5831cf4545d75ecb8a 2014-11-13 11:17:43 +10:00
Clark Gaebel
76ed7484eb Use the Deref traits for FlowRefs.
This patch switches FlowRefs to using the Deref and DerefMut traits, instead of
the custom `get` and `get_mut` functions.
2014-10-15 11:04:05 -07:00
Keegan McAllister
a640a7c5c3 Upgrade to rustc 0.12.0-pre (4d2af3861 2014-09-17 15:51:11 +0000) 2014-09-20 13:00:06 -07:00
Jack Moffitt
c6ab60dbfc Cargoify servo 2014-09-08 20:21:42 -06:00
Renamed from src/components/layout/flow_ref.rs (Browse further)