Skip to content

Commit a24f636

Browse files
committed
Auto merge of rust-lang#64160 - Centril:rollup-vrfj1pt, r=Centril
Rollup of 15 pull requests Successful merges: - rust-lang#62860 (Stabilize checked_duration_since for 1.38.0) - rust-lang#63549 (Rev::rposition counts from the wrong end) - rust-lang#63985 (Stabilize pin_into_inner in 1.39.0) - rust-lang#64005 (Add a `Place::is_indirect` method to determine whether a `Place` contains a `Deref` projection) - rust-lang#64031 (Harden `param_attrs` test wrt. usage of a proc macro `#[attr]`) - rust-lang#64038 (Check impl trait substs when checking for recursive types) - rust-lang#64043 (Add some more tests for underscore imports) - rust-lang#64092 (Update xLTO compatibility table in rustc book.) - rust-lang#64110 (Refer to "`self` type" instead of "receiver type") - rust-lang#64120 (Move path parsing earlier) - rust-lang#64123 (Added warning around code with reference to uninit bytes) - rust-lang#64128 (unused_parens: account for or-patterns and `&(mut x)`) - rust-lang#64141 (Minimize uses of `LocalInternedString`) - rust-lang#64142 (Fix doc links in `std::cmp` module) - rust-lang#64148 (fix a few typos in comments) Failed merges: r? @ghost
2 parents f257c40 + 51ae5d0 commit a24f636

File tree

102 files changed

+1182
-433
lines changed

Some content is hidden

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

102 files changed

+1182
-433
lines changed

src/doc/rustc/src/linker-plugin-lto.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,6 @@ The following table shows known good combinations of toolchain versions.
105105
| Rust 1.34 |||
106106
| Rust 1.35 |||
107107
| Rust 1.36 |||
108+
| Rust 1.37 |||
108109

109110
Note that the compatibility policy for this feature might change in the future.

src/libcore/cmp.rs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,22 @@
99
//! * [`Ord`] and [`PartialOrd`] are traits that allow you to define total and
1010
//! partial orderings between values, respectively. Implementing them overloads
1111
//! the `<`, `<=`, `>`, and `>=` operators.
12-
//! * [`Ordering`][cmp::Ordering] is an enum returned by the
13-
//! main functions of [`Ord`] and [`PartialOrd`], and describes an ordering.
14-
//! * [`Reverse`][cmp::Reverse] is a struct that allows you to easily reverse
15-
//! an ordering.
16-
//! * [`max`][cmp::max] and [`min`][cmp::min] are functions that build off of
17-
//! [`Ord`] and allow you to find the maximum or minimum of two values.
12+
//! * [`Ordering`] is an enum returned by the main functions of [`Ord`] and
13+
//! [`PartialOrd`], and describes an ordering.
14+
//! * [`Reverse`] is a struct that allows you to easily reverse an ordering.
15+
//! * [`max`] and [`min`] are functions that build off of [`Ord`] and allow you
16+
//! to find the maximum or minimum of two values.
1817
//!
1918
//! For more details, see the respective documentation of each item in the list.
19+
//!
20+
//! [`Eq`]: trait.Eq.html
21+
//! [`PartialEq`]: trait.PartialEq.html
22+
//! [`Ord`]: trait.Ord.html
23+
//! [`PartialOrd`]: trait.PartialOrd.html
24+
//! [`Ordering`]: enum.Ordering.html
25+
//! [`Reverse`]: struct.Reverse.html
26+
//! [`max`]: fn.max.html
27+
//! [`min`]: fn.min.html
2028
2129
#![stable(feature = "rust1", since = "1.0.0")]
2230

src/libcore/iter/adapters/mod.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,6 @@ impl<I> Iterator for Rev<I> where I: DoubleEndedIterator {
6666
{
6767
self.iter.rfind(predicate)
6868
}
69-
70-
#[inline]
71-
fn rposition<P>(&mut self, predicate: P) -> Option<usize> where
72-
P: FnMut(Self::Item) -> bool
73-
{
74-
self.iter.position(predicate)
75-
}
7669
}
7770

7871
#[stable(feature = "rust1", since = "1.0.0")]

