Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make use of RefCell::try_borrow_unguarded
  • Loading branch information
nox committed Apr 12, 2019
1 parent a74f522 commit 4416314
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
8 changes: 6 additions & 2 deletions components/constellation/constellation.rs
Expand Up @@ -2030,18 +2030,22 @@ where
None
};

// https://github.com/rust-lang/rust/issues/59159
let browsing_context_size = browsing_context.size;
let browsing_context_is_visible = browsing_context.is_visible;

// Create the new pipeline, attached to the parent and push to pending changes
self.new_pipeline(
new_pipeline_id,
browsing_context_id,
top_level_browsing_context_id,
Some(parent_pipeline_id),
None,
browsing_context.size,
browsing_context_size,
load_data,
load_info.sandbox,
is_private,
browsing_context.is_visible,
browsing_context_is_visible,
);
self.add_pending_change(SessionHistoryChange {
top_level_browsing_context_id: top_level_browsing_context_id,
Expand Down
4 changes: 3 additions & 1 deletion components/script/dom/bindings/cell.rs
Expand Up @@ -26,7 +26,9 @@ impl<T> DomRefCell<T> {
#[allow(unsafe_code)]
pub unsafe fn borrow_for_layout(&self) -> &T {
debug_assert!(thread_state::get().is_layout());
&*self.value.as_ptr()
self.value
.try_borrow_unguarded()
.expect("cell is mutably borrowed")
}

/// Borrow the contents for the purpose of script deallocation.
Expand Down
2 changes: 0 additions & 2 deletions components/script/dom/xmlhttprequest.rs
Expand Up @@ -1442,8 +1442,6 @@ impl XMLHttpRequest {

fn filter_response_headers(&self) -> HeaderMap {
// https://fetch.spec.whatwg.org/#concept-response-header-list
use http::header::{self, HeaderName};

let mut headers = self.response_headers.borrow().clone();
headers.remove(header::SET_COOKIE);
headers.remove(HeaderName::from_static("set-cookie2"));
Expand Down
1 change: 1 addition & 0 deletions components/script/lib.rs
Expand Up @@ -4,6 +4,7 @@

#![cfg_attr(feature = "unstable", feature(core_intrinsics))]
#![cfg_attr(feature = "unstable", feature(on_unimplemented))]
#![feature(borrow_state)]
#![feature(const_fn)]
#![feature(drain_filter)]
#![feature(inner_deref)]
Expand Down
1 change: 0 additions & 1 deletion components/style/error_reporting.rs
Expand Up @@ -245,7 +245,6 @@ impl ParseErrorReporter for RustLogReporter {
location: SourceLocation,
error: ContextualParseError,
) {
use log;
if log_enabled!(log::Level::Info) {
info!(
"Url:\t{}\n{}:{} {}",
Expand Down
1 change: 0 additions & 1 deletion components/style/servo/selector_parser.rs
Expand Up @@ -354,7 +354,6 @@ impl NonTSPseudoClass {
/// selector matching, and it's set from the DOM.
pub fn state_flag(&self) -> ElementState {
use self::NonTSPseudoClass::*;
use crate::element_state::ElementState;
match *self {
Active => ElementState::IN_ACTIVE_STATE,
Focus => ElementState::IN_FOCUS_STATE,
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain
@@ -1 +1 @@
nightly-2019-03-26
nightly-2019-04-12

0 comments on commit 4416314

Please sign in to comment.