Skip to content

Commit 9a90d03

Browse files
committed
Auto merge of #62226 - Centril:rollup-rcy1alx, r=Centril
Rollup of 7 pull requests Successful merges: - #61199 (Revert "Set test flag when rustdoc is running with --test option" ) - #61755 (Add `--pass $mode` to compiletest through `./x.py`) - #61818 (Issue #60709 test) - #62023 (publish_toolstate: don't use 'new' from inside the loop) - #62104 (Inform the query system about properties of queries at compile time) - #62163 (Avoid mem::uninitialized() in std::sys::unix) - #62204 (doc(libcore) Fix CS) Failed merges: r? @ghost
2 parents 8ec3942 + 38801ce commit 9a90d03

File tree

41 files changed

+392
-224
lines changed

Some content is hidden

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

41 files changed

+392
-224
lines changed

src/bootstrap/builder/tests.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ fn test_with_no_doc_stage0() {
598598
bless: false,
599599
compare_mode: None,
600600
rustfix_coverage: false,
601+
pass: None,
601602
};
602603

603604
let build = Build::new(config);
@@ -640,6 +641,7 @@ fn test_exclude() {
640641
bless: false,
641642
compare_mode: None,
642643
rustfix_coverage: false,
644+
pass: None,
643645
};
644646

645647
let build = Build::new(config);

src/bootstrap/flags.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ pub enum Subcommand {
5858
/// Whether to automatically update stderr/stdout files
5959
bless: bool,
6060
compare_mode: Option<String>,
61+
pass: Option<String>,
6162
test_args: Vec<String>,
6263
rustc_args: Vec<String>,
6364
fail_fast: bool,
@@ -199,6 +200,12 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`"
199200
"mode describing what file the actual ui output will be compared to",
200201
"COMPARE MODE",
201202
);
203+
opts.optopt(
204+
"",
205+
"pass",
206+
"force {check,build,run}-pass tests to this mode.",
207+
"check | build | run"
208+
);
202209
opts.optflag(
203210
"",
204211
"rustfix-coverage",
@@ -401,6 +408,7 @@ Arguments:
401408
paths,
402409
bless: matches.opt_present("bless"),
403410
compare_mode: matches.opt_str("compare-mode"),
411+
pass: matches.opt_str("pass"),
404412
test_args: matches.opt_strs("test-args"),
405413
rustc_args: matches.opt_strs("rustc-args"),
406414
fail_fast: !matches.opt_present("no-fail-fast"),
@@ -524,6 +532,15 @@ impl Subcommand {
524532
_ => None,
525533
}
526534
}
535+
536+
pub fn pass(&self) -> Option<&str> {
537+
match *self {
538+
Subcommand::Test {
539+
ref pass, ..
540+
} => pass.as_ref().map(|s| &s[..]),
541+
_ => None,
542+
}
543+
}
527544
}
528545

529546
fn split(s: &[String]) -> Vec<String> {

src/bootstrap/test.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,6 +1065,11 @@ impl Step for Compiletest {
10651065
}
10661066
});
10671067

1068+
if let Some(ref pass) = builder.config.cmd.pass() {
1069+
cmd.arg("--pass");
1070+
cmd.arg(pass);
1071+
}
1072+
10681073
if let Some(ref nodejs) = builder.config.nodejs {
10691074
cmd.arg("--nodejs").arg(nodejs);
10701075
}

src/libcore/iter/traits/collect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ pub trait FromIterator<A>: Sized {
196196
/// ```rust
197197
/// fn collect_as_strings<T>(collection: T) -> Vec<String>
198198
/// where T: IntoIterator,
199-
/// T::Item : std::fmt::Debug,
199+
/// T::Item: std::fmt::Debug,
200200
/// {
201201
/// collection
202202
/// .into_iter()

src/libcore/marker.rs

Lines changed: 3 additions & 3 deletions
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/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,6 +510,8 @@ pub fn swap<T>(x: &mut T, y: &mut T) {
510510
/// A simple example:
511511
///
512512
/// ```
513+
/// #![feature(mem_take)]
514+
///
513515
/// use std::mem;
514516
///
515517
/// let mut v: Vec<i32> = vec![1, 2];
@@ -540,7 +542,8 @@ pub fn swap<T>(x: &mut T, y: &mut T) {
540542
/// `self`, allowing it to be returned:
541543
///
542544
/// ```
543-
/// # #![allow(dead_code)]
545+
/// #![feature(mem_take)]
546+
///
544547
/// use std::mem;
545548
///
546549
/// # struct Buffer<T> { buf: Vec<T> }

src/libcore/raw.rs

Lines changed: 2 additions & 2 deletions
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/dep_graph/dep_node.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,6 @@ macro_rules! define_dep_nodes {
142142
}
143143
}
144144

145-
// FIXME: Make `is_anon`, `is_eval_always` and `has_params` properties
146-
// of queries
147-
#[inline(always)]
148145
pub fn is_anon(&self) -> bool {
149146
match *self {
150147
$(
@@ -163,7 +160,6 @@ macro_rules! define_dep_nodes {
163160
}
164161

165162
#[allow(unreachable_code)]
166-
#[inline(always)]
167163
pub fn has_params(&self) -> bool {
168164
match *self {
169165
$(

src/librustc/ty/query/config.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::dep_graph::SerializedDepNodeIndex;
2-
use crate::dep_graph::DepNode;
2+
use crate::dep_graph::{DepKind, DepNode};
33
use crate::hir::def_id::{CrateNum, DefId};
44
use crate::ty::TyCtxt;
55
use crate::ty::query::queries;
@@ -28,13 +28,18 @@ pub trait QueryConfig<'tcx> {
2828
}
2929

3030
pub(crate) trait QueryAccessors<'tcx>: QueryConfig<'tcx> {
31+
const ANON: bool;
32+
const EVAL_ALWAYS: bool;
33+
3134
fn query(key: Self::Key) -> Query<'tcx>;
3235

3336
// Don't use this method to access query results, instead use the methods on TyCtxt
3437
fn query_cache<'a>(tcx: TyCtxt<'tcx>) -> &'a Lock<QueryCache<'tcx, Self>>;
3538

3639
fn to_dep_node(tcx: TyCtxt<'tcx>, key: &Self::Key) -> DepNode;
3740

41+
fn dep_kind() -> DepKind;
42+
3843
// Don't use this method to compute query results, instead use the methods on TyCtxt
3944
fn compute(tcx: TyCtxt<'tcx>, key: Self::Key) -> Self::Value;
4045

src/librustc/ty/query/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,6 @@ pub use self::on_disk_cache::OnDiskCache;
101101
rustc_query_append! { [define_queries!][ <'tcx>
102102
Other {
103103
/// Runs analysis passes on the crate.
104-
[] fn analysis: Analysis(CrateNum) -> Result<(), ErrorReported>,
104+
[eval_always] fn analysis: Analysis(CrateNum) -> Result<(), ErrorReported>,
105105
},
106106
]}

0 commit comments

Comments
 (0)