src/libcore/pin.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ impl<P: Deref<Target: Unpin>> Pin<P> {
462462
/// can ignore the pinning invariants when unwrapping it.
463463
///
464464
/// [`Unpin`]: ../../std/marker/trait.Unpin.html
465-
#[unstable(feature = "pin_into_inner", issue = "60245")]
465+
#[stable(feature = "pin_into_inner", since = "1.39.0")]
466466
#[inline(always)]
467467
pub fn into_inner(pin: Pin<P>) -> P {
468468
pin.pointer
@@ -569,7 +569,7 @@ impl<P: Deref> Pin<P> {
569569
///
570570
/// [`Unpin`]: ../../std/marker/trait.Unpin.html
571571
/// [`Pin::into_inner`]: #method.into_inner
572-
#[unstable(feature = "pin_into_inner", issue = "60245")]
572+
#[stable(feature = "pin_into_inner", since = "1.39.0")]
573573
#[inline(always)]
574574
pub unsafe fn into_inner_unchecked(pin: Pin<P>) -> P {
575575
pin.pointer

src/libcore/tests/iter.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1688,6 +1688,12 @@ fn test_rposition() {
16881688
assert!(v.iter().rposition(g).is_none());
16891689
}
16901690

1691+
#[test]
1692+
fn test_rev_rposition() {
1693+
let v = [0, 0, 1, 1];
1694+
assert_eq!(v.iter().rev().rposition(|&x| x == 1), Some(1));
1695+
}
1696+
16911697
#[test]
16921698
#[should_panic]
16931699
fn test_rposition_panic() {

src/librustc/error_codes.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Generally, `Self: Sized` is used to indicate that the trait should not be used
3939
as a trait object. If the trait comes from your own crate, consider removing
4040
this restriction.
4141
42-
### Method references the `Self` type in its arguments or return type
42+
### Method references the `Self` type in its parameters or return type
4343
4444
This happens when a trait has a method like the following:
4545

src/librustc/hir/map/collector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ impl<'a, 'hir> NodeCollector<'a, 'hir> {
186186
});
187187

188188
let mut upstream_crates: Vec<_> = cstore.crates_untracked().iter().map(|&cnum| {
189-
let name = cstore.crate_name_untracked(cnum).as_str();
189+
let name = cstore.crate_name_untracked(cnum).as_interned_str();
190190
let disambiguator = cstore.crate_disambiguator_untracked(cnum).to_fingerprint();
191191
let hash = cstore.crate_hash_untracked(cnum);
192192
(name, disambiguator, hash)

src/librustc/ich/impls_syntax.rs

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use std::mem;
99
use syntax::ast;
1010
use syntax::feature_gate;
1111
use syntax::parse::token;
12-
use syntax::symbol::{InternedString, LocalInternedString};
12+
use syntax::symbol::InternedString;
1313
use syntax::tokenstream;
1414
use syntax_pos::SourceFile;
1515

@@ -39,27 +39,6 @@ impl<'a> ToStableHashKey<StableHashingContext<'a>> for InternedString {
3939
}
4040
}
4141

42-
impl<'a> HashStable<StableHashingContext<'a>> for LocalInternedString {
43-
#[inline]
44-
fn hash_stable<W: StableHasherResult>(&self,
45-
hcx: &mut StableHashingContext<'a>,
46-
hasher: &mut StableHasher<W>) {
47-
let s: &str = &**self;
48-
s.hash_stable(hcx, hasher);
49-
}
50-
}
51-
52-
impl<'a> ToStableHashKey<StableHashingContext<'a>> for LocalInternedString {
53-
type KeyType = LocalInternedString;
54-
55-
#[inline]
56-
fn to_stable_hash_key(&self,
57-
_: &StableHashingContext<'a>)
58-
-> LocalInternedString {
59-
self.clone()
60-
}
61-
}
62-
6342
impl<'a> HashStable<StableHashingContext<'a>> for ast::Name {
6443
#[inline]
6544
fn hash_stable<W: StableHasherResult>(&self,

src/librustc/infer/error_reporting/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1627,7 +1627,7 @@ impl<'tcx> ObligationCause<'tcx> {
16271627
MainFunctionType => Error0580("main function has wrong type"),
16281628
StartFunctionType => Error0308("start function has wrong type"),
16291629
IntrinsicType => Error0308("intrinsic has wrong type"),
1630-
MethodReceiver => Error0308("mismatched method receiver"),
1630+
MethodReceiver => Error0308("mismatched `self` parameter type"),
16311631

16321632
// In the case where we have no more specific thing to
16331633
// say, also take a look at the error code, maybe we can

src/librustc/lint/context.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use crate::util::common::time;
3333
use std::default::Default as StdDefault;
3434
use syntax::ast;
3535
use syntax::edition;
36-
use syntax_pos::{MultiSpan, Span, symbol::{LocalInternedString, Symbol}};
36+
use syntax_pos::{MultiSpan, Span, symbol::Symbol};
3737
use errors::DiagnosticBuilder;
3838
use crate::hir;
3939
use crate::hir::def_id::{CrateNum, DefId, LOCAL_CRATE};
@@ -405,7 +405,7 @@ impl LintStore {
405405
pub fn check_lint_name(
406406
&self,
407407
lint_name: &str,
408-
tool_name: Option<LocalInternedString>,
408+
tool_name: Option<Symbol>,
409409
) -> CheckLintNameResult<'_> {
410410
let complete_name = if let Some(tool_name) = tool_name {
411411
format!("{}::{}", tool_name, lint_name)

0 commit comments

Comments
 (0)