Skip to content

Commit 83167c4

Browse files
committed
Auto merge of #62065 - pietroalbini:beta-rollup, r=Mark-Simulacrum
[beta] Rollup backports Rolled up: * [beta] Comment out dev key #61700 Cherry picked: * Dont ICE on an attempt to use GAT without feature gate #61118 * Fix cfg(test) build for x86_64-fortanix-unknown-sgx #61503 * Handle index out of bound errors during const eval without panic #61598 * Hygienize macros in the standard library #61629 * Fix ICE involving mut references #61947 * rustc_typeck: correctly compute `Substs` for `Res::SelfCtor`. #61896 * Revert "Set test flag when rustdoc is running with --test option" #61199 * create a "provisional cache" to restore performance in the case of cycles #61754 r? @ghost
2 parents a91f2e5 + 4b3d9d4 commit 83167c4

35 files changed

+674
-209
lines changed

.azure-pipelines/auto.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Starter pipeline
2+
# Start with a minimal pipeline that you can customize to build and deploy your code.
3+
# Add steps that build, run tests, deploy, and more:
4+
# https://aka.ms/yaml
5+
6+
pr: none
7+
trigger:
8+
- auto
9+
10+
pool:
11+
vmImage: 'Ubuntu 16.04'
12+
13+
steps:
14+
- script: echo Done
15+
displayName: 'Dummy build'

src/liballoc/macros.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ macro_rules! vec {
4242
($($x:expr),*) => (
4343
<[_]>::into_vec(box [$($x),*])
4444
);
45-
($($x:expr,)*) => (vec![$($x),*])
45+
($($x:expr,)*) => ($crate::vec![$($x),*])
4646
}
4747

4848
// HACK(japaric): with cfg(test) the inherent `[T]::into_vec` method, which is

src/libcore/macros.rs

