Skip to content

Commit e82a604

Browse files
committed
Auto merge of #2731 - RalfJung:rustup, r=RalfJung
Rustup
2 parents 7893132 + 39bb865 commit e82a604

File tree

1,013 files changed

+13066
-8457
lines changed

Some content is hidden

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

1,013 files changed

+13066
-8457
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ jobs:
430430
os: windows-latest-xl
431431
- name: dist-x86_64-msvc
432432
env:
433-
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --host=x86_64-pc-windows-msvc --target=x86_64-pc-windows-msvc --enable-full-tools --enable-profiler"
433+
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --host=x86_64-pc-windows-msvc --target=x86_64-pc-windows-msvc --enable-full-tools --enable-profiler --set rust.lto=thin"
434434
SCRIPT: PGO_HOST=x86_64-pc-windows-msvc src/ci/pgo.sh python x.py dist bootstrap --include-default-paths
435435
DIST_REQUIRE_ALL_TOOLS: 1
436436
os: windows-latest-xl

Cargo.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -809,9 +809,9 @@ dependencies = [
809809

810810
[[package]]
811811
name = "compiler_builtins"
812-
version = "0.1.84"
812+
version = "0.1.85"
813813
source = "registry+https://github.com/rust-lang/crates.io-index"
814-
checksum = "989b2c1ca6e90ad06fdc69d1d1862fa28d27a977be6d92ae2fa762cf61fe0b10"
814+
checksum = "13e81c6cd7ab79f51a0c927d22858d61ad12bd0b3865f0b13ece02a4486aeabb"
815815
dependencies = [
816816
"cc",
817817
"rustc-std-workspace-core",
@@ -4627,9 +4627,9 @@ dependencies = [
46274627

46284628
[[package]]
46294629
name = "rustix"
4630-
version = "0.36.3"
4630+
version = "0.36.5"
46314631
source = "registry+https://github.com/rust-lang/crates.io-index"
4632-
checksum = "0b1fbb4dfc4eb1d390c02df47760bb19a84bb80b301ecc947ab5406394d8223e"
4632+
checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588"
46334633
dependencies = [
46344634
"bitflags",
46354635
"errno",

RELEASES.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,94 @@
1+
Version 1.66.0 (2022-12-15)
2+
==========================
3+
4+
Language
5+
--------
6+
- [Permit specifying explicit discriminants on all `repr(Int)` enums](https://github.com/rust-lang/rust/pull/95710/)
7+
```rust
8+
#[repr(u8)]
9+
enum Foo {
10+
A(u8) = 0,
11+
B(i8) = 1,
12+
C(bool) = 42,
13+
}
14+
```
15+
- [Allow transmutes between the same type differing only in lifetimes](https://github.com/rust-lang/rust/pull/101520/)
16+
- [Change constant evaluation errors from a deny-by-default lint to a hard error](https://github.com/rust-lang/rust/pull/102091/)
17+
- [Trigger `must_use` on `impl Trait` for supertraits](https://github.com/rust-lang/rust/pull/102287/)
18+
This makes `impl ExactSizeIterator` respect the existing `#[must_use]` annotation on `Iterator`.
19+
- [Allow `..=X` in patterns](https://github.com/rust-lang/rust/pull/102275/)
20+
- [Uplift `clippy::for_loops_over_fallibles` lint into rustc](https://github.com/rust-lang/rust/pull/99696/)
21+
- [Stabilize `sym` operands in inline assembly](https://github.com/rust-lang/rust/pull/103168/)
22+
- [Update to Unicode 15](https://github.com/rust-lang/rust/pull/101912/)
23+
- [Opaque types no longer imply lifetime bounds](https://github.com/rust-lang/rust/pull/95474/)
24+
This is a soundness fix which may break code that was erroneously relying on this behavior.
25+
26+
Compiler
27+
--------
28+
- [Add armv5te-none-eabi and thumbv5te-none-eabi tier 3 targets](https://github.com/rust-lang/rust/pull/101329/)
29+
- Refer to Rust's [platform support page][platform-support-doc] for more
30+
information on Rust's tiered platform support.
31+
- [Add support for linking against macOS universal libraries](https://github.com/rust-lang/rust/pull/98736)
32+
33+
Libraries
34+
---------
35+
- [Fix `#[derive(Default)]` on a generic `#[default]` enum adding unnecessary `Default` bounds](https://github.com/rust-lang/rust/pull/101040/)
36+
- [Update to Unicode 15](https://github.com/rust-lang/rust/pull/101821/)
37+
38+
Stabilized APIs
39+
---------------
40+
41+
- [`proc_macro::Span::source_text`](https://doc.rust-lang.org/stable/proc_macro/struct.Span.html#method.source_text)
42+
- [`uX::{checked_add_signed, overflowing_add_signed, saturating_add_signed, wrapping_add_signed}`](https://doc.rust-lang.org/stable/std/primitive.u8.html#method.checked_add_signed)
43+
- [`iX::{checked_add_unsigned, overflowing_add_unsigned, saturating_add_unsigned, wrapping_add_unsigned}`](https://doc.rust-lang.org/stable/std/primitive.i8.html#method.checked_add_unsigned)
44+
- [`iX::{checked_sub_unsigned, overflowing_sub_unsigned, saturating_sub_unsigned, wrapping_sub_unsigned}`](https://doc.rust-lang.org/stable/std/primitive.i8.html#method.checked_sub_unsigned)
45+
- [`BTreeSet::{first, last, pop_first, pop_last}`](https://doc.rust-lang.org/stable/std/collections/struct.BTreeSet.html#method.first)
46+
- [`BTreeMap::{first_key_value, last_key_value, first_entry, last_entry, pop_first, pop_last}`](https://doc.rust-lang.org/stable/std/collections/struct.BTreeMap.html#method.first_key_value)
47+
- [Add `AsFd` implementations for stdio lock types on WASI.](https://github.com/rust-lang/rust/pull/101768/)
48+
- [`impl TryFrom<Vec<T>> for Box<[T; N]>`](https://doc.rust-lang.org/stable/std/boxed/struct.Box.html#impl-TryFrom%3CVec%3CT%2C%20Global%3E%3E-for-Box%3C%5BT%3B%20N%5D%2C%20Global%3E)
49+
- [`core::hint::black_box`](https://doc.rust-lang.org/stable/std/hint/fn.black_box.html)
50+
- [`Duration::try_from_secs_{f32,f64}`](https://doc.rust-lang.org/stable/std/time/struct.Duration.html#method.try_from_secs_f32)
51+
- [`Option::unzip`](https://doc.rust-lang.org/stable/std/option/enum.Option.html#method.unzip)
52+
- [`std::os::fd`](https://doc.rust-lang.org/stable/std/os/fd/index.html)
53+
54+
55+
Rustdoc
56+
-------
57+
58+
- [Add Rustdoc warning for invalid HTML tags in the documentation](https://github.com/rust-lang/rust/pull/101720/)
59+
60+
Cargo
61+
-----
62+
63+
- [Added `cargo remove` to remove dependencies from Cargo.toml](https://doc.rust-lang.org/nightly/cargo/commands/cargo-remove.html)
64+
- [`cargo publish` now waits for the new version to be downloadable before exiting](https://github.com/rust-lang/cargo/pull/11062)
65+
66+
See [detailed release notes](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-166-2022-12-15) for more.
67+
68+
Compatibility Notes
69+
-------------------
70+
71+
- [Only apply `ProceduralMasquerade` hack to older versions of `rental`](https://github.com/rust-lang/rust/pull/94063/)
72+
- [Don't export `__heap_base` and `__data_end` on wasm32-wasi.](https://github.com/rust-lang/rust/pull/102385/)
73+
- [Don't export `__wasm_init_memory` on WebAssembly.](https://github.com/rust-lang/rust/pull/102426/)
74+
- [Only export `__tls_*` on wasm32-unknown-unknown.](https://github.com/rust-lang/rust/pull/102440/)
75+
- [Don't link to `libresolv` in libstd on Darwin](https://github.com/rust-lang/rust/pull/102766/)
76+
- [Update libstd's libc to 0.2.135 (to make `libstd` no longer pull in `libiconv.dylib` on Darwin)](https://github.com/rust-lang/rust/pull/103277/)
77+
- [Opaque types no longer imply lifetime bounds](https://github.com/rust-lang/rust/pull/95474/)
78+
This is a soundness fix which may break code that was erroneously relying on this behavior.
79+
- [Make `order_dependent_trait_objects` show up in future-breakage reports](https://github.com/rust-lang/rust/pull/102635/)
80+
- [Change std::process::Command spawning to default to inheriting the parent's signal mask](https://github.com/rust-lang/rust/pull/101077/)
81+
82+
Internal Changes
83+
----------------
84+
85+
These changes do not affect any public interfaces of Rust, but they represent
86+
significant improvements to the performance or internals of rustc and related
87+
tools.
88+
89+
- [Enable BOLT for LLVM compilation](https://github.com/rust-lang/rust/pull/94381/)
90+
- [Enable LTO for rustc_driver.so](https://github.com/rust-lang/rust/pull/101403/)
91+
192
Version 1.65.0 (2022-11-03)
293
==========================
394

compiler/rustc_abi/src/lib.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#![cfg_attr(feature = "nightly", feature(step_trait, rustc_attrs, min_specialization))]
22

3-
use std::convert::{TryFrom, TryInto};
43
use std::fmt;
54
#[cfg(feature = "nightly")]
65
use std::iter::Step;
@@ -803,12 +802,9 @@ impl Integer {
803802
pub fn for_align<C: HasDataLayout>(cx: &C, wanted: Align) -> Option<Integer> {
804803
let dl = cx.data_layout();
805804

806-
for candidate in [I8, I16, I32, I64, I128] {
807-
if wanted == candidate.align(dl).abi && wanted.bytes() == candidate.size().bytes() {
808-
return Some(candidate);
809-
}
810-
}
811-
None
805+
[I8, I16, I32, I64, I128].into_iter().find(|&candidate| {
806+
wanted == candidate.align(dl).abi && wanted.bytes() == candidate.size().bytes()
807+
})
812808
}
813809

814810
/// Find the largest integer with the given alignment or less.

compiler/rustc_apfloat/src/ieee.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use crate::{Category, ExpInt, IEK_INF, IEK_NAN, IEK_ZERO};
22
use crate::{Float, FloatConvert, ParseError, Round, Status, StatusAnd};
33

44
use core::cmp::{self, Ordering};
5-
use core::convert::TryFrom;
65
use core::fmt::{self, Write};
76
use core::marker::PhantomData;
87
use core::mem;

compiler/rustc_arena/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use smallvec::SmallVec;
2828
use std::alloc::Layout;
2929
use std::cell::{Cell, RefCell};
3030
use std::cmp;
31-
use std::marker::{PhantomData, Send};
31+
use std::marker::PhantomData;
3232
use std::mem::{self, MaybeUninit};
3333
use std::ptr::{self, NonNull};
3434
use std::slice;

compiler/rustc_ast/src/ast.rs

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
3333
use rustc_span::source_map::{respan, Spanned};
3434
use rustc_span::symbol::{kw, sym, Ident, Symbol};
3535
use rustc_span::{Span, DUMMY_SP};
36-
use std::convert::TryFrom;
3736
use std::fmt;
3837
use std::mem;
3938
use thin_vec::{thin_vec, ThinVec};
@@ -1735,8 +1734,10 @@ pub enum StrStyle {
17351734
/// A literal in a meta item.
17361735
#[derive(Clone, Encodable, Decodable, Debug, HashStable_Generic)]
17371736
pub struct MetaItemLit {
1738-
/// The original literal token as written in source code.
1739-
pub token_lit: token::Lit,
1737+
/// The original literal as written in the source code.
1738+
pub symbol: Symbol,
1739+
/// The original suffix as written in the source code.
1740+
pub suffix: Option<Symbol>,
17401741
/// The "semantic" representation of the literal lowered from the original tokens.
17411742
/// Strings are unescaped, hexadecimal forms are eliminated, etc.
17421743
pub kind: LitKind,
@@ -1746,13 +1747,14 @@ pub struct MetaItemLit {
17461747
/// Similar to `MetaItemLit`, but restricted to string literals.
17471748
#[derive(Clone, Copy, Encodable, Decodable, Debug)]
17481749
pub struct StrLit {
1749-
/// The original literal token as written in source code.
1750-
pub style: StrStyle,
1750+
/// The original literal as written in source code.
17511751
pub symbol: Symbol,
1752+
/// The original suffix as written in source code.
17521753
pub suffix: Option<Symbol>,
1753-
pub span: Span,
1754-
/// The unescaped "semantic" representation of the literal lowered from the original token.
1754+
/// The semantic (unescaped) representation of the literal.
17551755
pub symbol_unescaped: Symbol,
1756+
pub style: StrStyle,
1757+
pub span: Span,
17561758
}
17571759

17581760
impl StrLit {
@@ -1798,8 +1800,9 @@ pub enum LitKind {
17981800
/// A string literal (`"foo"`). The symbol is unescaped, and so may differ
17991801
/// from the original token's symbol.
18001802
Str(Symbol, StrStyle),
1801-
/// A byte string (`b"foo"`).
1802-
ByteStr(Lrc<[u8]>),
1803+
/// A byte string (`b"foo"`). Not stored as a symbol because it might be
1804+
/// non-utf8, and symbols only allow utf8 strings.
1805+
ByteStr(Lrc<[u8]>, StrStyle),
18031806
/// A byte char (`b'f'`).
18041807
Byte(u8),
18051808
/// A character literal (`'a'`).
@@ -1824,7 +1827,7 @@ impl LitKind {
18241827

18251828
/// Returns `true` if this literal is byte literal string.
18261829
pub fn is_bytestr(&self) -> bool {
1827-
matches!(self, LitKind::ByteStr(_))
1830+
matches!(self, LitKind::ByteStr(..))
18281831
}
18291832

18301833
/// Returns `true` if this is a numeric literal.
@@ -2463,20 +2466,14 @@ pub enum ModKind {
24632466
Unloaded,
24642467
}
24652468

2466-
#[derive(Copy, Clone, Encodable, Decodable, Debug)]
2469+
#[derive(Copy, Clone, Encodable, Decodable, Debug, Default)]
24672470
pub struct ModSpans {
24682471
/// `inner_span` covers the body of the module; for a file module, its the whole file.
24692472
/// For an inline module, its the span inside the `{ ... }`, not including the curly braces.
24702473
pub inner_span: Span,
24712474
pub inject_use_span: Span,
24722475
}
24732476

2474-
impl Default for ModSpans {
2475-
fn default() -> ModSpans {
2476-
ModSpans { inner_span: Default::default(), inject_use_span: Default::default() }
2477-
}
2478-
}
2479-
24802477
/// Foreign module declaration.
24812478
///
24822479
/// E.g., `extern { .. }` or `extern "C" { .. }`.
@@ -3101,7 +3098,7 @@ mod size_asserts {
31013098
static_assert_size!(ItemKind, 112);
31023099
static_assert_size!(LitKind, 24);
31033100
static_assert_size!(Local, 72);
3104-
static_assert_size!(MetaItemLit, 48);
3101+
static_assert_size!(MetaItemLit, 40);
31053102
static_assert_size!(Param, 40);
31063103
static_assert_size!(Pat, 88);
31073104
static_assert_size!(Path, 24);

compiler/rustc_ast/src/attr/mod.rs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
//! Functions dealing with attributes and meta items.
22
3-
use crate::ast;
43
use crate::ast::{AttrArgs, AttrArgsEq, AttrId, AttrItem, AttrKind, AttrStyle, AttrVec, Attribute};
54
use crate::ast::{DelimArgs, Expr, ExprKind, LitKind, MetaItemLit};
65
use crate::ast::{MacDelimiter, MetaItem, MetaItemKind, NestedMetaItem, NormalAttr};
7-
use crate::ast::{Path, PathSegment, StrStyle, DUMMY_NODE_ID};
6+
use crate::ast::{Path, PathSegment, DUMMY_NODE_ID};
87
use crate::ptr::P;
98
use crate::token::{self, CommentKind, Delimiter, Token};
109
use crate::tokenstream::{DelimSpan, Spacing, TokenTree};
1110
use crate::tokenstream::{LazyAttrTokenStream, TokenStream};
1211
use crate::util::comments;
12+
use crate::util::literal::escape_string_symbol;
1313
use rustc_data_structures::sync::WorkerLocal;
1414
use rustc_index::bit_set::GrowableBitSet;
1515
use rustc_span::symbol::{sym, Ident, Symbol};
@@ -321,18 +321,6 @@ impl Attribute {
321321
}
322322
}
323323

324-
/* Constructors */
325-
326-
pub fn mk_name_value_item_str(ident: Ident, str: Symbol, str_span: Span) -> MetaItem {
327-
mk_name_value_item(ident, LitKind::Str(str, ast::StrStyle::Cooked), str_span)
328-
}
329-
330-
pub fn mk_name_value_item(ident: Ident, kind: LitKind, lit_span: Span) -> MetaItem {
331-
let lit = MetaItemLit { token_lit: kind.to_token_lit(), kind, span: lit_span };
332-
let span = ident.span.to(lit_span);
333-
MetaItem { path: Path::from_ident(ident), kind: MetaItemKind::NameValue(lit), span }
334-
}
335-
336324
pub struct AttrIdGenerator(WorkerLocal<Cell<u32>>);
337325

338326
#[cfg(debug_assertions)]
@@ -408,7 +396,7 @@ pub fn mk_attr_name_value_str(
408396
val: Symbol,
409397
span: Span,
410398
) -> Attribute {
411-
let lit = LitKind::Str(val, StrStyle::Cooked).to_token_lit();
399+
let lit = token::Lit::new(token::Str, escape_string_symbol(val), None);
412400
let expr = P(Expr {
413401
id: DUMMY_NODE_ID,
414402
kind: ExprKind::Lit(lit),

compiler/rustc_ast/src/ptr.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
//! Moreover, a switch to, e.g., `P<'a, T>` would be easy and mostly automated.
2323
2424
use std::fmt::{self, Debug, Display};
25-
use std::iter::FromIterator;
2625
use std::ops::{Deref, DerefMut};
2726
use std::{slice, vec};
2827

compiler/rustc_ast/src/token.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ impl Lit {
114114
if let NtExpr(expr) | NtLiteral(expr) = &**nt
115115
&& let ast::ExprKind::Lit(token_lit) = expr.kind =>
116116
{
117-
Some(token_lit.clone())
117+
Some(token_lit)
118118
}
119119
_ => None,
120120
}

compiler/rustc_ast/src/tokenstream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ impl TokenStream {
362362
}
363363
}
364364

365-
impl iter::FromIterator<TokenTree> for TokenStream {
365+
impl FromIterator<TokenTree> for TokenStream {
366366
fn from_iter<I: IntoIterator<Item = TokenTree>>(iter: I) -> Self {
367367
TokenStream::new(iter.into_iter().collect::<Vec<TokenTree>>())
368368
}

0 commit comments

Comments
 (0)