Skip to content

Commit 686d0ae

Browse files
committed
Auto merge of #50290 - kennytm:rollup, r=kennytm
Rollup of 9 pull requests Successful merges: - #49858 (std: Mark `ptr::Unique` with `#[doc(hidden)]`) - #49968 (Stabilize dyn trait) - #50192 (Add some utilities to `libsyntax`) - #50251 (rustc: Disable threads in LLD for wasm) - #50263 (rustc: Emit `uwtable` for allocator shims) - #50269 (Update `parking_lot` dependencies) - #50273 (Allow #[inline] on closures) - #50284 (fix search load page failure) - #50257 (Don't ICE on tuple struct ctor with incorrect arg count) Failed merges:
2 parents a997525 + dc6b167 commit 686d0ae

File tree

69 files changed

+298
-249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+298
-249
lines changed

src/Cargo.lock

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

src/liballoc/boxed.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ impl<T: ?Sized> Box<T> {
184184

185185
#[unstable(feature = "ptr_internals", issue = "0", reason = "use into_raw_non_null instead")]
186186
#[inline]
187+
#[doc(hidden)]
187188
pub fn into_unique(b: Box<T>) -> Unique<T> {
188189
let unique = b.0;
189190
mem::forget(b);

src/libcore/ptr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2513,6 +2513,7 @@ impl<T: ?Sized> PartialOrd for *mut T {
25132513
reason = "use NonNull instead and consider PhantomData<T> \
25142514
(if you also use #[may_dangle]), Send, and/or Sync")]
25152515
#[allow(deprecated)]
2516+
#[doc(hidden)]
25162517
pub struct Unique<T: ?Sized> {
25172518
pointer: NonZero<*const T>,
25182519
// NOTE: this marker has no consequences for variance, but is necessary

src/libproc_macro/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ impl Span {
270270
/// `self` was generated from, if any.
271271
#[unstable(feature = "proc_macro", issue = "38356")]
272272
pub fn parent(&self) -> Option<Span> {
273-
self.0.ctxt().outer().expn_info().map(|i| Span(i.call_site))
273+
self.0.parent().map(Span)
274274
}
275275

276276
/// The span for the origin source code that `self` was generated from. If

src/librustc/hir/check_attr.rs

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ enum Target {
3030
ForeignMod,
3131
Expression,
3232
Statement,
33+
Closure,
3334
Other,
3435
}
3536

@@ -103,14 +104,14 @@ impl<'a, 'tcx> CheckAttrVisitor<'a, 'tcx> {
103104
self.check_repr(item, target);
104105
}
105106

106-
/// Check if an `#[inline]` is applied to a function.
107+
/// Check if an `#[inline]` is applied to a function or a closure.
107108
fn check_inline(&self, attr: &hir::Attribute, span: &Span, target: Target) {
108-
if target != Target::Fn {
109+
if target != Target::Fn && target != Target::Closure {
109110
struct_span_err!(self.tcx.sess,
110111
attr.span,
111112
E0518,
112-
"attribute should be applied to function")
113-
.span_label(*span, "not a function")
113+
"attribute should be applied to function or closure")
114+
.span_label(*span, "not a function or closure")
114115
.emit();
115116
}
116117
}
@@ -286,9 +287,13 @@ impl<'a, 'tcx> CheckAttrVisitor<'a, 'tcx> {
286287
}
287288

288289
fn check_expr_attributes(&self, expr: &hir::Expr) {
290+
let target = match expr.node {
291+
hir::ExprClosure(..) => Target::Closure,
292+
_ => Target::Expression,
293+
};
289294
for attr in expr.attrs.iter() {
290295
if attr.check_name("inline") {
291-
self.check_inline(attr, &expr.span, Target::Expression);
296+
self.check_inline(attr, &expr.span, target);
292297
}
293298
if attr.check_name("repr") {
294299
self.emit_repr_error(

src/librustc/hir/lowering.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4107,15 +4107,13 @@ impl<'a> LoweringContext<'a> {
41074107
}
41084108

41094109
fn maybe_lint_bare_trait(&self, span: Span, id: NodeId, is_global: bool) {
4110-
if self.sess.features_untracked().dyn_trait {
4111-
self.sess.buffer_lint_with_diagnostic(
4112-
builtin::BARE_TRAIT_OBJECT,
4113-
id,
4114-
span,
4115-
"trait objects without an explicit `dyn` are deprecated",
4116-
builtin::BuiltinLintDiagnostics::BareTraitObject(span, is_global),
4117-
)
4118-
}
4110+
self.sess.buffer_lint_with_diagnostic(
4111+
builtin::BARE_TRAIT_OBJECT,
4112+
id,
4113+
span,
4114+
"trait objects without an explicit `dyn` are deprecated",
4115+
builtin::BuiltinLintDiagnostics::BareTraitObject(span, is_global),
4116+
)
41194117
}
41204118

41214119
fn wrap_in_try_constructor(

src/librustc/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545
#![feature(const_fn)]
4646
#![feature(core_intrinsics)]
4747
#![feature(drain_filter)]
48-
#![feature(dyn_trait)]
4948
#![feature(entry_or_default)]
49+
#![cfg_attr(stage0, feature(dyn_trait))]
5050
#![feature(from_ref)]
5151
#![feature(fs_read_write)]
5252
#![cfg_attr(windows, feature(libc))]

src/librustc/traits/error_reporting.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,12 @@ impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
979979
ArgKind::Arg(format!("{}", field.name), "_".to_string())
980980
}).collect::<Vec<_>>())
981981
}
982+
hir::map::NodeStructCtor(ref variant_data) => {
983+
(self.tcx.sess.codemap().def_span(self.tcx.hir.span(variant_data.id())),
984+
variant_data.fields()
985+
.iter().map(|_| ArgKind::Arg("_".to_owned(), "_".to_owned()))
986+
.collect())
987+
}
982988
_ => panic!("non-FnLike node found: {:?}", node),
983989
}
984990
}

src/librustc_mir/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Rust MIR: a lowered representation of Rust. Also: an experiment!
2424
#![feature(const_fn)]
2525
#![feature(core_intrinsics)]
2626
#![feature(decl_macro)]
27-
#![feature(dyn_trait)]
27+
#![cfg_attr(stage0, feature(dyn_trait))]
2828
#![feature(fs_read_write)]
2929
#![feature(macro_vis_matcher)]
3030
#![feature(exhaustive_patterns)]

src/librustc_trans/allocator.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use std::ffi::CString;
1212
use std::ptr;
1313

14+
use attributes;
1415
use libc::c_uint;
1516
use rustc::middle::allocator::AllocatorKind;
1617
use rustc::ty::TyCtxt;
@@ -67,6 +68,9 @@ pub(crate) unsafe fn trans(tcx: TyCtxt, mods: &ModuleLlvm, kind: AllocatorKind)
6768
if tcx.sess.target.target.options.default_hidden_visibility {
6869
llvm::LLVMRustSetVisibility(llfn, llvm::Visibility::Hidden);
6970
}
71+
if tcx.sess.target.target.options.requires_uwtable {
72+
attributes::emit_uwtable(llfn, true);
73+
}
7074

7175
let callee = CString::new(kind.fn_name(method.name)).unwrap();
7276
let callee = llvm::LLVMRustGetOrInsertFunction(llmod,

0 commit comments

Comments
 (0)