Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit f42692b

Browse files
committed
Auto merge of rust-lang#77954 - JohnTitor:rollup-bpoy497, r=JohnTitor
Rollup of 9 pull requests Successful merges: - rust-lang#77570 (Allow ascii whitespace char for doc aliases ) - rust-lang#77739 (Remove unused code) - rust-lang#77753 (Check html comments) - rust-lang#77879 (Provide better documentation and help messages for x.py setup) - rust-lang#77902 (Include aarch64-pc-windows-msvc in the dist manifests) - rust-lang#77934 (Document -Z codegen-backend in the unstable book) - rust-lang#77936 (Remove needless alloc_slice) - rust-lang#77946 (Validate references to source scopes) - rust-lang#77951 (Update books) Failed merges: r? `@ghost`
2 parents e160e5c + 00100a4 commit f42692b

File tree

66 files changed

+302
-784
lines changed

Some content is hidden

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

66 files changed

+302
-784
lines changed

compiler/rustc_ast/src/ast.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -167,13 +167,6 @@ pub enum GenericArgs {
167167
}
168168

169169
impl GenericArgs {
170-
pub fn is_parenthesized(&self) -> bool {
171-
match *self {
172-
Parenthesized(..) => true,
173-
_ => false,
174-
}
175-
}
176-
177170
pub fn is_angle_bracketed(&self) -> bool {
178171
match *self {
179172
AngleBracketed(..) => true,
@@ -857,13 +850,6 @@ impl BinOpKind {
857850
}
858851
}
859852

860-
pub fn is_shift(&self) -> bool {
861-
match *self {
862-
BinOpKind::Shl | BinOpKind::Shr => true,
863-
_ => false,
864-
}
865-
}
866-
867853
pub fn is_comparison(&self) -> bool {
868854
use BinOpKind::*;
869855
// Note for developers: please keep this as is;
@@ -873,11 +859,6 @@ impl BinOpKind {
873859
And | Or | Add | Sub | Mul | Div | Rem | BitXor | BitAnd | BitOr | Shl | Shr => false,
874860
}
875861
}
876-
877-
/// Returns `true` if the binary operator takes its arguments by value
878-
pub fn is_by_value(&self) -> bool {
879-
!self.is_comparison()
880-
}
881862
}
882863

883864
pub type BinOp = Spanned<BinOpKind>;
@@ -896,14 +877,6 @@ pub enum UnOp {
896877
}
897878

898879
impl UnOp {
899-
/// Returns `true` if the unary operator takes its argument by value
900-
pub fn is_by_value(u: UnOp) -> bool {
901-
match u {
902-
UnOp::Neg | UnOp::Not => true,
903-
_ => false,
904-
}
905-
}
906-
907880
pub fn to_string(op: UnOp) -> &'static str {
908881
match op {
909882
UnOp::Deref => "*",
@@ -1753,13 +1726,6 @@ impl IntTy {
17531726
}
17541727
}
17551728

1756-
pub fn val_to_string(&self, val: i128) -> String {
1757-
// Cast to a `u128` so we can correctly print `INT128_MIN`. All integral types
1758-
// are parsed as `u128`, so we wouldn't want to print an extra negative
1759-
// sign.
1760-
format!("{}{}", val as u128, self.name_str())
1761-
}
1762-
17631729
pub fn bit_width(&self) -> Option<u64> {
17641730
Some(match *self {
17651731
IntTy::Isize => return None,
@@ -1818,10 +1784,6 @@ impl UintTy {
18181784
}
18191785
}
18201786

1821-
pub fn val_to_string(&self, val: u128) -> String {
1822-
format!("{}{}", val, self.name_str())
1823-
}
1824-
18251787
pub fn bit_width(&self) -> Option<u64> {
18261788
Some(match *self {
18271789
UintTy::Usize => return None,

compiler/rustc_ast/src/attr/mod.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,6 @@ impl NestedMetaItem {
101101
self.meta_item().is_some()
102102
}
103103

104-
/// Returns `true` if the variant is `Literal`.
105-
pub fn is_literal(&self) -> bool {
106-
self.literal().is_some()
107-
}
108-
109104
/// Returns `true` if `self` is a `MetaItem` and the meta item is a word.
110105
pub fn is_word(&self) -> bool {
111106
self.meta_item().map_or(false, |meta_item| meta_item.is_word())
@@ -232,10 +227,6 @@ impl MetaItem {
232227
pub fn is_value_str(&self) -> bool {
233228
self.value_str().is_some()
234229
}
235-
236-
pub fn is_meta_item_list(&self) -> bool {
237-
self.meta_item_list().is_some()
238-
}
239230
}
240231

241232
impl AttrItem {

compiler/rustc_ast/src/token.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,6 @@ pub enum DelimToken {
5454
NoDelim,
5555
}
5656

57-
impl DelimToken {
58-
pub fn len(self) -> usize {
59-
if self == NoDelim { 0 } else { 1 }
60-
}
61-
62-
pub fn is_empty(self) -> bool {
63-
self == NoDelim
64-
}
65-
}
66-
6757
#[derive(Clone, Copy, PartialEq, Encodable, Decodable, Debug, HashStable_Generic)]
6858
pub enum LitKind {
6959
Bool, // AST only, must never appear in a `Token`

compiler/rustc_ast/src/tokenstream.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,6 @@ impl TokenStream {
295295
.collect(),
296296
))
297297
}
298-
299-
pub fn map<F: FnMut(TokenTree) -> TokenTree>(self, mut f: F) -> TokenStream {
300-
TokenStream(Lrc::new(
301-
self.0.iter().map(|(tree, is_joint)| (f(tree.clone()), *is_joint)).collect(),
302-
))
303-
}
304298
}
305299

306300
// 99.5%+ of the time we have 1 or 2 elements in this vector.

compiler/rustc_ast/src/util/parser.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ impl AssocOp {
231231
}
232232
}
233233

234-
pub const PREC_RESET: i8 = -100;
235234
pub const PREC_CLOSURE: i8 = -40;
236235
pub const PREC_JUMP: i8 = -30;
237236
pub const PREC_RANGE: i8 = -10;

compiler/rustc_codegen_llvm/src/llvm/mod.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,6 @@ pub fn SetUnnamedAddress(global: &'a Value, unnamed: UnnamedAddr) {
118118
}
119119
}
120120

121-
pub fn set_thread_local(global: &'a Value, is_thread_local: bool) {
122-
unsafe {
123-
LLVMSetThreadLocal(global, is_thread_local as Bool);
124-
}
125-
}
126121
pub fn set_thread_local_mode(global: &'a Value, mode: ThreadLocalMode) {
127122
unsafe {
128123
LLVMSetThreadLocalMode(global, mode);

compiler/rustc_codegen_ssa/src/back/write.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1519,8 +1519,6 @@ fn start_executing_work<B: ExtraBackendMethods>(
15191519
}
15201520
}
15211521

1522-
pub const CODEGEN_WORKER_ID: usize = usize::MAX;
1523-
15241522
/// `FatalError` is explicitly not `Send`.
15251523
#[must_use]
15261524
pub struct WorkerFatalError;

compiler/rustc_codegen_ssa/src/base.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,6 @@ fn get_argc_argv<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
479479
}
480480
}
481481

482-
pub const CODEGEN_WORKER_ID: usize = usize::MAX;
483-
484482
pub fn codegen_crate<B: ExtraBackendMethods>(
485483
backend: B,
486484
tcx: TyCtxt<'tcx>,

compiler/rustc_data_structures/src/work_queue.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ pub struct WorkQueue<T: Idx> {
1414
}
1515

1616
impl<T: Idx> WorkQueue<T> {
17-
/// Creates a new work queue with all the elements from (0..len).
18-
#[inline]
19-
pub fn with_all(len: usize) -> Self {
20-
WorkQueue { deque: (0..len).map(T::new).collect(), set: BitSet::new_filled(len) }
21-
}
22-
2317
/// Creates a new work queue that starts empty, where elements range from (0..len).
2418
#[inline]
2519
pub fn with_none(len: usize) -> Self {

compiler/rustc_errors/src/diagnostic.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,6 @@ impl Diagnostic {
121121
self.level == Level::Cancelled
122122
}
123123

124-
/// Set the sorting span.
125-
pub fn set_sort_span(&mut self, sp: Span) {
126-
self.sort_span = sp;
127-
}
128-
129124
/// Adds a span/label to be included in the resulting snippet.
130125
///
131126
/// This is pushed onto the [`MultiSpan`] that was created when the diagnostic
@@ -535,14 +530,6 @@ impl Diagnostic {
535530
&self.message
536531
}
537532

538-
/// Used by a lint. Copies over all details *but* the "main
539-
/// message".
540-
pub fn copy_details_not_message(&mut self, from: &Diagnostic) {
541-
self.span = from.span.clone();
542-
self.code = from.code.clone();
543-
self.children.extend(from.children.iter().cloned())
544-
}
545-
546533
/// Convenience function for internal use, clients should use one of the
547534
/// public methods above.
548535
pub fn sub(

0 commit comments

Comments
 (0)