Skip to content

Commit e82261d

Browse files
committed
Auto merge of #50413 - kennytm:rollup, r=kennytm
Rollup of 12 pull requests Successful merges: - #50302 (Add query search order check) - #50320 (Fix invalid path generation in rustdoc search) - #50349 (Rename "show type declaration" to "show declaration") - #50360 (Clarify wordings of the `unstable_name_collision` lint.) - #50365 (Use two vectors in nearest_common_ancestor.) - #50393 (Allow unaligned reads in constants) - #50401 (Revert "Implement FromStr for PathBuf") - #50406 (Forbid constructing empty identifiers from concat_idents) - #50407 (Always inline simple BytePos and CharPos methods.) - #50416 (check if the token is a lifetime before parsing) - #50417 (Update Cargo) - #50421 (Fix ICE when using a..=b in a closure.) Failed merges:
2 parents d68b0ec + 03a0402 commit e82261d

File tree

26 files changed

+162
-61
lines changed

26 files changed

+162
-61
lines changed

src/libcore/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -606,8 +606,8 @@ mod builtin {
606606
#[macro_export]
607607
#[cfg(dox)]
608608
macro_rules! concat_idents {
609-
($($e:ident),*) => ({ /* compiler built-in */ });
610-
($($e:ident,)*) => ({ /* compiler built-in */ });
609+
($($e:ident),+) => ({ /* compiler built-in */ });
610+
($($e:ident,)+) => ({ /* compiler built-in */ });
611611
}
612612

613613
/// Concatenates literals into a static string slice.

src/librustc/hir/lowering.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3121,9 +3121,9 @@ impl<'a> LoweringContext<'a> {
31213121
}
31223122
// Desugar `<start>..=<end>` to `std::ops::RangeInclusive::new(<start>, <end>)`
31233123
ExprKind::Range(Some(ref e1), Some(ref e2), RangeLimits::Closed) => {
3124-
// FIXME: Use head_sp directly after RangeInclusive::new() is stabilized in stage0.
3124+
// FIXME: Use e.span directly after RangeInclusive::new() is stabilized in stage0.
31253125
let span = self.allow_internal_unstable(CompilerDesugaringKind::DotFill, e.span);
3126-
let id = self.lower_node_id(e.id);
3126+
let id = self.next_id();
31273127
let e1 = self.lower_expr(e1);
31283128
let e2 = self.lower_expr(e2);
31293129
let ty_path = P(self.std_path(span, &["ops", "RangeInclusive"], false));

src/librustc/lint/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ pub fn struct_lint_level<'a>(sess: &'a Session,
507507

508508
let explanation = if lint_id == LintId::of(::lint::builtin::UNSTABLE_NAME_COLLISION) {
509509
"once this method is added to the standard library, \
510-
there will be ambiguity here, which will cause a hard error!"
510+
the ambiguity may cause an error or change in behavior!"
511511
.to_owned()
512512
} else if let Some(edition) = future_incompatible.edition {
513513
format!("{} in the {} edition!", STANDARD_MESSAGE, edition)

src/librustc/middle/region.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -690,21 +690,22 @@ impl<'tcx> ScopeTree {
690690
// the start. So this algorithm is faster.
691691
let mut ma = Some(scope_a);
692692
let mut mb = Some(scope_b);
693-
let mut seen: SmallVec<[Scope; 32]> = SmallVec::new();
693+
let mut seen_a: SmallVec<[Scope; 32]> = SmallVec::new();
694+
let mut seen_b: SmallVec<[Scope; 32]> = SmallVec::new();
694695
loop {
695696
if let Some(a) = ma {
696-
if seen.iter().position(|s| *s == a).is_some() {
697+
if seen_b.iter().position(|s| *s == a).is_some() {
697698
return a;
698699
}
699-
seen.push(a);
700+
seen_a.push(a);
700701
ma = self.parent_map.get(&a).map(|s| *s);
701702
}
702703

703704
if let Some(b) = mb {
704-
if seen.iter().position(|s| *s == b).is_some() {
705+
if seen_a.iter().position(|s| *s == b).is_some() {
705706
return b;
706707
}
707-
seen.push(b);
708+
seen_b.push(b);
708709
mb = self.parent_map.get(&b).map(|s| *s);
709710
}
710711

src/librustc_mir/hair/pattern/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {
792792
ConstVal::Value(miri) => const_val_field(
793793
self.tcx, self.param_env, instance,
794794
variant_opt, field, miri, cv.ty,
795-
).unwrap(),
795+
).expect("field access failed"),
796796
_ => bug!("{:#?} is not a valid adt", cv),
797797
};
798798
self.const_to_pat(instance, val, id, span)

src/librustc_mir/interpret/eval_context.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,9 +1340,7 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M
13401340
use syntax::ast::FloatTy;
13411341

13421342
let layout = self.layout_of(ty)?;
1343-
// do the strongest layout check of the two
1344-
let align = layout.align.max(ptr_align);
1345-
self.memory.check_align(ptr, align)?;
1343+
self.memory.check_align(ptr, ptr_align)?;
13461344

13471345
if layout.size.bytes() == 0 {
13481346
return Ok(Some(Value::ByVal(PrimVal::Undef)));

src/librustdoc/html/render.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ impl<'a> Cache {
14271427
}
14281428
if let Some(ref item_name) = item.name {
14291429
let path = self.paths.get(&item.def_id)
1430-
.map(|p| p.0.join("::").to_string())
1430+
.map(|p| p.0[..p.0.len() - 1].join("::"))
14311431
.unwrap_or("std".to_owned());
14321432
for alias in item.attrs.lists("doc")
14331433
.filter(|a| a.check_name("alias"))

src/librustdoc/html/static/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1996,7 +1996,7 @@
19961996
if (e.parentNode.id === "main") {
19971997
var otherMessage;
19981998
if (hasClass(e, "type-decl")) {
1999-
otherMessage = '&nbsp;Show&nbsp;type&nbsp;declaration';
1999+
otherMessage = '&nbsp;Show&nbsp;declaration';
20002000
}
20012001
e.parentNode.insertBefore(createToggle(otherMessage), e);
20022002
if (otherMessage && getCurrentValue('rustdoc-item-declarations') !== "false") {

src/libstd/macros.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,8 +450,8 @@ pub mod builtin {
450450
#[unstable(feature = "concat_idents_macro", issue = "29599")]
451451
#[macro_export]
452452
macro_rules! concat_idents {
453-
($($e:ident),*) => ({ /* compiler built-in */ });
454-
($($e:ident,)*) => ({ /* compiler built-in */ });
453+
($($e:ident),+) => ({ /* compiler built-in */ });
454+
($($e:ident,)+) => ({ /* compiler built-in */ });
455455
}
456456

457457
/// Concatenates literals into a static string slice.

src/libstd/path.rs

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ use io;
8787
use iter::{self, FusedIterator};
8888
use ops::{self, Deref};
8989
use rc::Rc;
90-
use str::FromStr;
9190
use sync::Arc;
9291

9392
use ffi::{OsStr, OsString};
@@ -1441,32 +1440,6 @@ impl From<String> for PathBuf {
14411440
}
14421441
}
14431442

1444-
/// Error returned from [`PathBuf::from_str`][`from_str`].
1445-
///
1446-
/// Note that parsing a path will never fail. This error is just a placeholder
1447-
/// for implementing `FromStr` for `PathBuf`.
1448-
///
1449-
/// [`from_str`]: struct.PathBuf.html#method.from_str
1450-
#[derive(Debug, Clone, PartialEq, Eq)]
1451-
#[stable(feature = "path_from_str", since = "1.26.0")]
1452-
pub enum ParsePathError {}
1453-
1454-
#[stable(feature = "path_from_str", since = "1.26.0")]
1455-
impl fmt::Display for ParsePathError {
1456-
fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
1457-
match *self {}
1458-
}
1459-
}
1460-
1461-
#[stable(feature = "path_from_str", since = "1.26.0")]
1462-
impl FromStr for PathBuf {
1463-
type Err = ParsePathError;
1464-
1465-
fn from_str(s: &str) -> Result<Self, Self::Err> {
1466-
Ok(PathBuf::from(s))
1467-
}
1468-
}
1469-
14701443
#[stable(feature = "rust1", since = "1.0.0")]
14711444
impl<P: AsRef<Path>> iter::FromIterator<P> for PathBuf {
14721445
fn from_iter<I: IntoIterator<Item = P>>(iter: I) -> PathBuf {

0 commit comments

Comments
 (0)