Skip to content

Commit bf03485

Browse files
author
bors-servo
authored
Auto merge of #23726 - servo:rustup, r=<try>
Upgrade to rustc 1.38.0-nightly (4b65a86eb 2019-07-15) <del>This uses `MaybeUninit` in Stylo. `MaybeUninit` is stable in Rust 1.36.0, which Firefox [plans](https://wiki.mozilla.org/Rust_Update_Policy_for_Firefox) to require on 2019-06-18.</del> Update: `MaybeUninit` in Stylo removed from this PR, after rust-lang/rust#62599. <!-- 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/23726) <!-- Reviewable:end -->
2 parents 005320c + cabdc2d commit bf03485

File tree

9 files changed

+76
-79
lines changed

9 files changed

+76
-79
lines changed

Cargo.lock

Lines changed: 52 additions & 51 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

components/background_hang_monitor/sampler_linux.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,15 @@ struct PosixSemaphore {
6464

6565
impl PosixSemaphore {
6666
pub fn new(value: u32) -> io::Result<Self> {
67-
let mut sem: libc::sem_t = unsafe { mem::uninitialized() };
67+
let mut sem = mem::MaybeUninit::uninit();
6868
let r = unsafe {
69-
libc::sem_init(&mut sem, 0 /* not shared */, value)
69+
libc::sem_init(sem.as_mut_ptr(), 0 /* not shared */, value)
7070
};
7171
if r == -1 {
7272
return Err(io::Error::last_os_error());
7373
}
7474
Ok(PosixSemaphore {
75-
sem: UnsafeCell::new(sem),
75+
sem: UnsafeCell::new(unsafe { sem.assume_init() }),
7676
})
7777
}
7878

@@ -150,7 +150,7 @@ enum RegNum {
150150
Sp = UNW_REG_SP as isize,
151151
}
152152

153-
fn get_register(cursor: &mut unw_cursor_t, num: RegNum) -> Result<u64, i32> {
153+
fn get_register(cursor: *mut unw_cursor_t, num: RegNum) -> Result<u64, i32> {
154154
unsafe {
155155
let mut val = 0;
156156
let ret = unw_get_reg(cursor, num as i32, &mut val);
@@ -162,7 +162,7 @@ fn get_register(cursor: &mut unw_cursor_t, num: RegNum) -> Result<u64, i32> {
162162
}
163163
}
164164

165-
fn step(cursor: &mut unw_cursor_t) -> Result<bool, i32> {
165+
fn step(cursor: *mut unw_cursor_t) -> Result<bool, i32> {
166166
unsafe {
167167
// libunwind 1.1 seems to get confused and walks off the end of the stack. The last IP
168168
// it reports is 0, so we'll stop if we're there.
@@ -204,23 +204,23 @@ impl Sampler for LinuxSampler {
204204
}
205205

206206
let context = unsafe { SHARED_STATE.context.load(Ordering::SeqCst) };
207-
let mut cursor = unsafe { mem::uninitialized() };
208-
let ret = unsafe { unw_init_local(&mut cursor, context) };
207+
let mut cursor = mem::MaybeUninit::uninit();
208+
let ret = unsafe { unw_init_local(cursor.as_mut_ptr(), context) };
209209
let result = if ret == UNW_ESUCCESS {
210210
let mut native_stack = NativeStack::new();
211211
loop {
212-
let ip = match get_register(&mut cursor, RegNum::Ip) {
212+
let ip = match get_register(cursor.as_mut_ptr(), RegNum::Ip) {
213213
Ok(ip) => ip,
214214
Err(_) => break,
215215
};
216-
let sp = match get_register(&mut cursor, RegNum::Sp) {
216+
let sp = match get_register(cursor.as_mut_ptr(), RegNum::Sp) {
217217
Ok(sp) => sp,
218218
Err(_) => break,
219219
};
220220
if native_stack
221221
.process_register(ip as *mut _, sp as *mut _)
222222
.is_err() ||
223-
!step(&mut cursor).unwrap_or(false)
223+
!step(cursor.as_mut_ptr()).unwrap_or(false)
224224
{
225225
break;
226226
}

components/script/dom/webglshader.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use dom_struct::dom_struct;
2121
use mozangle::shaders::{BuiltInResources, Output, ShaderValidator};
2222
use std::cell::Cell;
2323
use std::os::raw::c_int;
24-
use std::sync::{Once, ONCE_INIT};
24+
use std::sync::Once;
2525

2626
#[derive(Clone, Copy, Debug, JSTraceable, MallocSizeOf, PartialEq)]
2727
pub enum ShaderCompilationStatus {
@@ -42,7 +42,7 @@ pub struct WebGLShader {
4242
compilation_status: Cell<ShaderCompilationStatus>,
4343
}
4444

45-
static GLSLANG_INITIALIZATION: Once = ONCE_INIT;
45+
static GLSLANG_INITIALIZATION: Once = Once::new();
4646

4747
impl WebGLShader {
4848
fn new_inherited(context: &WebGLRenderingContext, id: WebGLShaderId, shader_type: u32) -> Self {

components/script/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,16 @@ use script_traits::SWManagerSenders;
106106
#[cfg(target_os = "linux")]
107107
#[allow(unsafe_code)]
108108
fn perform_platform_specific_initialization() {
109-
use std::mem;
110109
// 4096 is default max on many linux systems
111110
const MAX_FILE_LIMIT: libc::rlim_t = 4096;
112111

113112
// Bump up our number of file descriptors to save us from impending doom caused by an onslaught
114113
// of iframes.
115114
unsafe {
116-
let mut rlim: libc::rlimit = mem::uninitialized();
115+
let mut rlim = libc::rlimit {
116+
rlim_cur: 0,
117+
rlim_max: 0,
118+
};
117119
match libc::getrlimit(libc::RLIMIT_NOFILE, &mut rlim) {
118120
0 => {
119121
if rlim.rlim_cur >= MAX_FILE_LIMIT {

components/script_plugins/unrooted_must_root.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
161161
.all(|a| !a.check_name(self.symbols.must_root))
162162
{
163163
for ref field in def.fields() {
164-
let def_id = cx.tcx.hir().local_def_id_from_hir_id(field.hir_id);
164+
let def_id = cx.tcx.hir().local_def_id(field.hir_id);
165165
if is_unrooted_ty(&self.symbols, cx, cx.tcx.type_of(def_id), false) {
166166
cx.span_lint(UNROOTED_MUST_ROOT, field.span,
167167
"Type must be rooted, use #[must_root] on the struct definition to propagate")
@@ -182,7 +182,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
182182
match var.node.data {
183183
hir::VariantData::Tuple(ref fields, ..) => {
184184
for ref field in fields {
185-
let def_id = cx.tcx.hir().local_def_id_from_hir_id(field.hir_id);
185+
let def_id = cx.tcx.hir().local_def_id(field.hir_id);
186186
if is_unrooted_ty(&self.symbols, cx, cx.tcx.type_of(def_id), false) {
187187
cx.span_lint(
188188
UNROOTED_MUST_ROOT,
@@ -215,7 +215,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnrootedPass {
215215
};
216216

217217
if !in_derive_expn(span) {
218-
let def_id = cx.tcx.hir().local_def_id_from_hir_id(id);
218+
let def_id = cx.tcx.hir().local_def_id(id);
219219
let sig = cx.tcx.type_of(def_id).fn_sig(cx.tcx);
220220

221221
for (arg, ty) in decl.inputs.iter().zip(sig.inputs().skip_binder().iter()) {

components/script_plugins/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use rustc::hir::def_id::DefId;
66
use rustc::lint::LateContext;
7-
use syntax::source_map::{ExpnFormat, Span};
7+
use syntax::source_map::{ExpnKind, MacroKind, Span};
88
use syntax::symbol::Symbol;
99

1010
/// check if a DefId's path matches the given absolute type path
@@ -31,7 +31,7 @@ pub fn match_def_path(cx: &LateContext, def_id: DefId, path: &[Symbol]) -> bool
3131

3232
pub fn in_derive_expn(span: Span) -> bool {
3333
if let Some(i) = span.ctxt().outer().expn_info() {
34-
if let ExpnFormat::MacroAttribute(n) = i.format {
34+
if let ExpnKind::Macro(MacroKind::Attr, n) = i.kind {
3535
n.as_str().contains("derive")
3636
} else {
3737
false

components/script_plugins/webidl_must_inherit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for WebIdlPass {
185185
_gen: &'tcx hir::Generics,
186186
id: HirId,
187187
) {
188-
let def_id = cx.tcx.hir().local_def_id_from_hir_id(id);
188+
let def_id = cx.tcx.hir().local_def_id(id);
189189
if !is_webidl_ty(&self.symbols, cx, cx.tcx.type_of(def_id)) {
190190
return;
191191
}
@@ -196,7 +196,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for WebIdlPass {
196196
};
197197

198198
let parent_name = def.fields().iter().next().map(|field| {
199-
let def_id = cx.tcx.hir().local_def_id_from_hir_id(field.hir_id);
199+
let def_id = cx.tcx.hir().local_def_id(field.hir_id);
200200
let ty = cx.tcx.type_of(def_id).to_string();
201201
get_ty_name(&ty).to_string()
202202
});

etc/rustdoc-with-private

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
#!/bin/sh
22

3-
# Work around https://github.com/rust-lang/rust/issues/62132
4-
if [ "$2" = "synstructure" -o "$2" = "derivative" ]
5-
then
6-
exit
7-
fi
8-
93
# Emit documentation for private items so it is easier to look
104
# up internal definitions.
115
#

rust-toolchain

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
nightly-2019-07-04
1+
nightly-2019-07-16

0 commit comments

Comments
 (0)