aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-04-12 13:02:40 -0400
committerGitHub <noreply@github.com>2019-04-12 13:02:40 -0400
commit83186242d443d57a38c23d4dd873b4e26bc0a336 (patch)
tree5972d4108b31821b64d5274185be10b36b1faed0 /components/script
parenta74f5222db7f7f39e426cd0b8836f5b806730ef7 (diff)
parent44163148c2fe2b6b92f1129a493e086ab5594d19 (diff)
downloadservo-83186242d443d57a38c23d4dd873b4e26bc0a336.tar.gz
servo-83186242d443d57a38c23d4dd873b4e26bc0a336.zip
Auto merge of #23196 - servo:rustup, r=jdm
Make use of RefCell::try_borrow_unguarded <!-- Reviewable:start --> This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23196) <!-- Reviewable:end -->
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/bindings/cell.rs4
-rw-r--r--components/script/dom/xmlhttprequest.rs2
-rw-r--r--components/script/lib.rs1
3 files changed, 4 insertions, 3 deletions
diff --git a/components/script/dom/bindings/cell.rs b/components/script/dom/bindings/cell.rs
index cccc172ee97..525ac069fe3 100644
--- a/components/script/dom/bindings/cell.rs
+++ b/components/script/dom/bindings/cell.rs
@@ -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.
diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs
index e0ba954964c..cb1d0d06196 100644
--- a/components/script/dom/xmlhttprequest.rs
+++ b/components/script/dom/xmlhttprequest.rs
@@ -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"));
diff --git a/components/script/lib.rs b/components/script/lib.rs
index 565cdbfc6c2..a057540ae22 100644
--- a/components/script/lib.rs
+++ b/components/script/lib.rs
@@ -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)]