+11-11
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
#[stable(feature = "core", since = "1.6.0")]
77
macro_rules! panic {
88
() => (
9-
panic!("explicit panic")
9+
$crate::panic!("explicit panic")
1010
);
1111
($msg:expr) => ({
1212
$crate::panicking::panic(&($msg, file!(), line!(), __rust_unstable_column!()))
1313
});
1414
($msg:expr,) => (
15-
panic!($msg)
15+
$crate::panic!($msg)
1616
);
1717
($fmt:expr, $($arg:tt)+) => ({
1818
$crate::panicking::panic_fmt(format_args!($fmt, $($arg)*),
@@ -58,7 +58,7 @@ macro_rules! assert_eq {
5858
}
5959
});
6060
($left:expr, $right:expr,) => ({
61-
assert_eq!($left, $right)
61+
$crate::assert_eq!($left, $right)
6262
});
6363
($left:expr, $right:expr, $($arg:tt)+) => ({
6464
match (&($left), &($right)) {
@@ -115,7 +115,7 @@ macro_rules! assert_ne {
115115
}
116116
});
117117
($left:expr, $right:expr,) => {
118-
assert_ne!($left, $right)
118+
$crate::assert_ne!($left, $right)
119119
};
120120
($left:expr, $right:expr, $($arg:tt)+) => ({
121121
match (&($left), &($right)) {
@@ -208,7 +208,7 @@ macro_rules! debug_assert {
208208
#[macro_export]
209209
#[stable(feature = "rust1", since = "1.0.0")]
210210
macro_rules! debug_assert_eq {
211-
($($arg:tt)*) => (if cfg!(debug_assertions) { assert_eq!($($arg)*); })
211+
($($arg:tt)*) => (if cfg!(debug_assertions) { $crate::assert_eq!($($arg)*); })
212212
}
213213

214214
/// Asserts that two expressions are not equal to each other.
@@ -235,7 +235,7 @@ macro_rules! debug_assert_eq {
235235
#[macro_export]
236236
#[stable(feature = "assert_ne", since = "1.13.0")]
237237
macro_rules! debug_assert_ne {
238-
($($arg:tt)*) => (if cfg!(debug_assertions) { assert_ne!($($arg)*); })
238+
($($arg:tt)*) => (if cfg!(debug_assertions) { $crate::assert_ne!($($arg)*); })
239239
}
240240

241241
/// Unwraps a result or propagates its error.
@@ -310,7 +310,7 @@ macro_rules! r#try {
310310
return $crate::result::Result::Err($crate::convert::From::from(err))
311311
}
312312
});
313-
($expr:expr,) => (r#try!($expr));
313+
($expr:expr,) => ($crate::r#try!($expr));
314314
}
315315

316316
/// Writes formatted data into a buffer.
@@ -425,10 +425,10 @@ macro_rules! write {
425425
#[allow_internal_unstable(format_args_nl)]
426426
macro_rules! writeln {
427427
($dst:expr) => (
428-
write!($dst, "\n")
428+
$crate::write!($dst, "\n")
429429
);
430430
($dst:expr,) => (
431-
writeln!($dst)
431+
$crate::writeln!($dst)
432432
);
433433
($dst:expr, $($arg:tt)*) => (
434434
$dst.write_fmt(format_args_nl!($($arg)*))
@@ -493,10 +493,10 @@ macro_rules! unreachable {
493493
panic!("internal error: entered unreachable code")
494494
});
495495
($msg:expr) => ({
496-
unreachable!("{}", $msg)
496+
$crate::unreachable!("{}", $msg)
497497
});
498498
($msg:expr,) => ({
499-
unreachable!($msg)
499+
$crate::unreachable!($msg)
500500
});
501501
($fmt:expr, $($arg:tt)*) => ({
502502
panic!(concat!("internal error: entered unreachable code: ", $fmt), $($arg)*)

src/libcore/marker.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,9 @@ impl<T: ?Sized> !Send for *mut T { }
7373
/// impl Foo for Impl { }
7474
/// impl Bar for Impl { }
7575
///
76-
/// let x: &Foo = &Impl; // OK
77-
/// // let y: &Bar = &Impl; // error: the trait `Bar` cannot
78-
/// // be made into an object
76+
/// let x: &dyn Foo = &Impl; // OK
77+
/// // let y: &dyn Bar = &Impl; // error: the trait `Bar` cannot
78+
/// // be made into an object
7979
/// ```
8080
///
8181
/// [trait object]: ../../book/ch17-02-trait-objects.html

src/libcore/mem.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ impl<T: ?Sized> DerefMut for ManuallyDrop<T> {
10711071
/// optimizations, potentially resulting in a larger size:
10721072
///
10731073
/// ```rust
1074-
/// # use std::mem::{MaybeUninit, size_of, align_of};
1074+
/// # use std::mem::{MaybeUninit, size_of};
10751075
/// assert_eq!(size_of::<Option<bool>>(), 1);
10761076
/// assert_eq!(size_of::<Option<MaybeUninit<bool>>>(), 2);
10771077
/// ```

src/libcore/raw.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
/// let value: i32 = 123;
5454
///
5555
/// // let the compiler make a trait object
56-
/// let object: &Foo = &value;
56+
/// let object: &dyn Foo = &value;
5757
///
5858
/// // look at the raw representation
5959
/// let raw_object: raw::TraitObject = unsafe { mem::transmute(object) };
@@ -65,7 +65,7 @@
6565
///
6666
/// // construct a new object, pointing to a different `i32`, being
6767
/// // careful to use the `i32` vtable from `object`
68-
/// let synthesized: &Foo = unsafe {
68+
/// let synthesized: &dyn Foo = unsafe {
6969
/// mem::transmute(raw::TraitObject {
7070
/// data: &other_value as *const _ as *mut (),
7171
/// vtable: raw_object.vtable,

src/librustc/middle/region.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -658,12 +658,15 @@ impl<'tcx> ScopeTree {
658658
// The lifetime was defined on node that doesn't own a body,
659659
// which in practice can only mean a trait or an impl, that
660660
// is the parent of a method, and that is enforced below.
661-
assert_eq!(Some(param_owner_id), self.root_parent,
662-
"free_scope: {:?} not recognized by the \
663-
region scope tree for {:?} / {:?}",
664-
param_owner,
665-
self.root_parent.map(|id| tcx.hir().local_def_id_from_hir_id(id)),
666-
self.root_body.map(|hir_id| DefId::local(hir_id.owner)));
661+
if Some(param_owner_id) != self.root_parent {
662+
tcx.sess.delay_span_bug(
663+
DUMMY_SP,
664+
&format!("free_scope: {:?} not recognized by the \
665+
region scope tree for {:?} / {:?}",
666+
param_owner,
667+
self.root_parent.map(|id| tcx.hir().local_def_id_from_hir_id(id)),
668+
self.root_body.map(|hir_id| DefId::local(hir_id.owner))));
669+
}
667670

668671
// The trait/impl lifetime is in scope for the method's body.
669672
self.root_body.unwrap().local_id

src/librustc/traits/query/evaluate_obligation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx> {
6464
Err(OverflowError) => {
6565
let mut selcx =
6666
SelectionContext::with_query_mode(&self, TraitQueryMode::Standard);
67-
selcx.evaluate_obligation_recursively(obligation)
67+
selcx.evaluate_root_obligation(obligation)
6868
.unwrap_or_else(|r| {
6969
span_bug!(
7070
obligation.cause.span,

0 commit comments

Comments
 (0)