| author | bors <bors@rust-lang.org> 2024-09-23 02:02:22 UTC |
| committer | bors <bors@rust-lang.org> 2024-09-23 02:02:22 UTC |
| log | 66b0b29e65c77e5801c308e725a233c0728df300 |
| tree | 8c72f79e844035a65c7153b21dd8ef3cacacdbfa |
| parent | d14c1c75ab284d382bd1e9c499596c274f1abe58 |
| parent | 9132770c8f920fea72af23b56acb67c1f1d6928d |
Bump stage0 to beta-2024-09-22 and rustfmt to nightly-2024-09-22
I'm doing this to apply the changes to version sorting (https://github.com/rust-lang/rustfmt/pull/6284) that have occurred since rustfmt last upgraded (and a few other miscellaneous changes, like changes to expression overflowing: https://github.com/rust-lang/rustfmt/pull/6260). Eagerly updating rustfmt and formatting-the-world will ideally move some of the pressure off of the beta bump which will happen at the beginning of the next release cycle.
You can verify this is correct by checking out the changes, reverting the last commit, reapplying them, and diffing the changes:
```
git fetch git@github.com:compiler-errors/rust.git bump
git checkout -b bump FETCH_HEAD
git reset --hard HEAD~5
./x.py fmt --all
git diff FETCH_HEAD
# ignore the changes to stage0, and rustfmt.toml,
# and test file changes in rustdoc-js-std, run-make.
```
Or just take my word for it? Up to the reviewer.
r? release1459 files changed, 7616 insertions(+), 8848 deletions(-)
compiler/rustc_abi/src/layout.rs+1-1| ... | ... | @@ -999,8 +999,8 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> { |
| 999 | 999 | if repr.can_randomize_type_layout() && cfg!(feature = "randomize") { |
| 1000 | 1000 | #[cfg(feature = "randomize")] |
| 1001 | 1001 | { |
| 1002 | use rand::seq::SliceRandom; | |
| 1003 | 1002 | use rand::SeedableRng; |
| 1003 | use rand::seq::SliceRandom; | |
| 1004 | 1004 | // `ReprOptions.field_shuffle_seed` is a deterministic seed we can use to randomize field |
| 1005 | 1005 | // ordering. |
| 1006 | 1006 | let mut rng = |
compiler/rustc_abi/src/lib.rs+4-7| ... | ... | @@ -1138,13 +1138,10 @@ impl Scalar { |
| 1138 | 1138 | #[inline] |
| 1139 | 1139 | pub fn is_bool(&self) -> bool { |
| 1140 | 1140 | use Integer::*; |
| 1141 | matches!( | |
| 1142 | self, | |
| 1143 | Scalar::Initialized { | |
| 1144 | value: Primitive::Int(I8, false), | |
| 1145 | valid_range: WrappingRange { start: 0, end: 1 } | |
| 1146 | } | |
| 1147 | ) | |
| 1141 | matches!(self, Scalar::Initialized { | |
| 1142 | value: Primitive::Int(I8, false), | |
| 1143 | valid_range: WrappingRange { start: 0, end: 1 } | |
| 1144 | }) | |
| 1148 | 1145 | } |
| 1149 | 1146 | |
| 1150 | 1147 | /// Get the primitive representation of this type, ignoring the valid range and whether the |
compiler/rustc_ast/src/ast.rs+7-7| ... | ... | @@ -21,19 +21,19 @@ |
| 21 | 21 | use std::borrow::Cow; |
| 22 | 22 | use std::{cmp, fmt, mem}; |
| 23 | 23 | |
| 24 | pub use GenericArgs::*; | |
| 25 | pub use UnsafeSource::*; | |
| 24 | 26 | pub use rustc_ast_ir::{Movability, Mutability}; |
| 25 | 27 | use rustc_data_structures::packed::Pu128; |
| 26 | 28 | use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; |
| 27 | 29 | use rustc_data_structures::stack::ensure_sufficient_stack; |
| 28 | 30 | use rustc_data_structures::sync::Lrc; |
| 29 | 31 | use rustc_macros::{Decodable, Encodable, HashStable_Generic}; |
| 30 | use rustc_span::source_map::{respan, Spanned}; | |
| 31 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 32 | 32 | pub use rustc_span::AttrId; |
| 33 | use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP}; | |
| 34 | use thin_vec::{thin_vec, ThinVec}; | |
| 35 | pub use GenericArgs::*; | |
| 36 | pub use UnsafeSource::*; | |
| 33 | use rustc_span::source_map::{Spanned, respan}; | |
| 34 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 35 | use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span}; | |
| 36 | use thin_vec::{ThinVec, thin_vec}; | |
| 37 | 37 | |
| 38 | 38 | pub use crate::format::*; |
| 39 | 39 | use crate::ptr::P; |
| ... | ... | @@ -288,7 +288,7 @@ impl ParenthesizedArgs { |
| 288 | 288 | } |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | pub use crate::node_id::{NodeId, CRATE_NODE_ID, DUMMY_NODE_ID}; | |
| 291 | pub use crate::node_id::{CRATE_NODE_ID, DUMMY_NODE_ID, NodeId}; | |
| 292 | 292 | |
| 293 | 293 | /// Modifiers on a trait bound like `~const`, `?` and `!`. |
| 294 | 294 | #[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug)] |
compiler/rustc_ast/src/attr/mod.rs+6-6| ... | ... | @@ -4,15 +4,15 @@ use std::iter; |
| 4 | 4 | use std::sync::atomic::{AtomicU32, Ordering}; |
| 5 | 5 | |
| 6 | 6 | use rustc_index::bit_set::GrowableBitSet; |
| 7 | use rustc_span::symbol::{sym, Ident, Symbol}; | |
| 8 | 7 | use rustc_span::Span; |
| 9 | use smallvec::{smallvec, SmallVec}; | |
| 10 | use thin_vec::{thin_vec, ThinVec}; | |
| 8 | use rustc_span::symbol::{Ident, Symbol, sym}; | |
| 9 | use smallvec::{SmallVec, smallvec}; | |
| 10 | use thin_vec::{ThinVec, thin_vec}; | |
| 11 | 11 | |
| 12 | 12 | use crate::ast::{ |
| 13 | AttrArgs, AttrArgsEq, AttrId, AttrItem, AttrKind, AttrStyle, AttrVec, Attribute, DelimArgs, | |
| 14 | Expr, ExprKind, LitKind, MetaItem, MetaItemKind, MetaItemLit, NestedMetaItem, NormalAttr, Path, | |
| 15 | PathSegment, Safety, DUMMY_NODE_ID, | |
| 13 | AttrArgs, AttrArgsEq, AttrId, AttrItem, AttrKind, AttrStyle, AttrVec, Attribute, DUMMY_NODE_ID, | |
| 14 | DelimArgs, Expr, ExprKind, LitKind, MetaItem, MetaItemKind, MetaItemLit, NestedMetaItem, | |
| 15 | NormalAttr, Path, PathSegment, Safety, | |
| 16 | 16 | }; |
| 17 | 17 | use crate::ptr::P; |
| 18 | 18 | use crate::token::{self, CommentKind, Delimiter, Token}; |
compiler/rustc_ast/src/entry.rs+2-2| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | use rustc_span::symbol::sym; | |
| 2 | 1 | use rustc_span::Symbol; |
| 2 | use rustc_span::symbol::sym; | |
| 3 | 3 | |
| 4 | use crate::{attr, Attribute}; | |
| 4 | use crate::{Attribute, attr}; | |
| 5 | 5 | |
| 6 | 6 | #[derive(Debug)] |
| 7 | 7 | pub enum EntryPointType { |
compiler/rustc_ast/src/expand/allocator.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use rustc_macros::HashStable_Generic; |
| 2 | use rustc_span::symbol::{sym, Symbol}; | |
| 2 | use rustc_span::symbol::{Symbol, sym}; | |
| 3 | 3 | |
| 4 | 4 | #[derive(Clone, Debug, Copy, Eq, PartialEq, HashStable_Generic)] |
| 5 | 5 | pub enum AllocatorKind { |
compiler/rustc_ast/src/format.rs+2-2| ... | ... | @@ -1,10 +1,10 @@ |
| 1 | 1 | use rustc_data_structures::fx::FxHashMap; |
| 2 | 2 | use rustc_macros::{Decodable, Encodable}; |
| 3 | use rustc_span::symbol::{Ident, Symbol}; | |
| 4 | 3 | use rustc_span::Span; |
| 4 | use rustc_span::symbol::{Ident, Symbol}; | |
| 5 | 5 | |
| 6 | use crate::ptr::P; | |
| 7 | 6 | use crate::Expr; |
| 7 | use crate::ptr::P; | |
| 8 | 8 | |
| 9 | 9 | // Definitions: |
| 10 | 10 | // |
compiler/rustc_ast/src/mut_visit.rs+2-2| ... | ... | @@ -13,10 +13,10 @@ use std::panic; |
| 13 | 13 | use rustc_data_structures::flat_map_in_place::FlatMapInPlace; |
| 14 | 14 | use rustc_data_structures::stack::ensure_sufficient_stack; |
| 15 | 15 | use rustc_data_structures::sync::Lrc; |
| 16 | use rustc_span::Span; | |
| 16 | 17 | use rustc_span::source_map::Spanned; |
| 17 | 18 | use rustc_span::symbol::Ident; |
| 18 | use rustc_span::Span; | |
| 19 | use smallvec::{smallvec, Array, SmallVec}; | |
| 19 | use smallvec::{Array, SmallVec, smallvec}; | |
| 20 | 20 | use thin_vec::ThinVec; |
| 21 | 21 | |
| 22 | 22 | use crate::ast::*; |
compiler/rustc_ast/src/token.rs+8-8| ... | ... | @@ -1,21 +1,21 @@ |
| 1 | 1 | use std::borrow::Cow; |
| 2 | 2 | use std::fmt; |
| 3 | 3 | |
| 4 | pub use BinOpToken::*; | |
| 5 | pub use LitKind::*; | |
| 6 | pub use Nonterminal::*; | |
| 7 | pub use NtExprKind::*; | |
| 8 | pub use NtPatKind::*; | |
| 9 | pub use TokenKind::*; | |
| 4 | 10 | use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; |
| 5 | 11 | use rustc_data_structures::sync::Lrc; |
| 6 | 12 | use rustc_macros::{Decodable, Encodable, HashStable_Generic}; |
| 7 | 13 | use rustc_span::edition::Edition; |
| 8 | use rustc_span::symbol::{kw, sym}; | |
| 9 | 14 | #[allow(clippy::useless_attribute)] // FIXME: following use of `hidden_glob_reexports` incorrectly triggers `useless_attribute` lint. |
| 10 | 15 | #[allow(hidden_glob_reexports)] |
| 11 | 16 | use rustc_span::symbol::{Ident, Symbol}; |
| 12 | use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP}; | |
| 13 | pub use BinOpToken::*; | |
| 14 | pub use LitKind::*; | |
| 15 | pub use Nonterminal::*; | |
| 16 | pub use NtExprKind::*; | |
| 17 | pub use NtPatKind::*; | |
| 18 | pub use TokenKind::*; | |
| 17 | use rustc_span::symbol::{kw, sym}; | |
| 18 | use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span}; | |
| 19 | 19 | |
| 20 | 20 | use crate::ast; |
| 21 | 21 | use crate::ptr::P; |
compiler/rustc_ast/src/tokenstream.rs+1-1| ... | ... | @@ -20,7 +20,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; |
| 20 | 20 | use rustc_data_structures::sync::{self, Lrc}; |
| 21 | 21 | use rustc_macros::{Decodable, Encodable, HashStable_Generic}; |
| 22 | 22 | use rustc_serialize::{Decodable, Encodable}; |
| 23 | use rustc_span::{sym, Span, SpanDecoder, SpanEncoder, Symbol, DUMMY_SP}; | |
| 23 | use rustc_span::{DUMMY_SP, Span, SpanDecoder, SpanEncoder, Symbol, sym}; | |
| 24 | 24 | |
| 25 | 25 | use crate::ast::{AttrStyle, StmtKind}; |
| 26 | 26 | use crate::ast_traits::{HasAttrs, HasTokens}; |
compiler/rustc_ast/src/util/literal.rs+2-2| ... | ... | @@ -3,10 +3,10 @@ |
| 3 | 3 | use std::{ascii, fmt, str}; |
| 4 | 4 | |
| 5 | 5 | use rustc_lexer::unescape::{ |
| 6 | byte_from_char, unescape_byte, unescape_char, unescape_mixed, unescape_unicode, MixedUnit, Mode, | |
| 6 | MixedUnit, Mode, byte_from_char, unescape_byte, unescape_char, unescape_mixed, unescape_unicode, | |
| 7 | 7 | }; |
| 8 | use rustc_span::symbol::{kw, sym, Symbol}; | |
| 9 | 8 | use rustc_span::Span; |
| 9 | use rustc_span::symbol::{Symbol, kw, sym}; | |
| 10 | 10 | use tracing::debug; |
| 11 | 11 | |
| 12 | 12 | use crate::ast::{self, LitKind, MetaItemLit, StrStyle}; |
compiler/rustc_ast/src/visit.rs+1-1| ... | ... | @@ -15,8 +15,8 @@ |
| 15 | 15 | |
| 16 | 16 | pub use rustc_ast_ir::visit::VisitorResult; |
| 17 | 17 | pub use rustc_ast_ir::{try_visit, visit_opt, walk_list, walk_visitable_list}; |
| 18 | use rustc_span::symbol::Ident; | |
| 19 | 18 | use rustc_span::Span; |
| 19 | use rustc_span::symbol::Ident; | |
| 20 | 20 | |
| 21 | 21 | use crate::ast::*; |
| 22 | 22 | use crate::ptr::P; |
compiler/rustc_ast_lowering/src/asm.rs+4-4| ... | ... | @@ -8,9 +8,10 @@ use rustc_hir as hir; |
| 8 | 8 | use rustc_hir::def::{DefKind, Res}; |
| 9 | 9 | use rustc_session::parse::feature_err; |
| 10 | 10 | use rustc_span::symbol::kw; |
| 11 | use rustc_span::{sym, Span}; | |
| 11 | use rustc_span::{Span, sym}; | |
| 12 | 12 | use rustc_target::asm; |
| 13 | 13 | |
| 14 | use super::LoweringContext; | |
| 14 | 15 | use super::errors::{ |
| 15 | 16 | AbiSpecifiedMultipleTimes, AttSyntaxOnlyX86, ClobberAbiNotSupported, |
| 16 | 17 | InlineAsmUnsupportedTarget, InvalidAbiClobberAbi, InvalidAsmTemplateModifierConst, |
| ... | ... | @@ -18,10 +19,9 @@ use super::errors::{ |
| 18 | 19 | InvalidAsmTemplateModifierRegClassSub, InvalidAsmTemplateModifierSym, InvalidRegister, |
| 19 | 20 | InvalidRegisterClass, RegisterClassOnlyClobber, RegisterConflict, |
| 20 | 21 | }; |
| 21 | use super::LoweringContext; | |
| 22 | 22 | use crate::{ |
| 23 | fluent_generated as fluent, AllowReturnTypeNotation, ImplTraitContext, ImplTraitPosition, | |
| 24 | ParamMode, ResolverAstLoweringExt, | |
| 23 | AllowReturnTypeNotation, ImplTraitContext, ImplTraitPosition, ParamMode, | |
| 24 | ResolverAstLoweringExt, fluent_generated as fluent, | |
| 25 | 25 | }; |
| 26 | 26 | |
| 27 | 27 | impl<'a, 'hir> LoweringContext<'a, 'hir> { |
compiler/rustc_ast_lowering/src/delegation.rs+1-1| ... | ... | @@ -46,8 +46,8 @@ use rustc_errors::ErrorGuaranteed; |
| 46 | 46 | use rustc_hir::def_id::DefId; |
| 47 | 47 | use rustc_middle::span_bug; |
| 48 | 48 | use rustc_middle::ty::{Asyncness, ResolverAstLowering}; |
| 49 | use rustc_span::symbol::Ident; | |
| 50 | 49 | use rustc_span::Span; |
| 50 | use rustc_span::symbol::Ident; | |
| 51 | 51 | use rustc_target::spec::abi; |
| 52 | 52 | use {rustc_ast as ast, rustc_hir as hir}; |
| 53 | 53 |
compiler/rustc_ast_lowering/src/expr.rs+15-18| ... | ... | @@ -4,14 +4,14 @@ use rustc_ast::ptr::P as AstP; |
| 4 | 4 | use rustc_ast::*; |
| 5 | 5 | use rustc_data_structures::stack::ensure_sufficient_stack; |
| 6 | 6 | use rustc_hir as hir; |
| 7 | use rustc_hir::def::{DefKind, Res}; | |
| 8 | 7 | use rustc_hir::HirId; |
| 8 | use rustc_hir::def::{DefKind, Res}; | |
| 9 | 9 | use rustc_middle::span_bug; |
| 10 | 10 | use rustc_session::errors::report_lit_error; |
| 11 | use rustc_span::source_map::{respan, Spanned}; | |
| 12 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 13 | use rustc_span::{DesugaringKind, Span, DUMMY_SP}; | |
| 14 | use thin_vec::{thin_vec, ThinVec}; | |
| 11 | use rustc_span::source_map::{Spanned, respan}; | |
| 12 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 13 | use rustc_span::{DUMMY_SP, DesugaringKind, Span}; | |
| 14 | use thin_vec::{ThinVec, thin_vec}; | |
| 15 | 15 | |
| 16 | 16 | use super::errors::{ |
| 17 | 17 | AsyncCoroutinesNotSupported, AwaitOnlyInAsyncFnAndBlocks, BaseExpressionDoubleDot, |
| ... | ... | @@ -23,7 +23,7 @@ use super::{ |
| 23 | 23 | GenericArgsMode, ImplTraitContext, LoweringContext, ParamMode, ResolverAstLoweringExt, |
| 24 | 24 | }; |
| 25 | 25 | use crate::errors::YieldInClosure; |
| 26 | use crate::{fluent_generated, AllowReturnTypeNotation, FnDeclKind, ImplTraitPosition}; | |
| 26 | use crate::{AllowReturnTypeNotation, FnDeclKind, ImplTraitPosition, fluent_generated}; | |
| 27 | 27 | |
| 28 | 28 | impl<'hir> LoweringContext<'_, 'hir> { |
| 29 | 29 | fn lower_exprs(&mut self, exprs: &[AstP<Expr>]) -> &'hir [hir::Expr<'hir>] { |
| ... | ... | @@ -725,18 +725,15 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 725 | 725 | span, |
| 726 | 726 | Some(self.allow_gen_future.clone()), |
| 727 | 727 | ); |
| 728 | self.lower_attrs( | |
| 729 | inner_hir_id, | |
| 730 | &[Attribute { | |
| 731 | kind: AttrKind::Normal(ptr::P(NormalAttr::from_ident(Ident::new( | |
| 732 | sym::track_caller, | |
| 733 | span, | |
| 734 | )))), | |
| 735 | id: self.tcx.sess.psess.attr_id_generator.mk_attr_id(), | |
| 736 | style: AttrStyle::Outer, | |
| 737 | span: unstable_span, | |
| 738 | }], | |
| 739 | ); | |
| 728 | self.lower_attrs(inner_hir_id, &[Attribute { | |
| 729 | kind: AttrKind::Normal(ptr::P(NormalAttr::from_ident(Ident::new( | |
| 730 | sym::track_caller, | |
| 731 | span, | |
| 732 | )))), | |
| 733 | id: self.tcx.sess.psess.attr_id_generator.mk_attr_id(), | |
| 734 | style: AttrStyle::Outer, | |
| 735 | span: unstable_span, | |
| 736 | }]); | |
| 740 | 737 | } |
| 741 | 738 | } |
| 742 | 739 |
compiler/rustc_ast_lowering/src/format.rs+5-8| ... | ... | @@ -6,8 +6,8 @@ use rustc_ast::*; |
| 6 | 6 | use rustc_data_structures::fx::FxIndexMap; |
| 7 | 7 | use rustc_hir as hir; |
| 8 | 8 | use rustc_session::config::FmtDebug; |
| 9 | use rustc_span::symbol::{kw, Ident}; | |
| 10 | use rustc_span::{sym, Span, Symbol}; | |
| 9 | use rustc_span::symbol::{Ident, kw}; | |
| 10 | use rustc_span::{Span, Symbol, sym}; | |
| 11 | 11 | |
| 12 | 12 | use super::LoweringContext; |
| 13 | 13 | |
| ... | ... | @@ -363,16 +363,13 @@ fn make_format_spec<'hir>( |
| 363 | 363 | debug_hex, |
| 364 | 364 | } = &placeholder.format_options; |
| 365 | 365 | let fill = ctx.expr_char(sp, fill.unwrap_or(' ')); |
| 366 | let align = ctx.expr_lang_item_type_relative( | |
| 367 | sp, | |
| 368 | hir::LangItem::FormatAlignment, | |
| 369 | match alignment { | |
| 366 | let align = | |
| 367 | ctx.expr_lang_item_type_relative(sp, hir::LangItem::FormatAlignment, match alignment { | |
| 370 | 368 | Some(FormatAlignment::Left) => sym::Left, |
| 371 | 369 | Some(FormatAlignment::Right) => sym::Right, |
| 372 | 370 | Some(FormatAlignment::Center) => sym::Center, |
| 373 | 371 | None => sym::Unknown, |
| 374 | }, | |
| 375 | ); | |
| 372 | }); | |
| 376 | 373 | // This needs to match `Flag` in library/core/src/fmt/rt.rs. |
| 377 | 374 | let flags: u32 = ((sign == Some(FormatSign::Plus)) as u32) |
| 378 | 375 | | ((sign == Some(FormatSign::Minus)) as u32) << 1 |
compiler/rustc_ast_lowering/src/index.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ use rustc_hir::*; |
| 6 | 6 | use rustc_index::IndexVec; |
| 7 | 7 | use rustc_middle::span_bug; |
| 8 | 8 | use rustc_middle::ty::TyCtxt; |
| 9 | use rustc_span::{Span, DUMMY_SP}; | |
| 9 | use rustc_span::{DUMMY_SP, Span}; | |
| 10 | 10 | use tracing::{debug, instrument}; |
| 11 | 11 | |
| 12 | 12 | /// A visitor that walks over the HIR and collects `Node`s into a HIR map. |
compiler/rustc_ast_lowering/src/item.rs+31-43| ... | ... | @@ -3,17 +3,17 @@ use rustc_ast::visit::AssocCtxt; |
| 3 | 3 | use rustc_ast::*; |
| 4 | 4 | use rustc_errors::ErrorGuaranteed; |
| 5 | 5 | use rustc_hir as hir; |
| 6 | use rustc_hir::def::{DefKind, Res}; | |
| 7 | use rustc_hir::def_id::{LocalDefId, CRATE_DEF_ID}; | |
| 8 | 6 | use rustc_hir::PredicateOrigin; |
| 7 | use rustc_hir::def::{DefKind, Res}; | |
| 8 | use rustc_hir::def_id::{CRATE_DEF_ID, LocalDefId}; | |
| 9 | 9 | use rustc_index::{IndexSlice, IndexVec}; |
| 10 | 10 | use rustc_middle::span_bug; |
| 11 | 11 | use rustc_middle::ty::{ResolverAstLowering, TyCtxt}; |
| 12 | 12 | use rustc_span::edit_distance::find_best_match_for_name; |
| 13 | use rustc_span::symbol::{kw, sym, Ident}; | |
| 13 | use rustc_span::symbol::{Ident, kw, sym}; | |
| 14 | 14 | use rustc_span::{DesugaringKind, Span, Symbol}; |
| 15 | 15 | use rustc_target::spec::abi; |
| 16 | use smallvec::{smallvec, SmallVec}; | |
| 16 | use smallvec::{SmallVec, smallvec}; | |
| 17 | 17 | use thin_vec::ThinVec; |
| 18 | 18 | use tracing::instrument; |
| 19 | 19 | |
| ... | ... | @@ -281,16 +281,13 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 281 | 281 | ); |
| 282 | 282 | this.arena.alloc(this.ty(span, hir::TyKind::Err(guar))) |
| 283 | 283 | } |
| 284 | Some(ty) => this.lower_ty( | |
| 285 | ty, | |
| 286 | ImplTraitContext::OpaqueTy { | |
| 287 | origin: hir::OpaqueTyOrigin::TyAlias { | |
| 288 | parent: this.local_def_id(id), | |
| 289 | in_assoc_ty: false, | |
| 290 | }, | |
| 291 | fn_kind: None, | |
| 284 | Some(ty) => this.lower_ty(ty, ImplTraitContext::OpaqueTy { | |
| 285 | origin: hir::OpaqueTyOrigin::TyAlias { | |
| 286 | parent: this.local_def_id(id), | |
| 287 | in_assoc_ty: false, | |
| 292 | 288 | }, |
| 293 | ), | |
| 289 | fn_kind: None, | |
| 290 | }), | |
| 294 | 291 | }, |
| 295 | 292 | ); |
| 296 | 293 | hir::ItemKind::TyAlias(ty, generics) |
| ... | ... | @@ -981,16 +978,13 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 981 | 978 | hir::ImplItemKind::Type(ty) |
| 982 | 979 | } |
| 983 | 980 | Some(ty) => { |
| 984 | let ty = this.lower_ty( | |
| 985 | ty, | |
| 986 | ImplTraitContext::OpaqueTy { | |
| 987 | origin: hir::OpaqueTyOrigin::TyAlias { | |
| 988 | parent: this.local_def_id(i.id), | |
| 989 | in_assoc_ty: true, | |
| 990 | }, | |
| 991 | fn_kind: None, | |
| 981 | let ty = this.lower_ty(ty, ImplTraitContext::OpaqueTy { | |
| 982 | origin: hir::OpaqueTyOrigin::TyAlias { | |
| 983 | parent: this.local_def_id(i.id), | |
| 984 | in_assoc_ty: true, | |
| 992 | 985 | }, |
| 993 | ); | |
| 986 | fn_kind: None, | |
| 987 | }); | |
| 994 | 988 | hir::ImplItemKind::Type(ty) |
| 995 | 989 | } |
| 996 | 990 | }, |
| ... | ... | @@ -1129,13 +1123,10 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 1129 | 1123 | |
| 1130 | 1124 | pub(super) fn lower_const_body(&mut self, span: Span, expr: Option<&Expr>) -> hir::BodyId { |
| 1131 | 1125 | self.lower_body(|this| { |
| 1132 | ( | |
| 1133 | &[], | |
| 1134 | match expr { | |
| 1135 | Some(expr) => this.lower_expr_mut(expr), | |
| 1136 | None => this.expr_err(span, this.dcx().span_delayed_bug(span, "no block")), | |
| 1137 | }, | |
| 1138 | ) | |
| 1126 | (&[], match expr { | |
| 1127 | Some(expr) => this.lower_expr_mut(expr), | |
| 1128 | None => this.expr_err(span, this.dcx().span_delayed_bug(span, "no block")), | |
| 1129 | }) | |
| 1139 | 1130 | }) |
| 1140 | 1131 | } |
| 1141 | 1132 | |
| ... | ... | @@ -1515,10 +1506,10 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 1515 | 1506 | for bound in &bound_pred.bounds { |
| 1516 | 1507 | if !matches!( |
| 1517 | 1508 | *bound, |
| 1518 | GenericBound::Trait( | |
| 1519 | _, | |
| 1520 | TraitBoundModifiers { polarity: BoundPolarity::Maybe(_), .. } | |
| 1521 | ) | |
| 1509 | GenericBound::Trait(_, TraitBoundModifiers { | |
| 1510 | polarity: BoundPolarity::Maybe(_), | |
| 1511 | .. | |
| 1512 | }) | |
| 1522 | 1513 | ) { |
| 1523 | 1514 | continue; |
| 1524 | 1515 | } |
| ... | ... | @@ -1619,16 +1610,13 @@ impl<'hir> LoweringContext<'_, 'hir> { |
| 1619 | 1610 | self.children.push((anon_const_did, hir::MaybeOwner::NonOwner(const_id))); |
| 1620 | 1611 | |
| 1621 | 1612 | let const_body = self.lower_body(|this| { |
| 1622 | ( | |
| 1623 | &[], | |
| 1624 | hir::Expr { | |
| 1625 | hir_id: const_expr_id, | |
| 1626 | kind: hir::ExprKind::Lit( | |
| 1627 | this.arena.alloc(hir::Lit { node: LitKind::Bool(true), span }), | |
| 1628 | ), | |
| 1629 | span, | |
| 1630 | }, | |
| 1631 | ) | |
| 1613 | (&[], hir::Expr { | |
| 1614 | hir_id: const_expr_id, | |
| 1615 | kind: hir::ExprKind::Lit( | |
| 1616 | this.arena.alloc(hir::Lit { node: LitKind::Bool(true), span }), | |
| 1617 | ), | |
| 1618 | span, | |
| 1619 | }) | |
| 1632 | 1620 | }); |
| 1633 | 1621 | |
| 1634 | 1622 | let default_ac = self.arena.alloc(hir::AnonConst { |
compiler/rustc_ast_lowering/src/lib.rs+4-4| ... | ... | @@ -53,7 +53,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; |
| 53 | 53 | use rustc_data_structures::sync::Lrc; |
| 54 | 54 | use rustc_errors::{DiagArgFromDisplay, DiagCtxtHandle, StashKey}; |
| 55 | 55 | use rustc_hir::def::{DefKind, LifetimeRes, Namespace, PartialRes, PerNS, Res}; |
| 56 | use rustc_hir::def_id::{LocalDefId, LocalDefIdMap, CRATE_DEF_ID, LOCAL_CRATE}; | |
| 56 | use rustc_hir::def_id::{CRATE_DEF_ID, LOCAL_CRATE, LocalDefId, LocalDefIdMap}; | |
| 57 | 57 | use rustc_hir::{ |
| 58 | 58 | self as hir, ConstArg, GenericArg, HirId, ItemLocalMap, MissingLifetimeKind, ParamName, |
| 59 | 59 | TraitCandidate, |
| ... | ... | @@ -63,9 +63,9 @@ use rustc_macros::extension; |
| 63 | 63 | use rustc_middle::span_bug; |
| 64 | 64 | use rustc_middle::ty::{ResolverAstLowering, TyCtxt}; |
| 65 | 65 | use rustc_session::parse::{add_feature_diagnostics, feature_err}; |
| 66 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 67 | use rustc_span::{DesugaringKind, Span, DUMMY_SP}; | |
| 68 | use smallvec::{smallvec, SmallVec}; | |
| 66 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 67 | use rustc_span::{DUMMY_SP, DesugaringKind, Span}; | |
| 68 | use smallvec::{SmallVec, smallvec}; | |
| 69 | 69 | use thin_vec::ThinVec; |
| 70 | 70 | use tracing::{debug, instrument, trace}; |
| 71 | 71 |
compiler/rustc_ast_lowering/src/lifetime_collector.rs+1-1| ... | ... | @@ -4,8 +4,8 @@ use rustc_data_structures::fx::FxIndexSet; |
| 4 | 4 | use rustc_hir::def::{DefKind, LifetimeRes, Res}; |
| 5 | 5 | use rustc_middle::span_bug; |
| 6 | 6 | use rustc_middle::ty::ResolverAstLowering; |
| 7 | use rustc_span::symbol::{kw, Ident}; | |
| 8 | 7 | use rustc_span::Span; |
| 8 | use rustc_span::symbol::{Ident, kw}; | |
| 9 | 9 | |
| 10 | 10 | use super::ResolverAstLoweringExt; |
| 11 | 11 |
compiler/rustc_ast_lowering/src/pat.rs+1-1| ... | ... | @@ -3,9 +3,9 @@ use rustc_ast::*; |
| 3 | 3 | use rustc_data_structures::stack::ensure_sufficient_stack; |
| 4 | 4 | use rustc_hir as hir; |
| 5 | 5 | use rustc_hir::def::Res; |
| 6 | use rustc_span::Span; | |
| 6 | 7 | use rustc_span::source_map::Spanned; |
| 7 | 8 | use rustc_span::symbol::Ident; |
| 8 | use rustc_span::Span; | |
| 9 | 9 | |
| 10 | 10 | use super::errors::{ |
| 11 | 11 | ArbitraryExpressionInPattern, ExtraDoubleDot, MisplacedDoubleDot, SubTupleBinding, |
compiler/rustc_ast_lowering/src/path.rs+4-4| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | 1 | use rustc_ast::{self as ast, *}; |
| 2 | 2 | use rustc_data_structures::sync::Lrc; |
| 3 | 3 | use rustc_hir as hir; |
| 4 | use rustc_hir::GenericArg; | |
| 4 | 5 | use rustc_hir::def::{DefKind, PartialRes, Res}; |
| 5 | 6 | use rustc_hir::def_id::DefId; |
| 6 | use rustc_hir::GenericArg; | |
| 7 | 7 | use rustc_middle::span_bug; |
| 8 | 8 | use rustc_session::parse::add_feature_diagnostics; |
| 9 | use rustc_span::symbol::{kw, sym, Ident}; | |
| 10 | use rustc_span::{BytePos, DesugaringKind, Span, Symbol, DUMMY_SP}; | |
| 11 | use smallvec::{smallvec, SmallVec}; | |
| 9 | use rustc_span::symbol::{Ident, kw, sym}; | |
| 10 | use rustc_span::{BytePos, DUMMY_SP, DesugaringKind, Span, Symbol}; | |
| 11 | use smallvec::{SmallVec, smallvec}; | |
| 12 | 12 | use tracing::{debug, instrument}; |
| 13 | 13 | |
| 14 | 14 | use super::errors::{ |
compiler/rustc_ast_passes/src/ast_validation.rs+3-3| ... | ... | @@ -21,21 +21,21 @@ use std::ops::{Deref, DerefMut}; |
| 21 | 21 | |
| 22 | 22 | use itertools::{Either, Itertools}; |
| 23 | 23 | use rustc_ast::ptr::P; |
| 24 | use rustc_ast::visit::{walk_list, AssocCtxt, BoundKind, FnCtxt, FnKind, Visitor}; | |
| 24 | use rustc_ast::visit::{AssocCtxt, BoundKind, FnCtxt, FnKind, Visitor, walk_list}; | |
| 25 | 25 | use rustc_ast::*; |
| 26 | 26 | use rustc_ast_pretty::pprust::{self, State}; |
| 27 | 27 | use rustc_data_structures::fx::FxIndexMap; |
| 28 | 28 | use rustc_errors::DiagCtxtHandle; |
| 29 | 29 | use rustc_feature::Features; |
| 30 | 30 | use rustc_parse::validate_attr; |
| 31 | use rustc_session::Session; | |
| 31 | 32 | use rustc_session::lint::builtin::{ |
| 32 | 33 | DEPRECATED_WHERE_CLAUSE_LOCATION, MISSING_ABI, MISSING_UNSAFE_ON_EXTERN, |
| 33 | 34 | PATTERNS_IN_FNS_WITHOUT_BODY, |
| 34 | 35 | }; |
| 35 | 36 | use rustc_session::lint::{BuiltinLintDiag, LintBuffer}; |
| 36 | use rustc_session::Session; | |
| 37 | use rustc_span::symbol::{kw, sym, Ident}; | |
| 38 | 37 | use rustc_span::Span; |
| 38 | use rustc_span::symbol::{Ident, kw, sym}; | |
| 39 | 39 | use rustc_target::spec::abi; |
| 40 | 40 | use thin_vec::thin_vec; |
| 41 | 41 |
compiler/rustc_ast_passes/src/feature_gate.rs+4-4| ... | ... | @@ -1,12 +1,12 @@ |
| 1 | 1 | use rustc_ast as ast; |
| 2 | 2 | use rustc_ast::visit::{self, AssocCtxt, FnCtxt, FnKind, Visitor}; |
| 3 | use rustc_ast::{attr, token, NodeId, PatKind}; | |
| 4 | use rustc_feature::{AttributeGate, BuiltinAttribute, Features, GateIssue, BUILTIN_ATTRIBUTE_MAP}; | |
| 5 | use rustc_session::parse::{feature_err, feature_err_issue, feature_warn}; | |
| 3 | use rustc_ast::{NodeId, PatKind, attr, token}; | |
| 4 | use rustc_feature::{AttributeGate, BUILTIN_ATTRIBUTE_MAP, BuiltinAttribute, Features, GateIssue}; | |
| 6 | 5 | use rustc_session::Session; |
| 6 | use rustc_session::parse::{feature_err, feature_err_issue, feature_warn}; | |
| 7 | use rustc_span::Span; | |
| 7 | 8 | use rustc_span::source_map::Spanned; |
| 8 | 9 | use rustc_span::symbol::sym; |
| 9 | use rustc_span::Span; | |
| 10 | 10 | use rustc_target::spec::abi; |
| 11 | 11 | use thin_vec::ThinVec; |
| 12 | 12 |
compiler/rustc_ast_passes/src/node_count.rs+1-1| ... | ... | @@ -2,8 +2,8 @@ |
| 2 | 2 | |
| 3 | 3 | use rustc_ast::visit::*; |
| 4 | 4 | use rustc_ast::*; |
| 5 | use rustc_span::symbol::Ident; | |
| 6 | 5 | use rustc_span::Span; |
| 6 | use rustc_span::symbol::Ident; | |
| 7 | 7 | |
| 8 | 8 | pub struct NodeCounter { |
| 9 | 9 | pub count: usize, |
compiler/rustc_ast_pretty/src/pp/convenience.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use std::borrow::Cow; |
| 2 | 2 | |
| 3 | use crate::pp::{BeginToken, BreakToken, Breaks, IndentStyle, Printer, Token, SIZE_INFINITY}; | |
| 3 | use crate::pp::{BeginToken, BreakToken, Breaks, IndentStyle, Printer, SIZE_INFINITY, Token}; | |
| 4 | 4 | |
| 5 | 5 | impl Printer { |
| 6 | 6 | /// "raw box" |
compiler/rustc_ast_pretty/src/pprust/mod.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ use std::borrow::Cow; |
| 7 | 7 | use rustc_ast as ast; |
| 8 | 8 | use rustc_ast::token::{Nonterminal, Token, TokenKind}; |
| 9 | 9 | use rustc_ast::tokenstream::{TokenStream, TokenTree}; |
| 10 | pub use state::{print_crate, AnnNode, Comments, PpAnn, PrintState, State}; | |
| 10 | pub use state::{AnnNode, Comments, PpAnn, PrintState, State, print_crate}; | |
| 11 | 11 | |
| 12 | 12 | pub fn nonterminal_to_string(nt: &Nonterminal) -> String { |
| 13 | 13 | State::new().nonterminal_to_string(nt) |
compiler/rustc_ast_pretty/src/pprust/state.rs+6-6| ... | ... | @@ -18,14 +18,14 @@ use rustc_ast::tokenstream::{Spacing, TokenStream, TokenTree}; |
| 18 | 18 | use rustc_ast::util::classify; |
| 19 | 19 | use rustc_ast::util::comments::{Comment, CommentStyle}; |
| 20 | 20 | use rustc_ast::{ |
| 21 | self as ast, attr, AttrArgs, AttrArgsEq, BindingMode, BlockCheckMode, ByRef, DelimArgs, | |
| 22 | GenericArg, GenericBound, InlineAsmOperand, InlineAsmOptions, InlineAsmRegOrRegClass, | |
| 23 | InlineAsmTemplatePiece, PatKind, RangeEnd, RangeSyntax, Safety, SelfKind, Term, | |
| 21 | self as ast, AttrArgs, AttrArgsEq, BindingMode, BlockCheckMode, ByRef, DelimArgs, GenericArg, | |
| 22 | GenericBound, InlineAsmOperand, InlineAsmOptions, InlineAsmRegOrRegClass, | |
| 23 | InlineAsmTemplatePiece, PatKind, RangeEnd, RangeSyntax, Safety, SelfKind, Term, attr, | |
| 24 | 24 | }; |
| 25 | 25 | use rustc_span::edition::Edition; |
| 26 | 26 | use rustc_span::source_map::{SourceMap, Spanned}; |
| 27 | use rustc_span::symbol::{kw, sym, Ident, IdentPrinter, Symbol}; | |
| 28 | use rustc_span::{BytePos, CharPos, FileName, Pos, Span, DUMMY_SP}; | |
| 27 | use rustc_span::symbol::{Ident, IdentPrinter, Symbol, kw, sym}; | |
| 28 | use rustc_span::{BytePos, CharPos, DUMMY_SP, FileName, Pos, Span}; | |
| 29 | 29 | use thin_vec::ThinVec; |
| 30 | 30 | |
| 31 | 31 | use crate::pp::Breaks::{Consistent, Inconsistent}; |
| ... | ... | @@ -292,9 +292,9 @@ pub fn print_crate<'a>( |
| 292 | 292 | /// - #73345: `#[allow(unused)]` must be printed rather than `# [allow(unused)]` |
| 293 | 293 | /// |
| 294 | 294 | fn space_between(tt1: &TokenTree, tt2: &TokenTree) -> bool { |
| 295 | use token::*; | |
| 296 | 295 | use Delimiter::*; |
| 297 | 296 | use TokenTree::{Delimited as Del, Token as Tok}; |
| 297 | use token::*; | |
| 298 | 298 | |
| 299 | 299 | fn is_punct(tt: &TokenTree) -> bool { |
| 300 | 300 | matches!(tt, TokenTree::Token(tok, _) if tok.is_punct()) |
compiler/rustc_ast_pretty/src/pprust/state/expr.rs+3-3| ... | ... | @@ -7,13 +7,13 @@ use rustc_ast::util::classify; |
| 7 | 7 | use rustc_ast::util::literal::escape_byte_str_symbol; |
| 8 | 8 | use rustc_ast::util::parser::{self, AssocOp, Fixity}; |
| 9 | 9 | use rustc_ast::{ |
| 10 | self as ast, token, BlockCheckMode, FormatAlignment, FormatArgPosition, FormatArgsPiece, | |
| 11 | FormatCount, FormatDebugHex, FormatSign, FormatTrait, | |
| 10 | self as ast, BlockCheckMode, FormatAlignment, FormatArgPosition, FormatArgsPiece, FormatCount, | |
| 11 | FormatDebugHex, FormatSign, FormatTrait, token, | |
| 12 | 12 | }; |
| 13 | 13 | |
| 14 | 14 | use crate::pp::Breaks::Inconsistent; |
| 15 | 15 | use crate::pprust::state::fixup::FixupContext; |
| 16 | use crate::pprust::state::{AnnNode, PrintState, State, INDENT_UNIT}; | |
| 16 | use crate::pprust::state::{AnnNode, INDENT_UNIT, PrintState, State}; | |
| 17 | 17 | |
| 18 | 18 | impl<'a> State<'a> { |
| 19 | 19 | fn print_else(&mut self, els: Option<&ast::Expr>) { |
compiler/rustc_ast_pretty/src/pprust/state/fixup.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | use rustc_ast::util::{classify, parser}; | |
| 2 | 1 | use rustc_ast::Expr; |
| 2 | use rustc_ast::util::{classify, parser}; | |
| 3 | 3 | |
| 4 | 4 | #[derive(Copy, Clone, Debug)] |
| 5 | 5 | pub(crate) struct FixupContext { |
compiler/rustc_ast_pretty/src/pprust/state/item.rs+2-2| ... | ... | @@ -1,13 +1,13 @@ |
| 1 | 1 | use ast::StaticItem; |
| 2 | 2 | use itertools::{Itertools, Position}; |
| 3 | 3 | use rustc_ast as ast; |
| 4 | use rustc_ast::ptr::P; | |
| 5 | 4 | use rustc_ast::ModKind; |
| 5 | use rustc_ast::ptr::P; | |
| 6 | 6 | use rustc_span::symbol::Ident; |
| 7 | 7 | |
| 8 | 8 | use crate::pp::Breaks::Inconsistent; |
| 9 | 9 | use crate::pprust::state::fixup::FixupContext; |
| 10 | use crate::pprust::state::{AnnNode, PrintState, State, INDENT_UNIT}; | |
| 10 | use crate::pprust::state::{AnnNode, INDENT_UNIT, PrintState, State}; | |
| 11 | 11 | |
| 12 | 12 | enum DelegationKind<'a> { |
| 13 | 13 | Single, |
compiler/rustc_ast_pretty/src/pprust/tests.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use rustc_ast as ast; |
| 2 | 2 | use rustc_span::symbol::Ident; |
| 3 | use rustc_span::{create_default_session_globals_then, DUMMY_SP}; | |
| 3 | use rustc_span::{DUMMY_SP, create_default_session_globals_then}; | |
| 4 | 4 | use thin_vec::ThinVec; |
| 5 | 5 | |
| 6 | 6 | use super::*; |
compiler/rustc_attr/src/builtin.rs+6-6| ... | ... | @@ -4,21 +4,21 @@ use std::num::NonZero; |
| 4 | 4 | |
| 5 | 5 | use rustc_abi::Align; |
| 6 | 6 | use rustc_ast::{ |
| 7 | self as ast, attr, Attribute, LitKind, MetaItem, MetaItemKind, MetaItemLit, NestedMetaItem, | |
| 8 | NodeId, | |
| 7 | self as ast, Attribute, LitKind, MetaItem, MetaItemKind, MetaItemLit, NestedMetaItem, NodeId, | |
| 8 | attr, | |
| 9 | 9 | }; |
| 10 | 10 | use rustc_ast_pretty::pprust; |
| 11 | 11 | use rustc_errors::ErrorGuaranteed; |
| 12 | use rustc_feature::{find_gated_cfg, is_builtin_attr_name, Features, GatedCfg}; | |
| 12 | use rustc_feature::{Features, GatedCfg, find_gated_cfg, is_builtin_attr_name}; | |
| 13 | 13 | use rustc_macros::{Decodable, Encodable, HashStable_Generic}; |
| 14 | 14 | use rustc_session::config::ExpectedValues; |
| 15 | use rustc_session::lint::builtin::UNEXPECTED_CFGS; | |
| 16 | 15 | use rustc_session::lint::BuiltinLintDiag; |
| 16 | use rustc_session::lint::builtin::UNEXPECTED_CFGS; | |
| 17 | 17 | use rustc_session::parse::feature_err; |
| 18 | 18 | use rustc_session::{RustcVersion, Session}; |
| 19 | use rustc_span::hygiene::Transparency; | |
| 20 | use rustc_span::symbol::{sym, Symbol}; | |
| 21 | 19 | use rustc_span::Span; |
| 20 | use rustc_span::hygiene::Transparency; | |
| 21 | use rustc_span::symbol::{Symbol, sym}; | |
| 22 | 22 | |
| 23 | 23 | use crate::fluent_generated; |
| 24 | 24 | use crate::session_diagnostics::{self, IncorrectReprFormatGenericCause}; |
compiler/rustc_attr/src/lib.rs+3-3| ... | ... | @@ -15,11 +15,11 @@ |
| 15 | 15 | mod builtin; |
| 16 | 16 | mod session_diagnostics; |
| 17 | 17 | |
| 18 | pub use builtin::*; | |
| 19 | pub use rustc_ast::attr::*; | |
| 20 | pub(crate) use rustc_session::HashStableContext; | |
| 21 | 18 | pub use IntType::*; |
| 22 | 19 | pub use ReprAttr::*; |
| 23 | 20 | pub use StabilityLevel::*; |
| 21 | pub use builtin::*; | |
| 22 | pub use rustc_ast::attr::*; | |
| 23 | pub(crate) use rustc_session::HashStableContext; | |
| 24 | 24 | |
| 25 | 25 | rustc_fluent_macro::fluent_messages! { "../messages.ftl" } |
compiler/rustc_attr/src/session_diagnostics.rs+11-15| ... | ... | @@ -6,7 +6,7 @@ use rustc_errors::{Applicability, Diag, DiagCtxtHandle, Diagnostic, EmissionGuar |
| 6 | 6 | use rustc_macros::{Diagnostic, Subdiagnostic}; |
| 7 | 7 | use rustc_span::{Span, Symbol}; |
| 8 | 8 | |
| 9 | use crate::{fluent_generated as fluent, UnsupportedLiteralReason}; | |
| 9 | use crate::{UnsupportedLiteralReason, fluent_generated as fluent}; | |
| 10 | 10 | |
| 11 | 11 | #[derive(Diagnostic)] |
| 12 | 12 | #[diag(attr_expected_one_cfg_pattern, code = E0536)] |
| ... | ... | @@ -203,20 +203,16 @@ pub(crate) struct UnsupportedLiteral { |
| 203 | 203 | |
| 204 | 204 | impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for UnsupportedLiteral { |
| 205 | 205 | fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> { |
| 206 | let mut diag = Diag::new( | |
| 207 | dcx, | |
| 208 | level, | |
| 209 | match self.reason { | |
| 210 | UnsupportedLiteralReason::Generic => fluent::attr_unsupported_literal_generic, | |
| 211 | UnsupportedLiteralReason::CfgString => fluent::attr_unsupported_literal_cfg_string, | |
| 212 | UnsupportedLiteralReason::DeprecatedString => { | |
| 213 | fluent::attr_unsupported_literal_deprecated_string | |
| 214 | } | |
| 215 | UnsupportedLiteralReason::DeprecatedKvPair => { | |
| 216 | fluent::attr_unsupported_literal_deprecated_kv_pair | |
| 217 | } | |
| 218 | }, | |
| 219 | ); | |
| 206 | let mut diag = Diag::new(dcx, level, match self.reason { | |
| 207 | UnsupportedLiteralReason::Generic => fluent::attr_unsupported_literal_generic, | |
| 208 | UnsupportedLiteralReason::CfgString => fluent::attr_unsupported_literal_cfg_string, | |
| 209 | UnsupportedLiteralReason::DeprecatedString => { | |
| 210 | fluent::attr_unsupported_literal_deprecated_string | |
| 211 | } | |
| 212 | UnsupportedLiteralReason::DeprecatedKvPair => { | |
| 213 | fluent::attr_unsupported_literal_deprecated_kv_pair | |
| 214 | } | |
| 215 | }); | |
| 220 | 216 | diag.span(self.span); |
| 221 | 217 | diag.code(E0565); |
| 222 | 218 | if self.is_bytestr { |
compiler/rustc_borrowck/src/borrow_set.rs+2-2| ... | ... | @@ -4,15 +4,15 @@ use std::ops::Index; |
| 4 | 4 | use rustc_data_structures::fx::{FxIndexMap, FxIndexSet}; |
| 5 | 5 | use rustc_index::bit_set::BitSet; |
| 6 | 6 | use rustc_middle::mir::visit::{MutatingUseContext, NonUseContext, PlaceContext, Visitor}; |
| 7 | use rustc_middle::mir::{self, traversal, Body, Local, Location}; | |
| 7 | use rustc_middle::mir::{self, Body, Local, Location, traversal}; | |
| 8 | 8 | use rustc_middle::span_bug; |
| 9 | 9 | use rustc_middle::ty::{RegionVid, TyCtxt}; |
| 10 | 10 | use rustc_mir_dataflow::move_paths::MoveData; |
| 11 | 11 | use tracing::debug; |
| 12 | 12 | |
| 13 | use crate::BorrowIndex; | |
| 13 | 14 | use crate::path_utils::allow_two_phase_borrow; |
| 14 | 15 | use crate::place_ext::PlaceExt; |
| 15 | use crate::BorrowIndex; | |
| 16 | 16 | |
| 17 | 17 | pub struct BorrowSet<'tcx> { |
| 18 | 18 | /// The fundamental map relating bitvector indexes to the borrows |
compiler/rustc_borrowck/src/borrowck_errors.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | #![allow(rustc::untranslatable_diagnostic)] |
| 3 | 3 | |
| 4 | 4 | use rustc_errors::codes::*; |
| 5 | use rustc_errors::{struct_span_code_err, Applicability, Diag, DiagCtxtHandle}; | |
| 5 | use rustc_errors::{Applicability, Diag, DiagCtxtHandle, struct_span_code_err}; | |
| 6 | 6 | use rustc_hir as hir; |
| 7 | 7 | use rustc_middle::span_bug; |
| 8 | 8 | use rustc_middle::ty::{self, Ty, TyCtxt}; |
compiler/rustc_borrowck/src/consumers.rs+2-2| ... | ... | @@ -8,12 +8,12 @@ use rustc_middle::mir::{Body, Promoted}; |
| 8 | 8 | use rustc_middle::ty::TyCtxt; |
| 9 | 9 | |
| 10 | 10 | pub use super::constraints::OutlivesConstraint; |
| 11 | pub use super::dataflow::{calculate_borrows_out_of_scope_at_location, BorrowIndex, Borrows}; | |
| 11 | pub use super::dataflow::{BorrowIndex, Borrows, calculate_borrows_out_of_scope_at_location}; | |
| 12 | 12 | pub use super::facts::{AllFacts as PoloniusInput, RustcFacts}; |
| 13 | 13 | pub use super::location::{LocationTable, RichLocation}; |
| 14 | 14 | pub use super::nll::PoloniusOutput; |
| 15 | 15 | pub use super::place_ext::PlaceExt; |
| 16 | pub use super::places_conflict::{places_conflict, PlaceConflictBias}; | |
| 16 | pub use super::places_conflict::{PlaceConflictBias, places_conflict}; | |
| 17 | 17 | pub use super::region_infer::RegionInferenceContext; |
| 18 | 18 | use crate::borrow_set::BorrowSet; |
| 19 | 19 |
compiler/rustc_borrowck/src/dataflow.rs+1-1| ... | ... | @@ -12,7 +12,7 @@ use rustc_mir_dataflow::impls::{EverInitializedPlaces, MaybeUninitializedPlaces} |
| 12 | 12 | use rustc_mir_dataflow::{Analysis, AnalysisDomain, Forward, GenKill, Results, ResultsVisitable}; |
| 13 | 13 | use tracing::debug; |
| 14 | 14 | |
| 15 | use crate::{places_conflict, BorrowSet, PlaceConflictBias, PlaceExt, RegionInferenceContext}; | |
| 15 | use crate::{BorrowSet, PlaceConflictBias, PlaceExt, RegionInferenceContext, places_conflict}; | |
| 16 | 16 | |
| 17 | 17 | /// The results of the dataflow analyses used by the borrow checker. |
| 18 | 18 | pub(crate) struct BorrowckResults<'a, 'tcx> { |
compiler/rustc_borrowck/src/diagnostics/bound_region_errors.rs+21-22| ... | ... | @@ -14,18 +14,18 @@ use rustc_middle::ty::{ |
| 14 | 14 | self, RePlaceholder, Region, RegionVid, Ty, TyCtxt, TypeFoldable, UniverseIndex, |
| 15 | 15 | }; |
| 16 | 16 | use rustc_span::Span; |
| 17 | use rustc_trait_selection::error_reporting::infer::nice_region_error::NiceRegionError; | |
| 18 | 17 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; |
| 19 | use rustc_trait_selection::traits::query::type_op; | |
| 18 | use rustc_trait_selection::error_reporting::infer::nice_region_error::NiceRegionError; | |
| 20 | 19 | use rustc_trait_selection::traits::ObligationCtxt; |
| 20 | use rustc_trait_selection::traits::query::type_op; | |
| 21 | 21 | use rustc_traits::{type_op_ascribe_user_type_with_span, type_op_prove_predicate_with_cause}; |
| 22 | 22 | use tracing::{debug, instrument}; |
| 23 | 23 | |
| 24 | use crate::MirBorrowckCtxt; | |
| 24 | 25 | use crate::region_infer::values::RegionElement; |
| 25 | 26 | use crate::session_diagnostics::{ |
| 26 | 27 | HigherRankedErrorCause, HigherRankedLifetimeError, HigherRankedSubtypeError, |
| 27 | 28 | }; |
| 28 | use crate::MirBorrowckCtxt; | |
| 29 | 29 | |
| 30 | 30 | #[derive(Clone)] |
| 31 | 31 | pub(crate) struct UniverseInfo<'tcx>(UniverseInfoInner<'tcx>); |
| ... | ... | @@ -176,25 +176,24 @@ trait TypeOpInfo<'tcx> { |
| 176 | 176 | return; |
| 177 | 177 | }; |
| 178 | 178 | |
| 179 | let placeholder_region = ty::Region::new_placeholder( | |
| 180 | tcx, | |
| 181 | ty::Placeholder { universe: adjusted_universe.into(), bound: placeholder.bound }, | |
| 182 | ); | |
| 183 | ||
| 184 | let error_region = if let RegionElement::PlaceholderRegion(error_placeholder) = | |
| 185 | error_element | |
| 186 | { | |
| 187 | let adjusted_universe = | |
| 188 | error_placeholder.universe.as_u32().checked_sub(base_universe.as_u32()); | |
| 189 | adjusted_universe.map(|adjusted| { | |
| 190 | ty::Region::new_placeholder( | |
| 191 | tcx, | |
| 192 | ty::Placeholder { universe: adjusted.into(), bound: error_placeholder.bound }, | |
| 193 | ) | |
| 194 | }) | |
| 195 | } else { | |
| 196 | None | |
| 197 | }; | |
| 179 | let placeholder_region = ty::Region::new_placeholder(tcx, ty::Placeholder { | |
| 180 | universe: adjusted_universe.into(), | |
| 181 | bound: placeholder.bound, | |
| 182 | }); | |
| 183 | ||
| 184 | let error_region = | |
| 185 | if let RegionElement::PlaceholderRegion(error_placeholder) = error_element { | |
| 186 | let adjusted_universe = | |
| 187 | error_placeholder.universe.as_u32().checked_sub(base_universe.as_u32()); | |
| 188 | adjusted_universe.map(|adjusted| { | |
| 189 | ty::Region::new_placeholder(tcx, ty::Placeholder { | |
| 190 | universe: adjusted.into(), | |
| 191 | bound: error_placeholder.bound, | |
| 192 | }) | |
| 193 | }) | |
| 194 | } else { | |
| 195 | None | |
| 196 | }; | |
| 198 | 197 | |
| 199 | 198 | debug!(?placeholder_region); |
| 200 | 199 |
compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs+24-24| ... | ... | @@ -11,10 +11,10 @@ use hir::{ClosureKind, Path}; |
| 11 | 11 | use rustc_data_structures::captures::Captures; |
| 12 | 12 | use rustc_data_structures::fx::FxIndexSet; |
| 13 | 13 | use rustc_errors::codes::*; |
| 14 | use rustc_errors::{struct_span_code_err, Applicability, Diag, MultiSpan}; | |
| 14 | use rustc_errors::{Applicability, Diag, MultiSpan, struct_span_code_err}; | |
| 15 | 15 | use rustc_hir as hir; |
| 16 | 16 | use rustc_hir::def::{DefKind, Res}; |
| 17 | use rustc_hir::intravisit::{walk_block, walk_expr, Map, Visitor}; | |
| 17 | use rustc_hir::intravisit::{Map, Visitor, walk_block, walk_expr}; | |
| 18 | 18 | use rustc_hir::{CoroutineDesugaring, CoroutineKind, CoroutineSource, LangItem, PatField}; |
| 19 | 19 | use rustc_middle::bug; |
| 20 | 20 | use rustc_middle::hir::nested_filter::OnlyBodies; |
| ... | ... | @@ -27,17 +27,17 @@ use rustc_middle::mir::{ |
| 27 | 27 | }; |
| 28 | 28 | use rustc_middle::ty::print::PrintTraitRefExt as _; |
| 29 | 29 | use rustc_middle::ty::{ |
| 30 | self, suggest_constraining_type_params, PredicateKind, Ty, TyCtxt, TypeSuperVisitable, | |
| 31 | TypeVisitor, Upcast, | |
| 30 | self, PredicateKind, Ty, TyCtxt, TypeSuperVisitable, TypeVisitor, Upcast, | |
| 31 | suggest_constraining_type_params, | |
| 32 | 32 | }; |
| 33 | 33 | use rustc_middle::util::CallKind; |
| 34 | 34 | use rustc_mir_dataflow::move_paths::{InitKind, MoveOutIndex, MovePathIndex}; |
| 35 | 35 | use rustc_span::def_id::{DefId, LocalDefId}; |
| 36 | 36 | use rustc_span::hygiene::DesugaringKind; |
| 37 | use rustc_span::symbol::{kw, sym, Ident}; | |
| 37 | use rustc_span::symbol::{Ident, kw, sym}; | |
| 38 | 38 | use rustc_span::{BytePos, Span, Symbol}; |
| 39 | use rustc_trait_selection::error_reporting::traits::FindExprBySpan; | |
| 40 | 39 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; |
| 40 | use rustc_trait_selection::error_reporting::traits::FindExprBySpan; | |
| 41 | 41 | use rustc_trait_selection::infer::InferCtxtExt; |
| 42 | 42 | use rustc_trait_selection::traits::{Obligation, ObligationCause, ObligationCtxt}; |
| 43 | 43 | use tracing::{debug, instrument}; |
| ... | ... | @@ -46,9 +46,9 @@ use super::explain_borrow::{BorrowExplanation, LaterUseKind}; |
| 46 | 46 | use super::{DescribePlaceOpt, RegionName, RegionNameSource, UseSpans}; |
| 47 | 47 | use crate::borrow_set::{BorrowData, TwoPhaseActivation}; |
| 48 | 48 | use crate::diagnostics::conflict_errors::StorageDeadOrDrop::LocalStorageDead; |
| 49 | use crate::diagnostics::{find_all_local_uses, CapturedMessageOpt, Instance}; | |
| 49 | use crate::diagnostics::{CapturedMessageOpt, Instance, find_all_local_uses}; | |
| 50 | 50 | use crate::prefixes::IsPrefixOf; |
| 51 | use crate::{borrowck_errors, InitializationRequiringAction, MirBorrowckCtxt, WriteKind}; | |
| 51 | use crate::{InitializationRequiringAction, MirBorrowckCtxt, WriteKind, borrowck_errors}; | |
| 52 | 52 | |
| 53 | 53 | #[derive(Debug)] |
| 54 | 54 | struct MoveSite { |
| ... | ... | @@ -145,10 +145,10 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { |
| 145 | 145 | span, |
| 146 | 146 | desired_action.as_noun(), |
| 147 | 147 | partially_str, |
| 148 | self.describe_place_with_options( | |
| 149 | moved_place, | |
| 150 | DescribePlaceOpt { including_downcast: true, including_tuple_field: true }, | |
| 151 | ), | |
| 148 | self.describe_place_with_options(moved_place, DescribePlaceOpt { | |
| 149 | including_downcast: true, | |
| 150 | including_tuple_field: true, | |
| 151 | }), | |
| 152 | 152 | ); |
| 153 | 153 | |
| 154 | 154 | let reinit_spans = maybe_reinitialized_locations |
| ... | ... | @@ -266,10 +266,10 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { |
| 266 | 266 | } |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | let opt_name = self.describe_place_with_options( | |
| 270 | place.as_ref(), | |
| 271 | DescribePlaceOpt { including_downcast: true, including_tuple_field: true }, | |
| 272 | ); | |
| 269 | let opt_name = self.describe_place_with_options(place.as_ref(), DescribePlaceOpt { | |
| 270 | including_downcast: true, | |
| 271 | including_tuple_field: true, | |
| 272 | }); | |
| 273 | 273 | let note_msg = match opt_name { |
| 274 | 274 | Some(name) => format!("`{name}`"), |
| 275 | 275 | None => "value".to_owned(), |
| ... | ... | @@ -689,17 +689,17 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { |
| 689 | 689 | } |
| 690 | 690 | let spans: Vec<_> = spans_set.into_iter().collect(); |
| 691 | 691 | |
| 692 | let (name, desc) = match self.describe_place_with_options( | |
| 693 | moved_place, | |
| 694 | DescribePlaceOpt { including_downcast: true, including_tuple_field: true }, | |
| 695 | ) { | |
| 692 | let (name, desc) = match self.describe_place_with_options(moved_place, DescribePlaceOpt { | |
| 693 | including_downcast: true, | |
| 694 | including_tuple_field: true, | |
| 695 | }) { | |
| 696 | 696 | Some(name) => (format!("`{name}`"), format!("`{name}` ")), |
| 697 | 697 | None => ("the variable".to_string(), String::new()), |
| 698 | 698 | }; |
| 699 | let path = match self.describe_place_with_options( | |
| 700 | used_place, | |
| 701 | DescribePlaceOpt { including_downcast: true, including_tuple_field: true }, | |
| 702 | ) { | |
| 699 | let path = match self.describe_place_with_options(used_place, DescribePlaceOpt { | |
| 700 | including_downcast: true, | |
| 701 | including_tuple_field: true, | |
| 702 | }) { | |
| 703 | 703 | Some(name) => format!("`{name}`"), |
| 704 | 704 | None => "value".to_string(), |
| 705 | 705 | }; |
compiler/rustc_borrowck/src/diagnostics/explain_borrow.rs+3-3| ... | ... | @@ -17,12 +17,12 @@ use rustc_middle::mir::{ |
| 17 | 17 | }; |
| 18 | 18 | use rustc_middle::ty::adjustment::PointerCoercion; |
| 19 | 19 | use rustc_middle::ty::{self, RegionVid, Ty, TyCtxt}; |
| 20 | use rustc_span::symbol::{kw, Symbol}; | |
| 21 | use rustc_span::{sym, DesugaringKind, Span}; | |
| 20 | use rustc_span::symbol::{Symbol, kw}; | |
| 21 | use rustc_span::{DesugaringKind, Span, sym}; | |
| 22 | 22 | use rustc_trait_selection::error_reporting::traits::FindExprBySpan; |
| 23 | 23 | use tracing::{debug, instrument}; |
| 24 | 24 | |
| 25 | use super::{find_use, RegionName, UseSpans}; | |
| 25 | use super::{RegionName, UseSpans, find_use}; | |
| 26 | 26 | use crate::borrow_set::BorrowData; |
| 27 | 27 | use crate::nll::ConstraintDescription; |
| 28 | 28 | use crate::region_infer::{BlameConstraint, Cause, ExtraConstraintInfo}; |
compiler/rustc_borrowck/src/diagnostics/mod.rs+8-8| ... | ... | @@ -15,22 +15,22 @@ use rustc_middle::mir::{ |
| 15 | 15 | }; |
| 16 | 16 | use rustc_middle::ty::print::Print; |
| 17 | 17 | use rustc_middle::ty::{self, Instance, Ty, TyCtxt}; |
| 18 | use rustc_middle::util::{call_kind, CallDesugaringKind}; | |
| 18 | use rustc_middle::util::{CallDesugaringKind, call_kind}; | |
| 19 | 19 | use rustc_mir_dataflow::move_paths::{InitLocation, LookupResult}; |
| 20 | 20 | use rustc_span::def_id::LocalDefId; |
| 21 | 21 | use rustc_span::source_map::Spanned; |
| 22 | 22 | use rustc_span::symbol::sym; |
| 23 | use rustc_span::{Span, Symbol, DUMMY_SP}; | |
| 23 | use rustc_span::{DUMMY_SP, Span, Symbol}; | |
| 24 | 24 | use rustc_target::abi::{FieldIdx, VariantIdx}; |
| 25 | 25 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; |
| 26 | 26 | use rustc_trait_selection::infer::InferCtxtExt; |
| 27 | 27 | use rustc_trait_selection::traits::{ |
| 28 | type_known_to_meet_bound_modulo_regions, FulfillmentErrorCode, | |
| 28 | FulfillmentErrorCode, type_known_to_meet_bound_modulo_regions, | |
| 29 | 29 | }; |
| 30 | 30 | use tracing::debug; |
| 31 | 31 | |
| 32 | use super::borrow_set::BorrowData; | |
| 33 | 32 | use super::MirBorrowckCtxt; |
| 33 | use super::borrow_set::BorrowData; | |
| 34 | 34 | use crate::fluent_generated as fluent; |
| 35 | 35 | use crate::session_diagnostics::{ |
| 36 | 36 | CaptureArgLabel, CaptureReasonLabel, CaptureReasonNote, CaptureReasonSuggest, CaptureVarCause, |
| ... | ... | @@ -177,10 +177,10 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { |
| 177 | 177 | /// End-user visible description of `place` if one can be found. |
| 178 | 178 | /// If the place is a temporary for instance, `None` will be returned. |
| 179 | 179 | pub(super) fn describe_place(&self, place_ref: PlaceRef<'tcx>) -> Option<String> { |
| 180 | self.describe_place_with_options( | |
| 181 | place_ref, | |
| 182 | DescribePlaceOpt { including_downcast: false, including_tuple_field: true }, | |
| 183 | ) | |
| 180 | self.describe_place_with_options(place_ref, DescribePlaceOpt { | |
| 181 | including_downcast: false, | |
| 182 | including_tuple_field: true, | |
| 183 | }) | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | /// End-user visible description of `place` if one can be found. If the place is a temporary |
compiler/rustc_borrowck/src/diagnostics/move_errors.rs+1-1| ... | ... | @@ -12,9 +12,9 @@ use rustc_span::{BytePos, ExpnKind, MacroKind, Span}; |
| 12 | 12 | use rustc_trait_selection::error_reporting::traits::FindExprBySpan; |
| 13 | 13 | use tracing::debug; |
| 14 | 14 | |
| 15 | use crate::MirBorrowckCtxt; | |
| 15 | 16 | use crate::diagnostics::{CapturedMessageOpt, DescribePlaceOpt, UseSpans}; |
| 16 | 17 | use crate::prefixes::PrefixSet; |
| 17 | use crate::MirBorrowckCtxt; | |
| 18 | 18 | |
| 19 | 19 | #[derive(Debug)] |
| 20 | 20 | pub(crate) enum IllegalMoveOriginKind<'tcx> { |
compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs+3-3| ... | ... | @@ -14,8 +14,8 @@ use rustc_middle::mir::{ |
| 14 | 14 | PlaceRef, ProjectionElem, |
| 15 | 15 | }; |
| 16 | 16 | use rustc_middle::ty::{self, InstanceKind, Ty, TyCtxt, Upcast}; |
| 17 | use rustc_span::symbol::{kw, Symbol}; | |
| 18 | use rustc_span::{sym, BytePos, DesugaringKind, Span}; | |
| 17 | use rustc_span::symbol::{Symbol, kw}; | |
| 18 | use rustc_span::{BytePos, DesugaringKind, Span, sym}; | |
| 19 | 19 | use rustc_target::abi::FieldIdx; |
| 20 | 20 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; |
| 21 | 21 | use rustc_trait_selection::infer::InferCtxtExt; |
| ... | ... | @@ -24,7 +24,7 @@ use tracing::debug; |
| 24 | 24 | |
| 25 | 25 | use crate::diagnostics::BorrowedContentSource; |
| 26 | 26 | use crate::util::FindAssignments; |
| 27 | use crate::{session_diagnostics, MirBorrowckCtxt}; | |
| 27 | use crate::{MirBorrowckCtxt, session_diagnostics}; | |
| 28 | 28 | |
| 29 | 29 | #[derive(Copy, Clone, Debug, Eq, PartialEq)] |
| 30 | 30 | pub(crate) enum AccessKind { |
compiler/rustc_borrowck/src/diagnostics/region_errors.rs+14-17| ... | ... | @@ -3,26 +3,26 @@ |
| 3 | 3 | use rustc_data_structures::fx::FxIndexSet; |
| 4 | 4 | use rustc_errors::{Applicability, Diag, ErrorGuaranteed, MultiSpan}; |
| 5 | 5 | use rustc_hir as hir; |
| 6 | use rustc_hir::def::Res::Def; | |
| 7 | use rustc_hir::def_id::DefId; | |
| 8 | use rustc_hir::intravisit::Visitor; | |
| 9 | 6 | use rustc_hir::GenericBound::Trait; |
| 10 | 7 | use rustc_hir::QPath::Resolved; |
| 11 | 8 | use rustc_hir::WherePredicate::BoundPredicate; |
| 9 | use rustc_hir::def::Res::Def; | |
| 10 | use rustc_hir::def_id::DefId; | |
| 11 | use rustc_hir::intravisit::Visitor; | |
| 12 | 12 | use rustc_hir::{PolyTraitRef, TyKind, WhereBoundPredicate}; |
| 13 | 13 | use rustc_infer::infer::{NllRegionVariableOrigin, RelateParamBound}; |
| 14 | 14 | use rustc_middle::bug; |
| 15 | 15 | use rustc_middle::hir::place::PlaceBase; |
| 16 | 16 | use rustc_middle::mir::{ConstraintCategory, ReturnConstraint}; |
| 17 | 17 | use rustc_middle::ty::{self, GenericArgs, Region, RegionVid, Ty, TyCtxt, TypeVisitor}; |
| 18 | use rustc_span::symbol::{kw, Ident}; | |
| 19 | 18 | use rustc_span::Span; |
| 19 | use rustc_span::symbol::{Ident, kw}; | |
| 20 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; | |
| 20 | 21 | use rustc_trait_selection::error_reporting::infer::nice_region_error::{ |
| 21 | self, find_anon_type, find_param_with_region, suggest_adding_lifetime_params, | |
| 22 | HirTraitObjectVisitor, NiceRegionError, TraitObjectVisitor, | |
| 22 | self, HirTraitObjectVisitor, NiceRegionError, TraitObjectVisitor, find_anon_type, | |
| 23 | find_param_with_region, suggest_adding_lifetime_params, | |
| 23 | 24 | }; |
| 24 | 25 | use rustc_trait_selection::error_reporting::infer::region::unexpected_hidden_region_diagnostic; |
| 25 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; | |
| 26 | 26 | use rustc_trait_selection::infer::InferCtxtExt; |
| 27 | 27 | use rustc_trait_selection::traits::{Obligation, ObligationCtxt}; |
| 28 | 28 | use tracing::{debug, instrument, trace}; |
| ... | ... | @@ -36,7 +36,7 @@ use crate::session_diagnostics::{ |
| 36 | 36 | LifetimeReturnCategoryErr, RequireStaticErr, VarHereDenote, |
| 37 | 37 | }; |
| 38 | 38 | use crate::universal_regions::DefiningTy; |
| 39 | use crate::{borrowck_errors, fluent_generated as fluent, MirBorrowckCtxt}; | |
| 39 | use crate::{MirBorrowckCtxt, borrowck_errors, fluent_generated as fluent}; | |
| 40 | 40 | |
| 41 | 41 | impl<'tcx> ConstraintDescription for ConstraintCategory<'tcx> { |
| 42 | 42 | fn description(&self) -> &'static str { |
| ... | ... | @@ -1108,15 +1108,12 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { |
| 1108 | 1108 | let closure_ty = Ty::new_closure( |
| 1109 | 1109 | tcx, |
| 1110 | 1110 | closure_def_id.to_def_id(), |
| 1111 | ty::ClosureArgs::new( | |
| 1112 | tcx, | |
| 1113 | ty::ClosureArgsParts { | |
| 1114 | parent_args: args.parent_args(), | |
| 1115 | closure_kind_ty: args.kind_ty(), | |
| 1116 | tupled_upvars_ty: args.tupled_upvars_ty(), | |
| 1117 | closure_sig_as_fn_ptr_ty, | |
| 1118 | }, | |
| 1119 | ) | |
| 1111 | ty::ClosureArgs::new(tcx, ty::ClosureArgsParts { | |
| 1112 | parent_args: args.parent_args(), | |
| 1113 | closure_kind_ty: args.kind_ty(), | |
| 1114 | tupled_upvars_ty: args.tupled_upvars_ty(), | |
| 1115 | closure_sig_as_fn_ptr_ty, | |
| 1116 | }) | |
| 1120 | 1117 | .args, |
| 1121 | 1118 | ); |
| 1122 | 1119 |
compiler/rustc_borrowck/src/diagnostics/region_name.rs+3-3| ... | ... | @@ -11,13 +11,13 @@ use rustc_hir::def::{DefKind, Res}; |
| 11 | 11 | use rustc_middle::ty::print::RegionHighlightMode; |
| 12 | 12 | use rustc_middle::ty::{self, GenericArgKind, GenericArgsRef, RegionVid, Ty}; |
| 13 | 13 | use rustc_middle::{bug, span_bug}; |
| 14 | use rustc_span::symbol::{kw, sym, Symbol}; | |
| 15 | use rustc_span::{Span, DUMMY_SP}; | |
| 14 | use rustc_span::symbol::{Symbol, kw, sym}; | |
| 15 | use rustc_span::{DUMMY_SP, Span}; | |
| 16 | 16 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; |
| 17 | 17 | use tracing::{debug, instrument}; |
| 18 | 18 | |
| 19 | use crate::universal_regions::DefiningTy; | |
| 20 | 19 | use crate::MirBorrowckCtxt; |
| 20 | use crate::universal_regions::DefiningTy; | |
| 21 | 21 | |
| 22 | 22 | /// A name for a particular region used in emitting diagnostics. This name could be a generated |
| 23 | 23 | /// name like `'1`, a name used by the user like `'a`, or a name like `'static`. |
compiler/rustc_borrowck/src/diagnostics/var_name.rs+1-1| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use rustc_index::IndexSlice; |
| 2 | 2 | use rustc_middle::mir::{Body, Local}; |
| 3 | 3 | use rustc_middle::ty::{self, RegionVid, TyCtxt}; |
| 4 | use rustc_span::symbol::Symbol; | |
| 5 | 4 | use rustc_span::Span; |
| 5 | use rustc_span::symbol::Symbol; | |
| 6 | 6 | use tracing::debug; |
| 7 | 7 | |
| 8 | 8 | use crate::region_infer::RegionInferenceContext; |
compiler/rustc_borrowck/src/facts.rs+1-1| ... | ... | @@ -10,8 +10,8 @@ use rustc_middle::mir::Local; |
| 10 | 10 | use rustc_middle::ty::{RegionVid, TyCtxt}; |
| 11 | 11 | use rustc_mir_dataflow::move_paths::MovePathIndex; |
| 12 | 12 | |
| 13 | use crate::location::{LocationIndex, LocationTable}; | |
| 14 | 13 | use crate::BorrowIndex; |
| 14 | use crate::location::{LocationIndex, LocationTable}; | |
| 15 | 15 | |
| 16 | 16 | #[derive(Copy, Clone, Debug)] |
| 17 | 17 | pub struct RustcFacts; |
compiler/rustc_borrowck/src/lib.rs+5-9| ... | ... | @@ -37,13 +37,13 @@ use rustc_middle::mir::*; |
| 37 | 37 | use rustc_middle::query::Providers; |
| 38 | 38 | use rustc_middle::ty::{self, ParamEnv, RegionVid, TyCtxt}; |
| 39 | 39 | use rustc_middle::{bug, span_bug}; |
| 40 | use rustc_mir_dataflow::Analysis; | |
| 40 | 41 | use rustc_mir_dataflow::impls::{ |
| 41 | 42 | EverInitializedPlaces, MaybeInitializedPlaces, MaybeUninitializedPlaces, |
| 42 | 43 | }; |
| 43 | 44 | use rustc_mir_dataflow::move_paths::{ |
| 44 | 45 | InitIndex, InitLocation, LookupResult, MoveData, MoveOutIndex, MovePathIndex, |
| 45 | 46 | }; |
| 46 | use rustc_mir_dataflow::Analysis; | |
| 47 | 47 | use rustc_session::lint::builtin::UNUSED_MUT; |
| 48 | 48 | use rustc_span::{Span, Symbol}; |
| 49 | 49 | use rustc_target::abi::FieldIdx; |
| ... | ... | @@ -86,7 +86,7 @@ use borrow_set::{BorrowData, BorrowSet}; |
| 86 | 86 | use dataflow::{BorrowIndex, BorrowckDomain, BorrowckResults, Borrows}; |
| 87 | 87 | use nll::PoloniusOutput; |
| 88 | 88 | use place_ext::PlaceExt; |
| 89 | use places_conflict::{places_conflict, PlaceConflictBias}; | |
| 89 | use places_conflict::{PlaceConflictBias, places_conflict}; | |
| 90 | 90 | use region_infer::RegionInferenceContext; |
| 91 | 91 | use renumber::RegionCtxt; |
| 92 | 92 | |
| ... | ... | @@ -1612,13 +1612,9 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> { |
| 1612 | 1612 | match elem { |
| 1613 | 1613 | ProjectionElem::Deref => match place_ty.ty.kind() { |
| 1614 | 1614 | ty::Ref(..) | ty::RawPtr(..) => { |
| 1615 | self.move_errors.push(MoveError::new( | |
| 1616 | place, | |
| 1617 | location, | |
| 1618 | BorrowedContent { | |
| 1619 | target_place: place_ref.project_deeper(&[elem], tcx), | |
| 1620 | }, | |
| 1621 | )); | |
| 1615 | self.move_errors.push(MoveError::new(place, location, BorrowedContent { | |
| 1616 | target_place: place_ref.project_deeper(&[elem], tcx), | |
| 1617 | })); | |
| 1622 | 1618 | return; |
| 1623 | 1619 | } |
| 1624 | 1620 | ty::Adt(adt, _) => { |
compiler/rustc_borrowck/src/nll.rs+5-5| ... | ... | @@ -9,17 +9,17 @@ use polonius_engine::{Algorithm, Output}; |
| 9 | 9 | use rustc_data_structures::fx::FxIndexMap; |
| 10 | 10 | use rustc_hir::def_id::LocalDefId; |
| 11 | 11 | use rustc_index::IndexSlice; |
| 12 | use rustc_middle::mir::pretty::{dump_mir_with_options, PrettyPrintMirOptions}; | |
| 12 | use rustc_middle::mir::pretty::{PrettyPrintMirOptions, dump_mir_with_options}; | |
| 13 | 13 | use rustc_middle::mir::{ |
| 14 | create_dump_file, dump_enabled, dump_mir, Body, ClosureOutlivesSubject, | |
| 15 | ClosureRegionRequirements, PassWhere, Promoted, | |
| 14 | Body, ClosureOutlivesSubject, ClosureRegionRequirements, PassWhere, Promoted, create_dump_file, | |
| 15 | dump_enabled, dump_mir, | |
| 16 | 16 | }; |
| 17 | 17 | use rustc_middle::ty::print::with_no_trimmed_paths; |
| 18 | 18 | use rustc_middle::ty::{self, OpaqueHiddenType, TyCtxt}; |
| 19 | use rustc_mir_dataflow::ResultsCursor; | |
| 19 | 20 | use rustc_mir_dataflow::impls::MaybeInitializedPlaces; |
| 20 | 21 | use rustc_mir_dataflow::move_paths::MoveData; |
| 21 | 22 | use rustc_mir_dataflow::points::DenseLocationMap; |
| 22 | use rustc_mir_dataflow::ResultsCursor; | |
| 23 | 23 | use rustc_session::config::MirIncludeSpans; |
| 24 | 24 | use rustc_span::symbol::sym; |
| 25 | 25 | use tracing::{debug, instrument}; |
| ... | ... | @@ -32,7 +32,7 @@ use crate::location::LocationTable; |
| 32 | 32 | use crate::region_infer::RegionInferenceContext; |
| 33 | 33 | use crate::type_check::{self, MirTypeckRegionConstraints, MirTypeckResults}; |
| 34 | 34 | use crate::universal_regions::UniversalRegions; |
| 35 | use crate::{polonius, renumber, BorrowckInferCtxt}; | |
| 35 | use crate::{BorrowckInferCtxt, polonius, renumber}; | |
| 36 | 36 | |
| 37 | 37 | pub type PoloniusOutput = Output<RustcFacts>; |
| 38 | 38 |
compiler/rustc_borrowck/src/path_utils.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ use rustc_target::abi::FieldIdx; |
| 5 | 5 | use tracing::debug; |
| 6 | 6 | |
| 7 | 7 | use crate::borrow_set::{BorrowData, BorrowSet, TwoPhaseActivation}; |
| 8 | use crate::{places_conflict, AccessDepth, BorrowIndex}; | |
| 8 | use crate::{AccessDepth, BorrowIndex, places_conflict}; | |
| 9 | 9 | |
| 10 | 10 | /// Returns `true` if the borrow represented by `kind` is |
| 11 | 11 | /// allowed to be split into separate Reservation and |
compiler/rustc_borrowck/src/region_infer/mod.rs+2-2| ... | ... | @@ -23,6 +23,7 @@ use rustc_mir_dataflow::points::DenseLocationMap; |
| 23 | 23 | use rustc_span::Span; |
| 24 | 24 | use tracing::{debug, instrument, trace}; |
| 25 | 25 | |
| 26 | use crate::BorrowckInferCtxt; | |
| 26 | 27 | use crate::constraints::graph::{self, NormalConstraintGraph, RegionGraph}; |
| 27 | 28 | use crate::constraints::{ConstraintSccIndex, OutlivesConstraint, OutlivesConstraintSet}; |
| 28 | 29 | use crate::dataflow::BorrowIndex; |
| ... | ... | @@ -33,10 +34,9 @@ use crate::region_infer::reverse_sccs::ReverseSccGraph; |
| 33 | 34 | use crate::region_infer::values::{ |
| 34 | 35 | LivenessValues, PlaceholderIndices, RegionElement, RegionValues, ToElementIndex, |
| 35 | 36 | }; |
| 36 | use crate::type_check::free_region_relations::UniversalRegionRelations; | |
| 37 | 37 | use crate::type_check::Locations; |
| 38 | use crate::type_check::free_region_relations::UniversalRegionRelations; | |
| 38 | 39 | use crate::universal_regions::UniversalRegions; |
| 39 | use crate::BorrowckInferCtxt; | |
| 40 | 40 | |
| 41 | 41 | mod dump_mir; |
| 42 | 42 | mod graphviz; |
compiler/rustc_borrowck/src/region_infer/opaque_types.rs+5-5| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use rustc_data_structures::fx::FxIndexMap; |
| 2 | 2 | use rustc_errors::ErrorGuaranteed; |
| 3 | use rustc_hir::OpaqueTyOrigin; | |
| 3 | 4 | use rustc_hir::def::DefKind; |
| 4 | 5 | use rustc_hir::def_id::LocalDefId; |
| 5 | use rustc_hir::OpaqueTyOrigin; | |
| 6 | 6 | use rustc_infer::infer::{InferCtxt, NllRegionVariableOrigin, TyCtxtInferExt as _}; |
| 7 | 7 | use rustc_infer::traits::{Obligation, ObligationCause}; |
| 8 | 8 | use rustc_macros::extension; |
| ... | ... | @@ -165,10 +165,10 @@ impl<'tcx> RegionInferenceContext<'tcx> { |
| 165 | 165 | // FIXME(oli-obk): collect multiple spans for better diagnostics down the road. |
| 166 | 166 | prev.span = prev.span.substitute_dummy(concrete_type.span); |
| 167 | 167 | } else { |
| 168 | result.insert( | |
| 169 | opaque_type_key.def_id, | |
| 170 | OpaqueHiddenType { ty, span: concrete_type.span }, | |
| 171 | ); | |
| 168 | result.insert(opaque_type_key.def_id, OpaqueHiddenType { | |
| 169 | ty, | |
| 170 | span: concrete_type.span, | |
| 171 | }); | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | // Check that all opaque types have the same region parameters if they have the same |
compiler/rustc_borrowck/src/region_infer/reverse_sccs.rs+1-1| ... | ... | @@ -5,8 +5,8 @@ use rustc_data_structures::graph; |
| 5 | 5 | use rustc_data_structures::graph::vec_graph::VecGraph; |
| 6 | 6 | use rustc_middle::ty::RegionVid; |
| 7 | 7 | |
| 8 | use crate::constraints::ConstraintSccIndex; | |
| 9 | 8 | use crate::RegionInferenceContext; |
| 9 | use crate::constraints::ConstraintSccIndex; | |
| 10 | 10 | |
| 11 | 11 | pub(crate) struct ReverseSccGraph { |
| 12 | 12 | graph: VecGraph<ConstraintSccIndex>, |
compiler/rustc_borrowck/src/region_infer/values.rs+1-1| ... | ... | @@ -2,9 +2,9 @@ use std::fmt::Debug; |
| 2 | 2 | use std::rc::Rc; |
| 3 | 3 | |
| 4 | 4 | use rustc_data_structures::fx::{FxHashSet, FxIndexSet}; |
| 5 | use rustc_index::Idx; | |
| 5 | 6 | use rustc_index::bit_set::SparseBitMatrix; |
| 6 | 7 | use rustc_index::interval::{IntervalSet, SparseIntervalMatrix}; |
| 7 | use rustc_index::Idx; | |
| 8 | 8 | use rustc_middle::mir::{BasicBlock, Location}; |
| 9 | 9 | use rustc_middle::ty::{self, RegionVid}; |
| 10 | 10 | use rustc_mir_dataflow::points::{DenseLocationMap, PointIndex}; |
compiler/rustc_borrowck/src/session_diagnostics.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | use rustc_errors::codes::*; | |
| 2 | 1 | use rustc_errors::MultiSpan; |
| 2 | use rustc_errors::codes::*; | |
| 3 | 3 | use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic}; |
| 4 | 4 | use rustc_middle::ty::{GenericArg, Ty}; |
| 5 | 5 | use rustc_span::Span; |
compiler/rustc_borrowck/src/type_check/canonical.rs+2-2| ... | ... | @@ -5,11 +5,11 @@ use rustc_infer::infer::canonical::Canonical; |
| 5 | 5 | use rustc_middle::bug; |
| 6 | 6 | use rustc_middle::mir::ConstraintCategory; |
| 7 | 7 | use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable, Upcast}; |
| 8 | use rustc_span::def_id::DefId; | |
| 9 | 8 | use rustc_span::Span; |
| 9 | use rustc_span::def_id::DefId; | |
| 10 | use rustc_trait_selection::traits::ObligationCause; | |
| 10 | 11 | use rustc_trait_selection::traits::query::type_op::custom::CustomTypeOp; |
| 11 | 12 | use rustc_trait_selection::traits::query::type_op::{self, TypeOpOutput}; |
| 12 | use rustc_trait_selection::traits::ObligationCause; | |
| 13 | 13 | use tracing::{debug, instrument}; |
| 14 | 14 | |
| 15 | 15 | use super::{Locations, NormalizeLocation, TypeChecker}; |
compiler/rustc_borrowck/src/type_check/constraint_conversion.rs+2-2| ... | ... | @@ -6,13 +6,13 @@ use rustc_infer::infer::region_constraints::{GenericKind, VerifyBound}; |
| 6 | 6 | use rustc_infer::infer::{self, InferCtxt, SubregionOrigin}; |
| 7 | 7 | use rustc_middle::bug; |
| 8 | 8 | use rustc_middle::mir::{ClosureOutlivesSubject, ClosureRegionRequirements, ConstraintCategory}; |
| 9 | use rustc_middle::traits::query::NoSolution; | |
| 10 | 9 | use rustc_middle::traits::ObligationCause; |
| 10 | use rustc_middle::traits::query::NoSolution; | |
| 11 | 11 | use rustc_middle::ty::{self, GenericArgKind, Ty, TyCtxt, TypeFoldable, TypeVisitableExt}; |
| 12 | 12 | use rustc_span::Span; |
| 13 | use rustc_trait_selection::traits::ScrubbedTraitError; | |
| 13 | 14 | use rustc_trait_selection::traits::query::type_op::custom::CustomTypeOp; |
| 14 | 15 | use rustc_trait_selection::traits::query::type_op::{TypeOp, TypeOpOutput}; |
| 15 | use rustc_trait_selection::traits::ScrubbedTraitError; | |
| 16 | 16 | use tracing::{debug, instrument}; |
| 17 | 17 | |
| 18 | 18 | use crate::constraints::OutlivesConstraint; |
compiler/rustc_borrowck/src/type_check/free_region_relations.rs+3-3| ... | ... | @@ -6,10 +6,10 @@ use rustc_hir::def::DefKind; |
| 6 | 6 | use rustc_infer::infer::canonical::QueryRegionConstraints; |
| 7 | 7 | use rustc_infer::infer::outlives::env::RegionBoundPairs; |
| 8 | 8 | use rustc_infer::infer::region_constraints::GenericKind; |
| 9 | use rustc_infer::infer::{outlives, InferCtxt}; | |
| 9 | use rustc_infer::infer::{InferCtxt, outlives}; | |
| 10 | 10 | use rustc_middle::mir::ConstraintCategory; |
| 11 | use rustc_middle::traits::query::OutlivesBound; | |
| 12 | 11 | use rustc_middle::traits::ObligationCause; |
| 12 | use rustc_middle::traits::query::OutlivesBound; | |
| 13 | 13 | use rustc_middle::ty::{self, RegionVid, Ty, TypeVisitableExt}; |
| 14 | 14 | use rustc_span::{ErrorGuaranteed, Span}; |
| 15 | 15 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; |
| ... | ... | @@ -18,7 +18,7 @@ use rustc_trait_selection::traits::query::type_op::{self, TypeOp}; |
| 18 | 18 | use tracing::{debug, instrument}; |
| 19 | 19 | use type_op::TypeOpOutput; |
| 20 | 20 | |
| 21 | use crate::type_check::{constraint_conversion, Locations, MirTypeckRegionConstraints}; | |
| 21 | use crate::type_check::{Locations, MirTypeckRegionConstraints, constraint_conversion}; | |
| 22 | 22 | use crate::universal_regions::UniversalRegions; |
| 23 | 23 | |
| 24 | 24 | #[derive(Debug)] |
compiler/rustc_borrowck/src/type_check/input_output.rs+11-14| ... | ... | @@ -77,20 +77,17 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { |
| 77 | 77 | let output_ty = Ty::new_coroutine( |
| 78 | 78 | self.tcx(), |
| 79 | 79 | self.tcx().coroutine_for_closure(mir_def_id), |
| 80 | ty::CoroutineArgs::new( | |
| 81 | self.tcx(), | |
| 82 | ty::CoroutineArgsParts { | |
| 83 | parent_args: args.parent_args(), | |
| 84 | kind_ty: Ty::from_coroutine_closure_kind(self.tcx(), args.kind()), | |
| 85 | return_ty: user_provided_sig.output(), | |
| 86 | tupled_upvars_ty, | |
| 87 | // For async closures, none of these can be annotated, so just fill | |
| 88 | // them with fresh ty vars. | |
| 89 | resume_ty: next_ty_var(), | |
| 90 | yield_ty: next_ty_var(), | |
| 91 | witness: next_ty_var(), | |
| 92 | }, | |
| 93 | ) | |
| 80 | ty::CoroutineArgs::new(self.tcx(), ty::CoroutineArgsParts { | |
| 81 | parent_args: args.parent_args(), | |
| 82 | kind_ty: Ty::from_coroutine_closure_kind(self.tcx(), args.kind()), | |
| 83 | return_ty: user_provided_sig.output(), | |
| 84 | tupled_upvars_ty, | |
| 85 | // For async closures, none of these can be annotated, so just fill | |
| 86 | // them with fresh ty vars. | |
| 87 | resume_ty: next_ty_var(), | |
| 88 | yield_ty: next_ty_var(), | |
| 89 | witness: next_ty_var(), | |
| 90 | }) | |
| 94 | 91 | .args, |
| 95 | 92 | ); |
| 96 | 93 |
compiler/rustc_borrowck/src/type_check/liveness/mod.rs+1-1| ... | ... | @@ -7,10 +7,10 @@ use rustc_middle::mir::{Body, Local, Location, SourceInfo}; |
| 7 | 7 | use rustc_middle::span_bug; |
| 8 | 8 | use rustc_middle::ty::visit::TypeVisitable; |
| 9 | 9 | use rustc_middle::ty::{GenericArgsRef, Region, RegionVid, Ty, TyCtxt}; |
| 10 | use rustc_mir_dataflow::ResultsCursor; | |
| 10 | 11 | use rustc_mir_dataflow::impls::MaybeInitializedPlaces; |
| 11 | 12 | use rustc_mir_dataflow::move_paths::MoveData; |
| 12 | 13 | use rustc_mir_dataflow::points::DenseLocationMap; |
| 13 | use rustc_mir_dataflow::ResultsCursor; | |
| 14 | 14 | use tracing::debug; |
| 15 | 15 | |
| 16 | 16 | use super::TypeChecker; |
compiler/rustc_borrowck/src/type_check/liveness/trace.rs+1-1| ... | ... | @@ -8,10 +8,10 @@ use rustc_infer::infer::outlives::for_liveness; |
| 8 | 8 | use rustc_middle::mir::{BasicBlock, Body, ConstraintCategory, Local, Location}; |
| 9 | 9 | use rustc_middle::traits::query::DropckOutlivesResult; |
| 10 | 10 | use rustc_middle::ty::{Ty, TyCtxt, TypeVisitable, TypeVisitableExt}; |
| 11 | use rustc_mir_dataflow::ResultsCursor; | |
| 11 | 12 | use rustc_mir_dataflow::impls::MaybeInitializedPlaces; |
| 12 | 13 | use rustc_mir_dataflow::move_paths::{HasMoveData, MoveData, MovePathIndex}; |
| 13 | 14 | use rustc_mir_dataflow::points::{DenseLocationMap, PointIndex}; |
| 14 | use rustc_mir_dataflow::ResultsCursor; | |
| 15 | 15 | use rustc_span::DUMMY_SP; |
| 16 | 16 | use rustc_trait_selection::traits::query::type_op::outlives::DropckOutlives; |
| 17 | 17 | use rustc_trait_selection::traits::query::type_op::{TypeOp, TypeOpOutput}; |
compiler/rustc_borrowck/src/type_check/mod.rs+15-17| ... | ... | @@ -31,20 +31,20 @@ use rustc_middle::ty::{ |
| 31 | 31 | UserType, UserTypeAnnotationIndex, |
| 32 | 32 | }; |
| 33 | 33 | use rustc_middle::{bug, span_bug}; |
| 34 | use rustc_mir_dataflow::ResultsCursor; | |
| 34 | 35 | use rustc_mir_dataflow::impls::MaybeInitializedPlaces; |
| 35 | 36 | use rustc_mir_dataflow::move_paths::MoveData; |
| 36 | 37 | use rustc_mir_dataflow::points::DenseLocationMap; |
| 37 | use rustc_mir_dataflow::ResultsCursor; | |
| 38 | 38 | use rustc_span::def_id::CRATE_DEF_ID; |
| 39 | 39 | use rustc_span::source_map::Spanned; |
| 40 | 40 | use rustc_span::symbol::sym; |
| 41 | use rustc_span::{Span, DUMMY_SP}; | |
| 42 | use rustc_target::abi::{FieldIdx, FIRST_VARIANT}; | |
| 41 | use rustc_span::{DUMMY_SP, Span}; | |
| 42 | use rustc_target::abi::{FIRST_VARIANT, FieldIdx}; | |
| 43 | use rustc_trait_selection::traits::PredicateObligation; | |
| 43 | 44 | use rustc_trait_selection::traits::query::type_op::custom::{ |
| 44 | scrape_region_constraints, CustomTypeOp, | |
| 45 | CustomTypeOp, scrape_region_constraints, | |
| 45 | 46 | }; |
| 46 | 47 | use rustc_trait_selection::traits::query::type_op::{TypeOp, TypeOpOutput}; |
| 47 | use rustc_trait_selection::traits::PredicateObligation; | |
| 48 | 48 | use tracing::{debug, instrument, trace}; |
| 49 | 49 | |
| 50 | 50 | use crate::borrow_set::BorrowSet; |
| ... | ... | @@ -53,13 +53,13 @@ use crate::diagnostics::UniverseInfo; |
| 53 | 53 | use crate::facts::AllFacts; |
| 54 | 54 | use crate::location::LocationTable; |
| 55 | 55 | use crate::member_constraints::MemberConstraintSet; |
| 56 | use crate::region_infer::values::{LivenessValues, PlaceholderIndex, PlaceholderIndices}; | |
| 57 | 56 | use crate::region_infer::TypeTest; |
| 57 | use crate::region_infer::values::{LivenessValues, PlaceholderIndex, PlaceholderIndices}; | |
| 58 | 58 | use crate::renumber::RegionCtxt; |
| 59 | 59 | use crate::session_diagnostics::{MoveUnsized, SimdIntrinsicArgConst}; |
| 60 | 60 | use crate::type_check::free_region_relations::{CreateResult, UniversalRegionRelations}; |
| 61 | 61 | use crate::universal_regions::{DefiningTy, UniversalRegions}; |
| 62 | use crate::{path_utils, BorrowckInferCtxt}; | |
| 62 | use crate::{BorrowckInferCtxt, path_utils}; | |
| 63 | 63 | |
| 64 | 64 | macro_rules! span_mirbug { |
| 65 | 65 | ($context:expr, $elem:expr, $($message:tt)*) => ({ |
| ... | ... | @@ -1944,11 +1944,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { |
| 1944 | 1944 | } |
| 1945 | 1945 | |
| 1946 | 1946 | &Rvalue::NullaryOp(NullOp::SizeOf | NullOp::AlignOf, ty) => { |
| 1947 | let trait_ref = ty::TraitRef::new( | |
| 1948 | tcx, | |
| 1949 | tcx.require_lang_item(LangItem::Sized, Some(span)), | |
| 1950 | [ty], | |
| 1951 | ); | |
| 1947 | let trait_ref = | |
| 1948 | ty::TraitRef::new(tcx, tcx.require_lang_item(LangItem::Sized, Some(span)), [ | |
| 1949 | ty, | |
| 1950 | ]); | |
| 1952 | 1951 | |
| 1953 | 1952 | self.prove_trait_ref( |
| 1954 | 1953 | trait_ref, |
| ... | ... | @@ -1961,11 +1960,10 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { |
| 1961 | 1960 | Rvalue::ShallowInitBox(operand, ty) => { |
| 1962 | 1961 | self.check_operand(operand, location); |
| 1963 | 1962 | |
| 1964 | let trait_ref = ty::TraitRef::new( | |
| 1965 | tcx, | |
| 1966 | tcx.require_lang_item(LangItem::Sized, Some(span)), | |
| 1967 | [*ty], | |
| 1968 | ); | |
| 1963 | let trait_ref = | |
| 1964 | ty::TraitRef::new(tcx, tcx.require_lang_item(LangItem::Sized, Some(span)), [ | |
| 1965 | *ty, | |
| 1966 | ]); | |
| 1969 | 1967 | |
| 1970 | 1968 | self.prove_trait_ref( |
| 1971 | 1969 | trait_ref, |
compiler/rustc_borrowck/src/type_check/relate_tys.rs+2-2| ... | ... | @@ -4,12 +4,12 @@ use rustc_infer::infer::relate::{ |
| 4 | 4 | PredicateEmittingRelation, Relate, RelateResult, StructurallyRelateAliases, TypeRelation, |
| 5 | 5 | }; |
| 6 | 6 | use rustc_infer::infer::{InferCtxt, NllRegionVariableOrigin}; |
| 7 | use rustc_infer::traits::solve::Goal; | |
| 8 | 7 | use rustc_infer::traits::Obligation; |
| 8 | use rustc_infer::traits::solve::Goal; | |
| 9 | 9 | use rustc_middle::mir::ConstraintCategory; |
| 10 | 10 | use rustc_middle::span_bug; |
| 11 | use rustc_middle::traits::query::NoSolution; | |
| 12 | 11 | use rustc_middle::traits::ObligationCause; |
| 12 | use rustc_middle::traits::query::NoSolution; | |
| 13 | 13 | use rustc_middle::ty::fold::FnMutDelegate; |
| 14 | 14 | use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt}; |
| 15 | 15 | use rustc_span::symbol::sym; |
compiler/rustc_borrowck/src/universal_regions.rs+6-6| ... | ... | @@ -20,9 +20,9 @@ use std::iter; |
| 20 | 20 | |
| 21 | 21 | use rustc_data_structures::fx::FxIndexMap; |
| 22 | 22 | use rustc_errors::Diag; |
| 23 | use rustc_hir::BodyOwnerKind; | |
| 23 | 24 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| 24 | 25 | use rustc_hir::lang_items::LangItem; |
| 25 | use rustc_hir::BodyOwnerKind; | |
| 26 | 26 | use rustc_index::IndexVec; |
| 27 | 27 | use rustc_infer::infer::NllRegionVariableOrigin; |
| 28 | 28 | use rustc_macros::extension; |
| ... | ... | @@ -37,8 +37,8 @@ use rustc_span::symbol::{kw, sym}; |
| 37 | 37 | use rustc_span::{ErrorGuaranteed, Symbol}; |
| 38 | 38 | use tracing::{debug, instrument}; |
| 39 | 39 | |
| 40 | use crate::renumber::RegionCtxt; | |
| 41 | 40 | use crate::BorrowckInferCtxt; |
| 41 | use crate::renumber::RegionCtxt; | |
| 42 | 42 | |
| 43 | 43 | #[derive(Debug)] |
| 44 | 44 | pub(crate) struct UniversalRegions<'tcx> { |
| ... | ... | @@ -629,10 +629,10 @@ impl<'cx, 'tcx> UniversalRegionsBuilder<'cx, 'tcx> { |
| 629 | 629 | let ty = tcx |
| 630 | 630 | .typeck(self.mir_def) |
| 631 | 631 | .node_type(tcx.local_def_id_to_hir_id(self.mir_def)); |
| 632 | let args = InlineConstArgs::new( | |
| 633 | tcx, | |
| 634 | InlineConstArgsParts { parent_args: identity_args, ty }, | |
| 635 | ) | |
| 632 | let args = InlineConstArgs::new(tcx, InlineConstArgsParts { | |
| 633 | parent_args: identity_args, | |
| 634 | ty, | |
| 635 | }) | |
| 636 | 636 | .args; |
| 637 | 637 | let args = self.infcx.replace_free_regions_with_nll_infer_vars(FR, args); |
| 638 | 638 | DefiningTy::InlineConst(self.mir_def.to_def_id(), args) |
compiler/rustc_builtin_macros/src/alloc_error_handler.rs+6-7| ... | ... | @@ -3,9 +3,9 @@ use rustc_ast::{ |
| 3 | 3 | self as ast, Fn, FnHeader, FnSig, Generics, ItemKind, Safety, Stmt, StmtKind, TyKind, |
| 4 | 4 | }; |
| 5 | 5 | use rustc_expand::base::{Annotatable, ExtCtxt}; |
| 6 | use rustc_span::symbol::{kw, sym, Ident}; | |
| 7 | 6 | use rustc_span::Span; |
| 8 | use thin_vec::{thin_vec, ThinVec}; | |
| 7 | use rustc_span::symbol::{Ident, kw, sym}; | |
| 8 | use thin_vec::{ThinVec, thin_vec}; | |
| 9 | 9 | |
| 10 | 10 | use crate::errors; |
| 11 | 11 | use crate::util::check_builtin_macro_attribute; |
| ... | ... | @@ -68,11 +68,10 @@ fn generate_handler(cx: &ExtCtxt<'_>, handler: Ident, span: Span, sig_span: Span |
| 68 | 68 | |
| 69 | 69 | let layout_new = cx.std_path(&[sym::alloc, sym::Layout, sym::from_size_align_unchecked]); |
| 70 | 70 | let layout_new = cx.expr_path(cx.path(span, layout_new)); |
| 71 | let layout = cx.expr_call( | |
| 72 | span, | |
| 73 | layout_new, | |
| 74 | thin_vec![cx.expr_ident(span, size), cx.expr_ident(span, align)], | |
| 75 | ); | |
| 71 | let layout = cx.expr_call(span, layout_new, thin_vec![ | |
| 72 | cx.expr_ident(span, size), | |
| 73 | cx.expr_ident(span, align) | |
| 74 | ]); | |
| 76 | 75 | |
| 77 | 76 | let call = cx.expr_call_ident(sig_span, handler, thin_vec![layout]); |
| 78 | 77 |
compiler/rustc_builtin_macros/src/asm.rs+2-2| ... | ... | @@ -1,16 +1,16 @@ |
| 1 | 1 | use ast::token::IdentIsRaw; |
| 2 | 2 | use lint::BuiltinLintDiag; |
| 3 | use rustc_ast::AsmMacro; | |
| 3 | 4 | use rustc_ast::ptr::P; |
| 4 | 5 | use rustc_ast::token::{self, Delimiter}; |
| 5 | 6 | use rustc_ast::tokenstream::TokenStream; |
| 6 | use rustc_ast::AsmMacro; | |
| 7 | 7 | use rustc_data_structures::fx::{FxHashMap, FxIndexMap}; |
| 8 | 8 | use rustc_errors::PResult; |
| 9 | 9 | use rustc_expand::base::*; |
| 10 | 10 | use rustc_index::bit_set::GrowableBitSet; |
| 11 | 11 | use rustc_parse::parser::Parser; |
| 12 | 12 | use rustc_session::lint; |
| 13 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 13 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 14 | 14 | use rustc_span::{ErrorGuaranteed, InnerSpan, Span}; |
| 15 | 15 | use rustc_target::asm::InlineAsmArch; |
| 16 | 16 | use smallvec::smallvec; |
compiler/rustc_builtin_macros/src/assert.rs+3-3| ... | ... | @@ -3,13 +3,13 @@ mod context; |
| 3 | 3 | use rustc_ast::ptr::P; |
| 4 | 4 | use rustc_ast::token::Delimiter; |
| 5 | 5 | use rustc_ast::tokenstream::{DelimSpan, TokenStream}; |
| 6 | use rustc_ast::{token, DelimArgs, Expr, ExprKind, MacCall, Path, PathSegment, UnOp}; | |
| 6 | use rustc_ast::{DelimArgs, Expr, ExprKind, MacCall, Path, PathSegment, UnOp, token}; | |
| 7 | 7 | use rustc_ast_pretty::pprust; |
| 8 | 8 | use rustc_errors::PResult; |
| 9 | 9 | use rustc_expand::base::{DummyResult, ExpandResult, ExtCtxt, MacEager, MacroExpanderResult}; |
| 10 | 10 | use rustc_parse::parser::Parser; |
| 11 | use rustc_span::symbol::{sym, Ident, Symbol}; | |
| 12 | use rustc_span::{Span, DUMMY_SP}; | |
| 11 | use rustc_span::symbol::{Ident, Symbol, sym}; | |
| 12 | use rustc_span::{DUMMY_SP, Span}; | |
| 13 | 13 | use thin_vec::thin_vec; |
| 14 | 14 | |
| 15 | 15 | use crate::edition_panic::use_panic_2021; |
compiler/rustc_builtin_macros/src/assert/context.rs+4-4| ... | ... | @@ -2,15 +2,15 @@ use rustc_ast::ptr::P; |
| 2 | 2 | use rustc_ast::token::{self, Delimiter, IdentIsRaw}; |
| 3 | 3 | use rustc_ast::tokenstream::{DelimSpan, TokenStream, TokenTree}; |
| 4 | 4 | use rustc_ast::{ |
| 5 | BinOpKind, BorrowKind, DelimArgs, Expr, ExprKind, ItemKind, MacCall, MethodCall, Mutability, | |
| 6 | Path, PathSegment, Stmt, StructRest, UnOp, UseTree, UseTreeKind, DUMMY_NODE_ID, | |
| 5 | BinOpKind, BorrowKind, DUMMY_NODE_ID, DelimArgs, Expr, ExprKind, ItemKind, MacCall, MethodCall, | |
| 6 | Mutability, Path, PathSegment, Stmt, StructRest, UnOp, UseTree, UseTreeKind, | |
| 7 | 7 | }; |
| 8 | 8 | use rustc_ast_pretty::pprust; |
| 9 | 9 | use rustc_data_structures::fx::FxHashSet; |
| 10 | 10 | use rustc_expand::base::ExtCtxt; |
| 11 | use rustc_span::symbol::{sym, Ident, Symbol}; | |
| 12 | 11 | use rustc_span::Span; |
| 13 | use thin_vec::{thin_vec, ThinVec}; | |
| 12 | use rustc_span::symbol::{Ident, Symbol, sym}; | |
| 13 | use thin_vec::{ThinVec, thin_vec}; | |
| 14 | 14 | |
| 15 | 15 | pub(super) struct Context<'cx, 'a> { |
| 16 | 16 | // An optimization. |
compiler/rustc_builtin_macros/src/cfg_accessible.rs+1-1| ... | ... | @@ -4,8 +4,8 @@ use rustc_ast as ast; |
| 4 | 4 | use rustc_expand::base::{Annotatable, ExpandResult, ExtCtxt, Indeterminate, MultiItemModifier}; |
| 5 | 5 | use rustc_feature::AttributeTemplate; |
| 6 | 6 | use rustc_parse::validate_attr; |
| 7 | use rustc_span::symbol::sym; | |
| 8 | 7 | use rustc_span::Span; |
| 8 | use rustc_span::symbol::sym; | |
| 9 | 9 | |
| 10 | 10 | use crate::errors; |
| 11 | 11 |
compiler/rustc_builtin_macros/src/cfg_eval.rs+2-2| ... | ... | @@ -4,7 +4,7 @@ use rustc_ast as ast; |
| 4 | 4 | use rustc_ast::mut_visit::MutVisitor; |
| 5 | 5 | use rustc_ast::ptr::P; |
| 6 | 6 | use rustc_ast::visit::{AssocCtxt, Visitor}; |
| 7 | use rustc_ast::{mut_visit, visit, Attribute, HasAttrs, HasTokens, NodeId}; | |
| 7 | use rustc_ast::{Attribute, HasAttrs, HasTokens, NodeId, mut_visit, visit}; | |
| 8 | 8 | use rustc_errors::PResult; |
| 9 | 9 | use rustc_expand::base::{Annotatable, ExtCtxt}; |
| 10 | 10 | use rustc_expand::config::StripUnconfigured; |
| ... | ... | @@ -12,8 +12,8 @@ use rustc_expand::configure; |
| 12 | 12 | use rustc_feature::Features; |
| 13 | 13 | use rustc_parse::parser::{ForceCollect, Parser}; |
| 14 | 14 | use rustc_session::Session; |
| 15 | use rustc_span::symbol::sym; | |
| 16 | 15 | use rustc_span::Span; |
| 16 | use rustc_span::symbol::sym; | |
| 17 | 17 | use smallvec::SmallVec; |
| 18 | 18 | use tracing::instrument; |
| 19 | 19 |
compiler/rustc_builtin_macros/src/cmdline_attrs.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | //! Attributes injected into the crate root from command line using `-Z crate-attr`. |
| 2 | 2 | |
| 3 | 3 | use rustc_ast::attr::mk_attr; |
| 4 | use rustc_ast::{self as ast, token, AttrItem, AttrStyle}; | |
| 4 | use rustc_ast::{self as ast, AttrItem, AttrStyle, token}; | |
| 5 | 5 | use rustc_parse::parser::ForceCollect; |
| 6 | 6 | use rustc_parse::{new_parser_from_source_str, unwrap_or_emit_fatal}; |
| 7 | 7 | use rustc_session::parse::ParseSess; |
compiler/rustc_builtin_macros/src/concat_bytes.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use rustc_ast::ptr::P; |
| 2 | 2 | use rustc_ast::tokenstream::TokenStream; |
| 3 | use rustc_ast::{token, ExprKind, LitIntType, LitKind, UintTy}; | |
| 3 | use rustc_ast::{ExprKind, LitIntType, LitKind, UintTy, token}; | |
| 4 | 4 | use rustc_expand::base::{DummyResult, ExpandResult, ExtCtxt, MacEager, MacroExpanderResult}; |
| 5 | 5 | use rustc_session::errors::report_lit_error; |
| 6 | 6 | use rustc_span::{ErrorGuaranteed, Span}; |
compiler/rustc_builtin_macros/src/concat_idents.rs+2-2| ... | ... | @@ -1,10 +1,10 @@ |
| 1 | 1 | use rustc_ast::ptr::P; |
| 2 | 2 | use rustc_ast::token::{self, Token}; |
| 3 | 3 | use rustc_ast::tokenstream::{TokenStream, TokenTree}; |
| 4 | use rustc_ast::{AttrVec, Expr, ExprKind, Path, Ty, TyKind, DUMMY_NODE_ID}; | |
| 4 | use rustc_ast::{AttrVec, DUMMY_NODE_ID, Expr, ExprKind, Path, Ty, TyKind}; | |
| 5 | 5 | use rustc_expand::base::{DummyResult, ExpandResult, ExtCtxt, MacResult, MacroExpanderResult}; |
| 6 | use rustc_span::symbol::{Ident, Symbol}; | |
| 7 | 6 | use rustc_span::Span; |
| 7 | use rustc_span::symbol::{Ident, Symbol}; | |
| 8 | 8 | |
| 9 | 9 | use crate::errors; |
| 10 | 10 |
compiler/rustc_builtin_macros/src/derive.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ use rustc_expand::base::{ |
| 6 | 6 | use rustc_feature::AttributeTemplate; |
| 7 | 7 | use rustc_parse::validate_attr; |
| 8 | 8 | use rustc_session::Session; |
| 9 | use rustc_span::symbol::{sym, Ident}; | |
| 9 | use rustc_span::symbol::{Ident, sym}; | |
| 10 | 10 | use rustc_span::{ErrorGuaranteed, Span}; |
| 11 | 11 | |
| 12 | 12 | use crate::cfg_eval::cfg_eval; |
compiler/rustc_builtin_macros/src/deriving/clone.rs+10-16| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | use rustc_ast::{self as ast, Generics, ItemKind, MetaItem, VariantData}; |
| 2 | 2 | use rustc_data_structures::fx::FxHashSet; |
| 3 | 3 | use rustc_expand::base::{Annotatable, ExtCtxt}; |
| 4 | use rustc_span::symbol::{kw, sym, Ident}; | |
| 5 | 4 | use rustc_span::Span; |
| 6 | use thin_vec::{thin_vec, ThinVec}; | |
| 5 | use rustc_span::symbol::{Ident, kw, sym}; | |
| 6 | use thin_vec::{ThinVec, thin_vec}; | |
| 7 | 7 | |
| 8 | 8 | use crate::deriving::generic::ty::*; |
| 9 | 9 | use crate::deriving::generic::*; |
| ... | ... | @@ -115,13 +115,10 @@ fn cs_clone_simple( |
| 115 | 115 | // type parameters. |
| 116 | 116 | } else if !field.ty.kind.is_anon_adt() { |
| 117 | 117 | // let _: AssertParamIsClone<FieldTy>; |
| 118 | super::assert_ty_bounds( | |
| 119 | cx, | |
| 120 | &mut stmts, | |
| 121 | field.ty.clone(), | |
| 122 | field.span, | |
| 123 | &[sym::clone, sym::AssertParamIsClone], | |
| 124 | ); | |
| 118 | super::assert_ty_bounds(cx, &mut stmts, field.ty.clone(), field.span, &[ | |
| 119 | sym::clone, | |
| 120 | sym::AssertParamIsClone, | |
| 121 | ]); | |
| 125 | 122 | } |
| 126 | 123 | } |
| 127 | 124 | }; |
| ... | ... | @@ -130,13 +127,10 @@ fn cs_clone_simple( |
| 130 | 127 | // Just a single assertion for unions, that the union impls `Copy`. |
| 131 | 128 | // let _: AssertParamIsCopy<Self>; |
| 132 | 129 | let self_ty = cx.ty_path(cx.path_ident(trait_span, Ident::with_dummy_span(kw::SelfUpper))); |
| 133 | super::assert_ty_bounds( | |
| 134 | cx, | |
| 135 | &mut stmts, | |
| 136 | self_ty, | |
| 137 | trait_span, | |
| 138 | &[sym::clone, sym::AssertParamIsCopy], | |
| 139 | ); | |
| 130 | super::assert_ty_bounds(cx, &mut stmts, self_ty, trait_span, &[ | |
| 131 | sym::clone, | |
| 132 | sym::AssertParamIsCopy, | |
| 133 | ]); | |
| 140 | 134 | } else { |
| 141 | 135 | match *substr.fields { |
| 142 | 136 | StaticStruct(vdata, ..) => { |
compiler/rustc_builtin_macros/src/deriving/cmp/eq.rs+6-9| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | use rustc_ast::{self as ast, MetaItem}; |
| 2 | 2 | use rustc_data_structures::fx::FxHashSet; |
| 3 | 3 | use rustc_expand::base::{Annotatable, ExtCtxt}; |
| 4 | use rustc_span::symbol::sym; | |
| 5 | 4 | use rustc_span::Span; |
| 6 | use thin_vec::{thin_vec, ThinVec}; | |
| 5 | use rustc_span::symbol::sym; | |
| 6 | use thin_vec::{ThinVec, thin_vec}; | |
| 7 | 7 | |
| 8 | 8 | use crate::deriving::generic::ty::*; |
| 9 | 9 | use crate::deriving::generic::*; |
| ... | ... | @@ -66,13 +66,10 @@ fn cs_total_eq_assert( |
| 66 | 66 | // Already produced an assertion for this type. |
| 67 | 67 | } else { |
| 68 | 68 | // let _: AssertParamIsEq<FieldTy>; |
| 69 | super::assert_ty_bounds( | |
| 70 | cx, | |
| 71 | &mut stmts, | |
| 72 | field.ty.clone(), | |
| 73 | field.span, | |
| 74 | &[sym::cmp, sym::AssertParamIsEq], | |
| 75 | ); | |
| 69 | super::assert_ty_bounds(cx, &mut stmts, field.ty.clone(), field.span, &[ | |
| 70 | sym::cmp, | |
| 71 | sym::AssertParamIsEq, | |
| 72 | ]); | |
| 76 | 73 | } |
| 77 | 74 | } |
| 78 | 75 | }; |
compiler/rustc_builtin_macros/src/deriving/cmp/ord.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use rustc_ast::MetaItem; |
| 2 | 2 | use rustc_expand::base::{Annotatable, ExtCtxt}; |
| 3 | use rustc_span::symbol::{sym, Ident}; | |
| 4 | 3 | use rustc_span::Span; |
| 4 | use rustc_span::symbol::{Ident, sym}; | |
| 5 | 5 | use thin_vec::thin_vec; |
| 6 | 6 | |
| 7 | 7 | use crate::deriving::generic::ty::*; |
compiler/rustc_builtin_macros/src/deriving/cmp/partial_eq.rs+1-1| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use rustc_ast::ptr::P; |
| 2 | 2 | use rustc_ast::{BinOpKind, BorrowKind, Expr, ExprKind, MetaItem, Mutability}; |
| 3 | 3 | use rustc_expand::base::{Annotatable, ExtCtxt}; |
| 4 | use rustc_span::symbol::sym; | |
| 5 | 4 | use rustc_span::Span; |
| 5 | use rustc_span::symbol::sym; | |
| 6 | 6 | use thin_vec::thin_vec; |
| 7 | 7 | |
| 8 | 8 | use crate::deriving::generic::ty::*; |
compiler/rustc_builtin_macros/src/deriving/cmp/partial_ord.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use rustc_ast::{ExprKind, ItemKind, MetaItem, PatKind}; |
| 2 | 2 | use rustc_expand::base::{Annotatable, ExtCtxt}; |
| 3 | use rustc_span::symbol::{sym, Ident}; | |
| 4 | 3 | use rustc_span::Span; |
| 4 | use rustc_span::symbol::{Ident, sym}; | |
| 5 | 5 | use thin_vec::thin_vec; |
| 6 | 6 | |
| 7 | 7 | use crate::deriving::generic::ty::*; |
compiler/rustc_builtin_macros/src/deriving/debug.rs+2-2| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | use rustc_ast::{self as ast, EnumDef, MetaItem}; |
| 2 | 2 | use rustc_expand::base::{Annotatable, ExtCtxt}; |
| 3 | 3 | use rustc_session::config::FmtDebug; |
| 4 | use rustc_span::symbol::{sym, Ident, Symbol}; | |
| 5 | 4 | use rustc_span::Span; |
| 6 | use thin_vec::{thin_vec, ThinVec}; | |
| 5 | use rustc_span::symbol::{Ident, Symbol, sym}; | |
| 6 | use thin_vec::{ThinVec, thin_vec}; | |
| 7 | 7 | |
| 8 | 8 | use crate::deriving::generic::ty::*; |
| 9 | 9 | use crate::deriving::generic::*; |
compiler/rustc_builtin_macros/src/deriving/decodable.rs+29-40| ... | ... | @@ -3,9 +3,9 @@ |
| 3 | 3 | use rustc_ast::ptr::P; |
| 4 | 4 | use rustc_ast::{self as ast, Expr, MetaItem, Mutability}; |
| 5 | 5 | use rustc_expand::base::{Annotatable, ExtCtxt}; |
| 6 | use rustc_span::symbol::{sym, Ident, Symbol}; | |
| 7 | 6 | use rustc_span::Span; |
| 8 | use thin_vec::{thin_vec, ThinVec}; | |
| 7 | use rustc_span::symbol::{Ident, Symbol, sym}; | |
| 8 | use thin_vec::{ThinVec, thin_vec}; | |
| 9 | 9 | |
| 10 | 10 | use crate::deriving::generic::ty::*; |
| 11 | 11 | use crate::deriving::generic::*; |
| ... | ... | @@ -32,10 +32,11 @@ pub(crate) fn expand_deriving_rustc_decodable( |
| 32 | 32 | methods: vec![MethodDef { |
| 33 | 33 | name: sym::decode, |
| 34 | 34 | generics: Bounds { |
| 35 | bounds: vec![( | |
| 36 | typaram, | |
| 37 | vec![Path::new_(vec![krate, sym::Decoder], vec![], PathKind::Global)], | |
| 38 | )], | |
| 35 | bounds: vec![(typaram, vec![Path::new_( | |
| 36 | vec![krate, sym::Decoder], | |
| 37 | vec![], | |
| 38 | PathKind::Global, | |
| 39 | )])], | |
| 39 | 40 | }, |
| 40 | 41 | explicit_self: false, |
| 41 | 42 | nonself_args: vec![( |
| ... | ... | @@ -94,32 +95,24 @@ fn decodable_substructure( |
| 94 | 95 | decode_static_fields(cx, trait_span, path, summary, |cx, span, name, field| { |
| 95 | 96 | cx.expr_try( |
| 96 | 97 | span, |
| 97 | cx.expr_call_global( | |
| 98 | span, | |
| 99 | fn_read_struct_field_path.clone(), | |
| 100 | thin_vec![ | |
| 101 | blkdecoder.clone(), | |
| 102 | cx.expr_str(span, name), | |
| 103 | cx.expr_usize(span, field), | |
| 104 | exprdecode.clone(), | |
| 105 | ], | |
| 106 | ), | |
| 98 | cx.expr_call_global(span, fn_read_struct_field_path.clone(), thin_vec![ | |
| 99 | blkdecoder.clone(), | |
| 100 | cx.expr_str(span, name), | |
| 101 | cx.expr_usize(span, field), | |
| 102 | exprdecode.clone(), | |
| 103 | ]), | |
| 107 | 104 | ) |
| 108 | 105 | }); |
| 109 | 106 | let result = cx.expr_ok(trait_span, result); |
| 110 | 107 | let fn_read_struct_path: Vec<_> = |
| 111 | 108 | cx.def_site_path(&[sym::rustc_serialize, sym::Decoder, sym::read_struct]); |
| 112 | 109 | |
| 113 | cx.expr_call_global( | |
| 114 | trait_span, | |
| 115 | fn_read_struct_path, | |
| 116 | thin_vec![ | |
| 117 | decoder, | |
| 118 | cx.expr_str(trait_span, substr.type_ident.name), | |
| 119 | cx.expr_usize(trait_span, nfields), | |
| 120 | cx.lambda1(trait_span, result, blkarg), | |
| 121 | ], | |
| 122 | ) | |
| 110 | cx.expr_call_global(trait_span, fn_read_struct_path, thin_vec![ | |
| 111 | decoder, | |
| 112 | cx.expr_str(trait_span, substr.type_ident.name), | |
| 113 | cx.expr_usize(trait_span, nfields), | |
| 114 | cx.lambda1(trait_span, result, blkarg), | |
| 115 | ]) | |
| 123 | 116 | } |
| 124 | 117 | StaticEnum(_, fields) => { |
| 125 | 118 | let variant = Ident::new(sym::i, trait_span); |
| ... | ... | @@ -160,23 +153,19 @@ fn decodable_substructure( |
| 160 | 153 | let variant_array_ref = cx.expr_array_ref(trait_span, variants); |
| 161 | 154 | let fn_read_enum_variant_path: Vec<_> = |
| 162 | 155 | cx.def_site_path(&[sym::rustc_serialize, sym::Decoder, sym::read_enum_variant]); |
| 163 | let result = cx.expr_call_global( | |
| 164 | trait_span, | |
| 165 | fn_read_enum_variant_path, | |
| 166 | thin_vec![blkdecoder, variant_array_ref, lambda], | |
| 167 | ); | |
| 156 | let result = cx.expr_call_global(trait_span, fn_read_enum_variant_path, thin_vec![ | |
| 157 | blkdecoder, | |
| 158 | variant_array_ref, | |
| 159 | lambda | |
| 160 | ]); | |
| 168 | 161 | let fn_read_enum_path: Vec<_> = |
| 169 | 162 | cx.def_site_path(&[sym::rustc_serialize, sym::Decoder, sym::read_enum]); |
| 170 | 163 | |
| 171 | cx.expr_call_global( | |
| 172 | trait_span, | |
| 173 | fn_read_enum_path, | |
| 174 | thin_vec![ | |
| 175 | decoder, | |
| 176 | cx.expr_str(trait_span, substr.type_ident.name), | |
| 177 | cx.lambda1(trait_span, result, blkarg), | |
| 178 | ], | |
| 179 | ) | |
| 164 | cx.expr_call_global(trait_span, fn_read_enum_path, thin_vec![ | |
| 165 | decoder, | |
| 166 | cx.expr_str(trait_span, substr.type_ident.name), | |
| 167 | cx.lambda1(trait_span, result, blkarg), | |
| 168 | ]) | |
| 180 | 169 | } |
| 181 | 170 | _ => cx.dcx().bug("expected StaticEnum or StaticStruct in derive(Decodable)"), |
| 182 | 171 | }; |
compiler/rustc_builtin_macros/src/deriving/default.rs+7-7| ... | ... | @@ -2,12 +2,12 @@ use core::ops::ControlFlow; |
| 2 | 2 | |
| 3 | 3 | use rustc_ast as ast; |
| 4 | 4 | use rustc_ast::visit::visit_opt; |
| 5 | use rustc_ast::{attr, EnumDef, VariantData}; | |
| 5 | use rustc_ast::{EnumDef, VariantData, attr}; | |
| 6 | 6 | use rustc_expand::base::{Annotatable, DummyResult, ExtCtxt}; |
| 7 | use rustc_span::symbol::{kw, sym, Ident}; | |
| 7 | use rustc_span::symbol::{Ident, kw, sym}; | |
| 8 | 8 | use rustc_span::{ErrorGuaranteed, Span}; |
| 9 | 9 | use smallvec::SmallVec; |
| 10 | use thin_vec::{thin_vec, ThinVec}; | |
| 10 | use thin_vec::{ThinVec, thin_vec}; | |
| 11 | 11 | |
| 12 | 12 | use crate::deriving::generic::ty::*; |
| 13 | 13 | use crate::deriving::generic::*; |
| ... | ... | @@ -93,10 +93,10 @@ fn default_enum_substructure( |
| 93 | 93 | } { |
| 94 | 94 | Ok(default_variant) => { |
| 95 | 95 | // We now know there is exactly one unit variant with exactly one `#[default]` attribute. |
| 96 | cx.expr_path(cx.path( | |
| 97 | default_variant.span, | |
| 98 | vec![Ident::new(kw::SelfUpper, default_variant.span), default_variant.ident], | |
| 99 | )) | |
| 96 | cx.expr_path(cx.path(default_variant.span, vec![ | |
| 97 | Ident::new(kw::SelfUpper, default_variant.span), | |
| 98 | default_variant.ident, | |
| 99 | ])) | |
| 100 | 100 | } |
| 101 | 101 | Err(guar) => DummyResult::raw_expr(trait_span, Some(guar)), |
| 102 | 102 | }; |
compiler/rustc_builtin_macros/src/deriving/encodable.rs+38-55| ... | ... | @@ -87,9 +87,9 @@ |
| 87 | 87 | |
| 88 | 88 | use rustc_ast::{AttrVec, ExprKind, MetaItem, Mutability}; |
| 89 | 89 | use rustc_expand::base::{Annotatable, ExtCtxt}; |
| 90 | use rustc_span::symbol::{sym, Ident, Symbol}; | |
| 91 | 90 | use rustc_span::Span; |
| 92 | use thin_vec::{thin_vec, ThinVec}; | |
| 91 | use rustc_span::symbol::{Ident, Symbol, sym}; | |
| 92 | use thin_vec::{ThinVec, thin_vec}; | |
| 93 | 93 | |
| 94 | 94 | use crate::deriving::generic::ty::*; |
| 95 | 95 | use crate::deriving::generic::*; |
| ... | ... | @@ -116,10 +116,11 @@ pub(crate) fn expand_deriving_rustc_encodable( |
| 116 | 116 | methods: vec![MethodDef { |
| 117 | 117 | name: sym::encode, |
| 118 | 118 | generics: Bounds { |
| 119 | bounds: vec![( | |
| 120 | typaram, | |
| 121 | vec![Path::new_(vec![krate, sym::Encoder], vec![], PathKind::Global)], | |
| 122 | )], | |
| 119 | bounds: vec![(typaram, vec![Path::new_( | |
| 120 | vec![krate, sym::Encoder], | |
| 121 | vec![], | |
| 122 | PathKind::Global, | |
| 123 | )])], | |
| 123 | 124 | }, |
| 124 | 125 | explicit_self: true, |
| 125 | 126 | nonself_args: vec![( |
| ... | ... | @@ -157,14 +158,11 @@ fn encodable_substructure( |
| 157 | 158 | // throw an underscore in front to suppress unused variable warnings |
| 158 | 159 | let blkarg = Ident::new(sym::_e, trait_span); |
| 159 | 160 | let blkencoder = cx.expr_ident(trait_span, blkarg); |
| 160 | let fn_path = cx.expr_path(cx.path_global( | |
| 161 | trait_span, | |
| 162 | vec![ | |
| 163 | Ident::new(krate, trait_span), | |
| 164 | Ident::new(sym::Encodable, trait_span), | |
| 165 | Ident::new(sym::encode, trait_span), | |
| 166 | ], | |
| 167 | )); | |
| 161 | let fn_path = cx.expr_path(cx.path_global(trait_span, vec![ | |
| 162 | Ident::new(krate, trait_span), | |
| 163 | Ident::new(sym::Encodable, trait_span), | |
| 164 | Ident::new(sym::encode, trait_span), | |
| 165 | ])); | |
| 168 | 166 | |
| 169 | 167 | match substr.fields { |
| 170 | 168 | Struct(_, fields) => { |
| ... | ... | @@ -180,16 +178,12 @@ fn encodable_substructure( |
| 180 | 178 | let enc = |
| 181 | 179 | cx.expr_call(span, fn_path.clone(), thin_vec![self_ref, blkencoder.clone()]); |
| 182 | 180 | let lambda = cx.lambda1(span, enc, blkarg); |
| 183 | let call = cx.expr_call_global( | |
| 184 | span, | |
| 185 | fn_emit_struct_field_path.clone(), | |
| 186 | thin_vec![ | |
| 187 | blkencoder.clone(), | |
| 188 | cx.expr_str(span, name), | |
| 189 | cx.expr_usize(span, i), | |
| 190 | lambda, | |
| 191 | ], | |
| 192 | ); | |
| 181 | let call = cx.expr_call_global(span, fn_emit_struct_field_path.clone(), thin_vec![ | |
| 182 | blkencoder.clone(), | |
| 183 | cx.expr_str(span, name), | |
| 184 | cx.expr_usize(span, i), | |
| 185 | lambda, | |
| 186 | ]); | |
| 193 | 187 | |
| 194 | 188 | // last call doesn't need a try! |
| 195 | 189 | let last = fields.len() - 1; |
| ... | ... | @@ -214,16 +208,12 @@ fn encodable_substructure( |
| 214 | 208 | let fn_emit_struct_path = |
| 215 | 209 | cx.def_site_path(&[sym::rustc_serialize, sym::Encoder, sym::emit_struct]); |
| 216 | 210 | |
| 217 | let expr = cx.expr_call_global( | |
| 218 | trait_span, | |
| 219 | fn_emit_struct_path, | |
| 220 | thin_vec![ | |
| 221 | encoder, | |
| 222 | cx.expr_str(trait_span, substr.type_ident.name), | |
| 223 | cx.expr_usize(trait_span, fields.len()), | |
| 224 | blk, | |
| 225 | ], | |
| 226 | ); | |
| 211 | let expr = cx.expr_call_global(trait_span, fn_emit_struct_path, thin_vec![ | |
| 212 | encoder, | |
| 213 | cx.expr_str(trait_span, substr.type_ident.name), | |
| 214 | cx.expr_usize(trait_span, fields.len()), | |
| 215 | blk, | |
| 216 | ]); | |
| 227 | 217 | BlockOrExpr::new_expr(expr) |
| 228 | 218 | } |
| 229 | 219 | |
| ... | ... | @@ -243,11 +233,8 @@ fn encodable_substructure( |
| 243 | 233 | let last = fields.len() - 1; |
| 244 | 234 | for (i, &FieldInfo { ref self_expr, span, .. }) in fields.iter().enumerate() { |
| 245 | 235 | let self_ref = cx.expr_addr_of(span, self_expr.clone()); |
| 246 | let enc = cx.expr_call( | |
| 247 | span, | |
| 248 | fn_path.clone(), | |
| 249 | thin_vec![self_ref, blkencoder.clone()], | |
| 250 | ); | |
| 236 | let enc = cx | |
| 237 | .expr_call(span, fn_path.clone(), thin_vec![self_ref, blkencoder.clone()]); | |
| 251 | 238 | let lambda = cx.lambda1(span, enc, blkarg); |
| 252 | 239 | |
| 253 | 240 | let call = cx.expr_call_global( |
| ... | ... | @@ -274,26 +261,22 @@ fn encodable_substructure( |
| 274 | 261 | let fn_emit_enum_variant_path: Vec<_> = |
| 275 | 262 | cx.def_site_path(&[sym::rustc_serialize, sym::Encoder, sym::emit_enum_variant]); |
| 276 | 263 | |
| 277 | let call = cx.expr_call_global( | |
| 278 | trait_span, | |
| 279 | fn_emit_enum_variant_path, | |
| 280 | thin_vec![ | |
| 281 | blkencoder, | |
| 282 | name, | |
| 283 | cx.expr_usize(trait_span, *idx), | |
| 284 | cx.expr_usize(trait_span, fields.len()), | |
| 285 | blk, | |
| 286 | ], | |
| 287 | ); | |
| 264 | let call = cx.expr_call_global(trait_span, fn_emit_enum_variant_path, thin_vec![ | |
| 265 | blkencoder, | |
| 266 | name, | |
| 267 | cx.expr_usize(trait_span, *idx), | |
| 268 | cx.expr_usize(trait_span, fields.len()), | |
| 269 | blk, | |
| 270 | ]); | |
| 288 | 271 | |
| 289 | 272 | let blk = cx.lambda1(trait_span, call, blkarg); |
| 290 | 273 | let fn_emit_enum_path: Vec<_> = |
| 291 | 274 | cx.def_site_path(&[sym::rustc_serialize, sym::Encoder, sym::emit_enum]); |
| 292 | let expr = cx.expr_call_global( | |
| 293 | trait_span, | |
| 294 | fn_emit_enum_path, | |
| 295 | thin_vec![encoder, cx.expr_str(trait_span, substr.type_ident.name), blk], | |
| 296 | ); | |
| 275 | let expr = cx.expr_call_global(trait_span, fn_emit_enum_path, thin_vec![ | |
| 276 | encoder, | |
| 277 | cx.expr_str(trait_span, substr.type_ident.name), | |
| 278 | blk | |
| 279 | ]); | |
| 297 | 280 | BlockOrExpr::new_mixed(thin_vec![me], Some(expr)) |
| 298 | 281 | } |
| 299 | 282 |
compiler/rustc_builtin_macros/src/deriving/generic/mod.rs+9-11| ... | ... | @@ -178,6 +178,8 @@ use std::cell::RefCell; |
| 178 | 178 | use std::ops::Not; |
| 179 | 179 | use std::{iter, vec}; |
| 180 | 180 | |
| 181 | pub(crate) use StaticFields::*; | |
| 182 | pub(crate) use SubstructureFields::*; | |
| 181 | 183 | use rustc_ast::ptr::P; |
| 182 | 184 | use rustc_ast::{ |
| 183 | 185 | self as ast, BindingMode, ByRef, EnumDef, Expr, GenericArg, GenericParamKind, Generics, |
| ... | ... | @@ -185,12 +187,10 @@ use rustc_ast::{ |
| 185 | 187 | }; |
| 186 | 188 | use rustc_attr as attr; |
| 187 | 189 | use rustc_expand::base::{Annotatable, ExtCtxt}; |
| 188 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 189 | use rustc_span::{Span, DUMMY_SP}; | |
| 190 | use thin_vec::{thin_vec, ThinVec}; | |
| 190 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 191 | use rustc_span::{DUMMY_SP, Span}; | |
| 192 | use thin_vec::{ThinVec, thin_vec}; | |
| 191 | 193 | use ty::{Bounds, Path, Ref, Self_, Ty}; |
| 192 | pub(crate) use StaticFields::*; | |
| 193 | pub(crate) use SubstructureFields::*; | |
| 194 | 194 | |
| 195 | 195 | use crate::{deriving, errors}; |
| 196 | 196 | |
| ... | ... | @@ -1228,12 +1228,10 @@ impl<'a> MethodDef<'a> { |
| 1228 | 1228 | |
| 1229 | 1229 | let discr_let_stmts: ThinVec<_> = iter::zip(&discr_idents, &selflike_args) |
| 1230 | 1230 | .map(|(&ident, selflike_arg)| { |
| 1231 | let variant_value = deriving::call_intrinsic( | |
| 1232 | cx, | |
| 1233 | span, | |
| 1234 | sym::discriminant_value, | |
| 1235 | thin_vec![selflike_arg.clone()], | |
| 1236 | ); | |
| 1231 | let variant_value = | |
| 1232 | deriving::call_intrinsic(cx, span, sym::discriminant_value, thin_vec![ | |
| 1233 | selflike_arg.clone() | |
| 1234 | ]); | |
| 1237 | 1235 | cx.stmt_let(span, false, ident, variant_value) |
| 1238 | 1236 | }) |
| 1239 | 1237 | .collect(); |
compiler/rustc_builtin_macros/src/deriving/generic/ty.rs+3-3| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | 1 | //! A mini version of ast::Ty, which is easier to use, and features an explicit `Self` type to use |
| 2 | 2 | //! when specifying impls to be derived. |
| 3 | 3 | |
| 4 | pub(crate) use Ty::*; | |
| 4 | 5 | use rustc_ast::ptr::P; |
| 5 | 6 | use rustc_ast::{self as ast, Expr, GenericArg, GenericParamKind, Generics, SelfKind}; |
| 6 | 7 | use rustc_expand::base::ExtCtxt; |
| 7 | 8 | use rustc_span::source_map::respan; |
| 8 | use rustc_span::symbol::{kw, Ident, Symbol}; | |
| 9 | use rustc_span::{Span, DUMMY_SP}; | |
| 9 | use rustc_span::symbol::{Ident, Symbol, kw}; | |
| 10 | use rustc_span::{DUMMY_SP, Span}; | |
| 10 | 11 | use thin_vec::ThinVec; |
| 11 | pub(crate) use Ty::*; | |
| 12 | 12 | |
| 13 | 13 | /// A path, e.g., `::std::option::Option::<i32>` (global). Has support |
| 14 | 14 | /// for type parameters. |
compiler/rustc_builtin_macros/src/deriving/hash.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use rustc_ast::{MetaItem, Mutability}; |
| 2 | 2 | use rustc_expand::base::{Annotatable, ExtCtxt}; |
| 3 | use rustc_span::symbol::sym; | |
| 4 | 3 | use rustc_span::Span; |
| 4 | use rustc_span::symbol::sym; | |
| 5 | 5 | use thin_vec::thin_vec; |
| 6 | 6 | |
| 7 | 7 | use crate::deriving::generic::ty::*; |
compiler/rustc_builtin_macros/src/deriving/mod.rs+2-2| ... | ... | @@ -4,9 +4,9 @@ use rustc_ast as ast; |
| 4 | 4 | use rustc_ast::ptr::P; |
| 5 | 5 | use rustc_ast::{GenericArg, MetaItem}; |
| 6 | 6 | use rustc_expand::base::{Annotatable, ExpandResult, ExtCtxt, MultiItemModifier}; |
| 7 | use rustc_span::symbol::{sym, Symbol}; | |
| 8 | 7 | use rustc_span::Span; |
| 9 | use thin_vec::{thin_vec, ThinVec}; | |
| 8 | use rustc_span::symbol::{Symbol, sym}; | |
| 9 | use thin_vec::{ThinVec, thin_vec}; | |
| 10 | 10 | |
| 11 | 11 | macro path_local($x:ident) { |
| 12 | 12 | generic::ty::Path::new_local(sym::$x) |
compiler/rustc_builtin_macros/src/deriving/smart_ptr.rs+3-3| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | use ast::ptr::P; | |
| 2 | 1 | use ast::HasAttrs; |
| 2 | use ast::ptr::P; | |
| 3 | 3 | use rustc_ast::mut_visit::MutVisitor; |
| 4 | 4 | use rustc_ast::visit::BoundKind; |
| 5 | 5 | use rustc_ast::{ |
| ... | ... | @@ -9,9 +9,9 @@ use rustc_ast::{ |
| 9 | 9 | use rustc_attr as attr; |
| 10 | 10 | use rustc_data_structures::flat_map_in_place::FlatMapInPlace; |
| 11 | 11 | use rustc_expand::base::{Annotatable, ExtCtxt}; |
| 12 | use rustc_span::symbol::{sym, Ident}; | |
| 12 | use rustc_span::symbol::{Ident, sym}; | |
| 13 | 13 | use rustc_span::{Span, Symbol}; |
| 14 | use thin_vec::{thin_vec, ThinVec}; | |
| 14 | use thin_vec::{ThinVec, thin_vec}; | |
| 15 | 15 | |
| 16 | 16 | macro_rules! path { |
| 17 | 17 | ($span:expr, $($part:ident)::*) => { vec![$(Ident::new(sym::$part, $span),)*] } |
compiler/rustc_builtin_macros/src/edition_panic.rs+1-1| ... | ... | @@ -3,9 +3,9 @@ use rustc_ast::token::Delimiter; |
| 3 | 3 | use rustc_ast::tokenstream::{DelimSpan, TokenStream}; |
| 4 | 4 | use rustc_ast::*; |
| 5 | 5 | use rustc_expand::base::*; |
| 6 | use rustc_span::Span; | |
| 6 | 7 | use rustc_span::edition::Edition; |
| 7 | 8 | use rustc_span::symbol::sym; |
| 8 | use rustc_span::Span; | |
| 9 | 9 | |
| 10 | 10 | /// This expands to either |
| 11 | 11 | /// - `$crate::panic::panic_2015!(...)` or |
compiler/rustc_builtin_macros/src/env.rs+6-6| ... | ... | @@ -10,8 +10,8 @@ use rustc_ast::token::{self, LitKind}; |
| 10 | 10 | use rustc_ast::tokenstream::TokenStream; |
| 11 | 11 | use rustc_ast::{AstDeref, ExprKind, GenericArg, Mutability}; |
| 12 | 12 | use rustc_expand::base::{DummyResult, ExpandResult, ExtCtxt, MacEager, MacroExpanderResult}; |
| 13 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 14 | 13 | use rustc_span::Span; |
| 14 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 15 | 15 | use thin_vec::thin_vec; |
| 16 | 16 | |
| 17 | 17 | use crate::errors; |
| ... | ... | @@ -58,11 +58,11 @@ pub(crate) fn expand_option_env<'cx>( |
| 58 | 58 | ))], |
| 59 | 59 | )) |
| 60 | 60 | } |
| 61 | Some(value) => cx.expr_call_global( | |
| 62 | sp, | |
| 63 | cx.std_path(&[sym::option, sym::Option, sym::Some]), | |
| 64 | thin_vec![cx.expr_str(sp, value)], | |
| 65 | ), | |
| 61 | Some(value) => { | |
| 62 | cx.expr_call_global(sp, cx.std_path(&[sym::option, sym::Option, sym::Some]), thin_vec![ | |
| 63 | cx.expr_str(sp, value) | |
| 64 | ]) | |
| 65 | } | |
| 66 | 66 | }; |
| 67 | 67 | ExpandResult::Ready(MacEager::expr(e)) |
| 68 | 68 | } |
compiler/rustc_builtin_macros/src/format.rs+2-1| ... | ... | @@ -2,9 +2,10 @@ use parse::Position::ArgumentNamed; |
| 2 | 2 | use rustc_ast::ptr::P; |
| 3 | 3 | use rustc_ast::tokenstream::TokenStream; |
| 4 | 4 | use rustc_ast::{ |
| 5 | token, Expr, ExprKind, FormatAlignment, FormatArgPosition, FormatArgPositionKind, FormatArgs, | |
| 5 | Expr, ExprKind, FormatAlignment, FormatArgPosition, FormatArgPositionKind, FormatArgs, | |
| 6 | 6 | FormatArgsPiece, FormatArgument, FormatArgumentKind, FormatArguments, FormatCount, |
| 7 | 7 | FormatDebugHex, FormatOptions, FormatPlaceholder, FormatSign, FormatTrait, Recovered, StmtKind, |
| 8 | token, | |
| 8 | 9 | }; |
| 9 | 10 | use rustc_data_structures::fx::FxHashSet; |
| 10 | 11 | use rustc_errors::{Applicability, Diag, MultiSpan, PResult, SingleLabelManySpans}; |
compiler/rustc_builtin_macros/src/format_foreign.rs+4-8| ... | ... | @@ -183,14 +183,10 @@ pub(crate) mod printf { |
| 183 | 183 | s.push('{'); |
| 184 | 184 | |
| 185 | 185 | if let Some(arg) = self.parameter { |
| 186 | match write!( | |
| 187 | s, | |
| 188 | "{}", | |
| 189 | match arg.checked_sub(1) { | |
| 190 | Some(a) => a, | |
| 191 | None => return Err(None), | |
| 192 | } | |
| 193 | ) { | |
| 186 | match write!(s, "{}", match arg.checked_sub(1) { | |
| 187 | Some(a) => a, | |
| 188 | None => return Err(None), | |
| 189 | }) { | |
| 194 | 190 | Err(_) => return Err(None), |
| 195 | 191 | _ => {} |
| 196 | 192 | } |
compiler/rustc_builtin_macros/src/format_foreign/printf/tests.rs+7-5| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use super::{iter_subs, parse_next_substitution as pns, Format as F, Num as N, Substitution as S}; | |
| 1 | use super::{Format as F, Num as N, Substitution as S, iter_subs, parse_next_substitution as pns}; | |
| 2 | 2 | |
| 3 | 3 | macro_rules! assert_eq_pnsat { |
| 4 | 4 | ($lhs:expr, $rhs:expr) => { |
| ... | ... | @@ -99,10 +99,12 @@ fn test_parse() { |
| 99 | 99 | fn test_iter() { |
| 100 | 100 | let s = "The %d'th word %% is: `%.*s` %!\n"; |
| 101 | 101 | let subs: Vec<_> = iter_subs(s, 0).map(|sub| sub.translate().ok()).collect(); |
| 102 | assert_eq!( | |
| 103 | subs.iter().map(Option::as_deref).collect::<Vec<_>>(), | |
| 104 | vec![Some("{}"), None, Some("{:.*}"), None] | |
| 105 | ); | |
| 102 | assert_eq!(subs.iter().map(Option::as_deref).collect::<Vec<_>>(), vec![ | |
| 103 | Some("{}"), | |
| 104 | None, | |
| 105 | Some("{:.*}"), | |
| 106 | None | |
| 107 | ]); | |
| 106 | 108 | } |
| 107 | 109 | |
| 108 | 110 | /// Checks that the translations are what we expect. |
compiler/rustc_builtin_macros/src/format_foreign/shell/tests.rs+6-5| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use super::{parse_next_substitution as pns, Substitution as S}; | |
| 1 | use super::{Substitution as S, parse_next_substitution as pns}; | |
| 2 | 2 | |
| 3 | 3 | macro_rules! assert_eq_pnsat { |
| 4 | 4 | ($lhs:expr, $rhs:expr) => { |
| ... | ... | @@ -38,10 +38,11 @@ fn test_iter() { |
| 38 | 38 | use super::iter_subs; |
| 39 | 39 | let s = "The $0'th word $$ is: `$WORD` $!\n"; |
| 40 | 40 | let subs: Vec<_> = iter_subs(s, 0).map(|sub| sub.translate().ok()).collect(); |
| 41 | assert_eq!( | |
| 42 | subs.iter().map(Option::as_deref).collect::<Vec<_>>(), | |
| 43 | vec![Some("{0}"), None, Some("{WORD}")] | |
| 44 | ); | |
| 41 | assert_eq!(subs.iter().map(Option::as_deref).collect::<Vec<_>>(), vec![ | |
| 42 | Some("{0}"), | |
| 43 | None, | |
| 44 | Some("{WORD}") | |
| 45 | ]); | |
| 45 | 46 | } |
| 46 | 47 | |
| 47 | 48 | #[test] |
compiler/rustc_builtin_macros/src/global_allocator.rs+3-3| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use rustc_ast::expand::allocator::{ |
| 2 | global_fn_name, AllocatorMethod, AllocatorMethodInput, AllocatorTy, ALLOCATOR_METHODS, | |
| 2 | ALLOCATOR_METHODS, AllocatorMethod, AllocatorMethodInput, AllocatorTy, global_fn_name, | |
| 3 | 3 | }; |
| 4 | 4 | use rustc_ast::ptr::P; |
| 5 | 5 | use rustc_ast::{ |
| ... | ... | @@ -7,9 +7,9 @@ use rustc_ast::{ |
| 7 | 7 | Stmt, StmtKind, Ty, TyKind, |
| 8 | 8 | }; |
| 9 | 9 | use rustc_expand::base::{Annotatable, ExtCtxt}; |
| 10 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 11 | 10 | use rustc_span::Span; |
| 12 | use thin_vec::{thin_vec, ThinVec}; | |
| 11 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 12 | use thin_vec::{ThinVec, thin_vec}; | |
| 13 | 13 | |
| 14 | 14 | use crate::errors; |
| 15 | 15 | use crate::util::check_builtin_macro_attribute; |
compiler/rustc_builtin_macros/src/pattern_type.rs+2-2| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | use rustc_ast::ptr::P; |
| 2 | 2 | use rustc_ast::tokenstream::TokenStream; |
| 3 | use rustc_ast::{ast, Pat, Ty}; | |
| 3 | use rustc_ast::{Pat, Ty, ast}; | |
| 4 | 4 | use rustc_errors::PResult; |
| 5 | 5 | use rustc_expand::base::{self, DummyResult, ExpandResult, ExtCtxt, MacroExpanderResult}; |
| 6 | use rustc_span::{sym, Span}; | |
| 6 | use rustc_span::{Span, sym}; | |
| 7 | 7 | |
| 8 | 8 | pub(crate) fn expand<'cx>( |
| 9 | 9 | cx: &'cx mut ExtCtxt<'_>, |
compiler/rustc_builtin_macros/src/proc_macro_harness.rs+30-35| ... | ... | @@ -2,19 +2,19 @@ use std::mem; |
| 2 | 2 | |
| 3 | 3 | use rustc_ast::ptr::P; |
| 4 | 4 | use rustc_ast::visit::{self, Visitor}; |
| 5 | use rustc_ast::{self as ast, attr, NodeId}; | |
| 5 | use rustc_ast::{self as ast, NodeId, attr}; | |
| 6 | 6 | use rustc_ast_pretty::pprust; |
| 7 | 7 | use rustc_errors::DiagCtxtHandle; |
| 8 | use rustc_expand::base::{parse_macro_name_and_helper_attrs, ExtCtxt, ResolverExpand}; | |
| 8 | use rustc_expand::base::{ExtCtxt, ResolverExpand, parse_macro_name_and_helper_attrs}; | |
| 9 | 9 | use rustc_expand::expand::{AstFragment, ExpansionConfig}; |
| 10 | 10 | use rustc_feature::Features; |
| 11 | 11 | use rustc_session::Session; |
| 12 | 12 | use rustc_span::hygiene::AstPass; |
| 13 | 13 | use rustc_span::source_map::SourceMap; |
| 14 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 15 | use rustc_span::{Span, DUMMY_SP}; | |
| 14 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 15 | use rustc_span::{DUMMY_SP, Span}; | |
| 16 | 16 | use smallvec::smallvec; |
| 17 | use thin_vec::{thin_vec, ThinVec}; | |
| 17 | use thin_vec::{ThinVec, thin_vec}; | |
| 18 | 18 | |
| 19 | 19 | use crate::errors; |
| 20 | 20 | |
| ... | ... | @@ -302,29 +302,25 @@ fn mk_decls(cx: &mut ExtCtxt<'_>, macros: &[ProcMacro]) -> P<ast::Item> { |
| 302 | 302 | }; |
| 303 | 303 | let local_path = |cx: &ExtCtxt<'_>, name| cx.expr_path(cx.path(span, vec![name])); |
| 304 | 304 | let proc_macro_ty_method_path = |cx: &ExtCtxt<'_>, method| { |
| 305 | cx.expr_path(cx.path( | |
| 306 | span.with_ctxt(harness_span.ctxt()), | |
| 307 | vec![proc_macro, bridge, client, proc_macro_ty, method], | |
| 308 | )) | |
| 305 | cx.expr_path(cx.path(span.with_ctxt(harness_span.ctxt()), vec![ | |
| 306 | proc_macro, | |
| 307 | bridge, | |
| 308 | client, | |
| 309 | proc_macro_ty, | |
| 310 | method, | |
| 311 | ])) | |
| 309 | 312 | }; |
| 310 | 313 | match m { |
| 311 | 314 | ProcMacro::Derive(cd) => { |
| 312 | 315 | cx.resolver.declare_proc_macro(cd.id); |
| 313 | cx.expr_call( | |
| 314 | span, | |
| 315 | proc_macro_ty_method_path(cx, custom_derive), | |
| 316 | thin_vec![ | |
| 317 | cx.expr_str(span, cd.trait_name), | |
| 318 | cx.expr_array_ref( | |
| 319 | span, | |
| 320 | cd.attrs | |
| 321 | .iter() | |
| 322 | .map(|&s| cx.expr_str(span, s)) | |
| 323 | .collect::<ThinVec<_>>(), | |
| 324 | ), | |
| 325 | local_path(cx, cd.function_name), | |
| 326 | ], | |
| 327 | ) | |
| 316 | cx.expr_call(span, proc_macro_ty_method_path(cx, custom_derive), thin_vec![ | |
| 317 | cx.expr_str(span, cd.trait_name), | |
| 318 | cx.expr_array_ref( | |
| 319 | span, | |
| 320 | cd.attrs.iter().map(|&s| cx.expr_str(span, s)).collect::<ThinVec<_>>(), | |
| 321 | ), | |
| 322 | local_path(cx, cd.function_name), | |
| 323 | ]) | |
| 328 | 324 | } |
| 329 | 325 | ProcMacro::Attr(ca) | ProcMacro::Bang(ca) => { |
| 330 | 326 | cx.resolver.declare_proc_macro(ca.id); |
| ... | ... | @@ -334,14 +330,10 @@ fn mk_decls(cx: &mut ExtCtxt<'_>, macros: &[ProcMacro]) -> P<ast::Item> { |
| 334 | 330 | ProcMacro::Derive(_) => unreachable!(), |
| 335 | 331 | }; |
| 336 | 332 | |
| 337 | cx.expr_call( | |
| 338 | span, | |
| 339 | proc_macro_ty_method_path(cx, ident), | |
| 340 | thin_vec![ | |
| 341 | cx.expr_str(span, ca.function_name.name), | |
| 342 | local_path(cx, ca.function_name), | |
| 343 | ], | |
| 344 | ) | |
| 333 | cx.expr_call(span, proc_macro_ty_method_path(cx, ident), thin_vec![ | |
| 334 | cx.expr_str(span, ca.function_name.name), | |
| 335 | local_path(cx, ca.function_name), | |
| 336 | ]) | |
| 345 | 337 | } |
| 346 | 338 | } |
| 347 | 339 | }) |
| ... | ... | @@ -355,9 +347,12 @@ fn mk_decls(cx: &mut ExtCtxt<'_>, macros: &[ProcMacro]) -> P<ast::Item> { |
| 355 | 347 | span, |
| 356 | 348 | cx.ty( |
| 357 | 349 | span, |
| 358 | ast::TyKind::Slice( | |
| 359 | cx.ty_path(cx.path(span, vec![proc_macro, bridge, client, proc_macro_ty])), | |
| 360 | ), | |
| 350 | ast::TyKind::Slice(cx.ty_path(cx.path(span, vec![ | |
| 351 | proc_macro, | |
| 352 | bridge, | |
| 353 | client, | |
| 354 | proc_macro_ty, | |
| 355 | ]))), | |
| 361 | 356 | ), |
| 362 | 357 | None, |
| 363 | 358 | ast::Mutability::Not, |
compiler/rustc_builtin_macros/src/source_util.rs+2-2| ... | ... | @@ -8,7 +8,7 @@ use rustc_ast::tokenstream::TokenStream; |
| 8 | 8 | use rustc_ast_pretty::pprust; |
| 9 | 9 | use rustc_data_structures::sync::Lrc; |
| 10 | 10 | use rustc_expand::base::{ |
| 11 | resolve_path, DummyResult, ExpandResult, ExtCtxt, MacEager, MacResult, MacroExpanderResult, | |
| 11 | DummyResult, ExpandResult, ExtCtxt, MacEager, MacResult, MacroExpanderResult, resolve_path, | |
| 12 | 12 | }; |
| 13 | 13 | use rustc_expand::module::DirOwnership; |
| 14 | 14 | use rustc_lint_defs::BuiltinLintDiag; |
| ... | ... | @@ -73,8 +73,8 @@ pub(crate) fn expand_file( |
| 73 | 73 | let topmost = cx.expansion_cause().unwrap_or(sp); |
| 74 | 74 | let loc = cx.source_map().lookup_char_pos(topmost.lo()); |
| 75 | 75 | |
| 76 | use rustc_session::config::RemapPathScopeComponents; | |
| 77 | 76 | use rustc_session::RemapFileNameExt; |
| 77 | use rustc_session::config::RemapPathScopeComponents; | |
| 78 | 78 | ExpandResult::Ready(MacEager::expr(cx.expr_str( |
| 79 | 79 | topmost, |
| 80 | 80 | Symbol::intern( |
compiler/rustc_builtin_macros/src/standard_library_imports.rs+2-2| ... | ... | @@ -3,10 +3,10 @@ use rustc_expand::base::{ExtCtxt, ResolverExpand}; |
| 3 | 3 | use rustc_expand::expand::ExpansionConfig; |
| 4 | 4 | use rustc_feature::Features; |
| 5 | 5 | use rustc_session::Session; |
| 6 | use rustc_span::DUMMY_SP; | |
| 6 | 7 | use rustc_span::edition::Edition::*; |
| 7 | 8 | use rustc_span::hygiene::AstPass; |
| 8 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 9 | use rustc_span::DUMMY_SP; | |
| 9 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 10 | 10 | use thin_vec::thin_vec; |
| 11 | 11 | |
| 12 | 12 | pub fn inject( |
compiler/rustc_builtin_macros/src/test.rs+135-172| ... | ... | @@ -5,13 +5,13 @@ use std::assert_matches::assert_matches; |
| 5 | 5 | use std::iter; |
| 6 | 6 | |
| 7 | 7 | use rustc_ast::ptr::P; |
| 8 | use rustc_ast::{self as ast, attr, GenericParamKind}; | |
| 8 | use rustc_ast::{self as ast, GenericParamKind, attr}; | |
| 9 | 9 | use rustc_ast_pretty::pprust; |
| 10 | 10 | use rustc_errors::{Applicability, Diag, Level}; |
| 11 | 11 | use rustc_expand::base::*; |
| 12 | use rustc_span::symbol::{sym, Ident, Symbol}; | |
| 12 | use rustc_span::symbol::{Ident, Symbol, sym}; | |
| 13 | 13 | use rustc_span::{ErrorGuaranteed, FileNameDisplayPreference, Span}; |
| 14 | use thin_vec::{thin_vec, ThinVec}; | |
| 14 | use thin_vec::{ThinVec, thin_vec}; | |
| 15 | 15 | use tracing::debug; |
| 16 | 16 | |
| 17 | 17 | use crate::errors; |
| ... | ... | @@ -170,26 +170,20 @@ pub(crate) fn expand_test_or_bench( |
| 170 | 170 | |
| 171 | 171 | // creates test::ShouldPanic::$name |
| 172 | 172 | let should_panic_path = |name| { |
| 173 | cx.path( | |
| 174 | sp, | |
| 175 | vec![ | |
| 176 | test_id, | |
| 177 | Ident::from_str_and_span("ShouldPanic", sp), | |
| 178 | Ident::from_str_and_span(name, sp), | |
| 179 | ], | |
| 180 | ) | |
| 173 | cx.path(sp, vec![ | |
| 174 | test_id, | |
| 175 | Ident::from_str_and_span("ShouldPanic", sp), | |
| 176 | Ident::from_str_and_span(name, sp), | |
| 177 | ]) | |
| 181 | 178 | }; |
| 182 | 179 | |
| 183 | 180 | // creates test::TestType::$name |
| 184 | 181 | let test_type_path = |name| { |
| 185 | cx.path( | |
| 186 | sp, | |
| 187 | vec![ | |
| 188 | test_id, | |
| 189 | Ident::from_str_and_span("TestType", sp), | |
| 190 | Ident::from_str_and_span(name, sp), | |
| 191 | ], | |
| 192 | ) | |
| 182 | cx.path(sp, vec![ | |
| 183 | test_id, | |
| 184 | Ident::from_str_and_span("TestType", sp), | |
| 185 | Ident::from_str_and_span(name, sp), | |
| 186 | ]) | |
| 193 | 187 | }; |
| 194 | 188 | |
| 195 | 189 | // creates $name: $expr |
| ... | ... | @@ -209,55 +203,39 @@ pub(crate) fn expand_test_or_bench( |
| 209 | 203 | // A simple ident for a lambda |
| 210 | 204 | let b = Ident::from_str_and_span("b", attr_sp); |
| 211 | 205 | |
| 212 | cx.expr_call( | |
| 213 | sp, | |
| 214 | cx.expr_path(test_path("StaticBenchFn")), | |
| 215 | thin_vec![ | |
| 216 | // #[coverage(off)] | |
| 217 | // |b| self::test::assert_test_result( | |
| 218 | coverage_off(cx.lambda1( | |
| 219 | sp, | |
| 206 | cx.expr_call(sp, cx.expr_path(test_path("StaticBenchFn")), thin_vec![ | |
| 207 | // #[coverage(off)] | |
| 208 | // |b| self::test::assert_test_result( | |
| 209 | coverage_off(cx.lambda1( | |
| 210 | sp, | |
| 211 | cx.expr_call(sp, cx.expr_path(test_path("assert_test_result")), thin_vec![ | |
| 212 | // super::$test_fn(b) | |
| 220 | 213 | cx.expr_call( |
| 221 | sp, | |
| 222 | cx.expr_path(test_path("assert_test_result")), | |
| 223 | thin_vec![ | |
| 224 | // super::$test_fn(b) | |
| 225 | cx.expr_call( | |
| 226 | ret_ty_sp, | |
| 227 | cx.expr_path(cx.path(sp, vec![item.ident])), | |
| 228 | thin_vec![cx.expr_ident(sp, b)], | |
| 229 | ), | |
| 230 | ], | |
| 214 | ret_ty_sp, | |
| 215 | cx.expr_path(cx.path(sp, vec![item.ident])), | |
| 216 | thin_vec![cx.expr_ident(sp, b)], | |
| 231 | 217 | ), |
| 232 | b, | |
| 233 | )), // ) | |
| 234 | ], | |
| 235 | ) | |
| 218 | ],), | |
| 219 | b, | |
| 220 | )), // ) | |
| 221 | ]) | |
| 236 | 222 | } else { |
| 237 | cx.expr_call( | |
| 238 | sp, | |
| 239 | cx.expr_path(test_path("StaticTestFn")), | |
| 240 | thin_vec![ | |
| 241 | // #[coverage(off)] | |
| 242 | // || { | |
| 243 | coverage_off(cx.lambda0( | |
| 244 | sp, | |
| 245 | // test::assert_test_result( | |
| 223 | cx.expr_call(sp, cx.expr_path(test_path("StaticTestFn")), thin_vec![ | |
| 224 | // #[coverage(off)] | |
| 225 | // || { | |
| 226 | coverage_off(cx.lambda0( | |
| 227 | sp, | |
| 228 | // test::assert_test_result( | |
| 229 | cx.expr_call(sp, cx.expr_path(test_path("assert_test_result")), thin_vec![ | |
| 230 | // $test_fn() | |
| 246 | 231 | cx.expr_call( |
| 247 | sp, | |
| 248 | cx.expr_path(test_path("assert_test_result")), | |
| 249 | thin_vec![ | |
| 250 | // $test_fn() | |
| 251 | cx.expr_call( | |
| 252 | ret_ty_sp, | |
| 253 | cx.expr_path(cx.path(sp, vec![item.ident])), | |
| 254 | ThinVec::new(), | |
| 255 | ), // ) | |
| 256 | ], | |
| 257 | ), // } | |
| 258 | )), // ) | |
| 259 | ], | |
| 260 | ) | |
| 232 | ret_ty_sp, | |
| 233 | cx.expr_path(cx.path(sp, vec![item.ident])), | |
| 234 | ThinVec::new(), | |
| 235 | ), // ) | |
| 236 | ],), // } | |
| 237 | )), // ) | |
| 238 | ]) | |
| 261 | 239 | }; |
| 262 | 240 | |
| 263 | 241 | let test_path_symbol = Symbol::intern(&item_path( |
| ... | ... | @@ -268,122 +246,107 @@ pub(crate) fn expand_test_or_bench( |
| 268 | 246 | |
| 269 | 247 | let location_info = get_location_info(cx, &item); |
| 270 | 248 | |
| 271 | let mut test_const = | |
| 272 | cx.item( | |
| 273 | sp, | |
| 274 | Ident::new(item.ident.name, sp), | |
| 275 | thin_vec![ | |
| 276 | // #[cfg(test)] | |
| 277 | cx.attr_nested_word(sym::cfg, sym::test, attr_sp), | |
| 278 | // #[rustc_test_marker = "test_case_sort_key"] | |
| 279 | cx.attr_name_value_str(sym::rustc_test_marker, test_path_symbol, attr_sp), | |
| 280 | // #[doc(hidden)] | |
| 281 | cx.attr_nested_word(sym::doc, sym::hidden, attr_sp), | |
| 282 | ], | |
| 283 | // const $ident: test::TestDescAndFn = | |
| 284 | ast::ItemKind::Const( | |
| 285 | ast::ConstItem { | |
| 286 | defaultness: ast::Defaultness::Final, | |
| 287 | generics: ast::Generics::default(), | |
| 288 | ty: cx.ty(sp, ast::TyKind::Path(None, test_path("TestDescAndFn"))), | |
| 289 | // test::TestDescAndFn { | |
| 290 | expr: Some( | |
| 291 | cx.expr_struct( | |
| 292 | sp, | |
| 293 | test_path("TestDescAndFn"), | |
| 294 | thin_vec![ | |
| 249 | let mut test_const = cx.item( | |
| 250 | sp, | |
| 251 | Ident::new(item.ident.name, sp), | |
| 252 | thin_vec![ | |
| 253 | // #[cfg(test)] | |
| 254 | cx.attr_nested_word(sym::cfg, sym::test, attr_sp), | |
| 255 | // #[rustc_test_marker = "test_case_sort_key"] | |
| 256 | cx.attr_name_value_str(sym::rustc_test_marker, test_path_symbol, attr_sp), | |
| 257 | // #[doc(hidden)] | |
| 258 | cx.attr_nested_word(sym::doc, sym::hidden, attr_sp), | |
| 259 | ], | |
| 260 | // const $ident: test::TestDescAndFn = | |
| 261 | ast::ItemKind::Const( | |
| 262 | ast::ConstItem { | |
| 263 | defaultness: ast::Defaultness::Final, | |
| 264 | generics: ast::Generics::default(), | |
| 265 | ty: cx.ty(sp, ast::TyKind::Path(None, test_path("TestDescAndFn"))), | |
| 266 | // test::TestDescAndFn { | |
| 267 | expr: Some( | |
| 268 | cx.expr_struct(sp, test_path("TestDescAndFn"), thin_vec![ | |
| 295 | 269 | // desc: test::TestDesc { |
| 296 | 270 | field( |
| 297 | 271 | "desc", |
| 298 | cx.expr_struct( | |
| 299 | sp, | |
| 300 | test_path("TestDesc"), | |
| 301 | thin_vec![ | |
| 302 | // name: "path::to::test" | |
| 303 | field( | |
| 304 | "name", | |
| 305 | cx.expr_call( | |
| 306 | sp, | |
| 307 | cx.expr_path(test_path("StaticTestName")), | |
| 308 | thin_vec![cx.expr_str(sp, test_path_symbol)], | |
| 309 | ), | |
| 272 | cx.expr_struct(sp, test_path("TestDesc"), thin_vec![ | |
| 273 | // name: "path::to::test" | |
| 274 | field( | |
| 275 | "name", | |
| 276 | cx.expr_call( | |
| 277 | sp, | |
| 278 | cx.expr_path(test_path("StaticTestName")), | |
| 279 | thin_vec![cx.expr_str(sp, test_path_symbol)], | |
| 310 | 280 | ), |
| 311 | // ignore: true | false | |
| 312 | field("ignore", cx.expr_bool(sp, should_ignore(&item)),), | |
| 313 | // ignore_message: Some("...") | None | |
| 314 | field( | |
| 315 | "ignore_message", | |
| 316 | if let Some(msg) = should_ignore_message(&item) { | |
| 317 | cx.expr_some(sp, cx.expr_str(sp, msg)) | |
| 318 | } else { | |
| 319 | cx.expr_none(sp) | |
| 320 | }, | |
| 281 | ), | |
| 282 | // ignore: true | false | |
| 283 | field("ignore", cx.expr_bool(sp, should_ignore(&item)),), | |
| 284 | // ignore_message: Some("...") | None | |
| 285 | field( | |
| 286 | "ignore_message", | |
| 287 | if let Some(msg) = should_ignore_message(&item) { | |
| 288 | cx.expr_some(sp, cx.expr_str(sp, msg)) | |
| 289 | } else { | |
| 290 | cx.expr_none(sp) | |
| 291 | }, | |
| 292 | ), | |
| 293 | // source_file: <relative_path_of_source_file> | |
| 294 | field("source_file", cx.expr_str(sp, location_info.0)), | |
| 295 | // start_line: start line of the test fn identifier. | |
| 296 | field("start_line", cx.expr_usize(sp, location_info.1)), | |
| 297 | // start_col: start column of the test fn identifier. | |
| 298 | field("start_col", cx.expr_usize(sp, location_info.2)), | |
| 299 | // end_line: end line of the test fn identifier. | |
| 300 | field("end_line", cx.expr_usize(sp, location_info.3)), | |
| 301 | // end_col: end column of the test fn identifier. | |
| 302 | field("end_col", cx.expr_usize(sp, location_info.4)), | |
| 303 | // compile_fail: true | false | |
| 304 | field("compile_fail", cx.expr_bool(sp, false)), | |
| 305 | // no_run: true | false | |
| 306 | field("no_run", cx.expr_bool(sp, false)), | |
| 307 | // should_panic: ... | |
| 308 | field("should_panic", match should_panic(cx, &item) { | |
| 309 | // test::ShouldPanic::No | |
| 310 | ShouldPanic::No => { | |
| 311 | cx.expr_path(should_panic_path("No")) | |
| 312 | } | |
| 313 | // test::ShouldPanic::Yes | |
| 314 | ShouldPanic::Yes(None) => { | |
| 315 | cx.expr_path(should_panic_path("Yes")) | |
| 316 | } | |
| 317 | // test::ShouldPanic::YesWithMessage("...") | |
| 318 | ShouldPanic::Yes(Some(sym)) => cx.expr_call( | |
| 319 | sp, | |
| 320 | cx.expr_path(should_panic_path("YesWithMessage")), | |
| 321 | thin_vec![cx.expr_str(sp, sym)], | |
| 321 | 322 | ), |
| 322 | // source_file: <relative_path_of_source_file> | |
| 323 | field("source_file", cx.expr_str(sp, location_info.0)), | |
| 324 | // start_line: start line of the test fn identifier. | |
| 325 | field("start_line", cx.expr_usize(sp, location_info.1)), | |
| 326 | // start_col: start column of the test fn identifier. | |
| 327 | field("start_col", cx.expr_usize(sp, location_info.2)), | |
| 328 | // end_line: end line of the test fn identifier. | |
| 329 | field("end_line", cx.expr_usize(sp, location_info.3)), | |
| 330 | // end_col: end column of the test fn identifier. | |
| 331 | field("end_col", cx.expr_usize(sp, location_info.4)), | |
| 332 | // compile_fail: true | false | |
| 333 | field("compile_fail", cx.expr_bool(sp, false)), | |
| 334 | // no_run: true | false | |
| 335 | field("no_run", cx.expr_bool(sp, false)), | |
| 336 | // should_panic: ... | |
| 337 | field( | |
| 338 | "should_panic", | |
| 339 | match should_panic(cx, &item) { | |
| 340 | // test::ShouldPanic::No | |
| 341 | ShouldPanic::No => { | |
| 342 | cx.expr_path(should_panic_path("No")) | |
| 343 | } | |
| 344 | // test::ShouldPanic::Yes | |
| 345 | ShouldPanic::Yes(None) => { | |
| 346 | cx.expr_path(should_panic_path("Yes")) | |
| 347 | } | |
| 348 | // test::ShouldPanic::YesWithMessage("...") | |
| 349 | ShouldPanic::Yes(Some(sym)) => cx.expr_call( | |
| 350 | sp, | |
| 351 | cx.expr_path(should_panic_path("YesWithMessage")), | |
| 352 | thin_vec![cx.expr_str(sp, sym)], | |
| 353 | ), | |
| 354 | }, | |
| 355 | ), | |
| 356 | // test_type: ... | |
| 357 | field( | |
| 358 | "test_type", | |
| 359 | match test_type(cx) { | |
| 360 | // test::TestType::UnitTest | |
| 361 | TestType::UnitTest => { | |
| 362 | cx.expr_path(test_type_path("UnitTest")) | |
| 363 | } | |
| 364 | // test::TestType::IntegrationTest | |
| 365 | TestType::IntegrationTest => { | |
| 366 | cx.expr_path(test_type_path("IntegrationTest")) | |
| 367 | } | |
| 368 | // test::TestPath::Unknown | |
| 369 | TestType::Unknown => { | |
| 370 | cx.expr_path(test_type_path("Unknown")) | |
| 371 | } | |
| 372 | }, | |
| 373 | ), | |
| 374 | // }, | |
| 375 | ], | |
| 376 | ), | |
| 323 | },), | |
| 324 | // test_type: ... | |
| 325 | field("test_type", match test_type(cx) { | |
| 326 | // test::TestType::UnitTest | |
| 327 | TestType::UnitTest => { | |
| 328 | cx.expr_path(test_type_path("UnitTest")) | |
| 329 | } | |
| 330 | // test::TestType::IntegrationTest | |
| 331 | TestType::IntegrationTest => { | |
| 332 | cx.expr_path(test_type_path("IntegrationTest")) | |
| 333 | } | |
| 334 | // test::TestPath::Unknown | |
| 335 | TestType::Unknown => { | |
| 336 | cx.expr_path(test_type_path("Unknown")) | |
| 337 | } | |
| 338 | },), | |
| 339 | // }, | |
| 340 | ],), | |
| 377 | 341 | ), |
| 378 | 342 | // testfn: test::StaticTestFn(...) | test::StaticBenchFn(...) |
| 379 | 343 | field("testfn", test_fn), // } |
| 380 | ], | |
| 381 | ), // } | |
| 382 | ), | |
| 383 | } | |
| 384 | .into(), | |
| 385 | ), | |
| 386 | ); | |
| 344 | ]), // } | |
| 345 | ), | |
| 346 | } | |
| 347 | .into(), | |
| 348 | ), | |
| 349 | ); | |
| 387 | 350 | test_const = test_const.map(|mut tc| { |
| 388 | 351 | tc.vis.kind = ast::VisibilityKind::Public; |
| 389 | 352 | tc |
compiler/rustc_builtin_macros/src/test_harness.rs+7-7| ... | ... | @@ -6,21 +6,21 @@ use rustc_ast as ast; |
| 6 | 6 | use rustc_ast::entry::EntryPointType; |
| 7 | 7 | use rustc_ast::mut_visit::*; |
| 8 | 8 | use rustc_ast::ptr::P; |
| 9 | use rustc_ast::visit::{walk_item, Visitor}; | |
| 10 | use rustc_ast::{attr, ModKind}; | |
| 9 | use rustc_ast::visit::{Visitor, walk_item}; | |
| 10 | use rustc_ast::{ModKind, attr}; | |
| 11 | 11 | use rustc_errors::DiagCtxtHandle; |
| 12 | 12 | use rustc_expand::base::{ExtCtxt, ResolverExpand}; |
| 13 | 13 | use rustc_expand::expand::{AstFragment, ExpansionConfig}; |
| 14 | 14 | use rustc_feature::Features; |
| 15 | 15 | use rustc_lint_defs::BuiltinLintDiag; |
| 16 | use rustc_session::lint::builtin::UNNAMEABLE_TEST_ITEMS; | |
| 17 | 16 | use rustc_session::Session; |
| 17 | use rustc_session::lint::builtin::UNNAMEABLE_TEST_ITEMS; | |
| 18 | 18 | use rustc_span::hygiene::{AstPass, SyntaxContext, Transparency}; |
| 19 | use rustc_span::symbol::{sym, Ident, Symbol}; | |
| 20 | use rustc_span::{Span, DUMMY_SP}; | |
| 19 | use rustc_span::symbol::{Ident, Symbol, sym}; | |
| 20 | use rustc_span::{DUMMY_SP, Span}; | |
| 21 | 21 | use rustc_target::spec::PanicStrategy; |
| 22 | use smallvec::{smallvec, SmallVec}; | |
| 23 | use thin_vec::{thin_vec, ThinVec}; | |
| 22 | use smallvec::{SmallVec, smallvec}; | |
| 23 | use thin_vec::{ThinVec, thin_vec}; | |
| 24 | 24 | use tracing::debug; |
| 25 | 25 | |
| 26 | 26 | use crate::errors; |
compiler/rustc_builtin_macros/src/trace_macros.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use rustc_ast::tokenstream::{TokenStream, TokenTree}; |
| 2 | 2 | use rustc_expand::base::{DummyResult, ExpandResult, ExtCtxt, MacroExpanderResult}; |
| 3 | use rustc_span::symbol::kw; | |
| 4 | 3 | use rustc_span::Span; |
| 4 | use rustc_span::symbol::kw; | |
| 5 | 5 | |
| 6 | 6 | use crate::errors; |
| 7 | 7 |
compiler/rustc_builtin_macros/src/util.rs+2-2| ... | ... | @@ -1,12 +1,12 @@ |
| 1 | 1 | use rustc_ast::ptr::P; |
| 2 | 2 | use rustc_ast::tokenstream::TokenStream; |
| 3 | use rustc_ast::{self as ast, attr, token, AttrStyle, Attribute, MetaItem}; | |
| 3 | use rustc_ast::{self as ast, AttrStyle, Attribute, MetaItem, attr, token}; | |
| 4 | 4 | use rustc_errors::{Applicability, Diag, ErrorGuaranteed}; |
| 5 | 5 | use rustc_expand::base::{Annotatable, ExpandResult, ExtCtxt}; |
| 6 | 6 | use rustc_expand::expand::AstFragment; |
| 7 | 7 | use rustc_feature::AttributeTemplate; |
| 8 | use rustc_lint_defs::builtin::DUPLICATE_MACRO_ATTRIBUTES; | |
| 9 | 8 | use rustc_lint_defs::BuiltinLintDiag; |
| 9 | use rustc_lint_defs::builtin::DUPLICATE_MACRO_ATTRIBUTES; | |
| 10 | 10 | use rustc_parse::{parser, validate_attr}; |
| 11 | 11 | use rustc_session::errors::report_lit_error; |
| 12 | 12 | use rustc_span::{BytePos, Span, Symbol}; |
compiler/rustc_codegen_cranelift/build_system/abi_cafe.rs+2-2| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use crate::path::{Dirs, RelPath}; |
| 2 | 2 | use crate::prepare::GitRepo; |
| 3 | use crate::utils::{spawn_and_wait, CargoProject, Compiler}; | |
| 4 | use crate::{build_sysroot, CodegenBackend, SysrootKind}; | |
| 3 | use crate::utils::{CargoProject, Compiler, spawn_and_wait}; | |
| 4 | use crate::{CodegenBackend, SysrootKind, build_sysroot}; | |
| 5 | 5 | |
| 6 | 6 | static ABI_CAFE_REPO: GitRepo = GitRepo::github( |
| 7 | 7 | "Gankra", |
compiler/rustc_codegen_cranelift/build_system/bench.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ use std::path::Path; |
| 5 | 5 | use crate::path::{Dirs, RelPath}; |
| 6 | 6 | use crate::prepare::GitRepo; |
| 7 | 7 | use crate::rustc_info::get_file_name; |
| 8 | use crate::utils::{hyperfine_command, spawn_and_wait, Compiler}; | |
| 8 | use crate::utils::{Compiler, hyperfine_command, spawn_and_wait}; | |
| 9 | 9 | |
| 10 | 10 | static SIMPLE_RAYTRACER_REPO: GitRepo = GitRepo::github( |
| 11 | 11 | "ebobby", |
compiler/rustc_codegen_cranelift/build_system/build_sysroot.rs+2-2| ... | ... | @@ -5,9 +5,9 @@ use std::{env, fs}; |
| 5 | 5 | use crate::path::{Dirs, RelPath}; |
| 6 | 6 | use crate::rustc_info::get_file_name; |
| 7 | 7 | use crate::utils::{ |
| 8 | remove_dir_if_exists, spawn_and_wait, try_hard_link, CargoProject, Compiler, LogGroup, | |
| 8 | CargoProject, Compiler, LogGroup, remove_dir_if_exists, spawn_and_wait, try_hard_link, | |
| 9 | 9 | }; |
| 10 | use crate::{config, CodegenBackend, SysrootKind}; | |
| 10 | use crate::{CodegenBackend, SysrootKind, config}; | |
| 11 | 11 | |
| 12 | 12 | static DIST_DIR: RelPath = RelPath::DIST; |
| 13 | 13 | static BIN_DIR: RelPath = RelPath::DIST.join("bin"); |
compiler/rustc_codegen_cranelift/build_system/tests.rs+3-3| ... | ... | @@ -4,11 +4,11 @@ use std::path::PathBuf; |
| 4 | 4 | use std::process::Command; |
| 5 | 5 | |
| 6 | 6 | use crate::path::{Dirs, RelPath}; |
| 7 | use crate::prepare::{apply_patches, GitRepo}; | |
| 7 | use crate::prepare::{GitRepo, apply_patches}; | |
| 8 | 8 | use crate::rustc_info::get_default_sysroot; |
| 9 | 9 | use crate::shared_utils::rustflags_from_env; |
| 10 | use crate::utils::{spawn_and_wait, CargoProject, Compiler, LogGroup}; | |
| 11 | use crate::{build_sysroot, config, CodegenBackend, SysrootKind}; | |
| 10 | use crate::utils::{CargoProject, Compiler, LogGroup, spawn_and_wait}; | |
| 11 | use crate::{CodegenBackend, SysrootKind, build_sysroot, config}; | |
| 12 | 12 | |
| 13 | 13 | static BUILD_EXAMPLE_OUT_DIR: RelPath = RelPath::BUILD.join("example"); |
| 14 | 14 |
compiler/rustc_codegen_cranelift/example/std_example.rs+3-4| ... | ... | @@ -238,10 +238,9 @@ unsafe fn test_simd() { |
| 238 | 238 | let (zero0, zero1) = std::mem::transmute::<_, (u64, u64)>(x); |
| 239 | 239 | assert_eq!((zero0, zero1), (0, 0)); |
| 240 | 240 | assert_eq!(std::mem::transmute::<_, [u16; 8]>(or), [7, 7, 7, 7, 7, 7, 7, 7]); |
| 241 | assert_eq!( | |
| 242 | std::mem::transmute::<_, [u16; 8]>(cmp_eq), | |
| 243 | [0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff] | |
| 244 | ); | |
| 241 | assert_eq!(std::mem::transmute::<_, [u16; 8]>(cmp_eq), [ | |
| 242 | 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff | |
| 243 | ]); | |
| 245 | 244 | assert_eq!(std::mem::transmute::<_, [u16; 8]>(cmp_lt), [0, 0, 0, 0, 0, 0, 0, 0]); |
| 246 | 245 | |
| 247 | 246 | test_mm_slli_si128(); |
compiler/rustc_codegen_cranelift/src/abi/mod.rs+1-1| ... | ... | @@ -13,9 +13,9 @@ use cranelift_module::ModuleError; |
| 13 | 13 | use rustc_codegen_ssa::base::is_call_from_compiler_builtins_to_upstream_monomorphization; |
| 14 | 14 | use rustc_codegen_ssa::errors::CompilerBuiltinsCannotCall; |
| 15 | 15 | use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; |
| 16 | use rustc_middle::ty::TypeVisitableExt; | |
| 16 | 17 | use rustc_middle::ty::layout::FnAbiOf; |
| 17 | 18 | use rustc_middle::ty::print::with_no_trimmed_paths; |
| 18 | use rustc_middle::ty::TypeVisitableExt; | |
| 19 | 19 | use rustc_session::Session; |
| 20 | 20 | use rustc_span::source_map::Spanned; |
| 21 | 21 | use rustc_target::abi::call::{Conv, FnAbi, PassMode}; |
compiler/rustc_codegen_cranelift/src/abi/pass_mode.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ use cranelift_codegen::ir::{ArgumentExtension, ArgumentPurpose}; |
| 4 | 4 | use rustc_target::abi::call::{ |
| 5 | 5 | ArgAbi, ArgAttributes, ArgExtension as RustcArgExtension, CastTarget, PassMode, Reg, RegKind, |
| 6 | 6 | }; |
| 7 | use smallvec::{smallvec, SmallVec}; | |
| 7 | use smallvec::{SmallVec, smallvec}; | |
| 8 | 8 | |
| 9 | 9 | use crate::prelude::*; |
| 10 | 10 | use crate::value_and_place::assert_assignable; |
compiler/rustc_codegen_cranelift/src/abi/returning.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | //! Return value handling |
| 2 | 2 | |
| 3 | 3 | use rustc_target::abi::call::{ArgAbi, PassMode}; |
| 4 | use smallvec::{smallvec, SmallVec}; | |
| 4 | use smallvec::{SmallVec, smallvec}; | |
| 5 | 5 | |
| 6 | 6 | use crate::prelude::*; |
| 7 | 7 |
compiler/rustc_codegen_cranelift/src/allocator.rs+2-2| ... | ... | @@ -2,8 +2,8 @@ |
| 2 | 2 | // Adapted from rustc |
| 3 | 3 | |
| 4 | 4 | use rustc_ast::expand::allocator::{ |
| 5 | alloc_error_handler_name, default_fn_name, global_fn_name, AllocatorKind, AllocatorTy, | |
| 6 | ALLOCATOR_METHODS, NO_ALLOC_SHIM_IS_UNSTABLE, | |
| 5 | ALLOCATOR_METHODS, AllocatorKind, AllocatorTy, NO_ALLOC_SHIM_IS_UNSTABLE, | |
| 6 | alloc_error_handler_name, default_fn_name, global_fn_name, | |
| 7 | 7 | }; |
| 8 | 8 | use rustc_codegen_ssa::base::allocator_kind_for_codegen; |
| 9 | 9 | use rustc_session::config::OomStrategy; |
compiler/rustc_codegen_cranelift/src/base.rs+2-2| ... | ... | @@ -1,17 +1,17 @@ |
| 1 | 1 | //! Codegen of a single function |
| 2 | 2 | |
| 3 | use cranelift_codegen::ir::UserFuncName; | |
| 4 | 3 | use cranelift_codegen::CodegenError; |
| 4 | use cranelift_codegen::ir::UserFuncName; | |
| 5 | 5 | use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext}; |
| 6 | 6 | use cranelift_module::ModuleError; |
| 7 | 7 | use rustc_ast::InlineAsmOptions; |
| 8 | 8 | use rustc_codegen_ssa::base::is_call_from_compiler_builtins_to_upstream_monomorphization; |
| 9 | 9 | use rustc_index::IndexVec; |
| 10 | 10 | use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; |
| 11 | use rustc_middle::ty::TypeVisitableExt; | |
| 11 | 12 | use rustc_middle::ty::adjustment::PointerCoercion; |
| 12 | 13 | use rustc_middle::ty::layout::FnAbiOf; |
| 13 | 14 | use rustc_middle::ty::print::with_no_trimmed_paths; |
| 14 | use rustc_middle::ty::TypeVisitableExt; | |
| 15 | 15 | |
| 16 | 16 | use crate::constant::ConstantCx; |
| 17 | 17 | use crate::debuginfo::{FunctionDebugContext, TypeDebugContext}; |
compiler/rustc_codegen_cranelift/src/common.rs+1-1| ... | ... | @@ -1,10 +1,10 @@ |
| 1 | 1 | use cranelift_codegen::isa::TargetFrontendConfig; |
| 2 | 2 | use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext}; |
| 3 | 3 | use rustc_index::IndexVec; |
| 4 | use rustc_middle::ty::TypeFoldable; | |
| 4 | 5 | use rustc_middle::ty::layout::{ |
| 5 | 6 | self, FnAbiError, FnAbiOfHelpers, FnAbiRequest, LayoutError, LayoutOfHelpers, |
| 6 | 7 | }; |
| 7 | use rustc_middle::ty::TypeFoldable; | |
| 8 | 8 | use rustc_span::source_map::Spanned; |
| 9 | 9 | use rustc_target::abi::call::FnAbi; |
| 10 | 10 | use rustc_target::abi::{Float, Integer, Primitive}; |
compiler/rustc_codegen_cranelift/src/constant.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ use std::cmp::Ordering; |
| 5 | 5 | use cranelift_module::*; |
| 6 | 6 | use rustc_data_structures::fx::FxHashSet; |
| 7 | 7 | use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; |
| 8 | use rustc_middle::mir::interpret::{read_target_uint, AllocId, GlobalAlloc, Scalar}; | |
| 8 | use rustc_middle::mir::interpret::{AllocId, GlobalAlloc, Scalar, read_target_uint}; | |
| 9 | 9 | use rustc_middle::ty::{Binder, ExistentialTraitRef, ScalarInt}; |
| 10 | 10 | |
| 11 | 11 | use crate::prelude::*; |
compiler/rustc_codegen_cranelift/src/debuginfo/emit.rs+1-1| ... | ... | @@ -6,8 +6,8 @@ use gimli::write::{Address, AttributeValue, EndianVec, Result, Sections, Writer} |
| 6 | 6 | use gimli::{RunTimeEndian, SectionId}; |
| 7 | 7 | use rustc_data_structures::fx::FxHashMap; |
| 8 | 8 | |
| 9 | use super::object::WriteDebugInfo; | |
| 10 | 9 | use super::DebugContext; |
| 10 | use super::object::WriteDebugInfo; | |
| 11 | 11 | |
| 12 | 12 | pub(super) fn address_for_func(func_id: FuncId) -> Address { |
| 13 | 13 | let symbol = func_id.as_u32(); |
compiler/rustc_codegen_cranelift/src/debuginfo/line_info.rs+3-3| ... | ... | @@ -3,15 +3,15 @@ |
| 3 | 3 | use std::ffi::OsStr; |
| 4 | 4 | use std::path::{Component, Path}; |
| 5 | 5 | |
| 6 | use cranelift_codegen::binemit::CodeOffset; | |
| 7 | 6 | use cranelift_codegen::MachSrcLoc; |
| 7 | use cranelift_codegen::binemit::CodeOffset; | |
| 8 | 8 | use gimli::write::{AttributeValue, FileId, FileInfo, LineProgram, LineString, LineStringTable}; |
| 9 | 9 | use rustc_span::{ |
| 10 | hygiene, FileName, Pos, SourceFile, SourceFileAndLine, SourceFileHash, SourceFileHashAlgorithm, | |
| 10 | FileName, Pos, SourceFile, SourceFileAndLine, SourceFileHash, SourceFileHashAlgorithm, hygiene, | |
| 11 | 11 | }; |
| 12 | 12 | |
| 13 | use crate::debuginfo::emit::address_for_func; | |
| 14 | 13 | use crate::debuginfo::FunctionDebugContext; |
| 14 | use crate::debuginfo::emit::address_for_func; | |
| 15 | 15 | use crate::prelude::*; |
| 16 | 16 | |
| 17 | 17 | // OPTIMIZATION: It is cheaper to do this in one pass than using `.parent()` and `.file_name()`. |
compiler/rustc_codegen_cranelift/src/debuginfo/object.rs+9-12| ... | ... | @@ -73,19 +73,16 @@ impl WriteDebugInfo for ObjectProduct { |
| 73 | 73 | } |
| 74 | 74 | }; |
| 75 | 75 | self.object |
| 76 | .add_relocation( | |
| 77 | from.0, | |
| 78 | Relocation { | |
| 79 | offset: u64::from(reloc.offset), | |
| 80 | symbol, | |
| 81 | flags: RelocationFlags::Generic { | |
| 82 | kind: reloc.kind, | |
| 83 | encoding: RelocationEncoding::Generic, | |
| 84 | size: reloc.size * 8, | |
| 85 | }, | |
| 86 | addend: i64::try_from(symbol_offset).unwrap() + reloc.addend, | |
| 76 | .add_relocation(from.0, Relocation { | |
| 77 | offset: u64::from(reloc.offset), | |
| 78 | symbol, | |
| 79 | flags: RelocationFlags::Generic { | |
| 80 | kind: reloc.kind, | |
| 81 | encoding: RelocationEncoding::Generic, | |
| 82 | size: reloc.size * 8, | |
| 87 | 83 | }, |
| 88 | ) | |
| 84 | addend: i64::try_from(symbol_offset).unwrap() + reloc.addend, | |
| 85 | }) | |
| 89 | 86 | .unwrap(); |
| 90 | 87 | } |
| 91 | 88 | } |
compiler/rustc_codegen_cranelift/src/debuginfo/types.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ use rustc_data_structures::fx::FxHashMap; |
| 6 | 6 | use rustc_middle::ty::layout::LayoutOf; |
| 7 | 7 | use rustc_middle::ty::{self, Ty, TyCtxt}; |
| 8 | 8 | |
| 9 | use crate::{has_ptr_meta, DebugContext, RevealAllLayoutCx}; | |
| 9 | use crate::{DebugContext, RevealAllLayoutCx, has_ptr_meta}; | |
| 10 | 10 | |
| 11 | 11 | #[derive(Default)] |
| 12 | 12 | pub(crate) struct TypeDebugContext<'tcx> { |
compiler/rustc_codegen_cranelift/src/debuginfo/unwind.rs+2-2| ... | ... | @@ -1,11 +1,11 @@ |
| 1 | 1 | //! Unwind info generation (`.eh_frame`) |
| 2 | 2 | |
| 3 | 3 | use cranelift_codegen::ir::Endianness; |
| 4 | use cranelift_codegen::isa::unwind::UnwindInfo; | |
| 5 | 4 | use cranelift_codegen::isa::TargetIsa; |
| 5 | use cranelift_codegen::isa::unwind::UnwindInfo; | |
| 6 | 6 | use cranelift_object::ObjectProduct; |
| 7 | use gimli::write::{CieId, EhFrame, FrameTable, Section}; | |
| 8 | 7 | use gimli::RunTimeEndian; |
| 8 | use gimli::write::{CieId, EhFrame, FrameTable, Section}; | |
| 9 | 9 | |
| 10 | 10 | use super::emit::address_for_func; |
| 11 | 11 | use super::object::WriteDebugInfo; |
compiler/rustc_codegen_cranelift/src/driver/aot.rs+5-5| ... | ... | @@ -12,24 +12,24 @@ use rustc_codegen_ssa::back::link::ensure_removed; |
| 12 | 12 | use rustc_codegen_ssa::back::metadata::create_compressed_metadata_file; |
| 13 | 13 | use rustc_codegen_ssa::base::determine_cgu_reuse; |
| 14 | 14 | use rustc_codegen_ssa::{ |
| 15 | errors as ssa_errors, CodegenResults, CompiledModule, CrateInfo, ModuleKind, | |
| 15 | CodegenResults, CompiledModule, CrateInfo, ModuleKind, errors as ssa_errors, | |
| 16 | 16 | }; |
| 17 | 17 | use rustc_data_structures::profiling::SelfProfilerRef; |
| 18 | 18 | use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; |
| 19 | use rustc_data_structures::sync::{par_map, IntoDynSyncSend}; | |
| 20 | use rustc_metadata::fs::copy_to_stdout; | |
| 19 | use rustc_data_structures::sync::{IntoDynSyncSend, par_map}; | |
| 21 | 20 | use rustc_metadata::EncodedMetadata; |
| 21 | use rustc_metadata::fs::copy_to_stdout; | |
| 22 | 22 | use rustc_middle::dep_graph::{WorkProduct, WorkProductId}; |
| 23 | 23 | use rustc_middle::mir::mono::{CodegenUnit, MonoItem}; |
| 24 | use rustc_session::config::{DebugInfo, OutFileName, OutputFilenames, OutputType}; | |
| 25 | 24 | use rustc_session::Session; |
| 25 | use rustc_session::config::{DebugInfo, OutFileName, OutputFilenames, OutputType}; | |
| 26 | 26 | |
| 27 | use crate::BackendConfig; | |
| 27 | 28 | use crate::concurrency_limiter::{ConcurrencyLimiter, ConcurrencyLimiterToken}; |
| 28 | 29 | use crate::debuginfo::TypeDebugContext; |
| 29 | 30 | use crate::global_asm::GlobalAsmConfig; |
| 30 | 31 | use crate::prelude::*; |
| 31 | 32 | use crate::unwind_module::UnwindModule; |
| 32 | use crate::BackendConfig; | |
| 33 | 33 | |
| 34 | 34 | struct ModuleCodegenResult { |
| 35 | 35 | module_regular: CompiledModule, |
compiler/rustc_codegen_cranelift/src/driver/jit.rs+6-10| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | use std::cell::RefCell; |
| 5 | 5 | use std::ffi::CString; |
| 6 | 6 | use std::os::raw::{c_char, c_int}; |
| 7 | use std::sync::{mpsc, Mutex, OnceLock}; | |
| 7 | use std::sync::{Mutex, OnceLock, mpsc}; | |
| 8 | 8 | |
| 9 | 9 | use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext}; |
| 10 | 10 | use cranelift_jit::{JITBuilder, JITModule}; |
| ... | ... | @@ -359,15 +359,11 @@ fn codegen_shim<'tcx>( |
| 359 | 359 | let instance_ptr = Box::into_raw(Box::new(inst)); |
| 360 | 360 | |
| 361 | 361 | let jit_fn = module |
| 362 | .declare_function( | |
| 363 | "__clif_jit_fn", | |
| 364 | Linkage::Import, | |
| 365 | &Signature { | |
| 366 | call_conv: module.target_config().default_call_conv, | |
| 367 | params: vec![AbiParam::new(pointer_type), AbiParam::new(pointer_type)], | |
| 368 | returns: vec![AbiParam::new(pointer_type)], | |
| 369 | }, | |
| 370 | ) | |
| 362 | .declare_function("__clif_jit_fn", Linkage::Import, &Signature { | |
| 363 | call_conv: module.target_config().default_call_conv, | |
| 364 | params: vec![AbiParam::new(pointer_type), AbiParam::new(pointer_type)], | |
| 365 | returns: vec![AbiParam::new(pointer_type)], | |
| 366 | }) | |
| 371 | 367 | .unwrap(); |
| 372 | 368 | |
| 373 | 369 | let context = cached_context; |
compiler/rustc_codegen_cranelift/src/inline_asm.rs+5-9| ... | ... | @@ -869,15 +869,11 @@ fn call_inline_asm<'tcx>( |
| 869 | 869 | |
| 870 | 870 | let inline_asm_func = fx |
| 871 | 871 | .module |
| 872 | .declare_function( | |
| 873 | asm_name, | |
| 874 | Linkage::Import, | |
| 875 | &Signature { | |
| 876 | call_conv: CallConv::SystemV, | |
| 877 | params: vec![AbiParam::new(fx.pointer_type)], | |
| 878 | returns: vec![], | |
| 879 | }, | |
| 880 | ) | |
| 872 | .declare_function(asm_name, Linkage::Import, &Signature { | |
| 873 | call_conv: CallConv::SystemV, | |
| 874 | params: vec![AbiParam::new(fx.pointer_type)], | |
| 875 | returns: vec![], | |
| 876 | }) | |
| 881 | 877 | .unwrap(); |
| 882 | 878 | let inline_asm_func = fx.module.declare_func_in_func(inline_asm_func, fx.bcx.func); |
| 883 | 879 | if fx.clif_comments.enabled() { |
compiler/rustc_codegen_cranelift/src/intrinsics/llvm_x86.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | use rustc_ast::ast::{InlineAsmOptions, InlineAsmTemplatePiece}; |
| 4 | 4 | use rustc_target::asm::*; |
| 5 | 5 | |
| 6 | use crate::inline_asm::{codegen_inline_asm_inner, CInlineAsmOperand}; | |
| 6 | use crate::inline_asm::{CInlineAsmOperand, codegen_inline_asm_inner}; | |
| 7 | 7 | use crate::intrinsics::*; |
| 8 | 8 | use crate::prelude::*; |
| 9 | 9 |
compiler/rustc_codegen_cranelift/src/intrinsics/mod.rs+2-2| ... | ... | @@ -19,11 +19,11 @@ mod simd; |
| 19 | 19 | |
| 20 | 20 | use cranelift_codegen::ir::AtomicRmwOp; |
| 21 | 21 | use rustc_middle::ty; |
| 22 | use rustc_middle::ty::GenericArgsRef; | |
| 22 | 23 | use rustc_middle::ty::layout::{HasParamEnv, ValidityRequirement}; |
| 23 | 24 | use rustc_middle::ty::print::{with_no_trimmed_paths, with_no_visible_paths}; |
| 24 | use rustc_middle::ty::GenericArgsRef; | |
| 25 | 25 | use rustc_span::source_map::Spanned; |
| 26 | use rustc_span::symbol::{sym, Symbol}; | |
| 26 | use rustc_span::symbol::{Symbol, sym}; | |
| 27 | 27 | |
| 28 | 28 | pub(crate) use self::llvm::codegen_llvm_intrinsic_call; |
| 29 | 29 | use crate::cast::clif_intcast; |
compiler/rustc_codegen_cranelift/src/intrinsics/simd.rs+3-6| ... | ... | @@ -574,12 +574,9 @@ pub(super) fn codegen_simd_intrinsic_call<'tcx>( |
| 574 | 574 | (sym::simd_round, types::F64) => "round", |
| 575 | 575 | _ => unreachable!("{:?}", intrinsic), |
| 576 | 576 | }; |
| 577 | fx.lib_call( | |
| 578 | name, | |
| 579 | vec![AbiParam::new(lane_ty)], | |
| 580 | vec![AbiParam::new(lane_ty)], | |
| 581 | &[lane], | |
| 582 | )[0] | |
| 577 | fx.lib_call(name, vec![AbiParam::new(lane_ty)], vec![AbiParam::new(lane_ty)], &[ | |
| 578 | lane, | |
| 579 | ])[0] | |
| 583 | 580 | }); |
| 584 | 581 | } |
| 585 | 582 |
compiler/rustc_codegen_cranelift/src/lib.rs+7-7| ... | ... | @@ -38,15 +38,15 @@ use std::sync::Arc; |
| 38 | 38 | |
| 39 | 39 | use cranelift_codegen::isa::TargetIsa; |
| 40 | 40 | use cranelift_codegen::settings::{self, Configurable}; |
| 41 | use rustc_codegen_ssa::traits::CodegenBackend; | |
| 42 | 41 | use rustc_codegen_ssa::CodegenResults; |
| 42 | use rustc_codegen_ssa::traits::CodegenBackend; | |
| 43 | 43 | use rustc_data_structures::profiling::SelfProfilerRef; |
| 44 | 44 | use rustc_errors::ErrorGuaranteed; |
| 45 | 45 | use rustc_metadata::EncodedMetadata; |
| 46 | 46 | use rustc_middle::dep_graph::{WorkProduct, WorkProductId}; |
| 47 | use rustc_session::config::OutputFilenames; | |
| 48 | 47 | use rustc_session::Session; |
| 49 | use rustc_span::{sym, Symbol}; | |
| 48 | use rustc_session::config::OutputFilenames; | |
| 49 | use rustc_span::{Symbol, sym}; | |
| 50 | 50 | |
| 51 | 51 | pub use crate::config::*; |
| 52 | 52 | use crate::prelude::*; |
| ... | ... | @@ -83,13 +83,13 @@ mod value_and_place; |
| 83 | 83 | mod vtable; |
| 84 | 84 | |
| 85 | 85 | mod prelude { |
| 86 | pub(crate) use cranelift_codegen::Context; | |
| 86 | 87 | pub(crate) use cranelift_codegen::ir::condcodes::{FloatCC, IntCC}; |
| 87 | 88 | pub(crate) use cranelift_codegen::ir::function::Function; |
| 88 | 89 | pub(crate) use cranelift_codegen::ir::{ |
| 89 | types, AbiParam, Block, FuncRef, Inst, InstBuilder, MemFlags, Signature, SourceLoc, | |
| 90 | StackSlot, StackSlotData, StackSlotKind, TrapCode, Type, Value, | |
| 90 | AbiParam, Block, FuncRef, Inst, InstBuilder, MemFlags, Signature, SourceLoc, StackSlot, | |
| 91 | StackSlotData, StackSlotKind, TrapCode, Type, Value, types, | |
| 91 | 92 | }; |
| 92 | pub(crate) use cranelift_codegen::Context; | |
| 93 | 93 | pub(crate) use cranelift_module::{self, DataDescription, FuncId, Linkage, Module}; |
| 94 | 94 | pub(crate) use rustc_data_structures::fx::{FxHashMap, FxIndexMap}; |
| 95 | 95 | pub(crate) use rustc_hir::def_id::{DefId, LOCAL_CRATE}; |
| ... | ... | @@ -100,7 +100,7 @@ mod prelude { |
| 100 | 100 | self, FloatTy, Instance, InstanceKind, IntTy, ParamEnv, Ty, TyCtxt, UintTy, |
| 101 | 101 | }; |
| 102 | 102 | pub(crate) use rustc_span::Span; |
| 103 | pub(crate) use rustc_target::abi::{Abi, FieldIdx, Scalar, Size, VariantIdx, FIRST_VARIANT}; | |
| 103 | pub(crate) use rustc_target::abi::{Abi, FIRST_VARIANT, FieldIdx, Scalar, Size, VariantIdx}; | |
| 104 | 104 | |
| 105 | 105 | pub(crate) use crate::abi::*; |
| 106 | 106 | pub(crate) use crate::base::{codegen_operand, codegen_place}; |
compiler/rustc_codegen_cranelift/src/main_shim.rs+6-9| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | use cranelift_frontend::{FunctionBuilder, FunctionBuilderContext}; |
| 2 | 2 | use rustc_hir::LangItem; |
| 3 | 3 | use rustc_middle::ty::{AssocKind, GenericArg}; |
| 4 | use rustc_session::config::{sigpipe, EntryFnType}; | |
| 5 | use rustc_span::symbol::Ident; | |
| 4 | use rustc_session::config::{EntryFnType, sigpipe}; | |
| 6 | 5 | use rustc_span::DUMMY_SP; |
| 6 | use rustc_span::symbol::Ident; | |
| 7 | 7 | |
| 8 | 8 | use crate::prelude::*; |
| 9 | 9 | |
| ... | ... | @@ -16,13 +16,10 @@ pub(crate) fn maybe_create_entry_wrapper( |
| 16 | 16 | is_primary_cgu: bool, |
| 17 | 17 | ) { |
| 18 | 18 | let (main_def_id, (is_main_fn, sigpipe)) = match tcx.entry_fn(()) { |
| 19 | Some((def_id, entry_ty)) => ( | |
| 20 | def_id, | |
| 21 | match entry_ty { | |
| 22 | EntryFnType::Main { sigpipe } => (true, sigpipe), | |
| 23 | EntryFnType::Start => (false, sigpipe::DEFAULT), | |
| 24 | }, | |
| 25 | ), | |
| 19 | Some((def_id, entry_ty)) => (def_id, match entry_ty { | |
| 20 | EntryFnType::Main { sigpipe } => (true, sigpipe), | |
| 21 | EntryFnType::Start => (false, sigpipe::DEFAULT), | |
| 22 | }), | |
| 26 | 23 | None => return, |
| 27 | 24 | }; |
| 28 | 25 |
compiler/rustc_codegen_cranelift/src/pretty_clif.rs+1-1| ... | ... | @@ -59,8 +59,8 @@ use std::fmt; |
| 59 | 59 | use std::io::Write; |
| 60 | 60 | |
| 61 | 61 | use cranelift_codegen::entity::SecondaryMap; |
| 62 | use cranelift_codegen::ir::entities::AnyEntity; | |
| 63 | 62 | use cranelift_codegen::ir::Fact; |
| 63 | use cranelift_codegen::ir::entities::AnyEntity; | |
| 64 | 64 | use cranelift_codegen::write::{FuncWriter, PlainWriter}; |
| 65 | 65 | use rustc_middle::ty::layout::FnAbiOf; |
| 66 | 66 | use rustc_middle::ty::print::with_no_trimmed_paths; |
compiler/rustc_codegen_cranelift/src/trap.rs+5-9| ... | ... | @@ -5,15 +5,11 @@ use crate::prelude::*; |
| 5 | 5 | fn codegen_print(fx: &mut FunctionCx<'_, '_, '_>, msg: &str) { |
| 6 | 6 | let puts = fx |
| 7 | 7 | .module |
| 8 | .declare_function( | |
| 9 | "puts", | |
| 10 | Linkage::Import, | |
| 11 | &Signature { | |
| 12 | call_conv: fx.target_config.default_call_conv, | |
| 13 | params: vec![AbiParam::new(fx.pointer_type)], | |
| 14 | returns: vec![AbiParam::new(types::I32)], | |
| 15 | }, | |
| 16 | ) | |
| 8 | .declare_function("puts", Linkage::Import, &Signature { | |
| 9 | call_conv: fx.target_config.default_call_conv, | |
| 10 | params: vec![AbiParam::new(fx.pointer_type)], | |
| 11 | returns: vec![AbiParam::new(types::I32)], | |
| 12 | }) | |
| 17 | 13 | .unwrap(); |
| 18 | 14 | let puts = fx.module.declare_func_in_func(puts, &mut fx.bcx.func); |
| 19 | 15 | if fx.clif_comments.enabled() { |
compiler/rustc_codegen_gcc/build_system/src/config.rs+1-1| ... | ... | @@ -3,8 +3,8 @@ use std::ffi::OsStr; |
| 3 | 3 | use std::path::{Path, PathBuf}; |
| 4 | 4 | use std::{env as std_env, fs}; |
| 5 | 5 | |
| 6 | use boml::types::TomlValue; | |
| 7 | 6 | use boml::Toml; |
| 7 | use boml::types::TomlValue; | |
| 8 | 8 | |
| 9 | 9 | use crate::utils::{ |
| 10 | 10 | create_dir, create_symlink, get_os_name, get_sysroot_dir, run_command_with_output, |
compiler/rustc_codegen_gcc/build_system/src/test.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use std::collections::HashMap; |
| 2 | 2 | use std::ffi::OsStr; |
| 3 | use std::fs::{remove_dir_all, File}; | |
| 3 | use std::fs::{File, remove_dir_all}; | |
| 4 | 4 | use std::io::{BufRead, BufReader}; |
| 5 | 5 | use std::path::{Path, PathBuf}; |
| 6 | 6 | use std::str::FromStr; |
compiler/rustc_codegen_gcc/build_system/src/utils.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use std::collections::HashMap; |
| 2 | use std::ffi::OsStr; | |
| 2 | 3 | #[cfg(unix)] |
| 3 | 4 | use std::ffi::c_int; |
| 4 | use std::ffi::OsStr; | |
| 5 | 5 | use std::fmt::Debug; |
| 6 | 6 | use std::fs; |
| 7 | 7 | #[cfg(unix)] |
compiler/rustc_codegen_gcc/src/abi.rs+1-1| ... | ... | @@ -4,8 +4,8 @@ use gccjit::{ToLValue, ToRValue, Type}; |
| 4 | 4 | use rustc_codegen_ssa::traits::{AbiBuilderMethods, BaseTypeCodegenMethods}; |
| 5 | 5 | use rustc_data_structures::fx::FxHashSet; |
| 6 | 6 | use rustc_middle::bug; |
| 7 | use rustc_middle::ty::layout::LayoutOf; | |
| 8 | 7 | use rustc_middle::ty::Ty; |
| 8 | use rustc_middle::ty::layout::LayoutOf; | |
| 9 | 9 | #[cfg(feature = "master")] |
| 10 | 10 | use rustc_session::config; |
| 11 | 11 | use rustc_target::abi::call::{ArgAttributes, CastTarget, FnAbi, PassMode, Reg, RegKind}; |
compiler/rustc_codegen_gcc/src/allocator.rs+2-2| ... | ... | @@ -2,8 +2,8 @@ |
| 2 | 2 | use gccjit::FnAttribute; |
| 3 | 3 | use gccjit::{Context, FunctionType, GlobalKind, ToRValue, Type}; |
| 4 | 4 | use rustc_ast::expand::allocator::{ |
| 5 | alloc_error_handler_name, default_fn_name, global_fn_name, AllocatorKind, AllocatorTy, | |
| 6 | ALLOCATOR_METHODS, NO_ALLOC_SHIM_IS_UNSTABLE, | |
| 5 | ALLOCATOR_METHODS, AllocatorKind, AllocatorTy, NO_ALLOC_SHIM_IS_UNSTABLE, | |
| 6 | alloc_error_handler_name, default_fn_name, global_fn_name, | |
| 7 | 7 | }; |
| 8 | 8 | use rustc_middle::bug; |
| 9 | 9 | use rustc_middle::ty::TyCtxt; |
compiler/rustc_codegen_gcc/src/back/lto.rs+3-3| ... | ... | @@ -27,7 +27,7 @@ use rustc_codegen_ssa::back::lto::{LtoModuleCodegen, SerializedModule, ThinModul |
| 27 | 27 | use rustc_codegen_ssa::back::symbol_export; |
| 28 | 28 | use rustc_codegen_ssa::back::write::{CodegenContext, FatLtoInput}; |
| 29 | 29 | use rustc_codegen_ssa::traits::*; |
| 30 | use rustc_codegen_ssa::{looks_like_rust_object_file, ModuleCodegen, ModuleKind}; | |
| 30 | use rustc_codegen_ssa::{ModuleCodegen, ModuleKind, looks_like_rust_object_file}; | |
| 31 | 31 | use rustc_data_structures::memmap::Mmap; |
| 32 | 32 | use rustc_errors::{DiagCtxtHandle, FatalError}; |
| 33 | 33 | use rustc_hir::def_id::LOCAL_CRATE; |
| ... | ... | @@ -35,11 +35,11 @@ use rustc_middle::bug; |
| 35 | 35 | use rustc_middle::dep_graph::WorkProduct; |
| 36 | 36 | use rustc_middle::middle::exported_symbols::{SymbolExportInfo, SymbolExportLevel}; |
| 37 | 37 | use rustc_session::config::{CrateType, Lto}; |
| 38 | use tempfile::{tempdir, TempDir}; | |
| 38 | use tempfile::{TempDir, tempdir}; | |
| 39 | 39 | |
| 40 | 40 | use crate::back::write::save_temp_bitcode; |
| 41 | 41 | use crate::errors::{DynamicLinkingWithLTO, LtoBitcodeFromRlib, LtoDisallowed, LtoDylib}; |
| 42 | use crate::{to_gcc_opt_level, GccCodegenBackend, GccContext, SyncContext}; | |
| 42 | use crate::{GccCodegenBackend, GccContext, SyncContext, to_gcc_opt_level}; | |
| 43 | 43 | |
| 44 | 44 | /// We keep track of the computed LTO cache keys from the previous |
| 45 | 45 | /// session to determine which CGUs we can reuse. |
compiler/rustc_codegen_gcc/src/base.rs+1-1| ... | ... | @@ -19,7 +19,7 @@ use rustc_target::spec::PanicStrategy; |
| 19 | 19 | |
| 20 | 20 | use crate::builder::Builder; |
| 21 | 21 | use crate::context::CodegenCx; |
| 22 | use crate::{gcc_util, new_context, GccContext, LockedTargetInfo, SyncContext}; | |
| 22 | use crate::{GccContext, LockedTargetInfo, SyncContext, gcc_util, new_context}; | |
| 23 | 23 | |
| 24 | 24 | #[cfg(feature = "master")] |
| 25 | 25 | pub fn visibility_to_gcc(linkage: Visibility) -> gccjit::Visibility { |
compiler/rustc_codegen_gcc/src/builder.rs+15-14| ... | ... | @@ -7,7 +7,8 @@ use gccjit::{ |
| 7 | 7 | BinaryOp, Block, ComparisonOp, Context, Function, LValue, Location, RValue, ToRValue, Type, |
| 8 | 8 | UnaryOp, |
| 9 | 9 | }; |
| 10 | use rustc_apfloat::{ieee, Float, Round, Status}; | |
| 10 | use rustc_apfloat::{Float, Round, Status, ieee}; | |
| 11 | use rustc_codegen_ssa::MemFlags; | |
| 11 | 12 | use rustc_codegen_ssa::common::{ |
| 12 | 13 | AtomicOrdering, AtomicRmwBinOp, IntPredicate, RealPredicate, SynchronizationScope, TypeKind, |
| 13 | 14 | }; |
| ... | ... | @@ -17,7 +18,6 @@ use rustc_codegen_ssa::traits::{ |
| 17 | 18 | BackendTypes, BaseTypeCodegenMethods, BuilderMethods, ConstCodegenMethods, |
| 18 | 19 | LayoutTypeCodegenMethods, OverflowOp, StaticBuilderMethods, |
| 19 | 20 | }; |
| 20 | use rustc_codegen_ssa::MemFlags; | |
| 21 | 21 | use rustc_data_structures::fx::FxHashSet; |
| 22 | 22 | use rustc_middle::bug; |
| 23 | 23 | use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs; |
| ... | ... | @@ -25,13 +25,13 @@ use rustc_middle::ty::layout::{ |
| 25 | 25 | FnAbiError, FnAbiOfHelpers, FnAbiRequest, HasParamEnv, HasTyCtxt, LayoutError, LayoutOfHelpers, |
| 26 | 26 | }; |
| 27 | 27 | use rustc_middle::ty::{Instance, ParamEnv, Ty, TyCtxt}; |
| 28 | use rustc_span::def_id::DefId; | |
| 29 | 28 | use rustc_span::Span; |
| 29 | use rustc_span::def_id::DefId; | |
| 30 | 30 | use rustc_target::abi::call::FnAbi; |
| 31 | 31 | use rustc_target::abi::{self, Align, HasDataLayout, Size, TargetDataLayout, WrappingRange}; |
| 32 | 32 | use rustc_target::spec::{HasTargetSpec, HasWasmCAbiOpt, Target, WasmCAbi}; |
| 33 | 33 | |
| 34 | use crate::common::{type_is_pointer, SignType, TypeReflection}; | |
| 34 | use crate::common::{SignType, TypeReflection, type_is_pointer}; | |
| 35 | 35 | use crate::context::CodegenCx; |
| 36 | 36 | use crate::intrinsic::llvm; |
| 37 | 37 | use crate::type_of::LayoutGccExt; |
| ... | ... | @@ -152,11 +152,14 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> { |
| 152 | 152 | // NOTE: not sure why, but we have the wrong type here. |
| 153 | 153 | let int_type = compare_exchange.get_param(2).to_rvalue().get_type(); |
| 154 | 154 | let src = self.context.new_bitcast(self.location, src, int_type); |
| 155 | self.context.new_call( | |
| 156 | self.location, | |
| 157 | compare_exchange, | |
| 158 | &[dst, expected, src, weak, order, failure_order], | |
| 159 | ) | |
| 155 | self.context.new_call(self.location, compare_exchange, &[ | |
| 156 | dst, | |
| 157 | expected, | |
| 158 | src, | |
| 159 | weak, | |
| 160 | order, | |
| 161 | failure_order, | |
| 162 | ]) | |
| 160 | 163 | } |
| 161 | 164 | |
| 162 | 165 | pub fn assign(&self, lvalue: LValue<'gcc>, value: RValue<'gcc>) { |
| ... | ... | @@ -1079,11 +1082,9 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> { |
| 1079 | 1082 | let align = dest.val.align.restrict_for_offset(dest.layout.field(self.cx(), 0).size); |
| 1080 | 1083 | cg_elem.val.store(self, PlaceRef::new_sized_aligned(current_val, cg_elem.layout, align)); |
| 1081 | 1084 | |
| 1082 | let next = self.inbounds_gep( | |
| 1083 | self.backend_type(cg_elem.layout), | |
| 1084 | current.to_rvalue(), | |
| 1085 | &[self.const_usize(1)], | |
| 1086 | ); | |
| 1085 | let next = self.inbounds_gep(self.backend_type(cg_elem.layout), current.to_rvalue(), &[ | |
| 1086 | self.const_usize(1), | |
| 1087 | ]); | |
| 1087 | 1088 | self.llbb().add_assignment(self.location, current, next); |
| 1088 | 1089 | self.br(header_bb); |
| 1089 | 1090 |
compiler/rustc_codegen_gcc/src/common.rs+1-1| ... | ... | @@ -2,8 +2,8 @@ use gccjit::{LValue, RValue, ToRValue, Type}; |
| 2 | 2 | use rustc_codegen_ssa::traits::{ |
| 3 | 3 | BaseTypeCodegenMethods, ConstCodegenMethods, MiscCodegenMethods, StaticCodegenMethods, |
| 4 | 4 | }; |
| 5 | use rustc_middle::mir::interpret::{ConstAllocation, GlobalAlloc, Scalar}; | |
| 6 | 5 | use rustc_middle::mir::Mutability; |
| 6 | use rustc_middle::mir::interpret::{ConstAllocation, GlobalAlloc, Scalar}; | |
| 7 | 7 | use rustc_middle::ty::layout::LayoutOf; |
| 8 | 8 | use rustc_target::abi::{self, HasDataLayout, Pointer}; |
| 9 | 9 |
compiler/rustc_codegen_gcc/src/consts.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ use rustc_codegen_ssa::traits::{ |
| 7 | 7 | use rustc_hir::def::DefKind; |
| 8 | 8 | use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs}; |
| 9 | 9 | use rustc_middle::mir::interpret::{ |
| 10 | self, read_target_uint, ConstAllocation, ErrorHandled, Scalar as InterpScalar, | |
| 10 | self, ConstAllocation, ErrorHandled, Scalar as InterpScalar, read_target_uint, | |
| 11 | 11 | }; |
| 12 | 12 | use rustc_middle::ty::layout::LayoutOf; |
| 13 | 13 | use rustc_middle::ty::{self, Instance}; |
compiler/rustc_codegen_gcc/src/context.rs+2-2| ... | ... | @@ -6,7 +6,7 @@ use gccjit::{ |
| 6 | 6 | use rustc_codegen_ssa::base::wants_msvc_seh; |
| 7 | 7 | use rustc_codegen_ssa::errors as ssa_errors; |
| 8 | 8 | use rustc_codegen_ssa::traits::{BackendTypes, BaseTypeCodegenMethods, MiscCodegenMethods}; |
| 9 | use rustc_data_structures::base_n::{ToBaseN, ALPHANUMERIC_ONLY}; | |
| 9 | use rustc_data_structures::base_n::{ALPHANUMERIC_ONLY, ToBaseN}; | |
| 10 | 10 | use rustc_data_structures::fx::{FxHashMap, FxHashSet}; |
| 11 | 11 | use rustc_middle::mir::mono::CodegenUnit; |
| 12 | 12 | use rustc_middle::span_bug; |
| ... | ... | @@ -17,7 +17,7 @@ use rustc_middle::ty::layout::{ |
| 17 | 17 | use rustc_middle::ty::{self, Instance, ParamEnv, PolyExistentialTraitRef, Ty, TyCtxt}; |
| 18 | 18 | use rustc_session::Session; |
| 19 | 19 | use rustc_span::source_map::respan; |
| 20 | use rustc_span::{Span, DUMMY_SP}; | |
| 20 | use rustc_span::{DUMMY_SP, Span}; | |
| 21 | 21 | use rustc_target::abi::{HasDataLayout, PointeeInfo, Size, TargetDataLayout, VariantIdx}; |
| 22 | 22 | use rustc_target::spec::{HasTargetSpec, HasWasmCAbiOpt, Target, TlsModel, WasmCAbi}; |
| 23 | 23 |
compiler/rustc_codegen_gcc/src/debuginfo.rs+1-1| ... | ... | @@ -10,8 +10,8 @@ use rustc_middle::mir::{self, Body, SourceScope}; |
| 10 | 10 | use rustc_middle::ty::{Instance, PolyExistentialTraitRef, Ty}; |
| 11 | 11 | use rustc_session::config::DebugInfo; |
| 12 | 12 | use rustc_span::{BytePos, Pos, SourceFile, SourceFileAndLine, Span, Symbol}; |
| 13 | use rustc_target::abi::call::FnAbi; | |
| 14 | 13 | use rustc_target::abi::Size; |
| 14 | use rustc_target::abi::call::FnAbi; | |
| 15 | 15 | |
| 16 | 16 | use crate::builder::Builder; |
| 17 | 17 | use crate::context::CodegenCx; |
compiler/rustc_codegen_gcc/src/gcc_util.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ use rustc_data_structures::fx::FxHashMap; |
| 4 | 4 | use rustc_middle::bug; |
| 5 | 5 | use rustc_session::Session; |
| 6 | 6 | use rustc_target::target_features::RUSTC_SPECIFIC_FEATURES; |
| 7 | use smallvec::{smallvec, SmallVec}; | |
| 7 | use smallvec::{SmallVec, smallvec}; | |
| 8 | 8 | |
| 9 | 9 | use crate::errors::{ |
| 10 | 10 | PossibleFeature, TargetFeatureDisableOrEnable, UnknownCTargetFeature, |
compiler/rustc_codegen_gcc/src/int.rs+9-11| ... | ... | @@ -6,8 +6,8 @@ use gccjit::{BinaryOp, ComparisonOp, FunctionType, Location, RValue, ToRValue, T |
| 6 | 6 | use rustc_codegen_ssa::common::{IntPredicate, TypeKind}; |
| 7 | 7 | use rustc_codegen_ssa::traits::{BackendTypes, BaseTypeCodegenMethods, BuilderMethods, OverflowOp}; |
| 8 | 8 | use rustc_middle::ty::{ParamEnv, Ty}; |
| 9 | use rustc_target::abi::call::{ArgAbi, ArgAttributes, Conv, FnAbi, PassMode}; | |
| 10 | 9 | use rustc_target::abi::Endian; |
| 10 | use rustc_target::abi::call::{ArgAbi, ArgAttributes, Conv, FnAbi, PassMode}; | |
| 11 | 11 | use rustc_target::spec; |
| 12 | 12 | |
| 13 | 13 | use crate::builder::{Builder, ToGccComp}; |
| ... | ... | @@ -395,11 +395,9 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> { |
| 395 | 395 | |
| 396 | 396 | let indirect = matches!(fn_abi.ret.mode, PassMode::Indirect { .. }); |
| 397 | 397 | |
| 398 | let return_type = self.context.new_struct_type( | |
| 399 | self.location, | |
| 400 | "result_overflow", | |
| 401 | &[result_field, overflow_field], | |
| 402 | ); | |
| 398 | let return_type = self | |
| 399 | .context | |
| 400 | .new_struct_type(self.location, "result_overflow", &[result_field, overflow_field]); | |
| 403 | 401 | let result = if indirect { |
| 404 | 402 | let return_value = |
| 405 | 403 | self.current_func().new_local(self.location, return_type.as_type(), "return_value"); |
| ... | ... | @@ -416,11 +414,11 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> { |
| 416 | 414 | ); |
| 417 | 415 | self.llbb().add_eval( |
| 418 | 416 | self.location, |
| 419 | self.context.new_call( | |
| 420 | self.location, | |
| 421 | func, | |
| 422 | &[return_value.get_address(self.location), lhs, rhs], | |
| 423 | ), | |
| 417 | self.context.new_call(self.location, func, &[ | |
| 418 | return_value.get_address(self.location), | |
| 419 | lhs, | |
| 420 | rhs, | |
| 421 | ]), | |
| 424 | 422 | ); |
| 425 | 423 | return_value.to_rvalue() |
| 426 | 424 | } else { |
compiler/rustc_codegen_gcc/src/intrinsic/llvm.rs+10-12| ... | ... | @@ -511,12 +511,11 @@ pub fn adjust_intrinsic_return_value<'a, 'gcc, 'tcx>( |
| 511 | 511 | let field2 = builder.context.new_field(None, args[1].get_type(), "carryResult"); |
| 512 | 512 | let struct_type = |
| 513 | 513 | builder.context.new_struct_type(None, "addcarryResult", &[field1, field2]); |
| 514 | return_value = builder.context.new_struct_constructor( | |
| 515 | None, | |
| 516 | struct_type.as_type(), | |
| 517 | None, | |
| 518 | &[return_value, last_arg.dereference(None).to_rvalue()], | |
| 519 | ); | |
| 514 | return_value = | |
| 515 | builder.context.new_struct_constructor(None, struct_type.as_type(), None, &[ | |
| 516 | return_value, | |
| 517 | last_arg.dereference(None).to_rvalue(), | |
| 518 | ]); | |
| 520 | 519 | } |
| 521 | 520 | } |
| 522 | 521 | "__builtin_ia32_stmxcsr" => { |
| ... | ... | @@ -541,12 +540,11 @@ pub fn adjust_intrinsic_return_value<'a, 'gcc, 'tcx>( |
| 541 | 540 | let field2 = builder.context.new_field(None, return_value.get_type(), "success"); |
| 542 | 541 | let struct_type = |
| 543 | 542 | builder.context.new_struct_type(None, "rdrand_result", &[field1, field2]); |
| 544 | return_value = builder.context.new_struct_constructor( | |
| 545 | None, | |
| 546 | struct_type.as_type(), | |
| 547 | None, | |
| 548 | &[random_number, success_variable.to_rvalue()], | |
| 549 | ); | |
| 543 | return_value = | |
| 544 | builder.context.new_struct_constructor(None, struct_type.as_type(), None, &[ | |
| 545 | random_number, | |
| 546 | success_variable.to_rvalue(), | |
| 547 | ]); | |
| 550 | 548 | } |
| 551 | 549 | _ => (), |
| 552 | 550 | } |
compiler/rustc_codegen_gcc/src/intrinsic/mod.rs+4-4| ... | ... | @@ -7,6 +7,7 @@ use std::iter; |
| 7 | 7 | #[cfg(feature = "master")] |
| 8 | 8 | use gccjit::FunctionType; |
| 9 | 9 | use gccjit::{ComparisonOp, Function, RValue, ToRValue, Type, UnaryOp}; |
| 10 | use rustc_codegen_ssa::MemFlags; | |
| 10 | 11 | use rustc_codegen_ssa::base::wants_msvc_seh; |
| 11 | 12 | use rustc_codegen_ssa::common::IntPredicate; |
| 12 | 13 | use rustc_codegen_ssa::errors::InvalidMonomorphization; |
| ... | ... | @@ -17,18 +18,17 @@ use rustc_codegen_ssa::traits::{ |
| 17 | 18 | }; |
| 18 | 19 | #[cfg(feature = "master")] |
| 19 | 20 | use rustc_codegen_ssa::traits::{BaseTypeCodegenMethods, MiscCodegenMethods}; |
| 20 | use rustc_codegen_ssa::MemFlags; | |
| 21 | 21 | use rustc_middle::bug; |
| 22 | 22 | use rustc_middle::ty::layout::LayoutOf; |
| 23 | 23 | #[cfg(feature = "master")] |
| 24 | 24 | use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt}; |
| 25 | 25 | use rustc_middle::ty::{self, Instance, Ty}; |
| 26 | use rustc_span::{sym, Span, Symbol}; | |
| 27 | use rustc_target::abi::call::{ArgAbi, FnAbi, PassMode}; | |
| 26 | use rustc_span::{Span, Symbol, sym}; | |
| 28 | 27 | use rustc_target::abi::HasDataLayout; |
| 28 | use rustc_target::abi::call::{ArgAbi, FnAbi, PassMode}; | |
| 29 | use rustc_target::spec::PanicStrategy; | |
| 29 | 30 | #[cfg(feature = "master")] |
| 30 | 31 | use rustc_target::spec::abi::Abi; |
| 31 | use rustc_target::spec::PanicStrategy; | |
| 32 | 32 | |
| 33 | 33 | #[cfg(feature = "master")] |
| 34 | 34 | use crate::abi::FnAbiGccExt; |
compiler/rustc_codegen_gcc/src/intrinsic/simd.rs+230-238| ... | ... | @@ -16,7 +16,7 @@ use rustc_hir as hir; |
| 16 | 16 | use rustc_middle::mir::BinOp; |
| 17 | 17 | use rustc_middle::ty::layout::HasTyCtxt; |
| 18 | 18 | use rustc_middle::ty::{self, Ty}; |
| 19 | use rustc_span::{sym, Span, Symbol}; | |
| 19 | use rustc_span::{Span, Symbol, sym}; | |
| 20 | 20 | use rustc_target::abi::{Align, Size}; |
| 21 | 21 | |
| 22 | 22 | use crate::builder::Builder; |
| ... | ... | @@ -60,10 +60,11 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 60 | 60 | let arg_tys = sig.inputs(); |
| 61 | 61 | |
| 62 | 62 | if name == sym::simd_select_bitmask { |
| 63 | require_simd!( | |
| 64 | arg_tys[1], | |
| 65 | InvalidMonomorphization::SimdArgument { span, name, ty: arg_tys[1] } | |
| 66 | ); | |
| 63 | require_simd!(arg_tys[1], InvalidMonomorphization::SimdArgument { | |
| 64 | span, | |
| 65 | name, | |
| 66 | ty: arg_tys[1] | |
| 67 | }); | |
| 67 | 68 | let (len, _) = arg_tys[1].simd_size_and_type(bx.tcx()); |
| 68 | 69 | |
| 69 | 70 | let expected_int_bits = (len.max(8) - 1).next_power_of_two(); |
| ... | ... | @@ -135,17 +136,14 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 135 | 136 | require_simd!(ret_ty, InvalidMonomorphization::SimdReturn { span, name, ty: ret_ty }); |
| 136 | 137 | |
| 137 | 138 | let (out_len, out_ty) = ret_ty.simd_size_and_type(bx.tcx()); |
| 138 | require!( | |
| 139 | in_len == out_len, | |
| 140 | InvalidMonomorphization::ReturnLengthInputType { | |
| 141 | span, | |
| 142 | name, | |
| 143 | in_len, | |
| 144 | in_ty, | |
| 145 | ret_ty, | |
| 146 | out_len | |
| 147 | } | |
| 148 | ); | |
| 139 | require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { | |
| 140 | span, | |
| 141 | name, | |
| 142 | in_len, | |
| 143 | in_ty, | |
| 144 | ret_ty, | |
| 145 | out_len | |
| 146 | }); | |
| 149 | 147 | require!( |
| 150 | 148 | bx.type_kind(bx.element_type(llret_ty)) == TypeKind::Integer, |
| 151 | 149 | InvalidMonomorphization::ReturnIntegerType { span, name, ret_ty, out_ty } |
| ... | ... | @@ -251,17 +249,23 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 251 | 249 | let lo_nibble = |
| 252 | 250 | bx.context.new_rvalue_from_vector(None, long_byte_vector_type, &lo_nibble_elements); |
| 253 | 251 | |
| 254 | let mask = bx.context.new_rvalue_from_vector( | |
| 255 | None, | |
| 256 | long_byte_vector_type, | |
| 257 | &vec![bx.context.new_rvalue_from_int(bx.u8_type, 0x0f); byte_vector_type_size as _], | |
| 258 | ); | |
| 259 | ||
| 260 | let four_vec = bx.context.new_rvalue_from_vector( | |
| 261 | None, | |
| 262 | long_byte_vector_type, | |
| 263 | &vec![bx.context.new_rvalue_from_int(bx.u8_type, 4); byte_vector_type_size as _], | |
| 264 | ); | |
| 252 | let mask = bx.context.new_rvalue_from_vector(None, long_byte_vector_type, &vec![ | |
| 253 | bx.context | |
| 254 | .new_rvalue_from_int( | |
| 255 | bx.u8_type, 0x0f | |
| 256 | ); | |
| 257 | byte_vector_type_size | |
| 258 | as _ | |
| 259 | ]); | |
| 260 | ||
| 261 | let four_vec = bx.context.new_rvalue_from_vector(None, long_byte_vector_type, &vec![ | |
| 262 | bx.context | |
| 263 | .new_rvalue_from_int( | |
| 264 | bx.u8_type, 4 | |
| 265 | ); | |
| 266 | byte_vector_type_size | |
| 267 | as _ | |
| 268 | ]); | |
| 265 | 269 | |
| 266 | 270 | // Step 2: Byte-swap the input. |
| 267 | 271 | let swapped = simd_bswap(bx, args[0].immediate()); |
| ... | ... | @@ -364,14 +368,21 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 364 | 368 | require_simd!(ret_ty, InvalidMonomorphization::SimdReturn { span, name, ty: ret_ty }); |
| 365 | 369 | |
| 366 | 370 | let (out_len, out_ty) = ret_ty.simd_size_and_type(bx.tcx()); |
| 367 | require!( | |
| 368 | out_len == n, | |
| 369 | InvalidMonomorphization::ReturnLength { span, name, in_len: n, ret_ty, out_len } | |
| 370 | ); | |
| 371 | require!( | |
| 372 | in_elem == out_ty, | |
| 373 | InvalidMonomorphization::ReturnElement { span, name, in_elem, in_ty, ret_ty, out_ty } | |
| 374 | ); | |
| 371 | require!(out_len == n, InvalidMonomorphization::ReturnLength { | |
| 372 | span, | |
| 373 | name, | |
| 374 | in_len: n, | |
| 375 | ret_ty, | |
| 376 | out_len | |
| 377 | }); | |
| 378 | require!(in_elem == out_ty, InvalidMonomorphization::ReturnElement { | |
| 379 | span, | |
| 380 | name, | |
| 381 | in_elem, | |
| 382 | in_ty, | |
| 383 | ret_ty, | |
| 384 | out_ty | |
| 385 | }); | |
| 375 | 386 | |
| 376 | 387 | let vector = args[2].immediate(); |
| 377 | 388 | |
| ... | ... | @@ -380,16 +391,13 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 380 | 391 | |
| 381 | 392 | #[cfg(feature = "master")] |
| 382 | 393 | if name == sym::simd_insert { |
| 383 | require!( | |
| 384 | in_elem == arg_tys[2], | |
| 385 | InvalidMonomorphization::InsertedType { | |
| 386 | span, | |
| 387 | name, | |
| 388 | in_elem, | |
| 389 | in_ty, | |
| 390 | out_ty: arg_tys[2] | |
| 391 | } | |
| 392 | ); | |
| 394 | require!(in_elem == arg_tys[2], InvalidMonomorphization::InsertedType { | |
| 395 | span, | |
| 396 | name, | |
| 397 | in_elem, | |
| 398 | in_ty, | |
| 399 | out_ty: arg_tys[2] | |
| 400 | }); | |
| 393 | 401 | let vector = args[0].immediate(); |
| 394 | 402 | let index = args[1].immediate(); |
| 395 | 403 | let value = args[2].immediate(); |
| ... | ... | @@ -403,10 +411,13 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 403 | 411 | |
| 404 | 412 | #[cfg(feature = "master")] |
| 405 | 413 | if name == sym::simd_extract { |
| 406 | require!( | |
| 407 | ret_ty == in_elem, | |
| 408 | InvalidMonomorphization::ReturnType { span, name, in_elem, in_ty, ret_ty } | |
| 409 | ); | |
| 414 | require!(ret_ty == in_elem, InvalidMonomorphization::ReturnType { | |
| 415 | span, | |
| 416 | name, | |
| 417 | in_elem, | |
| 418 | in_ty, | |
| 419 | ret_ty | |
| 420 | }); | |
| 410 | 421 | let vector = args[0].immediate(); |
| 411 | 422 | return Ok(bx.context.new_vector_access(None, vector, args[1].immediate()).to_rvalue()); |
| 412 | 423 | } |
| ... | ... | @@ -414,15 +425,18 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 414 | 425 | if name == sym::simd_select { |
| 415 | 426 | let m_elem_ty = in_elem; |
| 416 | 427 | let m_len = in_len; |
| 417 | require_simd!( | |
| 418 | arg_tys[1], | |
| 419 | InvalidMonomorphization::SimdArgument { span, name, ty: arg_tys[1] } | |
| 420 | ); | |
| 428 | require_simd!(arg_tys[1], InvalidMonomorphization::SimdArgument { | |
| 429 | span, | |
| 430 | name, | |
| 431 | ty: arg_tys[1] | |
| 432 | }); | |
| 421 | 433 | let (v_len, _) = arg_tys[1].simd_size_and_type(bx.tcx()); |
| 422 | require!( | |
| 423 | m_len == v_len, | |
| 424 | InvalidMonomorphization::MismatchedLengths { span, name, m_len, v_len } | |
| 425 | ); | |
| 434 | require!(m_len == v_len, InvalidMonomorphization::MismatchedLengths { | |
| 435 | span, | |
| 436 | name, | |
| 437 | m_len, | |
| 438 | v_len | |
| 439 | }); | |
| 426 | 440 | match *m_elem_ty.kind() { |
| 427 | 441 | ty::Int(_) => {} |
| 428 | 442 | _ => return_error!(InvalidMonomorphization::MaskType { span, name, ty: m_elem_ty }), |
| ... | ... | @@ -434,27 +448,25 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 434 | 448 | require_simd!(ret_ty, InvalidMonomorphization::SimdReturn { span, name, ty: ret_ty }); |
| 435 | 449 | let (out_len, out_elem) = ret_ty.simd_size_and_type(bx.tcx()); |
| 436 | 450 | |
| 437 | require!( | |
| 438 | in_len == out_len, | |
| 439 | InvalidMonomorphization::ReturnLengthInputType { | |
| 440 | span, | |
| 441 | name, | |
| 442 | in_len, | |
| 443 | in_ty, | |
| 444 | ret_ty, | |
| 445 | out_len | |
| 446 | } | |
| 447 | ); | |
| 451 | require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { | |
| 452 | span, | |
| 453 | name, | |
| 454 | in_len, | |
| 455 | in_ty, | |
| 456 | ret_ty, | |
| 457 | out_len | |
| 458 | }); | |
| 448 | 459 | |
| 449 | 460 | match *in_elem.kind() { |
| 450 | 461 | ty::RawPtr(p_ty, _) => { |
| 451 | 462 | let metadata = p_ty.ptr_metadata_ty(bx.tcx, |ty| { |
| 452 | 463 | bx.tcx.normalize_erasing_regions(ty::ParamEnv::reveal_all(), ty) |
| 453 | 464 | }); |
| 454 | require!( | |
| 455 | metadata.is_unit(), | |
| 456 | InvalidMonomorphization::CastFatPointer { span, name, ty: in_elem } | |
| 457 | ); | |
| 465 | require!(metadata.is_unit(), InvalidMonomorphization::CastFatPointer { | |
| 466 | span, | |
| 467 | name, | |
| 468 | ty: in_elem | |
| 469 | }); | |
| 458 | 470 | } |
| 459 | 471 | _ => { |
| 460 | 472 | return_error!(InvalidMonomorphization::ExpectedPointer { span, name, ty: in_elem }) |
| ... | ... | @@ -465,10 +477,11 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 465 | 477 | let metadata = p_ty.ptr_metadata_ty(bx.tcx, |ty| { |
| 466 | 478 | bx.tcx.normalize_erasing_regions(ty::ParamEnv::reveal_all(), ty) |
| 467 | 479 | }); |
| 468 | require!( | |
| 469 | metadata.is_unit(), | |
| 470 | InvalidMonomorphization::CastFatPointer { span, name, ty: out_elem } | |
| 471 | ); | |
| 480 | require!(metadata.is_unit(), InvalidMonomorphization::CastFatPointer { | |
| 481 | span, | |
| 482 | name, | |
| 483 | ty: out_elem | |
| 484 | }); | |
| 472 | 485 | } |
| 473 | 486 | _ => { |
| 474 | 487 | return_error!(InvalidMonomorphization::ExpectedPointer { span, name, ty: out_elem }) |
| ... | ... | @@ -491,17 +504,14 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 491 | 504 | require_simd!(ret_ty, InvalidMonomorphization::SimdReturn { span, name, ty: ret_ty }); |
| 492 | 505 | let (out_len, out_elem) = ret_ty.simd_size_and_type(bx.tcx()); |
| 493 | 506 | |
| 494 | require!( | |
| 495 | in_len == out_len, | |
| 496 | InvalidMonomorphization::ReturnLengthInputType { | |
| 497 | span, | |
| 498 | name, | |
| 499 | in_len, | |
| 500 | in_ty, | |
| 501 | ret_ty, | |
| 502 | out_len | |
| 503 | } | |
| 504 | ); | |
| 507 | require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { | |
| 508 | span, | |
| 509 | name, | |
| 510 | in_len, | |
| 511 | in_ty, | |
| 512 | ret_ty, | |
| 513 | out_len | |
| 514 | }); | |
| 505 | 515 | |
| 506 | 516 | match *in_elem.kind() { |
| 507 | 517 | ty::RawPtr(_, _) => {} |
| ... | ... | @@ -530,17 +540,14 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 530 | 540 | require_simd!(ret_ty, InvalidMonomorphization::SimdReturn { span, name, ty: ret_ty }); |
| 531 | 541 | let (out_len, out_elem) = ret_ty.simd_size_and_type(bx.tcx()); |
| 532 | 542 | |
| 533 | require!( | |
| 534 | in_len == out_len, | |
| 535 | InvalidMonomorphization::ReturnLengthInputType { | |
| 536 | span, | |
| 537 | name, | |
| 538 | in_len, | |
| 539 | in_ty, | |
| 540 | ret_ty, | |
| 541 | out_len | |
| 542 | } | |
| 543 | ); | |
| 543 | require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { | |
| 544 | span, | |
| 545 | name, | |
| 546 | in_len, | |
| 547 | in_ty, | |
| 548 | ret_ty, | |
| 549 | out_len | |
| 550 | }); | |
| 544 | 551 | |
| 545 | 552 | match *in_elem.kind() { |
| 546 | 553 | ty::Uint(ty::UintTy::Usize) => {} |
| ... | ... | @@ -569,17 +576,14 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 569 | 576 | if name == sym::simd_cast || name == sym::simd_as { |
| 570 | 577 | require_simd!(ret_ty, InvalidMonomorphization::SimdReturn { span, name, ty: ret_ty }); |
| 571 | 578 | let (out_len, out_elem) = ret_ty.simd_size_and_type(bx.tcx()); |
| 572 | require!( | |
| 573 | in_len == out_len, | |
| 574 | InvalidMonomorphization::ReturnLengthInputType { | |
| 575 | span, | |
| 576 | name, | |
| 577 | in_len, | |
| 578 | in_ty, | |
| 579 | ret_ty, | |
| 580 | out_len | |
| 581 | } | |
| 582 | ); | |
| 579 | require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { | |
| 580 | span, | |
| 581 | name, | |
| 582 | in_len, | |
| 583 | in_ty, | |
| 584 | ret_ty, | |
| 585 | out_len | |
| 586 | }); | |
| 583 | 587 | // casting cares about nominal type, not just structural type |
| 584 | 588 | if in_elem == out_elem { |
| 585 | 589 | return Ok(args[0].immediate()); |
| ... | ... | @@ -605,17 +609,14 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 605 | 609 | |
| 606 | 610 | match (in_style, out_style) { |
| 607 | 611 | (Style::Unsupported, Style::Unsupported) => { |
| 608 | require!( | |
| 609 | false, | |
| 610 | InvalidMonomorphization::UnsupportedCast { | |
| 611 | span, | |
| 612 | name, | |
| 613 | in_ty, | |
| 614 | in_elem, | |
| 615 | ret_ty, | |
| 616 | out_elem | |
| 617 | } | |
| 618 | ); | |
| 612 | require!(false, InvalidMonomorphization::UnsupportedCast { | |
| 613 | span, | |
| 614 | name, | |
| 615 | in_ty, | |
| 616 | in_elem, | |
| 617 | ret_ty, | |
| 618 | out_elem | |
| 619 | }); | |
| 619 | 620 | } |
| 620 | 621 | _ => return Ok(bx.context.convert_vector(None, args[0].immediate(), llret_ty)), |
| 621 | 622 | } |
| ... | ... | @@ -880,47 +881,45 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 880 | 881 | |
| 881 | 882 | // All types must be simd vector types |
| 882 | 883 | require_simd!(in_ty, InvalidMonomorphization::SimdFirst { span, name, ty: in_ty }); |
| 883 | require_simd!( | |
| 884 | arg_tys[1], | |
| 885 | InvalidMonomorphization::SimdSecond { span, name, ty: arg_tys[1] } | |
| 886 | ); | |
| 887 | require_simd!( | |
| 888 | arg_tys[2], | |
| 889 | InvalidMonomorphization::SimdThird { span, name, ty: arg_tys[2] } | |
| 890 | ); | |
| 884 | require_simd!(arg_tys[1], InvalidMonomorphization::SimdSecond { | |
| 885 | span, | |
| 886 | name, | |
| 887 | ty: arg_tys[1] | |
| 888 | }); | |
| 889 | require_simd!(arg_tys[2], InvalidMonomorphization::SimdThird { | |
| 890 | span, | |
| 891 | name, | |
| 892 | ty: arg_tys[2] | |
| 893 | }); | |
| 891 | 894 | require_simd!(ret_ty, InvalidMonomorphization::SimdReturn { span, name, ty: ret_ty }); |
| 892 | 895 | |
| 893 | 896 | // Of the same length: |
| 894 | 897 | let (out_len, _) = arg_tys[1].simd_size_and_type(bx.tcx()); |
| 895 | 898 | let (out_len2, _) = arg_tys[2].simd_size_and_type(bx.tcx()); |
| 896 | require!( | |
| 897 | in_len == out_len, | |
| 898 | InvalidMonomorphization::SecondArgumentLength { | |
| 899 | span, | |
| 900 | name, | |
| 901 | in_len, | |
| 902 | in_ty, | |
| 903 | arg_ty: arg_tys[1], | |
| 904 | out_len | |
| 905 | } | |
| 906 | ); | |
| 907 | require!( | |
| 908 | in_len == out_len2, | |
| 909 | InvalidMonomorphization::ThirdArgumentLength { | |
| 910 | span, | |
| 911 | name, | |
| 912 | in_len, | |
| 913 | in_ty, | |
| 914 | arg_ty: arg_tys[2], | |
| 915 | out_len: out_len2 | |
| 916 | } | |
| 917 | ); | |
| 899 | require!(in_len == out_len, InvalidMonomorphization::SecondArgumentLength { | |
| 900 | span, | |
| 901 | name, | |
| 902 | in_len, | |
| 903 | in_ty, | |
| 904 | arg_ty: arg_tys[1], | |
| 905 | out_len | |
| 906 | }); | |
| 907 | require!(in_len == out_len2, InvalidMonomorphization::ThirdArgumentLength { | |
| 908 | span, | |
| 909 | name, | |
| 910 | in_len, | |
| 911 | in_ty, | |
| 912 | arg_ty: arg_tys[2], | |
| 913 | out_len: out_len2 | |
| 914 | }); | |
| 918 | 915 | |
| 919 | 916 | // The return type must match the first argument type |
| 920 | require!( | |
| 921 | ret_ty == in_ty, | |
| 922 | InvalidMonomorphization::ExpectedReturnType { span, name, in_ty, ret_ty } | |
| 923 | ); | |
| 917 | require!(ret_ty == in_ty, InvalidMonomorphization::ExpectedReturnType { | |
| 918 | span, | |
| 919 | name, | |
| 920 | in_ty, | |
| 921 | ret_ty | |
| 922 | }); | |
| 924 | 923 | |
| 925 | 924 | // This counts how many pointers |
| 926 | 925 | fn ptr_count(t: Ty<'_>) -> usize { |
| ... | ... | @@ -947,18 +946,15 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 947 | 946 | (ptr_count(element_ty1), non_ptr(element_ty1)) |
| 948 | 947 | } |
| 949 | 948 | _ => { |
| 950 | require!( | |
| 951 | false, | |
| 952 | InvalidMonomorphization::ExpectedElementType { | |
| 953 | span, | |
| 954 | name, | |
| 955 | expected_element: element_ty1, | |
| 956 | second_arg: arg_tys[1], | |
| 957 | in_elem, | |
| 958 | in_ty, | |
| 959 | mutability: ExpectedPointerMutability::Not, | |
| 960 | } | |
| 961 | ); | |
| 949 | require!(false, InvalidMonomorphization::ExpectedElementType { | |
| 950 | span, | |
| 951 | name, | |
| 952 | expected_element: element_ty1, | |
| 953 | second_arg: arg_tys[1], | |
| 954 | in_elem, | |
| 955 | in_ty, | |
| 956 | mutability: ExpectedPointerMutability::Not, | |
| 957 | }); | |
| 962 | 958 | unreachable!(); |
| 963 | 959 | } |
| 964 | 960 | }; |
| ... | ... | @@ -971,15 +967,12 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 971 | 967 | match *element_ty2.kind() { |
| 972 | 968 | ty::Int(_) => (), |
| 973 | 969 | _ => { |
| 974 | require!( | |
| 975 | false, | |
| 976 | InvalidMonomorphization::ThirdArgElementType { | |
| 977 | span, | |
| 978 | name, | |
| 979 | expected_element: element_ty2, | |
| 980 | third_arg: arg_tys[2] | |
| 981 | } | |
| 982 | ); | |
| 970 | require!(false, InvalidMonomorphization::ThirdArgElementType { | |
| 971 | span, | |
| 972 | name, | |
| 973 | expected_element: element_ty2, | |
| 974 | third_arg: arg_tys[2] | |
| 975 | }); | |
| 983 | 976 | } |
| 984 | 977 | } |
| 985 | 978 | |
| ... | ... | @@ -1003,40 +996,36 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 1003 | 996 | |
| 1004 | 997 | // All types must be simd vector types |
| 1005 | 998 | require_simd!(in_ty, InvalidMonomorphization::SimdFirst { span, name, ty: in_ty }); |
| 1006 | require_simd!( | |
| 1007 | arg_tys[1], | |
| 1008 | InvalidMonomorphization::SimdSecond { span, name, ty: arg_tys[1] } | |
| 1009 | ); | |
| 1010 | require_simd!( | |
| 1011 | arg_tys[2], | |
| 1012 | InvalidMonomorphization::SimdThird { span, name, ty: arg_tys[2] } | |
| 1013 | ); | |
| 999 | require_simd!(arg_tys[1], InvalidMonomorphization::SimdSecond { | |
| 1000 | span, | |
| 1001 | name, | |
| 1002 | ty: arg_tys[1] | |
| 1003 | }); | |
| 1004 | require_simd!(arg_tys[2], InvalidMonomorphization::SimdThird { | |
| 1005 | span, | |
| 1006 | name, | |
| 1007 | ty: arg_tys[2] | |
| 1008 | }); | |
| 1014 | 1009 | |
| 1015 | 1010 | // Of the same length: |
| 1016 | 1011 | let (element_len1, _) = arg_tys[1].simd_size_and_type(bx.tcx()); |
| 1017 | 1012 | let (element_len2, _) = arg_tys[2].simd_size_and_type(bx.tcx()); |
| 1018 | require!( | |
| 1019 | in_len == element_len1, | |
| 1020 | InvalidMonomorphization::SecondArgumentLength { | |
| 1021 | span, | |
| 1022 | name, | |
| 1023 | in_len, | |
| 1024 | in_ty, | |
| 1025 | arg_ty: arg_tys[1], | |
| 1026 | out_len: element_len1 | |
| 1027 | } | |
| 1028 | ); | |
| 1029 | require!( | |
| 1030 | in_len == element_len2, | |
| 1031 | InvalidMonomorphization::ThirdArgumentLength { | |
| 1032 | span, | |
| 1033 | name, | |
| 1034 | in_len, | |
| 1035 | in_ty, | |
| 1036 | arg_ty: arg_tys[2], | |
| 1037 | out_len: element_len2 | |
| 1038 | } | |
| 1039 | ); | |
| 1013 | require!(in_len == element_len1, InvalidMonomorphization::SecondArgumentLength { | |
| 1014 | span, | |
| 1015 | name, | |
| 1016 | in_len, | |
| 1017 | in_ty, | |
| 1018 | arg_ty: arg_tys[1], | |
| 1019 | out_len: element_len1 | |
| 1020 | }); | |
| 1021 | require!(in_len == element_len2, InvalidMonomorphization::ThirdArgumentLength { | |
| 1022 | span, | |
| 1023 | name, | |
| 1024 | in_len, | |
| 1025 | in_ty, | |
| 1026 | arg_ty: arg_tys[2], | |
| 1027 | out_len: element_len2 | |
| 1028 | }); | |
| 1040 | 1029 | |
| 1041 | 1030 | // This counts how many pointers |
| 1042 | 1031 | fn ptr_count(t: Ty<'_>) -> usize { |
| ... | ... | @@ -1064,18 +1053,15 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 1064 | 1053 | (ptr_count(element_ty1), non_ptr(element_ty1)) |
| 1065 | 1054 | } |
| 1066 | 1055 | _ => { |
| 1067 | require!( | |
| 1068 | false, | |
| 1069 | InvalidMonomorphization::ExpectedElementType { | |
| 1070 | span, | |
| 1071 | name, | |
| 1072 | expected_element: element_ty1, | |
| 1073 | second_arg: arg_tys[1], | |
| 1074 | in_elem, | |
| 1075 | in_ty, | |
| 1076 | mutability: ExpectedPointerMutability::Mut, | |
| 1077 | } | |
| 1078 | ); | |
| 1056 | require!(false, InvalidMonomorphization::ExpectedElementType { | |
| 1057 | span, | |
| 1058 | name, | |
| 1059 | expected_element: element_ty1, | |
| 1060 | second_arg: arg_tys[1], | |
| 1061 | in_elem, | |
| 1062 | in_ty, | |
| 1063 | mutability: ExpectedPointerMutability::Mut, | |
| 1064 | }); | |
| 1079 | 1065 | unreachable!(); |
| 1080 | 1066 | } |
| 1081 | 1067 | }; |
| ... | ... | @@ -1087,15 +1073,12 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 1087 | 1073 | match *element_ty2.kind() { |
| 1088 | 1074 | ty::Int(_) => (), |
| 1089 | 1075 | _ => { |
| 1090 | require!( | |
| 1091 | false, | |
| 1092 | InvalidMonomorphization::ThirdArgElementType { | |
| 1093 | span, | |
| 1094 | name, | |
| 1095 | expected_element: element_ty2, | |
| 1096 | third_arg: arg_tys[2] | |
| 1097 | } | |
| 1098 | ); | |
| 1076 | require!(false, InvalidMonomorphization::ThirdArgElementType { | |
| 1077 | span, | |
| 1078 | name, | |
| 1079 | expected_element: element_ty2, | |
| 1080 | third_arg: arg_tys[2] | |
| 1081 | }); | |
| 1099 | 1082 | } |
| 1100 | 1083 | } |
| 1101 | 1084 | |
| ... | ... | @@ -1262,10 +1245,13 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 1262 | 1245 | ($name:ident : $vec_op:expr, $float_reduce:ident, $ordered:expr, $op:ident, |
| 1263 | 1246 | $identity:expr) => { |
| 1264 | 1247 | if name == sym::$name { |
| 1265 | require!( | |
| 1266 | ret_ty == in_elem, | |
| 1267 | InvalidMonomorphization::ReturnType { span, name, in_elem, in_ty, ret_ty } | |
| 1268 | ); | |
| 1248 | require!(ret_ty == in_elem, InvalidMonomorphization::ReturnType { | |
| 1249 | span, | |
| 1250 | name, | |
| 1251 | in_elem, | |
| 1252 | in_ty, | |
| 1253 | ret_ty | |
| 1254 | }); | |
| 1269 | 1255 | return match *in_elem.kind() { |
| 1270 | 1256 | ty::Int(_) | ty::Uint(_) => { |
| 1271 | 1257 | let r = bx.vector_reduce_op(args[0].immediate(), $vec_op); |
| ... | ... | @@ -1331,10 +1317,13 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 1331 | 1317 | macro_rules! minmax_red { |
| 1332 | 1318 | ($name:ident: $int_red:ident, $float_red:ident) => { |
| 1333 | 1319 | if name == sym::$name { |
| 1334 | require!( | |
| 1335 | ret_ty == in_elem, | |
| 1336 | InvalidMonomorphization::ReturnType { span, name, in_elem, in_ty, ret_ty } | |
| 1337 | ); | |
| 1320 | require!(ret_ty == in_elem, InvalidMonomorphization::ReturnType { | |
| 1321 | span, | |
| 1322 | name, | |
| 1323 | in_elem, | |
| 1324 | in_ty, | |
| 1325 | ret_ty | |
| 1326 | }); | |
| 1338 | 1327 | return match *in_elem.kind() { |
| 1339 | 1328 | ty::Int(_) | ty::Uint(_) => Ok(bx.$int_red(args[0].immediate())), |
| 1340 | 1329 | ty::Float(_) => Ok(bx.$float_red(args[0].immediate())), |
| ... | ... | @@ -1358,10 +1347,13 @@ pub fn generic_simd_intrinsic<'a, 'gcc, 'tcx>( |
| 1358 | 1347 | ($name:ident : $op:expr, $boolean:expr) => { |
| 1359 | 1348 | if name == sym::$name { |
| 1360 | 1349 | let input = if !$boolean { |
| 1361 | require!( | |
| 1362 | ret_ty == in_elem, | |
| 1363 | InvalidMonomorphization::ReturnType { span, name, in_elem, in_ty, ret_ty } | |
| 1364 | ); | |
| 1350 | require!(ret_ty == in_elem, InvalidMonomorphization::ReturnType { | |
| 1351 | span, | |
| 1352 | name, | |
| 1353 | in_elem, | |
| 1354 | in_ty, | |
| 1355 | ret_ty | |
| 1356 | }); | |
| 1365 | 1357 | args[0].immediate() |
| 1366 | 1358 | } else { |
| 1367 | 1359 | match *in_elem.kind() { |
compiler/rustc_codegen_gcc/src/lib.rs+2-2| ... | ... | @@ -107,10 +107,10 @@ use rustc_metadata::EncodedMetadata; |
| 107 | 107 | use rustc_middle::dep_graph::{WorkProduct, WorkProductId}; |
| 108 | 108 | use rustc_middle::ty::TyCtxt; |
| 109 | 109 | use rustc_middle::util::Providers; |
| 110 | use rustc_session::config::{Lto, OptLevel, OutputFilenames}; | |
| 111 | 110 | use rustc_session::Session; |
| 112 | use rustc_span::fatal_error::FatalError; | |
| 111 | use rustc_session::config::{Lto, OptLevel, OutputFilenames}; | |
| 113 | 112 | use rustc_span::Symbol; |
| 113 | use rustc_span::fatal_error::FatalError; | |
| 114 | 114 | use tempfile::TempDir; |
| 115 | 115 | |
| 116 | 116 | use crate::back::lto::ModuleBuffer; |
compiler/rustc_codegen_llvm/src/abi.rs+18-26| ... | ... | @@ -1,19 +1,19 @@ |
| 1 | 1 | use std::cmp; |
| 2 | 2 | |
| 3 | 3 | use libc::c_uint; |
| 4 | use rustc_codegen_ssa::MemFlags; | |
| 4 | 5 | use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue}; |
| 5 | 6 | use rustc_codegen_ssa::mir::place::{PlaceRef, PlaceValue}; |
| 6 | 7 | use rustc_codegen_ssa::traits::*; |
| 7 | use rustc_codegen_ssa::MemFlags; | |
| 8 | use rustc_middle::ty::Ty; | |
| 8 | 9 | use rustc_middle::ty::layout::LayoutOf; |
| 9 | 10 | pub(crate) use rustc_middle::ty::layout::{FAT_PTR_ADDR, FAT_PTR_EXTRA}; |
| 10 | use rustc_middle::ty::Ty; | |
| 11 | 11 | use rustc_middle::{bug, ty}; |
| 12 | 12 | use rustc_session::config; |
| 13 | 13 | pub(crate) use rustc_target::abi::call::*; |
| 14 | 14 | use rustc_target::abi::{self, HasDataLayout, Int, Size}; |
| 15 | pub(crate) use rustc_target::spec::abi::Abi; | |
| 16 | 15 | use rustc_target::spec::SanitizerSet; |
| 16 | pub(crate) use rustc_target::spec::abi::Abi; | |
| 17 | 17 | use smallvec::SmallVec; |
| 18 | 18 | |
| 19 | 19 | use crate::attributes::llfn_attrs_from_instance; |
| ... | ... | @@ -445,11 +445,11 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> { |
| 445 | 445 | // LLVM also rejects full range. |
| 446 | 446 | && !scalar.is_always_valid(cx) |
| 447 | 447 | { |
| 448 | attributes::apply_to_llfn( | |
| 449 | llfn, | |
| 450 | idx, | |
| 451 | &[llvm::CreateRangeAttr(cx.llcx, scalar.size(cx), scalar.valid_range(cx))], | |
| 452 | ); | |
| 448 | attributes::apply_to_llfn(llfn, idx, &[llvm::CreateRangeAttr( | |
| 449 | cx.llcx, | |
| 450 | scalar.size(cx), | |
| 451 | scalar.valid_range(cx), | |
| 452 | )]); | |
| 453 | 453 | } |
| 454 | 454 | }; |
| 455 | 455 | |
| ... | ... | @@ -469,14 +469,10 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> { |
| 469 | 469 | ); |
| 470 | 470 | attributes::apply_to_llfn(llfn, llvm::AttributePlace::Argument(i), &[sret]); |
| 471 | 471 | if cx.sess().opts.optimize != config::OptLevel::No { |
| 472 | attributes::apply_to_llfn( | |
| 473 | llfn, | |
| 474 | llvm::AttributePlace::Argument(i), | |
| 475 | &[ | |
| 476 | llvm::AttributeKind::Writable.create_attr(cx.llcx), | |
| 477 | llvm::AttributeKind::DeadOnUnwind.create_attr(cx.llcx), | |
| 478 | ], | |
| 479 | ); | |
| 472 | attributes::apply_to_llfn(llfn, llvm::AttributePlace::Argument(i), &[ | |
| 473 | llvm::AttributeKind::Writable.create_attr(cx.llcx), | |
| 474 | llvm::AttributeKind::DeadOnUnwind.create_attr(cx.llcx), | |
| 475 | ]); | |
| 480 | 476 | } |
| 481 | 477 | } |
| 482 | 478 | PassMode::Cast { cast, pad_i32: _ } => { |
| ... | ... | @@ -592,11 +588,9 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> { |
| 592 | 588 | bx.cx.llcx, |
| 593 | 589 | bx.cx.type_array(bx.cx.type_i8(), arg.layout.size.bytes()), |
| 594 | 590 | ); |
| 595 | attributes::apply_to_callsite( | |
| 596 | callsite, | |
| 597 | llvm::AttributePlace::Argument(i), | |
| 598 | &[byval], | |
| 599 | ); | |
| 591 | attributes::apply_to_callsite(callsite, llvm::AttributePlace::Argument(i), &[ | |
| 592 | byval, | |
| 593 | ]); | |
| 600 | 594 | } |
| 601 | 595 | PassMode::Direct(attrs) |
| 602 | 596 | | PassMode::Indirect { attrs, meta_attrs: None, on_stack: false } => { |
| ... | ... | @@ -628,11 +622,9 @@ impl<'ll, 'tcx> FnAbiLlvmExt<'ll, 'tcx> for FnAbi<'tcx, Ty<'tcx>> { |
| 628 | 622 | // This will probably get ignored on all targets but those supporting the TrustZone-M |
| 629 | 623 | // extension (thumbv8m targets). |
| 630 | 624 | let cmse_nonsecure_call = llvm::CreateAttrString(bx.cx.llcx, "cmse_nonsecure_call"); |
| 631 | attributes::apply_to_callsite( | |
| 632 | callsite, | |
| 633 | llvm::AttributePlace::Function, | |
| 634 | &[cmse_nonsecure_call], | |
| 635 | ); | |
| 625 | attributes::apply_to_callsite(callsite, llvm::AttributePlace::Function, &[ | |
| 626 | cmse_nonsecure_call, | |
| 627 | ]); | |
| 636 | 628 | } |
| 637 | 629 | |
| 638 | 630 | // Some intrinsics require that an elementtype attribute (with the pointee type of a |
compiler/rustc_codegen_llvm/src/allocator.rs+3-3| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | 1 | use libc::c_uint; |
| 2 | 2 | use rustc_ast::expand::allocator::{ |
| 3 | alloc_error_handler_name, default_fn_name, global_fn_name, AllocatorKind, AllocatorTy, | |
| 4 | ALLOCATOR_METHODS, NO_ALLOC_SHIM_IS_UNSTABLE, | |
| 3 | ALLOCATOR_METHODS, AllocatorKind, AllocatorTy, NO_ALLOC_SHIM_IS_UNSTABLE, | |
| 4 | alloc_error_handler_name, default_fn_name, global_fn_name, | |
| 5 | 5 | }; |
| 6 | 6 | use rustc_middle::bug; |
| 7 | 7 | use rustc_middle::ty::TyCtxt; |
| 8 | 8 | use rustc_session::config::{DebugInfo, OomStrategy}; |
| 9 | 9 | |
| 10 | 10 | use crate::llvm::{self, Context, False, Module, True, Type}; |
| 11 | use crate::{attributes, debuginfo, ModuleLlvm}; | |
| 11 | use crate::{ModuleLlvm, attributes, debuginfo}; | |
| 12 | 12 | |
| 13 | 13 | pub(crate) unsafe fn codegen( |
| 14 | 14 | tcx: TyCtxt<'_>, |
compiler/rustc_codegen_llvm/src/asm.rs+2-2| ... | ... | @@ -5,10 +5,10 @@ use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece}; |
| 5 | 5 | use rustc_codegen_ssa::mir::operand::OperandValue; |
| 6 | 6 | use rustc_codegen_ssa::traits::*; |
| 7 | 7 | use rustc_data_structures::fx::FxHashMap; |
| 8 | use rustc_middle::ty::layout::TyAndLayout; | |
| 9 | 8 | use rustc_middle::ty::Instance; |
| 9 | use rustc_middle::ty::layout::TyAndLayout; | |
| 10 | 10 | use rustc_middle::{bug, span_bug}; |
| 11 | use rustc_span::{sym, Pos, Span, Symbol}; | |
| 11 | use rustc_span::{Pos, Span, Symbol, sym}; | |
| 12 | 12 | use rustc_target::abi::*; |
| 13 | 13 | use rustc_target::asm::*; |
| 14 | 14 | use smallvec::SmallVec; |
compiler/rustc_codegen_llvm/src/back/archive.rs+3-3| ... | ... | @@ -1,12 +1,12 @@ |
| 1 | 1 | //! A helper class for dealing with static archives |
| 2 | 2 | |
| 3 | use std::ffi::{c_char, c_void, CStr, CString}; | |
| 3 | use std::ffi::{CStr, CString, c_char, c_void}; | |
| 4 | 4 | use std::path::{Path, PathBuf}; |
| 5 | 5 | use std::{io, mem, ptr, str}; |
| 6 | 6 | |
| 7 | 7 | use rustc_codegen_ssa::back::archive::{ |
| 8 | try_extract_macho_fat_archive, ArArchiveBuilder, ArchiveBuildFailure, ArchiveBuilder, | |
| 9 | ArchiveBuilderBuilder, ObjectReader, UnknownArchiveKind, DEFAULT_OBJECT_READER, | |
| 8 | ArArchiveBuilder, ArchiveBuildFailure, ArchiveBuilder, ArchiveBuilderBuilder, | |
| 9 | DEFAULT_OBJECT_READER, ObjectReader, UnknownArchiveKind, try_extract_macho_fat_archive, | |
| 10 | 10 | }; |
| 11 | 11 | use rustc_session::Session; |
| 12 | 12 |
compiler/rustc_codegen_llvm/src/back/lto.rs+2-2| ... | ... | @@ -11,7 +11,7 @@ use rustc_codegen_ssa::back::lto::{LtoModuleCodegen, SerializedModule, ThinModul |
| 11 | 11 | use rustc_codegen_ssa::back::symbol_export; |
| 12 | 12 | use rustc_codegen_ssa::back::write::{CodegenContext, FatLtoInput, TargetMachineFactoryConfig}; |
| 13 | 13 | use rustc_codegen_ssa::traits::*; |
| 14 | use rustc_codegen_ssa::{looks_like_rust_object_file, ModuleCodegen, ModuleKind}; | |
| 14 | use rustc_codegen_ssa::{ModuleCodegen, ModuleKind, looks_like_rust_object_file}; | |
| 15 | 15 | use rustc_data_structures::fx::FxHashMap; |
| 16 | 16 | use rustc_data_structures::memmap::Mmap; |
| 17 | 17 | use rustc_errors::{DiagCtxtHandle, FatalError}; |
| ... | ... | @@ -23,7 +23,7 @@ use rustc_session::config::{self, CrateType, Lto}; |
| 23 | 23 | use tracing::{debug, info}; |
| 24 | 24 | |
| 25 | 25 | use crate::back::write::{ |
| 26 | self, bitcode_section_name, save_temp_bitcode, CodegenDiagnosticsStage, DiagnosticHandlers, | |
| 26 | self, CodegenDiagnosticsStage, DiagnosticHandlers, bitcode_section_name, save_temp_bitcode, | |
| 27 | 27 | }; |
| 28 | 28 | use crate::errors::{ |
| 29 | 29 | DynamicLinkingWithLTO, LlvmError, LtoBitcodeFromRlib, LtoDisallowed, LtoDylib, LtoProcMacro, |
compiler/rustc_codegen_llvm/src/back/owned_target_machine.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use std::ffi::{c_char, CStr}; | |
| 1 | use std::ffi::{CStr, c_char}; | |
| 2 | 2 | use std::marker::PhantomData; |
| 3 | 3 | use std::ops::Deref; |
| 4 | 4 | use std::ptr::NonNull; |
compiler/rustc_codegen_llvm/src/back/profiling.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use std::ffi::{c_void, CStr}; | |
| 1 | use std::ffi::{CStr, c_void}; | |
| 2 | 2 | use std::os::raw::c_char; |
| 3 | 3 | use std::sync::Arc; |
| 4 | 4 |
compiler/rustc_codegen_llvm/src/back/write.rs+4-4| ... | ... | @@ -20,19 +20,19 @@ use rustc_data_structures::small_c_str::SmallCStr; |
| 20 | 20 | use rustc_errors::{DiagCtxtHandle, FatalError, Level}; |
| 21 | 21 | use rustc_fs_util::{link_or_copy, path_to_c_string}; |
| 22 | 22 | use rustc_middle::ty::TyCtxt; |
| 23 | use rustc_session::Session; | |
| 23 | 24 | use rustc_session::config::{ |
| 24 | 25 | self, Lto, OutputType, Passes, RemapPathScopeComponents, SplitDwarfKind, SwitchWithOptPath, |
| 25 | 26 | }; |
| 26 | use rustc_session::Session; | |
| 27 | use rustc_span::symbol::sym; | |
| 28 | 27 | use rustc_span::InnerSpan; |
| 28 | use rustc_span::symbol::sym; | |
| 29 | 29 | use rustc_target::spec::{CodeModel, RelocModel, SanitizerSet, SplitDebuginfo, TlsModel}; |
| 30 | 30 | use tracing::debug; |
| 31 | 31 | |
| 32 | 32 | use crate::back::lto::ThinBuffer; |
| 33 | 33 | use crate::back::owned_target_machine::OwnedTargetMachine; |
| 34 | 34 | use crate::back::profiling::{ |
| 35 | selfprofile_after_pass_callback, selfprofile_before_pass_callback, LlvmSelfProfiler, | |
| 35 | LlvmSelfProfiler, selfprofile_after_pass_callback, selfprofile_before_pass_callback, | |
| 36 | 36 | }; |
| 37 | 37 | use crate::errors::{ |
| 38 | 38 | CopyBitcode, FromLlvmDiag, FromLlvmOptimizationDiag, LlvmError, UnknownCompression, |
| ... | ... | @@ -41,7 +41,7 @@ use crate::errors::{ |
| 41 | 41 | use crate::llvm::diagnostic::OptimizationDiagnosticKind::*; |
| 42 | 42 | use crate::llvm::{self, DiagnosticInfo, PassManager}; |
| 43 | 43 | use crate::type_::Type; |
| 44 | use crate::{base, common, llvm_util, LlvmCodegenBackend, ModuleLlvm}; | |
| 44 | use crate::{LlvmCodegenBackend, ModuleLlvm, base, common, llvm_util}; | |
| 45 | 45 | |
| 46 | 46 | pub(crate) fn llvm_err<'a>(dcx: DiagCtxtHandle<'_>, err: LlvmError<'a>) -> FatalError { |
| 47 | 47 | match llvm::last_error() { |
compiler/rustc_codegen_llvm/src/builder.rs+1-1| ... | ... | @@ -3,11 +3,11 @@ use std::ops::Deref; |
| 3 | 3 | use std::{iter, ptr}; |
| 4 | 4 | |
| 5 | 5 | use libc::{c_char, c_uint}; |
| 6 | use rustc_codegen_ssa::MemFlags; | |
| 6 | 7 | use rustc_codegen_ssa::common::{IntPredicate, RealPredicate, SynchronizationScope, TypeKind}; |
| 7 | 8 | use rustc_codegen_ssa::mir::operand::{OperandRef, OperandValue}; |
| 8 | 9 | use rustc_codegen_ssa::mir::place::PlaceRef; |
| 9 | 10 | use rustc_codegen_ssa::traits::*; |
| 10 | use rustc_codegen_ssa::MemFlags; | |
| 11 | 11 | use rustc_data_structures::small_c_str::SmallCStr; |
| 12 | 12 | use rustc_hir::def_id::DefId; |
| 13 | 13 | use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs; |
compiler/rustc_codegen_llvm/src/consts.rs+2-2| ... | ... | @@ -6,8 +6,8 @@ use rustc_hir::def::DefKind; |
| 6 | 6 | use rustc_hir::def_id::DefId; |
| 7 | 7 | use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs}; |
| 8 | 8 | use rustc_middle::mir::interpret::{ |
| 9 | read_target_uint, Allocation, ConstAllocation, ErrorHandled, InitChunk, Pointer, | |
| 10 | Scalar as InterpScalar, | |
| 9 | Allocation, ConstAllocation, ErrorHandled, InitChunk, Pointer, Scalar as InterpScalar, | |
| 10 | read_target_uint, | |
| 11 | 11 | }; |
| 12 | 12 | use rustc_middle::mir::mono::MonoItem; |
| 13 | 13 | use rustc_middle::ty::layout::LayoutOf; |
compiler/rustc_codegen_llvm/src/context.rs+3-3| ... | ... | @@ -7,7 +7,7 @@ use libc::c_uint; |
| 7 | 7 | use rustc_codegen_ssa::base::{wants_msvc_seh, wants_wasm_eh}; |
| 8 | 8 | use rustc_codegen_ssa::errors as ssa_errors; |
| 9 | 9 | use rustc_codegen_ssa::traits::*; |
| 10 | use rustc_data_structures::base_n::{ToBaseN, ALPHANUMERIC_ONLY}; | |
| 10 | use rustc_data_structures::base_n::{ALPHANUMERIC_ONLY, ToBaseN}; | |
| 11 | 11 | use rustc_data_structures::fx::FxHashMap; |
| 12 | 12 | use rustc_data_structures::small_c_str::SmallCStr; |
| 13 | 13 | use rustc_hir::def_id::DefId; |
| ... | ... | @@ -18,12 +18,12 @@ use rustc_middle::ty::layout::{ |
| 18 | 18 | }; |
| 19 | 19 | use rustc_middle::ty::{self, Instance, Ty, TyCtxt}; |
| 20 | 20 | use rustc_middle::{bug, span_bug}; |
| 21 | use rustc_session::Session; | |
| 21 | 22 | use rustc_session::config::{ |
| 22 | 23 | BranchProtection, CFGuard, CFProtection, CrateType, DebugInfo, PAuthKey, PacRet, |
| 23 | 24 | }; |
| 24 | use rustc_session::Session; | |
| 25 | 25 | use rustc_span::source_map::Spanned; |
| 26 | use rustc_span::{Span, DUMMY_SP}; | |
| 26 | use rustc_span::{DUMMY_SP, Span}; | |
| 27 | 27 | use rustc_target::abi::{HasDataLayout, TargetDataLayout, VariantIdx}; |
| 28 | 28 | use rustc_target::spec::{HasTargetSpec, RelocModel, SmallDataThresholdSupport, Target, TlsModel}; |
| 29 | 29 | use smallvec::SmallVec; |
compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs+2-2| ... | ... | @@ -5,8 +5,8 @@ use rustc_hir::def_id::{DefId, LocalDefId}; |
| 5 | 5 | use rustc_index::IndexVec; |
| 6 | 6 | use rustc_middle::ty::{self, TyCtxt}; |
| 7 | 7 | use rustc_middle::{bug, mir}; |
| 8 | use rustc_span::def_id::DefIdSet; | |
| 9 | 8 | use rustc_span::Symbol; |
| 9 | use rustc_span::def_id::DefIdSet; | |
| 10 | 10 | use tracing::debug; |
| 11 | 11 | |
| 12 | 12 | use crate::common::CodegenCx; |
| ... | ... | @@ -183,8 +183,8 @@ impl GlobalFileTable { |
| 183 | 183 | // Since rustc generates coverage maps with relative paths, the |
| 184 | 184 | // compilation directory can be combined with the relative paths |
| 185 | 185 | // to get absolute paths, if needed. |
| 186 | use rustc_session::config::RemapPathScopeComponents; | |
| 187 | 186 | use rustc_session::RemapFileNameExt; |
| 187 | use rustc_session::config::RemapPathScopeComponents; | |
| 188 | 188 | let working_dir: &str = &tcx |
| 189 | 189 | .sess |
| 190 | 190 | .opts |
compiler/rustc_codegen_llvm/src/coverageinfo/mod.rs+1-1| ... | ... | @@ -9,8 +9,8 @@ use rustc_data_structures::fx::{FxHashMap, FxIndexMap}; |
| 9 | 9 | use rustc_llvm::RustString; |
| 10 | 10 | use rustc_middle::bug; |
| 11 | 11 | use rustc_middle::mir::coverage::CoverageKind; |
| 12 | use rustc_middle::ty::layout::HasTyCtxt; | |
| 13 | 12 | use rustc_middle::ty::Instance; |
| 13 | use rustc_middle::ty::layout::HasTyCtxt; | |
| 14 | 14 | use rustc_target::abi::{Align, Size}; |
| 15 | 15 | use tracing::{debug, instrument}; |
| 16 | 16 |
compiler/rustc_codegen_llvm/src/debuginfo/create_scope_map.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use rustc_codegen_ssa::mir::debuginfo::{DebugScope, FunctionDebugContext}; |
| 2 | 2 | use rustc_codegen_ssa::traits::*; |
| 3 | use rustc_index::bit_set::BitSet; | |
| 4 | 3 | use rustc_index::Idx; |
| 4 | use rustc_index::bit_set::BitSet; | |
| 5 | 5 | use rustc_middle::mir::{Body, SourceScope}; |
| 6 | 6 | use rustc_middle::ty::layout::FnAbiOf; |
| 7 | 7 | use rustc_middle::ty::{self, Instance}; |
compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs+6-6| ... | ... | @@ -5,7 +5,7 @@ use std::path::{Path, PathBuf}; |
| 5 | 5 | use std::{iter, ptr}; |
| 6 | 6 | |
| 7 | 7 | use libc::{c_char, c_longlong, c_uint}; |
| 8 | use rustc_codegen_ssa::debuginfo::type_names::{cpp_like_debuginfo, VTableNameKind}; | |
| 8 | use rustc_codegen_ssa::debuginfo::type_names::{VTableNameKind, cpp_like_debuginfo}; | |
| 9 | 9 | use rustc_codegen_ssa::traits::*; |
| 10 | 10 | use rustc_fs_util::path_to_c_string; |
| 11 | 11 | use rustc_hir::def::{CtorKind, DefKind}; |
| ... | ... | @@ -18,7 +18,7 @@ use rustc_middle::ty::{ |
| 18 | 18 | }; |
| 19 | 19 | use rustc_session::config::{self, DebugInfo, Lto}; |
| 20 | 20 | use rustc_span::symbol::Symbol; |
| 21 | use rustc_span::{hygiene, FileName, FileNameDisplayPreference, SourceFile, DUMMY_SP}; | |
| 21 | use rustc_span::{DUMMY_SP, FileName, FileNameDisplayPreference, SourceFile, hygiene}; | |
| 22 | 22 | use rustc_symbol_mangling::typeid_for_trait_ref; |
| 23 | 23 | use rustc_target::abi::{Align, Size}; |
| 24 | 24 | use rustc_target::spec::DebuginfoKind; |
| ... | ... | @@ -26,15 +26,15 @@ use smallvec::smallvec; |
| 26 | 26 | use tracing::{debug, instrument}; |
| 27 | 27 | |
| 28 | 28 | use self::type_map::{DINodeCreationResult, Stub, UniqueTypeId}; |
| 29 | use super::CodegenUnitDebugContext; | |
| 29 | 30 | use super::namespace::mangled_name_of_instance; |
| 30 | 31 | use super::type_names::{compute_debuginfo_type_name, compute_debuginfo_vtable_name}; |
| 31 | 32 | use super::utils::{ |
| 32 | create_DIArray, debug_context, get_namespace_for_item, is_node_local_to_unit, DIB, | |
| 33 | DIB, create_DIArray, debug_context, get_namespace_for_item, is_node_local_to_unit, | |
| 33 | 34 | }; |
| 34 | use super::CodegenUnitDebugContext; | |
| 35 | 35 | use crate::common::CodegenCx; |
| 36 | 36 | use crate::debuginfo::metadata::type_map::build_type_with_children; |
| 37 | use crate::debuginfo::utils::{fat_pointer_kind, FatPtrKind}; | |
| 37 | use crate::debuginfo::utils::{FatPtrKind, fat_pointer_kind}; | |
| 38 | 38 | use crate::llvm::debuginfo::{ |
| 39 | 39 | DIDescriptor, DIFile, DIFlags, DILexicalBlock, DIScope, DIType, DebugEmissionKind, |
| 40 | 40 | DebugNameTableKind, |
| ... | ... | @@ -875,8 +875,8 @@ pub(crate) fn build_compile_unit_di_node<'ll, 'tcx>( |
| 875 | 875 | codegen_unit_name: &str, |
| 876 | 876 | debug_context: &CodegenUnitDebugContext<'ll, 'tcx>, |
| 877 | 877 | ) -> &'ll DIDescriptor { |
| 878 | use rustc_session::config::RemapPathScopeComponents; | |
| 879 | 878 | use rustc_session::RemapFileNameExt; |
| 879 | use rustc_session::config::RemapPathScopeComponents; | |
| 880 | 880 | let mut name_in_debuginfo = tcx |
| 881 | 881 | .sess |
| 882 | 882 | .local_crate_source_file() |
compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs+2-2| ... | ... | @@ -15,9 +15,9 @@ use crate::common::CodegenCx; |
| 15 | 15 | use crate::debuginfo::metadata::enums::DiscrResult; |
| 16 | 16 | use crate::debuginfo::metadata::type_map::{self, Stub, UniqueTypeId}; |
| 17 | 17 | use crate::debuginfo::metadata::{ |
| 18 | DINodeCreationResult, NO_GENERICS, NO_SCOPE_METADATA, SmallVec, UNKNOWN_LINE_NUMBER, | |
| 18 | 19 | build_field_di_node, file_metadata, size_and_align_of, type_di_node, unknown_file_metadata, |
| 19 | visibility_di_flags, DINodeCreationResult, SmallVec, NO_GENERICS, NO_SCOPE_METADATA, | |
| 20 | UNKNOWN_LINE_NUMBER, | |
| 20 | visibility_di_flags, | |
| 21 | 21 | }; |
| 22 | 22 | use crate::debuginfo::utils::DIB; |
| 23 | 23 | use crate::llvm::debuginfo::{DIFile, DIFlags, DIType}; |
compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs+4-4| ... | ... | @@ -12,14 +12,14 @@ use rustc_span::Symbol; |
| 12 | 12 | use rustc_target::abi::{FieldIdx, TagEncoding, VariantIdx, Variants}; |
| 13 | 13 | |
| 14 | 14 | use super::type_map::{DINodeCreationResult, UniqueTypeId}; |
| 15 | use super::{size_and_align_of, SmallVec}; | |
| 15 | use super::{SmallVec, size_and_align_of}; | |
| 16 | 16 | use crate::common::CodegenCx; |
| 17 | 17 | use crate::debuginfo::metadata::type_map::{self, Stub}; |
| 18 | 18 | use crate::debuginfo::metadata::{ |
| 19 | build_field_di_node, build_generic_type_param_di_nodes, type_di_node, unknown_file_metadata, | |
| 20 | UNKNOWN_LINE_NUMBER, | |
| 19 | UNKNOWN_LINE_NUMBER, build_field_di_node, build_generic_type_param_di_nodes, type_di_node, | |
| 20 | unknown_file_metadata, | |
| 21 | 21 | }; |
| 22 | use crate::debuginfo::utils::{create_DIArray, get_namespace_for_item, DIB}; | |
| 22 | use crate::debuginfo::utils::{DIB, create_DIArray, get_namespace_for_item}; | |
| 23 | 23 | use crate::llvm::debuginfo::{DIFlags, DIType}; |
| 24 | 24 | use crate::llvm::{self}; |
| 25 | 25 |
compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/native.rs+3-3| ... | ... | @@ -13,10 +13,10 @@ use smallvec::smallvec; |
| 13 | 13 | use crate::common::CodegenCx; |
| 14 | 14 | use crate::debuginfo::metadata::type_map::{self, Stub, StubInfo, UniqueTypeId}; |
| 15 | 15 | use crate::debuginfo::metadata::{ |
| 16 | file_metadata, size_and_align_of, type_di_node, unknown_file_metadata, visibility_di_flags, | |
| 17 | DINodeCreationResult, SmallVec, NO_GENERICS, UNKNOWN_LINE_NUMBER, | |
| 16 | DINodeCreationResult, NO_GENERICS, SmallVec, UNKNOWN_LINE_NUMBER, file_metadata, | |
| 17 | size_and_align_of, type_di_node, unknown_file_metadata, visibility_di_flags, | |
| 18 | 18 | }; |
| 19 | use crate::debuginfo::utils::{create_DIArray, get_namespace_for_item, DIB}; | |
| 19 | use crate::debuginfo::utils::{DIB, create_DIArray, get_namespace_for_item}; | |
| 20 | 20 | use crate::llvm::debuginfo::{DIFile, DIFlags, DIType}; |
| 21 | 21 | use crate::llvm::{self}; |
| 22 | 22 |
compiler/rustc_codegen_llvm/src/debuginfo/metadata/type_map.rs+2-2| ... | ... | @@ -8,9 +8,9 @@ use rustc_middle::bug; |
| 8 | 8 | use rustc_middle::ty::{ParamEnv, PolyExistentialTraitRef, Ty, TyCtxt}; |
| 9 | 9 | use rustc_target::abi::{Align, Size, VariantIdx}; |
| 10 | 10 | |
| 11 | use super::{unknown_file_metadata, SmallVec, UNKNOWN_LINE_NUMBER}; | |
| 11 | use super::{SmallVec, UNKNOWN_LINE_NUMBER, unknown_file_metadata}; | |
| 12 | 12 | use crate::common::CodegenCx; |
| 13 | use crate::debuginfo::utils::{create_DIArray, debug_context, DIB}; | |
| 13 | use crate::debuginfo::utils::{DIB, create_DIArray, debug_context}; | |
| 14 | 14 | use crate::llvm::debuginfo::{DIFlags, DIScope, DIType}; |
| 15 | 15 | use crate::llvm::{self}; |
| 16 | 16 |
compiler/rustc_codegen_llvm/src/debuginfo/mod.rs+11-14| ... | ... | @@ -16,8 +16,8 @@ use rustc_index::IndexVec; |
| 16 | 16 | use rustc_middle::mir; |
| 17 | 17 | use rustc_middle::ty::layout::LayoutOf; |
| 18 | 18 | use rustc_middle::ty::{self, GenericArgsRef, Instance, ParamEnv, Ty, TypeVisitableExt}; |
| 19 | use rustc_session::config::{self, DebugInfo}; | |
| 20 | 19 | use rustc_session::Session; |
| 20 | use rustc_session::config::{self, DebugInfo}; | |
| 21 | 21 | use rustc_span::symbol::Symbol; |
| 22 | 22 | use rustc_span::{ |
| 23 | 23 | BytePos, Pos, SourceFile, SourceFileAndLine, SourceFileHash, Span, StableSourceFileId, |
| ... | ... | @@ -26,9 +26,9 @@ use rustc_target::abi::Size; |
| 26 | 26 | use smallvec::SmallVec; |
| 27 | 27 | use tracing::debug; |
| 28 | 28 | |
| 29 | use self::metadata::{file_metadata, type_di_node, UNKNOWN_COLUMN_NUMBER, UNKNOWN_LINE_NUMBER}; | |
| 29 | use self::metadata::{UNKNOWN_COLUMN_NUMBER, UNKNOWN_LINE_NUMBER, file_metadata, type_di_node}; | |
| 30 | 30 | use self::namespace::mangled_name_of_instance; |
| 31 | use self::utils::{create_DIArray, is_node_local_to_unit, DIB}; | |
| 31 | use self::utils::{DIB, create_DIArray, is_node_local_to_unit}; | |
| 32 | 32 | use crate::abi::FnAbi; |
| 33 | 33 | use crate::builder::Builder; |
| 34 | 34 | use crate::common::CodegenCx; |
| ... | ... | @@ -555,17 +555,14 @@ impl<'ll, 'tcx> DebugInfoCodegenMethods<'tcx> for CodegenCx<'ll, 'tcx> { |
| 555 | 555 | } |
| 556 | 556 | } |
| 557 | 557 | |
| 558 | let scope = namespace::item_namespace( | |
| 559 | cx, | |
| 560 | DefId { | |
| 561 | krate: instance.def_id().krate, | |
| 562 | index: cx | |
| 563 | .tcx | |
| 564 | .def_key(instance.def_id()) | |
| 565 | .parent | |
| 566 | .expect("get_containing_scope: missing parent?"), | |
| 567 | }, | |
| 568 | ); | |
| 558 | let scope = namespace::item_namespace(cx, DefId { | |
| 559 | krate: instance.def_id().krate, | |
| 560 | index: cx | |
| 561 | .tcx | |
| 562 | .def_key(instance.def_id()) | |
| 563 | .parent | |
| 564 | .expect("get_containing_scope: missing parent?"), | |
| 565 | }); | |
| 569 | 566 | (scope, false) |
| 570 | 567 | } |
| 571 | 568 | } |
compiler/rustc_codegen_llvm/src/debuginfo/namespace.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ use rustc_codegen_ssa::debuginfo::type_names; |
| 4 | 4 | use rustc_hir::def_id::DefId; |
| 5 | 5 | use rustc_middle::ty::{self, Instance}; |
| 6 | 6 | |
| 7 | use super::utils::{debug_context, DIB}; | |
| 7 | use super::utils::{DIB, debug_context}; | |
| 8 | 8 | use crate::common::CodegenCx; |
| 9 | 9 | use crate::llvm; |
| 10 | 10 | use crate::llvm::debuginfo::DIScope; |
compiler/rustc_codegen_llvm/src/debuginfo/utils.rs+1-1| ... | ... | @@ -5,8 +5,8 @@ use rustc_middle::ty::layout::{HasParamEnv, LayoutOf}; |
| 5 | 5 | use rustc_middle::ty::{self, Ty}; |
| 6 | 6 | use tracing::trace; |
| 7 | 7 | |
| 8 | use super::namespace::item_namespace; | |
| 9 | 8 | use super::CodegenUnitDebugContext; |
| 9 | use super::namespace::item_namespace; | |
| 10 | 10 | use crate::common::CodegenCx; |
| 11 | 11 | use crate::llvm; |
| 12 | 12 | use crate::llvm::debuginfo::{DIArray, DIBuilder, DIDescriptor, DIScope}; |
compiler/rustc_codegen_llvm/src/intrinsic.rs+207-213| ... | ... | @@ -12,7 +12,7 @@ use rustc_middle::mir::BinOp; |
| 12 | 12 | use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, LayoutOf}; |
| 13 | 13 | use rustc_middle::ty::{self, GenericArgsRef, Ty}; |
| 14 | 14 | use rustc_middle::{bug, span_bug}; |
| 15 | use rustc_span::{sym, Span, Symbol}; | |
| 15 | use rustc_span::{Span, Symbol, sym}; | |
| 16 | 16 | use rustc_target::abi::{self, Align, Float, HasDataLayout, Primitive, Size}; |
| 17 | 17 | use rustc_target::spec::{HasTargetSpec, PanicStrategy}; |
| 18 | 18 | use tracing::debug; |
| ... | ... | @@ -330,15 +330,12 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> { |
| 330 | 330 | sym::prefetch_write_instruction => (1, 0), |
| 331 | 331 | _ => bug!(), |
| 332 | 332 | }; |
| 333 | self.call_intrinsic( | |
| 334 | "llvm.prefetch", | |
| 335 | &[ | |
| 336 | args[0].immediate(), | |
| 337 | self.const_i32(rw), | |
| 338 | args[1].immediate(), | |
| 339 | self.const_i32(cache_type), | |
| 340 | ], | |
| 341 | ) | |
| 333 | self.call_intrinsic("llvm.prefetch", &[ | |
| 334 | args[0].immediate(), | |
| 335 | self.const_i32(rw), | |
| 336 | args[1].immediate(), | |
| 337 | self.const_i32(cache_type), | |
| 338 | ]) | |
| 342 | 339 | } |
| 343 | 340 | sym::ctlz |
| 344 | 341 | | sym::ctlz_nonzero |
| ... | ... | @@ -356,10 +353,10 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> { |
| 356 | 353 | Some((width, signed)) => match name { |
| 357 | 354 | sym::ctlz | sym::cttz => { |
| 358 | 355 | let y = self.const_bool(false); |
| 359 | let ret = self.call_intrinsic( | |
| 360 | &format!("llvm.{name}.i{width}"), | |
| 361 | &[args[0].immediate(), y], | |
| 362 | ); | |
| 356 | let ret = self.call_intrinsic(&format!("llvm.{name}.i{width}"), &[ | |
| 357 | args[0].immediate(), | |
| 358 | y, | |
| 359 | ]); | |
| 363 | 360 | |
| 364 | 361 | self.intcast(ret, llret_ty, false) |
| 365 | 362 | } |
| ... | ... | @@ -376,26 +373,24 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> { |
| 376 | 373 | self.intcast(ret, llret_ty, false) |
| 377 | 374 | } |
| 378 | 375 | sym::ctpop => { |
| 379 | let ret = self.call_intrinsic( | |
| 380 | &format!("llvm.ctpop.i{width}"), | |
| 381 | &[args[0].immediate()], | |
| 382 | ); | |
| 376 | let ret = self.call_intrinsic(&format!("llvm.ctpop.i{width}"), &[args | |
| 377 | [0] | |
| 378 | .immediate()]); | |
| 383 | 379 | self.intcast(ret, llret_ty, false) |
| 384 | 380 | } |
| 385 | 381 | sym::bswap => { |
| 386 | 382 | if width == 8 { |
| 387 | 383 | args[0].immediate() // byte swap a u8/i8 is just a no-op |
| 388 | 384 | } else { |
| 389 | self.call_intrinsic( | |
| 390 | &format!("llvm.bswap.i{width}"), | |
| 391 | &[args[0].immediate()], | |
| 392 | ) | |
| 385 | self.call_intrinsic(&format!("llvm.bswap.i{width}"), &[ | |
| 386 | args[0].immediate() | |
| 387 | ]) | |
| 393 | 388 | } |
| 394 | 389 | } |
| 395 | sym::bitreverse => self.call_intrinsic( | |
| 396 | &format!("llvm.bitreverse.i{width}"), | |
| 397 | &[args[0].immediate()], | |
| 398 | ), | |
| 390 | sym::bitreverse => self | |
| 391 | .call_intrinsic(&format!("llvm.bitreverse.i{width}"), &[ | |
| 392 | args[0].immediate() | |
| 393 | ]), | |
| 399 | 394 | sym::rotate_left | sym::rotate_right => { |
| 400 | 395 | let is_left = name == sym::rotate_left; |
| 401 | 396 | let val = args[0].immediate(); |
| ... | ... | @@ -471,10 +466,11 @@ impl<'ll, 'tcx> IntrinsicCallBuilderMethods<'tcx> for Builder<'_, 'll, 'tcx> { |
| 471 | 466 | |
| 472 | 467 | sym::compare_bytes => { |
| 473 | 468 | // Here we assume that the `memcmp` provided by the target is a NOP for size 0. |
| 474 | let cmp = self.call_intrinsic( | |
| 475 | "memcmp", | |
| 476 | &[args[0].immediate(), args[1].immediate(), args[2].immediate()], | |
| 477 | ); | |
| 469 | let cmp = self.call_intrinsic("memcmp", &[ | |
| 470 | args[0].immediate(), | |
| 471 | args[1].immediate(), | |
| 472 | args[2].immediate(), | |
| 473 | ]); | |
| 478 | 474 | // Some targets have `memcmp` returning `i16`, but the intrinsic is always `i32`. |
| 479 | 475 | self.sext(cmp, self.type_ix(32)) |
| 480 | 476 | } |
| ... | ... | @@ -1216,17 +1212,14 @@ fn generic_simd_intrinsic<'ll, 'tcx>( |
| 1216 | 1212 | if let Some(cmp_op) = comparison { |
| 1217 | 1213 | let (out_len, out_ty) = require_simd!(ret_ty, SimdReturn); |
| 1218 | 1214 | |
| 1219 | require!( | |
| 1220 | in_len == out_len, | |
| 1221 | InvalidMonomorphization::ReturnLengthInputType { | |
| 1222 | span, | |
| 1223 | name, | |
| 1224 | in_len, | |
| 1225 | in_ty, | |
| 1226 | ret_ty, | |
| 1227 | out_len | |
| 1228 | } | |
| 1229 | ); | |
| 1215 | require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { | |
| 1216 | span, | |
| 1217 | name, | |
| 1218 | in_len, | |
| 1219 | in_ty, | |
| 1220 | ret_ty, | |
| 1221 | out_len | |
| 1222 | }); | |
| 1230 | 1223 | require!( |
| 1231 | 1224 | bx.type_kind(bx.element_type(llret_ty)) == TypeKind::Integer, |
| 1232 | 1225 | InvalidMonomorphization::ReturnIntegerType { span, name, ret_ty, out_ty } |
| ... | ... | @@ -1252,14 +1245,21 @@ fn generic_simd_intrinsic<'ll, 'tcx>( |
| 1252 | 1245 | let n = idx.len() as u64; |
| 1253 | 1246 | |
| 1254 | 1247 | let (out_len, out_ty) = require_simd!(ret_ty, SimdReturn); |
| 1255 | require!( | |
| 1256 | out_len == n, | |
| 1257 | InvalidMonomorphization::ReturnLength { span, name, in_len: n, ret_ty, out_len } | |
| 1258 | ); | |
| 1259 | require!( | |
| 1260 | in_elem == out_ty, | |
| 1261 | InvalidMonomorphization::ReturnElement { span, name, in_elem, in_ty, ret_ty, out_ty } | |
| 1262 | ); | |
| 1248 | require!(out_len == n, InvalidMonomorphization::ReturnLength { | |
| 1249 | span, | |
| 1250 | name, | |
| 1251 | in_len: n, | |
| 1252 | ret_ty, | |
| 1253 | out_len | |
| 1254 | }); | |
| 1255 | require!(in_elem == out_ty, InvalidMonomorphization::ReturnElement { | |
| 1256 | span, | |
| 1257 | name, | |
| 1258 | in_elem, | |
| 1259 | in_ty, | |
| 1260 | ret_ty, | |
| 1261 | out_ty | |
| 1262 | }); | |
| 1263 | 1263 | |
| 1264 | 1264 | let total_len = in_len * 2; |
| 1265 | 1265 | |
| ... | ... | @@ -1304,14 +1304,21 @@ fn generic_simd_intrinsic<'ll, 'tcx>( |
| 1304 | 1304 | }; |
| 1305 | 1305 | |
| 1306 | 1306 | let (out_len, out_ty) = require_simd!(ret_ty, SimdReturn); |
| 1307 | require!( | |
| 1308 | out_len == n, | |
| 1309 | InvalidMonomorphization::ReturnLength { span, name, in_len: n, ret_ty, out_len } | |
| 1310 | ); | |
| 1311 | require!( | |
| 1312 | in_elem == out_ty, | |
| 1313 | InvalidMonomorphization::ReturnElement { span, name, in_elem, in_ty, ret_ty, out_ty } | |
| 1314 | ); | |
| 1307 | require!(out_len == n, InvalidMonomorphization::ReturnLength { | |
| 1308 | span, | |
| 1309 | name, | |
| 1310 | in_len: n, | |
| 1311 | ret_ty, | |
| 1312 | out_len | |
| 1313 | }); | |
| 1314 | require!(in_elem == out_ty, InvalidMonomorphization::ReturnElement { | |
| 1315 | span, | |
| 1316 | name, | |
| 1317 | in_elem, | |
| 1318 | in_ty, | |
| 1319 | ret_ty, | |
| 1320 | out_ty | |
| 1321 | }); | |
| 1315 | 1322 | |
| 1316 | 1323 | let total_len = u128::from(in_len) * 2; |
| 1317 | 1324 | |
| ... | ... | @@ -1336,16 +1343,13 @@ fn generic_simd_intrinsic<'ll, 'tcx>( |
| 1336 | 1343 | } |
| 1337 | 1344 | |
| 1338 | 1345 | if name == sym::simd_insert { |
| 1339 | require!( | |
| 1340 | in_elem == arg_tys[2], | |
| 1341 | InvalidMonomorphization::InsertedType { | |
| 1342 | span, | |
| 1343 | name, | |
| 1344 | in_elem, | |
| 1345 | in_ty, | |
| 1346 | out_ty: arg_tys[2] | |
| 1347 | } | |
| 1348 | ); | |
| 1346 | require!(in_elem == arg_tys[2], InvalidMonomorphization::InsertedType { | |
| 1347 | span, | |
| 1348 | name, | |
| 1349 | in_elem, | |
| 1350 | in_ty, | |
| 1351 | out_ty: arg_tys[2] | |
| 1352 | }); | |
| 1349 | 1353 | let idx = bx |
| 1350 | 1354 | .const_to_opt_u128(args[1].immediate(), false) |
| 1351 | 1355 | .expect("typeck should have ensure that this is a const"); |
| ... | ... | @@ -1364,10 +1368,13 @@ fn generic_simd_intrinsic<'ll, 'tcx>( |
| 1364 | 1368 | )); |
| 1365 | 1369 | } |
| 1366 | 1370 | if name == sym::simd_extract { |
| 1367 | require!( | |
| 1368 | ret_ty == in_elem, | |
| 1369 | InvalidMonomorphization::ReturnType { span, name, in_elem, in_ty, ret_ty } | |
| 1370 | ); | |
| 1371 | require!(ret_ty == in_elem, InvalidMonomorphization::ReturnType { | |
| 1372 | span, | |
| 1373 | name, | |
| 1374 | in_elem, | |
| 1375 | in_ty, | |
| 1376 | ret_ty | |
| 1377 | }); | |
| 1371 | 1378 | let idx = bx |
| 1372 | 1379 | .const_to_opt_u128(args[1].immediate(), false) |
| 1373 | 1380 | .expect("typeck should have ensure that this is a const"); |
| ... | ... | @@ -1386,10 +1393,12 @@ fn generic_simd_intrinsic<'ll, 'tcx>( |
| 1386 | 1393 | let m_elem_ty = in_elem; |
| 1387 | 1394 | let m_len = in_len; |
| 1388 | 1395 | let (v_len, _) = require_simd!(arg_tys[1], SimdArgument); |
| 1389 | require!( | |
| 1390 | m_len == v_len, | |
| 1391 | InvalidMonomorphization::MismatchedLengths { span, name, m_len, v_len } | |
| 1392 | ); | |
| 1396 | require!(m_len == v_len, InvalidMonomorphization::MismatchedLengths { | |
| 1397 | span, | |
| 1398 | name, | |
| 1399 | m_len, | |
| 1400 | v_len | |
| 1401 | }); | |
| 1393 | 1402 | match m_elem_ty.kind() { |
| 1394 | 1403 | ty::Int(_) => {} |
| 1395 | 1404 | _ => return_error!(InvalidMonomorphization::MaskType { span, name, ty: m_elem_ty }), |
| ... | ... | @@ -1616,34 +1625,30 @@ fn generic_simd_intrinsic<'ll, 'tcx>( |
| 1616 | 1625 | require_simd!(ret_ty, SimdReturn); |
| 1617 | 1626 | |
| 1618 | 1627 | // Of the same length: |
| 1619 | require!( | |
| 1620 | in_len == out_len, | |
| 1621 | InvalidMonomorphization::SecondArgumentLength { | |
| 1622 | span, | |
| 1623 | name, | |
| 1624 | in_len, | |
| 1625 | in_ty, | |
| 1626 | arg_ty: arg_tys[1], | |
| 1627 | out_len | |
| 1628 | } | |
| 1629 | ); | |
| 1630 | require!( | |
| 1631 | in_len == out_len2, | |
| 1632 | InvalidMonomorphization::ThirdArgumentLength { | |
| 1633 | span, | |
| 1634 | name, | |
| 1635 | in_len, | |
| 1636 | in_ty, | |
| 1637 | arg_ty: arg_tys[2], | |
| 1638 | out_len: out_len2 | |
| 1639 | } | |
| 1640 | ); | |
| 1628 | require!(in_len == out_len, InvalidMonomorphization::SecondArgumentLength { | |
| 1629 | span, | |
| 1630 | name, | |
| 1631 | in_len, | |
| 1632 | in_ty, | |
| 1633 | arg_ty: arg_tys[1], | |
| 1634 | out_len | |
| 1635 | }); | |
| 1636 | require!(in_len == out_len2, InvalidMonomorphization::ThirdArgumentLength { | |
| 1637 | span, | |
| 1638 | name, | |
| 1639 | in_len, | |
| 1640 | in_ty, | |
| 1641 | arg_ty: arg_tys[2], | |
| 1642 | out_len: out_len2 | |
| 1643 | }); | |
| 1641 | 1644 | |
| 1642 | 1645 | // The return type must match the first argument type |
| 1643 | require!( | |
| 1644 | ret_ty == in_ty, | |
| 1645 | InvalidMonomorphization::ExpectedReturnType { span, name, in_ty, ret_ty } | |
| 1646 | ); | |
| 1646 | require!(ret_ty == in_ty, InvalidMonomorphization::ExpectedReturnType { | |
| 1647 | span, | |
| 1648 | name, | |
| 1649 | in_ty, | |
| 1650 | ret_ty | |
| 1651 | }); | |
| 1647 | 1652 | |
| 1648 | 1653 | require!( |
| 1649 | 1654 | matches!( |
| ... | ... | @@ -1734,23 +1739,22 @@ fn generic_simd_intrinsic<'ll, 'tcx>( |
| 1734 | 1739 | require_simd!(ret_ty, SimdReturn); |
| 1735 | 1740 | |
| 1736 | 1741 | // Of the same length: |
| 1737 | require!( | |
| 1738 | values_len == mask_len, | |
| 1739 | InvalidMonomorphization::ThirdArgumentLength { | |
| 1740 | span, | |
| 1741 | name, | |
| 1742 | in_len: mask_len, | |
| 1743 | in_ty: mask_ty, | |
| 1744 | arg_ty: values_ty, | |
| 1745 | out_len: values_len | |
| 1746 | } | |
| 1747 | ); | |
| 1742 | require!(values_len == mask_len, InvalidMonomorphization::ThirdArgumentLength { | |
| 1743 | span, | |
| 1744 | name, | |
| 1745 | in_len: mask_len, | |
| 1746 | in_ty: mask_ty, | |
| 1747 | arg_ty: values_ty, | |
| 1748 | out_len: values_len | |
| 1749 | }); | |
| 1748 | 1750 | |
| 1749 | 1751 | // The return type must match the last argument type |
| 1750 | require!( | |
| 1751 | ret_ty == values_ty, | |
| 1752 | InvalidMonomorphization::ExpectedReturnType { span, name, in_ty: values_ty, ret_ty } | |
| 1753 | ); | |
| 1752 | require!(ret_ty == values_ty, InvalidMonomorphization::ExpectedReturnType { | |
| 1753 | span, | |
| 1754 | name, | |
| 1755 | in_ty: values_ty, | |
| 1756 | ret_ty | |
| 1757 | }); | |
| 1754 | 1758 | |
| 1755 | 1759 | require!( |
| 1756 | 1760 | matches!( |
| ... | ... | @@ -1832,17 +1836,14 @@ fn generic_simd_intrinsic<'ll, 'tcx>( |
| 1832 | 1836 | let (values_len, values_elem) = require_simd!(values_ty, SimdThird); |
| 1833 | 1837 | |
| 1834 | 1838 | // Of the same length: |
| 1835 | require!( | |
| 1836 | values_len == mask_len, | |
| 1837 | InvalidMonomorphization::ThirdArgumentLength { | |
| 1838 | span, | |
| 1839 | name, | |
| 1840 | in_len: mask_len, | |
| 1841 | in_ty: mask_ty, | |
| 1842 | arg_ty: values_ty, | |
| 1843 | out_len: values_len | |
| 1844 | } | |
| 1845 | ); | |
| 1839 | require!(values_len == mask_len, InvalidMonomorphization::ThirdArgumentLength { | |
| 1840 | span, | |
| 1841 | name, | |
| 1842 | in_len: mask_len, | |
| 1843 | in_ty: mask_ty, | |
| 1844 | arg_ty: values_ty, | |
| 1845 | out_len: values_len | |
| 1846 | }); | |
| 1846 | 1847 | |
| 1847 | 1848 | // The second argument must be a mutable pointer type matching the element type |
| 1848 | 1849 | require!( |
| ... | ... | @@ -1921,28 +1922,22 @@ fn generic_simd_intrinsic<'ll, 'tcx>( |
| 1921 | 1922 | let (element_len2, element_ty2) = require_simd!(arg_tys[2], SimdThird); |
| 1922 | 1923 | |
| 1923 | 1924 | // Of the same length: |
| 1924 | require!( | |
| 1925 | in_len == element_len1, | |
| 1926 | InvalidMonomorphization::SecondArgumentLength { | |
| 1927 | span, | |
| 1928 | name, | |
| 1929 | in_len, | |
| 1930 | in_ty, | |
| 1931 | arg_ty: arg_tys[1], | |
| 1932 | out_len: element_len1 | |
| 1933 | } | |
| 1934 | ); | |
| 1935 | require!( | |
| 1936 | in_len == element_len2, | |
| 1937 | InvalidMonomorphization::ThirdArgumentLength { | |
| 1938 | span, | |
| 1939 | name, | |
| 1940 | in_len, | |
| 1941 | in_ty, | |
| 1942 | arg_ty: arg_tys[2], | |
| 1943 | out_len: element_len2 | |
| 1944 | } | |
| 1945 | ); | |
| 1925 | require!(in_len == element_len1, InvalidMonomorphization::SecondArgumentLength { | |
| 1926 | span, | |
| 1927 | name, | |
| 1928 | in_len, | |
| 1929 | in_ty, | |
| 1930 | arg_ty: arg_tys[1], | |
| 1931 | out_len: element_len1 | |
| 1932 | }); | |
| 1933 | require!(in_len == element_len2, InvalidMonomorphization::ThirdArgumentLength { | |
| 1934 | span, | |
| 1935 | name, | |
| 1936 | in_len, | |
| 1937 | in_ty, | |
| 1938 | arg_ty: arg_tys[2], | |
| 1939 | out_len: element_len2 | |
| 1940 | }); | |
| 1946 | 1941 | |
| 1947 | 1942 | require!( |
| 1948 | 1943 | matches!( |
| ... | ... | @@ -2016,10 +2011,13 @@ fn generic_simd_intrinsic<'ll, 'tcx>( |
| 2016 | 2011 | ($name:ident : $integer_reduce:ident, $float_reduce:ident, $ordered:expr, $op:ident, |
| 2017 | 2012 | $identity:expr) => { |
| 2018 | 2013 | if name == sym::$name { |
| 2019 | require!( | |
| 2020 | ret_ty == in_elem, | |
| 2021 | InvalidMonomorphization::ReturnType { span, name, in_elem, in_ty, ret_ty } | |
| 2022 | ); | |
| 2014 | require!(ret_ty == in_elem, InvalidMonomorphization::ReturnType { | |
| 2015 | span, | |
| 2016 | name, | |
| 2017 | in_elem, | |
| 2018 | in_ty, | |
| 2019 | ret_ty | |
| 2020 | }); | |
| 2023 | 2021 | return match in_elem.kind() { |
| 2024 | 2022 | ty::Int(_) | ty::Uint(_) => { |
| 2025 | 2023 | let r = bx.$integer_reduce(args[0].immediate()); |
| ... | ... | @@ -2088,10 +2086,13 @@ fn generic_simd_intrinsic<'ll, 'tcx>( |
| 2088 | 2086 | macro_rules! minmax_red { |
| 2089 | 2087 | ($name:ident: $int_red:ident, $float_red:ident) => { |
| 2090 | 2088 | if name == sym::$name { |
| 2091 | require!( | |
| 2092 | ret_ty == in_elem, | |
| 2093 | InvalidMonomorphization::ReturnType { span, name, in_elem, in_ty, ret_ty } | |
| 2094 | ); | |
| 2089 | require!(ret_ty == in_elem, InvalidMonomorphization::ReturnType { | |
| 2090 | span, | |
| 2091 | name, | |
| 2092 | in_elem, | |
| 2093 | in_ty, | |
| 2094 | ret_ty | |
| 2095 | }); | |
| 2095 | 2096 | return match in_elem.kind() { |
| 2096 | 2097 | ty::Int(_i) => Ok(bx.$int_red(args[0].immediate(), true)), |
| 2097 | 2098 | ty::Uint(_u) => Ok(bx.$int_red(args[0].immediate(), false)), |
| ... | ... | @@ -2116,10 +2117,13 @@ fn generic_simd_intrinsic<'ll, 'tcx>( |
| 2116 | 2117 | ($name:ident : $red:ident, $boolean:expr) => { |
| 2117 | 2118 | if name == sym::$name { |
| 2118 | 2119 | let input = if !$boolean { |
| 2119 | require!( | |
| 2120 | ret_ty == in_elem, | |
| 2121 | InvalidMonomorphization::ReturnType { span, name, in_elem, in_ty, ret_ty } | |
| 2122 | ); | |
| 2120 | require!(ret_ty == in_elem, InvalidMonomorphization::ReturnType { | |
| 2121 | span, | |
| 2122 | name, | |
| 2123 | in_elem, | |
| 2124 | in_ty, | |
| 2125 | ret_ty | |
| 2126 | }); | |
| 2123 | 2127 | args[0].immediate() |
| 2124 | 2128 | } else { |
| 2125 | 2129 | match in_elem.kind() { |
| ... | ... | @@ -2165,27 +2169,25 @@ fn generic_simd_intrinsic<'ll, 'tcx>( |
| 2165 | 2169 | |
| 2166 | 2170 | if name == sym::simd_cast_ptr { |
| 2167 | 2171 | let (out_len, out_elem) = require_simd!(ret_ty, SimdReturn); |
| 2168 | require!( | |
| 2169 | in_len == out_len, | |
| 2170 | InvalidMonomorphization::ReturnLengthInputType { | |
| 2171 | span, | |
| 2172 | name, | |
| 2173 | in_len, | |
| 2174 | in_ty, | |
| 2175 | ret_ty, | |
| 2176 | out_len | |
| 2177 | } | |
| 2178 | ); | |
| 2172 | require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { | |
| 2173 | span, | |
| 2174 | name, | |
| 2175 | in_len, | |
| 2176 | in_ty, | |
| 2177 | ret_ty, | |
| 2178 | out_len | |
| 2179 | }); | |
| 2179 | 2180 | |
| 2180 | 2181 | match in_elem.kind() { |
| 2181 | 2182 | ty::RawPtr(p_ty, _) => { |
| 2182 | 2183 | let metadata = p_ty.ptr_metadata_ty(bx.tcx, |ty| { |
| 2183 | 2184 | bx.tcx.normalize_erasing_regions(ty::ParamEnv::reveal_all(), ty) |
| 2184 | 2185 | }); |
| 2185 | require!( | |
| 2186 | metadata.is_unit(), | |
| 2187 | InvalidMonomorphization::CastFatPointer { span, name, ty: in_elem } | |
| 2188 | ); | |
| 2186 | require!(metadata.is_unit(), InvalidMonomorphization::CastFatPointer { | |
| 2187 | span, | |
| 2188 | name, | |
| 2189 | ty: in_elem | |
| 2190 | }); | |
| 2189 | 2191 | } |
| 2190 | 2192 | _ => { |
| 2191 | 2193 | return_error!(InvalidMonomorphization::ExpectedPointer { span, name, ty: in_elem }) |
| ... | ... | @@ -2196,10 +2198,11 @@ fn generic_simd_intrinsic<'ll, 'tcx>( |
| 2196 | 2198 | let metadata = p_ty.ptr_metadata_ty(bx.tcx, |ty| { |
| 2197 | 2199 | bx.tcx.normalize_erasing_regions(ty::ParamEnv::reveal_all(), ty) |
| 2198 | 2200 | }); |
| 2199 | require!( | |
| 2200 | metadata.is_unit(), | |
| 2201 | InvalidMonomorphization::CastFatPointer { span, name, ty: out_elem } | |
| 2202 | ); | |
| 2201 | require!(metadata.is_unit(), InvalidMonomorphization::CastFatPointer { | |
| 2202 | span, | |
| 2203 | name, | |
| 2204 | ty: out_elem | |
| 2205 | }); | |
| 2203 | 2206 | } |
| 2204 | 2207 | _ => { |
| 2205 | 2208 | return_error!(InvalidMonomorphization::ExpectedPointer { span, name, ty: out_elem }) |
| ... | ... | @@ -2211,17 +2214,14 @@ fn generic_simd_intrinsic<'ll, 'tcx>( |
| 2211 | 2214 | |
| 2212 | 2215 | if name == sym::simd_expose_provenance { |
| 2213 | 2216 | let (out_len, out_elem) = require_simd!(ret_ty, SimdReturn); |
| 2214 | require!( | |
| 2215 | in_len == out_len, | |
| 2216 | InvalidMonomorphization::ReturnLengthInputType { | |
| 2217 | span, | |
| 2218 | name, | |
| 2219 | in_len, | |
| 2220 | in_ty, | |
| 2221 | ret_ty, | |
| 2222 | out_len | |
| 2223 | } | |
| 2224 | ); | |
| 2217 | require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { | |
| 2218 | span, | |
| 2219 | name, | |
| 2220 | in_len, | |
| 2221 | in_ty, | |
| 2222 | ret_ty, | |
| 2223 | out_len | |
| 2224 | }); | |
| 2225 | 2225 | |
| 2226 | 2226 | match in_elem.kind() { |
| 2227 | 2227 | ty::RawPtr(_, _) => {} |
| ... | ... | @@ -2239,17 +2239,14 @@ fn generic_simd_intrinsic<'ll, 'tcx>( |
| 2239 | 2239 | |
| 2240 | 2240 | if name == sym::simd_with_exposed_provenance { |
| 2241 | 2241 | let (out_len, out_elem) = require_simd!(ret_ty, SimdReturn); |
| 2242 | require!( | |
| 2243 | in_len == out_len, | |
| 2244 | InvalidMonomorphization::ReturnLengthInputType { | |
| 2245 | span, | |
| 2246 | name, | |
| 2247 | in_len, | |
| 2248 | in_ty, | |
| 2249 | ret_ty, | |
| 2250 | out_len | |
| 2251 | } | |
| 2252 | ); | |
| 2242 | require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { | |
| 2243 | span, | |
| 2244 | name, | |
| 2245 | in_len, | |
| 2246 | in_ty, | |
| 2247 | ret_ty, | |
| 2248 | out_len | |
| 2249 | }); | |
| 2253 | 2250 | |
| 2254 | 2251 | match in_elem.kind() { |
| 2255 | 2252 | ty::Uint(ty::UintTy::Usize) => {} |
| ... | ... | @@ -2267,17 +2264,14 @@ fn generic_simd_intrinsic<'ll, 'tcx>( |
| 2267 | 2264 | |
| 2268 | 2265 | if name == sym::simd_cast || name == sym::simd_as { |
| 2269 | 2266 | let (out_len, out_elem) = require_simd!(ret_ty, SimdReturn); |
| 2270 | require!( | |
| 2271 | in_len == out_len, | |
| 2272 | InvalidMonomorphization::ReturnLengthInputType { | |
| 2273 | span, | |
| 2274 | name, | |
| 2275 | in_len, | |
| 2276 | in_ty, | |
| 2277 | ret_ty, | |
| 2278 | out_len | |
| 2279 | } | |
| 2280 | ); | |
| 2267 | require!(in_len == out_len, InvalidMonomorphization::ReturnLengthInputType { | |
| 2268 | span, | |
| 2269 | name, | |
| 2270 | in_len, | |
| 2271 | in_ty, | |
| 2272 | ret_ty, | |
| 2273 | out_len | |
| 2274 | }); | |
| 2281 | 2275 | // casting cares about nominal type, not just structural type |
| 2282 | 2276 | if in_elem == out_elem { |
| 2283 | 2277 | return Ok(args[0].immediate()); |
compiler/rustc_codegen_llvm/src/lib.rs+1-1| ... | ... | @@ -41,8 +41,8 @@ use rustc_metadata::EncodedMetadata; |
| 41 | 41 | use rustc_middle::dep_graph::{WorkProduct, WorkProductId}; |
| 42 | 42 | use rustc_middle::ty::TyCtxt; |
| 43 | 43 | use rustc_middle::util::Providers; |
| 44 | use rustc_session::config::{OptLevel, OutputFilenames, PrintKind, PrintRequest}; | |
| 45 | 44 | use rustc_session::Session; |
| 45 | use rustc_session::config::{OptLevel, OutputFilenames, PrintKind, PrintRequest}; | |
| 46 | 46 | use rustc_span::symbol::Symbol; |
| 47 | 47 | |
| 48 | 48 | mod back { |
compiler/rustc_codegen_llvm/src/llvm/ffi.rs+1-1| ... | ... | @@ -5,13 +5,13 @@ use std::marker::PhantomData; |
| 5 | 5 | |
| 6 | 6 | use libc::{c_char, c_int, c_uint, c_ulonglong, c_void, size_t}; |
| 7 | 7 | |
| 8 | use super::RustString; | |
| 8 | 9 | use super::debuginfo::{ |
| 9 | 10 | DIArray, DIBasicType, DIBuilder, DICompositeType, DIDerivedType, DIDescriptor, DIEnumerator, |
| 10 | 11 | DIFile, DIFlags, DIGlobalVariableExpression, DILexicalBlock, DILocation, DINameSpace, |
| 11 | 12 | DISPFlags, DIScope, DISubprogram, DISubrange, DITemplateTypeParameter, DIType, DIVariable, |
| 12 | 13 | DebugEmissionKind, DebugNameTableKind, |
| 13 | 14 | }; |
| 14 | use super::RustString; | |
| 15 | 15 | |
| 16 | 16 | pub type Bool = c_uint; |
| 17 | 17 |
compiler/rustc_codegen_llvm/src/llvm_util.rs+2-2| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use std::ffi::{c_char, c_void, CStr, CString}; | |
| 1 | use std::ffi::{CStr, CString, c_char, c_void}; | |
| 2 | 2 | use std::fmt::Write; |
| 3 | 3 | use std::path::Path; |
| 4 | 4 | use std::sync::Once; |
| ... | ... | @@ -11,8 +11,8 @@ use rustc_data_structures::small_c_str::SmallCStr; |
| 11 | 11 | use rustc_data_structures::unord::UnordSet; |
| 12 | 12 | use rustc_fs_util::path_to_c_string; |
| 13 | 13 | use rustc_middle::bug; |
| 14 | use rustc_session::config::{PrintKind, PrintRequest}; | |
| 15 | 14 | use rustc_session::Session; |
| 15 | use rustc_session::config::{PrintKind, PrintRequest}; | |
| 16 | 16 | use rustc_span::symbol::Symbol; |
| 17 | 17 | use rustc_target::spec::{MergeFunctions, PanicStrategy, SmallDataThresholdSupport}; |
| 18 | 18 | use rustc_target::target_features::{RUSTC_SPECIAL_FEATURES, RUSTC_SPECIFIC_FEATURES}; |
compiler/rustc_codegen_llvm/src/va_arg.rs+1-1| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use rustc_codegen_ssa::common::IntPredicate; |
| 2 | 2 | use rustc_codegen_ssa::mir::operand::OperandRef; |
| 3 | 3 | use rustc_codegen_ssa::traits::{BaseTypeCodegenMethods, BuilderMethods, ConstCodegenMethods}; |
| 4 | use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf}; | |
| 5 | 4 | use rustc_middle::ty::Ty; |
| 5 | use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf}; | |
| 6 | 6 | use rustc_target::abi::{Align, Endian, HasDataLayout, Size}; |
| 7 | 7 | |
| 8 | 8 | use crate::builder::Builder; |
compiler/rustc_codegen_ssa/src/back/archive.rs+6-6| ... | ... | @@ -6,9 +6,9 @@ use std::io::{self, Write}; |
| 6 | 6 | use std::path::{Path, PathBuf}; |
| 7 | 7 | |
| 8 | 8 | use ar_archive_writer::{ |
| 9 | write_archive_to_stream, ArchiveKind, COFFShortExport, MachineTypes, NewArchiveMember, | |
| 9 | ArchiveKind, COFFShortExport, MachineTypes, NewArchiveMember, write_archive_to_stream, | |
| 10 | 10 | }; |
| 11 | pub use ar_archive_writer::{ObjectReader, DEFAULT_OBJECT_READER}; | |
| 11 | pub use ar_archive_writer::{DEFAULT_OBJECT_READER, ObjectReader}; | |
| 12 | 12 | use object::read::archive::ArchiveFile; |
| 13 | 13 | use object::read::macho::FatArch; |
| 14 | 14 | use rustc_data_structures::fx::FxIndexSet; |
| ... | ... | @@ -395,10 +395,10 @@ impl<'a> ArchiveBuilder for ArArchiveBuilder<'a> { |
| 395 | 395 | let member_path = archive_path.parent().unwrap().join(Path::new(&file_name)); |
| 396 | 396 | self.entries.push((file_name.into_bytes(), ArchiveEntry::File(member_path))); |
| 397 | 397 | } else { |
| 398 | self.entries.push(( | |
| 399 | file_name.into_bytes(), | |
| 400 | ArchiveEntry::FromArchive { archive_index, file_range: entry.file_range() }, | |
| 401 | )); | |
| 398 | self.entries.push((file_name.into_bytes(), ArchiveEntry::FromArchive { | |
| 399 | archive_index, | |
| 400 | file_range: entry.file_range(), | |
| 401 | })); | |
| 402 | 402 | } |
| 403 | 403 | } |
| 404 | 404 | } |
compiler/rustc_codegen_ssa/src/back/link.rs+8-8| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use std::collections::BTreeSet; |
| 2 | 2 | use std::ffi::OsString; |
| 3 | use std::fs::{read, File, OpenOptions}; | |
| 3 | use std::fs::{File, OpenOptions, read}; | |
| 4 | 4 | use std::io::{BufWriter, Write}; |
| 5 | 5 | use std::ops::{ControlFlow, Deref}; |
| 6 | 6 | use std::path::{Path, PathBuf}; |
| ... | ... | @@ -18,7 +18,7 @@ use rustc_data_structures::temp_dir::MaybeTempDir; |
| 18 | 18 | use rustc_errors::{DiagCtxtHandle, ErrorGuaranteed, FatalError}; |
| 19 | 19 | use rustc_fs_util::{fix_windows_verbatim_for_gcc, try_canonicalize}; |
| 20 | 20 | use rustc_hir::def_id::{CrateNum, LOCAL_CRATE}; |
| 21 | use rustc_metadata::fs::{copy_to_stdout, emit_wrapper_file, METADATA_FILENAME}; | |
| 21 | use rustc_metadata::fs::{METADATA_FILENAME, copy_to_stdout, emit_wrapper_file}; | |
| 22 | 22 | use rustc_metadata::{find_native_static_library, walk_native_lib_search_dirs}; |
| 23 | 23 | use rustc_middle::bug; |
| 24 | 24 | use rustc_middle::middle::debugger_visualizer::DebuggerVisualizerFile; |
| ... | ... | @@ -34,7 +34,7 @@ use rustc_session::search_paths::PathKind; |
| 34 | 34 | use rustc_session::utils::NativeLibKind; |
| 35 | 35 | /// For all the linkers we support, and information they might |
| 36 | 36 | /// need out of the shared crate context before we get rid of it. |
| 37 | use rustc_session::{filesearch, Session}; | |
| 37 | use rustc_session::{Session, filesearch}; | |
| 38 | 38 | use rustc_span::symbol::Symbol; |
| 39 | 39 | use rustc_target::spec::crt_objects::CrtObjects; |
| 40 | 40 | use rustc_target::spec::{ |
| ... | ... | @@ -48,11 +48,11 @@ use tracing::{debug, info, warn}; |
| 48 | 48 | use super::archive::{ArchiveBuilder, ArchiveBuilderBuilder}; |
| 49 | 49 | use super::command::Command; |
| 50 | 50 | use super::linker::{self, Linker}; |
| 51 | use super::metadata::{create_wrapper_file, MetadataPosition}; | |
| 51 | use super::metadata::{MetadataPosition, create_wrapper_file}; | |
| 52 | 52 | use super::rpath::{self, RPathConfig}; |
| 53 | 53 | use crate::{ |
| 54 | common, errors, looks_like_rust_object_file, CodegenResults, CompiledModule, CrateInfo, | |
| 55 | NativeLib, | |
| 54 | CodegenResults, CompiledModule, CrateInfo, NativeLib, common, errors, | |
| 55 | looks_like_rust_object_file, | |
| 56 | 56 | }; |
| 57 | 57 | |
| 58 | 58 | pub fn ensure_removed(dcx: DiagCtxtHandle<'_>, path: &Path) { |
| ... | ... | @@ -1197,8 +1197,8 @@ fn escape_linker_output(s: &[u8], flavour: LinkerFlavor) -> String { |
| 1197 | 1197 | #[cfg(windows)] |
| 1198 | 1198 | mod win { |
| 1199 | 1199 | use windows::Win32::Globalization::{ |
| 1200 | GetLocaleInfoEx, MultiByteToWideChar, CP_OEMCP, LOCALE_IUSEUTF8LEGACYOEMCP, | |
| 1201 | LOCALE_NAME_SYSTEM_DEFAULT, LOCALE_RETURN_NUMBER, MB_ERR_INVALID_CHARS, | |
| 1200 | CP_OEMCP, GetLocaleInfoEx, LOCALE_IUSEUTF8LEGACYOEMCP, LOCALE_NAME_SYSTEM_DEFAULT, | |
| 1201 | LOCALE_RETURN_NUMBER, MB_ERR_INVALID_CHARS, MultiByteToWideChar, | |
| 1202 | 1202 | }; |
| 1203 | 1203 | |
| 1204 | 1204 | /// Get the Windows system OEM code page. This is most notably the code page |
compiler/rustc_codegen_ssa/src/back/linker.rs+1-1| ... | ... | @@ -15,8 +15,8 @@ use rustc_middle::middle::dependency_format::Linkage; |
| 15 | 15 | use rustc_middle::middle::exported_symbols; |
| 16 | 16 | use rustc_middle::middle::exported_symbols::{ExportedSymbol, SymbolExportInfo, SymbolExportKind}; |
| 17 | 17 | use rustc_middle::ty::TyCtxt; |
| 18 | use rustc_session::config::{self, CrateType, DebugInfo, LinkerPluginLto, Lto, OptLevel, Strip}; | |
| 19 | 18 | use rustc_session::Session; |
| 19 | use rustc_session::config::{self, CrateType, DebugInfo, LinkerPluginLto, Lto, OptLevel, Strip}; | |
| 20 | 20 | use rustc_span::symbol::sym; |
| 21 | 21 | use rustc_target::spec::{Cc, LinkOutputKind, LinkerFlavor, Lld}; |
| 22 | 22 | use tracing::{debug, warn}; |
compiler/rustc_codegen_ssa/src/back/lto.rs+1-1| ... | ... | @@ -5,8 +5,8 @@ use rustc_data_structures::memmap::Mmap; |
| 5 | 5 | use rustc_errors::FatalError; |
| 6 | 6 | |
| 7 | 7 | use super::write::CodegenContext; |
| 8 | use crate::traits::*; | |
| 9 | 8 | use crate::ModuleCodegen; |
| 9 | use crate::traits::*; | |
| 10 | 10 | |
| 11 | 11 | pub struct ThinModule<B: WriteBackendMethods> { |
| 12 | 12 | pub shared: Arc<ThinShared<B>>, |
compiler/rustc_codegen_ssa/src/back/metadata.rs+13-16| ... | ... | @@ -7,19 +7,20 @@ use std::path::Path; |
| 7 | 7 | |
| 8 | 8 | use object::write::{self, StandardSegment, Symbol, SymbolSection}; |
| 9 | 9 | use object::{ |
| 10 | elf, pe, xcoff, Architecture, BinaryFormat, Endianness, FileFlags, Object, ObjectSection, | |
| 11 | ObjectSymbol, SectionFlags, SectionKind, SubArchitecture, SymbolFlags, SymbolKind, SymbolScope, | |
| 10 | Architecture, BinaryFormat, Endianness, FileFlags, Object, ObjectSection, ObjectSymbol, | |
| 11 | SectionFlags, SectionKind, SubArchitecture, SymbolFlags, SymbolKind, SymbolScope, elf, pe, | |
| 12 | xcoff, | |
| 12 | 13 | }; |
| 13 | 14 | use rustc_data_structures::memmap::Mmap; |
| 14 | use rustc_data_structures::owned_slice::{try_slice_owned, OwnedSlice}; | |
| 15 | use rustc_data_structures::owned_slice::{OwnedSlice, try_slice_owned}; | |
| 16 | use rustc_metadata::EncodedMetadata; | |
| 15 | 17 | use rustc_metadata::creader::MetadataLoader; |
| 16 | 18 | use rustc_metadata::fs::METADATA_FILENAME; |
| 17 | use rustc_metadata::EncodedMetadata; | |
| 18 | 19 | use rustc_middle::bug; |
| 19 | 20 | use rustc_session::Session; |
| 20 | 21 | use rustc_span::sym; |
| 21 | 22 | use rustc_target::abi::Endian; |
| 22 | use rustc_target::spec::{ef_avr_arch, RelocModel, Target}; | |
| 23 | use rustc_target::spec::{RelocModel, Target, ef_avr_arch}; | |
| 23 | 24 | |
| 24 | 25 | /// The default metadata loader. This is used by cg_llvm and cg_clif. |
| 25 | 26 | /// |
| ... | ... | @@ -668,17 +669,13 @@ pub fn create_metadata_file_for_wasm(sess: &Session, data: &[u8], section_name: |
| 668 | 669 | let mut imports = wasm_encoder::ImportSection::new(); |
| 669 | 670 | |
| 670 | 671 | if sess.target.pointer_width == 64 { |
| 671 | imports.import( | |
| 672 | "env", | |
| 673 | "__linear_memory", | |
| 674 | wasm_encoder::MemoryType { | |
| 675 | minimum: 0, | |
| 676 | maximum: None, | |
| 677 | memory64: true, | |
| 678 | shared: false, | |
| 679 | page_size_log2: None, | |
| 680 | }, | |
| 681 | ); | |
| 672 | imports.import("env", "__linear_memory", wasm_encoder::MemoryType { | |
| 673 | minimum: 0, | |
| 674 | maximum: None, | |
| 675 | memory64: true, | |
| 676 | shared: false, | |
| 677 | page_size_log2: None, | |
| 678 | }); | |
| 682 | 679 | } |
| 683 | 680 | |
| 684 | 681 | if imports.len() > 0 { |
compiler/rustc_codegen_ssa/src/back/rpath/tests.rs+7-10| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use std::ffi::OsString; |
| 2 | 2 | use std::path::{Path, PathBuf}; |
| 3 | 3 | |
| 4 | use super::{get_rpath_relative_to_output, minimize_rpaths, rpaths_to_flags, RPathConfig}; | |
| 4 | use super::{RPathConfig, get_rpath_relative_to_output, minimize_rpaths, rpaths_to_flags}; | |
| 5 | 5 | |
| 6 | 6 | #[test] |
| 7 | 7 | fn test_rpaths_to_flags() { |
| ... | ... | @@ -74,13 +74,10 @@ fn test_rpath_relative_issue_119571() { |
| 74 | 74 | fn test_xlinker() { |
| 75 | 75 | let args = rpaths_to_flags(vec!["a/normal/path".into(), "a,comma,path".into()]); |
| 76 | 76 | |
| 77 | assert_eq!( | |
| 78 | args, | |
| 79 | vec![ | |
| 80 | OsString::from("-Wl,-rpath,a/normal/path"), | |
| 81 | OsString::from("-Wl,-rpath"), | |
| 82 | OsString::from("-Xlinker"), | |
| 83 | OsString::from("a,comma,path") | |
| 84 | ] | |
| 85 | ); | |
| 77 | assert_eq!(args, vec![ | |
| 78 | OsString::from("-Wl,-rpath,a/normal/path"), | |
| 79 | OsString::from("-Wl,-rpath"), | |
| 80 | OsString::from("-Xlinker"), | |
| 81 | OsString::from("a,comma,path") | |
| 82 | ]); | |
| 86 | 83 | } |
compiler/rustc_codegen_ssa/src/back/symbol_export.rs+57-90| ... | ... | @@ -3,11 +3,11 @@ use std::collections::hash_map::Entry::*; |
| 3 | 3 | use rustc_ast::expand::allocator::{ALLOCATOR_METHODS, NO_ALLOC_SHIM_IS_UNSTABLE}; |
| 4 | 4 | use rustc_data_structures::unord::UnordMap; |
| 5 | 5 | use rustc_hir::def::DefKind; |
| 6 | use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LocalDefId, LOCAL_CRATE}; | |
| 6 | use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LOCAL_CRATE, LocalDefId}; | |
| 7 | 7 | use rustc_middle::bug; |
| 8 | 8 | use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; |
| 9 | 9 | use rustc_middle::middle::exported_symbols::{ |
| 10 | metadata_symbol_name, ExportedSymbol, SymbolExportInfo, SymbolExportKind, SymbolExportLevel, | |
| 10 | ExportedSymbol, SymbolExportInfo, SymbolExportKind, SymbolExportLevel, metadata_symbol_name, | |
| 11 | 11 | }; |
| 12 | 12 | use rustc_middle::query::LocalCrate; |
| 13 | 13 | use rustc_middle::ty::{self, GenericArgKind, GenericArgsRef, Instance, SymbolName, TyCtxt}; |
| ... | ... | @@ -140,14 +140,11 @@ fn reachable_non_generics_provider(tcx: TyCtxt<'_>, _: LocalCrate) -> DefIdMap<S |
| 140 | 140 | .into(); |
| 141 | 141 | |
| 142 | 142 | if let Some(id) = tcx.proc_macro_decls_static(()) { |
| 143 | reachable_non_generics.insert( | |
| 144 | id.to_def_id(), | |
| 145 | SymbolExportInfo { | |
| 146 | level: SymbolExportLevel::C, | |
| 147 | kind: SymbolExportKind::Data, | |
| 148 | used: false, | |
| 149 | }, | |
| 150 | ); | |
| 143 | reachable_non_generics.insert(id.to_def_id(), SymbolExportInfo { | |
| 144 | level: SymbolExportLevel::C, | |
| 145 | kind: SymbolExportKind::Data, | |
| 146 | used: false, | |
| 147 | }); | |
| 151 | 148 | } |
| 152 | 149 | |
| 153 | 150 | reachable_non_generics |
| ... | ... | @@ -188,14 +185,11 @@ fn exported_symbols_provider_local( |
| 188 | 185 | if !tcx.sess.target.dll_tls_export { |
| 189 | 186 | symbols.extend(sorted.iter().filter_map(|(&def_id, &info)| { |
| 190 | 187 | tcx.needs_thread_local_shim(def_id).then(|| { |
| 191 | ( | |
| 192 | ExportedSymbol::ThreadLocalShim(def_id), | |
| 193 | SymbolExportInfo { | |
| 194 | level: info.level, | |
| 195 | kind: SymbolExportKind::Text, | |
| 196 | used: info.used, | |
| 197 | }, | |
| 198 | ) | |
| 188 | (ExportedSymbol::ThreadLocalShim(def_id), SymbolExportInfo { | |
| 189 | level: info.level, | |
| 190 | kind: SymbolExportKind::Text, | |
| 191 | used: info.used, | |
| 192 | }) | |
| 199 | 193 | }) |
| 200 | 194 | })) |
| 201 | 195 | } |
| ... | ... | @@ -204,14 +198,11 @@ fn exported_symbols_provider_local( |
| 204 | 198 | let exported_symbol = |
| 205 | 199 | ExportedSymbol::NoDefId(SymbolName::new(tcx, tcx.sess.target.entry_name.as_ref())); |
| 206 | 200 | |
| 207 | symbols.push(( | |
| 208 | exported_symbol, | |
| 209 | SymbolExportInfo { | |
| 210 | level: SymbolExportLevel::C, | |
| 211 | kind: SymbolExportKind::Text, | |
| 212 | used: false, | |
| 213 | }, | |
| 214 | )); | |
| 201 | symbols.push((exported_symbol, SymbolExportInfo { | |
| 202 | level: SymbolExportLevel::C, | |
| 203 | kind: SymbolExportKind::Text, | |
| 204 | used: false, | |
| 205 | })); | |
| 215 | 206 | } |
| 216 | 207 | |
| 217 | 208 | // Mark allocator shim symbols as exported only if they were generated. |
| ... | ... | @@ -223,26 +214,20 @@ fn exported_symbols_provider_local( |
| 223 | 214 | { |
| 224 | 215 | let exported_symbol = ExportedSymbol::NoDefId(SymbolName::new(tcx, &symbol_name)); |
| 225 | 216 | |
| 226 | symbols.push(( | |
| 227 | exported_symbol, | |
| 228 | SymbolExportInfo { | |
| 229 | level: SymbolExportLevel::Rust, | |
| 230 | kind: SymbolExportKind::Text, | |
| 231 | used: false, | |
| 232 | }, | |
| 233 | )); | |
| 217 | symbols.push((exported_symbol, SymbolExportInfo { | |
| 218 | level: SymbolExportLevel::Rust, | |
| 219 | kind: SymbolExportKind::Text, | |
| 220 | used: false, | |
| 221 | })); | |
| 234 | 222 | } |
| 235 | 223 | |
| 236 | 224 | let exported_symbol = |
| 237 | 225 | ExportedSymbol::NoDefId(SymbolName::new(tcx, NO_ALLOC_SHIM_IS_UNSTABLE)); |
| 238 | symbols.push(( | |
| 239 | exported_symbol, | |
| 240 | SymbolExportInfo { | |
| 241 | level: SymbolExportLevel::Rust, | |
| 242 | kind: SymbolExportKind::Data, | |
| 243 | used: false, | |
| 244 | }, | |
| 245 | )) | |
| 226 | symbols.push((exported_symbol, SymbolExportInfo { | |
| 227 | level: SymbolExportLevel::Rust, | |
| 228 | kind: SymbolExportKind::Data, | |
| 229 | used: false, | |
| 230 | })) | |
| 246 | 231 | } |
| 247 | 232 | |
| 248 | 233 | if tcx.sess.instrument_coverage() || tcx.sess.opts.cg.profile_generate.enabled() { |
| ... | ... | @@ -254,14 +239,11 @@ fn exported_symbols_provider_local( |
| 254 | 239 | |
| 255 | 240 | symbols.extend(PROFILER_WEAK_SYMBOLS.iter().map(|sym| { |
| 256 | 241 | let exported_symbol = ExportedSymbol::NoDefId(SymbolName::new(tcx, sym)); |
| 257 | ( | |
| 258 | exported_symbol, | |
| 259 | SymbolExportInfo { | |
| 260 | level: SymbolExportLevel::C, | |
| 261 | kind: SymbolExportKind::Data, | |
| 262 | used: false, | |
| 263 | }, | |
| 264 | ) | |
| 242 | (exported_symbol, SymbolExportInfo { | |
| 243 | level: SymbolExportLevel::C, | |
| 244 | kind: SymbolExportKind::Data, | |
| 245 | used: false, | |
| 246 | }) | |
| 265 | 247 | })); |
| 266 | 248 | } |
| 267 | 249 | |
| ... | ... | @@ -279,14 +261,11 @@ fn exported_symbols_provider_local( |
| 279 | 261 | |
| 280 | 262 | symbols.extend(msan_weak_symbols.into_iter().map(|sym| { |
| 281 | 263 | let exported_symbol = ExportedSymbol::NoDefId(SymbolName::new(tcx, sym)); |
| 282 | ( | |
| 283 | exported_symbol, | |
| 284 | SymbolExportInfo { | |
| 285 | level: SymbolExportLevel::C, | |
| 286 | kind: SymbolExportKind::Data, | |
| 287 | used: false, | |
| 288 | }, | |
| 289 | ) | |
| 264 | (exported_symbol, SymbolExportInfo { | |
| 265 | level: SymbolExportLevel::C, | |
| 266 | kind: SymbolExportKind::Data, | |
| 267 | used: false, | |
| 268 | }) | |
| 290 | 269 | })); |
| 291 | 270 | } |
| 292 | 271 | |
| ... | ... | @@ -296,14 +275,11 @@ fn exported_symbols_provider_local( |
| 296 | 275 | let symbol_name = metadata_symbol_name(tcx); |
| 297 | 276 | let exported_symbol = ExportedSymbol::NoDefId(SymbolName::new(tcx, &symbol_name)); |
| 298 | 277 | |
| 299 | symbols.push(( | |
| 300 | exported_symbol, | |
| 301 | SymbolExportInfo { | |
| 302 | level: SymbolExportLevel::C, | |
| 303 | kind: SymbolExportKind::Data, | |
| 304 | used: true, | |
| 305 | }, | |
| 306 | )); | |
| 278 | symbols.push((exported_symbol, SymbolExportInfo { | |
| 279 | level: SymbolExportLevel::C, | |
| 280 | kind: SymbolExportKind::Data, | |
| 281 | used: true, | |
| 282 | })); | |
| 307 | 283 | } |
| 308 | 284 | |
| 309 | 285 | if tcx.sess.opts.share_generics() && tcx.local_crate_exports_generics() { |
| ... | ... | @@ -338,14 +314,11 @@ fn exported_symbols_provider_local( |
| 338 | 314 | MonoItem::Fn(Instance { def: InstanceKind::Item(def), args }) => { |
| 339 | 315 | if args.non_erasable_generics(tcx, def).next().is_some() { |
| 340 | 316 | let symbol = ExportedSymbol::Generic(def, args); |
| 341 | symbols.push(( | |
| 342 | symbol, | |
| 343 | SymbolExportInfo { | |
| 344 | level: SymbolExportLevel::Rust, | |
| 345 | kind: SymbolExportKind::Text, | |
| 346 | used: false, | |
| 347 | }, | |
| 348 | )); | |
| 317 | symbols.push((symbol, SymbolExportInfo { | |
| 318 | level: SymbolExportLevel::Rust, | |
| 319 | kind: SymbolExportKind::Text, | |
| 320 | used: false, | |
| 321 | })); | |
| 349 | 322 | } |
| 350 | 323 | } |
| 351 | 324 | MonoItem::Fn(Instance { def: InstanceKind::DropGlue(def_id, Some(ty)), args }) => { |
| ... | ... | @@ -354,14 +327,11 @@ fn exported_symbols_provider_local( |
| 354 | 327 | args.non_erasable_generics(tcx, def_id).next(), |
| 355 | 328 | Some(GenericArgKind::Type(ty)) |
| 356 | 329 | ); |
| 357 | symbols.push(( | |
| 358 | ExportedSymbol::DropGlue(ty), | |
| 359 | SymbolExportInfo { | |
| 360 | level: SymbolExportLevel::Rust, | |
| 361 | kind: SymbolExportKind::Text, | |
| 362 | used: false, | |
| 363 | }, | |
| 364 | )); | |
| 330 | symbols.push((ExportedSymbol::DropGlue(ty), SymbolExportInfo { | |
| 331 | level: SymbolExportLevel::Rust, | |
| 332 | kind: SymbolExportKind::Text, | |
| 333 | used: false, | |
| 334 | })); | |
| 365 | 335 | } |
| 366 | 336 | MonoItem::Fn(Instance { |
| 367 | 337 | def: InstanceKind::AsyncDropGlueCtorShim(def_id, Some(ty)), |
| ... | ... | @@ -372,14 +342,11 @@ fn exported_symbols_provider_local( |
| 372 | 342 | args.non_erasable_generics(tcx, def_id).next(), |
| 373 | 343 | Some(GenericArgKind::Type(ty)) |
| 374 | 344 | ); |
| 375 | symbols.push(( | |
| 376 | ExportedSymbol::AsyncDropGlueCtorShim(ty), | |
| 377 | SymbolExportInfo { | |
| 378 | level: SymbolExportLevel::Rust, | |
| 379 | kind: SymbolExportKind::Text, | |
| 380 | used: false, | |
| 381 | }, | |
| 382 | )); | |
| 345 | symbols.push((ExportedSymbol::AsyncDropGlueCtorShim(ty), SymbolExportInfo { | |
| 346 | level: SymbolExportLevel::Rust, | |
| 347 | kind: SymbolExportKind::Text, | |
| 348 | used: false, | |
| 349 | })); | |
| 383 | 350 | } |
| 384 | 351 | _ => { |
| 385 | 352 | // Any other symbols don't qualify for sharing |
compiler/rustc_codegen_ssa/src/back/write.rs+5-5| ... | ... | @@ -2,8 +2,8 @@ use std::any::Any; |
| 2 | 2 | use std::assert_matches::assert_matches; |
| 3 | 3 | use std::marker::PhantomData; |
| 4 | 4 | use std::path::{Path, PathBuf}; |
| 5 | use std::sync::mpsc::{channel, Receiver, Sender}; | |
| 6 | 5 | use std::sync::Arc; |
| 6 | use std::sync::mpsc::{Receiver, Sender, channel}; | |
| 7 | 7 | use std::{fs, io, mem, str, thread}; |
| 8 | 8 | |
| 9 | 9 | use jobserver::{Acquired, Client}; |
| ... | ... | @@ -23,16 +23,16 @@ use rustc_hir::def_id::{CrateNum, LOCAL_CRATE}; |
| 23 | 23 | use rustc_incremental::{ |
| 24 | 24 | copy_cgu_workproduct_to_incr_comp_cache_dir, in_incr_comp_dir, in_incr_comp_dir_sess, |
| 25 | 25 | }; |
| 26 | use rustc_metadata::fs::copy_to_stdout; | |
| 27 | 26 | use rustc_metadata::EncodedMetadata; |
| 27 | use rustc_metadata::fs::copy_to_stdout; | |
| 28 | 28 | use rustc_middle::bug; |
| 29 | 29 | use rustc_middle::dep_graph::{WorkProduct, WorkProductId}; |
| 30 | 30 | use rustc_middle::middle::exported_symbols::SymbolExportInfo; |
| 31 | 31 | use rustc_middle::ty::TyCtxt; |
| 32 | use rustc_session::Session; | |
| 32 | 33 | use rustc_session::config::{ |
| 33 | 34 | self, CrateType, Lto, OutFileName, OutputFilenames, OutputType, Passes, SwitchWithOptPath, |
| 34 | 35 | }; |
| 35 | use rustc_session::Session; | |
| 36 | 36 | use rustc_span::source_map::SourceMap; |
| 37 | 37 | use rustc_span::symbol::sym; |
| 38 | 38 | use rustc_span::{BytePos, FileName, InnerSpan, Pos, Span}; |
| ... | ... | @@ -45,8 +45,8 @@ use super::symbol_export::symbol_name_for_instance_in_crate; |
| 45 | 45 | use crate::errors::ErrorCreatingRemarkDir; |
| 46 | 46 | use crate::traits::*; |
| 47 | 47 | use crate::{ |
| 48 | errors, CachedModuleCodegen, CodegenResults, CompiledModule, CrateInfo, ModuleCodegen, | |
| 49 | ModuleKind, | |
| 48 | CachedModuleCodegen, CodegenResults, CompiledModule, CrateInfo, ModuleCodegen, ModuleKind, | |
| 49 | errors, | |
| 50 | 50 | }; |
| 51 | 51 | |
| 52 | 52 | const PRE_LTO_BC_EXT: &str = "pre-lto.bc"; |
compiler/rustc_codegen_ssa/src/base.rs+7-7| ... | ... | @@ -3,7 +3,7 @@ use std::collections::BTreeSet; |
| 3 | 3 | use std::time::{Duration, Instant}; |
| 4 | 4 | |
| 5 | 5 | use itertools::Itertools; |
| 6 | use rustc_ast::expand::allocator::{global_fn_name, AllocatorKind, ALLOCATOR_METHODS}; | |
| 6 | use rustc_ast::expand::allocator::{ALLOCATOR_METHODS, AllocatorKind, global_fn_name}; | |
| 7 | 7 | use rustc_attr as attr; |
| 8 | 8 | use rustc_data_structures::fx::{FxHashMap, FxIndexSet}; |
| 9 | 9 | use rustc_data_structures::profiling::{get_resident_set_size, print_time_passes_entry}; |
| ... | ... | @@ -17,15 +17,15 @@ use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs; |
| 17 | 17 | use rustc_middle::middle::debugger_visualizer::{DebuggerVisualizerFile, DebuggerVisualizerType}; |
| 18 | 18 | use rustc_middle::middle::exported_symbols::SymbolExportKind; |
| 19 | 19 | use rustc_middle::middle::{exported_symbols, lang_items}; |
| 20 | use rustc_middle::mir::mono::{CodegenUnit, CodegenUnitNameBuilder, MonoItem}; | |
| 21 | 20 | use rustc_middle::mir::BinOp; |
| 21 | use rustc_middle::mir::mono::{CodegenUnit, CodegenUnitNameBuilder, MonoItem}; | |
| 22 | 22 | use rustc_middle::query::Providers; |
| 23 | 23 | use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf, TyAndLayout}; |
| 24 | 24 | use rustc_middle::ty::{self, Instance, Ty, TyCtxt}; |
| 25 | use rustc_session::config::{self, CrateType, EntryFnType, OptLevel, OutputType}; | |
| 26 | 25 | use rustc_session::Session; |
| 26 | use rustc_session::config::{self, CrateType, EntryFnType, OptLevel, OutputType}; | |
| 27 | 27 | use rustc_span::symbol::sym; |
| 28 | use rustc_span::{Symbol, DUMMY_SP}; | |
| 28 | use rustc_span::{DUMMY_SP, Symbol}; | |
| 29 | 29 | use rustc_target::abi::FIRST_VARIANT; |
| 30 | 30 | use tracing::{debug, info}; |
| 31 | 31 | |
| ... | ... | @@ -33,15 +33,15 @@ use crate::assert_module_sources::CguReuse; |
| 33 | 33 | use crate::back::link::are_upstream_rust_objects_already_included; |
| 34 | 34 | use crate::back::metadata::create_compressed_metadata_file; |
| 35 | 35 | use crate::back::write::{ |
| 36 | compute_per_cgu_lto_type, start_async_codegen, submit_codegened_module_to_llvm, | |
| 37 | submit_post_lto_module_to_llvm, submit_pre_lto_module_to_llvm, ComputedLtoType, OngoingCodegen, | |
| 36 | ComputedLtoType, OngoingCodegen, compute_per_cgu_lto_type, start_async_codegen, | |
| 37 | submit_codegened_module_to_llvm, submit_post_lto_module_to_llvm, submit_pre_lto_module_to_llvm, | |
| 38 | 38 | }; |
| 39 | 39 | use crate::common::{self, IntPredicate, RealPredicate, TypeKind}; |
| 40 | 40 | use crate::mir::operand::OperandValue; |
| 41 | 41 | use crate::mir::place::PlaceRef; |
| 42 | 42 | use crate::traits::*; |
| 43 | 43 | use crate::{ |
| 44 | errors, meth, mir, CachedModuleCodegen, CompiledModule, CrateInfo, ModuleCodegen, ModuleKind, | |
| 44 | CachedModuleCodegen, CompiledModule, CrateInfo, ModuleCodegen, ModuleKind, errors, meth, mir, | |
| 45 | 45 | }; |
| 46 | 46 | |
| 47 | 47 | pub(crate) fn bin_op_to_icmp_predicate(op: BinOp, signed: bool) -> IntPredicate { |
compiler/rustc_codegen_ssa/src/codegen_attrs.rs+7-7| ... | ... | @@ -1,12 +1,12 @@ |
| 1 | use rustc_ast::{ast, attr, MetaItemKind, NestedMetaItem}; | |
| 2 | use rustc_attr::{list_contains_name, InlineAttr, InstructionSetAttr, OptimizeAttr}; | |
| 1 | use rustc_ast::{MetaItemKind, NestedMetaItem, ast, attr}; | |
| 2 | use rustc_attr::{InlineAttr, InstructionSetAttr, OptimizeAttr, list_contains_name}; | |
| 3 | 3 | use rustc_errors::codes::*; |
| 4 | use rustc_errors::{struct_span_code_err, DiagMessage, SubdiagMessage}; | |
| 4 | use rustc_errors::{DiagMessage, SubdiagMessage, struct_span_code_err}; | |
| 5 | 5 | use rustc_hir as hir; |
| 6 | 6 | use rustc_hir::def::DefKind; |
| 7 | use rustc_hir::def_id::{DefId, LocalDefId, LOCAL_CRATE}; | |
| 7 | use rustc_hir::def_id::{DefId, LOCAL_CRATE, LocalDefId}; | |
| 8 | 8 | use rustc_hir::weak_lang_items::WEAK_LANG_ITEMS; |
| 9 | use rustc_hir::{lang_items, LangItem}; | |
| 9 | use rustc_hir::{LangItem, lang_items}; | |
| 10 | 10 | use rustc_middle::middle::codegen_fn_attrs::{ |
| 11 | 11 | CodegenFnAttrFlags, CodegenFnAttrs, PatchableFunctionEntry, |
| 12 | 12 | }; |
| ... | ... | @@ -16,8 +16,8 @@ use rustc_middle::ty::{self as ty, TyCtxt}; |
| 16 | 16 | use rustc_session::lint; |
| 17 | 17 | use rustc_session::parse::feature_err; |
| 18 | 18 | use rustc_span::symbol::Ident; |
| 19 | use rustc_span::{sym, Span}; | |
| 20 | use rustc_target::spec::{abi, SanitizerSet}; | |
| 19 | use rustc_span::{Span, sym}; | |
| 20 | use rustc_target::spec::{SanitizerSet, abi}; | |
| 21 | 21 | |
| 22 | 22 | use crate::errors; |
| 23 | 23 | use crate::target_features::{check_target_feature_trait_unsafe, from_target_feature}; |
compiler/rustc_codegen_ssa/src/errors.rs+1-1| ... | ... | @@ -10,8 +10,8 @@ use rustc_errors::{ |
| 10 | 10 | Diag, DiagArgValue, DiagCtxtHandle, Diagnostic, EmissionGuarantee, IntoDiagArg, Level, |
| 11 | 11 | }; |
| 12 | 12 | use rustc_macros::Diagnostic; |
| 13 | use rustc_middle::ty::layout::LayoutError; | |
| 14 | 13 | use rustc_middle::ty::Ty; |
| 14 | use rustc_middle::ty::layout::LayoutError; | |
| 15 | 15 | use rustc_span::{Span, Symbol}; |
| 16 | 16 | use rustc_type_ir::FloatTy; |
| 17 | 17 |
compiler/rustc_codegen_ssa/src/lib.rs+1-1| ... | ... | @@ -37,10 +37,10 @@ use rustc_middle::middle::exported_symbols::SymbolExportKind; |
| 37 | 37 | use rustc_middle::util::Providers; |
| 38 | 38 | use rustc_serialize::opaque::{FileEncoder, MemDecoder}; |
| 39 | 39 | use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; |
| 40 | use rustc_session::Session; | |
| 40 | 41 | use rustc_session::config::{CrateType, OutputFilenames, OutputType, RUST_CGU_EXT}; |
| 41 | 42 | use rustc_session::cstore::{self, CrateSource}; |
| 42 | 43 | use rustc_session::utils::NativeLibKind; |
| 43 | use rustc_session::Session; | |
| 44 | 44 | use rustc_span::symbol::Symbol; |
| 45 | 45 | |
| 46 | 46 | pub mod assert_module_sources; |
compiler/rustc_codegen_ssa/src/mir/analyze.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ use rustc_data_structures::graph::dominators::Dominators; |
| 5 | 5 | use rustc_index::bit_set::BitSet; |
| 6 | 6 | use rustc_index::{IndexSlice, IndexVec}; |
| 7 | 7 | use rustc_middle::mir::visit::{MutatingUseContext, NonMutatingUseContext, PlaceContext, Visitor}; |
| 8 | use rustc_middle::mir::{self, traversal, DefLocation, Location, TerminatorKind}; | |
| 8 | use rustc_middle::mir::{self, DefLocation, Location, TerminatorKind, traversal}; | |
| 9 | 9 | use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf}; |
| 10 | 10 | use rustc_middle::{bug, span_bug}; |
| 11 | 11 | use tracing::debug; |
compiler/rustc_codegen_ssa/src/mir/block.rs+6-6| ... | ... | @@ -10,7 +10,7 @@ use rustc_middle::ty::{self, Instance, Ty}; |
| 10 | 10 | use rustc_middle::{bug, span_bug}; |
| 11 | 11 | use rustc_session::config::OptLevel; |
| 12 | 12 | use rustc_span::source_map::Spanned; |
| 13 | use rustc_span::{sym, Span}; | |
| 13 | use rustc_span::{Span, sym}; | |
| 14 | 14 | use rustc_target::abi::call::{ArgAbi, FnAbi, PassMode, Reg}; |
| 15 | 15 | use rustc_target::abi::{self, HasDataLayout, WrappingRange}; |
| 16 | 16 | use rustc_target::spec::abi::Abi; |
| ... | ... | @@ -24,7 +24,7 @@ use crate::base::{self, is_call_from_compiler_builtins_to_upstream_monomorphizat |
| 24 | 24 | use crate::common::{self, IntPredicate}; |
| 25 | 25 | use crate::errors::CompilerBuiltinsCannotCall; |
| 26 | 26 | use crate::traits::*; |
| 27 | use crate::{meth, MemFlags}; | |
| 27 | use crate::{MemFlags, meth}; | |
| 28 | 28 | |
| 29 | 29 | // Indicates if we are in the middle of merging a BB's successor into it. This |
| 30 | 30 | // can happen when BB jumps directly to its successor and the successor has no |
| ... | ... | @@ -1590,10 +1590,10 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { |
| 1590 | 1590 | if let Some(slot) = self.personality_slot { |
| 1591 | 1591 | slot |
| 1592 | 1592 | } else { |
| 1593 | let layout = cx.layout_of(Ty::new_tup( | |
| 1594 | cx.tcx(), | |
| 1595 | &[Ty::new_mut_ptr(cx.tcx(), cx.tcx().types.u8), cx.tcx().types.i32], | |
| 1596 | )); | |
| 1593 | let layout = cx.layout_of(Ty::new_tup(cx.tcx(), &[ | |
| 1594 | Ty::new_mut_ptr(cx.tcx(), cx.tcx().types.u8), | |
| 1595 | cx.tcx().types.i32, | |
| 1596 | ])); | |
| 1597 | 1597 | let slot = PlaceRef::alloca(bx, layout); |
| 1598 | 1598 | self.personality_slot = Some(slot); |
| 1599 | 1599 | slot |
compiler/rustc_codegen_ssa/src/mir/coverageinfo.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | use rustc_middle::mir::coverage::CoverageKind; | |
| 2 | 1 | use rustc_middle::mir::SourceScope; |
| 2 | use rustc_middle::mir::coverage::CoverageKind; | |
| 3 | 3 | |
| 4 | 4 | use super::FunctionCx; |
| 5 | 5 | use crate::traits::*; |
compiler/rustc_codegen_ssa/src/mir/debuginfo.rs+2-2| ... | ... | @@ -8,8 +8,8 @@ use rustc_middle::ty::layout::{LayoutOf, TyAndLayout}; |
| 8 | 8 | use rustc_middle::ty::{Instance, Ty}; |
| 9 | 9 | use rustc_middle::{bug, mir, ty}; |
| 10 | 10 | use rustc_session::config::DebugInfo; |
| 11 | use rustc_span::symbol::{kw, Symbol}; | |
| 12 | use rustc_span::{hygiene, BytePos, Span}; | |
| 11 | use rustc_span::symbol::{Symbol, kw}; | |
| 12 | use rustc_span::{BytePos, Span, hygiene}; | |
| 13 | 13 | use rustc_target::abi::{Abi, FieldIdx, FieldsShape, Size, VariantIdx}; |
| 14 | 14 | |
| 15 | 15 | use super::operand::{OperandRef, OperandValue}; |
compiler/rustc_codegen_ssa/src/mir/intrinsic.rs+4-4| ... | ... | @@ -1,16 +1,16 @@ |
| 1 | 1 | use rustc_middle::ty::{self, Ty, TyCtxt}; |
| 2 | 2 | use rustc_middle::{bug, span_bug}; |
| 3 | 3 | use rustc_session::config::OptLevel; |
| 4 | use rustc_span::{sym, Span}; | |
| 5 | use rustc_target::abi::call::{FnAbi, PassMode}; | |
| 4 | use rustc_span::{Span, sym}; | |
| 6 | 5 | use rustc_target::abi::WrappingRange; |
| 6 | use rustc_target::abi::call::{FnAbi, PassMode}; | |
| 7 | 7 | |
| 8 | use super::FunctionCx; | |
| 8 | 9 | use super::operand::OperandRef; |
| 9 | 10 | use super::place::PlaceRef; |
| 10 | use super::FunctionCx; | |
| 11 | 11 | use crate::errors::InvalidMonomorphization; |
| 12 | 12 | use crate::traits::*; |
| 13 | use crate::{errors, meth, size_of_val, MemFlags}; | |
| 13 | use crate::{MemFlags, errors, meth, size_of_val}; | |
| 14 | 14 | |
| 15 | 15 | fn copy_intrinsic<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>( |
| 16 | 16 | bx: &mut Bx, |
compiler/rustc_codegen_ssa/src/mir/mod.rs+2-2| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | use std::iter; |
| 2 | 2 | |
| 3 | use rustc_index::bit_set::BitSet; | |
| 4 | 3 | use rustc_index::IndexVec; |
| 4 | use rustc_index::bit_set::BitSet; | |
| 5 | 5 | use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; |
| 6 | use rustc_middle::mir::{traversal, UnwindTerminateReason}; | |
| 6 | use rustc_middle::mir::{UnwindTerminateReason, traversal}; | |
| 7 | 7 | use rustc_middle::ty::layout::{FnAbiOf, HasTyCtxt, TyAndLayout}; |
| 8 | 8 | use rustc_middle::ty::{self, Instance, Ty, TyCtxt, TypeFoldable, TypeVisitableExt}; |
| 9 | 9 | use rustc_middle::{bug, mir, span_bug}; |
compiler/rustc_codegen_ssa/src/mir/operand.rs+3-3| ... | ... | @@ -4,17 +4,17 @@ use std::fmt; |
| 4 | 4 | use arrayvec::ArrayVec; |
| 5 | 5 | use either::Either; |
| 6 | 6 | use rustc_middle::bug; |
| 7 | use rustc_middle::mir::interpret::{alloc_range, Pointer, Scalar}; | |
| 7 | use rustc_middle::mir::interpret::{Pointer, Scalar, alloc_range}; | |
| 8 | 8 | use rustc_middle::mir::{self, ConstValue}; |
| 9 | use rustc_middle::ty::layout::{LayoutOf, TyAndLayout}; | |
| 10 | 9 | use rustc_middle::ty::Ty; |
| 10 | use rustc_middle::ty::layout::{LayoutOf, TyAndLayout}; | |
| 11 | 11 | use rustc_target::abi::{self, Abi, Align, Size}; |
| 12 | 12 | use tracing::debug; |
| 13 | 13 | |
| 14 | 14 | use super::place::{PlaceRef, PlaceValue}; |
| 15 | 15 | use super::{FunctionCx, LocalRef}; |
| 16 | 16 | use crate::traits::*; |
| 17 | use crate::{size_of_val, MemFlags}; | |
| 17 | use crate::{MemFlags, size_of_val}; | |
| 18 | 18 | |
| 19 | 19 | /// The representation of a Rust value. The enum variant is in fact |
| 20 | 20 | /// uniquely determined by the value's type, but is kept as a |
compiler/rustc_codegen_ssa/src/mir/place.rs+8-9| ... | ... | @@ -415,11 +415,10 @@ impl<'a, 'tcx, V: CodegenObject> PlaceRef<'tcx, V> { |
| 415 | 415 | layout.size |
| 416 | 416 | }; |
| 417 | 417 | |
| 418 | let llval = bx.inbounds_gep( | |
| 419 | bx.cx().backend_type(self.layout), | |
| 420 | self.val.llval, | |
| 421 | &[bx.cx().const_usize(0), llindex], | |
| 422 | ); | |
| 418 | let llval = bx.inbounds_gep(bx.cx().backend_type(self.layout), self.val.llval, &[ | |
| 419 | bx.cx().const_usize(0), | |
| 420 | llindex, | |
| 421 | ]); | |
| 423 | 422 | let align = self.val.align.restrict_for_offset(offset); |
| 424 | 423 | PlaceValue::new_sized(llval, align).with_type(layout) |
| 425 | 424 | } |
| ... | ... | @@ -470,10 +469,10 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { |
| 470 | 469 | LocalRef::Operand(..) => { |
| 471 | 470 | if place_ref.is_indirect_first_projection() { |
| 472 | 471 | base = 1; |
| 473 | let cg_base = self.codegen_consume( | |
| 474 | bx, | |
| 475 | mir::PlaceRef { projection: &place_ref.projection[..0], ..place_ref }, | |
| 476 | ); | |
| 472 | let cg_base = self.codegen_consume(bx, mir::PlaceRef { | |
| 473 | projection: &place_ref.projection[..0], | |
| 474 | ..place_ref | |
| 475 | }); | |
| 477 | 476 | cg_base.deref(bx.cx()) |
| 478 | 477 | } else { |
| 479 | 478 | bug!("using operand local {:?} as place", place_ref); |
compiler/rustc_codegen_ssa/src/mir/rvalue.rs+3-3| ... | ... | @@ -6,8 +6,8 @@ use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf, TyAndLayout}; |
| 6 | 6 | use rustc_middle::ty::{self, Instance, Ty, TyCtxt}; |
| 7 | 7 | use rustc_middle::{bug, mir, span_bug}; |
| 8 | 8 | use rustc_session::config::OptLevel; |
| 9 | use rustc_span::{Span, DUMMY_SP}; | |
| 10 | use rustc_target::abi::{self, FieldIdx, FIRST_VARIANT}; | |
| 9 | use rustc_span::{DUMMY_SP, Span}; | |
| 10 | use rustc_target::abi::{self, FIRST_VARIANT, FieldIdx}; | |
| 11 | 11 | use tracing::{debug, instrument}; |
| 12 | 12 | |
| 13 | 13 | use super::operand::{OperandRef, OperandValue}; |
| ... | ... | @@ -15,7 +15,7 @@ use super::place::PlaceRef; |
| 15 | 15 | use super::{FunctionCx, LocalRef}; |
| 16 | 16 | use crate::common::IntPredicate; |
| 17 | 17 | use crate::traits::*; |
| 18 | use crate::{base, MemFlags}; | |
| 18 | use crate::{MemFlags, base}; | |
| 19 | 19 | |
| 20 | 20 | impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { |
| 21 | 21 | #[instrument(level = "trace", skip(self, bx))] |
compiler/rustc_codegen_ssa/src/mono_item.rs+1-1| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use rustc_hir as hir; |
| 2 | 2 | use rustc_middle::mir::interpret::ErrorHandled; |
| 3 | 3 | use rustc_middle::mir::mono::{Linkage, MonoItem, Visibility}; |
| 4 | use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf}; | |
| 5 | 4 | use rustc_middle::ty::Instance; |
| 5 | use rustc_middle::ty::layout::{HasTyCtxt, LayoutOf}; | |
| 6 | 6 | use rustc_middle::{span_bug, ty}; |
| 7 | 7 | use tracing::debug; |
| 8 | 8 |
compiler/rustc_codegen_ssa/src/target_features.rs+2-2| ... | ... | @@ -4,14 +4,14 @@ use rustc_data_structures::fx::FxIndexSet; |
| 4 | 4 | use rustc_data_structures::unord::{UnordMap, UnordSet}; |
| 5 | 5 | use rustc_errors::Applicability; |
| 6 | 6 | use rustc_hir::def::DefKind; |
| 7 | use rustc_hir::def_id::{DefId, LocalDefId, LOCAL_CRATE}; | |
| 7 | use rustc_hir::def_id::{DefId, LOCAL_CRATE, LocalDefId}; | |
| 8 | 8 | use rustc_middle::bug; |
| 9 | 9 | use rustc_middle::middle::codegen_fn_attrs::TargetFeature; |
| 10 | 10 | use rustc_middle::query::Providers; |
| 11 | 11 | use rustc_middle::ty::TyCtxt; |
| 12 | 12 | use rustc_session::parse::feature_err; |
| 13 | use rustc_span::symbol::{sym, Symbol}; | |
| 14 | 13 | use rustc_span::Span; |
| 14 | use rustc_span::symbol::{Symbol, sym}; | |
| 15 | 15 | |
| 16 | 16 | use crate::errors; |
| 17 | 17 |
compiler/rustc_codegen_ssa/src/traits/backend.rs+3-3| ... | ... | @@ -5,17 +5,17 @@ use rustc_ast::expand::allocator::AllocatorKind; |
| 5 | 5 | use rustc_data_structures::fx::FxIndexMap; |
| 6 | 6 | use rustc_data_structures::sync::{DynSend, DynSync}; |
| 7 | 7 | use rustc_errors::ErrorGuaranteed; |
| 8 | use rustc_metadata::creader::MetadataLoaderDyn; | |
| 9 | 8 | use rustc_metadata::EncodedMetadata; |
| 9 | use rustc_metadata::creader::MetadataLoaderDyn; | |
| 10 | 10 | use rustc_middle::dep_graph::{WorkProduct, WorkProductId}; |
| 11 | 11 | use rustc_middle::ty::TyCtxt; |
| 12 | 12 | use rustc_middle::util::Providers; |
| 13 | use rustc_session::config::{self, OutputFilenames, PrintRequest}; | |
| 14 | 13 | use rustc_session::Session; |
| 14 | use rustc_session::config::{self, OutputFilenames, PrintRequest}; | |
| 15 | 15 | use rustc_span::symbol::Symbol; |
| 16 | 16 | |
| 17 | use super::write::WriteBackendMethods; | |
| 18 | 17 | use super::CodegenObject; |
| 18 | use super::write::WriteBackendMethods; | |
| 19 | 19 | use crate::back::write::TargetMachineFactoryFn; |
| 20 | 20 | use crate::{CodegenResults, ModuleCodegen}; |
| 21 | 21 |
compiler/rustc_codegen_ssa/src/traits/builder.rs+1-1| ... | ... | @@ -18,12 +18,12 @@ use super::intrinsic::IntrinsicCallBuilderMethods; |
| 18 | 18 | use super::misc::MiscCodegenMethods; |
| 19 | 19 | use super::type_::{ArgAbiBuilderMethods, BaseTypeCodegenMethods, LayoutTypeCodegenMethods}; |
| 20 | 20 | use super::{CodegenMethods, StaticBuilderMethods}; |
| 21 | use crate::MemFlags; | |
| 21 | 22 | use crate::common::{ |
| 22 | 23 | AtomicOrdering, AtomicRmwBinOp, IntPredicate, RealPredicate, SynchronizationScope, TypeKind, |
| 23 | 24 | }; |
| 24 | 25 | use crate::mir::operand::{OperandRef, OperandValue}; |
| 25 | 26 | use crate::mir::place::{PlaceRef, PlaceValue}; |
| 26 | use crate::MemFlags; | |
| 27 | 27 | |
| 28 | 28 | #[derive(Copy, Clone, Debug)] |
| 29 | 29 | pub enum OverflowOp { |
compiler/rustc_codegen_ssa/src/traits/debuginfo.rs+1-1| ... | ... | @@ -3,8 +3,8 @@ use std::ops::Range; |
| 3 | 3 | use rustc_middle::mir; |
| 4 | 4 | use rustc_middle::ty::{Instance, PolyExistentialTraitRef, Ty}; |
| 5 | 5 | use rustc_span::{SourceFile, Span, Symbol}; |
| 6 | use rustc_target::abi::call::FnAbi; | |
| 7 | 6 | use rustc_target::abi::Size; |
| 7 | use rustc_target::abi::call::FnAbi; | |
| 8 | 8 | |
| 9 | 9 | use super::BackendTypes; |
| 10 | 10 | use crate::mir::debuginfo::{FunctionDebugContext, VariableKind}; |
compiler/rustc_codegen_ssa/src/traits/mod.rs+1-1| ... | ... | @@ -27,8 +27,8 @@ mod write; |
| 27 | 27 | |
| 28 | 28 | use std::fmt; |
| 29 | 29 | |
| 30 | use rustc_middle::ty::layout::{FnAbiOf, LayoutOf, TyAndLayout}; | |
| 31 | 30 | use rustc_middle::ty::Ty; |
| 31 | use rustc_middle::ty::layout::{FnAbiOf, LayoutOf, TyAndLayout}; | |
| 32 | 32 | use rustc_target::abi::call::FnAbi; |
| 33 | 33 | |
| 34 | 34 | pub use self::abi::AbiBuilderMethods; |
compiler/rustc_codegen_ssa/src/traits/type_.rs+1-1| ... | ... | @@ -4,8 +4,8 @@ use rustc_middle::ty::{self, Ty}; |
| 4 | 4 | use rustc_target::abi::call::{ArgAbi, CastTarget, FnAbi, Reg}; |
| 5 | 5 | use rustc_target::abi::{AddressSpace, Float, Integer}; |
| 6 | 6 | |
| 7 | use super::misc::MiscCodegenMethods; | |
| 8 | 7 | use super::BackendTypes; |
| 8 | use super::misc::MiscCodegenMethods; | |
| 9 | 9 | use crate::common::TypeKind; |
| 10 | 10 | use crate::mir::place::PlaceRef; |
| 11 | 11 |
compiler/rustc_const_eval/src/check_consts/check.rs+2-2| ... | ... | @@ -16,10 +16,10 @@ use rustc_middle::mir::*; |
| 16 | 16 | use rustc_middle::span_bug; |
| 17 | 17 | use rustc_middle::ty::adjustment::PointerCoercion; |
| 18 | 18 | use rustc_middle::ty::{self, Instance, InstanceKind, Ty, TypeVisitableExt}; |
| 19 | use rustc_mir_dataflow::Analysis; | |
| 19 | 20 | use rustc_mir_dataflow::impls::MaybeStorageLive; |
| 20 | 21 | use rustc_mir_dataflow::storage::always_storage_live_locals; |
| 21 | use rustc_mir_dataflow::Analysis; | |
| 22 | use rustc_span::{sym, Span, Symbol, DUMMY_SP}; | |
| 22 | use rustc_span::{DUMMY_SP, Span, Symbol, sym}; | |
| 23 | 23 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; |
| 24 | 24 | use rustc_trait_selection::traits::{self, ObligationCauseCode, ObligationCtxt}; |
| 25 | 25 | use tracing::{debug, instrument, trace}; |
compiler/rustc_const_eval/src/check_consts/ops.rs+5-5| ... | ... | @@ -2,20 +2,20 @@ |
| 2 | 2 | |
| 3 | 3 | use hir::def_id::LocalDefId; |
| 4 | 4 | use hir::{ConstContext, LangItem}; |
| 5 | use rustc_errors::codes::*; | |
| 6 | 5 | use rustc_errors::Diag; |
| 6 | use rustc_errors::codes::*; | |
| 7 | 7 | use rustc_hir as hir; |
| 8 | 8 | use rustc_hir::def_id::DefId; |
| 9 | 9 | use rustc_infer::infer::TyCtxtInferExt; |
| 10 | 10 | use rustc_infer::traits::{ImplSource, Obligation, ObligationCause}; |
| 11 | 11 | use rustc_middle::mir::CallSource; |
| 12 | 12 | use rustc_middle::span_bug; |
| 13 | use rustc_middle::ty::print::{with_no_trimmed_paths, PrintTraitRefExt as _}; | |
| 13 | use rustc_middle::ty::print::{PrintTraitRefExt as _, with_no_trimmed_paths}; | |
| 14 | 14 | use rustc_middle::ty::{ |
| 15 | self, suggest_constraining_type_param, Closure, FnDef, FnPtr, GenericArgKind, GenericArgsRef, | |
| 16 | Param, TraitRef, Ty, | |
| 15 | self, Closure, FnDef, FnPtr, GenericArgKind, GenericArgsRef, Param, TraitRef, Ty, | |
| 16 | suggest_constraining_type_param, | |
| 17 | 17 | }; |
| 18 | use rustc_middle::util::{call_kind, CallDesugaringKind, CallKind}; | |
| 18 | use rustc_middle::util::{CallDesugaringKind, CallKind, call_kind}; | |
| 19 | 19 | use rustc_session::parse::feature_err; |
| 20 | 20 | use rustc_span::symbol::sym; |
| 21 | 21 | use rustc_span::{BytePos, Pos, Span, Symbol}; |
compiler/rustc_const_eval/src/check_consts/post_drop_elaboration.rs+2-2| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | 1 | use rustc_middle::mir::visit::Visitor; |
| 2 | 2 | use rustc_middle::mir::{self, BasicBlock, Location}; |
| 3 | 3 | use rustc_middle::ty::{Ty, TyCtxt}; |
| 4 | use rustc_span::symbol::sym; | |
| 5 | 4 | use rustc_span::Span; |
| 5 | use rustc_span::symbol::sym; | |
| 6 | 6 | use tracing::trace; |
| 7 | 7 | |
| 8 | use super::ConstCx; | |
| 8 | 9 | use super::check::Qualifs; |
| 9 | 10 | use super::ops::{self, NonConstOp}; |
| 10 | 11 | use super::qualifs::{NeedsNonConstDrop, Qualif}; |
| 11 | use super::ConstCx; | |
| 12 | 12 | use crate::check_consts::rustc_allow_const_fn_unstable; |
| 13 | 13 | |
| 14 | 14 | /// Returns `true` if we should use the more precise live drop checker that runs after drop |
compiler/rustc_const_eval/src/check_consts/qualifs.rs+4-8| ... | ... | @@ -206,14 +206,10 @@ impl Qualif for NeedsNonConstDrop { |
| 206 | 206 | cx.tcx, |
| 207 | 207 | ObligationCause::dummy_with_span(cx.body.span), |
| 208 | 208 | cx.param_env, |
| 209 | ty::TraitRef::new( | |
| 210 | cx.tcx, | |
| 211 | destruct_def_id, | |
| 212 | [ | |
| 213 | ty::GenericArg::from(ty), | |
| 214 | ty::GenericArg::from(cx.tcx.expected_host_effect_param_for_body(cx.def_id())), | |
| 215 | ], | |
| 216 | ), | |
| 209 | ty::TraitRef::new(cx.tcx, destruct_def_id, [ | |
| 210 | ty::GenericArg::from(ty), | |
| 211 | ty::GenericArg::from(cx.tcx.expected_host_effect_param_for_body(cx.def_id())), | |
| 212 | ]), | |
| 217 | 213 | ); |
| 218 | 214 | |
| 219 | 215 | let infcx = cx.tcx.infer_ctxt().build(); |
compiler/rustc_const_eval/src/check_consts/resolver.rs+1-1| ... | ... | @@ -13,7 +13,7 @@ use rustc_middle::mir::{ |
| 13 | 13 | use rustc_mir_dataflow::fmt::DebugWithContext; |
| 14 | 14 | use rustc_mir_dataflow::{Analysis, AnalysisDomain, JoinSemiLattice}; |
| 15 | 15 | |
| 16 | use super::{qualifs, ConstCx, Qualif}; | |
| 16 | use super::{ConstCx, Qualif, qualifs}; | |
| 17 | 17 | |
| 18 | 18 | /// A `Visitor` that propagates qualifs between locals. This defines the transfer function of |
| 19 | 19 | /// `FlowSensitiveAnalysis`. |
compiler/rustc_const_eval/src/const_eval/dummy_machine.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ use rustc_middle::{bug, span_bug, ty}; |
| 6 | 6 | use rustc_span::def_id::DefId; |
| 7 | 7 | |
| 8 | 8 | use crate::interpret::{ |
| 9 | self, throw_machine_stop, HasStaticRootDefId, ImmTy, Immediate, InterpCx, PointerArithmetic, | |
| 9 | self, HasStaticRootDefId, ImmTy, Immediate, InterpCx, PointerArithmetic, throw_machine_stop, | |
| 10 | 10 | }; |
| 11 | 11 | |
| 12 | 12 | /// Macro for machine-specific `InterpError` without allocation. |
compiler/rustc_const_eval/src/const_eval/error.rs+2-2| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use std::mem; |
| 2 | 2 | |
| 3 | 3 | use rustc_errors::{DiagArgName, DiagArgValue, DiagMessage, Diagnostic, IntoDiagArg}; |
| 4 | use rustc_middle::mir::interpret::{Provenance, ReportedErrorInfo}; | |
| 5 | 4 | use rustc_middle::mir::AssertKind; |
| 5 | use rustc_middle::mir::interpret::{Provenance, ReportedErrorInfo}; | |
| 6 | 6 | use rustc_middle::query::TyCtxtAt; |
| 7 | 7 | use rustc_middle::ty::layout::LayoutError; |
| 8 | 8 | use rustc_middle::ty::{ConstInt, TyCtxt}; |
| ... | ... | @@ -11,7 +11,7 @@ use rustc_span::{Span, Symbol}; |
| 11 | 11 | use super::CompileTimeMachine; |
| 12 | 12 | use crate::errors::{self, FrameNote, ReportErrorExt}; |
| 13 | 13 | use crate::interpret::{ |
| 14 | err_inval, err_machine_stop, ErrorHandled, Frame, InterpError, InterpErrorInfo, MachineStopType, | |
| 14 | ErrorHandled, Frame, InterpError, InterpErrorInfo, MachineStopType, err_inval, err_machine_stop, | |
| 15 | 15 | }; |
| 16 | 16 | |
| 17 | 17 | /// The CTFE machine has some custom error kinds. |
compiler/rustc_const_eval/src/const_eval/eval_queries.rs+4-4| ... | ... | @@ -11,18 +11,18 @@ use rustc_middle::ty::layout::LayoutOf; |
| 11 | 11 | use rustc_middle::ty::print::with_no_trimmed_paths; |
| 12 | 12 | use rustc_middle::ty::{self, Ty, TyCtxt}; |
| 13 | 13 | use rustc_span::def_id::LocalDefId; |
| 14 | use rustc_span::{Span, DUMMY_SP}; | |
| 14 | use rustc_span::{DUMMY_SP, Span}; | |
| 15 | 15 | use rustc_target::abi::{self, Abi}; |
| 16 | 16 | use tracing::{debug, instrument, trace}; |
| 17 | 17 | |
| 18 | 18 | use super::{CanAccessMutGlobal, CompileTimeInterpCx, CompileTimeMachine}; |
| 19 | 19 | use crate::const_eval::CheckAlignment; |
| 20 | 20 | use crate::interpret::{ |
| 21 | create_static_alloc, eval_nullary_intrinsic, intern_const_alloc_recursive, throw_exhaust, | |
| 22 | 21 | CtfeValidationMode, GlobalId, Immediate, InternKind, InternResult, InterpCx, InterpError, |
| 23 | InterpResult, MPlaceTy, MemoryKind, OpTy, RefTracking, StackPopCleanup, | |
| 22 | InterpResult, MPlaceTy, MemoryKind, OpTy, RefTracking, StackPopCleanup, create_static_alloc, | |
| 23 | eval_nullary_intrinsic, intern_const_alloc_recursive, throw_exhaust, | |
| 24 | 24 | }; |
| 25 | use crate::{errors, CTRL_C_RECEIVED}; | |
| 25 | use crate::{CTRL_C_RECEIVED, errors}; | |
| 26 | 26 | |
| 27 | 27 | // Returns a pointer to where the result lives |
| 28 | 28 | #[instrument(level = "trace", skip(ecx, body))] |
compiler/rustc_const_eval/src/const_eval/machine.rs+7-7| ... | ... | @@ -6,14 +6,14 @@ use std::ops::ControlFlow; |
| 6 | 6 | use rustc_ast::Mutability; |
| 7 | 7 | use rustc_data_structures::fx::{FxHashMap, FxIndexMap, IndexEntry}; |
| 8 | 8 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| 9 | use rustc_hir::{self as hir, LangItem, CRATE_HIR_ID}; | |
| 9 | use rustc_hir::{self as hir, CRATE_HIR_ID, LangItem}; | |
| 10 | 10 | use rustc_middle::mir::AssertMessage; |
| 11 | 11 | use rustc_middle::query::TyCtxtAt; |
| 12 | 12 | use rustc_middle::ty::layout::{FnAbiOf, TyAndLayout}; |
| 13 | 13 | use rustc_middle::ty::{self, Ty, TyCtxt}; |
| 14 | 14 | use rustc_middle::{bug, mir}; |
| 15 | use rustc_span::symbol::{sym, Symbol}; | |
| 16 | 15 | use rustc_span::Span; |
| 16 | use rustc_span::symbol::{Symbol, sym}; | |
| 17 | 17 | use rustc_target::abi::{Align, Size}; |
| 18 | 18 | use rustc_target::spec::abi::Abi as CallAbi; |
| 19 | 19 | use tracing::debug; |
| ... | ... | @@ -22,10 +22,10 @@ use super::error::*; |
| 22 | 22 | use crate::errors::{LongRunning, LongRunningWarn}; |
| 23 | 23 | use crate::fluent_generated as fluent; |
| 24 | 24 | use crate::interpret::{ |
| 25 | self, compile_time_machine, err_ub, throw_exhaust, throw_inval, throw_ub_custom, throw_unsup, | |
| 26 | throw_unsup_format, AllocId, AllocRange, ConstAllocation, CtfeProvenance, FnArg, Frame, | |
| 27 | GlobalAlloc, ImmTy, InterpCx, InterpResult, MPlaceTy, OpTy, Pointer, PointerArithmetic, | |
| 28 | RangeSet, Scalar, StackPopCleanup, | |
| 25 | self, AllocId, AllocRange, ConstAllocation, CtfeProvenance, FnArg, Frame, GlobalAlloc, ImmTy, | |
| 26 | InterpCx, InterpResult, MPlaceTy, OpTy, Pointer, PointerArithmetic, RangeSet, Scalar, | |
| 27 | StackPopCleanup, compile_time_machine, err_ub, throw_exhaust, throw_inval, throw_ub_custom, | |
| 28 | throw_unsup, throw_unsup_format, | |
| 29 | 29 | }; |
| 30 | 30 | |
| 31 | 31 | /// When hitting this many interpreted terminators we emit a deny by default lint |
| ... | ... | @@ -203,8 +203,8 @@ impl<'tcx> CompileTimeInterpCx<'tcx> { |
| 203 | 203 | let topmost = span.ctxt().outer_expn().expansion_cause().unwrap_or(span); |
| 204 | 204 | let caller = self.tcx.sess.source_map().lookup_char_pos(topmost.lo()); |
| 205 | 205 | |
| 206 | use rustc_session::config::RemapPathScopeComponents; | |
| 207 | 206 | use rustc_session::RemapFileNameExt; |
| 207 | use rustc_session::config::RemapPathScopeComponents; | |
| 208 | 208 | ( |
| 209 | 209 | Symbol::intern( |
| 210 | 210 | &caller |
compiler/rustc_const_eval/src/const_eval/mod.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ use rustc_middle::{bug, mir}; |
| 7 | 7 | use rustc_target::abi::VariantIdx; |
| 8 | 8 | use tracing::instrument; |
| 9 | 9 | |
| 10 | use crate::interpret::{format_interp_error, InterpCx}; | |
| 10 | use crate::interpret::{InterpCx, format_interp_error}; | |
| 11 | 11 | |
| 12 | 12 | mod dummy_machine; |
| 13 | 13 | mod error; |
compiler/rustc_const_eval/src/const_eval/valtrees.rs+3-3| ... | ... | @@ -9,12 +9,12 @@ use tracing::{debug, instrument, trace}; |
| 9 | 9 | |
| 10 | 10 | use super::eval_queries::{mk_eval_cx_to_read_const_val, op_to_const}; |
| 11 | 11 | use super::machine::CompileTimeInterpCx; |
| 12 | use super::{ValTreeCreationError, ValTreeCreationResult, VALTREE_MAX_NODES}; | |
| 12 | use super::{VALTREE_MAX_NODES, ValTreeCreationError, ValTreeCreationResult}; | |
| 13 | 13 | use crate::const_eval::CanAccessMutGlobal; |
| 14 | 14 | use crate::errors::MaxNumNodesInConstErr; |
| 15 | 15 | use crate::interpret::{ |
| 16 | intern_const_alloc_recursive, ImmTy, Immediate, InternKind, MPlaceTy, MemPlaceMeta, MemoryKind, | |
| 17 | PlaceTy, Projectable, Scalar, | |
| 16 | ImmTy, Immediate, InternKind, MPlaceTy, MemPlaceMeta, MemoryKind, PlaceTy, Projectable, Scalar, | |
| 17 | intern_const_alloc_recursive, | |
| 18 | 18 | }; |
| 19 | 19 | |
| 20 | 20 | #[instrument(skip(ecx), level = "debug")] |
compiler/rustc_const_eval/src/errors.rs+5-8| ... | ... | @@ -15,8 +15,8 @@ use rustc_middle::mir::interpret::{ |
| 15 | 15 | }; |
| 16 | 16 | use rustc_middle::ty::{self, Mutability, Ty}; |
| 17 | 17 | use rustc_span::Span; |
| 18 | use rustc_target::abi::call::AdjustForForeignAbiError; | |
| 19 | 18 | use rustc_target::abi::WrappingRange; |
| 19 | use rustc_target::abi::call::AdjustForForeignAbiError; | |
| 20 | 20 | |
| 21 | 21 | use crate::interpret::InternKind; |
| 22 | 22 | |
| ... | ... | @@ -510,13 +510,10 @@ impl<'a> ReportErrorExt for UndefinedBehaviorInfo<'a> { |
| 510 | 510 | } |
| 511 | 511 | ShiftOverflow { intrinsic, shift_amount } => { |
| 512 | 512 | diag.arg("intrinsic", intrinsic); |
| 513 | diag.arg( | |
| 514 | "shift_amount", | |
| 515 | match shift_amount { | |
| 516 | Either::Left(v) => v.to_string(), | |
| 517 | Either::Right(v) => v.to_string(), | |
| 518 | }, | |
| 519 | ); | |
| 513 | diag.arg("shift_amount", match shift_amount { | |
| 514 | Either::Left(v) => v.to_string(), | |
| 515 | Either::Right(v) => v.to_string(), | |
| 516 | }); | |
| 520 | 517 | } |
| 521 | 518 | BoundsCheckFailed { len, index } => { |
| 522 | 519 | diag.arg("len", len); |
compiler/rustc_const_eval/src/interpret/call.rs+11-17| ... | ... | @@ -14,9 +14,9 @@ use rustc_target::spec::abi::Abi; |
| 14 | 14 | use tracing::{info, instrument, trace}; |
| 15 | 15 | |
| 16 | 16 | use super::{ |
| 17 | throw_ub, throw_ub_custom, throw_unsup_format, CtfeProvenance, FnVal, ImmTy, InterpCx, | |
| 18 | InterpResult, MPlaceTy, Machine, OpTy, PlaceTy, Projectable, Provenance, ReturnAction, Scalar, | |
| 19 | StackPopCleanup, StackPopInfo, | |
| 17 | CtfeProvenance, FnVal, ImmTy, InterpCx, InterpResult, MPlaceTy, Machine, OpTy, PlaceTy, | |
| 18 | Projectable, Provenance, ReturnAction, Scalar, StackPopCleanup, StackPopInfo, throw_ub, | |
| 19 | throw_ub_custom, throw_unsup_format, | |
| 20 | 20 | }; |
| 21 | 21 | use crate::fluent_generated as fluent; |
| 22 | 22 | |
| ... | ... | @@ -364,13 +364,10 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { |
| 364 | 364 | "caller ABI: {:#?}, args: {:#?}", |
| 365 | 365 | caller_fn_abi, |
| 366 | 366 | args.iter() |
| 367 | .map(|arg| ( | |
| 368 | arg.layout().ty, | |
| 369 | match arg { | |
| 370 | FnArg::Copy(op) => format!("copy({op:?})"), | |
| 371 | FnArg::InPlace(mplace) => format!("in-place({mplace:?})"), | |
| 372 | } | |
| 373 | )) | |
| 367 | .map(|arg| (arg.layout().ty, match arg { | |
| 368 | FnArg::Copy(op) => format!("copy({op:?})"), | |
| 369 | FnArg::InPlace(mplace) => format!("in-place({mplace:?})"), | |
| 370 | })) | |
| 374 | 371 | .collect::<Vec<_>>() |
| 375 | 372 | ); |
| 376 | 373 | trace!( |
| ... | ... | @@ -853,13 +850,10 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { |
| 853 | 850 | ); |
| 854 | 851 | |
| 855 | 852 | // Check `unwinding`. |
| 856 | assert_eq!( | |
| 857 | unwinding, | |
| 858 | match self.frame().loc { | |
| 859 | Left(loc) => self.body().basic_blocks[loc.block].is_cleanup, | |
| 860 | Right(_) => true, | |
| 861 | } | |
| 862 | ); | |
| 853 | assert_eq!(unwinding, match self.frame().loc { | |
| 854 | Left(loc) => self.body().basic_blocks[loc.block].is_cleanup, | |
| 855 | Right(_) => true, | |
| 856 | }); | |
| 863 | 857 | if unwinding && self.frame_idx() == 0 { |
| 864 | 858 | throw_ub_custom!(fluent::const_eval_unwind_past_top); |
| 865 | 859 | } |
compiler/rustc_const_eval/src/interpret/cast.rs+2-2| ... | ... | @@ -2,8 +2,8 @@ use std::assert_matches::assert_matches; |
| 2 | 2 | |
| 3 | 3 | use rustc_apfloat::ieee::{Double, Half, Quad, Single}; |
| 4 | 4 | use rustc_apfloat::{Float, FloatConvert}; |
| 5 | use rustc_middle::mir::interpret::{InterpResult, PointerArithmetic, Scalar}; | |
| 6 | 5 | use rustc_middle::mir::CastKind; |
| 6 | use rustc_middle::mir::interpret::{InterpResult, PointerArithmetic, Scalar}; | |
| 7 | 7 | use rustc_middle::ty::adjustment::PointerCoercion; |
| 8 | 8 | use rustc_middle::ty::layout::{IntegerExt, LayoutOf, TyAndLayout}; |
| 9 | 9 | use rustc_middle::ty::{self, FloatTy, Ty}; |
| ... | ... | @@ -14,7 +14,7 @@ use tracing::trace; |
| 14 | 14 | |
| 15 | 15 | use super::util::ensure_monomorphic_enough; |
| 16 | 16 | use super::{ |
| 17 | err_inval, throw_ub, throw_ub_custom, FnVal, ImmTy, Immediate, InterpCx, Machine, OpTy, PlaceTy, | |
| 17 | FnVal, ImmTy, Immediate, InterpCx, Machine, OpTy, PlaceTy, err_inval, throw_ub, throw_ub_custom, | |
| 18 | 18 | }; |
| 19 | 19 | use crate::fluent_generated as fluent; |
| 20 | 20 |
compiler/rustc_const_eval/src/interpret/discriminant.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ use rustc_target::abi::{self, TagEncoding, VariantIdx, Variants}; |
| 7 | 7 | use tracing::{instrument, trace}; |
| 8 | 8 | |
| 9 | 9 | use super::{ |
| 10 | err_ub, throw_ub, ImmTy, InterpCx, InterpResult, Machine, Projectable, Scalar, Writeable, | |
| 10 | ImmTy, InterpCx, InterpResult, Machine, Projectable, Scalar, Writeable, err_ub, throw_ub, | |
| 11 | 11 | }; |
| 12 | 12 | |
| 13 | 13 | impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { |
compiler/rustc_const_eval/src/interpret/eval_context.rs+5-5| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use either::{Left, Right}; |
| 2 | 2 | use rustc_errors::DiagCtxtHandle; |
| 3 | 3 | use rustc_hir::def_id::DefId; |
| 4 | use rustc_infer::infer::at::ToTrace; | |
| 5 | 4 | use rustc_infer::infer::TyCtxtInferExt; |
| 5 | use rustc_infer::infer::at::ToTrace; | |
| 6 | 6 | use rustc_infer::traits::ObligationCause; |
| 7 | 7 | use rustc_middle::mir::interpret::{ErrorHandled, InvalidMetaKind, ReportedErrorInfo}; |
| 8 | 8 | use rustc_middle::query::TyCtxtAt; |
| ... | ... | @@ -19,11 +19,11 @@ use rustc_trait_selection::traits::ObligationCtxt; |
| 19 | 19 | use tracing::{debug, instrument, trace}; |
| 20 | 20 | |
| 21 | 21 | use super::{ |
| 22 | err_inval, throw_inval, throw_ub, throw_ub_custom, Frame, FrameInfo, GlobalId, InterpErrorInfo, | |
| 23 | InterpResult, MPlaceTy, Machine, MemPlaceMeta, Memory, OpTy, Place, PlaceTy, PointerArithmetic, | |
| 24 | Projectable, Provenance, | |
| 22 | Frame, FrameInfo, GlobalId, InterpErrorInfo, InterpResult, MPlaceTy, Machine, MemPlaceMeta, | |
| 23 | Memory, OpTy, Place, PlaceTy, PointerArithmetic, Projectable, Provenance, err_inval, | |
| 24 | throw_inval, throw_ub, throw_ub_custom, | |
| 25 | 25 | }; |
| 26 | use crate::{fluent_generated as fluent, util, ReportErrorExt}; | |
| 26 | use crate::{ReportErrorExt, fluent_generated as fluent, util}; | |
| 27 | 27 | |
| 28 | 28 | pub struct InterpCx<'tcx, M: Machine<'tcx>> { |
| 29 | 29 | /// Stores the `Machine` instance. |
compiler/rustc_const_eval/src/interpret/intern.rs+6-6| ... | ... | @@ -26,7 +26,7 @@ use rustc_span::def_id::LocalDefId; |
| 26 | 26 | use rustc_span::sym; |
| 27 | 27 | use tracing::{instrument, trace}; |
| 28 | 28 | |
| 29 | use super::{err_ub, AllocId, Allocation, InterpCx, MPlaceTy, Machine, MemoryKind, PlaceTy}; | |
| 29 | use super::{AllocId, Allocation, InterpCx, MPlaceTy, Machine, MemoryKind, PlaceTy, err_ub}; | |
| 30 | 30 | use crate::const_eval; |
| 31 | 31 | use crate::errors::NestedStaticInThreadLocal; |
| 32 | 32 | |
| ... | ... | @@ -100,11 +100,11 @@ fn intern_as_new_static<'tcx>( |
| 100 | 100 | alloc_id: AllocId, |
| 101 | 101 | alloc: ConstAllocation<'tcx>, |
| 102 | 102 | ) { |
| 103 | let feed = tcx.create_def( | |
| 104 | static_id, | |
| 105 | sym::nested, | |
| 106 | DefKind::Static { safety: hir::Safety::Safe, mutability: alloc.0.mutability, nested: true }, | |
| 107 | ); | |
| 103 | let feed = tcx.create_def(static_id, sym::nested, DefKind::Static { | |
| 104 | safety: hir::Safety::Safe, | |
| 105 | mutability: alloc.0.mutability, | |
| 106 | nested: true, | |
| 107 | }); | |
| 108 | 108 | tcx.set_nested_alloc_id_static(alloc_id, feed.def_id()); |
| 109 | 109 | |
| 110 | 110 | if tcx.is_thread_local_static(static_id.into()) { |
compiler/rustc_const_eval/src/interpret/intrinsics.rs+3-3| ... | ... | @@ -9,16 +9,16 @@ use rustc_middle::mir::{self, BinOp, ConstValue, NonDivergingIntrinsic}; |
| 9 | 9 | use rustc_middle::ty::layout::{LayoutOf as _, TyAndLayout, ValidityRequirement}; |
| 10 | 10 | use rustc_middle::ty::{GenericArgsRef, Ty, TyCtxt}; |
| 11 | 11 | use rustc_middle::{bug, ty}; |
| 12 | use rustc_span::symbol::{sym, Symbol}; | |
| 12 | use rustc_span::symbol::{Symbol, sym}; | |
| 13 | 13 | use rustc_target::abi::Size; |
| 14 | 14 | use tracing::trace; |
| 15 | 15 | |
| 16 | 16 | use super::memory::MemoryKind; |
| 17 | 17 | use super::util::ensure_monomorphic_enough; |
| 18 | 18 | use super::{ |
| 19 | err_inval, err_ub_custom, err_unsup_format, throw_inval, throw_ub_custom, throw_ub_format, | |
| 20 | 19 | Allocation, CheckInAllocMsg, ConstAllocation, GlobalId, ImmTy, InterpCx, InterpResult, |
| 21 | MPlaceTy, Machine, OpTy, Pointer, PointerArithmetic, Provenance, Scalar, | |
| 20 | MPlaceTy, Machine, OpTy, Pointer, PointerArithmetic, Provenance, Scalar, err_inval, | |
| 21 | err_ub_custom, err_unsup_format, throw_inval, throw_ub_custom, throw_ub_format, | |
| 22 | 22 | }; |
| 23 | 23 | use crate::fluent_generated as fluent; |
| 24 | 24 |
compiler/rustc_const_eval/src/interpret/machine.rs+5-5| ... | ... | @@ -9,18 +9,18 @@ use std::hash::Hash; |
| 9 | 9 | use rustc_apfloat::{Float, FloatConvert}; |
| 10 | 10 | use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece}; |
| 11 | 11 | use rustc_middle::query::TyCtxtAt; |
| 12 | use rustc_middle::ty::layout::TyAndLayout; | |
| 13 | 12 | use rustc_middle::ty::Ty; |
| 13 | use rustc_middle::ty::layout::TyAndLayout; | |
| 14 | 14 | use rustc_middle::{mir, ty}; |
| 15 | use rustc_span::def_id::DefId; | |
| 16 | 15 | use rustc_span::Span; |
| 16 | use rustc_span::def_id::DefId; | |
| 17 | 17 | use rustc_target::abi::{Align, Size}; |
| 18 | 18 | use rustc_target::spec::abi::Abi as CallAbi; |
| 19 | 19 | |
| 20 | 20 | use super::{ |
| 21 | throw_unsup, throw_unsup_format, AllocBytes, AllocId, AllocKind, AllocRange, Allocation, | |
| 22 | ConstAllocation, CtfeProvenance, FnArg, Frame, ImmTy, InterpCx, InterpResult, MPlaceTy, | |
| 23 | MemoryKind, Misalignment, OpTy, PlaceTy, Pointer, Provenance, RangeSet, CTFE_ALLOC_SALT, | |
| 21 | AllocBytes, AllocId, AllocKind, AllocRange, Allocation, CTFE_ALLOC_SALT, ConstAllocation, | |
| 22 | CtfeProvenance, FnArg, Frame, ImmTy, InterpCx, InterpResult, MPlaceTy, MemoryKind, | |
| 23 | Misalignment, OpTy, PlaceTy, Pointer, Provenance, RangeSet, throw_unsup, throw_unsup_format, | |
| 24 | 24 | }; |
| 25 | 25 | |
| 26 | 26 | /// Data returned by [`Machine::after_stack_pop`], and consumed by |
compiler/rustc_const_eval/src/interpret/memory.rs+2-2| ... | ... | @@ -21,10 +21,10 @@ use rustc_target::abi::{Align, HasDataLayout, Size}; |
| 21 | 21 | use tracing::{debug, instrument, trace}; |
| 22 | 22 | |
| 23 | 23 | use super::{ |
| 24 | alloc_range, err_ub, err_ub_custom, throw_ub, throw_ub_custom, throw_unsup, throw_unsup_format, | |
| 25 | 24 | AllocBytes, AllocId, AllocMap, AllocRange, Allocation, CheckAlignMsg, CheckInAllocMsg, |
| 26 | 25 | CtfeProvenance, GlobalAlloc, InterpCx, InterpResult, Machine, MayLeak, Misalignment, Pointer, |
| 27 | PointerArithmetic, Provenance, Scalar, | |
| 26 | PointerArithmetic, Provenance, Scalar, alloc_range, err_ub, err_ub_custom, throw_ub, | |
| 27 | throw_ub_custom, throw_unsup, throw_unsup_format, | |
| 28 | 28 | }; |
| 29 | 29 | use crate::fluent_generated as fluent; |
| 30 | 30 |
compiler/rustc_const_eval/src/interpret/mod.rs+4-4| ... | ... | @@ -24,13 +24,13 @@ use eval_context::{from_known_layout, mir_assign_valid_types}; |
| 24 | 24 | pub use rustc_middle::mir::interpret::*; // have all the `interpret` symbols in one place: here |
| 25 | 25 | |
| 26 | 26 | pub use self::call::FnArg; |
| 27 | pub use self::eval_context::{format_interp_error, InterpCx}; | |
| 27 | pub use self::eval_context::{InterpCx, format_interp_error}; | |
| 28 | 28 | pub use self::intern::{ |
| 29 | intern_const_alloc_for_constprop, intern_const_alloc_recursive, HasStaticRootDefId, InternKind, | |
| 30 | InternResult, | |
| 29 | HasStaticRootDefId, InternKind, InternResult, intern_const_alloc_for_constprop, | |
| 30 | intern_const_alloc_recursive, | |
| 31 | 31 | }; |
| 32 | 32 | pub(crate) use self::intrinsics::eval_nullary_intrinsic; |
| 33 | pub use self::machine::{compile_time_machine, AllocMap, Machine, MayLeak, ReturnAction}; | |
| 33 | pub use self::machine::{AllocMap, Machine, MayLeak, ReturnAction, compile_time_machine}; | |
| 34 | 34 | pub use self::memory::{AllocKind, AllocRef, AllocRefMut, FnVal, Memory, MemoryKind}; |
| 35 | 35 | use self::operand::Operand; |
| 36 | 36 | pub use self::operand::{ImmTy, Immediate, OpTy}; |
compiler/rustc_const_eval/src/interpret/operand.rs+3-3| ... | ... | @@ -14,9 +14,9 @@ use rustc_target::abi::{self, Abi, HasDataLayout, Size}; |
| 14 | 14 | use tracing::trace; |
| 15 | 15 | |
| 16 | 16 | use super::{ |
| 17 | alloc_range, err_ub, from_known_layout, mir_assign_valid_types, throw_ub, CtfeProvenance, | |
| 18 | InterpCx, InterpResult, MPlaceTy, Machine, MemPlace, MemPlaceMeta, OffsetMode, PlaceTy, | |
| 19 | Pointer, Projectable, Provenance, Scalar, | |
| 17 | CtfeProvenance, InterpCx, InterpResult, MPlaceTy, Machine, MemPlace, MemPlaceMeta, OffsetMode, | |
| 18 | PlaceTy, Pointer, Projectable, Provenance, Scalar, alloc_range, err_ub, from_known_layout, | |
| 19 | mir_assign_valid_types, throw_ub, | |
| 20 | 20 | }; |
| 21 | 21 | |
| 22 | 22 | /// An `Immediate` represents a single immediate self-contained Rust value. |
compiler/rustc_const_eval/src/interpret/operator.rs+2-2| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use either::Either; |
| 2 | 2 | use rustc_apfloat::{Float, FloatConvert}; |
| 3 | use rustc_middle::mir::interpret::{InterpResult, PointerArithmetic, Scalar}; | |
| 4 | 3 | use rustc_middle::mir::NullOp; |
| 4 | use rustc_middle::mir::interpret::{InterpResult, PointerArithmetic, Scalar}; | |
| 5 | 5 | use rustc_middle::ty::layout::{LayoutOf, TyAndLayout}; |
| 6 | 6 | use rustc_middle::ty::{self, FloatTy, ScalarInt, Ty}; |
| 7 | 7 | use rustc_middle::{bug, mir, span_bug}; |
| ... | ... | @@ -9,7 +9,7 @@ use rustc_span::symbol::sym; |
| 9 | 9 | use rustc_target::abi::Size; |
| 10 | 10 | use tracing::trace; |
| 11 | 11 | |
| 12 | use super::{throw_ub, ImmTy, InterpCx, Machine, MemPlaceMeta}; | |
| 12 | use super::{ImmTy, InterpCx, Machine, MemPlaceMeta, throw_ub}; | |
| 13 | 13 | |
| 14 | 14 | impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { |
| 15 | 15 | fn three_way_compare<T: Ord>(&self, lhs: T, rhs: T) -> ImmTy<'tcx, M::Provenance> { |
compiler/rustc_const_eval/src/interpret/place.rs+4-4| ... | ... | @@ -6,16 +6,16 @@ use std::assert_matches::assert_matches; |
| 6 | 6 | |
| 7 | 7 | use either::{Either, Left, Right}; |
| 8 | 8 | use rustc_ast::Mutability; |
| 9 | use rustc_middle::ty::layout::{LayoutOf, TyAndLayout}; | |
| 10 | 9 | use rustc_middle::ty::Ty; |
| 10 | use rustc_middle::ty::layout::{LayoutOf, TyAndLayout}; | |
| 11 | 11 | use rustc_middle::{bug, mir, span_bug}; |
| 12 | 12 | use rustc_target::abi::{Abi, Align, HasDataLayout, Size}; |
| 13 | 13 | use tracing::{instrument, trace}; |
| 14 | 14 | |
| 15 | 15 | use super::{ |
| 16 | alloc_range, mir_assign_valid_types, AllocRef, AllocRefMut, CheckAlignMsg, CtfeProvenance, | |
| 17 | ImmTy, Immediate, InterpCx, InterpResult, Machine, MemoryKind, Misalignment, OffsetMode, OpTy, | |
| 18 | Operand, Pointer, Projectable, Provenance, Scalar, | |
| 16 | AllocRef, AllocRefMut, CheckAlignMsg, CtfeProvenance, ImmTy, Immediate, InterpCx, InterpResult, | |
| 17 | Machine, MemoryKind, Misalignment, OffsetMode, OpTy, Operand, Pointer, Projectable, Provenance, | |
| 18 | Scalar, alloc_range, mir_assign_valid_types, | |
| 19 | 19 | }; |
| 20 | 20 | |
| 21 | 21 | #[derive(Copy, Clone, Hash, PartialEq, Eq, Debug)] |
compiler/rustc_const_eval/src/interpret/projection.rs+3-3| ... | ... | @@ -10,15 +10,15 @@ |
| 10 | 10 | use std::marker::PhantomData; |
| 11 | 11 | use std::ops::Range; |
| 12 | 12 | |
| 13 | use rustc_middle::ty::layout::{LayoutOf, TyAndLayout}; | |
| 14 | 13 | use rustc_middle::ty::Ty; |
| 14 | use rustc_middle::ty::layout::{LayoutOf, TyAndLayout}; | |
| 15 | 15 | use rustc_middle::{bug, mir, span_bug, ty}; |
| 16 | 16 | use rustc_target::abi::{self, Size, VariantIdx}; |
| 17 | 17 | use tracing::{debug, instrument}; |
| 18 | 18 | |
| 19 | 19 | use super::{ |
| 20 | err_ub, throw_ub, throw_unsup, InterpCx, InterpResult, MPlaceTy, Machine, MemPlaceMeta, OpTy, | |
| 21 | Provenance, Scalar, | |
| 20 | InterpCx, InterpResult, MPlaceTy, Machine, MemPlaceMeta, OpTy, Provenance, Scalar, err_ub, | |
| 21 | throw_ub, throw_unsup, | |
| 22 | 22 | }; |
| 23 | 23 | |
| 24 | 24 | /// Describes the constraints placed on offset-projections. |
compiler/rustc_const_eval/src/interpret/stack.rs+3-3| ... | ... | @@ -15,9 +15,9 @@ use rustc_span::Span; |
| 15 | 15 | use tracing::{info_span, instrument, trace}; |
| 16 | 16 | |
| 17 | 17 | use super::{ |
| 18 | from_known_layout, throw_ub, throw_unsup, AllocId, CtfeProvenance, Immediate, InterpCx, | |
| 19 | InterpResult, MPlaceTy, Machine, MemPlace, MemPlaceMeta, MemoryKind, Operand, Pointer, | |
| 20 | Provenance, ReturnAction, Scalar, | |
| 18 | AllocId, CtfeProvenance, Immediate, InterpCx, InterpResult, MPlaceTy, Machine, MemPlace, | |
| 19 | MemPlaceMeta, MemoryKind, Operand, Pointer, Provenance, ReturnAction, Scalar, | |
| 20 | from_known_layout, throw_ub, throw_unsup, | |
| 21 | 21 | }; |
| 22 | 22 | use crate::errors; |
| 23 | 23 |
compiler/rustc_const_eval/src/interpret/step.rs+3-3| ... | ... | @@ -9,12 +9,12 @@ use rustc_middle::ty::{self, Instance, Ty}; |
| 9 | 9 | use rustc_middle::{bug, mir, span_bug}; |
| 10 | 10 | use rustc_span::source_map::Spanned; |
| 11 | 11 | use rustc_target::abi::call::FnAbi; |
| 12 | use rustc_target::abi::{FieldIdx, FIRST_VARIANT}; | |
| 12 | use rustc_target::abi::{FIRST_VARIANT, FieldIdx}; | |
| 13 | 13 | use tracing::{info, instrument, trace}; |
| 14 | 14 | |
| 15 | 15 | use super::{ |
| 16 | throw_ub, FnArg, FnVal, ImmTy, Immediate, InterpCx, InterpResult, Machine, MemPlaceMeta, | |
| 17 | PlaceTy, Projectable, Scalar, | |
| 16 | FnArg, FnVal, ImmTy, Immediate, InterpCx, InterpResult, Machine, MemPlaceMeta, PlaceTy, | |
| 17 | Projectable, Scalar, throw_ub, | |
| 18 | 18 | }; |
| 19 | 19 | use crate::util; |
| 20 | 20 |
compiler/rustc_const_eval/src/interpret/traits.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ use rustc_target::abi::{Align, Size}; |
| 5 | 5 | use tracing::trace; |
| 6 | 6 | |
| 7 | 7 | use super::util::ensure_monomorphic_enough; |
| 8 | use super::{throw_ub, InterpCx, MPlaceTy, Machine, MemPlaceMeta, OffsetMode, Projectable}; | |
| 8 | use super::{InterpCx, MPlaceTy, Machine, MemPlaceMeta, OffsetMode, Projectable, throw_ub}; | |
| 9 | 9 | |
| 10 | 10 | impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> { |
| 11 | 11 | /// Creates a dynamic vtable for the given type and vtable origin. This is used only for |
compiler/rustc_const_eval/src/interpret/util.rs+1-1| ... | ... | @@ -9,7 +9,7 @@ use rustc_middle::ty::{ |
| 9 | 9 | }; |
| 10 | 10 | use tracing::debug; |
| 11 | 11 | |
| 12 | use super::{throw_inval, InterpCx, MPlaceTy, MemoryKind}; | |
| 12 | use super::{InterpCx, MPlaceTy, MemoryKind, throw_inval}; | |
| 13 | 13 | use crate::const_eval::{CompileTimeInterpCx, CompileTimeMachine, InterpretationResult}; |
| 14 | 14 | |
| 15 | 15 | /// Checks whether a type contains generic parameters which must be instantiated. |
compiler/rustc_const_eval/src/interpret/validity.rs+19-18| ... | ... | @@ -17,12 +17,12 @@ use rustc_hir as hir; |
| 17 | 17 | use rustc_middle::bug; |
| 18 | 18 | use rustc_middle::mir::interpret::ValidationErrorKind::{self, *}; |
| 19 | 19 | use rustc_middle::mir::interpret::{ |
| 20 | alloc_range, ExpectedKind, InterpError, InvalidMetaKind, Misalignment, PointerKind, Provenance, | |
| 21 | UnsupportedOpInfo, ValidationErrorInfo, | |
| 20 | ExpectedKind, InterpError, InvalidMetaKind, Misalignment, PointerKind, Provenance, | |
| 21 | UnsupportedOpInfo, ValidationErrorInfo, alloc_range, | |
| 22 | 22 | }; |
| 23 | 23 | use rustc_middle::ty::layout::{LayoutCx, LayoutOf, TyAndLayout}; |
| 24 | 24 | use rustc_middle::ty::{self, Ty}; |
| 25 | use rustc_span::symbol::{sym, Symbol}; | |
| 25 | use rustc_span::symbol::{Symbol, sym}; | |
| 26 | 26 | use rustc_target::abi::{ |
| 27 | 27 | Abi, FieldIdx, FieldsShape, Scalar as ScalarAbi, Size, VariantIdx, Variants, WrappingRange, |
| 28 | 28 | }; |
| ... | ... | @@ -30,9 +30,9 @@ use tracing::trace; |
| 30 | 30 | |
| 31 | 31 | use super::machine::AllocMap; |
| 32 | 32 | use super::{ |
| 33 | err_ub, format_interp_error, throw_ub, AllocId, AllocKind, CheckInAllocMsg, GlobalAlloc, ImmTy, | |
| 34 | Immediate, InterpCx, InterpResult, MPlaceTy, Machine, MemPlaceMeta, PlaceTy, Pointer, | |
| 35 | Projectable, Scalar, ValueVisitor, | |
| 33 | AllocId, AllocKind, CheckInAllocMsg, GlobalAlloc, ImmTy, Immediate, InterpCx, InterpResult, | |
| 34 | MPlaceTy, Machine, MemPlaceMeta, PlaceTy, Pointer, Projectable, Scalar, ValueVisitor, err_ub, | |
| 35 | format_interp_error, throw_ub, | |
| 36 | 36 | }; |
| 37 | 37 | |
| 38 | 38 | // for the validation errors |
| ... | ... | @@ -803,10 +803,10 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValidityVisitor<'rt, 'tcx, M> { |
| 803 | 803 | if start == 1 && end == max_value { |
| 804 | 804 | // Only null is the niche. So make sure the ptr is NOT null. |
| 805 | 805 | if self.ecx.scalar_may_be_null(scalar)? { |
| 806 | throw_validation_failure!( | |
| 807 | self.path, | |
| 808 | NullablePtrOutOfRange { range: valid_range, max_value } | |
| 809 | ) | |
| 806 | throw_validation_failure!(self.path, NullablePtrOutOfRange { | |
| 807 | range: valid_range, | |
| 808 | max_value | |
| 809 | }) | |
| 810 | 810 | } else { |
| 811 | 811 | return Ok(()); |
| 812 | 812 | } |
| ... | ... | @@ -816,10 +816,10 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValidityVisitor<'rt, 'tcx, M> { |
| 816 | 816 | } else { |
| 817 | 817 | // Conservatively, we reject, because the pointer *could* have a bad |
| 818 | 818 | // value. |
| 819 | throw_validation_failure!( | |
| 820 | self.path, | |
| 821 | PtrOutOfRange { range: valid_range, max_value } | |
| 822 | ) | |
| 819 | throw_validation_failure!(self.path, PtrOutOfRange { | |
| 820 | range: valid_range, | |
| 821 | max_value | |
| 822 | }) | |
| 823 | 823 | } |
| 824 | 824 | } |
| 825 | 825 | }; |
| ... | ... | @@ -827,10 +827,11 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValidityVisitor<'rt, 'tcx, M> { |
| 827 | 827 | if valid_range.contains(bits) { |
| 828 | 828 | Ok(()) |
| 829 | 829 | } else { |
| 830 | throw_validation_failure!( | |
| 831 | self.path, | |
| 832 | OutOfRange { value: format!("{bits}"), range: valid_range, max_value } | |
| 833 | ) | |
| 830 | throw_validation_failure!(self.path, OutOfRange { | |
| 831 | value: format!("{bits}"), | |
| 832 | range: valid_range, | |
| 833 | max_value | |
| 834 | }) | |
| 834 | 835 | } |
| 835 | 836 | } |
| 836 | 837 |
compiler/rustc_const_eval/src/interpret/visitor.rs+1-1| ... | ... | @@ -10,7 +10,7 @@ use rustc_middle::ty::{self, Ty}; |
| 10 | 10 | use rustc_target::abi::{FieldIdx, FieldsShape, VariantIdx, Variants}; |
| 11 | 11 | use tracing::trace; |
| 12 | 12 | |
| 13 | use super::{throw_inval, InterpCx, MPlaceTy, Machine, Projectable}; | |
| 13 | use super::{InterpCx, MPlaceTy, Machine, Projectable, throw_inval}; | |
| 14 | 14 | |
| 15 | 15 | /// How to traverse a value and what to do when we are at the leaves. |
| 16 | 16 | pub trait ValueVisitor<'tcx, M: Machine<'tcx>>: Sized { |
compiler/rustc_const_eval/src/util/caller_location.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ use rustc_middle::{bug, mir}; |
| 6 | 6 | use rustc_span::symbol::Symbol; |
| 7 | 7 | use tracing::trace; |
| 8 | 8 | |
| 9 | use crate::const_eval::{mk_eval_cx_to_read_const_val, CanAccessMutGlobal, CompileTimeInterpCx}; | |
| 9 | use crate::const_eval::{CanAccessMutGlobal, CompileTimeInterpCx, mk_eval_cx_to_read_const_val}; | |
| 10 | 10 | use crate::interpret::*; |
| 11 | 11 | |
| 12 | 12 | /// Allocate a `const core::panic::Location` with the provided filename and line/column numbers. |
compiler/rustc_data_structures/src/fingerprint.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ use std::hash::{Hash, Hasher}; |
| 3 | 3 | use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; |
| 4 | 4 | |
| 5 | 5 | use crate::stable_hasher::{ |
| 6 | impl_stable_traits_for_trivial_type, FromStableHash, Hash64, StableHasherHash, | |
| 6 | FromStableHash, Hash64, StableHasherHash, impl_stable_traits_for_trivial_type, | |
| 7 | 7 | }; |
| 8 | 8 | |
| 9 | 9 | #[cfg(test)] |
compiler/rustc_data_structures/src/flock/windows.rs+2-2| ... | ... | @@ -6,8 +6,8 @@ use std::path::Path; |
| 6 | 6 | use tracing::debug; |
| 7 | 7 | use windows::Win32::Foundation::{ERROR_INVALID_FUNCTION, HANDLE}; |
| 8 | 8 | use windows::Win32::Storage::FileSystem::{ |
| 9 | LockFileEx, FILE_SHARE_DELETE, FILE_SHARE_READ, FILE_SHARE_WRITE, LOCKFILE_EXCLUSIVE_LOCK, | |
| 10 | LOCKFILE_FAIL_IMMEDIATELY, LOCK_FILE_FLAGS, | |
| 9 | FILE_SHARE_DELETE, FILE_SHARE_READ, FILE_SHARE_WRITE, LOCK_FILE_FLAGS, LOCKFILE_EXCLUSIVE_LOCK, | |
| 10 | LOCKFILE_FAIL_IMMEDIATELY, LockFileEx, | |
| 11 | 11 | }; |
| 12 | 12 | use windows::Win32::System::IO::OVERLAPPED; |
| 13 | 13 |
compiler/rustc_data_structures/src/graph/dominators/tests.rs+39-26| ... | ... | @@ -15,10 +15,17 @@ fn diamond() { |
| 15 | 15 | #[test] |
| 16 | 16 | fn paper() { |
| 17 | 17 | // example from the paper: |
| 18 | let graph = TestGraph::new( | |
| 19 | 6, | |
| 20 | &[(6, 5), (6, 4), (5, 1), (4, 2), (4, 3), (1, 2), (2, 3), (3, 2), (2, 1)], | |
| 21 | ); | |
| 18 | let graph = TestGraph::new(6, &[ | |
| 19 | (6, 5), | |
| 20 | (6, 4), | |
| 21 | (5, 1), | |
| 22 | (4, 2), | |
| 23 | (4, 3), | |
| 24 | (1, 2), | |
| 25 | (2, 3), | |
| 26 | (3, 2), | |
| 27 | (2, 1), | |
| 28 | ]); | |
| 22 | 29 | |
| 23 | 30 | let d = dominators(&graph); |
| 24 | 31 | assert_eq!(d.immediate_dominator(0), None); // <-- note that 0 is not in graph |
| ... | ... | @@ -33,10 +40,19 @@ fn paper() { |
| 33 | 40 | #[test] |
| 34 | 41 | fn paper_slt() { |
| 35 | 42 | // example from the paper: |
| 36 | let graph = TestGraph::new( | |
| 37 | 1, | |
| 38 | &[(1, 2), (1, 3), (2, 3), (2, 7), (3, 4), (3, 6), (4, 5), (5, 4), (6, 7), (7, 8), (8, 5)], | |
| 39 | ); | |
| 43 | let graph = TestGraph::new(1, &[ | |
| 44 | (1, 2), | |
| 45 | (1, 3), | |
| 46 | (2, 3), | |
| 47 | (2, 7), | |
| 48 | (3, 4), | |
| 49 | (3, 6), | |
| 50 | (4, 5), | |
| 51 | (5, 4), | |
| 52 | (6, 7), | |
| 53 | (7, 8), | |
| 54 | (8, 5), | |
| 55 | ]); | |
| 40 | 56 | |
| 41 | 57 | dominators(&graph); |
| 42 | 58 | } |
| ... | ... | @@ -53,24 +69,21 @@ fn immediate_dominator() { |
| 53 | 69 | |
| 54 | 70 | #[test] |
| 55 | 71 | fn transitive_dominator() { |
| 56 | let graph = TestGraph::new( | |
| 57 | 0, | |
| 58 | &[ | |
| 59 | // First tree branch. | |
| 60 | (0, 1), | |
| 61 | (1, 2), | |
| 62 | (2, 3), | |
| 63 | (3, 4), | |
| 64 | // Second tree branch. | |
| 65 | (1, 5), | |
| 66 | (5, 6), | |
| 67 | // Third tree branch. | |
| 68 | (0, 7), | |
| 69 | // These links make 0 the dominator for 2 and 3. | |
| 70 | (7, 2), | |
| 71 | (5, 3), | |
| 72 | ], | |
| 73 | ); | |
| 72 | let graph = TestGraph::new(0, &[ | |
| 73 | // First tree branch. | |
| 74 | (0, 1), | |
| 75 | (1, 2), | |
| 76 | (2, 3), | |
| 77 | (3, 4), | |
| 78 | // Second tree branch. | |
| 79 | (1, 5), | |
| 80 | (5, 6), | |
| 81 | // Third tree branch. | |
| 82 | (0, 7), | |
| 83 | // These links make 0 the dominator for 2 and 3. | |
| 84 | (7, 2), | |
| 85 | (5, 3), | |
| 86 | ]); | |
| 74 | 87 | |
| 75 | 88 | let d = dominators(&graph); |
| 76 | 89 | assert_eq!(d.immediate_dominator(2), Some(0)); |
compiler/rustc_data_structures/src/graph/implementation/tests.rs+4-7| ... | ... | @@ -110,13 +110,10 @@ fn each_adjacent_from_a() { |
| 110 | 110 | #[test] |
| 111 | 111 | fn each_adjacent_from_b() { |
| 112 | 112 | let graph = create_graph(); |
| 113 | test_adjacent_edges( | |
| 114 | &graph, | |
| 115 | NodeIndex(1), | |
| 116 | "B", | |
| 117 | &[("FB", "F"), ("AB", "A")], | |
| 118 | &[("BD", "D"), ("BC", "C")], | |
| 119 | ); | |
| 113 | test_adjacent_edges(&graph, NodeIndex(1), "B", &[("FB", "F"), ("AB", "A")], &[ | |
| 114 | ("BD", "D"), | |
| 115 | ("BC", "C"), | |
| 116 | ]); | |
| 120 | 117 | } |
| 121 | 118 | |
| 122 | 119 | #[test] |
compiler/rustc_data_structures/src/graph/scc/tests.rs+40-43| ... | ... | @@ -326,49 +326,46 @@ fn test_bug_max_leak_minimised() { |
| 326 | 326 | |
| 327 | 327 | #[test] |
| 328 | 328 | fn test_bug_max_leak() { |
| 329 | let graph = TestGraph::new( | |
| 330 | 8, | |
| 331 | &[ | |
| 332 | (0, 0), | |
| 333 | (0, 18), | |
| 334 | (0, 19), | |
| 335 | (0, 1), | |
| 336 | (0, 2), | |
| 337 | (0, 7), | |
| 338 | (0, 8), | |
| 339 | (0, 23), | |
| 340 | (18, 0), | |
| 341 | (18, 12), | |
| 342 | (19, 0), | |
| 343 | (19, 25), | |
| 344 | (12, 18), | |
| 345 | (12, 3), | |
| 346 | (12, 5), | |
| 347 | (3, 12), | |
| 348 | (3, 21), | |
| 349 | (3, 22), | |
| 350 | (5, 13), | |
| 351 | (21, 3), | |
| 352 | (22, 3), | |
| 353 | (13, 5), | |
| 354 | (13, 4), | |
| 355 | (4, 13), | |
| 356 | (4, 0), | |
| 357 | (2, 11), | |
| 358 | (7, 6), | |
| 359 | (6, 20), | |
| 360 | (20, 6), | |
| 361 | (8, 17), | |
| 362 | (17, 9), | |
| 363 | (9, 16), | |
| 364 | (16, 26), | |
| 365 | (26, 15), | |
| 366 | (15, 10), | |
| 367 | (10, 14), | |
| 368 | (14, 27), | |
| 369 | (23, 24), | |
| 370 | ], | |
| 371 | ); | |
| 329 | let graph = TestGraph::new(8, &[ | |
| 330 | (0, 0), | |
| 331 | (0, 18), | |
| 332 | (0, 19), | |
| 333 | (0, 1), | |
| 334 | (0, 2), | |
| 335 | (0, 7), | |
| 336 | (0, 8), | |
| 337 | (0, 23), | |
| 338 | (18, 0), | |
| 339 | (18, 12), | |
| 340 | (19, 0), | |
| 341 | (19, 25), | |
| 342 | (12, 18), | |
| 343 | (12, 3), | |
| 344 | (12, 5), | |
| 345 | (3, 12), | |
| 346 | (3, 21), | |
| 347 | (3, 22), | |
| 348 | (5, 13), | |
| 349 | (21, 3), | |
| 350 | (22, 3), | |
| 351 | (13, 5), | |
| 352 | (13, 4), | |
| 353 | (4, 13), | |
| 354 | (4, 0), | |
| 355 | (2, 11), | |
| 356 | (7, 6), | |
| 357 | (6, 20), | |
| 358 | (20, 6), | |
| 359 | (8, 17), | |
| 360 | (17, 9), | |
| 361 | (9, 16), | |
| 362 | (16, 26), | |
| 363 | (26, 15), | |
| 364 | (15, 10), | |
| 365 | (10, 14), | |
| 366 | (14, 27), | |
| 367 | (23, 24), | |
| 368 | ]); | |
| 372 | 369 | let sccs: MaxReachedSccs = Sccs::new_with_annotation(&graph, |w| match w { |
| 373 | 370 | 22 => MaxReached(1), |
| 374 | 371 | 24 => MaxReached(2), |
compiler/rustc_data_structures/src/obligation_forest/tests.rs+4-4| ... | ... | @@ -347,10 +347,10 @@ fn diamond() { |
| 347 | 347 | )); |
| 348 | 348 | assert_eq!(d_count, 1); |
| 349 | 349 | assert_eq!(ok.len(), 0); |
| 350 | assert_eq!( | |
| 351 | err, | |
| 352 | vec![super::Error { error: "operation failed", backtrace: vec!["D'", "A'.1", "A'"] }] | |
| 353 | ); | |
| 350 | assert_eq!(err, vec![super::Error { | |
| 351 | error: "operation failed", | |
| 352 | backtrace: vec!["D'", "A'.1", "A'"] | |
| 353 | }]); | |
| 354 | 354 | |
| 355 | 355 | let errors = forest.to_errors(()); |
| 356 | 356 | assert_eq!(errors.len(), 0); |
compiler/rustc_data_structures/src/owned_slice/tests.rs+2-2| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | use std::ops::Deref; |
| 2 | use std::sync::atomic::{self, AtomicBool}; | |
| 3 | 2 | use std::sync::Arc; |
| 3 | use std::sync::atomic::{self, AtomicBool}; | |
| 4 | 4 | |
| 5 | 5 | use crate::defer; |
| 6 | use crate::owned_slice::{slice_owned, try_slice_owned, OwnedSlice}; | |
| 6 | use crate::owned_slice::{OwnedSlice, slice_owned, try_slice_owned}; | |
| 7 | 7 | |
| 8 | 8 | #[test] |
| 9 | 9 | fn smoke() { |
compiler/rustc_data_structures/src/sharded.rs+1-1| ... | ... | @@ -8,7 +8,7 @@ use either::Either; |
| 8 | 8 | |
| 9 | 9 | use crate::fx::{FxHashMap, FxHasher}; |
| 10 | 10 | #[cfg(parallel_compiler)] |
| 11 | use crate::sync::{is_dyn_thread_safe, CacheAligned}; | |
| 11 | use crate::sync::{CacheAligned, is_dyn_thread_safe}; | |
| 12 | 12 | use crate::sync::{Lock, LockGuard, Mode}; |
| 13 | 13 | |
| 14 | 14 | // 32 shards is sufficient to reduce contention on an 8-core Ryzen 7 1700, |
compiler/rustc_data_structures/src/stable_hasher.rs+1-1| ... | ... | @@ -14,7 +14,7 @@ pub use rustc_stable_hash::{ |
| 14 | 14 | FromStableHash, SipHasher128Hash as StableHasherHash, StableSipHasher128 as StableHasher, |
| 15 | 15 | }; |
| 16 | 16 | |
| 17 | pub use crate::hashes::{Hash128, Hash64}; | |
| 17 | pub use crate::hashes::{Hash64, Hash128}; | |
| 18 | 18 | |
| 19 | 19 | /// Something that implements `HashStable<CTX>` can be hashed in a way that is |
| 20 | 20 | /// stable across multiple compilation sessions. |
compiler/rustc_data_structures/src/sync/lock.rs+1-1| ... | ... | @@ -25,8 +25,8 @@ mod maybe_sync { |
| 25 | 25 | use std::mem::ManuallyDrop; |
| 26 | 26 | use std::ops::{Deref, DerefMut}; |
| 27 | 27 | |
| 28 | use parking_lot::lock_api::RawMutex as _; | |
| 29 | 28 | use parking_lot::RawMutex; |
| 29 | use parking_lot::lock_api::RawMutex as _; | |
| 30 | 30 | |
| 31 | 31 | use super::Mode; |
| 32 | 32 | use crate::sync::mode; |
compiler/rustc_data_structures/src/sync/parallel.rs+3-3| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | #![allow(dead_code)] |
| 5 | 5 | |
| 6 | 6 | use std::any::Any; |
| 7 | use std::panic::{catch_unwind, resume_unwind, AssertUnwindSafe}; | |
| 7 | use std::panic::{AssertUnwindSafe, catch_unwind, resume_unwind}; | |
| 8 | 8 | |
| 9 | 9 | #[cfg(not(parallel_compiler))] |
| 10 | 10 | pub use disabled::*; |
| ... | ... | @@ -12,8 +12,8 @@ pub use disabled::*; |
| 12 | 12 | pub use enabled::*; |
| 13 | 13 | use parking_lot::Mutex; |
| 14 | 14 | |
| 15 | use crate::sync::IntoDynSyncSend; | |
| 16 | 15 | use crate::FatalErrorMarker; |
| 16 | use crate::sync::IntoDynSyncSend; | |
| 17 | 17 | |
| 18 | 18 | /// A guard used to hold panics that occur during a parallel section to later by unwound. |
| 19 | 19 | /// This is used for the parallel compiler to prevent fatal errors from non-deterministically |
| ... | ... | @@ -102,7 +102,7 @@ mod disabled { |
| 102 | 102 | |
| 103 | 103 | #[cfg(parallel_compiler)] |
| 104 | 104 | mod enabled { |
| 105 | use crate::sync::{mode, parallel_guard, DynSend, DynSync, FromDyn}; | |
| 105 | use crate::sync::{DynSend, DynSync, FromDyn, mode, parallel_guard}; | |
| 106 | 106 | |
| 107 | 107 | /// Runs a list of blocks in parallel. The first block is executed immediately on |
| 108 | 108 | /// the current thread. Use that for the longest running block. |
compiler/rustc_data_structures/src/work_queue.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use std::collections::VecDeque; |
| 2 | 2 | |
| 3 | use rustc_index::bit_set::BitSet; | |
| 4 | 3 | use rustc_index::Idx; |
| 4 | use rustc_index::bit_set::BitSet; | |
| 5 | 5 | |
| 6 | 6 | /// A work queue is a handy data structure for tracking work left to |
| 7 | 7 | /// do. (For example, basic blocks left to process.) It is basically a |
compiler/rustc_driver_impl/src/lib.rs+11-13| ... | ... | @@ -24,7 +24,7 @@ use std::ffi::OsString; |
| 24 | 24 | use std::fmt::Write as _; |
| 25 | 25 | use std::fs::{self, File}; |
| 26 | 26 | use std::io::{self, IsTerminal, Read, Write}; |
| 27 | use std::panic::{self, catch_unwind, PanicHookInfo}; | |
| 27 | use std::panic::{self, PanicHookInfo, catch_unwind}; | |
| 28 | 28 | use std::path::PathBuf; |
| 29 | 29 | use std::process::{self, Command, Stdio}; |
| 30 | 30 | use std::sync::atomic::{AtomicBool, Ordering}; |
| ... | ... | @@ -37,30 +37,30 @@ use rustc_codegen_ssa::traits::CodegenBackend; |
| 37 | 37 | use rustc_codegen_ssa::{CodegenErrors, CodegenResults}; |
| 38 | 38 | use rustc_const_eval::CTRL_C_RECEIVED; |
| 39 | 39 | use rustc_data_structures::profiling::{ |
| 40 | get_resident_set_size, print_time_passes_entry, TimePassesFormat, | |
| 40 | TimePassesFormat, get_resident_set_size, print_time_passes_entry, | |
| 41 | 41 | }; |
| 42 | 42 | use rustc_errors::emitter::stderr_destination; |
| 43 | 43 | use rustc_errors::registry::Registry; |
| 44 | 44 | use rustc_errors::{ |
| 45 | markdown, ColorConfig, DiagCtxt, ErrCode, ErrorGuaranteed, FatalError, PResult, | |
| 45 | ColorConfig, DiagCtxt, ErrCode, ErrorGuaranteed, FatalError, PResult, markdown, | |
| 46 | 46 | }; |
| 47 | 47 | use rustc_feature::find_gated_cfg; |
| 48 | 48 | use rustc_interface::util::{self, get_codegen_backend}; |
| 49 | use rustc_interface::{interface, passes, Linker, Queries}; | |
| 49 | use rustc_interface::{Linker, Queries, interface, passes}; | |
| 50 | 50 | use rustc_lint::unerased_lint_store; |
| 51 | 51 | use rustc_metadata::creader::MetadataLoader; |
| 52 | 52 | use rustc_metadata::locator; |
| 53 | 53 | use rustc_parse::{new_parser_from_file, new_parser_from_source_str, unwrap_or_emit_fatal}; |
| 54 | 54 | use rustc_session::config::{ |
| 55 | nightly_options, ErrorOutputType, Input, OutFileName, OutputType, UnstableOptions, CG_OPTIONS, | |
| 56 | Z_OPTIONS, | |
| 55 | CG_OPTIONS, ErrorOutputType, Input, OutFileName, OutputType, UnstableOptions, Z_OPTIONS, | |
| 56 | nightly_options, | |
| 57 | 57 | }; |
| 58 | 58 | use rustc_session::getopts::{self, Matches}; |
| 59 | 59 | use rustc_session::lint::{Lint, LintId}; |
| 60 | 60 | use rustc_session::output::collect_crate_types; |
| 61 | use rustc_session::{config, filesearch, EarlyDiagCtxt, Session}; | |
| 62 | use rustc_span::source_map::FileLoader; | |
| 61 | use rustc_session::{EarlyDiagCtxt, Session, config, filesearch}; | |
| 63 | 62 | use rustc_span::FileName; |
| 63 | use rustc_span::source_map::FileLoader; | |
| 64 | 64 | use rustc_target::json::ToJson; |
| 65 | 65 | use rustc_target::spec::{Target, TargetTriple}; |
| 66 | 66 | use time::OffsetDateTime; |
| ... | ... | @@ -410,11 +410,9 @@ fn run_compiler( |
| 410 | 410 | }); |
| 411 | 411 | } else { |
| 412 | 412 | let krate = queries.parse()?; |
| 413 | pretty::print( | |
| 414 | sess, | |
| 415 | pp_mode, | |
| 416 | pretty::PrintExtra::AfterParsing { krate: &*krate.borrow() }, | |
| 417 | ); | |
| 413 | pretty::print(sess, pp_mode, pretty::PrintExtra::AfterParsing { | |
| 414 | krate: &*krate.borrow(), | |
| 415 | }); | |
| 418 | 416 | } |
| 419 | 417 | trace!("finished pretty-printing"); |
| 420 | 418 | return early_exit(); |
compiler/rustc_driver_impl/src/pretty.rs+2-2| ... | ... | @@ -8,11 +8,11 @@ use rustc_errors::FatalError; |
| 8 | 8 | use rustc_middle::bug; |
| 9 | 9 | use rustc_middle::mir::{write_mir_graphviz, write_mir_pretty}; |
| 10 | 10 | use rustc_middle::ty::{self, TyCtxt}; |
| 11 | use rustc_session::config::{OutFileName, PpHirMode, PpMode, PpSourceMode}; | |
| 12 | 11 | use rustc_session::Session; |
| 12 | use rustc_session::config::{OutFileName, PpHirMode, PpMode, PpSourceMode}; | |
| 13 | 13 | use rustc_smir::rustc_internal::pretty::write_smir_pretty; |
| 14 | use rustc_span::symbol::Ident; | |
| 15 | 14 | use rustc_span::FileName; |
| 15 | use rustc_span::symbol::Ident; | |
| 16 | 16 | use tracing::debug; |
| 17 | 17 | use {rustc_ast as ast, rustc_hir_pretty as pprust_hir}; |
| 18 | 18 |
compiler/rustc_driver_impl/src/signal_handler.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | //! Signal handler for rustc |
| 2 | 2 | //! Primarily used to extract a backtrace from stack overflow |
| 3 | 3 | |
| 4 | use std::alloc::{alloc, Layout}; | |
| 4 | use std::alloc::{Layout, alloc}; | |
| 5 | 5 | use std::{fmt, mem, ptr}; |
| 6 | 6 | |
| 7 | 7 | use rustc_interface::util::{DEFAULT_STACK_SIZE, STACK_SIZE}; |
compiler/rustc_error_messages/src/lib.rs+4-4| ... | ... | @@ -16,20 +16,20 @@ use std::path::{Path, PathBuf}; |
| 16 | 16 | use std::sync::LazyLock as Lazy; |
| 17 | 17 | use std::{fmt, fs, io}; |
| 18 | 18 | |
| 19 | pub use fluent_bundle::types::FluentType; | |
| 20 | 19 | use fluent_bundle::FluentResource; |
| 20 | pub use fluent_bundle::types::FluentType; | |
| 21 | 21 | pub use fluent_bundle::{self, FluentArgs, FluentError, FluentValue}; |
| 22 | 22 | use fluent_syntax::parser::ParserError; |
| 23 | 23 | use icu_provider_adapters::fallback::{LocaleFallbackProvider, LocaleFallbacker}; |
| 24 | #[cfg(parallel_compiler)] | |
| 25 | use intl_memoizer::concurrent::IntlLangMemoizer; | |
| 26 | 24 | #[cfg(not(parallel_compiler))] |
| 27 | 25 | use intl_memoizer::IntlLangMemoizer; |
| 26 | #[cfg(parallel_compiler)] | |
| 27 | use intl_memoizer::concurrent::IntlLangMemoizer; | |
| 28 | 28 | use rustc_data_structures::sync::{IntoDynSyncSend, Lrc}; |
| 29 | 29 | use rustc_macros::{Decodable, Encodable}; |
| 30 | 30 | use rustc_span::Span; |
| 31 | 31 | use tracing::{instrument, trace}; |
| 32 | pub use unic_langid::{langid, LanguageIdentifier}; | |
| 32 | pub use unic_langid::{LanguageIdentifier, langid}; | |
| 33 | 33 | |
| 34 | 34 | pub type FluentBundle = |
| 35 | 35 | IntoDynSyncSend<fluent_bundle::bundle::FluentBundle<FluentResource, IntlLangMemoizer>>; |
compiler/rustc_errors/src/annotate_snippet_emitter_writer.rs+2-2| ... | ... | @@ -8,12 +8,12 @@ |
| 8 | 8 | use annotate_snippets::{Renderer, Snippet}; |
| 9 | 9 | use rustc_data_structures::sync::Lrc; |
| 10 | 10 | use rustc_error_messages::FluentArgs; |
| 11 | use rustc_span::source_map::SourceMap; | |
| 12 | 11 | use rustc_span::SourceFile; |
| 12 | use rustc_span::source_map::SourceMap; | |
| 13 | 13 | |
| 14 | 14 | use crate::emitter::FileWithAnnotatedLines; |
| 15 | 15 | use crate::snippet::Line; |
| 16 | use crate::translation::{to_fluent_args, Translate}; | |
| 16 | use crate::translation::{Translate, to_fluent_args}; | |
| 17 | 17 | use crate::{ |
| 18 | 18 | CodeSuggestion, DiagInner, DiagMessage, Emitter, ErrCode, FluentBundle, LazyFallbackBundle, |
| 19 | 19 | Level, MultiSpan, Style, Subdiag, |
compiler/rustc_errors/src/diagnostic.rs+2-2| ... | ... | @@ -7,12 +7,12 @@ use std::panic; |
| 7 | 7 | use std::thread::panicking; |
| 8 | 8 | |
| 9 | 9 | use rustc_data_structures::fx::FxIndexMap; |
| 10 | use rustc_error_messages::{fluent_value_from_str_list_sep_by_and, FluentValue}; | |
| 10 | use rustc_error_messages::{FluentValue, fluent_value_from_str_list_sep_by_and}; | |
| 11 | 11 | use rustc_lint_defs::Applicability; |
| 12 | 12 | use rustc_macros::{Decodable, Encodable}; |
| 13 | 13 | use rustc_span::source_map::Spanned; |
| 14 | 14 | use rustc_span::symbol::Symbol; |
| 15 | use rustc_span::{Span, DUMMY_SP}; | |
| 15 | use rustc_span::{DUMMY_SP, Span}; | |
| 16 | 16 | use tracing::debug; |
| 17 | 17 | |
| 18 | 18 | use crate::snippet::Style; |
compiler/rustc_errors/src/diagnostic_impls.rs+3-3| ... | ... | @@ -7,9 +7,9 @@ use std::process::ExitStatus; |
| 7 | 7 | |
| 8 | 8 | use rustc_ast_pretty::pprust; |
| 9 | 9 | use rustc_macros::Subdiagnostic; |
| 10 | use rustc_span::Span; | |
| 10 | 11 | use rustc_span::edition::Edition; |
| 11 | 12 | use rustc_span::symbol::{Ident, MacroRulesNormalizedIdent, Symbol}; |
| 12 | use rustc_span::Span; | |
| 13 | 13 | use rustc_target::abi::TargetDataLayoutErrors; |
| 14 | 14 | use rustc_target::spec::{PanicStrategy, SplitDebuginfo, StackProtector, TargetTriple}; |
| 15 | 15 | use rustc_type_ir::{ClosureKind, FloatTy}; |
| ... | ... | @@ -17,8 +17,8 @@ use {rustc_ast as ast, rustc_hir as hir}; |
| 17 | 17 | |
| 18 | 18 | use crate::diagnostic::DiagLocation; |
| 19 | 19 | use crate::{ |
| 20 | fluent_generated as fluent, Diag, DiagArgValue, DiagCtxtHandle, Diagnostic, EmissionGuarantee, | |
| 21 | ErrCode, IntoDiagArg, Level, SubdiagMessageOp, Subdiagnostic, | |
| 20 | Diag, DiagArgValue, DiagCtxtHandle, Diagnostic, EmissionGuarantee, ErrCode, IntoDiagArg, Level, | |
| 21 | SubdiagMessageOp, Subdiagnostic, fluent_generated as fluent, | |
| 22 | 22 | }; |
| 23 | 23 | |
| 24 | 24 | pub struct DiagArgFromDisplay<'a>(pub &'a dyn fmt::Display); |
compiler/rustc_errors/src/emitter.rs+3-3| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | //! The output types are defined in `rustc_session::config::ErrorOutputType`. |
| 9 | 9 | |
| 10 | 10 | use std::borrow::Cow; |
| 11 | use std::cmp::{max, min, Reverse}; | |
| 11 | use std::cmp::{Reverse, max, min}; | |
| 12 | 12 | use std::error::Report; |
| 13 | 13 | use std::io::prelude::*; |
| 14 | 14 | use std::io::{self, IsTerminal}; |
| ... | ... | @@ -22,7 +22,7 @@ use rustc_error_messages::{FluentArgs, SpanLabel}; |
| 22 | 22 | use rustc_lint_defs::pluralize; |
| 23 | 23 | use rustc_span::hygiene::{ExpnKind, MacroKind}; |
| 24 | 24 | use rustc_span::source_map::SourceMap; |
| 25 | use rustc_span::{char_width, FileLines, FileName, SourceFile, Span}; | |
| 25 | use rustc_span::{FileLines, FileName, SourceFile, Span, char_width}; | |
| 26 | 26 | use termcolor::{Buffer, BufferWriter, Color, ColorChoice, ColorSpec, StandardStream, WriteColor}; |
| 27 | 27 | use tracing::{debug, instrument, trace, warn}; |
| 28 | 28 | |
| ... | ... | @@ -31,7 +31,7 @@ use crate::snippet::{ |
| 31 | 31 | Annotation, AnnotationColumn, AnnotationType, Line, MultilineAnnotation, Style, StyledString, |
| 32 | 32 | }; |
| 33 | 33 | use crate::styled_buffer::StyledBuffer; |
| 34 | use crate::translation::{to_fluent_args, Translate}; | |
| 34 | use crate::translation::{Translate, to_fluent_args}; | |
| 35 | 35 | use crate::{ |
| 36 | 36 | CodeSuggestion, DiagCtxt, DiagInner, DiagMessage, ErrCode, FluentBundle, LazyFallbackBundle, |
| 37 | 37 | Level, MultiSpan, Subdiag, SubstitutionHighlight, SuggestionStyle, TerminalUrl, |
compiler/rustc_errors/src/json.rs+4-4| ... | ... | @@ -19,19 +19,19 @@ use derive_setters::Setters; |
| 19 | 19 | use rustc_data_structures::sync::{IntoDynSyncSend, Lrc}; |
| 20 | 20 | use rustc_error_messages::FluentArgs; |
| 21 | 21 | use rustc_lint_defs::Applicability; |
| 22 | use rustc_span::Span; | |
| 22 | 23 | use rustc_span::hygiene::ExpnData; |
| 23 | 24 | use rustc_span::source_map::SourceMap; |
| 24 | use rustc_span::Span; | |
| 25 | 25 | use serde::Serialize; |
| 26 | 26 | use termcolor::{ColorSpec, WriteColor}; |
| 27 | 27 | |
| 28 | 28 | use crate::diagnostic::IsLint; |
| 29 | 29 | use crate::emitter::{ |
| 30 | should_show_source_code, ColorConfig, Destination, Emitter, HumanEmitter, | |
| 31 | HumanReadableErrorType, | |
| 30 | ColorConfig, Destination, Emitter, HumanEmitter, HumanReadableErrorType, | |
| 31 | should_show_source_code, | |
| 32 | 32 | }; |
| 33 | 33 | use crate::registry::Registry; |
| 34 | use crate::translation::{to_fluent_args, Translate}; | |
| 34 | use crate::translation::{Translate, to_fluent_args}; | |
| 35 | 35 | use crate::{ |
| 36 | 36 | CodeSuggestion, FluentBundle, LazyFallbackBundle, MultiSpan, SpanLabel, Subdiag, Suggestions, |
| 37 | 37 | TerminalUrl, |
compiler/rustc_errors/src/json/tests.rs+65-97| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use std::str; |
| 2 | 2 | |
| 3 | use rustc_span::source_map::FilePathMapping; | |
| 4 | 3 | use rustc_span::BytePos; |
| 4 | use rustc_span::source_map::FilePathMapping; | |
| 5 | 5 | use serde::Deserialize; |
| 6 | 6 | |
| 7 | 7 | use super::*; |
| ... | ... | @@ -69,128 +69,96 @@ fn test_positions(code: &str, span: (u32, u32), expected_output: SpanTestData) { |
| 69 | 69 | |
| 70 | 70 | #[test] |
| 71 | 71 | fn empty() { |
| 72 | test_positions( | |
| 73 | " ", | |
| 74 | (0, 1), | |
| 75 | SpanTestData { | |
| 76 | byte_start: 0, | |
| 77 | byte_end: 1, | |
| 78 | line_start: 1, | |
| 79 | column_start: 1, | |
| 80 | line_end: 1, | |
| 81 | column_end: 2, | |
| 82 | }, | |
| 83 | ) | |
| 72 | test_positions(" ", (0, 1), SpanTestData { | |
| 73 | byte_start: 0, | |
| 74 | byte_end: 1, | |
| 75 | line_start: 1, | |
| 76 | column_start: 1, | |
| 77 | line_end: 1, | |
| 78 | column_end: 2, | |
| 79 | }) | |
| 84 | 80 | } |
| 85 | 81 | |
| 86 | 82 | #[test] |
| 87 | 83 | fn bom() { |
| 88 | test_positions( | |
| 89 | "\u{feff} ", | |
| 90 | (0, 1), | |
| 91 | SpanTestData { | |
| 92 | byte_start: 3, | |
| 93 | byte_end: 4, | |
| 94 | line_start: 1, | |
| 95 | column_start: 1, | |
| 96 | line_end: 1, | |
| 97 | column_end: 2, | |
| 98 | }, | |
| 99 | ) | |
| 84 | test_positions("\u{feff} ", (0, 1), SpanTestData { | |
| 85 | byte_start: 3, | |
| 86 | byte_end: 4, | |
| 87 | line_start: 1, | |
| 88 | column_start: 1, | |
| 89 | line_end: 1, | |
| 90 | column_end: 2, | |
| 91 | }) | |
| 100 | 92 | } |
| 101 | 93 | |
| 102 | 94 | #[test] |
| 103 | 95 | fn lf_newlines() { |
| 104 | test_positions( | |
| 105 | "\nmod foo;\nmod bar;\n", | |
| 106 | (5, 12), | |
| 107 | SpanTestData { | |
| 108 | byte_start: 5, | |
| 109 | byte_end: 12, | |
| 110 | line_start: 2, | |
| 111 | column_start: 5, | |
| 112 | line_end: 3, | |
| 113 | column_end: 3, | |
| 114 | }, | |
| 115 | ) | |
| 96 | test_positions("\nmod foo;\nmod bar;\n", (5, 12), SpanTestData { | |
| 97 | byte_start: 5, | |
| 98 | byte_end: 12, | |
| 99 | line_start: 2, | |
| 100 | column_start: 5, | |
| 101 | line_end: 3, | |
| 102 | column_end: 3, | |
| 103 | }) | |
| 116 | 104 | } |
| 117 | 105 | |
| 118 | 106 | #[test] |
| 119 | 107 | fn crlf_newlines() { |
| 120 | test_positions( | |
| 121 | "\r\nmod foo;\r\nmod bar;\r\n", | |
| 122 | (5, 12), | |
| 123 | SpanTestData { | |
| 124 | byte_start: 6, | |
| 125 | byte_end: 14, | |
| 126 | line_start: 2, | |
| 127 | column_start: 5, | |
| 128 | line_end: 3, | |
| 129 | column_end: 3, | |
| 130 | }, | |
| 131 | ) | |
| 108 | test_positions("\r\nmod foo;\r\nmod bar;\r\n", (5, 12), SpanTestData { | |
| 109 | byte_start: 6, | |
| 110 | byte_end: 14, | |
| 111 | line_start: 2, | |
| 112 | column_start: 5, | |
| 113 | line_end: 3, | |
| 114 | column_end: 3, | |
| 115 | }) | |
| 132 | 116 | } |
| 133 | 117 | |
| 134 | 118 | #[test] |
| 135 | 119 | fn crlf_newlines_with_bom() { |
| 136 | test_positions( | |
| 137 | "\u{feff}\r\nmod foo;\r\nmod bar;\r\n", | |
| 138 | (5, 12), | |
| 139 | SpanTestData { | |
| 140 | byte_start: 9, | |
| 141 | byte_end: 17, | |
| 142 | line_start: 2, | |
| 143 | column_start: 5, | |
| 144 | line_end: 3, | |
| 145 | column_end: 3, | |
| 146 | }, | |
| 147 | ) | |
| 120 | test_positions("\u{feff}\r\nmod foo;\r\nmod bar;\r\n", (5, 12), SpanTestData { | |
| 121 | byte_start: 9, | |
| 122 | byte_end: 17, | |
| 123 | line_start: 2, | |
| 124 | column_start: 5, | |
| 125 | line_end: 3, | |
| 126 | column_end: 3, | |
| 127 | }) | |
| 148 | 128 | } |
| 149 | 129 | |
| 150 | 130 | #[test] |
| 151 | 131 | fn span_before_crlf() { |
| 152 | test_positions( | |
| 153 | "foo\r\nbar", | |
| 154 | (2, 3), | |
| 155 | SpanTestData { | |
| 156 | byte_start: 2, | |
| 157 | byte_end: 3, | |
| 158 | line_start: 1, | |
| 159 | column_start: 3, | |
| 160 | line_end: 1, | |
| 161 | column_end: 4, | |
| 162 | }, | |
| 163 | ) | |
| 132 | test_positions("foo\r\nbar", (2, 3), SpanTestData { | |
| 133 | byte_start: 2, | |
| 134 | byte_end: 3, | |
| 135 | line_start: 1, | |
| 136 | column_start: 3, | |
| 137 | line_end: 1, | |
| 138 | column_end: 4, | |
| 139 | }) | |
| 164 | 140 | } |
| 165 | 141 | |
| 166 | 142 | #[test] |
| 167 | 143 | fn span_on_crlf() { |
| 168 | test_positions( | |
| 169 | "foo\r\nbar", | |
| 170 | (3, 4), | |
| 171 | SpanTestData { | |
| 172 | byte_start: 3, | |
| 173 | byte_end: 5, | |
| 174 | line_start: 1, | |
| 175 | column_start: 4, | |
| 176 | line_end: 2, | |
| 177 | column_end: 1, | |
| 178 | }, | |
| 179 | ) | |
| 144 | test_positions("foo\r\nbar", (3, 4), SpanTestData { | |
| 145 | byte_start: 3, | |
| 146 | byte_end: 5, | |
| 147 | line_start: 1, | |
| 148 | column_start: 4, | |
| 149 | line_end: 2, | |
| 150 | column_end: 1, | |
| 151 | }) | |
| 180 | 152 | } |
| 181 | 153 | |
| 182 | 154 | #[test] |
| 183 | 155 | fn span_after_crlf() { |
| 184 | test_positions( | |
| 185 | "foo\r\nbar", | |
| 186 | (4, 5), | |
| 187 | SpanTestData { | |
| 188 | byte_start: 5, | |
| 189 | byte_end: 6, | |
| 190 | line_start: 2, | |
| 191 | column_start: 1, | |
| 192 | line_end: 2, | |
| 193 | column_end: 2, | |
| 194 | }, | |
| 195 | ) | |
| 156 | test_positions("foo\r\nbar", (4, 5), SpanTestData { | |
| 157 | byte_start: 5, | |
| 158 | byte_end: 6, | |
| 159 | line_start: 2, | |
| 160 | column_start: 1, | |
| 161 | line_end: 2, | |
| 162 | column_end: 2, | |
| 163 | }) | |
| 196 | 164 | } |
compiler/rustc_errors/src/lib.rs+8-8| ... | ... | @@ -42,6 +42,7 @@ use std::ops::DerefMut; |
| 42 | 42 | use std::path::{Path, PathBuf}; |
| 43 | 43 | use std::{fmt, panic}; |
| 44 | 44 | |
| 45 | use Level::*; | |
| 45 | 46 | pub use codes::*; |
| 46 | 47 | pub use diagnostic::{ |
| 47 | 48 | BugAbort, Diag, DiagArg, DiagArgMap, DiagArgName, DiagArgValue, DiagInner, DiagStyledString, |
| ... | ... | @@ -53,29 +54,28 @@ pub use diagnostic_impls::{ |
| 53 | 54 | IndicateAnonymousLifetime, SingleLabelManySpans, |
| 54 | 55 | }; |
| 55 | 56 | pub use emitter::ColorConfig; |
| 56 | use emitter::{is_case_difference, is_different, DynEmitter, Emitter}; | |
| 57 | use emitter::{DynEmitter, Emitter, is_case_difference, is_different}; | |
| 57 | 58 | use registry::Registry; |
| 59 | use rustc_data_structures::AtomicRef; | |
| 58 | 60 | use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet}; |
| 59 | 61 | use rustc_data_structures::stable_hasher::{Hash128, StableHasher}; |
| 60 | 62 | use rustc_data_structures::sync::{Lock, Lrc}; |
| 61 | use rustc_data_structures::AtomicRef; | |
| 62 | 63 | pub use rustc_error_messages::{ |
| 63 | fallback_fluent_bundle, fluent_bundle, DiagMessage, FluentBundle, LanguageIdentifier, | |
| 64 | LazyFallbackBundle, MultiSpan, SpanLabel, SubdiagMessage, | |
| 64 | DiagMessage, FluentBundle, LanguageIdentifier, LazyFallbackBundle, MultiSpan, SpanLabel, | |
| 65 | SubdiagMessage, fallback_fluent_bundle, fluent_bundle, | |
| 65 | 66 | }; |
| 66 | 67 | use rustc_lint_defs::LintExpectationId; |
| 67 | pub use rustc_lint_defs::{pluralize, Applicability}; | |
| 68 | pub use rustc_lint_defs::{Applicability, pluralize}; | |
| 68 | 69 | use rustc_macros::{Decodable, Encodable}; |
| 70 | pub use rustc_span::ErrorGuaranteed; | |
| 69 | 71 | pub use rustc_span::fatal_error::{FatalError, FatalErrorMarker}; |
| 70 | 72 | use rustc_span::source_map::SourceMap; |
| 71 | pub use rustc_span::ErrorGuaranteed; | |
| 72 | use rustc_span::{Loc, Span, DUMMY_SP}; | |
| 73 | use rustc_span::{DUMMY_SP, Loc, Span}; | |
| 73 | 74 | pub use snippet::Style; |
| 74 | 75 | // Used by external projects such as `rust-gpu`. |
| 75 | 76 | // See https://github.com/rust-lang/rust/pull/115393. |
| 76 | 77 | pub use termcolor::{Color, ColorSpec, WriteColor}; |
| 77 | 78 | use tracing::debug; |
| 78 | use Level::*; | |
| 79 | 79 | |
| 80 | 80 | pub mod annotate_snippet_emitter_writer; |
| 81 | 81 | pub mod codes; |
compiler/rustc_errors/src/lock.rs+2-2| ... | ... | @@ -16,11 +16,11 @@ pub(crate) fn acquire_global_lock(name: &str) -> Box<dyn Any> { |
| 16 | 16 | use std::ffi::CString; |
| 17 | 17 | use std::io; |
| 18 | 18 | |
| 19 | use windows::core::PCSTR; | |
| 20 | 19 | use windows::Win32::Foundation::{CloseHandle, HANDLE, WAIT_ABANDONED, WAIT_OBJECT_0}; |
| 21 | 20 | use windows::Win32::System::Threading::{ |
| 22 | CreateMutexA, ReleaseMutex, WaitForSingleObject, INFINITE, | |
| 21 | CreateMutexA, INFINITE, ReleaseMutex, WaitForSingleObject, | |
| 23 | 22 | }; |
| 23 | use windows::core::PCSTR; | |
| 24 | 24 | |
| 25 | 25 | struct Handle(HANDLE); |
| 26 | 26 |
compiler/rustc_errors/src/tests.rs+2-2| ... | ... | @@ -1,11 +1,11 @@ |
| 1 | 1 | use rustc_data_structures::sync::{IntoDynSyncSend, Lrc}; |
| 2 | 2 | use rustc_error_messages::fluent_bundle::resolver::errors::{ReferenceKind, ResolverError}; |
| 3 | use rustc_error_messages::{langid, DiagMessage}; | |
| 3 | use rustc_error_messages::{DiagMessage, langid}; | |
| 4 | 4 | |
| 5 | use crate::FluentBundle; | |
| 5 | 6 | use crate::error::{TranslateError, TranslateErrorKind}; |
| 6 | 7 | use crate::fluent_bundle::*; |
| 7 | 8 | use crate::translation::Translate; |
| 8 | use crate::FluentBundle; | |
| 9 | 9 | |
| 10 | 10 | struct Dummy { |
| 11 | 11 | bundle: FluentBundle, |
compiler/rustc_expand/src/base.rs+4-4| ... | ... | @@ -15,8 +15,8 @@ use rustc_data_structures::sync::{self, Lrc}; |
| 15 | 15 | use rustc_errors::{DiagCtxtHandle, ErrorGuaranteed, PResult}; |
| 16 | 16 | use rustc_feature::Features; |
| 17 | 17 | use rustc_lint_defs::{BufferedEarlyLint, RegisteredTools}; |
| 18 | use rustc_parse::parser::Parser; | |
| 19 | 18 | use rustc_parse::MACRO_ARGUMENTS; |
| 19 | use rustc_parse::parser::Parser; | |
| 20 | 20 | use rustc_session::config::CollapseMacroDebuginfo; |
| 21 | 21 | use rustc_session::parse::ParseSess; |
| 22 | 22 | use rustc_session::{Limit, Session}; |
| ... | ... | @@ -24,9 +24,9 @@ use rustc_span::def_id::{CrateNum, DefId, LocalDefId}; |
| 24 | 24 | use rustc_span::edition::Edition; |
| 25 | 25 | use rustc_span::hygiene::{AstPass, ExpnData, ExpnKind, LocalExpnId, MacroKind}; |
| 26 | 26 | use rustc_span::source_map::SourceMap; |
| 27 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 28 | use rustc_span::{FileName, Span, DUMMY_SP}; | |
| 29 | use smallvec::{smallvec, SmallVec}; | |
| 27 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 28 | use rustc_span::{DUMMY_SP, FileName, Span}; | |
| 29 | use smallvec::{SmallVec, smallvec}; | |
| 30 | 30 | use thin_vec::ThinVec; |
| 31 | 31 | |
| 32 | 32 | use crate::base::ast::NestedMetaItem; |
compiler/rustc_expand/src/build.rs+17-23| ... | ... | @@ -1,12 +1,12 @@ |
| 1 | 1 | use rustc_ast::ptr::P; |
| 2 | 2 | use rustc_ast::util::literal; |
| 3 | 3 | use rustc_ast::{ |
| 4 | self as ast, attr, token, AttrVec, BlockCheckMode, Expr, LocalKind, MatchKind, PatKind, UnOp, | |
| 4 | self as ast, AttrVec, BlockCheckMode, Expr, LocalKind, MatchKind, PatKind, UnOp, attr, token, | |
| 5 | 5 | }; |
| 6 | 6 | use rustc_span::source_map::Spanned; |
| 7 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 8 | use rustc_span::{Span, DUMMY_SP}; | |
| 9 | use thin_vec::{thin_vec, ThinVec}; | |
| 7 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 8 | use rustc_span::{DUMMY_SP, Span}; | |
| 9 | use thin_vec::{ThinVec, thin_vec}; | |
| 10 | 10 | |
| 11 | 11 | use crate::base::ExtCtxt; |
| 12 | 12 | |
| ... | ... | @@ -152,18 +152,15 @@ impl<'a> ExtCtxt<'a> { |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | pub fn trait_bound(&self, path: ast::Path, is_const: bool) -> ast::GenericBound { |
| 155 | ast::GenericBound::Trait( | |
| 156 | self.poly_trait_ref(path.span, path), | |
| 157 | ast::TraitBoundModifiers { | |
| 158 | polarity: ast::BoundPolarity::Positive, | |
| 159 | constness: if is_const { | |
| 160 | ast::BoundConstness::Maybe(DUMMY_SP) | |
| 161 | } else { | |
| 162 | ast::BoundConstness::Never | |
| 163 | }, | |
| 164 | asyncness: ast::BoundAsyncness::Normal, | |
| 155 | ast::GenericBound::Trait(self.poly_trait_ref(path.span, path), ast::TraitBoundModifiers { | |
| 156 | polarity: ast::BoundPolarity::Positive, | |
| 157 | constness: if is_const { | |
| 158 | ast::BoundConstness::Maybe(DUMMY_SP) | |
| 159 | } else { | |
| 160 | ast::BoundConstness::Never | |
| 165 | 161 | }, |
| 166 | ) | |
| 162 | asyncness: ast::BoundAsyncness::Normal, | |
| 163 | }) | |
| 167 | 164 | } |
| 168 | 165 | |
| 169 | 166 | pub fn lifetime(&self, span: Span, ident: Ident) -> ast::Lifetime { |
| ... | ... | @@ -232,14 +229,11 @@ impl<'a> ExtCtxt<'a> { |
| 232 | 229 | } |
| 233 | 230 | |
| 234 | 231 | pub fn block_expr(&self, expr: P<ast::Expr>) -> P<ast::Block> { |
| 235 | self.block( | |
| 236 | expr.span, | |
| 237 | thin_vec![ast::Stmt { | |
| 238 | id: ast::DUMMY_NODE_ID, | |
| 239 | span: expr.span, | |
| 240 | kind: ast::StmtKind::Expr(expr), | |
| 241 | }], | |
| 242 | ) | |
| 232 | self.block(expr.span, thin_vec![ast::Stmt { | |
| 233 | id: ast::DUMMY_NODE_ID, | |
| 234 | span: expr.span, | |
| 235 | kind: ast::StmtKind::Expr(expr), | |
| 236 | }]) | |
| 243 | 237 | } |
| 244 | 238 | pub fn block(&self, span: Span, stmts: ThinVec<ast::Stmt>) -> P<ast::Block> { |
| 245 | 239 | P(ast::Block { |
compiler/rustc_expand/src/config.rs+3-3| ... | ... | @@ -9,14 +9,14 @@ use rustc_ast::{self as ast, AttrStyle, Attribute, HasAttrs, HasTokens, MetaItem |
| 9 | 9 | use rustc_attr as attr; |
| 10 | 10 | use rustc_data_structures::flat_map_in_place::FlatMapInPlace; |
| 11 | 11 | use rustc_feature::{ |
| 12 | AttributeSafety, Features, ACCEPTED_FEATURES, REMOVED_FEATURES, UNSTABLE_FEATURES, | |
| 12 | ACCEPTED_FEATURES, AttributeSafety, Features, REMOVED_FEATURES, UNSTABLE_FEATURES, | |
| 13 | 13 | }; |
| 14 | 14 | use rustc_lint_defs::BuiltinLintDiag; |
| 15 | 15 | use rustc_parse::validate_attr; |
| 16 | use rustc_session::parse::feature_err; | |
| 17 | 16 | use rustc_session::Session; |
| 18 | use rustc_span::symbol::{sym, Symbol}; | |
| 17 | use rustc_session::parse::feature_err; | |
| 19 | 18 | use rustc_span::Span; |
| 19 | use rustc_span::symbol::{Symbol, sym}; | |
| 20 | 20 | use thin_vec::ThinVec; |
| 21 | 21 | use tracing::instrument; |
| 22 | 22 |
compiler/rustc_expand/src/expand.rs+5-5| ... | ... | @@ -8,7 +8,7 @@ use rustc_ast::mut_visit::*; |
| 8 | 8 | use rustc_ast::ptr::P; |
| 9 | 9 | use rustc_ast::token::{self, Delimiter}; |
| 10 | 10 | use rustc_ast::tokenstream::TokenStream; |
| 11 | use rustc_ast::visit::{self, try_visit, walk_list, AssocCtxt, Visitor, VisitorResult}; | |
| 11 | use rustc_ast::visit::{self, AssocCtxt, Visitor, VisitorResult, try_visit, walk_list}; | |
| 12 | 12 | use rustc_ast::{ |
| 13 | 13 | AssocItemKind, AstNodeWrapper, AttrArgs, AttrStyle, AttrVec, ExprKind, ForeignItemKind, |
| 14 | 14 | HasAttrs, HasNodeId, Inline, ItemKind, MacStmtStyle, MetaItemKind, ModKind, NestedMetaItem, |
| ... | ... | @@ -23,12 +23,12 @@ use rustc_parse::parser::{ |
| 23 | 23 | AttemptLocalParseRecovery, CommaRecoveryMode, ForceCollect, Parser, RecoverColon, RecoverComma, |
| 24 | 24 | }; |
| 25 | 25 | use rustc_parse::validate_attr; |
| 26 | use rustc_session::lint::builtin::{UNUSED_ATTRIBUTES, UNUSED_DOC_COMMENTS}; | |
| 27 | 26 | use rustc_session::lint::BuiltinLintDiag; |
| 27 | use rustc_session::lint::builtin::{UNUSED_ATTRIBUTES, UNUSED_DOC_COMMENTS}; | |
| 28 | 28 | use rustc_session::parse::feature_err; |
| 29 | 29 | use rustc_session::{Limit, Session}; |
| 30 | 30 | use rustc_span::hygiene::SyntaxContext; |
| 31 | use rustc_span::symbol::{sym, Ident}; | |
| 31 | use rustc_span::symbol::{Ident, sym}; | |
| 32 | 32 | use rustc_span::{ErrorGuaranteed, FileName, LocalExpnId, Span}; |
| 33 | 33 | use smallvec::SmallVec; |
| 34 | 34 | |
| ... | ... | @@ -42,9 +42,9 @@ use crate::errors::{ |
| 42 | 42 | use crate::fluent_generated; |
| 43 | 43 | use crate::mbe::diagnostics::annotate_err_with_kind; |
| 44 | 44 | use crate::module::{ |
| 45 | mod_dir_path, mod_file_path_from_attr, parse_external_mod, DirOwnership, ParsedExternalMod, | |
| 45 | DirOwnership, ParsedExternalMod, mod_dir_path, mod_file_path_from_attr, parse_external_mod, | |
| 46 | 46 | }; |
| 47 | use crate::placeholders::{placeholder, PlaceholderExpander}; | |
| 47 | use crate::placeholders::{PlaceholderExpander, placeholder}; | |
| 48 | 48 | |
| 49 | 49 | macro_rules! ast_fragments { |
| 50 | 50 | ( |
compiler/rustc_expand/src/mbe.rs+1-1| ... | ... | @@ -16,8 +16,8 @@ use metavar_expr::MetaVarExpr; |
| 16 | 16 | use rustc_ast::token::{Delimiter, NonterminalKind, Token, TokenKind}; |
| 17 | 17 | use rustc_ast::tokenstream::{DelimSpacing, DelimSpan}; |
| 18 | 18 | use rustc_macros::{Decodable, Encodable}; |
| 19 | use rustc_span::symbol::Ident; | |
| 20 | 19 | use rustc_span::Span; |
| 20 | use rustc_span::symbol::Ident; | |
| 21 | 21 | |
| 22 | 22 | /// Contains the sub-token-trees of a "delimited" token tree such as `(a b c)`. |
| 23 | 23 | /// The delimiters are not represented explicitly in the `tts` vector. |
compiler/rustc_expand/src/mbe/diagnostics.rs+3-3| ... | ... | @@ -12,11 +12,11 @@ use rustc_span::symbol::Ident; |
| 12 | 12 | use rustc_span::{ErrorGuaranteed, Span}; |
| 13 | 13 | use tracing::debug; |
| 14 | 14 | |
| 15 | use super::macro_rules::{parser_from_cx, NoopTracker}; | |
| 16 | use crate::expand::{parse_ast_fragment, AstFragmentKind}; | |
| 15 | use super::macro_rules::{NoopTracker, parser_from_cx}; | |
| 16 | use crate::expand::{AstFragmentKind, parse_ast_fragment}; | |
| 17 | 17 | use crate::mbe::macro_parser::ParseResult::*; |
| 18 | 18 | use crate::mbe::macro_parser::{MatcherLoc, NamedParseResult, TtParser}; |
| 19 | use crate::mbe::macro_rules::{try_match_macro, Tracker}; | |
| 19 | use crate::mbe::macro_rules::{Tracker, try_match_macro}; | |
| 20 | 20 | |
| 21 | 21 | pub(super) fn failed_to_match_macro( |
| 22 | 22 | psess: &ParseSess, |
compiler/rustc_expand/src/mbe/macro_check.rs+2-2| ... | ... | @@ -108,14 +108,14 @@ |
| 108 | 108 | use std::iter; |
| 109 | 109 | |
| 110 | 110 | use rustc_ast::token::{Delimiter, IdentIsRaw, Token, TokenKind}; |
| 111 | use rustc_ast::{NodeId, DUMMY_NODE_ID}; | |
| 111 | use rustc_ast::{DUMMY_NODE_ID, NodeId}; | |
| 112 | 112 | use rustc_data_structures::fx::FxHashMap; |
| 113 | 113 | use rustc_errors::MultiSpan; |
| 114 | 114 | use rustc_lint_defs::BuiltinLintDiag; |
| 115 | 115 | use rustc_session::lint::builtin::{META_VARIABLE_MISUSE, MISSING_FRAGMENT_SPECIFIER}; |
| 116 | 116 | use rustc_session::parse::ParseSess; |
| 117 | 117 | use rustc_span::edition::Edition; |
| 118 | use rustc_span::symbol::{kw, MacroRulesNormalizedIdent}; | |
| 118 | use rustc_span::symbol::{MacroRulesNormalizedIdent, kw}; | |
| 119 | 119 | use rustc_span::{ErrorGuaranteed, Span}; |
| 120 | 120 | use smallvec::SmallVec; |
| 121 | 121 |
compiler/rustc_expand/src/mbe/macro_parser.rs+3-3| ... | ... | @@ -75,16 +75,16 @@ use std::collections::hash_map::Entry::{Occupied, Vacant}; |
| 75 | 75 | use std::fmt::Display; |
| 76 | 76 | use std::rc::Rc; |
| 77 | 77 | |
| 78 | pub(crate) use NamedMatch::*; | |
| 79 | pub(crate) use ParseResult::*; | |
| 78 | 80 | use rustc_ast::token::{self, DocComment, NonterminalKind, Token}; |
| 79 | 81 | use rustc_ast_pretty::pprust; |
| 80 | 82 | use rustc_data_structures::fx::FxHashMap; |
| 81 | 83 | use rustc_errors::ErrorGuaranteed; |
| 82 | 84 | use rustc_lint_defs::pluralize; |
| 83 | 85 | use rustc_parse::parser::{ParseNtResult, Parser}; |
| 84 | use rustc_span::symbol::{Ident, MacroRulesNormalizedIdent}; | |
| 85 | 86 | use rustc_span::Span; |
| 86 | pub(crate) use NamedMatch::*; | |
| 87 | pub(crate) use ParseResult::*; | |
| 87 | use rustc_span::symbol::{Ident, MacroRulesNormalizedIdent}; | |
| 88 | 88 | |
| 89 | 89 | use crate::mbe::macro_rules::Tracker; |
| 90 | 90 | use crate::mbe::{KleeneOp, TokenTree}; |
compiler/rustc_expand/src/mbe/macro_rules.rs+28-34| ... | ... | @@ -8,23 +8,23 @@ use rustc_ast::token::NtPatKind::*; |
| 8 | 8 | use rustc_ast::token::TokenKind::*; |
| 9 | 9 | use rustc_ast::token::{self, Delimiter, NonterminalKind, Token, TokenKind}; |
| 10 | 10 | use rustc_ast::tokenstream::{DelimSpan, TokenStream}; |
| 11 | use rustc_ast::{NodeId, DUMMY_NODE_ID}; | |
| 11 | use rustc_ast::{DUMMY_NODE_ID, NodeId}; | |
| 12 | 12 | use rustc_ast_pretty::pprust; |
| 13 | 13 | use rustc_attr::{self as attr, TransparencyError}; |
| 14 | 14 | use rustc_data_structures::fx::{FxHashMap, FxIndexMap}; |
| 15 | 15 | use rustc_errors::{Applicability, ErrorGuaranteed}; |
| 16 | 16 | use rustc_feature::Features; |
| 17 | use rustc_lint_defs::BuiltinLintDiag; | |
| 17 | 18 | use rustc_lint_defs::builtin::{ |
| 18 | 19 | RUST_2021_INCOMPATIBLE_OR_PATTERNS, SEMICOLON_IN_EXPRESSIONS_FROM_MACROS, |
| 19 | 20 | }; |
| 20 | use rustc_lint_defs::BuiltinLintDiag; | |
| 21 | 21 | use rustc_parse::parser::{ParseNtResult, Parser, Recovery}; |
| 22 | use rustc_session::parse::ParseSess; | |
| 23 | 22 | use rustc_session::Session; |
| 23 | use rustc_session::parse::ParseSess; | |
| 24 | use rustc_span::Span; | |
| 24 | 25 | use rustc_span::edition::Edition; |
| 25 | 26 | use rustc_span::hygiene::Transparency; |
| 26 | use rustc_span::symbol::{kw, sym, Ident, MacroRulesNormalizedIdent}; | |
| 27 | use rustc_span::Span; | |
| 27 | use rustc_span::symbol::{Ident, MacroRulesNormalizedIdent, kw, sym}; | |
| 28 | 28 | use tracing::{debug, instrument, trace, trace_span}; |
| 29 | 29 | |
| 30 | 30 | use super::diagnostics; |
| ... | ... | @@ -33,7 +33,7 @@ use crate::base::{ |
| 33 | 33 | DummyResult, ExpandResult, ExtCtxt, MacResult, MacroExpanderResult, SyntaxExtension, |
| 34 | 34 | SyntaxExtensionKind, TTMacroExpander, |
| 35 | 35 | }; |
| 36 | use crate::expand::{ensure_complete_parse, parse_ast_fragment, AstFragment, AstFragmentKind}; | |
| 36 | use crate::expand::{AstFragment, AstFragmentKind, ensure_complete_parse, parse_ast_fragment}; | |
| 37 | 37 | use crate::mbe; |
| 38 | 38 | use crate::mbe::diagnostics::{annotate_doc_comment, parse_failure_msg}; |
| 39 | 39 | use crate::mbe::macro_check; |
| ... | ... | @@ -408,35 +408,29 @@ pub fn compile_declarative_macro( |
| 408 | 408 | // ...quasiquoting this would be nice. |
| 409 | 409 | // These spans won't matter, anyways |
| 410 | 410 | let argument_gram = vec![ |
| 411 | mbe::TokenTree::Sequence( | |
| 412 | DelimSpan::dummy(), | |
| 413 | mbe::SequenceRepetition { | |
| 414 | tts: vec![ | |
| 415 | mbe::TokenTree::MetaVarDecl(def.span, lhs_nm, tt_spec), | |
| 416 | mbe::TokenTree::token(token::FatArrow, def.span), | |
| 417 | mbe::TokenTree::MetaVarDecl(def.span, rhs_nm, tt_spec), | |
| 418 | ], | |
| 419 | separator: Some(Token::new( | |
| 420 | if macro_rules { token::Semi } else { token::Comma }, | |
| 421 | def.span, | |
| 422 | )), | |
| 423 | kleene: mbe::KleeneToken::new(mbe::KleeneOp::OneOrMore, def.span), | |
| 424 | num_captures: 2, | |
| 425 | }, | |
| 426 | ), | |
| 411 | mbe::TokenTree::Sequence(DelimSpan::dummy(), mbe::SequenceRepetition { | |
| 412 | tts: vec![ | |
| 413 | mbe::TokenTree::MetaVarDecl(def.span, lhs_nm, tt_spec), | |
| 414 | mbe::TokenTree::token(token::FatArrow, def.span), | |
| 415 | mbe::TokenTree::MetaVarDecl(def.span, rhs_nm, tt_spec), | |
| 416 | ], | |
| 417 | separator: Some(Token::new( | |
| 418 | if macro_rules { token::Semi } else { token::Comma }, | |
| 419 | def.span, | |
| 420 | )), | |
| 421 | kleene: mbe::KleeneToken::new(mbe::KleeneOp::OneOrMore, def.span), | |
| 422 | num_captures: 2, | |
| 423 | }), | |
| 427 | 424 | // to phase into semicolon-termination instead of semicolon-separation |
| 428 | mbe::TokenTree::Sequence( | |
| 429 | DelimSpan::dummy(), | |
| 430 | mbe::SequenceRepetition { | |
| 431 | tts: vec![mbe::TokenTree::token( | |
| 432 | if macro_rules { token::Semi } else { token::Comma }, | |
| 433 | def.span, | |
| 434 | )], | |
| 435 | separator: None, | |
| 436 | kleene: mbe::KleeneToken::new(mbe::KleeneOp::ZeroOrMore, def.span), | |
| 437 | num_captures: 0, | |
| 438 | }, | |
| 439 | ), | |
| 425 | mbe::TokenTree::Sequence(DelimSpan::dummy(), mbe::SequenceRepetition { | |
| 426 | tts: vec![mbe::TokenTree::token( | |
| 427 | if macro_rules { token::Semi } else { token::Comma }, | |
| 428 | def.span, | |
| 429 | )], | |
| 430 | separator: None, | |
| 431 | kleene: mbe::KleeneToken::new(mbe::KleeneOp::ZeroOrMore, def.span), | |
| 432 | num_captures: 0, | |
| 433 | }), | |
| 440 | 434 | ]; |
| 441 | 435 | // Convert it into `MatcherLoc` form. |
| 442 | 436 | let argument_gram = mbe::macro_parser::compute_locs(&argument_gram); |
compiler/rustc_expand/src/mbe/quoted.rs+22-22| ... | ... | @@ -1,13 +1,13 @@ |
| 1 | 1 | use rustc_ast::token::NtExprKind::*; |
| 2 | 2 | use rustc_ast::token::{self, Delimiter, IdentIsRaw, NonterminalKind, Token}; |
| 3 | use rustc_ast::{tokenstream, NodeId}; | |
| 3 | use rustc_ast::{NodeId, tokenstream}; | |
| 4 | 4 | use rustc_ast_pretty::pprust; |
| 5 | 5 | use rustc_feature::Features; |
| 6 | use rustc_session::parse::feature_err; | |
| 7 | 6 | use rustc_session::Session; |
| 8 | use rustc_span::edition::Edition; | |
| 9 | use rustc_span::symbol::{kw, sym, Ident}; | |
| 7 | use rustc_session::parse::feature_err; | |
| 10 | 8 | use rustc_span::Span; |
| 9 | use rustc_span::edition::Edition; | |
| 10 | use rustc_span::symbol::{Ident, kw, sym}; | |
| 11 | 11 | |
| 12 | 12 | use crate::errors; |
| 13 | 13 | use crate::mbe::macro_parser::count_metavar_decls; |
| ... | ... | @@ -207,10 +207,10 @@ fn parse_tree<'a>( |
| 207 | 207 | Some(&tokenstream::TokenTree::Delimited(delim_span, _, delim, ref tts)) => { |
| 208 | 208 | if parsing_patterns { |
| 209 | 209 | if delim != Delimiter::Parenthesis { |
| 210 | span_dollar_dollar_or_metavar_in_the_lhs_err( | |
| 211 | sess, | |
| 212 | &Token { kind: token::OpenDelim(delim), span: delim_span.entire() }, | |
| 213 | ); | |
| 210 | span_dollar_dollar_or_metavar_in_the_lhs_err(sess, &Token { | |
| 211 | kind: token::OpenDelim(delim), | |
| 212 | span: delim_span.entire(), | |
| 213 | }); | |
| 214 | 214 | } |
| 215 | 215 | } else { |
| 216 | 216 | match delim { |
| ... | ... | @@ -263,10 +263,12 @@ fn parse_tree<'a>( |
| 263 | 263 | // Count the number of captured "names" (i.e., named metavars) |
| 264 | 264 | let num_captures = |
| 265 | 265 | if parsing_patterns { count_metavar_decls(&sequence) } else { 0 }; |
| 266 | TokenTree::Sequence( | |
| 267 | delim_span, | |
| 268 | SequenceRepetition { tts: sequence, separator, kleene, num_captures }, | |
| 269 | ) | |
| 266 | TokenTree::Sequence(delim_span, SequenceRepetition { | |
| 267 | tts: sequence, | |
| 268 | separator, | |
| 269 | kleene, | |
| 270 | num_captures, | |
| 271 | }) | |
| 270 | 272 | } |
| 271 | 273 | |
| 272 | 274 | // `tree` is followed by an `ident`. This could be `$meta_var` or the `$crate` |
| ... | ... | @@ -287,10 +289,10 @@ fn parse_tree<'a>( |
| 287 | 289 | _, |
| 288 | 290 | )) => { |
| 289 | 291 | if parsing_patterns { |
| 290 | span_dollar_dollar_or_metavar_in_the_lhs_err( | |
| 291 | sess, | |
| 292 | &Token { kind: token::Dollar, span: dollar_span2 }, | |
| 293 | ); | |
| 292 | span_dollar_dollar_or_metavar_in_the_lhs_err(sess, &Token { | |
| 293 | kind: token::Dollar, | |
| 294 | span: dollar_span2, | |
| 295 | }); | |
| 294 | 296 | } else { |
| 295 | 297 | maybe_emit_macro_metavar_expr_feature(features, sess, dollar_span2); |
| 296 | 298 | } |
| ... | ... | @@ -315,14 +317,12 @@ fn parse_tree<'a>( |
| 315 | 317 | |
| 316 | 318 | // `tree` is the beginning of a delimited set of tokens (e.g., `(` or `{`). We need to |
| 317 | 319 | // descend into the delimited set and further parse it. |
| 318 | &tokenstream::TokenTree::Delimited(span, spacing, delim, ref tts) => TokenTree::Delimited( | |
| 319 | span, | |
| 320 | spacing, | |
| 321 | Delimited { | |
| 320 | &tokenstream::TokenTree::Delimited(span, spacing, delim, ref tts) => { | |
| 321 | TokenTree::Delimited(span, spacing, Delimited { | |
| 322 | 322 | delim, |
| 323 | 323 | tts: parse(tts, parsing_patterns, sess, node_id, features, edition), |
| 324 | }, | |
| 325 | ), | |
| 324 | }) | |
| 325 | } | |
| 326 | 326 | } |
| 327 | 327 | } |
| 328 | 328 |
compiler/rustc_expand/src/mbe/transcribe.rs+5-5| ... | ... | @@ -1,18 +1,18 @@ |
| 1 | 1 | use std::mem; |
| 2 | 2 | |
| 3 | use rustc_ast::ExprKind; | |
| 3 | 4 | use rustc_ast::mut_visit::{self, MutVisitor}; |
| 4 | 5 | use rustc_ast::token::{self, Delimiter, IdentIsRaw, Lit, LitKind, Nonterminal, Token, TokenKind}; |
| 5 | 6 | use rustc_ast::tokenstream::{DelimSpacing, DelimSpan, Spacing, TokenStream, TokenTree}; |
| 6 | use rustc_ast::ExprKind; | |
| 7 | 7 | use rustc_data_structures::fx::FxHashMap; |
| 8 | use rustc_errors::{pluralize, Diag, DiagCtxtHandle, PResult}; | |
| 8 | use rustc_errors::{Diag, DiagCtxtHandle, PResult, pluralize}; | |
| 9 | 9 | use rustc_parse::lexer::nfc_normalize; |
| 10 | 10 | use rustc_parse::parser::ParseNtResult; |
| 11 | 11 | use rustc_session::parse::{ParseSess, SymbolGallery}; |
| 12 | 12 | use rustc_span::hygiene::{LocalExpnId, Transparency}; |
| 13 | use rustc_span::symbol::{sym, Ident, MacroRulesNormalizedIdent}; | |
| 14 | use rustc_span::{with_metavar_spans, Span, Symbol, SyntaxContext}; | |
| 15 | use smallvec::{smallvec, SmallVec}; | |
| 13 | use rustc_span::symbol::{Ident, MacroRulesNormalizedIdent, sym}; | |
| 14 | use rustc_span::{Span, Symbol, SyntaxContext, with_metavar_spans}; | |
| 15 | use smallvec::{SmallVec, smallvec}; | |
| 16 | 16 | |
| 17 | 17 | use crate::errors::{ |
| 18 | 18 | CountRepetitionMisplaced, MetaVarExprUnrecognizedVar, MetaVarsDifSeqMatchers, MustRepeatOnce, |
compiler/rustc_expand/src/module.rs+3-3| ... | ... | @@ -2,13 +2,13 @@ use std::iter::once; |
| 2 | 2 | use std::path::{self, Path, PathBuf}; |
| 3 | 3 | |
| 4 | 4 | use rustc_ast::ptr::P; |
| 5 | use rustc_ast::{token, AttrVec, Attribute, Inline, Item, ModSpans}; | |
| 5 | use rustc_ast::{AttrVec, Attribute, Inline, Item, ModSpans, token}; | |
| 6 | 6 | use rustc_errors::{Diag, ErrorGuaranteed}; |
| 7 | 7 | use rustc_parse::{new_parser_from_file, unwrap_or_emit_fatal, validate_attr}; |
| 8 | use rustc_session::parse::ParseSess; | |
| 9 | 8 | use rustc_session::Session; |
| 10 | use rustc_span::symbol::{sym, Ident}; | |
| 9 | use rustc_session::parse::ParseSess; | |
| 11 | 10 | use rustc_span::Span; |
| 11 | use rustc_span::symbol::{Ident, sym}; | |
| 12 | 12 | use thin_vec::ThinVec; |
| 13 | 13 | |
| 14 | 14 | use crate::base::ModuleData; |
compiler/rustc_expand/src/placeholders.rs+2-2| ... | ... | @@ -4,9 +4,9 @@ use rustc_ast::token::Delimiter; |
| 4 | 4 | use rustc_ast::visit::AssocCtxt; |
| 5 | 5 | use rustc_ast::{self as ast}; |
| 6 | 6 | use rustc_data_structures::fx::FxHashMap; |
| 7 | use rustc_span::symbol::Ident; | |
| 8 | 7 | use rustc_span::DUMMY_SP; |
| 9 | use smallvec::{smallvec, SmallVec}; | |
| 8 | use rustc_span::symbol::Ident; | |
| 9 | use smallvec::{SmallVec, smallvec}; | |
| 10 | 10 | use thin_vec::ThinVec; |
| 11 | 11 | |
| 12 | 12 | use crate::expand::{AstFragment, AstFragmentKind}; |
compiler/rustc_expand/src/proc_macro.rs+1-1| ... | ... | @@ -4,8 +4,8 @@ use rustc_ast::tokenstream::TokenStream; |
| 4 | 4 | use rustc_errors::ErrorGuaranteed; |
| 5 | 5 | use rustc_parse::parser::{ForceCollect, Parser}; |
| 6 | 6 | use rustc_session::config::ProcMacroExecutionStrategy; |
| 7 | use rustc_span::profiling::SpannedEventArgRecorder; | |
| 8 | 7 | use rustc_span::Span; |
| 8 | use rustc_span::profiling::SpannedEventArgRecorder; | |
| 9 | 9 | |
| 10 | 10 | use crate::base::{self, *}; |
| 11 | 11 | use crate::{errors, proc_macro_server}; |
compiler/rustc_expand/src/proc_macro_server.rs+3-3| ... | ... | @@ -2,7 +2,7 @@ use std::ops::{Bound, Range}; |
| 2 | 2 | |
| 3 | 3 | use ast::token::IdentIsRaw; |
| 4 | 4 | use pm::bridge::{ |
| 5 | server, DelimSpan, Diagnostic, ExpnGlobals, Group, Ident, LitKind, Literal, Punct, TokenTree, | |
| 5 | DelimSpan, Diagnostic, ExpnGlobals, Group, Ident, LitKind, Literal, Punct, TokenTree, server, | |
| 6 | 6 | }; |
| 7 | 7 | use pm::{Delimiter, Level}; |
| 8 | 8 | use rustc_ast as ast; |
| ... | ... | @@ -18,9 +18,9 @@ use rustc_parse::parser::Parser; |
| 18 | 18 | use rustc_parse::{new_parser_from_source_str, source_str_to_stream, unwrap_or_emit_fatal}; |
| 19 | 19 | use rustc_session::parse::ParseSess; |
| 20 | 20 | use rustc_span::def_id::CrateNum; |
| 21 | use rustc_span::symbol::{self, sym, Symbol}; | |
| 21 | use rustc_span::symbol::{self, Symbol, sym}; | |
| 22 | 22 | use rustc_span::{BytePos, FileName, Pos, SourceFile, Span}; |
| 23 | use smallvec::{smallvec, SmallVec}; | |
| 23 | use smallvec::{SmallVec, smallvec}; | |
| 24 | 24 | |
| 25 | 25 | use crate::base::ExtCtxt; |
| 26 | 26 |
compiler/rustc_feature/src/accepted.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | use rustc_span::symbol::sym; |
| 4 | 4 | |
| 5 | use super::{to_nonzero, Feature}; | |
| 5 | use super::{Feature, to_nonzero}; | |
| 6 | 6 | |
| 7 | 7 | macro_rules! declare_features { |
| 8 | 8 | ($( |
compiler/rustc_feature/src/builtin_attrs.rs+2-2| ... | ... | @@ -2,11 +2,11 @@ |
| 2 | 2 | |
| 3 | 3 | use std::sync::LazyLock; |
| 4 | 4 | |
| 5 | use rustc_data_structures::fx::FxHashMap; | |
| 6 | use rustc_span::symbol::{sym, Symbol}; | |
| 7 | 5 | use AttributeDuplicates::*; |
| 8 | 6 | use AttributeGate::*; |
| 9 | 7 | use AttributeType::*; |
| 8 | use rustc_data_structures::fx::FxHashMap; | |
| 9 | use rustc_span::symbol::{Symbol, sym}; | |
| 10 | 10 | |
| 11 | 11 | use crate::{Features, Stability}; |
| 12 | 12 |
compiler/rustc_feature/src/lib.rs+4-4| ... | ... | @@ -129,10 +129,10 @@ pub fn find_feature_issue(feature: Symbol, issue: GateIssue) -> Option<NonZero<u |
| 129 | 129 | |
| 130 | 130 | pub use accepted::ACCEPTED_FEATURES; |
| 131 | 131 | pub use builtin_attrs::{ |
| 132 | deprecated_attributes, encode_cross_crate, find_gated_cfg, is_builtin_attr_name, | |
| 133 | is_stable_diagnostic_attribute, is_valid_for_get_attr, AttributeDuplicates, AttributeGate, | |
| 134 | AttributeSafety, AttributeTemplate, AttributeType, BuiltinAttribute, GatedCfg, | |
| 135 | BUILTIN_ATTRIBUTES, BUILTIN_ATTRIBUTE_MAP, | |
| 132 | AttributeDuplicates, AttributeGate, AttributeSafety, AttributeTemplate, AttributeType, | |
| 133 | BUILTIN_ATTRIBUTE_MAP, BUILTIN_ATTRIBUTES, BuiltinAttribute, GatedCfg, deprecated_attributes, | |
| 134 | encode_cross_crate, find_gated_cfg, is_builtin_attr_name, is_stable_diagnostic_attribute, | |
| 135 | is_valid_for_get_attr, | |
| 136 | 136 | }; |
| 137 | 137 | pub use removed::REMOVED_FEATURES; |
| 138 | 138 | pub use unstable::{Features, INCOMPATIBLE_FEATURES, UNSTABLE_FEATURES}; |
compiler/rustc_feature/src/removed.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | use rustc_span::symbol::sym; |
| 4 | 4 | |
| 5 | use super::{to_nonzero, Feature}; | |
| 5 | use super::{Feature, to_nonzero}; | |
| 6 | 6 | |
| 7 | 7 | pub struct RemovedFeature { |
| 8 | 8 | pub feature: Feature, |
compiler/rustc_feature/src/unstable.rs+2-2| ... | ... | @@ -1,10 +1,10 @@ |
| 1 | 1 | //! List of the unstable feature gates. |
| 2 | 2 | |
| 3 | 3 | use rustc_data_structures::fx::FxHashSet; |
| 4 | use rustc_span::symbol::{sym, Symbol}; | |
| 5 | 4 | use rustc_span::Span; |
| 5 | use rustc_span::symbol::{Symbol, sym}; | |
| 6 | 6 | |
| 7 | use super::{to_nonzero, Feature}; | |
| 7 | use super::{Feature, to_nonzero}; | |
| 8 | 8 | |
| 9 | 9 | pub struct UnstableFeature { |
| 10 | 10 | pub feature: Feature, |
compiler/rustc_fluent_macro/src/fluent.rs+1-1| ... | ... | @@ -11,7 +11,7 @@ use fluent_syntax::parser::ParserError; |
| 11 | 11 | use proc_macro::{Diagnostic, Level, Span}; |
| 12 | 12 | use proc_macro2::TokenStream; |
| 13 | 13 | use quote::quote; |
| 14 | use syn::{parse_macro_input, Ident, LitStr}; | |
| 14 | use syn::{Ident, LitStr, parse_macro_input}; | |
| 15 | 15 | use unic_langid::langid; |
| 16 | 16 | |
| 17 | 17 | /// Helper function for returning an absolute path for macro-invocation relative file paths. |
compiler/rustc_fs_util/src/lib.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use std::ffi::CString; |
| 2 | use std::path::{absolute, Path, PathBuf}; | |
| 2 | use std::path::{Path, PathBuf, absolute}; | |
| 3 | 3 | use std::{fs, io}; |
| 4 | 4 | |
| 5 | 5 | // Unfortunately, on windows, it looks like msvcrt.dll is silently translating |
compiler/rustc_graphviz/src/tests.rs+7-11| ... | ... | @@ -4,7 +4,7 @@ use std::io::prelude::*; |
| 4 | 4 | use NodeLabels::*; |
| 5 | 5 | |
| 6 | 6 | use super::LabelText::{self, EscStr, HtmlStr, LabelStr}; |
| 7 | use super::{render, Edges, GraphWalk, Id, Labeller, Nodes, Style}; | |
| 7 | use super::{Edges, GraphWalk, Id, Labeller, Nodes, Style, render}; | |
| 8 | 8 | |
| 9 | 9 | /// each node is an index in a vector in the graph. |
| 10 | 10 | type Node = usize; |
| ... | ... | @@ -360,16 +360,12 @@ fn left_aligned_text() { |
| 360 | 360 | |
| 361 | 361 | let mut writer = Vec::new(); |
| 362 | 362 | |
| 363 | let g = LabelledGraphWithEscStrs::new( | |
| 364 | "syntax_tree", | |
| 365 | labels, | |
| 366 | vec![ | |
| 367 | edge(0, 1, "then", Style::None), | |
| 368 | edge(0, 2, "else", Style::None), | |
| 369 | edge(1, 3, ";", Style::None), | |
| 370 | edge(2, 3, ";", Style::None), | |
| 371 | ], | |
| 372 | ); | |
| 363 | let g = LabelledGraphWithEscStrs::new("syntax_tree", labels, vec![ | |
| 364 | edge(0, 1, "then", Style::None), | |
| 365 | edge(0, 2, "else", Style::None), | |
| 366 | edge(1, 3, ";", Style::None), | |
| 367 | edge(2, 3, ";", Style::None), | |
| 368 | ]); | |
| 373 | 369 | |
| 374 | 370 | render(&g, &mut writer).unwrap(); |
| 375 | 371 | let mut r = String::new(); |
compiler/rustc_hir/src/def.rs+1-1| ... | ... | @@ -6,10 +6,10 @@ use rustc_ast::NodeId; |
| 6 | 6 | use rustc_data_structures::stable_hasher::ToStableHashKey; |
| 7 | 7 | use rustc_data_structures::unord::UnordMap; |
| 8 | 8 | use rustc_macros::{Decodable, Encodable, HashStable_Generic}; |
| 9 | use rustc_span::Symbol; | |
| 9 | 10 | use rustc_span::def_id::{DefId, LocalDefId}; |
| 10 | 11 | use rustc_span::hygiene::MacroKind; |
| 11 | 12 | use rustc_span::symbol::kw; |
| 12 | use rustc_span::Symbol; | |
| 13 | 13 | |
| 14 | 14 | use crate::definitions::DefPathData; |
| 15 | 15 | use crate::hir; |
compiler/rustc_hir/src/definitions.rs+2-2| ... | ... | @@ -11,11 +11,11 @@ use rustc_data_structures::stable_hasher::{Hash64, StableHasher}; |
| 11 | 11 | use rustc_data_structures::unord::UnordMap; |
| 12 | 12 | use rustc_index::IndexVec; |
| 13 | 13 | use rustc_macros::{Decodable, Encodable}; |
| 14 | use rustc_span::symbol::{kw, sym, Symbol}; | |
| 14 | use rustc_span::symbol::{Symbol, kw, sym}; | |
| 15 | 15 | use tracing::{debug, instrument}; |
| 16 | 16 | |
| 17 | 17 | pub use crate::def_id::DefPathHash; |
| 18 | use crate::def_id::{CrateNum, DefIndex, LocalDefId, StableCrateId, CRATE_DEF_INDEX, LOCAL_CRATE}; | |
| 18 | use crate::def_id::{CRATE_DEF_INDEX, CrateNum, DefIndex, LOCAL_CRATE, LocalDefId, StableCrateId}; | |
| 19 | 19 | use crate::def_path_hash_map::DefPathHashMap; |
| 20 | 20 | |
| 21 | 21 | /// The `DefPathTable` maps `DefIndex`es to `DefKey`s and vice versa. |
compiler/rustc_hir/src/diagnostic_items.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use rustc_data_structures::fx::FxIndexMap; |
| 2 | 2 | use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; |
| 3 | use rustc_span::def_id::DefIdMap; | |
| 4 | 3 | use rustc_span::Symbol; |
| 4 | use rustc_span::def_id::DefIdMap; | |
| 5 | 5 | |
| 6 | 6 | use crate::def_id::DefId; |
| 7 | 7 |
compiler/rustc_hir/src/hir.rs+12-11| ... | ... | @@ -17,18 +17,18 @@ use rustc_macros::{Decodable, Encodable, HashStable_Generic}; |
| 17 | 17 | use rustc_span::def_id::LocalDefId; |
| 18 | 18 | use rustc_span::hygiene::MacroKind; |
| 19 | 19 | use rustc_span::source_map::Spanned; |
| 20 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 21 | use rustc_span::{BytePos, ErrorGuaranteed, Span, DUMMY_SP}; | |
| 20 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 21 | use rustc_span::{BytePos, DUMMY_SP, ErrorGuaranteed, Span}; | |
| 22 | 22 | use rustc_target::asm::InlineAsmRegOrRegClass; |
| 23 | 23 | use rustc_target::spec::abi::Abi; |
| 24 | 24 | use smallvec::SmallVec; |
| 25 | 25 | use tracing::debug; |
| 26 | 26 | |
| 27 | use crate::LangItem; | |
| 27 | 28 | use crate::def::{CtorKind, DefKind, Res}; |
| 28 | 29 | use crate::def_id::{DefId, LocalDefIdMap}; |
| 29 | 30 | pub(crate) use crate::hir_id::{HirId, ItemLocalId, ItemLocalMap, OwnerId}; |
| 30 | 31 | use crate::intravisit::FnKind; |
| 31 | use crate::LangItem; | |
| 32 | 32 | |
| 33 | 33 | #[derive(Debug, Copy, Clone, HashStable_Generic)] |
| 34 | 34 | pub struct Lifetime { |
| ... | ... | @@ -2589,10 +2589,10 @@ impl<'hir> Ty<'hir> { |
| 2589 | 2589 | fn visit_ty(&mut self, t: &'v Ty<'v>) { |
| 2590 | 2590 | if matches!( |
| 2591 | 2591 | &t.kind, |
| 2592 | TyKind::Path(QPath::Resolved( | |
| 2593 | _, | |
| 2594 | Path { res: crate::def::Res::SelfTyAlias { .. }, .. }, | |
| 2595 | )) | |
| 2592 | TyKind::Path(QPath::Resolved(_, Path { | |
| 2593 | res: crate::def::Res::SelfTyAlias { .. }, | |
| 2594 | .. | |
| 2595 | },)) | |
| 2596 | 2596 | ) { |
| 2597 | 2597 | self.0.push(t.span); |
| 2598 | 2598 | return; |
| ... | ... | @@ -2920,10 +2920,11 @@ impl<'hir> InlineAsmOperand<'hir> { |
| 2920 | 2920 | } |
| 2921 | 2921 | |
| 2922 | 2922 | pub fn is_clobber(&self) -> bool { |
| 2923 | matches!( | |
| 2924 | self, | |
| 2925 | InlineAsmOperand::Out { reg: InlineAsmRegOrRegClass::Reg(_), late: _, expr: None } | |
| 2926 | ) | |
| 2923 | matches!(self, InlineAsmOperand::Out { | |
| 2924 | reg: InlineAsmRegOrRegClass::Reg(_), | |
| 2925 | late: _, | |
| 2926 | expr: None | |
| 2927 | }) | |
| 2927 | 2928 | } |
| 2928 | 2929 | } |
| 2929 | 2930 |
compiler/rustc_hir/src/hir_id.rs+2-2| ... | ... | @@ -2,10 +2,10 @@ use std::fmt::{self, Debug}; |
| 2 | 2 | |
| 3 | 3 | use rustc_data_structures::stable_hasher::{HashStable, StableHasher, StableOrd, ToStableHashKey}; |
| 4 | 4 | use rustc_macros::{Decodable, Encodable, HashStable_Generic}; |
| 5 | use rustc_span::def_id::DefPathHash; | |
| 6 | 5 | use rustc_span::HashStableContext; |
| 6 | use rustc_span::def_id::DefPathHash; | |
| 7 | 7 | |
| 8 | use crate::def_id::{DefId, DefIndex, LocalDefId, CRATE_DEF_ID}; | |
| 8 | use crate::def_id::{CRATE_DEF_ID, DefId, DefIndex, LocalDefId}; | |
| 9 | 9 | |
| 10 | 10 | #[derive(Copy, Clone, PartialEq, Eq, Hash, Encodable, Decodable)] |
| 11 | 11 | pub struct OwnerId { |
compiler/rustc_hir/src/intravisit.rs+2-2| ... | ... | @@ -64,11 +64,11 @@ |
| 64 | 64 | //! This order consistency is required in a few places in rustc, for |
| 65 | 65 | //! example coroutine inference, and possibly also HIR borrowck. |
| 66 | 66 | |
| 67 | use rustc_ast::visit::{try_visit, visit_opt, walk_list, VisitorResult}; | |
| 67 | use rustc_ast::visit::{VisitorResult, try_visit, visit_opt, walk_list}; | |
| 68 | 68 | use rustc_ast::{Attribute, Label}; |
| 69 | use rustc_span::Span; | |
| 69 | 70 | use rustc_span::def_id::LocalDefId; |
| 70 | 71 | use rustc_span::symbol::{Ident, Symbol}; |
| 71 | use rustc_span::Span; | |
| 72 | 72 | |
| 73 | 73 | use crate::hir::*; |
| 74 | 74 |
compiler/rustc_hir/src/lang_items.rs+1-1| ... | ... | @@ -11,8 +11,8 @@ use rustc_ast as ast; |
| 11 | 11 | use rustc_data_structures::fx::FxIndexMap; |
| 12 | 12 | use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; |
| 13 | 13 | use rustc_macros::{Decodable, Encodable, HashStable_Generic}; |
| 14 | use rustc_span::symbol::{kw, sym, Symbol}; | |
| 15 | 14 | use rustc_span::Span; |
| 15 | use rustc_span::symbol::{Symbol, kw, sym}; | |
| 16 | 16 | |
| 17 | 17 | use crate::def_id::DefId; |
| 18 | 18 | use crate::{MethodKind, Target}; |
compiler/rustc_hir/src/pat_util.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use std::iter::Enumerate; |
| 2 | 2 | |
| 3 | use rustc_span::symbol::Ident; | |
| 4 | 3 | use rustc_span::Span; |
| 4 | use rustc_span::symbol::Ident; | |
| 5 | 5 | |
| 6 | 6 | use crate::def::{CtorOf, DefKind, Res}; |
| 7 | 7 | use crate::def_id::{DefId, DefIdSet}; |
compiler/rustc_hir/src/target.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | use std::fmt::{self, Display}; |
| 8 | 8 | |
| 9 | 9 | use crate::def::DefKind; |
| 10 | use crate::{hir, Item, ItemKind, TraitItem, TraitItemKind}; | |
| 10 | use crate::{Item, ItemKind, TraitItem, TraitItemKind, hir}; | |
| 11 | 11 | |
| 12 | 12 | #[derive(Copy, Clone, PartialEq, Debug)] |
| 13 | 13 | pub enum GenericParamKind { |
compiler/rustc_hir/src/tests.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use rustc_data_structures::stable_hasher::Hash64; |
| 2 | 2 | use rustc_span::def_id::{DefPathHash, StableCrateId}; |
| 3 | 3 | use rustc_span::edition::Edition; |
| 4 | use rustc_span::{create_session_globals_then, Symbol}; | |
| 4 | use rustc_span::{Symbol, create_session_globals_then}; | |
| 5 | 5 | |
| 6 | 6 | use crate::definitions::{DefKey, DefPathData, DisambiguatedDefPathData}; |
| 7 | 7 |
compiler/rustc_hir/src/weak_lang_items.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | //! Validity checking for weak lang items |
| 2 | 2 | |
| 3 | use rustc_span::symbol::{sym, Symbol}; | |
| 3 | use rustc_span::symbol::{Symbol, sym}; | |
| 4 | 4 | |
| 5 | 5 | use crate::LangItem; |
| 6 | 6 |
compiler/rustc_hir_analysis/src/autoderef.rs+1-1| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use rustc_infer::infer::InferCtxt; |
| 2 | 2 | use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt}; |
| 3 | 3 | use rustc_session::Limit; |
| 4 | use rustc_span::def_id::{LocalDefId, LOCAL_CRATE}; | |
| 5 | 4 | use rustc_span::Span; |
| 5 | use rustc_span::def_id::{LOCAL_CRATE, LocalDefId}; | |
| 6 | 6 | use rustc_trait_selection::traits::ObligationCtxt; |
| 7 | 7 | use tracing::{debug, instrument}; |
| 8 | 8 |
compiler/rustc_hir_analysis/src/bounds.rs+12-15| ... | ... | @@ -2,12 +2,12 @@ |
| 2 | 2 | //! [`rustc_middle::ty`] form. |
| 3 | 3 | |
| 4 | 4 | use rustc_data_structures::fx::FxIndexMap; |
| 5 | use rustc_hir::def::DefKind; | |
| 6 | 5 | use rustc_hir::LangItem; |
| 6 | use rustc_hir::def::DefKind; | |
| 7 | 7 | use rustc_middle::ty::fold::FnMutDelegate; |
| 8 | 8 | use rustc_middle::ty::{self, Ty, TyCtxt, Upcast}; |
| 9 | use rustc_span::def_id::DefId; | |
| 10 | 9 | use rustc_span::Span; |
| 10 | use rustc_span::def_id::DefId; | |
| 11 | 11 | |
| 12 | 12 | use crate::hir_ty_lowering::OnlySelfBounds; |
| 13 | 13 | |
| ... | ... | @@ -112,14 +112,11 @@ impl<'tcx> Bounds<'tcx> { |
| 112 | 112 | // This should work for any bound variables as long as they don't have any |
| 113 | 113 | // bounds e.g. `for<T: Trait>`. |
| 114 | 114 | // FIXME(effects) reconsider this approach to allow compatibility with `for<T: Tr>` |
| 115 | let ty = tcx.replace_bound_vars_uncached( | |
| 116 | ty, | |
| 117 | FnMutDelegate { | |
| 118 | regions: &mut |_| tcx.lifetimes.re_static, | |
| 119 | types: &mut |_| tcx.types.unit, | |
| 120 | consts: &mut |_| unimplemented!("`~const` does not support const binders"), | |
| 121 | }, | |
| 122 | ); | |
| 115 | let ty = tcx.replace_bound_vars_uncached(ty, FnMutDelegate { | |
| 116 | regions: &mut |_| tcx.lifetimes.re_static, | |
| 117 | types: &mut |_| tcx.types.unit, | |
| 118 | consts: &mut |_| unimplemented!("`~const` does not support const binders"), | |
| 119 | }); | |
| 123 | 120 | |
| 124 | 121 | self.effects_min_tys.insert(ty, span); |
| 125 | 122 | return; |
| ... | ... | @@ -152,11 +149,11 @@ impl<'tcx> Bounds<'tcx> { |
| 152 | 149 | }; |
| 153 | 150 | let self_ty = Ty::new_projection(tcx, assoc, bound_trait_ref.skip_binder().args); |
| 154 | 151 | // make `<T as Tr>::Effects: Compat<runtime>` |
| 155 | let new_trait_ref = ty::TraitRef::new( | |
| 156 | tcx, | |
| 157 | tcx.require_lang_item(LangItem::EffectsCompat, Some(span)), | |
| 158 | [ty::GenericArg::from(self_ty), compat_val.into()], | |
| 159 | ); | |
| 152 | let new_trait_ref = | |
| 153 | ty::TraitRef::new(tcx, tcx.require_lang_item(LangItem::EffectsCompat, Some(span)), [ | |
| 154 | ty::GenericArg::from(self_ty), | |
| 155 | compat_val.into(), | |
| 156 | ]); | |
| 160 | 157 | self.clauses.push((bound_trait_ref.rebind(new_trait_ref).upcast(tcx), span)); |
| 161 | 158 | } |
| 162 | 159 |
compiler/rustc_hir_analysis/src/check/check.rs+3-3| ... | ... | @@ -2,10 +2,10 @@ use std::cell::LazyCell; |
| 2 | 2 | use std::ops::ControlFlow; |
| 3 | 3 | |
| 4 | 4 | use rustc_data_structures::unord::{UnordMap, UnordSet}; |
| 5 | use rustc_errors::codes::*; | |
| 6 | 5 | use rustc_errors::MultiSpan; |
| 7 | use rustc_hir::def::{CtorKind, DefKind}; | |
| 6 | use rustc_errors::codes::*; | |
| 8 | 7 | use rustc_hir::Node; |
| 8 | use rustc_hir::def::{CtorKind, DefKind}; | |
| 9 | 9 | use rustc_infer::infer::{RegionVariableOrigin, TyCtxtInferExt}; |
| 10 | 10 | use rustc_infer::traits::Obligation; |
| 11 | 11 | use rustc_lint_defs::builtin::REPR_TRANSPARENT_EXTERNAL_PRIVATE_FIELDS; |
| ... | ... | @@ -22,8 +22,8 @@ use rustc_middle::ty::{ |
| 22 | 22 | }; |
| 23 | 23 | use rustc_session::lint::builtin::{UNINHABITED_STATIC, UNSUPPORTED_CALLING_CONVENTIONS}; |
| 24 | 24 | use rustc_target::abi::FieldIdx; |
| 25 | use rustc_trait_selection::error_reporting::traits::on_unimplemented::OnUnimplementedDirective; | |
| 26 | 25 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; |
| 26 | use rustc_trait_selection::error_reporting::traits::on_unimplemented::OnUnimplementedDirective; | |
| 27 | 27 | use rustc_trait_selection::traits; |
| 28 | 28 | use rustc_trait_selection::traits::outlives_bounds::InferCtxtExt as _; |
| 29 | 29 | use rustc_type_ir::fold::TypeFoldable; |
compiler/rustc_hir_analysis/src/check/compare_impl_item.rs+32-55| ... | ... | @@ -5,10 +5,10 @@ use std::iter; |
| 5 | 5 | use hir::def_id::{DefId, DefIdMap, LocalDefId}; |
| 6 | 6 | use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet}; |
| 7 | 7 | use rustc_errors::codes::*; |
| 8 | use rustc_errors::{pluralize, struct_span_code_err, Applicability, ErrorGuaranteed}; | |
| 8 | use rustc_errors::{Applicability, ErrorGuaranteed, pluralize, struct_span_code_err}; | |
| 9 | 9 | use rustc_hir as hir; |
| 10 | 10 | use rustc_hir::def::{DefKind, Res}; |
| 11 | use rustc_hir::{intravisit, GenericParamKind, ImplItemKind}; | |
| 11 | use rustc_hir::{GenericParamKind, ImplItemKind, intravisit}; | |
| 12 | 12 | use rustc_infer::infer::outlives::env::OutlivesEnvironment; |
| 13 | 13 | use rustc_infer::infer::{self, InferCtxt, TyCtxtInferExt}; |
| 14 | 14 | use rustc_infer::traits::util; |
| ... | ... | @@ -176,15 +176,12 @@ fn compare_method_predicate_entailment<'tcx>( |
| 176 | 176 | // obligations. |
| 177 | 177 | let impl_m_def_id = impl_m.def_id.expect_local(); |
| 178 | 178 | let impl_m_span = tcx.def_span(impl_m_def_id); |
| 179 | let cause = ObligationCause::new( | |
| 180 | impl_m_span, | |
| 181 | impl_m_def_id, | |
| 182 | ObligationCauseCode::CompareImplItem { | |
| 179 | let cause = | |
| 180 | ObligationCause::new(impl_m_span, impl_m_def_id, ObligationCauseCode::CompareImplItem { | |
| 183 | 181 | impl_item_def_id: impl_m_def_id, |
| 184 | 182 | trait_item_def_id: trait_m.def_id, |
| 185 | 183 | kind: impl_m.kind, |
| 186 | }, | |
| 187 | ); | |
| 184 | }); | |
| 188 | 185 | |
| 189 | 186 | // Create mapping from impl to placeholder. |
| 190 | 187 | let impl_to_placeholder_args = GenericArgs::identity_for_item(tcx, impl_m.def_id); |
| ... | ... | @@ -237,15 +234,12 @@ fn compare_method_predicate_entailment<'tcx>( |
| 237 | 234 | let normalize_cause = traits::ObligationCause::misc(span, impl_m_def_id); |
| 238 | 235 | let predicate = ocx.normalize(&normalize_cause, param_env, predicate); |
| 239 | 236 | |
| 240 | let cause = ObligationCause::new( | |
| 241 | span, | |
| 242 | impl_m_def_id, | |
| 243 | ObligationCauseCode::CompareImplItem { | |
| 237 | let cause = | |
| 238 | ObligationCause::new(span, impl_m_def_id, ObligationCauseCode::CompareImplItem { | |
| 244 | 239 | impl_item_def_id: impl_m_def_id, |
| 245 | 240 | trait_item_def_id: trait_m.def_id, |
| 246 | 241 | kind: impl_m.kind, |
| 247 | }, | |
| 248 | ); | |
| 242 | }); | |
| 249 | 243 | ocx.register_obligation(traits::Obligation::new(tcx, cause, param_env, predicate)); |
| 250 | 244 | } |
| 251 | 245 | |
| ... | ... | @@ -465,15 +459,12 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>( |
| 465 | 459 | |
| 466 | 460 | let impl_m_hir_id = tcx.local_def_id_to_hir_id(impl_m_def_id); |
| 467 | 461 | let return_span = tcx.hir().fn_decl_by_hir_id(impl_m_hir_id).unwrap().output.span(); |
| 468 | let cause = ObligationCause::new( | |
| 469 | return_span, | |
| 470 | impl_m_def_id, | |
| 471 | ObligationCauseCode::CompareImplItem { | |
| 462 | let cause = | |
| 463 | ObligationCause::new(return_span, impl_m_def_id, ObligationCauseCode::CompareImplItem { | |
| 472 | 464 | impl_item_def_id: impl_m_def_id, |
| 473 | 465 | trait_item_def_id: trait_m.def_id, |
| 474 | 466 | kind: impl_m.kind, |
| 475 | }, | |
| 476 | ); | |
| 467 | }); | |
| 477 | 468 | |
| 478 | 469 | // Create mapping from impl to placeholder. |
| 479 | 470 | let impl_to_placeholder_args = GenericArgs::identity_for_item(tcx, impl_m.def_id); |
| ... | ... | @@ -561,16 +552,13 @@ pub(super) fn collect_return_position_impl_trait_in_trait_tys<'tcx>( |
| 561 | 552 | idx += 1; |
| 562 | 553 | ( |
| 563 | 554 | ty, |
| 564 | Ty::new_placeholder( | |
| 565 | tcx, | |
| 566 | ty::Placeholder { | |
| 567 | universe, | |
| 568 | bound: ty::BoundTy { | |
| 569 | var: ty::BoundVar::from_usize(idx), | |
| 570 | kind: ty::BoundTyKind::Anon, | |
| 571 | }, | |
| 555 | Ty::new_placeholder(tcx, ty::Placeholder { | |
| 556 | universe, | |
| 557 | bound: ty::BoundTy { | |
| 558 | var: ty::BoundVar::from_usize(idx), | |
| 559 | kind: ty::BoundTyKind::Anon, | |
| 572 | 560 | }, |
| 573 | ), | |
| 561 | }), | |
| 574 | 562 | ) |
| 575 | 563 | }) |
| 576 | 564 | .collect(); |
| ... | ... | @@ -936,13 +924,10 @@ impl<'tcx> ty::FallibleTypeFolder<TyCtxt<'tcx>> for RemapHiddenTyRegions<'tcx> { |
| 936 | 924 | return Err(guar); |
| 937 | 925 | }; |
| 938 | 926 | |
| 939 | Ok(ty::Region::new_early_param( | |
| 940 | self.tcx, | |
| 941 | ty::EarlyParamRegion { | |
| 942 | name: e.name, | |
| 943 | index: (e.index as usize - self.num_trait_args + self.num_impl_args) as u32, | |
| 944 | }, | |
| 945 | )) | |
| 927 | Ok(ty::Region::new_early_param(self.tcx, ty::EarlyParamRegion { | |
| 928 | name: e.name, | |
| 929 | index: (e.index as usize - self.num_trait_args + self.num_impl_args) as u32, | |
| 930 | })) | |
| 946 | 931 | } |
| 947 | 932 | } |
| 948 | 933 | |
| ... | ... | @@ -1932,15 +1917,12 @@ fn compare_type_predicate_entailment<'tcx>( |
| 1932 | 1917 | let cause = ObligationCause::misc(span, impl_ty_def_id); |
| 1933 | 1918 | let predicate = ocx.normalize(&cause, param_env, predicate); |
| 1934 | 1919 | |
| 1935 | let cause = ObligationCause::new( | |
| 1936 | span, | |
| 1937 | impl_ty_def_id, | |
| 1938 | ObligationCauseCode::CompareImplItem { | |
| 1920 | let cause = | |
| 1921 | ObligationCause::new(span, impl_ty_def_id, ObligationCauseCode::CompareImplItem { | |
| 1939 | 1922 | impl_item_def_id: impl_ty.def_id.expect_local(), |
| 1940 | 1923 | trait_item_def_id: trait_ty.def_id, |
| 1941 | 1924 | kind: impl_ty.kind, |
| 1942 | }, | |
| 1943 | ); | |
| 1925 | }); | |
| 1944 | 1926 | ocx.register_obligation(traits::Obligation::new(tcx, cause, param_env, predicate)); |
| 1945 | 1927 | } |
| 1946 | 1928 | |
| ... | ... | @@ -2178,25 +2160,20 @@ fn param_env_with_gat_bounds<'tcx>( |
| 2178 | 2160 | let kind = ty::BoundTyKind::Param(param.def_id, param.name); |
| 2179 | 2161 | let bound_var = ty::BoundVariableKind::Ty(kind); |
| 2180 | 2162 | bound_vars.push(bound_var); |
| 2181 | Ty::new_bound( | |
| 2182 | tcx, | |
| 2183 | ty::INNERMOST, | |
| 2184 | ty::BoundTy { var: ty::BoundVar::from_usize(bound_vars.len() - 1), kind }, | |
| 2185 | ) | |
| 2163 | Ty::new_bound(tcx, ty::INNERMOST, ty::BoundTy { | |
| 2164 | var: ty::BoundVar::from_usize(bound_vars.len() - 1), | |
| 2165 | kind, | |
| 2166 | }) | |
| 2186 | 2167 | .into() |
| 2187 | 2168 | } |
| 2188 | 2169 | GenericParamDefKind::Lifetime => { |
| 2189 | 2170 | let kind = ty::BoundRegionKind::BrNamed(param.def_id, param.name); |
| 2190 | 2171 | let bound_var = ty::BoundVariableKind::Region(kind); |
| 2191 | 2172 | bound_vars.push(bound_var); |
| 2192 | ty::Region::new_bound( | |
| 2193 | tcx, | |
| 2194 | ty::INNERMOST, | |
| 2195 | ty::BoundRegion { | |
| 2196 | var: ty::BoundVar::from_usize(bound_vars.len() - 1), | |
| 2197 | kind, | |
| 2198 | }, | |
| 2199 | ) | |
| 2173 | ty::Region::new_bound(tcx, ty::INNERMOST, ty::BoundRegion { | |
| 2174 | var: ty::BoundVar::from_usize(bound_vars.len() - 1), | |
| 2175 | kind, | |
| 2176 | }) | |
| 2200 | 2177 | .into() |
| 2201 | 2178 | } |
| 2202 | 2179 | GenericParamDefKind::Const { .. } => { |
compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs+2-2| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use rustc_data_structures::fx::FxIndexSet; |
| 2 | 2 | use rustc_hir as hir; |
| 3 | 3 | use rustc_hir::def_id::DefId; |
| 4 | use rustc_infer::infer::outlives::env::OutlivesEnvironment; | |
| 5 | 4 | use rustc_infer::infer::TyCtxtInferExt; |
| 5 | use rustc_infer::infer::outlives::env::OutlivesEnvironment; | |
| 6 | 6 | use rustc_lint_defs::builtin::{REFINING_IMPL_TRAIT_INTERNAL, REFINING_IMPL_TRAIT_REACHABLE}; |
| 7 | 7 | use rustc_middle::span_bug; |
| 8 | 8 | use rustc_middle::traits::{ObligationCause, Reveal}; |
| ... | ... | @@ -13,7 +13,7 @@ use rustc_middle::ty::{ |
| 13 | 13 | use rustc_span::Span; |
| 14 | 14 | use rustc_trait_selection::regions::InferCtxtRegionExt; |
| 15 | 15 | use rustc_trait_selection::traits::outlives_bounds::InferCtxtExt; |
| 16 | use rustc_trait_selection::traits::{elaborate, normalize_param_env_or_error, ObligationCtxt}; | |
| 16 | use rustc_trait_selection::traits::{ObligationCtxt, elaborate, normalize_param_env_or_error}; | |
| 17 | 17 | |
| 18 | 18 | /// Check that an implementation does not refine an RPITIT from a trait method signature. |
| 19 | 19 | pub(super) fn check_refining_return_position_impl_trait_in_trait<'tcx>( |
compiler/rustc_hir_analysis/src/check/dropck.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | |
| 5 | 5 | use rustc_data_structures::fx::FxHashSet; |
| 6 | 6 | use rustc_errors::codes::*; |
| 7 | use rustc_errors::{struct_span_code_err, ErrorGuaranteed}; | |
| 7 | use rustc_errors::{ErrorGuaranteed, struct_span_code_err}; | |
| 8 | 8 | use rustc_infer::infer::outlives::env::OutlivesEnvironment; |
| 9 | 9 | use rustc_infer::infer::{RegionResolutionError, TyCtxtInferExt}; |
| 10 | 10 | use rustc_infer::traits::{ObligationCause, ObligationCauseCode}; |
compiler/rustc_hir_analysis/src/check/entry.rs+2-2| ... | ... | @@ -6,9 +6,9 @@ use rustc_infer::infer::TyCtxtInferExt; |
| 6 | 6 | use rustc_middle::span_bug; |
| 7 | 7 | use rustc_middle::ty::{self, Ty, TyCtxt}; |
| 8 | 8 | use rustc_session::config::EntryFnType; |
| 9 | use rustc_span::def_id::{DefId, LocalDefId, CRATE_DEF_ID}; | |
| 10 | use rustc_span::symbol::sym; | |
| 11 | 9 | use rustc_span::Span; |
| 10 | use rustc_span::def_id::{CRATE_DEF_ID, DefId, LocalDefId}; | |
| 11 | use rustc_span::symbol::sym; | |
| 12 | 12 | use rustc_target::spec::abi::Abi; |
| 13 | 13 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; |
| 14 | 14 | use rustc_trait_selection::traits::{self, ObligationCause, ObligationCauseCode}; |
compiler/rustc_hir_analysis/src/check/errs.rs+4-5| ... | ... | @@ -79,11 +79,10 @@ fn handle_static_mut_ref( |
| 79 | 79 | } else { |
| 80 | 80 | (errors::MutRefSugg::Shared { lo, hi }, "shared") |
| 81 | 81 | }; |
| 82 | tcx.emit_node_span_lint( | |
| 83 | STATIC_MUT_REFS, | |
| 84 | hir_id, | |
| 82 | tcx.emit_node_span_lint(STATIC_MUT_REFS, hir_id, span, errors::RefOfMutStatic { | |
| 85 | 83 | span, |
| 86 | errors::RefOfMutStatic { span, sugg, shared }, | |
| 87 | ); | |
| 84 | sugg, | |
| 85 | shared, | |
| 86 | }); | |
| 88 | 87 | } |
| 89 | 88 | } |
compiler/rustc_hir_analysis/src/check/intrinsic.rs+9-11| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | //! intrinsics that the compiler exposes. |
| 3 | 3 | |
| 4 | 4 | use rustc_errors::codes::*; |
| 5 | use rustc_errors::{struct_span_code_err, DiagMessage}; | |
| 5 | use rustc_errors::{DiagMessage, struct_span_code_err}; | |
| 6 | 6 | use rustc_hir as hir; |
| 7 | 7 | use rustc_middle::bug; |
| 8 | 8 | use rustc_middle::traits::{ObligationCause, ObligationCauseCode}; |
| ... | ... | @@ -190,16 +190,14 @@ pub fn check_intrinsic_type( |
| 190 | 190 | ]); |
| 191 | 191 | let mk_va_list_ty = |mutbl| { |
| 192 | 192 | tcx.lang_items().va_list().map(|did| { |
| 193 | let region = ty::Region::new_bound( | |
| 194 | tcx, | |
| 195 | ty::INNERMOST, | |
| 196 | ty::BoundRegion { var: ty::BoundVar::ZERO, kind: ty::BrAnon }, | |
| 197 | ); | |
| 198 | let env_region = ty::Region::new_bound( | |
| 199 | tcx, | |
| 200 | ty::INNERMOST, | |
| 201 | ty::BoundRegion { var: ty::BoundVar::from_u32(2), kind: ty::BrEnv }, | |
| 202 | ); | |
| 193 | let region = ty::Region::new_bound(tcx, ty::INNERMOST, ty::BoundRegion { | |
| 194 | var: ty::BoundVar::ZERO, | |
| 195 | kind: ty::BrAnon, | |
| 196 | }); | |
| 197 | let env_region = ty::Region::new_bound(tcx, ty::INNERMOST, ty::BoundRegion { | |
| 198 | var: ty::BoundVar::from_u32(2), | |
| 199 | kind: ty::BrEnv, | |
| 200 | }); | |
| 203 | 201 | let va_list_ty = tcx.type_of(did).instantiate(tcx, &[region.into()]); |
| 204 | 202 | (Ty::new_ref(tcx, env_region, va_list_ty, mutbl), va_list_ty) |
| 205 | 203 | }) |
compiler/rustc_hir_analysis/src/check/intrinsicck.rs+1-1| ... | ... | @@ -6,8 +6,8 @@ use rustc_hir::{self as hir, LangItem}; |
| 6 | 6 | use rustc_middle::bug; |
| 7 | 7 | use rustc_middle::ty::{self, FloatTy, IntTy, Ty, TyCtxt, TypeVisitableExt, UintTy}; |
| 8 | 8 | use rustc_session::lint; |
| 9 | use rustc_span::def_id::LocalDefId; | |
| 10 | 9 | use rustc_span::Symbol; |
| 10 | use rustc_span::def_id::LocalDefId; | |
| 11 | 11 | use rustc_target::abi::FieldIdx; |
| 12 | 12 | use rustc_target::asm::{ |
| 13 | 13 | InlineAsmReg, InlineAsmRegClass, InlineAsmRegOrRegClass, InlineAsmType, ModifierInfo, |
compiler/rustc_hir_analysis/src/check/mod.rs+4-4| ... | ... | @@ -75,7 +75,7 @@ use std::num::NonZero; |
| 75 | 75 | |
| 76 | 76 | pub use check::check_abi; |
| 77 | 77 | use rustc_data_structures::fx::{FxHashSet, FxIndexMap}; |
| 78 | use rustc_errors::{pluralize, struct_span_code_err, Diag, ErrorGuaranteed}; | |
| 78 | use rustc_errors::{Diag, ErrorGuaranteed, pluralize, struct_span_code_err}; | |
| 79 | 79 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| 80 | 80 | use rustc_hir::intravisit::Visitor; |
| 81 | 81 | use rustc_index::bit_set::BitSet; |
| ... | ... | @@ -88,13 +88,13 @@ use rustc_middle::ty::{self, GenericArgs, GenericArgsRef, Ty, TyCtxt}; |
| 88 | 88 | use rustc_middle::{bug, span_bug}; |
| 89 | 89 | use rustc_session::parse::feature_err; |
| 90 | 90 | use rustc_span::def_id::CRATE_DEF_ID; |
| 91 | use rustc_span::symbol::{kw, sym, Ident}; | |
| 92 | use rustc_span::{BytePos, Span, Symbol, DUMMY_SP}; | |
| 91 | use rustc_span::symbol::{Ident, kw, sym}; | |
| 92 | use rustc_span::{BytePos, DUMMY_SP, Span, Symbol}; | |
| 93 | 93 | use rustc_target::abi::VariantIdx; |
| 94 | 94 | use rustc_target::spec::abi::Abi; |
| 95 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; | |
| 95 | 96 | use rustc_trait_selection::error_reporting::infer::ObligationCauseExt as _; |
| 96 | 97 | use rustc_trait_selection::error_reporting::traits::suggestions::ReturnsVisitor; |
| 97 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; | |
| 98 | 98 | use rustc_trait_selection::traits::ObligationCtxt; |
| 99 | 99 | use tracing::debug; |
| 100 | 100 |
compiler/rustc_hir_analysis/src/check/wfcheck.rs+19-19| ... | ... | @@ -4,11 +4,11 @@ use std::ops::{ControlFlow, Deref}; |
| 4 | 4 | use hir::intravisit::{self, Visitor}; |
| 5 | 5 | use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexSet}; |
| 6 | 6 | use rustc_errors::codes::*; |
| 7 | use rustc_errors::{pluralize, struct_span_code_err, Applicability, ErrorGuaranteed}; | |
| 7 | use rustc_errors::{Applicability, ErrorGuaranteed, pluralize, struct_span_code_err}; | |
| 8 | use rustc_hir::ItemKind; | |
| 8 | 9 | use rustc_hir::def::{DefKind, Res}; |
| 9 | 10 | use rustc_hir::def_id::{DefId, LocalDefId, LocalModDefId}; |
| 10 | 11 | use rustc_hir::lang_items::LangItem; |
| 11 | use rustc_hir::ItemKind; | |
| 12 | 12 | use rustc_infer::infer::outlives::env::OutlivesEnvironment; |
| 13 | 13 | use rustc_infer::infer::{self, InferCtxt, TyCtxtInferExt}; |
| 14 | 14 | use rustc_macros::LintDiagnostic; |
| ... | ... | @@ -21,27 +21,27 @@ use rustc_middle::ty::{ |
| 21 | 21 | }; |
| 22 | 22 | use rustc_middle::{bug, span_bug}; |
| 23 | 23 | use rustc_session::parse::feature_err; |
| 24 | use rustc_span::symbol::{sym, Ident}; | |
| 25 | use rustc_span::{Span, DUMMY_SP}; | |
| 24 | use rustc_span::symbol::{Ident, sym}; | |
| 25 | use rustc_span::{DUMMY_SP, Span}; | |
| 26 | 26 | use rustc_target::spec::abi::Abi; |
| 27 | 27 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; |
| 28 | 28 | use rustc_trait_selection::regions::InferCtxtRegionExt; |
| 29 | 29 | use rustc_trait_selection::traits::misc::{ |
| 30 | type_allowed_to_implement_const_param_ty, ConstParamTyImplementationError, | |
| 30 | ConstParamTyImplementationError, type_allowed_to_implement_const_param_ty, | |
| 31 | 31 | }; |
| 32 | 32 | use rustc_trait_selection::traits::outlives_bounds::InferCtxtExt as _; |
| 33 | 33 | use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt as _; |
| 34 | 34 | use rustc_trait_selection::traits::{ |
| 35 | 35 | self, FulfillmentError, ObligationCause, ObligationCauseCode, ObligationCtxt, WellFormedLoc, |
| 36 | 36 | }; |
| 37 | use rustc_type_ir::solve::NoSolution; | |
| 38 | 37 | use rustc_type_ir::TypeFlags; |
| 38 | use rustc_type_ir::solve::NoSolution; | |
| 39 | 39 | use tracing::{debug, instrument}; |
| 40 | 40 | use {rustc_ast as ast, rustc_hir as hir}; |
| 41 | 41 | |
| 42 | 42 | use crate::autoderef::Autoderef; |
| 43 | 43 | use crate::collect::CollectItemTypesVisitor; |
| 44 | use crate::constrained_generic_params::{identify_constrained_generic_params, Parameter}; | |
| 44 | use crate::constrained_generic_params::{Parameter, identify_constrained_generic_params}; | |
| 45 | 45 | use crate::{errors, fluent_generated as fluent}; |
| 46 | 46 | |
| 47 | 47 | pub(super) struct WfCheckingCtxt<'a, 'tcx> { |
| ... | ... | @@ -664,10 +664,10 @@ fn gather_gat_bounds<'tcx, T: TypeFoldable<TyCtxt<'tcx>>>( |
| 664 | 664 | // Same for the region. In our example, 'a corresponds |
| 665 | 665 | // to the 'me parameter. |
| 666 | 666 | let region_param = gat_generics.param_at(*region_a_idx, tcx); |
| 667 | let region_param = ty::Region::new_early_param( | |
| 668 | tcx, | |
| 669 | ty::EarlyParamRegion { index: region_param.index, name: region_param.name }, | |
| 670 | ); | |
| 667 | let region_param = ty::Region::new_early_param(tcx, ty::EarlyParamRegion { | |
| 668 | index: region_param.index, | |
| 669 | name: region_param.name, | |
| 670 | }); | |
| 671 | 671 | // The predicate we expect to see. (In our example, |
| 672 | 672 | // `Self: 'me`.) |
| 673 | 673 | bounds.insert( |
| ... | ... | @@ -693,16 +693,16 @@ fn gather_gat_bounds<'tcx, T: TypeFoldable<TyCtxt<'tcx>>>( |
| 693 | 693 | debug!("required clause: {region_a} must outlive {region_b}"); |
| 694 | 694 | // Translate into the generic parameters of the GAT. |
| 695 | 695 | let region_a_param = gat_generics.param_at(*region_a_idx, tcx); |
| 696 | let region_a_param = ty::Region::new_early_param( | |
| 697 | tcx, | |
| 698 | ty::EarlyParamRegion { index: region_a_param.index, name: region_a_param.name }, | |
| 699 | ); | |
| 696 | let region_a_param = ty::Region::new_early_param(tcx, ty::EarlyParamRegion { | |
| 697 | index: region_a_param.index, | |
| 698 | name: region_a_param.name, | |
| 699 | }); | |
| 700 | 700 | // Same for the region. |
| 701 | 701 | let region_b_param = gat_generics.param_at(*region_b_idx, tcx); |
| 702 | let region_b_param = ty::Region::new_early_param( | |
| 703 | tcx, | |
| 704 | ty::EarlyParamRegion { index: region_b_param.index, name: region_b_param.name }, | |
| 705 | ); | |
| 702 | let region_b_param = ty::Region::new_early_param(tcx, ty::EarlyParamRegion { | |
| 703 | index: region_b_param.index, | |
| 704 | name: region_b_param.name, | |
| 705 | }); | |
| 706 | 706 | // The predicate we expect to see. |
| 707 | 707 | bounds.insert( |
| 708 | 708 | ty::ClauseKind::RegionOutlives(ty::OutlivesPredicate( |
compiler/rustc_hir_analysis/src/coherence/builtin.rs+8-9| ... | ... | @@ -7,20 +7,20 @@ use std::collections::BTreeMap; |
| 7 | 7 | use rustc_data_structures::fx::FxHashSet; |
| 8 | 8 | use rustc_errors::{ErrorGuaranteed, MultiSpan}; |
| 9 | 9 | use rustc_hir as hir; |
| 10 | use rustc_hir::ItemKind; | |
| 10 | 11 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| 11 | 12 | use rustc_hir::lang_items::LangItem; |
| 12 | use rustc_hir::ItemKind; | |
| 13 | 13 | use rustc_infer::infer::outlives::env::OutlivesEnvironment; |
| 14 | 14 | use rustc_infer::infer::{self, RegionResolutionError, TyCtxtInferExt}; |
| 15 | 15 | use rustc_infer::traits::Obligation; |
| 16 | 16 | use rustc_middle::ty::adjustment::CoerceUnsizedInfo; |
| 17 | 17 | use rustc_middle::ty::print::PrintTraitRefExt as _; |
| 18 | use rustc_middle::ty::{self, suggest_constraining_type_params, Ty, TyCtxt, TypeVisitableExt}; | |
| 19 | use rustc_span::{Span, DUMMY_SP}; | |
| 18 | use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt, suggest_constraining_type_params}; | |
| 19 | use rustc_span::{DUMMY_SP, Span}; | |
| 20 | 20 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; |
| 21 | 21 | use rustc_trait_selection::traits::misc::{ |
| 22 | type_allowed_to_implement_const_param_ty, type_allowed_to_implement_copy, | |
| 23 | 22 | ConstParamTyImplementationError, CopyImplementationError, InfringingFieldsReason, |
| 23 | type_allowed_to_implement_const_param_ty, type_allowed_to_implement_copy, | |
| 24 | 24 | }; |
| 25 | 25 | use rustc_trait_selection::traits::{self, ObligationCause, ObligationCtxt}; |
| 26 | 26 | use tracing::debug; |
| ... | ... | @@ -309,11 +309,10 @@ fn visit_implementation_of_dispatch_from_dyn(checker: &Checker<'_>) -> Result<() |
| 309 | 309 | tcx, |
| 310 | 310 | cause.clone(), |
| 311 | 311 | param_env, |
| 312 | ty::TraitRef::new( | |
| 313 | tcx, | |
| 314 | dispatch_from_dyn_trait, | |
| 315 | [field.ty(tcx, args_a), field.ty(tcx, args_b)], | |
| 316 | ), | |
| 312 | ty::TraitRef::new(tcx, dispatch_from_dyn_trait, [ | |
| 313 | field.ty(tcx, args_a), | |
| 314 | field.ty(tcx, args_b), | |
| 315 | ]), | |
| 317 | 316 | )); |
| 318 | 317 | } |
| 319 | 318 | let errors = ocx.select_all_or_error(); |
compiler/rustc_hir_analysis/src/coherence/inherent_impls.rs+2-2| ... | ... | @@ -11,10 +11,10 @@ use rustc_hir as hir; |
| 11 | 11 | use rustc_hir::def::DefKind; |
| 12 | 12 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| 13 | 13 | use rustc_middle::bug; |
| 14 | use rustc_middle::ty::fast_reject::{simplify_type, SimplifiedType, TreatParams}; | |
| 14 | use rustc_middle::ty::fast_reject::{SimplifiedType, TreatParams, simplify_type}; | |
| 15 | 15 | use rustc_middle::ty::{self, CrateInherentImpls, Ty, TyCtxt}; |
| 16 | use rustc_span::symbol::sym; | |
| 17 | 16 | use rustc_span::ErrorGuaranteed; |
| 17 | use rustc_span::symbol::sym; | |
| 18 | 18 | |
| 19 | 19 | use crate::errors; |
| 20 | 20 |
compiler/rustc_hir_analysis/src/coherence/inherent_impls_overlap.rs+4-7| ... | ... | @@ -252,13 +252,10 @@ impl<'tcx> InherentOverlapChecker<'tcx> { |
| 252 | 252 | for ident in &idents_to_add { |
| 253 | 253 | connected_region_ids.insert(*ident, id_to_set); |
| 254 | 254 | } |
| 255 | connected_regions.insert( | |
| 256 | id_to_set, | |
| 257 | ConnectedRegion { | |
| 258 | idents: idents_to_add, | |
| 259 | impl_blocks: std::iter::once(i).collect(), | |
| 260 | }, | |
| 261 | ); | |
| 255 | connected_regions.insert(id_to_set, ConnectedRegion { | |
| 256 | idents: idents_to_add, | |
| 257 | impl_blocks: std::iter::once(i).collect(), | |
| 258 | }); | |
| 262 | 259 | } |
| 263 | 260 | // Take the only id inside the list |
| 264 | 261 | &[id_to_set] => { |
compiler/rustc_hir_analysis/src/coherence/mod.rs+2-2| ... | ... | @@ -7,12 +7,12 @@ |
| 7 | 7 | |
| 8 | 8 | use rustc_errors::codes::*; |
| 9 | 9 | use rustc_errors::struct_span_code_err; |
| 10 | use rustc_hir::def_id::{DefId, LocalDefId}; | |
| 11 | 10 | use rustc_hir::LangItem; |
| 11 | use rustc_hir::def_id::{DefId, LocalDefId}; | |
| 12 | 12 | use rustc_middle::query::Providers; |
| 13 | 13 | use rustc_middle::ty::{self, TyCtxt, TypeVisitableExt}; |
| 14 | 14 | use rustc_session::parse::feature_err; |
| 15 | use rustc_span::{sym, ErrorGuaranteed}; | |
| 15 | use rustc_span::{ErrorGuaranteed, sym}; | |
| 16 | 16 | use tracing::debug; |
| 17 | 17 | |
| 18 | 18 | use crate::errors; |
compiler/rustc_hir_analysis/src/coherence/unsafety.rs+2-2| ... | ... | @@ -4,11 +4,11 @@ |
| 4 | 4 | use rustc_errors::codes::*; |
| 5 | 5 | use rustc_errors::struct_span_code_err; |
| 6 | 6 | use rustc_hir::Safety; |
| 7 | use rustc_middle::ty::print::PrintTraitRefExt as _; | |
| 8 | 7 | use rustc_middle::ty::ImplPolarity::*; |
| 8 | use rustc_middle::ty::print::PrintTraitRefExt as _; | |
| 9 | 9 | use rustc_middle::ty::{ImplTraitHeader, TraitDef, TyCtxt}; |
| 10 | use rustc_span::def_id::LocalDefId; | |
| 11 | 10 | use rustc_span::ErrorGuaranteed; |
| 11 | use rustc_span::def_id::LocalDefId; | |
| 12 | 12 | |
| 13 | 13 | pub(super) fn check_item( |
| 14 | 14 | tcx: TyCtxt<'_>, |
compiler/rustc_hir_analysis/src/collect.rs+4-4| ... | ... | @@ -23,11 +23,11 @@ use rustc_data_structures::captures::Captures; |
| 23 | 23 | use rustc_data_structures::fx::{FxHashSet, FxIndexMap}; |
| 24 | 24 | use rustc_data_structures::unord::UnordMap; |
| 25 | 25 | use rustc_errors::{ |
| 26 | struct_span_code_err, Applicability, Diag, DiagCtxtHandle, ErrorGuaranteed, StashKey, E0228, | |
| 26 | Applicability, Diag, DiagCtxtHandle, E0228, ErrorGuaranteed, StashKey, struct_span_code_err, | |
| 27 | 27 | }; |
| 28 | 28 | use rustc_hir::def::DefKind; |
| 29 | 29 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| 30 | use rustc_hir::intravisit::{self, walk_generics, Visitor}; | |
| 30 | use rustc_hir::intravisit::{self, Visitor, walk_generics}; | |
| 31 | 31 | use rustc_hir::{self as hir, GenericParamKind, Node}; |
| 32 | 32 | use rustc_infer::infer::{InferCtxt, TyCtxtInferExt}; |
| 33 | 33 | use rustc_infer::traits::ObligationCause; |
| ... | ... | @@ -36,8 +36,8 @@ use rustc_middle::query::Providers; |
| 36 | 36 | use rustc_middle::ty::util::{Discr, IntTypeExt}; |
| 37 | 37 | use rustc_middle::ty::{self, AdtKind, Const, IsSuggestable, Ty, TyCtxt}; |
| 38 | 38 | use rustc_middle::{bug, span_bug}; |
| 39 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 40 | use rustc_span::{Span, DUMMY_SP}; | |
| 39 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 40 | use rustc_span::{DUMMY_SP, Span}; | |
| 41 | 41 | use rustc_target::spec::abi; |
| 42 | 42 | use rustc_trait_selection::error_reporting::traits::suggestions::NextTypeParamName; |
| 43 | 43 | use rustc_trait_selection::infer::InferCtxtExt; |
compiler/rustc_hir_analysis/src/collect/dump.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use rustc_hir::def::DefKind; |
| 2 | use rustc_hir::def_id::{LocalDefId, CRATE_DEF_ID}; | |
| 2 | use rustc_hir::def_id::{CRATE_DEF_ID, LocalDefId}; | |
| 3 | 3 | use rustc_hir::intravisit; |
| 4 | 4 | use rustc_middle::hir::nested_filter::OnlyBodies; |
| 5 | 5 | use rustc_middle::ty::TyCtxt; |
compiler/rustc_hir_analysis/src/collect/generics_of.rs+1-1| ... | ... | @@ -8,8 +8,8 @@ use rustc_hir::def::DefKind; |
| 8 | 8 | use rustc_hir::def_id::LocalDefId; |
| 9 | 9 | use rustc_middle::ty::{self, TyCtxt}; |
| 10 | 10 | use rustc_session::lint; |
| 11 | use rustc_span::symbol::{kw, Symbol}; | |
| 12 | 11 | use rustc_span::Span; |
| 12 | use rustc_span::symbol::{Symbol, kw}; | |
| 13 | 13 | use tracing::{debug, instrument}; |
| 14 | 14 | |
| 15 | 15 | use crate::delegation::inherit_generics_for_delegation_item; |
compiler/rustc_hir_analysis/src/collect/item_bounds.rs+2-2| ... | ... | @@ -5,13 +5,13 @@ use rustc_middle::ty::{ |
| 5 | 5 | self, GenericArgs, Ty, TyCtxt, TypeFoldable, TypeFolder, TypeSuperFoldable, |
| 6 | 6 | }; |
| 7 | 7 | use rustc_middle::{bug, span_bug}; |
| 8 | use rustc_span::def_id::{DefId, LocalDefId}; | |
| 9 | 8 | use rustc_span::Span; |
| 9 | use rustc_span::def_id::{DefId, LocalDefId}; | |
| 10 | 10 | use rustc_type_ir::Upcast; |
| 11 | 11 | use tracing::{debug, instrument}; |
| 12 | 12 | |
| 13 | use super::predicates_of::assert_only_contains_predicates_from; | |
| 14 | 13 | use super::ItemCtxt; |
| 14 | use super::predicates_of::assert_only_contains_predicates_from; | |
| 15 | 15 | use crate::hir_ty_lowering::{HirTyLowerer, PredicateFilter}; |
| 16 | 16 | |
| 17 | 17 | /// For associated types we include both bounds written on the type |
compiler/rustc_hir_analysis/src/collect/predicates_of.rs+5-5| ... | ... | @@ -9,7 +9,7 @@ use rustc_hir::intravisit::{self, Visitor}; |
| 9 | 9 | use rustc_middle::ty::{self, GenericPredicates, ImplTraitInTraitData, Ty, TyCtxt, Upcast}; |
| 10 | 10 | use rustc_middle::{bug, span_bug}; |
| 11 | 11 | use rustc_span::symbol::Ident; |
| 12 | use rustc_span::{Span, DUMMY_SP}; | |
| 12 | use rustc_span::{DUMMY_SP, Span}; | |
| 13 | 13 | use tracing::{debug, instrument, trace}; |
| 14 | 14 | |
| 15 | 15 | use crate::bounds::Bounds; |
| ... | ... | @@ -379,10 +379,10 @@ fn compute_bidirectional_outlives_predicates<'tcx>( |
| 379 | 379 | for param in opaque_own_params { |
| 380 | 380 | let orig_lifetime = tcx.map_opaque_lifetime_to_parent_lifetime(param.def_id.expect_local()); |
| 381 | 381 | if let ty::ReEarlyParam(..) = *orig_lifetime { |
| 382 | let dup_lifetime = ty::Region::new_early_param( | |
| 383 | tcx, | |
| 384 | ty::EarlyParamRegion { index: param.index, name: param.name }, | |
| 385 | ); | |
| 382 | let dup_lifetime = ty::Region::new_early_param(tcx, ty::EarlyParamRegion { | |
| 383 | index: param.index, | |
| 384 | name: param.name, | |
| 385 | }); | |
| 386 | 386 | let span = tcx.def_span(param.def_id); |
| 387 | 387 | predicates.push(( |
| 388 | 388 | ty::ClauseKind::RegionOutlives(ty::OutlivesPredicate(orig_lifetime, dup_lifetime)) |
compiler/rustc_hir_analysis/src/collect/resolve_bound_vars.rs+3-3| ... | ... | @@ -21,9 +21,9 @@ use rustc_middle::middle::resolve_bound_vars::*; |
| 21 | 21 | use rustc_middle::query::Providers; |
| 22 | 22 | use rustc_middle::ty::{self, TyCtxt, TypeSuperVisitable, TypeVisitor}; |
| 23 | 23 | use rustc_middle::{bug, span_bug}; |
| 24 | use rustc_span::def_id::{DefId, LocalDefId}; | |
| 25 | use rustc_span::symbol::{sym, Ident}; | |
| 26 | 24 | use rustc_span::Span; |
| 25 | use rustc_span::def_id::{DefId, LocalDefId}; | |
| 26 | use rustc_span::symbol::{Ident, sym}; | |
| 27 | 27 | use tracing::{debug, debug_span, instrument}; |
| 28 | 28 | |
| 29 | 29 | use crate::errors; |
| ... | ... | @@ -1730,7 +1730,7 @@ impl<'a, 'tcx> BoundVarContext<'a, 'tcx> { |
| 1730 | 1730 | ) |
| 1731 | 1731 | }; |
| 1732 | 1732 | |
| 1733 | use smallvec::{smallvec, SmallVec}; | |
| 1733 | use smallvec::{SmallVec, smallvec}; | |
| 1734 | 1734 | let mut stack: SmallVec<[(DefId, SmallVec<[ty::BoundVariableKind; 8]>); 8]> = |
| 1735 | 1735 | smallvec![(def_id, smallvec![])]; |
| 1736 | 1736 | let mut visited: FxHashSet<DefId> = FxHashSet::default(); |
compiler/rustc_hir_analysis/src/collect/type_of.rs+3-3| ... | ... | @@ -2,18 +2,18 @@ use core::ops::ControlFlow; |
| 2 | 2 | |
| 3 | 3 | use rustc_errors::{Applicability, StashKey, Suggestions}; |
| 4 | 4 | use rustc_hir as hir; |
| 5 | use rustc_hir::def_id::{DefId, LocalDefId}; | |
| 6 | 5 | use rustc_hir::HirId; |
| 6 | use rustc_hir::def_id::{DefId, LocalDefId}; | |
| 7 | 7 | use rustc_middle::query::plumbing::CyclePlaceholder; |
| 8 | 8 | use rustc_middle::ty::print::with_forced_trimmed_paths; |
| 9 | 9 | use rustc_middle::ty::util::IntTypeExt; |
| 10 | 10 | use rustc_middle::ty::{self, Article, IsSuggestable, Ty, TyCtxt, TypeVisitableExt}; |
| 11 | 11 | use rustc_middle::{bug, span_bug}; |
| 12 | 12 | use rustc_span::symbol::Ident; |
| 13 | use rustc_span::{Span, DUMMY_SP}; | |
| 13 | use rustc_span::{DUMMY_SP, Span}; | |
| 14 | 14 | use tracing::debug; |
| 15 | 15 | |
| 16 | use super::{bad_placeholder, ItemCtxt}; | |
| 16 | use super::{ItemCtxt, bad_placeholder}; | |
| 17 | 17 | use crate::errors::TypeofReservedKeywordUsed; |
| 18 | 18 | use crate::hir_ty_lowering::HirTyLowerer; |
| 19 | 19 |
compiler/rustc_hir_analysis/src/collect/type_of/opaque.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ use rustc_errors::StashKey; |
| 2 | 2 | use rustc_hir::def::DefKind; |
| 3 | 3 | use rustc_hir::def_id::LocalDefId; |
| 4 | 4 | use rustc_hir::intravisit::{self, Visitor}; |
| 5 | use rustc_hir::{self as hir, def, Expr, ImplItem, Item, Node, TraitItem}; | |
| 5 | use rustc_hir::{self as hir, Expr, ImplItem, Item, Node, TraitItem, def}; | |
| 6 | 6 | use rustc_middle::bug; |
| 7 | 7 | use rustc_middle::hir::nested_filter; |
| 8 | 8 | use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt}; |
compiler/rustc_hir_analysis/src/delegation.rs+4-4| ... | ... | @@ -41,10 +41,10 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for ParamIndexRemapper<'tcx> { |
| 41 | 41 | if let ty::ReEarlyParam(param) = r.kind() |
| 42 | 42 | && let Some(index) = self.remap_table.get(&param.index).copied() |
| 43 | 43 | { |
| 44 | return ty::Region::new_early_param( | |
| 45 | self.tcx, | |
| 46 | ty::EarlyParamRegion { index, name: param.name }, | |
| 47 | ); | |
| 44 | return ty::Region::new_early_param(self.tcx, ty::EarlyParamRegion { | |
| 45 | index, | |
| 46 | name: param.name, | |
| 47 | }); | |
| 48 | 48 | } |
| 49 | 49 | r |
| 50 | 50 | } |
compiler/rustc_hir_analysis/src/errors/wrong_number_of_generic_args.rs+2-2| ... | ... | @@ -1,12 +1,12 @@ |
| 1 | 1 | use std::iter; |
| 2 | 2 | |
| 3 | use GenericArgsInfo::*; | |
| 3 | 4 | use rustc_errors::codes::*; |
| 4 | use rustc_errors::{pluralize, Applicability, Diag, Diagnostic, EmissionGuarantee, MultiSpan}; | |
| 5 | use rustc_errors::{Applicability, Diag, Diagnostic, EmissionGuarantee, MultiSpan, pluralize}; | |
| 5 | 6 | use rustc_hir as hir; |
| 6 | 7 | use rustc_middle::ty::{self as ty, AssocItems, AssocKind, TyCtxt}; |
| 7 | 8 | use rustc_span::def_id::DefId; |
| 8 | 9 | use tracing::debug; |
| 9 | use GenericArgsInfo::*; | |
| 10 | 10 | |
| 11 | 11 | /// Handles the `wrong number of type / lifetime / ... arguments` family of error messages. |
| 12 | 12 | pub(crate) struct WrongNumberOfGenericArgs<'a, 'tcx> { |
compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs+7-9| ... | ... | @@ -4,13 +4,13 @@ use rustc_data_structures::fx::{FxIndexMap, FxIndexSet}; |
| 4 | 4 | use rustc_errors::codes::*; |
| 5 | 5 | use rustc_errors::struct_span_code_err; |
| 6 | 6 | use rustc_hir as hir; |
| 7 | use rustc_hir::HirId; | |
| 7 | 8 | use rustc_hir::def::{DefKind, Res}; |
| 8 | 9 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| 9 | use rustc_hir::HirId; | |
| 10 | 10 | use rustc_middle::bug; |
| 11 | 11 | use rustc_middle::ty::{self as ty, IsSuggestable, Ty, TyCtxt}; |
| 12 | 12 | use rustc_span::symbol::Ident; |
| 13 | use rustc_span::{sym, ErrorGuaranteed, Span, Symbol}; | |
| 13 | use rustc_span::{ErrorGuaranteed, Span, Symbol, sym}; | |
| 14 | 14 | use rustc_trait_selection::traits; |
| 15 | 15 | use rustc_type_ir::visit::{TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor}; |
| 16 | 16 | use smallvec::SmallVec; |
| ... | ... | @@ -672,15 +672,13 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { |
| 672 | 672 | let mut num_bound_vars = candidate.bound_vars().len(); |
| 673 | 673 | let args = candidate.skip_binder().args.extend_to(tcx, item_def_id, |param, _| { |
| 674 | 674 | let arg = match param.kind { |
| 675 | ty::GenericParamDefKind::Lifetime => ty::Region::new_bound( | |
| 676 | tcx, | |
| 677 | ty::INNERMOST, | |
| 678 | ty::BoundRegion { | |
| 675 | ty::GenericParamDefKind::Lifetime => { | |
| 676 | ty::Region::new_bound(tcx, ty::INNERMOST, ty::BoundRegion { | |
| 679 | 677 | var: ty::BoundVar::from_usize(num_bound_vars), |
| 680 | 678 | kind: ty::BoundRegionKind::BrNamed(param.def_id, param.name), |
| 681 | }, | |
| 682 | ) | |
| 683 | .into(), | |
| 679 | }) | |
| 680 | .into() | |
| 681 | } | |
| 684 | 682 | ty::GenericParamDefKind::Type { .. } => { |
| 685 | 683 | let guar = *emitted_bad_param_err.get_or_insert_with(|| { |
| 686 | 684 | self.dcx().emit_err(crate::errors::ReturnTypeNotationIllegalParam::Type { |
compiler/rustc_hir_analysis/src/hir_ty_lowering/errors.rs+14-17| ... | ... | @@ -3,7 +3,7 @@ use rustc_data_structures::sorted_map::SortedMap; |
| 3 | 3 | use rustc_data_structures::unord::UnordMap; |
| 4 | 4 | use rustc_errors::codes::*; |
| 5 | 5 | use rustc_errors::{ |
| 6 | pluralize, struct_span_code_err, Applicability, Diag, ErrorGuaranteed, MultiSpan, | |
| 6 | Applicability, Diag, ErrorGuaranteed, MultiSpan, pluralize, struct_span_code_err, | |
| 7 | 7 | }; |
| 8 | 8 | use rustc_hir as hir; |
| 9 | 9 | use rustc_hir::def::{DefKind, Res}; |
| ... | ... | @@ -12,16 +12,16 @@ use rustc_middle::bug; |
| 12 | 12 | use rustc_middle::query::Key; |
| 13 | 13 | use rustc_middle::ty::print::{PrintPolyTraitRefExt as _, PrintTraitRefExt as _}; |
| 14 | 14 | use rustc_middle::ty::{ |
| 15 | self, suggest_constraining_type_param, AdtDef, Binder, GenericParamDefKind, TraitRef, Ty, | |
| 16 | TyCtxt, TypeVisitableExt, | |
| 15 | self, AdtDef, Binder, GenericParamDefKind, TraitRef, Ty, TyCtxt, TypeVisitableExt, | |
| 16 | suggest_constraining_type_param, | |
| 17 | 17 | }; |
| 18 | 18 | use rustc_session::parse::feature_err; |
| 19 | 19 | use rustc_span::edit_distance::find_best_match_for_name; |
| 20 | use rustc_span::symbol::{kw, sym, Ident}; | |
| 21 | use rustc_span::{BytePos, Span, Symbol, DUMMY_SP}; | |
| 20 | use rustc_span::symbol::{Ident, kw, sym}; | |
| 21 | use rustc_span::{BytePos, DUMMY_SP, Span, Symbol}; | |
| 22 | 22 | use rustc_trait_selection::error_reporting::traits::report_object_safety_error; |
| 23 | 23 | use rustc_trait_selection::traits::{ |
| 24 | object_safety_violations_for_assoc_item, FulfillmentError, TraitAliasExpansionInfo, | |
| 24 | FulfillmentError, TraitAliasExpansionInfo, object_safety_violations_for_assoc_item, | |
| 25 | 25 | }; |
| 26 | 26 | |
| 27 | 27 | use crate::errors::{ |
| ... | ... | @@ -834,17 +834,14 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ { |
| 834 | 834 | .into_iter() |
| 835 | 835 | .map(|(trait_, mut assocs)| { |
| 836 | 836 | assocs.sort(); |
| 837 | format!( | |
| 838 | "{} in `{trait_}`", | |
| 839 | match &assocs[..] { | |
| 840 | [] => String::new(), | |
| 841 | [only] => format!("`{only}`"), | |
| 842 | [assocs @ .., last] => format!( | |
| 843 | "{} and `{last}`", | |
| 844 | assocs.iter().map(|a| format!("`{a}`")).collect::<Vec<_>>().join(", ") | |
| 845 | ), | |
| 846 | } | |
| 847 | ) | |
| 837 | format!("{} in `{trait_}`", match &assocs[..] { | |
| 838 | [] => String::new(), | |
| 839 | [only] => format!("`{only}`"), | |
| 840 | [assocs @ .., last] => format!( | |
| 841 | "{} and `{last}`", | |
| 842 | assocs.iter().map(|a| format!("`{a}`")).collect::<Vec<_>>().join(", ") | |
| 843 | ), | |
| 844 | }) | |
| 848 | 845 | }) |
| 849 | 846 | .collect::<Vec<String>>(); |
| 850 | 847 | names.sort(); |
compiler/rustc_hir_analysis/src/hir_ty_lowering/generics.rs+2-2| ... | ... | @@ -1,10 +1,10 @@ |
| 1 | 1 | use rustc_ast::ast::ParamKindOrd; |
| 2 | 2 | use rustc_errors::codes::*; |
| 3 | use rustc_errors::{struct_span_code_err, Applicability, Diag, ErrorGuaranteed, MultiSpan}; | |
| 3 | use rustc_errors::{Applicability, Diag, ErrorGuaranteed, MultiSpan, struct_span_code_err}; | |
| 4 | 4 | use rustc_hir as hir; |
| 5 | use rustc_hir::GenericArg; | |
| 5 | 6 | use rustc_hir::def::{DefKind, Res}; |
| 6 | 7 | use rustc_hir::def_id::DefId; |
| 7 | use rustc_hir::GenericArg; | |
| 8 | 8 | use rustc_middle::ty::{ |
| 9 | 9 | self, GenericArgsRef, GenericParamDef, GenericParamDefKind, IsSuggestable, Ty, |
| 10 | 10 | }; |
compiler/rustc_hir_analysis/src/hir_ty_lowering/lint.rs+1-1| ... | ... | @@ -3,8 +3,8 @@ use rustc_errors::codes::*; |
| 3 | 3 | use rustc_errors::{Diag, EmissionGuarantee, StashKey}; |
| 4 | 4 | use rustc_hir as hir; |
| 5 | 5 | use rustc_hir::def::{DefKind, Res}; |
| 6 | use rustc_lint_defs::builtin::BARE_TRAIT_OBJECTS; | |
| 7 | 6 | use rustc_lint_defs::Applicability; |
| 7 | use rustc_lint_defs::builtin::BARE_TRAIT_OBJECTS; | |
| 8 | 8 | use rustc_span::Span; |
| 9 | 9 | use rustc_trait_selection::error_reporting::traits::suggestions::NextTypeParamName; |
| 10 | 10 |
compiler/rustc_hir_analysis/src/hir_ty_lowering/mod.rs+4-4| ... | ... | @@ -26,7 +26,7 @@ use rustc_ast::TraitObjectSyntax; |
| 26 | 26 | use rustc_data_structures::fx::{FxHashSet, FxIndexMap}; |
| 27 | 27 | use rustc_errors::codes::*; |
| 28 | 28 | use rustc_errors::{ |
| 29 | struct_span_code_err, Applicability, Diag, DiagCtxtHandle, ErrorGuaranteed, FatalError, | |
| 29 | Applicability, Diag, DiagCtxtHandle, ErrorGuaranteed, FatalError, struct_span_code_err, | |
| 30 | 30 | }; |
| 31 | 31 | use rustc_hir as hir; |
| 32 | 32 | use rustc_hir::def::{CtorOf, DefKind, Namespace, Res}; |
| ... | ... | @@ -44,8 +44,8 @@ use rustc_middle::ty::{ |
| 44 | 44 | use rustc_middle::{bug, span_bug}; |
| 45 | 45 | use rustc_session::lint::builtin::AMBIGUOUS_ASSOCIATED_ITEMS; |
| 46 | 46 | use rustc_span::edit_distance::find_best_match_for_name; |
| 47 | use rustc_span::symbol::{kw, Ident, Symbol}; | |
| 48 | use rustc_span::{Span, DUMMY_SP}; | |
| 47 | use rustc_span::symbol::{Ident, Symbol, kw}; | |
| 48 | use rustc_span::{DUMMY_SP, Span}; | |
| 49 | 49 | use rustc_target::spec::abi; |
| 50 | 50 | use rustc_trait_selection::infer::InferCtxtExt; |
| 51 | 51 | use rustc_trait_selection::traits::wf::object_region_bounds; |
| ... | ... | @@ -54,7 +54,7 @@ use tracing::{debug, debug_span, instrument}; |
| 54 | 54 | |
| 55 | 55 | use crate::bounds::Bounds; |
| 56 | 56 | use crate::errors::{AmbiguousLifetimeBound, BadReturnTypeNotation, WildPatTy}; |
| 57 | use crate::hir_ty_lowering::errors::{prohibit_assoc_item_constraint, GenericsArgsErrExtend}; | |
| 57 | use crate::hir_ty_lowering::errors::{GenericsArgsErrExtend, prohibit_assoc_item_constraint}; | |
| 58 | 58 | use crate::hir_ty_lowering::generics::{check_generic_arg_count, lower_generic_args}; |
| 59 | 59 | use crate::middle::resolve_bound_vars as rbv; |
| 60 | 60 | use crate::require_c_abi_if_c_variadic; |
compiler/rustc_hir_analysis/src/hir_ty_lowering/object_safety.rs+1-1| ... | ... | @@ -13,7 +13,7 @@ use rustc_middle::ty::{ |
| 13 | 13 | use rustc_span::{ErrorGuaranteed, Span}; |
| 14 | 14 | use rustc_trait_selection::error_reporting::traits::report_object_safety_error; |
| 15 | 15 | use rustc_trait_selection::traits::{self, hir_ty_lowering_object_safety_violations}; |
| 16 | use smallvec::{smallvec, SmallVec}; | |
| 16 | use smallvec::{SmallVec, smallvec}; | |
| 17 | 17 | use tracing::{debug, instrument}; |
| 18 | 18 | |
| 19 | 19 | use super::HirTyLowerer; |
compiler/rustc_hir_analysis/src/impl_wf_check/min_specialization.rs+2-2| ... | ... | @@ -68,15 +68,15 @@ |
| 68 | 68 | use rustc_data_structures::fx::FxHashSet; |
| 69 | 69 | use rustc_hir as hir; |
| 70 | 70 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| 71 | use rustc_infer::infer::outlives::env::OutlivesEnvironment; | |
| 72 | 71 | use rustc_infer::infer::TyCtxtInferExt; |
| 72 | use rustc_infer::infer::outlives::env::OutlivesEnvironment; | |
| 73 | 73 | use rustc_infer::traits::specialization_graph::Node; |
| 74 | 74 | use rustc_middle::ty::trait_def::TraitSpecializationKind; |
| 75 | 75 | use rustc_middle::ty::{self, GenericArg, GenericArgs, GenericArgsRef, TyCtxt, TypeVisitableExt}; |
| 76 | 76 | use rustc_span::{ErrorGuaranteed, Span}; |
| 77 | 77 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; |
| 78 | 78 | use rustc_trait_selection::traits::outlives_bounds::InferCtxtExt as _; |
| 79 | use rustc_trait_selection::traits::{self, translate_args_with_cause, wf, ObligationCtxt}; | |
| 79 | use rustc_trait_selection::traits::{self, ObligationCtxt, translate_args_with_cause, wf}; | |
| 80 | 80 | use tracing::{debug, instrument}; |
| 81 | 81 | |
| 82 | 82 | use crate::errors::GenericArgsOnOverriddenImpl; |
compiler/rustc_hir_analysis/src/lib.rs+1-1| ... | ... | @@ -100,8 +100,8 @@ use rustc_middle::mir::interpret::GlobalId; |
| 100 | 100 | use rustc_middle::query::Providers; |
| 101 | 101 | use rustc_middle::ty::{self, Ty, TyCtxt}; |
| 102 | 102 | use rustc_session::parse::feature_err; |
| 103 | use rustc_span::symbol::sym; | |
| 104 | 103 | use rustc_span::Span; |
| 104 | use rustc_span::symbol::sym; | |
| 105 | 105 | use rustc_target::spec::abi::Abi; |
| 106 | 106 | use rustc_trait_selection::traits; |
| 107 | 107 |
compiler/rustc_hir_analysis/src/outlives/utils.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ use rustc_data_structures::fx::FxIndexMap; |
| 2 | 2 | use rustc_middle::ty::{self, GenericArg, GenericArgKind, Region, Ty, TyCtxt}; |
| 3 | 3 | use rustc_middle::{bug, span_bug}; |
| 4 | 4 | use rustc_span::Span; |
| 5 | use rustc_type_ir::outlives::{push_outlives_components, Component}; | |
| 5 | use rustc_type_ir::outlives::{Component, push_outlives_components}; | |
| 6 | 6 | use smallvec::smallvec; |
| 7 | 7 | |
| 8 | 8 | /// Tracks the `T: 'a` or `'a: 'a` predicates that we have inferred |
compiler/rustc_hir_analysis/src/variance/dump.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use std::fmt::Write; |
| 2 | 2 | |
| 3 | 3 | use rustc_hir::def::DefKind; |
| 4 | use rustc_hir::def_id::{LocalDefId, CRATE_DEF_ID}; | |
| 4 | use rustc_hir::def_id::{CRATE_DEF_ID, LocalDefId}; | |
| 5 | 5 | use rustc_middle::ty::{GenericArgs, TyCtxt}; |
| 6 | 6 | use rustc_span::symbol::sym; |
| 7 | 7 |
compiler/rustc_hir_pretty/src/lib.rs+6-9| ... | ... | @@ -18,9 +18,9 @@ use rustc_hir::{ |
| 18 | 18 | HirId, LifetimeParamKind, Node, PatKind, PreciseCapturingArg, RangeEnd, Term, |
| 19 | 19 | TraitBoundModifier, |
| 20 | 20 | }; |
| 21 | use rustc_span::source_map::SourceMap; | |
| 22 | use rustc_span::symbol::{kw, Ident, Symbol}; | |
| 23 | 21 | use rustc_span::FileName; |
| 22 | use rustc_span::source_map::SourceMap; | |
| 23 | use rustc_span::symbol::{Ident, Symbol, kw}; | |
| 24 | 24 | use rustc_target::spec::abi::Abi; |
| 25 | 25 | use {rustc_ast as ast, rustc_hir as hir}; |
| 26 | 26 | |
| ... | ... | @@ -2026,13 +2026,10 @@ impl<'a> State<'a> { |
| 2026 | 2026 | let generic_params = generic_params |
| 2027 | 2027 | .iter() |
| 2028 | 2028 | .filter(|p| { |
| 2029 | matches!( | |
| 2030 | p, | |
| 2031 | GenericParam { | |
| 2032 | kind: GenericParamKind::Lifetime { kind: LifetimeParamKind::Explicit }, | |
| 2033 | .. | |
| 2034 | } | |
| 2035 | ) | |
| 2029 | matches!(p, GenericParam { | |
| 2030 | kind: GenericParamKind::Lifetime { kind: LifetimeParamKind::Explicit }, | |
| 2031 | .. | |
| 2032 | }) | |
| 2036 | 2033 | }) |
| 2037 | 2034 | .collect::<Vec<_>>(); |
| 2038 | 2035 |
compiler/rustc_hir_typeck/src/callee.rs+22-28| ... | ... | @@ -13,17 +13,17 @@ use rustc_middle::ty::adjustment::{ |
| 13 | 13 | }; |
| 14 | 14 | use rustc_middle::ty::{self, GenericArgsRef, Ty, TyCtxt, TypeVisitableExt}; |
| 15 | 15 | use rustc_middle::{bug, span_bug}; |
| 16 | use rustc_span::def_id::LocalDefId; | |
| 17 | use rustc_span::symbol::{sym, Ident}; | |
| 18 | 16 | use rustc_span::Span; |
| 17 | use rustc_span::def_id::LocalDefId; | |
| 18 | use rustc_span::symbol::{Ident, sym}; | |
| 19 | 19 | use rustc_target::spec::abi; |
| 20 | 20 | use rustc_trait_selection::error_reporting::traits::DefIdOrName; |
| 21 | 21 | use rustc_trait_selection::infer::InferCtxtExt as _; |
| 22 | 22 | use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt as _; |
| 23 | 23 | use tracing::{debug, instrument, trace}; |
| 24 | 24 | |
| 25 | use super::method::probe::ProbeScope; | |
| 26 | 25 | use super::method::MethodCallee; |
| 26 | use super::method::probe::ProbeScope; | |
| 27 | 27 | use super::{Expectation, FnCtxt, TupleArgumentsFlag}; |
| 28 | 28 | use crate::errors; |
| 29 | 29 | |
| ... | ... | @@ -156,16 +156,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 156 | 156 | closure_sig, |
| 157 | 157 | ); |
| 158 | 158 | let adjustments = self.adjust_steps(autoderef); |
| 159 | self.record_deferred_call_resolution( | |
| 160 | def_id, | |
| 161 | DeferredCallResolution { | |
| 162 | call_expr, | |
| 163 | callee_expr, | |
| 164 | closure_ty: adjusted_ty, | |
| 165 | adjustments, | |
| 166 | fn_sig: closure_sig, | |
| 167 | }, | |
| 168 | ); | |
| 159 | self.record_deferred_call_resolution(def_id, DeferredCallResolution { | |
| 160 | call_expr, | |
| 161 | callee_expr, | |
| 162 | closure_ty: adjusted_ty, | |
| 163 | adjustments, | |
| 164 | fn_sig: closure_sig, | |
| 165 | }); | |
| 169 | 166 | return Some(CallStep::DeferredClosure(def_id, closure_sig)); |
| 170 | 167 | } |
| 171 | 168 | |
| ... | ... | @@ -202,16 +199,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 202 | 199 | coroutine_closure_sig.abi, |
| 203 | 200 | ); |
| 204 | 201 | let adjustments = self.adjust_steps(autoderef); |
| 205 | self.record_deferred_call_resolution( | |
| 206 | def_id, | |
| 207 | DeferredCallResolution { | |
| 208 | call_expr, | |
| 209 | callee_expr, | |
| 210 | closure_ty: adjusted_ty, | |
| 211 | adjustments, | |
| 212 | fn_sig: call_sig, | |
| 213 | }, | |
| 214 | ); | |
| 202 | self.record_deferred_call_resolution(def_id, DeferredCallResolution { | |
| 203 | call_expr, | |
| 204 | callee_expr, | |
| 205 | closure_ty: adjusted_ty, | |
| 206 | adjustments, | |
| 207 | fn_sig: call_sig, | |
| 208 | }); | |
| 215 | 209 | return Some(CallStep::DeferredClosure(def_id, call_sig)); |
| 216 | 210 | } |
| 217 | 211 | |
| ... | ... | @@ -554,11 +548,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 554 | 548 | self.tcx, |
| 555 | 549 | self.misc(span), |
| 556 | 550 | self.param_env, |
| 557 | ty::TraitRef::new( | |
| 558 | self.tcx, | |
| 559 | fn_once_def_id, | |
| 560 | [arg_ty.into(), fn_sig.inputs()[0].into(), const_param], | |
| 561 | ), | |
| 551 | ty::TraitRef::new(self.tcx, fn_once_def_id, [ | |
| 552 | arg_ty.into(), | |
| 553 | fn_sig.inputs()[0].into(), | |
| 554 | const_param, | |
| 555 | ]), | |
| 562 | 556 | )); |
| 563 | 557 | |
| 564 | 558 | self.register_predicate(traits::Obligation::new( |
compiler/rustc_hir_typeck/src/cast.rs+11-15| ... | ... | @@ -42,7 +42,7 @@ use rustc_middle::ty::{self, Ty, TyCtxt, TypeAndMut, TypeVisitableExt, VariantDe |
| 42 | 42 | use rustc_session::lint; |
| 43 | 43 | use rustc_span::def_id::LOCAL_CRATE; |
| 44 | 44 | use rustc_span::symbol::sym; |
| 45 | use rustc_span::{Span, DUMMY_SP}; | |
| 45 | use rustc_span::{DUMMY_SP, Span}; | |
| 46 | 46 | use rustc_trait_selection::infer::InferCtxtExt; |
| 47 | 47 | use tracing::{debug, instrument}; |
| 48 | 48 | |
| ... | ... | @@ -284,14 +284,11 @@ impl<'a, 'tcx> CastCheck<'tcx> { |
| 284 | 284 | let mut err = |
| 285 | 285 | make_invalid_casting_error(self.span, self.expr_ty, self.cast_ty, fcx); |
| 286 | 286 | if self.cast_ty.is_integral() { |
| 287 | err.help(format!( | |
| 288 | "cast through {} first", | |
| 289 | match e { | |
| 290 | CastError::NeedViaPtr => "a raw pointer", | |
| 291 | CastError::NeedViaThinPtr => "a thin pointer", | |
| 292 | e => unreachable!("control flow means we should never encounter a {e:?}"), | |
| 293 | } | |
| 294 | )); | |
| 287 | err.help(format!("cast through {} first", match e { | |
| 288 | CastError::NeedViaPtr => "a raw pointer", | |
| 289 | CastError::NeedViaThinPtr => "a thin pointer", | |
| 290 | e => unreachable!("control flow means we should never encounter a {e:?}"), | |
| 291 | })); | |
| 295 | 292 | } |
| 296 | 293 | |
| 297 | 294 | self.try_suggest_collection_to_bool(fcx, &mut err); |
| ... | ... | @@ -620,12 +617,11 @@ impl<'a, 'tcx> CastCheck<'tcx> { |
| 620 | 617 | }; |
| 621 | 618 | let expr_ty = fcx.resolve_vars_if_possible(self.expr_ty); |
| 622 | 619 | let cast_ty = fcx.resolve_vars_if_possible(self.cast_ty); |
| 623 | fcx.tcx.emit_node_span_lint( | |
| 624 | lint, | |
| 625 | self.expr.hir_id, | |
| 626 | self.span, | |
| 627 | errors::TrivialCast { numeric, expr_ty, cast_ty }, | |
| 628 | ); | |
| 620 | fcx.tcx.emit_node_span_lint(lint, self.expr.hir_id, self.span, errors::TrivialCast { | |
| 621 | numeric, | |
| 622 | expr_ty, | |
| 623 | cast_ty, | |
| 624 | }); | |
| 629 | 625 | } |
| 630 | 626 | |
| 631 | 627 | #[instrument(skip(fcx), level = "debug")] |
compiler/rustc_hir_typeck/src/check.rs+10-13| ... | ... | @@ -191,21 +191,18 @@ fn check_panic_info_fn(tcx: TyCtxt<'_>, fn_id: LocalDefId, fn_sig: ty::FnSig<'_> |
| 191 | 191 | let panic_info_did = tcx.require_lang_item(hir::LangItem::PanicInfo, Some(span)); |
| 192 | 192 | |
| 193 | 193 | // build type `for<'a, 'b> fn(&'a PanicInfo<'b>) -> !` |
| 194 | let panic_info_ty = tcx.type_of(panic_info_did).instantiate( | |
| 195 | tcx, | |
| 196 | &[ty::GenericArg::from(ty::Region::new_bound( | |
| 197 | tcx, | |
| 198 | ty::INNERMOST, | |
| 199 | ty::BoundRegion { var: ty::BoundVar::from_u32(1), kind: ty::BrAnon }, | |
| 200 | ))], | |
| 201 | ); | |
| 194 | let panic_info_ty = tcx.type_of(panic_info_did).instantiate(tcx, &[ty::GenericArg::from( | |
| 195 | ty::Region::new_bound(tcx, ty::INNERMOST, ty::BoundRegion { | |
| 196 | var: ty::BoundVar::from_u32(1), | |
| 197 | kind: ty::BrAnon, | |
| 198 | }), | |
| 199 | )]); | |
| 202 | 200 | let panic_info_ref_ty = Ty::new_imm_ref( |
| 203 | 201 | tcx, |
| 204 | ty::Region::new_bound( | |
| 205 | tcx, | |
| 206 | ty::INNERMOST, | |
| 207 | ty::BoundRegion { var: ty::BoundVar::ZERO, kind: ty::BrAnon }, | |
| 208 | ), | |
| 202 | ty::Region::new_bound(tcx, ty::INNERMOST, ty::BoundRegion { | |
| 203 | var: ty::BoundVar::ZERO, | |
| 204 | kind: ty::BrAnon, | |
| 205 | }), | |
| 209 | 206 | panic_info_ty, |
| 210 | 207 | ); |
| 211 | 208 |
compiler/rustc_hir_typeck/src/closure.rs+20-28| ... | ... | @@ -14,14 +14,14 @@ use rustc_middle::span_bug; |
| 14 | 14 | use rustc_middle::ty::visit::{TypeVisitable, TypeVisitableExt}; |
| 15 | 15 | use rustc_middle::ty::{self, GenericArgs, Ty, TyCtxt, TypeSuperVisitable, TypeVisitor}; |
| 16 | 16 | use rustc_span::def_id::LocalDefId; |
| 17 | use rustc_span::{Span, DUMMY_SP}; | |
| 17 | use rustc_span::{DUMMY_SP, Span}; | |
| 18 | 18 | use rustc_target::spec::abi::Abi; |
| 19 | 19 | use rustc_trait_selection::error_reporting::traits::ArgKind; |
| 20 | 20 | use rustc_trait_selection::traits; |
| 21 | 21 | use rustc_type_ir::ClosureKind; |
| 22 | 22 | use tracing::{debug, instrument, trace}; |
| 23 | 23 | |
| 24 | use super::{check_fn, CoroutineTypes, Expectation, FnCtxt}; | |
| 24 | use super::{CoroutineTypes, Expectation, FnCtxt, check_fn}; | |
| 25 | 25 | |
| 26 | 26 | /// What signature do we *expect* the closure to have from context? |
| 27 | 27 | #[derive(Debug, Clone, TypeFoldable, TypeVisitable)] |
| ... | ... | @@ -103,15 +103,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 103 | 103 | None => self.next_ty_var(expr_span), |
| 104 | 104 | }; |
| 105 | 105 | |
| 106 | let closure_args = ty::ClosureArgs::new( | |
| 107 | tcx, | |
| 108 | ty::ClosureArgsParts { | |
| 109 | parent_args, | |
| 110 | closure_kind_ty, | |
| 111 | closure_sig_as_fn_ptr_ty: Ty::new_fn_ptr(tcx, sig), | |
| 112 | tupled_upvars_ty, | |
| 113 | }, | |
| 114 | ); | |
| 106 | let closure_args = ty::ClosureArgs::new(tcx, ty::ClosureArgsParts { | |
| 107 | parent_args, | |
| 108 | closure_kind_ty, | |
| 109 | closure_sig_as_fn_ptr_ty: Ty::new_fn_ptr(tcx, sig), | |
| 110 | tupled_upvars_ty, | |
| 111 | }); | |
| 115 | 112 | |
| 116 | 113 | (Ty::new_closure(tcx, expr_def_id.to_def_id(), closure_args.args), None) |
| 117 | 114 | } |
| ... | ... | @@ -180,18 +177,15 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 180 | 177 | _ => tcx.types.unit, |
| 181 | 178 | }; |
| 182 | 179 | |
| 183 | let coroutine_args = ty::CoroutineArgs::new( | |
| 184 | tcx, | |
| 185 | ty::CoroutineArgsParts { | |
| 186 | parent_args, | |
| 187 | kind_ty, | |
| 188 | resume_ty, | |
| 189 | yield_ty, | |
| 190 | return_ty: liberated_sig.output(), | |
| 191 | witness: interior, | |
| 192 | tupled_upvars_ty, | |
| 193 | }, | |
| 194 | ); | |
| 180 | let coroutine_args = ty::CoroutineArgs::new(tcx, ty::CoroutineArgsParts { | |
| 181 | parent_args, | |
| 182 | kind_ty, | |
| 183 | resume_ty, | |
| 184 | yield_ty, | |
| 185 | return_ty: liberated_sig.output(), | |
| 186 | witness: interior, | |
| 187 | tupled_upvars_ty, | |
| 188 | }); | |
| 195 | 189 | |
| 196 | 190 | ( |
| 197 | 191 | Ty::new_coroutine(tcx, expr_def_id.to_def_id(), coroutine_args.args), |
| ... | ... | @@ -222,9 +216,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 222 | 216 | }; |
| 223 | 217 | |
| 224 | 218 | let coroutine_captures_by_ref_ty = self.next_ty_var(expr_span); |
| 225 | let closure_args = ty::CoroutineClosureArgs::new( | |
| 226 | tcx, | |
| 227 | ty::CoroutineClosureArgsParts { | |
| 219 | let closure_args = | |
| 220 | ty::CoroutineClosureArgs::new(tcx, ty::CoroutineClosureArgsParts { | |
| 228 | 221 | parent_args, |
| 229 | 222 | closure_kind_ty, |
| 230 | 223 | signature_parts_ty: Ty::new_fn_ptr( |
| ... | ... | @@ -245,8 +238,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 245 | 238 | tupled_upvars_ty, |
| 246 | 239 | coroutine_captures_by_ref_ty, |
| 247 | 240 | coroutine_witness_ty: interior, |
| 248 | }, | |
| 249 | ); | |
| 241 | }); | |
| 250 | 242 | |
| 251 | 243 | let coroutine_kind_ty = match expected_kind { |
| 252 | 244 | Some(kind) => Ty::from_coroutine_closure_kind(tcx, kind), |
compiler/rustc_hir_typeck/src/coercion.rs+25-31| ... | ... | @@ -38,7 +38,7 @@ |
| 38 | 38 | use std::ops::Deref; |
| 39 | 39 | |
| 40 | 40 | use rustc_errors::codes::*; |
| 41 | use rustc_errors::{struct_span_code_err, Applicability, Diag}; | |
| 41 | use rustc_errors::{Applicability, Diag, struct_span_code_err}; | |
| 42 | 42 | use rustc_hir as hir; |
| 43 | 43 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| 44 | 44 | use rustc_hir_analysis::hir_ty_lowering::HirTyLowerer; |
| ... | ... | @@ -58,18 +58,18 @@ use rustc_middle::ty::visit::TypeVisitableExt; |
| 58 | 58 | use rustc_middle::ty::{self, GenericArgsRef, Ty, TyCtxt}; |
| 59 | 59 | use rustc_session::parse::feature_err; |
| 60 | 60 | use rustc_span::symbol::sym; |
| 61 | use rustc_span::{BytePos, DesugaringKind, Span, DUMMY_SP}; | |
| 61 | use rustc_span::{BytePos, DUMMY_SP, DesugaringKind, Span}; | |
| 62 | 62 | use rustc_target::spec::abi::Abi; |
| 63 | 63 | use rustc_trait_selection::infer::InferCtxtExt as _; |
| 64 | 64 | use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt; |
| 65 | 65 | use rustc_trait_selection::traits::{ |
| 66 | 66 | self, NormalizeExt, ObligationCause, ObligationCauseCode, ObligationCtxt, |
| 67 | 67 | }; |
| 68 | use smallvec::{smallvec, SmallVec}; | |
| 68 | use smallvec::{SmallVec, smallvec}; | |
| 69 | 69 | use tracing::{debug, instrument}; |
| 70 | 70 | |
| 71 | use crate::errors::SuggestBoxingForReturnImplTrait; | |
| 72 | 71 | use crate::FnCtxt; |
| 72 | use crate::errors::SuggestBoxingForReturnImplTrait; | |
| 73 | 73 | |
| 74 | 74 | struct Coerce<'a, 'tcx> { |
| 75 | 75 | fcx: &'a FnCtxt<'a, 'tcx>, |
| ... | ... | @@ -534,24 +534,18 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> { |
| 534 | 534 | // the reborrow in coerce_borrowed_ptr will pick it up. |
| 535 | 535 | let mutbl = AutoBorrowMutability::new(mutbl_b, AllowTwoPhase::No); |
| 536 | 536 | |
| 537 | Some(( | |
| 538 | Adjustment { kind: Adjust::Deref(None), target: ty_a }, | |
| 539 | Adjustment { | |
| 540 | kind: Adjust::Borrow(AutoBorrow::Ref(r_borrow, mutbl)), | |
| 541 | target: Ty::new_ref(self.tcx, r_borrow, ty_a, mutbl_b), | |
| 542 | }, | |
| 543 | )) | |
| 537 | Some((Adjustment { kind: Adjust::Deref(None), target: ty_a }, Adjustment { | |
| 538 | kind: Adjust::Borrow(AutoBorrow::Ref(r_borrow, mutbl)), | |
| 539 | target: Ty::new_ref(self.tcx, r_borrow, ty_a, mutbl_b), | |
| 540 | })) | |
| 544 | 541 | } |
| 545 | 542 | (&ty::Ref(_, ty_a, mt_a), &ty::RawPtr(_, mt_b)) => { |
| 546 | 543 | coerce_mutbls(mt_a, mt_b)?; |
| 547 | 544 | |
| 548 | Some(( | |
| 549 | Adjustment { kind: Adjust::Deref(None), target: ty_a }, | |
| 550 | Adjustment { | |
| 551 | kind: Adjust::Borrow(AutoBorrow::RawPtr(mt_b)), | |
| 552 | target: Ty::new_ptr(self.tcx, ty_a, mt_b), | |
| 553 | }, | |
| 554 | )) | |
| 545 | Some((Adjustment { kind: Adjust::Deref(None), target: ty_a }, Adjustment { | |
| 546 | kind: Adjust::Borrow(AutoBorrow::RawPtr(mt_b)), | |
| 547 | target: Ty::new_ptr(self.tcx, ty_a, mt_b), | |
| 548 | })) | |
| 555 | 549 | } |
| 556 | 550 | _ => None, |
| 557 | 551 | }; |
| ... | ... | @@ -573,11 +567,11 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> { |
| 573 | 567 | let mut selcx = traits::SelectionContext::new(self); |
| 574 | 568 | |
| 575 | 569 | // Create an obligation for `Source: CoerceUnsized<Target>`. |
| 576 | let cause = ObligationCause::new( | |
| 577 | self.cause.span, | |
| 578 | self.body_id, | |
| 579 | ObligationCauseCode::Coercion { source, target }, | |
| 580 | ); | |
| 570 | let cause = | |
| 571 | ObligationCause::new(self.cause.span, self.body_id, ObligationCauseCode::Coercion { | |
| 572 | source, | |
| 573 | target, | |
| 574 | }); | |
| 581 | 575 | |
| 582 | 576 | // Use a FIFO queue for this custom fulfillment procedure. |
| 583 | 577 | // |
| ... | ... | @@ -1021,10 +1015,10 @@ impl<'f, 'tcx> Coerce<'f, 'tcx> { |
| 1021 | 1015 | // regionck knows that the region for `a` must be valid here. |
| 1022 | 1016 | if is_ref { |
| 1023 | 1017 | self.unify_and(a_unsafe, b, |target| { |
| 1024 | vec![ | |
| 1025 | Adjustment { kind: Adjust::Deref(None), target: mt_a.ty }, | |
| 1026 | Adjustment { kind: Adjust::Borrow(AutoBorrow::RawPtr(mutbl_b)), target }, | |
| 1027 | ] | |
| 1018 | vec![Adjustment { kind: Adjust::Deref(None), target: mt_a.ty }, Adjustment { | |
| 1019 | kind: Adjust::Borrow(AutoBorrow::RawPtr(mutbl_b)), | |
| 1020 | target, | |
| 1021 | }] | |
| 1028 | 1022 | }) |
| 1029 | 1023 | } else if mt_a.mutbl != mutbl_b { |
| 1030 | 1024 | self.unify_and(a_unsafe, b, simple(Adjust::Pointer(PointerCoercion::MutToConstPointer))) |
| ... | ... | @@ -1241,10 +1235,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 1241 | 1235 | _ => span_bug!(new.span, "should not try to coerce a {new_ty} to a fn pointer"), |
| 1242 | 1236 | }; |
| 1243 | 1237 | for expr in exprs.iter().map(|e| e.as_coercion_site()) { |
| 1244 | self.apply_adjustments( | |
| 1245 | expr, | |
| 1246 | vec![Adjustment { kind: prev_adjustment.clone(), target: fn_ptr }], | |
| 1247 | ); | |
| 1238 | self.apply_adjustments(expr, vec![Adjustment { | |
| 1239 | kind: prev_adjustment.clone(), | |
| 1240 | target: fn_ptr, | |
| 1241 | }]); | |
| 1248 | 1242 | } |
| 1249 | 1243 | self.apply_adjustments(new, vec![Adjustment { kind: next_adjustment, target: fn_ptr }]); |
| 1250 | 1244 | return Ok(fn_ptr); |
compiler/rustc_hir_typeck/src/demand.rs+1-1| ... | ... | @@ -10,7 +10,7 @@ use rustc_middle::ty::fold::BottomUpFolder; |
| 10 | 10 | use rustc_middle::ty::print::with_no_trimmed_paths; |
| 11 | 11 | use rustc_middle::ty::{self, AssocItem, Ty, TypeFoldable, TypeVisitableExt}; |
| 12 | 12 | use rustc_span::symbol::sym; |
| 13 | use rustc_span::{Span, DUMMY_SP}; | |
| 13 | use rustc_span::{DUMMY_SP, Span}; | |
| 14 | 14 | use rustc_trait_selection::infer::InferCtxtExt; |
| 15 | 15 | use rustc_trait_selection::traits::ObligationCause; |
| 16 | 16 | use tracing::instrument; |
compiler/rustc_hir_typeck/src/diverges.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use std::{cmp, ops}; |
| 2 | 2 | |
| 3 | use rustc_span::{Span, DUMMY_SP}; | |
| 3 | use rustc_span::{DUMMY_SP, Span}; | |
| 4 | 4 | |
| 5 | 5 | /// Tracks whether executing a node may exit normally (versus |
| 6 | 6 | /// return/break/panic, which "diverge", leaving dead code in their |
compiler/rustc_hir_typeck/src/expr.rs+13-13| ... | ... | @@ -7,7 +7,7 @@ use rustc_data_structures::stack::ensure_sufficient_stack; |
| 7 | 7 | use rustc_data_structures::unord::UnordMap; |
| 8 | 8 | use rustc_errors::codes::*; |
| 9 | 9 | use rustc_errors::{ |
| 10 | pluralize, struct_span_code_err, Applicability, Diag, ErrorGuaranteed, StashKey, Subdiagnostic, | |
| 10 | Applicability, Diag, ErrorGuaranteed, StashKey, Subdiagnostic, pluralize, struct_span_code_err, | |
| 11 | 11 | }; |
| 12 | 12 | use rustc_hir::def::{CtorKind, DefKind, Res}; |
| 13 | 13 | use rustc_hir::def_id::DefId; |
| ... | ... | @@ -17,26 +17,28 @@ use rustc_hir::{ExprKind, HirId, QPath}; |
| 17 | 17 | use rustc_hir_analysis::hir_ty_lowering::HirTyLowerer as _; |
| 18 | 18 | use rustc_infer::infer; |
| 19 | 19 | use rustc_infer::infer::{DefineOpaqueTypes, InferOk}; |
| 20 | use rustc_infer::traits::query::NoSolution; | |
| 21 | 20 | use rustc_infer::traits::ObligationCause; |
| 21 | use rustc_infer::traits::query::NoSolution; | |
| 22 | 22 | use rustc_middle::ty::adjustment::{Adjust, Adjustment, AllowTwoPhase}; |
| 23 | 23 | use rustc_middle::ty::error::{ExpectedFound, TypeError}; |
| 24 | 24 | use rustc_middle::ty::{self, AdtKind, GenericArgsRef, Ty, TypeVisitableExt}; |
| 25 | 25 | use rustc_middle::{bug, span_bug}; |
| 26 | 26 | use rustc_session::errors::ExprParenthesesNeeded; |
| 27 | 27 | use rustc_session::parse::feature_err; |
| 28 | use rustc_span::Span; | |
| 28 | 29 | use rustc_span::edit_distance::find_best_match_for_name; |
| 29 | 30 | use rustc_span::hygiene::DesugaringKind; |
| 30 | 31 | use rustc_span::source_map::Spanned; |
| 31 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 32 | use rustc_span::Span; | |
| 33 | use rustc_target::abi::{FieldIdx, FIRST_VARIANT}; | |
| 32 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 33 | use rustc_target::abi::{FIRST_VARIANT, FieldIdx}; | |
| 34 | 34 | use rustc_trait_selection::infer::InferCtxtExt; |
| 35 | 35 | use rustc_trait_selection::traits::{self, ObligationCauseCode, ObligationCtxt}; |
| 36 | 36 | use smallvec::SmallVec; |
| 37 | 37 | use tracing::{debug, instrument, trace}; |
| 38 | 38 | use {rustc_ast as ast, rustc_hir as hir}; |
| 39 | 39 | |
| 40 | use crate::Expectation::{self, ExpectCastableToType, ExpectHasType, NoExpectation}; | |
| 41 | use crate::TupleArgumentsFlag::DontTupleArguments; | |
| 40 | 42 | use crate::coercion::{CoerceMany, DynamicCoerceMany}; |
| 41 | 43 | use crate::errors::{ |
| 42 | 44 | AddressOfTemporaryTaken, FieldMultiplySpecifiedInInitializer, |
| ... | ... | @@ -44,11 +46,9 @@ use crate::errors::{ |
| 44 | 46 | ReturnStmtOutsideOfFnBody, StructExprNonExhaustive, TypeMismatchFruTypo, |
| 45 | 47 | YieldExprOutsideOfCoroutine, |
| 46 | 48 | }; |
| 47 | use crate::Expectation::{self, ExpectCastableToType, ExpectHasType, NoExpectation}; | |
| 48 | use crate::TupleArgumentsFlag::DontTupleArguments; | |
| 49 | 49 | use crate::{ |
| 50 | cast, fatally_break_rust, report_unexpected_variant_res, type_error_struct, BreakableCtxt, | |
| 51 | CoroutineTypes, Diverges, FnCtxt, Needs, | |
| 50 | BreakableCtxt, CoroutineTypes, Diverges, FnCtxt, Needs, cast, fatally_break_rust, | |
| 51 | report_unexpected_variant_res, type_error_struct, | |
| 52 | 52 | }; |
| 53 | 53 | |
| 54 | 54 | impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| ... | ... | @@ -72,10 +72,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | let adj_ty = self.next_ty_var(expr.span); |
| 75 | self.apply_adjustments( | |
| 76 | expr, | |
| 77 | vec![Adjustment { kind: Adjust::NeverToAny, target: adj_ty }], | |
| 78 | ); | |
| 75 | self.apply_adjustments(expr, vec![Adjustment { | |
| 76 | kind: Adjust::NeverToAny, | |
| 77 | target: adj_ty, | |
| 78 | }]); | |
| 79 | 79 | ty = adj_ty; |
| 80 | 80 | } |
| 81 | 81 |
compiler/rustc_hir_typeck/src/expr_use_visitor.rs+7-5| ... | ... | @@ -6,9 +6,9 @@ use std::cell::{Ref, RefCell}; |
| 6 | 6 | use std::ops::Deref; |
| 7 | 7 | use std::slice::from_ref; |
| 8 | 8 | |
| 9 | use hir::Expr; | |
| 9 | 10 | use hir::def::DefKind; |
| 10 | 11 | use hir::pat_util::EnumerateAndAdjustIterator as _; |
| 11 | use hir::Expr; | |
| 12 | 12 | use rustc_data_structures::fx::FxIndexMap; |
| 13 | 13 | use rustc_hir as hir; |
| 14 | 14 | use rustc_hir::def::{CtorOf, Res}; |
| ... | ... | @@ -20,11 +20,11 @@ use rustc_middle::hir::place::ProjectionKind; |
| 20 | 20 | pub use rustc_middle::hir::place::{Place, PlaceBase, PlaceWithHirId, Projection}; |
| 21 | 21 | use rustc_middle::mir::FakeReadCause; |
| 22 | 22 | use rustc_middle::ty::{ |
| 23 | self, adjustment, AdtKind, Ty, TyCtxt, TypeFoldable, TypeVisitableExt as _, | |
| 23 | self, AdtKind, Ty, TyCtxt, TypeFoldable, TypeVisitableExt as _, adjustment, | |
| 24 | 24 | }; |
| 25 | 25 | use rustc_middle::{bug, span_bug}; |
| 26 | 26 | use rustc_span::{ErrorGuaranteed, Span}; |
| 27 | use rustc_target::abi::{FieldIdx, VariantIdx, FIRST_VARIANT}; | |
| 27 | use rustc_target::abi::{FIRST_VARIANT, FieldIdx, VariantIdx}; | |
| 28 | 28 | use rustc_trait_selection::infer::InferCtxtExt; |
| 29 | 29 | use tracing::{debug, trace}; |
| 30 | 30 | use ty::BorrowKind::ImmBorrow; |
| ... | ... | @@ -151,7 +151,8 @@ pub trait TypeInformationCtxt<'tcx> { |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | impl<'tcx> TypeInformationCtxt<'tcx> for &FnCtxt<'_, 'tcx> { |
| 154 | type TypeckResults<'a> = Ref<'a, ty::TypeckResults<'tcx>> | |
| 154 | type TypeckResults<'a> | |
| 155 | = Ref<'a, ty::TypeckResults<'tcx>> | |
| 155 | 156 | where |
| 156 | 157 | Self: 'a; |
| 157 | 158 | |
| ... | ... | @@ -195,7 +196,8 @@ impl<'tcx> TypeInformationCtxt<'tcx> for &FnCtxt<'_, 'tcx> { |
| 195 | 196 | } |
| 196 | 197 | |
| 197 | 198 | impl<'tcx> TypeInformationCtxt<'tcx> for (&LateContext<'tcx>, LocalDefId) { |
| 198 | type TypeckResults<'a> = &'tcx ty::TypeckResults<'tcx> | |
| 199 | type TypeckResults<'a> | |
| 200 | = &'tcx ty::TypeckResults<'tcx> | |
| 199 | 201 | where |
| 200 | 202 | Self: 'a; |
| 201 | 203 |
compiler/rustc_hir_typeck/src/fallback.rs+3-3| ... | ... | @@ -5,18 +5,18 @@ use rustc_data_structures::graph::vec_graph::VecGraph; |
| 5 | 5 | use rustc_data_structures::graph::{self}; |
| 6 | 6 | use rustc_data_structures::unord::{UnordBag, UnordMap, UnordSet}; |
| 7 | 7 | use rustc_hir as hir; |
| 8 | use rustc_hir::intravisit::Visitor; | |
| 9 | 8 | use rustc_hir::HirId; |
| 9 | use rustc_hir::intravisit::Visitor; | |
| 10 | 10 | use rustc_infer::infer::{DefineOpaqueTypes, InferOk}; |
| 11 | 11 | use rustc_middle::bug; |
| 12 | 12 | use rustc_middle::ty::{self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable}; |
| 13 | 13 | use rustc_session::lint; |
| 14 | 14 | use rustc_span::def_id::LocalDefId; |
| 15 | use rustc_span::{Span, DUMMY_SP}; | |
| 15 | use rustc_span::{DUMMY_SP, Span}; | |
| 16 | 16 | use rustc_trait_selection::traits::{ObligationCause, ObligationCtxt}; |
| 17 | 17 | use tracing::debug; |
| 18 | 18 | |
| 19 | use crate::{errors, FnCtxt, TypeckRootCtxt}; | |
| 19 | use crate::{FnCtxt, TypeckRootCtxt, errors}; | |
| 20 | 20 | |
| 21 | 21 | #[derive(Copy, Clone)] |
| 22 | 22 | pub(crate) enum DivergingFallbackBehavior { |
compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs+16-23| ... | ... | @@ -28,10 +28,10 @@ use rustc_middle::ty::{ |
| 28 | 28 | }; |
| 29 | 29 | use rustc_middle::{bug, span_bug}; |
| 30 | 30 | use rustc_session::lint; |
| 31 | use rustc_span::Span; | |
| 31 | 32 | use rustc_span::def_id::LocalDefId; |
| 32 | 33 | use rustc_span::hygiene::DesugaringKind; |
| 33 | 34 | use rustc_span::symbol::kw; |
| 34 | use rustc_span::Span; | |
| 35 | 35 | use rustc_target::abi::FieldIdx; |
| 36 | 36 | use rustc_trait_selection::error_reporting::infer::need_type_info::TypeAnnotationNeeded; |
| 37 | 37 | use rustc_trait_selection::traits::{ |
| ... | ... | @@ -42,7 +42,7 @@ use tracing::{debug, instrument}; |
| 42 | 42 | use crate::callee::{self, DeferredCallResolution}; |
| 43 | 43 | use crate::errors::{self, CtorIsPrivate}; |
| 44 | 44 | use crate::method::{self, MethodCallee}; |
| 45 | use crate::{rvalue_scopes, BreakableCtxt, Diverges, Expectation, FnCtxt, LoweredTy}; | |
| 45 | use crate::{BreakableCtxt, Diverges, Expectation, FnCtxt, LoweredTy, rvalue_scopes}; | |
| 46 | 46 | |
| 47 | 47 | impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 48 | 48 | /// Produces warning on the given node, if the current point in the |
| ... | ... | @@ -224,10 +224,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 224 | 224 | debug!("fcx {}", self.tag()); |
| 225 | 225 | |
| 226 | 226 | if Self::can_contain_user_lifetime_bounds((args, user_self_ty)) { |
| 227 | let canonicalized = self.canonicalize_user_type_annotation(UserType::TypeOf( | |
| 228 | def_id, | |
| 229 | UserArgs { args, user_self_ty }, | |
| 230 | )); | |
| 227 | let canonicalized = | |
| 228 | self.canonicalize_user_type_annotation(UserType::TypeOf(def_id, UserArgs { | |
| 229 | args, | |
| 230 | user_self_ty, | |
| 231 | })); | |
| 231 | 232 | debug!(?canonicalized); |
| 232 | 233 | self.write_user_type_annotation(hir_id, canonicalized); |
| 233 | 234 | } |
| ... | ... | @@ -270,13 +271,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 270 | 271 | } |
| 271 | 272 | |
| 272 | 273 | let autoborrow_mut = adj.iter().any(|adj| { |
| 273 | matches!( | |
| 274 | adj, | |
| 275 | &Adjustment { | |
| 276 | kind: Adjust::Borrow(AutoBorrow::Ref(_, AutoBorrowMutability::Mut { .. })), | |
| 277 | .. | |
| 278 | } | |
| 279 | ) | |
| 274 | matches!(adj, &Adjustment { | |
| 275 | kind: Adjust::Borrow(AutoBorrow::Ref(_, AutoBorrowMutability::Mut { .. })), | |
| 276 | .. | |
| 277 | }) | |
| 280 | 278 | }); |
| 281 | 279 | |
| 282 | 280 | match self.typeck_results.borrow_mut().adjustments_mut().entry(expr.hir_id) { |
| ... | ... | @@ -968,16 +966,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 968 | 966 | let mut sp = MultiSpan::from_span(path_segment.ident.span); |
| 969 | 967 | sp.push_span_label( |
| 970 | 968 | path_segment.ident.span, |
| 971 | format!( | |
| 972 | "this call modifies {} in-place", | |
| 973 | match rcvr.kind { | |
| 974 | ExprKind::Path(QPath::Resolved( | |
| 975 | None, | |
| 976 | hir::Path { segments: [segment], .. }, | |
| 977 | )) => format!("`{}`", segment.ident), | |
| 978 | _ => "its receiver".to_string(), | |
| 979 | } | |
| 980 | ), | |
| 969 | format!("this call modifies {} in-place", match rcvr.kind { | |
| 970 | ExprKind::Path(QPath::Resolved(None, hir::Path { segments: [segment], .. })) => | |
| 971 | format!("`{}`", segment.ident), | |
| 972 | _ => "its receiver".to_string(), | |
| 973 | }), | |
| 981 | 974 | ); |
| 982 | 975 | |
| 983 | 976 | let modifies_rcvr_note = |
compiler/rustc_hir_typeck/src/fn_ctxt/adjust_fulfillment_errors.rs+1-1| ... | ... | @@ -5,8 +5,8 @@ use rustc_hir::def::{DefKind, Res}; |
| 5 | 5 | use rustc_hir::def_id::DefId; |
| 6 | 6 | use rustc_infer::traits::ObligationCauseCode; |
| 7 | 7 | use rustc_middle::ty::{self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitor}; |
| 8 | use rustc_span::symbol::kw; | |
| 9 | 8 | use rustc_span::Span; |
| 9 | use rustc_span::symbol::kw; | |
| 10 | 10 | use rustc_trait_selection::traits; |
| 11 | 11 | |
| 12 | 12 | use crate::FnCtxt; |
compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs+9-9| ... | ... | @@ -4,8 +4,8 @@ use itertools::Itertools; |
| 4 | 4 | use rustc_data_structures::fx::FxIndexSet; |
| 5 | 5 | use rustc_errors::codes::*; |
| 6 | 6 | use rustc_errors::{ |
| 7 | a_or_an, display_list_with_comma_and, pluralize, Applicability, Diag, ErrorGuaranteed, | |
| 8 | MultiSpan, StashKey, | |
| 7 | Applicability, Diag, ErrorGuaranteed, MultiSpan, StashKey, a_or_an, | |
| 8 | display_list_with_comma_and, pluralize, | |
| 9 | 9 | }; |
| 10 | 10 | use rustc_hir::def::{CtorOf, DefKind, Res}; |
| 11 | 11 | use rustc_hir::def_id::DefId; |
| ... | ... | @@ -22,28 +22,28 @@ use rustc_middle::ty::visit::TypeVisitableExt; |
| 22 | 22 | use rustc_middle::ty::{self, IsSuggestable, Ty, TyCtxt}; |
| 23 | 23 | use rustc_middle::{bug, span_bug}; |
| 24 | 24 | use rustc_session::Session; |
| 25 | use rustc_span::symbol::{kw, Ident}; | |
| 26 | use rustc_span::{sym, Span, DUMMY_SP}; | |
| 25 | use rustc_span::symbol::{Ident, kw}; | |
| 26 | use rustc_span::{DUMMY_SP, Span, sym}; | |
| 27 | 27 | use rustc_trait_selection::error_reporting::infer::{FailureCode, ObligationCauseExt}; |
| 28 | 28 | use rustc_trait_selection::infer::InferCtxtExt; |
| 29 | 29 | use rustc_trait_selection::traits::{self, ObligationCauseCode, ObligationCtxt, SelectionContext}; |
| 30 | 30 | use tracing::debug; |
| 31 | 31 | use {rustc_ast as ast, rustc_hir as hir}; |
| 32 | 32 | |
| 33 | use crate::Expectation::*; | |
| 34 | use crate::TupleArgumentsFlag::*; | |
| 33 | 35 | use crate::coercion::CoerceMany; |
| 34 | 36 | use crate::errors::SuggestPtrNullMut; |
| 35 | 37 | use crate::fn_ctxt::arg_matrix::{ArgMatrix, Compatibility, Error, ExpectedIdx, ProvidedIdx}; |
| 36 | 38 | use crate::fn_ctxt::infer::FnCall; |
| 37 | 39 | use crate::gather_locals::Declaration; |
| 40 | use crate::method::MethodCallee; | |
| 38 | 41 | use crate::method::probe::IsSuggestion; |
| 39 | 42 | use crate::method::probe::Mode::MethodCall; |
| 40 | 43 | use crate::method::probe::ProbeScope::TraitsInScope; |
| 41 | use crate::method::MethodCallee; | |
| 42 | use crate::Expectation::*; | |
| 43 | use crate::TupleArgumentsFlag::*; | |
| 44 | 44 | use crate::{ |
| 45 | errors, struct_span_code_err, BreakableCtxt, Diverges, Expectation, FnCtxt, LoweredTy, Needs, | |
| 46 | TupleArgumentsFlag, | |
| 45 | BreakableCtxt, Diverges, Expectation, FnCtxt, LoweredTy, Needs, TupleArgumentsFlag, errors, | |
| 46 | struct_span_code_err, | |
| 47 | 47 | }; |
| 48 | 48 | |
| 49 | 49 | #[derive(Clone, Copy, Default)] |
compiler/rustc_hir_typeck/src/fn_ctxt/mod.rs+2-2| ... | ... | @@ -17,9 +17,9 @@ use rustc_infer::infer; |
| 17 | 17 | use rustc_middle::ty::{self, Const, Ty, TyCtxt, TypeVisitableExt}; |
| 18 | 18 | use rustc_session::Session; |
| 19 | 19 | use rustc_span::symbol::Ident; |
| 20 | use rustc_span::{self, sym, Span, DUMMY_SP}; | |
| 21 | use rustc_trait_selection::error_reporting::infer::sub_relations::SubRelations; | |
| 20 | use rustc_span::{self, DUMMY_SP, Span, sym}; | |
| 22 | 21 | use rustc_trait_selection::error_reporting::TypeErrCtxt; |
| 22 | use rustc_trait_selection::error_reporting::infer::sub_relations::SubRelations; | |
| 23 | 23 | use rustc_trait_selection::traits::{ObligationCause, ObligationCauseCode, ObligationCtxt}; |
| 24 | 24 | |
| 25 | 25 | use crate::coercion::DynamicCoerceMany; |
compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs+12-12| ... | ... | @@ -19,15 +19,15 @@ use rustc_middle::middle::stability::EvalResult; |
| 19 | 19 | use rustc_middle::span_bug; |
| 20 | 20 | use rustc_middle::ty::print::with_no_trimmed_paths; |
| 21 | 21 | use rustc_middle::ty::{ |
| 22 | self, suggest_constraining_type_params, Article, Binder, IsSuggestable, Ty, TyCtxt, | |
| 23 | TypeVisitableExt, Upcast, | |
| 22 | self, Article, Binder, IsSuggestable, Ty, TyCtxt, TypeVisitableExt, Upcast, | |
| 23 | suggest_constraining_type_params, | |
| 24 | 24 | }; |
| 25 | 25 | use rustc_session::errors::ExprParenthesesNeeded; |
| 26 | 26 | use rustc_span::source_map::Spanned; |
| 27 | use rustc_span::symbol::{sym, Ident}; | |
| 27 | use rustc_span::symbol::{Ident, sym}; | |
| 28 | 28 | use rustc_span::{Span, Symbol}; |
| 29 | use rustc_trait_selection::error_reporting::traits::DefIdOrName; | |
| 30 | 29 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; |
| 30 | use rustc_trait_selection::error_reporting::traits::DefIdOrName; | |
| 31 | 31 | use rustc_trait_selection::infer::InferCtxtExt; |
| 32 | 32 | use rustc_trait_selection::traits; |
| 33 | 33 | use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt as _; |
| ... | ... | @@ -2001,17 +2001,17 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 2001 | 2001 | expr.kind, |
| 2002 | 2002 | hir::ExprKind::Call( |
| 2003 | 2003 | hir::Expr { |
| 2004 | kind: hir::ExprKind::Path(hir::QPath::Resolved( | |
| 2005 | None, | |
| 2006 | hir::Path { res: Res::Def(hir::def::DefKind::Ctor(_, _), _), .. }, | |
| 2007 | )), | |
| 2004 | kind: hir::ExprKind::Path(hir::QPath::Resolved(None, hir::Path { | |
| 2005 | res: Res::Def(hir::def::DefKind::Ctor(_, _), _), | |
| 2006 | .. | |
| 2007 | },)), | |
| 2008 | 2008 | .. |
| 2009 | 2009 | }, |
| 2010 | 2010 | .., |
| 2011 | ) | hir::ExprKind::Path(hir::QPath::Resolved( | |
| 2012 | None, | |
| 2013 | hir::Path { res: Res::Def(hir::def::DefKind::Ctor(_, _), _), .. }, | |
| 2014 | )), | |
| 2011 | ) | hir::ExprKind::Path(hir::QPath::Resolved(None, hir::Path { | |
| 2012 | res: Res::Def(hir::def::DefKind::Ctor(_, _), _), | |
| 2013 | .. | |
| 2014 | },)), | |
| 2015 | 2015 | ); |
| 2016 | 2016 | |
| 2017 | 2017 | let (article, kind, variant, sugg_operator) = |
compiler/rustc_hir_typeck/src/gather_locals.rs+1-1| ... | ... | @@ -3,8 +3,8 @@ use rustc_hir::intravisit::{self, Visitor}; |
| 3 | 3 | use rustc_hir::{HirId, PatKind}; |
| 4 | 4 | use rustc_infer::traits::ObligationCauseCode; |
| 5 | 5 | use rustc_middle::ty::{Ty, UserType}; |
| 6 | use rustc_span::def_id::LocalDefId; | |
| 7 | 6 | use rustc_span::Span; |
| 7 | use rustc_span::def_id::LocalDefId; | |
| 8 | 8 | use tracing::debug; |
| 9 | 9 | |
| 10 | 10 | use crate::FnCtxt; |
compiler/rustc_hir_typeck/src/lib.rs+2-2| ... | ... | @@ -43,7 +43,7 @@ pub use coercion::can_coerce; |
| 43 | 43 | use fn_ctxt::FnCtxt; |
| 44 | 44 | use rustc_data_structures::unord::UnordSet; |
| 45 | 45 | use rustc_errors::codes::*; |
| 46 | use rustc_errors::{pluralize, struct_span_code_err, Applicability, ErrorGuaranteed}; | |
| 46 | use rustc_errors::{Applicability, ErrorGuaranteed, pluralize, struct_span_code_err}; | |
| 47 | 47 | use rustc_hir as hir; |
| 48 | 48 | use rustc_hir::def::{DefKind, Res}; |
| 49 | 49 | use rustc_hir::intravisit::Visitor; |
| ... | ... | @@ -55,8 +55,8 @@ use rustc_middle::query::Providers; |
| 55 | 55 | use rustc_middle::ty::{self, Ty, TyCtxt}; |
| 56 | 56 | use rustc_middle::{bug, span_bug}; |
| 57 | 57 | use rustc_session::config; |
| 58 | use rustc_span::def_id::LocalDefId; | |
| 59 | 58 | use rustc_span::Span; |
| 59 | use rustc_span::def_id::LocalDefId; | |
| 60 | 60 | use tracing::{debug, instrument}; |
| 61 | 61 | use typeck_root_ctxt::TypeckRootCtxt; |
| 62 | 62 |
compiler/rustc_hir_typeck/src/method/confirm.rs+4-4| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use std::ops::Deref; |
| 2 | 2 | |
| 3 | 3 | use rustc_hir as hir; |
| 4 | use rustc_hir::def_id::DefId; | |
| 5 | 4 | use rustc_hir::GenericArg; |
| 5 | use rustc_hir::def_id::DefId; | |
| 6 | 6 | use rustc_hir_analysis::hir_ty_lowering::generics::{ |
| 7 | 7 | check_generic_arg_count_for_call, lower_generic_args, |
| 8 | 8 | }; |
| ... | ... | @@ -20,12 +20,12 @@ use rustc_middle::ty::{ |
| 20 | 20 | UserType, |
| 21 | 21 | }; |
| 22 | 22 | use rustc_middle::{bug, span_bug}; |
| 23 | use rustc_span::{Span, DUMMY_SP}; | |
| 23 | use rustc_span::{DUMMY_SP, Span}; | |
| 24 | 24 | use rustc_trait_selection::traits; |
| 25 | 25 | use tracing::debug; |
| 26 | 26 | |
| 27 | use super::{probe, MethodCallee}; | |
| 28 | use crate::{callee, FnCtxt}; | |
| 27 | use super::{MethodCallee, probe}; | |
| 28 | use crate::{FnCtxt, callee}; | |
| 29 | 29 | |
| 30 | 30 | struct ConfirmContext<'a, 'tcx> { |
| 31 | 31 | fcx: &'a FnCtxt<'a, 'tcx>, |
compiler/rustc_hir_typeck/src/method/mod.rs+2-2| ... | ... | @@ -18,14 +18,14 @@ use rustc_middle::ty::{ |
| 18 | 18 | self, GenericArgs, GenericArgsRef, GenericParamDefKind, Ty, TypeVisitableExt, |
| 19 | 19 | }; |
| 20 | 20 | use rustc_middle::{bug, span_bug}; |
| 21 | use rustc_span::symbol::Ident; | |
| 22 | 21 | use rustc_span::Span; |
| 22 | use rustc_span::symbol::Ident; | |
| 23 | 23 | use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt; |
| 24 | 24 | use rustc_trait_selection::traits::{self, NormalizeExt}; |
| 25 | 25 | use tracing::{debug, instrument}; |
| 26 | 26 | |
| 27 | use self::probe::{IsSuggestion, ProbeScope}; | |
| 28 | 27 | pub(crate) use self::MethodError::*; |
| 28 | use self::probe::{IsSuggestion, ProbeScope}; | |
| 29 | 29 | use crate::FnCtxt; |
| 30 | 30 | |
| 31 | 31 | pub(crate) fn provide(providers: &mut Providers) { |
compiler/rustc_hir_typeck/src/method/prelude_edition_lints.rs+3-3| ... | ... | @@ -8,14 +8,14 @@ use rustc_lint::{ARRAY_INTO_ITER, BOXED_SLICE_INTO_ITER}; |
| 8 | 8 | use rustc_middle::span_bug; |
| 9 | 9 | use rustc_middle::ty::{self, Ty}; |
| 10 | 10 | use rustc_session::lint::builtin::{RUST_2021_PRELUDE_COLLISIONS, RUST_2024_PRELUDE_COLLISIONS}; |
| 11 | use rustc_span::symbol::kw::{Empty, Underscore}; | |
| 12 | use rustc_span::symbol::{sym, Ident}; | |
| 13 | 11 | use rustc_span::Span; |
| 12 | use rustc_span::symbol::kw::{Empty, Underscore}; | |
| 13 | use rustc_span::symbol::{Ident, sym}; | |
| 14 | 14 | use rustc_trait_selection::infer::InferCtxtExt; |
| 15 | 15 | use tracing::debug; |
| 16 | 16 | |
| 17 | use crate::method::probe::{self, Pick}; | |
| 18 | 17 | use crate::FnCtxt; |
| 18 | use crate::method::probe::{self, Pick}; | |
| 19 | 19 | |
| 20 | 20 | impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 21 | 21 | pub(super) fn lint_edition_dependent_dot_call( |
compiler/rustc_hir_typeck/src/method/probe.rs+7-7| ... | ... | @@ -6,15 +6,15 @@ use std::ops::Deref; |
| 6 | 6 | use rustc_data_structures::fx::FxHashSet; |
| 7 | 7 | use rustc_errors::Applicability; |
| 8 | 8 | use rustc_hir as hir; |
| 9 | use rustc_hir::def::DefKind; | |
| 10 | 9 | use rustc_hir::HirId; |
| 10 | use rustc_hir::def::DefKind; | |
| 11 | 11 | use rustc_hir_analysis::autoderef::{self, Autoderef}; |
| 12 | 12 | use rustc_infer::infer::canonical::{Canonical, OriginalQueryValues, QueryResponse}; |
| 13 | 13 | use rustc_infer::infer::{self, DefineOpaqueTypes, InferOk, TyCtxtInferExt}; |
| 14 | 14 | use rustc_infer::traits::ObligationCauseCode; |
| 15 | 15 | use rustc_middle::middle::stability; |
| 16 | 16 | use rustc_middle::query::Providers; |
| 17 | use rustc_middle::ty::fast_reject::{simplify_type, TreatParams}; | |
| 17 | use rustc_middle::ty::fast_reject::{TreatParams, simplify_type}; | |
| 18 | 18 | use rustc_middle::ty::{ |
| 19 | 19 | self, AssocItem, AssocItemContainer, GenericArgs, GenericArgsRef, GenericParamDefKind, |
| 20 | 20 | ParamEnvAnd, Ty, TyCtxt, TypeVisitableExt, Upcast, |
| ... | ... | @@ -25,22 +25,22 @@ use rustc_span::def_id::{DefId, LocalDefId}; |
| 25 | 25 | use rustc_span::edit_distance::{ |
| 26 | 26 | edit_distance_with_substrings, find_best_match_for_name_with_substrings, |
| 27 | 27 | }; |
| 28 | use rustc_span::symbol::{sym, Ident}; | |
| 29 | use rustc_span::{Span, Symbol, DUMMY_SP}; | |
| 28 | use rustc_span::symbol::{Ident, sym}; | |
| 29 | use rustc_span::{DUMMY_SP, Span, Symbol}; | |
| 30 | 30 | use rustc_trait_selection::error_reporting::infer::need_type_info::TypeAnnotationNeeded; |
| 31 | 31 | use rustc_trait_selection::infer::InferCtxtExt as _; |
| 32 | use rustc_trait_selection::traits::query::CanonicalTyGoal; | |
| 32 | 33 | use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt; |
| 33 | 34 | use rustc_trait_selection::traits::query::method_autoderef::{ |
| 34 | 35 | CandidateStep, MethodAutoderefBadTy, MethodAutoderefStepsResult, |
| 35 | 36 | }; |
| 36 | use rustc_trait_selection::traits::query::CanonicalTyGoal; | |
| 37 | 37 | use rustc_trait_selection::traits::{self, ObligationCause, ObligationCtxt}; |
| 38 | use smallvec::{smallvec, SmallVec}; | |
| 38 | use smallvec::{SmallVec, smallvec}; | |
| 39 | 39 | use tracing::{debug, instrument}; |
| 40 | 40 | |
| 41 | 41 | use self::CandidateKind::*; |
| 42 | 42 | pub(crate) use self::PickKind::*; |
| 43 | use super::{suggest, CandidateSource, MethodError, NoMatchData}; | |
| 43 | use super::{CandidateSource, MethodError, NoMatchData, suggest}; | |
| 44 | 44 | use crate::FnCtxt; |
| 45 | 45 | |
| 46 | 46 | /// Boolean flag used to indicate if this search is for a suggestion |
compiler/rustc_hir_typeck/src/method/suggest.rs+6-6| ... | ... | @@ -13,7 +13,7 @@ use rustc_data_structures::fx::{FxIndexMap, FxIndexSet}; |
| 13 | 13 | use rustc_data_structures::sorted_map::SortedMap; |
| 14 | 14 | use rustc_data_structures::unord::UnordSet; |
| 15 | 15 | use rustc_errors::codes::*; |
| 16 | use rustc_errors::{pluralize, struct_span_code_err, Applicability, Diag, MultiSpan, StashKey}; | |
| 16 | use rustc_errors::{Applicability, Diag, MultiSpan, StashKey, pluralize, struct_span_code_err}; | |
| 17 | 17 | use rustc_hir::def::DefKind; |
| 18 | 18 | use rustc_hir::def_id::DefId; |
| 19 | 19 | use rustc_hir::intravisit::{self, Visitor}; |
| ... | ... | @@ -21,21 +21,21 @@ use rustc_hir::lang_items::LangItem; |
| 21 | 21 | use rustc_hir::{self as hir, ExprKind, HirId, Node, PathSegment, QPath}; |
| 22 | 22 | use rustc_infer::infer::{self, RegionVariableOrigin}; |
| 23 | 23 | use rustc_middle::bug; |
| 24 | use rustc_middle::ty::fast_reject::{simplify_type, DeepRejectCtxt, TreatParams}; | |
| 24 | use rustc_middle::ty::fast_reject::{DeepRejectCtxt, TreatParams, simplify_type}; | |
| 25 | 25 | use rustc_middle::ty::print::{ |
| 26 | with_crate_prefix, with_forced_trimmed_paths, PrintTraitRefExt as _, | |
| 26 | PrintTraitRefExt as _, with_crate_prefix, with_forced_trimmed_paths, | |
| 27 | 27 | }; |
| 28 | 28 | use rustc_middle::ty::{self, GenericArgKind, IsSuggestable, Ty, TyCtxt, TypeVisitableExt}; |
| 29 | 29 | use rustc_span::def_id::DefIdSet; |
| 30 | use rustc_span::symbol::{kw, sym, Ident}; | |
| 30 | use rustc_span::symbol::{Ident, kw, sym}; | |
| 31 | 31 | use rustc_span::{ |
| 32 | edit_distance, ErrorGuaranteed, ExpnKind, FileName, MacroKind, Span, Symbol, DUMMY_SP, | |
| 32 | DUMMY_SP, ErrorGuaranteed, ExpnKind, FileName, MacroKind, Span, Symbol, edit_distance, | |
| 33 | 33 | }; |
| 34 | 34 | use rustc_trait_selection::error_reporting::traits::on_unimplemented::OnUnimplementedNote; |
| 35 | 35 | use rustc_trait_selection::infer::InferCtxtExt; |
| 36 | 36 | use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt as _; |
| 37 | 37 | use rustc_trait_selection::traits::{ |
| 38 | supertraits, FulfillmentError, Obligation, ObligationCause, ObligationCauseCode, | |
| 38 | FulfillmentError, Obligation, ObligationCause, ObligationCauseCode, supertraits, | |
| 39 | 39 | }; |
| 40 | 40 | use tracing::{debug, info, instrument}; |
| 41 | 41 |
compiler/rustc_hir_typeck/src/op.rs+11-15| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | use rustc_data_structures::packed::Pu128; |
| 4 | 4 | use rustc_errors::codes::*; |
| 5 | use rustc_errors::{struct_span_code_err, Applicability, Diag}; | |
| 5 | use rustc_errors::{Applicability, Diag, struct_span_code_err}; | |
| 6 | 6 | use rustc_infer::traits::ObligationCauseCode; |
| 7 | 7 | use rustc_middle::ty::adjustment::{ |
| 8 | 8 | Adjust, Adjustment, AllowTwoPhase, AutoBorrow, AutoBorrowMutability, |
| ... | ... | @@ -11,17 +11,17 @@ use rustc_middle::ty::print::with_no_trimmed_paths; |
| 11 | 11 | use rustc_middle::ty::{self, IsSuggestable, Ty, TyCtxt, TypeVisitableExt}; |
| 12 | 12 | use rustc_middle::{bug, span_bug}; |
| 13 | 13 | use rustc_session::errors::ExprParenthesesNeeded; |
| 14 | use rustc_span::source_map::Spanned; | |
| 15 | use rustc_span::symbol::{sym, Ident}; | |
| 16 | 14 | use rustc_span::Span; |
| 15 | use rustc_span::source_map::Spanned; | |
| 16 | use rustc_span::symbol::{Ident, sym}; | |
| 17 | 17 | use rustc_trait_selection::infer::InferCtxtExt; |
| 18 | 18 | use rustc_trait_selection::traits::{FulfillmentError, ObligationCtxt}; |
| 19 | 19 | use rustc_type_ir::TyKind::*; |
| 20 | 20 | use tracing::debug; |
| 21 | 21 | use {rustc_ast as ast, rustc_hir as hir}; |
| 22 | 22 | |
| 23 | use super::method::MethodCallee; | |
| 24 | 23 | use super::FnCtxt; |
| 24 | use super::method::MethodCallee; | |
| 25 | 25 | use crate::Expectation; |
| 26 | 26 | |
| 27 | 27 | impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| ... | ... | @@ -896,17 +896,13 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 896 | 896 | let opname = Ident::with_dummy_span(opname); |
| 897 | 897 | let (opt_rhs_expr, opt_rhs_ty) = opt_rhs.unzip(); |
| 898 | 898 | let input_types = opt_rhs_ty.as_slice(); |
| 899 | let cause = self.cause( | |
| 900 | span, | |
| 901 | ObligationCauseCode::BinOp { | |
| 902 | lhs_hir_id: lhs_expr.hir_id, | |
| 903 | rhs_hir_id: opt_rhs_expr.map(|expr| expr.hir_id), | |
| 904 | rhs_span: opt_rhs_expr.map(|expr| expr.span), | |
| 905 | rhs_is_lit: opt_rhs_expr | |
| 906 | .is_some_and(|expr| matches!(expr.kind, hir::ExprKind::Lit(_))), | |
| 907 | output_ty: expected.only_has_type(self), | |
| 908 | }, | |
| 909 | ); | |
| 899 | let cause = self.cause(span, ObligationCauseCode::BinOp { | |
| 900 | lhs_hir_id: lhs_expr.hir_id, | |
| 901 | rhs_hir_id: opt_rhs_expr.map(|expr| expr.hir_id), | |
| 902 | rhs_span: opt_rhs_expr.map(|expr| expr.span), | |
| 903 | rhs_is_lit: opt_rhs_expr.is_some_and(|expr| matches!(expr.kind, hir::ExprKind::Lit(_))), | |
| 904 | output_ty: expected.only_has_type(self), | |
| 905 | }); | |
| 910 | 906 | |
| 911 | 907 | let method = self.lookup_method_in_trait( |
| 912 | 908 | cause.clone(), |
compiler/rustc_hir_typeck/src/pat.rs+4-4| ... | ... | @@ -5,7 +5,7 @@ use rustc_ast as ast; |
| 5 | 5 | use rustc_data_structures::fx::FxHashMap; |
| 6 | 6 | use rustc_errors::codes::*; |
| 7 | 7 | use rustc_errors::{ |
| 8 | pluralize, struct_span_code_err, Applicability, Diag, ErrorGuaranteed, MultiSpan, | |
| 8 | Applicability, Diag, ErrorGuaranteed, MultiSpan, pluralize, struct_span_code_err, | |
| 9 | 9 | }; |
| 10 | 10 | use rustc_hir::def::{CtorKind, DefKind, Res}; |
| 11 | 11 | use rustc_hir::pat_util::EnumerateAndAdjustIterator; |
| ... | ... | @@ -18,8 +18,8 @@ use rustc_session::parse::feature_err; |
| 18 | 18 | use rustc_span::edit_distance::find_best_match_for_name; |
| 19 | 19 | use rustc_span::hygiene::DesugaringKind; |
| 20 | 20 | use rustc_span::source_map::Spanned; |
| 21 | use rustc_span::symbol::{kw, sym, Ident}; | |
| 22 | use rustc_span::{BytePos, Span, DUMMY_SP}; | |
| 21 | use rustc_span::symbol::{Ident, kw, sym}; | |
| 22 | use rustc_span::{BytePos, DUMMY_SP, Span}; | |
| 23 | 23 | use rustc_target::abi::FieldIdx; |
| 24 | 24 | use rustc_trait_selection::infer::InferCtxtExt; |
| 25 | 25 | use rustc_trait_selection::traits::{ObligationCause, ObligationCauseCode}; |
| ... | ... | @@ -28,7 +28,7 @@ use ty::VariantDef; |
| 28 | 28 | |
| 29 | 29 | use super::report_unexpected_variant_res; |
| 30 | 30 | use crate::gather_locals::DeclOrigin; |
| 31 | use crate::{errors, FnCtxt, LoweredTy}; | |
| 31 | use crate::{FnCtxt, LoweredTy, errors}; | |
| 32 | 32 | |
| 33 | 33 | const CANNOT_IMPLICITLY_DEREF_POINTER_TRAIT_OBJ: &str = "\ |
| 34 | 34 | This error indicates that a pointer to a trait type cannot be implicitly dereferenced by a \ |
compiler/rustc_hir_typeck/src/place_op.rs+5-8| ... | ... | @@ -7,8 +7,8 @@ use rustc_middle::ty::adjustment::{ |
| 7 | 7 | PointerCoercion, |
| 8 | 8 | }; |
| 9 | 9 | use rustc_middle::ty::{self, Ty}; |
| 10 | use rustc_span::symbol::{sym, Ident}; | |
| 11 | 10 | use rustc_span::Span; |
| 11 | use rustc_span::symbol::{Ident, sym}; | |
| 12 | 12 | use tracing::debug; |
| 13 | 13 | use {rustc_ast as ast, rustc_hir as hir}; |
| 14 | 14 | |
| ... | ... | @@ -30,13 +30,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 30 | 30 | let ok = self.try_overloaded_deref(expr.span, oprnd_ty)?; |
| 31 | 31 | let method = self.register_infer_ok_obligations(ok); |
| 32 | 32 | if let ty::Ref(region, _, hir::Mutability::Not) = method.sig.inputs()[0].kind() { |
| 33 | self.apply_adjustments( | |
| 34 | oprnd_expr, | |
| 35 | vec![Adjustment { | |
| 36 | kind: Adjust::Borrow(AutoBorrow::Ref(*region, AutoBorrowMutability::Not)), | |
| 37 | target: method.sig.inputs()[0], | |
| 38 | }], | |
| 39 | ); | |
| 33 | self.apply_adjustments(oprnd_expr, vec![Adjustment { | |
| 34 | kind: Adjust::Borrow(AutoBorrow::Ref(*region, AutoBorrowMutability::Not)), | |
| 35 | target: method.sig.inputs()[0], | |
| 36 | }]); | |
| 40 | 37 | } else { |
| 41 | 38 | span_bug!(expr.span, "input to deref is not a ref?"); |
| 42 | 39 | } |
compiler/rustc_hir_typeck/src/rvalue_scopes.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | use hir::def_id::DefId; | |
| 2 | 1 | use hir::Node; |
| 2 | use hir::def_id::DefId; | |
| 3 | 3 | use rustc_hir as hir; |
| 4 | 4 | use rustc_middle::bug; |
| 5 | 5 | use rustc_middle::middle::region::{RvalueCandidateType, Scope, ScopeTree}; |
compiler/rustc_hir_typeck/src/typeck_root_ctxt.rs+1-1| ... | ... | @@ -9,8 +9,8 @@ use rustc_infer::infer::{InferCtxt, InferOk, TyCtxtInferExt}; |
| 9 | 9 | use rustc_middle::span_bug; |
| 10 | 10 | use rustc_middle::ty::visit::TypeVisitableExt; |
| 11 | 11 | use rustc_middle::ty::{self, Ty, TyCtxt}; |
| 12 | use rustc_span::def_id::LocalDefIdMap; | |
| 13 | 12 | use rustc_span::Span; |
| 13 | use rustc_span::def_id::LocalDefIdMap; | |
| 14 | 14 | use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt; |
| 15 | 15 | use rustc_trait_selection::traits::{ |
| 16 | 16 | self, FulfillmentError, PredicateObligation, TraitEngine, TraitEngineExt as _, |
compiler/rustc_hir_typeck/src/upvar.rs+22-31| ... | ... | @@ -36,9 +36,9 @@ use rustc_data_structures::fx::{FxIndexMap, FxIndexSet}; |
| 36 | 36 | use rustc_data_structures::unord::{ExtendUnord, UnordSet}; |
| 37 | 37 | use rustc_errors::{Applicability, MultiSpan}; |
| 38 | 38 | use rustc_hir as hir; |
| 39 | use rustc_hir::HirId; | |
| 39 | 40 | use rustc_hir::def_id::LocalDefId; |
| 40 | 41 | use rustc_hir::intravisit::{self, Visitor}; |
| 41 | use rustc_hir::HirId; | |
| 42 | 42 | use rustc_middle::hir::place::{Place, PlaceBase, PlaceWithHirId, Projection, ProjectionKind}; |
| 43 | 43 | use rustc_middle::mir::FakeReadCause; |
| 44 | 44 | use rustc_middle::traits::ObligationCauseCode; |
| ... | ... | @@ -48,7 +48,7 @@ use rustc_middle::ty::{ |
| 48 | 48 | }; |
| 49 | 49 | use rustc_middle::{bug, span_bug}; |
| 50 | 50 | use rustc_session::lint; |
| 51 | use rustc_span::{sym, BytePos, Pos, Span, Symbol}; | |
| 51 | use rustc_span::{BytePos, Pos, Span, Symbol, sym}; | |
| 52 | 52 | use rustc_target::abi::FIRST_VARIANT; |
| 53 | 53 | use rustc_trait_selection::infer::InferCtxtExt; |
| 54 | 54 | use tracing::{debug, instrument}; |
| ... | ... | @@ -287,14 +287,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 287 | 287 | bug!(); |
| 288 | 288 | }; |
| 289 | 289 | let place = self.place_for_root_variable(closure_def_id, local_id); |
| 290 | delegate.capture_information.push(( | |
| 291 | place, | |
| 292 | ty::CaptureInfo { | |
| 293 | capture_kind_expr_id: Some(init.hir_id), | |
| 294 | path_expr_id: Some(init.hir_id), | |
| 295 | capture_kind: UpvarCapture::ByValue, | |
| 296 | }, | |
| 297 | )); | |
| 290 | delegate.capture_information.push((place, ty::CaptureInfo { | |
| 291 | capture_kind_expr_id: Some(init.hir_id), | |
| 292 | path_expr_id: Some(init.hir_id), | |
| 293 | capture_kind: UpvarCapture::ByValue, | |
| 294 | })); | |
| 298 | 295 | } |
| 299 | 296 | } |
| 300 | 297 | |
| ... | ... | @@ -381,11 +378,11 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { |
| 381 | 378 | if let UpvarArgs::CoroutineClosure(args) = args |
| 382 | 379 | && !args.references_error() |
| 383 | 380 | { |
| 384 | let closure_env_region: ty::Region<'_> = ty::Region::new_bound( | |
| 385 | self.tcx, | |
| 386 | ty::INNERMOST, | |
| 387 | ty::BoundRegion { var: ty::BoundVar::ZERO, kind: ty::BoundRegionKind::BrEnv }, | |
| 388 | ); | |
| 381 | let closure_env_region: ty::Region<'_> = | |
| 382 | ty::Region::new_bound(self.tcx, ty::INNERMOST, ty::BoundRegion { | |
| 383 | var: ty::BoundVar::ZERO, | |
| 384 | kind: ty::BoundRegionKind::BrEnv, | |
| 385 | }); | |
| 389 | 386 | |
| 390 | 387 | let num_args = args |
| 391 | 388 | .as_coroutine_closure() |
| ... | ... | @@ -2004,14 +2001,11 @@ impl<'tcx> euv::Delegate<'tcx> for InferBorrowKind<'tcx> { |
| 2004 | 2001 | let PlaceBase::Upvar(upvar_id) = place_with_id.place.base else { return }; |
| 2005 | 2002 | assert_eq!(self.closure_def_id, upvar_id.closure_expr_id); |
| 2006 | 2003 | |
| 2007 | self.capture_information.push(( | |
| 2008 | place_with_id.place.clone(), | |
| 2009 | ty::CaptureInfo { | |
| 2010 | capture_kind_expr_id: Some(diag_expr_id), | |
| 2011 | path_expr_id: Some(diag_expr_id), | |
| 2012 | capture_kind: ty::UpvarCapture::ByValue, | |
| 2013 | }, | |
| 2014 | )); | |
| 2004 | self.capture_information.push((place_with_id.place.clone(), ty::CaptureInfo { | |
| 2005 | capture_kind_expr_id: Some(diag_expr_id), | |
| 2006 | path_expr_id: Some(diag_expr_id), | |
| 2007 | capture_kind: ty::UpvarCapture::ByValue, | |
| 2008 | })); | |
| 2015 | 2009 | } |
| 2016 | 2010 | |
| 2017 | 2011 | #[instrument(skip(self), level = "debug")] |
| ... | ... | @@ -2038,14 +2032,11 @@ impl<'tcx> euv::Delegate<'tcx> for InferBorrowKind<'tcx> { |
| 2038 | 2032 | capture_kind = ty::UpvarCapture::ByRef(ty::BorrowKind::ImmBorrow); |
| 2039 | 2033 | } |
| 2040 | 2034 | |
| 2041 | self.capture_information.push(( | |
| 2042 | place, | |
| 2043 | ty::CaptureInfo { | |
| 2044 | capture_kind_expr_id: Some(diag_expr_id), | |
| 2045 | path_expr_id: Some(diag_expr_id), | |
| 2046 | capture_kind, | |
| 2047 | }, | |
| 2048 | )); | |
| 2035 | self.capture_information.push((place, ty::CaptureInfo { | |
| 2036 | capture_kind_expr_id: Some(diag_expr_id), | |
| 2037 | path_expr_id: Some(diag_expr_id), | |
| 2038 | capture_kind, | |
| 2039 | })); | |
| 2049 | 2040 | } |
| 2050 | 2041 | |
| 2051 | 2042 | #[instrument(skip(self), level = "debug")] |
compiler/rustc_hir_typeck/src/writeback.rs+2-2| ... | ... | @@ -7,16 +7,16 @@ use std::mem; |
| 7 | 7 | use rustc_data_structures::unord::ExtendUnord; |
| 8 | 8 | use rustc_errors::{ErrorGuaranteed, StashKey}; |
| 9 | 9 | use rustc_hir as hir; |
| 10 | use rustc_hir::intravisit::{self, Visitor}; | |
| 11 | 10 | use rustc_hir::HirId; |
| 11 | use rustc_hir::intravisit::{self, Visitor}; | |
| 12 | 12 | use rustc_middle::span_bug; |
| 13 | 13 | use rustc_middle::traits::ObligationCause; |
| 14 | 14 | use rustc_middle::ty::adjustment::{Adjust, Adjustment, PointerCoercion}; |
| 15 | 15 | use rustc_middle::ty::fold::{TypeFoldable, TypeFolder}; |
| 16 | 16 | use rustc_middle::ty::visit::TypeVisitableExt; |
| 17 | 17 | use rustc_middle::ty::{self, Ty, TyCtxt, TypeSuperFoldable}; |
| 18 | use rustc_span::symbol::sym; | |
| 19 | 18 | use rustc_span::Span; |
| 19 | use rustc_span::symbol::sym; | |
| 20 | 20 | use rustc_trait_selection::error_reporting::infer::need_type_info::TypeAnnotationNeeded; |
| 21 | 21 | use rustc_trait_selection::solve; |
| 22 | 22 | use tracing::{debug, instrument}; |
compiler/rustc_incremental/src/assert_dep_graph.rs+4-4| ... | ... | @@ -38,17 +38,17 @@ use std::fs::{self, File}; |
| 38 | 38 | use std::io::{BufWriter, Write}; |
| 39 | 39 | |
| 40 | 40 | use rustc_data_structures::fx::FxIndexSet; |
| 41 | use rustc_data_structures::graph::implementation::{Direction, NodeIndex, INCOMING, OUTGOING}; | |
| 42 | use rustc_hir::def_id::{DefId, LocalDefId, CRATE_DEF_ID}; | |
| 41 | use rustc_data_structures::graph::implementation::{Direction, INCOMING, NodeIndex, OUTGOING}; | |
| 42 | use rustc_hir::def_id::{CRATE_DEF_ID, DefId, LocalDefId}; | |
| 43 | 43 | use rustc_hir::intravisit::{self, Visitor}; |
| 44 | 44 | use rustc_middle::dep_graph::{ |
| 45 | dep_kinds, DepGraphQuery, DepKind, DepNode, DepNodeExt, DepNodeFilter, EdgeFilter, | |
| 45 | DepGraphQuery, DepKind, DepNode, DepNodeExt, DepNodeFilter, EdgeFilter, dep_kinds, | |
| 46 | 46 | }; |
| 47 | 47 | use rustc_middle::hir::nested_filter; |
| 48 | 48 | use rustc_middle::ty::TyCtxt; |
| 49 | 49 | use rustc_middle::{bug, span_bug}; |
| 50 | use rustc_span::symbol::{sym, Symbol}; | |
| 51 | 50 | use rustc_span::Span; |
| 51 | use rustc_span::symbol::{Symbol, sym}; | |
| 52 | 52 | use tracing::debug; |
| 53 | 53 | use {rustc_ast as ast, rustc_graphviz as dot, rustc_hir as hir}; |
| 54 | 54 |
compiler/rustc_incremental/src/lib.rs+3-3| ... | ... | @@ -14,9 +14,9 @@ mod errors; |
| 14 | 14 | mod persist; |
| 15 | 15 | |
| 16 | 16 | pub use persist::{ |
| 17 | copy_cgu_workproduct_to_incr_comp_cache_dir, finalize_session_directory, in_incr_comp_dir, | |
| 18 | in_incr_comp_dir_sess, load_query_result_cache, save_dep_graph, save_work_product_index, | |
| 19 | setup_dep_graph, LoadResult, | |
| 17 | LoadResult, copy_cgu_workproduct_to_incr_comp_cache_dir, finalize_session_directory, | |
| 18 | in_incr_comp_dir, in_incr_comp_dir_sess, load_query_result_cache, save_dep_graph, | |
| 19 | save_work_product_index, setup_dep_graph, | |
| 20 | 20 | }; |
| 21 | 21 | |
| 22 | 22 | rustc_fluent_macro::fluent_messages! { "../messages.ftl" } |
compiler/rustc_incremental/src/persist/dirty_clean.rs+8-7| ... | ... | @@ -23,12 +23,12 @@ use rustc_ast::{self as ast, Attribute, NestedMetaItem}; |
| 23 | 23 | use rustc_data_structures::fx::FxHashSet; |
| 24 | 24 | use rustc_data_structures::unord::UnordSet; |
| 25 | 25 | use rustc_hir::def_id::LocalDefId; |
| 26 | use rustc_hir::{intravisit, ImplItemKind, ItemKind as HirItem, Node as HirNode, TraitItemKind}; | |
| 27 | use rustc_middle::dep_graph::{label_strs, DepNode, DepNodeExt}; | |
| 26 | use rustc_hir::{ImplItemKind, ItemKind as HirItem, Node as HirNode, TraitItemKind, intravisit}; | |
| 27 | use rustc_middle::dep_graph::{DepNode, DepNodeExt, label_strs}; | |
| 28 | 28 | use rustc_middle::hir::nested_filter; |
| 29 | 29 | use rustc_middle::ty::TyCtxt; |
| 30 | use rustc_span::symbol::{sym, Symbol}; | |
| 31 | 30 | use rustc_span::Span; |
| 31 | use rustc_span::symbol::{Symbol, sym}; | |
| 32 | 32 | use thin_vec::ThinVec; |
| 33 | 33 | use tracing::debug; |
| 34 | 34 | |
| ... | ... | @@ -106,10 +106,11 @@ const LABELS_FN_IN_TRAIT: &[&[&str]] = |
| 106 | 106 | const LABELS_HIR_ONLY: &[&[&str]] = &[BASE_HIR]; |
| 107 | 107 | |
| 108 | 108 | /// Impl `DepNode`s. |
| 109 | const LABELS_TRAIT: &[&[&str]] = &[ | |
| 110 | BASE_HIR, | |
| 111 | &[label_strs::associated_item_def_ids, label_strs::predicates_of, label_strs::generics_of], | |
| 112 | ]; | |
| 109 | const LABELS_TRAIT: &[&[&str]] = &[BASE_HIR, &[ | |
| 110 | label_strs::associated_item_def_ids, | |
| 111 | label_strs::predicates_of, | |
| 112 | label_strs::generics_of, | |
| 113 | ]]; | |
| 113 | 114 | |
| 114 | 115 | /// Impl `DepNode`s. |
| 115 | 116 | const LABELS_IMPL: &[&[&str]] = &[BASE_HIR, BASE_IMPL]; |
compiler/rustc_incremental/src/persist/file_format.rs+1-1| ... | ... | @@ -15,8 +15,8 @@ use std::path::{Path, PathBuf}; |
| 15 | 15 | use std::{env, fs}; |
| 16 | 16 | |
| 17 | 17 | use rustc_data_structures::memmap::Mmap; |
| 18 | use rustc_serialize::opaque::{FileEncodeResult, FileEncoder}; | |
| 19 | 18 | use rustc_serialize::Encoder; |
| 19 | use rustc_serialize::opaque::{FileEncodeResult, FileEncoder}; | |
| 20 | 20 | use rustc_session::Session; |
| 21 | 21 | use tracing::debug; |
| 22 | 22 |
compiler/rustc_incremental/src/persist/fs.rs+3-3| ... | ... | @@ -108,14 +108,14 @@ use std::io::{self, ErrorKind}; |
| 108 | 108 | use std::path::{Path, PathBuf}; |
| 109 | 109 | use std::time::{Duration, SystemTime, UNIX_EPOCH}; |
| 110 | 110 | |
| 111 | use rand::{thread_rng, RngCore}; | |
| 112 | use rustc_data_structures::base_n::{BaseNString, ToBaseN, CASE_INSENSITIVE}; | |
| 111 | use rand::{RngCore, thread_rng}; | |
| 112 | use rustc_data_structures::base_n::{BaseNString, CASE_INSENSITIVE, ToBaseN}; | |
| 113 | 113 | use rustc_data_structures::fx::{FxHashSet, FxIndexSet}; |
| 114 | 114 | use rustc_data_structures::svh::Svh; |
| 115 | 115 | use rustc_data_structures::unord::{UnordMap, UnordSet}; |
| 116 | 116 | use rustc_data_structures::{base_n, flock}; |
| 117 | 117 | use rustc_errors::ErrorGuaranteed; |
| 118 | use rustc_fs_util::{link_or_copy, try_canonicalize, LinkOrCopy}; | |
| 118 | use rustc_fs_util::{LinkOrCopy, link_or_copy, try_canonicalize}; | |
| 119 | 119 | use rustc_middle::bug; |
| 120 | 120 | use rustc_session::config::CrateType; |
| 121 | 121 | use rustc_session::output::{collect_crate_types, find_crate_name}; |
compiler/rustc_incremental/src/persist/load.rs+2-2| ... | ... | @@ -7,10 +7,10 @@ use rustc_data_structures::memmap::Mmap; |
| 7 | 7 | use rustc_data_structures::unord::UnordMap; |
| 8 | 8 | use rustc_middle::dep_graph::{DepGraph, DepsType, SerializedDepGraph, WorkProductMap}; |
| 9 | 9 | use rustc_middle::query::on_disk_cache::OnDiskCache; |
| 10 | use rustc_serialize::opaque::MemDecoder; | |
| 11 | 10 | use rustc_serialize::Decodable; |
| 12 | use rustc_session::config::IncrementalStateAssertion; | |
| 11 | use rustc_serialize::opaque::MemDecoder; | |
| 13 | 12 | use rustc_session::Session; |
| 13 | use rustc_session::config::IncrementalStateAssertion; | |
| 14 | 14 | use rustc_span::ErrorGuaranteed; |
| 15 | 15 | use tracing::{debug, warn}; |
| 16 | 16 |
compiler/rustc_incremental/src/persist/mod.rs+1-1| ... | ... | @@ -11,6 +11,6 @@ mod save; |
| 11 | 11 | mod work_product; |
| 12 | 12 | |
| 13 | 13 | pub use fs::{finalize_session_directory, in_incr_comp_dir, in_incr_comp_dir_sess}; |
| 14 | pub use load::{load_query_result_cache, setup_dep_graph, LoadResult}; | |
| 14 | pub use load::{LoadResult, load_query_result_cache, setup_dep_graph}; | |
| 15 | 15 | pub use save::{save_dep_graph, save_work_product_index}; |
| 16 | 16 | pub use work_product::copy_cgu_workproduct_to_incr_comp_cache_dir; |
compiler/rustc_incremental/src/persist/save.rs+1-1| ... | ... | @@ -7,8 +7,8 @@ use rustc_middle::dep_graph::{ |
| 7 | 7 | DepGraph, SerializedDepGraph, WorkProduct, WorkProductId, WorkProductMap, |
| 8 | 8 | }; |
| 9 | 9 | use rustc_middle::ty::TyCtxt; |
| 10 | use rustc_serialize::opaque::{FileEncodeResult, FileEncoder}; | |
| 11 | 10 | use rustc_serialize::Encodable as RustcEncodable; |
| 11 | use rustc_serialize::opaque::{FileEncodeResult, FileEncoder}; | |
| 12 | 12 | use rustc_session::Session; |
| 13 | 13 | use tracing::debug; |
| 14 | 14 |
compiler/rustc_index/src/bit_set.rs+2-2| ... | ... | @@ -3,11 +3,11 @@ use std::ops::{BitAnd, BitAndAssign, BitOrAssign, Bound, Not, Range, RangeBounds |
| 3 | 3 | use std::rc::Rc; |
| 4 | 4 | use std::{fmt, iter, mem, slice}; |
| 5 | 5 | |
| 6 | use Chunk::*; | |
| 6 | 7 | use arrayvec::ArrayVec; |
| 7 | 8 | #[cfg(feature = "nightly")] |
| 8 | 9 | use rustc_macros::{Decodable_Generic, Encodable_Generic}; |
| 9 | use smallvec::{smallvec, SmallVec}; | |
| 10 | use Chunk::*; | |
| 10 | use smallvec::{SmallVec, smallvec}; | |
| 11 | 11 | |
| 12 | 12 | use crate::{Idx, IndexVec}; |
| 13 | 13 |
compiler/rustc_index/src/bit_set/tests.rs+30-40| ... | ... | @@ -182,10 +182,11 @@ fn chunked_bitset() { |
| 182 | 182 | //----------------------------------------------------------------------- |
| 183 | 183 | |
| 184 | 184 | let mut b1 = ChunkedBitSet::<usize>::new_empty(1); |
| 185 | assert_eq!( | |
| 186 | b1, | |
| 187 | ChunkedBitSet { domain_size: 1, chunks: Box::new([Zeros(1)]), marker: PhantomData } | |
| 188 | ); | |
| 185 | assert_eq!(b1, ChunkedBitSet { | |
| 186 | domain_size: 1, | |
| 187 | chunks: Box::new([Zeros(1)]), | |
| 188 | marker: PhantomData | |
| 189 | }); | |
| 189 | 190 | |
| 190 | 191 | b1.assert_valid(); |
| 191 | 192 | assert!(!b1.contains(0)); |
| ... | ... | @@ -204,10 +205,11 @@ fn chunked_bitset() { |
| 204 | 205 | //----------------------------------------------------------------------- |
| 205 | 206 | |
| 206 | 207 | let mut b100 = ChunkedBitSet::<usize>::new_filled(100); |
| 207 | assert_eq!( | |
| 208 | b100, | |
| 209 | ChunkedBitSet { domain_size: 100, chunks: Box::new([Ones(100)]), marker: PhantomData } | |
| 210 | ); | |
| 208 | assert_eq!(b100, ChunkedBitSet { | |
| 209 | domain_size: 100, | |
| 210 | chunks: Box::new([Ones(100)]), | |
| 211 | marker: PhantomData | |
| 212 | }); | |
| 211 | 213 | |
| 212 | 214 | b100.assert_valid(); |
| 213 | 215 | for i in 0..100 { |
| ... | ... | @@ -222,20 +224,17 @@ fn chunked_bitset() { |
| 222 | 224 | ); |
| 223 | 225 | assert_eq!(b100.count(), 97); |
| 224 | 226 | assert!(!b100.contains(20) && b100.contains(30) && !b100.contains(99) && b100.contains(50)); |
| 225 | assert_eq!( | |
| 226 | b100.chunks(), | |
| 227 | vec![Mixed( | |
| 228 | 100, | |
| 229 | 97, | |
| 230 | #[rustfmt::skip] | |
| 227 | assert_eq!(b100.chunks(), vec![Mixed( | |
| 228 | 100, | |
| 229 | 97, | |
| 230 | #[rustfmt::skip] | |
| 231 | 231 | Rc::new([ |
| 232 | 232 | 0b11111111_11111111_11111110_11111111_11111111_11101111_11111111_11111111, |
| 233 | 233 | 0b00000000_00000000_00000000_00000111_11111111_11111111_11111111_11111111, |
| 234 | 234 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, |
| 235 | 235 | 0, 0, 0, 0, 0, |
| 236 | 236 | ]) |
| 237 | )], | |
| 238 | ); | |
| 237 | )],); | |
| 239 | 238 | b100.assert_valid(); |
| 240 | 239 | let mut num_removed = 0; |
| 241 | 240 | for i in 0..100 { |
| ... | ... | @@ -250,14 +249,11 @@ fn chunked_bitset() { |
| 250 | 249 | //----------------------------------------------------------------------- |
| 251 | 250 | |
| 252 | 251 | let mut b2548 = ChunkedBitSet::<usize>::new_empty(2548); |
| 253 | assert_eq!( | |
| 254 | b2548, | |
| 255 | ChunkedBitSet { | |
| 256 | domain_size: 2548, | |
| 257 | chunks: Box::new([Zeros(2048), Zeros(500)]), | |
| 258 | marker: PhantomData, | |
| 259 | } | |
| 260 | ); | |
| 252 | assert_eq!(b2548, ChunkedBitSet { | |
| 253 | domain_size: 2548, | |
| 254 | chunks: Box::new([Zeros(2048), Zeros(500)]), | |
| 255 | marker: PhantomData, | |
| 256 | }); | |
| 261 | 257 | |
| 262 | 258 | b2548.assert_valid(); |
| 263 | 259 | b2548.insert(14); |
| ... | ... | @@ -274,14 +270,11 @@ fn chunked_bitset() { |
| 274 | 270 | //----------------------------------------------------------------------- |
| 275 | 271 | |
| 276 | 272 | let mut b4096 = ChunkedBitSet::<usize>::new_empty(4096); |
| 277 | assert_eq!( | |
| 278 | b4096, | |
| 279 | ChunkedBitSet { | |
| 280 | domain_size: 4096, | |
| 281 | chunks: Box::new([Zeros(2048), Zeros(2048)]), | |
| 282 | marker: PhantomData, | |
| 283 | } | |
| 284 | ); | |
| 273 | assert_eq!(b4096, ChunkedBitSet { | |
| 274 | domain_size: 4096, | |
| 275 | chunks: Box::new([Zeros(2048), Zeros(2048)]), | |
| 276 | marker: PhantomData, | |
| 277 | }); | |
| 285 | 278 | |
| 286 | 279 | b4096.assert_valid(); |
| 287 | 280 | for i in 0..4096 { |
| ... | ... | @@ -311,14 +304,11 @@ fn chunked_bitset() { |
| 311 | 304 | //----------------------------------------------------------------------- |
| 312 | 305 | |
| 313 | 306 | let mut b10000 = ChunkedBitSet::<usize>::new_empty(10000); |
| 314 | assert_eq!( | |
| 315 | b10000, | |
| 316 | ChunkedBitSet { | |
| 317 | domain_size: 10000, | |
| 318 | chunks: Box::new([Zeros(2048), Zeros(2048), Zeros(2048), Zeros(2048), Zeros(1808),]), | |
| 319 | marker: PhantomData, | |
| 320 | } | |
| 321 | ); | |
| 307 | assert_eq!(b10000, ChunkedBitSet { | |
| 308 | domain_size: 10000, | |
| 309 | chunks: Box::new([Zeros(2048), Zeros(2048), Zeros(2048), Zeros(2048), Zeros(1808),]), | |
| 310 | marker: PhantomData, | |
| 311 | }); | |
| 322 | 312 | |
| 323 | 313 | b10000.assert_valid(); |
| 324 | 314 | assert!(b10000.insert(3000) && b10000.insert(5000)); |
compiler/rustc_index/src/vec/tests.rs+10-8| ... | ... | @@ -29,19 +29,21 @@ fn index_size_is_optimized() { |
| 29 | 29 | #[test] |
| 30 | 30 | fn range_iterator_iterates_forwards() { |
| 31 | 31 | let range = MyIdx::from_u32(1)..MyIdx::from_u32(4); |
| 32 | assert_eq!( | |
| 33 | range.collect::<Vec<_>>(), | |
| 34 | [MyIdx::from_u32(1), MyIdx::from_u32(2), MyIdx::from_u32(3)] | |
| 35 | ); | |
| 32 | assert_eq!(range.collect::<Vec<_>>(), [ | |
| 33 | MyIdx::from_u32(1), | |
| 34 | MyIdx::from_u32(2), | |
| 35 | MyIdx::from_u32(3) | |
| 36 | ]); | |
| 36 | 37 | } |
| 37 | 38 | |
| 38 | 39 | #[test] |
| 39 | 40 | fn range_iterator_iterates_backwards() { |
| 40 | 41 | let range = MyIdx::from_u32(1)..MyIdx::from_u32(4); |
| 41 | assert_eq!( | |
| 42 | range.rev().collect::<Vec<_>>(), | |
| 43 | [MyIdx::from_u32(3), MyIdx::from_u32(2), MyIdx::from_u32(1)] | |
| 44 | ); | |
| 42 | assert_eq!(range.rev().collect::<Vec<_>>(), [ | |
| 43 | MyIdx::from_u32(3), | |
| 44 | MyIdx::from_u32(2), | |
| 45 | MyIdx::from_u32(1) | |
| 46 | ]); | |
| 45 | 47 | } |
| 46 | 48 | |
| 47 | 49 | #[test] |
compiler/rustc_infer/src/infer/canonical/canonicalizer.rs+1-1| ... | ... | @@ -15,10 +15,10 @@ use rustc_middle::ty::{ |
| 15 | 15 | use smallvec::SmallVec; |
| 16 | 16 | use tracing::debug; |
| 17 | 17 | |
| 18 | use crate::infer::InferCtxt; | |
| 18 | 19 | use crate::infer::canonical::{ |
| 19 | 20 | Canonical, CanonicalTyVarKind, CanonicalVarInfo, CanonicalVarKind, OriginalQueryValues, |
| 20 | 21 | }; |
| 21 | use crate::infer::InferCtxt; | |
| 22 | 22 | |
| 23 | 23 | impl<'tcx> InferCtxt<'tcx> { |
| 24 | 24 | /// Canonicalizes a query value `V`. When we canonicalize a query, |
compiler/rustc_infer/src/infer/canonical/query_response.rs+1-1| ... | ... | @@ -19,7 +19,7 @@ use rustc_middle::ty::{self, BoundVar, GenericArg, GenericArgKind, Ty, TyCtxt}; |
| 19 | 19 | use rustc_middle::{bug, span_bug}; |
| 20 | 20 | use tracing::{debug, instrument}; |
| 21 | 21 | |
| 22 | use crate::infer::canonical::instantiate::{instantiate_value, CanonicalExt}; | |
| 22 | use crate::infer::canonical::instantiate::{CanonicalExt, instantiate_value}; | |
| 23 | 23 | use crate::infer::canonical::{ |
| 24 | 24 | Canonical, CanonicalQueryResponse, CanonicalVarValues, Certainty, OriginalQueryValues, |
| 25 | 25 | QueryOutlivesConstraint, QueryRegionConstraints, QueryResponse, |
compiler/rustc_infer/src/infer/context.rs+2-2| ... | ... | @@ -1,12 +1,12 @@ |
| 1 | 1 | ///! Definition of `InferCtxtLike` from the librarified type layer. |
| 2 | 2 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| 3 | use rustc_middle::traits::solve::{Goal, NoSolution, SolverMode}; | |
| 4 | 3 | use rustc_middle::traits::ObligationCause; |
| 4 | use rustc_middle::traits::solve::{Goal, NoSolution, SolverMode}; | |
| 5 | 5 | use rustc_middle::ty::fold::TypeFoldable; |
| 6 | 6 | use rustc_middle::ty::{self, Ty, TyCtxt}; |
| 7 | 7 | use rustc_span::DUMMY_SP; |
| 8 | use rustc_type_ir::relate::Relate; | |
| 9 | 8 | use rustc_type_ir::InferCtxtLike; |
| 9 | use rustc_type_ir::relate::Relate; | |
| 10 | 10 | |
| 11 | 11 | use super::{BoundRegionConversionTime, InferCtxt, SubregionOrigin}; |
| 12 | 12 |
compiler/rustc_infer/src/infer/lexical_region_resolve/mod.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ use std::fmt; |
| 4 | 4 | |
| 5 | 5 | use rustc_data_structures::fx::FxHashSet; |
| 6 | 6 | use rustc_data_structures::graph::implementation::{ |
| 7 | Direction, Graph, NodeIndex, INCOMING, OUTGOING, | |
| 7 | Direction, Graph, INCOMING, NodeIndex, OUTGOING, | |
| 8 | 8 | }; |
| 9 | 9 | use rustc_data_structures::intern::Interned; |
| 10 | 10 | use rustc_data_structures::unord::UnordSet; |
compiler/rustc_infer/src/infer/mod.rs+21-27| ... | ... | @@ -1,6 +1,9 @@ |
| 1 | 1 | use std::cell::{Cell, RefCell}; |
| 2 | 2 | use std::fmt; |
| 3 | 3 | |
| 4 | pub use BoundRegionConversionTime::*; | |
| 5 | pub use RegionVariableOrigin::*; | |
| 6 | pub use SubregionOrigin::*; | |
| 4 | 7 | pub use at::DefineOpaqueTypes; |
| 5 | 8 | use free_regions::RegionRelations; |
| 6 | 9 | pub use freshen::TypeFreshener; |
| ... | ... | @@ -10,8 +13,8 @@ use opaque_types::OpaqueTypeStorage; |
| 10 | 13 | use region_constraints::{ |
| 11 | 14 | GenericKind, RegionConstraintCollector, RegionConstraintStorage, VarInfos, VerifyBound, |
| 12 | 15 | }; |
| 13 | pub use relate::combine::{CombineFields, PredicateEmittingRelation}; | |
| 14 | 16 | pub use relate::StructurallyRelateAliases; |
| 17 | pub use relate::combine::{CombineFields, PredicateEmittingRelation}; | |
| 15 | 18 | use rustc_data_structures::captures::Captures; |
| 16 | 19 | use rustc_data_structures::fx::{FxHashSet, FxIndexMap}; |
| 17 | 20 | use rustc_data_structures::sync::Lrc; |
| ... | ... | @@ -26,29 +29,26 @@ use rustc_middle::infer::canonical::{Canonical, CanonicalVarValues}; |
| 26 | 29 | use rustc_middle::infer::unify_key::{ |
| 27 | 30 | ConstVariableOrigin, ConstVariableValue, ConstVidKey, EffectVarValue, EffectVidKey, |
| 28 | 31 | }; |
| 29 | use rustc_middle::mir::interpret::{ErrorHandled, EvalToValTreeResult}; | |
| 30 | 32 | use rustc_middle::mir::ConstraintCategory; |
| 33 | use rustc_middle::mir::interpret::{ErrorHandled, EvalToValTreeResult}; | |
| 31 | 34 | use rustc_middle::traits::select; |
| 32 | 35 | use rustc_middle::traits::solve::{Goal, NoSolution}; |
| 36 | pub use rustc_middle::ty::IntVarValue; | |
| 33 | 37 | use rustc_middle::ty::error::{ExpectedFound, TypeError}; |
| 34 | 38 | use rustc_middle::ty::fold::{ |
| 35 | 39 | BoundVarReplacerDelegate, TypeFoldable, TypeFolder, TypeSuperFoldable, |
| 36 | 40 | }; |
| 37 | 41 | use rustc_middle::ty::visit::TypeVisitableExt; |
| 38 | pub use rustc_middle::ty::IntVarValue; | |
| 39 | 42 | use rustc_middle::ty::{ |
| 40 | 43 | self, ConstVid, EffectVid, FloatVid, GenericArg, GenericArgKind, GenericArgs, GenericArgsRef, |
| 41 | 44 | GenericParamDefKind, InferConst, IntVid, Ty, TyCtxt, TyVid, |
| 42 | 45 | }; |
| 43 | 46 | use rustc_middle::{bug, span_bug}; |
| 44 | use rustc_span::symbol::Symbol; | |
| 45 | 47 | use rustc_span::Span; |
| 48 | use rustc_span::symbol::Symbol; | |
| 46 | 49 | use snapshot::undo_log::InferCtxtUndoLogs; |
| 47 | 50 | use tracing::{debug, instrument}; |
| 48 | 51 | use type_variable::TypeVariableOrigin; |
| 49 | pub use BoundRegionConversionTime::*; | |
| 50 | pub use RegionVariableOrigin::*; | |
| 51 | pub use SubregionOrigin::*; | |
| 52 | 52 | |
| 53 | 53 | use crate::infer::relate::RelateResult; |
| 54 | 54 | use crate::traits::{self, ObligationCause, ObligationInspector, PredicateObligation, TraitEngine}; |
| ... | ... | @@ -1776,16 +1776,13 @@ fn replace_param_and_infer_args_with_placeholder<'tcx>( |
| 1776 | 1776 | self.idx += 1; |
| 1777 | 1777 | idx |
| 1778 | 1778 | }; |
| 1779 | Ty::new_placeholder( | |
| 1780 | self.tcx, | |
| 1781 | ty::PlaceholderType { | |
| 1782 | universe: ty::UniverseIndex::ROOT, | |
| 1783 | bound: ty::BoundTy { | |
| 1784 | var: ty::BoundVar::from_u32(idx), | |
| 1785 | kind: ty::BoundTyKind::Anon, | |
| 1786 | }, | |
| 1779 | Ty::new_placeholder(self.tcx, ty::PlaceholderType { | |
| 1780 | universe: ty::UniverseIndex::ROOT, | |
| 1781 | bound: ty::BoundTy { | |
| 1782 | var: ty::BoundVar::from_u32(idx), | |
| 1783 | kind: ty::BoundTyKind::Anon, | |
| 1787 | 1784 | }, |
| 1788 | ) | |
| 1785 | }) | |
| 1789 | 1786 | } else { |
| 1790 | 1787 | t.super_fold_with(self) |
| 1791 | 1788 | } |
| ... | ... | @@ -1793,17 +1790,14 @@ fn replace_param_and_infer_args_with_placeholder<'tcx>( |
| 1793 | 1790 | |
| 1794 | 1791 | fn fold_const(&mut self, c: ty::Const<'tcx>) -> ty::Const<'tcx> { |
| 1795 | 1792 | if let ty::ConstKind::Infer(_) = c.kind() { |
| 1796 | ty::Const::new_placeholder( | |
| 1797 | self.tcx, | |
| 1798 | ty::PlaceholderConst { | |
| 1799 | universe: ty::UniverseIndex::ROOT, | |
| 1800 | bound: ty::BoundVar::from_u32({ | |
| 1801 | let idx = self.idx; | |
| 1802 | self.idx += 1; | |
| 1803 | idx | |
| 1804 | }), | |
| 1805 | }, | |
| 1806 | ) | |
| 1793 | ty::Const::new_placeholder(self.tcx, ty::PlaceholderConst { | |
| 1794 | universe: ty::UniverseIndex::ROOT, | |
| 1795 | bound: ty::BoundVar::from_u32({ | |
| 1796 | let idx = self.idx; | |
| 1797 | self.idx += 1; | |
| 1798 | idx | |
| 1799 | }), | |
| 1800 | }) | |
| 1807 | 1801 | } else { |
| 1808 | 1802 | c.super_fold_with(self) |
| 1809 | 1803 | } |
compiler/rustc_infer/src/infer/opaque_types/mod.rs+1-1| ... | ... | @@ -2,8 +2,8 @@ use hir::def_id::{DefId, LocalDefId}; |
| 2 | 2 | use rustc_data_structures::fx::FxIndexMap; |
| 3 | 3 | use rustc_data_structures::sync::Lrc; |
| 4 | 4 | use rustc_hir as hir; |
| 5 | use rustc_middle::traits::solve::Goal; | |
| 6 | 5 | use rustc_middle::traits::ObligationCause; |
| 6 | use rustc_middle::traits::solve::Goal; | |
| 7 | 7 | use rustc_middle::ty::error::{ExpectedFound, TypeError}; |
| 8 | 8 | use rustc_middle::ty::fold::BottomUpFolder; |
| 9 | 9 | use rustc_middle::ty::{ |
compiler/rustc_infer/src/infer/outlives/env.rs+1-1| ... | ... | @@ -5,8 +5,8 @@ use rustc_middle::ty::{self, Region}; |
| 5 | 5 | use tracing::{debug, instrument}; |
| 6 | 6 | |
| 7 | 7 | use super::explicit_outlives_bounds; |
| 8 | use crate::infer::free_regions::FreeRegionMap; | |
| 9 | 8 | use crate::infer::GenericKind; |
| 9 | use crate::infer::free_regions::FreeRegionMap; | |
| 10 | 10 | use crate::traits::query::OutlivesBound; |
| 11 | 11 | |
| 12 | 12 | /// The `OutlivesEnvironment` collects information about what outlives |
compiler/rustc_infer/src/infer/outlives/obligations.rs+10-14| ... | ... | @@ -68,7 +68,7 @@ use rustc_middle::ty::{ |
| 68 | 68 | TypeFoldable as _, TypeVisitableExt, |
| 69 | 69 | }; |
| 70 | 70 | use rustc_span::DUMMY_SP; |
| 71 | use rustc_type_ir::outlives::{push_outlives_components, Component}; | |
| 71 | use rustc_type_ir::outlives::{Component, push_outlives_components}; | |
| 72 | 72 | use smallvec::smallvec; |
| 73 | 73 | use tracing::{debug, instrument}; |
| 74 | 74 | |
| ... | ... | @@ -101,19 +101,15 @@ impl<'tcx> InferCtxt<'tcx> { |
| 101 | 101 | ) { |
| 102 | 102 | debug!(?sup_type, ?sub_region, ?cause); |
| 103 | 103 | let origin = SubregionOrigin::from_obligation_cause(cause, || { |
| 104 | infer::RelateParamBound( | |
| 105 | cause.span, | |
| 106 | sup_type, | |
| 107 | match cause.code().peel_derives() { | |
| 108 | ObligationCauseCode::WhereClause(_, span) | |
| 109 | | ObligationCauseCode::WhereClauseInExpr(_, span, ..) | |
| 110 | if !span.is_dummy() => | |
| 111 | { | |
| 112 | Some(*span) | |
| 113 | } | |
| 114 | _ => None, | |
| 115 | }, | |
| 116 | ) | |
| 104 | infer::RelateParamBound(cause.span, sup_type, match cause.code().peel_derives() { | |
| 105 | ObligationCauseCode::WhereClause(_, span) | |
| 106 | | ObligationCauseCode::WhereClauseInExpr(_, span, ..) | |
| 107 | if !span.is_dummy() => | |
| 108 | { | |
| 109 | Some(*span) | |
| 110 | } | |
| 111 | _ => None, | |
| 112 | }) | |
| 117 | 113 | }); |
| 118 | 114 | |
| 119 | 115 | self.register_region_obligation(RegionObligation { sup_type, sub_region, origin }); |
compiler/rustc_infer/src/infer/outlives/verify.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use std::assert_matches::assert_matches; |
| 2 | 2 | |
| 3 | 3 | use rustc_middle::ty::{self, OutlivesPredicate, Ty, TyCtxt}; |
| 4 | use rustc_type_ir::outlives::{compute_alias_components_recursive, Component}; | |
| 4 | use rustc_type_ir::outlives::{Component, compute_alias_components_recursive}; | |
| 5 | 5 | use smallvec::smallvec; |
| 6 | 6 | use tracing::{debug, instrument, trace}; |
| 7 | 7 |
compiler/rustc_infer/src/infer/relate/combine.rs+1-1| ... | ... | @@ -30,7 +30,7 @@ use super::glb::Glb; |
| 30 | 30 | use super::lub::Lub; |
| 31 | 31 | use super::type_relating::TypeRelating; |
| 32 | 32 | use super::{RelateResult, StructurallyRelateAliases}; |
| 33 | use crate::infer::{relate, DefineOpaqueTypes, InferCtxt, TypeTrace}; | |
| 33 | use crate::infer::{DefineOpaqueTypes, InferCtxt, TypeTrace, relate}; | |
| 34 | 34 | use crate::traits::{Obligation, PredicateObligation}; |
| 35 | 35 | |
| 36 | 36 | #[derive(Clone)] |
compiler/rustc_infer/src/infer/relate/generalize.rs+1-1| ... | ... | @@ -17,7 +17,7 @@ use super::{ |
| 17 | 17 | PredicateEmittingRelation, Relate, RelateResult, StructurallyRelateAliases, TypeRelation, |
| 18 | 18 | }; |
| 19 | 19 | use crate::infer::type_variable::TypeVariableValue; |
| 20 | use crate::infer::{relate, InferCtxt, RegionVariableOrigin}; | |
| 20 | use crate::infer::{InferCtxt, RegionVariableOrigin, relate}; | |
| 21 | 21 | |
| 22 | 22 | impl<'tcx> InferCtxt<'tcx> { |
| 23 | 23 | /// The idea is that we should ensure that the type variable `target_vid` |
compiler/rustc_infer/src/infer/relate/glb.rs+1-1| ... | ... | @@ -6,9 +6,9 @@ use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt}; |
| 6 | 6 | use rustc_span::Span; |
| 7 | 7 | use tracing::{debug, instrument}; |
| 8 | 8 | |
| 9 | use super::StructurallyRelateAliases; | |
| 9 | 10 | use super::combine::{CombineFields, PredicateEmittingRelation}; |
| 10 | 11 | use super::lattice::{self, LatticeDir}; |
| 11 | use super::StructurallyRelateAliases; | |
| 12 | 12 | use crate::infer::{DefineOpaqueTypes, InferCtxt, SubregionOrigin}; |
| 13 | 13 | use crate::traits::ObligationCause; |
| 14 | 14 |
compiler/rustc_infer/src/infer/relate/higher_ranked.rs+13-13| ... | ... | @@ -6,8 +6,8 @@ use rustc_middle::ty::{self, Ty, TyCtxt, TypeFoldable}; |
| 6 | 6 | use tracing::{debug, instrument}; |
| 7 | 7 | |
| 8 | 8 | use super::RelateResult; |
| 9 | use crate::infer::snapshot::CombinedSnapshot; | |
| 10 | 9 | use crate::infer::InferCtxt; |
| 10 | use crate::infer::snapshot::CombinedSnapshot; | |
| 11 | 11 | |
| 12 | 12 | impl<'tcx> InferCtxt<'tcx> { |
| 13 | 13 | /// Replaces all bound variables (lifetimes, types, and constants) bound by |
| ... | ... | @@ -34,22 +34,22 @@ impl<'tcx> InferCtxt<'tcx> { |
| 34 | 34 | |
| 35 | 35 | let delegate = FnMutDelegate { |
| 36 | 36 | regions: &mut |br: ty::BoundRegion| { |
| 37 | ty::Region::new_placeholder( | |
| 38 | self.tcx, | |
| 39 | ty::PlaceholderRegion { universe: next_universe, bound: br }, | |
| 40 | ) | |
| 37 | ty::Region::new_placeholder(self.tcx, ty::PlaceholderRegion { | |
| 38 | universe: next_universe, | |
| 39 | bound: br, | |
| 40 | }) | |
| 41 | 41 | }, |
| 42 | 42 | types: &mut |bound_ty: ty::BoundTy| { |
| 43 | Ty::new_placeholder( | |
| 44 | self.tcx, | |
| 45 | ty::PlaceholderType { universe: next_universe, bound: bound_ty }, | |
| 46 | ) | |
| 43 | Ty::new_placeholder(self.tcx, ty::PlaceholderType { | |
| 44 | universe: next_universe, | |
| 45 | bound: bound_ty, | |
| 46 | }) | |
| 47 | 47 | }, |
| 48 | 48 | consts: &mut |bound_var: ty::BoundVar| { |
| 49 | ty::Const::new_placeholder( | |
| 50 | self.tcx, | |
| 51 | ty::PlaceholderConst { universe: next_universe, bound: bound_var }, | |
| 52 | ) | |
| 49 | ty::Const::new_placeholder(self.tcx, ty::PlaceholderConst { | |
| 50 | universe: next_universe, | |
| 51 | bound: bound_var, | |
| 52 | }) | |
| 53 | 53 | }, |
| 54 | 54 | }; |
| 55 | 55 |
compiler/rustc_infer/src/infer/relate/lub.rs+1-1| ... | ... | @@ -6,9 +6,9 @@ use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt}; |
| 6 | 6 | use rustc_span::Span; |
| 7 | 7 | use tracing::{debug, instrument}; |
| 8 | 8 | |
| 9 | use super::StructurallyRelateAliases; | |
| 9 | 10 | use super::combine::{CombineFields, PredicateEmittingRelation}; |
| 10 | 11 | use super::lattice::{self, LatticeDir}; |
| 11 | use super::StructurallyRelateAliases; | |
| 12 | 12 | use crate::infer::{DefineOpaqueTypes, InferCtxt, SubregionOrigin}; |
| 13 | 13 | use crate::traits::ObligationCause; |
| 14 | 14 |
compiler/rustc_infer/src/infer/relate/type_relating.rs+2-2| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | 1 | use rustc_middle::traits::solve::Goal; |
| 2 | 2 | use rustc_middle::ty::relate::{ |
| 3 | relate_args_invariantly, relate_args_with_variances, Relate, RelateResult, TypeRelation, | |
| 3 | Relate, RelateResult, TypeRelation, relate_args_invariantly, relate_args_with_variances, | |
| 4 | 4 | }; |
| 5 | 5 | use rustc_middle::ty::{self, Ty, TyCtxt, TyVar}; |
| 6 | 6 | use rustc_span::Span; |
| 7 | 7 | use tracing::{debug, instrument}; |
| 8 | 8 | |
| 9 | 9 | use super::combine::CombineFields; |
| 10 | use crate::infer::relate::{PredicateEmittingRelation, StructurallyRelateAliases}; | |
| 11 | 10 | use crate::infer::BoundRegionConversionTime::HigherRankedType; |
| 11 | use crate::infer::relate::{PredicateEmittingRelation, StructurallyRelateAliases}; | |
| 12 | 12 | use crate::infer::{DefineOpaqueTypes, InferCtxt, SubregionOrigin}; |
| 13 | 13 | |
| 14 | 14 | /// Enforce that `a` is equal to or a subtype of `b`. |
compiler/rustc_infer/src/infer/snapshot/mod.rs+1-1| ... | ... | @@ -2,8 +2,8 @@ use rustc_data_structures::undo_log::UndoLogs; |
| 2 | 2 | use rustc_middle::ty; |
| 3 | 3 | use tracing::{debug, instrument}; |
| 4 | 4 | |
| 5 | use super::region_constraints::RegionSnapshot; | |
| 6 | 5 | use super::InferCtxt; |
| 6 | use super::region_constraints::RegionSnapshot; | |
| 7 | 7 | |
| 8 | 8 | mod fudge; |
| 9 | 9 | pub(crate) mod undo_log; |
compiler/rustc_infer/src/infer/snapshot/undo_log.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ use rustc_middle::infer::unify_key::{ConstVidKey, EffectVidKey, RegionVidKey}; |
| 6 | 6 | use rustc_middle::ty::{self, OpaqueHiddenType, OpaqueTypeKey}; |
| 7 | 7 | use tracing::debug; |
| 8 | 8 | |
| 9 | use crate::infer::{region_constraints, type_variable, InferCtxtInner}; | |
| 9 | use crate::infer::{InferCtxtInner, region_constraints, type_variable}; | |
| 10 | 10 | use crate::traits; |
| 11 | 11 | |
| 12 | 12 | pub struct Snapshot<'tcx> { |
compiler/rustc_infer/src/traits/engine.rs+6-9| ... | ... | @@ -45,15 +45,12 @@ pub trait TraitEngine<'tcx, E: 'tcx>: 'tcx { |
| 45 | 45 | cause: ObligationCause<'tcx>, |
| 46 | 46 | ) { |
| 47 | 47 | let trait_ref = ty::TraitRef::new(infcx.tcx, def_id, [ty]); |
| 48 | self.register_predicate_obligation( | |
| 49 | infcx, | |
| 50 | Obligation { | |
| 51 | cause, | |
| 52 | recursion_depth: 0, | |
| 53 | param_env, | |
| 54 | predicate: trait_ref.upcast(infcx.tcx), | |
| 55 | }, | |
| 56 | ); | |
| 48 | self.register_predicate_obligation(infcx, Obligation { | |
| 49 | cause, | |
| 50 | recursion_depth: 0, | |
| 51 | param_env, | |
| 52 | predicate: trait_ref.upcast(infcx.tcx), | |
| 53 | }); | |
| 57 | 54 | } |
| 58 | 55 | |
| 59 | 56 | fn register_predicate_obligation( |
compiler/rustc_infer/src/traits/mod.rs+2-2| ... | ... | @@ -18,14 +18,14 @@ pub use rustc_middle::traits::*; |
| 18 | 18 | use rustc_middle::ty::{self, Ty, TyCtxt, Upcast}; |
| 19 | 19 | use rustc_span::Span; |
| 20 | 20 | |
| 21 | pub use self::ImplSource::*; | |
| 22 | pub use self::SelectionError::*; | |
| 21 | 23 | pub use self::engine::{FromSolverError, ScrubbedTraitError, TraitEngine}; |
| 22 | 24 | pub(crate) use self::project::UndoLog; |
| 23 | 25 | pub use self::project::{ |
| 24 | 26 | MismatchedProjectionTypes, Normalized, NormalizedTerm, ProjectionCache, ProjectionCacheEntry, |
| 25 | 27 | ProjectionCacheKey, ProjectionCacheStorage, |
| 26 | 28 | }; |
| 27 | pub use self::ImplSource::*; | |
| 28 | pub use self::SelectionError::*; | |
| 29 | 29 | use crate::infer::InferCtxt; |
| 30 | 30 | |
| 31 | 31 | /// An `Obligation` represents some trait reference (e.g., `i32: Eq`) for |
compiler/rustc_infer/src/traits/project.rs+4-4| ... | ... | @@ -200,10 +200,10 @@ impl<'tcx> ProjectionCache<'_, 'tcx> { |
| 200 | 200 | if result.must_apply_considering_regions() { |
| 201 | 201 | ty.obligations = vec![]; |
| 202 | 202 | } |
| 203 | map.insert( | |
| 204 | key, | |
| 205 | ProjectionCacheEntry::NormalizedTerm { ty, complete: Some(result) }, | |
| 206 | ); | |
| 203 | map.insert(key, ProjectionCacheEntry::NormalizedTerm { | |
| 204 | ty, | |
| 205 | complete: Some(result), | |
| 206 | }); | |
| 207 | 207 | } |
| 208 | 208 | ref value => { |
| 209 | 209 | // Type inference could "strand behind" old cache entries. Leave |
compiler/rustc_infer/src/traits/util.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use rustc_data_structures::fx::FxHashSet; |
| 2 | 2 | use rustc_middle::ty::{self, ToPolyTraitRef, TyCtxt}; |
| 3 | use rustc_span::symbol::Ident; | |
| 4 | 3 | use rustc_span::Span; |
| 4 | use rustc_span::symbol::Ident; | |
| 5 | 5 | pub use rustc_type_ir::elaborate::*; |
| 6 | 6 | |
| 7 | 7 | use crate::traits::{self, Obligation, ObligationCauseCode, PredicateObligation}; |
compiler/rustc_interface/src/interface.rs+3-3| ... | ... | @@ -2,7 +2,7 @@ use std::path::PathBuf; |
| 2 | 2 | use std::result; |
| 3 | 3 | use std::sync::Arc; |
| 4 | 4 | |
| 5 | use rustc_ast::{token, LitKind, MetaItemKind}; | |
| 5 | use rustc_ast::{LitKind, MetaItemKind, token}; | |
| 6 | 6 | use rustc_codegen_ssa::traits::CodegenBackend; |
| 7 | 7 | use rustc_data_structures::fx::{FxHashMap, FxHashSet}; |
| 8 | 8 | use rustc_data_structures::stable_hasher::StableHasher; |
| ... | ... | @@ -21,10 +21,10 @@ use rustc_query_system::query::print_query_stack; |
| 21 | 21 | use rustc_session::config::{self, Cfg, CheckCfg, ExpectedValues, Input, OutFileName}; |
| 22 | 22 | use rustc_session::filesearch::{self, sysroot_candidates}; |
| 23 | 23 | use rustc_session::parse::ParseSess; |
| 24 | use rustc_session::{lint, CompilerIO, EarlyDiagCtxt, Session}; | |
| 24 | use rustc_session::{CompilerIO, EarlyDiagCtxt, Session, lint}; | |
| 25 | use rustc_span::FileName; | |
| 25 | 26 | use rustc_span::source_map::{FileLoader, RealFileLoader, SourceMapInputs}; |
| 26 | 27 | use rustc_span::symbol::sym; |
| 27 | use rustc_span::FileName; | |
| 28 | 28 | use tracing::trace; |
| 29 | 29 | |
| 30 | 30 | use crate::util; |
compiler/rustc_interface/src/lib.rs+1-1| ... | ... | @@ -14,7 +14,7 @@ mod queries; |
| 14 | 14 | pub mod util; |
| 15 | 15 | |
| 16 | 16 | pub use callbacks::setup_callbacks; |
| 17 | pub use interface::{run_compiler, Config}; | |
| 17 | pub use interface::{Config, run_compiler}; | |
| 18 | 18 | pub use passes::DEFAULT_QUERY_PROVIDERS; |
| 19 | 19 | pub use queries::{Linker, Queries}; |
| 20 | 20 |
compiler/rustc_interface/src/passes.rs+12-16| ... | ... | @@ -13,10 +13,10 @@ use rustc_data_structures::sync::{AppendOnlyIndexVec, FreezeLock, Lrc, OnceLock, |
| 13 | 13 | use rustc_expand::base::{ExtCtxt, LintStoreExpand}; |
| 14 | 14 | use rustc_feature::Features; |
| 15 | 15 | use rustc_fs_util::try_canonicalize; |
| 16 | use rustc_hir::def_id::{StableCrateId, StableCrateIdMap, LOCAL_CRATE}; | |
| 16 | use rustc_hir::def_id::{LOCAL_CRATE, StableCrateId, StableCrateIdMap}; | |
| 17 | 17 | use rustc_hir::definitions::Definitions; |
| 18 | 18 | use rustc_incremental::setup_dep_graph; |
| 19 | use rustc_lint::{unerased_lint_store, BufferedEarlyLint, EarlyCheckNode, LintStore}; | |
| 19 | use rustc_lint::{BufferedEarlyLint, EarlyCheckNode, LintStore, unerased_lint_store}; | |
| 20 | 20 | use rustc_metadata::creader::CStore; |
| 21 | 21 | use rustc_middle::arena::Arena; |
| 22 | 22 | use rustc_middle::ty::{self, GlobalCtxt, RegisteredTools, TyCtxt}; |
| ... | ... | @@ -32,8 +32,8 @@ use rustc_session::cstore::Untracked; |
| 32 | 32 | use rustc_session::output::{collect_crate_types, filename_for_input, find_crate_name}; |
| 33 | 33 | use rustc_session::search_paths::PathKind; |
| 34 | 34 | use rustc_session::{Limit, Session}; |
| 35 | use rustc_span::symbol::{sym, Symbol}; | |
| 36 | 35 | use rustc_span::FileName; |
| 36 | use rustc_span::symbol::{Symbol, sym}; | |
| 37 | 37 | use rustc_target::spec::PanicStrategy; |
| 38 | 38 | use rustc_trait_selection::traits; |
| 39 | 39 | use tracing::{info, instrument}; |
| ... | ... | @@ -980,19 +980,15 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> { |
| 980 | 980 | std::ops::ControlFlow::Continue::<std::convert::Infallible>(()) |
| 981 | 981 | }); |
| 982 | 982 | |
| 983 | sess.code_stats.record_vtable_size( | |
| 984 | tr, | |
| 985 | &name, | |
| 986 | VTableSizeInfo { | |
| 987 | trait_name: name.clone(), | |
| 988 | entries: entries_ignoring_upcasting + entries_for_upcasting, | |
| 989 | entries_ignoring_upcasting, | |
| 990 | entries_for_upcasting, | |
| 991 | upcasting_cost_percent: entries_for_upcasting as f64 | |
| 992 | / entries_ignoring_upcasting as f64 | |
| 993 | * 100., | |
| 994 | }, | |
| 995 | ) | |
| 983 | sess.code_stats.record_vtable_size(tr, &name, VTableSizeInfo { | |
| 984 | trait_name: name.clone(), | |
| 985 | entries: entries_ignoring_upcasting + entries_for_upcasting, | |
| 986 | entries_ignoring_upcasting, | |
| 987 | entries_for_upcasting, | |
| 988 | upcasting_cost_percent: entries_for_upcasting as f64 | |
| 989 | / entries_ignoring_upcasting as f64 | |
| 990 | * 100., | |
| 991 | }) | |
| 996 | 992 | } |
| 997 | 993 | } |
| 998 | 994 |
compiler/rustc_interface/src/queries.rs+2-2| ... | ... | @@ -3,8 +3,8 @@ use std::cell::{RefCell, RefMut}; |
| 3 | 3 | use std::sync::Arc; |
| 4 | 4 | |
| 5 | 5 | use rustc_ast as ast; |
| 6 | use rustc_codegen_ssa::traits::CodegenBackend; | |
| 7 | 6 | use rustc_codegen_ssa::CodegenResults; |
| 7 | use rustc_codegen_ssa::traits::CodegenBackend; | |
| 8 | 8 | use rustc_data_structures::steal::Steal; |
| 9 | 9 | use rustc_data_structures::svh::Svh; |
| 10 | 10 | use rustc_data_structures::sync::{OnceLock, WorkerLocal}; |
| ... | ... | @@ -13,8 +13,8 @@ use rustc_middle::arena::Arena; |
| 13 | 13 | use rustc_middle::dep_graph::DepGraph; |
| 14 | 14 | use rustc_middle::ty::{GlobalCtxt, TyCtxt}; |
| 15 | 15 | use rustc_serialize::opaque::FileEncodeResult; |
| 16 | use rustc_session::config::{self, OutputFilenames, OutputType}; | |
| 17 | 16 | use rustc_session::Session; |
| 17 | use rustc_session::config::{self, OutputFilenames, OutputType}; | |
| 18 | 18 | |
| 19 | 19 | use crate::errors::FailedWritingFile; |
| 20 | 20 | use crate::interface::{Compiler, Result}; |
compiler/rustc_interface/src/tests.rs+10-10| ... | ... | @@ -6,22 +6,22 @@ use std::sync::Arc; |
| 6 | 6 | |
| 7 | 7 | use rustc_data_structures::profiling::TimePassesFormat; |
| 8 | 8 | use rustc_errors::emitter::HumanReadableErrorType; |
| 9 | use rustc_errors::{registry, ColorConfig}; | |
| 9 | use rustc_errors::{ColorConfig, registry}; | |
| 10 | 10 | use rustc_session::config::{ |
| 11 | build_configuration, build_session_options, rustc_optgroups, BranchProtection, CFGuard, Cfg, | |
| 12 | CollapseMacroDebuginfo, CoverageLevel, CoverageOptions, DebugInfo, DumpMonoStatsFormat, | |
| 13 | ErrorOutputType, ExternEntry, ExternLocation, Externs, FmtDebug, FunctionReturn, | |
| 14 | InliningThreshold, Input, InstrumentCoverage, InstrumentXRay, LinkSelfContained, | |
| 15 | LinkerPluginLto, LocationDetail, LtoCli, MirIncludeSpans, NextSolverConfig, OomStrategy, | |
| 16 | Options, OutFileName, OutputType, OutputTypes, PAuthKey, PacRet, Passes, | |
| 11 | BranchProtection, CFGuard, Cfg, CollapseMacroDebuginfo, CoverageLevel, CoverageOptions, | |
| 12 | DebugInfo, DumpMonoStatsFormat, ErrorOutputType, ExternEntry, ExternLocation, Externs, | |
| 13 | FmtDebug, FunctionReturn, InliningThreshold, Input, InstrumentCoverage, InstrumentXRay, | |
| 14 | LinkSelfContained, LinkerPluginLto, LocationDetail, LtoCli, MirIncludeSpans, NextSolverConfig, | |
| 15 | OomStrategy, Options, OutFileName, OutputType, OutputTypes, PAuthKey, PacRet, Passes, | |
| 17 | 16 | PatchableFunctionEntry, Polonius, ProcMacroExecutionStrategy, Strip, SwitchWithOptPath, |
| 18 | SymbolManglingVersion, WasiExecModel, | |
| 17 | SymbolManglingVersion, WasiExecModel, build_configuration, build_session_options, | |
| 18 | rustc_optgroups, | |
| 19 | 19 | }; |
| 20 | 20 | use rustc_session::lint::Level; |
| 21 | 21 | use rustc_session::search_paths::SearchPath; |
| 22 | 22 | use rustc_session::utils::{CanonicalizedPath, NativeLib, NativeLibKind}; |
| 23 | use rustc_session::{build_session, filesearch, getopts, CompilerIO, EarlyDiagCtxt, Session}; | |
| 24 | use rustc_span::edition::{Edition, DEFAULT_EDITION}; | |
| 23 | use rustc_session::{CompilerIO, EarlyDiagCtxt, Session, build_session, filesearch, getopts}; | |
| 24 | use rustc_span::edition::{DEFAULT_EDITION, Edition}; | |
| 25 | 25 | use rustc_span::source_map::{RealFileLoader, SourceMapInputs}; |
| 26 | 26 | use rustc_span::symbol::sym; |
| 27 | 27 | use rustc_span::{FileName, SourceFileHashAlgorithm}; |
compiler/rustc_interface/src/util.rs+6-6| ... | ... | @@ -1,21 +1,21 @@ |
| 1 | 1 | use std::env::consts::{DLL_PREFIX, DLL_SUFFIX}; |
| 2 | 2 | use std::path::{Path, PathBuf}; |
| 3 | use std::sync::atomic::{AtomicBool, Ordering}; | |
| 4 | 3 | use std::sync::OnceLock; |
| 4 | use std::sync::atomic::{AtomicBool, Ordering}; | |
| 5 | 5 | use std::{env, iter, thread}; |
| 6 | 6 | |
| 7 | 7 | use rustc_ast as ast; |
| 8 | 8 | use rustc_codegen_ssa::traits::CodegenBackend; |
| 9 | 9 | #[cfg(parallel_compiler)] |
| 10 | 10 | use rustc_data_structures::sync; |
| 11 | use rustc_metadata::{load_symbol_from_dylib, DylibError}; | |
| 11 | use rustc_metadata::{DylibError, load_symbol_from_dylib}; | |
| 12 | 12 | use rustc_middle::ty::CurrentGcx; |
| 13 | 13 | use rustc_parse::validate_attr; |
| 14 | use rustc_session::config::{host_triple, Cfg, OutFileName, OutputFilenames, OutputTypes}; | |
| 14 | use rustc_session::config::{Cfg, OutFileName, OutputFilenames, OutputTypes, host_triple}; | |
| 15 | 15 | use rustc_session::filesearch::sysroot_candidates; |
| 16 | 16 | use rustc_session::lint::{self, BuiltinLintDiag, LintBuffer}; |
| 17 | use rustc_session::output::{categorize_crate_type, CRATE_TYPES}; | |
| 18 | use rustc_session::{filesearch, EarlyDiagCtxt, Session}; | |
| 17 | use rustc_session::output::{CRATE_TYPES, categorize_crate_type}; | |
| 18 | use rustc_session::{EarlyDiagCtxt, Session, filesearch}; | |
| 19 | 19 | use rustc_span::edit_distance::find_best_match_for_name; |
| 20 | 20 | use rustc_span::edition::Edition; |
| 21 | 21 | use rustc_span::source_map::SourceMapInputs; |
| ... | ... | @@ -143,7 +143,7 @@ pub(crate) fn run_in_thread_pool_with_globals<F: FnOnce(CurrentGcx) -> R + Send, |
| 143 | 143 | use rustc_data_structures::{defer, jobserver}; |
| 144 | 144 | use rustc_middle::ty::tls; |
| 145 | 145 | use rustc_query_impl::QueryCtxt; |
| 146 | use rustc_query_system::query::{break_query_cycles, QueryContext}; | |
| 146 | use rustc_query_system::query::{QueryContext, break_query_cycles}; | |
| 147 | 147 | |
| 148 | 148 | let thread_stack_size = init_stack_size(thread_builder_diag); |
| 149 | 149 |
compiler/rustc_lexer/src/tests.rs+11-26| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use expect_test::{expect, Expect}; | |
| 1 | use expect_test::{Expect, expect}; | |
| 2 | 2 | |
| 3 | 3 | use super::*; |
| 4 | 4 | |
| ... | ... | @@ -141,9 +141,7 @@ fn check_lexing(src: &str, expect: Expect) { |
| 141 | 141 | |
| 142 | 142 | #[test] |
| 143 | 143 | fn smoke_test() { |
| 144 | check_lexing( | |
| 145 | "/* my source file */ fn main() { println!(\"zebra\"); }\n", | |
| 146 | expect![[r#" | |
| 144 | check_lexing("/* my source file */ fn main() { println!(\"zebra\"); }\n", expect![[r#" | |
| 147 | 145 | Token { kind: BlockComment { doc_style: None, terminated: true }, len: 20 } |
| 148 | 146 | Token { kind: Whitespace, len: 1 } |
| 149 | 147 | Token { kind: Ident, len: 2 } |
| ... | ... | @@ -163,8 +161,7 @@ fn smoke_test() { |
| 163 | 161 | Token { kind: Whitespace, len: 1 } |
| 164 | 162 | Token { kind: CloseBrace, len: 1 } |
| 165 | 163 | Token { kind: Whitespace, len: 1 } |
| 166 | "#]], | |
| 167 | ) | |
| 164 | "#]]) | |
| 168 | 165 | } |
| 169 | 166 | |
| 170 | 167 | #[test] |
| ... | ... | @@ -207,47 +204,35 @@ fn comment_flavors() { |
| 207 | 204 | |
| 208 | 205 | #[test] |
| 209 | 206 | fn nested_block_comments() { |
| 210 | check_lexing( | |
| 211 | "/* /* */ */'a'", | |
| 212 | expect![[r#" | |
| 207 | check_lexing("/* /* */ */'a'", expect![[r#" | |
| 213 | 208 | Token { kind: BlockComment { doc_style: None, terminated: true }, len: 11 } |
| 214 | 209 | Token { kind: Literal { kind: Char { terminated: true }, suffix_start: 3 }, len: 3 } |
| 215 | "#]], | |
| 216 | ) | |
| 210 | "#]]) | |
| 217 | 211 | } |
| 218 | 212 | |
| 219 | 213 | #[test] |
| 220 | 214 | fn characters() { |
| 221 | check_lexing( | |
| 222 | "'a' ' ' '\\n'", | |
| 223 | expect![[r#" | |
| 215 | check_lexing("'a' ' ' '\\n'", expect![[r#" | |
| 224 | 216 | Token { kind: Literal { kind: Char { terminated: true }, suffix_start: 3 }, len: 3 } |
| 225 | 217 | Token { kind: Whitespace, len: 1 } |
| 226 | 218 | Token { kind: Literal { kind: Char { terminated: true }, suffix_start: 3 }, len: 3 } |
| 227 | 219 | Token { kind: Whitespace, len: 1 } |
| 228 | 220 | Token { kind: Literal { kind: Char { terminated: true }, suffix_start: 4 }, len: 4 } |
| 229 | "#]], | |
| 230 | ); | |
| 221 | "#]]); | |
| 231 | 222 | } |
| 232 | 223 | |
| 233 | 224 | #[test] |
| 234 | 225 | fn lifetime() { |
| 235 | check_lexing( | |
| 236 | "'abc", | |
| 237 | expect![[r#" | |
| 226 | check_lexing("'abc", expect![[r#" | |
| 238 | 227 | Token { kind: Lifetime { starts_with_number: false }, len: 4 } |
| 239 | "#]], | |
| 240 | ); | |
| 228 | "#]]); | |
| 241 | 229 | } |
| 242 | 230 | |
| 243 | 231 | #[test] |
| 244 | 232 | fn raw_string() { |
| 245 | check_lexing( | |
| 246 | "r###\"\"#a\\b\x00c\"\"###", | |
| 247 | expect![[r#" | |
| 233 | check_lexing("r###\"\"#a\\b\x00c\"\"###", expect![[r#" | |
| 248 | 234 | Token { kind: Literal { kind: RawStr { n_hashes: Some(3) }, suffix_start: 17 }, len: 17 } |
| 249 | "#]], | |
| 250 | ) | |
| 235 | "#]]) | |
| 251 | 236 | } |
| 252 | 237 | |
| 253 | 238 | #[test] |
compiler/rustc_lexer/src/unescape/tests.rs+6-9| ... | ... | @@ -108,15 +108,12 @@ fn test_unescape_str_warn() { |
| 108 | 108 | check("\\\n", &[]); |
| 109 | 109 | check("\\\n ", &[]); |
| 110 | 110 | |
| 111 | check( | |
| 112 | "\\\n \u{a0} x", | |
| 113 | &[ | |
| 114 | (0..5, Err(EscapeError::UnskippedWhitespaceWarning)), | |
| 115 | (3..5, Ok('\u{a0}')), | |
| 116 | (5..6, Ok(' ')), | |
| 117 | (6..7, Ok('x')), | |
| 118 | ], | |
| 119 | ); | |
| 111 | check("\\\n \u{a0} x", &[ | |
| 112 | (0..5, Err(EscapeError::UnskippedWhitespaceWarning)), | |
| 113 | (3..5, Ok('\u{a0}')), | |
| 114 | (5..6, Ok(' ')), | |
| 115 | (6..7, Ok('x')), | |
| 116 | ]); | |
| 120 | 117 | check("\\\n \n x", &[(0..7, Err(EscapeError::MultipleSkippedLinesWarning)), (7..8, Ok('x'))]); |
| 121 | 118 | } |
| 122 | 119 |
compiler/rustc_lint/src/builtin.rs+95-128| ... | ... | @@ -28,10 +28,10 @@ use rustc_ast::visit::{FnCtxt, FnKind}; |
| 28 | 28 | use rustc_ast::{self as ast, *}; |
| 29 | 29 | use rustc_ast_pretty::pprust::{self, expr_to_string}; |
| 30 | 30 | use rustc_errors::{Applicability, LintDiagnostic}; |
| 31 | use rustc_feature::{deprecated_attributes, AttributeGate, BuiltinAttribute, GateIssue, Stability}; | |
| 31 | use rustc_feature::{AttributeGate, BuiltinAttribute, GateIssue, Stability, deprecated_attributes}; | |
| 32 | 32 | use rustc_hir as hir; |
| 33 | 33 | use rustc_hir::def::{DefKind, Res}; |
| 34 | use rustc_hir::def_id::{DefId, LocalDefId, CRATE_DEF_ID}; | |
| 34 | use rustc_hir::def_id::{CRATE_DEF_ID, DefId, LocalDefId}; | |
| 35 | 35 | use rustc_hir::intravisit::FnKind as HirFnKind; |
| 36 | 36 | use rustc_hir::{Body, FnDecl, GenericParamKind, PatKind, PredicateOrigin}; |
| 37 | 37 | use rustc_middle::bug; |
| ... | ... | @@ -39,13 +39,13 @@ use rustc_middle::lint::in_external_macro; |
| 39 | 39 | use rustc_middle::ty::layout::LayoutOf; |
| 40 | 40 | use rustc_middle::ty::print::with_no_trimmed_paths; |
| 41 | 41 | use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt, Upcast, VariantDef}; |
| 42 | use rustc_session::lint::FutureIncompatibilityReason; | |
| 42 | 43 | // hardwired lints from rustc_lint_defs |
| 43 | 44 | pub use rustc_session::lint::builtin::*; |
| 44 | use rustc_session::lint::FutureIncompatibilityReason; | |
| 45 | 45 | use rustc_session::{declare_lint, declare_lint_pass, impl_lint_pass}; |
| 46 | 46 | use rustc_span::edition::Edition; |
| 47 | 47 | use rustc_span::source_map::Spanned; |
| 48 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 48 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 49 | 49 | use rustc_span::{BytePos, InnerSpan, Span}; |
| 50 | 50 | use rustc_target::abi::Abi; |
| 51 | 51 | use rustc_target::asm::InlineAsmArch; |
| ... | ... | @@ -68,10 +68,10 @@ use crate::lints::{ |
| 68 | 68 | BuiltinUnsafe, BuiltinUnstableFeatures, BuiltinUnusedDocComment, BuiltinUnusedDocCommentSub, |
| 69 | 69 | BuiltinWhileTrue, InvalidAsmLabel, |
| 70 | 70 | }; |
| 71 | use crate::nonstandard_style::{method_context, MethodLateContext}; | |
| 71 | use crate::nonstandard_style::{MethodLateContext, method_context}; | |
| 72 | 72 | use crate::{ |
| 73 | fluent_generated as fluent, EarlyContext, EarlyLintPass, LateContext, LateLintPass, Level, | |
| 74 | LintContext, | |
| 73 | EarlyContext, EarlyLintPass, LateContext, LateLintPass, Level, LintContext, | |
| 74 | fluent_generated as fluent, | |
| 75 | 75 | }; |
| 76 | 76 | |
| 77 | 77 | declare_lint! { |
| ... | ... | @@ -120,11 +120,10 @@ impl EarlyLintPass for WhileTrue { |
| 120 | 120 | "{}loop", |
| 121 | 121 | label.map_or_else(String::new, |label| format!("{}: ", label.ident,)) |
| 122 | 122 | ); |
| 123 | cx.emit_span_lint( | |
| 124 | WHILE_TRUE, | |
| 125 | condition_span, | |
| 126 | BuiltinWhileTrue { suggestion: condition_span, replace }, | |
| 127 | ); | |
| 123 | cx.emit_span_lint(WHILE_TRUE, condition_span, BuiltinWhileTrue { | |
| 124 | suggestion: condition_span, | |
| 125 | replace, | |
| 126 | }); | |
| 128 | 127 | } |
| 129 | 128 | } |
| 130 | 129 | } |
| ... | ... | @@ -436,11 +435,10 @@ impl MissingDoc { |
| 436 | 435 | let attrs = cx.tcx.hir().attrs(cx.tcx.local_def_id_to_hir_id(def_id)); |
| 437 | 436 | let has_doc = attrs.iter().any(has_doc); |
| 438 | 437 | if !has_doc { |
| 439 | cx.emit_span_lint( | |
| 440 | MISSING_DOCS, | |
| 441 | cx.tcx.def_span(def_id), | |
| 442 | BuiltinMissingDoc { article, desc }, | |
| 443 | ); | |
| 438 | cx.emit_span_lint(MISSING_DOCS, cx.tcx.def_span(def_id), BuiltinMissingDoc { | |
| 439 | article, | |
| 440 | desc, | |
| 441 | }); | |
| 444 | 442 | } |
| 445 | 443 | } |
| 446 | 444 | } |
| ... | ... | @@ -721,11 +719,10 @@ impl<'tcx> LateLintPass<'tcx> for MissingDebugImplementations { |
| 721 | 719 | .next() |
| 722 | 720 | .is_some(); |
| 723 | 721 | if !has_impl { |
| 724 | cx.emit_span_lint( | |
| 725 | MISSING_DEBUG_IMPLEMENTATIONS, | |
| 726 | item.span, | |
| 727 | BuiltinMissingDebugImpl { tcx: cx.tcx, def_id: debug }, | |
| 728 | ); | |
| 722 | cx.emit_span_lint(MISSING_DEBUG_IMPLEMENTATIONS, item.span, BuiltinMissingDebugImpl { | |
| 723 | tcx: cx.tcx, | |
| 724 | def_id: debug, | |
| 725 | }); | |
| 729 | 726 | } |
| 730 | 727 | } |
| 731 | 728 | } |
| ... | ... | @@ -847,24 +844,21 @@ impl EarlyLintPass for DeprecatedAttr { |
| 847 | 844 | BuiltinDeprecatedAttrLinkSuggestion::Default { suggestion: attr.span } |
| 848 | 845 | } |
| 849 | 846 | }; |
| 850 | cx.emit_span_lint( | |
| 851 | DEPRECATED, | |
| 852 | attr.span, | |
| 853 | BuiltinDeprecatedAttrLink { name, reason, link, suggestion }, | |
| 854 | ); | |
| 847 | cx.emit_span_lint(DEPRECATED, attr.span, BuiltinDeprecatedAttrLink { | |
| 848 | name, | |
| 849 | reason, | |
| 850 | link, | |
| 851 | suggestion, | |
| 852 | }); | |
| 855 | 853 | } |
| 856 | 854 | return; |
| 857 | 855 | } |
| 858 | 856 | } |
| 859 | 857 | if attr.has_name(sym::no_start) || attr.has_name(sym::crate_id) { |
| 860 | cx.emit_span_lint( | |
| 861 | DEPRECATED, | |
| 862 | attr.span, | |
| 863 | BuiltinDeprecatedAttrUsed { | |
| 864 | name: pprust::path_to_string(&attr.get_normal_item().path), | |
| 865 | suggestion: attr.span, | |
| 866 | }, | |
| 867 | ); | |
| 858 | cx.emit_span_lint(DEPRECATED, attr.span, BuiltinDeprecatedAttrUsed { | |
| 859 | name: pprust::path_to_string(&attr.get_normal_item().path), | |
| 860 | suggestion: attr.span, | |
| 861 | }); | |
| 868 | 862 | } |
| 869 | 863 | } |
| 870 | 864 | } |
| ... | ... | @@ -899,11 +893,11 @@ fn warn_if_doc(cx: &EarlyContext<'_>, node_span: Span, node_kind: &str, attrs: & |
| 899 | 893 | BuiltinUnusedDocCommentSub::BlockHelp |
| 900 | 894 | } |
| 901 | 895 | }; |
| 902 | cx.emit_span_lint( | |
| 903 | UNUSED_DOC_COMMENTS, | |
| 904 | span, | |
| 905 | BuiltinUnusedDocComment { kind: node_kind, label: node_span, sub }, | |
| 906 | ); | |
| 896 | cx.emit_span_lint(UNUSED_DOC_COMMENTS, span, BuiltinUnusedDocComment { | |
| 897 | kind: node_kind, | |
| 898 | label: node_span, | |
| 899 | sub, | |
| 900 | }); | |
| 907 | 901 | } |
| 908 | 902 | } |
| 909 | 903 | } |
| ... | ... | @@ -1033,11 +1027,9 @@ impl<'tcx> LateLintPass<'tcx> for InvalidNoMangleItems { |
| 1033 | 1027 | match param.kind { |
| 1034 | 1028 | GenericParamKind::Lifetime { .. } => {} |
| 1035 | 1029 | GenericParamKind::Type { .. } | GenericParamKind::Const { .. } => { |
| 1036 | cx.emit_span_lint( | |
| 1037 | NO_MANGLE_GENERIC_ITEMS, | |
| 1038 | span, | |
| 1039 | BuiltinNoMangleGeneric { suggestion: no_mangle_attr.span }, | |
| 1040 | ); | |
| 1030 | cx.emit_span_lint(NO_MANGLE_GENERIC_ITEMS, span, BuiltinNoMangleGeneric { | |
| 1031 | suggestion: no_mangle_attr.span, | |
| 1032 | }); | |
| 1041 | 1033 | break; |
| 1042 | 1034 | } |
| 1043 | 1035 | } |
| ... | ... | @@ -1064,11 +1056,9 @@ impl<'tcx> LateLintPass<'tcx> for InvalidNoMangleItems { |
| 1064 | 1056 | |
| 1065 | 1057 | // Const items do not refer to a particular location in memory, and therefore |
| 1066 | 1058 | // don't have anything to attach a symbol to |
| 1067 | cx.emit_span_lint( | |
| 1068 | NO_MANGLE_CONST_ITEMS, | |
| 1069 | it.span, | |
| 1070 | BuiltinConstNoMangle { suggestion }, | |
| 1071 | ); | |
| 1059 | cx.emit_span_lint(NO_MANGLE_CONST_ITEMS, it.span, BuiltinConstNoMangle { | |
| 1060 | suggestion, | |
| 1061 | }); | |
| 1072 | 1062 | } |
| 1073 | 1063 | } |
| 1074 | 1064 | hir::ItemKind::Impl(hir::Impl { generics, items, .. }) => { |
| ... | ... | @@ -1316,15 +1306,11 @@ impl UnreachablePub { |
| 1316 | 1306 | applicability = Applicability::MaybeIncorrect; |
| 1317 | 1307 | } |
| 1318 | 1308 | let def_span = cx.tcx.def_span(def_id); |
| 1319 | cx.emit_span_lint( | |
| 1320 | UNREACHABLE_PUB, | |
| 1321 | def_span, | |
| 1322 | BuiltinUnreachablePub { | |
| 1323 | what, | |
| 1324 | suggestion: (vis_span, applicability), | |
| 1325 | help: exportable, | |
| 1326 | }, | |
| 1327 | ); | |
| 1309 | cx.emit_span_lint(UNREACHABLE_PUB, def_span, BuiltinUnreachablePub { | |
| 1310 | what, | |
| 1311 | suggestion: (vis_span, applicability), | |
| 1312 | help: exportable, | |
| 1313 | }); | |
| 1328 | 1314 | } |
| 1329 | 1315 | } |
| 1330 | 1316 | } |
| ... | ... | @@ -1468,32 +1454,24 @@ impl<'tcx> LateLintPass<'tcx> for TypeAliasBounds { |
| 1468 | 1454 | let enable_feat_help = cx.tcx.sess.is_nightly_build(); |
| 1469 | 1455 | |
| 1470 | 1456 | if let [.., label_sp] = *where_spans { |
| 1471 | cx.emit_span_lint( | |
| 1472 | TYPE_ALIAS_BOUNDS, | |
| 1473 | where_spans, | |
| 1474 | BuiltinTypeAliasBounds { | |
| 1475 | in_where_clause: true, | |
| 1476 | label: label_sp, | |
| 1477 | enable_feat_help, | |
| 1478 | suggestions: vec![(generics.where_clause_span, String::new())], | |
| 1479 | preds: generics.predicates, | |
| 1480 | ty: ty.take(), | |
| 1481 | }, | |
| 1482 | ); | |
| 1457 | cx.emit_span_lint(TYPE_ALIAS_BOUNDS, where_spans, BuiltinTypeAliasBounds { | |
| 1458 | in_where_clause: true, | |
| 1459 | label: label_sp, | |
| 1460 | enable_feat_help, | |
| 1461 | suggestions: vec![(generics.where_clause_span, String::new())], | |
| 1462 | preds: generics.predicates, | |
| 1463 | ty: ty.take(), | |
| 1464 | }); | |
| 1483 | 1465 | } |
| 1484 | 1466 | if let [.., label_sp] = *inline_spans { |
| 1485 | cx.emit_span_lint( | |
| 1486 | TYPE_ALIAS_BOUNDS, | |
| 1487 | inline_spans, | |
| 1488 | BuiltinTypeAliasBounds { | |
| 1489 | in_where_clause: false, | |
| 1490 | label: label_sp, | |
| 1491 | enable_feat_help, | |
| 1492 | suggestions: inline_sugg, | |
| 1493 | preds: generics.predicates, | |
| 1494 | ty, | |
| 1495 | }, | |
| 1496 | ); | |
| 1467 | cx.emit_span_lint(TYPE_ALIAS_BOUNDS, inline_spans, BuiltinTypeAliasBounds { | |
| 1468 | in_where_clause: false, | |
| 1469 | label: label_sp, | |
| 1470 | enable_feat_help, | |
| 1471 | suggestions: inline_sugg, | |
| 1472 | preds: generics.predicates, | |
| 1473 | ty, | |
| 1474 | }); | |
| 1497 | 1475 | } |
| 1498 | 1476 | } |
| 1499 | 1477 | } |
| ... | ... | @@ -1579,11 +1557,10 @@ impl<'tcx> LateLintPass<'tcx> for TrivialConstraints { |
| 1579 | 1557 | | ClauseKind::ConstEvaluatable(..) => continue, |
| 1580 | 1558 | }; |
| 1581 | 1559 | if predicate.is_global() { |
| 1582 | cx.emit_span_lint( | |
| 1583 | TRIVIAL_BOUNDS, | |
| 1584 | span, | |
| 1585 | BuiltinTrivialBounds { predicate_kind_name, predicate }, | |
| 1586 | ); | |
| 1560 | cx.emit_span_lint(TRIVIAL_BOUNDS, span, BuiltinTrivialBounds { | |
| 1561 | predicate_kind_name, | |
| 1562 | predicate, | |
| 1563 | }); | |
| 1587 | 1564 | } |
| 1588 | 1565 | } |
| 1589 | 1566 | } |
| ... | ... | @@ -1899,11 +1876,12 @@ impl KeywordIdents { |
| 1899 | 1876 | return; |
| 1900 | 1877 | } |
| 1901 | 1878 | |
| 1902 | cx.emit_span_lint( | |
| 1903 | lint, | |
| 1904 | ident.span, | |
| 1905 | BuiltinKeywordIdents { kw: ident, next: edition, suggestion: ident.span, prefix }, | |
| 1906 | ); | |
| 1879 | cx.emit_span_lint(lint, ident.span, BuiltinKeywordIdents { | |
| 1880 | kw: ident, | |
| 1881 | next: edition, | |
| 1882 | suggestion: ident.span, | |
| 1883 | prefix, | |
| 1884 | }); | |
| 1907 | 1885 | } |
| 1908 | 1886 | } |
| 1909 | 1887 | |
| ... | ... | @@ -2322,11 +2300,11 @@ impl EarlyLintPass for IncompleteInternalFeatures { |
| 2322 | 2300 | let help = |
| 2323 | 2301 | HAS_MIN_FEATURES.contains(&name).then_some(BuiltinIncompleteFeaturesHelp); |
| 2324 | 2302 | |
| 2325 | cx.emit_span_lint( | |
| 2326 | INCOMPLETE_FEATURES, | |
| 2327 | span, | |
| 2328 | BuiltinIncompleteFeatures { name, note, help }, | |
| 2329 | ); | |
| 2303 | cx.emit_span_lint(INCOMPLETE_FEATURES, span, BuiltinIncompleteFeatures { | |
| 2304 | name, | |
| 2305 | note, | |
| 2306 | help, | |
| 2307 | }); | |
| 2330 | 2308 | } else { |
| 2331 | 2309 | cx.emit_span_lint(INTERNAL_FEATURES, span, BuiltinInternalFeatures { name }); |
| 2332 | 2310 | } |
| ... | ... | @@ -2647,17 +2625,13 @@ impl<'tcx> LateLintPass<'tcx> for InvalidValue { |
| 2647 | 2625 | InitKind::Uninit => fluent::lint_builtin_unpermitted_type_init_uninit, |
| 2648 | 2626 | }; |
| 2649 | 2627 | let sub = BuiltinUnpermittedTypeInitSub { err }; |
| 2650 | cx.emit_span_lint( | |
| 2651 | INVALID_VALUE, | |
| 2652 | expr.span, | |
| 2653 | BuiltinUnpermittedTypeInit { | |
| 2654 | msg, | |
| 2655 | ty: conjured_ty, | |
| 2656 | label: expr.span, | |
| 2657 | sub, | |
| 2658 | tcx: cx.tcx, | |
| 2659 | }, | |
| 2660 | ); | |
| 2628 | cx.emit_span_lint(INVALID_VALUE, expr.span, BuiltinUnpermittedTypeInit { | |
| 2629 | msg, | |
| 2630 | ty: conjured_ty, | |
| 2631 | label: expr.span, | |
| 2632 | sub, | |
| 2633 | tcx: cx.tcx, | |
| 2634 | }); | |
| 2661 | 2635 | } |
| 2662 | 2636 | } |
| 2663 | 2637 | } |
| ... | ... | @@ -2735,11 +2709,9 @@ impl<'tcx> LateLintPass<'tcx> for DerefNullPtr { |
| 2735 | 2709 | |
| 2736 | 2710 | if let rustc_hir::ExprKind::Unary(rustc_hir::UnOp::Deref, expr_deref) = expr.kind { |
| 2737 | 2711 | if is_null_ptr(cx, expr_deref) { |
| 2738 | cx.emit_span_lint( | |
| 2739 | DEREF_NULLPTR, | |
| 2740 | expr.span, | |
| 2741 | BuiltinDerefNullptr { label: expr.span }, | |
| 2742 | ); | |
| 2712 | cx.emit_span_lint(DEREF_NULLPTR, expr.span, BuiltinDerefNullptr { | |
| 2713 | label: expr.span, | |
| 2714 | }); | |
| 2743 | 2715 | } |
| 2744 | 2716 | } |
| 2745 | 2717 | } |
| ... | ... | @@ -2956,18 +2928,14 @@ impl<'tcx> LateLintPass<'tcx> for AsmLabels { |
| 2956 | 2928 | let span = span.unwrap_or(*template_span); |
| 2957 | 2929 | match label_kind { |
| 2958 | 2930 | AsmLabelKind::Named => { |
| 2959 | cx.emit_span_lint( | |
| 2960 | NAMED_ASM_LABELS, | |
| 2961 | span, | |
| 2962 | InvalidAsmLabel::Named { missing_precise_span }, | |
| 2963 | ); | |
| 2931 | cx.emit_span_lint(NAMED_ASM_LABELS, span, InvalidAsmLabel::Named { | |
| 2932 | missing_precise_span, | |
| 2933 | }); | |
| 2964 | 2934 | } |
| 2965 | 2935 | AsmLabelKind::FormatArg => { |
| 2966 | cx.emit_span_lint( | |
| 2967 | NAMED_ASM_LABELS, | |
| 2968 | span, | |
| 2969 | InvalidAsmLabel::FormatArg { missing_precise_span }, | |
| 2970 | ); | |
| 2936 | cx.emit_span_lint(NAMED_ASM_LABELS, span, InvalidAsmLabel::FormatArg { | |
| 2937 | missing_precise_span, | |
| 2938 | }); | |
| 2971 | 2939 | } |
| 2972 | 2940 | // the binary asm issue only occurs when using intel syntax on x86 targets |
| 2973 | 2941 | AsmLabelKind::Binary |
| ... | ... | @@ -2977,11 +2945,10 @@ impl<'tcx> LateLintPass<'tcx> for AsmLabels { |
| 2977 | 2945 | Some(InlineAsmArch::X86 | InlineAsmArch::X86_64) | None |
| 2978 | 2946 | ) => |
| 2979 | 2947 | { |
| 2980 | cx.emit_span_lint( | |
| 2981 | BINARY_ASM_LABELS, | |
| 2948 | cx.emit_span_lint(BINARY_ASM_LABELS, span, InvalidAsmLabel::Binary { | |
| 2949 | missing_precise_span, | |
| 2982 | 2950 | span, |
| 2983 | InvalidAsmLabel::Binary { missing_precise_span, span }, | |
| 2984 | ) | |
| 2951 | }) | |
| 2985 | 2952 | } |
| 2986 | 2953 | // No lint on anything other than x86 |
| 2987 | 2954 | AsmLabelKind::Binary => (), |
compiler/rustc_lint/src/context.rs+13-19| ... | ... | @@ -29,15 +29,15 @@ use rustc_hir::definitions::{DefPathData, DisambiguatedDefPathData}; |
| 29 | 29 | use rustc_middle::bug; |
| 30 | 30 | use rustc_middle::middle::privacy::EffectiveVisibilities; |
| 31 | 31 | use rustc_middle::ty::layout::{LayoutError, LayoutOfHelpers, TyAndLayout}; |
| 32 | use rustc_middle::ty::print::{with_no_trimmed_paths, PrintError, PrintTraitRefExt as _, Printer}; | |
| 32 | use rustc_middle::ty::print::{PrintError, PrintTraitRefExt as _, Printer, with_no_trimmed_paths}; | |
| 33 | 33 | use rustc_middle::ty::{self, GenericArg, RegisteredTools, Ty, TyCtxt}; |
| 34 | 34 | use rustc_session::lint::{ |
| 35 | 35 | BuiltinLintDiag, FutureIncompatibleInfo, Level, Lint, LintBuffer, LintExpectationId, LintId, |
| 36 | 36 | }; |
| 37 | 37 | use rustc_session::{LintStoreMarker, Session}; |
| 38 | use rustc_span::edit_distance::find_best_match_for_names; | |
| 39 | use rustc_span::symbol::{sym, Ident, Symbol}; | |
| 40 | 38 | use rustc_span::Span; |
| 39 | use rustc_span::edit_distance::find_best_match_for_names; | |
| 40 | use rustc_span::symbol::{Ident, Symbol, sym}; | |
| 41 | 41 | use rustc_target::abi; |
| 42 | 42 | use tracing::debug; |
| 43 | 43 | |
| ... | ... | @@ -251,14 +251,11 @@ impl LintStore { |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | pub fn register_group_alias(&mut self, lint_name: &'static str, alias: &'static str) { |
| 254 | self.lint_groups.insert( | |
| 255 | alias, | |
| 256 | LintGroup { | |
| 257 | lint_ids: vec![], | |
| 258 | is_externally_loaded: false, | |
| 259 | depr: Some(LintAlias { name: lint_name, silent: true }), | |
| 260 | }, | |
| 261 | ); | |
| 254 | self.lint_groups.insert(alias, LintGroup { | |
| 255 | lint_ids: vec![], | |
| 256 | is_externally_loaded: false, | |
| 257 | depr: Some(LintAlias { name: lint_name, silent: true }), | |
| 258 | }); | |
| 262 | 259 | } |
| 263 | 260 | |
| 264 | 261 | pub fn register_group( |
| ... | ... | @@ -273,14 +270,11 @@ impl LintStore { |
| 273 | 270 | .insert(name, LintGroup { lint_ids: to, is_externally_loaded, depr: None }) |
| 274 | 271 | .is_none(); |
| 275 | 272 | if let Some(deprecated) = deprecated_name { |
| 276 | self.lint_groups.insert( | |
| 277 | deprecated, | |
| 278 | LintGroup { | |
| 279 | lint_ids: vec![], | |
| 280 | is_externally_loaded, | |
| 281 | depr: Some(LintAlias { name, silent: false }), | |
| 282 | }, | |
| 283 | ); | |
| 273 | self.lint_groups.insert(deprecated, LintGroup { | |
| 274 | lint_ids: vec![], | |
| 275 | is_externally_loaded, | |
| 276 | depr: Some(LintAlias { name, silent: false }), | |
| 277 | }); | |
| 284 | 278 | } |
| 285 | 279 | |
| 286 | 280 | if !new { |
compiler/rustc_lint/src/context/diagnostics.rs+3-3| ... | ... | @@ -5,13 +5,13 @@ use std::borrow::Cow; |
| 5 | 5 | |
| 6 | 6 | use rustc_ast::util::unicode::TEXT_FLOW_CONTROL_CHARS; |
| 7 | 7 | use rustc_errors::{ |
| 8 | elided_lifetime_in_path_suggestion, Applicability, Diag, DiagArgValue, LintDiagnostic, | |
| 8 | Applicability, Diag, DiagArgValue, LintDiagnostic, elided_lifetime_in_path_suggestion, | |
| 9 | 9 | }; |
| 10 | 10 | use rustc_middle::middle::stability; |
| 11 | use rustc_session::lint::{BuiltinLintDiag, ElidedLifetimeResolution}; | |
| 12 | 11 | use rustc_session::Session; |
| 13 | use rustc_span::symbol::kw; | |
| 12 | use rustc_session::lint::{BuiltinLintDiag, ElidedLifetimeResolution}; | |
| 14 | 13 | use rustc_span::BytePos; |
| 14 | use rustc_span::symbol::kw; | |
| 15 | 15 | use tracing::debug; |
| 16 | 16 | |
| 17 | 17 | use crate::lints::{self, ElidedNamedLifetime}; |
compiler/rustc_lint/src/context/diagnostics/check_cfg.rs+2-2| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | use rustc_middle::bug; |
| 2 | use rustc_session::config::ExpectedValues; | |
| 3 | 2 | use rustc_session::Session; |
| 3 | use rustc_session::config::ExpectedValues; | |
| 4 | 4 | use rustc_span::edit_distance::find_best_match_for_name; |
| 5 | 5 | use rustc_span::symbol::Ident; |
| 6 | use rustc_span::{sym, Span, Symbol}; | |
| 6 | use rustc_span::{Span, Symbol, sym}; | |
| 7 | 7 | |
| 8 | 8 | use crate::lints; |
| 9 | 9 |
compiler/rustc_lint/src/deref_into_dyn_supertrait.rs+8-13| ... | ... | @@ -86,19 +86,14 @@ impl<'tcx> LateLintPass<'tcx> for DerefIntoDynSupertrait { |
| 86 | 86 | .find_map(|i| (i.ident.name == sym::Target).then_some(i.span)) |
| 87 | 87 | .map(|label| SupertraitAsDerefTargetLabel { label }); |
| 88 | 88 | let span = tcx.def_span(item.owner_id.def_id); |
| 89 | cx.emit_span_lint( | |
| 90 | DEREF_INTO_DYN_SUPERTRAIT, | |
| 91 | span, | |
| 92 | SupertraitAsDerefTarget { | |
| 93 | self_ty, | |
| 94 | supertrait_principal: supertrait_principal.map_bound(|trait_ref| { | |
| 95 | ty::ExistentialTraitRef::erase_self_ty(tcx, trait_ref) | |
| 96 | }), | |
| 97 | target_principal, | |
| 98 | label: span, | |
| 99 | label2, | |
| 100 | }, | |
| 101 | ); | |
| 89 | cx.emit_span_lint(DEREF_INTO_DYN_SUPERTRAIT, span, SupertraitAsDerefTarget { | |
| 90 | self_ty, | |
| 91 | supertrait_principal: supertrait_principal | |
| 92 | .map_bound(|trait_ref| ty::ExistentialTraitRef::erase_self_ty(tcx, trait_ref)), | |
| 93 | target_principal, | |
| 94 | label: span, | |
| 95 | label2, | |
| 96 | }); | |
| 102 | 97 | } |
| 103 | 98 | } |
| 104 | 99 | } |
compiler/rustc_lint/src/drop_forget_useless.rs+20-32| ... | ... | @@ -163,44 +163,32 @@ impl<'tcx> LateLintPass<'tcx> for DropForgetUseless { |
| 163 | 163 | }; |
| 164 | 164 | match fn_name { |
| 165 | 165 | sym::mem_drop if arg_ty.is_ref() && !drop_is_single_call_in_arm => { |
| 166 | cx.emit_span_lint( | |
| 167 | DROPPING_REFERENCES, | |
| 168 | expr.span, | |
| 169 | DropRefDiag { arg_ty, label: arg.span, sugg: let_underscore_ignore_sugg() }, | |
| 170 | ); | |
| 166 | cx.emit_span_lint(DROPPING_REFERENCES, expr.span, DropRefDiag { | |
| 167 | arg_ty, | |
| 168 | label: arg.span, | |
| 169 | sugg: let_underscore_ignore_sugg(), | |
| 170 | }); | |
| 171 | 171 | } |
| 172 | 172 | sym::mem_forget if arg_ty.is_ref() => { |
| 173 | cx.emit_span_lint( | |
| 174 | FORGETTING_REFERENCES, | |
| 175 | expr.span, | |
| 176 | ForgetRefDiag { | |
| 177 | arg_ty, | |
| 178 | label: arg.span, | |
| 179 | sugg: let_underscore_ignore_sugg(), | |
| 180 | }, | |
| 181 | ); | |
| 173 | cx.emit_span_lint(FORGETTING_REFERENCES, expr.span, ForgetRefDiag { | |
| 174 | arg_ty, | |
| 175 | label: arg.span, | |
| 176 | sugg: let_underscore_ignore_sugg(), | |
| 177 | }); | |
| 182 | 178 | } |
| 183 | 179 | sym::mem_drop if is_copy && !drop_is_single_call_in_arm => { |
| 184 | cx.emit_span_lint( | |
| 185 | DROPPING_COPY_TYPES, | |
| 186 | expr.span, | |
| 187 | DropCopyDiag { | |
| 188 | arg_ty, | |
| 189 | label: arg.span, | |
| 190 | sugg: let_underscore_ignore_sugg(), | |
| 191 | }, | |
| 192 | ); | |
| 180 | cx.emit_span_lint(DROPPING_COPY_TYPES, expr.span, DropCopyDiag { | |
| 181 | arg_ty, | |
| 182 | label: arg.span, | |
| 183 | sugg: let_underscore_ignore_sugg(), | |
| 184 | }); | |
| 193 | 185 | } |
| 194 | 186 | sym::mem_forget if is_copy => { |
| 195 | cx.emit_span_lint( | |
| 196 | FORGETTING_COPY_TYPES, | |
| 197 | expr.span, | |
| 198 | ForgetCopyDiag { | |
| 199 | arg_ty, | |
| 200 | label: arg.span, | |
| 201 | sugg: let_underscore_ignore_sugg(), | |
| 202 | }, | |
| 203 | ); | |
| 187 | cx.emit_span_lint(FORGETTING_COPY_TYPES, expr.span, ForgetCopyDiag { | |
| 188 | arg_ty, | |
| 189 | label: arg.span, | |
| 190 | sugg: let_underscore_ignore_sugg(), | |
| 191 | }); | |
| 204 | 192 | } |
| 205 | 193 | sym::mem_drop |
| 206 | 194 | if let ty::Adt(adt, _) = arg_ty.kind() |
compiler/rustc_lint/src/early.rs+3-3| ... | ... | @@ -15,15 +15,15 @@ |
| 15 | 15 | //! for all lint attributes. |
| 16 | 16 | |
| 17 | 17 | use rustc_ast::ptr::P; |
| 18 | use rustc_ast::visit::{self as ast_visit, walk_list, Visitor}; | |
| 18 | use rustc_ast::visit::{self as ast_visit, Visitor, walk_list}; | |
| 19 | 19 | use rustc_ast::{self as ast, HasAttrs}; |
| 20 | 20 | use rustc_data_structures::stack::ensure_sufficient_stack; |
| 21 | 21 | use rustc_feature::Features; |
| 22 | 22 | use rustc_middle::ty::RegisteredTools; |
| 23 | use rustc_session::lint::{BufferedEarlyLint, LintBuffer, LintPass}; | |
| 24 | 23 | use rustc_session::Session; |
| 25 | use rustc_span::symbol::Ident; | |
| 24 | use rustc_session::lint::{BufferedEarlyLint, LintBuffer, LintPass}; | |
| 26 | 25 | use rustc_span::Span; |
| 26 | use rustc_span::symbol::Ident; | |
| 27 | 27 | use tracing::debug; |
| 28 | 28 | |
| 29 | 29 | use crate::context::{EarlyContext, LintStore}; |
compiler/rustc_lint/src/enum_intrinsics_non_enums.rs+6-7| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | use rustc_hir as hir; |
| 2 | use rustc_middle::ty::visit::TypeVisitableExt; | |
| 3 | 2 | use rustc_middle::ty::Ty; |
| 3 | use rustc_middle::ty::visit::TypeVisitableExt; | |
| 4 | 4 | use rustc_session::{declare_lint, declare_lint_pass}; |
| 5 | use rustc_span::symbol::sym; | |
| 6 | 5 | use rustc_span::Span; |
| 6 | use rustc_span::symbol::sym; | |
| 7 | 7 | |
| 8 | 8 | use crate::context::LintContext; |
| 9 | 9 | use crate::lints::{EnumIntrinsicsMemDiscriminate, EnumIntrinsicsMemVariant}; |
| ... | ... | @@ -55,11 +55,10 @@ fn enforce_mem_discriminant( |
| 55 | 55 | ) { |
| 56 | 56 | let ty_param = cx.typeck_results().node_args(func_expr.hir_id).type_at(0); |
| 57 | 57 | if is_non_enum(ty_param) { |
| 58 | cx.emit_span_lint( | |
| 59 | ENUM_INTRINSICS_NON_ENUMS, | |
| 60 | expr_span, | |
| 61 | EnumIntrinsicsMemDiscriminate { ty_param, note: args_span }, | |
| 62 | ); | |
| 58 | cx.emit_span_lint(ENUM_INTRINSICS_NON_ENUMS, expr_span, EnumIntrinsicsMemDiscriminate { | |
| 59 | ty_param, | |
| 60 | note: args_span, | |
| 61 | }); | |
| 63 | 62 | } |
| 64 | 63 | } |
| 65 | 64 |
compiler/rustc_lint/src/expect.rs+1-1| ... | ... | @@ -3,8 +3,8 @@ use rustc_hir::CRATE_OWNER_ID; |
| 3 | 3 | use rustc_middle::lint::LintExpectation; |
| 4 | 4 | use rustc_middle::query::Providers; |
| 5 | 5 | use rustc_middle::ty::TyCtxt; |
| 6 | use rustc_session::lint::builtin::UNFULFILLED_LINT_EXPECTATIONS; | |
| 7 | 6 | use rustc_session::lint::LintExpectationId; |
| 7 | use rustc_session::lint::builtin::UNFULFILLED_LINT_EXPECTATIONS; | |
| 8 | 8 | use rustc_span::Symbol; |
| 9 | 9 | |
| 10 | 10 | use crate::lints::{Expectation, ExpectationNote}; |
compiler/rustc_lint/src/for_loops_over_fallibles.rs+9-6| ... | ... | @@ -4,7 +4,7 @@ use rustc_infer::infer::TyCtxtInferExt; |
| 4 | 4 | use rustc_infer::traits::ObligationCause; |
| 5 | 5 | use rustc_middle::ty; |
| 6 | 6 | use rustc_session::{declare_lint, declare_lint_pass}; |
| 7 | use rustc_span::{sym, Span}; | |
| 7 | use rustc_span::{Span, sym}; | |
| 8 | 8 | use rustc_trait_selection::traits::ObligationCtxt; |
| 9 | 9 | |
| 10 | 10 | use crate::lints::{ |
| ... | ... | @@ -96,11 +96,14 @@ impl<'tcx> LateLintPass<'tcx> for ForLoopsOverFallibles { |
| 96 | 96 | end_span: pat.span.between(arg.span), |
| 97 | 97 | }; |
| 98 | 98 | |
| 99 | cx.emit_span_lint( | |
| 100 | FOR_LOOPS_OVER_FALLIBLES, | |
| 101 | arg.span, | |
| 102 | ForLoopsOverFalliblesDiag { article, ref_prefix, ty, sub, question_mark, suggestion }, | |
| 103 | ); | |
| 99 | cx.emit_span_lint(FOR_LOOPS_OVER_FALLIBLES, arg.span, ForLoopsOverFalliblesDiag { | |
| 100 | article, | |
| 101 | ref_prefix, | |
| 102 | ty, | |
| 103 | sub, | |
| 104 | question_mark, | |
| 105 | suggestion, | |
| 106 | }); | |
| 104 | 107 | } |
| 105 | 108 | } |
| 106 | 109 |
compiler/rustc_lint/src/foreign_modules.rs+2-2| ... | ... | @@ -5,12 +5,12 @@ use rustc_hir::def::DefKind; |
| 5 | 5 | use rustc_middle::query::Providers; |
| 6 | 6 | use rustc_middle::ty::{self, AdtDef, Instance, Ty, TyCtxt}; |
| 7 | 7 | use rustc_session::declare_lint; |
| 8 | use rustc_span::{sym, Span, Symbol}; | |
| 8 | use rustc_span::{Span, Symbol, sym}; | |
| 9 | 9 | use rustc_target::abi::FIRST_VARIANT; |
| 10 | 10 | use tracing::{debug, instrument}; |
| 11 | 11 | |
| 12 | 12 | use crate::lints::{BuiltinClashingExtern, BuiltinClashingExternSub}; |
| 13 | use crate::{types, LintVec}; | |
| 13 | use crate::{LintVec, types}; | |
| 14 | 14 | |
| 15 | 15 | pub(crate) fn provide(providers: &mut Providers) { |
| 16 | 16 | *providers = Providers { clashing_extern_declarations, ..*providers }; |
compiler/rustc_lint/src/hidden_unicode_codepoints.rs+8-6| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use ast::util::unicode::{contains_text_flow_control_chars, TEXT_FLOW_CONTROL_CHARS}; | |
| 1 | use ast::util::unicode::{TEXT_FLOW_CONTROL_CHARS, contains_text_flow_control_chars}; | |
| 2 | 2 | use rustc_ast as ast; |
| 3 | 3 | use rustc_session::{declare_lint, declare_lint_pass}; |
| 4 | 4 | use rustc_span::{BytePos, Span, Symbol}; |
| ... | ... | @@ -73,11 +73,13 @@ impl HiddenUnicodeCodepoints { |
| 73 | 73 | HiddenUnicodeCodepointsDiagSub::NoEscape { spans } |
| 74 | 74 | }; |
| 75 | 75 | |
| 76 | cx.emit_span_lint( | |
| 77 | TEXT_DIRECTION_CODEPOINT_IN_LITERAL, | |
| 78 | span, | |
| 79 | HiddenUnicodeCodepointsDiag { label, count, span_label: span, labels, sub }, | |
| 80 | ); | |
| 76 | cx.emit_span_lint(TEXT_DIRECTION_CODEPOINT_IN_LITERAL, span, HiddenUnicodeCodepointsDiag { | |
| 77 | label, | |
| 78 | count, | |
| 79 | span_label: span, | |
| 80 | labels, | |
| 81 | sub, | |
| 82 | }); | |
| 81 | 83 | } |
| 82 | 84 | } |
| 83 | 85 | impl EarlyLintPass for HiddenUnicodeCodepoints { |
compiler/rustc_lint/src/if_let_rescope.rs+15-20| ... | ... | @@ -11,8 +11,8 @@ use rustc_macros::LintDiagnostic; |
| 11 | 11 | use rustc_middle::ty::TyCtxt; |
| 12 | 12 | use rustc_session::lint::{FutureIncompatibilityReason, Level}; |
| 13 | 13 | use rustc_session::{declare_lint, impl_lint_pass}; |
| 14 | use rustc_span::edition::Edition; | |
| 15 | 14 | use rustc_span::Span; |
| 15 | use rustc_span::edition::Edition; | |
| 16 | 16 | |
| 17 | 17 | use crate::{LateContext, LateLintPass}; |
| 18 | 18 | |
| ... | ... | @@ -210,25 +210,20 @@ impl IfLetRescope { |
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 | if let Some((span, hir_id)) = first_if_to_lint { |
| 213 | tcx.emit_node_span_lint( | |
| 214 | IF_LET_RESCOPE, | |
| 215 | hir_id, | |
| 216 | span, | |
| 217 | IfLetRescopeLint { | |
| 218 | significant_droppers, | |
| 219 | lifetime_ends, | |
| 220 | rewrite: first_if_to_rewrite.then_some(IfLetRescopeRewrite { | |
| 221 | match_heads, | |
| 222 | consequent_heads, | |
| 223 | closing_brackets: ClosingBrackets { | |
| 224 | span: expr_end, | |
| 225 | count: closing_brackets, | |
| 226 | empty_alt, | |
| 227 | }, | |
| 228 | alt_heads, | |
| 229 | }), | |
| 230 | }, | |
| 231 | ); | |
| 213 | tcx.emit_node_span_lint(IF_LET_RESCOPE, hir_id, span, IfLetRescopeLint { | |
| 214 | significant_droppers, | |
| 215 | lifetime_ends, | |
| 216 | rewrite: first_if_to_rewrite.then_some(IfLetRescopeRewrite { | |
| 217 | match_heads, | |
| 218 | consequent_heads, | |
| 219 | closing_brackets: ClosingBrackets { | |
| 220 | span: expr_end, | |
| 221 | count: closing_brackets, | |
| 222 | empty_alt, | |
| 223 | }, | |
| 224 | alt_heads, | |
| 225 | }), | |
| 226 | }); | |
| 232 | 227 | } |
| 233 | 228 | } |
| 234 | 229 | } |
compiler/rustc_lint/src/impl_trait_overcaptures.rs+10-8| ... | ... | @@ -7,12 +7,12 @@ use rustc_errors::{Applicability, LintDiagnostic}; |
| 7 | 7 | use rustc_hir as hir; |
| 8 | 8 | use rustc_hir::def::DefKind; |
| 9 | 9 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| 10 | use rustc_infer::infer::outlives::env::OutlivesEnvironment; | |
| 11 | 10 | use rustc_infer::infer::TyCtxtInferExt; |
| 11 | use rustc_infer::infer::outlives::env::OutlivesEnvironment; | |
| 12 | 12 | use rustc_macros::LintDiagnostic; |
| 13 | 13 | use rustc_middle::middle::resolve_bound_vars::ResolvedArg; |
| 14 | 14 | use rustc_middle::ty::relate::{ |
| 15 | structurally_relate_consts, structurally_relate_tys, Relate, RelateResult, TypeRelation, | |
| 15 | Relate, RelateResult, TypeRelation, structurally_relate_consts, structurally_relate_tys, | |
| 16 | 16 | }; |
| 17 | 17 | use rustc_middle::ty::{ |
| 18 | 18 | self, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor, |
| ... | ... | @@ -22,10 +22,10 @@ use rustc_session::lint::FutureIncompatibilityReason; |
| 22 | 22 | use rustc_session::{declare_lint, declare_lint_pass}; |
| 23 | 23 | use rustc_span::edition::Edition; |
| 24 | 24 | use rustc_span::{Span, Symbol}; |
| 25 | use rustc_trait_selection::traits::outlives_bounds::InferCtxtExt; | |
| 26 | 25 | use rustc_trait_selection::traits::ObligationCtxt; |
| 26 | use rustc_trait_selection::traits::outlives_bounds::InferCtxtExt; | |
| 27 | 27 | |
| 28 | use crate::{fluent_generated as fluent, LateContext, LateLintPass}; | |
| 28 | use crate::{LateContext, LateLintPass, fluent_generated as fluent}; | |
| 29 | 29 | |
| 30 | 30 | declare_lint! { |
| 31 | 31 | /// The `impl_trait_overcaptures` lint warns against cases where lifetime |
| ... | ... | @@ -309,10 +309,12 @@ where |
| 309 | 309 | // We only computed variance of lifetimes... |
| 310 | 310 | debug_assert_matches!(self.tcx.def_kind(def_id), DefKind::LifetimeParam); |
| 311 | 311 | let uncaptured = match *kind { |
| 312 | ParamKind::Early(name, index) => ty::Region::new_early_param( | |
| 313 | self.tcx, | |
| 314 | ty::EarlyParamRegion { name, index }, | |
| 315 | ), | |
| 312 | ParamKind::Early(name, index) => { | |
| 313 | ty::Region::new_early_param(self.tcx, ty::EarlyParamRegion { | |
| 314 | name, | |
| 315 | index, | |
| 316 | }) | |
| 317 | } | |
| 316 | 318 | ParamKind::Free(def_id, name) => ty::Region::new_late_param( |
| 317 | 319 | self.tcx, |
| 318 | 320 | self.parent_def_id.to_def_id(), |
compiler/rustc_lint/src/internal.rs+25-37| ... | ... | @@ -10,9 +10,9 @@ use rustc_hir::{ |
| 10 | 10 | }; |
| 11 | 11 | use rustc_middle::ty::{self, GenericArgsRef, Ty as MiddleTy}; |
| 12 | 12 | use rustc_session::{declare_lint_pass, declare_tool_lint}; |
| 13 | use rustc_span::hygiene::{ExpnKind, MacroKind}; | |
| 14 | use rustc_span::symbol::{kw, sym, Symbol}; | |
| 15 | 13 | use rustc_span::Span; |
| 14 | use rustc_span::hygiene::{ExpnKind, MacroKind}; | |
| 15 | use rustc_span::symbol::{Symbol, kw, sym}; | |
| 16 | 16 | use tracing::debug; |
| 17 | 17 | |
| 18 | 18 | use crate::lints::{ |
| ... | ... | @@ -48,11 +48,10 @@ impl LateLintPass<'_> for DefaultHashTypes { |
| 48 | 48 | Some(sym::HashSet) => "FxHashSet", |
| 49 | 49 | _ => return, |
| 50 | 50 | }; |
| 51 | cx.emit_span_lint( | |
| 52 | DEFAULT_HASH_TYPES, | |
| 53 | path.span, | |
| 54 | DefaultHashTypesDiag { preferred, used: cx.tcx.item_name(def_id) }, | |
| 55 | ); | |
| 51 | cx.emit_span_lint(DEFAULT_HASH_TYPES, path.span, DefaultHashTypesDiag { | |
| 52 | preferred, | |
| 53 | used: cx.tcx.item_name(def_id), | |
| 54 | }); | |
| 56 | 55 | } |
| 57 | 56 | } |
| 58 | 57 | |
| ... | ... | @@ -107,18 +106,14 @@ impl LateLintPass<'_> for QueryStability { |
| 107 | 106 | if let Ok(Some(instance)) = ty::Instance::try_resolve(cx.tcx, cx.param_env, def_id, args) { |
| 108 | 107 | let def_id = instance.def_id(); |
| 109 | 108 | if cx.tcx.has_attr(def_id, sym::rustc_lint_query_instability) { |
| 110 | cx.emit_span_lint( | |
| 111 | POTENTIAL_QUERY_INSTABILITY, | |
| 112 | span, | |
| 113 | QueryInstability { query: cx.tcx.item_name(def_id) }, | |
| 114 | ); | |
| 109 | cx.emit_span_lint(POTENTIAL_QUERY_INSTABILITY, span, QueryInstability { | |
| 110 | query: cx.tcx.item_name(def_id), | |
| 111 | }); | |
| 115 | 112 | } |
| 116 | 113 | if cx.tcx.has_attr(def_id, sym::rustc_lint_untracked_query_information) { |
| 117 | cx.emit_span_lint( | |
| 118 | UNTRACKED_QUERY_INFORMATION, | |
| 119 | span, | |
| 120 | QueryUntracked { method: cx.tcx.item_name(def_id) }, | |
| 121 | ); | |
| 114 | cx.emit_span_lint(UNTRACKED_QUERY_INFORMATION, span, QueryUntracked { | |
| 115 | method: cx.tcx.item_name(def_id), | |
| 116 | }); | |
| 122 | 117 | } |
| 123 | 118 | } |
| 124 | 119 | } |
| ... | ... | @@ -208,11 +203,9 @@ impl<'tcx> LateLintPass<'tcx> for TyTyKind { |
| 208 | 203 | |
| 209 | 204 | match span { |
| 210 | 205 | Some(span) => { |
| 211 | cx.emit_span_lint( | |
| 212 | USAGE_OF_TY_TYKIND, | |
| 213 | path.span, | |
| 214 | TykindKind { suggestion: span }, | |
| 215 | ); | |
| 206 | cx.emit_span_lint(USAGE_OF_TY_TYKIND, path.span, TykindKind { | |
| 207 | suggestion: span, | |
| 208 | }); | |
| 216 | 209 | } |
| 217 | 210 | None => cx.emit_span_lint(USAGE_OF_TY_TYKIND, path.span, TykindDiag), |
| 218 | 211 | } |
| ... | ... | @@ -220,11 +213,10 @@ impl<'tcx> LateLintPass<'tcx> for TyTyKind { |
| 220 | 213 | && path.segments.len() > 1 |
| 221 | 214 | && let Some(ty) = is_ty_or_ty_ctxt(cx, path) |
| 222 | 215 | { |
| 223 | cx.emit_span_lint( | |
| 224 | USAGE_OF_QUALIFIED_TY, | |
| 225 | path.span, | |
| 226 | TyQualified { ty, suggestion: path.span }, | |
| 227 | ); | |
| 216 | cx.emit_span_lint(USAGE_OF_QUALIFIED_TY, path.span, TyQualified { | |
| 217 | ty, | |
| 218 | suggestion: path.span, | |
| 219 | }); | |
| 228 | 220 | } |
| 229 | 221 | } |
| 230 | 222 | _ => {} |
| ... | ... | @@ -418,11 +410,9 @@ impl<'tcx> LateLintPass<'tcx> for ExistingDocKeyword { |
| 418 | 410 | if is_doc_keyword(keyword) { |
| 419 | 411 | return; |
| 420 | 412 | } |
| 421 | cx.emit_span_lint( | |
| 422 | EXISTING_DOC_KEYWORD, | |
| 423 | attr.span, | |
| 424 | NonExistentDocKeyword { keyword }, | |
| 425 | ); | |
| 413 | cx.emit_span_lint(EXISTING_DOC_KEYWORD, attr.span, NonExistentDocKeyword { | |
| 414 | keyword, | |
| 415 | }); | |
| 426 | 416 | } |
| 427 | 417 | } |
| 428 | 418 | } |
| ... | ... | @@ -625,11 +615,9 @@ impl LateLintPass<'_> for BadOptAccess { |
| 625 | 615 | && let Some(lit) = item.lit() |
| 626 | 616 | && let ast::LitKind::Str(val, _) = lit.kind |
| 627 | 617 | { |
| 628 | cx.emit_span_lint( | |
| 629 | BAD_OPT_ACCESS, | |
| 630 | expr.span, | |
| 631 | BadOptAccessDiag { msg: val.as_str() }, | |
| 632 | ); | |
| 618 | cx.emit_span_lint(BAD_OPT_ACCESS, expr.span, BadOptAccessDiag { | |
| 619 | msg: val.as_str(), | |
| 620 | }); | |
| 633 | 621 | } |
| 634 | 622 | } |
| 635 | 623 | } |
compiler/rustc_lint/src/late.rs+3-3| ... | ... | @@ -18,14 +18,14 @@ use std::any::Any; |
| 18 | 18 | use std::cell::Cell; |
| 19 | 19 | |
| 20 | 20 | use rustc_data_structures::stack::ensure_sufficient_stack; |
| 21 | use rustc_data_structures::sync::{join, Lrc}; | |
| 21 | use rustc_data_structures::sync::{Lrc, join}; | |
| 22 | 22 | use rustc_hir as hir; |
| 23 | 23 | use rustc_hir::def_id::{LocalDefId, LocalModDefId}; |
| 24 | use rustc_hir::{intravisit as hir_visit, HirId}; | |
| 24 | use rustc_hir::{HirId, intravisit as hir_visit}; | |
| 25 | 25 | use rustc_middle::hir::nested_filter; |
| 26 | 26 | use rustc_middle::ty::{self, TyCtxt}; |
| 27 | use rustc_session::lint::LintPass; | |
| 28 | 27 | use rustc_session::Session; |
| 28 | use rustc_session::lint::LintPass; | |
| 29 | 29 | use rustc_span::Span; |
| 30 | 30 | use tracing::debug; |
| 31 | 31 |
compiler/rustc_lint/src/let_underscore.rs+5-6| ... | ... | @@ -2,7 +2,7 @@ use rustc_errors::MultiSpan; |
| 2 | 2 | use rustc_hir as hir; |
| 3 | 3 | use rustc_middle::ty; |
| 4 | 4 | use rustc_session::{declare_lint, declare_lint_pass}; |
| 5 | use rustc_span::{sym, Symbol}; | |
| 5 | use rustc_span::{Symbol, sym}; | |
| 6 | 6 | |
| 7 | 7 | use crate::lints::{NonBindingLet, NonBindingLetSub}; |
| 8 | 8 | use crate::{LateContext, LateLintPass, LintContext}; |
| ... | ... | @@ -156,11 +156,10 @@ impl<'tcx> LateLintPass<'tcx> for LetUnderscore { |
| 156 | 156 | }; |
| 157 | 157 | if is_sync_lock { |
| 158 | 158 | let span = MultiSpan::from_span(pat.span); |
| 159 | cx.emit_span_lint( | |
| 160 | LET_UNDERSCORE_LOCK, | |
| 161 | span, | |
| 162 | NonBindingLet::SyncLock { sub, pat: pat.span }, | |
| 163 | ); | |
| 159 | cx.emit_span_lint(LET_UNDERSCORE_LOCK, span, NonBindingLet::SyncLock { | |
| 160 | sub, | |
| 161 | pat: pat.span, | |
| 162 | }); | |
| 164 | 163 | // Only emit let_underscore_drop for top-level `_` patterns. |
| 165 | 164 | } else if can_use_init.is_some() { |
| 166 | 165 | cx.emit_span_lint(LET_UNDERSCORE_DROP, local.span, NonBindingLet::DropType { sub }); |
compiler/rustc_lint/src/levels.rs+6-6| ... | ... | @@ -2,25 +2,25 @@ use rustc_ast_pretty::pprust; |
| 2 | 2 | use rustc_data_structures::fx::FxIndexMap; |
| 3 | 3 | use rustc_errors::{Diag, LintDiagnostic, MultiSpan}; |
| 4 | 4 | use rustc_feature::{Features, GateIssue}; |
| 5 | use rustc_hir::intravisit::{self, Visitor}; | |
| 6 | 5 | use rustc_hir::HirId; |
| 6 | use rustc_hir::intravisit::{self, Visitor}; | |
| 7 | 7 | use rustc_index::IndexVec; |
| 8 | 8 | use rustc_middle::bug; |
| 9 | 9 | use rustc_middle::hir::nested_filter; |
| 10 | 10 | use rustc_middle::lint::{ |
| 11 | lint_level, reveal_actual_level, LevelAndSource, LintExpectation, LintLevelSource, | |
| 12 | ShallowLintLevelMap, | |
| 11 | LevelAndSource, LintExpectation, LintLevelSource, ShallowLintLevelMap, lint_level, | |
| 12 | reveal_actual_level, | |
| 13 | 13 | }; |
| 14 | 14 | use rustc_middle::query::Providers; |
| 15 | 15 | use rustc_middle::ty::{RegisteredTools, TyCtxt}; |
| 16 | use rustc_session::Session; | |
| 16 | 17 | use rustc_session::lint::builtin::{ |
| 17 | 18 | self, FORBIDDEN_LINT_GROUPS, RENAMED_AND_REMOVED_LINTS, SINGLE_USE_LIFETIMES, |
| 18 | 19 | UNFULFILLED_LINT_EXPECTATIONS, UNKNOWN_LINTS, UNUSED_ATTRIBUTES, |
| 19 | 20 | }; |
| 20 | 21 | use rustc_session::lint::{Level, Lint, LintExpectationId, LintId}; |
| 21 | use rustc_session::Session; | |
| 22 | use rustc_span::symbol::{sym, Symbol}; | |
| 23 | use rustc_span::{Span, DUMMY_SP}; | |
| 22 | use rustc_span::symbol::{Symbol, sym}; | |
| 23 | use rustc_span::{DUMMY_SP, Span}; | |
| 24 | 24 | use tracing::{debug, instrument}; |
| 25 | 25 | use {rustc_ast as ast, rustc_hir as hir}; |
| 26 | 26 |
compiler/rustc_lint/src/lib.rs+14-19| ... | ... | @@ -133,7 +133,7 @@ pub use builtin::{MissingDoc, SoftLints}; |
| 133 | 133 | pub use context::{ |
| 134 | 134 | CheckLintNameResult, EarlyContext, FindLintError, LateContext, LintContext, LintStore, |
| 135 | 135 | }; |
| 136 | pub use early::{check_ast_node, EarlyCheckNode}; | |
| 136 | pub use early::{EarlyCheckNode, check_ast_node}; | |
| 137 | 137 | pub use late::{check_crate, late_lint_mod, unerased_lint_store}; |
| 138 | 138 | pub use passes::{EarlyLintPass, LateLintPass}; |
| 139 | 139 | pub use rustc_session::lint::Level::{self, *}; |
| ... | ... | @@ -618,24 +618,19 @@ fn register_internals(store: &mut LintStore) { |
| 618 | 618 | // `DIAGNOSTIC_OUTSIDE_OF_IMPL` here because `-Wrustc::internal` is provided to every crate and |
| 619 | 619 | // these lints will trigger all of the time - change this once migration to diagnostic structs |
| 620 | 620 | // and translation is completed |
| 621 | store.register_group( | |
| 622 | false, | |
| 623 | "rustc::internal", | |
| 624 | None, | |
| 625 | vec![ | |
| 626 | LintId::of(DEFAULT_HASH_TYPES), | |
| 627 | LintId::of(POTENTIAL_QUERY_INSTABILITY), | |
| 628 | LintId::of(UNTRACKED_QUERY_INFORMATION), | |
| 629 | LintId::of(USAGE_OF_TY_TYKIND), | |
| 630 | LintId::of(PASS_BY_VALUE), | |
| 631 | LintId::of(LINT_PASS_IMPL_WITHOUT_MACRO), | |
| 632 | LintId::of(USAGE_OF_QUALIFIED_TY), | |
| 633 | LintId::of(NON_GLOB_IMPORT_OF_TYPE_IR_INHERENT), | |
| 634 | LintId::of(EXISTING_DOC_KEYWORD), | |
| 635 | LintId::of(BAD_OPT_ACCESS), | |
| 636 | LintId::of(SPAN_USE_EQ_CTXT), | |
| 637 | ], | |
| 638 | ); | |
| 621 | store.register_group(false, "rustc::internal", None, vec![ | |
| 622 | LintId::of(DEFAULT_HASH_TYPES), | |
| 623 | LintId::of(POTENTIAL_QUERY_INSTABILITY), | |
| 624 | LintId::of(UNTRACKED_QUERY_INFORMATION), | |
| 625 | LintId::of(USAGE_OF_TY_TYKIND), | |
| 626 | LintId::of(PASS_BY_VALUE), | |
| 627 | LintId::of(LINT_PASS_IMPL_WITHOUT_MACRO), | |
| 628 | LintId::of(USAGE_OF_QUALIFIED_TY), | |
| 629 | LintId::of(NON_GLOB_IMPORT_OF_TYPE_IR_INHERENT), | |
| 630 | LintId::of(EXISTING_DOC_KEYWORD), | |
| 631 | LintId::of(BAD_OPT_ACCESS), | |
| 632 | LintId::of(SPAN_USE_EQ_CTXT), | |
| 633 | ]); | |
| 639 | 634 | } |
| 640 | 635 | |
| 641 | 636 | #[cfg(test)] |
compiler/rustc_lint/src/lints.rs+3-3| ... | ... | @@ -13,15 +13,15 @@ use rustc_hir::{self as hir, MissingLifetimeKind}; |
| 13 | 13 | use rustc_macros::{LintDiagnostic, Subdiagnostic}; |
| 14 | 14 | use rustc_middle::ty::inhabitedness::InhabitedPredicate; |
| 15 | 15 | use rustc_middle::ty::{Clause, PolyExistentialTraitRef, Ty, TyCtxt}; |
| 16 | use rustc_session::lint::AmbiguityErrorDiag; | |
| 17 | 16 | use rustc_session::Session; |
| 17 | use rustc_session::lint::AmbiguityErrorDiag; | |
| 18 | 18 | use rustc_span::edition::Edition; |
| 19 | 19 | use rustc_span::symbol::{Ident, MacroRulesNormalizedIdent}; |
| 20 | use rustc_span::{sym, Span, Symbol}; | |
| 20 | use rustc_span::{Span, Symbol, sym}; | |
| 21 | 21 | |
| 22 | 22 | use crate::builtin::{InitError, ShorthandAssocTyCollector, TypeAliasBounds}; |
| 23 | 23 | use crate::errors::{OverruledAttributeSub, RequestedLevel}; |
| 24 | use crate::{fluent_generated as fluent, LateContext}; | |
| 24 | use crate::{LateContext, fluent_generated as fluent}; | |
| 25 | 25 | |
| 26 | 26 | // array_into_iter.rs |
| 27 | 27 | #[derive(LintDiagnostic)] |
compiler/rustc_lint/src/macro_expr_fragment_specifier_2024_migration.rs+1-1| ... | ... | @@ -8,8 +8,8 @@ use rustc_span::edition::Edition; |
| 8 | 8 | use rustc_span::sym; |
| 9 | 9 | use tracing::debug; |
| 10 | 10 | |
| 11 | use crate::lints::MacroExprFragment2024; | |
| 12 | 11 | use crate::EarlyLintPass; |
| 12 | use crate::lints::MacroExprFragment2024; | |
| 13 | 13 | |
| 14 | 14 | declare_lint! { |
| 15 | 15 | /// The `edition_2024_expr_fragment_specifier` lint detects the use of |
compiler/rustc_lint/src/map_unit_fn.rs+14-28| ... | ... | @@ -60,39 +60,25 @@ impl<'tcx> LateLintPass<'tcx> for MapUnitFn { |
| 60 | 60 | let fn_ty = cx.tcx.fn_sig(id).skip_binder(); |
| 61 | 61 | let ret_ty = fn_ty.output().skip_binder(); |
| 62 | 62 | if is_unit_type(ret_ty) { |
| 63 | cx.emit_span_lint( | |
| 64 | MAP_UNIT_FN, | |
| 65 | span, | |
| 66 | MappingToUnit { | |
| 67 | function_label: cx | |
| 68 | .tcx | |
| 69 | .span_of_impl(*id) | |
| 70 | .unwrap_or(default_span), | |
| 71 | argument_label: args[0].span, | |
| 72 | map_label: arg_ty.default_span(cx.tcx), | |
| 73 | suggestion: path.ident.span, | |
| 74 | replace: "for_each".to_string(), | |
| 75 | }, | |
| 76 | ) | |
| 63 | cx.emit_span_lint(MAP_UNIT_FN, span, MappingToUnit { | |
| 64 | function_label: cx.tcx.span_of_impl(*id).unwrap_or(default_span), | |
| 65 | argument_label: args[0].span, | |
| 66 | map_label: arg_ty.default_span(cx.tcx), | |
| 67 | suggestion: path.ident.span, | |
| 68 | replace: "for_each".to_string(), | |
| 69 | }) | |
| 77 | 70 | } |
| 78 | 71 | } else if let ty::Closure(id, subs) = arg_ty.kind() { |
| 79 | 72 | let cl_ty = subs.as_closure().sig(); |
| 80 | 73 | let ret_ty = cl_ty.output().skip_binder(); |
| 81 | 74 | if is_unit_type(ret_ty) { |
| 82 | cx.emit_span_lint( | |
| 83 | MAP_UNIT_FN, | |
| 84 | span, | |
| 85 | MappingToUnit { | |
| 86 | function_label: cx | |
| 87 | .tcx | |
| 88 | .span_of_impl(*id) | |
| 89 | .unwrap_or(default_span), | |
| 90 | argument_label: args[0].span, | |
| 91 | map_label: arg_ty.default_span(cx.tcx), | |
| 92 | suggestion: path.ident.span, | |
| 93 | replace: "for_each".to_string(), | |
| 94 | }, | |
| 95 | ) | |
| 75 | cx.emit_span_lint(MAP_UNIT_FN, span, MappingToUnit { | |
| 76 | function_label: cx.tcx.span_of_impl(*id).unwrap_or(default_span), | |
| 77 | argument_label: args[0].span, | |
| 78 | map_label: arg_ty.default_span(cx.tcx), | |
| 79 | suggestion: path.ident.span, | |
| 80 | replace: "for_each".to_string(), | |
| 81 | }) | |
| 96 | 82 | } |
| 97 | 83 | } |
| 98 | 84 | } |
compiler/rustc_lint/src/methods.rs+5-6| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use rustc_hir::{Expr, ExprKind}; |
| 2 | 2 | use rustc_middle::ty; |
| 3 | 3 | use rustc_session::{declare_lint, declare_lint_pass}; |
| 4 | use rustc_span::symbol::sym; | |
| 5 | 4 | use rustc_span::Span; |
| 5 | use rustc_span::symbol::sym; | |
| 6 | 6 | |
| 7 | 7 | use crate::lints::CStringPtr; |
| 8 | 8 | use crate::{LateContext, LateLintPass, LintContext}; |
| ... | ... | @@ -58,11 +58,10 @@ fn lint_cstring_as_ptr( |
| 58 | 58 | if cx.tcx.is_diagnostic_item(sym::Result, def.did()) { |
| 59 | 59 | if let ty::Adt(adt, _) = args.type_at(0).kind() { |
| 60 | 60 | if cx.tcx.is_diagnostic_item(sym::cstring_type, adt.did()) { |
| 61 | cx.emit_span_lint( | |
| 62 | TEMPORARY_CSTRING_AS_PTR, | |
| 63 | as_ptr_span, | |
| 64 | CStringPtr { as_ptr: as_ptr_span, unwrap: unwrap.span }, | |
| 65 | ); | |
| 61 | cx.emit_span_lint(TEMPORARY_CSTRING_AS_PTR, as_ptr_span, CStringPtr { | |
| 62 | as_ptr: as_ptr_span, | |
| 63 | unwrap: unwrap.span, | |
| 64 | }); | |
| 66 | 65 | } |
| 67 | 66 | } |
| 68 | 67 | } |
compiler/rustc_lint/src/non_ascii_idents.rs+20-33| ... | ... | @@ -209,30 +209,22 @@ impl EarlyLintPass for NonAsciiIdents { |
| 209 | 209 | if codepoints.is_empty() { |
| 210 | 210 | continue; |
| 211 | 211 | } |
| 212 | cx.emit_span_lint( | |
| 213 | UNCOMMON_CODEPOINTS, | |
| 214 | sp, | |
| 215 | IdentifierUncommonCodepoints { | |
| 216 | codepoints_len: codepoints.len(), | |
| 217 | codepoints: codepoints.into_iter().map(|(c, _)| c).collect(), | |
| 218 | identifier_type: id_ty_descr, | |
| 219 | }, | |
| 220 | ); | |
| 212 | cx.emit_span_lint(UNCOMMON_CODEPOINTS, sp, IdentifierUncommonCodepoints { | |
| 213 | codepoints_len: codepoints.len(), | |
| 214 | codepoints: codepoints.into_iter().map(|(c, _)| c).collect(), | |
| 215 | identifier_type: id_ty_descr, | |
| 216 | }); | |
| 221 | 217 | } |
| 222 | 218 | |
| 223 | 219 | let remaining = chars |
| 224 | 220 | .extract_if(|(c, _)| !GeneralSecurityProfile::identifier_allowed(*c)) |
| 225 | 221 | .collect::<Vec<_>>(); |
| 226 | 222 | if !remaining.is_empty() { |
| 227 | cx.emit_span_lint( | |
| 228 | UNCOMMON_CODEPOINTS, | |
| 229 | sp, | |
| 230 | IdentifierUncommonCodepoints { | |
| 231 | codepoints_len: remaining.len(), | |
| 232 | codepoints: remaining.into_iter().map(|(c, _)| c).collect(), | |
| 233 | identifier_type: "Restricted", | |
| 234 | }, | |
| 235 | ); | |
| 223 | cx.emit_span_lint(UNCOMMON_CODEPOINTS, sp, IdentifierUncommonCodepoints { | |
| 224 | codepoints_len: remaining.len(), | |
| 225 | codepoints: remaining.into_iter().map(|(c, _)| c).collect(), | |
| 226 | identifier_type: "Restricted", | |
| 227 | }); | |
| 236 | 228 | } |
| 237 | 229 | } |
| 238 | 230 | } |
| ... | ... | @@ -261,16 +253,12 @@ impl EarlyLintPass for NonAsciiIdents { |
| 261 | 253 | .entry(skeleton_sym) |
| 262 | 254 | .and_modify(|(existing_symbol, existing_span, existing_is_ascii)| { |
| 263 | 255 | if !*existing_is_ascii || !is_ascii { |
| 264 | cx.emit_span_lint( | |
| 265 | CONFUSABLE_IDENTS, | |
| 266 | sp, | |
| 267 | ConfusableIdentifierPair { | |
| 268 | existing_sym: *existing_symbol, | |
| 269 | sym: symbol, | |
| 270 | label: *existing_span, | |
| 271 | main_label: sp, | |
| 272 | }, | |
| 273 | ); | |
| 256 | cx.emit_span_lint(CONFUSABLE_IDENTS, sp, ConfusableIdentifierPair { | |
| 257 | existing_sym: *existing_symbol, | |
| 258 | sym: symbol, | |
| 259 | label: *existing_span, | |
| 260 | main_label: sp, | |
| 261 | }); | |
| 274 | 262 | } |
| 275 | 263 | if *existing_is_ascii && !is_ascii { |
| 276 | 264 | *existing_symbol = symbol; |
| ... | ... | @@ -382,11 +370,10 @@ impl EarlyLintPass for NonAsciiIdents { |
| 382 | 370 | let char_info = format!("'{}' (U+{:04X})", ch, ch as u32); |
| 383 | 371 | includes += &char_info; |
| 384 | 372 | } |
| 385 | cx.emit_span_lint( | |
| 386 | MIXED_SCRIPT_CONFUSABLES, | |
| 387 | sp, | |
| 388 | MixedScriptConfusables { set: script_set.to_string(), includes }, | |
| 389 | ); | |
| 373 | cx.emit_span_lint(MIXED_SCRIPT_CONFUSABLES, sp, MixedScriptConfusables { | |
| 374 | set: script_set.to_string(), | |
| 375 | includes, | |
| 376 | }); | |
| 390 | 377 | } |
| 391 | 378 | } |
| 392 | 379 | } |
compiler/rustc_lint/src/non_fmt_panic.rs+6-10| ... | ... | @@ -9,11 +9,11 @@ use rustc_session::lint::FutureIncompatibilityReason; |
| 9 | 9 | use rustc_session::{declare_lint, declare_lint_pass}; |
| 10 | 10 | use rustc_span::edition::Edition; |
| 11 | 11 | use rustc_span::symbol::kw; |
| 12 | use rustc_span::{hygiene, sym, InnerSpan, Span, Symbol}; | |
| 12 | use rustc_span::{InnerSpan, Span, Symbol, hygiene, sym}; | |
| 13 | 13 | use rustc_trait_selection::infer::InferCtxtExt; |
| 14 | 14 | |
| 15 | 15 | use crate::lints::{NonFmtPanicBraces, NonFmtPanicUnused}; |
| 16 | use crate::{fluent_generated as fluent, LateContext, LateLintPass, LintContext}; | |
| 16 | use crate::{LateContext, LateLintPass, LintContext, fluent_generated as fluent}; | |
| 17 | 17 | |
| 18 | 18 | declare_lint! { |
| 19 | 19 | /// The `non_fmt_panics` lint detects `panic!(..)` invocations where the first |
| ... | ... | @@ -255,14 +255,10 @@ fn check_panic_str<'tcx>( |
| 255 | 255 | .map(|span| fmt_span.from_inner(InnerSpan::new(span.start, span.end))) |
| 256 | 256 | .collect(), |
| 257 | 257 | }; |
| 258 | cx.emit_span_lint( | |
| 259 | NON_FMT_PANICS, | |
| 260 | arg_spans, | |
| 261 | NonFmtPanicUnused { | |
| 262 | count: n_arguments, | |
| 263 | suggestion: is_arg_inside_call(arg.span, span).then_some(arg.span), | |
| 264 | }, | |
| 265 | ); | |
| 258 | cx.emit_span_lint(NON_FMT_PANICS, arg_spans, NonFmtPanicUnused { | |
| 259 | count: n_arguments, | |
| 260 | suggestion: is_arg_inside_call(arg.span, span).then_some(arg.span), | |
| 261 | }); | |
| 266 | 262 | } else { |
| 267 | 263 | let brace_spans: Option<Vec<_>> = |
| 268 | 264 | snippet.filter(|s| s.starts_with('"') || s.starts_with("r#")).map(|s| { |
compiler/rustc_lint/src/non_local_def.rs+19-23| ... | ... | @@ -10,14 +10,14 @@ use rustc_middle::ty::{ |
| 10 | 10 | use rustc_session::{declare_lint, impl_lint_pass}; |
| 11 | 11 | use rustc_span::def_id::{DefId, LOCAL_CRATE}; |
| 12 | 12 | use rustc_span::symbol::kw; |
| 13 | use rustc_span::{sym, ExpnKind, MacroKind, Span, Symbol}; | |
| 13 | use rustc_span::{ExpnKind, MacroKind, Span, Symbol, sym}; | |
| 14 | 14 | use rustc_trait_selection::error_reporting::traits::ambiguity::{ |
| 15 | compute_applicable_impls_for_diagnostics, CandidateSource, | |
| 15 | CandidateSource, compute_applicable_impls_for_diagnostics, | |
| 16 | 16 | }; |
| 17 | 17 | use rustc_trait_selection::infer::TyCtxtInferExt; |
| 18 | 18 | |
| 19 | 19 | use crate::lints::{NonLocalDefinitionsCargoUpdateNote, NonLocalDefinitionsDiag}; |
| 20 | use crate::{fluent_generated as fluent, LateContext, LateLintPass, LintContext}; | |
| 20 | use crate::{LateContext, LateLintPass, LintContext, fluent_generated as fluent}; | |
| 21 | 21 | |
| 22 | 22 | declare_lint! { |
| 23 | 23 | /// The `non_local_definitions` lint checks for `impl` blocks and `#[macro_export]` |
| ... | ... | @@ -277,26 +277,22 @@ impl<'tcx> LateLintPass<'tcx> for NonLocalDefinitions { |
| 277 | 277 | None |
| 278 | 278 | }; |
| 279 | 279 | |
| 280 | cx.emit_span_lint( | |
| 281 | NON_LOCAL_DEFINITIONS, | |
| 282 | ms, | |
| 283 | NonLocalDefinitionsDiag::Impl { | |
| 284 | depth: self.body_depth, | |
| 285 | body_kind_descr: cx.tcx.def_kind_descr(parent_def_kind, parent), | |
| 286 | body_name: parent_opt_item_name | |
| 287 | .map(|s| s.to_ident_string()) | |
| 288 | .unwrap_or_else(|| "<unnameable>".to_string()), | |
| 289 | cargo_update: cargo_update(), | |
| 290 | const_anon, | |
| 291 | self_ty_str, | |
| 292 | of_trait_str, | |
| 293 | move_to, | |
| 294 | doctest, | |
| 295 | may_remove, | |
| 296 | has_trait: impl_.of_trait.is_some(), | |
| 297 | macro_to_change, | |
| 298 | }, | |
| 299 | ) | |
| 280 | cx.emit_span_lint(NON_LOCAL_DEFINITIONS, ms, NonLocalDefinitionsDiag::Impl { | |
| 281 | depth: self.body_depth, | |
| 282 | body_kind_descr: cx.tcx.def_kind_descr(parent_def_kind, parent), | |
| 283 | body_name: parent_opt_item_name | |
| 284 | .map(|s| s.to_ident_string()) | |
| 285 | .unwrap_or_else(|| "<unnameable>".to_string()), | |
| 286 | cargo_update: cargo_update(), | |
| 287 | const_anon, | |
| 288 | self_ty_str, | |
| 289 | of_trait_str, | |
| 290 | move_to, | |
| 291 | doctest, | |
| 292 | may_remove, | |
| 293 | has_trait: impl_.of_trait.is_some(), | |
| 294 | macro_to_change, | |
| 295 | }) | |
| 300 | 296 | } |
| 301 | 297 | ItemKind::Macro(_macro, MacroKind::Bang) |
| 302 | 298 | if cx.tcx.has_attr(item.owner_id.def_id, sym::macro_export) => |
compiler/rustc_lint/src/nonstandard_style.rs+11-11| ... | ... | @@ -5,7 +5,7 @@ use rustc_middle::ty; |
| 5 | 5 | use rustc_session::config::CrateType; |
| 6 | 6 | use rustc_session::{declare_lint, declare_lint_pass}; |
| 7 | 7 | use rustc_span::def_id::LocalDefId; |
| 8 | use rustc_span::symbol::{sym, Ident}; | |
| 8 | use rustc_span::symbol::{Ident, sym}; | |
| 9 | 9 | use rustc_span::{BytePos, Span}; |
| 10 | 10 | use rustc_target::spec::abi::Abi; |
| 11 | 11 | use {rustc_ast as ast, rustc_attr as attr, rustc_hir as hir}; |
| ... | ... | @@ -151,11 +151,11 @@ impl NonCamelCaseTypes { |
| 151 | 151 | } else { |
| 152 | 152 | NonCamelCaseTypeSub::Label { span: ident.span } |
| 153 | 153 | }; |
| 154 | cx.emit_span_lint( | |
| 155 | NON_CAMEL_CASE_TYPES, | |
| 156 | ident.span, | |
| 157 | NonCamelCaseType { sort, name, sub }, | |
| 158 | ); | |
| 154 | cx.emit_span_lint(NON_CAMEL_CASE_TYPES, ident.span, NonCamelCaseType { | |
| 155 | sort, | |
| 156 | name, | |
| 157 | sub, | |
| 158 | }); | |
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | 161 | } |
| ... | ... | @@ -489,11 +489,11 @@ impl NonUpperCaseGlobals { |
| 489 | 489 | } else { |
| 490 | 490 | NonUpperCaseGlobalSub::Label { span: ident.span } |
| 491 | 491 | }; |
| 492 | cx.emit_span_lint( | |
| 493 | NON_UPPER_CASE_GLOBALS, | |
| 494 | ident.span, | |
| 495 | NonUpperCaseGlobal { sort, name, sub }, | |
| 496 | ); | |
| 492 | cx.emit_span_lint(NON_UPPER_CASE_GLOBALS, ident.span, NonUpperCaseGlobal { | |
| 493 | sort, | |
| 494 | name, | |
| 495 | sub, | |
| 496 | }); | |
| 497 | 497 | } |
| 498 | 498 | } |
| 499 | 499 | } |
compiler/rustc_lint/src/noop_method_call.rs+7-11| ... | ... | @@ -128,17 +128,13 @@ impl<'tcx> LateLintPass<'tcx> for NoopMethodCall { |
| 128 | 128 | ty::Adt(def, _) => Some(cx.tcx.def_span(def.did()).shrink_to_lo()), |
| 129 | 129 | _ => None, |
| 130 | 130 | }; |
| 131 | cx.emit_span_lint( | |
| 132 | NOOP_METHOD_CALL, | |
| 133 | span, | |
| 134 | NoopMethodCallDiag { | |
| 135 | method: call.ident.name, | |
| 136 | orig_ty, | |
| 137 | trait_, | |
| 138 | label: span, | |
| 139 | suggest_derive, | |
| 140 | }, | |
| 141 | ); | |
| 131 | cx.emit_span_lint(NOOP_METHOD_CALL, span, NoopMethodCallDiag { | |
| 132 | method: call.ident.name, | |
| 133 | orig_ty, | |
| 134 | trait_, | |
| 135 | label: span, | |
| 136 | suggest_derive, | |
| 137 | }); | |
| 142 | 138 | } else { |
| 143 | 139 | match name { |
| 144 | 140 | // If `type_of(x) == T` and `x.borrow()` is used to get `&T`, |
compiler/rustc_lint/src/opaque_hidden_inferred_bound.rs+1-1| ... | ... | @@ -5,8 +5,8 @@ use rustc_middle::ty::fold::BottomUpFolder; |
| 5 | 5 | use rustc_middle::ty::print::{PrintTraitPredicateExt as _, TraitPredPrintModifiersAndPath}; |
| 6 | 6 | use rustc_middle::ty::{self, Ty, TypeFoldable}; |
| 7 | 7 | use rustc_session::{declare_lint, declare_lint_pass}; |
| 8 | use rustc_span::symbol::kw; | |
| 9 | 8 | use rustc_span::Span; |
| 9 | use rustc_span::symbol::kw; | |
| 10 | 10 | use rustc_trait_selection::traits::{self, ObligationCtxt}; |
| 11 | 11 | |
| 12 | 12 | use crate::{LateContext, LateLintPass, LintContext}; |
compiler/rustc_lint/src/pass_by_value.rs+4-5| ... | ... | @@ -31,11 +31,10 @@ impl<'tcx> LateLintPass<'tcx> for PassByValue { |
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | if let Some(t) = path_for_pass_by_value(cx, inner_ty) { |
| 34 | cx.emit_span_lint( | |
| 35 | PASS_BY_VALUE, | |
| 36 | ty.span, | |
| 37 | PassByValueDiag { ty: t, suggestion: ty.span }, | |
| 38 | ); | |
| 34 | cx.emit_span_lint(PASS_BY_VALUE, ty.span, PassByValueDiag { | |
| 35 | ty: t, | |
| 36 | suggestion: ty.span, | |
| 37 | }); | |
| 39 | 38 | } |
| 40 | 39 | } |
| 41 | 40 | _ => {} |
compiler/rustc_lint/src/passes.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | use rustc_session::lint::builtin::HardwiredLints; | |
| 2 | 1 | use rustc_session::lint::LintPass; |
| 2 | use rustc_session::lint::builtin::HardwiredLints; | |
| 3 | 3 | |
| 4 | 4 | use crate::context::{EarlyContext, LateContext}; |
| 5 | 5 |
compiler/rustc_lint/src/redundant_semicolon.rs+4-5| ... | ... | @@ -50,10 +50,9 @@ fn maybe_lint_redundant_semis(cx: &EarlyContext<'_>, seq: &mut Option<(Span, boo |
| 50 | 50 | return; |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | cx.emit_span_lint( | |
| 54 | REDUNDANT_SEMICOLONS, | |
| 55 | span, | |
| 56 | RedundantSemicolonsDiag { multiple, suggestion: span }, | |
| 57 | ); | |
| 53 | cx.emit_span_lint(REDUNDANT_SEMICOLONS, span, RedundantSemicolonsDiag { | |
| 54 | multiple, | |
| 55 | suggestion: span, | |
| 56 | }); | |
| 58 | 57 | } |
| 59 | 58 | } |
compiler/rustc_lint/src/shadowed_into_iter.rs+6-5| ... | ... | @@ -146,10 +146,11 @@ impl<'tcx> LateLintPass<'tcx> for ShadowedIntoIter { |
| 146 | 146 | None |
| 147 | 147 | }; |
| 148 | 148 | |
| 149 | cx.emit_span_lint( | |
| 150 | lint, | |
| 151 | call.ident.span, | |
| 152 | ShadowedIntoIterDiag { target, edition, suggestion: call.ident.span, sub }, | |
| 153 | ); | |
| 149 | cx.emit_span_lint(lint, call.ident.span, ShadowedIntoIterDiag { | |
| 150 | target, | |
| 151 | edition, | |
| 152 | suggestion: call.ident.span, | |
| 153 | sub, | |
| 154 | }); | |
| 154 | 155 | } |
| 155 | 156 | } |
compiler/rustc_lint/src/static_mut_refs.rs+7-5| ... | ... | @@ -3,8 +3,8 @@ use rustc_hir::{Expr, Stmt}; |
| 3 | 3 | use rustc_middle::ty::{Mutability, TyKind}; |
| 4 | 4 | use rustc_session::lint::FutureIncompatibilityReason; |
| 5 | 5 | use rustc_session::{declare_lint, declare_lint_pass}; |
| 6 | use rustc_span::edition::Edition; | |
| 7 | 6 | use rustc_span::Span; |
| 7 | use rustc_span::edition::Edition; | |
| 8 | 8 | |
| 9 | 9 | use crate::lints::{MutRefSugg, RefOfMutStatic}; |
| 10 | 10 | use crate::{LateContext, LateLintPass, LintContext}; |
| ... | ... | @@ -146,9 +146,11 @@ fn emit_static_mut_refs( |
| 146 | 146 | } |
| 147 | 147 | }; |
| 148 | 148 | |
| 149 | cx.emit_span_lint( | |
| 150 | STATIC_MUT_REFS, | |
| 149 | cx.emit_span_lint(STATIC_MUT_REFS, span, RefOfMutStatic { | |
| 151 | 150 | span, |
| 152 | RefOfMutStatic { span, sugg, shared_label, shared_note, mut_note }, | |
| 153 | ); | |
| 151 | sugg, | |
| 152 | shared_label, | |
| 153 | shared_note, | |
| 154 | mut_note, | |
| 155 | }); | |
| 154 | 156 | } |
compiler/rustc_lint/src/tail_expr_drop_order.rs+1-1| ... | ... | @@ -8,8 +8,8 @@ use rustc_macros::LintDiagnostic; |
| 8 | 8 | use rustc_middle::ty; |
| 9 | 9 | use rustc_session::lint::FutureIncompatibilityReason; |
| 10 | 10 | use rustc_session::{declare_lint, declare_lint_pass}; |
| 11 | use rustc_span::edition::Edition; | |
| 12 | 11 | use rustc_span::Span; |
| 12 | use rustc_span::edition::Edition; | |
| 13 | 13 | |
| 14 | 14 | use crate::{LateContext, LateLintPass}; |
| 15 | 15 |
compiler/rustc_lint/src/tests.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use rustc_span::{create_default_session_globals_then, Symbol}; | |
| 1 | use rustc_span::{Symbol, create_default_session_globals_then}; | |
| 2 | 2 | |
| 3 | 3 | use crate::levels::parse_lint_and_tool_name; |
| 4 | 4 |
compiler/rustc_lint/src/traits.rs+5-5| ... | ... | @@ -101,11 +101,11 @@ impl<'tcx> LateLintPass<'tcx> for DropTraitConstraints { |
| 101 | 101 | continue; |
| 102 | 102 | } |
| 103 | 103 | let Some(def_id) = cx.tcx.get_diagnostic_item(sym::needs_drop) else { return }; |
| 104 | cx.emit_span_lint( | |
| 105 | DROP_BOUNDS, | |
| 106 | span, | |
| 107 | DropTraitConstraintsDiag { predicate, tcx: cx.tcx, def_id }, | |
| 108 | ); | |
| 104 | cx.emit_span_lint(DROP_BOUNDS, span, DropTraitConstraintsDiag { | |
| 105 | predicate, | |
| 106 | tcx: cx.tcx, | |
| 107 | def_id, | |
| 108 | }); | |
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | } |
compiler/rustc_lint/src/types.rs+22-22| ... | ... | @@ -12,7 +12,7 @@ use rustc_middle::ty::{ |
| 12 | 12 | use rustc_session::{declare_lint, declare_lint_pass, impl_lint_pass}; |
| 13 | 13 | use rustc_span::def_id::LocalDefId; |
| 14 | 14 | use rustc_span::symbol::sym; |
| 15 | use rustc_span::{source_map, Span, Symbol}; | |
| 15 | use rustc_span::{Span, Symbol, source_map}; | |
| 16 | 16 | use rustc_target::abi::{Abi, TagEncoding, Variants, WrappingRange}; |
| 17 | 17 | use rustc_target::spec::abi::Abi as SpecAbi; |
| 18 | 18 | use tracing::debug; |
| ... | ... | @@ -24,7 +24,7 @@ use crate::lints::{ |
| 24 | 24 | AtomicOrderingStore, ImproperCTypes, InvalidAtomicOrderingDiag, InvalidNanComparisons, |
| 25 | 25 | InvalidNanComparisonsSuggestion, UnusedComparisons, VariantSizeDifferencesDiag, |
| 26 | 26 | }; |
| 27 | use crate::{fluent_generated as fluent, LateContext, LateLintPass, LintContext}; | |
| 27 | use crate::{LateContext, LateLintPass, LintContext, fluent_generated as fluent}; | |
| 28 | 28 | |
| 29 | 29 | mod literal; |
| 30 | 30 | |
| ... | ... | @@ -434,16 +434,13 @@ impl<'tcx> LateLintPass<'tcx> for TypeLimits { |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | fn rev_binop(binop: hir::BinOp) -> hir::BinOp { |
| 437 | source_map::respan( | |
| 438 | binop.span, | |
| 439 | match binop.node { | |
| 440 | hir::BinOpKind::Lt => hir::BinOpKind::Gt, | |
| 441 | hir::BinOpKind::Le => hir::BinOpKind::Ge, | |
| 442 | hir::BinOpKind::Gt => hir::BinOpKind::Lt, | |
| 443 | hir::BinOpKind::Ge => hir::BinOpKind::Le, | |
| 444 | _ => return binop, | |
| 445 | }, | |
| 446 | ) | |
| 437 | source_map::respan(binop.span, match binop.node { | |
| 438 | hir::BinOpKind::Lt => hir::BinOpKind::Gt, | |
| 439 | hir::BinOpKind::Le => hir::BinOpKind::Ge, | |
| 440 | hir::BinOpKind::Gt => hir::BinOpKind::Lt, | |
| 441 | hir::BinOpKind::Ge => hir::BinOpKind::Le, | |
| 442 | _ => return binop, | |
| 443 | }) | |
| 447 | 444 | } |
| 448 | 445 | |
| 449 | 446 | fn check_limits( |
| ... | ... | @@ -1193,11 +1190,14 @@ impl<'a, 'tcx> ImproperCTypesVisitor<'a, 'tcx> { |
| 1193 | 1190 | } else { |
| 1194 | 1191 | None |
| 1195 | 1192 | }; |
| 1196 | self.cx.emit_span_lint( | |
| 1197 | lint, | |
| 1198 | sp, | |
| 1199 | ImproperCTypes { ty, desc, label: sp, help, note, span_note }, | |
| 1200 | ); | |
| 1193 | self.cx.emit_span_lint(lint, sp, ImproperCTypes { | |
| 1194 | ty, | |
| 1195 | desc, | |
| 1196 | label: sp, | |
| 1197 | help, | |
| 1198 | note, | |
| 1199 | span_note, | |
| 1200 | }); | |
| 1201 | 1201 | } |
| 1202 | 1202 | |
| 1203 | 1203 | fn check_for_opaque_ty(&mut self, sp: Span, ty: Ty<'tcx>) -> bool { |
| ... | ... | @@ -1666,11 +1666,11 @@ impl InvalidAtomicOrdering { |
| 1666 | 1666 | } |
| 1667 | 1667 | |
| 1668 | 1668 | fn check_atomic_compare_exchange(cx: &LateContext<'_>, expr: &Expr<'_>) { |
| 1669 | let Some((method, args)) = Self::inherent_atomic_method_call( | |
| 1670 | cx, | |
| 1671 | expr, | |
| 1672 | &[sym::fetch_update, sym::compare_exchange, sym::compare_exchange_weak], | |
| 1673 | ) else { | |
| 1669 | let Some((method, args)) = Self::inherent_atomic_method_call(cx, expr, &[ | |
| 1670 | sym::fetch_update, | |
| 1671 | sym::compare_exchange, | |
| 1672 | sym::compare_exchange_weak, | |
| 1673 | ]) else { | |
| 1674 | 1674 | return; |
| 1675 | 1675 | }; |
| 1676 | 1676 |
compiler/rustc_lint/src/types/literal.rs+46-58| ... | ... | @@ -1,18 +1,18 @@ |
| 1 | use hir::{is_range_literal, ExprKind, Node}; | |
| 2 | use rustc_middle::ty::layout::IntegerExt; | |
| 1 | use hir::{ExprKind, Node, is_range_literal}; | |
| 3 | 2 | use rustc_middle::ty::Ty; |
| 3 | use rustc_middle::ty::layout::IntegerExt; | |
| 4 | 4 | use rustc_middle::{bug, ty}; |
| 5 | 5 | use rustc_target::abi::{Integer, Size}; |
| 6 | 6 | use {rustc_ast as ast, rustc_attr as attr, rustc_hir as hir}; |
| 7 | 7 | |
| 8 | use crate::LateContext; | |
| 8 | 9 | use crate::context::LintContext; |
| 9 | 10 | use crate::lints::{ |
| 10 | 11 | OnlyCastu8ToChar, OverflowingBinHex, OverflowingBinHexSign, OverflowingBinHexSignBitSub, |
| 11 | 12 | OverflowingBinHexSub, OverflowingInt, OverflowingIntHelp, OverflowingLiteral, OverflowingUInt, |
| 12 | 13 | RangeEndpointOutOfRange, UseInclusiveRange, |
| 13 | 14 | }; |
| 14 | use crate::types::{TypeLimits, OVERFLOWING_LITERALS}; | |
| 15 | use crate::LateContext; | |
| 15 | use crate::types::{OVERFLOWING_LITERALS, TypeLimits}; | |
| 16 | 16 | |
| 17 | 17 | /// Attempts to special-case the overflowing literal lint when it occurs as a range endpoint (`expr..MAX+1`). |
| 18 | 18 | /// Returns `true` iff the lint was emitted. |
| ... | ... | @@ -74,11 +74,10 @@ fn lint_overflowing_range_endpoint<'tcx>( |
| 74 | 74 | } |
| 75 | 75 | }; |
| 76 | 76 | |
| 77 | cx.emit_span_lint( | |
| 78 | OVERFLOWING_LITERALS, | |
| 79 | struct_expr.span, | |
| 80 | RangeEndpointOutOfRange { ty, sub: sub_sugg }, | |
| 81 | ); | |
| 77 | cx.emit_span_lint(OVERFLOWING_LITERALS, struct_expr.span, RangeEndpointOutOfRange { | |
| 78 | ty, | |
| 79 | sub: sub_sugg, | |
| 80 | }); | |
| 82 | 81 | |
| 83 | 82 | // We've just emitted a lint, special cased for `(...)..MAX+1` ranges, |
| 84 | 83 | // return `true` so the callers don't also emit a lint |
| ... | ... | @@ -187,19 +186,15 @@ fn report_bin_hex_error( |
| 187 | 186 | }) |
| 188 | 187 | .flatten(); |
| 189 | 188 | |
| 190 | cx.emit_span_lint( | |
| 191 | OVERFLOWING_LITERALS, | |
| 192 | expr.span, | |
| 193 | OverflowingBinHex { | |
| 194 | ty: t, | |
| 195 | lit: repr_str.clone(), | |
| 196 | dec: val, | |
| 197 | actually, | |
| 198 | sign, | |
| 199 | sub, | |
| 200 | sign_bit_sub, | |
| 201 | }, | |
| 202 | ) | |
| 189 | cx.emit_span_lint(OVERFLOWING_LITERALS, expr.span, OverflowingBinHex { | |
| 190 | ty: t, | |
| 191 | lit: repr_str.clone(), | |
| 192 | dec: val, | |
| 193 | actually, | |
| 194 | sign, | |
| 195 | sub, | |
| 196 | sign_bit_sub, | |
| 197 | }) | |
| 203 | 198 | } |
| 204 | 199 | |
| 205 | 200 | // Find the "next" fitting integer and return a suggestion string |
| ... | ... | @@ -266,11 +261,13 @@ fn lint_int_literal<'tcx>( |
| 266 | 261 | let help = get_type_suggestion(cx.typeck_results().node_type(e.hir_id), v, negative) |
| 267 | 262 | .map(|suggestion_ty| OverflowingIntHelp { suggestion_ty }); |
| 268 | 263 | |
| 269 | cx.emit_span_lint( | |
| 270 | OVERFLOWING_LITERALS, | |
| 271 | span, | |
| 272 | OverflowingInt { ty: t.name_str(), lit, min, max, help }, | |
| 273 | ); | |
| 264 | cx.emit_span_lint(OVERFLOWING_LITERALS, span, OverflowingInt { | |
| 265 | ty: t.name_str(), | |
| 266 | lit, | |
| 267 | min, | |
| 268 | max, | |
| 269 | help, | |
| 270 | }); | |
| 274 | 271 | } |
| 275 | 272 | } |
| 276 | 273 | |
| ... | ... | @@ -294,11 +291,10 @@ fn lint_uint_literal<'tcx>( |
| 294 | 291 | match par_e.kind { |
| 295 | 292 | hir::ExprKind::Cast(..) => { |
| 296 | 293 | if let ty::Char = cx.typeck_results().expr_ty(par_e).kind() { |
| 297 | cx.emit_span_lint( | |
| 298 | OVERFLOWING_LITERALS, | |
| 299 | par_e.span, | |
| 300 | OnlyCastu8ToChar { span: par_e.span, literal: lit_val }, | |
| 301 | ); | |
| 294 | cx.emit_span_lint(OVERFLOWING_LITERALS, par_e.span, OnlyCastu8ToChar { | |
| 295 | span: par_e.span, | |
| 296 | literal: lit_val, | |
| 297 | }); | |
| 302 | 298 | return; |
| 303 | 299 | } |
| 304 | 300 | } |
| ... | ... | @@ -321,20 +317,16 @@ fn lint_uint_literal<'tcx>( |
| 321 | 317 | ); |
| 322 | 318 | return; |
| 323 | 319 | } |
| 324 | cx.emit_span_lint( | |
| 325 | OVERFLOWING_LITERALS, | |
| 326 | e.span, | |
| 327 | OverflowingUInt { | |
| 328 | ty: t.name_str(), | |
| 329 | lit: cx | |
| 330 | .sess() | |
| 331 | .source_map() | |
| 332 | .span_to_snippet(lit.span) | |
| 333 | .unwrap_or_else(|_| lit_val.to_string()), | |
| 334 | min, | |
| 335 | max, | |
| 336 | }, | |
| 337 | ); | |
| 320 | cx.emit_span_lint(OVERFLOWING_LITERALS, e.span, OverflowingUInt { | |
| 321 | ty: t.name_str(), | |
| 322 | lit: cx | |
| 323 | .sess() | |
| 324 | .source_map() | |
| 325 | .span_to_snippet(lit.span) | |
| 326 | .unwrap_or_else(|_| lit_val.to_string()), | |
| 327 | min, | |
| 328 | max, | |
| 329 | }); | |
| 338 | 330 | } |
| 339 | 331 | } |
| 340 | 332 | |
| ... | ... | @@ -367,18 +359,14 @@ pub(crate) fn lint_literal<'tcx>( |
| 367 | 359 | _ => bug!(), |
| 368 | 360 | }; |
| 369 | 361 | if is_infinite == Ok(true) { |
| 370 | cx.emit_span_lint( | |
| 371 | OVERFLOWING_LITERALS, | |
| 372 | e.span, | |
| 373 | OverflowingLiteral { | |
| 374 | ty: t.name_str(), | |
| 375 | lit: cx | |
| 376 | .sess() | |
| 377 | .source_map() | |
| 378 | .span_to_snippet(lit.span) | |
| 379 | .unwrap_or_else(|_| sym.to_string()), | |
| 380 | }, | |
| 381 | ); | |
| 362 | cx.emit_span_lint(OVERFLOWING_LITERALS, e.span, OverflowingLiteral { | |
| 363 | ty: t.name_str(), | |
| 364 | lit: cx | |
| 365 | .sess() | |
| 366 | .source_map() | |
| 367 | .span_to_snippet(lit.span) | |
| 368 | .unwrap_or_else(|_| sym.to_string()), | |
| 369 | }); | |
| 382 | 370 | } |
| 383 | 371 | } |
| 384 | 372 | _ => {} |
compiler/rustc_lint/src/unit_bindings.rs+3-5| ... | ... | @@ -63,11 +63,9 @@ impl<'tcx> LateLintPass<'tcx> for UnitBindings { |
| 63 | 63 | && !matches!(init.kind, hir::ExprKind::Tup([])) |
| 64 | 64 | && !matches!(local.pat.kind, hir::PatKind::Tuple([], ..)) |
| 65 | 65 | { |
| 66 | cx.emit_span_lint( | |
| 67 | UNIT_BINDINGS, | |
| 68 | local.span, | |
| 69 | UnitBindingsDiag { label: local.pat.span }, | |
| 70 | ); | |
| 66 | cx.emit_span_lint(UNIT_BINDINGS, local.span, UnitBindingsDiag { | |
| 67 | label: local.pat.span, | |
| 68 | }); | |
| 71 | 69 | } |
| 72 | 70 | } |
| 73 | 71 | } |
compiler/rustc_lint/src/unused.rs+48-58| ... | ... | @@ -4,14 +4,14 @@ use std::ops::ControlFlow; |
| 4 | 4 | use rustc_ast as ast; |
| 5 | 5 | use rustc_ast::util::{classify, parser}; |
| 6 | 6 | use rustc_ast::{ExprKind, StmtKind}; |
| 7 | use rustc_errors::{pluralize, MultiSpan}; | |
| 7 | use rustc_errors::{MultiSpan, pluralize}; | |
| 8 | 8 | use rustc_hir::def::{DefKind, Res}; |
| 9 | 9 | use rustc_hir::def_id::DefId; |
| 10 | 10 | use rustc_hir::{self as hir, LangItem}; |
| 11 | 11 | use rustc_infer::traits::util::elaborate; |
| 12 | use rustc_middle::ty::{self, adjustment, Ty}; | |
| 12 | use rustc_middle::ty::{self, Ty, adjustment}; | |
| 13 | 13 | use rustc_session::{declare_lint, declare_lint_pass, impl_lint_pass}; |
| 14 | use rustc_span::symbol::{kw, sym, Symbol}; | |
| 14 | use rustc_span::symbol::{Symbol, kw, sym}; | |
| 15 | 15 | use rustc_span::{BytePos, Span}; |
| 16 | 16 | use tracing::instrument; |
| 17 | 17 | |
| ... | ... | @@ -185,22 +185,18 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults { |
| 185 | 185 | let mut op_warned = false; |
| 186 | 186 | |
| 187 | 187 | if let Some(must_use_op) = must_use_op { |
| 188 | cx.emit_span_lint( | |
| 189 | UNUSED_MUST_USE, | |
| 190 | expr.span, | |
| 191 | UnusedOp { | |
| 192 | op: must_use_op, | |
| 193 | label: expr.span, | |
| 194 | suggestion: if expr_is_from_block { | |
| 195 | UnusedOpSuggestion::BlockTailExpr { | |
| 196 | before_span: expr.span.shrink_to_lo(), | |
| 197 | after_span: expr.span.shrink_to_hi(), | |
| 198 | } | |
| 199 | } else { | |
| 200 | UnusedOpSuggestion::NormalExpr { span: expr.span.shrink_to_lo() } | |
| 201 | }, | |
| 188 | cx.emit_span_lint(UNUSED_MUST_USE, expr.span, UnusedOp { | |
| 189 | op: must_use_op, | |
| 190 | label: expr.span, | |
| 191 | suggestion: if expr_is_from_block { | |
| 192 | UnusedOpSuggestion::BlockTailExpr { | |
| 193 | before_span: expr.span.shrink_to_lo(), | |
| 194 | after_span: expr.span.shrink_to_hi(), | |
| 195 | } | |
| 196 | } else { | |
| 197 | UnusedOpSuggestion::NormalExpr { span: expr.span.shrink_to_lo() } | |
| 202 | 198 | }, |
| 203 | ); | |
| 199 | }); | |
| 204 | 200 | op_warned = true; |
| 205 | 201 | } |
| 206 | 202 | |
| ... | ... | @@ -497,39 +493,35 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults { |
| 497 | 493 | ); |
| 498 | 494 | } |
| 499 | 495 | MustUsePath::Closure(span) => { |
| 500 | cx.emit_span_lint( | |
| 501 | UNUSED_MUST_USE, | |
| 502 | *span, | |
| 503 | UnusedClosure { count: plural_len, pre: descr_pre, post: descr_post }, | |
| 504 | ); | |
| 496 | cx.emit_span_lint(UNUSED_MUST_USE, *span, UnusedClosure { | |
| 497 | count: plural_len, | |
| 498 | pre: descr_pre, | |
| 499 | post: descr_post, | |
| 500 | }); | |
| 505 | 501 | } |
| 506 | 502 | MustUsePath::Coroutine(span) => { |
| 507 | cx.emit_span_lint( | |
| 508 | UNUSED_MUST_USE, | |
| 509 | *span, | |
| 510 | UnusedCoroutine { count: plural_len, pre: descr_pre, post: descr_post }, | |
| 511 | ); | |
| 503 | cx.emit_span_lint(UNUSED_MUST_USE, *span, UnusedCoroutine { | |
| 504 | count: plural_len, | |
| 505 | pre: descr_pre, | |
| 506 | post: descr_post, | |
| 507 | }); | |
| 512 | 508 | } |
| 513 | 509 | MustUsePath::Def(span, def_id, reason) => { |
| 514 | cx.emit_span_lint( | |
| 515 | UNUSED_MUST_USE, | |
| 516 | *span, | |
| 517 | UnusedDef { | |
| 518 | pre: descr_pre, | |
| 519 | post: descr_post, | |
| 520 | cx, | |
| 521 | def_id: *def_id, | |
| 522 | note: *reason, | |
| 523 | suggestion: (!is_inner).then_some(if expr_is_from_block { | |
| 524 | UnusedDefSuggestion::BlockTailExpr { | |
| 525 | before_span: span.shrink_to_lo(), | |
| 526 | after_span: span.shrink_to_hi(), | |
| 527 | } | |
| 528 | } else { | |
| 529 | UnusedDefSuggestion::NormalExpr { span: span.shrink_to_lo() } | |
| 530 | }), | |
| 531 | }, | |
| 532 | ); | |
| 510 | cx.emit_span_lint(UNUSED_MUST_USE, *span, UnusedDef { | |
| 511 | pre: descr_pre, | |
| 512 | post: descr_post, | |
| 513 | cx, | |
| 514 | def_id: *def_id, | |
| 515 | note: *reason, | |
| 516 | suggestion: (!is_inner).then_some(if expr_is_from_block { | |
| 517 | UnusedDefSuggestion::BlockTailExpr { | |
| 518 | before_span: span.shrink_to_lo(), | |
| 519 | after_span: span.shrink_to_hi(), | |
| 520 | } | |
| 521 | } else { | |
| 522 | UnusedDefSuggestion::NormalExpr { span: span.shrink_to_lo() } | |
| 523 | }), | |
| 524 | }); | |
| 533 | 525 | } |
| 534 | 526 | } |
| 535 | 527 | } |
| ... | ... | @@ -791,7 +783,7 @@ trait UnusedDelimLint { |
| 791 | 783 | // ``` |
| 792 | 784 | // fn f(){(print!(á |
| 793 | 785 | // ``` |
| 794 | use rustc_ast::visit::{walk_expr, Visitor}; | |
| 786 | use rustc_ast::visit::{Visitor, walk_expr}; | |
| 795 | 787 | struct ErrExprVisitor; |
| 796 | 788 | impl<'ast> Visitor<'ast> for ErrExprVisitor { |
| 797 | 789 | type Result = ControlFlow<()>; |
| ... | ... | @@ -869,11 +861,11 @@ trait UnusedDelimLint { |
| 869 | 861 | end_replace: hi_replace, |
| 870 | 862 | } |
| 871 | 863 | }); |
| 872 | cx.emit_span_lint( | |
| 873 | self.lint(), | |
| 874 | primary_span, | |
| 875 | UnusedDelim { delim: Self::DELIM_STR, item: msg, suggestion }, | |
| 876 | ); | |
| 864 | cx.emit_span_lint(self.lint(), primary_span, UnusedDelim { | |
| 865 | delim: Self::DELIM_STR, | |
| 866 | item: msg, | |
| 867 | suggestion, | |
| 868 | }); | |
| 877 | 869 | } |
| 878 | 870 | |
| 879 | 871 | fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &ast::Expr) { |
| ... | ... | @@ -1558,11 +1550,9 @@ impl UnusedImportBraces { |
| 1558 | 1550 | ast::UseTreeKind::Nested { .. } => return, |
| 1559 | 1551 | }; |
| 1560 | 1552 | |
| 1561 | cx.emit_span_lint( | |
| 1562 | UNUSED_IMPORT_BRACES, | |
| 1563 | item.span, | |
| 1564 | UnusedImportBracesDiag { node: node_name }, | |
| 1565 | ); | |
| 1553 | cx.emit_span_lint(UNUSED_IMPORT_BRACES, item.span, UnusedImportBracesDiag { | |
| 1554 | node: node_name, | |
| 1555 | }); | |
| 1566 | 1556 | } |
| 1567 | 1557 | } |
| 1568 | 1558 | } |
compiler/rustc_lint_defs/src/builtin.rs+1-1| ... | ... | @@ -9,7 +9,7 @@ |
| 9 | 9 | |
| 10 | 10 | use rustc_span::edition::Edition; |
| 11 | 11 | |
| 12 | use crate::{declare_lint, declare_lint_pass, FutureIncompatibilityReason}; | |
| 12 | use crate::{FutureIncompatibilityReason, declare_lint, declare_lint_pass}; | |
| 13 | 13 | |
| 14 | 14 | declare_lint_pass! { |
| 15 | 15 | /// Does nothing as a lint pass, but registers some `Lint`s |
compiler/rustc_lint_defs/src/lib.rs+1-1| ... | ... | @@ -14,7 +14,7 @@ use rustc_hir::{HashStableContext, HirId, MissingLifetimeKind}; |
| 14 | 14 | use rustc_macros::{Decodable, Encodable, HashStable_Generic}; |
| 15 | 15 | pub use rustc_span::edition::Edition; |
| 16 | 16 | use rustc_span::symbol::{Ident, MacroRulesNormalizedIdent}; |
| 17 | use rustc_span::{sym, Span, Symbol}; | |
| 17 | use rustc_span::{Span, Symbol, sym}; | |
| 18 | 18 | use rustc_target::spec::abi::Abi; |
| 19 | 19 | use serde::{Deserialize, Serialize}; |
| 20 | 20 |
compiler/rustc_log/src/lib.rs+1-1| ... | ... | @@ -44,8 +44,8 @@ use std::io::{self, IsTerminal}; |
| 44 | 44 | |
| 45 | 45 | use tracing_core::{Event, Subscriber}; |
| 46 | 46 | use tracing_subscriber::filter::{Directive, EnvFilter, LevelFilter}; |
| 47 | use tracing_subscriber::fmt::format::{self, FormatEvent, FormatFields}; | |
| 48 | 47 | use tracing_subscriber::fmt::FmtContext; |
| 48 | use tracing_subscriber::fmt::format::{self, FormatEvent, FormatFields}; | |
| 49 | 49 | use tracing_subscriber::layer::SubscriberExt; |
| 50 | 50 | |
| 51 | 51 | /// The values of all the environment variables that matter for configuring a logger. |
compiler/rustc_macros/src/diagnostics/diagnostic.rs+1-1| ... | ... | @@ -8,7 +8,7 @@ use syn::spanned::Spanned; |
| 8 | 8 | use synstructure::Structure; |
| 9 | 9 | |
| 10 | 10 | use crate::diagnostics::diagnostic_builder::DiagnosticDeriveKind; |
| 11 | use crate::diagnostics::error::{span_err, DiagnosticDeriveError}; | |
| 11 | use crate::diagnostics::error::{DiagnosticDeriveError, span_err}; | |
| 12 | 12 | use crate::diagnostics::utils::SetOnce; |
| 13 | 13 | |
| 14 | 14 | /// The central struct for constructing the `into_diag` method from an annotated struct. |
compiler/rustc_macros/src/diagnostics/diagnostic_builder.rs+4-4| ... | ... | @@ -3,17 +3,17 @@ |
| 3 | 3 | use proc_macro2::{Ident, Span, TokenStream}; |
| 4 | 4 | use quote::{format_ident, quote, quote_spanned}; |
| 5 | 5 | use syn::spanned::Spanned; |
| 6 | use syn::{parse_quote, Attribute, Meta, Path, Token, Type}; | |
| 6 | use syn::{Attribute, Meta, Path, Token, Type, parse_quote}; | |
| 7 | 7 | use synstructure::{BindingInfo, Structure, VariantInfo}; |
| 8 | 8 | |
| 9 | 9 | use super::utils::SubdiagnosticVariant; |
| 10 | 10 | use crate::diagnostics::error::{ |
| 11 | span_err, throw_invalid_attr, throw_span_err, DiagnosticDeriveError, | |
| 11 | DiagnosticDeriveError, span_err, throw_invalid_attr, throw_span_err, | |
| 12 | 12 | }; |
| 13 | 13 | use crate::diagnostics::utils::{ |
| 14 | FieldInfo, FieldInnerTy, FieldMap, HasFieldMap, SetOnce, SpannedOption, SubdiagnosticKind, | |
| 14 | 15 | build_field_mapping, is_doc_comment, report_error_if_not_applied_to_span, report_type_error, |
| 15 | should_generate_arg, type_is_bool, type_is_unit, type_matches_path, FieldInfo, FieldInnerTy, | |
| 16 | FieldMap, HasFieldMap, SetOnce, SpannedOption, SubdiagnosticKind, | |
| 16 | should_generate_arg, type_is_bool, type_is_unit, type_matches_path, | |
| 17 | 17 | }; |
| 18 | 18 | |
| 19 | 19 | /// What kind of diagnostic is being derived - a fatal/error/warning or a lint? |
compiler/rustc_macros/src/diagnostics/subdiagnostic.rs+5-5| ... | ... | @@ -8,13 +8,13 @@ use synstructure::{BindingInfo, Structure, VariantInfo}; |
| 8 | 8 | |
| 9 | 9 | use super::utils::SubdiagnosticVariant; |
| 10 | 10 | use crate::diagnostics::error::{ |
| 11 | invalid_attr, span_err, throw_invalid_attr, throw_span_err, DiagnosticDeriveError, | |
| 11 | DiagnosticDeriveError, invalid_attr, span_err, throw_invalid_attr, throw_span_err, | |
| 12 | 12 | }; |
| 13 | 13 | use crate::diagnostics::utils::{ |
| 14 | build_field_mapping, build_suggestion_code, is_doc_comment, new_code_ident, | |
| 15 | report_error_if_not_applied_to_applicability, report_error_if_not_applied_to_span, | |
| 16 | should_generate_arg, AllowMultipleAlternatives, FieldInfo, FieldInnerTy, FieldMap, HasFieldMap, | |
| 17 | SetOnce, SpannedOption, SubdiagnosticKind, | |
| 14 | AllowMultipleAlternatives, FieldInfo, FieldInnerTy, FieldMap, HasFieldMap, SetOnce, | |
| 15 | SpannedOption, SubdiagnosticKind, build_field_mapping, build_suggestion_code, is_doc_comment, | |
| 16 | new_code_ident, report_error_if_not_applied_to_applicability, | |
| 17 | report_error_if_not_applied_to_span, should_generate_arg, | |
| 18 | 18 | }; |
| 19 | 19 | |
| 20 | 20 | /// The central struct for constructing the `add_to_diag` method from an annotated struct. |
compiler/rustc_macros/src/diagnostics/utils.rs+3-3| ... | ... | @@ -5,16 +5,16 @@ use std::str::FromStr; |
| 5 | 5 | |
| 6 | 6 | use proc_macro::Span; |
| 7 | 7 | use proc_macro2::{Ident, TokenStream}; |
| 8 | use quote::{format_ident, quote, ToTokens}; | |
| 8 | use quote::{ToTokens, format_ident, quote}; | |
| 9 | 9 | use syn::meta::ParseNestedMeta; |
| 10 | 10 | use syn::punctuated::Punctuated; |
| 11 | 11 | use syn::spanned::Spanned; |
| 12 | use syn::{parenthesized, Attribute, Field, LitStr, Meta, Path, Token, Type, TypeTuple}; | |
| 12 | use syn::{Attribute, Field, LitStr, Meta, Path, Token, Type, TypeTuple, parenthesized}; | |
| 13 | 13 | use synstructure::{BindingInfo, VariantInfo}; |
| 14 | 14 | |
| 15 | 15 | use super::error::invalid_attr; |
| 16 | 16 | use crate::diagnostics::error::{ |
| 17 | span_err, throw_invalid_attr, throw_span_err, DiagnosticDeriveError, | |
| 17 | DiagnosticDeriveError, span_err, throw_invalid_attr, throw_span_err, | |
| 18 | 18 | }; |
| 19 | 19 | |
| 20 | 20 | thread_local! { |
compiler/rustc_macros/src/extension.rs+3-3| ... | ... | @@ -4,9 +4,9 @@ use syn::parse::{Parse, ParseStream}; |
| 4 | 4 | use syn::punctuated::Punctuated; |
| 5 | 5 | use syn::spanned::Spanned; |
| 6 | 6 | use syn::{ |
| 7 | braced, parse_macro_input, Attribute, Generics, ImplItem, Pat, PatIdent, Path, Signature, | |
| 8 | Token, TraitItem, TraitItemConst, TraitItemFn, TraitItemMacro, TraitItemType, Type, Visibility, | |
| 9 | WhereClause, | |
| 7 | Attribute, Generics, ImplItem, Pat, PatIdent, Path, Signature, Token, TraitItem, | |
| 8 | TraitItemConst, TraitItemFn, TraitItemMacro, TraitItemType, Type, Visibility, WhereClause, | |
| 9 | braced, parse_macro_input, | |
| 10 | 10 | }; |
| 11 | 11 | |
| 12 | 12 | pub(crate) fn extension( |
compiler/rustc_macros/src/lift.rs+6-9| ... | ... | @@ -40,14 +40,11 @@ pub(super) fn lift_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::To |
| 40 | 40 | }); |
| 41 | 41 | |
| 42 | 42 | s.add_impl_generic(newtcx); |
| 43 | s.bound_impl( | |
| 44 | quote!(::rustc_middle::ty::Lift<::rustc_middle::ty::TyCtxt<'__lifted>>), | |
| 45 | quote! { | |
| 46 | type Lifted = #lifted; | |
| 43 | s.bound_impl(quote!(::rustc_middle::ty::Lift<::rustc_middle::ty::TyCtxt<'__lifted>>), quote! { | |
| 44 | type Lifted = #lifted; | |
| 47 | 45 | |
| 48 | fn lift_to_interner(self, __tcx: ::rustc_middle::ty::TyCtxt<'__lifted>) -> Option<#lifted> { | |
| 49 | Some(match self { #body }) | |
| 50 | } | |
| 51 | }, | |
| 52 | ) | |
| 46 | fn lift_to_interner(self, __tcx: ::rustc_middle::ty::TyCtxt<'__lifted>) -> Option<#lifted> { | |
| 47 | Some(match self { #body }) | |
| 48 | } | |
| 49 | }) | |
| 53 | 50 | } |
compiler/rustc_macros/src/query.rs+2-2| ... | ... | @@ -4,8 +4,8 @@ use syn::parse::{Parse, ParseStream, Result}; |
| 4 | 4 | use syn::punctuated::Punctuated; |
| 5 | 5 | use syn::spanned::Spanned; |
| 6 | 6 | use syn::{ |
| 7 | braced, parenthesized, parse_macro_input, parse_quote, token, AttrStyle, Attribute, Block, | |
| 8 | Error, Expr, Ident, Pat, ReturnType, Token, Type, | |
| 7 | AttrStyle, Attribute, Block, Error, Expr, Ident, Pat, ReturnType, Token, Type, braced, | |
| 8 | parenthesized, parse_macro_input, parse_quote, token, | |
| 9 | 9 | }; |
| 10 | 10 | |
| 11 | 11 | mod kw { |
compiler/rustc_macros/src/serialize.rs+14-20| ... | ... | @@ -105,14 +105,11 @@ fn decodable_body( |
| 105 | 105 | }; |
| 106 | 106 | s.underscore_const(true); |
| 107 | 107 | |
| 108 | s.bound_impl( | |
| 109 | quote!(::rustc_serialize::Decodable<#decoder_ty>), | |
| 110 | quote! { | |
| 111 | fn decode(__decoder: &mut #decoder_ty) -> Self { | |
| 112 | #decode_body | |
| 113 | } | |
| 114 | }, | |
| 115 | ) | |
| 108 | s.bound_impl(quote!(::rustc_serialize::Decodable<#decoder_ty>), quote! { | |
| 109 | fn decode(__decoder: &mut #decoder_ty) -> Self { | |
| 110 | #decode_body | |
| 111 | } | |
| 112 | }) | |
| 116 | 113 | } |
| 117 | 114 | |
| 118 | 115 | fn decode_field(field: &syn::Field) -> proc_macro2::TokenStream { |
| ... | ... | @@ -288,16 +285,13 @@ fn encodable_body( |
| 288 | 285 | quote! {} |
| 289 | 286 | }; |
| 290 | 287 | |
| 291 | s.bound_impl( | |
| 292 | quote!(::rustc_serialize::Encodable<#encoder_ty>), | |
| 293 | quote! { | |
| 294 | fn encode( | |
| 295 | &self, | |
| 296 | __encoder: &mut #encoder_ty, | |
| 297 | ) { | |
| 298 | #lints | |
| 299 | #encode_body | |
| 300 | } | |
| 301 | }, | |
| 302 | ) | |
| 288 | s.bound_impl(quote!(::rustc_serialize::Encodable<#encoder_ty>), quote! { | |
| 289 | fn encode( | |
| 290 | &self, | |
| 291 | __encoder: &mut #encoder_ty, | |
| 292 | ) { | |
| 293 | #lints | |
| 294 | #encode_body | |
| 295 | } | |
| 296 | }) | |
| 303 | 297 | } |
compiler/rustc_macros/src/symbols.rs+1-1| ... | ... | @@ -30,7 +30,7 @@ use proc_macro2::{Span, TokenStream}; |
| 30 | 30 | use quote::quote; |
| 31 | 31 | use syn::parse::{Parse, ParseStream, Result}; |
| 32 | 32 | use syn::punctuated::Punctuated; |
| 33 | use syn::{braced, Expr, Ident, Lit, LitStr, Macro, Token}; | |
| 33 | use syn::{Expr, Ident, Lit, LitStr, Macro, Token, braced}; | |
| 34 | 34 | |
| 35 | 35 | #[cfg(test)] |
| 36 | 36 | mod tests; |
compiler/rustc_macros/src/symbols/tests.rs+4-4| ... | ... | @@ -94,8 +94,8 @@ fn check_symbol_order() { |
| 94 | 94 | aardvark, |
| 95 | 95 | } |
| 96 | 96 | }; |
| 97 | test_symbols_macro( | |
| 98 | input, | |
| 99 | &["Symbol `aardvark` must precede `zebra`", "location of previous symbol `zebra`"], | |
| 100 | ); | |
| 97 | test_symbols_macro(input, &[ | |
| 98 | "Symbol `aardvark` must precede `zebra`", | |
| 99 | "location of previous symbol `zebra`", | |
| 100 | ]); | |
| 101 | 101 | } |
compiler/rustc_macros/src/type_foldable.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use quote::{quote, ToTokens}; | |
| 1 | use quote::{ToTokens, quote}; | |
| 2 | 2 | use syn::parse_quote; |
| 3 | 3 | |
| 4 | 4 | pub(super) fn type_foldable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream { |
compiler/rustc_metadata/src/creader.rs+17-23| ... | ... | @@ -8,7 +8,7 @@ use std::time::Duration; |
| 8 | 8 | use std::{cmp, env, iter}; |
| 9 | 9 | |
| 10 | 10 | use proc_macro::bridge::client::ProcMacro; |
| 11 | use rustc_ast::expand::allocator::{alloc_error_handler_name, global_fn_name, AllocatorKind}; | |
| 11 | use rustc_ast::expand::allocator::{AllocatorKind, alloc_error_handler_name, global_fn_name}; | |
| 12 | 12 | use rustc_ast::{self as ast, *}; |
| 13 | 13 | use rustc_data_structures::fx::FxHashSet; |
| 14 | 14 | use rustc_data_structures::owned_slice::OwnedSlice; |
| ... | ... | @@ -17,7 +17,7 @@ use rustc_data_structures::sync::{self, FreezeReadGuard, FreezeWriteGuard}; |
| 17 | 17 | use rustc_errors::DiagCtxtHandle; |
| 18 | 18 | use rustc_expand::base::SyntaxExtension; |
| 19 | 19 | use rustc_fs_util::try_canonicalize; |
| 20 | use rustc_hir::def_id::{CrateNum, LocalDefId, StableCrateId, LOCAL_CRATE}; | |
| 20 | use rustc_hir::def_id::{CrateNum, LOCAL_CRATE, LocalDefId, StableCrateId}; | |
| 21 | 21 | use rustc_hir::definitions::Definitions; |
| 22 | 22 | use rustc_index::IndexVec; |
| 23 | 23 | use rustc_middle::bug; |
| ... | ... | @@ -28,8 +28,8 @@ use rustc_session::lint::{self, BuiltinLintDiag}; |
| 28 | 28 | use rustc_session::output::validate_crate_name; |
| 29 | 29 | use rustc_session::search_paths::PathKind; |
| 30 | 30 | use rustc_span::edition::Edition; |
| 31 | use rustc_span::symbol::{sym, Symbol}; | |
| 32 | use rustc_span::{Span, DUMMY_SP}; | |
| 31 | use rustc_span::symbol::{Symbol, sym}; | |
| 32 | use rustc_span::{DUMMY_SP, Span}; | |
| 33 | 33 | use rustc_target::spec::{PanicStrategy, Target, TargetTriple}; |
| 34 | 34 | use tracing::{debug, info, trace}; |
| 35 | 35 | |
| ... | ... | @@ -1063,15 +1063,12 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> { |
| 1063 | 1063 | let cnum = self.resolve_crate(name, item.span, dep_kind)?; |
| 1064 | 1064 | |
| 1065 | 1065 | let path_len = definitions.def_path(def_id).data.len(); |
| 1066 | self.cstore.update_extern_crate( | |
| 1067 | cnum, | |
| 1068 | ExternCrate { | |
| 1069 | src: ExternCrateSource::Extern(def_id.to_def_id()), | |
| 1070 | span: item.span, | |
| 1071 | path_len, | |
| 1072 | dependency_of: LOCAL_CRATE, | |
| 1073 | }, | |
| 1074 | ); | |
| 1066 | self.cstore.update_extern_crate(cnum, ExternCrate { | |
| 1067 | src: ExternCrateSource::Extern(def_id.to_def_id()), | |
| 1068 | span: item.span, | |
| 1069 | path_len, | |
| 1070 | dependency_of: LOCAL_CRATE, | |
| 1071 | }); | |
| 1075 | 1072 | Some(cnum) |
| 1076 | 1073 | } |
| 1077 | 1074 | _ => bug!(), |
| ... | ... | @@ -1081,16 +1078,13 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> { |
| 1081 | 1078 | pub fn process_path_extern(&mut self, name: Symbol, span: Span) -> Option<CrateNum> { |
| 1082 | 1079 | let cnum = self.resolve_crate(name, span, CrateDepKind::Explicit)?; |
| 1083 | 1080 | |
| 1084 | self.cstore.update_extern_crate( | |
| 1085 | cnum, | |
| 1086 | ExternCrate { | |
| 1087 | src: ExternCrateSource::Path, | |
| 1088 | span, | |
| 1089 | // to have the least priority in `update_extern_crate` | |
| 1090 | path_len: usize::MAX, | |
| 1091 | dependency_of: LOCAL_CRATE, | |
| 1092 | }, | |
| 1093 | ); | |
| 1081 | self.cstore.update_extern_crate(cnum, ExternCrate { | |
| 1082 | src: ExternCrateSource::Path, | |
| 1083 | span, | |
| 1084 | // to have the least priority in `update_extern_crate` | |
| 1085 | path_len: usize::MAX, | |
| 1086 | dependency_of: LOCAL_CRATE, | |
| 1087 | }); | |
| 1094 | 1088 | |
| 1095 | 1089 | Some(cnum) |
| 1096 | 1090 | } |
compiler/rustc_metadata/src/errors.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ use std::path::{Path, PathBuf}; |
| 4 | 4 | use rustc_errors::codes::*; |
| 5 | 5 | use rustc_errors::{Diag, DiagCtxtHandle, Diagnostic, EmissionGuarantee, Level}; |
| 6 | 6 | use rustc_macros::{Diagnostic, Subdiagnostic}; |
| 7 | use rustc_span::{sym, Span, Symbol}; | |
| 7 | use rustc_span::{Span, Symbol, sym}; | |
| 8 | 8 | use rustc_target::spec::{PanicStrategy, TargetTriple}; |
| 9 | 9 | |
| 10 | 10 | use crate::fluent_generated as fluent; |
compiler/rustc_metadata/src/fs.rs+1-1| ... | ... | @@ -12,7 +12,7 @@ use crate::errors::{ |
| 12 | 12 | BinaryOutputToTty, FailedCopyToStdout, FailedCreateEncodedMetadata, FailedCreateFile, |
| 13 | 13 | FailedCreateTempdir, FailedWriteError, |
| 14 | 14 | }; |
| 15 | use crate::{encode_metadata, EncodedMetadata}; | |
| 15 | use crate::{EncodedMetadata, encode_metadata}; | |
| 16 | 16 | |
| 17 | 17 | // FIXME(eddyb) maybe include the crate name in this? |
| 18 | 18 | pub const METADATA_FILENAME: &str = "lib.rmeta"; |
compiler/rustc_metadata/src/lib.rs+3-3| ... | ... | @@ -34,12 +34,12 @@ pub mod errors; |
| 34 | 34 | pub mod fs; |
| 35 | 35 | pub mod locator; |
| 36 | 36 | |
| 37 | pub use creader::{load_symbol_from_dylib, DylibError}; | |
| 38 | pub use fs::{emit_wrapper_file, METADATA_FILENAME}; | |
| 37 | pub use creader::{DylibError, load_symbol_from_dylib}; | |
| 38 | pub use fs::{METADATA_FILENAME, emit_wrapper_file}; | |
| 39 | 39 | pub use native_libs::{ |
| 40 | 40 | find_native_static_library, try_find_native_dynamic_library, try_find_native_static_library, |
| 41 | 41 | walk_native_lib_search_dirs, |
| 42 | 42 | }; |
| 43 | pub use rmeta::{encode_metadata, rendered_const, EncodedMetadata, METADATA_HEADER}; | |
| 43 | pub use rmeta::{EncodedMetadata, METADATA_HEADER, encode_metadata, rendered_const}; | |
| 44 | 44 | |
| 45 | 45 | rustc_fluent_macro::fluent_messages! { "../messages.ftl" } |
compiler/rustc_metadata/src/locator.rs+3-3| ... | ... | @@ -224,20 +224,20 @@ use rustc_data_structures::owned_slice::slice_owned; |
| 224 | 224 | use rustc_data_structures::svh::Svh; |
| 225 | 225 | use rustc_errors::{DiagArgValue, IntoDiagArg}; |
| 226 | 226 | use rustc_fs_util::try_canonicalize; |
| 227 | use rustc_session::Session; | |
| 227 | 228 | use rustc_session::cstore::CrateSource; |
| 228 | 229 | use rustc_session::filesearch::FileSearch; |
| 229 | 230 | use rustc_session::search_paths::PathKind; |
| 230 | 231 | use rustc_session::utils::CanonicalizedPath; |
| 231 | use rustc_session::Session; | |
| 232 | use rustc_span::symbol::Symbol; | |
| 233 | 232 | use rustc_span::Span; |
| 233 | use rustc_span::symbol::Symbol; | |
| 234 | 234 | use rustc_target::spec::{Target, TargetTriple}; |
| 235 | 235 | use snap::read::FrameDecoder; |
| 236 | 236 | use tracing::{debug, info}; |
| 237 | 237 | |
| 238 | 238 | use crate::creader::{Library, MetadataLoader}; |
| 239 | 239 | use crate::errors; |
| 240 | use crate::rmeta::{rustc_version, MetadataBlob, METADATA_HEADER}; | |
| 240 | use crate::rmeta::{METADATA_HEADER, MetadataBlob, rustc_version}; | |
| 241 | 241 | |
| 242 | 242 | #[derive(Clone)] |
| 243 | 243 | pub(crate) struct CrateLocator<'a> { |
compiler/rustc_metadata/src/native_libs.rs+4-4| ... | ... | @@ -1,11 +1,12 @@ |
| 1 | 1 | use std::ops::ControlFlow; |
| 2 | 2 | use std::path::{Path, PathBuf}; |
| 3 | 3 | |
| 4 | use rustc_ast::{NestedMetaItem, CRATE_NODE_ID}; | |
| 4 | use rustc_ast::{CRATE_NODE_ID, NestedMetaItem}; | |
| 5 | 5 | use rustc_attr as attr; |
| 6 | 6 | use rustc_data_structures::fx::FxHashSet; |
| 7 | 7 | use rustc_middle::query::LocalCrate; |
| 8 | 8 | use rustc_middle::ty::{List, ParamEnv, ParamEnvAnd, Ty, TyCtxt}; |
| 9 | use rustc_session::Session; | |
| 9 | 10 | use rustc_session::config::CrateType; |
| 10 | 11 | use rustc_session::cstore::{ |
| 11 | 12 | DllCallingConvention, DllImport, ForeignModule, NativeLib, PeImportNameType, |
| ... | ... | @@ -13,11 +14,10 @@ use rustc_session::cstore::{ |
| 13 | 14 | use rustc_session::parse::feature_err; |
| 14 | 15 | use rustc_session::search_paths::PathKind; |
| 15 | 16 | use rustc_session::utils::NativeLibKind; |
| 16 | use rustc_session::Session; | |
| 17 | 17 | use rustc_span::def_id::{DefId, LOCAL_CRATE}; |
| 18 | use rustc_span::symbol::{sym, Symbol}; | |
| 19 | use rustc_target::spec::abi::Abi; | |
| 18 | use rustc_span::symbol::{Symbol, sym}; | |
| 20 | 19 | use rustc_target::spec::LinkSelfContainedComponents; |
| 20 | use rustc_target::spec::abi::Abi; | |
| 21 | 21 | |
| 22 | 22 | use crate::{errors, fluent_generated}; |
| 23 | 23 |
compiler/rustc_metadata/src/rmeta/decoder.rs+3-3| ... | ... | @@ -22,16 +22,16 @@ use rustc_hir::diagnostic_items::DiagnosticItems; |
| 22 | 22 | use rustc_index::Idx; |
| 23 | 23 | use rustc_middle::middle::lib_features::LibFeatures; |
| 24 | 24 | use rustc_middle::mir::interpret::{AllocDecodingSession, AllocDecodingState}; |
| 25 | use rustc_middle::ty::codec::TyDecoder; | |
| 26 | 25 | use rustc_middle::ty::Visibility; |
| 26 | use rustc_middle::ty::codec::TyDecoder; | |
| 27 | 27 | use rustc_middle::{bug, implement_ty_decoder}; |
| 28 | 28 | use rustc_serialize::opaque::MemDecoder; |
| 29 | 29 | use rustc_serialize::{Decodable, Decoder}; |
| 30 | use rustc_session::cstore::{CrateSource, ExternCrate}; | |
| 31 | 30 | use rustc_session::Session; |
| 31 | use rustc_session::cstore::{CrateSource, ExternCrate}; | |
| 32 | 32 | use rustc_span::hygiene::HygieneDecodeContext; |
| 33 | 33 | use rustc_span::symbol::kw; |
| 34 | use rustc_span::{BytePos, Pos, SpanData, SpanDecoder, SyntaxContext, DUMMY_SP}; | |
| 34 | use rustc_span::{BytePos, DUMMY_SP, Pos, SpanData, SpanDecoder, SyntaxContext}; | |
| 35 | 35 | use tracing::debug; |
| 36 | 36 | |
| 37 | 37 | use crate::creader::CStore; |
compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs+3-3| ... | ... | @@ -18,14 +18,14 @@ use rustc_middle::ty::{self, TyCtxt}; |
| 18 | 18 | use rustc_middle::util::Providers; |
| 19 | 19 | use rustc_session::cstore::{CrateStore, ExternCrate}; |
| 20 | 20 | use rustc_session::{Session, StableCrateId}; |
| 21 | use rustc_span::hygiene::ExpnId; | |
| 22 | use rustc_span::symbol::{kw, Symbol}; | |
| 23 | 21 | use rustc_span::Span; |
| 22 | use rustc_span::hygiene::ExpnId; | |
| 23 | use rustc_span::symbol::{Symbol, kw}; | |
| 24 | 24 | |
| 25 | 25 | use super::{Decodable, DecodeContext, DecodeIterator}; |
| 26 | 26 | use crate::creader::{CStore, LoadedMacro}; |
| 27 | use crate::rmeta::table::IsDefault; | |
| 28 | 27 | use crate::rmeta::AttrFlags; |
| 28 | use crate::rmeta::table::IsDefault; | |
| 29 | 29 | use crate::{foreign_modules, native_libs}; |
| 30 | 30 | |
| 31 | 31 | trait ProcessQueryValue<'tcx, T> { |
compiler/rustc_metadata/src/rmeta/encoder.rs+3-3| ... | ... | @@ -7,11 +7,11 @@ use std::path::{Path, PathBuf}; |
| 7 | 7 | use rustc_ast::Attribute; |
| 8 | 8 | use rustc_data_structures::fx::{FxIndexMap, FxIndexSet}; |
| 9 | 9 | use rustc_data_structures::memmap::{Mmap, MmapMut}; |
| 10 | use rustc_data_structures::sync::{join, par_for_each_in, Lrc}; | |
| 10 | use rustc_data_structures::sync::{Lrc, join, par_for_each_in}; | |
| 11 | 11 | use rustc_data_structures::temp_dir::MaybeTempDir; |
| 12 | 12 | use rustc_feature::Features; |
| 13 | 13 | use rustc_hir as hir; |
| 14 | use rustc_hir::def_id::{LocalDefId, LocalDefIdSet, CRATE_DEF_ID, CRATE_DEF_INDEX, LOCAL_CRATE}; | |
| 14 | use rustc_hir::def_id::{CRATE_DEF_ID, CRATE_DEF_INDEX, LOCAL_CRATE, LocalDefId, LocalDefIdSet}; | |
| 15 | 15 | use rustc_hir::definitions::DefPathData; |
| 16 | 16 | use rustc_hir_pretty::id_to_string; |
| 17 | 17 | use rustc_middle::middle::dependency_format::Linkage; |
| ... | ... | @@ -24,7 +24,7 @@ use rustc_middle::ty::fast_reject::{self, TreatParams}; |
| 24 | 24 | use rustc_middle::ty::{AssocItemContainer, SymbolName}; |
| 25 | 25 | use rustc_middle::util::common::to_readable_str; |
| 26 | 26 | use rustc_middle::{bug, span_bug}; |
| 27 | use rustc_serialize::{opaque, Decodable, Decoder, Encodable, Encoder}; | |
| 27 | use rustc_serialize::{Decodable, Decoder, Encodable, Encoder, opaque}; | |
| 28 | 28 | use rustc_session::config::{CrateType, OptLevel}; |
| 29 | 29 | use rustc_span::hygiene::HygieneEncodeContext; |
| 30 | 30 | use rustc_span::symbol::sym; |
compiler/rustc_metadata/src/rmeta/mod.rs+2-2| ... | ... | @@ -5,7 +5,7 @@ pub(crate) use decoder::{CrateMetadata, CrateNumMap, MetadataBlob}; |
| 5 | 5 | use decoder::{DecodeContext, Metadata}; |
| 6 | 6 | use def_path_hash_map::DefPathHashMapRef; |
| 7 | 7 | use encoder::EncodeContext; |
| 8 | pub use encoder::{encode_metadata, rendered_const, EncodedMetadata}; | |
| 8 | pub use encoder::{EncodedMetadata, encode_metadata, rendered_const}; | |
| 9 | 9 | use rustc_ast::expand::StrippedCfgItem; |
| 10 | 10 | use rustc_data_structures::fx::FxHashMap; |
| 11 | 11 | use rustc_data_structures::svh::Svh; |
| ... | ... | @@ -13,8 +13,8 @@ use rustc_hir::def::{CtorKind, DefKind, DocLinkResMap}; |
| 13 | 13 | use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, DefIndex, DefPathHash, StableCrateId}; |
| 14 | 14 | use rustc_hir::definitions::DefKey; |
| 15 | 15 | use rustc_hir::lang_items::LangItem; |
| 16 | use rustc_index::bit_set::BitSet; | |
| 17 | 16 | use rustc_index::IndexVec; |
| 17 | use rustc_index::bit_set::BitSet; | |
| 18 | 18 | use rustc_macros::{ |
| 19 | 19 | Decodable, Encodable, MetadataDecodable, MetadataEncodable, TyDecodable, TyEncodable, |
| 20 | 20 | }; |
compiler/rustc_middle/src/dep_graph/dep_node.rs+2-2| ... | ... | @@ -57,12 +57,12 @@ |
| 57 | 57 | //! [dependency graph]: https://rustc-dev-guide.rust-lang.org/query.html |
| 58 | 58 | |
| 59 | 59 | use rustc_data_structures::fingerprint::Fingerprint; |
| 60 | use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LocalModDefId, ModDefId, LOCAL_CRATE}; | |
| 60 | use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE, LocalDefId, LocalModDefId, ModDefId}; | |
| 61 | 61 | use rustc_hir::definitions::DefPathHash; |
| 62 | 62 | use rustc_hir::{HirId, ItemLocalId, OwnerId}; |
| 63 | pub use rustc_query_system::dep_graph::dep_node::DepKind; | |
| 64 | 63 | pub use rustc_query_system::dep_graph::DepNode; |
| 65 | 64 | use rustc_query_system::dep_graph::FingerprintStyle; |
| 65 | pub use rustc_query_system::dep_graph::dep_node::DepKind; | |
| 66 | 66 | pub(crate) use rustc_query_system::dep_graph::{DepContext, DepNodeParams}; |
| 67 | 67 | use rustc_span::symbol::Symbol; |
| 68 | 68 |
compiler/rustc_middle/src/dep_graph/mod.rs+3-3| ... | ... | @@ -7,12 +7,12 @@ use crate::ty::{self, TyCtxt}; |
| 7 | 7 | #[macro_use] |
| 8 | 8 | mod dep_node; |
| 9 | 9 | |
| 10 | pub use dep_node::{dep_kinds, label_strs, DepKind, DepNode, DepNodeExt}; | |
| 10 | pub use dep_node::{DepKind, DepNode, DepNodeExt, dep_kinds, label_strs}; | |
| 11 | 11 | pub(crate) use dep_node::{make_compile_codegen_unit, make_compile_mono_item}; |
| 12 | 12 | pub use rustc_query_system::dep_graph::debug::{DepNodeFilter, EdgeFilter}; |
| 13 | 13 | pub use rustc_query_system::dep_graph::{ |
| 14 | hash_result, DepContext, DepGraphQuery, DepNodeIndex, Deps, SerializedDepGraph, | |
| 15 | SerializedDepNodeIndex, TaskDepsRef, WorkProduct, WorkProductId, WorkProductMap, | |
| 14 | DepContext, DepGraphQuery, DepNodeIndex, Deps, SerializedDepGraph, SerializedDepNodeIndex, | |
| 15 | TaskDepsRef, WorkProduct, WorkProductId, WorkProductMap, hash_result, | |
| 16 | 16 | }; |
| 17 | 17 | |
| 18 | 18 | pub type DepGraph = rustc_query_system::dep_graph::DepGraph<DepsType>; |
compiler/rustc_middle/src/hir/map/mod.rs+4-4| ... | ... | @@ -1,16 +1,16 @@ |
| 1 | use rustc_ast::visit::{walk_list, VisitorResult}; | |
| 1 | use rustc_ast::visit::{VisitorResult, walk_list}; | |
| 2 | 2 | use rustc_data_structures::fingerprint::Fingerprint; |
| 3 | 3 | use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; |
| 4 | 4 | use rustc_data_structures::svh::Svh; |
| 5 | use rustc_data_structures::sync::{par_for_each_in, try_par_for_each_in, DynSend, DynSync}; | |
| 5 | use rustc_data_structures::sync::{DynSend, DynSync, par_for_each_in, try_par_for_each_in}; | |
| 6 | 6 | use rustc_hir::def::{DefKind, Res}; |
| 7 | use rustc_hir::def_id::{DefId, LocalDefId, LocalModDefId, LOCAL_CRATE}; | |
| 7 | use rustc_hir::def_id::{DefId, LOCAL_CRATE, LocalDefId, LocalModDefId}; | |
| 8 | 8 | use rustc_hir::definitions::{DefKey, DefPath, DefPathHash}; |
| 9 | 9 | use rustc_hir::intravisit::Visitor; |
| 10 | 10 | use rustc_hir::*; |
| 11 | 11 | use rustc_middle::hir::nested_filter; |
| 12 | 12 | use rustc_span::def_id::StableCrateId; |
| 13 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 13 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 14 | 14 | use rustc_span::{ErrorGuaranteed, Span}; |
| 15 | 15 | use rustc_target::spec::abi::Abi; |
| 16 | 16 | use {rustc_ast as ast, rustc_hir_pretty as pprust_hir}; |
compiler/rustc_middle/src/hir/mod.rs+1-1| ... | ... | @@ -9,7 +9,7 @@ pub mod place; |
| 9 | 9 | use rustc_data_structures::fingerprint::Fingerprint; |
| 10 | 10 | use rustc_data_structures::sorted_map::SortedMap; |
| 11 | 11 | use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; |
| 12 | use rustc_data_structures::sync::{try_par_for_each_in, DynSend, DynSync}; | |
| 12 | use rustc_data_structures::sync::{DynSend, DynSync, try_par_for_each_in}; | |
| 13 | 13 | use rustc_hir::def::DefKind; |
| 14 | 14 | use rustc_hir::def_id::{DefId, LocalDefId, LocalModDefId}; |
| 15 | 15 | use rustc_hir::*; |
compiler/rustc_middle/src/hooks/mod.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | use rustc_hir::def_id::{DefId, DefPathHash}; |
| 7 | 7 | use rustc_session::StableCrateId; |
| 8 | 8 | use rustc_span::def_id::{CrateNum, LocalDefId}; |
| 9 | use rustc_span::{ExpnHash, ExpnId, DUMMY_SP}; | |
| 9 | use rustc_span::{DUMMY_SP, ExpnHash, ExpnId}; | |
| 10 | 10 | use tracing::instrument; |
| 11 | 11 | |
| 12 | 12 | use crate::mir; |
compiler/rustc_middle/src/infer/unify_key.rs+1-1| ... | ... | @@ -2,8 +2,8 @@ use std::cmp; |
| 2 | 2 | use std::marker::PhantomData; |
| 3 | 3 | |
| 4 | 4 | use rustc_data_structures::unify::{NoError, UnifyKey, UnifyValue}; |
| 5 | use rustc_span::def_id::DefId; | |
| 6 | 5 | use rustc_span::Span; |
| 6 | use rustc_span::def_id::DefId; | |
| 7 | 7 | |
| 8 | 8 | use crate::ty::{self, Ty, TyCtxt}; |
| 9 | 9 |
compiler/rustc_middle/src/lint.rs+2-2| ... | ... | @@ -5,11 +5,11 @@ use rustc_data_structures::sorted_map::SortedMap; |
| 5 | 5 | use rustc_errors::{Diag, MultiSpan}; |
| 6 | 6 | use rustc_hir::{HirId, ItemLocalId}; |
| 7 | 7 | use rustc_macros::HashStable; |
| 8 | use rustc_session::Session; | |
| 8 | 9 | use rustc_session::lint::builtin::{self, FORBIDDEN_LINT_GROUPS}; |
| 9 | 10 | use rustc_session::lint::{FutureIncompatibilityReason, Level, Lint, LintExpectationId, LintId}; |
| 10 | use rustc_session::Session; | |
| 11 | 11 | use rustc_span::hygiene::{ExpnKind, MacroKind}; |
| 12 | use rustc_span::{symbol, DesugaringKind, Span, Symbol, DUMMY_SP}; | |
| 12 | use rustc_span::{DUMMY_SP, DesugaringKind, Span, Symbol, symbol}; | |
| 13 | 13 | use tracing::instrument; |
| 14 | 14 | |
| 15 | 15 | use crate::ty::TyCtxt; |
compiler/rustc_middle/src/middle/lang_items.rs+1-1| ... | ... | @@ -7,8 +7,8 @@ |
| 7 | 7 | //! * Traits that represent operators; e.g., `Add`, `Sub`, `Index`. |
| 8 | 8 | //! * Functions called by the compiler itself. |
| 9 | 9 | |
| 10 | use rustc_hir::def_id::DefId; | |
| 11 | 10 | use rustc_hir::LangItem; |
| 11 | use rustc_hir::def_id::DefId; | |
| 12 | 12 | use rustc_span::Span; |
| 13 | 13 | use rustc_target::spec::PanicStrategy; |
| 14 | 14 |
compiler/rustc_middle/src/middle/limits.rs+1-1| ... | ... | @@ -12,7 +12,7 @@ use std::num::IntErrorKind; |
| 12 | 12 | |
| 13 | 13 | use rustc_ast::Attribute; |
| 14 | 14 | use rustc_session::{Limit, Limits, Session}; |
| 15 | use rustc_span::symbol::{sym, Symbol}; | |
| 15 | use rustc_span::symbol::{Symbol, sym}; | |
| 16 | 16 | |
| 17 | 17 | use crate::error::LimitInvalid; |
| 18 | 18 | use crate::query::Providers; |
compiler/rustc_middle/src/middle/mod.rs+1-1| ... | ... | @@ -6,8 +6,8 @@ pub mod lang_items; |
| 6 | 6 | pub mod lib_features { |
| 7 | 7 | use rustc_data_structures::unord::UnordMap; |
| 8 | 8 | use rustc_macros::{HashStable, TyDecodable, TyEncodable}; |
| 9 | use rustc_span::symbol::Symbol; | |
| 10 | 9 | use rustc_span::Span; |
| 10 | use rustc_span::symbol::Symbol; | |
| 11 | 11 | |
| 12 | 12 | #[derive(Copy, Clone, Debug, PartialEq, Eq)] |
| 13 | 13 | #[derive(HashStable, TyEncodable, TyDecodable)] |
compiler/rustc_middle/src/middle/privacy.rs+1-1| ... | ... | @@ -9,7 +9,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; |
| 9 | 9 | use rustc_hir::def::DefKind; |
| 10 | 10 | use rustc_macros::HashStable; |
| 11 | 11 | use rustc_query_system::ich::StableHashingContext; |
| 12 | use rustc_span::def_id::{LocalDefId, CRATE_DEF_ID}; | |
| 12 | use rustc_span::def_id::{CRATE_DEF_ID, LocalDefId}; | |
| 13 | 13 | |
| 14 | 14 | use crate::ty::{TyCtxt, Visibility}; |
| 15 | 15 |
compiler/rustc_middle/src/middle/region.rs+1-1| ... | ... | @@ -14,7 +14,7 @@ use rustc_data_structures::unord::UnordMap; |
| 14 | 14 | use rustc_hir as hir; |
| 15 | 15 | use rustc_hir::{HirId, HirIdMap, Node}; |
| 16 | 16 | use rustc_macros::{HashStable, TyDecodable, TyEncodable}; |
| 17 | use rustc_span::{Span, DUMMY_SP}; | |
| 17 | use rustc_span::{DUMMY_SP, Span}; | |
| 18 | 18 | use tracing::debug; |
| 19 | 19 | |
| 20 | 20 | use crate::ty::TyCtxt; |
compiler/rustc_middle/src/middle/stability.rs+2-2| ... | ... | @@ -15,12 +15,12 @@ use rustc_hir::def_id::{DefId, LocalDefId, LocalDefIdMap}; |
| 15 | 15 | use rustc_hir::{self as hir, HirId}; |
| 16 | 16 | use rustc_macros::{Decodable, Encodable, HashStable, Subdiagnostic}; |
| 17 | 17 | use rustc_middle::ty::print::with_no_trimmed_paths; |
| 18 | use rustc_session::Session; | |
| 18 | 19 | use rustc_session::lint::builtin::{DEPRECATED, DEPRECATED_IN_FUTURE, SOFT_UNSTABLE}; |
| 19 | 20 | use rustc_session::lint::{BuiltinLintDiag, DeprecatedSinceKind, Level, Lint, LintBuffer}; |
| 20 | 21 | use rustc_session::parse::feature_err_issue; |
| 21 | use rustc_session::Session; | |
| 22 | use rustc_span::symbol::{sym, Symbol}; | |
| 23 | 22 | use rustc_span::Span; |
| 23 | use rustc_span::symbol::{Symbol, sym}; | |
| 24 | 24 | use tracing::debug; |
| 25 | 25 | |
| 26 | 26 | pub use self::StabilityLevel::*; |
compiler/rustc_middle/src/mir/basic_blocks.rs+2-2| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use rustc_data_structures::fx::FxHashMap; |
| 2 | 2 | use rustc_data_structures::graph; |
| 3 | use rustc_data_structures::graph::dominators::{dominators, Dominators}; | |
| 3 | use rustc_data_structures::graph::dominators::{Dominators, dominators}; | |
| 4 | 4 | use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; |
| 5 | 5 | use rustc_data_structures::sync::OnceLock; |
| 6 | 6 | use rustc_index::{IndexSlice, IndexVec}; |
| ... | ... | @@ -9,7 +9,7 @@ use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; |
| 9 | 9 | use smallvec::SmallVec; |
| 10 | 10 | |
| 11 | 11 | use crate::mir::traversal::Postorder; |
| 12 | use crate::mir::{BasicBlock, BasicBlockData, Terminator, TerminatorKind, START_BLOCK}; | |
| 12 | use crate::mir::{BasicBlock, BasicBlockData, START_BLOCK, Terminator, TerminatorKind}; | |
| 13 | 13 | |
| 14 | 14 | #[derive(Clone, TyEncodable, TyDecodable, Debug, HashStable, TypeFoldable, TypeVisitable)] |
| 15 | 15 | pub struct BasicBlocks<'tcx> { |
compiler/rustc_middle/src/mir/consts.rs+4-4| ... | ... | @@ -2,13 +2,13 @@ use std::fmt::{self, Debug, Display, Formatter}; |
| 2 | 2 | |
| 3 | 3 | use rustc_hir::def_id::DefId; |
| 4 | 4 | use rustc_macros::{HashStable, Lift, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable}; |
| 5 | use rustc_session::config::RemapPathScopeComponents; | |
| 6 | 5 | use rustc_session::RemapFileNameExt; |
| 7 | use rustc_span::{Span, DUMMY_SP}; | |
| 6 | use rustc_session::config::RemapPathScopeComponents; | |
| 7 | use rustc_span::{DUMMY_SP, Span}; | |
| 8 | 8 | use rustc_target::abi::{HasDataLayout, Size}; |
| 9 | 9 | |
| 10 | use crate::mir::interpret::{alloc_range, AllocId, ConstAllocation, ErrorHandled, Scalar}; | |
| 11 | use crate::mir::{pretty_print_const_value, Promoted}; | |
| 10 | use crate::mir::interpret::{AllocId, ConstAllocation, ErrorHandled, Scalar, alloc_range}; | |
| 11 | use crate::mir::{Promoted, pretty_print_const_value}; | |
| 12 | 12 | use crate::ty::print::{pretty_print_const, with_no_trimmed_paths}; |
| 13 | 13 | use crate::ty::{self, GenericArgsRef, ScalarInt, Ty, TyCtxt}; |
| 14 | 14 |
compiler/rustc_middle/src/mir/interpret/allocation.rs+3-3| ... | ... | @@ -18,9 +18,9 @@ use rustc_macros::{HashStable, TyDecodable, TyEncodable}; |
| 18 | 18 | use rustc_target::abi::{Align, HasDataLayout, Size}; |
| 19 | 19 | |
| 20 | 20 | use super::{ |
| 21 | read_target_uint, write_target_uint, AllocId, BadBytesAccess, CtfeProvenance, InterpError, | |
| 22 | InterpResult, Pointer, PointerArithmetic, Provenance, ResourceExhaustionInfo, Scalar, | |
| 23 | ScalarSizeMismatch, UndefinedBehaviorInfo, UnsupportedOpInfo, | |
| 21 | AllocId, BadBytesAccess, CtfeProvenance, InterpError, InterpResult, Pointer, PointerArithmetic, | |
| 22 | Provenance, ResourceExhaustionInfo, Scalar, ScalarSizeMismatch, UndefinedBehaviorInfo, | |
| 23 | UnsupportedOpInfo, read_target_uint, write_target_uint, | |
| 24 | 24 | }; |
| 25 | 25 | use crate::ty; |
| 26 | 26 |
compiler/rustc_middle/src/mir/interpret/allocation/provenance_map.rs+1-1| ... | ... | @@ -9,7 +9,7 @@ use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; |
| 9 | 9 | use rustc_target::abi::{HasDataLayout, Size}; |
| 10 | 10 | use tracing::trace; |
| 11 | 11 | |
| 12 | use super::{alloc_range, AllocError, AllocRange, AllocResult, CtfeProvenance, Provenance}; | |
| 12 | use super::{AllocError, AllocRange, AllocResult, CtfeProvenance, Provenance, alloc_range}; | |
| 13 | 13 | |
| 14 | 14 | /// Stores the provenance information of pointers stored in memory. |
| 15 | 15 | #[derive(Clone, PartialEq, Eq, Hash, Debug)] |
compiler/rustc_middle/src/mir/interpret/error.rs+3-3| ... | ... | @@ -10,13 +10,13 @@ use rustc_errors::{DiagArgName, DiagArgValue, DiagMessage, ErrorGuaranteed, Into |
| 10 | 10 | use rustc_macros::{HashStable, TyDecodable, TyEncodable}; |
| 11 | 11 | use rustc_session::CtfeBacktrace; |
| 12 | 12 | use rustc_span::def_id::DefId; |
| 13 | use rustc_span::{Span, Symbol, DUMMY_SP}; | |
| 14 | use rustc_target::abi::{call, Align, Size, VariantIdx, WrappingRange}; | |
| 13 | use rustc_span::{DUMMY_SP, Span, Symbol}; | |
| 14 | use rustc_target::abi::{Align, Size, VariantIdx, WrappingRange, call}; | |
| 15 | 15 | |
| 16 | 16 | use super::{AllocId, AllocRange, ConstAllocation, Pointer, Scalar}; |
| 17 | 17 | use crate::error; |
| 18 | 18 | use crate::mir::{ConstAlloc, ConstValue}; |
| 19 | use crate::ty::{self, layout, tls, Ty, TyCtxt, ValTree}; | |
| 19 | use crate::ty::{self, Ty, TyCtxt, ValTree, layout, tls}; | |
| 20 | 20 | |
| 21 | 21 | #[derive(Debug, Copy, Clone, PartialEq, Eq, HashStable, TyEncodable, TyDecodable)] |
| 22 | 22 | pub enum ErrorHandled { |
compiler/rustc_middle/src/mir/interpret/mod.rs+2-2| ... | ... | @@ -30,8 +30,8 @@ pub use { |
| 30 | 30 | }; |
| 31 | 31 | |
| 32 | 32 | pub use self::allocation::{ |
| 33 | alloc_range, AllocBytes, AllocError, AllocRange, AllocResult, Allocation, ConstAllocation, | |
| 34 | InitChunk, InitChunkIter, | |
| 33 | AllocBytes, AllocError, AllocRange, AllocResult, Allocation, ConstAllocation, InitChunk, | |
| 34 | InitChunkIter, alloc_range, | |
| 35 | 35 | }; |
| 36 | 36 | pub use self::error::{ |
| 37 | 37 | BadBytesAccess, CheckAlignMsg, CheckInAllocMsg, ErrorHandled, EvalStaticInitializerRawResult, |
compiler/rustc_middle/src/mir/interpret/queries.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use rustc_hir::def::DefKind; |
| 2 | 2 | use rustc_hir::def_id::DefId; |
| 3 | 3 | use rustc_session::lint; |
| 4 | use rustc_span::{Span, DUMMY_SP}; | |
| 4 | use rustc_span::{DUMMY_SP, Span}; | |
| 5 | 5 | use tracing::{debug, instrument}; |
| 6 | 6 | |
| 7 | 7 | use super::{ |
compiler/rustc_middle/src/mir/interpret/value.rs+1-1| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use std::fmt; |
| 2 | 2 | |
| 3 | 3 | use either::{Either, Left, Right}; |
| 4 | use rustc_apfloat::ieee::{Double, Half, Quad, Single}; | |
| 5 | 4 | use rustc_apfloat::Float; |
| 5 | use rustc_apfloat::ieee::{Double, Half, Quad, Single}; | |
| 6 | 6 | use rustc_macros::{HashStable, TyDecodable, TyEncodable}; |
| 7 | 7 | use rustc_target::abi::{HasDataLayout, Size}; |
| 8 | 8 |
compiler/rustc_middle/src/mir/mod.rs+8-8| ... | ... | @@ -16,7 +16,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet}; |
| 16 | 16 | use rustc_data_structures::graph::dominators::Dominators; |
| 17 | 17 | use rustc_errors::{DiagArgName, DiagArgValue, DiagMessage, ErrorGuaranteed, IntoDiagArg}; |
| 18 | 18 | use rustc_hir::def::{CtorKind, Namespace}; |
| 19 | use rustc_hir::def_id::{DefId, CRATE_DEF_ID}; | |
| 19 | use rustc_hir::def_id::{CRATE_DEF_ID, DefId}; | |
| 20 | 20 | use rustc_hir::{ |
| 21 | 21 | self as hir, BindingMode, ByRef, CoroutineDesugaring, CoroutineKind, HirId, ImplicitSelfKind, |
| 22 | 22 | }; |
| ... | ... | @@ -26,7 +26,7 @@ use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisit |
| 26 | 26 | use rustc_serialize::{Decodable, Encodable}; |
| 27 | 27 | use rustc_span::source_map::Spanned; |
| 28 | 28 | use rustc_span::symbol::Symbol; |
| 29 | use rustc_span::{Span, DUMMY_SP}; | |
| 29 | use rustc_span::{DUMMY_SP, Span}; | |
| 30 | 30 | use rustc_target::abi::{FieldIdx, VariantIdx}; |
| 31 | 31 | use tracing::trace; |
| 32 | 32 | |
| ... | ... | @@ -36,7 +36,7 @@ use crate::mir::interpret::{AllocRange, Scalar}; |
| 36 | 36 | use crate::mir::visit::MirVisitable; |
| 37 | 37 | use crate::ty::codec::{TyDecoder, TyEncoder}; |
| 38 | 38 | use crate::ty::fold::{FallibleTypeFolder, TypeFoldable}; |
| 39 | use crate::ty::print::{pretty_print_const, with_no_trimmed_paths, FmtPrinter, Printer}; | |
| 39 | use crate::ty::print::{FmtPrinter, Printer, pretty_print_const, with_no_trimmed_paths}; | |
| 40 | 40 | use crate::ty::visit::TypeVisitableExt; |
| 41 | 41 | use crate::ty::{ |
| 42 | 42 | self, AdtDef, GenericArg, GenericArgsRef, Instance, InstanceKind, List, Ty, TyCtxt, |
| ... | ... | @@ -72,7 +72,7 @@ pub use terminator::*; |
| 72 | 72 | pub use self::generic_graph::graphviz_safe_def_name; |
| 73 | 73 | pub use self::graphviz::write_mir_graphviz; |
| 74 | 74 | pub use self::pretty::{ |
| 75 | create_dump_file, display_allocation, dump_enabled, dump_mir, write_mir_pretty, PassWhere, | |
| 75 | PassWhere, create_dump_file, display_allocation, dump_enabled, dump_mir, write_mir_pretty, | |
| 76 | 76 | }; |
| 77 | 77 | |
| 78 | 78 | /// Types for locals |
| ... | ... | @@ -1399,10 +1399,10 @@ impl<'tcx> BasicBlockData<'tcx> { |
| 1399 | 1399 | // existing elements from before the gap to the end of the gap. |
| 1400 | 1400 | // For now, this is safe code, emulating a gap but initializing it. |
| 1401 | 1401 | let mut gap = self.statements.len()..self.statements.len() + extra_stmts; |
| 1402 | self.statements.resize( | |
| 1403 | gap.end, | |
| 1404 | Statement { source_info: SourceInfo::outermost(DUMMY_SP), kind: StatementKind::Nop }, | |
| 1405 | ); | |
| 1402 | self.statements.resize(gap.end, Statement { | |
| 1403 | source_info: SourceInfo::outermost(DUMMY_SP), | |
| 1404 | kind: StatementKind::Nop, | |
| 1405 | }); | |
| 1406 | 1406 | for (splice_start, new_stmts) in splices.into_iter().rev() { |
| 1407 | 1407 | let splice_end = splice_start + new_stmts.size_hint().0; |
| 1408 | 1408 | while gap.end > splice_end { |
compiler/rustc_middle/src/mir/mono.rs+3-3| ... | ... | @@ -2,19 +2,19 @@ use std::fmt; |
| 2 | 2 | use std::hash::Hash; |
| 3 | 3 | |
| 4 | 4 | use rustc_attr::InlineAttr; |
| 5 | use rustc_data_structures::base_n::{BaseNString, ToBaseN, CASE_INSENSITIVE}; | |
| 5 | use rustc_data_structures::base_n::{BaseNString, CASE_INSENSITIVE, ToBaseN}; | |
| 6 | 6 | use rustc_data_structures::fingerprint::Fingerprint; |
| 7 | 7 | use rustc_data_structures::fx::FxIndexMap; |
| 8 | 8 | use rustc_data_structures::stable_hasher::{Hash128, HashStable, StableHasher, ToStableHashKey}; |
| 9 | 9 | use rustc_data_structures::unord::UnordMap; |
| 10 | use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE}; | |
| 11 | 10 | use rustc_hir::ItemId; |
| 11 | use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE}; | |
| 12 | 12 | use rustc_index::Idx; |
| 13 | 13 | use rustc_macros::{HashStable, TyDecodable, TyEncodable}; |
| 14 | 14 | use rustc_query_system::ich::StableHashingContext; |
| 15 | 15 | use rustc_session::config::OptLevel; |
| 16 | use rustc_span::symbol::Symbol; | |
| 17 | 16 | use rustc_span::Span; |
| 17 | use rustc_span::symbol::Symbol; | |
| 18 | 18 | use tracing::debug; |
| 19 | 19 | |
| 20 | 20 | use crate::dep_graph::{DepNode, WorkProduct, WorkProductId}; |
compiler/rustc_middle/src/mir/pretty.rs+2-2| ... | ... | @@ -6,8 +6,8 @@ use std::path::{Path, PathBuf}; |
| 6 | 6 | |
| 7 | 7 | use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece}; |
| 8 | 8 | use rustc_middle::mir::interpret::{ |
| 9 | alloc_range, read_target_uint, AllocBytes, AllocId, Allocation, GlobalAlloc, Pointer, | |
| 10 | Provenance, | |
| 9 | AllocBytes, AllocId, Allocation, GlobalAlloc, Pointer, Provenance, alloc_range, | |
| 10 | read_target_uint, | |
| 11 | 11 | }; |
| 12 | 12 | use rustc_middle::mir::visit::Visitor; |
| 13 | 13 | use rustc_middle::mir::*; |
compiler/rustc_middle/src/mir/query.rs+1-1| ... | ... | @@ -10,8 +10,8 @@ use rustc_hir::def_id::LocalDefId; |
| 10 | 10 | use rustc_index::bit_set::BitMatrix; |
| 11 | 11 | use rustc_index::{Idx, IndexVec}; |
| 12 | 12 | use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable}; |
| 13 | use rustc_span::symbol::Symbol; | |
| 14 | 13 | use rustc_span::Span; |
| 14 | use rustc_span::symbol::Symbol; | |
| 15 | 15 | use rustc_target::abi::{FieldIdx, VariantIdx}; |
| 16 | 16 | use smallvec::SmallVec; |
| 17 | 17 |
compiler/rustc_middle/src/mir/syntax.rs+2-2| ... | ... | @@ -5,14 +5,14 @@ |
| 5 | 5 | |
| 6 | 6 | use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece, Mutability}; |
| 7 | 7 | use rustc_data_structures::packed::Pu128; |
| 8 | use rustc_hir::def_id::DefId; | |
| 9 | 8 | use rustc_hir::CoroutineKind; |
| 9 | use rustc_hir::def_id::DefId; | |
| 10 | 10 | use rustc_index::IndexVec; |
| 11 | 11 | use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable}; |
| 12 | use rustc_span::Span; | |
| 12 | 13 | use rustc_span::def_id::LocalDefId; |
| 13 | 14 | use rustc_span::source_map::Spanned; |
| 14 | 15 | use rustc_span::symbol::Symbol; |
| 15 | use rustc_span::Span; | |
| 16 | 16 | use rustc_target::abi::{FieldIdx, VariantIdx}; |
| 17 | 17 | use rustc_target::asm::InlineAsmRegOrRegClass; |
| 18 | 18 | use smallvec::SmallVec; |
compiler/rustc_middle/src/mir/terminator.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ use std::slice; |
| 5 | 5 | use rustc_data_structures::packed::Pu128; |
| 6 | 6 | use rustc_hir::LangItem; |
| 7 | 7 | use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable}; |
| 8 | use smallvec::{smallvec, SmallVec}; | |
| 8 | use smallvec::{SmallVec, smallvec}; | |
| 9 | 9 | |
| 10 | 10 | use super::{TerminatorKind, *}; |
| 11 | 11 |
compiler/rustc_middle/src/query/keys.rs+2-2| ... | ... | @@ -1,10 +1,10 @@ |
| 1 | 1 | //! Defines the set of legal keys that can be used in queries. |
| 2 | 2 | |
| 3 | use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LocalModDefId, ModDefId, LOCAL_CRATE}; | |
| 3 | use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE, LocalDefId, LocalModDefId, ModDefId}; | |
| 4 | 4 | use rustc_hir::hir_id::{HirId, OwnerId}; |
| 5 | 5 | use rustc_query_system::query::{DefIdCache, DefaultCache, SingleCache, VecCache}; |
| 6 | 6 | use rustc_span::symbol::{Ident, Symbol}; |
| 7 | use rustc_span::{Span, DUMMY_SP}; | |
| 7 | use rustc_span::{DUMMY_SP, Span}; | |
| 8 | 8 | use rustc_target::abi; |
| 9 | 9 | |
| 10 | 10 | use crate::infer::canonical::Canonical; |
compiler/rustc_middle/src/query/mod.rs+9-9| ... | ... | @@ -12,8 +12,8 @@ use std::path::PathBuf; |
| 12 | 12 | use std::sync::Arc; |
| 13 | 13 | |
| 14 | 14 | use rustc_arena::TypedArena; |
| 15 | use rustc_ast::expand::allocator::AllocatorKind; | |
| 16 | 15 | use rustc_ast::expand::StrippedCfgItem; |
| 16 | use rustc_ast::expand::allocator::AllocatorKind; | |
| 17 | 17 | use rustc_data_structures::fingerprint::Fingerprint; |
| 18 | 18 | use rustc_data_structures::fx::{FxIndexMap, FxIndexSet}; |
| 19 | 19 | use rustc_data_structures::steal::Steal; |
| ... | ... | @@ -30,16 +30,16 @@ use rustc_hir::{Crate, ItemLocalId, ItemLocalMap, TraitCandidate}; |
| 30 | 30 | use rustc_index::IndexVec; |
| 31 | 31 | use rustc_macros::rustc_queries; |
| 32 | 32 | use rustc_query_system::ich::StableHashingContext; |
| 33 | use rustc_query_system::query::{try_get_cached, QueryCache, QueryMode, QueryState}; | |
| 33 | use rustc_query_system::query::{QueryCache, QueryMode, QueryState, try_get_cached}; | |
| 34 | use rustc_session::Limits; | |
| 34 | 35 | use rustc_session::config::{EntryFnType, OptLevel, OutputFilenames, SymbolManglingVersion}; |
| 35 | 36 | use rustc_session::cstore::{ |
| 36 | 37 | CrateDepKind, CrateSource, ExternCrate, ForeignModule, LinkagePreference, NativeLib, |
| 37 | 38 | }; |
| 38 | 39 | use rustc_session::lint::LintExpectationId; |
| 39 | use rustc_session::Limits; | |
| 40 | 40 | use rustc_span::def_id::LOCAL_CRATE; |
| 41 | 41 | use rustc_span::symbol::Symbol; |
| 42 | use rustc_span::{Span, DUMMY_SP}; | |
| 42 | use rustc_span::{DUMMY_SP, Span}; | |
| 43 | 43 | use rustc_target::abi; |
| 44 | 44 | use rustc_target::spec::PanicStrategy; |
| 45 | 45 | use {rustc_ast as ast, rustc_attr as attr, rustc_hir as hir}; |
| ... | ... | @@ -59,9 +59,9 @@ use crate::mir::interpret::{ |
| 59 | 59 | EvalToValTreeResult, GlobalId, LitToConstError, LitToConstInput, |
| 60 | 60 | }; |
| 61 | 61 | use crate::mir::mono::CodegenUnit; |
| 62 | use crate::query::erase::{erase, restore, Erase}; | |
| 62 | use crate::query::erase::{Erase, erase, restore}; | |
| 63 | 63 | use crate::query::plumbing::{ |
| 64 | query_ensure, query_ensure_error_guaranteed, query_get_at, CyclePlaceholder, DynamicQuery, | |
| 64 | CyclePlaceholder, DynamicQuery, query_ensure, query_ensure_error_guaranteed, query_get_at, | |
| 65 | 65 | }; |
| 66 | 66 | use crate::traits::query::{ |
| 67 | 67 | CanonicalAliasGoal, CanonicalPredicateGoal, CanonicalTyGoal, |
| ... | ... | @@ -70,12 +70,12 @@ use crate::traits::query::{ |
| 70 | 70 | MethodAutoderefStepsResult, NoSolution, NormalizationResult, OutlivesBound, |
| 71 | 71 | }; |
| 72 | 72 | use crate::traits::{ |
| 73 | specialization_graph, CodegenObligationError, EvaluationResult, ImplSource, | |
| 74 | ObjectSafetyViolation, ObligationCause, OverflowError, WellFormedLoc, | |
| 73 | CodegenObligationError, EvaluationResult, ImplSource, ObjectSafetyViolation, ObligationCause, | |
| 74 | OverflowError, WellFormedLoc, specialization_graph, | |
| 75 | 75 | }; |
| 76 | 76 | use crate::ty::fast_reject::SimplifiedType; |
| 77 | 77 | use crate::ty::layout::ValidityRequirement; |
| 78 | use crate::ty::print::{describe_as_module, PrintTraitRefExt}; | |
| 78 | use crate::ty::print::{PrintTraitRefExt, describe_as_module}; | |
| 79 | 79 | use crate::ty::util::AlwaysRequiresDrop; |
| 80 | 80 | use crate::ty::{ |
| 81 | 81 | self, CrateInherentImpls, GenericArg, GenericArgsRef, ParamEnvAnd, Ty, TyCtxt, TyCtxtFeed, |
compiler/rustc_middle/src/query/on_disk_cache.rs+10-13| ... | ... | @@ -6,7 +6,7 @@ use rustc_data_structures::memmap::Mmap; |
| 6 | 6 | use rustc_data_structures::sync::{HashMapExt, Lock, Lrc, RwLock}; |
| 7 | 7 | use rustc_data_structures::unhash::UnhashMap; |
| 8 | 8 | use rustc_data_structures::unord::{UnordMap, UnordSet}; |
| 9 | use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LocalDefId, StableCrateId, LOCAL_CRATE}; | |
| 9 | use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LOCAL_CRATE, LocalDefId, StableCrateId}; | |
| 10 | 10 | use rustc_hir::definitions::DefPathHash; |
| 11 | 11 | use rustc_index::{Idx, IndexVec}; |
| 12 | 12 | use rustc_macros::{Decodable, Encodable}; |
| ... | ... | @@ -328,18 +328,15 @@ impl<'sess> OnDiskCache<'sess> { |
| 328 | 328 | |
| 329 | 329 | // Encode the file footer. |
| 330 | 330 | let footer_pos = encoder.position() as u64; |
| 331 | encoder.encode_tagged( | |
| 332 | TAG_FILE_FOOTER, | |
| 333 | &Footer { | |
| 334 | file_index_to_stable_id, | |
| 335 | query_result_index, | |
| 336 | side_effects_index, | |
| 337 | interpret_alloc_index, | |
| 338 | syntax_contexts, | |
| 339 | expn_data, | |
| 340 | foreign_expn_data, | |
| 341 | }, | |
| 342 | ); | |
| 331 | encoder.encode_tagged(TAG_FILE_FOOTER, &Footer { | |
| 332 | file_index_to_stable_id, | |
| 333 | query_result_index, | |
| 334 | side_effects_index, | |
| 335 | interpret_alloc_index, | |
| 336 | syntax_contexts, | |
| 337 | expn_data, | |
| 338 | foreign_expn_data, | |
| 339 | }); | |
| 343 | 340 | |
| 344 | 341 | // Encode the position of the footer as the last 8 bytes of the |
| 345 | 342 | // file so we know where to look for it. |
compiler/rustc_middle/src/query/plumbing.rs+2-2| ... | ... | @@ -5,11 +5,11 @@ use rustc_data_structures::sync::{AtomicU64, WorkerLocal}; |
| 5 | 5 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| 6 | 6 | use rustc_hir::hir_id::OwnerId; |
| 7 | 7 | use rustc_macros::HashStable; |
| 8 | use rustc_query_system::HandleCycleError; | |
| 8 | 9 | use rustc_query_system::dep_graph::{DepNodeIndex, SerializedDepNodeIndex}; |
| 9 | 10 | pub(crate) use rustc_query_system::query::QueryJobId; |
| 10 | 11 | use rustc_query_system::query::*; |
| 11 | use rustc_query_system::HandleCycleError; | |
| 12 | use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP}; | |
| 12 | use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span}; | |
| 13 | 13 | |
| 14 | 14 | use crate::dep_graph; |
| 15 | 15 | use crate::dep_graph::DepKind; |
compiler/rustc_middle/src/thir.rs+1-1| ... | ... | @@ -16,7 +16,7 @@ use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece}; |
| 16 | 16 | use rustc_hir as hir; |
| 17 | 17 | use rustc_hir::def_id::DefId; |
| 18 | 18 | use rustc_hir::{BindingMode, ByRef, HirId, MatchSource, RangeEnd}; |
| 19 | use rustc_index::{newtype_index, IndexVec}; | |
| 19 | use rustc_index::{IndexVec, newtype_index}; | |
| 20 | 20 | use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeVisitable}; |
| 21 | 21 | use rustc_middle::middle::region; |
| 22 | 22 | use rustc_middle::mir::interpret::AllocId; |
compiler/rustc_middle/src/traits/mod.rs+4-4| ... | ... | @@ -14,17 +14,17 @@ use std::hash::{Hash, Hasher}; |
| 14 | 14 | use rustc_data_structures::sync::Lrc; |
| 15 | 15 | use rustc_errors::{Applicability, Diag, EmissionGuarantee}; |
| 16 | 16 | use rustc_hir as hir; |
| 17 | use rustc_hir::def_id::DefId; | |
| 18 | 17 | use rustc_hir::HirId; |
| 18 | use rustc_hir::def_id::DefId; | |
| 19 | 19 | use rustc_macros::{ |
| 20 | 20 | Decodable, Encodable, HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable, |
| 21 | 21 | }; |
| 22 | use rustc_span::def_id::{LocalDefId, CRATE_DEF_ID}; | |
| 22 | use rustc_span::def_id::{CRATE_DEF_ID, LocalDefId}; | |
| 23 | 23 | use rustc_span::symbol::Symbol; |
| 24 | use rustc_span::{Span, DUMMY_SP}; | |
| 24 | use rustc_span::{DUMMY_SP, Span}; | |
| 25 | 25 | // FIXME: Remove this import and import via `solve::` |
| 26 | 26 | pub use rustc_type_ir::solve::{BuiltinImplSource, Reveal}; |
| 27 | use smallvec::{smallvec, SmallVec}; | |
| 27 | use smallvec::{SmallVec, smallvec}; | |
| 28 | 28 | |
| 29 | 29 | pub use self::select::{EvaluationCache, EvaluationResult, OverflowError, SelectionCache}; |
| 30 | 30 | use crate::mir::ConstraintCategory; |
compiler/rustc_middle/src/ty/adt.rs+1-1| ... | ... | @@ -17,7 +17,7 @@ use rustc_macros::{HashStable, TyDecodable, TyEncodable}; |
| 17 | 17 | use rustc_query_system::ich::StableHashingContext; |
| 18 | 18 | use rustc_session::DataTypeKind; |
| 19 | 19 | use rustc_span::symbol::sym; |
| 20 | use rustc_target::abi::{ReprOptions, VariantIdx, FIRST_VARIANT}; | |
| 20 | use rustc_target::abi::{FIRST_VARIANT, ReprOptions, VariantIdx}; | |
| 21 | 21 | use tracing::{debug, info, trace}; |
| 22 | 22 | |
| 23 | 23 | use super::{ |
compiler/rustc_middle/src/ty/closure.rs+1-1| ... | ... | @@ -3,8 +3,8 @@ use std::fmt::Write; |
| 3 | 3 | use rustc_data_structures::captures::Captures; |
| 4 | 4 | use rustc_data_structures::fx::FxIndexMap; |
| 5 | 5 | use rustc_hir as hir; |
| 6 | use rustc_hir::def_id::LocalDefId; | |
| 7 | 6 | use rustc_hir::HirId; |
| 7 | use rustc_hir::def_id::LocalDefId; | |
| 8 | 8 | use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable}; |
| 9 | 9 | use rustc_span::def_id::LocalDefIdMap; |
| 10 | 10 | use rustc_span::symbol::Ident; |
compiler/rustc_middle/src/ty/consts.rs+5-8| ... | ... | @@ -18,7 +18,7 @@ mod valtree; |
| 18 | 18 | |
| 19 | 19 | pub use int::*; |
| 20 | 20 | pub use kind::*; |
| 21 | use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP}; | |
| 21 | use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span}; | |
| 22 | 22 | pub use valtree::*; |
| 23 | 23 | |
| 24 | 24 | pub type ConstKind<'tcx> = ir::ConstKind<TyCtxt<'tcx>>; |
| ... | ... | @@ -242,13 +242,10 @@ impl<'tcx> Const<'tcx> { |
| 242 | 242 | |
| 243 | 243 | match Self::try_from_lit_or_param(tcx, ty, expr) { |
| 244 | 244 | Some(v) => v, |
| 245 | None => ty::Const::new_unevaluated( | |
| 246 | tcx, | |
| 247 | ty::UnevaluatedConst { | |
| 248 | def: def.to_def_id(), | |
| 249 | args: GenericArgs::identity_for_item(tcx, def.to_def_id()), | |
| 250 | }, | |
| 251 | ), | |
| 245 | None => ty::Const::new_unevaluated(tcx, ty::UnevaluatedConst { | |
| 246 | def: def.to_def_id(), | |
| 247 | args: GenericArgs::identity_for_item(tcx, def.to_def_id()), | |
| 248 | }), | |
| 252 | 249 | } |
| 253 | 250 | } |
| 254 | 251 |
compiler/rustc_middle/src/ty/consts/int.rs+1-1| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use std::fmt; |
| 2 | 2 | use std::num::NonZero; |
| 3 | 3 | |
| 4 | use rustc_apfloat::ieee::{Double, Half, Quad, Single}; | |
| 5 | 4 | use rustc_apfloat::Float; |
| 5 | use rustc_apfloat::ieee::{Double, Half, Quad, Single}; | |
| 6 | 6 | use rustc_errors::{DiagArgValue, IntoDiagArg}; |
| 7 | 7 | use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; |
| 8 | 8 | use rustc_target::abi::Size; |
compiler/rustc_middle/src/ty/consts/kind.rs+5-8| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use std::assert_matches::assert_matches; |
| 2 | 2 | |
| 3 | use rustc_macros::{extension, HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable}; | |
| 3 | use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable, extension}; | |
| 4 | 4 | |
| 5 | 5 | use super::Const; |
| 6 | 6 | use crate::mir; |
| ... | ... | @@ -31,13 +31,10 @@ impl<'tcx> ty::UnevaluatedConst<'tcx> { |
| 31 | 31 | // FIXME(eddyb, skinny121) pass `InferCtxt` into here when it's available, so that |
| 32 | 32 | // we can call `infcx.const_eval_resolve` which handles inference variables. |
| 33 | 33 | if (param_env, self).has_non_region_infer() { |
| 34 | ( | |
| 35 | tcx.param_env(self.def), | |
| 36 | ty::UnevaluatedConst { | |
| 37 | def: self.def, | |
| 38 | args: ty::GenericArgs::identity_for_item(tcx, self.def), | |
| 39 | }, | |
| 40 | ) | |
| 34 | (tcx.param_env(self.def), ty::UnevaluatedConst { | |
| 35 | def: self.def, | |
| 36 | args: ty::GenericArgs::identity_for_item(tcx, self.def), | |
| 37 | }) | |
| 41 | 38 | } else { |
| 42 | 39 | (tcx.erase_regions(param_env).with_reveal_all_normalized(tcx), tcx.erase_regions(self)) |
| 43 | 40 | } |
compiler/rustc_middle/src/ty/context.rs+16-19| ... | ... | @@ -30,7 +30,7 @@ use rustc_errors::{ |
| 30 | 30 | }; |
| 31 | 31 | use rustc_hir as hir; |
| 32 | 32 | use rustc_hir::def::DefKind; |
| 33 | use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE}; | |
| 33 | use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE, LocalDefId}; | |
| 34 | 34 | use rustc_hir::definitions::Definitions; |
| 35 | 35 | use rustc_hir::intravisit::Visitor; |
| 36 | 36 | use rustc_hir::lang_items::LangItem; |
| ... | ... | @@ -45,17 +45,17 @@ use rustc_session::config::CrateType; |
| 45 | 45 | use rustc_session::cstore::{CrateStoreDyn, Untracked}; |
| 46 | 46 | use rustc_session::lint::Lint; |
| 47 | 47 | use rustc_session::{Limit, MetadataKind, Session}; |
| 48 | use rustc_span::def_id::{DefPathHash, StableCrateId, CRATE_DEF_ID}; | |
| 49 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 50 | use rustc_span::{Span, DUMMY_SP}; | |
| 48 | use rustc_span::def_id::{CRATE_DEF_ID, DefPathHash, StableCrateId}; | |
| 49 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 50 | use rustc_span::{DUMMY_SP, Span}; | |
| 51 | 51 | use rustc_target::abi::{FieldIdx, Layout, LayoutS, TargetDataLayout, VariantIdx}; |
| 52 | 52 | use rustc_target::spec::abi; |
| 53 | use rustc_type_ir::TyKind::*; | |
| 53 | 54 | use rustc_type_ir::fold::TypeFoldable; |
| 54 | 55 | use rustc_type_ir::lang_items::TraitSolverLangItem; |
| 55 | 56 | pub use rustc_type_ir::lift::Lift; |
| 56 | 57 | use rustc_type_ir::solve::SolverMode; |
| 57 | use rustc_type_ir::TyKind::*; | |
| 58 | use rustc_type_ir::{search_graph, CollectAndApply, Interner, TypeFlags, WithCachedTypeInfo}; | |
| 58 | use rustc_type_ir::{CollectAndApply, Interner, TypeFlags, WithCachedTypeInfo, search_graph}; | |
| 59 | 59 | use tracing::{debug, instrument}; |
| 60 | 60 | |
| 61 | 61 | use crate::arena::Arena; |
| ... | ... | @@ -1015,10 +1015,10 @@ impl<'tcx> CommonLifetimes<'tcx> { |
| 1015 | 1015 | .map(|i| { |
| 1016 | 1016 | (0..NUM_PREINTERNED_RE_LATE_BOUNDS_V) |
| 1017 | 1017 | .map(|v| { |
| 1018 | mk(ty::ReBound( | |
| 1019 | ty::DebruijnIndex::from(i), | |
| 1020 | ty::BoundRegion { var: ty::BoundVar::from(v), kind: ty::BrAnon }, | |
| 1021 | )) | |
| 1018 | mk(ty::ReBound(ty::DebruijnIndex::from(i), ty::BoundRegion { | |
| 1019 | var: ty::BoundVar::from(v), | |
| 1020 | kind: ty::BrAnon, | |
| 1021 | })) | |
| 1022 | 1022 | }) |
| 1023 | 1023 | .collect() |
| 1024 | 1024 | }) |
| ... | ... | @@ -3052,15 +3052,12 @@ impl<'tcx> TyCtxt<'tcx> { |
| 3052 | 3052 | } |
| 3053 | 3053 | |
| 3054 | 3054 | let generics = self.generics_of(new_parent); |
| 3055 | return ty::Region::new_early_param( | |
| 3056 | self, | |
| 3057 | ty::EarlyParamRegion { | |
| 3058 | index: generics | |
| 3059 | .param_def_id_to_index(self, ebv.to_def_id()) | |
| 3060 | .expect("early-bound var should be present in fn generics"), | |
| 3061 | name: self.item_name(ebv.to_def_id()), | |
| 3062 | }, | |
| 3063 | ); | |
| 3055 | return ty::Region::new_early_param(self, ty::EarlyParamRegion { | |
| 3056 | index: generics | |
| 3057 | .param_def_id_to_index(self, ebv.to_def_id()) | |
| 3058 | .expect("early-bound var should be present in fn generics"), | |
| 3059 | name: self.item_name(ebv.to_def_id()), | |
| 3060 | }); | |
| 3064 | 3061 | } |
| 3065 | 3062 | Some(resolve_bound_vars::ResolvedArg::LateBound(_, _, lbv)) => { |
| 3066 | 3063 | let new_parent = self.local_parent(lbv); |
compiler/rustc_middle/src/ty/diagnostics.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ use std::fmt::Write; |
| 5 | 5 | use std::ops::ControlFlow; |
| 6 | 6 | |
| 7 | 7 | use rustc_data_structures::fx::FxHashMap; |
| 8 | use rustc_errors::{into_diag_arg_using_display, Applicability, Diag, DiagArgValue, IntoDiagArg}; | |
| 8 | use rustc_errors::{Applicability, Diag, DiagArgValue, IntoDiagArg, into_diag_arg_using_display}; | |
| 9 | 9 | use rustc_hir::def::DefKind; |
| 10 | 10 | use rustc_hir::def_id::DefId; |
| 11 | 11 | use rustc_hir::{self as hir, LangItem, PredicateOrigin, WherePredicate}; |
compiler/rustc_middle/src/ty/error.rs+1-1| ... | ... | @@ -8,7 +8,7 @@ use rustc_hir::def::{CtorOf, DefKind}; |
| 8 | 8 | use rustc_macros::extension; |
| 9 | 9 | pub use rustc_type_ir::error::ExpectedFound; |
| 10 | 10 | |
| 11 | use crate::ty::print::{with_forced_trimmed_paths, FmtPrinter, PrettyPrinter}; | |
| 11 | use crate::ty::print::{FmtPrinter, PrettyPrinter, with_forced_trimmed_paths}; | |
| 12 | 12 | use crate::ty::{self, Ty, TyCtxt}; |
| 13 | 13 | |
| 14 | 14 | pub type TypeError<'tcx> = rustc_type_ir::error::TypeError<TyCtxt<'tcx>>; |
compiler/rustc_middle/src/ty/fold.rs+15-20| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use rustc_data_structures::fx::FxIndexMap; |
| 2 | 2 | use rustc_hir::def_id::DefId; |
| 3 | 3 | pub use rustc_type_ir::fold::{ |
| 4 | shift_region, shift_vars, FallibleTypeFolder, TypeFoldable, TypeFolder, TypeSuperFoldable, | |
| 4 | FallibleTypeFolder, TypeFoldable, TypeFolder, TypeSuperFoldable, shift_region, shift_vars, | |
| 5 | 5 | }; |
| 6 | 6 | use tracing::{debug, instrument}; |
| 7 | 7 | |
| ... | ... | @@ -336,26 +336,21 @@ impl<'tcx> TyCtxt<'tcx> { |
| 336 | 336 | T: TypeFoldable<TyCtxt<'tcx>>, |
| 337 | 337 | { |
| 338 | 338 | let shift_bv = |bv: ty::BoundVar| ty::BoundVar::from_usize(bv.as_usize() + bound_vars); |
| 339 | self.replace_escaping_bound_vars_uncached( | |
| 340 | value, | |
| 341 | FnMutDelegate { | |
| 342 | regions: &mut |r: ty::BoundRegion| { | |
| 343 | ty::Region::new_bound( | |
| 344 | self, | |
| 345 | ty::INNERMOST, | |
| 346 | ty::BoundRegion { var: shift_bv(r.var), kind: r.kind }, | |
| 347 | ) | |
| 348 | }, | |
| 349 | types: &mut |t: ty::BoundTy| { | |
| 350 | Ty::new_bound( | |
| 351 | self, | |
| 352 | ty::INNERMOST, | |
| 353 | ty::BoundTy { var: shift_bv(t.var), kind: t.kind }, | |
| 354 | ) | |
| 355 | }, | |
| 356 | consts: &mut |c| ty::Const::new_bound(self, ty::INNERMOST, shift_bv(c)), | |
| 339 | self.replace_escaping_bound_vars_uncached(value, FnMutDelegate { | |
| 340 | regions: &mut |r: ty::BoundRegion| { | |
| 341 | ty::Region::new_bound(self, ty::INNERMOST, ty::BoundRegion { | |
| 342 | var: shift_bv(r.var), | |
| 343 | kind: r.kind, | |
| 344 | }) | |
| 357 | 345 | }, |
| 358 | ) | |
| 346 | types: &mut |t: ty::BoundTy| { | |
| 347 | Ty::new_bound(self, ty::INNERMOST, ty::BoundTy { | |
| 348 | var: shift_bv(t.var), | |
| 349 | kind: t.kind, | |
| 350 | }) | |
| 351 | }, | |
| 352 | consts: &mut |c| ty::Const::new_bound(self, ty::INNERMOST, shift_bv(c)), | |
| 353 | }) | |
| 359 | 354 | } |
| 360 | 355 | |
| 361 | 356 | /// Replaces any late-bound regions bound in `value` with `'erased`. Useful in codegen but also |
compiler/rustc_middle/src/ty/generic_args.rs+1-1| ... | ... | @@ -11,7 +11,7 @@ use rustc_ast_ir::walk_visitable_list; |
| 11 | 11 | use rustc_data_structures::intern::Interned; |
| 12 | 12 | use rustc_errors::{DiagArgValue, IntoDiagArg}; |
| 13 | 13 | use rustc_hir::def_id::DefId; |
| 14 | use rustc_macros::{extension, HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable}; | |
| 14 | use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable, extension}; | |
| 15 | 15 | use rustc_serialize::{Decodable, Encodable}; |
| 16 | 16 | use rustc_type_ir::WithCachedTypeInfo; |
| 17 | 17 | use smallvec::SmallVec; |
compiler/rustc_middle/src/ty/generics.rs+1-1| ... | ... | @@ -2,8 +2,8 @@ use rustc_ast as ast; |
| 2 | 2 | use rustc_data_structures::fx::FxHashMap; |
| 3 | 3 | use rustc_hir::def_id::DefId; |
| 4 | 4 | use rustc_macros::{HashStable, TyDecodable, TyEncodable}; |
| 5 | use rustc_span::symbol::{kw, Symbol}; | |
| 6 | 5 | use rustc_span::Span; |
| 6 | use rustc_span::symbol::{Symbol, kw}; | |
| 7 | 7 | use tracing::instrument; |
| 8 | 8 | |
| 9 | 9 | use super::{Clause, InstantiatedPredicates, ParamConst, ParamTy, Ty, TyCtxt}; |
compiler/rustc_middle/src/ty/instance.rs+2-2| ... | ... | @@ -12,12 +12,12 @@ use rustc_index::bit_set::FiniteBitSet; |
| 12 | 12 | use rustc_macros::{Decodable, Encodable, HashStable, Lift, TyDecodable, TyEncodable}; |
| 13 | 13 | use rustc_middle::ty::normalize_erasing_regions::NormalizationError; |
| 14 | 14 | use rustc_span::def_id::LOCAL_CRATE; |
| 15 | use rustc_span::{Span, Symbol, DUMMY_SP}; | |
| 15 | use rustc_span::{DUMMY_SP, Span, Symbol}; | |
| 16 | 16 | use tracing::{debug, instrument}; |
| 17 | 17 | |
| 18 | 18 | use crate::error; |
| 19 | 19 | use crate::middle::codegen_fn_attrs::CodegenFnAttrFlags; |
| 20 | use crate::ty::print::{shrunk_instance_name, FmtPrinter, Printer}; | |
| 20 | use crate::ty::print::{FmtPrinter, Printer, shrunk_instance_name}; | |
| 21 | 21 | use crate::ty::{ |
| 22 | 22 | self, EarlyBinder, GenericArgs, GenericArgsRef, Ty, TyCtxt, TypeFoldable, TypeSuperFoldable, |
| 23 | 23 | TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor, |
compiler/rustc_middle/src/ty/intrinsic.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use rustc_macros::{Decodable, Encodable, HashStable}; |
| 2 | use rustc_span::def_id::DefId; | |
| 3 | 2 | use rustc_span::Symbol; |
| 3 | use rustc_span::def_id::DefId; | |
| 4 | 4 | |
| 5 | 5 | use super::TyCtxt; |
| 6 | 6 |
compiler/rustc_middle/src/ty/layout.rs+8-9| ... | ... | @@ -7,13 +7,13 @@ use rustc_errors::{ |
| 7 | 7 | Diag, DiagArgValue, DiagCtxtHandle, Diagnostic, EmissionGuarantee, IntoDiagArg, Level, |
| 8 | 8 | }; |
| 9 | 9 | use rustc_hir as hir; |
| 10 | use rustc_hir::def_id::DefId; | |
| 11 | 10 | use rustc_hir::LangItem; |
| 11 | use rustc_hir::def_id::DefId; | |
| 12 | 12 | use rustc_index::IndexVec; |
| 13 | use rustc_macros::{extension, HashStable, TyDecodable, TyEncodable}; | |
| 13 | use rustc_macros::{HashStable, TyDecodable, TyEncodable, extension}; | |
| 14 | 14 | use rustc_session::config::OptLevel; |
| 15 | use rustc_span::symbol::{sym, Symbol}; | |
| 16 | use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP}; | |
| 15 | use rustc_span::symbol::{Symbol, sym}; | |
| 16 | use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span}; | |
| 17 | 17 | use rustc_target::abi::call::FnAbi; |
| 18 | 18 | use rustc_target::abi::*; |
| 19 | 19 | use rustc_target::spec::abi::Abi as SpecAbi; |
| ... | ... | @@ -1295,11 +1295,10 @@ pub trait FnAbiOf<'tcx>: FnAbiOfHelpers<'tcx> { |
| 1295 | 1295 | // However, we don't do this early in order to avoid calling |
| 1296 | 1296 | // `def_span` unconditionally (which may have a perf penalty). |
| 1297 | 1297 | let span = if !span.is_dummy() { span } else { tcx.def_span(instance.def_id()) }; |
| 1298 | self.handle_fn_abi_err( | |
| 1299 | *err, | |
| 1300 | span, | |
| 1301 | FnAbiRequest::OfInstance { instance, extra_args }, | |
| 1302 | ) | |
| 1298 | self.handle_fn_abi_err(*err, span, FnAbiRequest::OfInstance { | |
| 1299 | instance, | |
| 1300 | extra_args, | |
| 1301 | }) | |
| 1303 | 1302 | }), |
| 1304 | 1303 | ) |
| 1305 | 1304 | } |
compiler/rustc_middle/src/ty/list.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ use std::hash::{Hash, Hasher}; |
| 4 | 4 | use std::ops::Deref; |
| 5 | 5 | use std::{fmt, iter, mem, ptr, slice}; |
| 6 | 6 | |
| 7 | use rustc_data_structures::aligned::{align_of, Aligned}; | |
| 7 | use rustc_data_structures::aligned::{Aligned, align_of}; | |
| 8 | 8 | #[cfg(parallel_compiler)] |
| 9 | 9 | use rustc_data_structures::sync::DynSync; |
| 10 | 10 | use rustc_serialize::{Encodable, Encoder}; |
compiler/rustc_middle/src/ty/mod.rs+15-15| ... | ... | @@ -26,52 +26,55 @@ pub use generics::*; |
| 26 | 26 | pub use intrinsic::IntrinsicDef; |
| 27 | 27 | use rustc_ast::expand::StrippedCfgItem; |
| 28 | 28 | use rustc_ast::node_id::NodeMap; |
| 29 | pub use rustc_ast_ir::{try_visit, Movability, Mutability}; | |
| 29 | pub use rustc_ast_ir::{Movability, Mutability, try_visit}; | |
| 30 | 30 | use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet}; |
| 31 | 31 | use rustc_data_structures::intern::Interned; |
| 32 | 32 | use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; |
| 33 | 33 | use rustc_data_structures::steal::Steal; |
| 34 | 34 | use rustc_data_structures::tagged_ptr::CopyTaggedPtr; |
| 35 | 35 | use rustc_errors::{Diag, ErrorGuaranteed, StashKey}; |
| 36 | use rustc_hir::LangItem; | |
| 36 | 37 | use rustc_hir::def::{CtorKind, CtorOf, DefKind, DocLinkResMap, LifetimeRes, Res}; |
| 37 | 38 | use rustc_hir::def_id::{CrateNum, DefId, DefIdMap, LocalDefId, LocalDefIdMap}; |
| 38 | use rustc_hir::LangItem; | |
| 39 | 39 | use rustc_index::IndexVec; |
| 40 | 40 | use rustc_macros::{ |
| 41 | extension, Decodable, Encodable, HashStable, TyDecodable, TyEncodable, TypeFoldable, | |
| 42 | TypeVisitable, | |
| 41 | Decodable, Encodable, HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable, | |
| 42 | extension, | |
| 43 | 43 | }; |
| 44 | 44 | use rustc_query_system::ich::StableHashingContext; |
| 45 | 45 | use rustc_serialize::{Decodable, Encodable}; |
| 46 | 46 | use rustc_session::lint::LintBuffer; |
| 47 | 47 | pub use rustc_session::lint::RegisteredTools; |
| 48 | 48 | use rustc_span::hygiene::MacroKind; |
| 49 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 49 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 50 | 50 | use rustc_span::{ExpnId, ExpnKind, Span}; |
| 51 | 51 | use rustc_target::abi::{Align, FieldIdx, Integer, IntegerType, VariantIdx}; |
| 52 | 52 | pub use rustc_target::abi::{ReprFlags, ReprOptions}; |
| 53 | pub use rustc_type_ir::relate::VarianceDiagInfo; | |
| 54 | 53 | pub use rustc_type_ir::ConstKind::{ |
| 55 | 54 | Bound as BoundCt, Error as ErrorCt, Expr as ExprCt, Infer as InferCt, Param as ParamCt, |
| 56 | 55 | Placeholder as PlaceholderCt, Unevaluated, Value, |
| 57 | 56 | }; |
| 57 | pub use rustc_type_ir::relate::VarianceDiagInfo; | |
| 58 | 58 | pub use rustc_type_ir::*; |
| 59 | 59 | use tracing::{debug, instrument}; |
| 60 | 60 | pub use vtable::*; |
| 61 | 61 | use {rustc_ast as ast, rustc_attr as attr, rustc_hir as hir}; |
| 62 | 62 | |
| 63 | pub use self::AssocItemContainer::*; | |
| 64 | pub use self::BorrowKind::*; | |
| 65 | pub use self::IntVarValue::*; | |
| 63 | 66 | pub use self::closure::{ |
| 64 | analyze_coroutine_closure_captures, is_ancestor_or_same_capture, place_to_string_for_capture, | |
| 65 | BorrowKind, CaptureInfo, CapturedPlace, ClosureTypeInfo, MinCaptureInformationMap, | |
| 66 | MinCaptureList, RootVariableMinCaptureList, UpvarCapture, UpvarId, UpvarPath, | |
| 67 | CAPTURE_STRUCT_LOCAL, | |
| 67 | BorrowKind, CAPTURE_STRUCT_LOCAL, CaptureInfo, CapturedPlace, ClosureTypeInfo, | |
| 68 | MinCaptureInformationMap, MinCaptureList, RootVariableMinCaptureList, UpvarCapture, UpvarId, | |
| 69 | UpvarPath, analyze_coroutine_closure_captures, is_ancestor_or_same_capture, | |
| 70 | place_to_string_for_capture, | |
| 68 | 71 | }; |
| 69 | 72 | pub use self::consts::{ |
| 70 | 73 | Const, ConstInt, ConstKind, Expr, ExprKind, FeedConstTy, ScalarInt, UnevaluatedConst, ValTree, |
| 71 | 74 | }; |
| 72 | 75 | pub use self::context::{ |
| 73 | tls, CtxtInterners, CurrentGcx, DeducedParamAttrs, Feed, FreeRegionInfo, GlobalCtxt, Lift, | |
| 74 | TyCtxt, TyCtxtFeed, | |
| 76 | CtxtInterners, CurrentGcx, DeducedParamAttrs, Feed, FreeRegionInfo, GlobalCtxt, Lift, TyCtxt, | |
| 77 | TyCtxtFeed, tls, | |
| 75 | 78 | }; |
| 76 | 79 | pub use self::fold::{FallibleTypeFolder, TypeFoldable, TypeFolder, TypeSuperFoldable}; |
| 77 | 80 | pub use self::instance::{Instance, InstanceKind, ReifyReason, ShortInstance, UnusedGenericParams}; |
| ... | ... | @@ -104,9 +107,6 @@ pub use self::typeck_results::{ |
| 104 | 107 | TypeckResults, UserType, UserTypeAnnotationIndex, |
| 105 | 108 | }; |
| 106 | 109 | pub use self::visit::{TypeSuperVisitable, TypeVisitable, TypeVisitableExt, TypeVisitor}; |
| 107 | pub use self::AssocItemContainer::*; | |
| 108 | pub use self::BorrowKind::*; | |
| 109 | pub use self::IntVarValue::*; | |
| 110 | 110 | use crate::error::{OpaqueHiddenTypeMismatch, TypeMismatchReason}; |
| 111 | 111 | use crate::metadata::ModChild; |
| 112 | 112 | use crate::middle::privacy::EffectiveVisibilities; |
compiler/rustc_middle/src/ty/opaque_types.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use rustc_data_structures::fx::FxHashMap; |
| 2 | use rustc_span::def_id::DefId; | |
| 3 | 2 | use rustc_span::Span; |
| 3 | use rustc_span::def_id::DefId; | |
| 4 | 4 | use tracing::{debug, instrument, trace}; |
| 5 | 5 | |
| 6 | 6 | use crate::error::ConstNotUsedTraitAlias; |
compiler/rustc_middle/src/ty/predicate.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ use std::cmp::Ordering; |
| 3 | 3 | use rustc_data_structures::captures::Captures; |
| 4 | 4 | use rustc_data_structures::intern::Interned; |
| 5 | 5 | use rustc_hir::def_id::DefId; |
| 6 | use rustc_macros::{extension, HashStable}; | |
| 6 | use rustc_macros::{HashStable, extension}; | |
| 7 | 7 | use rustc_type_ir as ir; |
| 8 | 8 | use tracing::instrument; |
| 9 | 9 |
compiler/rustc_middle/src/ty/print/pretty.rs+7-7| ... | ... | @@ -3,23 +3,23 @@ use std::fmt::{self, Write as _}; |
| 3 | 3 | use std::iter; |
| 4 | 4 | use std::ops::{Deref, DerefMut}; |
| 5 | 5 | |
| 6 | use rustc_apfloat::ieee::{Double, Half, Quad, Single}; | |
| 7 | 6 | use rustc_apfloat::Float; |
| 7 | use rustc_apfloat::ieee::{Double, Half, Quad, Single}; | |
| 8 | 8 | use rustc_data_structures::fx::{FxHashMap, FxIndexMap}; |
| 9 | 9 | use rustc_data_structures::unord::UnordMap; |
| 10 | 10 | use rustc_hir as hir; |
| 11 | use rustc_hir::LangItem; | |
| 11 | 12 | use rustc_hir::def::{self, CtorKind, DefKind, Namespace}; |
| 12 | use rustc_hir::def_id::{DefIdMap, DefIdSet, ModDefId, CRATE_DEF_ID, LOCAL_CRATE}; | |
| 13 | use rustc_hir::def_id::{CRATE_DEF_ID, DefIdMap, DefIdSet, LOCAL_CRATE, ModDefId}; | |
| 13 | 14 | use rustc_hir::definitions::{DefKey, DefPathDataName}; |
| 14 | use rustc_hir::LangItem; | |
| 15 | use rustc_macros::{extension, Lift}; | |
| 16 | use rustc_session::cstore::{ExternCrate, ExternCrateSource}; | |
| 15 | use rustc_macros::{Lift, extension}; | |
| 17 | 16 | use rustc_session::Limit; |
| 18 | use rustc_span::symbol::{kw, Ident, Symbol}; | |
| 17 | use rustc_session::cstore::{ExternCrate, ExternCrateSource}; | |
| 19 | 18 | use rustc_span::FileNameDisplayPreference; |
| 19 | use rustc_span::symbol::{Ident, Symbol, kw}; | |
| 20 | 20 | use rustc_target::abi::Size; |
| 21 | 21 | use rustc_target::spec::abi::Abi; |
| 22 | use rustc_type_ir::{elaborate, Upcast as _}; | |
| 22 | use rustc_type_ir::{Upcast as _, elaborate}; | |
| 23 | 23 | use smallvec::SmallVec; |
| 24 | 24 | |
| 25 | 25 | // `pretty` is a separate module only for organization. |
compiler/rustc_middle/src/ty/region.rs+2-2| ... | ... | @@ -4,8 +4,8 @@ use rustc_data_structures::intern::Interned; |
| 4 | 4 | use rustc_errors::MultiSpan; |
| 5 | 5 | use rustc_hir::def_id::DefId; |
| 6 | 6 | use rustc_macros::{HashStable, TyDecodable, TyEncodable}; |
| 7 | use rustc_span::symbol::{kw, sym, Symbol}; | |
| 8 | use rustc_span::{ErrorGuaranteed, DUMMY_SP}; | |
| 7 | use rustc_span::symbol::{Symbol, kw, sym}; | |
| 8 | use rustc_span::{DUMMY_SP, ErrorGuaranteed}; | |
| 9 | 9 | use rustc_type_ir::RegionKind as IrRegionKind; |
| 10 | 10 | pub use rustc_type_ir::RegionVid; |
| 11 | 11 | use tracing::debug; |
compiler/rustc_middle/src/ty/structural_impls.rs+1-1| ... | ... | @@ -16,7 +16,7 @@ use super::print::PrettyPrinter; |
| 16 | 16 | use super::{GenericArg, GenericArgKind, Pattern, Region}; |
| 17 | 17 | use crate::mir::interpret; |
| 18 | 18 | use crate::ty::fold::{FallibleTypeFolder, TypeFoldable, TypeSuperFoldable}; |
| 19 | use crate::ty::print::{with_no_trimmed_paths, FmtPrinter, Printer}; | |
| 19 | use crate::ty::print::{FmtPrinter, Printer, with_no_trimmed_paths}; | |
| 20 | 20 | use crate::ty::visit::{TypeSuperVisitable, TypeVisitable, TypeVisitor}; |
| 21 | 21 | use crate::ty::{self, InferConst, Lift, Term, TermKind, Ty, TyCtxt}; |
| 22 | 22 |
compiler/rustc_middle/src/ty/sty.rs+6-6| ... | ... | @@ -11,15 +11,15 @@ use hir::def::{CtorKind, DefKind}; |
| 11 | 11 | use rustc_data_structures::captures::Captures; |
| 12 | 12 | use rustc_errors::{ErrorGuaranteed, MultiSpan}; |
| 13 | 13 | use rustc_hir as hir; |
| 14 | use rustc_hir::def_id::DefId; | |
| 15 | 14 | use rustc_hir::LangItem; |
| 16 | use rustc_macros::{extension, HashStable, TyDecodable, TyEncodable, TypeFoldable}; | |
| 17 | use rustc_span::symbol::{sym, Symbol}; | |
| 18 | use rustc_span::{Span, DUMMY_SP}; | |
| 19 | use rustc_target::abi::{FieldIdx, VariantIdx, FIRST_VARIANT}; | |
| 15 | use rustc_hir::def_id::DefId; | |
| 16 | use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, extension}; | |
| 17 | use rustc_span::symbol::{Symbol, sym}; | |
| 18 | use rustc_span::{DUMMY_SP, Span}; | |
| 19 | use rustc_target::abi::{FIRST_VARIANT, FieldIdx, VariantIdx}; | |
| 20 | 20 | use rustc_target::spec::abi; |
| 21 | use rustc_type_ir::visit::TypeVisitableExt; | |
| 22 | 21 | use rustc_type_ir::TyKind::*; |
| 22 | use rustc_type_ir::visit::TypeVisitableExt; | |
| 23 | 23 | use rustc_type_ir::{self as ir, BoundVar, CollectAndApply, DynKind}; |
| 24 | 24 | use ty::util::{AsyncDropGlueMorphology, IntTypeExt}; |
| 25 | 25 |
compiler/rustc_middle/src/ty/typeck_results.rs+2-2| ... | ... | @@ -23,8 +23,8 @@ use crate::hir::place::Place as HirPlace; |
| 23 | 23 | use crate::infer::canonical::Canonical; |
| 24 | 24 | use crate::traits::ObligationCause; |
| 25 | 25 | use crate::ty::{ |
| 26 | self, tls, BoundVar, CanonicalPolyFnSig, ClosureSizeProfileData, GenericArgKind, GenericArgs, | |
| 27 | GenericArgsRef, Ty, UserArgs, | |
| 26 | self, BoundVar, CanonicalPolyFnSig, ClosureSizeProfileData, GenericArgKind, GenericArgs, | |
| 27 | GenericArgsRef, Ty, UserArgs, tls, | |
| 28 | 28 | }; |
| 29 | 29 | |
| 30 | 30 | #[derive(TyEncodable, TyDecodable, Debug, HashStable)] |
compiler/rustc_middle/src/ty/util.rs+2-2| ... | ... | @@ -11,12 +11,12 @@ use rustc_hir as hir; |
| 11 | 11 | use rustc_hir::def::{CtorOf, DefKind, Res}; |
| 12 | 12 | use rustc_hir::def_id::{CrateNum, DefId, LocalDefId}; |
| 13 | 13 | use rustc_index::bit_set::GrowableBitSet; |
| 14 | use rustc_macros::{extension, HashStable, TyDecodable, TyEncodable}; | |
| 14 | use rustc_macros::{HashStable, TyDecodable, TyEncodable, extension}; | |
| 15 | 15 | use rustc_session::Limit; |
| 16 | 16 | use rustc_span::sym; |
| 17 | 17 | use rustc_target::abi::{Float, Integer, IntegerType, Size}; |
| 18 | 18 | use rustc_target::spec::abi::Abi; |
| 19 | use smallvec::{smallvec, SmallVec}; | |
| 19 | use smallvec::{SmallVec, smallvec}; | |
| 20 | 20 | use tracing::{debug, instrument, trace}; |
| 21 | 21 | |
| 22 | 22 | use crate::middle::codegen_fn_attrs::CodegenFnAttrFlags; |
compiler/rustc_middle/src/ty/vtable.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ use std::fmt; |
| 3 | 3 | use rustc_ast::Mutability; |
| 4 | 4 | use rustc_macros::HashStable; |
| 5 | 5 | |
| 6 | use crate::mir::interpret::{alloc_range, AllocId, Allocation, Pointer, Scalar, CTFE_ALLOC_SALT}; | |
| 6 | use crate::mir::interpret::{AllocId, Allocation, CTFE_ALLOC_SALT, Pointer, Scalar, alloc_range}; | |
| 7 | 7 | use crate::ty::{self, Instance, PolyTraitRef, Ty, TyCtxt}; |
| 8 | 8 | |
| 9 | 9 | #[derive(Clone, Copy, PartialEq, HashStable)] |
compiler/rustc_middle/src/ty/walk.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | //! WARNING: this does not keep track of the region depth. |
| 3 | 3 | |
| 4 | 4 | use rustc_data_structures::sso::SsoHashSet; |
| 5 | use smallvec::{smallvec, SmallVec}; | |
| 5 | use smallvec::{SmallVec, smallvec}; | |
| 6 | 6 | use tracing::debug; |
| 7 | 7 | |
| 8 | 8 | use crate::ty::{self, GenericArg, GenericArgKind, Ty}; |
compiler/rustc_middle/src/util/bug.rs+2-2| ... | ... | @@ -1,12 +1,12 @@ |
| 1 | 1 | // These functions are used by macro expansion for bug! and span_bug! |
| 2 | 2 | |
| 3 | 3 | use std::fmt; |
| 4 | use std::panic::{panic_any, Location}; | |
| 4 | use std::panic::{Location, panic_any}; | |
| 5 | 5 | |
| 6 | 6 | use rustc_errors::MultiSpan; |
| 7 | 7 | use rustc_span::Span; |
| 8 | 8 | |
| 9 | use crate::ty::{tls, TyCtxt}; | |
| 9 | use crate::ty::{TyCtxt, tls}; | |
| 10 | 10 | |
| 11 | 11 | #[cold] |
| 12 | 12 | #[inline(never)] |
compiler/rustc_middle/src/util/call_kind.rs+2-2| ... | ... | @@ -3,9 +3,9 @@ |
| 3 | 3 | //! context. |
| 4 | 4 | |
| 5 | 5 | use rustc_hir::def_id::DefId; |
| 6 | use rustc_hir::{lang_items, LangItem}; | |
| 6 | use rustc_hir::{LangItem, lang_items}; | |
| 7 | 7 | use rustc_span::symbol::Ident; |
| 8 | use rustc_span::{sym, DesugaringKind, Span}; | |
| 8 | use rustc_span::{DesugaringKind, Span, sym}; | |
| 9 | 9 | use tracing::debug; |
| 10 | 10 | |
| 11 | 11 | use crate::ty::{AssocItemContainer, GenericArgsRef, Instance, ParamEnv, Ty, TyCtxt}; |
compiler/rustc_middle/src/util/mod.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ pub mod call_kind; |
| 3 | 3 | pub mod common; |
| 4 | 4 | pub mod find_self_call; |
| 5 | 5 | |
| 6 | pub use call_kind::{call_kind, CallDesugaringKind, CallKind}; | |
| 6 | pub use call_kind::{CallDesugaringKind, CallKind, call_kind}; | |
| 7 | 7 | pub use find_self_call::find_self_call; |
| 8 | 8 | |
| 9 | 9 | #[derive(Default, Copy, Clone)] |
compiler/rustc_middle/src/values.rs+2-2| ... | ... | @@ -4,12 +4,12 @@ use std::ops::ControlFlow; |
| 4 | 4 | |
| 5 | 5 | use rustc_data_structures::fx::FxHashSet; |
| 6 | 6 | use rustc_errors::codes::*; |
| 7 | use rustc_errors::{pluralize, struct_span_code_err, Applicability, MultiSpan}; | |
| 7 | use rustc_errors::{Applicability, MultiSpan, pluralize, struct_span_code_err}; | |
| 8 | 8 | use rustc_hir as hir; |
| 9 | 9 | use rustc_hir::def::{DefKind, Res}; |
| 10 | 10 | use rustc_middle::ty::{self, Representability, Ty, TyCtxt}; |
| 11 | use rustc_query_system::query::{report_cycle, CycleError}; | |
| 12 | 11 | use rustc_query_system::Value; |
| 12 | use rustc_query_system::query::{CycleError, report_cycle}; | |
| 13 | 13 | use rustc_span::def_id::LocalDefId; |
| 14 | 14 | use rustc_span::{ErrorGuaranteed, Span}; |
| 15 | 15 |
compiler/rustc_mir_build/src/build/block.rs+1-1| ... | ... | @@ -5,8 +5,8 @@ use rustc_middle::{span_bug, ty}; |
| 5 | 5 | use rustc_span::Span; |
| 6 | 6 | use tracing::debug; |
| 7 | 7 | |
| 8 | use crate::build::matches::{DeclareLetBindings, EmitStorageLive, ScheduleDrops}; | |
| 9 | 8 | use crate::build::ForGuard::OutsideGuard; |
| 9 | use crate::build::matches::{DeclareLetBindings, EmitStorageLive, ScheduleDrops}; | |
| 10 | 10 | use crate::build::{BlockAnd, BlockAndExtension, BlockFrame, Builder}; |
| 11 | 11 | |
| 12 | 12 | impl<'a, 'tcx> Builder<'a, 'tcx> { |
compiler/rustc_mir_build/src/build/cfg.rs+4-4| ... | ... | @@ -40,10 +40,10 @@ impl<'tcx> CFG<'tcx> { |
| 40 | 40 | place: Place<'tcx>, |
| 41 | 41 | rvalue: Rvalue<'tcx>, |
| 42 | 42 | ) { |
| 43 | self.push( | |
| 44 | block, | |
| 45 | Statement { source_info, kind: StatementKind::Assign(Box::new((place, rvalue))) }, | |
| 46 | ); | |
| 43 | self.push(block, Statement { | |
| 44 | source_info, | |
| 45 | kind: StatementKind::Assign(Box::new((place, rvalue))), | |
| 46 | }); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | pub(crate) fn push_assign_constant( |
compiler/rustc_mir_build/src/build/custom/mod.rs+1-1| ... | ... | @@ -19,8 +19,8 @@ |
| 19 | 19 | |
| 20 | 20 | use rustc_ast::Attribute; |
| 21 | 21 | use rustc_data_structures::fx::FxHashMap; |
| 22 | use rustc_hir::def_id::DefId; | |
| 23 | 22 | use rustc_hir::HirId; |
| 23 | use rustc_hir::def_id::DefId; | |
| 24 | 24 | use rustc_index::{IndexSlice, IndexVec}; |
| 25 | 25 | use rustc_middle::mir::*; |
| 26 | 26 | use rustc_middle::span_bug; |
compiler/rustc_mir_build/src/build/custom/parse/instruction.rs+2-2| ... | ... | @@ -4,11 +4,11 @@ use rustc_middle::mir::*; |
| 4 | 4 | use rustc_middle::thir::*; |
| 5 | 5 | use rustc_middle::ty; |
| 6 | 6 | use rustc_middle::ty::cast::mir_cast_kind; |
| 7 | use rustc_span::source_map::Spanned; | |
| 8 | 7 | use rustc_span::Span; |
| 8 | use rustc_span::source_map::Spanned; | |
| 9 | 9 | use rustc_target::abi::{FieldIdx, VariantIdx}; |
| 10 | 10 | |
| 11 | use super::{parse_by_kind, PResult, ParseCtxt}; | |
| 11 | use super::{PResult, ParseCtxt, parse_by_kind}; | |
| 12 | 12 | use crate::build::custom::ParseError; |
| 13 | 13 | use crate::build::expr::as_constant::as_constant_inner; |
| 14 | 14 |
compiler/rustc_mir_build/src/build/expr/as_constant.rs+2-2| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | use rustc_ast as ast; |
| 4 | 4 | use rustc_hir::LangItem; |
| 5 | 5 | use rustc_middle::mir::interpret::{ |
| 6 | Allocation, LitToConstError, LitToConstInput, Scalar, CTFE_ALLOC_SALT, | |
| 6 | Allocation, CTFE_ALLOC_SALT, LitToConstError, LitToConstInput, Scalar, | |
| 7 | 7 | }; |
| 8 | 8 | use rustc_middle::mir::*; |
| 9 | 9 | use rustc_middle::thir::*; |
| ... | ... | @@ -14,7 +14,7 @@ use rustc_middle::{bug, mir, span_bug}; |
| 14 | 14 | use rustc_target::abi::Size; |
| 15 | 15 | use tracing::{instrument, trace}; |
| 16 | 16 | |
| 17 | use crate::build::{parse_float_into_constval, Builder}; | |
| 17 | use crate::build::{Builder, parse_float_into_constval}; | |
| 18 | 18 | |
| 19 | 19 | impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 20 | 20 | /// Compile `expr`, yielding a compile-time constant. Assumes that |
compiler/rustc_mir_build/src/build/expr/as_place.rs+22-28| ... | ... | @@ -12,11 +12,11 @@ use rustc_middle::thir::*; |
| 12 | 12 | use rustc_middle::ty::{self, AdtDef, CanonicalUserTypeAnnotation, Ty, Variance}; |
| 13 | 13 | use rustc_middle::{bug, span_bug}; |
| 14 | 14 | use rustc_span::Span; |
| 15 | use rustc_target::abi::{FieldIdx, VariantIdx, FIRST_VARIANT}; | |
| 15 | use rustc_target::abi::{FIRST_VARIANT, FieldIdx, VariantIdx}; | |
| 16 | 16 | use tracing::{debug, instrument, trace}; |
| 17 | 17 | |
| 18 | use crate::build::expr::category::Category; | |
| 19 | 18 | use crate::build::ForGuard::{OutsideGuard, RefWithinGuard}; |
| 19 | use crate::build::expr::category::Category; | |
| 20 | 20 | use crate::build::{BlockAnd, BlockAndExtension, Builder, Capture, CaptureMap}; |
| 21 | 21 | |
| 22 | 22 | /// The "outermost" place that holds this value. |
| ... | ... | @@ -483,19 +483,16 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 483 | 483 | }); |
| 484 | 484 | |
| 485 | 485 | let place = place_builder.to_place(this); |
| 486 | this.cfg.push( | |
| 487 | block, | |
| 488 | Statement { | |
| 489 | source_info, | |
| 490 | kind: StatementKind::AscribeUserType( | |
| 491 | Box::new(( | |
| 492 | place, | |
| 493 | UserTypeProjection { base: annotation_index, projs: vec![] }, | |
| 494 | )), | |
| 495 | Variance::Invariant, | |
| 496 | ), | |
| 497 | }, | |
| 498 | ); | |
| 486 | this.cfg.push(block, Statement { | |
| 487 | source_info, | |
| 488 | kind: StatementKind::AscribeUserType( | |
| 489 | Box::new((place, UserTypeProjection { | |
| 490 | base: annotation_index, | |
| 491 | projs: vec![], | |
| 492 | })), | |
| 493 | Variance::Invariant, | |
| 494 | ), | |
| 495 | }); | |
| 499 | 496 | } |
| 500 | 497 | block.and(place_builder) |
| 501 | 498 | } |
| ... | ... | @@ -511,19 +508,16 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 511 | 508 | user_ty: user_ty.clone(), |
| 512 | 509 | inferred_ty: expr.ty, |
| 513 | 510 | }); |
| 514 | this.cfg.push( | |
| 515 | block, | |
| 516 | Statement { | |
| 517 | source_info, | |
| 518 | kind: StatementKind::AscribeUserType( | |
| 519 | Box::new(( | |
| 520 | Place::from(temp), | |
| 521 | UserTypeProjection { base: annotation_index, projs: vec![] }, | |
| 522 | )), | |
| 523 | Variance::Invariant, | |
| 524 | ), | |
| 525 | }, | |
| 526 | ); | |
| 511 | this.cfg.push(block, Statement { | |
| 512 | source_info, | |
| 513 | kind: StatementKind::AscribeUserType( | |
| 514 | Box::new((Place::from(temp), UserTypeProjection { | |
| 515 | base: annotation_index, | |
| 516 | projs: vec![], | |
| 517 | })), | |
| 518 | Variance::Invariant, | |
| 519 | ), | |
| 520 | }); | |
| 527 | 521 | } |
| 528 | 522 | block.and(PlaceBuilder::from(temp)) |
| 529 | 523 | } |
compiler/rustc_mir_build/src/build/expr/as_rvalue.rs+31-42| ... | ... | @@ -7,12 +7,12 @@ use rustc_middle::middle::region; |
| 7 | 7 | use rustc_middle::mir::interpret::Scalar; |
| 8 | 8 | use rustc_middle::mir::*; |
| 9 | 9 | use rustc_middle::thir::*; |
| 10 | use rustc_middle::ty::cast::{mir_cast_kind, CastTy}; | |
| 10 | use rustc_middle::ty::cast::{CastTy, mir_cast_kind}; | |
| 11 | 11 | use rustc_middle::ty::layout::IntegerExt; |
| 12 | 12 | use rustc_middle::ty::util::IntTypeExt; |
| 13 | 13 | use rustc_middle::ty::{self, Ty, UpvarArgs}; |
| 14 | 14 | use rustc_span::source_map::Spanned; |
| 15 | use rustc_span::{Span, DUMMY_SP}; | |
| 15 | use rustc_span::{DUMMY_SP, Span}; | |
| 16 | 16 | use rustc_target::abi::{Abi, FieldIdx, Primitive}; |
| 17 | 17 | use tracing::debug; |
| 18 | 18 | |
| ... | ... | @@ -147,23 +147,19 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 147 | 147 | ); |
| 148 | 148 | let storage = this.temp(Ty::new_mut_ptr(tcx, tcx.types.u8), expr_span); |
| 149 | 149 | let success = this.cfg.start_new_block(); |
| 150 | this.cfg.terminate( | |
| 151 | block, | |
| 152 | source_info, | |
| 153 | TerminatorKind::Call { | |
| 154 | func: exchange_malloc, | |
| 155 | args: [ | |
| 156 | Spanned { node: Operand::Move(size), span: DUMMY_SP }, | |
| 157 | Spanned { node: Operand::Move(align), span: DUMMY_SP }, | |
| 158 | ] | |
| 159 | .into(), | |
| 160 | destination: storage, | |
| 161 | target: Some(success), | |
| 162 | unwind: UnwindAction::Continue, | |
| 163 | call_source: CallSource::Misc, | |
| 164 | fn_span: expr_span, | |
| 165 | }, | |
| 166 | ); | |
| 150 | this.cfg.terminate(block, source_info, TerminatorKind::Call { | |
| 151 | func: exchange_malloc, | |
| 152 | args: [Spanned { node: Operand::Move(size), span: DUMMY_SP }, Spanned { | |
| 153 | node: Operand::Move(align), | |
| 154 | span: DUMMY_SP, | |
| 155 | }] | |
| 156 | .into(), | |
| 157 | destination: storage, | |
| 158 | target: Some(success), | |
| 159 | unwind: UnwindAction::Continue, | |
| 160 | call_source: CallSource::Misc, | |
| 161 | fn_span: expr_span, | |
| 162 | }); | |
| 167 | 163 | this.diverge_from(block); |
| 168 | 164 | block = success; |
| 169 | 165 | |
| ... | ... | @@ -171,10 +167,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 171 | 167 | // and therefore is not considered during coroutine auto-trait |
| 172 | 168 | // determination. See the comment about `box` at `yield_in_scope`. |
| 173 | 169 | let result = this.local_decls.push(LocalDecl::new(expr.ty, expr_span)); |
| 174 | this.cfg.push( | |
| 175 | block, | |
| 176 | Statement { source_info, kind: StatementKind::StorageLive(result) }, | |
| 177 | ); | |
| 170 | this.cfg.push(block, Statement { | |
| 171 | source_info, | |
| 172 | kind: StatementKind::StorageLive(result), | |
| 173 | }); | |
| 178 | 174 | if let Some(scope) = scope { |
| 179 | 175 | // schedule a shallow free of that memory, lest we unwind: |
| 180 | 176 | this.schedule_drop_storage_and_value(expr_span, scope, result); |
| ... | ... | @@ -268,15 +264,12 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 268 | 264 | ); |
| 269 | 265 | merge_place |
| 270 | 266 | }; |
| 271 | this.cfg.push( | |
| 272 | block, | |
| 273 | Statement { | |
| 274 | source_info, | |
| 275 | kind: StatementKind::Intrinsic(Box::new( | |
| 276 | NonDivergingIntrinsic::Assume(Operand::Move(assert_place)), | |
| 277 | )), | |
| 278 | }, | |
| 279 | ); | |
| 267 | this.cfg.push(block, Statement { | |
| 268 | source_info, | |
| 269 | kind: StatementKind::Intrinsic(Box::new( | |
| 270 | NonDivergingIntrinsic::Assume(Operand::Move(assert_place)), | |
| 271 | )), | |
| 272 | }); | |
| 280 | 273 | } |
| 281 | 274 | |
| 282 | 275 | (op, ty) |
| ... | ... | @@ -721,16 +714,12 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 721 | 714 | ); |
| 722 | 715 | if let Operand::Move(to_drop) = value_operand { |
| 723 | 716 | let success = this.cfg.start_new_block(); |
| 724 | this.cfg.terminate( | |
| 725 | block, | |
| 726 | outer_source_info, | |
| 727 | TerminatorKind::Drop { | |
| 728 | place: to_drop, | |
| 729 | target: success, | |
| 730 | unwind: UnwindAction::Continue, | |
| 731 | replace: false, | |
| 732 | }, | |
| 733 | ); | |
| 717 | this.cfg.terminate(block, outer_source_info, TerminatorKind::Drop { | |
| 718 | place: to_drop, | |
| 719 | target: success, | |
| 720 | unwind: UnwindAction::Continue, | |
| 721 | replace: false, | |
| 722 | }); | |
| 734 | 723 | this.diverge_from(block); |
| 735 | 724 | block = success; |
| 736 | 725 | } |
compiler/rustc_mir_build/src/build/expr/into.rs+43-56| ... | ... | @@ -221,14 +221,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 221 | 221 | this.in_breakable_scope(Some(loop_block), destination, expr_span, move |this| { |
| 222 | 222 | // conduct the test, if necessary |
| 223 | 223 | let body_block = this.cfg.start_new_block(); |
| 224 | this.cfg.terminate( | |
| 225 | loop_block, | |
| 226 | source_info, | |
| 227 | TerminatorKind::FalseUnwind { | |
| 228 | real_target: body_block, | |
| 229 | unwind: UnwindAction::Continue, | |
| 230 | }, | |
| 231 | ); | |
| 224 | this.cfg.terminate(loop_block, source_info, TerminatorKind::FalseUnwind { | |
| 225 | real_target: body_block, | |
| 226 | unwind: UnwindAction::Continue, | |
| 227 | }); | |
| 232 | 228 | this.diverge_from(loop_block); |
| 233 | 229 | |
| 234 | 230 | // The “return” value of the loop body must always be a unit. We therefore |
| ... | ... | @@ -259,30 +255,26 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 259 | 255 | |
| 260 | 256 | debug!("expr_into_dest: fn_span={:?}", fn_span); |
| 261 | 257 | |
| 262 | this.cfg.terminate( | |
| 263 | block, | |
| 264 | source_info, | |
| 265 | TerminatorKind::Call { | |
| 266 | func: fun, | |
| 267 | args, | |
| 268 | unwind: UnwindAction::Continue, | |
| 269 | destination, | |
| 270 | // The presence or absence of a return edge affects control-flow sensitive | |
| 271 | // MIR checks and ultimately whether code is accepted or not. We can only | |
| 272 | // omit the return edge if a return type is visibly uninhabited to a module | |
| 273 | // that makes the call. | |
| 274 | target: expr | |
| 275 | .ty | |
| 276 | .is_inhabited_from(this.tcx, this.parent_module, this.param_env) | |
| 277 | .then_some(success), | |
| 278 | call_source: if from_hir_call { | |
| 279 | CallSource::Normal | |
| 280 | } else { | |
| 281 | CallSource::OverloadedOperator | |
| 282 | }, | |
| 283 | fn_span, | |
| 258 | this.cfg.terminate(block, source_info, TerminatorKind::Call { | |
| 259 | func: fun, | |
| 260 | args, | |
| 261 | unwind: UnwindAction::Continue, | |
| 262 | destination, | |
| 263 | // The presence or absence of a return edge affects control-flow sensitive | |
| 264 | // MIR checks and ultimately whether code is accepted or not. We can only | |
| 265 | // omit the return edge if a return type is visibly uninhabited to a module | |
| 266 | // that makes the call. | |
| 267 | target: expr | |
| 268 | .ty | |
| 269 | .is_inhabited_from(this.tcx, this.parent_module, this.param_env) | |
| 270 | .then_some(success), | |
| 271 | call_source: if from_hir_call { | |
| 272 | CallSource::Normal | |
| 273 | } else { | |
| 274 | CallSource::OverloadedOperator | |
| 284 | 275 | }, |
| 285 | ); | |
| 276 | fn_span, | |
| 277 | }); | |
| 286 | 278 | this.diverge_from(block); |
| 287 | 279 | success.unit() |
| 288 | 280 | } |
| ... | ... | @@ -469,11 +461,9 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 469 | 461 | let tmp = this.get_unit_temp(); |
| 470 | 462 | let target = |
| 471 | 463 | this.ast_block(tmp, target, block, source_info).into_block(); |
| 472 | this.cfg.terminate( | |
| 473 | target, | |
| 474 | source_info, | |
| 475 | TerminatorKind::Goto { target: destination_block }, | |
| 476 | ); | |
| 464 | this.cfg.terminate(target, source_info, TerminatorKind::Goto { | |
| 465 | target: destination_block, | |
| 466 | }); | |
| 477 | 467 | |
| 478 | 468 | mir::InlineAsmOperand::Label { target_index } |
| 479 | 469 | } |
| ... | ... | @@ -484,22 +474,18 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 484 | 474 | this.cfg.push_assign_unit(block, source_info, destination, this.tcx); |
| 485 | 475 | } |
| 486 | 476 | |
| 487 | this.cfg.terminate( | |
| 488 | block, | |
| 489 | source_info, | |
| 490 | TerminatorKind::InlineAsm { | |
| 491 | template, | |
| 492 | operands, | |
| 493 | options, | |
| 494 | line_spans, | |
| 495 | targets: targets.into_boxed_slice(), | |
| 496 | unwind: if options.contains(InlineAsmOptions::MAY_UNWIND) { | |
| 497 | UnwindAction::Continue | |
| 498 | } else { | |
| 499 | UnwindAction::Unreachable | |
| 500 | }, | |
| 477 | this.cfg.terminate(block, source_info, TerminatorKind::InlineAsm { | |
| 478 | template, | |
| 479 | operands, | |
| 480 | options, | |
| 481 | line_spans, | |
| 482 | targets: targets.into_boxed_slice(), | |
| 483 | unwind: if options.contains(InlineAsmOptions::MAY_UNWIND) { | |
| 484 | UnwindAction::Continue | |
| 485 | } else { | |
| 486 | UnwindAction::Unreachable | |
| 501 | 487 | }, |
| 502 | ); | |
| 488 | }); | |
| 503 | 489 | if options.contains(InlineAsmOptions::MAY_UNWIND) { |
| 504 | 490 | this.diverge_from(block); |
| 505 | 491 | } |
| ... | ... | @@ -562,11 +548,12 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 562 | 548 | ) |
| 563 | 549 | ); |
| 564 | 550 | let resume = this.cfg.start_new_block(); |
| 565 | this.cfg.terminate( | |
| 566 | block, | |
| 567 | source_info, | |
| 568 | TerminatorKind::Yield { value, resume, resume_arg: destination, drop: None }, | |
| 569 | ); | |
| 551 | this.cfg.terminate(block, source_info, TerminatorKind::Yield { | |
| 552 | value, | |
| 553 | resume, | |
| 554 | resume_arg: destination, | |
| 555 | drop: None, | |
| 556 | }); | |
| 570 | 557 | this.coroutine_drop_cleanup(block); |
| 571 | 558 | resume.unit() |
| 572 | 559 | } |
compiler/rustc_mir_build/src/build/expr/stmt.rs+5-5| ... | ... | @@ -123,11 +123,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 123 | 123 | |
| 124 | 124 | unpack!(block = this.break_for_tail_call(block, &args, source_info)); |
| 125 | 125 | |
| 126 | this.cfg.terminate( | |
| 127 | block, | |
| 128 | source_info, | |
| 129 | TerminatorKind::TailCall { func: fun, args, fn_span }, | |
| 130 | ); | |
| 126 | this.cfg.terminate(block, source_info, TerminatorKind::TailCall { | |
| 127 | func: fun, | |
| 128 | args, | |
| 129 | fn_span, | |
| 130 | }); | |
| 131 | 131 | |
| 132 | 132 | this.cfg.start_new_block().unit() |
| 133 | 133 | }) |
compiler/rustc_mir_build/src/build/matches/match_pair.rs+5-8| ... | ... | @@ -2,9 +2,9 @@ use rustc_middle::mir::*; |
| 2 | 2 | use rustc_middle::thir::{self, *}; |
| 3 | 3 | use rustc_middle::ty::{self, Ty, TypeVisitableExt}; |
| 4 | 4 | |
| 5 | use crate::build::Builder; | |
| 5 | 6 | use crate::build::expr::as_place::{PlaceBase, PlaceBuilder}; |
| 6 | 7 | use crate::build::matches::{FlatPat, MatchPairTree, TestCase}; |
| 7 | use crate::build::Builder; | |
| 8 | 8 | |
| 9 | 9 | impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 10 | 10 | /// Builds and returns [`MatchPairTree`] subtrees, one for each pattern in |
| ... | ... | @@ -162,13 +162,10 @@ impl<'pat, 'tcx> MatchPairTree<'pat, 'tcx> { |
| 162 | 162 | let ascription = place.map(|source| { |
| 163 | 163 | let span = pattern.span; |
| 164 | 164 | let parent_id = cx.tcx.typeck_root_def_id(cx.def_id.to_def_id()); |
| 165 | let args = ty::InlineConstArgs::new( | |
| 166 | cx.tcx, | |
| 167 | ty::InlineConstArgsParts { | |
| 168 | parent_args: ty::GenericArgs::identity_for_item(cx.tcx, parent_id), | |
| 169 | ty: cx.infcx.next_ty_var(span), | |
| 170 | }, | |
| 171 | ) | |
| 165 | let args = ty::InlineConstArgs::new(cx.tcx, ty::InlineConstArgsParts { | |
| 166 | parent_args: ty::GenericArgs::identity_for_item(cx.tcx, parent_id), | |
| 167 | ty: cx.infcx.next_ty_var(span), | |
| 168 | }) | |
| 172 | 169 | .args; |
| 173 | 170 | let user_ty = cx.infcx.canonicalize_user_type_annotation(ty::UserType::TypeOf( |
| 174 | 171 | def.to_def_id(), |
compiler/rustc_mir_build/src/build/matches/mod.rs+46-67| ... | ... | @@ -18,9 +18,9 @@ use rustc_span::{BytePos, Pos, Span}; |
| 18 | 18 | use rustc_target::abi::VariantIdx; |
| 19 | 19 | use tracing::{debug, instrument}; |
| 20 | 20 | |
| 21 | use crate::build::ForGuard::{self, OutsideGuard, RefWithinGuard}; | |
| 21 | 22 | use crate::build::expr::as_place::PlaceBuilder; |
| 22 | 23 | use crate::build::scope::DropKind; |
| 23 | use crate::build::ForGuard::{self, OutsideGuard, RefWithinGuard}; | |
| 24 | 24 | use crate::build::{ |
| 25 | 25 | BlockAnd, BlockAndExtension, Builder, GuardFrame, GuardFrameLocal, LocalsForNode, |
| 26 | 26 | }; |
| ... | ... | @@ -104,11 +104,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 104 | 104 | variable_source_info: SourceInfo, |
| 105 | 105 | declare_let_bindings: DeclareLetBindings, |
| 106 | 106 | ) -> BlockAnd<()> { |
| 107 | self.then_else_break_inner( | |
| 108 | block, | |
| 109 | expr_id, | |
| 110 | ThenElseArgs { temp_scope_override, variable_source_info, declare_let_bindings }, | |
| 111 | ) | |
| 107 | self.then_else_break_inner(block, expr_id, ThenElseArgs { | |
| 108 | temp_scope_override, | |
| 109 | variable_source_info, | |
| 110 | declare_let_bindings, | |
| 111 | }) | |
| 112 | 112 | } |
| 113 | 113 | |
| 114 | 114 | fn then_else_break_inner( |
| ... | ... | @@ -134,24 +134,16 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 134 | 134 | let local_scope = this.local_scope(); |
| 135 | 135 | let (lhs_success_block, failure_block) = |
| 136 | 136 | this.in_if_then_scope(local_scope, expr_span, |this| { |
| 137 | this.then_else_break_inner( | |
| 138 | block, | |
| 139 | lhs, | |
| 140 | ThenElseArgs { | |
| 141 | declare_let_bindings: DeclareLetBindings::LetNotPermitted, | |
| 142 | ..args | |
| 143 | }, | |
| 144 | ) | |
| 145 | }); | |
| 146 | let rhs_success_block = this | |
| 147 | .then_else_break_inner( | |
| 148 | failure_block, | |
| 149 | rhs, | |
| 150 | ThenElseArgs { | |
| 137 | this.then_else_break_inner(block, lhs, ThenElseArgs { | |
| 151 | 138 | declare_let_bindings: DeclareLetBindings::LetNotPermitted, |
| 152 | 139 | ..args |
| 153 | }, | |
| 154 | ) | |
| 140 | }) | |
| 141 | }); | |
| 142 | let rhs_success_block = this | |
| 143 | .then_else_break_inner(failure_block, rhs, ThenElseArgs { | |
| 144 | declare_let_bindings: DeclareLetBindings::LetNotPermitted, | |
| 145 | ..args | |
| 146 | }) | |
| 155 | 147 | .into_block(); |
| 156 | 148 | |
| 157 | 149 | // Make the LHS and RHS success arms converge to a common block. |
| ... | ... | @@ -178,14 +170,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 178 | 170 | if this.tcx.sess.instrument_coverage() { |
| 179 | 171 | this.cfg.push_coverage_span_marker(block, this.source_info(expr_span)); |
| 180 | 172 | } |
| 181 | this.then_else_break_inner( | |
| 182 | block, | |
| 183 | arg, | |
| 184 | ThenElseArgs { | |
| 185 | declare_let_bindings: DeclareLetBindings::LetNotPermitted, | |
| 186 | ..args | |
| 187 | }, | |
| 188 | ) | |
| 173 | this.then_else_break_inner(block, arg, ThenElseArgs { | |
| 174 | declare_let_bindings: DeclareLetBindings::LetNotPermitted, | |
| 175 | ..args | |
| 176 | }) | |
| 189 | 177 | }); |
| 190 | 178 | this.break_for_else(success_block, args.variable_source_info); |
| 191 | 179 | failure_block.unit() |
| ... | ... | @@ -638,30 +626,27 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 638 | 626 | let ty_source_info = self.source_info(annotation.span); |
| 639 | 627 | |
| 640 | 628 | let base = self.canonical_user_type_annotations.push(annotation.clone()); |
| 641 | self.cfg.push( | |
| 642 | block, | |
| 643 | Statement { | |
| 644 | source_info: ty_source_info, | |
| 645 | kind: StatementKind::AscribeUserType( | |
| 646 | Box::new((place, UserTypeProjection { base, projs: Vec::new() })), | |
| 647 | // We always use invariant as the variance here. This is because the | |
| 648 | // variance field from the ascription refers to the variance to use | |
| 649 | // when applying the type to the value being matched, but this | |
| 650 | // ascription applies rather to the type of the binding. e.g., in this | |
| 651 | // example: | |
| 652 | // | |
| 653 | // ``` | |
| 654 | // let x: T = <expr> | |
| 655 | // ``` | |
| 656 | // | |
| 657 | // We are creating an ascription that defines the type of `x` to be | |
| 658 | // exactly `T` (i.e., with invariance). The variance field, in | |
| 659 | // contrast, is intended to be used to relate `T` to the type of | |
| 660 | // `<expr>`. | |
| 661 | ty::Invariant, | |
| 662 | ), | |
| 663 | }, | |
| 664 | ); | |
| 629 | self.cfg.push(block, Statement { | |
| 630 | source_info: ty_source_info, | |
| 631 | kind: StatementKind::AscribeUserType( | |
| 632 | Box::new((place, UserTypeProjection { base, projs: Vec::new() })), | |
| 633 | // We always use invariant as the variance here. This is because the | |
| 634 | // variance field from the ascription refers to the variance to use | |
| 635 | // when applying the type to the value being matched, but this | |
| 636 | // ascription applies rather to the type of the binding. e.g., in this | |
| 637 | // example: | |
| 638 | // | |
| 639 | // ``` | |
| 640 | // let x: T = <expr> | |
| 641 | // ``` | |
| 642 | // | |
| 643 | // We are creating an ascription that defines the type of `x` to be | |
| 644 | // exactly `T` (i.e., with invariance). The variance field, in | |
| 645 | // contrast, is intended to be used to relate `T` to the type of | |
| 646 | // `<expr>`. | |
| 647 | ty::Invariant, | |
| 648 | ), | |
| 649 | }); | |
| 665 | 650 | |
| 666 | 651 | self.schedule_drop_for_binding(var, irrefutable_pat.span, OutsideGuard); |
| 667 | 652 | block.unit() |
| ... | ... | @@ -2559,19 +2544,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 2559 | 2544 | let source_info = self.source_info(ascription.annotation.span); |
| 2560 | 2545 | |
| 2561 | 2546 | let base = self.canonical_user_type_annotations.push(ascription.annotation); |
| 2562 | self.cfg.push( | |
| 2563 | block, | |
| 2564 | Statement { | |
| 2565 | source_info, | |
| 2566 | kind: StatementKind::AscribeUserType( | |
| 2567 | Box::new(( | |
| 2568 | ascription.source, | |
| 2569 | UserTypeProjection { base, projs: Vec::new() }, | |
| 2570 | )), | |
| 2571 | ascription.variance, | |
| 2572 | ), | |
| 2573 | }, | |
| 2574 | ); | |
| 2547 | self.cfg.push(block, Statement { | |
| 2548 | source_info, | |
| 2549 | kind: StatementKind::AscribeUserType( | |
| 2550 | Box::new((ascription.source, UserTypeProjection { base, projs: Vec::new() })), | |
| 2551 | ascription.variance, | |
| 2552 | ), | |
| 2553 | }); | |
| 2575 | 2554 | } |
| 2576 | 2555 | } |
| 2577 | 2556 |
compiler/rustc_mir_build/src/build/matches/simplify.rs+1-1| ... | ... | @@ -16,8 +16,8 @@ use std::mem; |
| 16 | 16 | |
| 17 | 17 | use tracing::{debug, instrument}; |
| 18 | 18 | |
| 19 | use crate::build::matches::{MatchPairTree, PatternExtraData, TestCase}; | |
| 20 | 19 | use crate::build::Builder; |
| 20 | use crate::build::matches::{MatchPairTree, PatternExtraData, TestCase}; | |
| 21 | 21 | |
| 22 | 22 | impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 23 | 23 | /// Simplify a list of match pairs so they all require a test. Stores relevant bindings and |
compiler/rustc_mir_build/src/build/matches/test.rs+35-47| ... | ... | @@ -16,12 +16,12 @@ use rustc_middle::ty::{self, GenericArg, Ty, TyCtxt}; |
| 16 | 16 | use rustc_middle::{bug, span_bug}; |
| 17 | 17 | use rustc_span::def_id::DefId; |
| 18 | 18 | use rustc_span::source_map::Spanned; |
| 19 | use rustc_span::symbol::{sym, Symbol}; | |
| 20 | use rustc_span::{Span, DUMMY_SP}; | |
| 19 | use rustc_span::symbol::{Symbol, sym}; | |
| 20 | use rustc_span::{DUMMY_SP, Span}; | |
| 21 | 21 | use tracing::{debug, instrument}; |
| 22 | 22 | |
| 23 | use crate::build::matches::{Candidate, MatchPairTree, Test, TestBranch, TestCase, TestKind}; | |
| 24 | 23 | use crate::build::Builder; |
| 24 | use crate::build::matches::{Candidate, MatchPairTree, Test, TestBranch, TestCase, TestKind}; | |
| 25 | 25 | |
| 26 | 26 | impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 27 | 27 | /// Identifies what test is needed to decide if `match_pair` is applicable. |
| ... | ... | @@ -322,23 +322,15 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 322 | 322 | ); |
| 323 | 323 | // `let temp = <Ty as Deref>::deref(ref_src);` |
| 324 | 324 | // or `let temp = <Ty as DerefMut>::deref_mut(ref_src);` |
| 325 | self.cfg.terminate( | |
| 326 | block, | |
| 327 | source_info, | |
| 328 | TerminatorKind::Call { | |
| 329 | func: Operand::Constant(Box::new(ConstOperand { | |
| 330 | span, | |
| 331 | user_ty: None, | |
| 332 | const_: method, | |
| 333 | })), | |
| 334 | args: [Spanned { node: Operand::Move(ref_src), span }].into(), | |
| 335 | destination: temp, | |
| 336 | target: Some(target_block), | |
| 337 | unwind: UnwindAction::Continue, | |
| 338 | call_source: CallSource::Misc, | |
| 339 | fn_span: source_info.span, | |
| 340 | }, | |
| 341 | ); | |
| 325 | self.cfg.terminate(block, source_info, TerminatorKind::Call { | |
| 326 | func: Operand::Constant(Box::new(ConstOperand { span, user_ty: None, const_: method })), | |
| 327 | args: [Spanned { node: Operand::Move(ref_src), span }].into(), | |
| 328 | destination: temp, | |
| 329 | target: Some(target_block), | |
| 330 | unwind: UnwindAction::Continue, | |
| 331 | call_source: CallSource::Misc, | |
| 332 | fn_span: source_info.span, | |
| 333 | }); | |
| 342 | 334 | } |
| 343 | 335 | |
| 344 | 336 | /// Compare using the provided built-in comparison operator |
| ... | ... | @@ -466,33 +458,29 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 466 | 458 | let bool_ty = self.tcx.types.bool; |
| 467 | 459 | let eq_result = self.temp(bool_ty, source_info.span); |
| 468 | 460 | let eq_block = self.cfg.start_new_block(); |
| 469 | self.cfg.terminate( | |
| 470 | block, | |
| 471 | source_info, | |
| 472 | TerminatorKind::Call { | |
| 473 | func: Operand::Constant(Box::new(ConstOperand { | |
| 474 | span: source_info.span, | |
| 475 | ||
| 476 | // FIXME(#54571): This constant comes from user input (a | |
| 477 | // constant in a pattern). Are there forms where users can add | |
| 478 | // type annotations here? For example, an associated constant? | |
| 479 | // Need to experiment. | |
| 480 | user_ty: None, | |
| 481 | ||
| 482 | const_: method, | |
| 483 | })), | |
| 484 | args: [ | |
| 485 | Spanned { node: Operand::Copy(val), span: DUMMY_SP }, | |
| 486 | Spanned { node: expect, span: DUMMY_SP }, | |
| 487 | ] | |
| 488 | .into(), | |
| 489 | destination: eq_result, | |
| 490 | target: Some(eq_block), | |
| 491 | unwind: UnwindAction::Continue, | |
| 492 | call_source: CallSource::MatchCmp, | |
| 493 | fn_span: source_info.span, | |
| 494 | }, | |
| 495 | ); | |
| 461 | self.cfg.terminate(block, source_info, TerminatorKind::Call { | |
| 462 | func: Operand::Constant(Box::new(ConstOperand { | |
| 463 | span: source_info.span, | |
| 464 | ||
| 465 | // FIXME(#54571): This constant comes from user input (a | |
| 466 | // constant in a pattern). Are there forms where users can add | |
| 467 | // type annotations here? For example, an associated constant? | |
| 468 | // Need to experiment. | |
| 469 | user_ty: None, | |
| 470 | ||
| 471 | const_: method, | |
| 472 | })), | |
| 473 | args: [Spanned { node: Operand::Copy(val), span: DUMMY_SP }, Spanned { | |
| 474 | node: expect, | |
| 475 | span: DUMMY_SP, | |
| 476 | }] | |
| 477 | .into(), | |
| 478 | destination: eq_result, | |
| 479 | target: Some(eq_block), | |
| 480 | unwind: UnwindAction::Continue, | |
| 481 | call_source: CallSource::MatchCmp, | |
| 482 | fn_span: source_info.span, | |
| 483 | }); | |
| 496 | 484 | self.diverge_from(block); |
| 497 | 485 | |
| 498 | 486 | // check the result |
compiler/rustc_mir_build/src/build/matches/util.rs+5-6| ... | ... | @@ -4,9 +4,9 @@ use rustc_middle::ty::Ty; |
| 4 | 4 | use rustc_span::Span; |
| 5 | 5 | use tracing::debug; |
| 6 | 6 | |
| 7 | use crate::build::Builder; | |
| 7 | 8 | use crate::build::expr::as_place::PlaceBase; |
| 8 | 9 | use crate::build::matches::{Binding, Candidate, FlatPat, MatchPairTree, TestCase}; |
| 9 | use crate::build::Builder; | |
| 10 | 10 | |
| 11 | 11 | impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 12 | 12 | /// Creates a false edge to `imaginary_target` and a real edge to |
| ... | ... | @@ -20,11 +20,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 20 | 20 | source_info: SourceInfo, |
| 21 | 21 | ) { |
| 22 | 22 | if imaginary_target != real_target { |
| 23 | self.cfg.terminate( | |
| 24 | from_block, | |
| 25 | source_info, | |
| 26 | TerminatorKind::FalseEdge { real_target, imaginary_target }, | |
| 27 | ); | |
| 23 | self.cfg.terminate(from_block, source_info, TerminatorKind::FalseEdge { | |
| 24 | real_target, | |
| 25 | imaginary_target, | |
| 26 | }); | |
| 28 | 27 | } else { |
| 29 | 28 | self.cfg.goto(from_block, source_info, real_target) |
| 30 | 29 | } |
compiler/rustc_mir_build/src/build/misc.rs+5-10| ... | ... | @@ -45,16 +45,11 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 45 | 45 | ) -> Place<'tcx> { |
| 46 | 46 | let usize_ty = self.tcx.types.usize; |
| 47 | 47 | let temp = self.temp(usize_ty, source_info.span); |
| 48 | self.cfg.push_assign_constant( | |
| 49 | block, | |
| 50 | source_info, | |
| 51 | temp, | |
| 52 | ConstOperand { | |
| 53 | span: source_info.span, | |
| 54 | user_ty: None, | |
| 55 | const_: Const::from_usize(self.tcx, value), | |
| 56 | }, | |
| 57 | ); | |
| 48 | self.cfg.push_assign_constant(block, source_info, temp, ConstOperand { | |
| 49 | span: source_info.span, | |
| 50 | user_ty: None, | |
| 51 | const_: Const::from_usize(self.tcx, value), | |
| 52 | }); | |
| 58 | 53 | temp |
| 59 | 54 | } |
| 60 | 55 |
compiler/rustc_mir_build/src/build/mod.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use itertools::Itertools; |
| 2 | use rustc_apfloat::ieee::{Double, Half, Quad, Single}; | |
| 3 | 2 | use rustc_apfloat::Float; |
| 3 | use rustc_apfloat::ieee::{Double, Half, Quad, Single}; | |
| 4 | 4 | use rustc_ast::attr; |
| 5 | 5 | use rustc_data_structures::fx::FxHashMap; |
| 6 | 6 | use rustc_data_structures::sorted_map::SortedIndexMultiMap; |
compiler/rustc_mir_build/src/build/scope.rs+36-56| ... | ... | @@ -92,7 +92,7 @@ use rustc_middle::thir::{ExprId, LintLevel}; |
| 92 | 92 | use rustc_middle::{bug, span_bug}; |
| 93 | 93 | use rustc_session::lint::Level; |
| 94 | 94 | use rustc_span::source_map::Spanned; |
| 95 | use rustc_span::{Span, DUMMY_SP}; | |
| 95 | use rustc_span::{DUMMY_SP, Span}; | |
| 96 | 96 | use tracing::{debug, instrument}; |
| 97 | 97 | |
| 98 | 98 | use crate::build::{BlockAnd, BlockAndExtension, BlockFrame, Builder, CFG}; |
| ... | ... | @@ -510,16 +510,12 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 510 | 510 | (Some(normal_block), Some(exit_block)) => { |
| 511 | 511 | let target = self.cfg.start_new_block(); |
| 512 | 512 | let source_info = self.source_info(span); |
| 513 | self.cfg.terminate( | |
| 514 | normal_block.into_block(), | |
| 515 | source_info, | |
| 516 | TerminatorKind::Goto { target }, | |
| 517 | ); | |
| 518 | self.cfg.terminate( | |
| 519 | exit_block.into_block(), | |
| 520 | source_info, | |
| 521 | TerminatorKind::Goto { target }, | |
| 522 | ); | |
| 513 | self.cfg.terminate(normal_block.into_block(), source_info, TerminatorKind::Goto { | |
| 514 | target, | |
| 515 | }); | |
| 516 | self.cfg.terminate(exit_block.into_block(), source_info, TerminatorKind::Goto { | |
| 517 | target, | |
| 518 | }); | |
| 523 | 519 | target.unit() |
| 524 | 520 | } |
| 525 | 521 | } |
| ... | ... | @@ -806,25 +802,21 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 806 | 802 | unwind_drops.add_entry_point(block, unwind_entry_point); |
| 807 | 803 | |
| 808 | 804 | let next = self.cfg.start_new_block(); |
| 809 | self.cfg.terminate( | |
| 810 | block, | |
| 811 | source_info, | |
| 812 | TerminatorKind::Drop { | |
| 813 | place: local.into(), | |
| 814 | target: next, | |
| 815 | unwind: UnwindAction::Continue, | |
| 816 | replace: false, | |
| 817 | }, | |
| 818 | ); | |
| 805 | self.cfg.terminate(block, source_info, TerminatorKind::Drop { | |
| 806 | place: local.into(), | |
| 807 | target: next, | |
| 808 | unwind: UnwindAction::Continue, | |
| 809 | replace: false, | |
| 810 | }); | |
| 819 | 811 | block = next; |
| 820 | 812 | } |
| 821 | 813 | DropKind::Storage => { |
| 822 | 814 | // Only temps and vars need their storage dead. |
| 823 | 815 | assert!(local.index() > self.arg_count); |
| 824 | self.cfg.push( | |
| 825 | block, | |
| 826 | Statement { source_info, kind: StatementKind::StorageDead(local) }, | |
| 827 | ); | |
| 816 | self.cfg.push(block, Statement { | |
| 817 | source_info, | |
| 818 | kind: StatementKind::StorageDead(local), | |
| 819 | }); | |
| 828 | 820 | } |
| 829 | 821 | } |
| 830 | 822 | } |
| ... | ... | @@ -1283,16 +1275,12 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 1283 | 1275 | let assign_unwind = self.cfg.start_new_cleanup_block(); |
| 1284 | 1276 | self.cfg.push_assign(assign_unwind, source_info, place, value.clone()); |
| 1285 | 1277 | |
| 1286 | self.cfg.terminate( | |
| 1287 | block, | |
| 1288 | source_info, | |
| 1289 | TerminatorKind::Drop { | |
| 1290 | place, | |
| 1291 | target: assign, | |
| 1292 | unwind: UnwindAction::Cleanup(assign_unwind), | |
| 1293 | replace: true, | |
| 1294 | }, | |
| 1295 | ); | |
| 1278 | self.cfg.terminate(block, source_info, TerminatorKind::Drop { | |
| 1279 | place, | |
| 1280 | target: assign, | |
| 1281 | unwind: UnwindAction::Cleanup(assign_unwind), | |
| 1282 | replace: true, | |
| 1283 | }); | |
| 1296 | 1284 | self.diverge_from(block); |
| 1297 | 1285 | |
| 1298 | 1286 | assign.unit() |
| ... | ... | @@ -1312,17 +1300,13 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { |
| 1312 | 1300 | let source_info = self.source_info(span); |
| 1313 | 1301 | let success_block = self.cfg.start_new_block(); |
| 1314 | 1302 | |
| 1315 | self.cfg.terminate( | |
| 1316 | block, | |
| 1317 | source_info, | |
| 1318 | TerminatorKind::Assert { | |
| 1319 | cond, | |
| 1320 | expected, | |
| 1321 | msg: Box::new(msg), | |
| 1322 | target: success_block, | |
| 1323 | unwind: UnwindAction::Continue, | |
| 1324 | }, | |
| 1325 | ); | |
| 1303 | self.cfg.terminate(block, source_info, TerminatorKind::Assert { | |
| 1304 | cond, | |
| 1305 | expected, | |
| 1306 | msg: Box::new(msg), | |
| 1307 | target: success_block, | |
| 1308 | unwind: UnwindAction::Continue, | |
| 1309 | }); | |
| 1326 | 1310 | self.diverge_from(block); |
| 1327 | 1311 | |
| 1328 | 1312 | success_block |
| ... | ... | @@ -1397,16 +1381,12 @@ fn build_scope_drops<'tcx>( |
| 1397 | 1381 | unwind_drops.add_entry_point(block, unwind_to); |
| 1398 | 1382 | |
| 1399 | 1383 | let next = cfg.start_new_block(); |
| 1400 | cfg.terminate( | |
| 1401 | block, | |
| 1402 | source_info, | |
| 1403 | TerminatorKind::Drop { | |
| 1404 | place: local.into(), | |
| 1405 | target: next, | |
| 1406 | unwind: UnwindAction::Continue, | |
| 1407 | replace: false, | |
| 1408 | }, | |
| 1409 | ); | |
| 1384 | cfg.terminate(block, source_info, TerminatorKind::Drop { | |
| 1385 | place: local.into(), | |
| 1386 | target: next, | |
| 1387 | unwind: UnwindAction::Continue, | |
| 1388 | replace: false, | |
| 1389 | }); | |
| 1410 | 1390 | block = next; |
| 1411 | 1391 | } |
| 1412 | 1392 | DropKind::Storage => { |
compiler/rustc_mir_build/src/check_unsafety.rs+11-12| ... | ... | @@ -12,11 +12,11 @@ use rustc_middle::thir::visit::Visitor; |
| 12 | 12 | use rustc_middle::thir::*; |
| 13 | 13 | use rustc_middle::ty::print::with_no_trimmed_paths; |
| 14 | 14 | use rustc_middle::ty::{self, ParamEnv, Ty, TyCtxt}; |
| 15 | use rustc_session::lint::builtin::{DEPRECATED_SAFE_2024, UNSAFE_OP_IN_UNSAFE_FN, UNUSED_UNSAFE}; | |
| 16 | 15 | use rustc_session::lint::Level; |
| 16 | use rustc_session::lint::builtin::{DEPRECATED_SAFE_2024, UNSAFE_OP_IN_UNSAFE_FN, UNUSED_UNSAFE}; | |
| 17 | 17 | use rustc_span::def_id::{DefId, LocalDefId}; |
| 18 | 18 | use rustc_span::symbol::Symbol; |
| 19 | use rustc_span::{sym, Span}; | |
| 19 | use rustc_span::{Span, sym}; | |
| 20 | 20 | |
| 21 | 21 | use crate::build::ExprCategory; |
| 22 | 22 | use crate::errors::*; |
| ... | ... | @@ -499,10 +499,11 @@ impl<'a, 'tcx> Visitor<'a, 'tcx> for UnsafetyVisitor<'a, 'tcx> { |
| 499 | 499 | .copied() |
| 500 | 500 | .filter(|feature| missing.contains(feature)) |
| 501 | 501 | .collect(); |
| 502 | self.requires_unsafe( | |
| 503 | expr.span, | |
| 504 | CallToFunctionWith { function: func_did, missing, build_enabled }, | |
| 505 | ); | |
| 502 | self.requires_unsafe(expr.span, CallToFunctionWith { | |
| 503 | function: func_did, | |
| 504 | missing, | |
| 505 | build_enabled, | |
| 506 | }); | |
| 506 | 507 | } |
| 507 | 508 | } |
| 508 | 509 | } |
| ... | ... | @@ -1052,11 +1053,9 @@ pub(crate) fn check_unsafety(tcx: TyCtxt<'_>, def: LocalDefId) { |
| 1052 | 1053 | warnings.sort_by_key(|w| w.block_span); |
| 1053 | 1054 | for UnusedUnsafeWarning { hir_id, block_span, enclosing_unsafe } in warnings { |
| 1054 | 1055 | let block_span = tcx.sess.source_map().guess_head_span(block_span); |
| 1055 | tcx.emit_node_span_lint( | |
| 1056 | UNUSED_UNSAFE, | |
| 1057 | hir_id, | |
| 1058 | block_span, | |
| 1059 | UnusedUnsafe { span: block_span, enclosing: enclosing_unsafe }, | |
| 1060 | ); | |
| 1056 | tcx.emit_node_span_lint(UNUSED_UNSAFE, hir_id, block_span, UnusedUnsafe { | |
| 1057 | span: block_span, | |
| 1058 | enclosing: enclosing_unsafe, | |
| 1059 | }); | |
| 1061 | 1060 | } |
| 1062 | 1061 | } |
compiler/rustc_mir_build/src/errors.rs+1-1| ... | ... | @@ -7,8 +7,8 @@ use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic}; |
| 7 | 7 | use rustc_middle::ty::{self, Ty}; |
| 8 | 8 | use rustc_pattern_analysis::errors::Uncovered; |
| 9 | 9 | use rustc_pattern_analysis::rustc::RustcPatCtxt; |
| 10 | use rustc_span::symbol::Symbol; | |
| 11 | 10 | use rustc_span::Span; |
| 11 | use rustc_span::symbol::Symbol; | |
| 12 | 12 | |
| 13 | 13 | use crate::fluent_generated as fluent; |
| 14 | 14 |
compiler/rustc_mir_build/src/lints.rs+4-6| ... | ... | @@ -54,12 +54,10 @@ fn check_recursion<'tcx>( |
| 54 | 54 | |
| 55 | 55 | let sp = tcx.def_span(def_id); |
| 56 | 56 | let hir_id = tcx.local_def_id_to_hir_id(def_id); |
| 57 | tcx.emit_node_span_lint( | |
| 58 | UNCONDITIONAL_RECURSION, | |
| 59 | hir_id, | |
| 60 | sp, | |
| 61 | UnconditionalRecursion { span: sp, call_sites: vis.reachable_recursive_calls }, | |
| 62 | ); | |
| 57 | tcx.emit_node_span_lint(UNCONDITIONAL_RECURSION, hir_id, sp, UnconditionalRecursion { | |
| 58 | span: sp, | |
| 59 | call_sites: vis.reachable_recursive_calls, | |
| 60 | }); | |
| 63 | 61 | } |
| 64 | 62 | } |
| 65 | 63 |
compiler/rustc_mir_build/src/thir/cx/expr.rs+3-3| ... | ... | @@ -17,13 +17,13 @@ use rustc_middle::ty::{ |
| 17 | 17 | UserType, |
| 18 | 18 | }; |
| 19 | 19 | use rustc_middle::{bug, span_bug}; |
| 20 | use rustc_span::{sym, Span}; | |
| 21 | use rustc_target::abi::{FieldIdx, FIRST_VARIANT}; | |
| 20 | use rustc_span::{Span, sym}; | |
| 21 | use rustc_target::abi::{FIRST_VARIANT, FieldIdx}; | |
| 22 | 22 | use tracing::{debug, info, instrument, trace}; |
| 23 | 23 | |
| 24 | 24 | use crate::errors; |
| 25 | use crate::thir::cx::region::Scope; | |
| 26 | 25 | use crate::thir::cx::Cx; |
| 26 | use crate::thir::cx::region::Scope; | |
| 27 | 27 | use crate::thir::util::UserAnnotatedTyHelpers; |
| 28 | 28 | |
| 29 | 29 | impl<'tcx> Cx<'tcx> { |
compiler/rustc_mir_build/src/thir/cx/mod.rs+6-4| ... | ... | @@ -5,10 +5,10 @@ |
| 5 | 5 | use rustc_data_structures::steal::Steal; |
| 6 | 6 | use rustc_errors::ErrorGuaranteed; |
| 7 | 7 | use rustc_hir as hir; |
| 8 | use rustc_hir::HirId; | |
| 8 | 9 | use rustc_hir::def::DefKind; |
| 9 | 10 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| 10 | 11 | use rustc_hir::lang_items::LangItem; |
| 11 | use rustc_hir::HirId; | |
| 12 | 12 | use rustc_middle::bug; |
| 13 | 13 | use rustc_middle::middle::region; |
| 14 | 14 | use rustc_middle::thir::*; |
| ... | ... | @@ -182,9 +182,11 @@ impl<'tcx> Cx<'tcx> { |
| 182 | 182 | let ty = if fn_decl.c_variadic && index == fn_decl.inputs.len() { |
| 183 | 183 | let va_list_did = self.tcx.require_lang_item(LangItem::VaList, Some(param.span)); |
| 184 | 184 | |
| 185 | self.tcx | |
| 186 | .type_of(va_list_did) | |
| 187 | .instantiate(self.tcx, &[self.tcx.lifetimes.re_erased.into()]) | |
| 185 | self.tcx.type_of(va_list_did).instantiate(self.tcx, &[self | |
| 186 | .tcx | |
| 187 | .lifetimes | |
| 188 | .re_erased | |
| 189 | .into()]) | |
| 188 | 190 | } else { |
| 189 | 191 | fn_sig.inputs()[index] |
| 190 | 192 | }; |
compiler/rustc_mir_build/src/thir/pattern/check_match.rs+2-2| ... | ... | @@ -3,7 +3,7 @@ use rustc_ast::Mutability; |
| 3 | 3 | use rustc_data_structures::fx::FxIndexSet; |
| 4 | 4 | use rustc_data_structures::stack::ensure_sufficient_stack; |
| 5 | 5 | use rustc_errors::codes::*; |
| 6 | use rustc_errors::{struct_span_code_err, Applicability, ErrorGuaranteed, MultiSpan}; | |
| 6 | use rustc_errors::{Applicability, ErrorGuaranteed, MultiSpan, struct_span_code_err}; | |
| 7 | 7 | use rustc_hir::def::*; |
| 8 | 8 | use rustc_hir::def_id::LocalDefId; |
| 9 | 9 | use rustc_hir::{self as hir, BindingMode, ByRef, HirId}; |
| ... | ... | @@ -22,7 +22,7 @@ use rustc_session::lint::builtin::{ |
| 22 | 22 | BINDINGS_WITH_VARIANT_NAME, IRREFUTABLE_LET_PATTERNS, UNREACHABLE_PATTERNS, |
| 23 | 23 | }; |
| 24 | 24 | use rustc_span::hygiene::DesugaringKind; |
| 25 | use rustc_span::{sym, Span}; | |
| 25 | use rustc_span::{Span, sym}; | |
| 26 | 26 | use tracing::instrument; |
| 27 | 27 | |
| 28 | 28 | use crate::errors::*; |
compiler/rustc_mir_build/src/thir/pattern/const_to_pat.rs+1-1| ... | ... | @@ -10,8 +10,8 @@ use rustc_middle::thir::{FieldPat, Pat, PatKind}; |
| 10 | 10 | use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt, ValTree}; |
| 11 | 11 | use rustc_span::Span; |
| 12 | 12 | use rustc_target::abi::{FieldIdx, VariantIdx}; |
| 13 | use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt; | |
| 14 | 13 | use rustc_trait_selection::traits::ObligationCause; |
| 14 | use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt; | |
| 15 | 15 | use tracing::{debug, instrument, trace}; |
| 16 | 16 | |
| 17 | 17 | use super::PatCtxt; |
compiler/rustc_mir_dataflow/src/elaborate_drops.rs+14-20| ... | ... | @@ -8,9 +8,9 @@ use rustc_middle::span_bug; |
| 8 | 8 | use rustc_middle::traits::Reveal; |
| 9 | 9 | use rustc_middle::ty::util::IntTypeExt; |
| 10 | 10 | use rustc_middle::ty::{self, GenericArgsRef, Ty, TyCtxt}; |
| 11 | use rustc_span::source_map::Spanned; | |
| 12 | 11 | use rustc_span::DUMMY_SP; |
| 13 | use rustc_target::abi::{FieldIdx, VariantIdx, FIRST_VARIANT}; | |
| 12 | use rustc_span::source_map::Spanned; | |
| 13 | use rustc_target::abi::{FIRST_VARIANT, FieldIdx, VariantIdx}; | |
| 14 | 14 | use tracing::{debug, instrument}; |
| 15 | 15 | |
| 16 | 16 | /// The value of an inserted drop flag. |
| ... | ... | @@ -233,15 +233,12 @@ where |
| 233 | 233 | .patch_terminator(bb, TerminatorKind::Goto { target: self.succ }); |
| 234 | 234 | } |
| 235 | 235 | DropStyle::Static => { |
| 236 | self.elaborator.patch().patch_terminator( | |
| 237 | bb, | |
| 238 | TerminatorKind::Drop { | |
| 239 | place: self.place, | |
| 240 | target: self.succ, | |
| 241 | unwind: self.unwind.into_action(), | |
| 242 | replace: false, | |
| 243 | }, | |
| 244 | ); | |
| 236 | self.elaborator.patch().patch_terminator(bb, TerminatorKind::Drop { | |
| 237 | place: self.place, | |
| 238 | target: self.succ, | |
| 239 | unwind: self.unwind.into_action(), | |
| 240 | replace: false, | |
| 241 | }); | |
| 245 | 242 | } |
| 246 | 243 | DropStyle::Conditional => { |
| 247 | 244 | let drop_bb = self.complete_drop(self.succ, self.unwind); |
| ... | ... | @@ -732,15 +729,12 @@ where |
| 732 | 729 | }; |
| 733 | 730 | let loop_block = self.elaborator.patch().new_block(loop_block); |
| 734 | 731 | |
| 735 | self.elaborator.patch().patch_terminator( | |
| 736 | drop_block, | |
| 737 | TerminatorKind::Drop { | |
| 738 | place: tcx.mk_place_deref(ptr), | |
| 739 | target: loop_block, | |
| 740 | unwind: unwind.into_action(), | |
| 741 | replace: false, | |
| 742 | }, | |
| 743 | ); | |
| 732 | self.elaborator.patch().patch_terminator(drop_block, TerminatorKind::Drop { | |
| 733 | place: tcx.mk_place_deref(ptr), | |
| 734 | target: loop_block, | |
| 735 | unwind: unwind.into_action(), | |
| 736 | replace: false, | |
| 737 | }); | |
| 744 | 738 | |
| 745 | 739 | loop_block |
| 746 | 740 | } |
compiler/rustc_mir_dataflow/src/framework/engine.rs+5-5| ... | ... | @@ -7,17 +7,17 @@ use rustc_data_structures::work_queue::WorkQueue; |
| 7 | 7 | use rustc_hir::def_id::DefId; |
| 8 | 8 | use rustc_index::{Idx, IndexVec}; |
| 9 | 9 | use rustc_middle::bug; |
| 10 | use rustc_middle::mir::{self, create_dump_file, dump_enabled, traversal, BasicBlock}; | |
| 11 | use rustc_middle::ty::print::with_no_trimmed_paths; | |
| 10 | use rustc_middle::mir::{self, BasicBlock, create_dump_file, dump_enabled, traversal}; | |
| 12 | 11 | use rustc_middle::ty::TyCtxt; |
| 13 | use rustc_span::symbol::{sym, Symbol}; | |
| 12 | use rustc_middle::ty::print::with_no_trimmed_paths; | |
| 13 | use rustc_span::symbol::{Symbol, sym}; | |
| 14 | 14 | use tracing::{debug, error}; |
| 15 | 15 | use {rustc_ast as ast, rustc_graphviz as dot}; |
| 16 | 16 | |
| 17 | 17 | use super::fmt::DebugWithContext; |
| 18 | 18 | use super::{ |
| 19 | graphviz, visit_results, Analysis, AnalysisDomain, Direction, GenKill, GenKillAnalysis, | |
| 20 | GenKillSet, JoinSemiLattice, ResultsCursor, ResultsVisitor, | |
| 19 | Analysis, AnalysisDomain, Direction, GenKill, GenKillAnalysis, GenKillSet, JoinSemiLattice, | |
| 20 | ResultsCursor, ResultsVisitor, graphviz, visit_results, | |
| 21 | 21 | }; |
| 22 | 22 | use crate::errors::{ |
| 23 | 23 | DuplicateValuesFor, PathMustEndInFilename, RequiresAnArgument, UnknownFormatter, |
compiler/rustc_mir_dataflow/src/framework/fmt.rs+1-1| ... | ... | @@ -3,8 +3,8 @@ |
| 3 | 3 | |
| 4 | 4 | use std::fmt; |
| 5 | 5 | |
| 6 | use rustc_index::bit_set::{BitSet, ChunkedBitSet, HybridBitSet}; | |
| 7 | 6 | use rustc_index::Idx; |
| 7 | use rustc_index::bit_set::{BitSet, ChunkedBitSet, HybridBitSet}; | |
| 8 | 8 | |
| 9 | 9 | use super::lattice::MaybeReachable; |
| 10 | 10 |
compiler/rustc_mir_dataflow/src/framework/graphviz.rs+5-5| ... | ... | @@ -8,7 +8,7 @@ use std::{io, ops, str}; |
| 8 | 8 | use regex::Regex; |
| 9 | 9 | use rustc_graphviz as dot; |
| 10 | 10 | use rustc_index::bit_set::BitSet; |
| 11 | use rustc_middle::mir::{self, graphviz_safe_def_name, BasicBlock, Body, Location}; | |
| 11 | use rustc_middle::mir::{self, BasicBlock, Body, Location, graphviz_safe_def_name}; | |
| 12 | 12 | |
| 13 | 13 | use super::fmt::{DebugDiffWithAdapter, DebugWithAdapter, DebugWithContext}; |
| 14 | 14 | use super::{Analysis, CallReturnPlaces, Direction, Results, ResultsCursor, ResultsVisitor}; |
| ... | ... | @@ -502,10 +502,10 @@ where |
| 502 | 502 | r#"<td colspan="{colspan}" {fmt} align="left">{state}</td>"#, |
| 503 | 503 | colspan = this.style.num_state_columns(), |
| 504 | 504 | fmt = fmt, |
| 505 | state = dot::escape_html(&format!( | |
| 506 | "{:?}", | |
| 507 | DebugWithAdapter { this: state, ctxt: analysis } | |
| 508 | )), | |
| 505 | state = dot::escape_html(&format!("{:?}", DebugWithAdapter { | |
| 506 | this: state, | |
| 507 | ctxt: analysis | |
| 508 | })), | |
| 509 | 509 | ) |
| 510 | 510 | }) |
| 511 | 511 | } |
compiler/rustc_mir_dataflow/src/framework/mod.rs+2-2| ... | ... | @@ -32,8 +32,8 @@ |
| 32 | 32 | |
| 33 | 33 | use std::cmp::Ordering; |
| 34 | 34 | |
| 35 | use rustc_index::bit_set::{BitSet, ChunkedBitSet, HybridBitSet}; | |
| 36 | 35 | use rustc_index::Idx; |
| 36 | use rustc_index::bit_set::{BitSet, ChunkedBitSet, HybridBitSet}; | |
| 37 | 37 | use rustc_middle::mir::{self, BasicBlock, CallReturnPlaces, Location, TerminatorEdges}; |
| 38 | 38 | use rustc_middle::ty::TyCtxt; |
| 39 | 39 | |
| ... | ... | @@ -49,7 +49,7 @@ pub use self::cursor::ResultsCursor; |
| 49 | 49 | pub use self::direction::{Backward, Direction, Forward}; |
| 50 | 50 | pub use self::engine::{Engine, Results}; |
| 51 | 51 | pub use self::lattice::{JoinSemiLattice, MaybeReachable}; |
| 52 | pub use self::visitor::{visit_results, ResultsVisitable, ResultsVisitor}; | |
| 52 | pub use self::visitor::{ResultsVisitable, ResultsVisitor, visit_results}; | |
| 53 | 53 | |
| 54 | 54 | /// Analysis domains are all bitsets of various kinds. This trait holds |
| 55 | 55 | /// operations needed by all of them. |
compiler/rustc_mir_dataflow/src/framework/tests.rs+18-24| ... | ... | @@ -30,32 +30,26 @@ fn mock_body<'tcx>() -> mir::Body<'tcx> { |
| 30 | 30 | |
| 31 | 31 | block(4, mir::TerminatorKind::Return); |
| 32 | 32 | block(1, mir::TerminatorKind::Return); |
| 33 | block( | |
| 34 | 2, | |
| 35 | mir::TerminatorKind::Call { | |
| 36 | func: mir::Operand::Copy(dummy_place.clone()), | |
| 37 | args: [].into(), | |
| 38 | destination: dummy_place.clone(), | |
| 39 | target: Some(mir::START_BLOCK), | |
| 40 | unwind: mir::UnwindAction::Continue, | |
| 41 | call_source: mir::CallSource::Misc, | |
| 42 | fn_span: DUMMY_SP, | |
| 43 | }, | |
| 44 | ); | |
| 33 | block(2, mir::TerminatorKind::Call { | |
| 34 | func: mir::Operand::Copy(dummy_place.clone()), | |
| 35 | args: [].into(), | |
| 36 | destination: dummy_place.clone(), | |
| 37 | target: Some(mir::START_BLOCK), | |
| 38 | unwind: mir::UnwindAction::Continue, | |
| 39 | call_source: mir::CallSource::Misc, | |
| 40 | fn_span: DUMMY_SP, | |
| 41 | }); | |
| 45 | 42 | block(3, mir::TerminatorKind::Return); |
| 46 | 43 | block(0, mir::TerminatorKind::Return); |
| 47 | block( | |
| 48 | 4, | |
| 49 | mir::TerminatorKind::Call { | |
| 50 | func: mir::Operand::Copy(dummy_place.clone()), | |
| 51 | args: [].into(), | |
| 52 | destination: dummy_place.clone(), | |
| 53 | target: Some(mir::START_BLOCK), | |
| 54 | unwind: mir::UnwindAction::Continue, | |
| 55 | call_source: mir::CallSource::Misc, | |
| 56 | fn_span: DUMMY_SP, | |
| 57 | }, | |
| 58 | ); | |
| 44 | block(4, mir::TerminatorKind::Call { | |
| 45 | func: mir::Operand::Copy(dummy_place.clone()), | |
| 46 | args: [].into(), | |
| 47 | destination: dummy_place.clone(), | |
| 48 | target: Some(mir::START_BLOCK), | |
| 49 | unwind: mir::UnwindAction::Continue, | |
| 50 | call_source: mir::CallSource::Misc, | |
| 51 | fn_span: DUMMY_SP, | |
| 52 | }); | |
| 59 | 53 | |
| 60 | 54 | mir::Body::new_cfg_only(blocks) |
| 61 | 55 | } |
compiler/rustc_mir_dataflow/src/impls/initialized.rs+4-4| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use std::assert_matches::assert_matches; |
| 2 | 2 | |
| 3 | use rustc_index::bit_set::{BitSet, ChunkedBitSet}; | |
| 4 | 3 | use rustc_index::Idx; |
| 4 | use rustc_index::bit_set::{BitSet, ChunkedBitSet}; | |
| 5 | 5 | use rustc_middle::bug; |
| 6 | 6 | use rustc_middle::mir::{self, Body, CallReturnPlaces, Location, TerminatorEdges}; |
| 7 | 7 | use rustc_middle::ty::{self, TyCtxt}; |
| ... | ... | @@ -11,9 +11,9 @@ use crate::elaborate_drops::DropFlagState; |
| 11 | 11 | use crate::framework::SwitchIntEdgeEffects; |
| 12 | 12 | use crate::move_paths::{HasMoveData, InitIndex, InitKind, LookupResult, MoveData, MovePathIndex}; |
| 13 | 13 | use crate::{ |
| 14 | drop_flag_effects, drop_flag_effects_for_function_entry, drop_flag_effects_for_location, | |
| 15 | lattice, on_all_children_bits, on_lookup_result_bits, AnalysisDomain, GenKill, GenKillAnalysis, | |
| 16 | MaybeReachable, | |
| 14 | AnalysisDomain, GenKill, GenKillAnalysis, MaybeReachable, drop_flag_effects, | |
| 15 | drop_flag_effects_for_function_entry, drop_flag_effects_for_location, lattice, | |
| 16 | on_all_children_bits, on_lookup_result_bits, | |
| 17 | 17 | }; |
| 18 | 18 | |
| 19 | 19 | /// `MaybeInitializedPlaces` tracks all places that might be |
compiler/rustc_mir_dataflow/src/impls/mod.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ mod initialized; |
| 7 | 7 | mod liveness; |
| 8 | 8 | mod storage_liveness; |
| 9 | 9 | |
| 10 | pub use self::borrowed_locals::{borrowed_locals, MaybeBorrowedLocals}; | |
| 10 | pub use self::borrowed_locals::{MaybeBorrowedLocals, borrowed_locals}; | |
| 11 | 11 | pub use self::initialized::{ |
| 12 | 12 | DefinitelyInitializedPlaces, EverInitializedPlaces, MaybeInitializedPlaces, |
| 13 | 13 | MaybeUninitializedPlaces, |
compiler/rustc_mir_dataflow/src/lib.rs+3-3| ... | ... | @@ -17,9 +17,9 @@ pub use self::drop_flag_effects::{ |
| 17 | 17 | move_path_children_matching, on_all_children_bits, on_lookup_result_bits, |
| 18 | 18 | }; |
| 19 | 19 | pub use self::framework::{ |
| 20 | fmt, graphviz, lattice, visit_results, Analysis, AnalysisDomain, Backward, Direction, Engine, | |
| 21 | Forward, GenKill, GenKillAnalysis, JoinSemiLattice, MaybeReachable, Results, ResultsCursor, | |
| 22 | ResultsVisitable, ResultsVisitor, SwitchIntEdgeEffects, | |
| 20 | Analysis, AnalysisDomain, Backward, Direction, Engine, Forward, GenKill, GenKillAnalysis, | |
| 21 | JoinSemiLattice, MaybeReachable, Results, ResultsCursor, ResultsVisitable, ResultsVisitor, | |
| 22 | SwitchIntEdgeEffects, fmt, graphviz, lattice, visit_results, | |
| 23 | 23 | }; |
| 24 | 24 | use self::move_paths::MoveData; |
| 25 | 25 |
compiler/rustc_mir_dataflow/src/move_paths/builder.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ use rustc_middle::mir::tcx::{PlaceTy, RvalueInitializationState}; |
| 5 | 5 | use rustc_middle::mir::*; |
| 6 | 6 | use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt}; |
| 7 | 7 | use rustc_middle::{bug, span_bug}; |
| 8 | use smallvec::{smallvec, SmallVec}; | |
| 8 | use smallvec::{SmallVec, smallvec}; | |
| 9 | 9 | use tracing::debug; |
| 10 | 10 | |
| 11 | 11 | use super::abs_domain::Lift; |
compiler/rustc_mir_dataflow/src/points.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ use rustc_index::interval::SparseIntervalMatrix; |
| 3 | 3 | use rustc_index::{Idx, IndexVec}; |
| 4 | 4 | use rustc_middle::mir::{self, BasicBlock, Body, Location}; |
| 5 | 5 | |
| 6 | use crate::framework::{visit_results, ResultsVisitable, ResultsVisitor}; | |
| 6 | use crate::framework::{ResultsVisitable, ResultsVisitor, visit_results}; | |
| 7 | 7 | |
| 8 | 8 | /// Maps between a `Location` and a `PointIndex` (and vice versa). |
| 9 | 9 | pub struct DenseLocationMap { |
compiler/rustc_mir_dataflow/src/rustc_peek.rs+1-1| ... | ... | @@ -3,8 +3,8 @@ use rustc_hir::def_id::DefId; |
| 3 | 3 | use rustc_index::bit_set::BitSet; |
| 4 | 4 | use rustc_middle::mir::{self, Body, Local, Location}; |
| 5 | 5 | use rustc_middle::ty::{self, Ty, TyCtxt}; |
| 6 | use rustc_span::symbol::{sym, Symbol}; | |
| 7 | 6 | use rustc_span::Span; |
| 7 | use rustc_span::symbol::{Symbol, sym}; | |
| 8 | 8 | use tracing::{debug, info}; |
| 9 | 9 | |
| 10 | 10 | use crate::errors::{ |
compiler/rustc_mir_dataflow/src/value_analysis.rs+1-1| ... | ... | @@ -39,8 +39,8 @@ use std::ops::Range; |
| 39 | 39 | use rustc_data_structures::captures::Captures; |
| 40 | 40 | use rustc_data_structures::fx::{FxHashMap, FxIndexSet, StdEntry}; |
| 41 | 41 | use rustc_data_structures::stack::ensure_sufficient_stack; |
| 42 | use rustc_index::bit_set::BitSet; | |
| 43 | 42 | use rustc_index::IndexVec; |
| 43 | use rustc_index::bit_set::BitSet; | |
| 44 | 44 | use rustc_middle::bug; |
| 45 | 45 | use rustc_middle::mir::tcx::PlaceTy; |
| 46 | 46 | use rustc_middle::mir::visit::{MutatingUseContext, PlaceContext, Visitor}; |
compiler/rustc_mir_transform/src/abort_unwinding_calls.rs+2-2| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | use rustc_ast::InlineAsmOptions; |
| 2 | 2 | use rustc_middle::mir::*; |
| 3 | 3 | use rustc_middle::span_bug; |
| 4 | use rustc_middle::ty::{self, layout, TyCtxt}; | |
| 5 | use rustc_target::spec::abi::Abi; | |
| 4 | use rustc_middle::ty::{self, TyCtxt, layout}; | |
| 6 | 5 | use rustc_target::spec::PanicStrategy; |
| 6 | use rustc_target::spec::abi::Abi; | |
| 7 | 7 | |
| 8 | 8 | /// A pass that runs which is targeted at ensuring that codegen guarantees about |
| 9 | 9 | /// unwinding are upheld for compilations of panic=abort programs. |
compiler/rustc_mir_transform/src/add_moves_for_packed_drops.rs+6-9| ... | ... | @@ -95,13 +95,10 @@ fn add_move_for_packed_drop<'tcx>( |
| 95 | 95 | |
| 96 | 96 | patch.add_statement(loc, StatementKind::StorageLive(temp)); |
| 97 | 97 | patch.add_assign(loc, Place::from(temp), Rvalue::Use(Operand::Move(*place))); |
| 98 | patch.patch_terminator( | |
| 99 | loc.block, | |
| 100 | TerminatorKind::Drop { | |
| 101 | place: Place::from(temp), | |
| 102 | target: storage_dead_block, | |
| 103 | unwind, | |
| 104 | replace, | |
| 105 | }, | |
| 106 | ); | |
| 98 | patch.patch_terminator(loc.block, TerminatorKind::Drop { | |
| 99 | place: Place::from(temp), | |
| 100 | target: storage_dead_block, | |
| 101 | unwind, | |
| 102 | replace, | |
| 103 | }); | |
| 107 | 104 | } |
compiler/rustc_mir_transform/src/add_retag.rs+8-14| ... | ... | @@ -111,13 +111,10 @@ impl<'tcx> crate::MirPass<'tcx> for AddRetag { |
| 111 | 111 | .collect::<Vec<_>>(); |
| 112 | 112 | // Now we go over the returns we collected to retag the return values. |
| 113 | 113 | for (source_info, dest_place, dest_block) in returns { |
| 114 | basic_blocks[dest_block].statements.insert( | |
| 115 | 0, | |
| 116 | Statement { | |
| 117 | source_info, | |
| 118 | kind: StatementKind::Retag(RetagKind::Default, Box::new(dest_place)), | |
| 119 | }, | |
| 120 | ); | |
| 114 | basic_blocks[dest_block].statements.insert(0, Statement { | |
| 115 | source_info, | |
| 116 | kind: StatementKind::Retag(RetagKind::Default, Box::new(dest_place)), | |
| 117 | }); | |
| 121 | 118 | } |
| 122 | 119 | |
| 123 | 120 | // PART 3 |
| ... | ... | @@ -172,13 +169,10 @@ impl<'tcx> crate::MirPass<'tcx> for AddRetag { |
| 172 | 169 | }; |
| 173 | 170 | // Insert a retag after the statement. |
| 174 | 171 | let source_info = block_data.statements[i].source_info; |
| 175 | block_data.statements.insert( | |
| 176 | i + 1, | |
| 177 | Statement { | |
| 178 | source_info, | |
| 179 | kind: StatementKind::Retag(retag_kind, Box::new(place)), | |
| 180 | }, | |
| 181 | ); | |
| 172 | block_data.statements.insert(i + 1, Statement { | |
| 173 | source_info, | |
| 174 | kind: StatementKind::Retag(retag_kind, Box::new(place)), | |
| 175 | }); | |
| 182 | 176 | } |
| 183 | 177 | } |
| 184 | 178 | } |
compiler/rustc_mir_transform/src/check_const_item_mutation.rs+1-1| ... | ... | @@ -3,8 +3,8 @@ use rustc_middle::mir::visit::Visitor; |
| 3 | 3 | use rustc_middle::mir::*; |
| 4 | 4 | use rustc_middle::ty::TyCtxt; |
| 5 | 5 | use rustc_session::lint::builtin::CONST_ITEM_MUTATION; |
| 6 | use rustc_span::def_id::DefId; | |
| 7 | 6 | use rustc_span::Span; |
| 7 | use rustc_span::def_id::DefId; | |
| 8 | 8 | |
| 9 | 9 | use crate::errors; |
| 10 | 10 |
compiler/rustc_mir_transform/src/cleanup_post_borrowck.rs+1-1| ... | ... | @@ -18,8 +18,8 @@ |
| 18 | 18 | |
| 19 | 19 | use rustc_middle::mir::coverage::CoverageKind; |
| 20 | 20 | use rustc_middle::mir::{Body, BorrowKind, CastKind, Rvalue, StatementKind, TerminatorKind}; |
| 21 | use rustc_middle::ty::adjustment::PointerCoercion; | |
| 22 | 21 | use rustc_middle::ty::TyCtxt; |
| 22 | use rustc_middle::ty::adjustment::PointerCoercion; | |
| 23 | 23 | |
| 24 | 24 | pub(super) struct CleanupPostBorrowck; |
| 25 | 25 |
compiler/rustc_mir_transform/src/copy_prop.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | use rustc_index::bit_set::BitSet; | |
| 2 | 1 | use rustc_index::IndexSlice; |
| 2 | use rustc_index::bit_set::BitSet; | |
| 3 | 3 | use rustc_middle::mir::visit::*; |
| 4 | 4 | use rustc_middle::mir::*; |
| 5 | 5 | use rustc_middle::ty::TyCtxt; |
compiler/rustc_mir_transform/src/coroutine.rs+46-77| ... | ... | @@ -67,14 +67,14 @@ use rustc_middle::ty::{ |
| 67 | 67 | self, CoroutineArgs, CoroutineArgsExt, GenericArgsRef, InstanceKind, Ty, TyCtxt, |
| 68 | 68 | }; |
| 69 | 69 | use rustc_middle::{bug, span_bug}; |
| 70 | use rustc_mir_dataflow::Analysis; | |
| 70 | 71 | use rustc_mir_dataflow::impls::{ |
| 71 | 72 | MaybeBorrowedLocals, MaybeLiveLocals, MaybeRequiresStorage, MaybeStorageLive, |
| 72 | 73 | }; |
| 73 | 74 | use rustc_mir_dataflow::storage::always_storage_live_locals; |
| 74 | use rustc_mir_dataflow::Analysis; | |
| 75 | use rustc_span::Span; | |
| 75 | 76 | use rustc_span::def_id::{DefId, LocalDefId}; |
| 76 | 77 | use rustc_span::symbol::sym; |
| 77 | use rustc_span::Span; | |
| 78 | 78 | use rustc_target::abi::{FieldIdx, VariantIdx}; |
| 79 | 79 | use rustc_target::spec::PanicStrategy; |
| 80 | 80 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; |
| ... | ... | @@ -1054,14 +1054,11 @@ fn insert_switch<'tcx>( |
| 1054 | 1054 | let switch = TerminatorKind::SwitchInt { discr: Operand::Move(discr), targets: switch_targets }; |
| 1055 | 1055 | |
| 1056 | 1056 | let source_info = SourceInfo::outermost(body.span); |
| 1057 | body.basic_blocks_mut().raw.insert( | |
| 1058 | 0, | |
| 1059 | BasicBlockData { | |
| 1060 | statements: vec![assign], | |
| 1061 | terminator: Some(Terminator { source_info, kind: switch }), | |
| 1062 | is_cleanup: false, | |
| 1063 | }, | |
| 1064 | ); | |
| 1057 | body.basic_blocks_mut().raw.insert(0, BasicBlockData { | |
| 1058 | statements: vec![assign], | |
| 1059 | terminator: Some(Terminator { source_info, kind: switch }), | |
| 1060 | is_cleanup: false, | |
| 1061 | }); | |
| 1065 | 1062 | |
| 1066 | 1063 | let blocks = body.basic_blocks_mut().iter_mut(); |
| 1067 | 1064 | |
| ... | ... | @@ -1072,7 +1069,7 @@ fn insert_switch<'tcx>( |
| 1072 | 1069 | |
| 1073 | 1070 | fn elaborate_coroutine_drops<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) { |
| 1074 | 1071 | use rustc_middle::mir::patch::MirPatch; |
| 1075 | use rustc_mir_dataflow::elaborate_drops::{elaborate_drop, Unwind}; | |
| 1072 | use rustc_mir_dataflow::elaborate_drops::{Unwind, elaborate_drop}; | |
| 1076 | 1073 | |
| 1077 | 1074 | use crate::shim::DropShimElaborator; |
| 1078 | 1075 | |
| ... | ... | @@ -1605,16 +1602,13 @@ impl<'tcx> crate::MirPass<'tcx> for StateTransform { |
| 1605 | 1602 | // (which is now a generator interior). |
| 1606 | 1603 | let source_info = SourceInfo::outermost(body.span); |
| 1607 | 1604 | let stmts = &mut body.basic_blocks_mut()[START_BLOCK].statements; |
| 1608 | stmts.insert( | |
| 1609 | 0, | |
| 1610 | Statement { | |
| 1611 | source_info, | |
| 1612 | kind: StatementKind::Assign(Box::new(( | |
| 1613 | old_resume_local.into(), | |
| 1614 | Rvalue::Use(Operand::Move(resume_local.into())), | |
| 1615 | ))), | |
| 1616 | }, | |
| 1617 | ); | |
| 1605 | stmts.insert(0, Statement { | |
| 1606 | source_info, | |
| 1607 | kind: StatementKind::Assign(Box::new(( | |
| 1608 | old_resume_local.into(), | |
| 1609 | Rvalue::Use(Operand::Move(resume_local.into())), | |
| 1610 | ))), | |
| 1611 | }); | |
| 1618 | 1612 | |
| 1619 | 1613 | let always_live_locals = always_storage_live_locals(body); |
| 1620 | 1614 | |
| ... | ... | @@ -1851,18 +1845,12 @@ fn check_suspend_tys<'tcx>(tcx: TyCtxt<'tcx>, layout: &CoroutineLayout<'tcx>, bo |
| 1851 | 1845 | continue; |
| 1852 | 1846 | }; |
| 1853 | 1847 | |
| 1854 | check_must_not_suspend_ty( | |
| 1855 | tcx, | |
| 1856 | decl.ty, | |
| 1857 | hir_id, | |
| 1858 | param_env, | |
| 1859 | SuspendCheckData { | |
| 1860 | source_span: decl.source_info.span, | |
| 1861 | yield_span: yield_source_info.span, | |
| 1862 | plural_len: 1, | |
| 1863 | ..Default::default() | |
| 1864 | }, | |
| 1865 | ); | |
| 1848 | check_must_not_suspend_ty(tcx, decl.ty, hir_id, param_env, SuspendCheckData { | |
| 1849 | source_span: decl.source_info.span, | |
| 1850 | yield_span: yield_source_info.span, | |
| 1851 | plural_len: 1, | |
| 1852 | ..Default::default() | |
| 1853 | }); | |
| 1866 | 1854 | } |
| 1867 | 1855 | } |
| 1868 | 1856 | } |
| ... | ... | @@ -1902,13 +1890,10 @@ fn check_must_not_suspend_ty<'tcx>( |
| 1902 | 1890 | ty::Adt(_, args) if ty.is_box() => { |
| 1903 | 1891 | let boxed_ty = args.type_at(0); |
| 1904 | 1892 | let allocator_ty = args.type_at(1); |
| 1905 | check_must_not_suspend_ty( | |
| 1906 | tcx, | |
| 1907 | boxed_ty, | |
| 1908 | hir_id, | |
| 1909 | param_env, | |
| 1910 | SuspendCheckData { descr_pre: &format!("{}boxed ", data.descr_pre), ..data }, | |
| 1911 | ) || check_must_not_suspend_ty( | |
| 1893 | check_must_not_suspend_ty(tcx, boxed_ty, hir_id, param_env, SuspendCheckData { | |
| 1894 | descr_pre: &format!("{}boxed ", data.descr_pre), | |
| 1895 | ..data | |
| 1896 | }) || check_must_not_suspend_ty( | |
| 1912 | 1897 | tcx, |
| 1913 | 1898 | allocator_ty, |
| 1914 | 1899 | hir_id, |
| ... | ... | @@ -1927,12 +1912,10 @@ fn check_must_not_suspend_ty<'tcx>( |
| 1927 | 1912 | { |
| 1928 | 1913 | let def_id = poly_trait_predicate.trait_ref.def_id; |
| 1929 | 1914 | let descr_pre = &format!("{}implementer{} of ", data.descr_pre, plural_suffix); |
| 1930 | if check_must_not_suspend_def( | |
| 1931 | tcx, | |
| 1932 | def_id, | |
| 1933 | hir_id, | |
| 1934 | SuspendCheckData { descr_pre, ..data }, | |
| 1935 | ) { | |
| 1915 | if check_must_not_suspend_def(tcx, def_id, hir_id, SuspendCheckData { | |
| 1916 | descr_pre, | |
| 1917 | ..data | |
| 1918 | }) { | |
| 1936 | 1919 | has_emitted = true; |
| 1937 | 1920 | break; |
| 1938 | 1921 | } |
| ... | ... | @@ -1946,12 +1929,10 @@ fn check_must_not_suspend_ty<'tcx>( |
| 1946 | 1929 | if let ty::ExistentialPredicate::Trait(ref trait_ref) = predicate.skip_binder() { |
| 1947 | 1930 | let def_id = trait_ref.def_id; |
| 1948 | 1931 | let descr_post = &format!(" trait object{}{}", plural_suffix, data.descr_post); |
| 1949 | if check_must_not_suspend_def( | |
| 1950 | tcx, | |
| 1951 | def_id, | |
| 1952 | hir_id, | |
| 1953 | SuspendCheckData { descr_post, ..data }, | |
| 1954 | ) { | |
| 1932 | if check_must_not_suspend_def(tcx, def_id, hir_id, SuspendCheckData { | |
| 1933 | descr_post, | |
| 1934 | ..data | |
| 1935 | }) { | |
| 1955 | 1936 | has_emitted = true; |
| 1956 | 1937 | break; |
| 1957 | 1938 | } |
| ... | ... | @@ -1963,13 +1944,10 @@ fn check_must_not_suspend_ty<'tcx>( |
| 1963 | 1944 | let mut has_emitted = false; |
| 1964 | 1945 | for (i, ty) in fields.iter().enumerate() { |
| 1965 | 1946 | let descr_post = &format!(" in tuple element {i}"); |
| 1966 | if check_must_not_suspend_ty( | |
| 1967 | tcx, | |
| 1968 | ty, | |
| 1969 | hir_id, | |
| 1970 | param_env, | |
| 1971 | SuspendCheckData { descr_post, ..data }, | |
| 1972 | ) { | |
| 1947 | if check_must_not_suspend_ty(tcx, ty, hir_id, param_env, SuspendCheckData { | |
| 1948 | descr_post, | |
| 1949 | ..data | |
| 1950 | }) { | |
| 1973 | 1951 | has_emitted = true; |
| 1974 | 1952 | } |
| 1975 | 1953 | } |
| ... | ... | @@ -1977,29 +1955,20 @@ fn check_must_not_suspend_ty<'tcx>( |
| 1977 | 1955 | } |
| 1978 | 1956 | ty::Array(ty, len) => { |
| 1979 | 1957 | let descr_pre = &format!("{}array{} of ", data.descr_pre, plural_suffix); |
| 1980 | check_must_not_suspend_ty( | |
| 1981 | tcx, | |
| 1982 | ty, | |
| 1983 | hir_id, | |
| 1984 | param_env, | |
| 1985 | SuspendCheckData { | |
| 1986 | descr_pre, | |
| 1987 | plural_len: len.try_eval_target_usize(tcx, param_env).unwrap_or(0) as usize + 1, | |
| 1988 | ..data | |
| 1989 | }, | |
| 1990 | ) | |
| 1958 | check_must_not_suspend_ty(tcx, ty, hir_id, param_env, SuspendCheckData { | |
| 1959 | descr_pre, | |
| 1960 | plural_len: len.try_eval_target_usize(tcx, param_env).unwrap_or(0) as usize + 1, | |
| 1961 | ..data | |
| 1962 | }) | |
| 1991 | 1963 | } |
| 1992 | 1964 | // If drop tracking is enabled, we want to look through references, since the referent |
| 1993 | 1965 | // may not be considered live across the await point. |
| 1994 | 1966 | ty::Ref(_region, ty, _mutability) => { |
| 1995 | 1967 | let descr_pre = &format!("{}reference{} to ", data.descr_pre, plural_suffix); |
| 1996 | check_must_not_suspend_ty( | |
| 1997 | tcx, | |
| 1998 | ty, | |
| 1999 | hir_id, | |
| 2000 | param_env, | |
| 2001 | SuspendCheckData { descr_pre, ..data }, | |
| 2002 | ) | |
| 1968 | check_must_not_suspend_ty(tcx, ty, hir_id, param_env, SuspendCheckData { | |
| 1969 | descr_pre, | |
| 1970 | ..data | |
| 1971 | }) | |
| 2003 | 1972 | } |
| 2004 | 1973 | _ => false, |
| 2005 | 1974 | } |
compiler/rustc_mir_transform/src/coroutine/by_move_body.rs+4-4| ... | ... | @@ -140,10 +140,10 @@ pub(crate) fn coroutine_by_move_body_def_id<'tcx>( |
| 140 | 140 | // If the parent capture is by-ref, then we need to apply an additional |
| 141 | 141 | // deref before applying any further projections to this place. |
| 142 | 142 | if parent_capture.is_by_ref() { |
| 143 | child_precise_captures.insert( | |
| 144 | 0, | |
| 145 | Projection { ty: parent_capture.place.ty(), kind: ProjectionKind::Deref }, | |
| 146 | ); | |
| 143 | child_precise_captures.insert(0, Projection { | |
| 144 | ty: parent_capture.place.ty(), | |
| 145 | kind: ProjectionKind::Deref, | |
| 146 | }); | |
| 147 | 147 | } |
| 148 | 148 | // If the child capture is by-ref, then we need to apply a "ref" |
| 149 | 149 | // projection (i.e. `&`) at the end. But wait! We don't have that |
compiler/rustc_mir_transform/src/coverage/graph.rs+1-1| ... | ... | @@ -6,8 +6,8 @@ use rustc_data_structures::captures::Captures; |
| 6 | 6 | use rustc_data_structures::fx::FxHashSet; |
| 7 | 7 | use rustc_data_structures::graph::dominators::{self, Dominators}; |
| 8 | 8 | use rustc_data_structures::graph::{self, DirectedGraph, StartNode}; |
| 9 | use rustc_index::bit_set::BitSet; | |
| 10 | 9 | use rustc_index::IndexVec; |
| 10 | use rustc_index::bit_set::BitSet; | |
| 11 | 11 | use rustc_middle::bug; |
| 12 | 12 | use rustc_middle::mir::{self, BasicBlock, Terminator, TerminatorKind}; |
| 13 | 13 | use tracing::debug; |
compiler/rustc_mir_transform/src/coverage/mappings.rs+2-2| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use std::collections::BTreeSet; |
| 2 | 2 | |
| 3 | 3 | use rustc_data_structures::graph::DirectedGraph; |
| 4 | use rustc_index::bit_set::BitSet; | |
| 5 | 4 | use rustc_index::IndexVec; |
| 5 | use rustc_index::bit_set::BitSet; | |
| 6 | 6 | use rustc_middle::mir::coverage::{ |
| 7 | 7 | BlockMarkerId, BranchSpan, ConditionInfo, CoverageInfoHi, CoverageKind, |
| 8 | 8 | }; |
| ... | ... | @@ -10,10 +10,10 @@ use rustc_middle::mir::{self, BasicBlock, StatementKind}; |
| 10 | 10 | use rustc_middle::ty::TyCtxt; |
| 11 | 11 | use rustc_span::Span; |
| 12 | 12 | |
| 13 | use crate::coverage::ExtractedHirInfo; | |
| 13 | 14 | use crate::coverage::graph::{BasicCoverageBlock, CoverageGraph, START_BCB}; |
| 14 | 15 | use crate::coverage::spans::extract_refined_covspans; |
| 15 | 16 | use crate::coverage::unexpand::unexpand_into_body_span; |
| 16 | use crate::coverage::ExtractedHirInfo; | |
| 17 | 17 | |
| 18 | 18 | /// Associates an ordinary executable code span with its corresponding BCB. |
| 19 | 19 | #[derive(Debug)] |
compiler/rustc_mir_transform/src/coverage/mod.rs+2-2| ... | ... | @@ -9,7 +9,7 @@ mod tests; |
| 9 | 9 | mod unexpand; |
| 10 | 10 | |
| 11 | 11 | use rustc_hir as hir; |
| 12 | use rustc_hir::intravisit::{walk_expr, Visitor}; | |
| 12 | use rustc_hir::intravisit::{Visitor, walk_expr}; | |
| 13 | 13 | use rustc_middle::hir::map::Map; |
| 14 | 14 | use rustc_middle::hir::nested_filter; |
| 15 | 15 | use rustc_middle::mir::coverage::{ |
| ... | ... | @@ -147,8 +147,8 @@ fn create_mappings<'tcx>( |
| 147 | 147 | |
| 148 | 148 | let source_file = source_map.lookup_source_file(body_span.lo()); |
| 149 | 149 | |
| 150 | use rustc_session::config::RemapPathScopeComponents; | |
| 151 | 150 | use rustc_session::RemapFileNameExt; |
| 151 | use rustc_session::config::RemapPathScopeComponents; | |
| 152 | 152 | let file_name = Symbol::intern( |
| 153 | 153 | &source_file.name.for_scope(tcx.sess, RemapPathScopeComponents::MACRO).to_string_lossy(), |
| 154 | 154 | ); |
compiler/rustc_mir_transform/src/coverage/spans.rs+2-2| ... | ... | @@ -8,9 +8,9 @@ use tracing::{debug, debug_span, instrument}; |
| 8 | 8 | |
| 9 | 9 | use crate::coverage::graph::{BasicCoverageBlock, CoverageGraph}; |
| 10 | 10 | use crate::coverage::spans::from_mir::{ |
| 11 | extract_covspans_from_mir, ExtractedCovspans, Hole, SpanFromMir, | |
| 11 | ExtractedCovspans, Hole, SpanFromMir, extract_covspans_from_mir, | |
| 12 | 12 | }; |
| 13 | use crate::coverage::{mappings, ExtractedHirInfo}; | |
| 13 | use crate::coverage::{ExtractedHirInfo, mappings}; | |
| 14 | 14 | |
| 15 | 15 | mod from_mir; |
| 16 | 16 |
compiler/rustc_mir_transform/src/coverage/spans/from_mir.rs+1-1| ... | ... | @@ -5,12 +5,12 @@ use rustc_middle::mir::{ |
| 5 | 5 | }; |
| 6 | 6 | use rustc_span::{ExpnKind, Span}; |
| 7 | 7 | |
| 8 | use crate::coverage::ExtractedHirInfo; | |
| 8 | 9 | use crate::coverage::graph::{ |
| 9 | 10 | BasicCoverageBlock, BasicCoverageBlockData, CoverageGraph, START_BCB, |
| 10 | 11 | }; |
| 11 | 12 | use crate::coverage::spans::Covspan; |
| 12 | 13 | use crate::coverage::unexpand::unexpand_into_body_span_with_expn_kind; |
| 13 | use crate::coverage::ExtractedHirInfo; | |
| 14 | 14 | |
| 15 | 15 | pub(crate) struct ExtractedCovspans { |
| 16 | 16 | pub(crate) covspans: Vec<SpanFromMir>, |
compiler/rustc_mir_transform/src/coverage/tests.rs+10-13| ... | ... | @@ -29,7 +29,7 @@ use rustc_data_structures::graph::{DirectedGraph, Successors}; |
| 29 | 29 | use rustc_index::{Idx, IndexVec}; |
| 30 | 30 | use rustc_middle::mir::*; |
| 31 | 31 | use rustc_middle::{bug, ty}; |
| 32 | use rustc_span::{BytePos, Pos, Span, DUMMY_SP}; | |
| 32 | use rustc_span::{BytePos, DUMMY_SP, Pos, Span}; | |
| 33 | 33 | |
| 34 | 34 | use super::graph::{self, BasicCoverageBlock}; |
| 35 | 35 | |
| ... | ... | @@ -129,18 +129,15 @@ impl<'tcx> MockBlocks<'tcx> { |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | fn call(&mut self, some_from_block: Option<BasicBlock>) -> BasicBlock { |
| 132 | self.add_block_from( | |
| 133 | some_from_block, | |
| 134 | TerminatorKind::Call { | |
| 135 | func: Operand::Copy(self.dummy_place.clone()), | |
| 136 | args: [].into(), | |
| 137 | destination: self.dummy_place.clone(), | |
| 138 | target: Some(TEMP_BLOCK), | |
| 139 | unwind: UnwindAction::Continue, | |
| 140 | call_source: CallSource::Misc, | |
| 141 | fn_span: DUMMY_SP, | |
| 142 | }, | |
| 143 | ) | |
| 132 | self.add_block_from(some_from_block, TerminatorKind::Call { | |
| 133 | func: Operand::Copy(self.dummy_place.clone()), | |
| 134 | args: [].into(), | |
| 135 | destination: self.dummy_place.clone(), | |
| 136 | target: Some(TEMP_BLOCK), | |
| 137 | unwind: UnwindAction::Continue, | |
| 138 | call_source: CallSource::Misc, | |
| 139 | fn_span: DUMMY_SP, | |
| 140 | }) | |
| 144 | 141 | } |
| 145 | 142 | |
| 146 | 143 | fn goto(&mut self, some_from_block: Option<BasicBlock>) -> BasicBlock { |
compiler/rustc_mir_transform/src/dataflow_const_prop.rs+2-2| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | //! |
| 3 | 3 | //! Currently, this pass only propagates scalar values. |
| 4 | 4 | |
| 5 | use rustc_const_eval::const_eval::{throw_machine_stop_str, DummyMachine}; | |
| 5 | use rustc_const_eval::const_eval::{DummyMachine, throw_machine_stop_str}; | |
| 6 | 6 | use rustc_const_eval::interpret::{ImmTy, Immediate, InterpCx, OpTy, PlaceTy, Projectable}; |
| 7 | 7 | use rustc_data_structures::fx::FxHashMap; |
| 8 | 8 | use rustc_hir::def::DefKind; |
| ... | ... | @@ -18,7 +18,7 @@ use rustc_mir_dataflow::value_analysis::{ |
| 18 | 18 | }; |
| 19 | 19 | use rustc_mir_dataflow::{Analysis, Results, ResultsVisitor}; |
| 20 | 20 | use rustc_span::DUMMY_SP; |
| 21 | use rustc_target::abi::{Abi, FieldIdx, Size, VariantIdx, FIRST_VARIANT}; | |
| 21 | use rustc_target::abi::{Abi, FIRST_VARIANT, FieldIdx, Size, VariantIdx}; | |
| 22 | 22 | use tracing::{debug, debug_span, instrument}; |
| 23 | 23 | |
| 24 | 24 | // These constants are somewhat random guesses and have not been optimized. |
compiler/rustc_mir_transform/src/dead_store_elimination.rs+2-2| ... | ... | @@ -16,11 +16,11 @@ use rustc_middle::bug; |
| 16 | 16 | use rustc_middle::mir::visit::Visitor; |
| 17 | 17 | use rustc_middle::mir::*; |
| 18 | 18 | use rustc_middle::ty::TyCtxt; |
| 19 | use rustc_mir_dataflow::Analysis; | |
| 19 | 20 | use rustc_mir_dataflow::debuginfo::debuginfo_locals; |
| 20 | 21 | use rustc_mir_dataflow::impls::{ |
| 21 | borrowed_locals, LivenessTransferFunction, MaybeTransitiveLiveLocals, | |
| 22 | LivenessTransferFunction, MaybeTransitiveLiveLocals, borrowed_locals, | |
| 22 | 23 | }; |
| 23 | use rustc_mir_dataflow::Analysis; | |
| 24 | 24 | |
| 25 | 25 | use crate::util::is_within_packed; |
| 26 | 26 |
compiler/rustc_mir_transform/src/deduce_param_attrs.rs+1-1| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | use rustc_hir::def_id::LocalDefId; |
| 9 | 9 | use rustc_index::bit_set::BitSet; |
| 10 | 10 | use rustc_middle::mir::visit::{NonMutatingUseContext, PlaceContext, Visitor}; |
| 11 | use rustc_middle::mir::{Body, Location, Operand, Place, Terminator, TerminatorKind, RETURN_PLACE}; | |
| 11 | use rustc_middle::mir::{Body, Location, Operand, Place, RETURN_PLACE, Terminator, TerminatorKind}; | |
| 12 | 12 | use rustc_middle::ty::{self, DeducedParamAttrs, Ty, TyCtxt}; |
| 13 | 13 | use rustc_session::config::OptLevel; |
| 14 | 14 |
compiler/rustc_mir_transform/src/dest_prop.rs+4-4| ... | ... | @@ -137,13 +137,13 @@ use rustc_index::interval::SparseIntervalMatrix; |
| 137 | 137 | use rustc_middle::bug; |
| 138 | 138 | use rustc_middle::mir::visit::{MutVisitor, PlaceContext, Visitor}; |
| 139 | 139 | use rustc_middle::mir::{ |
| 140 | dump_mir, traversal, Body, HasLocalDecls, InlineAsmOperand, Local, LocalKind, Location, | |
| 141 | Operand, PassWhere, Place, Rvalue, Statement, StatementKind, TerminatorKind, | |
| 140 | Body, HasLocalDecls, InlineAsmOperand, Local, LocalKind, Location, Operand, PassWhere, Place, | |
| 141 | Rvalue, Statement, StatementKind, TerminatorKind, dump_mir, traversal, | |
| 142 | 142 | }; |
| 143 | 143 | use rustc_middle::ty::TyCtxt; |
| 144 | use rustc_mir_dataflow::impls::MaybeLiveLocals; | |
| 145 | use rustc_mir_dataflow::points::{save_as_intervals, DenseLocationMap, PointIndex}; | |
| 146 | 144 | use rustc_mir_dataflow::Analysis; |
| 145 | use rustc_mir_dataflow::impls::MaybeLiveLocals; | |
| 146 | use rustc_mir_dataflow::points::{DenseLocationMap, PointIndex, save_as_intervals}; | |
| 147 | 147 | use tracing::{debug, trace}; |
| 148 | 148 | |
| 149 | 149 | pub(super) struct DestinationPropagation; |
compiler/rustc_mir_transform/src/dump_mir.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | use std::fs::File; |
| 4 | 4 | use std::io; |
| 5 | 5 | |
| 6 | use rustc_middle::mir::{write_mir_pretty, Body}; | |
| 6 | use rustc_middle::mir::{Body, write_mir_pretty}; | |
| 7 | 7 | use rustc_middle::ty::TyCtxt; |
| 8 | 8 | use rustc_session::config::{OutFileName, OutputType}; |
| 9 | 9 |
compiler/rustc_mir_transform/src/elaborate_drops.rs+3-3| ... | ... | @@ -1,17 +1,17 @@ |
| 1 | 1 | use std::fmt; |
| 2 | 2 | |
| 3 | use rustc_index::bit_set::BitSet; | |
| 4 | 3 | use rustc_index::IndexVec; |
| 4 | use rustc_index::bit_set::BitSet; | |
| 5 | 5 | use rustc_middle::mir::patch::MirPatch; |
| 6 | 6 | use rustc_middle::mir::*; |
| 7 | 7 | use rustc_middle::ty::{self, TyCtxt}; |
| 8 | 8 | use rustc_mir_dataflow::elaborate_drops::{ |
| 9 | elaborate_drop, DropElaborator, DropFlagMode, DropFlagState, DropStyle, Unwind, | |
| 9 | DropElaborator, DropFlagMode, DropFlagState, DropStyle, Unwind, elaborate_drop, | |
| 10 | 10 | }; |
| 11 | 11 | use rustc_mir_dataflow::impls::{MaybeInitializedPlaces, MaybeUninitializedPlaces}; |
| 12 | 12 | use rustc_mir_dataflow::move_paths::{LookupResult, MoveData, MovePathIndex}; |
| 13 | 13 | use rustc_mir_dataflow::{ |
| 14 | on_all_children_bits, on_lookup_result_bits, Analysis, MoveDataParamEnv, ResultsCursor, | |
| 14 | Analysis, MoveDataParamEnv, ResultsCursor, on_all_children_bits, on_lookup_result_bits, | |
| 15 | 15 | }; |
| 16 | 16 | use rustc_span::Span; |
| 17 | 17 | use rustc_target::abi::{FieldIdx, VariantIdx}; |
compiler/rustc_mir_transform/src/errors.rs+1-1| ... | ... | @@ -4,8 +4,8 @@ use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic}; |
| 4 | 4 | use rustc_middle::mir::AssertKind; |
| 5 | 5 | use rustc_middle::ty::TyCtxt; |
| 6 | 6 | use rustc_session::lint::{self, Lint}; |
| 7 | use rustc_span::def_id::DefId; | |
| 8 | 7 | use rustc_span::Span; |
| 8 | use rustc_span::def_id::DefId; | |
| 9 | 9 | |
| 10 | 10 | use crate::fluent_generated as fluent; |
| 11 | 11 |
compiler/rustc_mir_transform/src/ffi_unwind_calls.rs+6-8| ... | ... | @@ -1,11 +1,11 @@ |
| 1 | use rustc_hir::def_id::{LocalDefId, LOCAL_CRATE}; | |
| 1 | use rustc_hir::def_id::{LOCAL_CRATE, LocalDefId}; | |
| 2 | 2 | use rustc_middle::mir::*; |
| 3 | 3 | use rustc_middle::query::{LocalCrate, Providers}; |
| 4 | use rustc_middle::ty::{self, layout, TyCtxt}; | |
| 4 | use rustc_middle::ty::{self, TyCtxt, layout}; | |
| 5 | 5 | use rustc_middle::{bug, span_bug}; |
| 6 | 6 | use rustc_session::lint::builtin::FFI_UNWIND_CALLS; |
| 7 | use rustc_target::spec::abi::Abi; | |
| 8 | 7 | use rustc_target::spec::PanicStrategy; |
| 8 | use rustc_target::spec::abi::Abi; | |
| 9 | 9 | use tracing::debug; |
| 10 | 10 | |
| 11 | 11 | use crate::errors; |
| ... | ... | @@ -86,12 +86,10 @@ fn has_ffi_unwind_calls(tcx: TyCtxt<'_>, local_def_id: LocalDefId) -> bool { |
| 86 | 86 | let span = terminator.source_info.span; |
| 87 | 87 | |
| 88 | 88 | let foreign = fn_def_id.is_some(); |
| 89 | tcx.emit_node_span_lint( | |
| 90 | FFI_UNWIND_CALLS, | |
| 91 | lint_root, | |
| 89 | tcx.emit_node_span_lint(FFI_UNWIND_CALLS, lint_root, span, errors::FfiUnwindCall { | |
| 92 | 90 | span, |
| 93 | errors::FfiUnwindCall { span, foreign }, | |
| 94 | ); | |
| 91 | foreign, | |
| 92 | }); | |
| 95 | 93 | |
| 96 | 94 | tainted = true; |
| 97 | 95 | } |
compiler/rustc_mir_transform/src/function_item_references.rs+1-1| ... | ... | @@ -4,9 +4,9 @@ use rustc_middle::mir::visit::Visitor; |
| 4 | 4 | use rustc_middle::mir::*; |
| 5 | 5 | use rustc_middle::ty::{self, EarlyBinder, GenericArgsRef, Ty, TyCtxt}; |
| 6 | 6 | use rustc_session::lint::builtin::FUNCTION_ITEM_REFERENCES; |
| 7 | use rustc_span::Span; | |
| 7 | 8 | use rustc_span::source_map::Spanned; |
| 8 | 9 | use rustc_span::symbol::sym; |
| 9 | use rustc_span::Span; | |
| 10 | 10 | use rustc_target::spec::abi::Abi; |
| 11 | 11 | |
| 12 | 12 | use crate::errors; |
compiler/rustc_mir_transform/src/gvn.rs+6-6| ... | ... | @@ -87,23 +87,23 @@ use std::borrow::Cow; |
| 87 | 87 | use either::Either; |
| 88 | 88 | use rustc_const_eval::const_eval::DummyMachine; |
| 89 | 89 | use rustc_const_eval::interpret::{ |
| 90 | intern_const_alloc_for_constprop, ImmTy, Immediate, InterpCx, MemPlaceMeta, MemoryKind, OpTy, | |
| 91 | Projectable, Scalar, | |
| 90 | ImmTy, Immediate, InterpCx, MemPlaceMeta, MemoryKind, OpTy, Projectable, Scalar, | |
| 91 | intern_const_alloc_for_constprop, | |
| 92 | 92 | }; |
| 93 | 93 | use rustc_data_structures::fx::FxIndexSet; |
| 94 | 94 | use rustc_data_structures::graph::dominators::Dominators; |
| 95 | 95 | use rustc_hir::def::DefKind; |
| 96 | 96 | use rustc_index::bit_set::BitSet; |
| 97 | use rustc_index::{newtype_index, IndexVec}; | |
| 97 | use rustc_index::{IndexVec, newtype_index}; | |
| 98 | 98 | use rustc_middle::bug; |
| 99 | 99 | use rustc_middle::mir::interpret::GlobalAlloc; |
| 100 | 100 | use rustc_middle::mir::visit::*; |
| 101 | 101 | use rustc_middle::mir::*; |
| 102 | 102 | use rustc_middle::ty::layout::{HasParamEnv, LayoutOf}; |
| 103 | 103 | use rustc_middle::ty::{self, Ty, TyCtxt}; |
| 104 | use rustc_span::def_id::DefId; | |
| 105 | 104 | use rustc_span::DUMMY_SP; |
| 106 | use rustc_target::abi::{self, Abi, FieldIdx, Size, VariantIdx, FIRST_VARIANT}; | |
| 105 | use rustc_span::def_id::DefId; | |
| 106 | use rustc_target::abi::{self, Abi, FIRST_VARIANT, FieldIdx, Size, VariantIdx}; | |
| 107 | 107 | use smallvec::SmallVec; |
| 108 | 108 | use tracing::{debug, instrument, trace}; |
| 109 | 109 | |
| ... | ... | @@ -1333,8 +1333,8 @@ impl<'body, 'tcx> VnState<'body, 'tcx> { |
| 1333 | 1333 | to: Ty<'tcx>, |
| 1334 | 1334 | location: Location, |
| 1335 | 1335 | ) -> Option<VnIndex> { |
| 1336 | use rustc_middle::ty::adjustment::PointerCoercion::*; | |
| 1337 | 1336 | use CastKind::*; |
| 1337 | use rustc_middle::ty::adjustment::PointerCoercion::*; | |
| 1338 | 1338 | |
| 1339 | 1339 | let mut from = operand.ty(self.local_decls, self.tcx); |
| 1340 | 1340 | let mut value = self.simplify_operand(operand, location)?; |
compiler/rustc_mir_transform/src/inline.rs+5-8| ... | ... | @@ -6,8 +6,8 @@ use std::ops::{Range, RangeFrom}; |
| 6 | 6 | use rustc_attr::InlineAttr; |
| 7 | 7 | use rustc_hir::def::DefKind; |
| 8 | 8 | use rustc_hir::def_id::DefId; |
| 9 | use rustc_index::bit_set::BitSet; | |
| 10 | 9 | use rustc_index::Idx; |
| 10 | use rustc_index::bit_set::BitSet; | |
| 11 | 11 | use rustc_middle::bug; |
| 12 | 12 | use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs}; |
| 13 | 13 | use rustc_middle::mir::visit::*; |
| ... | ... | @@ -885,13 +885,10 @@ impl<'tcx> Inliner<'tcx> { |
| 885 | 885 | }); |
| 886 | 886 | |
| 887 | 887 | if let Some(block) = return_block { |
| 888 | caller_body[block].statements.insert( | |
| 889 | 0, | |
| 890 | Statement { | |
| 891 | source_info: callsite.source_info, | |
| 892 | kind: StatementKind::StorageDead(local), | |
| 893 | }, | |
| 894 | ); | |
| 888 | caller_body[block].statements.insert(0, Statement { | |
| 889 | source_info: callsite.source_info, | |
| 890 | kind: StatementKind::StorageDead(local), | |
| 891 | }); | |
| 895 | 892 | } |
| 896 | 893 | |
| 897 | 894 | local |
compiler/rustc_mir_transform/src/instsimplify.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ use rustc_hir::LangItem; |
| 5 | 5 | use rustc_middle::bug; |
| 6 | 6 | use rustc_middle::mir::*; |
| 7 | 7 | use rustc_middle::ty::layout::ValidityRequirement; |
| 8 | use rustc_middle::ty::{self, layout, GenericArgsRef, ParamEnv, Ty, TyCtxt}; | |
| 8 | use rustc_middle::ty::{self, GenericArgsRef, ParamEnv, Ty, TyCtxt, layout}; | |
| 9 | 9 | use rustc_span::sym; |
| 10 | 10 | use rustc_span::symbol::Symbol; |
| 11 | 11 | use rustc_target::spec::abi::Abi; |
compiler/rustc_mir_transform/src/jump_threading.rs+1-1| ... | ... | @@ -39,8 +39,8 @@ use rustc_arena::DroplessArena; |
| 39 | 39 | use rustc_const_eval::const_eval::DummyMachine; |
| 40 | 40 | use rustc_const_eval::interpret::{ImmTy, Immediate, InterpCx, OpTy, Projectable}; |
| 41 | 41 | use rustc_data_structures::fx::FxHashSet; |
| 42 | use rustc_index::bit_set::BitSet; | |
| 43 | 42 | use rustc_index::IndexVec; |
| 43 | use rustc_index::bit_set::BitSet; | |
| 44 | 44 | use rustc_middle::bug; |
| 45 | 45 | use rustc_middle::mir::interpret::Scalar; |
| 46 | 46 | use rustc_middle::mir::visit::Visitor; |
compiler/rustc_mir_transform/src/known_panics_lint.rs+7-8| ... | ... | @@ -6,13 +6,13 @@ use std::fmt::Debug; |
| 6 | 6 | |
| 7 | 7 | use rustc_const_eval::const_eval::DummyMachine; |
| 8 | 8 | use rustc_const_eval::interpret::{ |
| 9 | format_interp_error, ImmTy, InterpCx, InterpResult, Projectable, Scalar, | |
| 9 | ImmTy, InterpCx, InterpResult, Projectable, Scalar, format_interp_error, | |
| 10 | 10 | }; |
| 11 | 11 | use rustc_data_structures::fx::FxHashSet; |
| 12 | use rustc_hir::def::DefKind; | |
| 13 | 12 | use rustc_hir::HirId; |
| 14 | use rustc_index::bit_set::BitSet; | |
| 13 | use rustc_hir::def::DefKind; | |
| 15 | 14 | use rustc_index::IndexVec; |
| 15 | use rustc_index::bit_set::BitSet; | |
| 16 | 16 | use rustc_middle::bug; |
| 17 | 17 | use rustc_middle::mir::visit::{MutatingUseContext, NonMutatingUseContext, PlaceContext, Visitor}; |
| 18 | 18 | use rustc_middle::mir::*; |
| ... | ... | @@ -296,12 +296,11 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> { |
| 296 | 296 | let source_info = self.body.source_info(location); |
| 297 | 297 | if let Some(lint_root) = self.lint_root(*source_info) { |
| 298 | 298 | let span = source_info.span; |
| 299 | self.tcx.emit_node_span_lint( | |
| 300 | lint_kind.lint(), | |
| 301 | lint_root, | |
| 299 | self.tcx.emit_node_span_lint(lint_kind.lint(), lint_root, span, AssertLint { | |
| 302 | 300 | span, |
| 303 | AssertLint { span, assert_kind, lint_kind }, | |
| 304 | ); | |
| 301 | assert_kind, | |
| 302 | lint_kind, | |
| 303 | }); | |
| 305 | 304 | } |
| 306 | 305 | } |
| 307 | 306 |
compiler/rustc_mir_transform/src/lib.rs+3-3| ... | ... | @@ -26,14 +26,14 @@ use rustc_hir::def_id::LocalDefId; |
| 26 | 26 | use rustc_index::IndexVec; |
| 27 | 27 | use rustc_middle::mir::{ |
| 28 | 28 | AnalysisPhase, Body, CallSource, ClearCrossCrate, ConstOperand, ConstQualifs, LocalDecl, |
| 29 | MirPhase, Operand, Place, ProjectionElem, Promoted, RuntimePhase, Rvalue, SourceInfo, | |
| 30 | Statement, StatementKind, TerminatorKind, START_BLOCK, | |
| 29 | MirPhase, Operand, Place, ProjectionElem, Promoted, RuntimePhase, Rvalue, START_BLOCK, | |
| 30 | SourceInfo, Statement, StatementKind, TerminatorKind, | |
| 31 | 31 | }; |
| 32 | 32 | use rustc_middle::ty::{self, TyCtxt, TypeVisitableExt}; |
| 33 | 33 | use rustc_middle::util::Providers; |
| 34 | 34 | use rustc_middle::{bug, query, span_bug}; |
| 35 | 35 | use rustc_span::source_map::Spanned; |
| 36 | use rustc_span::{sym, DUMMY_SP}; | |
| 36 | use rustc_span::{DUMMY_SP, sym}; | |
| 37 | 37 | use rustc_trait_selection::traits; |
| 38 | 38 | use tracing::{debug, trace}; |
| 39 | 39 |
compiler/rustc_mir_transform/src/promote_consts.rs+10-14| ... | ... | @@ -15,7 +15,7 @@ use std::cell::Cell; |
| 15 | 15 | use std::{cmp, iter, mem}; |
| 16 | 16 | |
| 17 | 17 | use either::{Left, Right}; |
| 18 | use rustc_const_eval::check_consts::{qualifs, ConstCx}; | |
| 18 | use rustc_const_eval::check_consts::{ConstCx, qualifs}; | |
| 19 | 19 | use rustc_data_structures::fx::FxHashSet; |
| 20 | 20 | use rustc_hir as hir; |
| 21 | 21 | use rustc_index::{Idx, IndexSlice, IndexVec}; |
| ... | ... | @@ -23,8 +23,8 @@ use rustc_middle::mir::visit::{MutVisitor, MutatingUseContext, PlaceContext, Vis |
| 23 | 23 | use rustc_middle::mir::*; |
| 24 | 24 | use rustc_middle::ty::{self, GenericArgs, List, Ty, TyCtxt, TypeVisitableExt}; |
| 25 | 25 | use rustc_middle::{bug, mir, span_bug}; |
| 26 | use rustc_span::source_map::Spanned; | |
| 27 | 26 | use rustc_span::Span; |
| 27 | use rustc_span::source_map::Spanned; | |
| 28 | 28 | use tracing::{debug, instrument}; |
| 29 | 29 | |
| 30 | 30 | /// A `MirPass` for promotion. |
| ... | ... | @@ -912,23 +912,19 @@ impl<'a, 'tcx> Promoter<'a, 'tcx> { |
| 912 | 912 | self.extra_statements.push((loc, promoted_ref_statement)); |
| 913 | 913 | |
| 914 | 914 | ( |
| 915 | Rvalue::Ref( | |
| 916 | tcx.lifetimes.re_erased, | |
| 917 | *borrow_kind, | |
| 918 | Place { | |
| 919 | local: mem::replace(&mut place.local, promoted_ref), | |
| 920 | projection: List::empty(), | |
| 921 | }, | |
| 922 | ), | |
| 915 | Rvalue::Ref(tcx.lifetimes.re_erased, *borrow_kind, Place { | |
| 916 | local: mem::replace(&mut place.local, promoted_ref), | |
| 917 | projection: List::empty(), | |
| 918 | }), | |
| 923 | 919 | promoted_operand, |
| 924 | 920 | ) |
| 925 | 921 | }; |
| 926 | 922 | |
| 927 | 923 | assert_eq!(self.new_block(), START_BLOCK); |
| 928 | self.visit_rvalue( | |
| 929 | &mut rvalue, | |
| 930 | Location { block: START_BLOCK, statement_index: usize::MAX }, | |
| 931 | ); | |
| 924 | self.visit_rvalue(&mut rvalue, Location { | |
| 925 | block: START_BLOCK, | |
| 926 | statement_index: usize::MAX, | |
| 927 | }); | |
| 932 | 928 | |
| 933 | 929 | let span = self.promoted.span; |
| 934 | 930 | self.assign(RETURN_PLACE, rvalue, span); |
compiler/rustc_mir_transform/src/ref_prop.rs+2-2| ... | ... | @@ -1,15 +1,15 @@ |
| 1 | 1 | use std::borrow::Cow; |
| 2 | 2 | |
| 3 | 3 | use rustc_data_structures::fx::FxHashSet; |
| 4 | use rustc_index::bit_set::BitSet; | |
| 5 | 4 | use rustc_index::IndexVec; |
| 5 | use rustc_index::bit_set::BitSet; | |
| 6 | 6 | use rustc_middle::bug; |
| 7 | 7 | use rustc_middle::mir::visit::*; |
| 8 | 8 | use rustc_middle::mir::*; |
| 9 | 9 | use rustc_middle::ty::TyCtxt; |
| 10 | use rustc_mir_dataflow::Analysis; | |
| 10 | 11 | use rustc_mir_dataflow::impls::MaybeStorageDead; |
| 11 | 12 | use rustc_mir_dataflow::storage::always_storage_live_locals; |
| 12 | use rustc_mir_dataflow::Analysis; | |
| 13 | 13 | use tracing::{debug, instrument}; |
| 14 | 14 | |
| 15 | 15 | use crate::ssa::{SsaLocals, StorageLiveLocals}; |
compiler/rustc_mir_transform/src/remove_uninit_drops.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ use rustc_middle::mir::{Body, TerminatorKind}; |
| 3 | 3 | use rustc_middle::ty::{self, GenericArgsRef, ParamEnv, Ty, TyCtxt, VariantDef}; |
| 4 | 4 | use rustc_mir_dataflow::impls::MaybeInitializedPlaces; |
| 5 | 5 | use rustc_mir_dataflow::move_paths::{LookupResult, MoveData, MovePathIndex}; |
| 6 | use rustc_mir_dataflow::{move_path_children_matching, Analysis, MaybeReachable}; | |
| 6 | use rustc_mir_dataflow::{Analysis, MaybeReachable, move_path_children_matching}; | |
| 7 | 7 | use rustc_target::abi::FieldIdx; |
| 8 | 8 | |
| 9 | 9 | /// Removes `Drop` terminators whose target is known to be uninitialized at |
compiler/rustc_mir_transform/src/required_consts.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use rustc_middle::mir::visit::Visitor; |
| 2 | use rustc_middle::mir::{traversal, Body, ConstOperand, Location}; | |
| 2 | use rustc_middle::mir::{Body, ConstOperand, Location, traversal}; | |
| 3 | 3 | |
| 4 | 4 | pub(super) struct RequiredConstsVisitor<'tcx> { |
| 5 | 5 | required_consts: Vec<ConstOperand<'tcx>>, |
compiler/rustc_mir_transform/src/shim.rs+2-2| ... | ... | @@ -14,8 +14,8 @@ use rustc_middle::ty::{ |
| 14 | 14 | use rustc_middle::{bug, span_bug}; |
| 15 | 15 | use rustc_mir_dataflow::elaborate_drops::{self, DropElaborator, DropFlagMode, DropStyle}; |
| 16 | 16 | use rustc_span::source_map::Spanned; |
| 17 | use rustc_span::{Span, DUMMY_SP}; | |
| 18 | use rustc_target::abi::{FieldIdx, VariantIdx, FIRST_VARIANT}; | |
| 17 | use rustc_span::{DUMMY_SP, Span}; | |
| 18 | use rustc_target::abi::{FIRST_VARIANT, FieldIdx, VariantIdx}; | |
| 19 | 19 | use rustc_target::spec::abi::Abi; |
| 20 | 20 | use tracing::{debug, instrument}; |
| 21 | 21 |
compiler/rustc_mir_transform/src/shim/async_destructor_ctor.rs+15-17| ... | ... | @@ -8,8 +8,8 @@ use rustc_hir::lang_items::LangItem; |
| 8 | 8 | use rustc_index::{Idx, IndexVec}; |
| 9 | 9 | use rustc_middle::mir::{ |
| 10 | 10 | BasicBlock, BasicBlockData, Body, CallSource, CastKind, Const, ConstOperand, ConstValue, Local, |
| 11 | LocalDecl, MirSource, Operand, Place, PlaceElem, Rvalue, SourceInfo, Statement, StatementKind, | |
| 12 | Terminator, TerminatorKind, UnwindAction, UnwindTerminateReason, RETURN_PLACE, | |
| 11 | LocalDecl, MirSource, Operand, Place, PlaceElem, RETURN_PLACE, Rvalue, SourceInfo, Statement, | |
| 12 | StatementKind, Terminator, TerminatorKind, UnwindAction, UnwindTerminateReason, | |
| 13 | 13 | }; |
| 14 | 14 | use rustc_middle::ty::adjustment::PointerCoercion; |
| 15 | 15 | use rustc_middle::ty::util::{AsyncDropGlueMorphology, Discr}; |
| ... | ... | @@ -452,19 +452,17 @@ impl<'tcx> AsyncDestructorCtorShimBuilder<'tcx> { |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | fn combine_sync_surface(&mut self) -> Ty<'tcx> { |
| 455 | self.apply_combinator( | |
| 456 | 1, | |
| 457 | LangItem::AsyncDropSurfaceDropInPlace, | |
| 458 | &[self.self_ty.unwrap().into()], | |
| 459 | ) | |
| 455 | self.apply_combinator(1, LangItem::AsyncDropSurfaceDropInPlace, &[self | |
| 456 | .self_ty | |
| 457 | .unwrap() | |
| 458 | .into()]) | |
| 460 | 459 | } |
| 461 | 460 | |
| 462 | 461 | fn combine_deferred_drop_in_place(&mut self) -> Ty<'tcx> { |
| 463 | self.apply_combinator( | |
| 464 | 1, | |
| 465 | LangItem::AsyncDropDeferredDropInPlace, | |
| 466 | &[self.self_ty.unwrap().into()], | |
| 467 | ) | |
| 462 | self.apply_combinator(1, LangItem::AsyncDropDeferredDropInPlace, &[self | |
| 463 | .self_ty | |
| 464 | .unwrap() | |
| 465 | .into()]) | |
| 468 | 466 | } |
| 469 | 467 | |
| 470 | 468 | fn combine_fuse(&mut self, inner_future_ty: Ty<'tcx>) -> Ty<'tcx> { |
| ... | ... | @@ -484,11 +482,11 @@ impl<'tcx> AsyncDestructorCtorShimBuilder<'tcx> { |
| 484 | 482 | } |
| 485 | 483 | |
| 486 | 484 | fn combine_either(&mut self, other: Ty<'tcx>, matched: Ty<'tcx>) -> Ty<'tcx> { |
| 487 | self.apply_combinator( | |
| 488 | 4, | |
| 489 | LangItem::AsyncDropEither, | |
| 490 | &[other.into(), matched.into(), self.self_ty.unwrap().into()], | |
| 491 | ) | |
| 485 | self.apply_combinator(4, LangItem::AsyncDropEither, &[ | |
| 486 | other.into(), | |
| 487 | matched.into(), | |
| 488 | self.self_ty.unwrap().into(), | |
| 489 | ]) | |
| 492 | 490 | } |
| 493 | 491 | |
| 494 | 492 | fn return_(mut self) -> Body<'tcx> { |
compiler/rustc_mir_transform/src/simplify_comparison_integral.rs+4-7| ... | ... | @@ -113,13 +113,10 @@ impl<'tcx> crate::MirPass<'tcx> for SimplifyComparisonIntegral { |
| 113 | 113 | // if we have StorageDeads to remove then make sure to insert them at the top of |
| 114 | 114 | // each target |
| 115 | 115 | for bb_idx in new_targets.all_targets() { |
| 116 | storage_deads_to_insert.push(( | |
| 117 | *bb_idx, | |
| 118 | Statement { | |
| 119 | source_info: terminator.source_info, | |
| 120 | kind: StatementKind::StorageDead(opt.to_switch_on.local), | |
| 121 | }, | |
| 122 | )); | |
| 116 | storage_deads_to_insert.push((*bb_idx, Statement { | |
| 117 | source_info: terminator.source_info, | |
| 118 | kind: StatementKind::StorageDead(opt.to_switch_on.local), | |
| 119 | })); | |
| 123 | 120 | } |
| 124 | 121 | } |
| 125 | 122 |
compiler/rustc_mir_transform/src/single_use_consts.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | use rustc_index::bit_set::BitSet; | |
| 2 | 1 | use rustc_index::IndexVec; |
| 2 | use rustc_index::bit_set::BitSet; | |
| 3 | 3 | use rustc_middle::bug; |
| 4 | 4 | use rustc_middle::mir::visit::{MutVisitor, PlaceContext, Visitor}; |
| 5 | 5 | use rustc_middle::mir::*; |
compiler/rustc_mir_transform/src/sroa.rs+2-2| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | 1 | use rustc_data_structures::flat_map_in_place::FlatMapInPlace; |
| 2 | 2 | use rustc_hir::LangItem; |
| 3 | use rustc_index::bit_set::{BitSet, GrowableBitSet}; | |
| 4 | 3 | use rustc_index::IndexVec; |
| 4 | use rustc_index::bit_set::{BitSet, GrowableBitSet}; | |
| 5 | 5 | use rustc_middle::bug; |
| 6 | 6 | use rustc_middle::mir::patch::MirPatch; |
| 7 | 7 | use rustc_middle::mir::visit::*; |
| 8 | 8 | use rustc_middle::mir::*; |
| 9 | 9 | use rustc_middle::ty::{self, Ty, TyCtxt}; |
| 10 | 10 | use rustc_mir_dataflow::value_analysis::{excluded_locals, iter_fields}; |
| 11 | use rustc_target::abi::{FieldIdx, FIRST_VARIANT}; | |
| 11 | use rustc_target::abi::{FIRST_VARIANT, FieldIdx}; | |
| 12 | 12 | use tracing::{debug, instrument}; |
| 13 | 13 | |
| 14 | 14 | pub(super) struct ScalarReplacementOfAggregates; |
compiler/rustc_mir_transform/src/ssa.rs+4-5| ... | ... | @@ -159,11 +159,10 @@ impl SsaLocals { |
| 159 | 159 | ) { |
| 160 | 160 | for &local in &self.assignment_order { |
| 161 | 161 | match self.assignments[local] { |
| 162 | Set1::One(DefLocation::Argument) => f( | |
| 163 | local, | |
| 164 | AssignedValue::Arg, | |
| 165 | Location { block: START_BLOCK, statement_index: 0 }, | |
| 166 | ), | |
| 162 | Set1::One(DefLocation::Argument) => f(local, AssignedValue::Arg, Location { | |
| 163 | block: START_BLOCK, | |
| 164 | statement_index: 0, | |
| 165 | }), | |
| 167 | 166 | Set1::One(DefLocation::Assignment(loc)) => { |
| 168 | 167 | let bb = &mut basic_blocks[loc.block]; |
| 169 | 168 | // `loc` must point to a direct assignment to `local`. |
compiler/rustc_mir_transform/src/validate.rs+2-2| ... | ... | @@ -2,8 +2,8 @@ |
| 2 | 2 | |
| 3 | 3 | use rustc_data_structures::fx::{FxHashMap, FxHashSet}; |
| 4 | 4 | use rustc_hir::LangItem; |
| 5 | use rustc_index::bit_set::BitSet; | |
| 6 | 5 | use rustc_index::IndexVec; |
| 6 | use rustc_index::bit_set::BitSet; | |
| 7 | 7 | use rustc_infer::traits::Reveal; |
| 8 | 8 | use rustc_middle::mir::coverage::CoverageKind; |
| 9 | 9 | use rustc_middle::mir::visit::{NonUseContext, PlaceContext, Visitor}; |
| ... | ... | @@ -14,7 +14,7 @@ use rustc_middle::ty::{ |
| 14 | 14 | Variance, |
| 15 | 15 | }; |
| 16 | 16 | use rustc_middle::{bug, span_bug}; |
| 17 | use rustc_target::abi::{Size, FIRST_VARIANT}; | |
| 17 | use rustc_target::abi::{FIRST_VARIANT, Size}; | |
| 18 | 18 | use rustc_target::spec::abi::Abi; |
| 19 | 19 | |
| 20 | 20 | use crate::util::{is_within_packed, relate_types}; |
compiler/rustc_monomorphize/src/collector.rs+6-6| ... | ... | @@ -210,7 +210,7 @@ mod move_check; |
| 210 | 210 | use std::path::PathBuf; |
| 211 | 211 | |
| 212 | 212 | use move_check::MoveCheckState; |
| 213 | use rustc_data_structures::sync::{par_for_each_in, LRef, MTLock}; | |
| 213 | use rustc_data_structures::sync::{LRef, MTLock, par_for_each_in}; | |
| 214 | 214 | use rustc_data_structures::unord::{UnordMap, UnordSet}; |
| 215 | 215 | use rustc_hir as hir; |
| 216 | 216 | use rustc_hir::def::DefKind; |
| ... | ... | @@ -220,7 +220,7 @@ use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; |
| 220 | 220 | use rustc_middle::mir::interpret::{AllocId, ErrorHandled, GlobalAlloc, Scalar}; |
| 221 | 221 | use rustc_middle::mir::mono::{InstantiationMode, MonoItem}; |
| 222 | 222 | use rustc_middle::mir::visit::Visitor as MirVisitor; |
| 223 | use rustc_middle::mir::{self, traversal, Location, MentionedItem}; | |
| 223 | use rustc_middle::mir::{self, Location, MentionedItem, traversal}; | |
| 224 | 224 | use rustc_middle::query::TyCtxtAt; |
| 225 | 225 | use rustc_middle::ty::adjustment::{CustomCoerceUnsized, PointerCoercion}; |
| 226 | 226 | use rustc_middle::ty::layout::ValidityRequirement; |
| ... | ... | @@ -231,11 +231,11 @@ use rustc_middle::ty::{ |
| 231 | 231 | }; |
| 232 | 232 | use rustc_middle::util::Providers; |
| 233 | 233 | use rustc_middle::{bug, span_bug}; |
| 234 | use rustc_session::config::EntryFnType; | |
| 235 | 234 | use rustc_session::Limit; |
| 236 | use rustc_span::source_map::{dummy_spanned, respan, Spanned}; | |
| 237 | use rustc_span::symbol::{sym, Ident}; | |
| 238 | use rustc_span::{Span, DUMMY_SP}; | |
| 235 | use rustc_session::config::EntryFnType; | |
| 236 | use rustc_span::source_map::{Spanned, dummy_spanned, respan}; | |
| 237 | use rustc_span::symbol::{Ident, sym}; | |
| 238 | use rustc_span::{DUMMY_SP, Span}; | |
| 239 | 239 | use rustc_target::abi::Size; |
| 240 | 240 | use tracing::{debug, instrument, trace}; |
| 241 | 241 |
compiler/rustc_monomorphize/src/collector/move_check.rs+4-5| ... | ... | @@ -132,12 +132,11 @@ impl<'a, 'tcx> MirUsedCollector<'a, 'tcx> { |
| 132 | 132 | // but correct span? This would make the lint at least accept crate-level lint attributes. |
| 133 | 133 | return; |
| 134 | 134 | }; |
| 135 | self.tcx.emit_node_span_lint( | |
| 136 | LARGE_ASSIGNMENTS, | |
| 137 | lint_root, | |
| 135 | self.tcx.emit_node_span_lint(LARGE_ASSIGNMENTS, lint_root, span, LargeAssignmentsLint { | |
| 138 | 136 | span, |
| 139 | LargeAssignmentsLint { span, size: too_large_size.bytes(), limit: limit as u64 }, | |
| 140 | ); | |
| 137 | size: too_large_size.bytes(), | |
| 138 | limit: limit as u64, | |
| 139 | }); | |
| 141 | 140 | self.move_check.move_size_spans.push(span); |
| 142 | 141 | } |
| 143 | 142 | } |
compiler/rustc_monomorphize/src/partitioning.rs+8-4| ... | ... | @@ -101,10 +101,10 @@ use std::path::{Path, PathBuf}; |
| 101 | 101 | use rustc_data_structures::fx::{FxIndexMap, FxIndexSet}; |
| 102 | 102 | use rustc_data_structures::sync; |
| 103 | 103 | use rustc_data_structures::unord::{UnordMap, UnordSet}; |
| 104 | use rustc_hir::LangItem; | |
| 104 | 105 | use rustc_hir::def::DefKind; |
| 105 | 106 | use rustc_hir::def_id::{DefId, DefIdSet, LOCAL_CRATE}; |
| 106 | 107 | use rustc_hir::definitions::DefPathDataName; |
| 107 | use rustc_hir::LangItem; | |
| 108 | 108 | use rustc_middle::bug; |
| 109 | 109 | use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags; |
| 110 | 110 | use rustc_middle::middle::exported_symbols::{SymbolExportInfo, SymbolExportLevel}; |
| ... | ... | @@ -116,8 +116,8 @@ use rustc_middle::ty::print::{characteristic_def_id_of_type, with_no_trimmed_pat |
| 116 | 116 | use rustc_middle::ty::visit::TypeVisitableExt; |
| 117 | 117 | use rustc_middle::ty::{self, InstanceKind, TyCtxt}; |
| 118 | 118 | use rustc_middle::util::Providers; |
| 119 | use rustc_session::config::{DumpMonoStatsFormat, SwitchWithOptPath}; | |
| 120 | 119 | use rustc_session::CodegenUnits; |
| 120 | use rustc_session::config::{DumpMonoStatsFormat, SwitchWithOptPath}; | |
| 121 | 121 | use rustc_span::symbol::Symbol; |
| 122 | 122 | use tracing::debug; |
| 123 | 123 | |
| ... | ... | @@ -255,8 +255,12 @@ where |
| 255 | 255 | } |
| 256 | 256 | let size_estimate = mono_item.size_estimate(cx.tcx); |
| 257 | 257 | |
| 258 | cgu.items_mut() | |
| 259 | .insert(mono_item, MonoItemData { inlined: false, linkage, visibility, size_estimate }); | |
| 258 | cgu.items_mut().insert(mono_item, MonoItemData { | |
| 259 | inlined: false, | |
| 260 | linkage, | |
| 261 | visibility, | |
| 262 | size_estimate, | |
| 263 | }); | |
| 260 | 264 | |
| 261 | 265 | // Get all inlined items that are reachable from `mono_item` without |
| 262 | 266 | // going via another root item. This includes drop-glue, functions from |
compiler/rustc_monomorphize/src/polymorphize.rs+1-1| ... | ... | @@ -5,9 +5,9 @@ |
| 5 | 5 | //! generic parameters are unused (and eventually, in what ways generic parameters are used - only |
| 6 | 6 | //! for their size, offset of a field, etc.). |
| 7 | 7 | |
| 8 | use rustc_hir::ConstContext; | |
| 8 | 9 | use rustc_hir::def::DefKind; |
| 9 | 10 | use rustc_hir::def_id::DefId; |
| 10 | use rustc_hir::ConstContext; | |
| 11 | 11 | use rustc_middle::mir::visit::{TyContext, Visitor}; |
| 12 | 12 | use rustc_middle::mir::{self, Local, LocalDecl, Location}; |
| 13 | 13 | use rustc_middle::query::Providers; |
compiler/rustc_next_trait_solver/src/solve/assembly/mod.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ use rustc_type_ir::fold::TypeFoldable; |
| 7 | 7 | use rustc_type_ir::inherent::*; |
| 8 | 8 | use rustc_type_ir::lang_items::TraitSolverLangItem; |
| 9 | 9 | use rustc_type_ir::visit::TypeVisitableExt as _; |
| 10 | use rustc_type_ir::{self as ty, elaborate, Interner, Upcast as _}; | |
| 10 | use rustc_type_ir::{self as ty, Interner, Upcast as _, elaborate}; | |
| 11 | 11 | use tracing::{debug, instrument}; |
| 12 | 12 | |
| 13 | 13 | use crate::delegate::SolverDelegate; |
compiler/rustc_next_trait_solver/src/solve/assembly/structural_traits.rs+13-18| ... | ... | @@ -7,7 +7,7 @@ use rustc_type_ir::data_structures::HashMap; |
| 7 | 7 | use rustc_type_ir::fold::{TypeFoldable, TypeFolder, TypeSuperFoldable}; |
| 8 | 8 | use rustc_type_ir::inherent::*; |
| 9 | 9 | use rustc_type_ir::lang_items::TraitSolverLangItem; |
| 10 | use rustc_type_ir::{self as ty, elaborate, Interner, Upcast as _}; | |
| 10 | use rustc_type_ir::{self as ty, Interner, Upcast as _, elaborate}; | |
| 11 | 11 | use rustc_type_ir_macros::{TypeFoldable_Generic, TypeVisitable_Generic}; |
| 12 | 12 | use tracing::instrument; |
| 13 | 13 | |
| ... | ... | @@ -507,11 +507,10 @@ pub(in crate::solve) fn extract_tupled_inputs_and_output_from_async_callable<I: |
| 507 | 507 | // will project to the right upvars for the generator, appending the inputs and |
| 508 | 508 | // coroutine upvars respecting the closure kind. |
| 509 | 509 | nested.push( |
| 510 | ty::TraitRef::new( | |
| 511 | cx, | |
| 512 | async_fn_kind_trait_def_id, | |
| 513 | [kind_ty, Ty::from_closure_kind(cx, goal_kind)], | |
| 514 | ) | |
| 510 | ty::TraitRef::new(cx, async_fn_kind_trait_def_id, [ | |
| 511 | kind_ty, | |
| 512 | Ty::from_closure_kind(cx, goal_kind), | |
| 513 | ]) | |
| 515 | 514 | .upcast(cx), |
| 516 | 515 | ); |
| 517 | 516 | } |
| ... | ... | @@ -617,18 +616,14 @@ fn coroutine_closure_to_ambiguous_coroutine<I: Interner>( |
| 617 | 616 | sig: ty::CoroutineClosureSignature<I>, |
| 618 | 617 | ) -> I::Ty { |
| 619 | 618 | let upvars_projection_def_id = cx.require_lang_item(TraitSolverLangItem::AsyncFnKindUpvars); |
| 620 | let tupled_upvars_ty = Ty::new_projection( | |
| 621 | cx, | |
| 622 | upvars_projection_def_id, | |
| 623 | [ | |
| 624 | I::GenericArg::from(args.kind_ty()), | |
| 625 | Ty::from_closure_kind(cx, goal_kind).into(), | |
| 626 | goal_region.into(), | |
| 627 | sig.tupled_inputs_ty.into(), | |
| 628 | args.tupled_upvars_ty().into(), | |
| 629 | args.coroutine_captures_by_ref_ty().into(), | |
| 630 | ], | |
| 631 | ); | |
| 619 | let tupled_upvars_ty = Ty::new_projection(cx, upvars_projection_def_id, [ | |
| 620 | I::GenericArg::from(args.kind_ty()), | |
| 621 | Ty::from_closure_kind(cx, goal_kind).into(), | |
| 622 | goal_region.into(), | |
| 623 | sig.tupled_inputs_ty.into(), | |
| 624 | args.tupled_upvars_ty().into(), | |
| 625 | args.coroutine_captures_by_ref_ty().into(), | |
| 626 | ]); | |
| 632 | 627 | sig.to_coroutine( |
| 633 | 628 | cx, |
| 634 | 629 | args.parent_args(), |
compiler/rustc_next_trait_solver/src/solve/eval_ctxt/canonical.rs+3-3| ... | ... | @@ -22,9 +22,9 @@ use crate::delegate::SolverDelegate; |
| 22 | 22 | use crate::resolve::EagerResolver; |
| 23 | 23 | use crate::solve::eval_ctxt::NestedGoals; |
| 24 | 24 | use crate::solve::{ |
| 25 | inspect, response_no_constraints_raw, CanonicalInput, CanonicalResponse, Certainty, EvalCtxt, | |
| 26 | ExternalConstraintsData, Goal, MaybeCause, NestedNormalizationGoals, NoSolution, | |
| 27 | PredefinedOpaquesData, QueryInput, QueryResult, Response, | |
| 25 | CanonicalInput, CanonicalResponse, Certainty, EvalCtxt, ExternalConstraintsData, Goal, | |
| 26 | MaybeCause, NestedNormalizationGoals, NoSolution, PredefinedOpaquesData, QueryInput, | |
| 27 | QueryResult, Response, inspect, response_no_constraints_raw, | |
| 28 | 28 | }; |
| 29 | 29 | |
| 30 | 30 | trait ResponseT<I: Interner> { |
compiler/rustc_next_trait_solver/src/solve/eval_ctxt/mod.rs+7-7| ... | ... | @@ -17,9 +17,9 @@ use crate::delegate::SolverDelegate; |
| 17 | 17 | use crate::solve::inspect::{self, ProofTreeBuilder}; |
| 18 | 18 | use crate::solve::search_graph::SearchGraph; |
| 19 | 19 | use crate::solve::{ |
| 20 | CanonicalInput, CanonicalResponse, Certainty, Goal, GoalEvaluationKind, GoalSource, | |
| 21 | NestedNormalizationGoals, NoSolution, PredefinedOpaquesData, QueryResult, SolverMode, | |
| 22 | FIXPOINT_STEP_LIMIT, | |
| 20 | CanonicalInput, CanonicalResponse, Certainty, FIXPOINT_STEP_LIMIT, Goal, GoalEvaluationKind, | |
| 21 | GoalSource, NestedNormalizationGoals, NoSolution, PredefinedOpaquesData, QueryResult, | |
| 22 | SolverMode, | |
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | 25 | pub(super) mod canonical; |
| ... | ... | @@ -497,10 +497,10 @@ where |
| 497 | 497 | // Replace the goal with an unconstrained infer var, so the |
| 498 | 498 | // RHS does not affect projection candidate assembly. |
| 499 | 499 | let unconstrained_rhs = self.next_term_infer_of_kind(goal.predicate.term); |
| 500 | let unconstrained_goal = goal.with( | |
| 501 | cx, | |
| 502 | ty::NormalizesTo { alias: goal.predicate.alias, term: unconstrained_rhs }, | |
| 503 | ); | |
| 500 | let unconstrained_goal = goal.with(cx, ty::NormalizesTo { | |
| 501 | alias: goal.predicate.alias, | |
| 502 | term: unconstrained_rhs, | |
| 503 | }); | |
| 504 | 504 | |
| 505 | 505 | let (NestedNormalizationGoals(nested_goals), _, certainty) = self.evaluate_goal_raw( |
| 506 | 506 | GoalEvaluationKind::Nested, |
compiler/rustc_next_trait_solver/src/solve/eval_ctxt/probe.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ use tracing::instrument; |
| 6 | 6 | use crate::delegate::SolverDelegate; |
| 7 | 7 | use crate::solve::assembly::Candidate; |
| 8 | 8 | use crate::solve::{ |
| 9 | inspect, BuiltinImplSource, CandidateSource, EvalCtxt, NoSolution, QueryResult, | |
| 9 | BuiltinImplSource, CandidateSource, EvalCtxt, NoSolution, QueryResult, inspect, | |
| 10 | 10 | }; |
| 11 | 11 | |
| 12 | 12 | pub(in crate::solve) struct ProbeCtxt<'me, 'a, D, I, F, T> |
compiler/rustc_next_trait_solver/src/solve/inspect/build.rs+2-2| ... | ... | @@ -13,8 +13,8 @@ use rustc_type_ir::{self as ty, Interner}; |
| 13 | 13 | use crate::delegate::SolverDelegate; |
| 14 | 14 | use crate::solve::eval_ctxt::canonical; |
| 15 | 15 | use crate::solve::{ |
| 16 | inspect, CanonicalInput, Certainty, GenerateProofTree, Goal, GoalEvaluationKind, GoalSource, | |
| 17 | QueryInput, QueryResult, | |
| 16 | CanonicalInput, Certainty, GenerateProofTree, Goal, GoalEvaluationKind, GoalSource, QueryInput, | |
| 17 | QueryResult, inspect, | |
| 18 | 18 | }; |
| 19 | 19 | |
| 20 | 20 | /// The core data structure when building proof trees. |
compiler/rustc_next_trait_solver/src/solve/normalizes_to/mod.rs+25-37| ... | ... | @@ -340,11 +340,10 @@ where |
| 340 | 340 | |
| 341 | 341 | let pred = tupled_inputs_and_output |
| 342 | 342 | .map_bound(|(inputs, output)| ty::ProjectionPredicate { |
| 343 | projection_term: ty::AliasTerm::new( | |
| 344 | cx, | |
| 345 | goal.predicate.def_id(), | |
| 346 | [goal.predicate.self_ty(), inputs], | |
| 347 | ), | |
| 343 | projection_term: ty::AliasTerm::new(cx, goal.predicate.def_id(), [ | |
| 344 | goal.predicate.self_ty(), | |
| 345 | inputs, | |
| 346 | ]), | |
| 348 | 347 | term: output.into(), |
| 349 | 348 | }) |
| 350 | 349 | .upcast(cx); |
| ... | ... | @@ -396,26 +395,21 @@ where |
| 396 | 395 | .is_lang_item(goal.predicate.def_id(), TraitSolverLangItem::CallOnceFuture) |
| 397 | 396 | { |
| 398 | 397 | ( |
| 399 | ty::AliasTerm::new( | |
| 400 | cx, | |
| 401 | goal.predicate.def_id(), | |
| 402 | [goal.predicate.self_ty(), tupled_inputs_ty], | |
| 403 | ), | |
| 398 | ty::AliasTerm::new(cx, goal.predicate.def_id(), [ | |
| 399 | goal.predicate.self_ty(), | |
| 400 | tupled_inputs_ty, | |
| 401 | ]), | |
| 404 | 402 | output_coroutine_ty.into(), |
| 405 | 403 | ) |
| 406 | 404 | } else if cx |
| 407 | 405 | .is_lang_item(goal.predicate.def_id(), TraitSolverLangItem::CallRefFuture) |
| 408 | 406 | { |
| 409 | 407 | ( |
| 410 | ty::AliasTerm::new( | |
| 411 | cx, | |
| 412 | goal.predicate.def_id(), | |
| 413 | [ | |
| 414 | I::GenericArg::from(goal.predicate.self_ty()), | |
| 415 | tupled_inputs_ty.into(), | |
| 416 | env_region.into(), | |
| 417 | ], | |
| 418 | ), | |
| 408 | ty::AliasTerm::new(cx, goal.predicate.def_id(), [ | |
| 409 | I::GenericArg::from(goal.predicate.self_ty()), | |
| 410 | tupled_inputs_ty.into(), | |
| 411 | env_region.into(), | |
| 412 | ]), | |
| 419 | 413 | output_coroutine_ty.into(), |
| 420 | 414 | ) |
| 421 | 415 | } else if cx.is_lang_item( |
| ... | ... | @@ -423,14 +417,10 @@ where |
| 423 | 417 | TraitSolverLangItem::AsyncFnOnceOutput, |
| 424 | 418 | ) { |
| 425 | 419 | ( |
| 426 | ty::AliasTerm::new( | |
| 427 | cx, | |
| 428 | goal.predicate.def_id(), | |
| 429 | [ | |
| 430 | I::GenericArg::from(goal.predicate.self_ty()), | |
| 431 | tupled_inputs_ty.into(), | |
| 432 | ], | |
| 433 | ), | |
| 420 | ty::AliasTerm::new(cx, goal.predicate.def_id(), [ | |
| 421 | I::GenericArg::from(goal.predicate.self_ty()), | |
| 422 | tupled_inputs_ty.into(), | |
| 423 | ]), | |
| 434 | 424 | coroutine_return_ty.into(), |
| 435 | 425 | ) |
| 436 | 426 | } else { |
| ... | ... | @@ -556,11 +546,10 @@ where |
| 556 | 546 | // and opaque types: If the `self_ty` is `Sized`, then the metadata is `()`. |
| 557 | 547 | // FIXME(ptr_metadata): This impl overlaps with the other impls and shouldn't |
| 558 | 548 | // exist. Instead, `Pointee<Metadata = ()>` should be a supertrait of `Sized`. |
| 559 | let sized_predicate = ty::TraitRef::new( | |
| 560 | cx, | |
| 561 | cx.require_lang_item(TraitSolverLangItem::Sized), | |
| 562 | [I::GenericArg::from(goal.predicate.self_ty())], | |
| 563 | ); | |
| 549 | let sized_predicate = | |
| 550 | ty::TraitRef::new(cx, cx.require_lang_item(TraitSolverLangItem::Sized), [ | |
| 551 | I::GenericArg::from(goal.predicate.self_ty()), | |
| 552 | ]); | |
| 564 | 553 | // FIXME(-Znext-solver=coinductive): Should this be `GoalSource::ImplWhereBound`? |
| 565 | 554 | ecx.add_goal(GoalSource::Misc, goal.with(cx, sized_predicate)); |
| 566 | 555 | Ty::new_unit(cx) |
| ... | ... | @@ -731,11 +720,10 @@ where |
| 731 | 720 | CandidateSource::BuiltinImpl(BuiltinImplSource::Misc), |
| 732 | 721 | goal, |
| 733 | 722 | ty::ProjectionPredicate { |
| 734 | projection_term: ty::AliasTerm::new( | |
| 735 | ecx.cx(), | |
| 736 | goal.predicate.def_id(), | |
| 737 | [self_ty, coroutine.resume_ty()], | |
| 738 | ), | |
| 723 | projection_term: ty::AliasTerm::new(ecx.cx(), goal.predicate.def_id(), [ | |
| 724 | self_ty, | |
| 725 | coroutine.resume_ty(), | |
| 726 | ]), | |
| 739 | 727 | term, |
| 740 | 728 | } |
| 741 | 729 | .upcast(cx), |
compiler/rustc_next_trait_solver/src/solve/search_graph.rs+2-2| ... | ... | @@ -1,13 +1,13 @@ |
| 1 | 1 | use std::convert::Infallible; |
| 2 | 2 | use std::marker::PhantomData; |
| 3 | 3 | |
| 4 | use rustc_type_ir::Interner; | |
| 4 | 5 | use rustc_type_ir::inherent::*; |
| 5 | 6 | use rustc_type_ir::search_graph::{self, PathKind}; |
| 6 | 7 | use rustc_type_ir::solve::{CanonicalInput, Certainty, QueryResult}; |
| 7 | use rustc_type_ir::Interner; | |
| 8 | 8 | |
| 9 | 9 | use super::inspect::ProofTreeBuilder; |
| 10 | use super::{has_no_inference_or_external_constraints, FIXPOINT_STEP_LIMIT}; | |
| 10 | use super::{FIXPOINT_STEP_LIMIT, has_no_inference_or_external_constraints}; | |
| 11 | 11 | use crate::delegate::SolverDelegate; |
| 12 | 12 | |
| 13 | 13 | /// This type is never constructed. We only use it to implement `search_graph::Delegate` |
compiler/rustc_next_trait_solver/src/solve/trait_goals.rs+14-21| ... | ... | @@ -6,7 +6,7 @@ use rustc_type_ir::fast_reject::DeepRejectCtxt; |
| 6 | 6 | use rustc_type_ir::inherent::*; |
| 7 | 7 | use rustc_type_ir::lang_items::TraitSolverLangItem; |
| 8 | 8 | use rustc_type_ir::visit::TypeVisitableExt as _; |
| 9 | use rustc_type_ir::{self as ty, elaborate, Interner, TraitPredicate, Upcast as _}; | |
| 9 | use rustc_type_ir::{self as ty, Interner, TraitPredicate, Upcast as _, elaborate}; | |
| 10 | 10 | use tracing::{instrument, trace}; |
| 11 | 11 | |
| 12 | 12 | use crate::delegate::SolverDelegate; |
| ... | ... | @@ -359,21 +359,18 @@ where |
| 359 | 359 | )?; |
| 360 | 360 | let output_is_sized_pred = tupled_inputs_and_output_and_coroutine.map_bound( |
| 361 | 361 | |AsyncCallableRelevantTypes { output_coroutine_ty, .. }| { |
| 362 | ty::TraitRef::new( | |
| 363 | cx, | |
| 364 | cx.require_lang_item(TraitSolverLangItem::Sized), | |
| 365 | [output_coroutine_ty], | |
| 366 | ) | |
| 362 | ty::TraitRef::new(cx, cx.require_lang_item(TraitSolverLangItem::Sized), [ | |
| 363 | output_coroutine_ty, | |
| 364 | ]) | |
| 367 | 365 | }, |
| 368 | 366 | ); |
| 369 | 367 | |
| 370 | 368 | let pred = tupled_inputs_and_output_and_coroutine |
| 371 | 369 | .map_bound(|AsyncCallableRelevantTypes { tupled_inputs_ty, .. }| { |
| 372 | ty::TraitRef::new( | |
| 373 | cx, | |
| 374 | goal.predicate.def_id(), | |
| 375 | [goal.predicate.self_ty(), tupled_inputs_ty], | |
| 376 | ) | |
| 370 | ty::TraitRef::new(cx, goal.predicate.def_id(), [ | |
| 371 | goal.predicate.self_ty(), | |
| 372 | tupled_inputs_ty, | |
| 373 | ]) | |
| 377 | 374 | }) |
| 378 | 375 | .upcast(cx); |
| 379 | 376 | // A built-in `AsyncFn` impl only holds if the output is sized. |
| ... | ... | @@ -1027,11 +1024,9 @@ where |
| 1027 | 1024 | GoalSource::ImplWhereBound, |
| 1028 | 1025 | goal.with( |
| 1029 | 1026 | cx, |
| 1030 | ty::TraitRef::new( | |
| 1031 | cx, | |
| 1032 | cx.require_lang_item(TraitSolverLangItem::Unsize), | |
| 1033 | [a_tail_ty, b_tail_ty], | |
| 1034 | ), | |
| 1027 | ty::TraitRef::new(cx, cx.require_lang_item(TraitSolverLangItem::Unsize), [ | |
| 1028 | a_tail_ty, b_tail_ty, | |
| 1029 | ]), | |
| 1035 | 1030 | ), |
| 1036 | 1031 | ); |
| 1037 | 1032 | self.probe_builtin_trait_candidate(BuiltinImplSource::Misc) |
| ... | ... | @@ -1069,11 +1064,9 @@ where |
| 1069 | 1064 | GoalSource::ImplWhereBound, |
| 1070 | 1065 | goal.with( |
| 1071 | 1066 | cx, |
| 1072 | ty::TraitRef::new( | |
| 1073 | cx, | |
| 1074 | cx.require_lang_item(TraitSolverLangItem::Unsize), | |
| 1075 | [a_last_ty, b_last_ty], | |
| 1076 | ), | |
| 1067 | ty::TraitRef::new(cx, cx.require_lang_item(TraitSolverLangItem::Unsize), [ | |
| 1068 | a_last_ty, b_last_ty, | |
| 1069 | ]), | |
| 1077 | 1070 | ), |
| 1078 | 1071 | ); |
| 1079 | 1072 | self.probe_builtin_trait_candidate(BuiltinImplSource::TupleUnsizing) |
compiler/rustc_parse/src/errors.rs+24-36| ... | ... | @@ -1116,25 +1116,19 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for ExpectedIdentifier { |
| 1116 | 1116 | fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> { |
| 1117 | 1117 | let token_descr = TokenDescription::from_token(&self.token); |
| 1118 | 1118 | |
| 1119 | let mut diag = Diag::new( | |
| 1120 | dcx, | |
| 1121 | level, | |
| 1122 | match token_descr { | |
| 1123 | Some(TokenDescription::ReservedIdentifier) => { | |
| 1124 | fluent::parse_expected_identifier_found_reserved_identifier_str | |
| 1125 | } | |
| 1126 | Some(TokenDescription::Keyword) => { | |
| 1127 | fluent::parse_expected_identifier_found_keyword_str | |
| 1128 | } | |
| 1129 | Some(TokenDescription::ReservedKeyword) => { | |
| 1130 | fluent::parse_expected_identifier_found_reserved_keyword_str | |
| 1131 | } | |
| 1132 | Some(TokenDescription::DocComment) => { | |
| 1133 | fluent::parse_expected_identifier_found_doc_comment_str | |
| 1134 | } | |
| 1135 | None => fluent::parse_expected_identifier_found_str, | |
| 1136 | }, | |
| 1137 | ); | |
| 1119 | let mut diag = Diag::new(dcx, level, match token_descr { | |
| 1120 | Some(TokenDescription::ReservedIdentifier) => { | |
| 1121 | fluent::parse_expected_identifier_found_reserved_identifier_str | |
| 1122 | } | |
| 1123 | Some(TokenDescription::Keyword) => fluent::parse_expected_identifier_found_keyword_str, | |
| 1124 | Some(TokenDescription::ReservedKeyword) => { | |
| 1125 | fluent::parse_expected_identifier_found_reserved_keyword_str | |
| 1126 | } | |
| 1127 | Some(TokenDescription::DocComment) => { | |
| 1128 | fluent::parse_expected_identifier_found_doc_comment_str | |
| 1129 | } | |
| 1130 | None => fluent::parse_expected_identifier_found_str, | |
| 1131 | }); | |
| 1138 | 1132 | diag.span(self.span); |
| 1139 | 1133 | diag.arg("token", self.token); |
| 1140 | 1134 | |
| ... | ... | @@ -1176,23 +1170,17 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for ExpectedSemi { |
| 1176 | 1170 | fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> { |
| 1177 | 1171 | let token_descr = TokenDescription::from_token(&self.token); |
| 1178 | 1172 | |
| 1179 | let mut diag = Diag::new( | |
| 1180 | dcx, | |
| 1181 | level, | |
| 1182 | match token_descr { | |
| 1183 | Some(TokenDescription::ReservedIdentifier) => { | |
| 1184 | fluent::parse_expected_semi_found_reserved_identifier_str | |
| 1185 | } | |
| 1186 | Some(TokenDescription::Keyword) => fluent::parse_expected_semi_found_keyword_str, | |
| 1187 | Some(TokenDescription::ReservedKeyword) => { | |
| 1188 | fluent::parse_expected_semi_found_reserved_keyword_str | |
| 1189 | } | |
| 1190 | Some(TokenDescription::DocComment) => { | |
| 1191 | fluent::parse_expected_semi_found_doc_comment_str | |
| 1192 | } | |
| 1193 | None => fluent::parse_expected_semi_found_str, | |
| 1194 | }, | |
| 1195 | ); | |
| 1173 | let mut diag = Diag::new(dcx, level, match token_descr { | |
| 1174 | Some(TokenDescription::ReservedIdentifier) => { | |
| 1175 | fluent::parse_expected_semi_found_reserved_identifier_str | |
| 1176 | } | |
| 1177 | Some(TokenDescription::Keyword) => fluent::parse_expected_semi_found_keyword_str, | |
| 1178 | Some(TokenDescription::ReservedKeyword) => { | |
| 1179 | fluent::parse_expected_semi_found_reserved_keyword_str | |
| 1180 | } | |
| 1181 | Some(TokenDescription::DocComment) => fluent::parse_expected_semi_found_doc_comment_str, | |
| 1182 | None => fluent::parse_expected_semi_found_str, | |
| 1183 | }); | |
| 1196 | 1184 | diag.span(self.span); |
| 1197 | 1185 | diag.arg("token", self.token); |
| 1198 | 1186 |
compiler/rustc_parse/src/lexer/diagnostics.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use rustc_ast::token::Delimiter; |
| 2 | 2 | use rustc_errors::Diag; |
| 3 | use rustc_span::source_map::SourceMap; | |
| 4 | 3 | use rustc_span::Span; |
| 4 | use rustc_span::source_map::SourceMap; | |
| 5 | 5 | |
| 6 | 6 | use super::UnmatchedDelim; |
| 7 | 7 |
compiler/rustc_parse/src/lexer/mod.rs+2-2| ... | ... | @@ -8,10 +8,10 @@ use rustc_errors::codes::*; |
| 8 | 8 | use rustc_errors::{Applicability, Diag, DiagCtxtHandle, StashKey}; |
| 9 | 9 | use rustc_lexer::unescape::{self, EscapeError, Mode}; |
| 10 | 10 | use rustc_lexer::{Base, Cursor, DocStyle, LiteralKind, RawStrError}; |
| 11 | use rustc_session::lint::BuiltinLintDiag; | |
| 11 | 12 | use rustc_session::lint::builtin::{ |
| 12 | 13 | RUST_2021_PREFIXES_INCOMPATIBLE_SYNTAX, TEXT_DIRECTION_CODEPOINT_IN_COMMENT, |
| 13 | 14 | }; |
| 14 | use rustc_session::lint::BuiltinLintDiag; | |
| 15 | 15 | use rustc_session::parse::ParseSess; |
| 16 | 16 | use rustc_span::symbol::Symbol; |
| 17 | 17 | use rustc_span::{BytePos, Pos, Span}; |
| ... | ... | @@ -866,7 +866,7 @@ impl<'psess, 'src> StringReader<'psess, 'src> { |
| 866 | 866 | } |
| 867 | 867 | |
| 868 | 868 | pub fn nfc_normalize(string: &str) -> Symbol { |
| 869 | use unicode_normalization::{is_nfc_quick, IsNormalized, UnicodeNormalization}; | |
| 869 | use unicode_normalization::{IsNormalized, UnicodeNormalization, is_nfc_quick}; | |
| 870 | 870 | match is_nfc_quick(string.chars()) { |
| 871 | 871 | IsNormalized::Yes => Symbol::intern(string), |
| 872 | 872 | _ => { |
compiler/rustc_parse/src/lexer/tokentrees.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ use rustc_errors::{Applicability, PErr}; |
| 5 | 5 | use rustc_span::symbol::kw; |
| 6 | 6 | |
| 7 | 7 | use super::diagnostics::{ |
| 8 | report_suspicious_mismatch_block, same_indentation_level, TokenTreeDiagInfo, | |
| 8 | TokenTreeDiagInfo, report_suspicious_mismatch_block, same_indentation_level, | |
| 9 | 9 | }; |
| 10 | 10 | use super::{StringReader, UnmatchedDelim}; |
| 11 | 11 | use crate::Parser; |
compiler/rustc_parse/src/lexer/unescape_error_reporting.rs+1-1| ... | ... | @@ -40,8 +40,8 @@ pub(crate) fn emit_unescape_error( |
| 40 | 40 | dcx.emit_err(UnescapeError::InvalidUnicodeEscape { span: err_span, surrogate: false }) |
| 41 | 41 | } |
| 42 | 42 | EscapeError::MoreThanOneChar => { |
| 43 | use unicode_normalization::char::is_combining_mark; | |
| 44 | 43 | use unicode_normalization::UnicodeNormalization; |
| 44 | use unicode_normalization::char::is_combining_mark; | |
| 45 | 45 | let mut sugg = None; |
| 46 | 46 | let mut note = None; |
| 47 | 47 |
compiler/rustc_parse/src/lib.rs+2-2| ... | ... | @@ -18,7 +18,7 @@ use std::path::Path; |
| 18 | 18 | |
| 19 | 19 | use rustc_ast as ast; |
| 20 | 20 | use rustc_ast::tokenstream::TokenStream; |
| 21 | use rustc_ast::{token, AttrItem, Attribute, MetaItem}; | |
| 21 | use rustc_ast::{AttrItem, Attribute, MetaItem, token}; | |
| 22 | 22 | use rustc_ast_pretty::pprust; |
| 23 | 23 | use rustc_data_structures::sync::Lrc; |
| 24 | 24 | use rustc_errors::{Diag, FatalError, PResult}; |
| ... | ... | @@ -29,7 +29,7 @@ pub const MACRO_ARGUMENTS: Option<&str> = Some("macro arguments"); |
| 29 | 29 | |
| 30 | 30 | #[macro_use] |
| 31 | 31 | pub mod parser; |
| 32 | use parser::{make_unclosed_delims_error, Parser}; | |
| 32 | use parser::{Parser, make_unclosed_delims_error}; | |
| 33 | 33 | pub mod lexer; |
| 34 | 34 | pub mod validate_attr; |
| 35 | 35 |
compiler/rustc_parse/src/parser/attr_wrapper.rs+5-5| ... | ... | @@ -10,7 +10,7 @@ use rustc_ast::{self as ast, AttrVec, Attribute, HasAttrs, HasTokens}; |
| 10 | 10 | use rustc_data_structures::fx::FxHashSet; |
| 11 | 11 | use rustc_errors::PResult; |
| 12 | 12 | use rustc_session::parse::ParseSess; |
| 13 | use rustc_span::{sym, Span, DUMMY_SP}; | |
| 13 | use rustc_span::{DUMMY_SP, Span, sym}; | |
| 14 | 14 | |
| 15 | 15 | use super::{ |
| 16 | 16 | Capturing, FlatToken, ForceCollect, NodeRange, NodeReplacement, Parser, ParserRange, |
| ... | ... | @@ -485,10 +485,10 @@ fn make_attr_token_stream( |
| 485 | 485 | for flat_token in iter { |
| 486 | 486 | match flat_token { |
| 487 | 487 | FlatToken::Token((Token { kind: TokenKind::OpenDelim(delim), span }, spacing)) => { |
| 488 | stack_rest.push(mem::replace( | |
| 489 | &mut stack_top, | |
| 490 | FrameData { open_delim_sp: Some((delim, span, spacing)), inner: vec![] }, | |
| 491 | )); | |
| 488 | stack_rest.push(mem::replace(&mut stack_top, FrameData { | |
| 489 | open_delim_sp: Some((delim, span, spacing)), | |
| 490 | inner: vec![], | |
| 491 | })); | |
| 492 | 492 | } |
| 493 | 493 | FlatToken::Token((Token { kind: TokenKind::CloseDelim(delim), span }, spacing)) => { |
| 494 | 494 | let frame_data = mem::replace(&mut stack_top, stack_rest.pop().unwrap()); |
compiler/rustc_parse/src/parser/diagnostics.rs+31-37| ... | ... | @@ -15,15 +15,15 @@ use rustc_ast::{ |
| 15 | 15 | use rustc_ast_pretty::pprust; |
| 16 | 16 | use rustc_data_structures::fx::FxHashSet; |
| 17 | 17 | use rustc_errors::{ |
| 18 | pluralize, Applicability, Diag, DiagCtxtHandle, ErrorGuaranteed, FatalError, PErr, PResult, | |
| 19 | Subdiagnostic, Suggestions, | |
| 18 | Applicability, Diag, DiagCtxtHandle, ErrorGuaranteed, FatalError, PErr, PResult, Subdiagnostic, | |
| 19 | Suggestions, pluralize, | |
| 20 | 20 | }; |
| 21 | 21 | use rustc_session::errors::ExprParenthesesNeeded; |
| 22 | 22 | use rustc_span::edit_distance::find_best_match_for_name; |
| 23 | 23 | use rustc_span::source_map::Spanned; |
| 24 | use rustc_span::symbol::{kw, sym, AllKeywords, Ident}; | |
| 25 | use rustc_span::{BytePos, Span, SpanSnippetError, Symbol, DUMMY_SP}; | |
| 26 | use thin_vec::{thin_vec, ThinVec}; | |
| 24 | use rustc_span::symbol::{AllKeywords, Ident, kw, sym}; | |
| 25 | use rustc_span::{BytePos, DUMMY_SP, Span, SpanSnippetError, Symbol}; | |
| 26 | use thin_vec::{ThinVec, thin_vec}; | |
| 27 | 27 | use tracing::{debug, trace}; |
| 28 | 28 | |
| 29 | 29 | use super::pat::Expected; |
| ... | ... | @@ -721,15 +721,12 @@ impl<'a> Parser<'a> { |
| 721 | 721 | let span = self.token.span.with_lo(pos).with_hi(pos); |
| 722 | 722 | err.span_suggestion_verbose( |
| 723 | 723 | span, |
| 724 | format!( | |
| 725 | "add a space before {} to write a regular comment", | |
| 726 | match (kind, style) { | |
| 727 | (token::CommentKind::Line, ast::AttrStyle::Inner) => "`!`", | |
| 728 | (token::CommentKind::Block, ast::AttrStyle::Inner) => "`!`", | |
| 729 | (token::CommentKind::Line, ast::AttrStyle::Outer) => "the last `/`", | |
| 730 | (token::CommentKind::Block, ast::AttrStyle::Outer) => "the last `*`", | |
| 731 | }, | |
| 732 | ), | |
| 724 | format!("add a space before {} to write a regular comment", match (kind, style) { | |
| 725 | (token::CommentKind::Line, ast::AttrStyle::Inner) => "`!`", | |
| 726 | (token::CommentKind::Block, ast::AttrStyle::Inner) => "`!`", | |
| 727 | (token::CommentKind::Line, ast::AttrStyle::Outer) => "the last `/`", | |
| 728 | (token::CommentKind::Block, ast::AttrStyle::Outer) => "the last `*`", | |
| 729 | },), | |
| 733 | 730 | " ".to_string(), |
| 734 | 731 | Applicability::MachineApplicable, |
| 735 | 732 | ); |
| ... | ... | @@ -1936,14 +1933,13 @@ impl<'a> Parser<'a> { |
| 1936 | 1933 | (token::Eof, None) => (self.prev_token.span, self.token.span), |
| 1937 | 1934 | _ => (self.prev_token.span.shrink_to_hi(), self.token.span), |
| 1938 | 1935 | }; |
| 1939 | let msg = format!( | |
| 1940 | "expected `{}`, found {}", | |
| 1941 | token_str, | |
| 1942 | match (&self.token.kind, self.subparser_name) { | |
| 1943 | (token::Eof, Some(origin)) => format!("end of {origin}"), | |
| 1944 | _ => this_token_str, | |
| 1945 | }, | |
| 1946 | ); | |
| 1936 | let msg = format!("expected `{}`, found {}", token_str, match ( | |
| 1937 | &self.token.kind, | |
| 1938 | self.subparser_name | |
| 1939 | ) { | |
| 1940 | (token::Eof, Some(origin)) => format!("end of {origin}"), | |
| 1941 | _ => this_token_str, | |
| 1942 | },); | |
| 1947 | 1943 | let mut err = self.dcx().struct_span_err(sp, msg); |
| 1948 | 1944 | let label_exp = format!("expected `{token_str}`"); |
| 1949 | 1945 | let sm = self.psess.source_map(); |
| ... | ... | @@ -2864,27 +2860,25 @@ impl<'a> Parser<'a> { |
| 2864 | 2860 | PatKind::Ident(BindingMode::NONE, ident, None) => { |
| 2865 | 2861 | match &first_pat.kind { |
| 2866 | 2862 | PatKind::Ident(_, old_ident, _) => { |
| 2867 | let path = PatKind::Path( | |
| 2868 | None, | |
| 2869 | Path { | |
| 2870 | span: new_span, | |
| 2871 | segments: thin_vec![ | |
| 2872 | PathSegment::from_ident(*old_ident), | |
| 2873 | PathSegment::from_ident(*ident), | |
| 2874 | ], | |
| 2875 | tokens: None, | |
| 2876 | }, | |
| 2877 | ); | |
| 2863 | let path = PatKind::Path(None, Path { | |
| 2864 | span: new_span, | |
| 2865 | segments: thin_vec![ | |
| 2866 | PathSegment::from_ident(*old_ident), | |
| 2867 | PathSegment::from_ident(*ident), | |
| 2868 | ], | |
| 2869 | tokens: None, | |
| 2870 | }); | |
| 2878 | 2871 | first_pat = self.mk_pat(new_span, path); |
| 2879 | 2872 | show_sugg = true; |
| 2880 | 2873 | } |
| 2881 | 2874 | PatKind::Path(old_qself, old_path) => { |
| 2882 | 2875 | let mut segments = old_path.segments.clone(); |
| 2883 | 2876 | segments.push(PathSegment::from_ident(*ident)); |
| 2884 | let path = PatKind::Path( | |
| 2885 | old_qself.clone(), | |
| 2886 | Path { span: new_span, segments, tokens: None }, | |
| 2887 | ); | |
| 2877 | let path = PatKind::Path(old_qself.clone(), Path { | |
| 2878 | span: new_span, | |
| 2879 | segments, | |
| 2880 | tokens: None, | |
| 2881 | }); | |
| 2888 | 2882 | first_pat = self.mk_pat(new_span, path); |
| 2889 | 2883 | show_sugg = true; |
| 2890 | 2884 | } |
compiler/rustc_parse/src/parser/expr.rs+26-26| ... | ... | @@ -10,25 +10,25 @@ use rustc_ast::ptr::P; |
| 10 | 10 | use rustc_ast::token::{self, Delimiter, Token, TokenKind}; |
| 11 | 11 | use rustc_ast::util::case::Case; |
| 12 | 12 | use rustc_ast::util::classify; |
| 13 | use rustc_ast::util::parser::{prec_let_scrutinee_needs_par, AssocOp, Fixity}; | |
| 14 | use rustc_ast::visit::{walk_expr, Visitor}; | |
| 13 | use rustc_ast::util::parser::{AssocOp, Fixity, prec_let_scrutinee_needs_par}; | |
| 14 | use rustc_ast::visit::{Visitor, walk_expr}; | |
| 15 | 15 | use rustc_ast::{ |
| 16 | 16 | self as ast, AnonConst, Arm, AttrStyle, AttrVec, BinOp, BinOpKind, BlockCheckMode, CaptureBy, |
| 17 | ClosureBinder, Expr, ExprField, ExprKind, FnDecl, FnRetTy, Label, MacCall, MetaItemLit, | |
| 18 | Movability, Param, RangeLimits, StmtKind, Ty, TyKind, UnOp, DUMMY_NODE_ID, | |
| 17 | ClosureBinder, DUMMY_NODE_ID, Expr, ExprField, ExprKind, FnDecl, FnRetTy, Label, MacCall, | |
| 18 | MetaItemLit, Movability, Param, RangeLimits, StmtKind, Ty, TyKind, UnOp, | |
| 19 | 19 | }; |
| 20 | 20 | use rustc_ast_pretty::pprust; |
| 21 | 21 | use rustc_data_structures::stack::ensure_sufficient_stack; |
| 22 | 22 | use rustc_errors::{Applicability, Diag, PResult, StashKey, Subdiagnostic}; |
| 23 | 23 | use rustc_lexer::unescape::unescape_char; |
| 24 | 24 | use rustc_macros::Subdiagnostic; |
| 25 | use rustc_session::errors::{report_lit_error, ExprParenthesesNeeded}; | |
| 26 | use rustc_session::lint::builtin::BREAK_WITH_LABEL_AND_LOOP; | |
| 25 | use rustc_session::errors::{ExprParenthesesNeeded, report_lit_error}; | |
| 27 | 26 | use rustc_session::lint::BuiltinLintDiag; |
| 27 | use rustc_session::lint::builtin::BREAK_WITH_LABEL_AND_LOOP; | |
| 28 | 28 | use rustc_span::source_map::{self, Spanned}; |
| 29 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 29 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 30 | 30 | use rustc_span::{BytePos, ErrorGuaranteed, Pos, Span}; |
| 31 | use thin_vec::{thin_vec, ThinVec}; | |
| 31 | use thin_vec::{ThinVec, thin_vec}; | |
| 32 | 32 | use tracing::instrument; |
| 33 | 33 | |
| 34 | 34 | use super::diagnostics::SnapshotParser; |
| ... | ... | @@ -811,20 +811,17 @@ impl<'a> Parser<'a> { |
| 811 | 811 | // Check if an illegal postfix operator has been added after the cast. |
| 812 | 812 | // If the resulting expression is not a cast, it is an illegal postfix operator. |
| 813 | 813 | if !matches!(with_postfix.kind, ExprKind::Cast(_, _)) { |
| 814 | let msg = format!( | |
| 815 | "cast cannot be followed by {}", | |
| 816 | match with_postfix.kind { | |
| 817 | ExprKind::Index(..) => "indexing", | |
| 818 | ExprKind::Try(_) => "`?`", | |
| 819 | ExprKind::Field(_, _) => "a field access", | |
| 820 | ExprKind::MethodCall(_) => "a method call", | |
| 821 | ExprKind::Call(_, _) => "a function call", | |
| 822 | ExprKind::Await(_, _) => "`.await`", | |
| 823 | ExprKind::Match(_, _, MatchKind::Postfix) => "a postfix match", | |
| 824 | ExprKind::Err(_) => return Ok(with_postfix), | |
| 825 | _ => unreachable!("parse_dot_or_call_expr_with_ shouldn't produce this"), | |
| 826 | } | |
| 827 | ); | |
| 814 | let msg = format!("cast cannot be followed by {}", match with_postfix.kind { | |
| 815 | ExprKind::Index(..) => "indexing", | |
| 816 | ExprKind::Try(_) => "`?`", | |
| 817 | ExprKind::Field(_, _) => "a field access", | |
| 818 | ExprKind::MethodCall(_) => "a method call", | |
| 819 | ExprKind::Call(_, _) => "a function call", | |
| 820 | ExprKind::Await(_, _) => "`.await`", | |
| 821 | ExprKind::Match(_, _, MatchKind::Postfix) => "a postfix match", | |
| 822 | ExprKind::Err(_) => return Ok(with_postfix), | |
| 823 | _ => unreachable!("parse_dot_or_call_expr_with_ shouldn't produce this"), | |
| 824 | }); | |
| 828 | 825 | let mut err = self.dcx().struct_span_err(span, msg); |
| 829 | 826 | |
| 830 | 827 | let suggest_parens = |err: &mut Diag<'_>| { |
| ... | ... | @@ -2844,10 +2841,13 @@ impl<'a> Parser<'a> { |
| 2844 | 2841 | .emit_err(errors::MissingExpressionInForLoop { span: expr.span.shrink_to_lo() }); |
| 2845 | 2842 | let err_expr = self.mk_expr(expr.span, ExprKind::Err(guar)); |
| 2846 | 2843 | let block = self.mk_block(thin_vec![], BlockCheckMode::Default, self.prev_token.span); |
| 2847 | return Ok(self.mk_expr( | |
| 2848 | lo.to(self.prev_token.span), | |
| 2849 | ExprKind::ForLoop { pat, iter: err_expr, body: block, label: opt_label, kind }, | |
| 2850 | )); | |
| 2844 | return Ok(self.mk_expr(lo.to(self.prev_token.span), ExprKind::ForLoop { | |
| 2845 | pat, | |
| 2846 | iter: err_expr, | |
| 2847 | body: block, | |
| 2848 | label: opt_label, | |
| 2849 | kind, | |
| 2850 | })); | |
| 2851 | 2851 | } |
| 2852 | 2852 | |
| 2853 | 2853 | let (attrs, loop_block) = self.parse_inner_attrs_and_block()?; |
compiler/rustc_parse/src/parser/generics.rs+2-2| ... | ... | @@ -1,10 +1,10 @@ |
| 1 | 1 | use ast::token::Delimiter; |
| 2 | 2 | use rustc_ast::{ |
| 3 | self as ast, token, AttrVec, GenericBounds, GenericParam, GenericParamKind, TyKind, WhereClause, | |
| 3 | self as ast, AttrVec, GenericBounds, GenericParam, GenericParamKind, TyKind, WhereClause, token, | |
| 4 | 4 | }; |
| 5 | 5 | use rustc_errors::{Applicability, PResult}; |
| 6 | use rustc_span::symbol::{kw, Ident}; | |
| 7 | 6 | use rustc_span::Span; |
| 7 | use rustc_span::symbol::{Ident, kw}; | |
| 8 | 8 | use thin_vec::ThinVec; |
| 9 | 9 | |
| 10 | 10 | use super::{ForceCollect, Parser, Trailing, UsePreAttrPos}; |
compiler/rustc_parse/src/parser/item.rs+9-9| ... | ... | @@ -10,15 +10,15 @@ use rustc_ast::util::case::Case; |
| 10 | 10 | use rustc_ast::{self as ast}; |
| 11 | 11 | use rustc_ast_pretty::pprust; |
| 12 | 12 | use rustc_errors::codes::*; |
| 13 | use rustc_errors::{struct_span_code_err, Applicability, PResult, StashKey}; | |
| 13 | use rustc_errors::{Applicability, PResult, StashKey, struct_span_code_err}; | |
| 14 | 14 | use rustc_span::edit_distance::edit_distance; |
| 15 | 15 | use rustc_span::edition::Edition; |
| 16 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 17 | use rustc_span::{source_map, ErrorGuaranteed, Span, DUMMY_SP}; | |
| 18 | use thin_vec::{thin_vec, ThinVec}; | |
| 16 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 17 | use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span, source_map}; | |
| 18 | use thin_vec::{ThinVec, thin_vec}; | |
| 19 | 19 | use tracing::debug; |
| 20 | 20 | |
| 21 | use super::diagnostics::{dummy_arg, ConsumeClosingDelim}; | |
| 21 | use super::diagnostics::{ConsumeClosingDelim, dummy_arg}; | |
| 22 | 22 | use super::ty::{AllowPlus, RecoverQPath, RecoverReturnSign}; |
| 23 | 23 | use super::{ |
| 24 | 24 | AttrWrapper, FollowedByType, ForceCollect, Parser, PathStyle, Trailing, UsePreAttrPos, |
| ... | ... | @@ -1897,10 +1897,10 @@ impl<'a> Parser<'a> { |
| 1897 | 1897 | // Try to recover extra trailing angle brackets |
| 1898 | 1898 | if let TyKind::Path(_, Path { segments, .. }) = &a_var.ty.kind { |
| 1899 | 1899 | if let Some(last_segment) = segments.last() { |
| 1900 | let guar = self.check_trailing_angle_brackets( | |
| 1901 | last_segment, | |
| 1902 | &[&token::Comma, &token::CloseDelim(Delimiter::Brace)], | |
| 1903 | ); | |
| 1900 | let guar = self.check_trailing_angle_brackets(last_segment, &[ | |
| 1901 | &token::Comma, | |
| 1902 | &token::CloseDelim(Delimiter::Brace), | |
| 1903 | ]); | |
| 1904 | 1904 | if let Some(_guar) = guar { |
| 1905 | 1905 | // Handle a case like `Vec<u8>>,` where we can continue parsing fields |
| 1906 | 1906 | // after the comma |
compiler/rustc_parse/src/parser/mod.rs+5-5| ... | ... | @@ -27,9 +27,9 @@ use rustc_ast::tokenstream::{ |
| 27 | 27 | }; |
| 28 | 28 | use rustc_ast::util::case::Case; |
| 29 | 29 | use rustc_ast::{ |
| 30 | self as ast, AnonConst, AttrArgs, AttrArgsEq, AttrId, ByRef, Const, CoroutineKind, DelimArgs, | |
| 31 | Expr, ExprKind, Extern, HasAttrs, HasTokens, Mutability, Recovered, Safety, StrLit, Visibility, | |
| 32 | VisibilityKind, DUMMY_NODE_ID, | |
| 30 | self as ast, AnonConst, AttrArgs, AttrArgsEq, AttrId, ByRef, Const, CoroutineKind, | |
| 31 | DUMMY_NODE_ID, DelimArgs, Expr, ExprKind, Extern, HasAttrs, HasTokens, Mutability, Recovered, | |
| 32 | Safety, StrLit, Visibility, VisibilityKind, | |
| 33 | 33 | }; |
| 34 | 34 | use rustc_ast_pretty::pprust; |
| 35 | 35 | use rustc_data_structures::fx::FxHashMap; |
| ... | ... | @@ -37,8 +37,8 @@ use rustc_data_structures::sync::Lrc; |
| 37 | 37 | use rustc_errors::{Applicability, Diag, FatalError, MultiSpan, PResult}; |
| 38 | 38 | use rustc_index::interval::IntervalSet; |
| 39 | 39 | use rustc_session::parse::ParseSess; |
| 40 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 41 | use rustc_span::{Span, DUMMY_SP}; | |
| 40 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 41 | use rustc_span::{DUMMY_SP, Span}; | |
| 42 | 42 | use thin_vec::ThinVec; |
| 43 | 43 | use tracing::debug; |
| 44 | 44 |
compiler/rustc_parse/src/parser/nonterminal.rs+2-2| ... | ... | @@ -1,13 +1,13 @@ |
| 1 | use rustc_ast::HasTokens; | |
| 1 | 2 | use rustc_ast::ptr::P; |
| 2 | 3 | use rustc_ast::token::Nonterminal::*; |
| 3 | 4 | use rustc_ast::token::NtExprKind::*; |
| 4 | 5 | use rustc_ast::token::NtPatKind::*; |
| 5 | 6 | use rustc_ast::token::{self, Delimiter, NonterminalKind, Token}; |
| 6 | use rustc_ast::HasTokens; | |
| 7 | 7 | use rustc_ast_pretty::pprust; |
| 8 | 8 | use rustc_data_structures::sync::Lrc; |
| 9 | 9 | use rustc_errors::PResult; |
| 10 | use rustc_span::symbol::{kw, Ident}; | |
| 10 | use rustc_span::symbol::{Ident, kw}; | |
| 11 | 11 | |
| 12 | 12 | use crate::errors::UnexpectedNonterminal; |
| 13 | 13 | use crate::parser::pat::{CommaRecoveryMode, RecoverColon, RecoverComma}; |
compiler/rustc_parse/src/parser/pat.rs+4-4| ... | ... | @@ -10,10 +10,10 @@ use rustc_ast::{ |
| 10 | 10 | use rustc_ast_pretty::pprust; |
| 11 | 11 | use rustc_errors::{Applicability, Diag, DiagArgValue, PResult, StashKey}; |
| 12 | 12 | use rustc_session::errors::ExprParenthesesNeeded; |
| 13 | use rustc_span::source_map::{respan, Spanned}; | |
| 14 | use rustc_span::symbol::{kw, sym, Ident}; | |
| 13 | use rustc_span::source_map::{Spanned, respan}; | |
| 14 | use rustc_span::symbol::{Ident, kw, sym}; | |
| 15 | 15 | use rustc_span::{BytePos, ErrorGuaranteed, Span}; |
| 16 | use thin_vec::{thin_vec, ThinVec}; | |
| 16 | use thin_vec::{ThinVec, thin_vec}; | |
| 17 | 17 | |
| 18 | 18 | use super::{ForceCollect, Parser, PathStyle, Restrictions, Trailing, UsePreAttrPos}; |
| 19 | 19 | use crate::errors::{ |
| ... | ... | @@ -27,7 +27,7 @@ use crate::errors::{ |
| 27 | 27 | UnexpectedLifetimeInPattern, UnexpectedParenInRangePat, UnexpectedParenInRangePatSugg, |
| 28 | 28 | UnexpectedVertVertBeforeFunctionParam, UnexpectedVertVertInPattern, WrapInParens, |
| 29 | 29 | }; |
| 30 | use crate::parser::expr::{could_be_unclosed_char_literal, DestructuredFloat}; | |
| 30 | use crate::parser::expr::{DestructuredFloat, could_be_unclosed_char_literal}; | |
| 31 | 31 | use crate::{maybe_recover_from_interpolated_ty_qpath, maybe_whole}; |
| 32 | 32 | |
| 33 | 33 | #[derive(PartialEq, Copy, Clone)] |
compiler/rustc_parse/src/parser/path.rs+12-14| ... | ... | @@ -9,7 +9,7 @@ use rustc_ast::{ |
| 9 | 9 | Path, PathSegment, QSelf, |
| 10 | 10 | }; |
| 11 | 11 | use rustc_errors::{Applicability, Diag, PResult}; |
| 12 | use rustc_span::symbol::{kw, sym, Ident}; | |
| 12 | use rustc_span::symbol::{Ident, kw, sym}; | |
| 13 | 13 | use rustc_span::{BytePos, Span}; |
| 14 | 14 | use thin_vec::ThinVec; |
| 15 | 15 | use tracing::debug; |
| ... | ... | @@ -107,10 +107,11 @@ impl<'a> Parser<'a> { |
| 107 | 107 | self.parse_path_segments(&mut path.segments, style, None)?; |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | Ok(( | |
| 111 | qself, | |
| 112 | Path { segments: path.segments, span: lo.to(self.prev_token.span), tokens: None }, | |
| 113 | )) | |
| 110 | Ok((qself, Path { | |
| 111 | segments: path.segments, | |
| 112 | span: lo.to(self.prev_token.span), | |
| 113 | tokens: None, | |
| 114 | })) | |
| 114 | 115 | } |
| 115 | 116 | |
| 116 | 117 | /// Recover from an invalid single colon, when the user likely meant a qualified path. |
| ... | ... | @@ -487,16 +488,13 @@ impl<'a> Parser<'a> { |
| 487 | 488 | |
| 488 | 489 | error.span_suggestion_verbose( |
| 489 | 490 | prev_token_before_parsing.span, |
| 490 | format!( | |
| 491 | "consider removing the `::` here to {}", | |
| 492 | match style { | |
| 493 | PathStyle::Expr => "call the expression", | |
| 494 | PathStyle::Pat => "turn this into a tuple struct pattern", | |
| 495 | _ => { | |
| 496 | return; | |
| 497 | } | |
| 491 | format!("consider removing the `::` here to {}", match style { | |
| 492 | PathStyle::Expr => "call the expression", | |
| 493 | PathStyle::Pat => "turn this into a tuple struct pattern", | |
| 494 | _ => { | |
| 495 | return; | |
| 498 | 496 | } |
| 499 | ), | |
| 497 | }), | |
| 500 | 498 | "", |
| 501 | 499 | Applicability::MaybeIncorrect, |
| 502 | 500 | ); |
compiler/rustc_parse/src/parser/stmt.rs+12-18| ... | ... | @@ -7,13 +7,13 @@ use rustc_ast::ptr::P; |
| 7 | 7 | use rustc_ast::token::{self, Delimiter, TokenKind}; |
| 8 | 8 | use rustc_ast::util::classify::{self, TrailingBrace}; |
| 9 | 9 | use rustc_ast::{ |
| 10 | AttrStyle, AttrVec, Block, BlockCheckMode, Expr, ExprKind, HasAttrs, Local, LocalKind, MacCall, | |
| 11 | MacCallStmt, MacStmtStyle, Recovered, Stmt, StmtKind, DUMMY_NODE_ID, | |
| 10 | AttrStyle, AttrVec, Block, BlockCheckMode, DUMMY_NODE_ID, Expr, ExprKind, HasAttrs, Local, | |
| 11 | LocalKind, MacCall, MacCallStmt, MacStmtStyle, Recovered, Stmt, StmtKind, | |
| 12 | 12 | }; |
| 13 | 13 | use rustc_errors::{Applicability, Diag, PResult}; |
| 14 | use rustc_span::symbol::{kw, sym, Ident}; | |
| 14 | use rustc_span::symbol::{Ident, kw, sym}; | |
| 15 | 15 | use rustc_span::{BytePos, ErrorGuaranteed, Span}; |
| 16 | use thin_vec::{thin_vec, ThinVec}; | |
| 16 | use thin_vec::{ThinVec, thin_vec}; | |
| 17 | 17 | |
| 18 | 18 | use super::attr::InnerAttrForbiddenReason; |
| 19 | 19 | use super::diagnostics::AttemptLocalParseRecovery; |
| ... | ... | @@ -417,20 +417,14 @@ impl<'a> Parser<'a> { |
| 417 | 417 | fn check_let_else_init_trailing_brace(&self, init: &ast::Expr) { |
| 418 | 418 | if let Some(trailing) = classify::expr_trailing_brace(init) { |
| 419 | 419 | let (span, sugg) = match trailing { |
| 420 | TrailingBrace::MacCall(mac) => ( | |
| 421 | mac.span(), | |
| 422 | errors::WrapInParentheses::MacroArgs { | |
| 423 | left: mac.args.dspan.open, | |
| 424 | right: mac.args.dspan.close, | |
| 425 | }, | |
| 426 | ), | |
| 427 | TrailingBrace::Expr(expr) => ( | |
| 428 | expr.span, | |
| 429 | errors::WrapInParentheses::Expression { | |
| 430 | left: expr.span.shrink_to_lo(), | |
| 431 | right: expr.span.shrink_to_hi(), | |
| 432 | }, | |
| 433 | ), | |
| 420 | TrailingBrace::MacCall(mac) => (mac.span(), errors::WrapInParentheses::MacroArgs { | |
| 421 | left: mac.args.dspan.open, | |
| 422 | right: mac.args.dspan.close, | |
| 423 | }), | |
| 424 | TrailingBrace::Expr(expr) => (expr.span, errors::WrapInParentheses::Expression { | |
| 425 | left: expr.span.shrink_to_lo(), | |
| 426 | right: expr.span.shrink_to_hi(), | |
| 427 | }), | |
| 434 | 428 | }; |
| 435 | 429 | self.dcx().emit_err(errors::InvalidCurlyInLetElse { |
| 436 | 430 | span: span.with_lo(span.hi() - BytePos(1)), |
compiler/rustc_parse/src/parser/tests.rs+3-3| ... | ... | @@ -9,15 +9,15 @@ use ast::token::IdentIsRaw; |
| 9 | 9 | use rustc_ast::ptr::P; |
| 10 | 10 | use rustc_ast::token::{self, Delimiter, Token}; |
| 11 | 11 | use rustc_ast::tokenstream::{DelimSpacing, DelimSpan, Spacing, TokenStream, TokenTree}; |
| 12 | use rustc_ast::{self as ast, visit, PatKind}; | |
| 12 | use rustc_ast::{self as ast, PatKind, visit}; | |
| 13 | 13 | use rustc_ast_pretty::pprust::item_to_string; |
| 14 | 14 | use rustc_data_structures::sync::Lrc; |
| 15 | 15 | use rustc_errors::emitter::HumanEmitter; |
| 16 | 16 | use rustc_errors::{DiagCtxt, MultiSpan, PResult}; |
| 17 | 17 | use rustc_session::parse::ParseSess; |
| 18 | 18 | use rustc_span::source_map::{FilePathMapping, SourceMap}; |
| 19 | use rustc_span::symbol::{kw, sym, Symbol}; | |
| 20 | use rustc_span::{create_default_session_globals_then, BytePos, FileName, Pos, Span}; | |
| 19 | use rustc_span::symbol::{Symbol, kw, sym}; | |
| 20 | use rustc_span::{BytePos, FileName, Pos, Span, create_default_session_globals_then}; | |
| 21 | 21 | use termcolor::WriteColor; |
| 22 | 22 | |
| 23 | 23 | use crate::parser::{ForceCollect, Parser}; |
compiler/rustc_parse/src/parser/tokenstream/tests.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use rustc_ast::token::{self, IdentIsRaw}; |
| 2 | 2 | use rustc_ast::tokenstream::{TokenStream, TokenTree}; |
| 3 | use rustc_span::{create_default_session_globals_then, BytePos, Span, Symbol}; | |
| 3 | use rustc_span::{BytePos, Span, Symbol, create_default_session_globals_then}; | |
| 4 | 4 | |
| 5 | 5 | use crate::parser::tests::string_to_stream; |
| 6 | 6 |
compiler/rustc_parse/src/parser/ty.rs+5-5| ... | ... | @@ -2,14 +2,14 @@ use rustc_ast::ptr::P; |
| 2 | 2 | use rustc_ast::token::{self, BinOpToken, Delimiter, IdentIsRaw, Token, TokenKind}; |
| 3 | 3 | use rustc_ast::util::case::Case; |
| 4 | 4 | use rustc_ast::{ |
| 5 | self as ast, BareFnTy, BoundAsyncness, BoundConstness, BoundPolarity, FnRetTy, GenericBound, | |
| 6 | GenericBounds, GenericParam, Generics, Lifetime, MacCall, MutTy, Mutability, PolyTraitRef, | |
| 7 | PreciseCapturingArg, TraitBoundModifiers, TraitObjectSyntax, Ty, TyKind, DUMMY_NODE_ID, | |
| 5 | self as ast, BareFnTy, BoundAsyncness, BoundConstness, BoundPolarity, DUMMY_NODE_ID, FnRetTy, | |
| 6 | GenericBound, GenericBounds, GenericParam, Generics, Lifetime, MacCall, MutTy, Mutability, | |
| 7 | PolyTraitRef, PreciseCapturingArg, TraitBoundModifiers, TraitObjectSyntax, Ty, TyKind, | |
| 8 | 8 | }; |
| 9 | 9 | use rustc_errors::{Applicability, PResult}; |
| 10 | use rustc_span::symbol::{kw, sym, Ident}; | |
| 10 | use rustc_span::symbol::{Ident, kw, sym}; | |
| 11 | 11 | use rustc_span::{ErrorGuaranteed, Span, Symbol}; |
| 12 | use thin_vec::{thin_vec, ThinVec}; | |
| 12 | use thin_vec::{ThinVec, thin_vec}; | |
| 13 | 13 | |
| 14 | 14 | use super::{Parser, PathStyle, SeqSep, TokenType, Trailing}; |
| 15 | 15 | use crate::errors::{ |
compiler/rustc_parse/src/validate_attr.rs+3-3| ... | ... | @@ -7,12 +7,12 @@ use rustc_ast::{ |
| 7 | 7 | NestedMetaItem, Safety, |
| 8 | 8 | }; |
| 9 | 9 | use rustc_errors::{Applicability, FatalError, PResult}; |
| 10 | use rustc_feature::{AttributeSafety, AttributeTemplate, BuiltinAttribute, BUILTIN_ATTRIBUTE_MAP}; | |
| 10 | use rustc_feature::{AttributeSafety, AttributeTemplate, BUILTIN_ATTRIBUTE_MAP, BuiltinAttribute}; | |
| 11 | 11 | use rustc_session::errors::report_lit_error; |
| 12 | use rustc_session::lint::builtin::{ILL_FORMED_ATTRIBUTE_INPUT, UNSAFE_ATTR_OUTSIDE_UNSAFE}; | |
| 13 | 12 | use rustc_session::lint::BuiltinLintDiag; |
| 13 | use rustc_session::lint::builtin::{ILL_FORMED_ATTRIBUTE_INPUT, UNSAFE_ATTR_OUTSIDE_UNSAFE}; | |
| 14 | 14 | use rustc_session::parse::ParseSess; |
| 15 | use rustc_span::{sym, BytePos, Span, Symbol}; | |
| 15 | use rustc_span::{BytePos, Span, Symbol, sym}; | |
| 16 | 16 | |
| 17 | 17 | use crate::{errors, parse_in}; |
| 18 | 18 |
compiler/rustc_parse_format/src/lib.rs+33-51| ... | ... | @@ -18,11 +18,11 @@ |
| 18 | 18 | |
| 19 | 19 | use std::{iter, str, string}; |
| 20 | 20 | |
| 21 | use rustc_lexer::unescape; | |
| 22 | 21 | pub use Alignment::*; |
| 23 | 22 | pub use Count::*; |
| 24 | 23 | pub use Piece::*; |
| 25 | 24 | pub use Position::*; |
| 25 | use rustc_lexer::unescape; | |
| 26 | 26 | |
| 27 | 27 | // Note: copied from rustc_span |
| 28 | 28 | /// Range inside of a `Span` used for diagnostics when we only have access to relative positions. |
| ... | ... | @@ -870,34 +870,28 @@ impl<'a> Parser<'a> { |
| 870 | 870 | if let (Some(pos), Some(_)) = (self.consume_pos('?'), self.consume_pos(':')) { |
| 871 | 871 | let word = self.word(); |
| 872 | 872 | let pos = self.to_span_index(pos); |
| 873 | self.errors.insert( | |
| 874 | 0, | |
| 875 | ParseError { | |
| 876 | description: "expected format parameter to occur after `:`".to_owned(), | |
| 877 | note: Some(format!("`?` comes after `:`, try `{}:{}` instead", word, "?")), | |
| 878 | label: "expected `?` to occur after `:`".to_owned(), | |
| 879 | span: pos.to(pos), | |
| 880 | secondary_label: None, | |
| 881 | suggestion: Suggestion::None, | |
| 882 | }, | |
| 883 | ); | |
| 873 | self.errors.insert(0, ParseError { | |
| 874 | description: "expected format parameter to occur after `:`".to_owned(), | |
| 875 | note: Some(format!("`?` comes after `:`, try `{}:{}` instead", word, "?")), | |
| 876 | label: "expected `?` to occur after `:`".to_owned(), | |
| 877 | span: pos.to(pos), | |
| 878 | secondary_label: None, | |
| 879 | suggestion: Suggestion::None, | |
| 880 | }); | |
| 884 | 881 | } |
| 885 | 882 | } |
| 886 | 883 | |
| 887 | 884 | fn suggest_format_align(&mut self, alignment: char) { |
| 888 | 885 | if let Some(pos) = self.consume_pos(alignment) { |
| 889 | 886 | let pos = self.to_span_index(pos); |
| 890 | self.errors.insert( | |
| 891 | 0, | |
| 892 | ParseError { | |
| 893 | description: "expected format parameter to occur after `:`".to_owned(), | |
| 894 | note: None, | |
| 895 | label: format!("expected `{}` to occur after `:`", alignment), | |
| 896 | span: pos.to(pos), | |
| 897 | secondary_label: None, | |
| 898 | suggestion: Suggestion::None, | |
| 899 | }, | |
| 900 | ); | |
| 887 | self.errors.insert(0, ParseError { | |
| 888 | description: "expected format parameter to occur after `:`".to_owned(), | |
| 889 | note: None, | |
| 890 | label: format!("expected `{}` to occur after `:`", alignment), | |
| 891 | span: pos.to(pos), | |
| 892 | secondary_label: None, | |
| 893 | suggestion: Suggestion::None, | |
| 894 | }); | |
| 901 | 895 | } |
| 902 | 896 | } |
| 903 | 897 | |
| ... | ... | @@ -914,36 +908,24 @@ impl<'a> Parser<'a> { |
| 914 | 908 | if let ArgumentNamed(_) = arg.position { |
| 915 | 909 | match field.position { |
| 916 | 910 | ArgumentNamed(_) => { |
| 917 | self.errors.insert( | |
| 918 | 0, | |
| 919 | ParseError { | |
| 920 | description: "field access isn't supported".to_string(), | |
| 921 | note: None, | |
| 922 | label: "not supported".to_string(), | |
| 923 | span: InnerSpan::new( | |
| 924 | arg.position_span.start, | |
| 925 | field.position_span.end, | |
| 926 | ), | |
| 927 | secondary_label: None, | |
| 928 | suggestion: Suggestion::UsePositional, | |
| 929 | }, | |
| 930 | ); | |
| 911 | self.errors.insert(0, ParseError { | |
| 912 | description: "field access isn't supported".to_string(), | |
| 913 | note: None, | |
| 914 | label: "not supported".to_string(), | |
| 915 | span: InnerSpan::new(arg.position_span.start, field.position_span.end), | |
| 916 | secondary_label: None, | |
| 917 | suggestion: Suggestion::UsePositional, | |
| 918 | }); | |
| 931 | 919 | } |
| 932 | 920 | ArgumentIs(_) => { |
| 933 | self.errors.insert( | |
| 934 | 0, | |
| 935 | ParseError { | |
| 936 | description: "tuple index access isn't supported".to_string(), | |
| 937 | note: None, | |
| 938 | label: "not supported".to_string(), | |
| 939 | span: InnerSpan::new( | |
| 940 | arg.position_span.start, | |
| 941 | field.position_span.end, | |
| 942 | ), | |
| 943 | secondary_label: None, | |
| 944 | suggestion: Suggestion::UsePositional, | |
| 945 | }, | |
| 946 | ); | |
| 921 | self.errors.insert(0, ParseError { | |
| 922 | description: "tuple index access isn't supported".to_string(), | |
| 923 | note: None, | |
| 924 | label: "not supported".to_string(), | |
| 925 | span: InnerSpan::new(arg.position_span.start, field.position_span.end), | |
| 926 | secondary_label: None, | |
| 927 | suggestion: Suggestion::UsePositional, | |
| 928 | }); | |
| 947 | 929 | } |
| 948 | 930 | _ => {} |
| 949 | 931 | }; |
compiler/rustc_parse_format/src/tests.rs+290-350| ... | ... | @@ -78,311 +78,307 @@ fn invalid_precision() { |
| 78 | 78 | |
| 79 | 79 | #[test] |
| 80 | 80 | fn format_nothing() { |
| 81 | same( | |
| 82 | "{}", | |
| 83 | &[NextArgument(Box::new(Argument { | |
| 84 | position: ArgumentImplicitlyIs(0), | |
| 85 | position_span: InnerSpan { start: 2, end: 2 }, | |
| 86 | format: fmtdflt(), | |
| 87 | }))], | |
| 88 | ); | |
| 81 | same("{}", &[NextArgument(Box::new(Argument { | |
| 82 | position: ArgumentImplicitlyIs(0), | |
| 83 | position_span: InnerSpan { start: 2, end: 2 }, | |
| 84 | format: fmtdflt(), | |
| 85 | }))]); | |
| 89 | 86 | } |
| 90 | 87 | #[test] |
| 91 | 88 | fn format_position() { |
| 92 | same( | |
| 93 | "{3}", | |
| 94 | &[NextArgument(Box::new(Argument { | |
| 95 | position: ArgumentIs(3), | |
| 96 | position_span: InnerSpan { start: 2, end: 3 }, | |
| 97 | format: fmtdflt(), | |
| 98 | }))], | |
| 99 | ); | |
| 89 | same("{3}", &[NextArgument(Box::new(Argument { | |
| 90 | position: ArgumentIs(3), | |
| 91 | position_span: InnerSpan { start: 2, end: 3 }, | |
| 92 | format: fmtdflt(), | |
| 93 | }))]); | |
| 100 | 94 | } |
| 101 | 95 | #[test] |
| 102 | 96 | fn format_position_nothing_else() { |
| 103 | same( | |
| 104 | "{3:}", | |
| 105 | &[NextArgument(Box::new(Argument { | |
| 106 | position: ArgumentIs(3), | |
| 107 | position_span: InnerSpan { start: 2, end: 3 }, | |
| 108 | format: fmtdflt(), | |
| 109 | }))], | |
| 110 | ); | |
| 97 | same("{3:}", &[NextArgument(Box::new(Argument { | |
| 98 | position: ArgumentIs(3), | |
| 99 | position_span: InnerSpan { start: 2, end: 3 }, | |
| 100 | format: fmtdflt(), | |
| 101 | }))]); | |
| 111 | 102 | } |
| 112 | 103 | #[test] |
| 113 | 104 | fn format_named() { |
| 114 | same( | |
| 115 | "{name}", | |
| 116 | &[NextArgument(Box::new(Argument { | |
| 117 | position: ArgumentNamed("name"), | |
| 118 | position_span: InnerSpan { start: 2, end: 6 }, | |
| 119 | format: fmtdflt(), | |
| 120 | }))], | |
| 121 | ) | |
| 105 | same("{name}", &[NextArgument(Box::new(Argument { | |
| 106 | position: ArgumentNamed("name"), | |
| 107 | position_span: InnerSpan { start: 2, end: 6 }, | |
| 108 | format: fmtdflt(), | |
| 109 | }))]) | |
| 122 | 110 | } |
| 123 | 111 | #[test] |
| 124 | 112 | fn format_type() { |
| 125 | same( | |
| 126 | "{3:x}", | |
| 127 | &[NextArgument(Box::new(Argument { | |
| 128 | position: ArgumentIs(3), | |
| 129 | position_span: InnerSpan { start: 2, end: 3 }, | |
| 130 | format: FormatSpec { | |
| 131 | fill: None, | |
| 132 | fill_span: None, | |
| 133 | align: AlignUnknown, | |
| 134 | sign: None, | |
| 135 | alternate: false, | |
| 136 | zero_pad: false, | |
| 137 | debug_hex: None, | |
| 138 | precision: CountImplied, | |
| 139 | width: CountImplied, | |
| 140 | precision_span: None, | |
| 141 | width_span: None, | |
| 142 | ty: "x", | |
| 143 | ty_span: None, | |
| 144 | }, | |
| 145 | }))], | |
| 146 | ); | |
| 113 | same("{3:x}", &[NextArgument(Box::new(Argument { | |
| 114 | position: ArgumentIs(3), | |
| 115 | position_span: InnerSpan { start: 2, end: 3 }, | |
| 116 | format: FormatSpec { | |
| 117 | fill: None, | |
| 118 | fill_span: None, | |
| 119 | align: AlignUnknown, | |
| 120 | sign: None, | |
| 121 | alternate: false, | |
| 122 | zero_pad: false, | |
| 123 | debug_hex: None, | |
| 124 | precision: CountImplied, | |
| 125 | width: CountImplied, | |
| 126 | precision_span: None, | |
| 127 | width_span: None, | |
| 128 | ty: "x", | |
| 129 | ty_span: None, | |
| 130 | }, | |
| 131 | }))]); | |
| 147 | 132 | } |
| 148 | 133 | #[test] |
| 149 | 134 | fn format_align_fill() { |
| 150 | same( | |
| 151 | "{3:>}", | |
| 152 | &[NextArgument(Box::new(Argument { | |
| 153 | position: ArgumentIs(3), | |
| 154 | position_span: InnerSpan { start: 2, end: 3 }, | |
| 155 | format: FormatSpec { | |
| 156 | fill: None, | |
| 157 | fill_span: None, | |
| 158 | align: AlignRight, | |
| 159 | sign: None, | |
| 160 | alternate: false, | |
| 161 | zero_pad: false, | |
| 162 | debug_hex: None, | |
| 163 | precision: CountImplied, | |
| 164 | width: CountImplied, | |
| 165 | precision_span: None, | |
| 166 | width_span: None, | |
| 167 | ty: "", | |
| 168 | ty_span: None, | |
| 169 | }, | |
| 170 | }))], | |
| 171 | ); | |
| 172 | same( | |
| 173 | "{3:0<}", | |
| 174 | &[NextArgument(Box::new(Argument { | |
| 175 | position: ArgumentIs(3), | |
| 176 | position_span: InnerSpan { start: 2, end: 3 }, | |
| 177 | format: FormatSpec { | |
| 178 | fill: Some('0'), | |
| 179 | fill_span: Some(InnerSpan::new(4, 5)), | |
| 180 | align: AlignLeft, | |
| 181 | sign: None, | |
| 182 | alternate: false, | |
| 183 | zero_pad: false, | |
| 184 | debug_hex: None, | |
| 185 | precision: CountImplied, | |
| 186 | width: CountImplied, | |
| 187 | precision_span: None, | |
| 188 | width_span: None, | |
| 189 | ty: "", | |
| 190 | ty_span: None, | |
| 191 | }, | |
| 192 | }))], | |
| 193 | ); | |
| 194 | same( | |
| 195 | "{3:*<abcd}", | |
| 196 | &[NextArgument(Box::new(Argument { | |
| 197 | position: ArgumentIs(3), | |
| 198 | position_span: InnerSpan { start: 2, end: 3 }, | |
| 199 | format: FormatSpec { | |
| 200 | fill: Some('*'), | |
| 201 | fill_span: Some(InnerSpan::new(4, 5)), | |
| 202 | align: AlignLeft, | |
| 203 | sign: None, | |
| 204 | alternate: false, | |
| 205 | zero_pad: false, | |
| 206 | debug_hex: None, | |
| 207 | precision: CountImplied, | |
| 208 | width: CountImplied, | |
| 209 | precision_span: None, | |
| 210 | width_span: None, | |
| 211 | ty: "abcd", | |
| 212 | ty_span: Some(InnerSpan::new(6, 10)), | |
| 213 | }, | |
| 214 | }))], | |
| 215 | ); | |
| 135 | same("{3:>}", &[NextArgument(Box::new(Argument { | |
| 136 | position: ArgumentIs(3), | |
| 137 | position_span: InnerSpan { start: 2, end: 3 }, | |
| 138 | format: FormatSpec { | |
| 139 | fill: None, | |
| 140 | fill_span: None, | |
| 141 | align: AlignRight, | |
| 142 | sign: None, | |
| 143 | alternate: false, | |
| 144 | zero_pad: false, | |
| 145 | debug_hex: None, | |
| 146 | precision: CountImplied, | |
| 147 | width: CountImplied, | |
| 148 | precision_span: None, | |
| 149 | width_span: None, | |
| 150 | ty: "", | |
| 151 | ty_span: None, | |
| 152 | }, | |
| 153 | }))]); | |
| 154 | same("{3:0<}", &[NextArgument(Box::new(Argument { | |
| 155 | position: ArgumentIs(3), | |
| 156 | position_span: InnerSpan { start: 2, end: 3 }, | |
| 157 | format: FormatSpec { | |
| 158 | fill: Some('0'), | |
| 159 | fill_span: Some(InnerSpan::new(4, 5)), | |
| 160 | align: AlignLeft, | |
| 161 | sign: None, | |
| 162 | alternate: false, | |
| 163 | zero_pad: false, | |
| 164 | debug_hex: None, | |
| 165 | precision: CountImplied, | |
| 166 | width: CountImplied, | |
| 167 | precision_span: None, | |
| 168 | width_span: None, | |
| 169 | ty: "", | |
| 170 | ty_span: None, | |
| 171 | }, | |
| 172 | }))]); | |
| 173 | same("{3:*<abcd}", &[NextArgument(Box::new(Argument { | |
| 174 | position: ArgumentIs(3), | |
| 175 | position_span: InnerSpan { start: 2, end: 3 }, | |
| 176 | format: FormatSpec { | |
| 177 | fill: Some('*'), | |
| 178 | fill_span: Some(InnerSpan::new(4, 5)), | |
| 179 | align: AlignLeft, | |
| 180 | sign: None, | |
| 181 | alternate: false, | |
| 182 | zero_pad: false, | |
| 183 | debug_hex: None, | |
| 184 | precision: CountImplied, | |
| 185 | width: CountImplied, | |
| 186 | precision_span: None, | |
| 187 | width_span: None, | |
| 188 | ty: "abcd", | |
| 189 | ty_span: Some(InnerSpan::new(6, 10)), | |
| 190 | }, | |
| 191 | }))]); | |
| 216 | 192 | } |
| 217 | 193 | #[test] |
| 218 | 194 | fn format_counts() { |
| 219 | same( | |
| 220 | "{:10x}", | |
| 221 | &[NextArgument(Box::new(Argument { | |
| 222 | position: ArgumentImplicitlyIs(0), | |
| 223 | position_span: InnerSpan { start: 2, end: 2 }, | |
| 224 | format: FormatSpec { | |
| 225 | fill: None, | |
| 226 | fill_span: None, | |
| 227 | align: AlignUnknown, | |
| 228 | sign: None, | |
| 229 | alternate: false, | |
| 230 | zero_pad: false, | |
| 231 | debug_hex: None, | |
| 232 | precision: CountImplied, | |
| 233 | precision_span: None, | |
| 234 | width: CountIs(10), | |
| 235 | width_span: Some(InnerSpan { start: 3, end: 5 }), | |
| 236 | ty: "x", | |
| 237 | ty_span: None, | |
| 238 | }, | |
| 239 | }))], | |
| 240 | ); | |
| 241 | same( | |
| 242 | "{:10$.10x}", | |
| 243 | &[NextArgument(Box::new(Argument { | |
| 244 | position: ArgumentImplicitlyIs(0), | |
| 245 | position_span: InnerSpan { start: 2, end: 2 }, | |
| 246 | format: FormatSpec { | |
| 247 | fill: None, | |
| 248 | fill_span: None, | |
| 249 | align: AlignUnknown, | |
| 250 | sign: None, | |
| 251 | alternate: false, | |
| 252 | zero_pad: false, | |
| 253 | debug_hex: None, | |
| 254 | precision: CountIs(10), | |
| 255 | precision_span: Some(InnerSpan { start: 6, end: 9 }), | |
| 256 | width: CountIsParam(10), | |
| 257 | width_span: Some(InnerSpan { start: 3, end: 6 }), | |
| 258 | ty: "x", | |
| 259 | ty_span: None, | |
| 260 | }, | |
| 261 | }))], | |
| 262 | ); | |
| 263 | same( | |
| 264 | "{1:0$.10x}", | |
| 265 | &[NextArgument(Box::new(Argument { | |
| 266 | position: ArgumentIs(1), | |
| 267 | position_span: InnerSpan { start: 2, end: 3 }, | |
| 268 | format: FormatSpec { | |
| 269 | fill: None, | |
| 270 | fill_span: None, | |
| 271 | align: AlignUnknown, | |
| 272 | sign: None, | |
| 273 | alternate: false, | |
| 274 | zero_pad: false, | |
| 275 | debug_hex: None, | |
| 276 | precision: CountIs(10), | |
| 277 | precision_span: Some(InnerSpan { start: 6, end: 9 }), | |
| 278 | width: CountIsParam(0), | |
| 279 | width_span: Some(InnerSpan { start: 4, end: 6 }), | |
| 280 | ty: "x", | |
| 281 | ty_span: None, | |
| 282 | }, | |
| 283 | }))], | |
| 284 | ); | |
| 285 | same( | |
| 286 | "{:.*x}", | |
| 287 | &[NextArgument(Box::new(Argument { | |
| 288 | position: ArgumentImplicitlyIs(1), | |
| 289 | position_span: InnerSpan { start: 2, end: 2 }, | |
| 290 | format: FormatSpec { | |
| 291 | fill: None, | |
| 292 | fill_span: None, | |
| 293 | align: AlignUnknown, | |
| 294 | sign: None, | |
| 295 | alternate: false, | |
| 296 | zero_pad: false, | |
| 297 | debug_hex: None, | |
| 298 | precision: CountIsStar(0), | |
| 299 | precision_span: Some(InnerSpan { start: 3, end: 5 }), | |
| 300 | width: CountImplied, | |
| 301 | width_span: None, | |
| 302 | ty: "x", | |
| 303 | ty_span: None, | |
| 304 | }, | |
| 305 | }))], | |
| 306 | ); | |
| 307 | same( | |
| 308 | "{:.10$x}", | |
| 309 | &[NextArgument(Box::new(Argument { | |
| 310 | position: ArgumentImplicitlyIs(0), | |
| 311 | position_span: InnerSpan { start: 2, end: 2 }, | |
| 312 | format: FormatSpec { | |
| 313 | fill: None, | |
| 314 | fill_span: None, | |
| 315 | align: AlignUnknown, | |
| 316 | sign: None, | |
| 317 | alternate: false, | |
| 318 | zero_pad: false, | |
| 319 | debug_hex: None, | |
| 320 | precision: CountIsParam(10), | |
| 321 | width: CountImplied, | |
| 322 | precision_span: Some(InnerSpan::new(3, 7)), | |
| 323 | width_span: None, | |
| 324 | ty: "x", | |
| 325 | ty_span: None, | |
| 326 | }, | |
| 327 | }))], | |
| 328 | ); | |
| 329 | same( | |
| 330 | "{:a$.b$?}", | |
| 331 | &[NextArgument(Box::new(Argument { | |
| 332 | position: ArgumentImplicitlyIs(0), | |
| 333 | position_span: InnerSpan { start: 2, end: 2 }, | |
| 334 | format: FormatSpec { | |
| 335 | fill: None, | |
| 336 | fill_span: None, | |
| 337 | align: AlignUnknown, | |
| 338 | sign: None, | |
| 339 | alternate: false, | |
| 340 | zero_pad: false, | |
| 341 | debug_hex: None, | |
| 342 | precision: CountIsName("b", InnerSpan { start: 6, end: 7 }), | |
| 343 | precision_span: Some(InnerSpan { start: 5, end: 8 }), | |
| 344 | width: CountIsName("a", InnerSpan { start: 3, end: 4 }), | |
| 345 | width_span: Some(InnerSpan { start: 3, end: 5 }), | |
| 346 | ty: "?", | |
| 347 | ty_span: None, | |
| 348 | }, | |
| 349 | }))], | |
| 350 | ); | |
| 351 | same( | |
| 352 | "{:.4}", | |
| 353 | &[NextArgument(Box::new(Argument { | |
| 354 | position: ArgumentImplicitlyIs(0), | |
| 355 | position_span: InnerSpan { start: 2, end: 2 }, | |
| 356 | format: FormatSpec { | |
| 357 | fill: None, | |
| 358 | fill_span: None, | |
| 359 | align: AlignUnknown, | |
| 360 | sign: None, | |
| 361 | alternate: false, | |
| 362 | zero_pad: false, | |
| 363 | debug_hex: None, | |
| 364 | precision: CountIs(4), | |
| 365 | precision_span: Some(InnerSpan { start: 3, end: 5 }), | |
| 366 | width: CountImplied, | |
| 367 | width_span: None, | |
| 368 | ty: "", | |
| 369 | ty_span: None, | |
| 370 | }, | |
| 371 | }))], | |
| 372 | ) | |
| 195 | same("{:10x}", &[NextArgument(Box::new(Argument { | |
| 196 | position: ArgumentImplicitlyIs(0), | |
| 197 | position_span: InnerSpan { start: 2, end: 2 }, | |
| 198 | format: FormatSpec { | |
| 199 | fill: None, | |
| 200 | fill_span: None, | |
| 201 | align: AlignUnknown, | |
| 202 | sign: None, | |
| 203 | alternate: false, | |
| 204 | zero_pad: false, | |
| 205 | debug_hex: None, | |
| 206 | precision: CountImplied, | |
| 207 | precision_span: None, | |
| 208 | width: CountIs(10), | |
| 209 | width_span: Some(InnerSpan { start: 3, end: 5 }), | |
| 210 | ty: "x", | |
| 211 | ty_span: None, | |
| 212 | }, | |
| 213 | }))]); | |
| 214 | same("{:10$.10x}", &[NextArgument(Box::new(Argument { | |
| 215 | position: ArgumentImplicitlyIs(0), | |
| 216 | position_span: InnerSpan { start: 2, end: 2 }, | |
| 217 | format: FormatSpec { | |
| 218 | fill: None, | |
| 219 | fill_span: None, | |
| 220 | align: AlignUnknown, | |
| 221 | sign: None, | |
| 222 | alternate: false, | |
| 223 | zero_pad: false, | |
| 224 | debug_hex: None, | |
| 225 | precision: CountIs(10), | |
| 226 | precision_span: Some(InnerSpan { start: 6, end: 9 }), | |
| 227 | width: CountIsParam(10), | |
| 228 | width_span: Some(InnerSpan { start: 3, end: 6 }), | |
| 229 | ty: "x", | |
| 230 | ty_span: None, | |
| 231 | }, | |
| 232 | }))]); | |
| 233 | same("{1:0$.10x}", &[NextArgument(Box::new(Argument { | |
| 234 | position: ArgumentIs(1), | |
| 235 | position_span: InnerSpan { start: 2, end: 3 }, | |
| 236 | format: FormatSpec { | |
| 237 | fill: None, | |
| 238 | fill_span: None, | |
| 239 | align: AlignUnknown, | |
| 240 | sign: None, | |
| 241 | alternate: false, | |
| 242 | zero_pad: false, | |
| 243 | debug_hex: None, | |
| 244 | precision: CountIs(10), | |
| 245 | precision_span: Some(InnerSpan { start: 6, end: 9 }), | |
| 246 | width: CountIsParam(0), | |
| 247 | width_span: Some(InnerSpan { start: 4, end: 6 }), | |
| 248 | ty: "x", | |
| 249 | ty_span: None, | |
| 250 | }, | |
| 251 | }))]); | |
| 252 | same("{:.*x}", &[NextArgument(Box::new(Argument { | |
| 253 | position: ArgumentImplicitlyIs(1), | |
| 254 | position_span: InnerSpan { start: 2, end: 2 }, | |
| 255 | format: FormatSpec { | |
| 256 | fill: None, | |
| 257 | fill_span: None, | |
| 258 | align: AlignUnknown, | |
| 259 | sign: None, | |
| 260 | alternate: false, | |
| 261 | zero_pad: false, | |
| 262 | debug_hex: None, | |
| 263 | precision: CountIsStar(0), | |
| 264 | precision_span: Some(InnerSpan { start: 3, end: 5 }), | |
| 265 | width: CountImplied, | |
| 266 | width_span: None, | |
| 267 | ty: "x", | |
| 268 | ty_span: None, | |
| 269 | }, | |
| 270 | }))]); | |
| 271 | same("{:.10$x}", &[NextArgument(Box::new(Argument { | |
| 272 | position: ArgumentImplicitlyIs(0), | |
| 273 | position_span: InnerSpan { start: 2, end: 2 }, | |
| 274 | format: FormatSpec { | |
| 275 | fill: None, | |
| 276 | fill_span: None, | |
| 277 | align: AlignUnknown, | |
| 278 | sign: None, | |
| 279 | alternate: false, | |
| 280 | zero_pad: false, | |
| 281 | debug_hex: None, | |
| 282 | precision: CountIsParam(10), | |
| 283 | width: CountImplied, | |
| 284 | precision_span: Some(InnerSpan::new(3, 7)), | |
| 285 | width_span: None, | |
| 286 | ty: "x", | |
| 287 | ty_span: None, | |
| 288 | }, | |
| 289 | }))]); | |
| 290 | same("{:a$.b$?}", &[NextArgument(Box::new(Argument { | |
| 291 | position: ArgumentImplicitlyIs(0), | |
| 292 | position_span: InnerSpan { start: 2, end: 2 }, | |
| 293 | format: FormatSpec { | |
| 294 | fill: None, | |
| 295 | fill_span: None, | |
| 296 | align: AlignUnknown, | |
| 297 | sign: None, | |
| 298 | alternate: false, | |
| 299 | zero_pad: false, | |
| 300 | debug_hex: None, | |
| 301 | precision: CountIsName("b", InnerSpan { start: 6, end: 7 }), | |
| 302 | precision_span: Some(InnerSpan { start: 5, end: 8 }), | |
| 303 | width: CountIsName("a", InnerSpan { start: 3, end: 4 }), | |
| 304 | width_span: Some(InnerSpan { start: 3, end: 5 }), | |
| 305 | ty: "?", | |
| 306 | ty_span: None, | |
| 307 | }, | |
| 308 | }))]); | |
| 309 | same("{:.4}", &[NextArgument(Box::new(Argument { | |
| 310 | position: ArgumentImplicitlyIs(0), | |
| 311 | position_span: InnerSpan { start: 2, end: 2 }, | |
| 312 | format: FormatSpec { | |
| 313 | fill: None, | |
| 314 | fill_span: None, | |
| 315 | align: AlignUnknown, | |
| 316 | sign: None, | |
| 317 | alternate: false, | |
| 318 | zero_pad: false, | |
| 319 | debug_hex: None, | |
| 320 | precision: CountIs(4), | |
| 321 | precision_span: Some(InnerSpan { start: 3, end: 5 }), | |
| 322 | width: CountImplied, | |
| 323 | width_span: None, | |
| 324 | ty: "", | |
| 325 | ty_span: None, | |
| 326 | }, | |
| 327 | }))]) | |
| 373 | 328 | } |
| 374 | 329 | #[test] |
| 375 | 330 | fn format_flags() { |
| 376 | same( | |
| 377 | "{:-}", | |
| 378 | &[NextArgument(Box::new(Argument { | |
| 379 | position: ArgumentImplicitlyIs(0), | |
| 380 | position_span: InnerSpan { start: 2, end: 2 }, | |
| 331 | same("{:-}", &[NextArgument(Box::new(Argument { | |
| 332 | position: ArgumentImplicitlyIs(0), | |
| 333 | position_span: InnerSpan { start: 2, end: 2 }, | |
| 334 | format: FormatSpec { | |
| 335 | fill: None, | |
| 336 | fill_span: None, | |
| 337 | align: AlignUnknown, | |
| 338 | sign: Some(Sign::Minus), | |
| 339 | alternate: false, | |
| 340 | zero_pad: false, | |
| 341 | debug_hex: None, | |
| 342 | precision: CountImplied, | |
| 343 | width: CountImplied, | |
| 344 | precision_span: None, | |
| 345 | width_span: None, | |
| 346 | ty: "", | |
| 347 | ty_span: None, | |
| 348 | }, | |
| 349 | }))]); | |
| 350 | same("{:+#}", &[NextArgument(Box::new(Argument { | |
| 351 | position: ArgumentImplicitlyIs(0), | |
| 352 | position_span: InnerSpan { start: 2, end: 2 }, | |
| 353 | format: FormatSpec { | |
| 354 | fill: None, | |
| 355 | fill_span: None, | |
| 356 | align: AlignUnknown, | |
| 357 | sign: Some(Sign::Plus), | |
| 358 | alternate: true, | |
| 359 | zero_pad: false, | |
| 360 | debug_hex: None, | |
| 361 | precision: CountImplied, | |
| 362 | width: CountImplied, | |
| 363 | precision_span: None, | |
| 364 | width_span: None, | |
| 365 | ty: "", | |
| 366 | ty_span: None, | |
| 367 | }, | |
| 368 | }))]); | |
| 369 | } | |
| 370 | #[test] | |
| 371 | fn format_mixture() { | |
| 372 | same("abcd {3:x} efg", &[ | |
| 373 | String("abcd "), | |
| 374 | NextArgument(Box::new(Argument { | |
| 375 | position: ArgumentIs(3), | |
| 376 | position_span: InnerSpan { start: 7, end: 8 }, | |
| 381 | 377 | format: FormatSpec { |
| 382 | 378 | fill: None, |
| 383 | 379 | fill_span: None, |
| 384 | 380 | align: AlignUnknown, |
| 385 | sign: Some(Sign::Minus), | |
| 381 | sign: None, | |
| 386 | 382 | alternate: false, |
| 387 | 383 | zero_pad: false, |
| 388 | 384 | debug_hex: None, |
| ... | ... | @@ -390,79 +386,23 @@ fn format_flags() { |
| 390 | 386 | width: CountImplied, |
| 391 | 387 | precision_span: None, |
| 392 | 388 | width_span: None, |
| 393 | ty: "", | |
| 394 | ty_span: None, | |
| 395 | }, | |
| 396 | }))], | |
| 397 | ); | |
| 398 | same( | |
| 399 | "{:+#}", | |
| 400 | &[NextArgument(Box::new(Argument { | |
| 401 | position: ArgumentImplicitlyIs(0), | |
| 402 | position_span: InnerSpan { start: 2, end: 2 }, | |
| 403 | format: FormatSpec { | |
| 404 | fill: None, | |
| 405 | fill_span: None, | |
| 406 | align: AlignUnknown, | |
| 407 | sign: Some(Sign::Plus), | |
| 408 | alternate: true, | |
| 409 | zero_pad: false, | |
| 410 | debug_hex: None, | |
| 411 | precision: CountImplied, | |
| 412 | width: CountImplied, | |
| 413 | precision_span: None, | |
| 414 | width_span: None, | |
| 415 | ty: "", | |
| 389 | ty: "x", | |
| 416 | 390 | ty_span: None, |
| 417 | 391 | }, |
| 418 | }))], | |
| 419 | ); | |
| 420 | } | |
| 421 | #[test] | |
| 422 | fn format_mixture() { | |
| 423 | same( | |
| 424 | "abcd {3:x} efg", | |
| 425 | &[ | |
| 426 | String("abcd "), | |
| 427 | NextArgument(Box::new(Argument { | |
| 428 | position: ArgumentIs(3), | |
| 429 | position_span: InnerSpan { start: 7, end: 8 }, | |
| 430 | format: FormatSpec { | |
| 431 | fill: None, | |
| 432 | fill_span: None, | |
| 433 | align: AlignUnknown, | |
| 434 | sign: None, | |
| 435 | alternate: false, | |
| 436 | zero_pad: false, | |
| 437 | debug_hex: None, | |
| 438 | precision: CountImplied, | |
| 439 | width: CountImplied, | |
| 440 | precision_span: None, | |
| 441 | width_span: None, | |
| 442 | ty: "x", | |
| 443 | ty_span: None, | |
| 444 | }, | |
| 445 | })), | |
| 446 | String(" efg"), | |
| 447 | ], | |
| 448 | ); | |
| 392 | })), | |
| 393 | String(" efg"), | |
| 394 | ]); | |
| 449 | 395 | } |
| 450 | 396 | #[test] |
| 451 | 397 | fn format_whitespace() { |
| 452 | same( | |
| 453 | "{ }", | |
| 454 | &[NextArgument(Box::new(Argument { | |
| 455 | position: ArgumentImplicitlyIs(0), | |
| 456 | position_span: InnerSpan { start: 2, end: 3 }, | |
| 457 | format: fmtdflt(), | |
| 458 | }))], | |
| 459 | ); | |
| 460 | same( | |
| 461 | "{ }", | |
| 462 | &[NextArgument(Box::new(Argument { | |
| 463 | position: ArgumentImplicitlyIs(0), | |
| 464 | position_span: InnerSpan { start: 2, end: 4 }, | |
| 465 | format: fmtdflt(), | |
| 466 | }))], | |
| 467 | ); | |
| 398 | same("{ }", &[NextArgument(Box::new(Argument { | |
| 399 | position: ArgumentImplicitlyIs(0), | |
| 400 | position_span: InnerSpan { start: 2, end: 3 }, | |
| 401 | format: fmtdflt(), | |
| 402 | }))]); | |
| 403 | same("{ }", &[NextArgument(Box::new(Argument { | |
| 404 | position: ArgumentImplicitlyIs(0), | |
| 405 | position_span: InnerSpan { start: 2, end: 4 }, | |
| 406 | format: fmtdflt(), | |
| 407 | }))]); | |
| 468 | 408 | } |
compiler/rustc_passes/src/check_attr.rs+19-30| ... | ... | @@ -8,16 +8,16 @@ use std::cell::Cell; |
| 8 | 8 | use std::collections::hash_map::Entry; |
| 9 | 9 | |
| 10 | 10 | use rustc_ast::{ |
| 11 | ast, AttrKind, AttrStyle, Attribute, LitKind, MetaItemKind, MetaItemLit, NestedMetaItem, | |
| 11 | AttrKind, AttrStyle, Attribute, LitKind, MetaItemKind, MetaItemLit, NestedMetaItem, ast, | |
| 12 | 12 | }; |
| 13 | 13 | use rustc_data_structures::fx::FxHashMap; |
| 14 | 14 | use rustc_errors::{Applicability, DiagCtxtHandle, IntoDiagArg, MultiSpan, StashKey}; |
| 15 | use rustc_feature::{AttributeDuplicates, AttributeType, BuiltinAttribute, BUILTIN_ATTRIBUTE_MAP}; | |
| 15 | use rustc_feature::{AttributeDuplicates, AttributeType, BUILTIN_ATTRIBUTE_MAP, BuiltinAttribute}; | |
| 16 | 16 | use rustc_hir::def_id::LocalModDefId; |
| 17 | 17 | use rustc_hir::intravisit::{self, Visitor}; |
| 18 | 18 | use rustc_hir::{ |
| 19 | self as hir, self, FnSig, ForeignItem, HirId, Item, ItemKind, MethodKind, Safety, Target, | |
| 20 | TraitItem, CRATE_HIR_ID, CRATE_OWNER_ID, | |
| 19 | self as hir, self, CRATE_HIR_ID, CRATE_OWNER_ID, FnSig, ForeignItem, HirId, Item, ItemKind, | |
| 20 | MethodKind, Safety, Target, TraitItem, | |
| 21 | 21 | }; |
| 22 | 22 | use rustc_macros::LintDiagnostic; |
| 23 | 23 | use rustc_middle::hir::nested_filter; |
| ... | ... | @@ -32,8 +32,8 @@ use rustc_session::lint::builtin::{ |
| 32 | 32 | UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES, UNUSED_ATTRIBUTES, |
| 33 | 33 | }; |
| 34 | 34 | use rustc_session::parse::feature_err; |
| 35 | use rustc_span::symbol::{kw, sym, Symbol}; | |
| 36 | use rustc_span::{BytePos, Span, DUMMY_SP}; | |
| 35 | use rustc_span::symbol::{Symbol, kw, sym}; | |
| 36 | use rustc_span::{BytePos, DUMMY_SP, Span}; | |
| 37 | 37 | use rustc_target::spec::abi::Abi; |
| 38 | 38 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; |
| 39 | 39 | use rustc_trait_selection::infer::{TyCtxtInferExt, ValuePairs}; |
| ... | ... | @@ -344,12 +344,8 @@ impl<'tcx> CheckAttrVisitor<'tcx> { |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | fn inline_attr_str_error_without_macro_def(&self, hir_id: HirId, attr: &Attribute, sym: &str) { |
| 347 | self.tcx.emit_node_span_lint( | |
| 348 | UNUSED_ATTRIBUTES, | |
| 349 | hir_id, | |
| 350 | attr.span, | |
| 351 | errors::IgnoredAttr { sym }, | |
| 352 | ); | |
| 347 | self.tcx | |
| 348 | .emit_node_span_lint(UNUSED_ATTRIBUTES, hir_id, attr.span, errors::IgnoredAttr { sym }); | |
| 353 | 349 | } |
| 354 | 350 | |
| 355 | 351 | /// Checks if `#[diagnostic::do_not_recommend]` is applied on a trait impl. |
| ... | ... | @@ -1396,12 +1392,10 @@ impl<'tcx> CheckAttrVisitor<'tcx> { |
| 1396 | 1392 | _ => { |
| 1397 | 1393 | // FIXME: #[cold] was previously allowed on non-functions and some crates used |
| 1398 | 1394 | // this, so only emit a warning. |
| 1399 | self.tcx.emit_node_span_lint( | |
| 1400 | UNUSED_ATTRIBUTES, | |
| 1401 | hir_id, | |
| 1402 | attr.span, | |
| 1403 | errors::Cold { span, on_crate: hir_id == CRATE_HIR_ID }, | |
| 1404 | ); | |
| 1395 | self.tcx.emit_node_span_lint(UNUSED_ATTRIBUTES, hir_id, attr.span, errors::Cold { | |
| 1396 | span, | |
| 1397 | on_crate: hir_id == CRATE_HIR_ID, | |
| 1398 | }); | |
| 1405 | 1399 | } |
| 1406 | 1400 | } |
| 1407 | 1401 | } |
| ... | ... | @@ -1416,12 +1410,9 @@ impl<'tcx> CheckAttrVisitor<'tcx> { |
| 1416 | 1410 | return; |
| 1417 | 1411 | } |
| 1418 | 1412 | |
| 1419 | self.tcx.emit_node_span_lint( | |
| 1420 | UNUSED_ATTRIBUTES, | |
| 1421 | hir_id, | |
| 1422 | attr.span, | |
| 1423 | errors::Link { span: (target != Target::ForeignMod).then_some(span) }, | |
| 1424 | ); | |
| 1413 | self.tcx.emit_node_span_lint(UNUSED_ATTRIBUTES, hir_id, attr.span, errors::Link { | |
| 1414 | span: (target != Target::ForeignMod).then_some(span), | |
| 1415 | }); | |
| 1425 | 1416 | } |
| 1426 | 1417 | |
| 1427 | 1418 | /// Checks if `#[link_name]` is applied to an item other than a foreign function or static. |
| ... | ... | @@ -2210,12 +2201,10 @@ impl<'tcx> CheckAttrVisitor<'tcx> { |
| 2210 | 2201 | return; |
| 2211 | 2202 | }; |
| 2212 | 2203 | |
| 2213 | self.tcx.emit_node_span_lint( | |
| 2214 | UNUSED_ATTRIBUTES, | |
| 2215 | hir_id, | |
| 2216 | attr.span, | |
| 2217 | errors::Unused { attr_span: attr.span, note }, | |
| 2218 | ); | |
| 2204 | self.tcx.emit_node_span_lint(UNUSED_ATTRIBUTES, hir_id, attr.span, errors::Unused { | |
| 2205 | attr_span: attr.span, | |
| 2206 | note, | |
| 2207 | }); | |
| 2219 | 2208 | } |
| 2220 | 2209 | |
| 2221 | 2210 | /// A best effort attempt to create an error for a mismatching proc macro signature. |
compiler/rustc_passes/src/check_const.rs+1-1| ... | ... | @@ -14,7 +14,7 @@ use rustc_middle::query::Providers; |
| 14 | 14 | use rustc_middle::span_bug; |
| 15 | 15 | use rustc_middle::ty::TyCtxt; |
| 16 | 16 | use rustc_session::parse::feature_err; |
| 17 | use rustc_span::{sym, Span, Symbol}; | |
| 17 | use rustc_span::{Span, Symbol, sym}; | |
| 18 | 18 | use {rustc_attr as attr, rustc_hir as hir}; |
| 19 | 19 | |
| 20 | 20 | use crate::errors::SkippingConstChecks; |
compiler/rustc_passes/src/dead.rs+2-2| ... | ... | @@ -5,8 +5,8 @@ |
| 5 | 5 | |
| 6 | 6 | use std::mem; |
| 7 | 7 | |
| 8 | use hir::def_id::{LocalDefIdMap, LocalDefIdSet}; | |
| 9 | 8 | use hir::ItemKind; |
| 9 | use hir::def_id::{LocalDefIdMap, LocalDefIdSet}; | |
| 10 | 10 | use rustc_data_structures::unord::UnordSet; |
| 11 | 11 | use rustc_errors::MultiSpan; |
| 12 | 12 | use rustc_hir as hir; |
| ... | ... | @@ -21,7 +21,7 @@ use rustc_middle::ty::{self, TyCtxt}; |
| 21 | 21 | use rustc_middle::{bug, span_bug}; |
| 22 | 22 | use rustc_session::lint; |
| 23 | 23 | use rustc_session::lint::builtin::DEAD_CODE; |
| 24 | use rustc_span::symbol::{sym, Symbol}; | |
| 24 | use rustc_span::symbol::{Symbol, sym}; | |
| 25 | 25 | use rustc_target::abi::FieldIdx; |
| 26 | 26 | |
| 27 | 27 | use crate::errors::{ |
compiler/rustc_passes/src/diagnostic_items.rs+2-2| ... | ... | @@ -10,12 +10,12 @@ |
| 10 | 10 | //! * Compiler internal types like `Ty` and `TyCtxt` |
| 11 | 11 | |
| 12 | 12 | use rustc_ast as ast; |
| 13 | use rustc_hir::diagnostic_items::DiagnosticItems; | |
| 14 | 13 | use rustc_hir::OwnerId; |
| 14 | use rustc_hir::diagnostic_items::DiagnosticItems; | |
| 15 | 15 | use rustc_middle::query::{LocalCrate, Providers}; |
| 16 | 16 | use rustc_middle::ty::TyCtxt; |
| 17 | 17 | use rustc_span::def_id::{DefId, LOCAL_CRATE}; |
| 18 | use rustc_span::symbol::{sym, Symbol}; | |
| 18 | use rustc_span::symbol::{Symbol, sym}; | |
| 19 | 19 | |
| 20 | 20 | use crate::errors::DuplicateDiagnosticItemInCrate; |
| 21 | 21 |
compiler/rustc_passes/src/entry.rs+3-3| ... | ... | @@ -2,12 +2,12 @@ use rustc_ast::attr; |
| 2 | 2 | use rustc_ast::entry::EntryPointType; |
| 3 | 3 | use rustc_errors::codes::*; |
| 4 | 4 | use rustc_hir::def::DefKind; |
| 5 | use rustc_hir::def_id::{DefId, LocalDefId, CRATE_DEF_ID, LOCAL_CRATE}; | |
| 6 | use rustc_hir::{ItemId, Node, CRATE_HIR_ID}; | |
| 5 | use rustc_hir::def_id::{CRATE_DEF_ID, DefId, LOCAL_CRATE, LocalDefId}; | |
| 6 | use rustc_hir::{CRATE_HIR_ID, ItemId, Node}; | |
| 7 | 7 | use rustc_middle::query::Providers; |
| 8 | 8 | use rustc_middle::ty::TyCtxt; |
| 9 | use rustc_session::config::{sigpipe, CrateType, EntryFnType, RemapPathScopeComponents}; | |
| 10 | 9 | use rustc_session::RemapFileNameExt; |
| 10 | use rustc_session::config::{CrateType, EntryFnType, RemapPathScopeComponents, sigpipe}; | |
| 11 | 11 | use rustc_span::symbol::sym; |
| 12 | 12 | use rustc_span::{Span, Symbol}; |
| 13 | 13 |
compiler/rustc_passes/src/errors.rs+6-10| ... | ... | @@ -10,7 +10,7 @@ use rustc_errors::{ |
| 10 | 10 | use rustc_hir::{self as hir, ExprKind, Target}; |
| 11 | 11 | use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic}; |
| 12 | 12 | use rustc_middle::ty::{MainDefinition, Ty}; |
| 13 | use rustc_span::{Span, Symbol, DUMMY_SP}; | |
| 13 | use rustc_span::{DUMMY_SP, Span, Symbol}; | |
| 14 | 14 | |
| 15 | 15 | use crate::check_attr::ProcMacroKind; |
| 16 | 16 | use crate::fluent_generated as fluent; |
| ... | ... | @@ -1337,15 +1337,11 @@ pub(crate) struct DuplicateLangItem { |
| 1337 | 1337 | impl<G: EmissionGuarantee> Diagnostic<'_, G> for DuplicateLangItem { |
| 1338 | 1338 | #[track_caller] |
| 1339 | 1339 | fn into_diag(self, dcx: DiagCtxtHandle<'_>, level: Level) -> Diag<'_, G> { |
| 1340 | let mut diag = Diag::new( | |
| 1341 | dcx, | |
| 1342 | level, | |
| 1343 | match self.duplicate { | |
| 1344 | Duplicate::Plain => fluent::passes_duplicate_lang_item, | |
| 1345 | Duplicate::Crate => fluent::passes_duplicate_lang_item_crate, | |
| 1346 | Duplicate::CrateDepends => fluent::passes_duplicate_lang_item_crate_depends, | |
| 1347 | }, | |
| 1348 | ); | |
| 1340 | let mut diag = Diag::new(dcx, level, match self.duplicate { | |
| 1341 | Duplicate::Plain => fluent::passes_duplicate_lang_item, | |
| 1342 | Duplicate::Crate => fluent::passes_duplicate_lang_item_crate, | |
| 1343 | Duplicate::CrateDepends => fluent::passes_duplicate_lang_item_crate_depends, | |
| 1344 | }); | |
| 1349 | 1345 | diag.code(E0152); |
| 1350 | 1346 | diag.arg("lang_item_name", self.lang_item_name); |
| 1351 | 1347 | diag.arg("crate_name", self.crate_name); |
compiler/rustc_passes/src/hir_id_validator.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use rustc_data_structures::sync::Lock; |
| 2 | 2 | use rustc_hir as hir; |
| 3 | 3 | use rustc_hir::def_id::LocalDefId; |
| 4 | use rustc_hir::{intravisit, HirId, ItemLocalId}; | |
| 4 | use rustc_hir::{HirId, ItemLocalId, intravisit}; | |
| 5 | 5 | use rustc_index::bit_set::GrowableBitSet; |
| 6 | 6 | use rustc_middle::hir::nested_filter; |
| 7 | 7 | use rustc_middle::ty::TyCtxt; |
compiler/rustc_passes/src/hir_stats.rs+170-192| ... | ... | @@ -3,15 +3,15 @@ |
| 3 | 3 | // completely accurate (some things might be counted twice, others missed). |
| 4 | 4 | |
| 5 | 5 | use rustc_ast::visit::BoundKind; |
| 6 | use rustc_ast::{self as ast, visit as ast_visit, AttrId, NodeId}; | |
| 6 | use rustc_ast::{self as ast, AttrId, NodeId, visit as ast_visit}; | |
| 7 | 7 | use rustc_data_structures::fx::{FxHashMap, FxHashSet}; |
| 8 | 8 | use rustc_hir as hir; |
| 9 | use rustc_hir::{intravisit as hir_visit, HirId}; | |
| 9 | use rustc_hir::{HirId, intravisit as hir_visit}; | |
| 10 | 10 | use rustc_middle::hir::map::Map; |
| 11 | 11 | use rustc_middle::ty::TyCtxt; |
| 12 | 12 | use rustc_middle::util::common::to_readable_str; |
| 13 | use rustc_span::def_id::LocalDefId; | |
| 14 | 13 | use rustc_span::Span; |
| 14 | use rustc_span::def_id::LocalDefId; | |
| 15 | 15 | |
| 16 | 16 | #[derive(Copy, Clone, PartialEq, Eq, Hash)] |
| 17 | 17 | enum Id { |
| ... | ... | @@ -219,28 +219,25 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | fn visit_item(&mut self, i: &'v hir::Item<'v>) { |
| 222 | record_variants!( | |
| 223 | (self, i, i.kind, Id::Node(i.hir_id()), hir, Item, ItemKind), | |
| 224 | [ | |
| 225 | ExternCrate, | |
| 226 | Use, | |
| 227 | Static, | |
| 228 | Const, | |
| 229 | Fn, | |
| 230 | Macro, | |
| 231 | Mod, | |
| 232 | ForeignMod, | |
| 233 | GlobalAsm, | |
| 234 | TyAlias, | |
| 235 | OpaqueTy, | |
| 236 | Enum, | |
| 237 | Struct, | |
| 238 | Union, | |
| 239 | Trait, | |
| 240 | TraitAlias, | |
| 241 | Impl | |
| 242 | ] | |
| 243 | ); | |
| 222 | record_variants!((self, i, i.kind, Id::Node(i.hir_id()), hir, Item, ItemKind), [ | |
| 223 | ExternCrate, | |
| 224 | Use, | |
| 225 | Static, | |
| 226 | Const, | |
| 227 | Fn, | |
| 228 | Macro, | |
| 229 | Mod, | |
| 230 | ForeignMod, | |
| 231 | GlobalAsm, | |
| 232 | TyAlias, | |
| 233 | OpaqueTy, | |
| 234 | Enum, | |
| 235 | Struct, | |
| 236 | Union, | |
| 237 | Trait, | |
| 238 | TraitAlias, | |
| 239 | Impl | |
| 240 | ]); | |
| 244 | 241 | hir_visit::walk_item(self, i) |
| 245 | 242 | } |
| 246 | 243 | |
| ... | ... | @@ -273,10 +270,9 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { |
| 273 | 270 | } |
| 274 | 271 | |
| 275 | 272 | fn visit_stmt(&mut self, s: &'v hir::Stmt<'v>) { |
| 276 | record_variants!( | |
| 277 | (self, s, s.kind, Id::Node(s.hir_id), hir, Stmt, StmtKind), | |
| 278 | [Let, Item, Expr, Semi] | |
| 279 | ); | |
| 273 | record_variants!((self, s, s.kind, Id::Node(s.hir_id), hir, Stmt, StmtKind), [ | |
| 274 | Let, Item, Expr, Semi | |
| 275 | ]); | |
| 280 | 276 | hir_visit::walk_stmt(self, s) |
| 281 | 277 | } |
| 282 | 278 | |
| ... | ... | @@ -286,26 +282,23 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { |
| 286 | 282 | } |
| 287 | 283 | |
| 288 | 284 | fn visit_pat(&mut self, p: &'v hir::Pat<'v>) { |
| 289 | record_variants!( | |
| 290 | (self, p, p.kind, Id::Node(p.hir_id), hir, Pat, PatKind), | |
| 291 | [ | |
| 292 | Wild, | |
| 293 | Binding, | |
| 294 | Struct, | |
| 295 | TupleStruct, | |
| 296 | Or, | |
| 297 | Never, | |
| 298 | Path, | |
| 299 | Tuple, | |
| 300 | Box, | |
| 301 | Deref, | |
| 302 | Ref, | |
| 303 | Lit, | |
| 304 | Range, | |
| 305 | Slice, | |
| 306 | Err | |
| 307 | ] | |
| 308 | ); | |
| 285 | record_variants!((self, p, p.kind, Id::Node(p.hir_id), hir, Pat, PatKind), [ | |
| 286 | Wild, | |
| 287 | Binding, | |
| 288 | Struct, | |
| 289 | TupleStruct, | |
| 290 | Or, | |
| 291 | Never, | |
| 292 | Path, | |
| 293 | Tuple, | |
| 294 | Box, | |
| 295 | Deref, | |
| 296 | Ref, | |
| 297 | Lit, | |
| 298 | Range, | |
| 299 | Slice, | |
| 300 | Err | |
| 301 | ]); | |
| 309 | 302 | hir_visit::walk_pat(self, p) |
| 310 | 303 | } |
| 311 | 304 | |
| ... | ... | @@ -315,15 +308,11 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { |
| 315 | 308 | } |
| 316 | 309 | |
| 317 | 310 | fn visit_expr(&mut self, e: &'v hir::Expr<'v>) { |
| 318 | record_variants!( | |
| 319 | (self, e, e.kind, Id::Node(e.hir_id), hir, Expr, ExprKind), | |
| 320 | [ | |
| 321 | ConstBlock, Array, Call, MethodCall, Tup, Binary, Unary, Lit, Cast, Type, | |
| 322 | DropTemps, Let, If, Loop, Match, Closure, Block, Assign, AssignOp, Field, Index, | |
| 323 | Path, AddrOf, Break, Continue, Ret, Become, InlineAsm, OffsetOf, Struct, Repeat, | |
| 324 | Yield, Err | |
| 325 | ] | |
| 326 | ); | |
| 311 | record_variants!((self, e, e.kind, Id::Node(e.hir_id), hir, Expr, ExprKind), [ | |
| 312 | ConstBlock, Array, Call, MethodCall, Tup, Binary, Unary, Lit, Cast, Type, DropTemps, | |
| 313 | Let, If, Loop, Match, Closure, Block, Assign, AssignOp, Field, Index, Path, AddrOf, | |
| 314 | Break, Continue, Ret, Become, InlineAsm, OffsetOf, Struct, Repeat, Yield, Err | |
| 315 | ]); | |
| 327 | 316 | hir_visit::walk_expr(self, e) |
| 328 | 317 | } |
| 329 | 318 | |
| ... | ... | @@ -333,27 +322,24 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { |
| 333 | 322 | } |
| 334 | 323 | |
| 335 | 324 | fn visit_ty(&mut self, t: &'v hir::Ty<'v>) { |
| 336 | record_variants!( | |
| 337 | (self, t, t.kind, Id::Node(t.hir_id), hir, Ty, TyKind), | |
| 338 | [ | |
| 339 | InferDelegation, | |
| 340 | Slice, | |
| 341 | Array, | |
| 342 | Ptr, | |
| 343 | Ref, | |
| 344 | BareFn, | |
| 345 | Never, | |
| 346 | Tup, | |
| 347 | AnonAdt, | |
| 348 | Path, | |
| 349 | OpaqueDef, | |
| 350 | TraitObject, | |
| 351 | Typeof, | |
| 352 | Infer, | |
| 353 | Pat, | |
| 354 | Err | |
| 355 | ] | |
| 356 | ); | |
| 325 | record_variants!((self, t, t.kind, Id::Node(t.hir_id), hir, Ty, TyKind), [ | |
| 326 | InferDelegation, | |
| 327 | Slice, | |
| 328 | Array, | |
| 329 | Ptr, | |
| 330 | Ref, | |
| 331 | BareFn, | |
| 332 | Never, | |
| 333 | Tup, | |
| 334 | AnonAdt, | |
| 335 | Path, | |
| 336 | OpaqueDef, | |
| 337 | TraitObject, | |
| 338 | Typeof, | |
| 339 | Infer, | |
| 340 | Pat, | |
| 341 | Err | |
| 342 | ]); | |
| 357 | 343 | hir_visit::walk_ty(self, t) |
| 358 | 344 | } |
| 359 | 345 | |
| ... | ... | @@ -368,10 +354,11 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { |
| 368 | 354 | } |
| 369 | 355 | |
| 370 | 356 | fn visit_where_predicate(&mut self, p: &'v hir::WherePredicate<'v>) { |
| 371 | record_variants!( | |
| 372 | (self, p, p, Id::None, hir, WherePredicate, WherePredicate), | |
| 373 | [BoundPredicate, RegionPredicate, EqPredicate] | |
| 374 | ); | |
| 357 | record_variants!((self, p, p, Id::None, hir, WherePredicate, WherePredicate), [ | |
| 358 | BoundPredicate, | |
| 359 | RegionPredicate, | |
| 360 | EqPredicate | |
| 361 | ]); | |
| 375 | 362 | hir_visit::walk_where_predicate(self, p) |
| 376 | 363 | } |
| 377 | 364 | |
| ... | ... | @@ -425,10 +412,9 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { |
| 425 | 412 | } |
| 426 | 413 | |
| 427 | 414 | fn visit_param_bound(&mut self, b: &'v hir::GenericBound<'v>) { |
| 428 | record_variants!( | |
| 429 | (self, b, b, Id::None, hir, GenericBound, GenericBound), | |
| 430 | [Trait, Outlives, Use] | |
| 431 | ); | |
| 415 | record_variants!((self, b, b, Id::None, hir, GenericBound, GenericBound), [ | |
| 416 | Trait, Outlives, Use | |
| 417 | ]); | |
| 432 | 418 | hir_visit::walk_param_bound(self, b) |
| 433 | 419 | } |
| 434 | 420 | |
| ... | ... | @@ -443,10 +429,9 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { |
| 443 | 429 | } |
| 444 | 430 | |
| 445 | 431 | fn visit_generic_arg(&mut self, ga: &'v hir::GenericArg<'v>) { |
| 446 | record_variants!( | |
| 447 | (self, ga, ga, Id::Node(ga.hir_id()), hir, GenericArg, GenericArg), | |
| 448 | [Lifetime, Type, Const, Infer] | |
| 449 | ); | |
| 432 | record_variants!((self, ga, ga, Id::Node(ga.hir_id()), hir, GenericArg, GenericArg), [ | |
| 433 | Lifetime, Type, Const, Infer | |
| 434 | ]); | |
| 450 | 435 | match ga { |
| 451 | 436 | hir::GenericArg::Lifetime(lt) => self.visit_lifetime(lt), |
| 452 | 437 | hir::GenericArg::Type(ty) => self.visit_ty(ty), |
| ... | ... | @@ -492,38 +477,34 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> { |
| 492 | 477 | |
| 493 | 478 | impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> { |
| 494 | 479 | fn visit_foreign_item(&mut self, i: &'v ast::ForeignItem) { |
| 495 | record_variants!( | |
| 496 | (self, i, i.kind, Id::None, ast, ForeignItem, ForeignItemKind), | |
| 497 | [Static, Fn, TyAlias, MacCall] | |
| 498 | ); | |
| 480 | record_variants!((self, i, i.kind, Id::None, ast, ForeignItem, ForeignItemKind), [ | |
| 481 | Static, Fn, TyAlias, MacCall | |
| 482 | ]); | |
| 499 | 483 | ast_visit::walk_item(self, i) |
| 500 | 484 | } |
| 501 | 485 | |
| 502 | 486 | fn visit_item(&mut self, i: &'v ast::Item) { |
| 503 | record_variants!( | |
| 504 | (self, i, i.kind, Id::None, ast, Item, ItemKind), | |
| 505 | [ | |
| 506 | ExternCrate, | |
| 507 | Use, | |
| 508 | Static, | |
| 509 | Const, | |
| 510 | Fn, | |
| 511 | Mod, | |
| 512 | ForeignMod, | |
| 513 | GlobalAsm, | |
| 514 | TyAlias, | |
| 515 | Enum, | |
| 516 | Struct, | |
| 517 | Union, | |
| 518 | Trait, | |
| 519 | TraitAlias, | |
| 520 | Impl, | |
| 521 | MacCall, | |
| 522 | MacroDef, | |
| 523 | Delegation, | |
| 524 | DelegationMac | |
| 525 | ] | |
| 526 | ); | |
| 487 | record_variants!((self, i, i.kind, Id::None, ast, Item, ItemKind), [ | |
| 488 | ExternCrate, | |
| 489 | Use, | |
| 490 | Static, | |
| 491 | Const, | |
| 492 | Fn, | |
| 493 | Mod, | |
| 494 | ForeignMod, | |
| 495 | GlobalAsm, | |
| 496 | TyAlias, | |
| 497 | Enum, | |
| 498 | Struct, | |
| 499 | Union, | |
| 500 | Trait, | |
| 501 | TraitAlias, | |
| 502 | Impl, | |
| 503 | MacCall, | |
| 504 | MacroDef, | |
| 505 | Delegation, | |
| 506 | DelegationMac | |
| 507 | ]); | |
| 527 | 508 | ast_visit::walk_item(self, i) |
| 528 | 509 | } |
| 529 | 510 | |
| ... | ... | @@ -538,10 +519,9 @@ impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> { |
| 538 | 519 | } |
| 539 | 520 | |
| 540 | 521 | fn visit_stmt(&mut self, s: &'v ast::Stmt) { |
| 541 | record_variants!( | |
| 542 | (self, s, s.kind, Id::None, ast, Stmt, StmtKind), | |
| 543 | [Let, Item, Expr, Semi, Empty, MacCall] | |
| 544 | ); | |
| 522 | record_variants!((self, s, s.kind, Id::None, ast, Stmt, StmtKind), [ | |
| 523 | Let, Item, Expr, Semi, Empty, MacCall | |
| 524 | ]); | |
| 545 | 525 | ast_visit::walk_stmt(self, s) |
| 546 | 526 | } |
| 547 | 527 | |
| ... | ... | @@ -556,29 +536,26 @@ impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> { |
| 556 | 536 | } |
| 557 | 537 | |
| 558 | 538 | fn visit_pat(&mut self, p: &'v ast::Pat) { |
| 559 | record_variants!( | |
| 560 | (self, p, p.kind, Id::None, ast, Pat, PatKind), | |
| 561 | [ | |
| 562 | Wild, | |
| 563 | Ident, | |
| 564 | Struct, | |
| 565 | TupleStruct, | |
| 566 | Or, | |
| 567 | Path, | |
| 568 | Tuple, | |
| 569 | Box, | |
| 570 | Deref, | |
| 571 | Ref, | |
| 572 | Lit, | |
| 573 | Range, | |
| 574 | Slice, | |
| 575 | Rest, | |
| 576 | Never, | |
| 577 | Paren, | |
| 578 | MacCall, | |
| 579 | Err | |
| 580 | ] | |
| 581 | ); | |
| 539 | record_variants!((self, p, p.kind, Id::None, ast, Pat, PatKind), [ | |
| 540 | Wild, | |
| 541 | Ident, | |
| 542 | Struct, | |
| 543 | TupleStruct, | |
| 544 | Or, | |
| 545 | Path, | |
| 546 | Tuple, | |
| 547 | Box, | |
| 548 | Deref, | |
| 549 | Ref, | |
| 550 | Lit, | |
| 551 | Range, | |
| 552 | Slice, | |
| 553 | Rest, | |
| 554 | Never, | |
| 555 | Paren, | |
| 556 | MacCall, | |
| 557 | Err | |
| 558 | ]); | |
| 582 | 559 | ast_visit::walk_pat(self, p) |
| 583 | 560 | } |
| 584 | 561 | |
| ... | ... | @@ -598,32 +575,29 @@ impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> { |
| 598 | 575 | } |
| 599 | 576 | |
| 600 | 577 | fn visit_ty(&mut self, t: &'v ast::Ty) { |
| 601 | record_variants!( | |
| 602 | (self, t, t.kind, Id::None, ast, Ty, TyKind), | |
| 603 | [ | |
| 604 | Slice, | |
| 605 | Array, | |
| 606 | Ptr, | |
| 607 | Ref, | |
| 608 | BareFn, | |
| 609 | Never, | |
| 610 | Tup, | |
| 611 | AnonStruct, | |
| 612 | AnonUnion, | |
| 613 | Path, | |
| 614 | Pat, | |
| 615 | TraitObject, | |
| 616 | ImplTrait, | |
| 617 | Paren, | |
| 618 | Typeof, | |
| 619 | Infer, | |
| 620 | ImplicitSelf, | |
| 621 | MacCall, | |
| 622 | CVarArgs, | |
| 623 | Dummy, | |
| 624 | Err | |
| 625 | ] | |
| 626 | ); | |
| 578 | record_variants!((self, t, t.kind, Id::None, ast, Ty, TyKind), [ | |
| 579 | Slice, | |
| 580 | Array, | |
| 581 | Ptr, | |
| 582 | Ref, | |
| 583 | BareFn, | |
| 584 | Never, | |
| 585 | Tup, | |
| 586 | AnonStruct, | |
| 587 | AnonUnion, | |
| 588 | Path, | |
| 589 | Pat, | |
| 590 | TraitObject, | |
| 591 | ImplTrait, | |
| 592 | Paren, | |
| 593 | Typeof, | |
| 594 | Infer, | |
| 595 | ImplicitSelf, | |
| 596 | MacCall, | |
| 597 | CVarArgs, | |
| 598 | Dummy, | |
| 599 | Err | |
| 600 | ]); | |
| 627 | 601 | |
| 628 | 602 | ast_visit::walk_ty(self, t) |
| 629 | 603 | } |
| ... | ... | @@ -634,10 +608,11 @@ impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> { |
| 634 | 608 | } |
| 635 | 609 | |
| 636 | 610 | fn visit_where_predicate(&mut self, p: &'v ast::WherePredicate) { |
| 637 | record_variants!( | |
| 638 | (self, p, p, Id::None, ast, WherePredicate, WherePredicate), | |
| 639 | [BoundPredicate, RegionPredicate, EqPredicate] | |
| 640 | ); | |
| 611 | record_variants!((self, p, p, Id::None, ast, WherePredicate, WherePredicate), [ | |
| 612 | BoundPredicate, | |
| 613 | RegionPredicate, | |
| 614 | EqPredicate | |
| 615 | ]); | |
| 641 | 616 | ast_visit::walk_where_predicate(self, p) |
| 642 | 617 | } |
| 643 | 618 | |
| ... | ... | @@ -647,18 +622,21 @@ impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> { |
| 647 | 622 | } |
| 648 | 623 | |
| 649 | 624 | fn visit_assoc_item(&mut self, i: &'v ast::AssocItem, ctxt: ast_visit::AssocCtxt) { |
| 650 | record_variants!( | |
| 651 | (self, i, i.kind, Id::None, ast, AssocItem, AssocItemKind), | |
| 652 | [Const, Fn, Type, MacCall, Delegation, DelegationMac] | |
| 653 | ); | |
| 625 | record_variants!((self, i, i.kind, Id::None, ast, AssocItem, AssocItemKind), [ | |
| 626 | Const, | |
| 627 | Fn, | |
| 628 | Type, | |
| 629 | MacCall, | |
| 630 | Delegation, | |
| 631 | DelegationMac | |
| 632 | ]); | |
| 654 | 633 | ast_visit::walk_assoc_item(self, i, ctxt); |
| 655 | 634 | } |
| 656 | 635 | |
| 657 | 636 | fn visit_param_bound(&mut self, b: &'v ast::GenericBound, _ctxt: BoundKind) { |
| 658 | record_variants!( | |
| 659 | (self, b, b, Id::None, ast, GenericBound, GenericBound), | |
| 660 | [Trait, Outlives, Use] | |
| 661 | ); | |
| 637 | record_variants!((self, b, b, Id::None, ast, GenericBound, GenericBound), [ | |
| 638 | Trait, Outlives, Use | |
| 639 | ]); | |
| 662 | 640 | ast_visit::walk_param_bound(self, b) |
| 663 | 641 | } |
| 664 | 642 | |
| ... | ... | @@ -691,18 +669,18 @@ impl<'v> ast_visit::Visitor<'v> for StatCollector<'v> { |
| 691 | 669 | // common, so we implement `visit_generic_args` and tolerate the double |
| 692 | 670 | // counting in the former case. |
| 693 | 671 | fn visit_generic_args(&mut self, g: &'v ast::GenericArgs) { |
| 694 | record_variants!( | |
| 695 | (self, g, g, Id::None, ast, GenericArgs, GenericArgs), | |
| 696 | [AngleBracketed, Parenthesized, ParenthesizedElided] | |
| 697 | ); | |
| 672 | record_variants!((self, g, g, Id::None, ast, GenericArgs, GenericArgs), [ | |
| 673 | AngleBracketed, | |
| 674 | Parenthesized, | |
| 675 | ParenthesizedElided | |
| 676 | ]); | |
| 698 | 677 | ast_visit::walk_generic_args(self, g) |
| 699 | 678 | } |
| 700 | 679 | |
| 701 | 680 | fn visit_attribute(&mut self, attr: &'v ast::Attribute) { |
| 702 | record_variants!( | |
| 703 | (self, attr, attr.kind, Id::None, ast, Attribute, AttrKind), | |
| 704 | [Normal, DocComment] | |
| 705 | ); | |
| 681 | record_variants!((self, attr, attr.kind, Id::None, ast, Attribute, AttrKind), [ | |
| 682 | Normal, DocComment | |
| 683 | ]); | |
| 706 | 684 | ast_visit::walk_attribute(self, attr) |
| 707 | 685 | } |
| 708 | 686 |
compiler/rustc_passes/src/lang_items.rs+2-2| ... | ... | @@ -11,13 +11,13 @@ use rustc_ast as ast; |
| 11 | 11 | use rustc_ast::visit; |
| 12 | 12 | use rustc_data_structures::fx::FxHashMap; |
| 13 | 13 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| 14 | use rustc_hir::lang_items::{extract, GenericRequirement}; | |
| 14 | use rustc_hir::lang_items::{GenericRequirement, extract}; | |
| 15 | 15 | use rustc_hir::{LangItem, LanguageItems, MethodKind, Target}; |
| 16 | 16 | use rustc_middle::query::Providers; |
| 17 | 17 | use rustc_middle::ty::{ResolverAstLowering, TyCtxt}; |
| 18 | 18 | use rustc_session::cstore::ExternCrate; |
| 19 | use rustc_span::symbol::kw::Empty; | |
| 20 | 19 | use rustc_span::Span; |
| 20 | use rustc_span::symbol::kw::Empty; | |
| 21 | 21 | |
| 22 | 22 | use crate::errors::{ |
| 23 | 23 | DuplicateLangItem, IncorrectTarget, LangItemOnIncorrectTarget, UnknownLangItem, |
compiler/rustc_passes/src/layout_test.rs+1-1| ... | ... | @@ -4,9 +4,9 @@ use rustc_hir::def_id::LocalDefId; |
| 4 | 4 | use rustc_middle::span_bug; |
| 5 | 5 | use rustc_middle::ty::layout::{HasParamEnv, HasTyCtxt, LayoutError, LayoutOfHelpers}; |
| 6 | 6 | use rustc_middle::ty::{self, ParamEnv, Ty, TyCtxt}; |
| 7 | use rustc_span::Span; | |
| 7 | 8 | use rustc_span::source_map::Spanned; |
| 8 | 9 | use rustc_span::symbol::sym; |
| 9 | use rustc_span::Span; | |
| 10 | 10 | use rustc_target::abi::{HasDataLayout, TargetDataLayout}; |
| 11 | 11 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; |
| 12 | 12 | use rustc_trait_selection::infer::TyCtxtInferExt; |
compiler/rustc_passes/src/lib_features.rs+1-1| ... | ... | @@ -12,7 +12,7 @@ use rustc_middle::middle::lib_features::{FeatureStability, LibFeatures}; |
| 12 | 12 | use rustc_middle::query::{LocalCrate, Providers}; |
| 13 | 13 | use rustc_middle::ty::TyCtxt; |
| 14 | 14 | use rustc_span::symbol::Symbol; |
| 15 | use rustc_span::{sym, Span}; | |
| 15 | use rustc_span::{Span, sym}; | |
| 16 | 16 | |
| 17 | 17 | use crate::errors::{FeaturePreviouslyDeclared, FeatureStableTwice}; |
| 18 | 18 |
compiler/rustc_passes/src/liveness.rs+1-1| ... | ... | @@ -96,7 +96,7 @@ use rustc_middle::query::Providers; |
| 96 | 96 | use rustc_middle::span_bug; |
| 97 | 97 | use rustc_middle::ty::{self, RootVariableMinCaptureList, Ty, TyCtxt}; |
| 98 | 98 | use rustc_session::lint; |
| 99 | use rustc_span::symbol::{kw, sym, Symbol}; | |
| 99 | use rustc_span::symbol::{Symbol, kw, sym}; | |
| 100 | 100 | use rustc_span::{BytePos, Span}; |
| 101 | 101 | use tracing::{debug, instrument}; |
| 102 | 102 |
compiler/rustc_passes/src/loops.rs+1-1| ... | ... | @@ -1,6 +1,7 @@ |
| 1 | 1 | use std::collections::BTreeMap; |
| 2 | 2 | use std::fmt; |
| 3 | 3 | |
| 4 | use Context::*; | |
| 4 | 5 | use rustc_hir as hir; |
| 5 | 6 | use rustc_hir::def_id::{LocalDefId, LocalModDefId}; |
| 6 | 7 | use rustc_hir::intravisit::{self, Visitor}; |
| ... | ... | @@ -11,7 +12,6 @@ use rustc_middle::span_bug; |
| 11 | 12 | use rustc_middle::ty::TyCtxt; |
| 12 | 13 | use rustc_span::hygiene::DesugaringKind; |
| 13 | 14 | use rustc_span::{BytePos, Span}; |
| 14 | use Context::*; | |
| 15 | 15 | |
| 16 | 16 | use crate::errors::{ |
| 17 | 17 | BreakInsideClosure, BreakInsideCoroutine, BreakNonLoop, ContinueLabeledBlock, OutsideLoop, |
compiler/rustc_passes/src/naked_functions.rs+1-1| ... | ... | @@ -10,8 +10,8 @@ use rustc_middle::hir::nested_filter::OnlyBodies; |
| 10 | 10 | use rustc_middle::query::Providers; |
| 11 | 11 | use rustc_middle::ty::TyCtxt; |
| 12 | 12 | use rustc_session::lint::builtin::UNDEFINED_NAKED_FUNCTION_ABI; |
| 13 | use rustc_span::symbol::sym; | |
| 14 | 13 | use rustc_span::Span; |
| 14 | use rustc_span::symbol::sym; | |
| 15 | 15 | use rustc_target::spec::abi::Abi; |
| 16 | 16 | |
| 17 | 17 | use crate::errors::{ |
compiler/rustc_passes/src/reachable.rs+1-1| ... | ... | @@ -25,10 +25,10 @@ |
| 25 | 25 | use hir::def_id::LocalDefIdSet; |
| 26 | 26 | use rustc_data_structures::stack::ensure_sufficient_stack; |
| 27 | 27 | use rustc_hir as hir; |
| 28 | use rustc_hir::Node; | |
| 28 | 29 | use rustc_hir::def::{DefKind, Res}; |
| 29 | 30 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| 30 | 31 | use rustc_hir::intravisit::{self, Visitor}; |
| 31 | use rustc_hir::Node; | |
| 32 | 32 | use rustc_middle::bug; |
| 33 | 33 | use rustc_middle::middle::codegen_fn_attrs::{CodegenFnAttrFlags, CodegenFnAttrs}; |
| 34 | 34 | use rustc_middle::middle::privacy::{self, Level}; |
compiler/rustc_passes/src/stability.rs+2-2| ... | ... | @@ -12,7 +12,7 @@ use rustc_data_structures::fx::FxIndexMap; |
| 12 | 12 | use rustc_data_structures::unord::{ExtendUnord, UnordMap, UnordSet}; |
| 13 | 13 | use rustc_hir as hir; |
| 14 | 14 | use rustc_hir::def::{DefKind, Res}; |
| 15 | use rustc_hir::def_id::{LocalDefId, LocalModDefId, CRATE_DEF_ID, LOCAL_CRATE}; | |
| 15 | use rustc_hir::def_id::{CRATE_DEF_ID, LOCAL_CRATE, LocalDefId, LocalModDefId}; | |
| 16 | 16 | use rustc_hir::hir_id::CRATE_HIR_ID; |
| 17 | 17 | use rustc_hir::intravisit::{self, Visitor}; |
| 18 | 18 | use rustc_hir::{FieldDef, Item, ItemKind, TraitRef, Ty, TyKind, Variant}; |
| ... | ... | @@ -24,8 +24,8 @@ use rustc_middle::query::Providers; |
| 24 | 24 | use rustc_middle::ty::TyCtxt; |
| 25 | 25 | use rustc_session::lint; |
| 26 | 26 | use rustc_session::lint::builtin::{INEFFECTIVE_UNSTABLE_TRAIT_IMPL, USELESS_DEPRECATED}; |
| 27 | use rustc_span::symbol::{sym, Symbol}; | |
| 28 | 27 | use rustc_span::Span; |
| 28 | use rustc_span::symbol::{Symbol, sym}; | |
| 29 | 29 | use rustc_target::spec::abi::Abi; |
| 30 | 30 | use tracing::{debug, info}; |
| 31 | 31 |
compiler/rustc_pattern_analysis/src/constructor.rs+2-2| ... | ... | @@ -176,13 +176,13 @@ |
| 176 | 176 | //! we assume they never cover each other. In order to respect the invariants of |
| 177 | 177 | //! [`SplitConstructorSet`], we give each `Opaque` constructor a unique id so we can recognize it. |
| 178 | 178 | |
| 179 | use std::cmp::{self, max, min, Ordering}; | |
| 179 | use std::cmp::{self, Ordering, max, min}; | |
| 180 | 180 | use std::fmt; |
| 181 | 181 | use std::iter::once; |
| 182 | 182 | |
| 183 | 183 | use rustc_apfloat::ieee::{DoubleS, HalfS, IeeeFloat, QuadS, SingleS}; |
| 184 | use rustc_index::bit_set::{BitSet, GrowableBitSet}; | |
| 185 | 184 | use rustc_index::IndexVec; |
| 185 | use rustc_index::bit_set::{BitSet, GrowableBitSet}; | |
| 186 | 186 | use smallvec::SmallVec; |
| 187 | 187 | |
| 188 | 188 | use self::Constructor::*; |
compiler/rustc_pattern_analysis/src/lints.rs+1-1| ... | ... | @@ -2,11 +2,11 @@ use rustc_session::lint::builtin::NON_EXHAUSTIVE_OMITTED_PATTERNS; |
| 2 | 2 | use rustc_span::ErrorGuaranteed; |
| 3 | 3 | use tracing::instrument; |
| 4 | 4 | |
| 5 | use crate::MatchArm; | |
| 5 | 6 | use crate::constructor::Constructor; |
| 6 | 7 | use crate::errors::{NonExhaustiveOmittedPattern, NonExhaustiveOmittedPatternLintOnArm, Uncovered}; |
| 7 | 8 | use crate::pat_column::PatternColumn; |
| 8 | 9 | use crate::rustc::{RevealedTy, RustcPatCtxt, WitnessPat}; |
| 9 | use crate::MatchArm; | |
| 10 | 10 | |
| 11 | 11 | /// Traverse the patterns to collect any variants of a non_exhaustive enum that fail to be mentioned |
| 12 | 12 | /// in a given column. |
compiler/rustc_pattern_analysis/src/pat.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | |
| 4 | 4 | use std::fmt; |
| 5 | 5 | |
| 6 | use smallvec::{smallvec, SmallVec}; | |
| 6 | use smallvec::{SmallVec, smallvec}; | |
| 7 | 7 | |
| 8 | 8 | use self::Constructor::*; |
| 9 | 9 | use crate::constructor::{Constructor, Slice, SliceKind}; |
compiler/rustc_pattern_analysis/src/rustc.rs+5-5| ... | ... | @@ -2,8 +2,8 @@ use std::fmt; |
| 2 | 2 | use std::iter::once; |
| 3 | 3 | |
| 4 | 4 | use rustc_arena::DroplessArena; |
| 5 | use rustc_hir::def_id::DefId; | |
| 6 | 5 | use rustc_hir::HirId; |
| 6 | use rustc_hir::def_id::DefId; | |
| 7 | 7 | use rustc_index::{Idx, IndexVec}; |
| 8 | 8 | use rustc_middle::middle::stability::EvalResult; |
| 9 | 9 | use rustc_middle::mir::{self, Const}; |
| ... | ... | @@ -14,8 +14,8 @@ use rustc_middle::ty::{ |
| 14 | 14 | }; |
| 15 | 15 | use rustc_middle::{bug, span_bug}; |
| 16 | 16 | use rustc_session::lint; |
| 17 | use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP}; | |
| 18 | use rustc_target::abi::{FieldIdx, Integer, VariantIdx, FIRST_VARIANT}; | |
| 17 | use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span}; | |
| 18 | use rustc_target::abi::{FIRST_VARIANT, FieldIdx, Integer, VariantIdx}; | |
| 19 | 19 | |
| 20 | 20 | use crate::constructor::Constructor::*; |
| 21 | 21 | use crate::constructor::{ |
| ... | ... | @@ -24,8 +24,8 @@ use crate::constructor::{ |
| 24 | 24 | use crate::lints::lint_nonexhaustive_missing_variants; |
| 25 | 25 | use crate::pat_column::PatternColumn; |
| 26 | 26 | use crate::rustc::print::EnumInfo; |
| 27 | use crate::usefulness::{compute_match_usefulness, PlaceValidity}; | |
| 28 | use crate::{errors, Captures, PatCx, PrivateUninhabitedField}; | |
| 27 | use crate::usefulness::{PlaceValidity, compute_match_usefulness}; | |
| 28 | use crate::{Captures, PatCx, PrivateUninhabitedField, errors}; | |
| 29 | 29 | |
| 30 | 30 | mod print; |
| 31 | 31 |
compiler/rustc_pattern_analysis/src/usefulness.rs+1-1| ... | ... | @@ -713,7 +713,7 @@ use std::fmt; |
| 713 | 713 | use rustc_data_structures::stack::ensure_sufficient_stack; |
| 714 | 714 | use rustc_hash::{FxHashMap, FxHashSet}; |
| 715 | 715 | use rustc_index::bit_set::BitSet; |
| 716 | use smallvec::{smallvec, SmallVec}; | |
| 716 | use smallvec::{SmallVec, smallvec}; | |
| 717 | 717 | use tracing::{debug, instrument}; |
| 718 | 718 | |
| 719 | 719 | use self::PlaceValidity::*; |
compiler/rustc_pattern_analysis/tests/common/mod.rs+1-1| ... | ... | @@ -6,9 +6,9 @@ use rustc_pattern_analysis::{Captures, MatchArm, PatCx, PrivateUninhabitedField} |
| 6 | 6 | |
| 7 | 7 | /// Sets up `tracing` for easier debugging. Tries to look like the `rustc` setup. |
| 8 | 8 | pub fn init_tracing() { |
| 9 | use tracing_subscriber::Layer; | |
| 9 | 10 | use tracing_subscriber::layer::SubscriberExt; |
| 10 | 11 | use tracing_subscriber::util::SubscriberInitExt; |
| 11 | use tracing_subscriber::Layer; | |
| 12 | 12 | let _ = tracing_tree::HierarchicalLayer::default() |
| 13 | 13 | .with_writer(std::io::stderr) |
| 14 | 14 | .with_ansi(true) |
compiler/rustc_pattern_analysis/tests/complexity.rs+1-1| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | //! Test the pattern complexity limit. |
| 2 | 2 | |
| 3 | 3 | use common::*; |
| 4 | use rustc_pattern_analysis::MatchArm; | |
| 4 | 5 | use rustc_pattern_analysis::pat::DeconstructedPat; |
| 5 | 6 | use rustc_pattern_analysis::usefulness::PlaceValidity; |
| 6 | use rustc_pattern_analysis::MatchArm; | |
| 7 | 7 | |
| 8 | 8 | #[macro_use] |
| 9 | 9 | mod common; |
compiler/rustc_pattern_analysis/tests/exhaustiveness.rs+1-1| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | //! Test exhaustiveness checking. |
| 2 | 2 | |
| 3 | 3 | use common::*; |
| 4 | use rustc_pattern_analysis::MatchArm; | |
| 4 | 5 | use rustc_pattern_analysis::pat::{DeconstructedPat, WitnessPat}; |
| 5 | 6 | use rustc_pattern_analysis::usefulness::PlaceValidity; |
| 6 | use rustc_pattern_analysis::MatchArm; | |
| 7 | 7 | |
| 8 | 8 | #[macro_use] |
| 9 | 9 | mod common; |
compiler/rustc_pattern_analysis/tests/intersection.rs+1-1| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | //! Test the computation of arm intersections. |
| 2 | 2 | |
| 3 | 3 | use common::*; |
| 4 | use rustc_pattern_analysis::MatchArm; | |
| 4 | 5 | use rustc_pattern_analysis::pat::DeconstructedPat; |
| 5 | 6 | use rustc_pattern_analysis::usefulness::PlaceValidity; |
| 6 | use rustc_pattern_analysis::MatchArm; | |
| 7 | 7 | |
| 8 | 8 | #[macro_use] |
| 9 | 9 | mod common; |
compiler/rustc_privacy/src/errors.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | use rustc_errors::codes::*; | |
| 2 | 1 | use rustc_errors::DiagArgFromDisplay; |
| 2 | use rustc_errors::codes::*; | |
| 3 | 3 | use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic}; |
| 4 | 4 | use rustc_span::{Span, Symbol}; |
| 5 | 5 |
compiler/rustc_privacy/src/lib.rs+4-4| ... | ... | @@ -20,12 +20,12 @@ use errors::{ |
| 20 | 20 | ItemIsPrivate, PrivateInterfacesOrBoundsLint, ReportEffectiveVisibility, UnnameableTypesLint, |
| 21 | 21 | UnnamedItemIsPrivate, |
| 22 | 22 | }; |
| 23 | use rustc_ast::visit::{try_visit, VisitorResult}; | |
| 24 | 23 | use rustc_ast::MacroDef; |
| 24 | use rustc_ast::visit::{VisitorResult, try_visit}; | |
| 25 | 25 | use rustc_data_structures::fx::FxHashSet; |
| 26 | 26 | use rustc_data_structures::intern::Interned; |
| 27 | 27 | use rustc_hir::def::{DefKind, Res}; |
| 28 | use rustc_hir::def_id::{DefId, LocalDefId, LocalModDefId, CRATE_DEF_ID}; | |
| 28 | use rustc_hir::def_id::{CRATE_DEF_ID, DefId, LocalDefId, LocalModDefId}; | |
| 29 | 29 | use rustc_hir::intravisit::{self, Visitor}; |
| 30 | 30 | use rustc_hir::{AssocItemKind, ForeignItemKind, ItemId, ItemKind, PatKind}; |
| 31 | 31 | use rustc_middle::middle::privacy::{EffectiveVisibilities, EffectiveVisibility, Level}; |
| ... | ... | @@ -37,9 +37,9 @@ use rustc_middle::ty::{ |
| 37 | 37 | }; |
| 38 | 38 | use rustc_middle::{bug, span_bug}; |
| 39 | 39 | use rustc_session::lint; |
| 40 | use rustc_span::hygiene::Transparency; | |
| 41 | use rustc_span::symbol::{kw, sym, Ident}; | |
| 42 | 40 | use rustc_span::Span; |
| 41 | use rustc_span::hygiene::Transparency; | |
| 42 | use rustc_span::symbol::{Ident, kw, sym}; | |
| 43 | 43 | use tracing::debug; |
| 44 | 44 | use {rustc_attr as attr, rustc_hir as hir}; |
| 45 | 45 |
compiler/rustc_query_impl/src/lib.rs+6-6| ... | ... | @@ -16,19 +16,19 @@ use rustc_data_structures::stable_hasher::HashStable; |
| 16 | 16 | use rustc_data_structures::sync::AtomicU64; |
| 17 | 17 | use rustc_middle::arena::Arena; |
| 18 | 18 | use rustc_middle::dep_graph::{self, DepKind, DepKindStruct, DepNodeIndex}; |
| 19 | use rustc_middle::query::erase::{erase, restore, Erase}; | |
| 19 | use rustc_middle::query::erase::{Erase, erase, restore}; | |
| 20 | 20 | use rustc_middle::query::on_disk_cache::{CacheEncoder, EncodedDepNodeIndex, OnDiskCache}; |
| 21 | 21 | use rustc_middle::query::plumbing::{DynamicQuery, QuerySystem, QuerySystemFns}; |
| 22 | 22 | use rustc_middle::query::{ |
| 23 | queries, AsLocalKey, DynamicQueries, ExternProviders, Providers, QueryCaches, QueryEngine, | |
| 24 | QueryStates, | |
| 23 | AsLocalKey, DynamicQueries, ExternProviders, Providers, QueryCaches, QueryEngine, QueryStates, | |
| 24 | queries, | |
| 25 | 25 | }; |
| 26 | 26 | use rustc_middle::ty::TyCtxt; |
| 27 | 27 | use rustc_query_system::dep_graph::SerializedDepNodeIndex; |
| 28 | 28 | use rustc_query_system::ich::StableHashingContext; |
| 29 | 29 | use rustc_query_system::query::{ |
| 30 | get_query_incr, get_query_non_incr, CycleError, HashResult, QueryCache, QueryConfig, QueryMap, | |
| 31 | QueryMode, QueryState, | |
| 30 | CycleError, HashResult, QueryCache, QueryConfig, QueryMap, QueryMode, QueryState, | |
| 31 | get_query_incr, get_query_non_incr, | |
| 32 | 32 | }; |
| 33 | 33 | use rustc_query_system::{HandleCycleError, Value}; |
| 34 | 34 | use rustc_span::{ErrorGuaranteed, Span}; |
| ... | ... | @@ -38,7 +38,7 @@ use crate::profiling_support::QueryKeyStringCache; |
| 38 | 38 | |
| 39 | 39 | #[macro_use] |
| 40 | 40 | mod plumbing; |
| 41 | pub use crate::plumbing::{query_key_hash_verify_all, QueryCtxt}; | |
| 41 | pub use crate::plumbing::{QueryCtxt, query_key_hash_verify_all}; | |
| 42 | 42 | |
| 43 | 43 | mod profiling_support; |
| 44 | 44 | pub use self::profiling_support::alloc_self_profile_query_strings; |
compiler/rustc_query_impl/src/plumbing.rs+5-5| ... | ... | @@ -11,21 +11,21 @@ use rustc_errors::DiagInner; |
| 11 | 11 | use rustc_index::Idx; |
| 12 | 12 | use rustc_middle::bug; |
| 13 | 13 | use rustc_middle::dep_graph::{ |
| 14 | self, dep_kinds, DepContext, DepKind, DepKindStruct, DepNode, DepNodeIndex, | |
| 15 | SerializedDepNodeIndex, | |
| 14 | self, DepContext, DepKind, DepKindStruct, DepNode, DepNodeIndex, SerializedDepNodeIndex, | |
| 15 | dep_kinds, | |
| 16 | 16 | }; |
| 17 | use rustc_middle::query::Key; | |
| 17 | 18 | use rustc_middle::query::on_disk_cache::{ |
| 18 | 19 | AbsoluteBytePos, CacheDecoder, CacheEncoder, EncodedDepNodeIndex, |
| 19 | 20 | }; |
| 20 | use rustc_middle::query::Key; | |
| 21 | 21 | use rustc_middle::ty::print::with_reduced_queries; |
| 22 | 22 | use rustc_middle::ty::tls::{self, ImplicitCtxt}; |
| 23 | 23 | use rustc_middle::ty::{self, TyCtxt, TyEncoder}; |
| 24 | 24 | use rustc_query_system::dep_graph::{DepNodeParams, HasDepContext}; |
| 25 | 25 | use rustc_query_system::ich::StableHashingContext; |
| 26 | 26 | use rustc_query_system::query::{ |
| 27 | force_query, QueryCache, QueryConfig, QueryContext, QueryJobId, QueryMap, QuerySideEffects, | |
| 28 | QueryStackFrame, | |
| 27 | QueryCache, QueryConfig, QueryContext, QueryJobId, QueryMap, QuerySideEffects, QueryStackFrame, | |
| 28 | force_query, | |
| 29 | 29 | }; |
| 30 | 30 | use rustc_query_system::{LayoutOfDepth, QueryOverflow}; |
| 31 | 31 | use rustc_serialize::{Decodable, Encodable}; |
compiler/rustc_query_impl/src/profiling_support.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ use std::io::Write; |
| 4 | 4 | use measureme::{StringComponent, StringId}; |
| 5 | 5 | use rustc_data_structures::fx::FxHashMap; |
| 6 | 6 | use rustc_data_structures::profiling::SelfProfiler; |
| 7 | use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LocalDefId, LOCAL_CRATE}; | |
| 7 | use rustc_hir::def_id::{CrateNum, DefId, DefIndex, LOCAL_CRATE, LocalDefId}; | |
| 8 | 8 | use rustc_hir::definitions::DefPathData; |
| 9 | 9 | use rustc_middle::ty::TyCtxt; |
| 10 | 10 | use rustc_query_system::query::QueryCache; |
compiler/rustc_query_system/src/dep_graph/dep_node.rs+1-1| ... | ... | @@ -45,9 +45,9 @@ |
| 45 | 45 | use std::fmt; |
| 46 | 46 | use std::hash::Hash; |
| 47 | 47 | |
| 48 | use rustc_data_structures::AtomicRef; | |
| 48 | 49 | use rustc_data_structures::fingerprint::{Fingerprint, PackedFingerprint}; |
| 49 | 50 | use rustc_data_structures::stable_hasher::{HashStable, StableHasher, StableOrd, ToStableHashKey}; |
| 50 | use rustc_data_structures::AtomicRef; | |
| 51 | 51 | use rustc_hir::definitions::DefPathHash; |
| 52 | 52 | use rustc_macros::{Decodable, Encodable}; |
| 53 | 53 |
compiler/rustc_query_system/src/dep_graph/graph.rs+1-1| ... | ... | @@ -3,8 +3,8 @@ use std::collections::hash_map::Entry; |
| 3 | 3 | use std::fmt::Debug; |
| 4 | 4 | use std::hash::Hash; |
| 5 | 5 | use std::marker::PhantomData; |
| 6 | use std::sync::atomic::Ordering; | |
| 7 | 6 | use std::sync::Arc; |
| 7 | use std::sync::atomic::Ordering; | |
| 8 | 8 | |
| 9 | 9 | use rustc_data_structures::fingerprint::Fingerprint; |
| 10 | 10 | use rustc_data_structures::fx::{FxHashMap, FxHashSet}; |
compiler/rustc_query_system/src/dep_graph/mod.rs+2-2| ... | ... | @@ -9,14 +9,14 @@ use std::panic; |
| 9 | 9 | |
| 10 | 10 | pub use dep_node::{DepKind, DepKindStruct, DepNode, DepNodeParams, WorkProductId}; |
| 11 | 11 | pub(crate) use graph::DepGraphData; |
| 12 | pub use graph::{hash_result, DepGraph, DepNodeIndex, TaskDepsRef, WorkProduct, WorkProductMap}; | |
| 12 | pub use graph::{DepGraph, DepNodeIndex, TaskDepsRef, WorkProduct, WorkProductMap, hash_result}; | |
| 13 | 13 | pub use query::DepGraphQuery; |
| 14 | 14 | use rustc_data_structures::profiling::SelfProfilerRef; |
| 15 | 15 | use rustc_session::Session; |
| 16 | 16 | pub use serialized::{SerializedDepGraph, SerializedDepNodeIndex}; |
| 17 | 17 | use tracing::instrument; |
| 18 | 18 | |
| 19 | use self::graph::{print_markframe_trace, MarkFrame}; | |
| 19 | use self::graph::{MarkFrame, print_markframe_trace}; | |
| 20 | 20 | use crate::ich::StableHashingContext; |
| 21 | 21 | |
| 22 | 22 | pub trait DepContext: Copy { |
compiler/rustc_query_system/src/dep_graph/query.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use rustc_data_structures::fx::FxHashMap; |
| 2 | use rustc_data_structures::graph::implementation::{Direction, Graph, NodeIndex, INCOMING}; | |
| 2 | use rustc_data_structures::graph::implementation::{Direction, Graph, INCOMING, NodeIndex}; | |
| 3 | 3 | use rustc_index::IndexVec; |
| 4 | 4 | |
| 5 | 5 | use super::{DepNode, DepNodeIndex}; |
compiler/rustc_query_system/src/ich/hcx.rs+2-2| ... | ... | @@ -3,11 +3,11 @@ use rustc_data_structures::stable_hasher::{HashStable, HashingControls, StableHa |
| 3 | 3 | use rustc_data_structures::sync::Lrc; |
| 4 | 4 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| 5 | 5 | use rustc_hir::definitions::DefPathHash; |
| 6 | use rustc_session::cstore::Untracked; | |
| 7 | 6 | use rustc_session::Session; |
| 7 | use rustc_session::cstore::Untracked; | |
| 8 | 8 | use rustc_span::source_map::SourceMap; |
| 9 | 9 | use rustc_span::symbol::Symbol; |
| 10 | use rustc_span::{BytePos, CachingSourceMapView, SourceFile, Span, SpanData, DUMMY_SP}; | |
| 10 | use rustc_span::{BytePos, CachingSourceMapView, DUMMY_SP, SourceFile, Span, SpanData}; | |
| 11 | 11 | |
| 12 | 12 | use crate::ich; |
| 13 | 13 |
compiler/rustc_query_system/src/ich/mod.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | //! ICH - Incremental Compilation Hash |
| 2 | 2 | |
| 3 | use rustc_span::symbol::{sym, Symbol}; | |
| 3 | use rustc_span::symbol::{Symbol, sym}; | |
| 4 | 4 | |
| 5 | 5 | pub use self::hcx::StableHashingContext; |
| 6 | 6 |
compiler/rustc_query_system/src/query/mod.rs+2-2| ... | ... | @@ -5,7 +5,7 @@ mod job; |
| 5 | 5 | #[cfg(parallel_compiler)] |
| 6 | 6 | pub use self::job::break_query_cycles; |
| 7 | 7 | pub use self::job::{ |
| 8 | print_query_stack, report_cycle, QueryInfo, QueryJob, QueryJobId, QueryJobInfo, QueryMap, | |
| 8 | QueryInfo, QueryJob, QueryJobId, QueryJobInfo, QueryMap, print_query_stack, report_cycle, | |
| 9 | 9 | }; |
| 10 | 10 | |
| 11 | 11 | mod caches; |
| ... | ... | @@ -17,8 +17,8 @@ use rustc_data_structures::sync::Lock; |
| 17 | 17 | use rustc_errors::DiagInner; |
| 18 | 18 | use rustc_hir::def::DefKind; |
| 19 | 19 | use rustc_macros::{Decodable, Encodable}; |
| 20 | use rustc_span::def_id::DefId; | |
| 21 | 20 | use rustc_span::Span; |
| 21 | use rustc_span::def_id::DefId; | |
| 22 | 22 | use thin_vec::ThinVec; |
| 23 | 23 | |
| 24 | 24 | pub use self::config::{HashResult, QueryConfig}; |
compiler/rustc_query_system/src/query/plumbing.rs+3-3| ... | ... | @@ -16,21 +16,21 @@ use rustc_data_structures::sync::Lock; |
| 16 | 16 | #[cfg(parallel_compiler)] |
| 17 | 17 | use rustc_data_structures::{outline, sync}; |
| 18 | 18 | use rustc_errors::{Diag, FatalError, StashKey}; |
| 19 | use rustc_span::{Span, DUMMY_SP}; | |
| 19 | use rustc_span::{DUMMY_SP, Span}; | |
| 20 | 20 | use thin_vec::ThinVec; |
| 21 | 21 | use tracing::instrument; |
| 22 | 22 | |
| 23 | 23 | use super::QueryConfig; |
| 24 | use crate::HandleCycleError; | |
| 24 | 25 | use crate::dep_graph::{DepContext, DepGraphData, DepNode, DepNodeIndex, DepNodeParams}; |
| 25 | 26 | use crate::ich::StableHashingContext; |
| 26 | 27 | use crate::query::caches::QueryCache; |
| 27 | 28 | #[cfg(parallel_compiler)] |
| 28 | 29 | use crate::query::job::QueryLatch; |
| 29 | use crate::query::job::{report_cycle, QueryInfo, QueryJob, QueryJobId, QueryJobInfo}; | |
| 30 | use crate::query::job::{QueryInfo, QueryJob, QueryJobId, QueryJobInfo, report_cycle}; | |
| 30 | 31 | use crate::query::{ |
| 31 | 32 | QueryContext, QueryMap, QuerySideEffects, QueryStackFrame, SerializedDepNodeIndex, |
| 32 | 33 | }; |
| 33 | use crate::HandleCycleError; | |
| 34 | 34 | |
| 35 | 35 | pub struct QueryState<K> { |
| 36 | 36 | active: Sharded<FxHashMap<K, QueryResult>>, |
compiler/rustc_resolve/src/build_reduced_graph.rs+10-12| ... | ... | @@ -17,24 +17,25 @@ use rustc_data_structures::sync::Lrc; |
| 17 | 17 | use rustc_expand::base::ResolverExpand; |
| 18 | 18 | use rustc_expand::expand::AstFragment; |
| 19 | 19 | use rustc_hir::def::{self, *}; |
| 20 | use rustc_hir::def_id::{DefId, LocalDefId, CRATE_DEF_ID}; | |
| 20 | use rustc_hir::def_id::{CRATE_DEF_ID, DefId, LocalDefId}; | |
| 21 | 21 | use rustc_metadata::creader::LoadedMacro; |
| 22 | 22 | use rustc_middle::metadata::ModChild; |
| 23 | 23 | use rustc_middle::ty::Feed; |
| 24 | 24 | use rustc_middle::{bug, ty}; |
| 25 | use rustc_span::hygiene::{ExpnId, LocalExpnId, MacroKind}; | |
| 26 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 27 | 25 | use rustc_span::Span; |
| 26 | use rustc_span::hygiene::{ExpnId, LocalExpnId, MacroKind}; | |
| 27 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 28 | 28 | use tracing::debug; |
| 29 | 29 | |
| 30 | use crate::Namespace::{MacroNS, TypeNS, ValueNS}; | |
| 30 | 31 | use crate::def_collector::collect_definitions; |
| 31 | 32 | use crate::imports::{ImportData, ImportKind}; |
| 32 | 33 | use crate::macros::{MacroRulesBinding, MacroRulesScope, MacroRulesScopeRef}; |
| 33 | use crate::Namespace::{MacroNS, TypeNS, ValueNS}; | |
| 34 | 34 | use crate::{ |
| 35 | errors, BindingKey, Determinacy, ExternPreludeEntry, Finalize, MacroData, Module, ModuleKind, | |
| 35 | BindingKey, Determinacy, ExternPreludeEntry, Finalize, MacroData, Module, ModuleKind, | |
| 36 | 36 | ModuleOrUniformRoot, NameBinding, NameBindingData, NameBindingKind, ParentScope, PathResult, |
| 37 | 37 | ResolutionError, Resolver, ResolverArenas, Segment, ToNameBinding, Used, VisResolutionError, |
| 38 | errors, | |
| 38 | 39 | }; |
| 39 | 40 | |
| 40 | 41 | type Res = def::Res<NodeId>; |
| ... | ... | @@ -565,13 +566,10 @@ impl<'a, 'ra, 'tcx> BuildReducedGraphVisitor<'a, 'ra, 'tcx> { |
| 565 | 566 | Some(rename) => source.ident.span.to(rename.span), |
| 566 | 567 | None => source.ident.span, |
| 567 | 568 | }; |
| 568 | self.r.report_error( | |
| 569 | span, | |
| 570 | ResolutionError::SelfImportsOnlyAllowedWithin { | |
| 571 | root: parent.is_none(), | |
| 572 | span_with_rename, | |
| 573 | }, | |
| 574 | ); | |
| 569 | self.r.report_error(span, ResolutionError::SelfImportsOnlyAllowedWithin { | |
| 570 | root: parent.is_none(), | |
| 571 | span_with_rename, | |
| 572 | }); | |
| 575 | 573 | |
| 576 | 574 | // Error recovery: replace `use foo::self;` with `use foo;` |
| 577 | 575 | if let Some(parent) = module_path.pop() { |
compiler/rustc_resolve/src/check_unused.rs+4-4| ... | ... | @@ -29,15 +29,15 @@ use rustc_data_structures::fx::{FxHashMap, FxIndexMap, FxIndexSet}; |
| 29 | 29 | use rustc_data_structures::unord::UnordSet; |
| 30 | 30 | use rustc_errors::MultiSpan; |
| 31 | 31 | use rustc_hir::def::{DefKind, Res}; |
| 32 | use rustc_session::lint::BuiltinLintDiag; | |
| 32 | 33 | use rustc_session::lint::builtin::{ |
| 33 | 34 | MACRO_USE_EXTERN_CRATE, UNUSED_EXTERN_CRATES, UNUSED_IMPORTS, UNUSED_QUALIFICATIONS, |
| 34 | 35 | }; |
| 35 | use rustc_session::lint::BuiltinLintDiag; | |
| 36 | use rustc_span::symbol::{kw, Ident}; | |
| 37 | use rustc_span::{Span, DUMMY_SP}; | |
| 36 | use rustc_span::symbol::{Ident, kw}; | |
| 37 | use rustc_span::{DUMMY_SP, Span}; | |
| 38 | 38 | |
| 39 | 39 | use crate::imports::{Import, ImportKind}; |
| 40 | use crate::{module_to_string, LexicalScopeBinding, NameBindingKind, Resolver}; | |
| 40 | use crate::{LexicalScopeBinding, NameBindingKind, Resolver, module_to_string}; | |
| 41 | 41 | |
| 42 | 42 | struct UnusedImport { |
| 43 | 43 | use_tree: ast::UseTree, |
compiler/rustc_resolve/src/def_collector.rs+8-11| ... | ... | @@ -7,9 +7,9 @@ use rustc_expand::expand::AstFragment; |
| 7 | 7 | use rustc_hir as hir; |
| 8 | 8 | use rustc_hir::def::{CtorKind, CtorOf, DefKind}; |
| 9 | 9 | use rustc_hir::def_id::LocalDefId; |
| 10 | use rustc_span::hygiene::LocalExpnId; | |
| 11 | use rustc_span::symbol::{kw, sym, Symbol}; | |
| 12 | 10 | use rustc_span::Span; |
| 11 | use rustc_span::hygiene::LocalExpnId; | |
| 12 | use rustc_span::symbol::{Symbol, kw, sym}; | |
| 13 | 13 | use tracing::debug; |
| 14 | 14 | |
| 15 | 15 | use crate::{ImplTraitContext, InvocationParent, PendingAnonConstInfo, Resolver}; |
| ... | ... | @@ -127,15 +127,12 @@ impl<'a, 'ra, 'tcx> DefCollector<'a, 'ra, 'tcx> { |
| 127 | 127 | fn visit_macro_invoc(&mut self, id: NodeId) { |
| 128 | 128 | let id = id.placeholder_to_expn_id(); |
| 129 | 129 | let pending_anon_const_info = self.pending_anon_const_info.take(); |
| 130 | let old_parent = self.resolver.invocation_parents.insert( | |
| 131 | id, | |
| 132 | InvocationParent { | |
| 133 | parent_def: self.parent_def, | |
| 134 | pending_anon_const_info, | |
| 135 | impl_trait_context: self.impl_trait_context, | |
| 136 | in_attr: self.in_attr, | |
| 137 | }, | |
| 138 | ); | |
| 130 | let old_parent = self.resolver.invocation_parents.insert(id, InvocationParent { | |
| 131 | parent_def: self.parent_def, | |
| 132 | pending_anon_const_info, | |
| 133 | impl_trait_context: self.impl_trait_context, | |
| 134 | in_attr: self.in_attr, | |
| 135 | }); | |
| 139 | 136 | assert!(old_parent.is_none(), "parent `LocalDefId` is reset for an invocation"); |
| 140 | 137 | } |
| 141 | 138 |
compiler/rustc_resolve/src/diagnostics.rs+22-18| ... | ... | @@ -2,36 +2,36 @@ use rustc_ast::expand::StrippedCfgItem; |
| 2 | 2 | use rustc_ast::ptr::P; |
| 3 | 3 | use rustc_ast::visit::{self, Visitor}; |
| 4 | 4 | use rustc_ast::{ |
| 5 | self as ast, Crate, ItemKind, MetaItemKind, ModKind, NestedMetaItem, NodeId, Path, | |
| 6 | CRATE_NODE_ID, | |
| 5 | self as ast, CRATE_NODE_ID, Crate, ItemKind, MetaItemKind, ModKind, NestedMetaItem, NodeId, | |
| 6 | Path, | |
| 7 | 7 | }; |
| 8 | 8 | use rustc_ast_pretty::pprust; |
| 9 | 9 | use rustc_data_structures::fx::FxHashSet; |
| 10 | 10 | use rustc_errors::codes::*; |
| 11 | 11 | use rustc_errors::{ |
| 12 | report_ambiguity_error, struct_span_code_err, Applicability, Diag, DiagCtxtHandle, | |
| 13 | ErrorGuaranteed, MultiSpan, SuggestionStyle, | |
| 12 | Applicability, Diag, DiagCtxtHandle, ErrorGuaranteed, MultiSpan, SuggestionStyle, | |
| 13 | report_ambiguity_error, struct_span_code_err, | |
| 14 | 14 | }; |
| 15 | 15 | use rustc_feature::BUILTIN_ATTRIBUTES; |
| 16 | use rustc_hir::PrimTy; | |
| 16 | 17 | use rustc_hir::def::Namespace::{self, *}; |
| 17 | 18 | use rustc_hir::def::{self, CtorKind, CtorOf, DefKind, NonMacroAttrKind, PerNS}; |
| 18 | use rustc_hir::def_id::{DefId, CRATE_DEF_ID}; | |
| 19 | use rustc_hir::PrimTy; | |
| 19 | use rustc_hir::def_id::{CRATE_DEF_ID, DefId}; | |
| 20 | 20 | use rustc_middle::bug; |
| 21 | 21 | use rustc_middle::ty::TyCtxt; |
| 22 | use rustc_session::Session; | |
| 22 | 23 | use rustc_session::lint::builtin::{ |
| 23 | 24 | ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE, AMBIGUOUS_GLOB_IMPORTS, |
| 24 | 25 | MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS, |
| 25 | 26 | }; |
| 26 | 27 | use rustc_session::lint::{AmbiguityErrorDiag, BuiltinLintDiag}; |
| 27 | use rustc_session::Session; | |
| 28 | 28 | use rustc_span::edit_distance::find_best_match_for_name; |
| 29 | 29 | use rustc_span::edition::Edition; |
| 30 | 30 | use rustc_span::hygiene::MacroKind; |
| 31 | 31 | use rustc_span::source_map::SourceMap; |
| 32 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 32 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 33 | 33 | use rustc_span::{BytePos, Span, SyntaxContext}; |
| 34 | use thin_vec::{thin_vec, ThinVec}; | |
| 34 | use thin_vec::{ThinVec, thin_vec}; | |
| 35 | 35 | use tracing::debug; |
| 36 | 36 | |
| 37 | 37 | use crate::errors::{ |
| ... | ... | @@ -41,11 +41,11 @@ use crate::errors::{ |
| 41 | 41 | use crate::imports::{Import, ImportKind}; |
| 42 | 42 | use crate::late::{PatternSource, Rib}; |
| 43 | 43 | use crate::{ |
| 44 | errors as errs, path_names_to_string, AmbiguityError, AmbiguityErrorMisc, AmbiguityKind, | |
| 45 | BindingError, BindingKey, Finalize, HasGenericParams, LexicalScopeBinding, MacroRulesScope, | |
| 46 | Module, ModuleKind, ModuleOrUniformRoot, NameBinding, NameBindingKind, ParentScope, PathResult, | |
| 47 | PrivacyError, ResolutionError, Resolver, Scope, ScopeSet, Segment, UseError, Used, | |
| 48 | VisResolutionError, | |
| 44 | AmbiguityError, AmbiguityErrorMisc, AmbiguityKind, BindingError, BindingKey, Finalize, | |
| 45 | HasGenericParams, LexicalScopeBinding, MacroRulesScope, Module, ModuleKind, | |
| 46 | ModuleOrUniformRoot, NameBinding, NameBindingKind, ParentScope, PathResult, PrivacyError, | |
| 47 | ResolutionError, Resolver, Scope, ScopeSet, Segment, UseError, Used, VisResolutionError, | |
| 48 | errors as errs, path_names_to_string, | |
| 49 | 49 | }; |
| 50 | 50 | |
| 51 | 51 | type Res = def::Res<ast::NodeId>; |
| ... | ... | @@ -1002,10 +1002,14 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 1002 | 1002 | VisResolutionError::AncestorOnly(span) => { |
| 1003 | 1003 | self.dcx().create_err(errs::AncestorOnly(span)) |
| 1004 | 1004 | } |
| 1005 | VisResolutionError::FailedToResolve(span, label, suggestion) => self.into_struct_error( | |
| 1006 | span, | |
| 1007 | ResolutionError::FailedToResolve { segment: None, label, suggestion, module: None }, | |
| 1008 | ), | |
| 1005 | VisResolutionError::FailedToResolve(span, label, suggestion) => { | |
| 1006 | self.into_struct_error(span, ResolutionError::FailedToResolve { | |
| 1007 | segment: None, | |
| 1008 | label, | |
| 1009 | suggestion, | |
| 1010 | module: None, | |
| 1011 | }) | |
| 1012 | } | |
| 1009 | 1013 | VisResolutionError::ExpectedFound(span, path_str, res) => { |
| 1010 | 1014 | self.dcx().create_err(errs::ExpectedModuleFound { span, res, path_str }) |
| 1011 | 1015 | } |
compiler/rustc_resolve/src/effective_visibilities.rs+2-2| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | use std::mem; |
| 2 | 2 | |
| 3 | 3 | use rustc_ast::visit::Visitor; |
| 4 | use rustc_ast::{ast, visit, Crate, EnumDef}; | |
| 4 | use rustc_ast::{Crate, EnumDef, ast, visit}; | |
| 5 | 5 | use rustc_data_structures::fx::FxHashSet; |
| 6 | use rustc_hir::def_id::{LocalDefId, CRATE_DEF_ID}; | |
| 6 | use rustc_hir::def_id::{CRATE_DEF_ID, LocalDefId}; | |
| 7 | 7 | use rustc_middle::middle::privacy::{EffectiveVisibilities, EffectiveVisibility, Level}; |
| 8 | 8 | use rustc_middle::ty::Visibility; |
| 9 | 9 | use tracing::info; |
compiler/rustc_resolve/src/errors.rs+2-2| ... | ... | @@ -1,11 +1,11 @@ |
| 1 | 1 | use rustc_errors::codes::*; |
| 2 | 2 | use rustc_errors::{Applicability, ElidedLifetimeInPathSubdiag, MultiSpan}; |
| 3 | 3 | use rustc_macros::{Diagnostic, Subdiagnostic}; |
| 4 | use rustc_span::symbol::{Ident, Symbol}; | |
| 5 | 4 | use rustc_span::Span; |
| 5 | use rustc_span::symbol::{Ident, Symbol}; | |
| 6 | 6 | |
| 7 | use crate::late::PatternSource; | |
| 8 | 7 | use crate::Res; |
| 8 | use crate::late::PatternSource; | |
| 9 | 9 | |
| 10 | 10 | #[derive(Diagnostic)] |
| 11 | 11 | #[diag(resolve_generic_params_from_outer_item, code = E0401)] |
compiler/rustc_resolve/src/ident.rs+30-43| ... | ... | @@ -1,27 +1,27 @@ |
| 1 | use Determinacy::*; | |
| 2 | use Namespace::*; | |
| 1 | 3 | use rustc_ast::{self as ast, NodeId}; |
| 2 | 4 | use rustc_errors::ErrorGuaranteed; |
| 3 | 5 | use rustc_hir::def::{DefKind, Namespace, NonMacroAttrKind, PartialRes, PerNS}; |
| 4 | 6 | use rustc_middle::{bug, ty}; |
| 5 | use rustc_session::lint::builtin::PROC_MACRO_DERIVE_RESOLUTION_FALLBACK; | |
| 6 | 7 | use rustc_session::lint::BuiltinLintDiag; |
| 8 | use rustc_session::lint::builtin::PROC_MACRO_DERIVE_RESOLUTION_FALLBACK; | |
| 7 | 9 | use rustc_session::parse::feature_err; |
| 8 | 10 | use rustc_span::def_id::LocalDefId; |
| 9 | 11 | use rustc_span::hygiene::{ExpnId, ExpnKind, LocalExpnId, MacroKind, SyntaxContext}; |
| 10 | use rustc_span::symbol::{kw, Ident}; | |
| 11 | use rustc_span::{sym, Span}; | |
| 12 | use rustc_span::symbol::{Ident, kw}; | |
| 13 | use rustc_span::{Span, sym}; | |
| 12 | 14 | use tracing::{debug, instrument}; |
| 13 | use Determinacy::*; | |
| 14 | use Namespace::*; | |
| 15 | 15 | |
| 16 | 16 | use crate::errors::{ParamKindInEnumDiscriminant, ParamKindInNonTrivialAnonConst}; |
| 17 | 17 | use crate::imports::Import; |
| 18 | 18 | use crate::late::{ConstantHasGenerics, NoConstantGenericsReason, PathSource, Rib, RibKind}; |
| 19 | use crate::macros::{sub_namespace_match, MacroRulesScope}; | |
| 19 | use crate::macros::{MacroRulesScope, sub_namespace_match}; | |
| 20 | 20 | use crate::{ |
| 21 | errors, AmbiguityError, AmbiguityErrorMisc, AmbiguityKind, BindingKey, Determinacy, Finalize, | |
| 21 | AmbiguityError, AmbiguityErrorMisc, AmbiguityKind, BindingKey, Determinacy, Finalize, | |
| 22 | 22 | ImportKind, LexicalScopeBinding, Module, ModuleKind, ModuleOrUniformRoot, NameBinding, |
| 23 | 23 | NameBindingKind, ParentScope, PathResult, PrivacyError, Res, ResolutionError, Resolver, Scope, |
| 24 | ScopeSet, Segment, ToNameBinding, Used, Weak, | |
| 24 | ScopeSet, Segment, ToNameBinding, Used, Weak, errors, | |
| 25 | 25 | }; |
| 26 | 26 | |
| 27 | 27 | type Visibility = ty::Visibility<LocalDefId>; |
| ... | ... | @@ -1218,25 +1218,21 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 1218 | 1218 | } |
| 1219 | 1219 | Some(_) => None, |
| 1220 | 1220 | }; |
| 1221 | ( | |
| 1222 | rib_ident.span, | |
| 1223 | AttemptToUseNonConstantValueInConstant { | |
| 1224 | ident: original_rib_ident_def, | |
| 1225 | suggestion: "const", | |
| 1226 | current: "let", | |
| 1227 | type_span, | |
| 1228 | }, | |
| 1229 | ) | |
| 1221 | (rib_ident.span, AttemptToUseNonConstantValueInConstant { | |
| 1222 | ident: original_rib_ident_def, | |
| 1223 | suggestion: "const", | |
| 1224 | current: "let", | |
| 1225 | type_span, | |
| 1226 | }) | |
| 1230 | 1227 | } |
| 1231 | Some((ident, kind)) => ( | |
| 1232 | span, | |
| 1233 | AttemptToUseNonConstantValueInConstant { | |
| 1228 | Some((ident, kind)) => { | |
| 1229 | (span, AttemptToUseNonConstantValueInConstant { | |
| 1234 | 1230 | ident, |
| 1235 | 1231 | suggestion: "let", |
| 1236 | 1232 | current: kind.as_str(), |
| 1237 | 1233 | type_span: None, |
| 1238 | }, | |
| 1239 | ), | |
| 1234 | }) | |
| 1235 | } | |
| 1240 | 1236 | }; |
| 1241 | 1237 | self.report_error(span, resolution_error); |
| 1242 | 1238 | } |
| ... | ... | @@ -1244,13 +1240,10 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 1244 | 1240 | } |
| 1245 | 1241 | RibKind::ConstParamTy => { |
| 1246 | 1242 | if let Some(span) = finalize { |
| 1247 | self.report_error( | |
| 1248 | span, | |
| 1249 | ParamInTyOfConstParam { | |
| 1250 | name: rib_ident.name, | |
| 1251 | param_kind: None, | |
| 1252 | }, | |
| 1253 | ); | |
| 1243 | self.report_error(span, ParamInTyOfConstParam { | |
| 1244 | name: rib_ident.name, | |
| 1245 | param_kind: None, | |
| 1246 | }); | |
| 1254 | 1247 | } |
| 1255 | 1248 | return Res::Err; |
| 1256 | 1249 | } |
| ... | ... | @@ -1331,13 +1324,10 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 1331 | 1324 | } |
| 1332 | 1325 | RibKind::ConstParamTy => { |
| 1333 | 1326 | if let Some(span) = finalize { |
| 1334 | self.report_error( | |
| 1335 | span, | |
| 1336 | ResolutionError::ParamInTyOfConstParam { | |
| 1337 | name: rib_ident.name, | |
| 1338 | param_kind: Some(errors::ParamKindInTyOfConstParam::Type), | |
| 1339 | }, | |
| 1340 | ); | |
| 1327 | self.report_error(span, ResolutionError::ParamInTyOfConstParam { | |
| 1328 | name: rib_ident.name, | |
| 1329 | param_kind: Some(errors::ParamKindInTyOfConstParam::Type), | |
| 1330 | }); | |
| 1341 | 1331 | } |
| 1342 | 1332 | return Res::Err; |
| 1343 | 1333 | } |
| ... | ... | @@ -1400,13 +1390,10 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 1400 | 1390 | } |
| 1401 | 1391 | RibKind::ConstParamTy => { |
| 1402 | 1392 | if let Some(span) = finalize { |
| 1403 | self.report_error( | |
| 1404 | span, | |
| 1405 | ResolutionError::ParamInTyOfConstParam { | |
| 1406 | name: rib_ident.name, | |
| 1407 | param_kind: Some(errors::ParamKindInTyOfConstParam::Const), | |
| 1408 | }, | |
| 1409 | ); | |
| 1393 | self.report_error(span, ResolutionError::ParamInTyOfConstParam { | |
| 1394 | name: rib_ident.name, | |
| 1395 | param_kind: Some(errors::ParamKindInTyOfConstParam::Const), | |
| 1396 | }); | |
| 1410 | 1397 | } |
| 1411 | 1398 | return Res::Err; |
| 1412 | 1399 | } |
compiler/rustc_resolve/src/imports.rs+16-19| ... | ... | @@ -7,36 +7,36 @@ use rustc_ast::NodeId; |
| 7 | 7 | use rustc_data_structures::fx::FxHashSet; |
| 8 | 8 | use rustc_data_structures::intern::Interned; |
| 9 | 9 | use rustc_errors::codes::*; |
| 10 | use rustc_errors::{pluralize, struct_span_code_err, Applicability, MultiSpan}; | |
| 10 | use rustc_errors::{Applicability, MultiSpan, pluralize, struct_span_code_err}; | |
| 11 | 11 | use rustc_hir::def::{self, DefKind, PartialRes}; |
| 12 | 12 | use rustc_hir::def_id::DefId; |
| 13 | 13 | use rustc_middle::metadata::{ModChild, Reexport}; |
| 14 | 14 | use rustc_middle::{span_bug, ty}; |
| 15 | use rustc_session::lint::BuiltinLintDiag; | |
| 15 | 16 | use rustc_session::lint::builtin::{ |
| 16 | 17 | AMBIGUOUS_GLOB_REEXPORTS, HIDDEN_GLOB_REEXPORTS, PUB_USE_OF_PRIVATE_EXTERN_CRATE, |
| 17 | 18 | REDUNDANT_IMPORTS, UNUSED_IMPORTS, |
| 18 | 19 | }; |
| 19 | use rustc_session::lint::BuiltinLintDiag; | |
| 20 | use rustc_span::Span; | |
| 20 | 21 | use rustc_span::edit_distance::find_best_match_for_name; |
| 21 | 22 | use rustc_span::hygiene::LocalExpnId; |
| 22 | use rustc_span::symbol::{kw, Ident, Symbol}; | |
| 23 | use rustc_span::Span; | |
| 23 | use rustc_span::symbol::{Ident, Symbol, kw}; | |
| 24 | 24 | use smallvec::SmallVec; |
| 25 | 25 | use tracing::debug; |
| 26 | 26 | |
| 27 | use crate::diagnostics::{import_candidates, DiagMode, Suggestion}; | |
| 27 | use crate::Determinacy::{self, *}; | |
| 28 | use crate::Namespace::*; | |
| 29 | use crate::diagnostics::{DiagMode, Suggestion, import_candidates}; | |
| 28 | 30 | use crate::errors::{ |
| 29 | 31 | CannotBeReexportedCratePublic, CannotBeReexportedCratePublicNS, CannotBeReexportedPrivate, |
| 30 | 32 | CannotBeReexportedPrivateNS, CannotDetermineImportResolution, CannotGlobImportAllCrates, |
| 31 | 33 | ConsiderAddingMacroExport, ConsiderMarkingAsPub, IsNotDirectlyImportable, |
| 32 | 34 | ItemsInTraitsAreNotImportable, |
| 33 | 35 | }; |
| 34 | use crate::Determinacy::{self, *}; | |
| 35 | use crate::Namespace::*; | |
| 36 | 36 | use crate::{ |
| 37 | module_to_string, names_to_string, AmbiguityError, AmbiguityKind, BindingKey, Finalize, | |
| 38 | ImportSuggestion, Module, ModuleOrUniformRoot, NameBinding, NameBindingData, NameBindingKind, | |
| 39 | ParentScope, PathResult, PerNS, ResolutionError, Resolver, ScopeSet, Segment, Used, | |
| 37 | AmbiguityError, AmbiguityKind, BindingKey, Finalize, ImportSuggestion, Module, | |
| 38 | ModuleOrUniformRoot, NameBinding, NameBindingData, NameBindingKind, ParentScope, PathResult, | |
| 39 | PerNS, ResolutionError, Resolver, ScopeSet, Segment, Used, module_to_string, names_to_string, | |
| 40 | 40 | }; |
| 41 | 41 | |
| 42 | 42 | type Res = def::Res<NodeId>; |
| ... | ... | @@ -901,15 +901,12 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 901 | 901 | } => { |
| 902 | 902 | if no_ambiguity { |
| 903 | 903 | assert!(import.imported_module.get().is_none()); |
| 904 | self.report_error( | |
| 905 | span, | |
| 906 | ResolutionError::FailedToResolve { | |
| 907 | segment: Some(segment_name), | |
| 908 | label, | |
| 909 | suggestion, | |
| 910 | module, | |
| 911 | }, | |
| 912 | ); | |
| 904 | self.report_error(span, ResolutionError::FailedToResolve { | |
| 905 | segment: Some(segment_name), | |
| 906 | label, | |
| 907 | suggestion, | |
| 908 | module, | |
| 909 | }); | |
| 913 | 910 | } |
| 914 | 911 | return None; |
| 915 | 912 | } |
compiler/rustc_resolve/src/late.rs+30-41| ... | ... | @@ -8,19 +8,19 @@ |
| 8 | 8 | |
| 9 | 9 | use std::assert_matches::debug_assert_matches; |
| 10 | 10 | use std::borrow::Cow; |
| 11 | use std::collections::hash_map::Entry; | |
| 12 | 11 | use std::collections::BTreeSet; |
| 12 | use std::collections::hash_map::Entry; | |
| 13 | 13 | use std::mem::{replace, swap, take}; |
| 14 | 14 | |
| 15 | 15 | use rustc_ast::ptr::P; |
| 16 | use rustc_ast::visit::{visit_opt, walk_list, AssocCtxt, BoundKind, FnCtxt, FnKind, Visitor}; | |
| 16 | use rustc_ast::visit::{AssocCtxt, BoundKind, FnCtxt, FnKind, Visitor, visit_opt, walk_list}; | |
| 17 | 17 | use rustc_ast::*; |
| 18 | 18 | use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap}; |
| 19 | 19 | use rustc_errors::codes::*; |
| 20 | 20 | use rustc_errors::{Applicability, DiagArgValue, IntoDiagArg, StashKey, Suggestions}; |
| 21 | 21 | use rustc_hir::def::Namespace::{self, *}; |
| 22 | 22 | use rustc_hir::def::{self, CtorKind, DefKind, LifetimeRes, NonMacroAttrKind, PartialRes, PerNS}; |
| 23 | use rustc_hir::def_id::{DefId, LocalDefId, CRATE_DEF_ID, LOCAL_CRATE}; | |
| 23 | use rustc_hir::def_id::{CRATE_DEF_ID, DefId, LOCAL_CRATE, LocalDefId}; | |
| 24 | 24 | use rustc_hir::{MissingLifetimeKind, PrimTy, TraitCandidate}; |
| 25 | 25 | use rustc_middle::middle::resolve_bound_vars::Set1; |
| 26 | 26 | use rustc_middle::ty::DelegationFnSig; |
| ... | ... | @@ -28,16 +28,16 @@ use rustc_middle::{bug, span_bug}; |
| 28 | 28 | use rustc_session::config::{CrateType, ResolveDocLinks}; |
| 29 | 29 | use rustc_session::lint::{self, BuiltinLintDiag}; |
| 30 | 30 | use rustc_session::parse::feature_err; |
| 31 | use rustc_span::source_map::{respan, Spanned}; | |
| 32 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 31 | use rustc_span::source_map::{Spanned, respan}; | |
| 32 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 33 | 33 | use rustc_span::{BytePos, Span, SyntaxContext}; |
| 34 | use smallvec::{smallvec, SmallVec}; | |
| 34 | use smallvec::{SmallVec, smallvec}; | |
| 35 | 35 | use tracing::{debug, instrument, trace}; |
| 36 | 36 | |
| 37 | 37 | use crate::{ |
| 38 | errors, path_names_to_string, rustdoc, BindingError, BindingKey, Finalize, LexicalScopeBinding, | |
| 39 | Module, ModuleOrUniformRoot, NameBinding, ParentScope, PathResult, ResolutionError, Resolver, | |
| 40 | Segment, TyCtxt, UseError, Used, | |
| 38 | BindingError, BindingKey, Finalize, LexicalScopeBinding, Module, ModuleOrUniformRoot, | |
| 39 | NameBinding, ParentScope, PathResult, ResolutionError, Resolver, Segment, TyCtxt, UseError, | |
| 40 | Used, errors, path_names_to_string, rustdoc, | |
| 41 | 41 | }; |
| 42 | 42 | |
| 43 | 43 | mod diagnostics; |
| ... | ... | @@ -1801,11 +1801,9 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { |
| 1801 | 1801 | && Some(true) == self.diag_metadata.in_non_gat_assoc_type |
| 1802 | 1802 | && let crate::ModuleKind::Def(DefKind::Trait, trait_id, _) = module.kind |
| 1803 | 1803 | { |
| 1804 | if def_id_matches_path( | |
| 1805 | self.r.tcx, | |
| 1806 | trait_id, | |
| 1807 | &["core", "iter", "traits", "iterator", "Iterator"], | |
| 1808 | ) { | |
| 1804 | if def_id_matches_path(self.r.tcx, trait_id, &[ | |
| 1805 | "core", "iter", "traits", "iterator", "Iterator", | |
| 1806 | ]) { | |
| 1809 | 1807 | self.r.dcx().emit_err(errors::LendingIteratorReportError { |
| 1810 | 1808 | lifetime: lifetime.ident.span, |
| 1811 | 1809 | ty: ty.span, |
| ... | ... | @@ -3412,14 +3410,11 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { |
| 3412 | 3410 | |
| 3413 | 3411 | match seen_trait_items.entry(id_in_trait) { |
| 3414 | 3412 | Entry::Occupied(entry) => { |
| 3415 | self.report_error( | |
| 3416 | span, | |
| 3417 | ResolutionError::TraitImplDuplicate { | |
| 3418 | name: ident.name, | |
| 3419 | old_span: *entry.get(), | |
| 3420 | trait_item_span: binding.span, | |
| 3421 | }, | |
| 3422 | ); | |
| 3413 | self.report_error(span, ResolutionError::TraitImplDuplicate { | |
| 3414 | name: ident.name, | |
| 3415 | old_span: *entry.get(), | |
| 3416 | trait_item_span: binding.span, | |
| 3417 | }); | |
| 3423 | 3418 | return; |
| 3424 | 3419 | } |
| 3425 | 3420 | Entry::Vacant(entry) => { |
| ... | ... | @@ -3450,16 +3445,13 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { |
| 3450 | 3445 | } |
| 3451 | 3446 | }; |
| 3452 | 3447 | let trait_path = path_names_to_string(path); |
| 3453 | self.report_error( | |
| 3454 | span, | |
| 3455 | ResolutionError::TraitImplMismatch { | |
| 3456 | name: ident.name, | |
| 3457 | kind, | |
| 3458 | code, | |
| 3459 | trait_path, | |
| 3460 | trait_item_span: binding.span, | |
| 3461 | }, | |
| 3462 | ); | |
| 3448 | self.report_error(span, ResolutionError::TraitImplMismatch { | |
| 3449 | name: ident.name, | |
| 3450 | kind, | |
| 3451 | code, | |
| 3452 | trait_path, | |
| 3453 | trait_item_span: binding.span, | |
| 3454 | }); | |
| 3463 | 3455 | } |
| 3464 | 3456 | |
| 3465 | 3457 | fn resolve_const_body(&mut self, expr: &'ast Expr, item: Option<(Ident, ConstantItemKind)>) { |
| ... | ... | @@ -4447,15 +4439,12 @@ impl<'a, 'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'a, 'ast, 'ra, 'tcx> { |
| 4447 | 4439 | module, |
| 4448 | 4440 | segment_name, |
| 4449 | 4441 | } => { |
| 4450 | return Err(respan( | |
| 4451 | span, | |
| 4452 | ResolutionError::FailedToResolve { | |
| 4453 | segment: Some(segment_name), | |
| 4454 | label, | |
| 4455 | suggestion, | |
| 4456 | module, | |
| 4457 | }, | |
| 4458 | )); | |
| 4442 | return Err(respan(span, ResolutionError::FailedToResolve { | |
| 4443 | segment: Some(segment_name), | |
| 4444 | label, | |
| 4445 | suggestion, | |
| 4446 | module, | |
| 4447 | })); | |
| 4459 | 4448 | } |
| 4460 | 4449 | PathResult::Module(..) | PathResult::Failed { .. } => return Ok(None), |
| 4461 | 4450 | PathResult::Indeterminate => bug!("indeterminate path result in resolve_qpath"), |
compiler/rustc_resolve/src/late/diagnostics.rs+26-32| ... | ... | @@ -5,30 +5,30 @@ use std::iter; |
| 5 | 5 | use std::ops::Deref; |
| 6 | 6 | |
| 7 | 7 | use rustc_ast::ptr::P; |
| 8 | use rustc_ast::visit::{walk_ty, FnCtxt, FnKind, LifetimeCtxt, Visitor}; | |
| 8 | use rustc_ast::visit::{FnCtxt, FnKind, LifetimeCtxt, Visitor, walk_ty}; | |
| 9 | 9 | use rustc_ast::{ |
| 10 | self as ast, AssocItemKind, Expr, ExprKind, GenericParam, GenericParamKind, Item, ItemKind, | |
| 11 | MethodCall, NodeId, Path, Ty, TyKind, DUMMY_NODE_ID, | |
| 10 | self as ast, AssocItemKind, DUMMY_NODE_ID, Expr, ExprKind, GenericParam, GenericParamKind, | |
| 11 | Item, ItemKind, MethodCall, NodeId, Path, Ty, TyKind, | |
| 12 | 12 | }; |
| 13 | 13 | use rustc_ast_pretty::pprust::where_bound_predicate_to_string; |
| 14 | 14 | use rustc_data_structures::fx::{FxHashSet, FxIndexSet}; |
| 15 | 15 | use rustc_errors::codes::*; |
| 16 | 16 | use rustc_errors::{ |
| 17 | pluralize, struct_span_code_err, Applicability, Diag, ErrorGuaranteed, MultiSpan, | |
| 18 | SuggestionStyle, | |
| 17 | Applicability, Diag, ErrorGuaranteed, MultiSpan, SuggestionStyle, pluralize, | |
| 18 | struct_span_code_err, | |
| 19 | 19 | }; |
| 20 | 20 | use rustc_hir as hir; |
| 21 | 21 | use rustc_hir::def::Namespace::{self, *}; |
| 22 | 22 | use rustc_hir::def::{self, CtorKind, CtorOf, DefKind}; |
| 23 | use rustc_hir::def_id::{DefId, CRATE_DEF_ID}; | |
| 23 | use rustc_hir::def_id::{CRATE_DEF_ID, DefId}; | |
| 24 | 24 | use rustc_hir::{MissingLifetimeKind, PrimTy}; |
| 25 | 25 | use rustc_middle::ty; |
| 26 | use rustc_session::{lint, Session}; | |
| 26 | use rustc_session::{Session, lint}; | |
| 27 | 27 | use rustc_span::edit_distance::find_best_match_for_name; |
| 28 | 28 | use rustc_span::edition::Edition; |
| 29 | 29 | use rustc_span::hygiene::MacroKind; |
| 30 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 31 | use rustc_span::{Span, DUMMY_SP}; | |
| 30 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 31 | use rustc_span::{DUMMY_SP, Span}; | |
| 32 | 32 | use thin_vec::ThinVec; |
| 33 | 33 | use tracing::debug; |
| 34 | 34 | |
| ... | ... | @@ -40,8 +40,8 @@ use crate::late::{ |
| 40 | 40 | }; |
| 41 | 41 | use crate::ty::fast_reject::SimplifiedType; |
| 42 | 42 | use crate::{ |
| 43 | errors, path_names_to_string, Module, ModuleKind, ModuleOrUniformRoot, PathResult, PathSource, | |
| 44 | Segment, | |
| 43 | Module, ModuleKind, ModuleOrUniformRoot, PathResult, PathSource, Segment, errors, | |
| 44 | path_names_to_string, | |
| 45 | 45 | }; |
| 46 | 46 | |
| 47 | 47 | type Res = def::Res<ast::NodeId>; |
| ... | ... | @@ -1017,15 +1017,12 @@ impl<'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { |
| 1017 | 1017 | |
| 1018 | 1018 | debug!("smart_resolve_path_fragment: E0424, source={:?}", source); |
| 1019 | 1019 | err.code(E0424); |
| 1020 | err.span_label( | |
| 1021 | span, | |
| 1022 | match source { | |
| 1023 | PathSource::Pat => { | |
| 1024 | "`self` value is a keyword and may not be bound to variables or shadowed" | |
| 1025 | } | |
| 1026 | _ => "`self` value is a keyword only available in methods with a `self` parameter", | |
| 1027 | }, | |
| 1028 | ); | |
| 1020 | err.span_label(span, match source { | |
| 1021 | PathSource::Pat => { | |
| 1022 | "`self` value is a keyword and may not be bound to variables or shadowed" | |
| 1023 | } | |
| 1024 | _ => "`self` value is a keyword only available in methods with a `self` parameter", | |
| 1025 | }); | |
| 1029 | 1026 | let is_assoc_fn = self.self_type_is_available(); |
| 1030 | 1027 | let self_from_macro = "a `self` parameter, but a macro invocation can only \ |
| 1031 | 1028 | access identifiers it receives from parameters"; |
| ... | ... | @@ -2309,18 +2306,15 @@ impl<'ast, 'ra: 'ast, 'tcx> LateResolutionVisitor<'_, 'ast, 'ra, 'tcx> { |
| 2309 | 2306 | if module_def_id == def_id { |
| 2310 | 2307 | let path = |
| 2311 | 2308 | Path { span: name_binding.span, segments: path_segments, tokens: None }; |
| 2312 | result = Some(( | |
| 2313 | module, | |
| 2314 | ImportSuggestion { | |
| 2315 | did: Some(def_id), | |
| 2316 | descr: "module", | |
| 2317 | path, | |
| 2318 | accessible: true, | |
| 2319 | doc_visible, | |
| 2320 | note: None, | |
| 2321 | via_import: false, | |
| 2322 | }, | |
| 2323 | )); | |
| 2309 | result = Some((module, ImportSuggestion { | |
| 2310 | did: Some(def_id), | |
| 2311 | descr: "module", | |
| 2312 | path, | |
| 2313 | accessible: true, | |
| 2314 | doc_visible, | |
| 2315 | note: None, | |
| 2316 | via_import: false, | |
| 2317 | })); | |
| 2324 | 2318 | } else { |
| 2325 | 2319 | // add the module to the lookup |
| 2326 | 2320 | if seen_modules.insert(module_def_id) { |
compiler/rustc_resolve/src/lib.rs+6-6| ... | ... | @@ -40,8 +40,8 @@ use rustc_arena::{DroplessArena, TypedArena}; |
| 40 | 40 | use rustc_ast::expand::StrippedCfgItem; |
| 41 | 41 | use rustc_ast::node_id::NodeMap; |
| 42 | 42 | use rustc_ast::{ |
| 43 | self as ast, attr, AngleBracketedArg, Crate, Expr, ExprKind, GenericArg, GenericArgs, LitKind, | |
| 44 | NodeId, Path, CRATE_NODE_ID, | |
| 43 | self as ast, AngleBracketedArg, CRATE_NODE_ID, Crate, Expr, ExprKind, GenericArg, GenericArgs, | |
| 44 | LitKind, NodeId, Path, attr, | |
| 45 | 45 | }; |
| 46 | 46 | use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet}; |
| 47 | 47 | use rustc_data_structures::intern::Interned; |
| ... | ... | @@ -54,7 +54,7 @@ use rustc_hir::def::Namespace::{self, *}; |
| 54 | 54 | use rustc_hir::def::{ |
| 55 | 55 | self, CtorOf, DefKind, DocLinkResMap, LifetimeRes, NonMacroAttrKind, PartialRes, PerNS, |
| 56 | 56 | }; |
| 57 | use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LocalDefIdMap, CRATE_DEF_ID, LOCAL_CRATE}; | |
| 57 | use rustc_hir::def_id::{CRATE_DEF_ID, CrateNum, DefId, LOCAL_CRATE, LocalDefId, LocalDefIdMap}; | |
| 58 | 58 | use rustc_hir::{PrimTy, TraitCandidate}; |
| 59 | 59 | use rustc_index::IndexVec; |
| 60 | 60 | use rustc_metadata::creader::{CStore, CrateLoader}; |
| ... | ... | @@ -70,9 +70,9 @@ use rustc_query_system::ich::StableHashingContext; |
| 70 | 70 | use rustc_session::lint::builtin::PRIVATE_MACRO_USE; |
| 71 | 71 | use rustc_session::lint::{BuiltinLintDiag, LintBuffer}; |
| 72 | 72 | use rustc_span::hygiene::{ExpnId, LocalExpnId, MacroKind, SyntaxContext, Transparency}; |
| 73 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 74 | use rustc_span::{Span, DUMMY_SP}; | |
| 75 | use smallvec::{smallvec, SmallVec}; | |
| 73 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 74 | use rustc_span::{DUMMY_SP, Span}; | |
| 75 | use smallvec::{SmallVec, smallvec}; | |
| 76 | 76 | use tracing::debug; |
| 77 | 77 | |
| 78 | 78 | type Res = def::Res<NodeId>; |
compiler/rustc_resolve/src/macros.rs+12-15| ... | ... | @@ -5,7 +5,7 @@ use std::cell::Cell; |
| 5 | 5 | use std::mem; |
| 6 | 6 | |
| 7 | 7 | use rustc_ast::expand::StrippedCfgItem; |
| 8 | use rustc_ast::{self as ast, attr, Crate, Inline, ItemKind, ModKind, NodeId}; | |
| 8 | use rustc_ast::{self as ast, Crate, Inline, ItemKind, ModKind, NodeId, attr}; | |
| 9 | 9 | use rustc_ast_pretty::pprust; |
| 10 | 10 | use rustc_attr::StabilityLevel; |
| 11 | 11 | use rustc_data_structures::intern::Interned; |
| ... | ... | @@ -23,24 +23,24 @@ use rustc_hir::def::{self, DefKind, Namespace, NonMacroAttrKind}; |
| 23 | 23 | use rustc_hir::def_id::{CrateNum, DefId, LocalDefId}; |
| 24 | 24 | use rustc_middle::middle::stability; |
| 25 | 25 | use rustc_middle::ty::{RegisteredTools, TyCtxt, Visibility}; |
| 26 | use rustc_session::lint::BuiltinLintDiag; | |
| 26 | 27 | use rustc_session::lint::builtin::{ |
| 27 | 28 | LEGACY_DERIVE_HELPERS, OUT_OF_SCOPE_MACRO_CALLS, SOFT_UNSTABLE, |
| 28 | UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES, UNUSED_MACROS, UNUSED_MACRO_RULES, | |
| 29 | UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES, UNUSED_MACRO_RULES, UNUSED_MACROS, | |
| 29 | 30 | }; |
| 30 | use rustc_session::lint::BuiltinLintDiag; | |
| 31 | 31 | use rustc_session::parse::feature_err; |
| 32 | 32 | use rustc_span::edit_distance::edit_distance; |
| 33 | 33 | use rustc_span::edition::Edition; |
| 34 | 34 | use rustc_span::hygiene::{self, AstPass, ExpnData, ExpnKind, LocalExpnId, MacroKind}; |
| 35 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 36 | use rustc_span::{Span, DUMMY_SP}; | |
| 35 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 36 | use rustc_span::{DUMMY_SP, Span}; | |
| 37 | 37 | |
| 38 | use crate::Namespace::*; | |
| 38 | 39 | use crate::errors::{ |
| 39 | 40 | self, AddAsNonDerive, CannotDetermineMacroResolution, CannotFindIdentInThisScope, |
| 40 | 41 | MacroExpectedFound, RemoveSurroundingDerive, |
| 41 | 42 | }; |
| 42 | 43 | use crate::imports::Import; |
| 43 | use crate::Namespace::*; | |
| 44 | 44 | use crate::{ |
| 45 | 45 | BindingKey, BuiltinMacroState, DeriveData, Determinacy, Finalize, InvocationParent, MacroData, |
| 46 | 46 | ModuleKind, ModuleOrUniformRoot, NameBinding, NameBindingKind, ParentScope, PathResult, |
| ... | ... | @@ -914,15 +914,12 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> { |
| 914 | 914 | None, |
| 915 | 915 | ) |
| 916 | 916 | }; |
| 917 | self.report_error( | |
| 918 | span, | |
| 919 | ResolutionError::FailedToResolve { | |
| 920 | segment: path.last().map(|segment| segment.ident.name), | |
| 921 | label, | |
| 922 | suggestion, | |
| 923 | module, | |
| 924 | }, | |
| 925 | ); | |
| 917 | self.report_error(span, ResolutionError::FailedToResolve { | |
| 918 | segment: path.last().map(|segment| segment.ident.name), | |
| 919 | label, | |
| 920 | suggestion, | |
| 921 | module, | |
| 922 | }); | |
| 926 | 923 | } |
| 927 | 924 | PathResult::Module(..) | PathResult::Indeterminate => unreachable!(), |
| 928 | 925 | } |
compiler/rustc_resolve/src/rustdoc.rs+2-2| ... | ... | @@ -9,8 +9,8 @@ use rustc_ast::util::comments::beautify_doc_string; |
| 9 | 9 | use rustc_data_structures::fx::FxHashMap; |
| 10 | 10 | use rustc_middle::ty::TyCtxt; |
| 11 | 11 | use rustc_span::def_id::DefId; |
| 12 | use rustc_span::symbol::{kw, sym, Symbol}; | |
| 13 | use rustc_span::{InnerSpan, Span, DUMMY_SP}; | |
| 12 | use rustc_span::symbol::{Symbol, kw, sym}; | |
| 13 | use rustc_span::{DUMMY_SP, InnerSpan, Span}; | |
| 14 | 14 | use tracing::{debug, trace}; |
| 15 | 15 | |
| 16 | 16 | #[derive(Clone, Copy, PartialEq, Eq, Debug)] |
compiler/rustc_sanitizers/src/cfi/mod.rs+1-1| ... | ... | @@ -3,4 +3,4 @@ |
| 3 | 3 | //! For more information about LLVM CFI and cross-language LLVM CFI support for the Rust compiler, |
| 4 | 4 | //! see design document in the tracking issue #89653. |
| 5 | 5 | pub mod typeid; |
| 6 | pub use crate::cfi::typeid::{typeid_for_fnabi, typeid_for_instance, TypeIdOptions}; | |
| 6 | pub use crate::cfi::typeid::{TypeIdOptions, typeid_for_fnabi, typeid_for_instance}; |
compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs+2-2| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | |
| 8 | 8 | use std::fmt::Write as _; |
| 9 | 9 | |
| 10 | use rustc_data_structures::base_n::{ToBaseN, ALPHANUMERIC_ONLY, CASE_INSENSITIVE}; | |
| 10 | use rustc_data_structures::base_n::{ALPHANUMERIC_ONLY, CASE_INSENSITIVE, ToBaseN}; | |
| 11 | 11 | use rustc_data_structures::fx::FxHashMap; |
| 12 | 12 | use rustc_hir as hir; |
| 13 | 13 | use rustc_middle::bug; |
| ... | ... | @@ -22,8 +22,8 @@ use rustc_target::abi::Integer; |
| 22 | 22 | use rustc_target::spec::abi::Abi; |
| 23 | 23 | use tracing::instrument; |
| 24 | 24 | |
| 25 | use crate::cfi::typeid::itanium_cxx_abi::transform::{TransformTy, TransformTyOptions}; | |
| 26 | 25 | use crate::cfi::typeid::TypeIdOptions; |
| 26 | use crate::cfi::typeid::itanium_cxx_abi::transform::{TransformTy, TransformTyOptions}; | |
| 27 | 27 | |
| 28 | 28 | /// Options for encode_ty. |
| 29 | 29 | pub(crate) type EncodeTyOptions = TypeIdOptions; |
compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/mod.rs+3-3| ... | ... | @@ -12,11 +12,11 @@ use tracing::instrument; |
| 12 | 12 | |
| 13 | 13 | mod encode; |
| 14 | 14 | mod transform; |
| 15 | use crate::cfi::typeid::itanium_cxx_abi::encode::{encode_ty, DictKey, EncodeTyOptions}; | |
| 15 | use crate::cfi::typeid::TypeIdOptions; | |
| 16 | use crate::cfi::typeid::itanium_cxx_abi::encode::{DictKey, EncodeTyOptions, encode_ty}; | |
| 16 | 17 | use crate::cfi::typeid::itanium_cxx_abi::transform::{ |
| 17 | transform_instance, TransformTy, TransformTyOptions, | |
| 18 | TransformTy, TransformTyOptions, transform_instance, | |
| 18 | 19 | }; |
| 19 | use crate::cfi::typeid::TypeIdOptions; | |
| 20 | 20 | |
| 21 | 21 | /// Returns a type metadata identifier for the specified FnAbi using the Itanium C++ ABI with vendor |
| 22 | 22 | /// extended type qualifiers and types for Rust types that are not used at the FFI boundary. |
compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/transform.rs+1-1| ... | ... | @@ -19,8 +19,8 @@ use rustc_span::sym; |
| 19 | 19 | use rustc_trait_selection::traits; |
| 20 | 20 | use tracing::{debug, instrument}; |
| 21 | 21 | |
| 22 | use crate::cfi::typeid::itanium_cxx_abi::encode::EncodeTyOptions; | |
| 23 | 22 | use crate::cfi::typeid::TypeIdOptions; |
| 23 | use crate::cfi::typeid::itanium_cxx_abi::encode::EncodeTyOptions; | |
| 24 | 24 | |
| 25 | 25 | /// Options for transform_ty. |
| 26 | 26 | pub(crate) type TransformTyOptions = TypeIdOptions; |
compiler/rustc_sanitizers/src/kcfi/mod.rs+1-1| ... | ... | @@ -4,4 +4,4 @@ |
| 4 | 4 | //! For more information about LLVM KCFI and cross-language LLVM KCFI support for the Rust compiler, |
| 5 | 5 | //! see the tracking issue #123479. |
| 6 | 6 | pub mod typeid; |
| 7 | pub use crate::kcfi::typeid::{typeid_for_fnabi, typeid_for_instance, TypeIdOptions}; | |
| 7 | pub use crate::kcfi::typeid::{TypeIdOptions, typeid_for_fnabi, typeid_for_instance}; |
compiler/rustc_sanitizers/src/kcfi/typeid/mod.rs+1-1| ... | ... | @@ -10,7 +10,7 @@ use rustc_middle::ty::{Instance, InstanceKind, ReifyReason, Ty, TyCtxt}; |
| 10 | 10 | use rustc_target::abi::call::FnAbi; |
| 11 | 11 | use twox_hash::XxHash64; |
| 12 | 12 | |
| 13 | pub use crate::cfi::typeid::{itanium_cxx_abi, TypeIdOptions}; | |
| 13 | pub use crate::cfi::typeid::{TypeIdOptions, itanium_cxx_abi}; | |
| 14 | 14 | |
| 15 | 15 | /// Returns a KCFI type metadata identifier for the specified FnAbi. |
| 16 | 16 | pub fn typeid_for_fnabi<'tcx>( |
compiler/rustc_serialize/tests/leb128.rs+2-2| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | use rustc_serialize::leb128::*; | |
| 2 | use rustc_serialize::opaque::{MemDecoder, MAGIC_END_BYTES}; | |
| 3 | 1 | use rustc_serialize::Decoder; |
| 2 | use rustc_serialize::leb128::*; | |
| 3 | use rustc_serialize::opaque::{MAGIC_END_BYTES, MemDecoder}; | |
| 4 | 4 | |
| 5 | 5 | macro_rules! impl_test_unsigned_leb128 { |
| 6 | 6 | ($test_name:ident, $write_fn_name:ident, $read_fn_name:ident, $int_ty:ident) => { |
compiler/rustc_session/src/code_stats.rs+1-1| ... | ... | @@ -2,8 +2,8 @@ use std::cmp; |
| 2 | 2 | |
| 3 | 3 | use rustc_data_structures::fx::{FxHashMap, FxHashSet}; |
| 4 | 4 | use rustc_data_structures::sync::Lock; |
| 5 | use rustc_span::def_id::DefId; | |
| 6 | 5 | use rustc_span::Symbol; |
| 6 | use rustc_span::def_id::DefId; | |
| 7 | 7 | use rustc_target::abi::{Align, Size}; |
| 8 | 8 | |
| 9 | 9 | #[derive(Clone, PartialEq, Eq, Hash, Debug)] |
compiler/rustc_session/src/config.rs+4-4| ... | ... | @@ -20,10 +20,10 @@ use rustc_errors::emitter::HumanReadableErrorType; |
| 20 | 20 | use rustc_errors::{ColorConfig, DiagArgValue, DiagCtxtFlags, IntoDiagArg}; |
| 21 | 21 | use rustc_feature::UnstableFeatures; |
| 22 | 22 | use rustc_macros::{Decodable, Encodable, HashStable_Generic}; |
| 23 | use rustc_span::edition::{Edition, DEFAULT_EDITION, EDITION_NAME_LIST, LATEST_STABLE_EDITION}; | |
| 23 | use rustc_span::edition::{DEFAULT_EDITION, EDITION_NAME_LIST, Edition, LATEST_STABLE_EDITION}; | |
| 24 | 24 | use rustc_span::source_map::FilePathMapping; |
| 25 | 25 | use rustc_span::{ |
| 26 | sym, FileName, FileNameDisplayPreference, RealFileName, SourceFileHashAlgorithm, Symbol, | |
| 26 | FileName, FileNameDisplayPreference, RealFileName, SourceFileHashAlgorithm, Symbol, sym, | |
| 27 | 27 | }; |
| 28 | 28 | use rustc_target::spec::{ |
| 29 | 29 | FramePointer, LinkSelfContainedComponents, LinkerFeatures, SplitDebuginfo, Target, TargetTriple, |
| ... | ... | @@ -34,7 +34,7 @@ use crate::errors::FileWriteFail; |
| 34 | 34 | pub use crate::options::*; |
| 35 | 35 | use crate::search_paths::SearchPath; |
| 36 | 36 | use crate::utils::{CanonicalizedPath, NativeLib, NativeLibKind}; |
| 37 | use crate::{filesearch, lint, EarlyDiagCtxt, HashStableContext, Session}; | |
| 37 | use crate::{EarlyDiagCtxt, HashStableContext, Session, filesearch, lint}; | |
| 38 | 38 | |
| 39 | 39 | mod cfg; |
| 40 | 40 | pub mod sigpipe; |
| ... | ... | @@ -3004,8 +3004,8 @@ pub(crate) mod dep_tracking { |
| 3004 | 3004 | use rustc_data_structures::stable_hasher::Hash64; |
| 3005 | 3005 | use rustc_errors::LanguageIdentifier; |
| 3006 | 3006 | use rustc_feature::UnstableFeatures; |
| 3007 | use rustc_span::edition::Edition; | |
| 3008 | 3007 | use rustc_span::RealFileName; |
| 3008 | use rustc_span::edition::Edition; | |
| 3009 | 3009 | use rustc_target::spec::{ |
| 3010 | 3010 | CodeModel, FramePointer, MergeFunctions, OnBrokenPipe, PanicStrategy, RelocModel, |
| 3011 | 3011 | RelroLevel, SanitizerSet, SplitDebuginfo, StackProtector, TargetTriple, TlsModel, WasmCAbi, |
compiler/rustc_session/src/config/cfg.rs+4-4| ... | ... | @@ -25,14 +25,14 @@ use std::iter; |
| 25 | 25 | |
| 26 | 26 | use rustc_ast::ast; |
| 27 | 27 | use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexSet}; |
| 28 | use rustc_lint_defs::builtin::EXPLICIT_BUILTIN_CFGS_IN_FLAGS; | |
| 29 | 28 | use rustc_lint_defs::BuiltinLintDiag; |
| 30 | use rustc_span::symbol::{sym, Symbol}; | |
| 29 | use rustc_lint_defs::builtin::EXPLICIT_BUILTIN_CFGS_IN_FLAGS; | |
| 30 | use rustc_span::symbol::{Symbol, sym}; | |
| 31 | 31 | use rustc_target::abi::Align; |
| 32 | use rustc_target::spec::{PanicStrategy, RelocModel, SanitizerSet, Target, TargetTriple, TARGETS}; | |
| 32 | use rustc_target::spec::{PanicStrategy, RelocModel, SanitizerSet, TARGETS, Target, TargetTriple}; | |
| 33 | 33 | |
| 34 | use crate::config::{CrateType, FmtDebug}; | |
| 35 | 34 | use crate::Session; |
| 35 | use crate::config::{CrateType, FmtDebug}; | |
| 36 | 36 | |
| 37 | 37 | /// The parsed `--cfg` options that define the compilation environment of the |
| 38 | 38 | /// crate, used to drive conditional compilation. |
compiler/rustc_session/src/cstore.rs+2-2| ... | ... | @@ -8,12 +8,12 @@ use std::path::PathBuf; |
| 8 | 8 | use rustc_ast as ast; |
| 9 | 9 | use rustc_data_structures::sync::{self, AppendOnlyIndexVec, FreezeLock}; |
| 10 | 10 | use rustc_hir::def_id::{ |
| 11 | CrateNum, DefId, LocalDefId, StableCrateId, StableCrateIdMap, LOCAL_CRATE, | |
| 11 | CrateNum, DefId, LOCAL_CRATE, LocalDefId, StableCrateId, StableCrateIdMap, | |
| 12 | 12 | }; |
| 13 | 13 | use rustc_hir::definitions::{DefKey, DefPath, DefPathHash, Definitions}; |
| 14 | 14 | use rustc_macros::{Decodable, Encodable, HashStable_Generic}; |
| 15 | use rustc_span::symbol::Symbol; | |
| 16 | 15 | use rustc_span::Span; |
| 16 | use rustc_span::symbol::Symbol; | |
| 17 | 17 | use rustc_target::spec::abi::Abi; |
| 18 | 18 | |
| 19 | 19 | use crate::search_paths::PathKind; |
compiler/rustc_session/src/filesearch.rs+3-3| ... | ... | @@ -4,7 +4,7 @@ use std::path::{Path, PathBuf}; |
| 4 | 4 | use std::{env, fs}; |
| 5 | 5 | |
| 6 | 6 | use rustc_fs_util::{fix_windows_verbatim_for_gcc, try_canonicalize}; |
| 7 | use smallvec::{smallvec, SmallVec}; | |
| 7 | use smallvec::{SmallVec, smallvec}; | |
| 8 | 8 | |
| 9 | 9 | use crate::search_paths::{PathKind, SearchPath}; |
| 10 | 10 | |
| ... | ... | @@ -121,11 +121,11 @@ fn current_dll_path() -> Result<PathBuf, String> { |
| 121 | 121 | use std::io; |
| 122 | 122 | use std::os::windows::prelude::*; |
| 123 | 123 | |
| 124 | use windows::core::PCWSTR; | |
| 125 | 124 | use windows::Win32::Foundation::HMODULE; |
| 126 | 125 | use windows::Win32::System::LibraryLoader::{ |
| 127 | GetModuleFileNameW, GetModuleHandleExW, GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, | |
| 126 | GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS, GetModuleFileNameW, GetModuleHandleExW, | |
| 128 | 127 | }; |
| 128 | use windows::core::PCWSTR; | |
| 129 | 129 | |
| 130 | 130 | let mut module = HMODULE::default(); |
| 131 | 131 | unsafe { |
compiler/rustc_session/src/options.rs+1-1| ... | ... | @@ -20,7 +20,7 @@ use rustc_target::spec::{ |
| 20 | 20 | use crate::config::*; |
| 21 | 21 | use crate::search_paths::SearchPath; |
| 22 | 22 | use crate::utils::NativeLib; |
| 23 | use crate::{lint, EarlyDiagCtxt}; | |
| 23 | use crate::{EarlyDiagCtxt, lint}; | |
| 24 | 24 | |
| 25 | 25 | macro_rules! insert { |
| 26 | 26 | ($opt_name:ident, $opt_expr:expr, $sub_hashes:expr) => { |
compiler/rustc_session/src/output.rs+1-1| ... | ... | @@ -7,12 +7,12 @@ use rustc_errors::FatalError; |
| 7 | 7 | use rustc_span::symbol::sym; |
| 8 | 8 | use rustc_span::{Span, Symbol}; |
| 9 | 9 | |
| 10 | use crate::Session; | |
| 10 | 11 | use crate::config::{self, CrateType, Input, OutFileName, OutputFilenames, OutputType}; |
| 11 | 12 | use crate::errors::{ |
| 12 | 13 | self, CrateNameDoesNotMatch, CrateNameEmpty, CrateNameInvalid, FileIsNotWriteable, |
| 13 | 14 | InvalidCharacterInCrateName, InvalidCrateNameHelp, |
| 14 | 15 | }; |
| 15 | use crate::Session; | |
| 16 | 16 | |
| 17 | 17 | pub fn out_filename( |
| 18 | 18 | sess: &Session, |
compiler/rustc_session/src/parse.rs+5-5| ... | ... | @@ -7,17 +7,18 @@ use rustc_ast::attr::AttrIdGenerator; |
| 7 | 7 | use rustc_ast::node_id::NodeId; |
| 8 | 8 | use rustc_data_structures::fx::{FxHashMap, FxIndexMap, FxIndexSet}; |
| 9 | 9 | use rustc_data_structures::sync::{AppendOnlyVec, Lock, Lrc}; |
| 10 | use rustc_errors::emitter::{stderr_destination, HumanEmitter, SilentEmitter}; | |
| 10 | use rustc_errors::emitter::{HumanEmitter, SilentEmitter, stderr_destination}; | |
| 11 | 11 | use rustc_errors::{ |
| 12 | fallback_fluent_bundle, ColorConfig, Diag, DiagCtxt, DiagCtxtHandle, DiagMessage, | |
| 13 | EmissionGuarantee, MultiSpan, StashKey, | |
| 12 | ColorConfig, Diag, DiagCtxt, DiagCtxtHandle, DiagMessage, EmissionGuarantee, MultiSpan, | |
| 13 | StashKey, fallback_fluent_bundle, | |
| 14 | 14 | }; |
| 15 | use rustc_feature::{find_feature_issue, GateIssue, UnstableFeatures}; | |
| 15 | use rustc_feature::{GateIssue, UnstableFeatures, find_feature_issue}; | |
| 16 | 16 | use rustc_span::edition::Edition; |
| 17 | 17 | use rustc_span::hygiene::ExpnId; |
| 18 | 18 | use rustc_span::source_map::{FilePathMapping, SourceMap}; |
| 19 | 19 | use rustc_span::{Span, Symbol}; |
| 20 | 20 | |
| 21 | use crate::Session; | |
| 21 | 22 | use crate::config::{Cfg, CheckCfg}; |
| 22 | 23 | use crate::errors::{ |
| 23 | 24 | CliFeatureDiagnosticHelp, FeatureDiagnosticForIssue, FeatureDiagnosticHelp, |
| ... | ... | @@ -25,7 +26,6 @@ use crate::errors::{ |
| 25 | 26 | }; |
| 26 | 27 | use crate::lint::builtin::UNSTABLE_SYNTAX_PRE_EXPANSION; |
| 27 | 28 | use crate::lint::{BufferedEarlyLint, BuiltinLintDiag, Lint, LintId}; |
| 28 | use crate::Session; | |
| 29 | 29 | |
| 30 | 30 | /// Collected spans during parsing for places where a certain feature was |
| 31 | 31 | /// used and should be feature gated accordingly in `check_crate`. |
compiler/rustc_session/src/search_paths.rs+1-1| ... | ... | @@ -3,8 +3,8 @@ use std::path::{Path, PathBuf}; |
| 3 | 3 | use rustc_macros::{Decodable, Encodable, HashStable_Generic}; |
| 4 | 4 | use rustc_target::spec::TargetTriple; |
| 5 | 5 | |
| 6 | use crate::filesearch::make_target_lib_path; | |
| 7 | 6 | use crate::EarlyDiagCtxt; |
| 7 | use crate::filesearch::make_target_lib_path; | |
| 8 | 8 | |
| 9 | 9 | #[derive(Clone, Debug)] |
| 10 | 10 | pub struct SearchPath { |
compiler/rustc_session/src/session.rs+5-5| ... | ... | @@ -2,9 +2,9 @@ use std::any::Any; |
| 2 | 2 | use std::ops::{Div, Mul}; |
| 3 | 3 | use std::path::{Path, PathBuf}; |
| 4 | 4 | use std::str::FromStr; |
| 5 | use std::sync::Arc; | |
| 5 | 6 | use std::sync::atomic::AtomicBool; |
| 6 | 7 | use std::sync::atomic::Ordering::SeqCst; |
| 7 | use std::sync::Arc; | |
| 8 | 8 | use std::{env, fmt, io}; |
| 9 | 9 | |
| 10 | 10 | use rustc_data_structures::flock; |
| ... | ... | @@ -16,12 +16,12 @@ use rustc_data_structures::sync::{ |
| 16 | 16 | }; |
| 17 | 17 | use rustc_errors::annotate_snippet_emitter_writer::AnnotateSnippetEmitter; |
| 18 | 18 | use rustc_errors::codes::*; |
| 19 | use rustc_errors::emitter::{stderr_destination, DynEmitter, HumanEmitter, HumanReadableErrorType}; | |
| 19 | use rustc_errors::emitter::{DynEmitter, HumanEmitter, HumanReadableErrorType, stderr_destination}; | |
| 20 | 20 | use rustc_errors::json::JsonEmitter; |
| 21 | 21 | use rustc_errors::registry::Registry; |
| 22 | 22 | use rustc_errors::{ |
| 23 | fallback_fluent_bundle, Diag, DiagCtxt, DiagCtxtHandle, DiagMessage, Diagnostic, | |
| 24 | ErrorGuaranteed, FatalAbort, FluentBundle, LazyFallbackBundle, TerminalUrl, | |
| 23 | Diag, DiagCtxt, DiagCtxtHandle, DiagMessage, Diagnostic, ErrorGuaranteed, FatalAbort, | |
| 24 | FluentBundle, LazyFallbackBundle, TerminalUrl, fallback_fluent_bundle, | |
| 25 | 25 | }; |
| 26 | 26 | use rustc_macros::HashStable_Generic; |
| 27 | 27 | pub use rustc_span::def_id::StableCrateId; |
| ... | ... | @@ -41,7 +41,7 @@ use crate::config::{ |
| 41 | 41 | InstrumentCoverage, OptLevel, OutFileName, OutputType, RemapPathScopeComponents, |
| 42 | 42 | SwitchWithOptPath, |
| 43 | 43 | }; |
| 44 | use crate::parse::{add_feature_diagnostics, ParseSess}; | |
| 44 | use crate::parse::{ParseSess, add_feature_diagnostics}; | |
| 45 | 45 | use crate::search_paths::{PathKind, SearchPath}; |
| 46 | 46 | use crate::{errors, filesearch, lint}; |
| 47 | 47 |
compiler/rustc_session/src/version.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ use std::borrow::Cow; |
| 2 | 2 | use std::fmt::{self, Display}; |
| 3 | 3 | |
| 4 | 4 | use rustc_errors::IntoDiagArg; |
| 5 | use rustc_macros::{current_rustc_version, Decodable, Encodable, HashStable_Generic}; | |
| 5 | use rustc_macros::{Decodable, Encodable, HashStable_Generic, current_rustc_version}; | |
| 6 | 6 | |
| 7 | 7 | #[derive(Encodable, Decodable, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] |
| 8 | 8 | #[derive(HashStable_Generic)] |
compiler/rustc_smir/src/rustc_internal/mod.rs+2-2| ... | ... | @@ -13,12 +13,12 @@ use rustc_data_structures::fx::FxIndexMap; |
| 13 | 13 | use rustc_middle::mir::interpret::AllocId; |
| 14 | 14 | use rustc_middle::ty; |
| 15 | 15 | use rustc_middle::ty::TyCtxt; |
| 16 | use rustc_span::def_id::{CrateNum, DefId}; | |
| 17 | 16 | use rustc_span::Span; |
| 17 | use rustc_span::def_id::{CrateNum, DefId}; | |
| 18 | 18 | use scoped_tls::scoped_thread_local; |
| 19 | use stable_mir::Error; | |
| 19 | 20 | use stable_mir::abi::Layout; |
| 20 | 21 | use stable_mir::ty::IndexedVal; |
| 21 | use stable_mir::Error; | |
| 22 | 22 | |
| 23 | 23 | use crate::rustc_smir::context::TablesWrapper; |
| 24 | 24 | use crate::rustc_smir::{Stable, Tables}; |
compiler/rustc_smir/src/rustc_smir/alloc.rs+2-2| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | use rustc_middle::mir::interpret::{alloc_range, AllocRange, Pointer}; | |
| 2 | 1 | use rustc_middle::mir::ConstValue; |
| 2 | use rustc_middle::mir::interpret::{AllocRange, Pointer, alloc_range}; | |
| 3 | use stable_mir::Error; | |
| 3 | 4 | use stable_mir::mir::Mutability; |
| 4 | 5 | use stable_mir::ty::{Allocation, ProvenanceMap}; |
| 5 | use stable_mir::Error; | |
| 6 | 6 | |
| 7 | 7 | use crate::rustc_smir::{Stable, Tables}; |
| 8 | 8 |
compiler/rustc_smir/src/rustc_smir/context.rs+1-1| ... | ... | @@ -34,7 +34,7 @@ use stable_mir::{Crate, CrateDef, CrateItem, CrateNum, DefId, Error, Filename, I |
| 34 | 34 | |
| 35 | 35 | use crate::rustc_internal::RustcInternal; |
| 36 | 36 | use crate::rustc_smir::builder::BodyBuilder; |
| 37 | use crate::rustc_smir::{alloc, new_item_kind, smir_crate, Stable, Tables}; | |
| 37 | use crate::rustc_smir::{Stable, Tables, alloc, new_item_kind, smir_crate}; | |
| 38 | 38 | |
| 39 | 39 | impl<'tcx> Context for TablesWrapper<'tcx> { |
| 40 | 40 | fn target_info(&self) -> MachineInfo { |
compiler/rustc_smir/src/rustc_smir/convert/mir.rs+2-2| ... | ... | @@ -6,9 +6,9 @@ use rustc_middle::{bug, mir}; |
| 6 | 6 | use stable_mir::mir::alloc::GlobalAlloc; |
| 7 | 7 | use stable_mir::mir::{ConstOperand, Statement, UserTypeProjection, VarDebugInfoFragment}; |
| 8 | 8 | use stable_mir::ty::{Allocation, ConstantKind, MirConst}; |
| 9 | use stable_mir::{opaque, Error}; | |
| 9 | use stable_mir::{Error, opaque}; | |
| 10 | 10 | |
| 11 | use crate::rustc_smir::{alloc, Stable, Tables}; | |
| 11 | use crate::rustc_smir::{Stable, Tables, alloc}; | |
| 12 | 12 | |
| 13 | 13 | impl<'tcx> Stable<'tcx> for mir::Body<'tcx> { |
| 14 | 14 | type T = stable_mir::mir::Body; |
compiler/rustc_smir/src/rustc_smir/convert/ty.rs+7-5| ... | ... | @@ -6,7 +6,7 @@ use stable_mir::ty::{ |
| 6 | 6 | AdtKind, FloatTy, GenericArgs, GenericParamDef, IntTy, Region, RigidTy, TyKind, UintTy, |
| 7 | 7 | }; |
| 8 | 8 | |
| 9 | use crate::rustc_smir::{alloc, Stable, Tables}; | |
| 9 | use crate::rustc_smir::{Stable, Tables, alloc}; | |
| 10 | 10 | |
| 11 | 11 | impl<'tcx> Stable<'tcx> for ty::AliasTyKind { |
| 12 | 12 | type T = stable_mir::ty::AliasKind; |
| ... | ... | @@ -815,10 +815,12 @@ impl<'tcx> Stable<'tcx> for ty::RegionKind<'tcx> { |
| 815 | 815 | index: early_reg.index, |
| 816 | 816 | name: early_reg.name.to_string(), |
| 817 | 817 | }), |
| 818 | ty::ReBound(db_index, bound_reg) => RegionKind::ReBound( | |
| 819 | db_index.as_u32(), | |
| 820 | BoundRegion { var: bound_reg.var.as_u32(), kind: bound_reg.kind.stable(tables) }, | |
| 821 | ), | |
| 818 | ty::ReBound(db_index, bound_reg) => { | |
| 819 | RegionKind::ReBound(db_index.as_u32(), BoundRegion { | |
| 820 | var: bound_reg.var.as_u32(), | |
| 821 | kind: bound_reg.kind.stable(tables), | |
| 822 | }) | |
| 823 | } | |
| 822 | 824 | ty::ReStatic => RegionKind::ReStatic, |
| 823 | 825 | ty::RePlaceholder(place_holder) => { |
| 824 | 826 | RegionKind::RePlaceholder(stable_mir::ty::Placeholder { |
compiler/rustc_span/src/def_id.rs+1-1| ... | ... | @@ -1,12 +1,12 @@ |
| 1 | 1 | use std::fmt; |
| 2 | 2 | use std::hash::{BuildHasherDefault, Hash, Hasher}; |
| 3 | 3 | |
| 4 | use rustc_data_structures::AtomicRef; | |
| 4 | 5 | use rustc_data_structures::fingerprint::Fingerprint; |
| 5 | 6 | use rustc_data_structures::stable_hasher::{ |
| 6 | 7 | Hash64, HashStable, StableHasher, StableOrd, ToStableHashKey, |
| 7 | 8 | }; |
| 8 | 9 | use rustc_data_structures::unhash::Unhasher; |
| 9 | use rustc_data_structures::AtomicRef; | |
| 10 | 10 | use rustc_index::Idx; |
| 11 | 11 | use rustc_macros::{Decodable, Encodable, HashStable_Generic}; |
| 12 | 12 | use rustc_serialize::{Decodable, Encodable}; |
compiler/rustc_span/src/hygiene.rs+3-3| ... | ... | @@ -39,10 +39,10 @@ use rustc_macros::{Decodable, Encodable, HashStable_Generic}; |
| 39 | 39 | use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; |
| 40 | 40 | use tracing::{debug, trace}; |
| 41 | 41 | |
| 42 | use crate::def_id::{CrateNum, DefId, StableCrateId, CRATE_DEF_ID, LOCAL_CRATE}; | |
| 42 | use crate::def_id::{CRATE_DEF_ID, CrateNum, DefId, LOCAL_CRATE, StableCrateId}; | |
| 43 | 43 | use crate::edition::Edition; |
| 44 | use crate::symbol::{kw, sym, Symbol}; | |
| 45 | use crate::{with_session_globals, HashStableContext, Span, SpanDecoder, SpanEncoder, DUMMY_SP}; | |
| 44 | use crate::symbol::{Symbol, kw, sym}; | |
| 45 | use crate::{DUMMY_SP, HashStableContext, Span, SpanDecoder, SpanEncoder, with_session_globals}; | |
| 46 | 46 | |
| 47 | 47 | /// A `SyntaxContext` represents a chain of pairs `(ExpnId, Transparency)` named "marks". |
| 48 | 48 | #[derive(Clone, Copy, PartialEq, Eq, Hash)] |
compiler/rustc_span/src/lib.rs+5-5| ... | ... | @@ -39,7 +39,7 @@ |
| 39 | 39 | extern crate self as rustc_span; |
| 40 | 40 | |
| 41 | 41 | use derive_where::derive_where; |
| 42 | use rustc_data_structures::{outline, AtomicRef}; | |
| 42 | use rustc_data_structures::{AtomicRef, outline}; | |
| 43 | 43 | use rustc_macros::{Decodable, Encodable, HashStable_Generic}; |
| 44 | 44 | use rustc_serialize::opaque::{FileEncoder, MemDecoder}; |
| 45 | 45 | use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; |
| ... | ... | @@ -60,13 +60,13 @@ pub use hygiene::{ |
| 60 | 60 | }; |
| 61 | 61 | use rustc_data_structures::stable_hasher::HashingControls; |
| 62 | 62 | pub mod def_id; |
| 63 | use def_id::{CrateNum, DefId, DefIndex, DefPathHash, LocalDefId, StableCrateId, LOCAL_CRATE}; | |
| 63 | use def_id::{CrateNum, DefId, DefIndex, DefPathHash, LOCAL_CRATE, LocalDefId, StableCrateId}; | |
| 64 | 64 | pub mod edit_distance; |
| 65 | 65 | mod span_encoding; |
| 66 | pub use span_encoding::{Span, DUMMY_SP}; | |
| 66 | pub use span_encoding::{DUMMY_SP, Span}; | |
| 67 | 67 | |
| 68 | 68 | pub mod symbol; |
| 69 | pub use symbol::{sym, Symbol}; | |
| 69 | pub use symbol::{Symbol, sym}; | |
| 70 | 70 | |
| 71 | 71 | mod analyze_source_file; |
| 72 | 72 | pub mod fatal_error; |
| ... | ... | @@ -83,7 +83,7 @@ use std::{fmt, iter}; |
| 83 | 83 | |
| 84 | 84 | use md5::{Digest, Md5}; |
| 85 | 85 | use rustc_data_structures::fx::FxHashMap; |
| 86 | use rustc_data_structures::stable_hasher::{Hash128, Hash64, HashStable, StableHasher}; | |
| 86 | use rustc_data_structures::stable_hasher::{Hash64, Hash128, HashStable, StableHasher}; | |
| 87 | 87 | use rustc_data_structures::sync::{FreezeLock, FreezeWriteGuard, Lock, Lrc}; |
| 88 | 88 | use sha1::Sha1; |
| 89 | 89 | use sha2::Sha256; |
compiler/rustc_span/src/span_encoding.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ use rustc_serialize::int_overflow::DebugStrictAdd; |
| 5 | 5 | |
| 6 | 6 | use crate::def_id::{DefIndex, LocalDefId}; |
| 7 | 7 | use crate::hygiene::SyntaxContext; |
| 8 | use crate::{BytePos, SpanData, SPAN_TRACK}; | |
| 8 | use crate::{BytePos, SPAN_TRACK, SpanData}; | |
| 9 | 9 | |
| 10 | 10 | /// A compressed span. |
| 11 | 11 | /// |
compiler/rustc_span/src/symbol.rs+3-3| ... | ... | @@ -11,9 +11,9 @@ use rustc_data_structures::stable_hasher::{ |
| 11 | 11 | HashStable, StableCompare, StableHasher, ToStableHashKey, |
| 12 | 12 | }; |
| 13 | 13 | use rustc_data_structures::sync::Lock; |
| 14 | use rustc_macros::{symbols, Decodable, Encodable, HashStable_Generic}; | |
| 14 | use rustc_macros::{Decodable, Encodable, HashStable_Generic, symbols}; | |
| 15 | 15 | |
| 16 | use crate::{with_session_globals, Edition, Span, DUMMY_SP}; | |
| 16 | use crate::{DUMMY_SP, Edition, Span, with_session_globals}; | |
| 17 | 17 | |
| 18 | 18 | #[cfg(test)] |
| 19 | 19 | mod tests; |
| ... | ... | @@ -2523,10 +2523,10 @@ pub mod kw { |
| 2523 | 2523 | /// For example `sym::rustfmt` or `sym::u8`. |
| 2524 | 2524 | pub mod sym { |
| 2525 | 2525 | // Used from a macro in `librustc_feature/accepted.rs` |
| 2526 | use super::Symbol; | |
| 2526 | 2527 | pub use super::kw::MacroRules as macro_rules; |
| 2527 | 2528 | #[doc(inline)] |
| 2528 | 2529 | pub use super::sym_generated::*; |
| 2529 | use super::Symbol; | |
| 2530 | 2530 | |
| 2531 | 2531 | /// Get the symbol for an integer. |
| 2532 | 2532 | /// |
compiler/rustc_symbol_mangling/src/test.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | use rustc_hir::def_id::LocalDefId; |
| 8 | 8 | use rustc_middle::ty::print::with_no_trimmed_paths; |
| 9 | 9 | use rustc_middle::ty::{GenericArgs, Instance, TyCtxt}; |
| 10 | use rustc_span::symbol::{sym, Symbol}; | |
| 10 | use rustc_span::symbol::{Symbol, sym}; | |
| 11 | 11 | |
| 12 | 12 | use crate::errors::{Kind, TestOutput}; |
| 13 | 13 |
compiler/rustc_target/src/abi/mod.rs+2-2| ... | ... | @@ -1,11 +1,11 @@ |
| 1 | 1 | use std::fmt; |
| 2 | 2 | use std::ops::Deref; |
| 3 | 3 | |
| 4 | use rustc_data_structures::intern::Interned; | |
| 5 | use rustc_macros::HashStable_Generic; | |
| 6 | 4 | pub use Float::*; |
| 7 | 5 | pub use Integer::*; |
| 8 | 6 | pub use Primitive::*; |
| 7 | use rustc_data_structures::intern::Interned; | |
| 8 | use rustc_macros::HashStable_Generic; | |
| 9 | 9 | |
| 10 | 10 | use crate::json::{Json, ToJson}; |
| 11 | 11 |
compiler/rustc_target/src/asm/arm.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use std::fmt; |
| 2 | 2 | |
| 3 | 3 | use rustc_data_structures::fx::FxIndexSet; |
| 4 | use rustc_span::{sym, Symbol}; | |
| 4 | use rustc_span::{Symbol, sym}; | |
| 5 | 5 | |
| 6 | 6 | use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; |
| 7 | 7 | use crate::spec::{RelocModel, Target}; |
compiler/rustc_target/src/asm/riscv.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use std::fmt; |
| 2 | 2 | |
| 3 | 3 | use rustc_data_structures::fx::FxIndexSet; |
| 4 | use rustc_span::{sym, Symbol}; | |
| 4 | use rustc_span::{Symbol, sym}; | |
| 5 | 5 | |
| 6 | 6 | use super::{InlineAsmArch, InlineAsmType, ModifierInfo}; |
| 7 | 7 | use crate::spec::{RelocModel, Target}; |
compiler/rustc_target/src/json.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ use std::borrow::Cow; |
| 2 | 2 | use std::collections::BTreeMap; |
| 3 | 3 | |
| 4 | 4 | pub use serde_json::Value as Json; |
| 5 | use serde_json::{json, Map, Number}; | |
| 5 | use serde_json::{Map, Number, json}; | |
| 6 | 6 | |
| 7 | 7 | use crate::spec::TargetMetadata; |
| 8 | 8 |
compiler/rustc_target/src/spec/base/aix.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{crt_objects, cvs, Cc, CodeModel, LinkOutputKind, LinkerFlavor, TargetOptions}; | |
| 2 | use crate::spec::{Cc, CodeModel, LinkOutputKind, LinkerFlavor, TargetOptions, crt_objects, cvs}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn opts() -> TargetOptions { |
| 5 | 5 | TargetOptions { |
compiler/rustc_target/src/spec/base/android.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, SanitizerSet, TargetOptions, TlsModel}; | |
| 1 | use crate::spec::{SanitizerSet, TargetOptions, TlsModel, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | let mut base = base::linux::opts(); |
compiler/rustc_target/src/spec/base/apple/mod.rs+6-7| ... | ... | @@ -3,8 +3,8 @@ use std::env; |
| 3 | 3 | use std::num::ParseIntError; |
| 4 | 4 | |
| 5 | 5 | use crate::spec::{ |
| 6 | add_link_args, add_link_args_iter, cvs, Cc, DebuginfoKind, FramePointer, LinkArgs, | |
| 7 | LinkerFlavor, Lld, SplitDebuginfo, StackProbeType, StaticCow, Target, TargetOptions, | |
| 6 | Cc, DebuginfoKind, FramePointer, LinkArgs, LinkerFlavor, Lld, SplitDebuginfo, StackProbeType, | |
| 7 | StaticCow, Target, TargetOptions, add_link_args, add_link_args_iter, cvs, | |
| 8 | 8 | }; |
| 9 | 9 | |
| 10 | 10 | #[cfg(test)] |
| ... | ... | @@ -190,11 +190,10 @@ fn pre_link_args(os: &'static str, arch: Arch, abi: TargetAbi) -> LinkArgs { |
| 190 | 190 | // |
| 191 | 191 | // CC forwards the `-arch` to the linker, so we use the same value |
| 192 | 192 | // here intentionally. |
| 193 | add_link_args( | |
| 194 | &mut args, | |
| 195 | LinkerFlavor::Darwin(Cc::Yes, Lld::No), | |
| 196 | &["-arch", arch.ld_arch()], | |
| 197 | ); | |
| 193 | add_link_args(&mut args, LinkerFlavor::Darwin(Cc::Yes, Lld::No), &[ | |
| 194 | "-arch", | |
| 195 | arch.ld_arch(), | |
| 196 | ]); | |
| 198 | 197 | // The presence of `-mmacosx-version-min` makes CC default to macOS, |
| 199 | 198 | // and it sets the deployment target. |
| 200 | 199 | let (major, minor, patch) = deployment_target(os, arch, abi); |
compiler/rustc_target/src/spec/base/apple/tests.rs+5-8| ... | ... | @@ -33,14 +33,11 @@ fn macos_link_environment_unmodified() { |
| 33 | 33 | for target in all_macos_targets { |
| 34 | 34 | // macOS targets should only remove information for cross-compiling, but never |
| 35 | 35 | // for the host. |
| 36 | assert_eq!( | |
| 37 | target.link_env_remove, | |
| 38 | crate::spec::cvs![ | |
| 39 | "IPHONEOS_DEPLOYMENT_TARGET", | |
| 40 | "TVOS_DEPLOYMENT_TARGET", | |
| 41 | "XROS_DEPLOYMENT_TARGET" | |
| 42 | ], | |
| 43 | ); | |
| 36 | assert_eq!(target.link_env_remove, crate::spec::cvs![ | |
| 37 | "IPHONEOS_DEPLOYMENT_TARGET", | |
| 38 | "TVOS_DEPLOYMENT_TARGET", | |
| 39 | "XROS_DEPLOYMENT_TARGET" | |
| 40 | ],); | |
| 44 | 41 | } |
| 45 | 42 | } |
| 46 | 43 |
compiler/rustc_target/src/spec/base/avr_gnu.rs+3-4| ... | ... | @@ -26,10 +26,9 @@ pub(crate) fn target(target_cpu: &'static str, mmcu: &'static str) -> Target { |
| 26 | 26 | linker: Some("avr-gcc".into()), |
| 27 | 27 | eh_frame_header: false, |
| 28 | 28 | pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[mmcu]), |
| 29 | late_link_args: TargetOptions::link_args( | |
| 30 | LinkerFlavor::Gnu(Cc::Yes, Lld::No), | |
| 31 | &["-lgcc"], | |
| 32 | ), | |
| 29 | late_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ | |
| 30 | "-lgcc", | |
| 31 | ]), | |
| 33 | 32 | max_atomic_width: Some(16), |
| 34 | 33 | atomic_cas: false, |
| 35 | 34 | relocation_model: RelocModel::Static, |
compiler/rustc_target/src/spec/base/dragonfly.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, RelroLevel, TargetOptions}; | |
| 1 | use crate::spec::{RelroLevel, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | TargetOptions { |
compiler/rustc_target/src/spec/base/freebsd.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, RelroLevel, TargetOptions}; | |
| 1 | use crate::spec::{RelroLevel, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | TargetOptions { |
compiler/rustc_target/src/spec/base/fuchsia.rs+14-17| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::spec::{ |
| 2 | crt_objects, cvs, Cc, FramePointer, LinkOutputKind, LinkerFlavor, Lld, TargetOptions, | |
| 2 | Cc, FramePointer, LinkOutputKind, LinkerFlavor, Lld, TargetOptions, crt_objects, cvs, | |
| 3 | 3 | }; |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn opts() -> TargetOptions { |
| ... | ... | @@ -8,22 +8,19 @@ pub(crate) fn opts() -> TargetOptions { |
| 8 | 8 | // so we only list them for ld/lld. |
| 9 | 9 | // |
| 10 | 10 | // https://github.com/llvm/llvm-project/blob/db9322b2066c55254e7691efeab863f43bfcc084/clang/lib/Driver/ToolChains/Fuchsia.cpp#L31 |
| 11 | let pre_link_args = TargetOptions::link_args( | |
| 12 | LinkerFlavor::Gnu(Cc::No, Lld::No), | |
| 13 | &[ | |
| 14 | "--build-id", | |
| 15 | "--hash-style=gnu", | |
| 16 | "-z", | |
| 17 | "max-page-size=4096", | |
| 18 | "-z", | |
| 19 | "now", | |
| 20 | "-z", | |
| 21 | "rodynamic", | |
| 22 | "-z", | |
| 23 | "separate-loadable-segments", | |
| 24 | "--pack-dyn-relocs=relr", | |
| 25 | ], | |
| 26 | ); | |
| 11 | let pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ | |
| 12 | "--build-id", | |
| 13 | "--hash-style=gnu", | |
| 14 | "-z", | |
| 15 | "max-page-size=4096", | |
| 16 | "-z", | |
| 17 | "now", | |
| 18 | "-z", | |
| 19 | "rodynamic", | |
| 20 | "-z", | |
| 21 | "separate-loadable-segments", | |
| 22 | "--pack-dyn-relocs=relr", | |
| 23 | ]); | |
| 27 | 24 | |
| 28 | 25 | TargetOptions { |
| 29 | 26 | os: "fuchsia".into(), |
compiler/rustc_target/src/spec/base/haiku.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, RelroLevel, TargetOptions}; | |
| 1 | use crate::spec::{RelroLevel, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | TargetOptions { |
compiler/rustc_target/src/spec/base/hurd.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, RelroLevel, TargetOptions}; | |
| 1 | use crate::spec::{RelroLevel, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | TargetOptions { |
compiler/rustc_target/src/spec/base/hurd_gnu.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, TargetOptions}; | |
| 1 | use crate::spec::{TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | TargetOptions { env: "gnu".into(), ..base::hurd::opts() } |
compiler/rustc_target/src/spec/base/illumos.rs+20-23| ... | ... | @@ -1,28 +1,25 @@ |
| 1 | use crate::spec::{cvs, Cc, FramePointer, LinkerFlavor, TargetOptions}; | |
| 1 | use crate::spec::{Cc, FramePointer, LinkerFlavor, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | let late_link_args = TargetOptions::link_args( | |
| 5 | LinkerFlavor::Unix(Cc::Yes), | |
| 6 | &[ | |
| 7 | // The illumos libc contains a stack unwinding implementation, as | |
| 8 | // does libgcc_s. The latter implementation includes several | |
| 9 | // additional symbols that are not always in base libc. To force | |
| 10 | // the consistent use of just one unwinder, we ensure libc appears | |
| 11 | // after libgcc_s in the NEEDED list for the resultant binary by | |
| 12 | // ignoring any attempts to add it as a dynamic dependency until the | |
| 13 | // very end. | |
| 14 | // FIXME: This should be replaced by a more complete and generic | |
| 15 | // mechanism for controlling the order of library arguments passed | |
| 16 | // to the linker. | |
| 17 | "-lc", | |
| 18 | // LLVM will insert calls to the stack protector functions | |
| 19 | // "__stack_chk_fail" and "__stack_chk_guard" into code in native | |
| 20 | // object files. Some platforms include these symbols directly in | |
| 21 | // libc, but at least historically these have been provided in | |
| 22 | // libssp.so on illumos and Solaris systems. | |
| 23 | "-lssp", | |
| 24 | ], | |
| 25 | ); | |
| 4 | let late_link_args = TargetOptions::link_args(LinkerFlavor::Unix(Cc::Yes), &[ | |
| 5 | // The illumos libc contains a stack unwinding implementation, as | |
| 6 | // does libgcc_s. The latter implementation includes several | |
| 7 | // additional symbols that are not always in base libc. To force | |
| 8 | // the consistent use of just one unwinder, we ensure libc appears | |
| 9 | // after libgcc_s in the NEEDED list for the resultant binary by | |
| 10 | // ignoring any attempts to add it as a dynamic dependency until the | |
| 11 | // very end. | |
| 12 | // FIXME: This should be replaced by a more complete and generic | |
| 13 | // mechanism for controlling the order of library arguments passed | |
| 14 | // to the linker. | |
| 15 | "-lc", | |
| 16 | // LLVM will insert calls to the stack protector functions | |
| 17 | // "__stack_chk_fail" and "__stack_chk_guard" into code in native | |
| 18 | // object files. Some platforms include these symbols directly in | |
| 19 | // libc, but at least historically these have been provided in | |
| 20 | // libssp.so on illumos and Solaris systems. | |
| 21 | "-lssp", | |
| 22 | ]); | |
| 26 | 23 | |
| 27 | 24 | TargetOptions { |
| 28 | 25 | os: "illumos".into(), |
compiler/rustc_target/src/spec/base/l4re.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, Cc, LinkerFlavor, PanicStrategy, RelocModel, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, PanicStrategy, RelocModel, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | TargetOptions { |
compiler/rustc_target/src/spec/base/linux.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use std::borrow::Cow; |
| 2 | 2 | |
| 3 | use crate::spec::{cvs, RelroLevel, SplitDebuginfo, TargetOptions}; | |
| 3 | use crate::spec::{RelroLevel, SplitDebuginfo, TargetOptions, cvs}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn opts() -> TargetOptions { |
| 6 | 6 | TargetOptions { |
compiler/rustc_target/src/spec/base/linux_gnu.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, TargetOptions}; | |
| 1 | use crate::spec::{TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | TargetOptions { env: "gnu".into(), ..base::linux::opts() } |
compiler/rustc_target/src/spec/base/linux_musl.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, crt_objects, LinkSelfContainedDefault, TargetOptions}; | |
| 1 | use crate::spec::{LinkSelfContainedDefault, TargetOptions, base, crt_objects}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | let mut base = base::linux::opts(); |
compiler/rustc_target/src/spec/base/linux_ohos.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, TargetOptions, TlsModel}; | |
| 1 | use crate::spec::{TargetOptions, TlsModel, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | let mut base = base::linux::opts(); |
compiler/rustc_target/src/spec/base/linux_uclibc.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, TargetOptions}; | |
| 1 | use crate::spec::{TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | TargetOptions { env: "uclibc".into(), ..base::linux::opts() } |
compiler/rustc_target/src/spec/base/netbsd.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, RelroLevel, TargetOptions}; | |
| 1 | use crate::spec::{RelroLevel, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | TargetOptions { |
compiler/rustc_target/src/spec/base/nto_qnx.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, RelroLevel, TargetOptions}; | |
| 1 | use crate::spec::{RelroLevel, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | TargetOptions { |
compiler/rustc_target/src/spec/base/openbsd.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, FramePointer, RelroLevel, TargetOptions, TlsModel}; | |
| 1 | use crate::spec::{FramePointer, RelroLevel, TargetOptions, TlsModel, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | TargetOptions { |
compiler/rustc_target/src/spec/base/redox.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, Cc, LinkerFlavor, Lld, RelroLevel, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, RelroLevel, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | TargetOptions { |
compiler/rustc_target/src/spec/base/solaris.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, Cc, LinkerFlavor, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | TargetOptions { |
compiler/rustc_target/src/spec/base/teeos.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{add_link_args, Cc, LinkerFlavor, Lld, PanicStrategy, RelroLevel, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelroLevel, TargetOptions, add_link_args}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | let lld_args = &["-zmax-page-size=4096", "-znow", "-ztext", "--execute-only"]; |
compiler/rustc_target/src/spec/base/uefi_msvc.rs+17-20| ... | ... | @@ -9,30 +9,27 @@ |
| 9 | 9 | // the timer-interrupt. Device-drivers are required to use polling-based models. Furthermore, all |
| 10 | 10 | // code runs in the same environment, no process separation is supported. |
| 11 | 11 | |
| 12 | use crate::spec::{base, LinkerFlavor, Lld, PanicStrategy, StackProbeType, TargetOptions}; | |
| 12 | use crate::spec::{LinkerFlavor, Lld, PanicStrategy, StackProbeType, TargetOptions, base}; | |
| 13 | 13 | |
| 14 | 14 | pub(crate) fn opts() -> TargetOptions { |
| 15 | 15 | let mut base = base::msvc::opts(); |
| 16 | 16 | |
| 17 | base.add_pre_link_args( | |
| 18 | LinkerFlavor::Msvc(Lld::No), | |
| 19 | &[ | |
| 20 | // Non-standard subsystems have no default entry-point in PE+ files. We have to define | |
| 21 | // one. "efi_main" seems to be a common choice amongst other implementations and the | |
| 22 | // spec. | |
| 23 | "/entry:efi_main", | |
| 24 | // COFF images have a "Subsystem" field in their header, which defines what kind of | |
| 25 | // program it is. UEFI has 3 fields reserved, which are EFI_APPLICATION, | |
| 26 | // EFI_BOOT_SERVICE_DRIVER, and EFI_RUNTIME_DRIVER. We default to EFI_APPLICATION, | |
| 27 | // which is very likely the most common option. Individual projects can override this | |
| 28 | // with custom linker flags. | |
| 29 | // The subsystem-type only has minor effects on the application. It defines the memory | |
| 30 | // regions the application is loaded into (runtime-drivers need to be put into | |
| 31 | // reserved areas), as well as whether a return from the entry-point is treated as | |
| 32 | // exit (default for applications). | |
| 33 | "/subsystem:efi_application", | |
| 34 | ], | |
| 35 | ); | |
| 17 | base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &[ | |
| 18 | // Non-standard subsystems have no default entry-point in PE+ files. We have to define | |
| 19 | // one. "efi_main" seems to be a common choice amongst other implementations and the | |
| 20 | // spec. | |
| 21 | "/entry:efi_main", | |
| 22 | // COFF images have a "Subsystem" field in their header, which defines what kind of | |
| 23 | // program it is. UEFI has 3 fields reserved, which are EFI_APPLICATION, | |
| 24 | // EFI_BOOT_SERVICE_DRIVER, and EFI_RUNTIME_DRIVER. We default to EFI_APPLICATION, | |
| 25 | // which is very likely the most common option. Individual projects can override this | |
| 26 | // with custom linker flags. | |
| 27 | // The subsystem-type only has minor effects on the application. It defines the memory | |
| 28 | // regions the application is loaded into (runtime-drivers need to be put into | |
| 29 | // reserved areas), as well as whether a return from the entry-point is treated as | |
| 30 | // exit (default for applications). | |
| 31 | "/subsystem:efi_application", | |
| 32 | ]); | |
| 36 | 33 | |
| 37 | 34 | TargetOptions { |
| 38 | 35 | os: "uefi".into(), |
compiler/rustc_target/src/spec/base/unikraft_linux_musl.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, PanicStrategy, RelocModel, TargetOptions}; | |
| 1 | use crate::spec::{PanicStrategy, RelocModel, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | TargetOptions { |
compiler/rustc_target/src/spec/base/vxworks.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, TargetOptions}; | |
| 1 | use crate::spec::{TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | TargetOptions { |
compiler/rustc_target/src/spec/base/wasm.rs+2-2| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use crate::spec::{ |
| 2 | add_link_args, cvs, Cc, LinkSelfContainedDefault, LinkerFlavor, PanicStrategy, RelocModel, | |
| 3 | TargetOptions, TlsModel, | |
| 2 | Cc, LinkSelfContainedDefault, LinkerFlavor, PanicStrategy, RelocModel, TargetOptions, TlsModel, | |
| 3 | add_link_args, cvs, | |
| 4 | 4 | }; |
| 5 | 5 | |
| 6 | 6 | pub(crate) fn options() -> TargetOptions { |
compiler/rustc_target/src/spec/base/windows_gnu.rs+15-22| ... | ... | @@ -1,31 +1,24 @@ |
| 1 | 1 | use std::borrow::Cow; |
| 2 | 2 | |
| 3 | 3 | use crate::spec::{ |
| 4 | add_link_args, crt_objects, cvs, Cc, DebuginfoKind, LinkSelfContainedDefault, LinkerFlavor, | |
| 5 | Lld, SplitDebuginfo, TargetOptions, | |
| 4 | Cc, DebuginfoKind, LinkSelfContainedDefault, LinkerFlavor, Lld, SplitDebuginfo, TargetOptions, | |
| 5 | add_link_args, crt_objects, cvs, | |
| 6 | 6 | }; |
| 7 | 7 | |
| 8 | 8 | pub(crate) fn opts() -> TargetOptions { |
| 9 | let mut pre_link_args = TargetOptions::link_args( | |
| 10 | LinkerFlavor::Gnu(Cc::No, Lld::No), | |
| 11 | &[ | |
| 12 | // Enable ASLR | |
| 13 | "--dynamicbase", | |
| 14 | // ASLR will rebase it anyway so leaving that option enabled only leads to confusion | |
| 15 | "--disable-auto-image-base", | |
| 16 | ], | |
| 17 | ); | |
| 18 | add_link_args( | |
| 19 | &mut pre_link_args, | |
| 20 | LinkerFlavor::Gnu(Cc::Yes, Lld::No), | |
| 21 | &[ | |
| 22 | // Tell GCC to avoid linker plugins, because we are not bundling | |
| 23 | // them with Windows installer, and Rust does its own LTO anyways. | |
| 24 | "-fno-use-linker-plugin", | |
| 25 | "-Wl,--dynamicbase", | |
| 26 | "-Wl,--disable-auto-image-base", | |
| 27 | ], | |
| 28 | ); | |
| 9 | let mut pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ | |
| 10 | // Enable ASLR | |
| 11 | "--dynamicbase", | |
| 12 | // ASLR will rebase it anyway so leaving that option enabled only leads to confusion | |
| 13 | "--disable-auto-image-base", | |
| 14 | ]); | |
| 15 | add_link_args(&mut pre_link_args, LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ | |
| 16 | // Tell GCC to avoid linker plugins, because we are not bundling | |
| 17 | // them with Windows installer, and Rust does its own LTO anyways. | |
| 18 | "-fno-use-linker-plugin", | |
| 19 | "-Wl,--dynamicbase", | |
| 20 | "-Wl,--disable-auto-image-base", | |
| 21 | ]); | |
| 29 | 22 | |
| 30 | 23 | // Order of `late_link_args*` was found through trial and error to work with various |
| 31 | 24 | // mingw-w64 versions (not tested on the CI). It's expected to change from time to time. |
compiler/rustc_target/src/spec/base/windows_gnullvm.rs+12-9| ... | ... | @@ -1,21 +1,24 @@ |
| 1 | 1 | use std::borrow::Cow; |
| 2 | 2 | |
| 3 | use crate::spec::{cvs, Cc, DebuginfoKind, LinkerFlavor, Lld, SplitDebuginfo, TargetOptions}; | |
| 3 | use crate::spec::{Cc, DebuginfoKind, LinkerFlavor, Lld, SplitDebuginfo, TargetOptions, cvs}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn opts() -> TargetOptions { |
| 6 | 6 | // We cannot use `-nodefaultlibs` because compiler-rt has to be passed |
| 7 | 7 | // as a path since it's not added to linker search path by the default. |
| 8 | 8 | // There were attempts to make it behave like libgcc (so one can just use -l<name>) |
| 9 | 9 | // but LLVM maintainers rejected it: https://reviews.llvm.org/D51440 |
| 10 | let pre_link_args = TargetOptions::link_args( | |
| 11 | LinkerFlavor::Gnu(Cc::Yes, Lld::No), | |
| 12 | &["-nolibc", "--unwindlib=none"], | |
| 13 | ); | |
| 10 | let pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ | |
| 11 | "-nolibc", | |
| 12 | "--unwindlib=none", | |
| 13 | ]); | |
| 14 | 14 | // Order of `late_link_args*` does not matter with LLD. |
| 15 | let late_link_args = TargetOptions::link_args( | |
| 16 | LinkerFlavor::Gnu(Cc::Yes, Lld::No), | |
| 17 | &["-lmingw32", "-lmingwex", "-lmsvcrt", "-lkernel32", "-luser32"], | |
| 18 | ); | |
| 15 | let late_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ | |
| 16 | "-lmingw32", | |
| 17 | "-lmingwex", | |
| 18 | "-lmsvcrt", | |
| 19 | "-lkernel32", | |
| 20 | "-luser32", | |
| 21 | ]); | |
| 19 | 22 | |
| 20 | 23 | TargetOptions { |
| 21 | 24 | os: "windows".into(), |
compiler/rustc_target/src/spec/base/windows_msvc.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, cvs, TargetOptions}; | |
| 1 | use crate::spec::{TargetOptions, base, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | let base = base::msvc::opts(); |
compiler/rustc_target/src/spec/base/windows_uwp_gnu.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{add_link_args, base, Cc, LinkArgs, LinkerFlavor, Lld, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkArgs, LinkerFlavor, Lld, TargetOptions, add_link_args, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | let base = base::windows_gnu::opts(); |
compiler/rustc_target/src/spec/base/windows_uwp_msvc.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, LinkerFlavor, Lld, TargetOptions}; | |
| 1 | use crate::spec::{LinkerFlavor, Lld, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn opts() -> TargetOptions { |
| 4 | 4 | let mut opts = base::windows_msvc::opts(); |
compiler/rustc_target/src/spec/mod.rs+5-5| ... | ... | @@ -45,7 +45,7 @@ use std::{fmt, io}; |
| 45 | 45 | use rustc_fs_util::try_canonicalize; |
| 46 | 46 | use rustc_macros::{Decodable, Encodable, HashStable_Generic}; |
| 47 | 47 | use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; |
| 48 | use rustc_span::symbol::{kw, sym, Symbol}; | |
| 48 | use rustc_span::symbol::{Symbol, kw, sym}; | |
| 49 | 49 | use serde_json::Value; |
| 50 | 50 | use tracing::debug; |
| 51 | 51 | |
| ... | ... | @@ -3389,10 +3389,10 @@ impl Target { |
| 3389 | 3389 | |
| 3390 | 3390 | // Each field should have been read using `Json::remove` so any keys remaining are unused. |
| 3391 | 3391 | let remaining_keys = obj.keys(); |
| 3392 | Ok(( | |
| 3393 | base, | |
| 3394 | TargetWarnings { unused_fields: remaining_keys.cloned().collect(), incorrect_type }, | |
| 3395 | )) | |
| 3392 | Ok((base, TargetWarnings { | |
| 3393 | unused_fields: remaining_keys.cloned().collect(), | |
| 3394 | incorrect_type, | |
| 3395 | })) | |
| 3396 | 3396 | } |
| 3397 | 3397 | |
| 3398 | 3398 | /// Load a built-in target |
compiler/rustc_target/src/spec/targets/aarch64_apple_darwin.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/aarch64_apple_ios.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/aarch64_apple_ios_macabi.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/aarch64_apple_ios_sim.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/aarch64_apple_tvos.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{FramePointer, Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/aarch64_apple_tvos_sim.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{FramePointer, Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/aarch64_apple_visionos.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/aarch64_apple_visionos_sim.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/aarch64_apple_watchos.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/aarch64_apple_watchos_sim.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{FramePointer, Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/aarch64_be_unknown_linux_gnu.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, StackProbeType, Target, TargetOptions}; | |
| 2 | use crate::spec::{StackProbeType, Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | Target { |
compiler/rustc_target/src/spec/targets/aarch64_be_unknown_linux_gnu_ilp32.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, StackProbeType, Target, TargetOptions}; | |
| 2 | use crate::spec::{StackProbeType, Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::linux_gnu::opts(); |
compiler/rustc_target/src/spec/targets/aarch64_be_unknown_netbsd.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, StackProbeType, Target, TargetOptions}; | |
| 2 | use crate::spec::{StackProbeType, Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | Target { |
compiler/rustc_target/src/spec/targets/aarch64_kmc_solid_asp3.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, RelocModel, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{RelocModel, StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let base = base::solid::opts("asp3"); |
compiler/rustc_target/src/spec/targets/aarch64_linux_android.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, SanitizerSet, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{SanitizerSet, StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | // See https://developer.android.com/ndk/guides/abis.html#arm64-v8a |
| 4 | 4 | // for target ABI requirements. |
compiler/rustc_target/src/spec/targets/aarch64_pc_windows_gnullvm.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target}; | |
| 1 | use crate::spec::{Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::windows_gnullvm::opts(); |
compiler/rustc_target/src/spec/targets/aarch64_pc_windows_msvc.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target}; | |
| 1 | use crate::spec::{Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::windows_msvc::opts(); |
compiler/rustc_target/src/spec/targets/aarch64_unknown_freebsd.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, SanitizerSet, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{SanitizerSet, StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/aarch64_unknown_fuchsia.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, SanitizerSet, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{SanitizerSet, StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/aarch64_unknown_hermit.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/aarch64_unknown_illumos.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, SanitizerSet, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, SanitizerSet, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::illumos::opts(); |
compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_gnu.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, SanitizerSet, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{SanitizerSet, StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_gnu_ilp32.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_musl.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, SanitizerSet, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{SanitizerSet, StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::linux_musl::opts(); |
compiler/rustc_target/src/spec/targets/aarch64_unknown_linux_ohos.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, SanitizerSet, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{SanitizerSet, StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::linux_ohos::opts(); |
compiler/rustc_target/src/spec/targets/aarch64_unknown_netbsd.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/aarch64_unknown_none.rs+3-4| ... | ... | @@ -16,10 +16,9 @@ pub(crate) fn target() -> Target { |
| 16 | 16 | linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), |
| 17 | 17 | linker: Some("rust-lld".into()), |
| 18 | 18 | // Enable the Cortex-A53 errata 843419 mitigation by default |
| 19 | pre_link_args: TargetOptions::link_args( | |
| 20 | LinkerFlavor::Gnu(Cc::No, Lld::No), | |
| 21 | &["--fix-cortex-a53-843419"], | |
| 22 | ), | |
| 19 | pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ | |
| 20 | "--fix-cortex-a53-843419", | |
| 21 | ]), | |
| 23 | 22 | features: "+v8a,+strict-align,+neon,+fp-armv8".into(), |
| 24 | 23 | supported_sanitizers: SanitizerSet::KCFI | SanitizerSet::KERNELADDRESS, |
| 25 | 24 | relocation_model: RelocModel::Static, |
compiler/rustc_target/src/spec/targets/aarch64_unknown_nto_qnx700.rs+4-5| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | // In QNX, libc does not provide a compatible ABI between versions. |
| ... | ... | @@ -27,10 +27,9 @@ pub(crate) fn target() -> Target { |
| 27 | 27 | options: TargetOptions { |
| 28 | 28 | features: "+v8a".into(), |
| 29 | 29 | max_atomic_width: Some(128), |
| 30 | pre_link_args: TargetOptions::link_args( | |
| 31 | LinkerFlavor::Gnu(Cc::Yes, Lld::No), | |
| 32 | &["-Vgcc_ntoaarch64le_cxx"], | |
| 33 | ), | |
| 30 | pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ | |
| 31 | "-Vgcc_ntoaarch64le_cxx", | |
| 32 | ]), | |
| 34 | 33 | env: "nto70".into(), |
| 35 | 34 | ..base::nto_qnx::opts() |
| 36 | 35 | }, |
compiler/rustc_target/src/spec/targets/aarch64_unknown_openbsd.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/aarch64_unknown_redox.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, StackProbeType, Target}; | |
| 1 | use crate::spec::{StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::redox::opts(); |
compiler/rustc_target/src/spec/targets/aarch64_unknown_teeos.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, StackProbeType, Target}; | |
| 1 | use crate::spec::{StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::teeos::opts(); |
compiler/rustc_target/src/spec/targets/aarch64_unknown_uefi.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // This defines the aarch64 target for UEFI systems as described in the UEFI specification. See the |
| 2 | 2 | // uefi-base module for generic UEFI options. |
| 3 | 3 | |
| 4 | use crate::spec::{base, LinkerFlavor, Lld, Target}; | |
| 4 | use crate::spec::{LinkerFlavor, Lld, Target, base}; | |
| 5 | 5 | |
| 6 | 6 | pub(crate) fn target() -> Target { |
| 7 | 7 | let mut base = base::uefi_msvc::opts(); |
compiler/rustc_target/src/spec/targets/aarch64_uwp_windows_msvc.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target}; | |
| 1 | use crate::spec::{Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::windows_uwp_msvc::opts(); |
compiler/rustc_target/src/spec/targets/aarch64_wrs_vxworks.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/arm64_32_apple_watchos.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/arm64e_apple_darwin.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/arm64e_apple_ios.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/arm64e_apple_tvos.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{FramePointer, Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/arm64ec_pc_windows_msvc.rs+5-6| ... | ... | @@ -1,14 +1,13 @@ |
| 1 | use crate::spec::{add_link_args, base, LinkerFlavor, Lld, Target}; | |
| 1 | use crate::spec::{LinkerFlavor, Lld, Target, add_link_args, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::windows_msvc::opts(); |
| 5 | 5 | base.max_atomic_width = Some(128); |
| 6 | 6 | base.features = "+v8a,+neon,+fp-armv8".into(); |
| 7 | add_link_args( | |
| 8 | &mut base.late_link_args, | |
| 9 | LinkerFlavor::Msvc(Lld::No), | |
| 10 | &["/machine:arm64ec", "softintrin.lib"], | |
| 11 | ); | |
| 7 | add_link_args(&mut base.late_link_args, LinkerFlavor::Msvc(Lld::No), &[ | |
| 8 | "/machine:arm64ec", | |
| 9 | "softintrin.lib", | |
| 10 | ]); | |
| 12 | 11 | |
| 13 | 12 | Target { |
| 14 | 13 | llvm_target: "arm64ec-pc-windows-msvc".into(), |
compiler/rustc_target/src/spec/targets/arm_linux_androideabi.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, SanitizerSet, Target, TargetOptions}; | |
| 1 | use crate::spec::{SanitizerSet, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/arm_unknown_linux_gnueabi.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/arm_unknown_linux_gnueabihf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabi.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/arm_unknown_linux_musleabihf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/armeb_unknown_linux_gnueabi.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Target, TargetOptions}; | |
| 2 | use crate::spec::{Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | Target { |
compiler/rustc_target/src/spec/targets/armv4t_none_eabi.rs+1-1| ... | ... | @@ -9,7 +9,7 @@ |
| 9 | 9 | //! The default link script is very likely wrong, so you should use |
| 10 | 10 | //! `-Clink-arg=-Tmy_script.ld` to override that with a correct linker script. |
| 11 | 11 | |
| 12 | use crate::spec::{cvs, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions}; | |
| 12 | use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions, cvs}; | |
| 13 | 13 | |
| 14 | 14 | pub(crate) fn target() -> Target { |
| 15 | 15 | Target { |
compiler/rustc_target/src/spec/targets/armv4t_unknown_linux_gnueabi.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/armv5te_none_eabi.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | //! Targets the ARMv5TE, with code as `a32` code by default. |
| 2 | 2 | |
| 3 | use crate::spec::{base, cvs, FramePointer, Target, TargetOptions}; | |
| 3 | use crate::spec::{FramePointer, Target, TargetOptions, base, cvs}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
| 6 | 6 | Target { |
compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_gnueabi.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_musleabi.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/armv5te_unknown_linux_uclibceabi.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/armv6_unknown_freebsd.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/armv6_unknown_netbsd_eabihf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/armv6k_nintendo_3ds.rs+7-5| ... | ... | @@ -1,14 +1,16 @@ |
| 1 | use crate::spec::{cvs, Cc, LinkerFlavor, Lld, RelocModel, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, RelocModel, Target, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | /// A base target for Nintendo 3DS devices using the devkitARM toolchain. |
| 4 | 4 | /// |
| 5 | 5 | /// Requires the devkitARM toolchain for 3DS targets on the host system. |
| 6 | 6 | |
| 7 | 7 | pub(crate) fn target() -> Target { |
| 8 | let pre_link_args = TargetOptions::link_args( | |
| 9 | LinkerFlavor::Gnu(Cc::Yes, Lld::No), | |
| 10 | &["-specs=3dsx.specs", "-mtune=mpcore", "-mfloat-abi=hard", "-mtp=soft"], | |
| 11 | ); | |
| 8 | let pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ | |
| 9 | "-specs=3dsx.specs", | |
| 10 | "-mtune=mpcore", | |
| 11 | "-mfloat-abi=hard", | |
| 12 | "-mtp=soft", | |
| 13 | ]); | |
| 12 | 14 | |
| 13 | 15 | Target { |
| 14 | 16 | llvm_target: "armv6k-none-eabihf".into(), |
compiler/rustc_target/src/spec/targets/armv7_linux_androideabi.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, SanitizerSet, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, SanitizerSet, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | // This target if is for the baseline of the Android v7a ABI |
| 4 | 4 | // in thumb mode. It's named armv7-* instead of thumbv7-* |
compiler/rustc_target/src/spec/targets/armv7_rtems_eabihf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/armv7_sony_vita_newlibeabihf.rs+5-5| ... | ... | @@ -1,15 +1,15 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{cvs, Cc, LinkerFlavor, Lld, RelocModel, Target, TargetOptions}; | |
| 2 | use crate::spec::{Cc, LinkerFlavor, Lld, RelocModel, Target, TargetOptions, cvs}; | |
| 3 | 3 | |
| 4 | 4 | /// A base target for PlayStation Vita devices using the VITASDK toolchain (using newlib). |
| 5 | 5 | /// |
| 6 | 6 | /// Requires the VITASDK toolchain on the host system. |
| 7 | 7 | |
| 8 | 8 | pub(crate) fn target() -> Target { |
| 9 | let pre_link_args = TargetOptions::link_args( | |
| 10 | LinkerFlavor::Gnu(Cc::Yes, Lld::No), | |
| 11 | &["-Wl,-q", "-Wl,--pic-veneer"], | |
| 12 | ); | |
| 9 | let pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ | |
| 10 | "-Wl,-q", | |
| 11 | "-Wl,--pic-veneer", | |
| 12 | ]); | |
| 13 | 13 | |
| 14 | 14 | Target { |
| 15 | 15 | llvm_target: "thumbv7a-vita-eabihf".into(), |
compiler/rustc_target/src/spec/targets/armv7_unknown_freebsd.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/armv7_unknown_linux_gnueabi.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | // This target is for glibc Linux on ARMv7 without thumb-mode, NEON or |
| 4 | 4 | // hardfloat. |
compiler/rustc_target/src/spec/targets/armv7_unknown_linux_gnueabihf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | // This target is for glibc Linux on ARMv7 without NEON or |
| 4 | 4 | // thumb-mode. See the thumbv7neon variant for enabling both. |
compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabi.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | // This target is for musl Linux on ARMv7 without thumb-mode, NEON or |
| 4 | 4 | // hardfloat. |
compiler/rustc_target/src/spec/targets/armv7_unknown_linux_musleabihf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | // This target is for musl Linux on ARMv7 without thumb-mode or NEON. |
| 4 | 4 |
compiler/rustc_target/src/spec/targets/armv7_unknown_linux_ohos.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | // This target is for OpenHarmony on ARMv7 Linux with thumb-mode, but no NEON or |
| 4 | 4 | // hardfloat. |
compiler/rustc_target/src/spec/targets/armv7_unknown_linux_uclibceabi.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | // This target is for uclibc Linux on ARMv7 without NEON, |
| 4 | 4 | // thumb-mode or hardfloat. |
compiler/rustc_target/src/spec/targets/armv7_unknown_linux_uclibceabihf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | // This target is for uclibc Linux on ARMv7 without NEON or |
| 4 | 4 | // thumb-mode. See the thumbv7neon variant for enabling both. |
compiler/rustc_target/src/spec/targets/armv7_unknown_netbsd_eabihf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/armv7_wrs_vxworks_eabihf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/armv7a_kmc_solid_asp3_eabi.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, RelocModel, Target, TargetOptions}; | |
| 1 | use crate::spec::{RelocModel, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let base = base::solid::opts("asp3"); |
compiler/rustc_target/src/spec/targets/armv7a_kmc_solid_asp3_eabihf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, RelocModel, Target, TargetOptions}; | |
| 1 | use crate::spec::{RelocModel, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let base = base::solid::opts("asp3"); |
compiler/rustc_target/src/spec/targets/armv7k_apple_watchos.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/armv7s_apple_ios.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/avr_unknown_gnu_atmega328.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target}; | |
| 1 | use crate::spec::{Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | base::avr_gnu::target("atmega328", "-mmcu=atmega328") |
compiler/rustc_target/src/spec/targets/bpfeb_unknown_none.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Target}; | |
| 2 | use crate::spec::{Target, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | Target { |
compiler/rustc_target/src/spec/targets/bpfel_unknown_none.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Target}; | |
| 2 | use crate::spec::{Target, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | Target { |
compiler/rustc_target/src/spec/targets/csky_unknown_linux_gnuabiv2.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | // This target is for glibc Linux on Csky |
| 4 | 4 |
compiler/rustc_target/src/spec/targets/csky_unknown_linux_gnuabiv2hf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | // This target is for glibc Linux on Csky |
| 4 | 4 |
compiler/rustc_target/src/spec/targets/hexagon_unknown_linux_musl.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::linux_musl::opts(); |
compiler/rustc_target/src/spec/targets/i386_apple_ios.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/i586_pc_nto_qnx700.rs+4-5| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
| ... | ... | @@ -17,10 +17,9 @@ pub(crate) fn target() -> Target { |
| 17 | 17 | options: TargetOptions { |
| 18 | 18 | cpu: "pentium4".into(), |
| 19 | 19 | max_atomic_width: Some(64), |
| 20 | pre_link_args: TargetOptions::link_args( | |
| 21 | LinkerFlavor::Gnu(Cc::Yes, Lld::No), | |
| 22 | &["-Vgcc_ntox86_cxx"], | |
| 23 | ), | |
| 20 | pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ | |
| 21 | "-Vgcc_ntox86_cxx", | |
| 22 | ]), | |
| 24 | 23 | env: "nto70".into(), |
| 25 | 24 | stack_probes: StackProbeType::Inline, |
| 26 | 25 | ..base::nto_qnx::opts() |
compiler/rustc_target/src/spec/targets/i586_unknown_netbsd.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::netbsd::opts(); |
compiler/rustc_target/src/spec/targets/i686_apple_darwin.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{FramePointer, Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/i686_linux_android.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, SanitizerSet, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{SanitizerSet, StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | // See https://developer.android.com/ndk/guides/abis.html#x86 |
| 4 | 4 | // for target ABI requirements. |
compiler/rustc_target/src/spec/targets/i686_pc_windows_gnu.rs+6-5| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, FramePointer, LinkerFlavor, Lld, Target}; | |
| 1 | use crate::spec::{Cc, FramePointer, LinkerFlavor, Lld, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::windows_gnu::opts(); |
| ... | ... | @@ -9,10 +9,11 @@ pub(crate) fn target() -> Target { |
| 9 | 9 | |
| 10 | 10 | // Mark all dynamic libraries and executables as compatible with the larger 4GiB address |
| 11 | 11 | // space available to x86 Windows binaries on x86_64. |
| 12 | base.add_pre_link_args( | |
| 13 | LinkerFlavor::Gnu(Cc::No, Lld::No), | |
| 14 | &["-m", "i386pe", "--large-address-aware"], | |
| 15 | ); | |
| 12 | base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ | |
| 13 | "-m", | |
| 14 | "i386pe", | |
| 15 | "--large-address-aware", | |
| 16 | ]); | |
| 16 | 17 | base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-Wl,--large-address-aware"]); |
| 17 | 18 | |
| 18 | 19 | Target { |
compiler/rustc_target/src/spec/targets/i686_pc_windows_gnullvm.rs+6-5| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, FramePointer, LinkerFlavor, Lld, Target}; | |
| 1 | use crate::spec::{Cc, FramePointer, LinkerFlavor, Lld, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::windows_gnullvm::opts(); |
| ... | ... | @@ -9,10 +9,11 @@ pub(crate) fn target() -> Target { |
| 9 | 9 | |
| 10 | 10 | // Mark all dynamic libraries and executables as compatible with the larger 4GiB address |
| 11 | 11 | // space available to x86 Windows binaries on x86_64. |
| 12 | base.add_pre_link_args( | |
| 13 | LinkerFlavor::Gnu(Cc::No, Lld::No), | |
| 14 | &["-m", "i386pe", "--large-address-aware"], | |
| 15 | ); | |
| 12 | base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ | |
| 13 | "-m", | |
| 14 | "i386pe", | |
| 15 | "--large-address-aware", | |
| 16 | ]); | |
| 16 | 17 | |
| 17 | 18 | Target { |
| 18 | 19 | llvm_target: "i686-pc-windows-gnu".into(), |
compiler/rustc_target/src/spec/targets/i686_pc_windows_msvc.rs+10-13| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, LinkerFlavor, Lld, SanitizerSet, Target}; | |
| 1 | use crate::spec::{LinkerFlavor, Lld, SanitizerSet, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::windows_msvc::opts(); |
| ... | ... | @@ -6,18 +6,15 @@ pub(crate) fn target() -> Target { |
| 6 | 6 | base.max_atomic_width = Some(64); |
| 7 | 7 | base.supported_sanitizers = SanitizerSet::ADDRESS; |
| 8 | 8 | |
| 9 | base.add_pre_link_args( | |
| 10 | LinkerFlavor::Msvc(Lld::No), | |
| 11 | &[ | |
| 12 | // Mark all dynamic libraries and executables as compatible with the larger 4GiB address | |
| 13 | // space available to x86 Windows binaries on x86_64. | |
| 14 | "/LARGEADDRESSAWARE", | |
| 15 | // Ensure the linker will only produce an image if it can also produce a table of | |
| 16 | // the image's safe exception handlers. | |
| 17 | // https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers | |
| 18 | "/SAFESEH", | |
| 19 | ], | |
| 20 | ); | |
| 9 | base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &[ | |
| 10 | // Mark all dynamic libraries and executables as compatible with the larger 4GiB address | |
| 11 | // space available to x86 Windows binaries on x86_64. | |
| 12 | "/LARGEADDRESSAWARE", | |
| 13 | // Ensure the linker will only produce an image if it can also produce a table of | |
| 14 | // the image's safe exception handlers. | |
| 15 | // https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers | |
| 16 | "/SAFESEH", | |
| 17 | ]); | |
| 21 | 18 | |
| 22 | 19 | Target { |
| 23 | 20 | llvm_target: "i686-pc-windows-msvc".into(), |
compiler/rustc_target/src/spec/targets/i686_unknown_freebsd.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::freebsd::opts(); |
compiler/rustc_target/src/spec/targets/i686_unknown_haiku.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::haiku::opts(); |
compiler/rustc_target/src/spec/targets/i686_unknown_hurd_gnu.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::hurd_gnu::opts(); |
compiler/rustc_target/src/spec/targets/i686_unknown_linux_gnu.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::linux_gnu::opts(); |
compiler/rustc_target/src/spec/targets/i686_unknown_linux_musl.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, FramePointer, LinkerFlavor, Lld, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, FramePointer, LinkerFlavor, Lld, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::linux_musl::opts(); |
compiler/rustc_target/src/spec/targets/i686_unknown_netbsd.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::netbsd::opts(); |
compiler/rustc_target/src/spec/targets/i686_unknown_openbsd.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::openbsd::opts(); |
compiler/rustc_target/src/spec/targets/i686_unknown_redox.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::redox::opts(); |
compiler/rustc_target/src/spec/targets/i686_unknown_uefi.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | // The cdecl ABI is used. It differs from the stdcall or fastcall ABI. |
| 6 | 6 | // "i686-unknown-windows" is used to get the minimal subset of windows-specific features. |
| 7 | 7 | |
| 8 | use crate::spec::{base, Target}; | |
| 8 | use crate::spec::{Target, base}; | |
| 9 | 9 | |
| 10 | 10 | pub(crate) fn target() -> Target { |
| 11 | 11 | let mut base = base::uefi_msvc::opts(); |
compiler/rustc_target/src/spec/targets/i686_uwp_windows_gnu.rs+6-5| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, FramePointer, LinkerFlavor, Lld, Target}; | |
| 1 | use crate::spec::{Cc, FramePointer, LinkerFlavor, Lld, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::windows_uwp_gnu::opts(); |
| ... | ... | @@ -8,10 +8,11 @@ pub(crate) fn target() -> Target { |
| 8 | 8 | |
| 9 | 9 | // Mark all dynamic libraries and executables as compatible with the larger 4GiB address |
| 10 | 10 | // space available to x86 Windows binaries on x86_64. |
| 11 | base.add_pre_link_args( | |
| 12 | LinkerFlavor::Gnu(Cc::No, Lld::No), | |
| 13 | &["-m", "i386pe", "--large-address-aware"], | |
| 14 | ); | |
| 11 | base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ | |
| 12 | "-m", | |
| 13 | "i386pe", | |
| 14 | "--large-address-aware", | |
| 15 | ]); | |
| 15 | 16 | base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-Wl,--large-address-aware"]); |
| 16 | 17 | |
| 17 | 18 | Target { |
compiler/rustc_target/src/spec/targets/i686_uwp_windows_msvc.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target}; | |
| 1 | use crate::spec::{Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::windows_uwp_msvc::opts(); |
compiler/rustc_target/src/spec/targets/i686_win7_windows_msvc.rs+10-13| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, LinkerFlavor, Lld, Target}; | |
| 1 | use crate::spec::{LinkerFlavor, Lld, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::windows_msvc::opts(); |
| ... | ... | @@ -6,18 +6,15 @@ pub(crate) fn target() -> Target { |
| 6 | 6 | base.max_atomic_width = Some(64); |
| 7 | 7 | base.vendor = "win7".into(); |
| 8 | 8 | |
| 9 | base.add_pre_link_args( | |
| 10 | LinkerFlavor::Msvc(Lld::No), | |
| 11 | &[ | |
| 12 | // Mark all dynamic libraries and executables as compatible with the larger 4GiB address | |
| 13 | // space available to x86 Windows binaries on x86_64. | |
| 14 | "/LARGEADDRESSAWARE", | |
| 15 | // Ensure the linker will only produce an image if it can also produce a table of | |
| 16 | // the image's safe exception handlers. | |
| 17 | // https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers | |
| 18 | "/SAFESEH", | |
| 19 | ], | |
| 20 | ); | |
| 9 | base.add_pre_link_args(LinkerFlavor::Msvc(Lld::No), &[ | |
| 10 | // Mark all dynamic libraries and executables as compatible with the larger 4GiB address | |
| 11 | // space available to x86 Windows binaries on x86_64. | |
| 12 | "/LARGEADDRESSAWARE", | |
| 13 | // Ensure the linker will only produce an image if it can also produce a table of | |
| 14 | // the image's safe exception handlers. | |
| 15 | // https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers | |
| 16 | "/SAFESEH", | |
| 17 | ]); | |
| 21 | 18 | |
| 22 | 19 | Target { |
| 23 | 20 | llvm_target: "i686-pc-windows-msvc".into(), |
compiler/rustc_target/src/spec/targets/i686_wrs_vxworks.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::vxworks::opts(); |
compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_gnu.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, CodeModel, Target, TargetOptions}; | |
| 1 | use crate::spec::{CodeModel, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/loongarch64_unknown_linux_musl.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, CodeModel, Target, TargetOptions}; | |
| 1 | use crate::spec::{CodeModel, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/m68k_unknown_linux_gnu.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Target, TargetOptions}; | |
| 2 | use crate::spec::{Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::linux_gnu::opts(); |
compiler/rustc_target/src/spec/targets/mips64_openwrt_linux_musl.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | //! A target tuple for OpenWrt MIPS64 targets. |
| 2 | 2 | |
| 3 | 3 | use crate::abi::Endian; |
| 4 | use crate::spec::{base, Target, TargetOptions}; | |
| 4 | use crate::spec::{Target, TargetOptions, base}; | |
| 5 | 5 | |
| 6 | 6 | pub(crate) fn target() -> Target { |
| 7 | 7 | let mut base = base::linux_musl::opts(); |
compiler/rustc_target/src/spec/targets/mips64_unknown_linux_gnuabi64.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Target, TargetOptions}; | |
| 2 | use crate::spec::{Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | Target { |
compiler/rustc_target/src/spec/targets/mips64_unknown_linux_muslabi64.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Target, TargetOptions}; | |
| 2 | use crate::spec::{Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::linux_musl::opts(); |
compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_gnuabi64.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/mips64el_unknown_linux_muslabi64.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::linux_musl::opts(); |
compiler/rustc_target/src/spec/targets/mips_unknown_linux_gnu.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Target, TargetOptions}; | |
| 2 | use crate::spec::{Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | Target { |
compiler/rustc_target/src/spec/targets/mips_unknown_linux_musl.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Target, TargetOptions}; | |
| 2 | use crate::spec::{Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::linux_musl::opts(); |
compiler/rustc_target/src/spec/targets/mips_unknown_linux_uclibc.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Target, TargetOptions}; | |
| 2 | use crate::spec::{Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | Target { |
compiler/rustc_target/src/spec/targets/mipsel_sony_psp.rs+5-5| ... | ... | @@ -1,13 +1,13 @@ |
| 1 | use crate::spec::{cvs, Cc, LinkerFlavor, Lld, RelocModel, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, RelocModel, Target, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | // The PSP has custom linker requirements. |
| 4 | 4 | const LINKER_SCRIPT: &str = include_str!("./mipsel_sony_psp_linker_script.ld"); |
| 5 | 5 | |
| 6 | 6 | pub(crate) fn target() -> Target { |
| 7 | let pre_link_args = TargetOptions::link_args( | |
| 8 | LinkerFlavor::Gnu(Cc::No, Lld::No), | |
| 9 | &["--emit-relocs", "--nmagic"], | |
| 10 | ); | |
| 7 | let pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ | |
| 8 | "--emit-relocs", | |
| 9 | "--nmagic", | |
| 10 | ]); | |
| 11 | 11 | |
| 12 | 12 | Target { |
| 13 | 13 | llvm_target: "mipsel-sony-psp".into(), |
compiler/rustc_target/src/spec/targets/mipsel_sony_psx.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/mipsel_unknown_linux_gnu.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/mipsel_unknown_linux_musl.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::linux_musl::opts(); |
compiler/rustc_target/src/spec/targets/mipsel_unknown_linux_uclibc.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/mipsel_unknown_netbsd.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Target, TargetOptions}; | |
| 2 | use crate::spec::{Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::netbsd::opts(); |
compiler/rustc_target/src/spec/targets/mipsisa32r6_unknown_linux_gnu.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Target, TargetOptions}; | |
| 2 | use crate::spec::{Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | Target { |
compiler/rustc_target/src/spec/targets/mipsisa32r6el_unknown_linux_gnu.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/mipsisa64r6_unknown_linux_gnuabi64.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Target, TargetOptions}; | |
| 2 | use crate::spec::{Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | Target { |
compiler/rustc_target/src/spec/targets/mipsisa64r6el_unknown_linux_gnuabi64.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/msp430_none_elf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, Cc, LinkerFlavor, PanicStrategy, RelocModel, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, PanicStrategy, RelocModel, Target, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/powerpc64_ibm_aix.rs+7-5| ... | ... | @@ -1,12 +1,14 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::aix::opts(); |
| 5 | 5 | base.max_atomic_width = Some(64); |
| 6 | base.add_pre_link_args( | |
| 7 | LinkerFlavor::Unix(Cc::No), | |
| 8 | &["-b64", "-bpT:0x100000000", "-bpD:0x110000000", "-bcdtors:all:0:s"], | |
| 9 | ); | |
| 6 | base.add_pre_link_args(LinkerFlavor::Unix(Cc::No), &[ | |
| 7 | "-b64", | |
| 8 | "-bpT:0x100000000", | |
| 9 | "-bpD:0x110000000", | |
| 10 | "-bcdtors:all:0:s", | |
| 11 | ]); | |
| 10 | 12 | |
| 11 | 13 | Target { |
| 12 | 14 | llvm_target: "powerpc64-ibm-aix".into(), |
compiler/rustc_target/src/spec/targets/powerpc64_unknown_freebsd.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | |
| 2 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::freebsd::opts(); |
compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_gnu.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | |
| 2 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::linux_gnu::opts(); |
compiler/rustc_target/src/spec/targets/powerpc64_unknown_linux_musl.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | |
| 2 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::linux_musl::opts(); |
compiler/rustc_target/src/spec/targets/powerpc64_unknown_openbsd.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | |
| 2 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::openbsd::opts(); |
compiler/rustc_target/src/spec/targets/powerpc64_wrs_vxworks.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | |
| 2 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::vxworks::opts(); |
compiler/rustc_target/src/spec/targets/powerpc64le_unknown_freebsd.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::freebsd::opts(); |
compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_gnu.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::linux_gnu::opts(); |
compiler/rustc_target/src/spec/targets/powerpc64le_unknown_linux_musl.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::linux_musl::opts(); |
compiler/rustc_target/src/spec/targets/powerpc_unknown_freebsd.rs+5-5| ... | ... | @@ -1,13 +1,13 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | |
| 2 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::freebsd::opts(); |
| 6 | 6 | // Extra hint to linker that we are generating secure-PLT code. |
| 7 | base.add_pre_link_args( | |
| 8 | LinkerFlavor::Gnu(Cc::Yes, Lld::No), | |
| 9 | &["-m32", "--target=powerpc-unknown-freebsd13.0"], | |
| 10 | ); | |
| 7 | base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ | |
| 8 | "-m32", | |
| 9 | "--target=powerpc-unknown-freebsd13.0", | |
| 10 | ]); | |
| 11 | 11 | base.max_atomic_width = Some(32); |
| 12 | 12 | base.stack_probes = StackProbeType::Inline; |
| 13 | 13 |
compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_gnu.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | |
| 2 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::linux_gnu::opts(); |
compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_gnuspe.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | |
| 2 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::linux_gnu::opts(); |
compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_musl.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | |
| 2 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::linux_musl::opts(); |
compiler/rustc_target/src/spec/targets/powerpc_unknown_linux_muslspe.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | |
| 2 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::linux_musl::opts(); |
compiler/rustc_target/src/spec/targets/powerpc_unknown_netbsd.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | |
| 2 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::netbsd::opts(); |
compiler/rustc_target/src/spec/targets/powerpc_unknown_openbsd.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, StackProbeType, Target}; | |
| 2 | use crate::spec::{StackProbeType, Target, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::openbsd::opts(); |
compiler/rustc_target/src/spec/targets/powerpc_wrs_vxworks.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | |
| 2 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::vxworks::opts(); |
compiler/rustc_target/src/spec/targets/powerpc_wrs_vxworks_spe.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | |
| 2 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::vxworks::opts(); |
compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_gnu.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use std::borrow::Cow; |
| 2 | 2 | |
| 3 | use crate::spec::{base, CodeModel, SplitDebuginfo, Target, TargetOptions}; | |
| 3 | use crate::spec::{CodeModel, SplitDebuginfo, Target, TargetOptions, base}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
| 6 | 6 | Target { |
compiler/rustc_target/src/spec/targets/riscv32gc_unknown_linux_musl.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use std::borrow::Cow; |
| 2 | 2 | |
| 3 | use crate::spec::{base, CodeModel, SplitDebuginfo, Target, TargetOptions}; | |
| 3 | use crate::spec::{CodeModel, SplitDebuginfo, Target, TargetOptions, base}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
| 6 | 6 | Target { |
compiler/rustc_target/src/spec/targets/riscv32imac_esp_espidf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, PanicStrategy, RelocModel, Target, TargetOptions}; | |
| 1 | use crate::spec::{PanicStrategy, RelocModel, Target, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/riscv32imac_unknown_nuttx_elf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/riscv32imafc_esp_espidf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, PanicStrategy, RelocModel, Target, TargetOptions}; | |
| 1 | use crate::spec::{PanicStrategy, RelocModel, Target, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/riscv32imafc_unknown_nuttx_elf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/riscv32imc_esp_espidf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, PanicStrategy, RelocModel, Target, TargetOptions}; | |
| 1 | use crate::spec::{PanicStrategy, RelocModel, Target, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/riscv32imc_unknown_nuttx_elf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{cvs, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions, cvs}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/riscv64_linux_android.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use std::borrow::Cow; |
| 2 | 2 | |
| 3 | use crate::spec::{base, CodeModel, SanitizerSet, SplitDebuginfo, Target, TargetOptions}; | |
| 3 | use crate::spec::{CodeModel, SanitizerSet, SplitDebuginfo, Target, TargetOptions, base}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
| 6 | 6 | Target { |
compiler/rustc_target/src/spec/targets/riscv64gc_unknown_freebsd.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, CodeModel, Target, TargetOptions}; | |
| 1 | use crate::spec::{CodeModel, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/riscv64gc_unknown_fuchsia.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, CodeModel, SanitizerSet, Target, TargetOptions}; | |
| 1 | use crate::spec::{CodeModel, SanitizerSet, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/riscv64gc_unknown_hermit.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, CodeModel, RelocModel, Target, TargetOptions, TlsModel}; | |
| 1 | use crate::spec::{CodeModel, RelocModel, Target, TargetOptions, TlsModel, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_gnu.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use std::borrow::Cow; |
| 2 | 2 | |
| 3 | use crate::spec::{base, CodeModel, SplitDebuginfo, Target, TargetOptions}; | |
| 3 | use crate::spec::{CodeModel, SplitDebuginfo, Target, TargetOptions, base}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
| 6 | 6 | Target { |
compiler/rustc_target/src/spec/targets/riscv64gc_unknown_linux_musl.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use std::borrow::Cow; |
| 2 | 2 | |
| 3 | use crate::spec::{base, CodeModel, SplitDebuginfo, Target, TargetOptions}; | |
| 3 | use crate::spec::{CodeModel, SplitDebuginfo, Target, TargetOptions, base}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
| 6 | 6 | Target { |
compiler/rustc_target/src/spec/targets/riscv64gc_unknown_netbsd.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, CodeModel, Target, TargetOptions}; | |
| 1 | use crate::spec::{CodeModel, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/riscv64gc_unknown_nuttx_elf.rs+2-2| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use crate::spec::{ |
| 2 | cvs, Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, Target, | |
| 3 | TargetOptions, | |
| 2 | Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, Target, | |
| 3 | TargetOptions, cvs, | |
| 4 | 4 | }; |
| 5 | 5 | |
| 6 | 6 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/riscv64gc_unknown_openbsd.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, CodeModel, Target, TargetOptions}; | |
| 1 | use crate::spec::{CodeModel, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/riscv64imac_unknown_nuttx_elf.rs+2-2| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use crate::spec::{ |
| 2 | cvs, Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, Target, | |
| 3 | TargetOptions, | |
| 2 | Cc, CodeModel, LinkerFlavor, Lld, PanicStrategy, RelocModel, SanitizerSet, Target, | |
| 3 | TargetOptions, cvs, | |
| 4 | 4 | }; |
| 5 | 5 | |
| 6 | 6 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/s390x_unknown_linux_gnu.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, SanitizerSet, StackProbeType, Target}; | |
| 2 | use crate::spec::{SanitizerSet, StackProbeType, Target, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::linux_gnu::opts(); |
compiler/rustc_target/src/spec/targets/s390x_unknown_linux_musl.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, SanitizerSet, StackProbeType, Target}; | |
| 2 | use crate::spec::{SanitizerSet, StackProbeType, Target, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::linux_musl::opts(); |
compiler/rustc_target/src/spec/targets/sparc64_unknown_linux_gnu.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Target}; | |
| 2 | use crate::spec::{Target, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::linux_gnu::opts(); |
compiler/rustc_target/src/spec/targets/sparc64_unknown_netbsd.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Cc, LinkerFlavor, Lld, Target, TargetOptions}; | |
| 2 | use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::netbsd::opts(); |
compiler/rustc_target/src/spec/targets/sparc64_unknown_openbsd.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Cc, LinkerFlavor, Lld, Target}; | |
| 2 | use crate::spec::{Cc, LinkerFlavor, Lld, Target, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::openbsd::opts(); |
compiler/rustc_target/src/spec/targets/sparc_unknown_linux_gnu.rs+4-5| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Cc, LinkerFlavor, Lld, Target, TargetOptions}; | |
| 2 | use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetOptions, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | Target { |
| ... | ... | @@ -16,10 +16,9 @@ pub(crate) fn target() -> Target { |
| 16 | 16 | options: TargetOptions { |
| 17 | 17 | cpu: "v9".into(), |
| 18 | 18 | endian: Endian::Big, |
| 19 | late_link_args: TargetOptions::link_args( | |
| 20 | LinkerFlavor::Gnu(Cc::Yes, Lld::No), | |
| 21 | &["-mcpu=v9", "-m32"], | |
| 22 | ), | |
| 19 | late_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ | |
| 20 | "-mcpu=v9", "-m32", | |
| 21 | ]), | |
| 23 | 22 | max_atomic_width: Some(32), |
| 24 | 23 | ..base::linux_gnu::opts() |
| 25 | 24 | }, |
compiler/rustc_target/src/spec/targets/sparcv9_sun_solaris.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | use crate::spec::{base, Cc, LinkerFlavor, Target}; | |
| 2 | use crate::spec::{Cc, LinkerFlavor, Target, base}; | |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
| 5 | 5 | let mut base = base::solaris::opts(); |
compiler/rustc_target/src/spec/targets/thumbv4t_none_eabi.rs+1-1| ... | ... | @@ -9,7 +9,7 @@ |
| 9 | 9 | //! The default link script is very likely wrong, so you should use |
| 10 | 10 | //! `-Clink-arg=-Tmy_script.ld` to override that with a correct linker script. |
| 11 | 11 | |
| 12 | use crate::spec::{base, cvs, FramePointer, PanicStrategy, RelocModel, Target, TargetOptions}; | |
| 12 | use crate::spec::{FramePointer, PanicStrategy, RelocModel, Target, TargetOptions, base, cvs}; | |
| 13 | 13 | |
| 14 | 14 | pub(crate) fn target() -> Target { |
| 15 | 15 | Target { |
compiler/rustc_target/src/spec/targets/thumbv5te_none_eabi.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | //! Targets the ARMv5TE, with code as `t32` code by default. |
| 2 | 2 | |
| 3 | use crate::spec::{base, cvs, FramePointer, Target, TargetOptions}; | |
| 3 | use crate::spec::{FramePointer, Target, TargetOptions, base, cvs}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
| 6 | 6 | Target { |
compiler/rustc_target/src/spec/targets/thumbv6m_none_eabi.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | // Targets the Cortex-M0, Cortex-M0+ and Cortex-M1 processors (ARMv6-M architecture) |
| 2 | 2 | |
| 3 | use crate::spec::{base, Target, TargetOptions}; | |
| 3 | use crate::spec::{Target, TargetOptions, base}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
| 6 | 6 | Target { |
compiler/rustc_target/src/spec/targets/thumbv6m_nuttx_eabi.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | // Targets the Cortex-M0, Cortex-M0+ and Cortex-M1 processors (ARMv6-M architecture) |
| 2 | 2 | |
| 3 | use crate::spec::{base, cvs, Target, TargetOptions}; | |
| 3 | use crate::spec::{Target, TargetOptions, base, cvs}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
| 6 | 6 | Target { |
compiler/rustc_target/src/spec/targets/thumbv7a_pc_windows_msvc.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, LinkerFlavor, Lld, PanicStrategy, Target, TargetOptions}; | |
| 1 | use crate::spec::{LinkerFlavor, Lld, PanicStrategy, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::windows_msvc::opts(); |
compiler/rustc_target/src/spec/targets/thumbv7a_uwp_windows_msvc.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, PanicStrategy, Target, TargetOptions}; | |
| 1 | use crate::spec::{PanicStrategy, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/thumbv7em_none_eabi.rs+1-1| ... | ... | @@ -9,7 +9,7 @@ |
| 9 | 9 | // To opt-in to hardware accelerated floating point operations, you can use, for example, |
| 10 | 10 | // `-C target-feature=+vfp4` or `-C target-cpu=cortex-m4`. |
| 11 | 11 | |
| 12 | use crate::spec::{base, Target, TargetOptions}; | |
| 12 | use crate::spec::{Target, TargetOptions, base}; | |
| 13 | 13 | |
| 14 | 14 | pub(crate) fn target() -> Target { |
| 15 | 15 | Target { |
compiler/rustc_target/src/spec/targets/thumbv7em_none_eabihf.rs+1-1| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | // |
| 9 | 9 | // To opt into double precision hardware support, use the `-C target-feature=+fp64` flag. |
| 10 | 10 | |
| 11 | use crate::spec::{base, Target, TargetOptions}; | |
| 11 | use crate::spec::{Target, TargetOptions, base}; | |
| 12 | 12 | |
| 13 | 13 | pub(crate) fn target() -> Target { |
| 14 | 14 | Target { |
compiler/rustc_target/src/spec/targets/thumbv7em_nuttx_eabi.rs+1-1| ... | ... | @@ -9,7 +9,7 @@ |
| 9 | 9 | // To opt-in to hardware accelerated floating point operations, you can use, for example, |
| 10 | 10 | // `-C target-feature=+vfp4` or `-C target-cpu=cortex-m4`. |
| 11 | 11 | |
| 12 | use crate::spec::{base, cvs, Target, TargetOptions}; | |
| 12 | use crate::spec::{Target, TargetOptions, base, cvs}; | |
| 13 | 13 | |
| 14 | 14 | pub(crate) fn target() -> Target { |
| 15 | 15 | Target { |
compiler/rustc_target/src/spec/targets/thumbv7em_nuttx_eabihf.rs+1-1| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | // |
| 9 | 9 | // To opt into double precision hardware support, use the `-C target-feature=+fp64` flag. |
| 10 | 10 | |
| 11 | use crate::spec::{base, cvs, Target, TargetOptions}; | |
| 11 | use crate::spec::{Target, TargetOptions, base, cvs}; | |
| 12 | 12 | |
| 13 | 13 | pub(crate) fn target() -> Target { |
| 14 | 14 | Target { |
compiler/rustc_target/src/spec/targets/thumbv7m_none_eabi.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | // Targets the Cortex-M3 processor (ARMv7-M) |
| 2 | 2 | |
| 3 | use crate::spec::{base, Target, TargetOptions}; | |
| 3 | use crate::spec::{Target, TargetOptions, base}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
| 6 | 6 | Target { |
compiler/rustc_target/src/spec/targets/thumbv7m_nuttx_eabi.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | // Targets the Cortex-M3 processor (ARMv7-M) |
| 2 | 2 | |
| 3 | use crate::spec::{base, cvs, Target, TargetOptions}; | |
| 3 | use crate::spec::{Target, TargetOptions, base, cvs}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
| 6 | 6 | Target { |
compiler/rustc_target/src/spec/targets/thumbv7neon_linux_androideabi.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | // This target if is for the Android v7a ABI in thumb mode with |
| 4 | 4 | // NEON unconditionally enabled and, therefore, with 32 FPU registers |
compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_gnueabihf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | // This target is for glibc Linux on ARMv7 with thumb mode enabled |
| 4 | 4 | // (for consistency with Android and Debian-based distributions) |
compiler/rustc_target/src/spec/targets/thumbv7neon_unknown_linux_musleabihf.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target, TargetOptions}; | |
| 1 | use crate::spec::{Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | // This target is for musl Linux on ARMv7 with thumb mode enabled |
| 4 | 4 | // (for consistency with Android and Debian-based distributions) |
compiler/rustc_target/src/spec/targets/thumbv8m_base_none_eabi.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | // Targets the Cortex-M23 processor (Baseline ARMv8-M) |
| 2 | 2 | |
| 3 | use crate::spec::{base, Target, TargetOptions}; | |
| 3 | use crate::spec::{Target, TargetOptions, base}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
| 6 | 6 | Target { |
compiler/rustc_target/src/spec/targets/thumbv8m_base_nuttx_eabi.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | // Targets the Cortex-M23 processor (Baseline ARMv8-M) |
| 2 | 2 | |
| 3 | use crate::spec::{base, cvs, Target, TargetOptions}; | |
| 3 | use crate::spec::{Target, TargetOptions, base, cvs}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
| 6 | 6 | Target { |
compiler/rustc_target/src/spec/targets/thumbv8m_main_none_eabi.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // Targets the Cortex-M33 processor (Armv8-M Mainline architecture profile), |
| 2 | 2 | // without the Floating Point extension. |
| 3 | 3 | |
| 4 | use crate::spec::{base, Target, TargetOptions}; | |
| 4 | use crate::spec::{Target, TargetOptions, base}; | |
| 5 | 5 | |
| 6 | 6 | pub(crate) fn target() -> Target { |
| 7 | 7 | Target { |
compiler/rustc_target/src/spec/targets/thumbv8m_main_none_eabihf.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // Targets the Cortex-M33 processor (Armv8-M Mainline architecture profile), |
| 2 | 2 | // with the Floating Point extension. |
| 3 | 3 | |
| 4 | use crate::spec::{base, Target, TargetOptions}; | |
| 4 | use crate::spec::{Target, TargetOptions, base}; | |
| 5 | 5 | |
| 6 | 6 | pub(crate) fn target() -> Target { |
| 7 | 7 | Target { |
compiler/rustc_target/src/spec/targets/thumbv8m_main_nuttx_eabi.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // Targets the Cortex-M33 processor (Armv8-M Mainline architecture profile), |
| 2 | 2 | // without the Floating Point extension. |
| 3 | 3 | |
| 4 | use crate::spec::{base, cvs, Target, TargetOptions}; | |
| 4 | use crate::spec::{Target, TargetOptions, base, cvs}; | |
| 5 | 5 | |
| 6 | 6 | pub(crate) fn target() -> Target { |
| 7 | 7 | Target { |
compiler/rustc_target/src/spec/targets/thumbv8m_main_nuttx_eabihf.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // Targets the Cortex-M33 processor (Armv8-M Mainline architecture profile), |
| 2 | 2 | // with the Floating Point extension. |
| 3 | 3 | |
| 4 | use crate::spec::{base, cvs, Target, TargetOptions}; | |
| 4 | use crate::spec::{Target, TargetOptions, base, cvs}; | |
| 5 | 5 | |
| 6 | 6 | pub(crate) fn target() -> Target { |
| 7 | 7 | Target { |
compiler/rustc_target/src/spec/targets/wasm32_unknown_emscripten.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::spec::{ |
| 2 | base, cvs, LinkArgs, LinkerFlavor, PanicStrategy, RelocModel, Target, TargetOptions, | |
| 2 | LinkArgs, LinkerFlavor, PanicStrategy, RelocModel, Target, TargetOptions, base, cvs, | |
| 3 | 3 | }; |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/wasm32_unknown_unknown.rs+12-18| ... | ... | @@ -10,29 +10,23 @@ |
| 10 | 10 | //! This target is more or less managed by the Rust and WebAssembly Working |
| 11 | 11 | //! Group nowadays at <https://github.com/rustwasm>. |
| 12 | 12 | |
| 13 | use crate::spec::{base, Cc, LinkerFlavor, Target}; | |
| 13 | use crate::spec::{Cc, LinkerFlavor, Target, base}; | |
| 14 | 14 | |
| 15 | 15 | pub(crate) fn target() -> Target { |
| 16 | 16 | let mut options = base::wasm::options(); |
| 17 | 17 | options.os = "unknown".into(); |
| 18 | 18 | |
| 19 | options.add_pre_link_args( | |
| 20 | LinkerFlavor::WasmLld(Cc::No), | |
| 21 | &[ | |
| 22 | // For now this target just never has an entry symbol no matter the output | |
| 23 | // type, so unconditionally pass this. | |
| 24 | "--no-entry", | |
| 25 | ], | |
| 26 | ); | |
| 27 | options.add_pre_link_args( | |
| 28 | LinkerFlavor::WasmLld(Cc::Yes), | |
| 29 | &[ | |
| 30 | // Make sure clang uses LLD as its linker and is configured appropriately | |
| 31 | // otherwise | |
| 32 | "--target=wasm32-unknown-unknown", | |
| 33 | "-Wl,--no-entry", | |
| 34 | ], | |
| 35 | ); | |
| 19 | options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::No), &[ | |
| 20 | // For now this target just never has an entry symbol no matter the output | |
| 21 | // type, so unconditionally pass this. | |
| 22 | "--no-entry", | |
| 23 | ]); | |
| 24 | options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &[ | |
| 25 | // Make sure clang uses LLD as its linker and is configured appropriately | |
| 26 | // otherwise | |
| 27 | "--target=wasm32-unknown-unknown", | |
| 28 | "-Wl,--no-entry", | |
| 29 | ]); | |
| 36 | 30 | |
| 37 | 31 | Target { |
| 38 | 32 | llvm_target: "wasm32-unknown-unknown".into(), |
compiler/rustc_target/src/spec/targets/wasm32_wasip1.rs+1-1| ... | ... | @@ -10,7 +10,7 @@ |
| 10 | 10 | //! was since renamed to `wasm32-wasip1` after the preview2 target was |
| 11 | 11 | //! introduced. |
| 12 | 12 | |
| 13 | use crate::spec::{base, crt_objects, Cc, LinkSelfContainedDefault, LinkerFlavor, Target}; | |
| 13 | use crate::spec::{Cc, LinkSelfContainedDefault, LinkerFlavor, Target, base, crt_objects}; | |
| 14 | 14 | |
| 15 | 15 | pub(crate) fn target() -> Target { |
| 16 | 16 | let mut options = base::wasm::options(); |
compiler/rustc_target/src/spec/targets/wasm32_wasip1_threads.rs+12-14| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | //! |
| 8 | 8 | //! Historically this target was known as `wasm32-wasi-preview1-threads`. |
| 9 | 9 | |
| 10 | use crate::spec::{base, crt_objects, Cc, LinkSelfContainedDefault, LinkerFlavor, Target}; | |
| 10 | use crate::spec::{Cc, LinkSelfContainedDefault, LinkerFlavor, Target, base, crt_objects}; | |
| 11 | 11 | |
| 12 | 12 | pub(crate) fn target() -> Target { |
| 13 | 13 | let mut options = base::wasm::options(); |
| ... | ... | @@ -15,19 +15,17 @@ pub(crate) fn target() -> Target { |
| 15 | 15 | options.os = "wasi".into(); |
| 16 | 16 | options.env = "p1".into(); |
| 17 | 17 | |
| 18 | options.add_pre_link_args( | |
| 19 | LinkerFlavor::WasmLld(Cc::No), | |
| 20 | &["--import-memory", "--export-memory", "--shared-memory"], | |
| 21 | ); | |
| 22 | options.add_pre_link_args( | |
| 23 | LinkerFlavor::WasmLld(Cc::Yes), | |
| 24 | &[ | |
| 25 | "--target=wasm32-wasip1-threads", | |
| 26 | "-Wl,--import-memory", | |
| 27 | "-Wl,--export-memory,", | |
| 28 | "-Wl,--shared-memory", | |
| 29 | ], | |
| 30 | ); | |
| 18 | options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::No), &[ | |
| 19 | "--import-memory", | |
| 20 | "--export-memory", | |
| 21 | "--shared-memory", | |
| 22 | ]); | |
| 23 | options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &[ | |
| 24 | "--target=wasm32-wasip1-threads", | |
| 25 | "-Wl,--import-memory", | |
| 26 | "-Wl,--export-memory,", | |
| 27 | "-Wl,--shared-memory", | |
| 28 | ]); | |
| 31 | 29 | |
| 32 | 30 | options.pre_link_objects_self_contained = crt_objects::pre_wasi_self_contained(); |
| 33 | 31 | options.post_link_objects_self_contained = crt_objects::post_wasi_self_contained(); |
compiler/rustc_target/src/spec/targets/wasm32_wasip2.rs+1-1| ... | ... | @@ -16,7 +16,7 @@ |
| 16 | 16 | //! You can see more about wasi at <https://wasi.dev> and the component model at |
| 17 | 17 | //! <https://github.com/WebAssembly/component-model>. |
| 18 | 18 | |
| 19 | use crate::spec::{base, crt_objects, LinkSelfContainedDefault, RelocModel, Target}; | |
| 19 | use crate::spec::{LinkSelfContainedDefault, RelocModel, Target, base, crt_objects}; | |
| 20 | 20 | |
| 21 | 21 | pub(crate) fn target() -> Target { |
| 22 | 22 | let mut options = base::wasm::options(); |
compiler/rustc_target/src/spec/targets/wasm64_unknown_unknown.rs+13-19| ... | ... | @@ -7,30 +7,24 @@ |
| 7 | 7 | //! the standard library is available, most of it returns an error immediately |
| 8 | 8 | //! (e.g. trying to create a TCP stream or something like that). |
| 9 | 9 | |
| 10 | use crate::spec::{base, Cc, LinkerFlavor, Target}; | |
| 10 | use crate::spec::{Cc, LinkerFlavor, Target, base}; | |
| 11 | 11 | |
| 12 | 12 | pub(crate) fn target() -> Target { |
| 13 | 13 | let mut options = base::wasm::options(); |
| 14 | 14 | options.os = "unknown".into(); |
| 15 | 15 | |
| 16 | options.add_pre_link_args( | |
| 17 | LinkerFlavor::WasmLld(Cc::No), | |
| 18 | &[ | |
| 19 | // For now this target just never has an entry symbol no matter the output | |
| 20 | // type, so unconditionally pass this. | |
| 21 | "--no-entry", | |
| 22 | "-mwasm64", | |
| 23 | ], | |
| 24 | ); | |
| 25 | options.add_pre_link_args( | |
| 26 | LinkerFlavor::WasmLld(Cc::Yes), | |
| 27 | &[ | |
| 28 | // Make sure clang uses LLD as its linker and is configured appropriately | |
| 29 | // otherwise | |
| 30 | "--target=wasm64-unknown-unknown", | |
| 31 | "-Wl,--no-entry", | |
| 32 | ], | |
| 33 | ); | |
| 16 | options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::No), &[ | |
| 17 | // For now this target just never has an entry symbol no matter the output | |
| 18 | // type, so unconditionally pass this. | |
| 19 | "--no-entry", | |
| 20 | "-mwasm64", | |
| 21 | ]); | |
| 22 | options.add_pre_link_args(LinkerFlavor::WasmLld(Cc::Yes), &[ | |
| 23 | // Make sure clang uses LLD as its linker and is configured appropriately | |
| 24 | // otherwise | |
| 25 | "--target=wasm64-unknown-unknown", | |
| 26 | "-Wl,--no-entry", | |
| 27 | ]); | |
| 34 | 28 | |
| 35 | 29 | // Any engine that implements wasm64 will surely implement the rest of these |
| 36 | 30 | // features since they were all merged into the official spec by the time |
compiler/rustc_target/src/spec/targets/x86_64_apple_darwin.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/x86_64_apple_ios.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{SanitizerSet, Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/x86_64_apple_ios_macabi.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{SanitizerSet, Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/x86_64_apple_tvos.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/x86_64_apple_watchos_sim.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/x86_64_fortanix_unknown_sgx.rs+32-35| ... | ... | @@ -1,42 +1,39 @@ |
| 1 | 1 | use std::borrow::Cow; |
| 2 | 2 | |
| 3 | use crate::spec::{cvs, Cc, LinkerFlavor, Lld, Target, TargetOptions}; | |
| 3 | use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetOptions, cvs}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
| 6 | let pre_link_args = TargetOptions::link_args( | |
| 7 | LinkerFlavor::Gnu(Cc::No, Lld::No), | |
| 8 | &[ | |
| 9 | "-e", | |
| 10 | "elf_entry", | |
| 11 | "-Bstatic", | |
| 12 | "--gc-sections", | |
| 13 | "-z", | |
| 14 | "text", | |
| 15 | "-z", | |
| 16 | "norelro", | |
| 17 | "--no-undefined", | |
| 18 | "--error-unresolved-symbols", | |
| 19 | "--no-undefined-version", | |
| 20 | "-Bsymbolic", | |
| 21 | "--export-dynamic", | |
| 22 | // The following symbols are needed by libunwind, which is linked after | |
| 23 | // libstd. Make sure they're included in the link. | |
| 24 | "-u", | |
| 25 | "__rust_abort", | |
| 26 | "-u", | |
| 27 | "__rust_c_alloc", | |
| 28 | "-u", | |
| 29 | "__rust_c_dealloc", | |
| 30 | "-u", | |
| 31 | "__rust_print_err", | |
| 32 | "-u", | |
| 33 | "__rust_rwlock_rdlock", | |
| 34 | "-u", | |
| 35 | "__rust_rwlock_unlock", | |
| 36 | "-u", | |
| 37 | "__rust_rwlock_wrlock", | |
| 38 | ], | |
| 39 | ); | |
| 6 | let pre_link_args = TargetOptions::link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ | |
| 7 | "-e", | |
| 8 | "elf_entry", | |
| 9 | "-Bstatic", | |
| 10 | "--gc-sections", | |
| 11 | "-z", | |
| 12 | "text", | |
| 13 | "-z", | |
| 14 | "norelro", | |
| 15 | "--no-undefined", | |
| 16 | "--error-unresolved-symbols", | |
| 17 | "--no-undefined-version", | |
| 18 | "-Bsymbolic", | |
| 19 | "--export-dynamic", | |
| 20 | // The following symbols are needed by libunwind, which is linked after | |
| 21 | // libstd. Make sure they're included in the link. | |
| 22 | "-u", | |
| 23 | "__rust_abort", | |
| 24 | "-u", | |
| 25 | "__rust_c_alloc", | |
| 26 | "-u", | |
| 27 | "__rust_c_dealloc", | |
| 28 | "-u", | |
| 29 | "__rust_print_err", | |
| 30 | "-u", | |
| 31 | "__rust_rwlock_rdlock", | |
| 32 | "-u", | |
| 33 | "__rust_rwlock_unlock", | |
| 34 | "-u", | |
| 35 | "__rust_rwlock_wrlock", | |
| 36 | ]); | |
| 40 | 37 | |
| 41 | 38 | const EXPORT_SYMBOLS: &[&str] = &[ |
| 42 | 39 | "sgx_entry", |
compiler/rustc_target/src/spec/targets/x86_64_linux_android.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::spec::{ |
| 2 | base, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetOptions, | |
| 2 | Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetOptions, base, | |
| 3 | 3 | }; |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/x86_64_pc_nto_qnx710.rs+4-5| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
| ... | ... | @@ -17,10 +17,9 @@ pub(crate) fn target() -> Target { |
| 17 | 17 | cpu: "x86-64".into(), |
| 18 | 18 | plt_by_default: false, |
| 19 | 19 | max_atomic_width: Some(64), |
| 20 | pre_link_args: TargetOptions::link_args( | |
| 21 | LinkerFlavor::Gnu(Cc::Yes, Lld::No), | |
| 22 | &["-Vgcc_ntox86_64_cxx"], | |
| 23 | ), | |
| 20 | pre_link_args: TargetOptions::link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &[ | |
| 21 | "-Vgcc_ntox86_64_cxx", | |
| 22 | ]), | |
| 24 | 23 | env: "nto71".into(), |
| 25 | 24 | ..base::nto_qnx::opts() |
| 26 | 25 | }, |
compiler/rustc_target/src/spec/targets/x86_64_pc_solaris.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, SanitizerSet, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, SanitizerSet, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::solaris::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_pc_windows_gnu.rs+6-5| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::windows_gnu::opts(); |
| ... | ... | @@ -6,10 +6,11 @@ pub(crate) fn target() -> Target { |
| 6 | 6 | base.features = "+cx16,+sse3,+sahf".into(); |
| 7 | 7 | base.plt_by_default = false; |
| 8 | 8 | // Use high-entropy 64 bit address space for ASLR |
| 9 | base.add_pre_link_args( | |
| 10 | LinkerFlavor::Gnu(Cc::No, Lld::No), | |
| 11 | &["-m", "i386pep", "--high-entropy-va"], | |
| 12 | ); | |
| 9 | base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ | |
| 10 | "-m", | |
| 11 | "i386pep", | |
| 12 | "--high-entropy-va", | |
| 13 | ]); | |
| 13 | 14 | base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64", "-Wl,--high-entropy-va"]); |
| 14 | 15 | base.max_atomic_width = Some(128); |
| 15 | 16 | base.linker = Some("x86_64-w64-mingw32-gcc".into()); |
compiler/rustc_target/src/spec/targets/x86_64_pc_windows_gnullvm.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::windows_gnullvm::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_pc_windows_msvc.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, SanitizerSet, Target}; | |
| 1 | use crate::spec::{SanitizerSet, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::windows_msvc::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_unikraft_linux_musl.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/x86_64_unknown_dragonfly.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::dragonfly::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_unknown_freebsd.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::freebsd::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_unknown_fuchsia.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, SanitizerSet, StackProbeType, Target}; | |
| 1 | use crate::spec::{SanitizerSet, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::fuchsia::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_unknown_haiku.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::haiku::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_unknown_hermit.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, StackProbeType, Target, TargetOptions}; | |
| 1 | use crate::spec::{StackProbeType, Target, TargetOptions, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | Target { |
compiler/rustc_target/src/spec/targets/x86_64_unknown_hurd_gnu.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::hurd_gnu::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_unknown_illumos.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, SanitizerSet, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, SanitizerSet, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::illumos::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_unknown_l4re_uclibc.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, PanicStrategy, Target}; | |
| 1 | use crate::spec::{PanicStrategy, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::l4re::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnu.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::linux_gnu::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_gnux32.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::linux_gnu::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_musl.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::linux_musl::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_none.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::linux::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_unknown_linux_ohos.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::linux_ohos::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_unknown_netbsd.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::spec::{ |
| 2 | base, Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetOptions, | |
| 2 | Cc, LinkerFlavor, Lld, SanitizerSet, StackProbeType, Target, TargetOptions, base, | |
| 3 | 3 | }; |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/x86_64_unknown_openbsd.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::openbsd::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_unknown_redox.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::redox::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_unknown_uefi.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | // LLVM. "x86_64-unknown-windows" is used to get the minimal subset of windows-specific features. |
| 7 | 7 | |
| 8 | 8 | use crate::abi::call::Conv; |
| 9 | use crate::spec::{base, Target}; | |
| 9 | use crate::spec::{Target, base}; | |
| 10 | 10 | |
| 11 | 11 | pub(crate) fn target() -> Target { |
| 12 | 12 | let mut base = base::uefi_msvc::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_uwp_windows_gnu.rs+6-5| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::windows_uwp_gnu::opts(); |
| ... | ... | @@ -6,10 +6,11 @@ pub(crate) fn target() -> Target { |
| 6 | 6 | base.features = "+cx16,+sse3,+sahf".into(); |
| 7 | 7 | base.plt_by_default = false; |
| 8 | 8 | // Use high-entropy 64 bit address space for ASLR |
| 9 | base.add_pre_link_args( | |
| 10 | LinkerFlavor::Gnu(Cc::No, Lld::No), | |
| 11 | &["-m", "i386pep", "--high-entropy-va"], | |
| 12 | ); | |
| 9 | base.add_pre_link_args(LinkerFlavor::Gnu(Cc::No, Lld::No), &[ | |
| 10 | "-m", | |
| 11 | "i386pep", | |
| 12 | "--high-entropy-va", | |
| 13 | ]); | |
| 13 | 14 | base.add_pre_link_args(LinkerFlavor::Gnu(Cc::Yes, Lld::No), &["-m64", "-Wl,--high-entropy-va"]); |
| 14 | 15 | base.max_atomic_width = Some(128); |
| 15 | 16 |
compiler/rustc_target/src/spec/targets/x86_64_uwp_windows_msvc.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target}; | |
| 1 | use crate::spec::{Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::windows_uwp_msvc::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_win7_windows_msvc.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Target}; | |
| 1 | use crate::spec::{Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::windows_msvc::opts(); |
compiler/rustc_target/src/spec/targets/x86_64_wrs_vxworks.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::{base, Cc, LinkerFlavor, Lld, StackProbeType, Target}; | |
| 1 | use crate::spec::{Cc, LinkerFlavor, Lld, StackProbeType, Target, base}; | |
| 2 | 2 | |
| 3 | 3 | pub(crate) fn target() -> Target { |
| 4 | 4 | let mut base = base::vxworks::opts(); |
compiler/rustc_target/src/spec/targets/x86_64h_apple_darwin.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::spec::base::apple::{base, Arch, TargetAbi}; | |
| 1 | use crate::spec::base::apple::{Arch, TargetAbi, base}; | |
| 2 | 2 | use crate::spec::{FramePointer, SanitizerSet, Target, TargetOptions}; |
| 3 | 3 | |
| 4 | 4 | pub(crate) fn target() -> Target { |
compiler/rustc_target/src/spec/targets/xtensa_esp32_espidf.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | 2 | use crate::spec::base::xtensa; |
| 3 | use crate::spec::{cvs, Target, TargetOptions}; | |
| 3 | use crate::spec::{Target, TargetOptions, cvs}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
| 6 | 6 | Target { |
compiler/rustc_target/src/spec/targets/xtensa_esp32s2_espidf.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | 2 | use crate::spec::base::xtensa; |
| 3 | use crate::spec::{cvs, Target, TargetOptions}; | |
| 3 | use crate::spec::{Target, TargetOptions, cvs}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
| 6 | 6 | Target { |
compiler/rustc_target/src/spec/targets/xtensa_esp32s3_espidf.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use crate::abi::Endian; |
| 2 | 2 | use crate::spec::base::xtensa; |
| 3 | use crate::spec::{cvs, Target, TargetOptions}; | |
| 3 | use crate::spec::{Target, TargetOptions, cvs}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) fn target() -> Target { |
| 6 | 6 | Target { |
compiler/rustc_target/src/target_features.rs+7-11| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use rustc_data_structures::fx::{FxHashMap, FxHashSet}; |
| 2 | use rustc_span::symbol::{sym, Symbol}; | |
| 2 | use rustc_span::symbol::{Symbol, sym}; | |
| 3 | 3 | |
| 4 | 4 | /// Features that control behaviour of rustc, rather than the codegen. |
| 5 | 5 | pub const RUSTC_SPECIFIC_FEATURES: &[&str] = &["crt-static"]; |
| ... | ... | @@ -243,17 +243,13 @@ const AARCH64_ALLOWED_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[ |
| 243 | 243 | ("sve2p1", Unstable(sym::aarch64_unstable_target_feature), &["sve2"]), |
| 244 | 244 | // FEAT_TME |
| 245 | 245 | ("tme", Stable, &[]), |
| 246 | ( | |
| 247 | "v8.1a", | |
| 248 | Unstable(sym::aarch64_ver_target_feature), | |
| 249 | &["crc", "lse", "rdm", "pan", "lor", "vh"], | |
| 250 | ), | |
| 246 | ("v8.1a", Unstable(sym::aarch64_ver_target_feature), &[ | |
| 247 | "crc", "lse", "rdm", "pan", "lor", "vh", | |
| 248 | ]), | |
| 251 | 249 | ("v8.2a", Unstable(sym::aarch64_ver_target_feature), &["v8.1a", "ras", "dpb"]), |
| 252 | ( | |
| 253 | "v8.3a", | |
| 254 | Unstable(sym::aarch64_ver_target_feature), | |
| 255 | &["v8.2a", "rcpc", "paca", "pacg", "jsconv"], | |
| 256 | ), | |
| 250 | ("v8.3a", Unstable(sym::aarch64_ver_target_feature), &[ | |
| 251 | "v8.2a", "rcpc", "paca", "pacg", "jsconv", | |
| 252 | ]), | |
| 257 | 253 | ("v8.4a", Unstable(sym::aarch64_ver_target_feature), &["v8.3a", "dotprod", "dit", "flagm"]), |
| 258 | 254 | ("v8.5a", Unstable(sym::aarch64_ver_target_feature), &["v8.4a", "ssbs", "sb", "dpb2", "bti"]), |
| 259 | 255 | ("v8.6a", Unstable(sym::aarch64_ver_target_feature), &["v8.5a", "bf16", "i8mm"]), |
compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs+4-4| ... | ... | @@ -51,7 +51,7 @@ use std::path::PathBuf; |
| 51 | 51 | use std::{cmp, fmt, iter}; |
| 52 | 52 | |
| 53 | 53 | use rustc_data_structures::fx::{FxIndexMap, FxIndexSet}; |
| 54 | use rustc_errors::{pluralize, Applicability, Diag, DiagStyledString, IntoDiagArg, StringPart}; | |
| 54 | use rustc_errors::{Applicability, Diag, DiagStyledString, IntoDiagArg, StringPart, pluralize}; | |
| 55 | 55 | use rustc_hir::def::DefKind; |
| 56 | 56 | use rustc_hir::def_id::DefId; |
| 57 | 57 | use rustc_hir::intravisit::Visitor; |
| ... | ... | @@ -61,12 +61,12 @@ use rustc_macros::extension; |
| 61 | 61 | use rustc_middle::bug; |
| 62 | 62 | use rustc_middle::dep_graph::DepContext; |
| 63 | 63 | use rustc_middle::ty::error::{ExpectedFound, TypeError, TypeErrorToStringExt}; |
| 64 | use rustc_middle::ty::print::{with_forced_trimmed_paths, PrintError, PrintTraitRefExt as _}; | |
| 64 | use rustc_middle::ty::print::{PrintError, PrintTraitRefExt as _, with_forced_trimmed_paths}; | |
| 65 | 65 | use rustc_middle::ty::{ |
| 66 | 66 | self, List, Region, Ty, TyCtxt, TypeFoldable, TypeSuperVisitable, TypeVisitable, |
| 67 | 67 | TypeVisitableExt, |
| 68 | 68 | }; |
| 69 | use rustc_span::{sym, BytePos, DesugaringKind, Pos, Span}; | |
| 69 | use rustc_span::{BytePos, DesugaringKind, Pos, Span, sym}; | |
| 70 | 70 | use rustc_target::spec::abi; |
| 71 | 71 | use tracing::{debug, instrument}; |
| 72 | 72 | |
| ... | ... | @@ -203,8 +203,8 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 203 | 203 | fn check_and_note_conflicting_crates(&self, err: &mut Diag<'_>, terr: TypeError<'tcx>) { |
| 204 | 204 | use hir::def_id::CrateNum; |
| 205 | 205 | use rustc_hir::definitions::DisambiguatedDefPathData; |
| 206 | use ty::print::Printer; | |
| 207 | 206 | use ty::GenericArg; |
| 207 | use ty::print::Printer; | |
| 208 | 208 | |
| 209 | 209 | struct AbsolutePathPrinter<'tcx> { |
| 210 | 210 | tcx: TyCtxt<'tcx>, |
compiler/rustc_trait_selection/src/error_reporting/infer/need_type_info.rs+3-3| ... | ... | @@ -6,7 +6,7 @@ use rustc_errors::codes::*; |
| 6 | 6 | use rustc_errors::{Diag, IntoDiagArg}; |
| 7 | 7 | use rustc_hir as hir; |
| 8 | 8 | use rustc_hir::def::{CtorOf, DefKind, Namespace, Res}; |
| 9 | use rustc_hir::def_id::{DefId, LocalDefId, LOCAL_CRATE}; | |
| 9 | use rustc_hir::def_id::{DefId, LOCAL_CRATE, LocalDefId}; | |
| 10 | 10 | use rustc_hir::intravisit::{self, Visitor}; |
| 11 | 11 | use rustc_hir::{Body, Closure, Expr, ExprKind, FnRetTy, HirId, LetStmt, LocalSource}; |
| 12 | 12 | use rustc_middle::bug; |
| ... | ... | @@ -17,8 +17,8 @@ use rustc_middle::ty::{ |
| 17 | 17 | self, GenericArg, GenericArgKind, GenericArgsRef, InferConst, IsSuggestable, Ty, TyCtxt, |
| 18 | 18 | TypeFoldable, TypeFolder, TypeSuperFoldable, TypeckResults, |
| 19 | 19 | }; |
| 20 | use rustc_span::symbol::{sym, Ident}; | |
| 21 | use rustc_span::{BytePos, FileName, Span, DUMMY_SP}; | |
| 20 | use rustc_span::symbol::{Ident, sym}; | |
| 21 | use rustc_span::{BytePos, DUMMY_SP, FileName, Span}; | |
| 22 | 22 | use tracing::{debug, instrument, warn}; |
| 23 | 23 | |
| 24 | 24 | use crate::error_reporting::TypeErrCtxt; |
compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/different_lifetimes.rs+2-2| ... | ... | @@ -2,14 +2,14 @@ |
| 2 | 2 | //! where both the regions are anonymous. |
| 3 | 3 | |
| 4 | 4 | use rustc_errors::{Diag, ErrorGuaranteed, Subdiagnostic}; |
| 5 | use rustc_hir::def_id::LocalDefId; | |
| 6 | 5 | use rustc_hir::Ty; |
| 6 | use rustc_hir::def_id::LocalDefId; | |
| 7 | 7 | use rustc_middle::ty::{Region, TyCtxt}; |
| 8 | 8 | use tracing::debug; |
| 9 | 9 | |
| 10 | use crate::error_reporting::infer::nice_region_error::NiceRegionError; | |
| 10 | 11 | use crate::error_reporting::infer::nice_region_error::find_anon_type::find_anon_type; |
| 11 | 12 | use crate::error_reporting::infer::nice_region_error::util::AnonymousParamInfo; |
| 12 | use crate::error_reporting::infer::nice_region_error::NiceRegionError; | |
| 13 | 13 | use crate::errors::{AddLifetimeParamsSuggestion, LifetimeMismatch, LifetimeMismatchLabels}; |
| 14 | 14 | use crate::infer::{RegionResolutionError, SubregionOrigin}; |
| 15 | 15 |
compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/mismatched_static_lifetime.rs+2-2| ... | ... | @@ -11,8 +11,8 @@ use tracing::debug; |
| 11 | 11 | |
| 12 | 12 | use crate::error_reporting::infer::nice_region_error::NiceRegionError; |
| 13 | 13 | use crate::errors::{ |
| 14 | note_and_explain, DoesNotOutliveStaticFromImpl, ImplicitStaticLifetimeSubdiag, | |
| 15 | IntroducesStaticBecauseUnmetLifetimeReq, MismatchedStaticLifetime, | |
| 14 | DoesNotOutliveStaticFromImpl, ImplicitStaticLifetimeSubdiag, | |
| 15 | IntroducesStaticBecauseUnmetLifetimeReq, MismatchedStaticLifetime, note_and_explain, | |
| 16 | 16 | }; |
| 17 | 17 | use crate::infer::{RegionResolutionError, SubregionOrigin, TypeTrace}; |
| 18 | 18 | use crate::traits::ObligationCauseCode; |
compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/mod.rs+1-1| ... | ... | @@ -19,7 +19,7 @@ mod util; |
| 19 | 19 | |
| 20 | 20 | pub use different_lifetimes::suggest_adding_lifetime_params; |
| 21 | 21 | pub use find_anon_type::find_anon_type; |
| 22 | pub use static_impl_trait::{suggest_new_region_bound, HirTraitObjectVisitor, TraitObjectVisitor}; | |
| 22 | pub use static_impl_trait::{HirTraitObjectVisitor, TraitObjectVisitor, suggest_new_region_bound}; | |
| 23 | 23 | pub use util::find_param_with_region; |
| 24 | 24 | |
| 25 | 25 | impl<'cx, 'tcx> TypeErrCtxt<'cx, 'tcx> { |
compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/named_anon_conflict.rs+1-1| ... | ... | @@ -6,8 +6,8 @@ use rustc_middle::ty; |
| 6 | 6 | use rustc_span::symbol::kw; |
| 7 | 7 | use tracing::debug; |
| 8 | 8 | |
| 9 | use crate::error_reporting::infer::nice_region_error::find_anon_type::find_anon_type; | |
| 10 | 9 | use crate::error_reporting::infer::nice_region_error::NiceRegionError; |
| 10 | use crate::error_reporting::infer::nice_region_error::find_anon_type::find_anon_type; | |
| 11 | 11 | use crate::errors::ExplicitLifetimeRequired; |
| 12 | 12 | |
| 13 | 13 | impl<'a, 'tcx> NiceRegionError<'a, 'tcx> { |
compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/placeholder_error.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ use std::fmt; |
| 3 | 3 | use rustc_data_structures::intern::Interned; |
| 4 | 4 | use rustc_errors::{Diag, IntoDiagArg}; |
| 5 | 5 | use rustc_hir::def::Namespace; |
| 6 | use rustc_hir::def_id::{DefId, CRATE_DEF_ID}; | |
| 6 | use rustc_hir::def_id::{CRATE_DEF_ID, DefId}; | |
| 7 | 7 | use rustc_middle::bug; |
| 8 | 8 | use rustc_middle::ty::error::ExpectedFound; |
| 9 | 9 | use rustc_middle::ty::print::{FmtPrinter, Print, PrintTraitRefExt as _, RegionHighlightMode}; |
compiler/rustc_trait_selection/src/error_reporting/infer/nice_region_error/static_impl_trait.rs+5-8| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | use rustc_data_structures::fx::FxIndexSet; |
| 4 | 4 | use rustc_errors::{Applicability, Diag, ErrorGuaranteed, MultiSpan, Subdiagnostic}; |
| 5 | 5 | use rustc_hir::def_id::DefId; |
| 6 | use rustc_hir::intravisit::{walk_ty, Visitor}; | |
| 6 | use rustc_hir::intravisit::{Visitor, walk_ty}; | |
| 7 | 7 | use rustc_hir::{ |
| 8 | 8 | self as hir, GenericBound, GenericParam, GenericParamKind, Item, ItemKind, Lifetime, |
| 9 | 9 | LifetimeName, LifetimeParamKind, MissingLifetimeKind, Node, TyKind, |
| ... | ... | @@ -11,9 +11,9 @@ use rustc_hir::{ |
| 11 | 11 | use rustc_middle::ty::{ |
| 12 | 12 | self, AssocItemContainer, StaticLifetimeVisitor, Ty, TyCtxt, TypeSuperVisitable, TypeVisitor, |
| 13 | 13 | }; |
| 14 | use rustc_span::Span; | |
| 14 | 15 | use rustc_span::def_id::LocalDefId; |
| 15 | 16 | use rustc_span::symbol::Ident; |
| 16 | use rustc_span::Span; | |
| 17 | 17 | use tracing::debug; |
| 18 | 18 | |
| 19 | 19 | use crate::error_reporting::infer::nice_region_error::NiceRegionError; |
| ... | ... | @@ -329,12 +329,9 @@ pub fn suggest_new_region_bound( |
| 329 | 329 | .params |
| 330 | 330 | .iter() |
| 331 | 331 | .filter(|p| { |
| 332 | matches!( | |
| 333 | p.kind, | |
| 334 | GenericParamKind::Lifetime { | |
| 335 | kind: hir::LifetimeParamKind::Explicit | |
| 336 | } | |
| 337 | ) | |
| 332 | matches!(p.kind, GenericParamKind::Lifetime { | |
| 333 | kind: hir::LifetimeParamKind::Explicit | |
| 334 | }) | |
| 338 | 335 | }) |
| 339 | 336 | .map(|p| { |
| 340 | 337 | if let hir::ParamName::Plain(name) = p.name { |
compiler/rustc_trait_selection/src/error_reporting/infer/note.rs+3-3| ... | ... | @@ -7,10 +7,10 @@ use rustc_span::symbol::kw; |
| 7 | 7 | use tracing::debug; |
| 8 | 8 | |
| 9 | 9 | use super::ObligationCauseAsDiagArg; |
| 10 | use crate::error_reporting::infer::{note_and_explain_region, TypeErrCtxt}; | |
| 10 | use crate::error_reporting::infer::{TypeErrCtxt, note_and_explain_region}; | |
| 11 | 11 | use crate::errors::{ |
| 12 | note_and_explain, FulfillReqLifetime, LfBoundNotSatisfied, OutlivesBound, OutlivesContent, | |
| 13 | RefLongerThanData, RegionOriginNote, WhereClauseSuggestions, | |
| 12 | FulfillReqLifetime, LfBoundNotSatisfied, OutlivesBound, OutlivesContent, RefLongerThanData, | |
| 13 | RegionOriginNote, WhereClauseSuggestions, note_and_explain, | |
| 14 | 14 | }; |
| 15 | 15 | use crate::fluent_generated as fluent; |
| 16 | 16 | use crate::infer::{self, SubregionOrigin}; |
compiler/rustc_trait_selection/src/error_reporting/infer/note_and_explain.rs+3-3| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | 1 | use rustc_errors::Applicability::{MachineApplicable, MaybeIncorrect}; |
| 2 | use rustc_errors::{pluralize, Diag, MultiSpan}; | |
| 2 | use rustc_errors::{Diag, MultiSpan, pluralize}; | |
| 3 | 3 | use rustc_hir as hir; |
| 4 | 4 | use rustc_hir::def::DefKind; |
| 5 | 5 | use rustc_middle::traits::{ObligationCause, ObligationCauseCode}; |
| 6 | 6 | use rustc_middle::ty::error::{ExpectedFound, TypeError}; |
| 7 | 7 | use rustc_middle::ty::fast_reject::DeepRejectCtxt; |
| 8 | 8 | use rustc_middle::ty::print::{FmtPrinter, Printer}; |
| 9 | use rustc_middle::ty::{self, suggest_constraining_type_param, Ty}; | |
| 9 | use rustc_middle::ty::{self, Ty, suggest_constraining_type_param}; | |
| 10 | 10 | use rustc_span::def_id::DefId; |
| 11 | use rustc_span::{sym, BytePos, Span, Symbol}; | |
| 11 | use rustc_span::{BytePos, Span, Symbol, sym}; | |
| 12 | 12 | use tracing::debug; |
| 13 | 13 | |
| 14 | 14 | use crate::error_reporting::TypeErrCtxt; |
compiler/rustc_trait_selection/src/error_reporting/infer/region.rs+5-5| ... | ... | @@ -2,7 +2,7 @@ use std::iter; |
| 2 | 2 | |
| 3 | 3 | use rustc_data_structures::fx::FxIndexSet; |
| 4 | 4 | use rustc_errors::{ |
| 5 | struct_span_code_err, Applicability, Diag, Subdiagnostic, E0309, E0310, E0311, E0495, | |
| 5 | Applicability, Diag, E0309, E0310, E0311, E0495, Subdiagnostic, struct_span_code_err, | |
| 6 | 6 | }; |
| 7 | 7 | use rustc_hir::def::DefKind; |
| 8 | 8 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| ... | ... | @@ -17,13 +17,13 @@ use rustc_span::{BytePos, ErrorGuaranteed, Span, Symbol}; |
| 17 | 17 | use rustc_type_ir::Upcast as _; |
| 18 | 18 | use tracing::{debug, instrument}; |
| 19 | 19 | |
| 20 | use super::nice_region_error::find_anon_type; | |
| 21 | 20 | use super::ObligationCauseAsDiagArg; |
| 22 | use crate::error_reporting::infer::ObligationCauseExt; | |
| 21 | use super::nice_region_error::find_anon_type; | |
| 23 | 22 | use crate::error_reporting::TypeErrCtxt; |
| 23 | use crate::error_reporting::infer::ObligationCauseExt; | |
| 24 | 24 | use crate::errors::{ |
| 25 | self, note_and_explain, FulfillReqLifetime, LfBoundNotSatisfied, OutlivesBound, | |
| 26 | OutlivesContent, RefLongerThanData, RegionOriginNote, WhereClauseSuggestions, | |
| 25 | self, FulfillReqLifetime, LfBoundNotSatisfied, OutlivesBound, OutlivesContent, | |
| 26 | RefLongerThanData, RegionOriginNote, WhereClauseSuggestions, note_and_explain, | |
| 27 | 27 | }; |
| 28 | 28 | use crate::fluent_generated as fluent; |
| 29 | 29 | use crate::infer::region_constraints::GenericKind; |
compiler/rustc_trait_selection/src/error_reporting/infer/suggest.rs+3-3| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use core::ops::ControlFlow; |
| 2 | 2 | |
| 3 | 3 | use hir::def::CtorKind; |
| 4 | use hir::intravisit::{walk_expr, walk_stmt, Visitor}; | |
| 4 | use hir::intravisit::{Visitor, walk_expr, walk_stmt}; | |
| 5 | 5 | use hir::{LetStmt, QPath}; |
| 6 | 6 | use rustc_data_structures::fx::FxIndexSet; |
| 7 | 7 | use rustc_errors::{Applicability, Diag}; |
| ... | ... | @@ -14,11 +14,11 @@ use rustc_middle::traits::{ |
| 14 | 14 | }; |
| 15 | 15 | use rustc_middle::ty::print::with_no_trimmed_paths; |
| 16 | 16 | use rustc_middle::ty::{self as ty, GenericArgKind, IsSuggestable, Ty, TypeVisitableExt}; |
| 17 | use rustc_span::{sym, Span}; | |
| 17 | use rustc_span::{Span, sym}; | |
| 18 | 18 | use tracing::debug; |
| 19 | 19 | |
| 20 | use crate::error_reporting::infer::hir::Path; | |
| 21 | 20 | use crate::error_reporting::TypeErrCtxt; |
| 21 | use crate::error_reporting::infer::hir::Path; | |
| 22 | 22 | use crate::errors::{ |
| 23 | 23 | ConsiderAddingAwait, FnConsiderCasting, FnItemsAreDistinct, FnUniqTypes, |
| 24 | 24 | FunctionPointerSuggestion, SuggestAccessingField, SuggestRemoveSemiOrReturnBinding, |
compiler/rustc_trait_selection/src/error_reporting/traits/ambiguity.rs+6-6| ... | ... | @@ -1,27 +1,27 @@ |
| 1 | 1 | use std::ops::ControlFlow; |
| 2 | 2 | |
| 3 | 3 | use rustc_errors::{ |
| 4 | struct_span_code_err, Applicability, Diag, MultiSpan, StashKey, E0283, E0284, E0790, | |
| 4 | Applicability, Diag, E0283, E0284, E0790, MultiSpan, StashKey, struct_span_code_err, | |
| 5 | 5 | }; |
| 6 | 6 | use rustc_hir as hir; |
| 7 | use rustc_hir::LangItem; | |
| 7 | 8 | use rustc_hir::def::{DefKind, Res}; |
| 8 | 9 | use rustc_hir::def_id::DefId; |
| 9 | 10 | use rustc_hir::intravisit::Visitor as _; |
| 10 | use rustc_hir::LangItem; | |
| 11 | 11 | use rustc_infer::infer::{BoundRegionConversionTime, InferCtxt}; |
| 12 | 12 | use rustc_infer::traits::util::elaborate; |
| 13 | 13 | use rustc_infer::traits::{ |
| 14 | 14 | Obligation, ObligationCause, ObligationCauseCode, PolyTraitObligation, PredicateObligation, |
| 15 | 15 | }; |
| 16 | 16 | use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitable as _, TypeVisitableExt as _}; |
| 17 | use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP}; | |
| 17 | use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span}; | |
| 18 | 18 | use tracing::{debug, instrument}; |
| 19 | 19 | |
| 20 | use crate::error_reporting::infer::need_type_info::TypeAnnotationNeeded; | |
| 21 | use crate::error_reporting::traits::{to_pretty_impl_header, FindExprBySpan}; | |
| 22 | 20 | use crate::error_reporting::TypeErrCtxt; |
| 23 | use crate::traits::query::evaluate_obligation::InferCtxtExt; | |
| 21 | use crate::error_reporting::infer::need_type_info::TypeAnnotationNeeded; | |
| 22 | use crate::error_reporting::traits::{FindExprBySpan, to_pretty_impl_header}; | |
| 24 | 23 | use crate::traits::ObligationCtxt; |
| 24 | use crate::traits::query::evaluate_obligation::InferCtxtExt; | |
| 25 | 25 | |
| 26 | 26 | #[derive(Debug)] |
| 27 | 27 | pub enum CandidateSource { |
compiler/rustc_trait_selection/src/error_reporting/traits/fulfillment_errors.rs+31-35| ... | ... | @@ -5,29 +5,29 @@ use rustc_data_structures::fx::FxHashMap; |
| 5 | 5 | use rustc_data_structures::unord::UnordSet; |
| 6 | 6 | use rustc_errors::codes::*; |
| 7 | 7 | use rustc_errors::{ |
| 8 | pluralize, struct_span_code_err, Applicability, Diag, ErrorGuaranteed, MultiSpan, StashKey, | |
| 9 | StringPart, Suggestions, | |
| 8 | Applicability, Diag, ErrorGuaranteed, MultiSpan, StashKey, StringPart, Suggestions, pluralize, | |
| 9 | struct_span_code_err, | |
| 10 | 10 | }; |
| 11 | 11 | use rustc_hir::def::Namespace; |
| 12 | use rustc_hir::def_id::{DefId, LocalDefId, LOCAL_CRATE}; | |
| 12 | use rustc_hir::def_id::{DefId, LOCAL_CRATE, LocalDefId}; | |
| 13 | 13 | use rustc_hir::intravisit::Visitor; |
| 14 | 14 | use rustc_hir::{self as hir, LangItem, Node}; |
| 15 | 15 | use rustc_infer::infer::{InferOk, TypeTrace}; |
| 16 | use rustc_middle::traits::select::OverflowError; | |
| 17 | 16 | use rustc_middle::traits::SignatureMismatchData; |
| 17 | use rustc_middle::traits::select::OverflowError; | |
| 18 | 18 | use rustc_middle::ty::abstract_const::NotConstEvaluatable; |
| 19 | 19 | use rustc_middle::ty::error::{ExpectedFound, TypeError}; |
| 20 | 20 | use rustc_middle::ty::fold::{BottomUpFolder, TypeFolder, TypeSuperFoldable}; |
| 21 | 21 | use rustc_middle::ty::print::{ |
| 22 | with_forced_trimmed_paths, FmtPrinter, Print, PrintTraitPredicateExt as _, | |
| 23 | PrintTraitRefExt as _, | |
| 22 | FmtPrinter, Print, PrintTraitPredicateExt as _, PrintTraitRefExt as _, | |
| 23 | with_forced_trimmed_paths, | |
| 24 | 24 | }; |
| 25 | 25 | use rustc_middle::ty::{ |
| 26 | 26 | self, ToPolyTraitRef, TraitRef, Ty, TyCtxt, TypeFoldable, TypeVisitableExt, Upcast, |
| 27 | 27 | }; |
| 28 | 28 | use rustc_middle::{bug, span_bug}; |
| 29 | 29 | use rustc_span::symbol::sym; |
| 30 | use rustc_span::{BytePos, Span, Symbol, DUMMY_SP}; | |
| 30 | use rustc_span::{BytePos, DUMMY_SP, Span, Symbol}; | |
| 31 | 31 | use tracing::{debug, instrument}; |
| 32 | 32 | |
| 33 | 33 | use super::on_unimplemented::{AppendConstMessage, OnUnimplementedNote}; |
| ... | ... | @@ -35,18 +35,18 @@ use super::suggestions::get_explanation_based_on_obligation; |
| 35 | 35 | use super::{ |
| 36 | 36 | ArgKind, CandidateSimilarity, GetSafeTransmuteErrorAndReason, ImplCandidate, UnsatisfiedConst, |
| 37 | 37 | }; |
| 38 | use crate::error_reporting::TypeErrCtxt; | |
| 38 | 39 | use crate::error_reporting::infer::TyCategory; |
| 39 | 40 | use crate::error_reporting::traits::report_object_safety_error; |
| 40 | use crate::error_reporting::TypeErrCtxt; | |
| 41 | 41 | use crate::errors::{ |
| 42 | 42 | AsyncClosureNotFn, ClosureFnMutLabel, ClosureFnOnceLabel, ClosureKindMismatch, |
| 43 | 43 | }; |
| 44 | 44 | use crate::infer::{self, InferCtxt, InferCtxtExt as _}; |
| 45 | 45 | use crate::traits::query::evaluate_obligation::InferCtxtExt as _; |
| 46 | 46 | use crate::traits::{ |
| 47 | elaborate, MismatchedProjectionTypes, NormalizeExt, Obligation, ObligationCause, | |
| 48 | ObligationCauseCode, ObligationCtxt, Overflow, PredicateObligation, SelectionError, | |
| 49 | SignatureMismatch, TraitNotObjectSafe, | |
| 47 | MismatchedProjectionTypes, NormalizeExt, Obligation, ObligationCause, ObligationCauseCode, | |
| 48 | ObligationCtxt, Overflow, PredicateObligation, SelectionError, SignatureMismatch, | |
| 49 | TraitNotObjectSafe, elaborate, | |
| 50 | 50 | }; |
| 51 | 51 | |
| 52 | 52 | impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| ... | ... | @@ -1688,16 +1688,13 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 1688 | 1688 | for (sp, label) in spans.into_iter() { |
| 1689 | 1689 | span.push_span_label(sp, label); |
| 1690 | 1690 | } |
| 1691 | err.highlighted_span_help( | |
| 1692 | span, | |
| 1693 | vec![ | |
| 1694 | StringPart::normal("there are ".to_string()), | |
| 1695 | StringPart::highlighted("multiple different versions".to_string()), | |
| 1696 | StringPart::normal(" of crate `".to_string()), | |
| 1697 | StringPart::highlighted(format!("{name}")), | |
| 1698 | StringPart::normal("` in the dependency graph".to_string()), | |
| 1699 | ], | |
| 1700 | ); | |
| 1691 | err.highlighted_span_help(span, vec![ | |
| 1692 | StringPart::normal("there are ".to_string()), | |
| 1693 | StringPart::highlighted("multiple different versions".to_string()), | |
| 1694 | StringPart::normal(" of crate `".to_string()), | |
| 1695 | StringPart::highlighted(format!("{name}")), | |
| 1696 | StringPart::normal("` in the dependency graph".to_string()), | |
| 1697 | ]); | |
| 1701 | 1698 | let candidates = if impl_candidates.is_empty() { |
| 1702 | 1699 | alternative_candidates(trait_def_id) |
| 1703 | 1700 | } else { |
| ... | ... | @@ -1724,17 +1721,14 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 1724 | 1721 | span.push_span_label(self.tcx.def_span(trait_def_id), "this is the required trait"); |
| 1725 | 1722 | span.push_span_label(sp_candidate, "this type implements the required trait"); |
| 1726 | 1723 | span.push_span_label(sp_found, "this type doesn't implement the required trait"); |
| 1727 | err.highlighted_span_note( | |
| 1728 | span, | |
| 1729 | vec![ | |
| 1730 | StringPart::normal( | |
| 1731 | "two types coming from two different versions of the same crate are \ | |
| 1724 | err.highlighted_span_note(span, vec![ | |
| 1725 | StringPart::normal( | |
| 1726 | "two types coming from two different versions of the same crate are \ | |
| 1732 | 1727 | different types " |
| 1733 | .to_string(), | |
| 1734 | ), | |
| 1735 | StringPart::highlighted("even if they look the same".to_string()), | |
| 1736 | ], | |
| 1737 | ); | |
| 1728 | .to_string(), | |
| 1729 | ), | |
| 1730 | StringPart::highlighted("even if they look the same".to_string()), | |
| 1731 | ]); | |
| 1738 | 1732 | } |
| 1739 | 1733 | err.help("you can use `cargo tree` to explore your dependency tree"); |
| 1740 | 1734 | return true; |
| ... | ... | @@ -2742,10 +2736,12 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 2742 | 2736 | .inputs |
| 2743 | 2737 | .iter() |
| 2744 | 2738 | .map(|arg| match arg.kind { |
| 2745 | hir::TyKind::Tup(tys) => ArgKind::Tuple( | |
| 2746 | Some(arg.span), | |
| 2747 | vec![("_".to_owned(), "_".to_owned()); tys.len()], | |
| 2748 | ), | |
| 2739 | hir::TyKind::Tup(tys) => { | |
| 2740 | ArgKind::Tuple(Some(arg.span), vec![ | |
| 2741 | ("_".to_owned(), "_".to_owned()); | |
| 2742 | tys.len() | |
| 2743 | ]) | |
| 2744 | } | |
| 2749 | 2745 | _ => ArgKind::empty(), |
| 2750 | 2746 | }) |
| 2751 | 2747 | .collect::<Vec<ArgKind>>(), |
compiler/rustc_trait_selection/src/error_reporting/traits/mod.rs+2-2| ... | ... | @@ -7,7 +7,7 @@ pub mod suggestions; |
| 7 | 7 | use std::{fmt, iter}; |
| 8 | 8 | |
| 9 | 9 | use rustc_data_structures::fx::{FxIndexMap, FxIndexSet}; |
| 10 | use rustc_errors::{struct_span_code_err, Applicability, Diag, MultiSpan, E0038, E0276}; | |
| 10 | use rustc_errors::{Applicability, Diag, E0038, E0276, MultiSpan, struct_span_code_err}; | |
| 11 | 11 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| 12 | 12 | use rustc_hir::intravisit::Visitor; |
| 13 | 13 | use rustc_hir::{self as hir, LangItem}; |
| ... | ... | @@ -15,7 +15,7 @@ use rustc_infer::traits::{ |
| 15 | 15 | ObjectSafetyViolation, Obligation, ObligationCause, ObligationCauseCode, PredicateObligation, |
| 16 | 16 | SelectionError, |
| 17 | 17 | }; |
| 18 | use rustc_middle::ty::print::{with_no_trimmed_paths, PrintTraitRefExt as _}; | |
| 18 | use rustc_middle::ty::print::{PrintTraitRefExt as _, with_no_trimmed_paths}; | |
| 19 | 19 | use rustc_middle::ty::{self, Ty, TyCtxt}; |
| 20 | 20 | use rustc_span::{ErrorGuaranteed, ExpnKind, Span}; |
| 21 | 21 | use tracing::{info, instrument}; |
compiler/rustc_trait_selection/src/error_reporting/traits/on_unimplemented.rs+2-2| ... | ... | @@ -4,7 +4,7 @@ use std::path::PathBuf; |
| 4 | 4 | use rustc_ast::{AttrArgs, AttrArgsEq, AttrKind, Attribute, MetaItem, NestedMetaItem}; |
| 5 | 5 | use rustc_data_structures::fx::FxHashMap; |
| 6 | 6 | use rustc_errors::codes::*; |
| 7 | use rustc_errors::{struct_span_code_err, ErrorGuaranteed}; | |
| 7 | use rustc_errors::{ErrorGuaranteed, struct_span_code_err}; | |
| 8 | 8 | use rustc_hir::def_id::{DefId, LocalDefId}; |
| 9 | 9 | use rustc_macros::LintDiagnostic; |
| 10 | 10 | use rustc_middle::bug; |
| ... | ... | @@ -12,8 +12,8 @@ use rustc_middle::ty::print::PrintTraitRefExt as _; |
| 12 | 12 | use rustc_middle::ty::{self, GenericArgsRef, GenericParamDefKind, TyCtxt}; |
| 13 | 13 | use rustc_parse_format::{ParseMode, Parser, Piece, Position}; |
| 14 | 14 | use rustc_session::lint::builtin::UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES; |
| 15 | use rustc_span::symbol::{kw, sym, Symbol}; | |
| 16 | 15 | use rustc_span::Span; |
| 16 | use rustc_span::symbol::{Symbol, kw, sym}; | |
| 17 | 17 | use tracing::{debug, info}; |
| 18 | 18 | use {rustc_attr as attr, rustc_hir as hir}; |
| 19 | 19 |
compiler/rustc_trait_selection/src/error_reporting/traits/overflow.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use std::fmt; |
| 2 | 2 | |
| 3 | 3 | use rustc_errors::{ |
| 4 | struct_span_code_err, Diag, EmissionGuarantee, ErrorGuaranteed, FatalError, E0275, | |
| 4 | Diag, E0275, EmissionGuarantee, ErrorGuaranteed, FatalError, struct_span_code_err, | |
| 5 | 5 | }; |
| 6 | 6 | use rustc_hir::def::Namespace; |
| 7 | 7 | use rustc_hir::def_id::LOCAL_CRATE; |
compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs+18-19| ... | ... | @@ -9,8 +9,8 @@ use rustc_data_structures::fx::FxHashSet; |
| 9 | 9 | use rustc_data_structures::stack::ensure_sufficient_stack; |
| 10 | 10 | use rustc_errors::codes::*; |
| 11 | 11 | use rustc_errors::{ |
| 12 | pluralize, struct_span_code_err, Applicability, Diag, EmissionGuarantee, MultiSpan, Style, | |
| 13 | SuggestionStyle, | |
| 12 | Applicability, Diag, EmissionGuarantee, MultiSpan, Style, SuggestionStyle, pluralize, | |
| 13 | struct_span_code_err, | |
| 14 | 14 | }; |
| 15 | 15 | use rustc_hir as hir; |
| 16 | 16 | use rustc_hir::def::{CtorOf, DefKind, Res}; |
| ... | ... | @@ -18,25 +18,25 @@ use rustc_hir::def_id::DefId; |
| 18 | 18 | use rustc_hir::intravisit::Visitor; |
| 19 | 19 | use rustc_hir::lang_items::LangItem; |
| 20 | 20 | use rustc_hir::{ |
| 21 | is_range_literal, CoroutineDesugaring, CoroutineKind, CoroutineSource, Expr, HirId, Node, | |
| 21 | CoroutineDesugaring, CoroutineKind, CoroutineSource, Expr, HirId, Node, is_range_literal, | |
| 22 | 22 | }; |
| 23 | 23 | use rustc_infer::infer::{BoundRegionConversionTime, DefineOpaqueTypes, InferCtxt, InferOk}; |
| 24 | 24 | use rustc_middle::hir::map; |
| 25 | 25 | use rustc_middle::traits::IsConstable; |
| 26 | 26 | use rustc_middle::ty::error::TypeError; |
| 27 | 27 | use rustc_middle::ty::print::{ |
| 28 | with_forced_trimmed_paths, with_no_trimmed_paths, PrintPolyTraitPredicateExt as _, | |
| 29 | PrintPolyTraitRefExt, PrintTraitPredicateExt as _, | |
| 28 | PrintPolyTraitPredicateExt as _, PrintPolyTraitRefExt, PrintTraitPredicateExt as _, | |
| 29 | with_forced_trimmed_paths, with_no_trimmed_paths, | |
| 30 | 30 | }; |
| 31 | 31 | use rustc_middle::ty::{ |
| 32 | self, suggest_arbitrary_trait_bound, suggest_constraining_type_param, AdtKind, GenericArgs, | |
| 33 | InferTy, IsSuggestable, ToPolyTraitRef, Ty, TyCtxt, TypeFoldable, TypeFolder, | |
| 34 | TypeSuperFoldable, TypeVisitableExt, TypeckResults, Upcast, | |
| 32 | self, AdtKind, GenericArgs, InferTy, IsSuggestable, ToPolyTraitRef, Ty, TyCtxt, TypeFoldable, | |
| 33 | TypeFolder, TypeSuperFoldable, TypeVisitableExt, TypeckResults, Upcast, | |
| 34 | suggest_arbitrary_trait_bound, suggest_constraining_type_param, | |
| 35 | 35 | }; |
| 36 | 36 | use rustc_middle::{bug, span_bug}; |
| 37 | 37 | use rustc_span::def_id::LocalDefId; |
| 38 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 39 | use rustc_span::{BytePos, DesugaringKind, ExpnKind, MacroKind, Span, DUMMY_SP}; | |
| 38 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 39 | use rustc_span::{BytePos, DUMMY_SP, DesugaringKind, ExpnKind, MacroKind, Span}; | |
| 40 | 40 | use rustc_target::spec::abi; |
| 41 | 41 | use tracing::{debug, instrument}; |
| 42 | 42 | |
| ... | ... | @@ -668,10 +668,10 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 668 | 668 | } |
| 669 | 669 | // Empty suggestions with empty spans ICE with debug assertions |
| 670 | 670 | if steps == 0 { |
| 671 | return ( | |
| 672 | msg.trim_end_matches(" and dereferencing instead"), | |
| 673 | vec![(prefix_span, String::new())], | |
| 674 | ); | |
| 671 | return (msg.trim_end_matches(" and dereferencing instead"), vec![( | |
| 672 | prefix_span, | |
| 673 | String::new(), | |
| 674 | )]); | |
| 675 | 675 | } |
| 676 | 676 | let derefs = "*".repeat(steps); |
| 677 | 677 | let needs_parens = steps > 0 |
| ... | ... | @@ -3553,11 +3553,10 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { |
| 3553 | 3553 | } |
| 3554 | 3554 | ObligationCauseCode::TrivialBound => { |
| 3555 | 3555 | err.help("see issue #48214"); |
| 3556 | tcx.disabled_nightly_features( | |
| 3557 | err, | |
| 3558 | Some(tcx.local_def_id_to_hir_id(body_id)), | |
| 3559 | [(String::new(), sym::trivial_bounds)], | |
| 3560 | ); | |
| 3556 | tcx.disabled_nightly_features(err, Some(tcx.local_def_id_to_hir_id(body_id)), [( | |
| 3557 | String::new(), | |
| 3558 | sym::trivial_bounds, | |
| 3559 | )]); | |
| 3561 | 3560 | } |
| 3562 | 3561 | ObligationCauseCode::OpaqueReturnType(expr_info) => { |
| 3563 | 3562 | if let Some((expr_ty, hir_id)) = expr_info { |
compiler/rustc_trait_selection/src/errors.rs+3-3| ... | ... | @@ -8,17 +8,17 @@ use rustc_errors::{ |
| 8 | 8 | }; |
| 9 | 9 | use rustc_hir as hir; |
| 10 | 10 | use rustc_hir::def_id::LocalDefId; |
| 11 | use rustc_hir::intravisit::{walk_ty, Visitor}; | |
| 11 | use rustc_hir::intravisit::{Visitor, walk_ty}; | |
| 12 | 12 | use rustc_hir::{FnRetTy, GenericParamKind}; |
| 13 | 13 | use rustc_macros::{Diagnostic, Subdiagnostic}; |
| 14 | 14 | use rustc_middle::ty::print::{PrintTraitRefExt as _, TraitRefPrintOnlyTraitPath}; |
| 15 | 15 | use rustc_middle::ty::{self, Binder, ClosureKind, FnSig, PolyTraitRef, Region, Ty, TyCtxt}; |
| 16 | use rustc_span::symbol::{kw, Ident, Symbol}; | |
| 16 | use rustc_span::symbol::{Ident, Symbol, kw}; | |
| 17 | 17 | use rustc_span::{BytePos, Span}; |
| 18 | 18 | |
| 19 | use crate::error_reporting::infer::ObligationCauseAsDiagArg; | |
| 19 | 20 | use crate::error_reporting::infer::need_type_info::UnderspecifiedArgKind; |
| 20 | 21 | use crate::error_reporting::infer::nice_region_error::placeholder_error::Highlighted; |
| 21 | use crate::error_reporting::infer::ObligationCauseAsDiagArg; | |
| 22 | 22 | use crate::fluent_generated as fluent; |
| 23 | 23 | |
| 24 | 24 | pub mod note_and_explain; |
compiler/rustc_trait_selection/src/errors/note_and_explain.rs+1-1| ... | ... | @@ -2,8 +2,8 @@ use rustc_errors::{Diag, EmissionGuarantee, IntoDiagArg, SubdiagMessageOp, Subdi |
| 2 | 2 | use rustc_hir::def_id::LocalDefId; |
| 3 | 3 | use rustc_middle::bug; |
| 4 | 4 | use rustc_middle::ty::{self, TyCtxt}; |
| 5 | use rustc_span::symbol::kw; | |
| 6 | 5 | use rustc_span::Span; |
| 6 | use rustc_span::symbol::kw; | |
| 7 | 7 | |
| 8 | 8 | use crate::error_reporting::infer::nice_region_error::find_anon_type; |
| 9 | 9 | use crate::fluent_generated as fluent; |
compiler/rustc_trait_selection/src/regions.rs+1-1| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use rustc_infer::infer::outlives::env::OutlivesEnvironment; |
| 2 | 2 | use rustc_infer::infer::{InferCtxt, RegionResolutionError}; |
| 3 | 3 | use rustc_macros::extension; |
| 4 | use rustc_middle::traits::query::NoSolution; | |
| 5 | 4 | use rustc_middle::traits::ObligationCause; |
| 5 | use rustc_middle::traits::query::NoSolution; | |
| 6 | 6 | |
| 7 | 7 | use crate::traits::ScrubbedTraitError; |
| 8 | 8 |
compiler/rustc_trait_selection/src/solve/delegate.rs+5-5| ... | ... | @@ -11,7 +11,7 @@ use rustc_infer::traits::solve::Goal; |
| 11 | 11 | use rustc_infer::traits::{ObligationCause, Reveal}; |
| 12 | 12 | use rustc_middle::ty::fold::TypeFoldable; |
| 13 | 13 | use rustc_middle::ty::{self, Ty, TyCtxt, TypeVisitableExt as _}; |
| 14 | use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP}; | |
| 14 | use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span}; | |
| 15 | 15 | use rustc_type_ir::solve::{Certainty, NoSolution, SolverMode}; |
| 16 | 16 | use tracing::trace; |
| 17 | 17 | |
| ... | ... | @@ -182,10 +182,10 @@ impl<'tcx> rustc_next_trait_solver::delegate::SolverDelegate for SolverDelegate< |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | fn inject_new_hidden_type_unchecked(&self, key: ty::OpaqueTypeKey<'tcx>, hidden_ty: Ty<'tcx>) { |
| 185 | self.0.inject_new_hidden_type_unchecked( | |
| 186 | key, | |
| 187 | ty::OpaqueHiddenType { ty: hidden_ty, span: DUMMY_SP }, | |
| 188 | ) | |
| 185 | self.0.inject_new_hidden_type_unchecked(key, ty::OpaqueHiddenType { | |
| 186 | ty: hidden_ty, | |
| 187 | span: DUMMY_SP, | |
| 188 | }) | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | fn reset_opaque_types(&self) { |
compiler/rustc_trait_selection/src/solve/fulfill.rs+5-5| ... | ... | @@ -15,9 +15,9 @@ use rustc_middle::ty::{self, TyCtxt}; |
| 15 | 15 | use rustc_next_trait_solver::solve::{GenerateProofTree, SolverDelegateEvalExt as _}; |
| 16 | 16 | use tracing::instrument; |
| 17 | 17 | |
| 18 | use super::Certainty; | |
| 18 | 19 | use super::delegate::SolverDelegate; |
| 19 | 20 | use super::inspect::{self, ProofTreeInferCtxtExt, ProofTreeVisitor}; |
| 20 | use super::Certainty; | |
| 21 | 21 | use crate::traits::{FulfillmentError, FulfillmentErrorCode, ScrubbedTraitError}; |
| 22 | 22 | |
| 23 | 23 | /// A trait engine using the new trait solver. |
| ... | ... | @@ -347,10 +347,10 @@ fn find_best_leaf_obligation<'tcx>( |
| 347 | 347 | ) -> PredicateObligation<'tcx> { |
| 348 | 348 | let obligation = infcx.resolve_vars_if_possible(obligation.clone()); |
| 349 | 349 | infcx |
| 350 | .visit_proof_tree( | |
| 351 | obligation.clone().into(), | |
| 352 | &mut BestObligation { obligation: obligation.clone(), consider_ambiguities }, | |
| 353 | ) | |
| 350 | .visit_proof_tree(obligation.clone().into(), &mut BestObligation { | |
| 351 | obligation: obligation.clone(), | |
| 352 | consider_ambiguities, | |
| 353 | }) | |
| 354 | 354 | .break_value() |
| 355 | 355 | .unwrap_or(obligation) |
| 356 | 356 | } |
compiler/rustc_trait_selection/src/solve/inspect/analyse.rs+2-2| ... | ... | @@ -15,14 +15,14 @@ use rustc_ast_ir::try_visit; |
| 15 | 15 | use rustc_ast_ir::visit::VisitorResult; |
| 16 | 16 | use rustc_infer::infer::{DefineOpaqueTypes, InferCtxt, InferOk}; |
| 17 | 17 | use rustc_macros::extension; |
| 18 | use rustc_middle::traits::solve::{Certainty, Goal, GoalSource, NoSolution, QueryResult}; | |
| 19 | 18 | use rustc_middle::traits::ObligationCause; |
| 19 | use rustc_middle::traits::solve::{Certainty, Goal, GoalSource, NoSolution, QueryResult}; | |
| 20 | 20 | use rustc_middle::ty::{TyCtxt, TypeFoldable}; |
| 21 | 21 | use rustc_middle::{bug, ty}; |
| 22 | 22 | use rustc_next_trait_solver::resolve::EagerResolver; |
| 23 | 23 | use rustc_next_trait_solver::solve::inspect::{self, instantiate_canonical_state}; |
| 24 | 24 | use rustc_next_trait_solver::solve::{GenerateProofTree, MaybeCause, SolverDelegateEvalExt as _}; |
| 25 | use rustc_span::{Span, DUMMY_SP}; | |
| 25 | use rustc_span::{DUMMY_SP, Span}; | |
| 26 | 26 | use tracing::instrument; |
| 27 | 27 | |
| 28 | 28 | use crate::solve::delegate::SolverDelegate; |
compiler/rustc_trait_selection/src/solve/normalize.rs+17-18| ... | ... | @@ -3,8 +3,8 @@ use std::fmt::Debug; |
| 3 | 3 | use std::marker::PhantomData; |
| 4 | 4 | |
| 5 | 5 | use rustc_data_structures::stack::ensure_sufficient_stack; |
| 6 | use rustc_infer::infer::at::At; | |
| 7 | 6 | use rustc_infer::infer::InferCtxt; |
| 7 | use rustc_infer::infer::at::At; | |
| 8 | 8 | use rustc_infer::traits::{FromSolverError, Obligation, TraitEngine}; |
| 9 | 9 | use rustc_middle::traits::ObligationCause; |
| 10 | 10 | use rustc_middle::ty::{ |
| ... | ... | @@ -14,8 +14,8 @@ use rustc_middle::ty::{ |
| 14 | 14 | use tracing::instrument; |
| 15 | 15 | |
| 16 | 16 | use super::{FulfillmentCtxt, NextSolverError}; |
| 17 | use crate::error_reporting::traits::OverflowCause; | |
| 18 | 17 | use crate::error_reporting::InferCtxtErrorExt; |
| 18 | use crate::error_reporting::traits::OverflowCause; | |
| 19 | 19 | use crate::traits::query::evaluate_obligation::InferCtxtExt; |
| 20 | 20 | use crate::traits::{BoundVarReplacer, PlaceholderReplacer, ScrubbedTraitError}; |
| 21 | 21 | |
| ... | ... | @@ -130,12 +130,11 @@ where |
| 130 | 130 | self.depth += 1; |
| 131 | 131 | |
| 132 | 132 | let new_infer_ct = infcx.next_const_var(self.at.cause.span); |
| 133 | let obligation = Obligation::new( | |
| 134 | tcx, | |
| 135 | self.at.cause.clone(), | |
| 136 | self.at.param_env, | |
| 137 | ty::NormalizesTo { alias: uv.into(), term: new_infer_ct.into() }, | |
| 138 | ); | |
| 133 | let obligation = | |
| 134 | Obligation::new(tcx, self.at.cause.clone(), self.at.param_env, ty::NormalizesTo { | |
| 135 | alias: uv.into(), | |
| 136 | term: new_infer_ct.into(), | |
| 137 | }); | |
| 139 | 138 | |
| 140 | 139 | let result = if infcx.predicate_may_hold(&obligation) { |
| 141 | 140 | self.fulfill_cx.register_predicate_obligation(infcx, obligation); |
| ... | ... | @@ -253,20 +252,20 @@ impl<'tcx> TypeFolder<TyCtxt<'tcx>> for DeeplyNormalizeForDiagnosticsFolder<'_, |
| 253 | 252 | } |
| 254 | 253 | |
| 255 | 254 | fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> { |
| 256 | deeply_normalize_with_skipped_universes( | |
| 257 | self.at, | |
| 258 | ty, | |
| 259 | vec![None; ty.outer_exclusive_binder().as_usize()], | |
| 260 | ) | |
| 255 | deeply_normalize_with_skipped_universes(self.at, ty, vec![ | |
| 256 | None; | |
| 257 | ty.outer_exclusive_binder() | |
| 258 | .as_usize() | |
| 259 | ]) | |
| 261 | 260 | .unwrap_or_else(|_: Vec<ScrubbedTraitError<'tcx>>| ty.super_fold_with(self)) |
| 262 | 261 | } |
| 263 | 262 | |
| 264 | 263 | fn fold_const(&mut self, ct: ty::Const<'tcx>) -> ty::Const<'tcx> { |
| 265 | deeply_normalize_with_skipped_universes( | |
| 266 | self.at, | |
| 267 | ct, | |
| 268 | vec![None; ct.outer_exclusive_binder().as_usize()], | |
| 269 | ) | |
| 264 | deeply_normalize_with_skipped_universes(self.at, ct, vec![ | |
| 265 | None; | |
| 266 | ct.outer_exclusive_binder() | |
| 267 | .as_usize() | |
| 268 | ]) | |
| 270 | 269 | .unwrap_or_else(|_: Vec<ScrubbedTraitError<'tcx>>| ct.super_fold_with(self)) |
| 271 | 270 | } |
| 272 | 271 | } |
compiler/rustc_trait_selection/src/traits/coherence.rs+23-30| ... | ... | @@ -20,20 +20,20 @@ use rustc_middle::ty::visit::{TypeSuperVisitable, TypeVisitable, TypeVisitableEx |
| 20 | 20 | use rustc_middle::ty::{self, Ty, TyCtxt}; |
| 21 | 21 | pub use rustc_next_trait_solver::coherence::*; |
| 22 | 22 | use rustc_span::symbol::sym; |
| 23 | use rustc_span::{Span, DUMMY_SP}; | |
| 23 | use rustc_span::{DUMMY_SP, Span}; | |
| 24 | 24 | use tracing::{debug, instrument, warn}; |
| 25 | 25 | |
| 26 | 26 | use super::ObligationCtxt; |
| 27 | 27 | use crate::error_reporting::traits::suggest_new_overflow_limit; |
| 28 | use crate::infer::outlives::env::OutlivesEnvironment; | |
| 29 | 28 | use crate::infer::InferOk; |
| 29 | use crate::infer::outlives::env::OutlivesEnvironment; | |
| 30 | 30 | use crate::solve::inspect::{InspectGoal, ProofTreeInferCtxtExt, ProofTreeVisitor}; |
| 31 | 31 | use crate::solve::{deeply_normalize_for_diagnostics, inspect}; |
| 32 | 32 | use crate::traits::query::evaluate_obligation::InferCtxtExt; |
| 33 | 33 | use crate::traits::select::IntercrateAmbiguityCause; |
| 34 | 34 | use crate::traits::{ |
| 35 | util, FulfillmentErrorCode, NormalizeExt, Obligation, ObligationCause, PredicateObligation, | |
| 36 | SelectionContext, SkipLeakCheck, | |
| 35 | FulfillmentErrorCode, NormalizeExt, Obligation, ObligationCause, PredicateObligation, | |
| 36 | SelectionContext, SkipLeakCheck, util, | |
| 37 | 37 | }; |
| 38 | 38 | |
| 39 | 39 | pub struct OverlapResult<'tcx> { |
| ... | ... | @@ -346,10 +346,9 @@ fn impl_intersection_has_impossible_obligation<'a, 'cx, 'tcx>( |
| 346 | 346 | overflowing_predicates: ambiguities |
| 347 | 347 | .into_iter() |
| 348 | 348 | .filter(|error| { |
| 349 | matches!( | |
| 350 | error.code, | |
| 351 | FulfillmentErrorCode::Ambiguity { overflow: Some(true) } | |
| 352 | ) | |
| 349 | matches!(error.code, FulfillmentErrorCode::Ambiguity { | |
| 350 | overflow: Some(true) | |
| 351 | }) | |
| 353 | 352 | }) |
| 354 | 353 | .map(|e| infcx.resolve_vars_if_possible(e.obligation.predicate)) |
| 355 | 354 | .collect(), |
| ... | ... | @@ -470,16 +469,13 @@ fn plug_infer_with_placeholders<'tcx>( |
| 470 | 469 | // Comparing against a type variable never registers hidden types anyway |
| 471 | 470 | DefineOpaqueTypes::Yes, |
| 472 | 471 | ty, |
| 473 | Ty::new_placeholder( | |
| 474 | self.infcx.tcx, | |
| 475 | ty::Placeholder { | |
| 476 | universe: self.universe, | |
| 477 | bound: ty::BoundTy { | |
| 478 | var: self.next_var(), | |
| 479 | kind: ty::BoundTyKind::Anon, | |
| 480 | }, | |
| 472 | Ty::new_placeholder(self.infcx.tcx, ty::Placeholder { | |
| 473 | universe: self.universe, | |
| 474 | bound: ty::BoundTy { | |
| 475 | var: self.next_var(), | |
| 476 | kind: ty::BoundTyKind::Anon, | |
| 481 | 477 | }, |
| 482 | ), | |
| 478 | }), | |
| 483 | 479 | ) |
| 484 | 480 | else { |
| 485 | 481 | bug!("we always expect to be able to plug an infer var with placeholder") |
| ... | ... | @@ -499,10 +495,10 @@ fn plug_infer_with_placeholders<'tcx>( |
| 499 | 495 | // registration happening anyway. |
| 500 | 496 | DefineOpaqueTypes::Yes, |
| 501 | 497 | ct, |
| 502 | ty::Const::new_placeholder( | |
| 503 | self.infcx.tcx, | |
| 504 | ty::Placeholder { universe: self.universe, bound: self.next_var() }, | |
| 505 | ), | |
| 498 | ty::Const::new_placeholder(self.infcx.tcx, ty::Placeholder { | |
| 499 | universe: self.universe, | |
| 500 | bound: self.next_var(), | |
| 501 | }), | |
| 506 | 502 | ) |
| 507 | 503 | else { |
| 508 | 504 | bug!("we always expect to be able to plug an infer var with placeholder") |
| ... | ... | @@ -527,16 +523,13 @@ fn plug_infer_with_placeholders<'tcx>( |
| 527 | 523 | // Lifetimes don't contain opaque types (or any types for that matter). |
| 528 | 524 | DefineOpaqueTypes::Yes, |
| 529 | 525 | r, |
| 530 | ty::Region::new_placeholder( | |
| 531 | self.infcx.tcx, | |
| 532 | ty::Placeholder { | |
| 533 | universe: self.universe, | |
| 534 | bound: ty::BoundRegion { | |
| 535 | var: self.next_var(), | |
| 536 | kind: ty::BoundRegionKind::BrAnon, | |
| 537 | }, | |
| 526 | ty::Region::new_placeholder(self.infcx.tcx, ty::Placeholder { | |
| 527 | universe: self.universe, | |
| 528 | bound: ty::BoundRegion { | |
| 529 | var: self.next_var(), | |
| 530 | kind: ty::BoundRegionKind::BrAnon, | |
| 538 | 531 | }, |
| 539 | ), | |
| 532 | }), | |
| 540 | 533 | ) |
| 541 | 534 | else { |
| 542 | 535 | bug!("we always expect to be able to plug an infer var with placeholder") |
compiler/rustc_trait_selection/src/traits/const_evaluatable.rs+1-1| ... | ... | @@ -16,7 +16,7 @@ use rustc_middle::mir::interpret::ErrorHandled; |
| 16 | 16 | use rustc_middle::traits::ObligationCause; |
| 17 | 17 | use rustc_middle::ty::abstract_const::NotConstEvaluatable; |
| 18 | 18 | use rustc_middle::ty::{self, TyCtxt, TypeVisitable, TypeVisitableExt, TypeVisitor}; |
| 19 | use rustc_span::{Span, DUMMY_SP}; | |
| 19 | use rustc_span::{DUMMY_SP, Span}; | |
| 20 | 20 | use tracing::{debug, instrument}; |
| 21 | 21 | |
| 22 | 22 | use crate::traits::ObligationCtxt; |
compiler/rustc_trait_selection/src/traits/fulfill.rs+2-2| ... | ... | @@ -18,8 +18,8 @@ use tracing::{debug, debug_span, instrument}; |
| 18 | 18 | use super::project::{self, ProjectAndUnifyResult}; |
| 19 | 19 | use super::select::SelectionContext; |
| 20 | 20 | use super::{ |
| 21 | const_evaluatable, wf, EvaluationResult, FulfillmentError, FulfillmentErrorCode, | |
| 22 | PredicateObligation, ScrubbedTraitError, Unimplemented, | |
| 21 | EvaluationResult, FulfillmentError, FulfillmentErrorCode, PredicateObligation, | |
| 22 | ScrubbedTraitError, Unimplemented, const_evaluatable, wf, | |
| 23 | 23 | }; |
| 24 | 24 | use crate::error_reporting::InferCtxtErrorExt; |
| 25 | 25 | use crate::infer::{InferCtxt, TyOrConstInferVar}; |
compiler/rustc_trait_selection/src/traits/mod.rs+8-8| ... | ... | @@ -35,20 +35,20 @@ use rustc_middle::ty::visit::{TypeVisitable, TypeVisitableExt}; |
| 35 | 35 | use rustc_middle::ty::{ |
| 36 | 36 | self, GenericArgs, GenericArgsRef, Ty, TyCtxt, TypeFolder, TypeSuperVisitable, Upcast, |
| 37 | 37 | }; |
| 38 | use rustc_span::def_id::DefId; | |
| 39 | 38 | use rustc_span::Span; |
| 39 | use rustc_span::def_id::DefId; | |
| 40 | 40 | use tracing::{debug, instrument}; |
| 41 | 41 | |
| 42 | 42 | pub use self::coherence::{ |
| 43 | add_placeholder_note, orphan_check_trait_ref, overlapping_impls, InCrate, IsFirstInputType, | |
| 44 | OrphanCheckErr, OrphanCheckMode, OverlapResult, UncoveredTyParams, | |
| 43 | InCrate, IsFirstInputType, OrphanCheckErr, OrphanCheckMode, OverlapResult, UncoveredTyParams, | |
| 44 | add_placeholder_note, orphan_check_trait_ref, overlapping_impls, | |
| 45 | 45 | }; |
| 46 | 46 | pub use self::engine::{ObligationCtxt, TraitEngineExt}; |
| 47 | 47 | pub use self::fulfill::{FulfillmentContext, OldSolverError, PendingPredicateObligation}; |
| 48 | 48 | pub use self::normalize::NormalizeExt; |
| 49 | 49 | pub use self::object_safety::{ |
| 50 | hir_ty_lowering_object_safety_violations, is_vtable_safe_method, | |
| 51 | object_safety_violations_for_assoc_item, ObjectSafetyViolation, | |
| 50 | ObjectSafetyViolation, hir_ty_lowering_object_safety_violations, is_vtable_safe_method, | |
| 51 | object_safety_violations_for_assoc_item, | |
| 52 | 52 | }; |
| 53 | 53 | pub use self::project::{normalize_inherent_projection, normalize_projection_ty}; |
| 54 | 54 | pub use self::select::{ |
| ... | ... | @@ -59,13 +59,13 @@ pub use self::specialize::specialization_graph::{ |
| 59 | 59 | FutureCompatOverlapError, FutureCompatOverlapErrorKind, |
| 60 | 60 | }; |
| 61 | 61 | pub use self::specialize::{ |
| 62 | specialization_graph, translate_args, translate_args_with_cause, OverlapError, | |
| 62 | OverlapError, specialization_graph, translate_args, translate_args_with_cause, | |
| 63 | 63 | }; |
| 64 | 64 | pub use self::structural_normalize::StructurallyNormalizeExt; |
| 65 | 65 | pub use self::util::{ |
| 66 | elaborate, expand_trait_aliases, impl_item_is_final, supertraits, | |
| 66 | BoundVarReplacer, PlaceholderReplacer, TraitAliasExpander, TraitAliasExpansionInfo, elaborate, | |
| 67 | expand_trait_aliases, impl_item_is_final, supertraits, | |
| 67 | 68 | transitive_bounds_that_define_assoc_item, upcast_choices, with_replaced_escaping_bound_vars, |
| 68 | BoundVarReplacer, PlaceholderReplacer, TraitAliasExpander, TraitAliasExpansionInfo, | |
| 69 | 69 | }; |
| 70 | 70 | use crate::error_reporting::InferCtxtErrorExt; |
| 71 | 71 | use crate::infer::outlives::env::OutlivesEnvironment; |
compiler/rustc_trait_selection/src/traits/normalize.rs+4-4| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | //! Deeply normalize types using the old trait solver. |
| 2 | 2 | |
| 3 | 3 | use rustc_data_structures::stack::ensure_sufficient_stack; |
| 4 | use rustc_infer::infer::at::At; | |
| 5 | 4 | use rustc_infer::infer::InferOk; |
| 5 | use rustc_infer::infer::at::At; | |
| 6 | 6 | use rustc_infer::traits::{ |
| 7 | 7 | FromSolverError, Normalized, Obligation, PredicateObligation, TraitEngine, |
| 8 | 8 | }; |
| ... | ... | @@ -14,11 +14,11 @@ use rustc_middle::ty::{ |
| 14 | 14 | use tracing::{debug, instrument}; |
| 15 | 15 | |
| 16 | 16 | use super::{ |
| 17 | project, with_replaced_escaping_bound_vars, BoundVarReplacer, PlaceholderReplacer, | |
| 18 | SelectionContext, | |
| 17 | BoundVarReplacer, PlaceholderReplacer, SelectionContext, project, | |
| 18 | with_replaced_escaping_bound_vars, | |
| 19 | 19 | }; |
| 20 | use crate::error_reporting::traits::OverflowCause; | |
| 21 | 20 | use crate::error_reporting::InferCtxtErrorExt; |
| 21 | use crate::error_reporting::traits::OverflowCause; | |
| 22 | 22 | use crate::solve::NextSolverError; |
| 23 | 23 | |
| 24 | 24 | #[extension(pub trait NormalizeExt<'tcx>)] |
compiler/rustc_trait_selection/src/traits/object_safety.rs+3-3| ... | ... | @@ -20,17 +20,17 @@ use rustc_middle::ty::{ |
| 20 | 20 | TypeFoldable, TypeFolder, TypeSuperFoldable, TypeSuperVisitable, TypeVisitable, |
| 21 | 21 | TypeVisitableExt, TypeVisitor, Upcast, |
| 22 | 22 | }; |
| 23 | use rustc_span::symbol::Symbol; | |
| 24 | 23 | use rustc_span::Span; |
| 24 | use rustc_span::symbol::Symbol; | |
| 25 | 25 | use rustc_target::abi::Abi; |
| 26 | 26 | use smallvec::SmallVec; |
| 27 | 27 | use tracing::{debug, instrument}; |
| 28 | 28 | |
| 29 | 29 | use super::elaborate; |
| 30 | 30 | use crate::infer::TyCtxtInferExt; |
| 31 | use crate::traits::query::evaluate_obligation::InferCtxtExt; | |
| 32 | 31 | pub use crate::traits::ObjectSafetyViolation; |
| 33 | use crate::traits::{util, MethodViolationCode, Obligation, ObligationCause}; | |
| 32 | use crate::traits::query::evaluate_obligation::InferCtxtExt; | |
| 33 | use crate::traits::{MethodViolationCode, Obligation, ObligationCause, util}; | |
| 34 | 34 | |
| 35 | 35 | /// Returns the object safety violations that affect HIR ty lowering. |
| 36 | 36 | /// |
compiler/rustc_trait_selection/src/traits/outlives_bounds.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use rustc_data_structures::fx::FxIndexSet; |
| 2 | use rustc_infer::infer::resolve::OpportunisticRegionResolver; | |
| 3 | 2 | use rustc_infer::infer::InferOk; |
| 3 | use rustc_infer::infer::resolve::OpportunisticRegionResolver; | |
| 4 | 4 | use rustc_macros::extension; |
| 5 | 5 | use rustc_middle::infer::canonical::{OriginalQueryValues, QueryRegionConstraints}; |
| 6 | 6 | use rustc_middle::span_bug; |
compiler/rustc_trait_selection/src/traits/project.rs+48-58| ... | ... | @@ -7,11 +7,11 @@ use rustc_data_structures::stack::ensure_sufficient_stack; |
| 7 | 7 | use rustc_errors::ErrorGuaranteed; |
| 8 | 8 | use rustc_hir::def::DefKind; |
| 9 | 9 | use rustc_hir::lang_items::LangItem; |
| 10 | use rustc_infer::infer::resolve::OpportunisticRegionResolver; | |
| 11 | 10 | use rustc_infer::infer::DefineOpaqueTypes; |
| 11 | use rustc_infer::infer::resolve::OpportunisticRegionResolver; | |
| 12 | 12 | use rustc_infer::traits::ObligationCauseCode; |
| 13 | use rustc_middle::traits::select::OverflowError; | |
| 14 | 13 | pub use rustc_middle::traits::Reveal; |
| 14 | use rustc_middle::traits::select::OverflowError; | |
| 15 | 15 | use rustc_middle::traits::{BuiltinImplSource, ImplSource, ImplSourceUserDefinedData}; |
| 16 | 16 | use rustc_middle::ty::fast_reject::DeepRejectCtxt; |
| 17 | 17 | use rustc_middle::ty::fold::TypeFoldable; |
| ... | ... | @@ -22,9 +22,9 @@ use rustc_span::symbol::sym; |
| 22 | 22 | use tracing::{debug, instrument}; |
| 23 | 23 | |
| 24 | 24 | use super::{ |
| 25 | specialization_graph, translate_args, util, MismatchedProjectionTypes, Normalized, | |
| 26 | NormalizedTerm, Obligation, ObligationCause, PredicateObligation, ProjectionCacheEntry, | |
| 27 | ProjectionCacheKey, Selection, SelectionContext, SelectionError, | |
| 25 | MismatchedProjectionTypes, Normalized, NormalizedTerm, Obligation, ObligationCause, | |
| 26 | PredicateObligation, ProjectionCacheEntry, ProjectionCacheKey, Selection, SelectionContext, | |
| 27 | SelectionError, specialization_graph, translate_args, util, | |
| 28 | 28 | }; |
| 29 | 29 | use crate::errors::InherentProjectionNormalizationOverflow; |
| 30 | 30 | use crate::infer::{BoundRegionConversionTime, InferOk}; |
| ... | ... | @@ -1696,18 +1696,14 @@ fn confirm_closure_candidate<'cx, 'tcx>( |
| 1696 | 1696 | } else { |
| 1697 | 1697 | let upvars_projection_def_id = |
| 1698 | 1698 | tcx.require_lang_item(LangItem::AsyncFnKindUpvars, None); |
| 1699 | let tupled_upvars_ty = Ty::new_projection( | |
| 1700 | tcx, | |
| 1701 | upvars_projection_def_id, | |
| 1702 | [ | |
| 1703 | ty::GenericArg::from(kind_ty), | |
| 1704 | Ty::from_closure_kind(tcx, ty::ClosureKind::FnOnce).into(), | |
| 1705 | tcx.lifetimes.re_static.into(), | |
| 1706 | sig.tupled_inputs_ty.into(), | |
| 1707 | args.tupled_upvars_ty().into(), | |
| 1708 | args.coroutine_captures_by_ref_ty().into(), | |
| 1709 | ], | |
| 1710 | ); | |
| 1699 | let tupled_upvars_ty = Ty::new_projection(tcx, upvars_projection_def_id, [ | |
| 1700 | ty::GenericArg::from(kind_ty), | |
| 1701 | Ty::from_closure_kind(tcx, ty::ClosureKind::FnOnce).into(), | |
| 1702 | tcx.lifetimes.re_static.into(), | |
| 1703 | sig.tupled_inputs_ty.into(), | |
| 1704 | args.tupled_upvars_ty().into(), | |
| 1705 | args.coroutine_captures_by_ref_ty().into(), | |
| 1706 | ]); | |
| 1711 | 1707 | sig.to_coroutine( |
| 1712 | 1708 | tcx, |
| 1713 | 1709 | args.parent_args(), |
| ... | ... | @@ -1834,18 +1830,14 @@ fn confirm_async_closure_candidate<'cx, 'tcx>( |
| 1834 | 1830 | // will project to the right upvars for the generator, appending the inputs and |
| 1835 | 1831 | // coroutine upvars respecting the closure kind. |
| 1836 | 1832 | // N.B. No need to register a `AsyncFnKindHelper` goal here, it's already in `nested`. |
| 1837 | let tupled_upvars_ty = Ty::new_projection( | |
| 1838 | tcx, | |
| 1839 | upvars_projection_def_id, | |
| 1840 | [ | |
| 1841 | ty::GenericArg::from(kind_ty), | |
| 1842 | Ty::from_closure_kind(tcx, goal_kind).into(), | |
| 1843 | env_region.into(), | |
| 1844 | sig.tupled_inputs_ty.into(), | |
| 1845 | args.tupled_upvars_ty().into(), | |
| 1846 | args.coroutine_captures_by_ref_ty().into(), | |
| 1847 | ], | |
| 1848 | ); | |
| 1833 | let tupled_upvars_ty = Ty::new_projection(tcx, upvars_projection_def_id, [ | |
| 1834 | ty::GenericArg::from(kind_ty), | |
| 1835 | Ty::from_closure_kind(tcx, goal_kind).into(), | |
| 1836 | env_region.into(), | |
| 1837 | sig.tupled_inputs_ty.into(), | |
| 1838 | args.tupled_upvars_ty().into(), | |
| 1839 | args.coroutine_captures_by_ref_ty().into(), | |
| 1840 | ]); | |
| 1849 | 1841 | sig.to_coroutine( |
| 1850 | 1842 | tcx, |
| 1851 | 1843 | args.parent_args(), |
| ... | ... | @@ -1859,16 +1851,17 @@ fn confirm_async_closure_candidate<'cx, 'tcx>( |
| 1859 | 1851 | name => bug!("no such associated type: {name}"), |
| 1860 | 1852 | }; |
| 1861 | 1853 | let projection_term = match item_name { |
| 1862 | sym::CallOnceFuture | sym::Output => ty::AliasTerm::new( | |
| 1863 | tcx, | |
| 1864 | obligation.predicate.def_id, | |
| 1865 | [self_ty, sig.tupled_inputs_ty], | |
| 1866 | ), | |
| 1867 | sym::CallRefFuture => ty::AliasTerm::new( | |
| 1868 | tcx, | |
| 1869 | obligation.predicate.def_id, | |
| 1870 | [ty::GenericArg::from(self_ty), sig.tupled_inputs_ty.into(), env_region.into()], | |
| 1871 | ), | |
| 1854 | sym::CallOnceFuture | sym::Output => { | |
| 1855 | ty::AliasTerm::new(tcx, obligation.predicate.def_id, [ | |
| 1856 | self_ty, | |
| 1857 | sig.tupled_inputs_ty, | |
| 1858 | ]) | |
| 1859 | } | |
| 1860 | sym::CallRefFuture => ty::AliasTerm::new(tcx, obligation.predicate.def_id, [ | |
| 1861 | ty::GenericArg::from(self_ty), | |
| 1862 | sig.tupled_inputs_ty.into(), | |
| 1863 | env_region.into(), | |
| 1864 | ]), | |
| 1872 | 1865 | name => bug!("no such associated type: {name}"), |
| 1873 | 1866 | }; |
| 1874 | 1867 | |
| ... | ... | @@ -1888,20 +1881,17 @@ fn confirm_async_closure_candidate<'cx, 'tcx>( |
| 1888 | 1881 | name => bug!("no such associated type: {name}"), |
| 1889 | 1882 | }; |
| 1890 | 1883 | let projection_term = match item_name { |
| 1891 | sym::CallOnceFuture | sym::Output => ty::AliasTerm::new( | |
| 1892 | tcx, | |
| 1893 | obligation.predicate.def_id, | |
| 1894 | [self_ty, Ty::new_tup(tcx, sig.inputs())], | |
| 1895 | ), | |
| 1896 | sym::CallRefFuture => ty::AliasTerm::new( | |
| 1897 | tcx, | |
| 1898 | obligation.predicate.def_id, | |
| 1899 | [ | |
| 1900 | ty::GenericArg::from(self_ty), | |
| 1901 | Ty::new_tup(tcx, sig.inputs()).into(), | |
| 1902 | env_region.into(), | |
| 1903 | ], | |
| 1904 | ), | |
| 1884 | sym::CallOnceFuture | sym::Output => { | |
| 1885 | ty::AliasTerm::new(tcx, obligation.predicate.def_id, [ | |
| 1886 | self_ty, | |
| 1887 | Ty::new_tup(tcx, sig.inputs()), | |
| 1888 | ]) | |
| 1889 | } | |
| 1890 | sym::CallRefFuture => ty::AliasTerm::new(tcx, obligation.predicate.def_id, [ | |
| 1891 | ty::GenericArg::from(self_ty), | |
| 1892 | Ty::new_tup(tcx, sig.inputs()).into(), | |
| 1893 | env_region.into(), | |
| 1894 | ]), | |
| 1905 | 1895 | name => bug!("no such associated type: {name}"), |
| 1906 | 1896 | }; |
| 1907 | 1897 | |
| ... | ... | @@ -1924,11 +1914,11 @@ fn confirm_async_closure_candidate<'cx, 'tcx>( |
| 1924 | 1914 | sym::CallOnceFuture | sym::Output => { |
| 1925 | 1915 | ty::AliasTerm::new(tcx, obligation.predicate.def_id, [self_ty, sig.inputs()[0]]) |
| 1926 | 1916 | } |
| 1927 | sym::CallRefFuture => ty::AliasTerm::new( | |
| 1928 | tcx, | |
| 1929 | obligation.predicate.def_id, | |
| 1930 | [ty::GenericArg::from(self_ty), sig.inputs()[0].into(), env_region.into()], | |
| 1931 | ), | |
| 1917 | sym::CallRefFuture => ty::AliasTerm::new(tcx, obligation.predicate.def_id, [ | |
| 1918 | ty::GenericArg::from(self_ty), | |
| 1919 | sig.inputs()[0].into(), | |
| 1920 | env_region.into(), | |
| 1921 | ]), | |
| 1932 | 1922 | name => bug!("no such associated type: {name}"), |
| 1933 | 1923 | }; |
| 1934 | 1924 |
compiler/rustc_trait_selection/src/traits/query/dropck_outlives.rs+2-2| ... | ... | @@ -1,11 +1,11 @@ |
| 1 | 1 | use rustc_data_structures::fx::FxHashSet; |
| 2 | 2 | use rustc_middle::traits::query::{DropckConstraint, DropckOutlivesResult}; |
| 3 | 3 | use rustc_middle::ty::{self, EarlyBinder, ParamEnvAnd, Ty, TyCtxt}; |
| 4 | use rustc_span::{Span, DUMMY_SP}; | |
| 4 | use rustc_span::{DUMMY_SP, Span}; | |
| 5 | 5 | use tracing::{debug, instrument}; |
| 6 | 6 | |
| 7 | use crate::traits::query::normalize::QueryNormalizeExt; | |
| 8 | 7 | use crate::traits::query::NoSolution; |
| 8 | use crate::traits::query::normalize::QueryNormalizeExt; | |
| 9 | 9 | use crate::traits::{Normalized, ObligationCause, ObligationCtxt}; |
| 10 | 10 | |
| 11 | 11 | /// This returns true if the type `ty` is "trivial" for |
compiler/rustc_trait_selection/src/traits/query/evaluate_obligation.rs+1-1| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use rustc_macros::extension; |
| 2 | 2 | use rustc_middle::span_bug; |
| 3 | 3 | |
| 4 | use crate::infer::canonical::OriginalQueryValues; | |
| 5 | 4 | use crate::infer::InferCtxt; |
| 5 | use crate::infer::canonical::OriginalQueryValues; | |
| 6 | 6 | use crate::traits::{ |
| 7 | 7 | EvaluationResult, ObligationCtxt, OverflowError, PredicateObligation, SelectionContext, |
| 8 | 8 | }; |
compiler/rustc_trait_selection/src/traits/query/normalize.rs+1-1| ... | ... | @@ -13,8 +13,8 @@ use rustc_span::DUMMY_SP; |
| 13 | 13 | use tracing::{debug, info, instrument}; |
| 14 | 14 | |
| 15 | 15 | use super::NoSolution; |
| 16 | use crate::error_reporting::traits::OverflowCause; | |
| 17 | 16 | use crate::error_reporting::InferCtxtErrorExt; |
| 17 | use crate::error_reporting::traits::OverflowCause; | |
| 18 | 18 | use crate::infer::at::At; |
| 19 | 19 | use crate::infer::canonical::OriginalQueryValues; |
| 20 | 20 | use crate::infer::{InferCtxt, InferOk}; |
compiler/rustc_trait_selection/src/traits/query/type_op/ascribe_user_type.rs+3-3| ... | ... | @@ -1,10 +1,10 @@ |
| 1 | use rustc_hir::def_id::{DefId, CRATE_DEF_ID}; | |
| 1 | use rustc_hir::def_id::{CRATE_DEF_ID, DefId}; | |
| 2 | 2 | use rustc_infer::traits::Obligation; |
| 3 | pub use rustc_middle::traits::query::type_op::AscribeUserType; | |
| 4 | 3 | use rustc_middle::traits::query::NoSolution; |
| 4 | pub use rustc_middle::traits::query::type_op::AscribeUserType; | |
| 5 | 5 | use rustc_middle::traits::{ObligationCause, ObligationCauseCode}; |
| 6 | 6 | use rustc_middle::ty::{self, ParamEnvAnd, Ty, TyCtxt, UserArgs, UserSelfTy, UserType}; |
| 7 | use rustc_span::{Span, DUMMY_SP}; | |
| 7 | use rustc_span::{DUMMY_SP, Span}; | |
| 8 | 8 | use tracing::{debug, instrument}; |
| 9 | 9 | |
| 10 | 10 | use crate::infer::canonical::{Canonical, CanonicalQueryResponse}; |
compiler/rustc_trait_selection/src/traits/query/type_op/custom.rs+2-2| ... | ... | @@ -7,10 +7,10 @@ use rustc_middle::ty::{TyCtxt, TypeFoldable}; |
| 7 | 7 | use rustc_span::Span; |
| 8 | 8 | use tracing::info; |
| 9 | 9 | |
| 10 | use crate::infer::canonical::query_response; | |
| 11 | 10 | use crate::infer::InferCtxt; |
| 12 | use crate::traits::query::type_op::TypeOpOutput; | |
| 11 | use crate::infer::canonical::query_response; | |
| 13 | 12 | use crate::traits::ObligationCtxt; |
| 13 | use crate::traits::query::type_op::TypeOpOutput; | |
| 14 | 14 | |
| 15 | 15 | pub struct CustomTypeOp<F> { |
| 16 | 16 | closure: F, |
compiler/rustc_trait_selection/src/traits/query/type_op/implied_outlives_bounds.rs+4-4| ... | ... | @@ -5,14 +5,14 @@ use rustc_macros::{HashStable, TypeFoldable, TypeVisitable}; |
| 5 | 5 | use rustc_middle::infer::canonical::CanonicalQueryResponse; |
| 6 | 6 | use rustc_middle::traits::ObligationCause; |
| 7 | 7 | use rustc_middle::ty::{self, ParamEnvAnd, Ty, TyCtxt, TypeFolder, TypeVisitableExt}; |
| 8 | use rustc_span::def_id::CRATE_DEF_ID; | |
| 9 | 8 | use rustc_span::DUMMY_SP; |
| 10 | use rustc_type_ir::outlives::{push_outlives_components, Component}; | |
| 11 | use smallvec::{smallvec, SmallVec}; | |
| 9 | use rustc_span::def_id::CRATE_DEF_ID; | |
| 10 | use rustc_type_ir::outlives::{Component, push_outlives_components}; | |
| 11 | use smallvec::{SmallVec, smallvec}; | |
| 12 | 12 | use tracing::debug; |
| 13 | 13 | |
| 14 | 14 | use crate::traits::query::NoSolution; |
| 15 | use crate::traits::{wf, ObligationCtxt}; | |
| 15 | use crate::traits::{ObligationCtxt, wf}; | |
| 16 | 16 | |
| 17 | 17 | #[derive(Copy, Clone, Debug, HashStable, TypeFoldable, TypeVisitable)] |
| 18 | 18 | pub struct ImpliedOutlivesBounds<'tcx> { |
compiler/rustc_trait_selection/src/traits/query/type_op/normalize.rs+2-2| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use std::fmt; |
| 2 | 2 | |
| 3 | pub use rustc_middle::traits::query::type_op::Normalize; | |
| 4 | use rustc_middle::traits::query::NoSolution; | |
| 5 | 3 | use rustc_middle::traits::ObligationCause; |
| 4 | use rustc_middle::traits::query::NoSolution; | |
| 5 | pub use rustc_middle::traits::query::type_op::Normalize; | |
| 6 | 6 | use rustc_middle::ty::fold::TypeFoldable; |
| 7 | 7 | use rustc_middle::ty::{self, Lift, ParamEnvAnd, Ty, TyCtxt, TypeVisitableExt}; |
| 8 | 8 |
compiler/rustc_trait_selection/src/traits/query/type_op/outlives.rs+1-1| ... | ... | @@ -3,10 +3,10 @@ use rustc_middle::traits::query::{DropckOutlivesResult, NoSolution}; |
| 3 | 3 | use rustc_middle::ty::{ParamEnvAnd, Ty, TyCtxt}; |
| 4 | 4 | |
| 5 | 5 | use crate::infer::canonical::{Canonical, CanonicalQueryResponse}; |
| 6 | use crate::traits::ObligationCtxt; | |
| 6 | 7 | use crate::traits::query::dropck_outlives::{ |
| 7 | 8 | compute_dropck_outlives_inner, trivial_dropck_outlives, |
| 8 | 9 | }; |
| 9 | use crate::traits::ObligationCtxt; | |
| 10 | 10 | |
| 11 | 11 | #[derive(Copy, Clone, Debug, HashStable, TypeFoldable, TypeVisitable)] |
| 12 | 12 | pub struct DropckOutlives<'tcx> { |
compiler/rustc_trait_selection/src/traits/query/type_op/prove_predicate.rs+2-2| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use rustc_hir::LangItem; |
| 2 | 2 | use rustc_infer::traits::Obligation; |
| 3 | pub use rustc_middle::traits::query::type_op::ProvePredicate; | |
| 4 | use rustc_middle::traits::query::NoSolution; | |
| 5 | 3 | use rustc_middle::traits::ObligationCause; |
| 4 | use rustc_middle::traits::query::NoSolution; | |
| 5 | pub use rustc_middle::traits::query::type_op::ProvePredicate; | |
| 6 | 6 | use rustc_middle::ty::{self, ParamEnvAnd, TyCtxt}; |
| 7 | 7 | |
| 8 | 8 | use crate::infer::canonical::{Canonical, CanonicalQueryResponse}; |
compiler/rustc_trait_selection/src/traits/select/_match.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use rustc_infer::infer::relate::{ |
| 2 | self, structurally_relate_tys, Relate, RelateResult, TypeRelation, | |
| 2 | self, Relate, RelateResult, TypeRelation, structurally_relate_tys, | |
| 3 | 3 | }; |
| 4 | 4 | use rustc_middle::ty::error::{ExpectedFound, TypeError}; |
| 5 | 5 | use rustc_middle::ty::{self, InferConst, Ty, TyCtxt}; |
compiler/rustc_trait_selection/src/traits/select/candidate_assembly.rs+1-1| ... | ... | @@ -8,8 +8,8 @@ |
| 8 | 8 | |
| 9 | 9 | use std::ops::ControlFlow; |
| 10 | 10 | |
| 11 | use hir::def_id::DefId; | |
| 12 | 11 | use hir::LangItem; |
| 12 | use hir::def_id::DefId; | |
| 13 | 13 | use rustc_data_structures::fx::{FxHashSet, FxIndexSet}; |
| 14 | 14 | use rustc_hir as hir; |
| 15 | 15 | use rustc_infer::traits::{Obligation, ObligationCause, PolyTraitObligation, SelectionError}; |
compiler/rustc_trait_selection/src/traits/select/confirmation.rs+37-55| ... | ... | @@ -305,15 +305,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { |
| 305 | 305 | let make_transmute_obl = |src, dst| { |
| 306 | 306 | let transmute_trait = obligation.predicate.def_id(); |
| 307 | 307 | let assume = obligation.predicate.skip_binder().trait_ref.args.const_at(2); |
| 308 | let trait_ref = ty::TraitRef::new( | |
| 309 | tcx, | |
| 310 | transmute_trait, | |
| 311 | [ | |
| 312 | ty::GenericArg::from(dst), | |
| 313 | ty::GenericArg::from(src), | |
| 314 | ty::GenericArg::from(assume), | |
| 315 | ], | |
| 316 | ); | |
| 308 | let trait_ref = ty::TraitRef::new(tcx, transmute_trait, [ | |
| 309 | ty::GenericArg::from(dst), | |
| 310 | ty::GenericArg::from(src), | |
| 311 | ty::GenericArg::from(assume), | |
| 312 | ]); | |
| 317 | 313 | Obligation::with_depth( |
| 318 | 314 | tcx, |
| 319 | 315 | obligation.cause.clone(), |
| ... | ... | @@ -324,11 +320,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { |
| 324 | 320 | }; |
| 325 | 321 | |
| 326 | 322 | let make_freeze_obl = |ty| { |
| 327 | let trait_ref = ty::TraitRef::new( | |
| 328 | tcx, | |
| 329 | tcx.require_lang_item(LangItem::Freeze, None), | |
| 330 | [ty::GenericArg::from(ty)], | |
| 331 | ); | |
| 323 | let trait_ref = | |
| 324 | ty::TraitRef::new(tcx, tcx.require_lang_item(LangItem::Freeze, None), [ | |
| 325 | ty::GenericArg::from(ty), | |
| 326 | ]); | |
| 332 | 327 | Obligation::with_depth( |
| 333 | 328 | tcx, |
| 334 | 329 | obligation.cause.clone(), |
| ... | ... | @@ -657,28 +652,20 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { |
| 657 | 652 | let kind = ty::BoundTyKind::Param(param.def_id, param.name); |
| 658 | 653 | let bound_var = ty::BoundVariableKind::Ty(kind); |
| 659 | 654 | bound_vars.push(bound_var); |
| 660 | Ty::new_bound( | |
| 661 | tcx, | |
| 662 | ty::INNERMOST, | |
| 663 | ty::BoundTy { | |
| 664 | var: ty::BoundVar::from_usize(bound_vars.len() - 1), | |
| 665 | kind, | |
| 666 | }, | |
| 667 | ) | |
| 655 | Ty::new_bound(tcx, ty::INNERMOST, ty::BoundTy { | |
| 656 | var: ty::BoundVar::from_usize(bound_vars.len() - 1), | |
| 657 | kind, | |
| 658 | }) | |
| 668 | 659 | .into() |
| 669 | 660 | } |
| 670 | 661 | GenericParamDefKind::Lifetime => { |
| 671 | 662 | let kind = ty::BoundRegionKind::BrNamed(param.def_id, param.name); |
| 672 | 663 | let bound_var = ty::BoundVariableKind::Region(kind); |
| 673 | 664 | bound_vars.push(bound_var); |
| 674 | ty::Region::new_bound( | |
| 675 | tcx, | |
| 676 | ty::INNERMOST, | |
| 677 | ty::BoundRegion { | |
| 678 | var: ty::BoundVar::from_usize(bound_vars.len() - 1), | |
| 679 | kind, | |
| 680 | }, | |
| 681 | ) | |
| 665 | ty::Region::new_bound(tcx, ty::INNERMOST, ty::BoundRegion { | |
| 666 | var: ty::BoundVar::from_usize(bound_vars.len() - 1), | |
| 667 | kind, | |
| 668 | }) | |
| 682 | 669 | .into() |
| 683 | 670 | } |
| 684 | 671 | GenericParamDefKind::Const { .. } => { |
| ... | ... | @@ -921,11 +908,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { |
| 921 | 908 | ), |
| 922 | 909 | ty::CoroutineClosure(_, args) => { |
| 923 | 910 | args.as_coroutine_closure().coroutine_closure_sig().map_bound(|sig| { |
| 924 | ty::TraitRef::new( | |
| 925 | self.tcx(), | |
| 926 | obligation.predicate.def_id(), | |
| 927 | [self_ty, sig.tupled_inputs_ty], | |
| 928 | ) | |
| 911 | ty::TraitRef::new(self.tcx(), obligation.predicate.def_id(), [ | |
| 912 | self_ty, | |
| 913 | sig.tupled_inputs_ty, | |
| 914 | ]) | |
| 929 | 915 | }) |
| 930 | 916 | } |
| 931 | 917 | _ => { |
| ... | ... | @@ -951,22 +937,20 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { |
| 951 | 937 | ty::CoroutineClosure(_, args) => { |
| 952 | 938 | let args = args.as_coroutine_closure(); |
| 953 | 939 | let trait_ref = args.coroutine_closure_sig().map_bound(|sig| { |
| 954 | ty::TraitRef::new( | |
| 955 | self.tcx(), | |
| 956 | obligation.predicate.def_id(), | |
| 957 | [self_ty, sig.tupled_inputs_ty], | |
| 958 | ) | |
| 940 | ty::TraitRef::new(self.tcx(), obligation.predicate.def_id(), [ | |
| 941 | self_ty, | |
| 942 | sig.tupled_inputs_ty, | |
| 943 | ]) | |
| 959 | 944 | }); |
| 960 | 945 | (trait_ref, args.kind_ty()) |
| 961 | 946 | } |
| 962 | 947 | ty::FnDef(..) | ty::FnPtr(..) => { |
| 963 | 948 | let sig = self_ty.fn_sig(tcx); |
| 964 | 949 | let trait_ref = sig.map_bound(|sig| { |
| 965 | ty::TraitRef::new( | |
| 966 | self.tcx(), | |
| 967 | obligation.predicate.def_id(), | |
| 968 | [self_ty, Ty::new_tup(tcx, sig.inputs())], | |
| 969 | ) | |
| 950 | ty::TraitRef::new(self.tcx(), obligation.predicate.def_id(), [ | |
| 951 | self_ty, | |
| 952 | Ty::new_tup(tcx, sig.inputs()), | |
| 953 | ]) | |
| 970 | 954 | }); |
| 971 | 955 | |
| 972 | 956 | // We must additionally check that the return type impls `Future`. |
| ... | ... | @@ -990,11 +974,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { |
| 990 | 974 | let args = args.as_closure(); |
| 991 | 975 | let sig = args.sig(); |
| 992 | 976 | let trait_ref = sig.map_bound(|sig| { |
| 993 | ty::TraitRef::new( | |
| 994 | self.tcx(), | |
| 995 | obligation.predicate.def_id(), | |
| 996 | [self_ty, sig.inputs()[0]], | |
| 997 | ) | |
| 977 | ty::TraitRef::new(self.tcx(), obligation.predicate.def_id(), [ | |
| 978 | self_ty, | |
| 979 | sig.inputs()[0], | |
| 980 | ]) | |
| 998 | 981 | }); |
| 999 | 982 | |
| 1000 | 983 | // We must additionally check that the return type impls `Future`. |
| ... | ... | @@ -1310,11 +1293,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> { |
| 1310 | 1293 | // Construct the nested `TailField<T>: Unsize<TailField<U>>` predicate. |
| 1311 | 1294 | let tail_unsize_obligation = obligation.with( |
| 1312 | 1295 | tcx, |
| 1313 | ty::TraitRef::new( | |
| 1314 | tcx, | |
| 1315 | obligation.predicate.def_id(), | |
| 1316 | [source_tail, target_tail], | |
| 1317 | ), | |
| 1296 | ty::TraitRef::new(tcx, obligation.predicate.def_id(), [ | |
| 1297 | source_tail, | |
| 1298 | target_tail, | |
| 1299 | ]), | |
| 1318 | 1300 | ); |
| 1319 | 1301 | nested.push(tail_unsize_obligation); |
| 1320 | 1302 |
compiler/rustc_trait_selection/src/traits/select/mod.rs+11-13| ... | ... | @@ -12,25 +12,25 @@ use rustc_data_structures::fx::{FxHashSet, FxIndexMap, FxIndexSet}; |
| 12 | 12 | use rustc_data_structures::stack::ensure_sufficient_stack; |
| 13 | 13 | use rustc_errors::{Diag, EmissionGuarantee}; |
| 14 | 14 | use rustc_hir as hir; |
| 15 | use rustc_hir::def_id::DefId; | |
| 16 | 15 | use rustc_hir::LangItem; |
| 17 | use rustc_infer::infer::relate::TypeRelation; | |
| 16 | use rustc_hir::def_id::DefId; | |
| 18 | 17 | use rustc_infer::infer::BoundRegionConversionTime::{self, HigherRankedType}; |
| 19 | 18 | use rustc_infer::infer::DefineOpaqueTypes; |
| 19 | use rustc_infer::infer::relate::TypeRelation; | |
| 20 | 20 | use rustc_infer::traits::TraitObligation; |
| 21 | 21 | use rustc_middle::bug; |
| 22 | use rustc_middle::dep_graph::{dep_kinds, DepNodeIndex}; | |
| 22 | use rustc_middle::dep_graph::{DepNodeIndex, dep_kinds}; | |
| 23 | 23 | use rustc_middle::mir::interpret::ErrorHandled; |
| 24 | 24 | pub use rustc_middle::traits::select::*; |
| 25 | 25 | use rustc_middle::ty::abstract_const::NotConstEvaluatable; |
| 26 | 26 | use rustc_middle::ty::error::TypeErrorToStringExt; |
| 27 | use rustc_middle::ty::print::{with_no_trimmed_paths, PrintTraitRefExt as _}; | |
| 27 | use rustc_middle::ty::print::{PrintTraitRefExt as _, with_no_trimmed_paths}; | |
| 28 | 28 | use rustc_middle::ty::{ |
| 29 | 29 | self, GenericArgsRef, PolyProjectionPredicate, Ty, TyCtxt, TypeFoldable, TypeVisitableExt, |
| 30 | 30 | Upcast, |
| 31 | 31 | }; |
| 32 | use rustc_span::symbol::sym; | |
| 33 | 32 | use rustc_span::Symbol; |
| 33 | use rustc_span::symbol::sym; | |
| 34 | 34 | use tracing::{debug, instrument, trace}; |
| 35 | 35 | |
| 36 | 36 | use self::EvaluationResult::*; |
| ... | ... | @@ -39,9 +39,9 @@ use super::coherence::{self, Conflict}; |
| 39 | 39 | use super::project::ProjectionTermObligation; |
| 40 | 40 | use super::util::closure_trait_ref_and_return_type; |
| 41 | 41 | use super::{ |
| 42 | const_evaluatable, project, util, wf, ImplDerivedCause, Normalized, Obligation, | |
| 43 | ObligationCause, ObligationCauseCode, Overflow, PolyTraitObligation, PredicateObligation, | |
| 44 | Selection, SelectionError, SelectionResult, TraitQueryMode, | |
| 42 | ImplDerivedCause, Normalized, Obligation, ObligationCause, ObligationCauseCode, Overflow, | |
| 43 | PolyTraitObligation, PredicateObligation, Selection, SelectionError, SelectionResult, | |
| 44 | TraitQueryMode, const_evaluatable, project, util, wf, | |
| 45 | 45 | }; |
| 46 | 46 | use crate::error_reporting::InferCtxtErrorExt; |
| 47 | 47 | use crate::infer::{InferCtxt, InferCtxtExt, InferOk, TypeFreshener}; |
| ... | ... | @@ -2449,11 +2449,9 @@ impl<'tcx> SelectionContext<'_, 'tcx> { |
| 2449 | 2449 | } else { |
| 2450 | 2450 | // If this is an ill-formed auto/built-in trait, then synthesize |
| 2451 | 2451 | // new error args for the missing generics. |
| 2452 | let err_args = ty::GenericArgs::extend_with_error( | |
| 2453 | tcx, | |
| 2454 | trait_def_id, | |
| 2455 | &[normalized_ty.into()], | |
| 2456 | ); | |
| 2452 | let err_args = ty::GenericArgs::extend_with_error(tcx, trait_def_id, &[ | |
| 2453 | normalized_ty.into(), | |
| 2454 | ]); | |
| 2457 | 2455 | ty::TraitRef::new_from_args(tcx, trait_def_id, err_args) |
| 2458 | 2456 | }; |
| 2459 | 2457 |
compiler/rustc_trait_selection/src/traits/specialize/mod.rs+3-3| ... | ... | @@ -21,16 +21,16 @@ use rustc_middle::query::LocalCrate; |
| 21 | 21 | use rustc_middle::ty::print::PrintTraitRefExt as _; |
| 22 | 22 | use rustc_middle::ty::{self, GenericArgsRef, ImplSubject, Ty, TyCtxt, TypeVisitableExt}; |
| 23 | 23 | use rustc_session::lint::builtin::{COHERENCE_LEAK_CHECK, ORDER_DEPENDENT_TRAIT_OBJECTS}; |
| 24 | use rustc_span::{sym, ErrorGuaranteed, Span, DUMMY_SP}; | |
| 24 | use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span, sym}; | |
| 25 | 25 | use specialization_graph::GraphExt; |
| 26 | 26 | use tracing::{debug, instrument}; |
| 27 | 27 | |
| 28 | use super::{util, SelectionContext}; | |
| 28 | use super::{SelectionContext, util}; | |
| 29 | 29 | use crate::error_reporting::traits::to_pretty_impl_header; |
| 30 | 30 | use crate::errors::NegativePositiveConflict; |
| 31 | 31 | use crate::infer::{InferCtxt, InferOk, TyCtxtInferExt}; |
| 32 | 32 | use crate::traits::select::IntercrateAmbiguityCause; |
| 33 | use crate::traits::{coherence, FutureCompatOverlapErrorKind, ObligationCause, ObligationCtxt}; | |
| 33 | use crate::traits::{FutureCompatOverlapErrorKind, ObligationCause, ObligationCtxt, coherence}; | |
| 34 | 34 | |
| 35 | 35 | /// Information pertinent to an overlapping impl error. |
| 36 | 36 | #[derive(Debug)] |
compiler/rustc_trait_selection/src/traits/util.rs+6-10| ... | ... | @@ -11,7 +11,7 @@ use rustc_middle::ty::{ |
| 11 | 11 | TypeVisitableExt, Upcast, |
| 12 | 12 | }; |
| 13 | 13 | use rustc_span::Span; |
| 14 | use smallvec::{smallvec, SmallVec}; | |
| 14 | use smallvec::{SmallVec, smallvec}; | |
| 15 | 15 | use tracing::debug; |
| 16 | 16 | |
| 17 | 17 | use super::{NormalizeExt, ObligationCause, PredicateObligation, SelectionContext}; |
| ... | ... | @@ -223,15 +223,11 @@ pub(crate) fn closure_trait_ref_and_return_type<'tcx>( |
| 223 | 223 | TupleArgumentsFlag::Yes => Ty::new_tup(tcx, sig.skip_binder().inputs()), |
| 224 | 224 | }; |
| 225 | 225 | let trait_ref = if tcx.has_host_param(fn_trait_def_id) { |
| 226 | ty::TraitRef::new( | |
| 227 | tcx, | |
| 228 | fn_trait_def_id, | |
| 229 | [ | |
| 230 | ty::GenericArg::from(self_ty), | |
| 231 | ty::GenericArg::from(arguments_tuple), | |
| 232 | ty::GenericArg::from(fn_host_effect), | |
| 233 | ], | |
| 234 | ) | |
| 226 | ty::TraitRef::new(tcx, fn_trait_def_id, [ | |
| 227 | ty::GenericArg::from(self_ty), | |
| 228 | ty::GenericArg::from(arguments_tuple), | |
| 229 | ty::GenericArg::from(fn_host_effect), | |
| 230 | ]) | |
| 235 | 231 | } else { |
| 236 | 232 | ty::TraitRef::new(tcx, fn_trait_def_id, [self_ty, arguments_tuple]) |
| 237 | 233 | }; |
compiler/rustc_trait_selection/src/traits/vtable.rs+2-2| ... | ... | @@ -8,8 +8,8 @@ use rustc_middle::query::Providers; |
| 8 | 8 | use rustc_middle::ty::{ |
| 9 | 9 | self, GenericArgs, GenericParamDefKind, Ty, TyCtxt, TypeVisitableExt, Upcast, VtblEntry, |
| 10 | 10 | }; |
| 11 | use rustc_span::{sym, Span, DUMMY_SP}; | |
| 12 | use smallvec::{smallvec, SmallVec}; | |
| 11 | use rustc_span::{DUMMY_SP, Span, sym}; | |
| 12 | use smallvec::{SmallVec, smallvec}; | |
| 13 | 13 | use tracing::debug; |
| 14 | 14 | |
| 15 | 15 | use crate::errors::DumpVTableEntries; |
compiler/rustc_trait_selection/src/traits/wf.rs+2-2| ... | ... | @@ -8,8 +8,8 @@ use rustc_middle::ty::{ |
| 8 | 8 | self, GenericArg, GenericArgKind, GenericArgsRef, Ty, TyCtxt, TypeSuperVisitable, |
| 9 | 9 | TypeVisitable, TypeVisitableExt, TypeVisitor, |
| 10 | 10 | }; |
| 11 | use rustc_span::def_id::{DefId, LocalDefId, CRATE_DEF_ID}; | |
| 12 | use rustc_span::{Span, DUMMY_SP}; | |
| 11 | use rustc_span::def_id::{CRATE_DEF_ID, DefId, LocalDefId}; | |
| 12 | use rustc_span::{DUMMY_SP, Span}; | |
| 13 | 13 | use tracing::{debug, instrument, trace}; |
| 14 | 14 | |
| 15 | 15 | use crate::infer::InferCtxt; |
compiler/rustc_traits/src/dropck_outlives.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use rustc_data_structures::fx::FxHashSet; |
| 2 | 2 | use rustc_hir::def_id::DefId; |
| 3 | use rustc_infer::infer::canonical::{Canonical, QueryResponse}; | |
| 4 | 3 | use rustc_infer::infer::TyCtxtInferExt; |
| 4 | use rustc_infer::infer::canonical::{Canonical, QueryResponse}; | |
| 5 | 5 | use rustc_middle::bug; |
| 6 | 6 | use rustc_middle::query::Providers; |
| 7 | 7 | use rustc_middle::traits::query::{DropckConstraint, DropckOutlivesResult}; |
compiler/rustc_traits/src/implied_outlives_bounds.rs+1-1| ... | ... | @@ -2,8 +2,8 @@ |
| 2 | 2 | //! Do not call this query directory. See |
| 3 | 3 | //! [`rustc_trait_selection::traits::query::type_op::implied_outlives_bounds`]. |
| 4 | 4 | |
| 5 | use rustc_infer::infer::canonical::{self, Canonical}; | |
| 6 | 5 | use rustc_infer::infer::TyCtxtInferExt; |
| 6 | use rustc_infer::infer::canonical::{self, Canonical}; | |
| 7 | 7 | use rustc_infer::traits::query::OutlivesBound; |
| 8 | 8 | use rustc_middle::query::Providers; |
| 9 | 9 | use rustc_middle::ty::TyCtxt; |
compiler/rustc_traits/src/normalize_projection_ty.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | use rustc_infer::infer::canonical::{Canonical, QueryResponse}; | |
| 2 | 1 | use rustc_infer::infer::TyCtxtInferExt; |
| 2 | use rustc_infer::infer::canonical::{Canonical, QueryResponse}; | |
| 3 | 3 | use rustc_middle::query::Providers; |
| 4 | 4 | use rustc_middle::ty::{ParamEnvAnd, TyCtxt}; |
| 5 | 5 | use rustc_trait_selection::error_reporting::InferCtxtErrorExt; |
compiler/rustc_traits/src/type_op.rs+2-2| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | 1 | use std::fmt; |
| 2 | 2 | |
| 3 | use rustc_infer::infer::canonical::{Canonical, QueryResponse}; | |
| 4 | 3 | use rustc_infer::infer::TyCtxtInferExt; |
| 4 | use rustc_infer::infer::canonical::{Canonical, QueryResponse}; | |
| 5 | 5 | use rustc_middle::query::Providers; |
| 6 | 6 | use rustc_middle::traits::query::NoSolution; |
| 7 | 7 | use rustc_middle::ty::{Clause, FnSig, ParamEnvAnd, PolyFnSig, Ty, TyCtxt, TypeFoldable}; |
| 8 | 8 | use rustc_trait_selection::infer::InferCtxtBuilderExt; |
| 9 | 9 | use rustc_trait_selection::traits::query::normalize::QueryNormalizeExt; |
| 10 | 10 | use rustc_trait_selection::traits::query::type_op::ascribe_user_type::{ |
| 11 | type_op_ascribe_user_type_with_span, AscribeUserType, | |
| 11 | AscribeUserType, type_op_ascribe_user_type_with_span, | |
| 12 | 12 | }; |
| 13 | 13 | use rustc_trait_selection::traits::query::type_op::normalize::Normalize; |
| 14 | 14 | use rustc_trait_selection::traits::query::type_op::prove_predicate::ProvePredicate; |
compiler/rustc_transmute/src/layout/dfa.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ use std::sync::atomic::{AtomicU32, Ordering}; |
| 3 | 3 | |
| 4 | 4 | use tracing::instrument; |
| 5 | 5 | |
| 6 | use super::{nfa, Byte, Nfa, Ref}; | |
| 6 | use super::{Byte, Nfa, Ref, nfa}; | |
| 7 | 7 | use crate::Map; |
| 8 | 8 | |
| 9 | 9 | #[derive(PartialEq, Clone, Debug)] |
compiler/rustc_transmute/src/layout/tree.rs+1-1| ... | ... | @@ -179,7 +179,7 @@ pub(crate) mod rustc { |
| 179 | 179 | }; |
| 180 | 180 | |
| 181 | 181 | use super::Tree; |
| 182 | use crate::layout::rustc::{layout_of, Def, Ref}; | |
| 182 | use crate::layout::rustc::{Def, Ref, layout_of}; | |
| 183 | 183 | |
| 184 | 184 | #[derive(Debug, Copy, Clone)] |
| 185 | 185 | pub(crate) enum Err { |
compiler/rustc_transmute/src/maybe_transmutable/mod.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ pub(crate) mod query_context; |
| 4 | 4 | #[cfg(test)] |
| 5 | 5 | mod tests; |
| 6 | 6 | |
| 7 | use crate::layout::{self, dfa, Byte, Def, Dfa, Nfa, Ref, Tree, Uninhabited}; | |
| 7 | use crate::layout::{self, Byte, Def, Dfa, Nfa, Ref, Tree, Uninhabited, dfa}; | |
| 8 | 8 | use crate::maybe_transmutable::query_context::QueryContext; |
| 9 | 9 | use crate::{Answer, Condition, Map, Reason}; |
| 10 | 10 |
compiler/rustc_transmute/src/maybe_transmutable/tests.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ use itertools::Itertools; |
| 2 | 2 | |
| 3 | 3 | use super::query_context::test::{Def, UltraMinimal}; |
| 4 | 4 | use crate::maybe_transmutable::MaybeTransmutableQuery; |
| 5 | use crate::{layout, Reason}; | |
| 5 | use crate::{Reason, layout}; | |
| 6 | 6 | |
| 7 | 7 | mod safety { |
| 8 | 8 | use super::*; |
compiler/rustc_ty_utils/src/abi.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ use rustc_hir::lang_items::LangItem; |
| 5 | 5 | use rustc_middle::bug; |
| 6 | 6 | use rustc_middle::query::Providers; |
| 7 | 7 | use rustc_middle::ty::layout::{ |
| 8 | fn_can_unwind, FnAbiError, HasParamEnv, HasTyCtxt, LayoutCx, LayoutOf, TyAndLayout, | |
| 8 | FnAbiError, HasParamEnv, HasTyCtxt, LayoutCx, LayoutOf, TyAndLayout, fn_can_unwind, | |
| 9 | 9 | }; |
| 10 | 10 | use rustc_middle::ty::{self, InstanceKind, Ty, TyCtxt}; |
| 11 | 11 | use rustc_session::config::OptLevel; |
compiler/rustc_ty_utils/src/consts.rs+1-1| ... | ... | @@ -11,7 +11,7 @@ use rustc_middle::ty::abstract_const::CastKind; |
| 11 | 11 | use rustc_middle::ty::{self, Expr, TyCtxt, TypeVisitableExt}; |
| 12 | 12 | use rustc_middle::{bug, mir, thir}; |
| 13 | 13 | use rustc_span::Span; |
| 14 | use rustc_target::abi::{VariantIdx, FIRST_VARIANT}; | |
| 14 | use rustc_target::abi::{FIRST_VARIANT, VariantIdx}; | |
| 15 | 15 | use tracing::{debug, instrument}; |
| 16 | 16 | |
| 17 | 17 | use crate::errors::{GenericConstantTooComplex, GenericConstantTooComplexSub}; |
compiler/rustc_ty_utils/src/implied_bounds.rs+4-4| ... | ... | @@ -78,10 +78,10 @@ fn assumed_wf_types<'tcx>(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> &'tcx [(Ty<' |
| 78 | 78 | if matches!(*orig_lt, ty::ReLateParam(..)) { |
| 79 | 79 | mapping.insert( |
| 80 | 80 | orig_lt, |
| 81 | ty::Region::new_early_param( | |
| 82 | tcx, | |
| 83 | ty::EarlyParamRegion { index: param.index, name: param.name }, | |
| 84 | ), | |
| 81 | ty::Region::new_early_param(tcx, ty::EarlyParamRegion { | |
| 82 | index: param.index, | |
| 83 | name: param.name, | |
| 84 | }), | |
| 85 | 85 | ); |
| 86 | 86 | } |
| 87 | 87 | } |
compiler/rustc_ty_utils/src/instance.rs+2-2| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use rustc_errors::ErrorGuaranteed; |
| 2 | use rustc_hir::def_id::DefId; | |
| 3 | 2 | use rustc_hir::LangItem; |
| 3 | use rustc_hir::def_id::DefId; | |
| 4 | 4 | use rustc_infer::infer::TyCtxtInferExt; |
| 5 | 5 | use rustc_middle::bug; |
| 6 | 6 | use rustc_middle::query::Providers; |
| ... | ... | @@ -11,7 +11,7 @@ use rustc_span::sym; |
| 11 | 11 | use rustc_trait_selection::traits; |
| 12 | 12 | use rustc_type_ir::ClosureKind; |
| 13 | 13 | use tracing::debug; |
| 14 | use traits::{translate_args, Reveal}; | |
| 14 | use traits::{Reveal, translate_args}; | |
| 15 | 15 | |
| 16 | 16 | use crate::errors::UnexpectedFnPtrAssociatedItem; |
| 17 | 17 |
compiler/rustc_ty_utils/src/layout.rs+21-36| ... | ... | @@ -9,7 +9,7 @@ use rustc_middle::bug; |
| 9 | 9 | use rustc_middle::mir::{CoroutineLayout, CoroutineSavedLocal}; |
| 10 | 10 | use rustc_middle::query::Providers; |
| 11 | 11 | use rustc_middle::ty::layout::{ |
| 12 | FloatExt, HasTyCtxt, IntegerExt, LayoutCx, LayoutError, LayoutOf, TyAndLayout, MAX_SIMD_LANES, | |
| 12 | FloatExt, HasTyCtxt, IntegerExt, LayoutCx, LayoutError, LayoutOf, MAX_SIMD_LANES, TyAndLayout, | |
| 13 | 13 | }; |
| 14 | 14 | use rustc_middle::ty::print::with_no_trimmed_paths; |
| 15 | 15 | use rustc_middle::ty::{ |
| ... | ... | @@ -194,20 +194,14 @@ fn layout_of_uncached<'tcx>( |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | // Basic scalars. |
| 197 | ty::Bool => tcx.mk_layout(LayoutS::scalar( | |
| 198 | cx, | |
| 199 | Scalar::Initialized { | |
| 200 | value: Int(I8, false), | |
| 201 | valid_range: WrappingRange { start: 0, end: 1 }, | |
| 202 | }, | |
| 203 | )), | |
| 204 | ty::Char => tcx.mk_layout(LayoutS::scalar( | |
| 205 | cx, | |
| 206 | Scalar::Initialized { | |
| 207 | value: Int(I32, false), | |
| 208 | valid_range: WrappingRange { start: 0, end: 0x10FFFF }, | |
| 209 | }, | |
| 210 | )), | |
| 197 | ty::Bool => tcx.mk_layout(LayoutS::scalar(cx, Scalar::Initialized { | |
| 198 | value: Int(I8, false), | |
| 199 | valid_range: WrappingRange { start: 0, end: 1 }, | |
| 200 | })), | |
| 201 | ty::Char => tcx.mk_layout(LayoutS::scalar(cx, Scalar::Initialized { | |
| 202 | value: Int(I32, false), | |
| 203 | valid_range: WrappingRange { start: 0, end: 0x10FFFF }, | |
| 204 | })), | |
| 211 | 205 | ty::Int(ity) => scalar(Int(Integer::from_int_ty(dl, ity), true)), |
| 212 | 206 | ty::Uint(ity) => scalar(Int(Integer::from_uint_ty(dl, ity), false)), |
| 213 | 207 | ty::Float(fty) => scalar(Float(Float::from_float_ty(fty))), |
| ... | ... | @@ -510,13 +504,10 @@ fn layout_of_uncached<'tcx>( |
| 510 | 504 | // Non-power-of-two vectors have padding up to the next power-of-two. |
| 511 | 505 | // If we're a packed repr, remove the padding while keeping the alignment as close |
| 512 | 506 | // to a vector as possible. |
| 513 | ( | |
| 514 | Abi::Aggregate { sized: true }, | |
| 515 | AbiAndPrefAlign { | |
| 516 | abi: Align::max_for_offset(size), | |
| 517 | pref: dl.vector_align(size).pref, | |
| 518 | }, | |
| 519 | ) | |
| 507 | (Abi::Aggregate { sized: true }, AbiAndPrefAlign { | |
| 508 | abi: Align::max_for_offset(size), | |
| 509 | pref: dl.vector_align(size).pref, | |
| 510 | }) | |
| 520 | 511 | } else { |
| 521 | 512 | (Abi::Vector { element: e_abi, count: e_len }, dl.vector_align(size)) |
| 522 | 513 | }; |
| ... | ... | @@ -1124,13 +1115,10 @@ fn variant_info_for_adt<'tcx>( |
| 1124 | 1115 | }) |
| 1125 | 1116 | .collect(); |
| 1126 | 1117 | |
| 1127 | ( | |
| 1128 | variant_infos, | |
| 1129 | match tag_encoding { | |
| 1130 | TagEncoding::Direct => Some(tag.size(cx)), | |
| 1131 | _ => None, | |
| 1132 | }, | |
| 1133 | ) | |
| 1118 | (variant_infos, match tag_encoding { | |
| 1119 | TagEncoding::Direct => Some(tag.size(cx)), | |
| 1120 | _ => None, | |
| 1121 | }) | |
| 1134 | 1122 | } |
| 1135 | 1123 | } |
| 1136 | 1124 | } |
| ... | ... | @@ -1250,11 +1238,8 @@ fn variant_info_for_coroutine<'tcx>( |
| 1250 | 1238 | let end_states: Vec<_> = end_states.collect(); |
| 1251 | 1239 | variant_infos.extend(end_states); |
| 1252 | 1240 | |
| 1253 | ( | |
| 1254 | variant_infos, | |
| 1255 | match tag_encoding { | |
| 1256 | TagEncoding::Direct => Some(tag.size(cx)), | |
| 1257 | _ => None, | |
| 1258 | }, | |
| 1259 | ) | |
| 1241 | (variant_infos, match tag_encoding { | |
| 1242 | TagEncoding::Direct => Some(tag.size(cx)), | |
| 1243 | _ => None, | |
| 1244 | }) | |
| 1260 | 1245 | } |
compiler/rustc_ty_utils/src/needs_drop.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ use rustc_data_structures::fx::FxHashSet; |
| 4 | 4 | use rustc_hir::def_id::DefId; |
| 5 | 5 | use rustc_middle::bug; |
| 6 | 6 | use rustc_middle::query::Providers; |
| 7 | use rustc_middle::ty::util::{needs_drop_components, AlwaysRequiresDrop}; | |
| 7 | use rustc_middle::ty::util::{AlwaysRequiresDrop, needs_drop_components}; | |
| 8 | 8 | use rustc_middle::ty::{self, EarlyBinder, GenericArgsRef, Ty, TyCtxt}; |
| 9 | 9 | use rustc_session::Limit; |
| 10 | 10 | use rustc_span::sym; |
compiler/rustc_ty_utils/src/opaque_types.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ use rustc_data_structures::fx::FxHashSet; |
| 2 | 2 | use rustc_hir::def::DefKind; |
| 3 | 3 | use rustc_hir::def_id::LocalDefId; |
| 4 | 4 | use rustc_hir::intravisit::Visitor; |
| 5 | use rustc_hir::{intravisit, CRATE_HIR_ID}; | |
| 5 | use rustc_hir::{CRATE_HIR_ID, intravisit}; | |
| 6 | 6 | use rustc_middle::bug; |
| 7 | 7 | use rustc_middle::query::Providers; |
| 8 | 8 | use rustc_middle::ty::util::{CheckRegions, NotUniqueParam}; |
compiler/rustc_ty_utils/src/ty.rs+2-2| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use rustc_data_structures::fx::FxHashSet; |
| 2 | 2 | use rustc_hir as hir; |
| 3 | use rustc_hir::def::DefKind; | |
| 4 | 3 | use rustc_hir::LangItem; |
| 4 | use rustc_hir::def::DefKind; | |
| 5 | 5 | use rustc_index::bit_set::BitSet; |
| 6 | 6 | use rustc_middle::bug; |
| 7 | 7 | use rustc_middle::query::Providers; |
| ... | ... | @@ -9,8 +9,8 @@ use rustc_middle::ty::{ |
| 9 | 9 | self, EarlyBinder, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable, TypeVisitableExt, |
| 10 | 10 | TypeVisitor, Upcast, |
| 11 | 11 | }; |
| 12 | use rustc_span::def_id::{DefId, LocalDefId, CRATE_DEF_ID}; | |
| 13 | 12 | use rustc_span::DUMMY_SP; |
| 13 | use rustc_span::def_id::{CRATE_DEF_ID, DefId, LocalDefId}; | |
| 14 | 14 | use rustc_trait_selection::traits; |
| 15 | 15 | use tracing::{debug, instrument}; |
| 16 | 16 |
compiler/rustc_type_ir/src/effects.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | use crate::Interner; | |
| 1 | 2 | use crate::inherent::*; |
| 2 | 3 | use crate::lang_items::TraitSolverLangItem::{EffectsMaybe, EffectsNoRuntime, EffectsRuntime}; |
| 3 | use crate::Interner; | |
| 4 | 4 | |
| 5 | 5 | #[derive(Clone, Copy, PartialEq, Eq)] |
| 6 | 6 | pub enum EffectKind { |
compiler/rustc_type_ir/src/elaborate.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ use smallvec::smallvec; |
| 4 | 4 | |
| 5 | 5 | use crate::data_structures::HashSet; |
| 6 | 6 | use crate::inherent::*; |
| 7 | use crate::outlives::{push_outlives_components, Component}; | |
| 7 | use crate::outlives::{Component, push_outlives_components}; | |
| 8 | 8 | use crate::{self as ty, Interner, Upcast as _}; |
| 9 | 9 | |
| 10 | 10 | /// "Elaboration" is the process of identifying all the predicates that |
compiler/rustc_type_ir/src/lib.rs+6-6| ... | ... | @@ -56,6 +56,12 @@ mod ty_info; |
| 56 | 56 | mod ty_kind; |
| 57 | 57 | mod upcast; |
| 58 | 58 | |
| 59 | pub use AliasTyKind::*; | |
| 60 | pub use DynKind::*; | |
| 61 | pub use InferTy::*; | |
| 62 | pub use RegionKind::*; | |
| 63 | pub use TyKind::*; | |
| 64 | pub use Variance::*; | |
| 59 | 65 | pub use binder::*; |
| 60 | 66 | pub use canonical::*; |
| 61 | 67 | #[cfg(feature = "nightly")] |
| ... | ... | @@ -73,12 +79,6 @@ pub use region_kind::*; |
| 73 | 79 | pub use ty_info::*; |
| 74 | 80 | pub use ty_kind::*; |
| 75 | 81 | pub use upcast::*; |
| 76 | pub use AliasTyKind::*; | |
| 77 | pub use DynKind::*; | |
| 78 | pub use InferTy::*; | |
| 79 | pub use RegionKind::*; | |
| 80 | pub use TyKind::*; | |
| 81 | pub use Variance::*; | |
| 82 | 82 | |
| 83 | 83 | rustc_index::newtype_index! { |
| 84 | 84 | /// A [De Bruijn index][dbi] is a standard means of representing |
compiler/rustc_type_ir/src/outlives.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | //! RFC for reference. |
| 4 | 4 | |
| 5 | 5 | use derive_where::derive_where; |
| 6 | use smallvec::{smallvec, SmallVec}; | |
| 6 | use smallvec::{SmallVec, smallvec}; | |
| 7 | 7 | |
| 8 | 8 | use crate::data_structures::SsoHashSet; |
| 9 | 9 | use crate::inherent::*; |
compiler/rustc_type_ir/src/predicate.rs+29-23| ... | ... | @@ -492,29 +492,35 @@ impl<I: Interner> AliasTerm<I> { |
| 492 | 492 | |
| 493 | 493 | pub fn to_term(self, interner: I) -> I::Term { |
| 494 | 494 | match self.kind(interner) { |
| 495 | AliasTermKind::ProjectionTy => Ty::new_alias( | |
| 496 | interner, | |
| 497 | ty::AliasTyKind::Projection, | |
| 498 | ty::AliasTy { def_id: self.def_id, args: self.args, _use_alias_ty_new_instead: () }, | |
| 499 | ) | |
| 500 | .into(), | |
| 501 | AliasTermKind::InherentTy => Ty::new_alias( | |
| 502 | interner, | |
| 503 | ty::AliasTyKind::Inherent, | |
| 504 | ty::AliasTy { def_id: self.def_id, args: self.args, _use_alias_ty_new_instead: () }, | |
| 505 | ) | |
| 506 | .into(), | |
| 507 | AliasTermKind::OpaqueTy => Ty::new_alias( | |
| 508 | interner, | |
| 509 | ty::AliasTyKind::Opaque, | |
| 510 | ty::AliasTy { def_id: self.def_id, args: self.args, _use_alias_ty_new_instead: () }, | |
| 511 | ) | |
| 512 | .into(), | |
| 513 | AliasTermKind::WeakTy => Ty::new_alias( | |
| 514 | interner, | |
| 515 | ty::AliasTyKind::Weak, | |
| 516 | ty::AliasTy { def_id: self.def_id, args: self.args, _use_alias_ty_new_instead: () }, | |
| 517 | ) | |
| 495 | AliasTermKind::ProjectionTy => { | |
| 496 | Ty::new_alias(interner, ty::AliasTyKind::Projection, ty::AliasTy { | |
| 497 | def_id: self.def_id, | |
| 498 | args: self.args, | |
| 499 | _use_alias_ty_new_instead: (), | |
| 500 | }) | |
| 501 | .into() | |
| 502 | } | |
| 503 | AliasTermKind::InherentTy => { | |
| 504 | Ty::new_alias(interner, ty::AliasTyKind::Inherent, ty::AliasTy { | |
| 505 | def_id: self.def_id, | |
| 506 | args: self.args, | |
| 507 | _use_alias_ty_new_instead: (), | |
| 508 | }) | |
| 509 | .into() | |
| 510 | } | |
| 511 | AliasTermKind::OpaqueTy => { | |
| 512 | Ty::new_alias(interner, ty::AliasTyKind::Opaque, ty::AliasTy { | |
| 513 | def_id: self.def_id, | |
| 514 | args: self.args, | |
| 515 | _use_alias_ty_new_instead: (), | |
| 516 | }) | |
| 517 | .into() | |
| 518 | } | |
| 519 | AliasTermKind::WeakTy => Ty::new_alias(interner, ty::AliasTyKind::Weak, ty::AliasTy { | |
| 520 | def_id: self.def_id, | |
| 521 | args: self.args, | |
| 522 | _use_alias_ty_new_instead: (), | |
| 523 | }) | |
| 518 | 524 | .into(), |
| 519 | 525 | AliasTermKind::UnevaluatedConst | AliasTermKind::ProjectionConst => { |
| 520 | 526 | I::Const::new_unevaluated( |
compiler/rustc_type_ir/src/ty_kind.rs+1-1| ... | ... | @@ -10,8 +10,8 @@ use rustc_data_structures::unify::{NoError, UnifyKey, UnifyValue}; |
| 10 | 10 | use rustc_macros::{Decodable, Encodable, HashStable_NoContext, TyDecodable, TyEncodable}; |
| 11 | 11 | use rustc_type_ir_macros::{Lift_Generic, TypeFoldable_Generic, TypeVisitable_Generic}; |
| 12 | 12 | |
| 13 | pub use self::closure::*; | |
| 14 | 13 | use self::TyKind::*; |
| 14 | pub use self::closure::*; | |
| 15 | 15 | use crate::inherent::*; |
| 16 | 16 | use crate::{self as ty, DebruijnIndex, Interner}; |
| 17 | 17 |
compiler/rustc_type_ir/src/ty_kind/closure.rs+10-13| ... | ... | @@ -3,7 +3,7 @@ use std::ops::ControlFlow; |
| 3 | 3 | use derive_where::derive_where; |
| 4 | 4 | use rustc_type_ir_macros::{Lift_Generic, TypeFoldable_Generic, TypeVisitable_Generic}; |
| 5 | 5 | |
| 6 | use crate::fold::{shift_region, TypeFoldable, TypeFolder, TypeSuperFoldable}; | |
| 6 | use crate::fold::{TypeFoldable, TypeFolder, TypeSuperFoldable, shift_region}; | |
| 7 | 7 | use crate::inherent::*; |
| 8 | 8 | use crate::visit::{TypeSuperVisitable, TypeVisitable, TypeVisitor}; |
| 9 | 9 | use crate::{self as ty, Interner}; |
| ... | ... | @@ -394,18 +394,15 @@ impl<I: Interner> CoroutineClosureSignature<I> { |
| 394 | 394 | coroutine_def_id: I::DefId, |
| 395 | 395 | tupled_upvars_ty: I::Ty, |
| 396 | 396 | ) -> I::Ty { |
| 397 | let coroutine_args = ty::CoroutineArgs::new( | |
| 398 | cx, | |
| 399 | ty::CoroutineArgsParts { | |
| 400 | parent_args, | |
| 401 | kind_ty: coroutine_kind_ty, | |
| 402 | resume_ty: self.resume_ty, | |
| 403 | yield_ty: self.yield_ty, | |
| 404 | return_ty: self.return_ty, | |
| 405 | witness: self.interior, | |
| 406 | tupled_upvars_ty, | |
| 407 | }, | |
| 408 | ); | |
| 397 | let coroutine_args = ty::CoroutineArgs::new(cx, ty::CoroutineArgsParts { | |
| 398 | parent_args, | |
| 399 | kind_ty: coroutine_kind_ty, | |
| 400 | resume_ty: self.resume_ty, | |
| 401 | yield_ty: self.yield_ty, | |
| 402 | return_ty: self.return_ty, | |
| 403 | witness: self.interior, | |
| 404 | tupled_upvars_ty, | |
| 405 | }); | |
| 409 | 406 | |
| 410 | 407 | Ty::new_coroutine(cx, coroutine_def_id, coroutine_args.args) |
| 411 | 408 | } |
compiler/rustc_type_ir_macros/src/lib.rs+26-35| ... | ... | @@ -35,17 +35,14 @@ fn type_foldable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::Toke |
| 35 | 35 | }) |
| 36 | 36 | }); |
| 37 | 37 | |
| 38 | s.bound_impl( | |
| 39 | quote!(::rustc_type_ir::fold::TypeFoldable<I>), | |
| 40 | quote! { | |
| 41 | fn try_fold_with<__F: ::rustc_type_ir::fold::FallibleTypeFolder<I>>( | |
| 42 | self, | |
| 43 | __folder: &mut __F | |
| 44 | ) -> Result<Self, __F::Error> { | |
| 45 | Ok(match self { #body_fold }) | |
| 46 | } | |
| 47 | }, | |
| 48 | ) | |
| 38 | s.bound_impl(quote!(::rustc_type_ir::fold::TypeFoldable<I>), quote! { | |
| 39 | fn try_fold_with<__F: ::rustc_type_ir::fold::FallibleTypeFolder<I>>( | |
| 40 | self, | |
| 41 | __folder: &mut __F | |
| 42 | ) -> Result<Self, __F::Error> { | |
| 43 | Ok(match self { #body_fold }) | |
| 44 | } | |
| 45 | }) | |
| 49 | 46 | } |
| 50 | 47 | |
| 51 | 48 | fn lift_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream { |
| ... | ... | @@ -85,19 +82,16 @@ fn lift_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::TokenStream { |
| 85 | 82 | let self_ty: syn::Type = parse_quote! { #name #ty_generics }; |
| 86 | 83 | let lifted_ty = lift(self_ty); |
| 87 | 84 | |
| 88 | s.bound_impl( | |
| 89 | quote!(::rustc_type_ir::lift::Lift<J>), | |
| 90 | quote! { | |
| 91 | type Lifted = #lifted_ty; | |
| 85 | s.bound_impl(quote!(::rustc_type_ir::lift::Lift<J>), quote! { | |
| 86 | type Lifted = #lifted_ty; | |
| 92 | 87 | |
| 93 | fn lift_to_interner( | |
| 94 | self, | |
| 95 | interner: J, | |
| 96 | ) -> Option<Self::Lifted> { | |
| 97 | Some(match self { #body_fold }) | |
| 98 | } | |
| 99 | }, | |
| 100 | ) | |
| 88 | fn lift_to_interner( | |
| 89 | self, | |
| 90 | interner: J, | |
| 91 | ) -> Option<Self::Lifted> { | |
| 92 | Some(match self { #body_fold }) | |
| 93 | } | |
| 94 | }) | |
| 101 | 95 | } |
| 102 | 96 | |
| 103 | 97 | fn lift(mut ty: syn::Type) -> syn::Type { |
| ... | ... | @@ -145,16 +139,13 @@ fn type_visitable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::Tok |
| 145 | 139 | }); |
| 146 | 140 | s.bind_with(|_| synstructure::BindStyle::Move); |
| 147 | 141 | |
| 148 | s.bound_impl( | |
| 149 | quote!(::rustc_type_ir::visit::TypeVisitable<I>), | |
| 150 | quote! { | |
| 151 | fn visit_with<__V: ::rustc_type_ir::visit::TypeVisitor<I>>( | |
| 152 | &self, | |
| 153 | __visitor: &mut __V | |
| 154 | ) -> __V::Result { | |
| 155 | match *self { #body_visit } | |
| 156 | <__V::Result as ::rustc_ast_ir::visit::VisitorResult>::output() | |
| 157 | } | |
| 158 | }, | |
| 159 | ) | |
| 142 | s.bound_impl(quote!(::rustc_type_ir::visit::TypeVisitable<I>), quote! { | |
| 143 | fn visit_with<__V: ::rustc_type_ir::visit::TypeVisitor<I>>( | |
| 144 | &self, | |
| 145 | __visitor: &mut __V | |
| 146 | ) -> __V::Result { | |
| 147 | match *self { #body_visit } | |
| 148 | <__V::Result as ::rustc_ast_ir::visit::VisitorResult>::output() | |
| 149 | } | |
| 150 | }) | |
| 160 | 151 | } |
compiler/stable_mir/src/abi.rs+1-1| ... | ... | @@ -8,7 +8,7 @@ use crate::compiler_interface::with; |
| 8 | 8 | use crate::mir::FieldIdx; |
| 9 | 9 | use crate::target::{MachineInfo, MachineSize as Size}; |
| 10 | 10 | use crate::ty::{Align, IndexedVal, Ty, VariantIdx}; |
| 11 | use crate::{error, Error, Opaque}; | |
| 11 | use crate::{Error, Opaque, error}; | |
| 12 | 12 | |
| 13 | 13 | /// A function ABI definition. |
| 14 | 14 | #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize)] |
compiler/stable_mir/src/compiler_interface.rs+2-2| ... | ... | @@ -18,8 +18,8 @@ use crate::ty::{ |
| 18 | 18 | TraitDef, Ty, TyConst, TyConstId, TyKind, UintTy, VariantDef, |
| 19 | 19 | }; |
| 20 | 20 | use crate::{ |
| 21 | mir, Crate, CrateItem, CrateItems, CrateNum, DefId, Error, Filename, ImplTraitDecls, ItemKind, | |
| 22 | Symbol, TraitDecls, | |
| 21 | Crate, CrateItem, CrateItems, CrateNum, DefId, Error, Filename, ImplTraitDecls, ItemKind, | |
| 22 | Symbol, TraitDecls, mir, | |
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | 25 | /// This trait defines the interface between stable_mir and the Rust compiler. |
compiler/stable_mir/src/crate_def.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | use serde::Serialize; |
| 5 | 5 | |
| 6 | 6 | use crate::ty::{GenericArgs, Span, Ty}; |
| 7 | use crate::{with, Crate, Symbol}; | |
| 7 | use crate::{Crate, Symbol, with}; | |
| 8 | 8 | |
| 9 | 9 | /// A unique identification number for each item accessible for the current compilation unit. |
| 10 | 10 | #[derive(Clone, Copy, PartialEq, Eq, Hash, Serialize)] |
compiler/stable_mir/src/mir/alloc.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ use serde::Serialize; |
| 7 | 7 | use crate::mir::mono::{Instance, StaticDef}; |
| 8 | 8 | use crate::target::{Endian, MachineInfo}; |
| 9 | 9 | use crate::ty::{Allocation, Binder, ExistentialTraitRef, IndexedVal, Ty}; |
| 10 | use crate::{with, Error}; | |
| 10 | use crate::{Error, with}; | |
| 11 | 11 | |
| 12 | 12 | /// An allocation in the SMIR global memory can be either a function pointer, |
| 13 | 13 | /// a static, or a "real" allocation with some data in it. |
compiler/stable_mir/src/mir/mono.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ use crate::abi::FnAbi; |
| 7 | 7 | use crate::crate_def::CrateDef; |
| 8 | 8 | use crate::mir::Body; |
| 9 | 9 | use crate::ty::{Allocation, ClosureDef, ClosureKind, FnDef, GenericArgs, IndexedVal, Ty}; |
| 10 | use crate::{with, CrateItem, DefId, Error, ItemKind, Opaque, Symbol}; | |
| 10 | use crate::{CrateItem, DefId, Error, ItemKind, Opaque, Symbol, with}; | |
| 11 | 11 | |
| 12 | 12 | #[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize)] |
| 13 | 13 | pub enum MonoItem { |
compiler/stable_mir/src/mir/pretty.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ use fmt::{Display, Formatter}; |
| 7 | 7 | use super::{AssertMessage, BinOp, BorrowKind, FakeBorrowKind, TerminatorKind}; |
| 8 | 8 | use crate::mir::{Operand, Place, Rvalue, StatementKind, UnwindAction, VarDebugInfoContents}; |
| 9 | 9 | use crate::ty::{IndexedVal, MirConst, Ty, TyConst}; |
| 10 | use crate::{with, Body, Mutability}; | |
| 10 | use crate::{Body, Mutability, with}; | |
| 11 | 11 | |
| 12 | 12 | impl Display for Ty { |
| 13 | 13 | fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { |
compiler/stable_mir/src/ty.rs+2-2| ... | ... | @@ -4,10 +4,10 @@ use std::ops::Range; |
| 4 | 4 | use serde::Serialize; |
| 5 | 5 | |
| 6 | 6 | use super::mir::{Body, Mutability, Safety}; |
| 7 | use super::{with, DefId, Error, Symbol}; | |
| 7 | use super::{DefId, Error, Symbol, with}; | |
| 8 | 8 | use crate::abi::{FnAbi, Layout}; |
| 9 | 9 | use crate::crate_def::{CrateDef, CrateDefType}; |
| 10 | use crate::mir::alloc::{read_target_int, read_target_uint, AllocId}; | |
| 10 | use crate::mir::alloc::{AllocId, read_target_int, read_target_uint}; | |
| 11 | 11 | use crate::mir::mono::StaticDef; |
| 12 | 12 | use crate::target::MachineInfo; |
| 13 | 13 | use crate::{Filename, Opaque}; |
compiler/stable_mir/src/visitor.rs+1-1| ... | ... | @@ -4,8 +4,8 @@ use super::ty::{ |
| 4 | 4 | Allocation, Binder, ConstDef, ExistentialPredicate, FnSig, GenericArgKind, GenericArgs, |
| 5 | 5 | MirConst, Promoted, Region, RigidTy, TermKind, Ty, UnevaluatedConst, |
| 6 | 6 | }; |
| 7 | use crate::ty::TyConst; | |
| 8 | 7 | use crate::Opaque; |
| 8 | use crate::ty::TyConst; | |
| 9 | 9 | |
| 10 | 10 | pub trait Visitor: Sized { |
| 11 | 11 | type Break; |
library/alloc/benches/binary_heap.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use std::collections::BinaryHeap; |
| 2 | 2 | |
| 3 | 3 | use rand::seq::SliceRandom; |
| 4 | use test::{black_box, Bencher}; | |
| 4 | use test::{Bencher, black_box}; | |
| 5 | 5 | |
| 6 | 6 | #[bench] |
| 7 | 7 | fn bench_find_smallest_1000(b: &mut Bencher) { |
library/alloc/benches/btree/map.rs+2-2| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | use std::collections::BTreeMap; |
| 2 | 2 | use std::ops::RangeBounds; |
| 3 | 3 | |
| 4 | use rand::seq::SliceRandom; | |
| 5 | 4 | use rand::Rng; |
| 6 | use test::{black_box, Bencher}; | |
| 5 | use rand::seq::SliceRandom; | |
| 6 | use test::{Bencher, black_box}; | |
| 7 | 7 | |
| 8 | 8 | macro_rules! map_insert_rand_bench { |
| 9 | 9 | ($name: ident, $n: expr, $map: ident) => { |
library/alloc/benches/slice.rs+2-2| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use std::{mem, ptr}; |
| 2 | 2 | |
| 3 | use rand::distributions::{Alphanumeric, DistString, Standard}; | |
| 4 | 3 | use rand::Rng; |
| 5 | use test::{black_box, Bencher}; | |
| 4 | use rand::distributions::{Alphanumeric, DistString, Standard}; | |
| 5 | use test::{Bencher, black_box}; | |
| 6 | 6 | |
| 7 | 7 | #[bench] |
| 8 | 8 | fn iterator(b: &mut Bencher) { |
library/alloc/benches/str.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use test::{black_box, Bencher}; | |
| 1 | use test::{Bencher, black_box}; | |
| 2 | 2 | |
| 3 | 3 | #[bench] |
| 4 | 4 | fn char_iterator(b: &mut Bencher) { |
library/alloc/benches/string.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use std::iter::repeat; |
| 2 | 2 | |
| 3 | use test::{black_box, Bencher}; | |
| 3 | use test::{Bencher, black_box}; | |
| 4 | 4 | |
| 5 | 5 | #[bench] |
| 6 | 6 | fn bench_with_capacity(b: &mut Bencher) { |
library/alloc/benches/vec.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use std::iter::repeat; |
| 2 | 2 | |
| 3 | 3 | use rand::RngCore; |
| 4 | use test::{black_box, Bencher}; | |
| 4 | use test::{Bencher, black_box}; | |
| 5 | 5 | |
| 6 | 6 | #[bench] |
| 7 | 7 | fn bench_new(b: &mut Bencher) { |
library/alloc/benches/vec_deque.rs+2-2| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | use std::collections::{vec_deque, VecDeque}; | |
| 1 | use std::collections::{VecDeque, vec_deque}; | |
| 2 | 2 | use std::mem; |
| 3 | 3 | |
| 4 | use test::{black_box, Bencher}; | |
| 4 | use test::{Bencher, black_box}; | |
| 5 | 5 | |
| 6 | 6 | #[bench] |
| 7 | 7 | fn bench_new(b: &mut Bencher) { |
library/alloc/src/boxed.rs+5-2| ... | ... | @@ -199,7 +199,7 @@ use core::ops::{ |
| 199 | 199 | DerefPure, DispatchFromDyn, Receiver, |
| 200 | 200 | }; |
| 201 | 201 | use core::pin::{Pin, PinCoerceUnsized}; |
| 202 | use core::ptr::{self, addr_of_mut, NonNull, Unique}; | |
| 202 | use core::ptr::{self, NonNull, Unique, addr_of_mut}; | |
| 203 | 203 | use core::task::{Context, Poll}; |
| 204 | 204 | use core::{borrow, fmt, slice}; |
| 205 | 205 | |
| ... | ... | @@ -2480,7 +2480,10 @@ impl<Args: Tuple, F: AsyncFnOnce<Args> + ?Sized, A: Allocator> AsyncFnOnce<Args> |
| 2480 | 2480 | |
| 2481 | 2481 | #[unstable(feature = "async_fn_traits", issue = "none")] |
| 2482 | 2482 | impl<Args: Tuple, F: AsyncFnMut<Args> + ?Sized, A: Allocator> AsyncFnMut<Args> for Box<F, A> { |
| 2483 | type CallRefFuture<'a> = F::CallRefFuture<'a> where Self: 'a; | |
| 2483 | type CallRefFuture<'a> | |
| 2484 | = F::CallRefFuture<'a> | |
| 2485 | where | |
| 2486 | Self: 'a; | |
| 2484 | 2487 | |
| 2485 | 2488 | extern "rust-call" fn async_call_mut(&mut self, args: Args) -> Self::CallRefFuture<'_> { |
| 2486 | 2489 | F::async_call_mut(self, args) |
library/alloc/src/collections/binary_heap/mod.rs+1-1| ... | ... | @@ -145,7 +145,7 @@ |
| 145 | 145 | |
| 146 | 146 | use core::alloc::Allocator; |
| 147 | 147 | use core::iter::{FusedIterator, InPlaceIterable, SourceIter, TrustedFused, TrustedLen}; |
| 148 | use core::mem::{self, swap, ManuallyDrop}; | |
| 148 | use core::mem::{self, ManuallyDrop, swap}; | |
| 149 | 149 | use core::num::NonZero; |
| 150 | 150 | use core::ops::{Deref, DerefMut}; |
| 151 | 151 | use core::{fmt, ptr}; |
library/alloc/src/collections/binary_heap/tests.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use std::panic::{catch_unwind, AssertUnwindSafe}; | |
| 1 | use std::panic::{AssertUnwindSafe, catch_unwind}; | |
| 2 | 2 | |
| 3 | 3 | use super::*; |
| 4 | 4 | use crate::boxed::Box; |
library/alloc/src/collections/btree/fix.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ use core::alloc::Allocator; |
| 3 | 3 | use super::map::MIN_LEN; |
| 4 | 4 | use super::node::ForceResult::*; |
| 5 | 5 | use super::node::LeftOrRight::*; |
| 6 | use super::node::{marker, Handle, NodeRef, Root}; | |
| 6 | use super::node::{Handle, NodeRef, Root, marker}; | |
| 7 | 7 | |
| 8 | 8 | impl<'a, K: 'a, V: 'a> NodeRef<marker::Mut<'a>, K, V, marker::LeafOrInternal> { |
| 9 | 9 | /// Stocks up a possibly underfull node by merging with or stealing from a |
library/alloc/src/collections/btree/map.rs+2-2| ... | ... | @@ -13,7 +13,7 @@ use super::borrow::DormantMutRef; |
| 13 | 13 | use super::dedup_sorted_iter::DedupSortedIter; |
| 14 | 14 | use super::navigate::{LazyLeafRange, LeafRange}; |
| 15 | 15 | use super::node::ForceResult::*; |
| 16 | use super::node::{self, marker, Handle, NodeRef, Root}; | |
| 16 | use super::node::{self, Handle, NodeRef, Root, marker}; | |
| 17 | 17 | use super::search::SearchBound; |
| 18 | 18 | use super::search::SearchResult::*; |
| 19 | 19 | use super::set_val::SetValZST; |
| ... | ... | @@ -22,9 +22,9 @@ use crate::vec::Vec; |
| 22 | 22 | |
| 23 | 23 | mod entry; |
| 24 | 24 | |
| 25 | use Entry::*; | |
| 25 | 26 | #[stable(feature = "rust1", since = "1.0.0")] |
| 26 | 27 | pub use entry::{Entry, OccupiedEntry, OccupiedError, VacantEntry}; |
| 27 | use Entry::*; | |
| 28 | 28 | |
| 29 | 29 | /// Minimum number of elements in a node that is not a root. |
| 30 | 30 | /// We might temporarily have fewer elements during methods. |
library/alloc/src/collections/btree/map/entry.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ use core::mem; |
| 5 | 5 | use Entry::*; |
| 6 | 6 | |
| 7 | 7 | use super::super::borrow::DormantMutRef; |
| 8 | use super::super::node::{marker, Handle, NodeRef}; | |
| 8 | use super::super::node::{Handle, NodeRef, marker}; | |
| 9 | 9 | use super::BTreeMap; |
| 10 | 10 | use crate::alloc::{Allocator, Global}; |
| 11 | 11 |
library/alloc/src/collections/btree/map/tests.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use core::assert_matches::assert_matches; |
| 2 | 2 | use std::iter; |
| 3 | 3 | use std::ops::Bound::{Excluded, Included, Unbounded}; |
| 4 | use std::panic::{catch_unwind, AssertUnwindSafe}; | |
| 4 | use std::panic::{AssertUnwindSafe, catch_unwind}; | |
| 5 | 5 | use std::sync::atomic::AtomicUsize; |
| 6 | 6 | use std::sync::atomic::Ordering::SeqCst; |
| 7 | 7 |
library/alloc/src/collections/btree/navigate.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ use core::ops::RangeBounds; |
| 3 | 3 | use core::{hint, ptr}; |
| 4 | 4 | |
| 5 | 5 | use super::node::ForceResult::*; |
| 6 | use super::node::{marker, Handle, NodeRef}; | |
| 6 | use super::node::{Handle, NodeRef, marker}; | |
| 7 | 7 | use super::search::SearchBound; |
| 8 | 8 | use crate::alloc::Allocator; |
| 9 | 9 | // `front` and `back` are always both `None` or both `Some`. |
library/alloc/src/collections/btree/remove.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ use core::alloc::Allocator; |
| 3 | 3 | use super::map::MIN_LEN; |
| 4 | 4 | use super::node::ForceResult::*; |
| 5 | 5 | use super::node::LeftOrRight::*; |
| 6 | use super::node::{marker, Handle, NodeRef}; | |
| 6 | use super::node::{Handle, NodeRef, marker}; | |
| 7 | 7 | |
| 8 | 8 | impl<'a, K: 'a, V: 'a> Handle<NodeRef<marker::Mut<'a>, K, V, marker::LeafOrInternal>, marker::KV> { |
| 9 | 9 | /// Removes a key-value pair from the tree, and returns that pair, as well as |
library/alloc/src/collections/btree/search.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ use SearchBound::*; |
| 6 | 6 | use SearchResult::*; |
| 7 | 7 | |
| 8 | 8 | use super::node::ForceResult::*; |
| 9 | use super::node::{marker, Handle, NodeRef}; | |
| 9 | use super::node::{Handle, NodeRef, marker}; | |
| 10 | 10 | |
| 11 | 11 | pub enum SearchBound<T> { |
| 12 | 12 | /// An inclusive bound to look for, just like `Bound::Included(T)`. |
library/alloc/src/collections/btree/set.rs+1-1| ... | ... | @@ -7,10 +7,10 @@ use core::iter::{FusedIterator, Peekable}; |
| 7 | 7 | use core::mem::ManuallyDrop; |
| 8 | 8 | use core::ops::{BitAnd, BitOr, BitXor, Bound, RangeBounds, Sub}; |
| 9 | 9 | |
| 10 | use super::Recover; | |
| 10 | 11 | use super::map::{BTreeMap, Keys}; |
| 11 | 12 | use super::merge_iter::MergeIterInner; |
| 12 | 13 | use super::set_val::SetValZST; |
| 13 | use super::Recover; | |
| 14 | 14 | use crate::alloc::{Allocator, Global}; |
| 15 | 15 | use crate::vec::Vec; |
| 16 | 16 |
library/alloc/src/collections/btree/set/tests.rs+7-11| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use std::ops::Bound::{Excluded, Included}; |
| 2 | use std::panic::{catch_unwind, AssertUnwindSafe}; | |
| 2 | use std::panic::{AssertUnwindSafe, catch_unwind}; | |
| 3 | 3 | |
| 4 | 4 | use super::*; |
| 5 | 5 | use crate::testing::crash_test::{CrashTestDummy, Panic}; |
| ... | ... | @@ -132,11 +132,9 @@ fn test_difference() { |
| 132 | 132 | check_difference(&[1, 3, 5, 9, 11], &[3, 6, 9], &[1, 5, 11]); |
| 133 | 133 | check_difference(&[1, 3, 5, 9, 11], &[0, 1], &[3, 5, 9, 11]); |
| 134 | 134 | check_difference(&[1, 3, 5, 9, 11], &[11, 12], &[1, 3, 5, 9]); |
| 135 | check_difference( | |
| 136 | &[-5, 11, 22, 33, 40, 42], | |
| 137 | &[-12, -5, 14, 23, 34, 38, 39, 50], | |
| 138 | &[11, 22, 33, 40, 42], | |
| 139 | ); | |
| 135 | check_difference(&[-5, 11, 22, 33, 40, 42], &[-12, -5, 14, 23, 34, 38, 39, 50], &[ | |
| 136 | 11, 22, 33, 40, 42, | |
| 137 | ]); | |
| 140 | 138 | |
| 141 | 139 | if cfg!(miri) { |
| 142 | 140 | // Miri is too slow |
| ... | ... | @@ -252,11 +250,9 @@ fn test_union() { |
| 252 | 250 | check_union(&[], &[], &[]); |
| 253 | 251 | check_union(&[1, 2, 3], &[2], &[1, 2, 3]); |
| 254 | 252 | check_union(&[2], &[1, 2, 3], &[1, 2, 3]); |
| 255 | check_union( | |
| 256 | &[1, 3, 5, 9, 11, 16, 19, 24], | |
| 257 | &[-2, 1, 5, 9, 13, 19], | |
| 258 | &[-2, 1, 3, 5, 9, 11, 13, 16, 19, 24], | |
| 259 | ); | |
| 253 | check_union(&[1, 3, 5, 9, 11, 16, 19, 24], &[-2, 1, 5, 9, 13, 19], &[ | |
| 254 | -2, 1, 3, 5, 9, 11, 13, 16, 19, 24, | |
| 255 | ]); | |
| 260 | 256 | } |
| 261 | 257 | |
| 262 | 258 | #[test] |
library/alloc/src/collections/linked_list/tests.rs+13-17| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | // FIXME(static_mut_refs): Do not allow `static_mut_refs` lint |
| 2 | 2 | #![allow(static_mut_refs)] |
| 3 | 3 | |
| 4 | use std::panic::{catch_unwind, AssertUnwindSafe}; | |
| 4 | use std::panic::{AssertUnwindSafe, catch_unwind}; | |
| 5 | 5 | use std::thread; |
| 6 | 6 | |
| 7 | 7 | use rand::RngCore; |
| ... | ... | @@ -696,10 +696,9 @@ fn test_cursor_mut_insert() { |
| 696 | 696 | cursor.splice_after(p); |
| 697 | 697 | cursor.splice_before(q); |
| 698 | 698 | check_links(&m); |
| 699 | assert_eq!( | |
| 700 | m.iter().cloned().collect::<Vec<_>>(), | |
| 701 | &[200, 201, 202, 203, 1, 100, 101, 102, 103, 8, 2, 3, 4, 5, 6] | |
| 702 | ); | |
| 699 | assert_eq!(m.iter().cloned().collect::<Vec<_>>(), &[ | |
| 700 | 200, 201, 202, 203, 1, 100, 101, 102, 103, 8, 2, 3, 4, 5, 6 | |
| 701 | ]); | |
| 703 | 702 | let mut cursor = m.cursor_front_mut(); |
| 704 | 703 | cursor.move_prev(); |
| 705 | 704 | let tmp = cursor.split_before(); |
| ... | ... | @@ -916,10 +915,9 @@ fn extract_if_complex() { |
| 916 | 915 | assert_eq!(removed, vec![2, 4, 6, 18, 20, 22, 24, 26, 34, 36]); |
| 917 | 916 | |
| 918 | 917 | assert_eq!(list.len(), 14); |
| 919 | assert_eq!( | |
| 920 | list.into_iter().collect::<Vec<_>>(), | |
| 921 | vec![1, 7, 9, 11, 13, 15, 17, 27, 29, 31, 33, 35, 37, 39] | |
| 922 | ); | |
| 918 | assert_eq!(list.into_iter().collect::<Vec<_>>(), vec![ | |
| 919 | 1, 7, 9, 11, 13, 15, 17, 27, 29, 31, 33, 35, 37, 39 | |
| 920 | ]); | |
| 923 | 921 | } |
| 924 | 922 | |
| 925 | 923 | { |
| ... | ... | @@ -934,10 +932,9 @@ fn extract_if_complex() { |
| 934 | 932 | assert_eq!(removed, vec![2, 4, 6, 18, 20, 22, 24, 26, 34, 36]); |
| 935 | 933 | |
| 936 | 934 | assert_eq!(list.len(), 13); |
| 937 | assert_eq!( | |
| 938 | list.into_iter().collect::<Vec<_>>(), | |
| 939 | vec![7, 9, 11, 13, 15, 17, 27, 29, 31, 33, 35, 37, 39] | |
| 940 | ); | |
| 935 | assert_eq!(list.into_iter().collect::<Vec<_>>(), vec![ | |
| 936 | 7, 9, 11, 13, 15, 17, 27, 29, 31, 33, 35, 37, 39 | |
| 937 | ]); | |
| 941 | 938 | } |
| 942 | 939 | |
| 943 | 940 | { |
| ... | ... | @@ -952,10 +949,9 @@ fn extract_if_complex() { |
| 952 | 949 | assert_eq!(removed, vec![2, 4, 6, 18, 20, 22, 24, 26, 34, 36]); |
| 953 | 950 | |
| 954 | 951 | assert_eq!(list.len(), 11); |
| 955 | assert_eq!( | |
| 956 | list.into_iter().collect::<Vec<_>>(), | |
| 957 | vec![7, 9, 11, 13, 15, 17, 27, 29, 31, 33, 35] | |
| 958 | ); | |
| 952 | assert_eq!(list.into_iter().collect::<Vec<_>>(), vec![ | |
| 953 | 7, 9, 11, 13, 15, 17, 27, 29, 31, 33, 35 | |
| 954 | ]); | |
| 959 | 955 | } |
| 960 | 956 | |
| 961 | 957 | { |
library/alloc/src/collections/vec_deque/mod.rs+1-1| ... | ... | @@ -9,7 +9,7 @@ |
| 9 | 9 | |
| 10 | 10 | use core::cmp::{self, Ordering}; |
| 11 | 11 | use core::hash::{Hash, Hasher}; |
| 12 | use core::iter::{repeat_n, repeat_with, ByRefSized}; | |
| 12 | use core::iter::{ByRefSized, repeat_n, repeat_with}; | |
| 13 | 13 | // This is used in a bunch of intra-doc links. |
| 14 | 14 | // FIXME: For some reason, `#[cfg(doc)]` wasn't sufficient, resulting in |
| 15 | 15 | // failures in linkchecker even though rustdoc built the docs just fine. |
library/alloc/src/collections/vec_deque/tests.rs+3-4| ... | ... | @@ -562,10 +562,9 @@ fn make_contiguous_head_to_end() { |
| 562 | 562 | tester.push_front(i as char); |
| 563 | 563 | } |
| 564 | 564 | |
| 565 | assert_eq!( | |
| 566 | tester, | |
| 567 | ['P', 'O', 'N', 'M', 'L', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K'] | |
| 568 | ); | |
| 565 | assert_eq!(tester, [ | |
| 566 | 'P', 'O', 'N', 'M', 'L', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K' | |
| 567 | ]); | |
| 569 | 568 | |
| 570 | 569 | // ABCDEFGHIJKPONML |
| 571 | 570 | let expected_start = 0; |
library/alloc/src/ffi/c_str.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | mod tests; |
| 5 | 5 | |
| 6 | 6 | use core::borrow::Borrow; |
| 7 | use core::ffi::{c_char, CStr}; | |
| 7 | use core::ffi::{CStr, c_char}; | |
| 8 | 8 | use core::num::NonZero; |
| 9 | 9 | use core::slice::memchr; |
| 10 | 10 | use core::str::{self, Utf8Error}; |
library/alloc/src/fmt.rs+3-3| ... | ... | @@ -580,10 +580,8 @@ |
| 580 | 580 | pub use core::fmt::Alignment; |
| 581 | 581 | #[stable(feature = "rust1", since = "1.0.0")] |
| 582 | 582 | pub use core::fmt::Error; |
| 583 | #[unstable(feature = "debug_closure_helpers", issue = "117729")] | |
| 584 | pub use core::fmt::{from_fn, FromFn}; | |
| 585 | 583 | #[stable(feature = "rust1", since = "1.0.0")] |
| 586 | pub use core::fmt::{write, Arguments}; | |
| 584 | pub use core::fmt::{Arguments, write}; | |
| 587 | 585 | #[stable(feature = "rust1", since = "1.0.0")] |
| 588 | 586 | pub use core::fmt::{Binary, Octal}; |
| 589 | 587 | #[stable(feature = "rust1", since = "1.0.0")] |
| ... | ... | @@ -592,6 +590,8 @@ pub use core::fmt::{Debug, Display}; |
| 592 | 590 | pub use core::fmt::{DebugList, DebugMap, DebugSet, DebugStruct, DebugTuple}; |
| 593 | 591 | #[stable(feature = "rust1", since = "1.0.0")] |
| 594 | 592 | pub use core::fmt::{Formatter, Result, Write}; |
| 593 | #[unstable(feature = "debug_closure_helpers", issue = "117729")] | |
| 594 | pub use core::fmt::{FromFn, from_fn}; | |
| 595 | 595 | #[stable(feature = "rust1", since = "1.0.0")] |
| 596 | 596 | pub use core::fmt::{LowerExp, UpperExp}; |
| 597 | 597 | #[stable(feature = "rust1", since = "1.0.0")] |
library/alloc/src/rc.rs+2-2| ... | ... | @@ -251,13 +251,13 @@ use core::intrinsics::abort; |
| 251 | 251 | #[cfg(not(no_global_oom_handling))] |
| 252 | 252 | use core::iter; |
| 253 | 253 | use core::marker::{PhantomData, Unsize}; |
| 254 | use core::mem::{self, align_of_val_raw, ManuallyDrop}; | |
| 254 | use core::mem::{self, ManuallyDrop, align_of_val_raw}; | |
| 255 | 255 | use core::ops::{CoerceUnsized, Deref, DerefMut, DerefPure, DispatchFromDyn, Receiver}; |
| 256 | 256 | use core::panic::{RefUnwindSafe, UnwindSafe}; |
| 257 | 257 | #[cfg(not(no_global_oom_handling))] |
| 258 | 258 | use core::pin::Pin; |
| 259 | 259 | use core::pin::PinCoerceUnsized; |
| 260 | use core::ptr::{self, drop_in_place, NonNull}; | |
| 260 | use core::ptr::{self, NonNull, drop_in_place}; | |
| 261 | 261 | #[cfg(not(no_global_oom_handling))] |
| 262 | 262 | use core::slice::from_raw_parts_mut; |
| 263 | 263 | use core::{borrow, fmt, hint}; |
library/alloc/src/slice.rs+8-8| ... | ... | @@ -43,14 +43,6 @@ pub use core::slice::ArrayWindows; |
| 43 | 43 | pub use core::slice::EscapeAscii; |
| 44 | 44 | #[stable(feature = "slice_get_slice", since = "1.28.0")] |
| 45 | 45 | pub use core::slice::SliceIndex; |
| 46 | #[stable(feature = "from_ref", since = "1.28.0")] | |
| 47 | pub use core::slice::{from_mut, from_ref}; | |
| 48 | #[unstable(feature = "slice_from_ptr_range", issue = "89792")] | |
| 49 | pub use core::slice::{from_mut_ptr_range, from_ptr_range}; | |
| 50 | #[stable(feature = "rust1", since = "1.0.0")] | |
| 51 | pub use core::slice::{from_raw_parts, from_raw_parts_mut}; | |
| 52 | #[unstable(feature = "slice_range", issue = "76393")] | |
| 53 | pub use core::slice::{range, try_range}; | |
| 54 | 46 | #[stable(feature = "slice_group_by", since = "1.77.0")] |
| 55 | 47 | pub use core::slice::{ChunkBy, ChunkByMut}; |
| 56 | 48 | #[stable(feature = "rust1", since = "1.0.0")] |
| ... | ... | @@ -69,6 +61,14 @@ pub use core::slice::{RSplit, RSplitMut}; |
| 69 | 61 | pub use core::slice::{RSplitN, RSplitNMut, SplitN, SplitNMut}; |
| 70 | 62 | #[stable(feature = "split_inclusive", since = "1.51.0")] |
| 71 | 63 | pub use core::slice::{SplitInclusive, SplitInclusiveMut}; |
| 64 | #[stable(feature = "from_ref", since = "1.28.0")] | |
| 65 | pub use core::slice::{from_mut, from_ref}; | |
| 66 | #[unstable(feature = "slice_from_ptr_range", issue = "89792")] | |
| 67 | pub use core::slice::{from_mut_ptr_range, from_ptr_range}; | |
| 68 | #[stable(feature = "rust1", since = "1.0.0")] | |
| 69 | pub use core::slice::{from_raw_parts, from_raw_parts_mut}; | |
| 70 | #[unstable(feature = "slice_range", issue = "76393")] | |
| 71 | pub use core::slice::{range, try_range}; | |
| 72 | 72 | |
| 73 | 73 | //////////////////////////////////////////////////////////////////////////////// |
| 74 | 74 | // Basic slice extension methods |
library/alloc/src/str.rs+7-7| ... | ... | @@ -9,9 +9,6 @@ |
| 9 | 9 | |
| 10 | 10 | use core::borrow::{Borrow, BorrowMut}; |
| 11 | 11 | use core::iter::FusedIterator; |
| 12 | #[stable(feature = "rust1", since = "1.0.0")] | |
| 13 | pub use core::str::pattern; | |
| 14 | use core::str::pattern::{DoubleEndedSearcher, Pattern, ReverseSearcher, Searcher}; | |
| 15 | 12 | #[stable(feature = "encode_utf16", since = "1.8.0")] |
| 16 | 13 | pub use core::str::EncodeUtf16; |
| 17 | 14 | #[stable(feature = "split_ascii_whitespace", since = "1.34.0")] |
| ... | ... | @@ -20,12 +17,11 @@ pub use core::str::SplitAsciiWhitespace; |
| 20 | 17 | pub use core::str::SplitInclusive; |
| 21 | 18 | #[stable(feature = "rust1", since = "1.0.0")] |
| 22 | 19 | pub use core::str::SplitWhitespace; |
| 23 | #[unstable(feature = "str_from_raw_parts", issue = "119206")] | |
| 24 | pub use core::str::{from_raw_parts, from_raw_parts_mut}; | |
| 25 | 20 | #[stable(feature = "rust1", since = "1.0.0")] |
| 26 | pub use core::str::{from_utf8, from_utf8_mut, Bytes, CharIndices, Chars}; | |
| 21 | pub use core::str::pattern; | |
| 22 | use core::str::pattern::{DoubleEndedSearcher, Pattern, ReverseSearcher, Searcher}; | |
| 27 | 23 | #[stable(feature = "rust1", since = "1.0.0")] |
| 28 | pub use core::str::{from_utf8_unchecked, from_utf8_unchecked_mut, ParseBoolError}; | |
| 24 | pub use core::str::{Bytes, CharIndices, Chars, from_utf8, from_utf8_mut}; | |
| 29 | 25 | #[stable(feature = "str_escape", since = "1.34.0")] |
| 30 | 26 | pub use core::str::{EscapeDebug, EscapeDefault, EscapeUnicode}; |
| 31 | 27 | #[stable(feature = "rust1", since = "1.0.0")] |
| ... | ... | @@ -38,6 +34,8 @@ pub use core::str::{MatchIndices, RMatchIndices}; |
| 38 | 34 | #[stable(feature = "rust1", since = "1.0.0")] |
| 39 | 35 | pub use core::str::{Matches, RMatches}; |
| 40 | 36 | #[stable(feature = "rust1", since = "1.0.0")] |
| 37 | pub use core::str::{ParseBoolError, from_utf8_unchecked, from_utf8_unchecked_mut}; | |
| 38 | #[stable(feature = "rust1", since = "1.0.0")] | |
| 41 | 39 | pub use core::str::{RSplit, Split}; |
| 42 | 40 | #[stable(feature = "rust1", since = "1.0.0")] |
| 43 | 41 | pub use core::str::{RSplitN, SplitN}; |
| ... | ... | @@ -45,6 +43,8 @@ pub use core::str::{RSplitN, SplitN}; |
| 45 | 43 | pub use core::str::{RSplitTerminator, SplitTerminator}; |
| 46 | 44 | #[stable(feature = "utf8_chunks", since = "1.79.0")] |
| 47 | 45 | pub use core::str::{Utf8Chunk, Utf8Chunks}; |
| 46 | #[unstable(feature = "str_from_raw_parts", issue = "119206")] | |
| 47 | pub use core::str::{from_raw_parts, from_raw_parts_mut}; | |
| 48 | 48 | use core::unicode::conversions; |
| 49 | 49 | use core::{mem, ptr}; |
| 50 | 50 |
library/alloc/src/string.rs+3-3| ... | ... | @@ -43,9 +43,9 @@ |
| 43 | 43 | #![stable(feature = "rust1", since = "1.0.0")] |
| 44 | 44 | |
| 45 | 45 | use core::error::Error; |
| 46 | use core::iter::FusedIterator; | |
| 46 | 47 | #[cfg(not(no_global_oom_handling))] |
| 47 | 48 | use core::iter::from_fn; |
| 48 | use core::iter::FusedIterator; | |
| 49 | 49 | #[cfg(not(no_global_oom_handling))] |
| 50 | 50 | use core::ops::Add; |
| 51 | 51 | #[cfg(not(no_global_oom_handling))] |
| ... | ... | @@ -62,9 +62,9 @@ use crate::alloc::Allocator; |
| 62 | 62 | use crate::borrow::{Cow, ToOwned}; |
| 63 | 63 | use crate::boxed::Box; |
| 64 | 64 | use crate::collections::TryReserveError; |
| 65 | use crate::str::{self, from_utf8_unchecked_mut, Chars, Utf8Error}; | |
| 65 | use crate::str::{self, Chars, Utf8Error, from_utf8_unchecked_mut}; | |
| 66 | 66 | #[cfg(not(no_global_oom_handling))] |
| 67 | use crate::str::{from_boxed_utf8_unchecked, FromStr}; | |
| 67 | use crate::str::{FromStr, from_boxed_utf8_unchecked}; | |
| 68 | 68 | use crate::vec::Vec; |
| 69 | 69 | |
| 70 | 70 | /// A UTF-8–encoded, growable string. |
library/alloc/src/sync.rs+1-1| ... | ... | @@ -17,7 +17,7 @@ use core::intrinsics::abort; |
| 17 | 17 | #[cfg(not(no_global_oom_handling))] |
| 18 | 18 | use core::iter; |
| 19 | 19 | use core::marker::{PhantomData, Unsize}; |
| 20 | use core::mem::{self, align_of_val_raw, ManuallyDrop}; | |
| 20 | use core::mem::{self, ManuallyDrop, align_of_val_raw}; | |
| 21 | 21 | use core::ops::{CoerceUnsized, Deref, DerefPure, DispatchFromDyn, Receiver}; |
| 22 | 22 | use core::panic::{RefUnwindSafe, UnwindSafe}; |
| 23 | 23 | use core::pin::{Pin, PinCoerceUnsized}; |
library/alloc/src/sync/tests.rs+1-1| ... | ... | @@ -1,10 +1,10 @@ |
| 1 | 1 | use std::clone::Clone; |
| 2 | 2 | use std::mem::MaybeUninit; |
| 3 | 3 | use std::option::Option::None; |
| 4 | use std::sync::Mutex; | |
| 4 | 5 | use std::sync::atomic::AtomicUsize; |
| 5 | 6 | use std::sync::atomic::Ordering::SeqCst; |
| 6 | 7 | use std::sync::mpsc::channel; |
| 7 | use std::sync::Mutex; | |
| 8 | 8 | use std::thread; |
| 9 | 9 | |
| 10 | 10 | use super::*; |
library/alloc/src/vec/in_place_collect.rs+1-1| ... | ... | @@ -163,7 +163,7 @@ use core::num::NonZero; |
| 163 | 163 | use core::ptr; |
| 164 | 164 | |
| 165 | 165 | use super::{InPlaceDrop, InPlaceDstDataSrcBufDrop, SpecFromIter, SpecFromIterNested, Vec}; |
| 166 | use crate::alloc::{handle_alloc_error, Global}; | |
| 166 | use crate::alloc::{Global, handle_alloc_error}; | |
| 167 | 167 | |
| 168 | 168 | const fn in_place_collectible<DEST, SRC>( |
| 169 | 169 | step_merge: Option<NonZero<usize>>, |
library/alloc/src/vec/in_place_drop.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use core::marker::PhantomData; |
| 2 | use core::ptr::{self, drop_in_place, NonNull}; | |
| 2 | use core::ptr::{self, NonNull, drop_in_place}; | |
| 3 | 3 | use core::slice::{self}; |
| 4 | 4 | |
| 5 | 5 | use crate::alloc::Global; |
library/alloc/tests/slice.rs+1-1| ... | ... | @@ -1417,8 +1417,8 @@ fn test_box_slice_clone() { |
| 1417 | 1417 | #[cfg_attr(target_os = "emscripten", ignore)] |
| 1418 | 1418 | #[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")] |
| 1419 | 1419 | fn test_box_slice_clone_panics() { |
| 1420 | use std::sync::atomic::{AtomicUsize, Ordering}; | |
| 1421 | 1420 | use std::sync::Arc; |
| 1421 | use std::sync::atomic::{AtomicUsize, Ordering}; | |
| 1422 | 1422 | |
| 1423 | 1423 | struct Canary { |
| 1424 | 1424 | count: Arc<AtomicUsize>, |
library/alloc/tests/str.rs+77-88| ... | ... | @@ -1524,14 +1524,18 @@ fn test_lines() { |
| 1524 | 1524 | t("bare\r", &["bare\r"]); |
| 1525 | 1525 | t("bare\rcr", &["bare\rcr"]); |
| 1526 | 1526 | t("Text\n\r", &["Text", "\r"]); |
| 1527 | t( | |
| 1528 | "\nMäry häd ä little lämb\n\r\nLittle lämb\n", | |
| 1529 | &["", "Märy häd ä little lämb", "", "Little lämb"], | |
| 1530 | ); | |
| 1531 | t( | |
| 1532 | "\r\nMäry häd ä little lämb\n\nLittle lämb", | |
| 1533 | &["", "Märy häd ä little lämb", "", "Little lämb"], | |
| 1534 | ); | |
| 1527 | t("\nMäry häd ä little lämb\n\r\nLittle lämb\n", &[ | |
| 1528 | "", | |
| 1529 | "Märy häd ä little lämb", | |
| 1530 | "", | |
| 1531 | "Little lämb", | |
| 1532 | ]); | |
| 1533 | t("\r\nMäry häd ä little lämb\n\nLittle lämb", &[ | |
| 1534 | "", | |
| 1535 | "Märy häd ä little lämb", | |
| 1536 | "", | |
| 1537 | "Little lämb", | |
| 1538 | ]); | |
| 1535 | 1539 | } |
| 1536 | 1540 | |
| 1537 | 1541 | #[test] |
| ... | ... | @@ -1971,88 +1975,73 @@ mod pattern { |
| 1971 | 1975 | assert_eq!(v, right); |
| 1972 | 1976 | } |
| 1973 | 1977 | |
| 1974 | make_test!( | |
| 1975 | str_searcher_ascii_haystack, | |
| 1976 | "bb", | |
| 1977 | "abbcbbd", | |
| 1978 | [Reject(0, 1), Match(1, 3), Reject(3, 4), Match(4, 6), Reject(6, 7),] | |
| 1979 | ); | |
| 1980 | make_test!( | |
| 1981 | str_searcher_ascii_haystack_seq, | |
| 1982 | "bb", | |
| 1983 | "abbcbbbbd", | |
| 1984 | [Reject(0, 1), Match(1, 3), Reject(3, 4), Match(4, 6), Match(6, 8), Reject(8, 9),] | |
| 1985 | ); | |
| 1986 | make_test!( | |
| 1987 | str_searcher_empty_needle_ascii_haystack, | |
| 1988 | "", | |
| 1989 | "abbcbbd", | |
| 1990 | [ | |
| 1991 | Match(0, 0), | |
| 1992 | Reject(0, 1), | |
| 1993 | Match(1, 1), | |
| 1994 | Reject(1, 2), | |
| 1995 | Match(2, 2), | |
| 1996 | Reject(2, 3), | |
| 1997 | Match(3, 3), | |
| 1998 | Reject(3, 4), | |
| 1999 | Match(4, 4), | |
| 2000 | Reject(4, 5), | |
| 2001 | Match(5, 5), | |
| 2002 | Reject(5, 6), | |
| 2003 | Match(6, 6), | |
| 2004 | Reject(6, 7), | |
| 2005 | Match(7, 7), | |
| 2006 | ] | |
| 2007 | ); | |
| 2008 | make_test!( | |
| 2009 | str_searcher_multibyte_haystack, | |
| 2010 | " ", | |
| 2011 | "├──", | |
| 2012 | [Reject(0, 3), Reject(3, 6), Reject(6, 9),] | |
| 2013 | ); | |
| 2014 | make_test!( | |
| 2015 | str_searcher_empty_needle_multibyte_haystack, | |
| 2016 | "", | |
| 2017 | "├──", | |
| 2018 | [ | |
| 2019 | Match(0, 0), | |
| 2020 | Reject(0, 3), | |
| 2021 | Match(3, 3), | |
| 2022 | Reject(3, 6), | |
| 2023 | Match(6, 6), | |
| 2024 | Reject(6, 9), | |
| 2025 | Match(9, 9), | |
| 2026 | ] | |
| 2027 | ); | |
| 1978 | make_test!(str_searcher_ascii_haystack, "bb", "abbcbbd", [ | |
| 1979 | Reject(0, 1), | |
| 1980 | Match(1, 3), | |
| 1981 | Reject(3, 4), | |
| 1982 | Match(4, 6), | |
| 1983 | Reject(6, 7), | |
| 1984 | ]); | |
| 1985 | make_test!(str_searcher_ascii_haystack_seq, "bb", "abbcbbbbd", [ | |
| 1986 | Reject(0, 1), | |
| 1987 | Match(1, 3), | |
| 1988 | Reject(3, 4), | |
| 1989 | Match(4, 6), | |
| 1990 | Match(6, 8), | |
| 1991 | Reject(8, 9), | |
| 1992 | ]); | |
| 1993 | make_test!(str_searcher_empty_needle_ascii_haystack, "", "abbcbbd", [ | |
| 1994 | Match(0, 0), | |
| 1995 | Reject(0, 1), | |
| 1996 | Match(1, 1), | |
| 1997 | Reject(1, 2), | |
| 1998 | Match(2, 2), | |
| 1999 | Reject(2, 3), | |
| 2000 | Match(3, 3), | |
| 2001 | Reject(3, 4), | |
| 2002 | Match(4, 4), | |
| 2003 | Reject(4, 5), | |
| 2004 | Match(5, 5), | |
| 2005 | Reject(5, 6), | |
| 2006 | Match(6, 6), | |
| 2007 | Reject(6, 7), | |
| 2008 | Match(7, 7), | |
| 2009 | ]); | |
| 2010 | make_test!(str_searcher_multibyte_haystack, " ", "├──", [ | |
| 2011 | Reject(0, 3), | |
| 2012 | Reject(3, 6), | |
| 2013 | Reject(6, 9), | |
| 2014 | ]); | |
| 2015 | make_test!(str_searcher_empty_needle_multibyte_haystack, "", "├──", [ | |
| 2016 | Match(0, 0), | |
| 2017 | Reject(0, 3), | |
| 2018 | Match(3, 3), | |
| 2019 | Reject(3, 6), | |
| 2020 | Match(6, 6), | |
| 2021 | Reject(6, 9), | |
| 2022 | Match(9, 9), | |
| 2023 | ]); | |
| 2028 | 2024 | make_test!(str_searcher_empty_needle_empty_haystack, "", "", [Match(0, 0),]); |
| 2029 | 2025 | make_test!(str_searcher_nonempty_needle_empty_haystack, "├", "", []); |
| 2030 | make_test!( | |
| 2031 | char_searcher_ascii_haystack, | |
| 2032 | 'b', | |
| 2033 | "abbcbbd", | |
| 2034 | [ | |
| 2035 | Reject(0, 1), | |
| 2036 | Match(1, 2), | |
| 2037 | Match(2, 3), | |
| 2038 | Reject(3, 4), | |
| 2039 | Match(4, 5), | |
| 2040 | Match(5, 6), | |
| 2041 | Reject(6, 7), | |
| 2042 | ] | |
| 2043 | ); | |
| 2044 | make_test!( | |
| 2045 | char_searcher_multibyte_haystack, | |
| 2046 | ' ', | |
| 2047 | "├──", | |
| 2048 | [Reject(0, 3), Reject(3, 6), Reject(6, 9),] | |
| 2049 | ); | |
| 2050 | make_test!( | |
| 2051 | char_searcher_short_haystack, | |
| 2052 | '\u{1F4A9}', | |
| 2053 | "* \t", | |
| 2054 | [Reject(0, 1), Reject(1, 2), Reject(2, 3),] | |
| 2055 | ); | |
| 2026 | make_test!(char_searcher_ascii_haystack, 'b', "abbcbbd", [ | |
| 2027 | Reject(0, 1), | |
| 2028 | Match(1, 2), | |
| 2029 | Match(2, 3), | |
| 2030 | Reject(3, 4), | |
| 2031 | Match(4, 5), | |
| 2032 | Match(5, 6), | |
| 2033 | Reject(6, 7), | |
| 2034 | ]); | |
| 2035 | make_test!(char_searcher_multibyte_haystack, ' ', "├──", [ | |
| 2036 | Reject(0, 3), | |
| 2037 | Reject(3, 6), | |
| 2038 | Reject(6, 9), | |
| 2039 | ]); | |
| 2040 | make_test!(char_searcher_short_haystack, '\u{1F4A9}', "* \t", [ | |
| 2041 | Reject(0, 1), | |
| 2042 | Reject(1, 2), | |
| 2043 | Reject(2, 3), | |
| 2044 | ]); | |
| 2056 | 2045 | |
| 2057 | 2046 | // See #85462 |
| 2058 | 2047 | #[test] |
library/alloc/tests/string.rs+13-22| ... | ... | @@ -154,28 +154,19 @@ fn test_fromutf8error_into_lossy() { |
| 154 | 154 | #[test] |
| 155 | 155 | fn test_from_utf16() { |
| 156 | 156 | let pairs = [ |
| 157 | ( | |
| 158 | String::from("𐍅𐌿𐌻𐍆𐌹𐌻𐌰\n"), | |
| 159 | vec![ | |
| 160 | 0xd800, 0xdf45, 0xd800, 0xdf3f, 0xd800, 0xdf3b, 0xd800, 0xdf46, 0xd800, 0xdf39, | |
| 161 | 0xd800, 0xdf3b, 0xd800, 0xdf30, 0x000a, | |
| 162 | ], | |
| 163 | ), | |
| 164 | ( | |
| 165 | String::from("𐐒𐑉𐐮𐑀𐐲𐑋 𐐏𐐲𐑍\n"), | |
| 166 | vec![ | |
| 167 | 0xd801, 0xdc12, 0xd801, 0xdc49, 0xd801, 0xdc2e, 0xd801, 0xdc40, 0xd801, 0xdc32, | |
| 168 | 0xd801, 0xdc4b, 0x0020, 0xd801, 0xdc0f, 0xd801, 0xdc32, 0xd801, 0xdc4d, 0x000a, | |
| 169 | ], | |
| 170 | ), | |
| 171 | ( | |
| 172 | String::from("𐌀𐌖𐌋𐌄𐌑𐌉·𐌌𐌄𐌕𐌄𐌋𐌉𐌑\n"), | |
| 173 | vec![ | |
| 174 | 0xd800, 0xdf00, 0xd800, 0xdf16, 0xd800, 0xdf0b, 0xd800, 0xdf04, 0xd800, 0xdf11, | |
| 175 | 0xd800, 0xdf09, 0x00b7, 0xd800, 0xdf0c, 0xd800, 0xdf04, 0xd800, 0xdf15, 0xd800, | |
| 176 | 0xdf04, 0xd800, 0xdf0b, 0xd800, 0xdf09, 0xd800, 0xdf11, 0x000a, | |
| 177 | ], | |
| 178 | ), | |
| 157 | (String::from("𐍅𐌿𐌻𐍆𐌹𐌻𐌰\n"), vec![ | |
| 158 | 0xd800, 0xdf45, 0xd800, 0xdf3f, 0xd800, 0xdf3b, 0xd800, 0xdf46, 0xd800, 0xdf39, 0xd800, | |
| 159 | 0xdf3b, 0xd800, 0xdf30, 0x000a, | |
| 160 | ]), | |
| 161 | (String::from("𐐒𐑉𐐮𐑀𐐲𐑋 𐐏𐐲𐑍\n"), vec![ | |
| 162 | 0xd801, 0xdc12, 0xd801, 0xdc49, 0xd801, 0xdc2e, 0xd801, 0xdc40, 0xd801, 0xdc32, 0xd801, | |
| 163 | 0xdc4b, 0x0020, 0xd801, 0xdc0f, 0xd801, 0xdc32, 0xd801, 0xdc4d, 0x000a, | |
| 164 | ]), | |
| 165 | (String::from("𐌀𐌖𐌋𐌄𐌑𐌉·𐌌𐌄𐌕𐌄𐌋𐌉𐌑\n"), vec![ | |
| 166 | 0xd800, 0xdf00, 0xd800, 0xdf16, 0xd800, 0xdf0b, 0xd800, 0xdf04, 0xd800, 0xdf11, 0xd800, | |
| 167 | 0xdf09, 0x00b7, 0xd800, 0xdf0c, 0xd800, 0xdf04, 0xd800, 0xdf15, 0xd800, 0xdf04, 0xd800, | |
| 168 | 0xdf0b, 0xd800, 0xdf09, 0xd800, 0xdf11, 0x000a, | |
| 169 | ]), | |
| 179 | 170 | ( |
| 180 | 171 | String::from("𐒋𐒘𐒈𐒑𐒛𐒒 𐒕𐒓 𐒈𐒚𐒍 𐒏𐒜𐒒𐒖𐒆 𐒕𐒆\n"), |
| 181 | 172 | vec![ |
library/alloc/tests/vec.rs+1-1| ... | ... | @@ -14,7 +14,7 @@ use std::fmt::Debug; |
| 14 | 14 | use std::iter::InPlaceIterable; |
| 15 | 15 | use std::mem::{size_of, swap}; |
| 16 | 16 | use std::ops::Bound::*; |
| 17 | use std::panic::{catch_unwind, AssertUnwindSafe}; | |
| 17 | use std::panic::{AssertUnwindSafe, catch_unwind}; | |
| 18 | 18 | use std::rc::Rc; |
| 19 | 19 | use std::sync::atomic::{AtomicU32, Ordering}; |
| 20 | 20 | use std::vec::{Drain, IntoIter}; |
library/alloc/tests/vec_deque.rs+2-2| ... | ... | @@ -3,12 +3,12 @@ |
| 3 | 3 | |
| 4 | 4 | use core::num::NonZero; |
| 5 | 5 | use std::assert_matches::assert_matches; |
| 6 | use std::collections::vec_deque::Drain; | |
| 7 | 6 | use std::collections::TryReserveErrorKind::*; |
| 8 | 7 | use std::collections::VecDeque; |
| 8 | use std::collections::vec_deque::Drain; | |
| 9 | 9 | use std::fmt::Debug; |
| 10 | 10 | use std::ops::Bound::*; |
| 11 | use std::panic::{catch_unwind, AssertUnwindSafe}; | |
| 11 | use std::panic::{AssertUnwindSafe, catch_unwind}; | |
| 12 | 12 | |
| 13 | 13 | use Taggy::*; |
| 14 | 14 | use Taggypar::*; |
library/alloc/tests/vec_deque_alloc_error.rs+2-2| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | #![feature(alloc_error_hook, allocator_api)] |
| 2 | 2 | |
| 3 | use std::alloc::{set_alloc_error_hook, AllocError, Allocator, Layout, System}; | |
| 3 | use std::alloc::{AllocError, Allocator, Layout, System, set_alloc_error_hook}; | |
| 4 | 4 | use std::collections::VecDeque; |
| 5 | use std::panic::{catch_unwind, AssertUnwindSafe}; | |
| 5 | use std::panic::{AssertUnwindSafe, catch_unwind}; | |
| 6 | 6 | use std::ptr::NonNull; |
| 7 | 7 | |
| 8 | 8 | #[test] |
library/core/benches/any.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use core::any::*; |
| 2 | 2 | |
| 3 | use test::{black_box, Bencher}; | |
| 3 | use test::{Bencher, black_box}; | |
| 4 | 4 | |
| 5 | 5 | #[bench] |
| 6 | 6 | fn bench_downcast_ref(b: &mut Bencher) { |
library/core/benches/array.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use test::{black_box, Bencher}; | |
| 1 | use test::{Bencher, black_box}; | |
| 2 | 2 | |
| 3 | 3 | macro_rules! map_array { |
| 4 | 4 | ($func_name:ident, $start_item: expr, $map_item: expr, $arr_size: expr) => { |
library/core/benches/ascii.rs+1-1| ... | ... | @@ -65,7 +65,7 @@ macro_rules! benches { |
| 65 | 65 | |
| 66 | 66 | use std::fmt::Write; |
| 67 | 67 | |
| 68 | use test::{black_box, Bencher}; | |
| 68 | use test::{Bencher, black_box}; | |
| 69 | 69 | |
| 70 | 70 | const ASCII_CASE_MASK: u8 = 0b0010_0000; |
| 71 | 71 |
library/core/benches/ascii/is_ascii.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use test::{black_box, Bencher}; | |
| 1 | use test::{Bencher, black_box}; | |
| 2 | 2 | |
| 3 | 3 | use super::{LONG, MEDIUM, SHORT}; |
| 4 | 4 |
library/core/benches/char/methods.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use test::{black_box, Bencher}; | |
| 1 | use test::{Bencher, black_box}; | |
| 2 | 2 | |
| 3 | 3 | const CHARS: [char; 9] = ['0', 'x', '2', '5', 'A', 'f', '7', '8', '9']; |
| 4 | 4 | const RADIX: [u32; 5] = [2, 8, 10, 16, 32]; |
library/core/benches/fmt.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use std::fmt::{self, Write as FmtWrite}; |
| 2 | 2 | use std::io::{self, Write as IoWrite}; |
| 3 | 3 | |
| 4 | use test::{black_box, Bencher}; | |
| 4 | use test::{Bencher, black_box}; | |
| 5 | 5 | |
| 6 | 6 | #[bench] |
| 7 | 7 | fn write_vec_value(bh: &mut Bencher) { |
library/core/benches/hash/sip.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | use core::hash::*; |
| 4 | 4 | |
| 5 | use test::{black_box, Bencher}; | |
| 5 | use test::{Bencher, black_box}; | |
| 6 | 6 | |
| 7 | 7 | fn hash_bytes<H: Hasher>(mut s: H, x: &[u8]) -> u64 { |
| 8 | 8 | Hasher::write(&mut s, x); |
library/core/benches/iter.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ use core::mem; |
| 4 | 4 | use core::num::Wrapping; |
| 5 | 5 | use core::ops::Range; |
| 6 | 6 | |
| 7 | use test::{black_box, Bencher}; | |
| 7 | use test::{Bencher, black_box}; | |
| 8 | 8 | |
| 9 | 9 | #[bench] |
| 10 | 10 | fn bench_rposition(b: &mut Bencher) { |
library/core/benches/net/addr_parser.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use core::net::{IpAddr, Ipv4Addr, Ipv6Addr, SocketAddr, SocketAddrV4, SocketAddrV6}; |
| 2 | 2 | use core::str::FromStr; |
| 3 | 3 | |
| 4 | use test::{black_box, Bencher}; | |
| 4 | use test::{Bencher, black_box}; | |
| 5 | 5 | |
| 6 | 6 | const IPV4_STR: &str = "192.168.0.1"; |
| 7 | 7 | const IPV4_STR_PORT: &str = "192.168.0.1:8080"; |
library/core/benches/num/dec2flt/mod.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use test::{black_box, Bencher}; | |
| 1 | use test::{Bencher, black_box}; | |
| 2 | 2 | |
| 3 | 3 | #[bench] |
| 4 | 4 | fn bench_0(b: &mut Bencher) { |
library/core/benches/num/flt2dec/mod.rs+2-2| ... | ... | @@ -3,10 +3,10 @@ mod strategy { |
| 3 | 3 | mod grisu; |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | use core::num::flt2dec::{decode, DecodableFloat, Decoded, FullDecoded, MAX_SIG_DIGITS}; | |
| 6 | use core::num::flt2dec::{DecodableFloat, Decoded, FullDecoded, MAX_SIG_DIGITS, decode}; | |
| 7 | 7 | use std::io::Write; |
| 8 | 8 | |
| 9 | use test::{black_box, Bencher}; | |
| 9 | use test::{Bencher, black_box}; | |
| 10 | 10 | |
| 11 | 11 | pub fn decode_finite<T: DecodableFloat>(v: T) -> Decoded { |
| 12 | 12 | match decode(v).1 { |
library/core/benches/num/int_log/mod.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use rand::Rng; |
| 2 | use test::{black_box, Bencher}; | |
| 2 | use test::{Bencher, black_box}; | |
| 3 | 3 | |
| 4 | 4 | macro_rules! int_log10_bench { |
| 5 | 5 | ($t:ty, $predictable:ident, $random:ident, $random_small:ident) => { |
library/core/benches/num/int_pow/mod.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use rand::Rng; |
| 2 | use test::{black_box, Bencher}; | |
| 2 | use test::{Bencher, black_box}; | |
| 3 | 3 | |
| 4 | 4 | const ITERATIONS: usize = 128; // Uses an ITERATIONS * 20 Byte stack allocation |
| 5 | 5 | type IntType = i128; // Hardest native type to multiply |
library/core/benches/num/int_sqrt/mod.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use rand::Rng; |
| 2 | use test::{black_box, Bencher}; | |
| 2 | use test::{Bencher, black_box}; | |
| 3 | 3 | |
| 4 | 4 | macro_rules! int_sqrt_bench { |
| 5 | 5 | ($t:ty, $predictable:ident, $random:ident, $random_small:ident, $random_uniform:ident) => { |
library/core/benches/num/mod.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ mod int_sqrt; |
| 6 | 6 | |
| 7 | 7 | use std::str::FromStr; |
| 8 | 8 | |
| 9 | use test::{black_box, Bencher}; | |
| 9 | use test::{Bencher, black_box}; | |
| 10 | 10 | |
| 11 | 11 | const ASCII_NUMBERS: [&str; 19] = [ |
| 12 | 12 | "0", |
library/core/benches/pattern.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use test::{black_box, Bencher}; | |
| 1 | use test::{Bencher, black_box}; | |
| 2 | 2 | |
| 3 | 3 | #[bench] |
| 4 | 4 | fn starts_with_char(b: &mut Bencher) { |
library/core/benches/slice.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use core::ptr::NonNull; |
| 2 | 2 | |
| 3 | use test::{black_box, Bencher}; | |
| 3 | use test::{Bencher, black_box}; | |
| 4 | 4 | |
| 5 | 5 | enum Cache { |
| 6 | 6 | L1, |
library/core/benches/str.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use std::str; |
| 2 | 2 | |
| 3 | use test::{black_box, Bencher}; | |
| 3 | use test::{Bencher, black_box}; | |
| 4 | 4 | |
| 5 | 5 | mod char_count; |
| 6 | 6 | mod corpora; |
library/core/benches/str/char_count.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use test::{black_box, Bencher}; | |
| 1 | use test::{Bencher, black_box}; | |
| 2 | 2 | |
| 3 | 3 | use super::corpora::*; |
| 4 | 4 |
library/core/benches/str/debug.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | |
| 6 | 6 | use std::fmt::{self, Write}; |
| 7 | 7 | |
| 8 | use test::{black_box, Bencher}; | |
| 8 | use test::{Bencher, black_box}; | |
| 9 | 9 | |
| 10 | 10 | #[derive(Default)] |
| 11 | 11 | struct CountingWriter { |
library/core/benches/str/iter.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use test::{black_box, Bencher}; | |
| 1 | use test::{Bencher, black_box}; | |
| 2 | 2 | |
| 3 | 3 | use super::corpora; |
| 4 | 4 |
library/core/benches/tuple.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use rand::prelude::*; |
| 2 | use test::{black_box, Bencher}; | |
| 2 | use test::{Bencher, black_box}; | |
| 3 | 3 | |
| 4 | 4 | #[bench] |
| 5 | 5 | fn bench_tuple_comparison(b: &mut Bencher) { |
library/core/src/array/mod.rs+1-1| ... | ... | @@ -10,7 +10,7 @@ use crate::convert::Infallible; |
| 10 | 10 | use crate::error::Error; |
| 11 | 11 | use crate::fmt; |
| 12 | 12 | use crate::hash::{self, Hash}; |
| 13 | use crate::iter::{repeat_n, UncheckedIterator}; | |
| 13 | use crate::iter::{UncheckedIterator, repeat_n}; | |
| 14 | 14 | use crate::mem::{self, MaybeUninit}; |
| 15 | 15 | use crate::ops::{ |
| 16 | 16 | ChangeOutputType, ControlFlow, FromResidual, Index, IndexMut, NeverShortCircuit, Residual, Try, |
library/core/src/async_iter/mod.rs+1-1| ... | ... | @@ -125,4 +125,4 @@ mod async_iter; |
| 125 | 125 | mod from_iter; |
| 126 | 126 | |
| 127 | 127 | pub use async_iter::{AsyncIterator, IntoAsyncIterator}; |
| 128 | pub use from_iter::{from_iter, FromIter}; | |
| 128 | pub use from_iter::{FromIter, from_iter}; |
library/core/src/cell.rs+9-8| ... | ... | @@ -1577,10 +1577,10 @@ impl<'b, T: ?Sized> Ref<'b, T> { |
| 1577 | 1577 | { |
| 1578 | 1578 | let (a, b) = f(&*orig); |
| 1579 | 1579 | let borrow = orig.borrow.clone(); |
| 1580 | ( | |
| 1581 | Ref { value: NonNull::from(a), borrow }, | |
| 1582 | Ref { value: NonNull::from(b), borrow: orig.borrow }, | |
| 1583 | ) | |
| 1580 | (Ref { value: NonNull::from(a), borrow }, Ref { | |
| 1581 | value: NonNull::from(b), | |
| 1582 | borrow: orig.borrow, | |
| 1583 | }) | |
| 1584 | 1584 | } |
| 1585 | 1585 | |
| 1586 | 1586 | /// Converts into a reference to the underlying data. |
| ... | ... | @@ -1745,10 +1745,11 @@ impl<'b, T: ?Sized> RefMut<'b, T> { |
| 1745 | 1745 | { |
| 1746 | 1746 | let borrow = orig.borrow.clone(); |
| 1747 | 1747 | let (a, b) = f(&mut *orig); |
| 1748 | ( | |
| 1749 | RefMut { value: NonNull::from(a), borrow, marker: PhantomData }, | |
| 1750 | RefMut { value: NonNull::from(b), borrow: orig.borrow, marker: PhantomData }, | |
| 1751 | ) | |
| 1748 | (RefMut { value: NonNull::from(a), borrow, marker: PhantomData }, RefMut { | |
| 1749 | value: NonNull::from(b), | |
| 1750 | borrow: orig.borrow, | |
| 1751 | marker: PhantomData, | |
| 1752 | }) | |
| 1752 | 1753 | } |
| 1753 | 1754 | |
| 1754 | 1755 | /// Converts into a mutable reference to the underlying data. |
library/core/src/ffi/c_str.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ use crate::error::Error; |
| 5 | 5 | use crate::ffi::c_char; |
| 6 | 6 | use crate::iter::FusedIterator; |
| 7 | 7 | use crate::marker::PhantomData; |
| 8 | use crate::ptr::{addr_of, NonNull}; | |
| 8 | use crate::ptr::{NonNull, addr_of}; | |
| 9 | 9 | use crate::slice::memchr; |
| 10 | 10 | use crate::{fmt, intrinsics, ops, slice, str}; |
| 11 | 11 |
library/core/src/fmt/mod.rs+2-2| ... | ... | @@ -33,10 +33,10 @@ pub enum Alignment { |
| 33 | 33 | Center, |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | #[unstable(feature = "debug_closure_helpers", issue = "117729")] | |
| 37 | pub use self::builders::{from_fn, FromFn}; | |
| 38 | 36 | #[stable(feature = "debug_builders", since = "1.2.0")] |
| 39 | 37 | pub use self::builders::{DebugList, DebugMap, DebugSet, DebugStruct, DebugTuple}; |
| 38 | #[unstable(feature = "debug_closure_helpers", issue = "117729")] | |
| 39 | pub use self::builders::{FromFn, from_fn}; | |
| 40 | 40 | |
| 41 | 41 | /// The type returned by formatter methods. |
| 42 | 42 | /// |
library/core/src/future/async_drop.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ use crate::intrinsics::discriminant_value; |
| 6 | 6 | use crate::marker::{DiscriminantKind, PhantomPinned}; |
| 7 | 7 | use crate::mem::MaybeUninit; |
| 8 | 8 | use crate::pin::Pin; |
| 9 | use crate::task::{ready, Context, Poll}; | |
| 9 | use crate::task::{Context, Poll, ready}; | |
| 10 | 10 | |
| 11 | 11 | /// Asynchronously drops a value by running `AsyncDrop::async_drop` |
| 12 | 12 | /// on a value and its fields recursively. |
library/core/src/future/join.rs+2-2| ... | ... | @@ -1,10 +1,10 @@ |
| 1 | 1 | #![allow(unused_imports, unused_macros)] // items are used by the macro |
| 2 | 2 | |
| 3 | 3 | use crate::cell::UnsafeCell; |
| 4 | use crate::future::{poll_fn, Future}; | |
| 4 | use crate::future::{Future, poll_fn}; | |
| 5 | 5 | use crate::mem; |
| 6 | 6 | use crate::pin::Pin; |
| 7 | use crate::task::{ready, Context, Poll}; | |
| 7 | use crate::task::{Context, Poll, ready}; | |
| 8 | 8 | |
| 9 | 9 | /// Polls multiple futures simultaneously, returning a tuple |
| 10 | 10 | /// of all results once complete. |
library/core/src/future/mod.rs+4-4| ... | ... | @@ -21,15 +21,15 @@ mod poll_fn; |
| 21 | 21 | mod ready; |
| 22 | 22 | |
| 23 | 23 | #[unstable(feature = "async_drop", issue = "126482")] |
| 24 | pub use async_drop::{async_drop, async_drop_in_place, AsyncDrop, AsyncDropInPlace}; | |
| 24 | pub use async_drop::{AsyncDrop, AsyncDropInPlace, async_drop, async_drop_in_place}; | |
| 25 | 25 | #[stable(feature = "into_future", since = "1.64.0")] |
| 26 | 26 | pub use into_future::IntoFuture; |
| 27 | 27 | #[stable(feature = "future_readiness_fns", since = "1.48.0")] |
| 28 | pub use pending::{pending, Pending}; | |
| 28 | pub use pending::{Pending, pending}; | |
| 29 | 29 | #[stable(feature = "future_poll_fn", since = "1.64.0")] |
| 30 | pub use poll_fn::{poll_fn, PollFn}; | |
| 30 | pub use poll_fn::{PollFn, poll_fn}; | |
| 31 | 31 | #[stable(feature = "future_readiness_fns", since = "1.48.0")] |
| 32 | pub use ready::{ready, Ready}; | |
| 32 | pub use ready::{Ready, ready}; | |
| 33 | 33 | |
| 34 | 34 | #[stable(feature = "futures_api", since = "1.36.0")] |
| 35 | 35 | pub use self::future::Future; |
library/core/src/iter/adapters/fuse.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use crate::intrinsics; |
| 2 | use crate::iter::adapters::zip::try_get_unchecked; | |
| 3 | 2 | use crate::iter::adapters::SourceIter; |
| 3 | use crate::iter::adapters::zip::try_get_unchecked; | |
| 4 | 4 | use crate::iter::{ |
| 5 | 5 | FusedIterator, TrustedFused, TrustedLen, TrustedRandomAccess, TrustedRandomAccessNoCoerce, |
| 6 | 6 | }; |
library/core/src/iter/adapters/map_while.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use crate::fmt; |
| 2 | use crate::iter::adapters::SourceIter; | |
| 3 | 2 | use crate::iter::InPlaceIterable; |
| 3 | use crate::iter::adapters::SourceIter; | |
| 4 | 4 | use crate::num::NonZero; |
| 5 | 5 | use crate::ops::{ControlFlow, Try}; |
| 6 | 6 |
library/core/src/iter/adapters/mod.rs+2-2| ... | ... | @@ -48,12 +48,12 @@ pub use self::map_while::MapWhile; |
| 48 | 48 | pub use self::map_windows::MapWindows; |
| 49 | 49 | #[stable(feature = "iterator_step_by", since = "1.28.0")] |
| 50 | 50 | pub use self::step_by::StepBy; |
| 51 | #[stable(feature = "iter_zip", since = "1.59.0")] | |
| 52 | pub use self::zip::zip; | |
| 53 | 51 | #[unstable(feature = "trusted_random_access", issue = "none")] |
| 54 | 52 | pub use self::zip::TrustedRandomAccess; |
| 55 | 53 | #[unstable(feature = "trusted_random_access", issue = "none")] |
| 56 | 54 | pub use self::zip::TrustedRandomAccessNoCoerce; |
| 55 | #[stable(feature = "iter_zip", since = "1.59.0")] | |
| 56 | pub use self::zip::zip; | |
| 57 | 57 | #[stable(feature = "rust1", since = "1.0.0")] |
| 58 | 58 | pub use self::{ |
| 59 | 59 | chain::Chain, cycle::Cycle, enumerate::Enumerate, filter::Filter, filter_map::FilterMap, |
library/core/src/iter/adapters/scan.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use crate::fmt; |
| 2 | use crate::iter::adapters::SourceIter; | |
| 3 | 2 | use crate::iter::InPlaceIterable; |
| 3 | use crate::iter::adapters::SourceIter; | |
| 4 | 4 | use crate::num::NonZero; |
| 5 | 5 | use crate::ops::{ControlFlow, Try}; |
| 6 | 6 |
library/core/src/iter/adapters/skip.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use crate::intrinsics::unlikely; |
| 2 | use crate::iter::adapters::zip::try_get_unchecked; | |
| 3 | 2 | use crate::iter::adapters::SourceIter; |
| 3 | use crate::iter::adapters::zip::try_get_unchecked; | |
| 4 | 4 | use crate::iter::{ |
| 5 | 5 | FusedIterator, InPlaceIterable, TrustedFused, TrustedLen, TrustedRandomAccess, |
| 6 | 6 | TrustedRandomAccessNoCoerce, |
library/core/src/iter/adapters/step_by.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::intrinsics; |
| 2 | use crate::iter::{from_fn, TrustedLen, TrustedRandomAccess}; | |
| 2 | use crate::iter::{TrustedLen, TrustedRandomAccess, from_fn}; | |
| 3 | 3 | use crate::num::NonZero; |
| 4 | 4 | use crate::ops::{Range, Try}; |
| 5 | 5 |
library/core/src/iter/mod.rs+13-13| ... | ... | @@ -380,11 +380,6 @@ macro_rules! impl_fold_via_try_fold { |
| 380 | 380 | }; |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | #[unstable(feature = "iter_chain", reason = "recently added", issue = "125964")] | |
| 384 | pub use self::adapters::chain; | |
| 385 | pub(crate) use self::adapters::try_process; | |
| 386 | #[stable(feature = "iter_zip", since = "1.59.0")] | |
| 387 | pub use self::adapters::zip; | |
| 388 | 383 | #[unstable(feature = "iter_array_chunks", reason = "recently added", issue = "100450")] |
| 389 | 384 | pub use self::adapters::ArrayChunks; |
| 390 | 385 | #[unstable(feature = "std_internals", issue = "none")] |
| ... | ... | @@ -407,6 +402,11 @@ pub use self::adapters::StepBy; |
| 407 | 402 | pub use self::adapters::TrustedRandomAccess; |
| 408 | 403 | #[unstable(feature = "trusted_random_access", issue = "none")] |
| 409 | 404 | pub use self::adapters::TrustedRandomAccessNoCoerce; |
| 405 | #[unstable(feature = "iter_chain", reason = "recently added", issue = "125964")] | |
| 406 | pub use self::adapters::chain; | |
| 407 | pub(crate) use self::adapters::try_process; | |
| 408 | #[stable(feature = "iter_zip", since = "1.59.0")] | |
| 409 | pub use self::adapters::zip; | |
| 410 | 410 | #[stable(feature = "rust1", since = "1.0.0")] |
| 411 | 411 | pub use self::adapters::{ |
| 412 | 412 | Chain, Cycle, Enumerate, Filter, FilterMap, FlatMap, Fuse, Inspect, Map, Peekable, Rev, Scan, |
| ... | ... | @@ -427,21 +427,21 @@ pub use self::range::Step; |
| 427 | 427 | )] |
| 428 | 428 | pub use self::sources::from_coroutine; |
| 429 | 429 | #[stable(feature = "iter_empty", since = "1.2.0")] |
| 430 | pub use self::sources::{empty, Empty}; | |
| 430 | pub use self::sources::{Empty, empty}; | |
| 431 | 431 | #[stable(feature = "iter_from_fn", since = "1.34.0")] |
| 432 | pub use self::sources::{from_fn, FromFn}; | |
| 432 | pub use self::sources::{FromFn, from_fn}; | |
| 433 | 433 | #[stable(feature = "iter_once", since = "1.2.0")] |
| 434 | pub use self::sources::{once, Once}; | |
| 434 | pub use self::sources::{Once, once}; | |
| 435 | 435 | #[stable(feature = "iter_once_with", since = "1.43.0")] |
| 436 | pub use self::sources::{once_with, OnceWith}; | |
| 436 | pub use self::sources::{OnceWith, once_with}; | |
| 437 | 437 | #[stable(feature = "rust1", since = "1.0.0")] |
| 438 | pub use self::sources::{repeat, Repeat}; | |
| 438 | pub use self::sources::{Repeat, repeat}; | |
| 439 | 439 | #[stable(feature = "iter_repeat_n", since = "1.82.0")] |
| 440 | pub use self::sources::{repeat_n, RepeatN}; | |
| 440 | pub use self::sources::{RepeatN, repeat_n}; | |
| 441 | 441 | #[stable(feature = "iterator_repeat_with", since = "1.28.0")] |
| 442 | pub use self::sources::{repeat_with, RepeatWith}; | |
| 442 | pub use self::sources::{RepeatWith, repeat_with}; | |
| 443 | 443 | #[stable(feature = "iter_successors", since = "1.34.0")] |
| 444 | pub use self::sources::{successors, Successors}; | |
| 444 | pub use self::sources::{Successors, successors}; | |
| 445 | 445 | #[stable(feature = "fused", since = "1.26.0")] |
| 446 | 446 | pub use self::traits::FusedIterator; |
| 447 | 447 | #[unstable(issue = "none", feature = "inplace_iteration")] |
library/core/src/iter/sources.rs+8-8| ... | ... | @@ -9,7 +9,7 @@ mod repeat_with; |
| 9 | 9 | mod successors; |
| 10 | 10 | |
| 11 | 11 | #[stable(feature = "iter_empty", since = "1.2.0")] |
| 12 | pub use self::empty::{empty, Empty}; | |
| 12 | pub use self::empty::{Empty, empty}; | |
| 13 | 13 | #[unstable( |
| 14 | 14 | feature = "iter_from_coroutine", |
| 15 | 15 | issue = "43122", |
| ... | ... | @@ -17,16 +17,16 @@ pub use self::empty::{empty, Empty}; |
| 17 | 17 | )] |
| 18 | 18 | pub use self::from_coroutine::from_coroutine; |
| 19 | 19 | #[stable(feature = "iter_from_fn", since = "1.34.0")] |
| 20 | pub use self::from_fn::{from_fn, FromFn}; | |
| 20 | pub use self::from_fn::{FromFn, from_fn}; | |
| 21 | 21 | #[stable(feature = "iter_once", since = "1.2.0")] |
| 22 | pub use self::once::{once, Once}; | |
| 22 | pub use self::once::{Once, once}; | |
| 23 | 23 | #[stable(feature = "iter_once_with", since = "1.43.0")] |
| 24 | pub use self::once_with::{once_with, OnceWith}; | |
| 24 | pub use self::once_with::{OnceWith, once_with}; | |
| 25 | 25 | #[stable(feature = "rust1", since = "1.0.0")] |
| 26 | pub use self::repeat::{repeat, Repeat}; | |
| 26 | pub use self::repeat::{Repeat, repeat}; | |
| 27 | 27 | #[stable(feature = "iter_repeat_n", since = "1.82.0")] |
| 28 | pub use self::repeat_n::{repeat_n, RepeatN}; | |
| 28 | pub use self::repeat_n::{RepeatN, repeat_n}; | |
| 29 | 29 | #[stable(feature = "iterator_repeat_with", since = "1.28.0")] |
| 30 | pub use self::repeat_with::{repeat_with, RepeatWith}; | |
| 30 | pub use self::repeat_with::{RepeatWith, repeat_with}; | |
| 31 | 31 | #[stable(feature = "iter_successors", since = "1.34.0")] |
| 32 | pub use self::successors::{successors, Successors}; | |
| 32 | pub use self::successors::{Successors, successors}; |
library/core/src/iter/traits/iterator.rs+4-4| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use super::super::{ |
| 2 | try_process, ArrayChunks, ByRefSized, Chain, Cloned, Copied, Cycle, Enumerate, Filter, | |
| 3 | FilterMap, FlatMap, Flatten, Fuse, Inspect, Intersperse, IntersperseWith, Map, MapWhile, | |
| 4 | MapWindows, Peekable, Product, Rev, Scan, Skip, SkipWhile, StepBy, Sum, Take, TakeWhile, | |
| 5 | TrustedRandomAccessNoCoerce, Zip, | |
| 2 | ArrayChunks, ByRefSized, Chain, Cloned, Copied, Cycle, Enumerate, Filter, FilterMap, FlatMap, | |
| 3 | Flatten, Fuse, Inspect, Intersperse, IntersperseWith, Map, MapWhile, MapWindows, Peekable, | |
| 4 | Product, Rev, Scan, Skip, SkipWhile, StepBy, Sum, Take, TakeWhile, TrustedRandomAccessNoCoerce, | |
| 5 | Zip, try_process, | |
| 6 | 6 | }; |
| 7 | 7 | use crate::array; |
| 8 | 8 | use crate::cmp::{self, Ordering}; |
library/core/src/num/dec2flt/decimal.rs+1-1| ... | ... | @@ -9,7 +9,7 @@ |
| 9 | 9 | //! algorithm can be found in "ParseNumberF64 by Simple Decimal Conversion", |
| 10 | 10 | //! available online: <https://nigeltao.github.io/blog/2020/parse-number-f64-simple.html>. |
| 11 | 11 | |
| 12 | use crate::num::dec2flt::common::{is_8digits, ByteSlice}; | |
| 12 | use crate::num::dec2flt::common::{ByteSlice, is_8digits}; | |
| 13 | 13 | |
| 14 | 14 | #[derive(Clone)] |
| 15 | 15 | pub struct Decimal { |
library/core/src/num/dec2flt/parse.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | //! Functions to parse floating-point numbers. |
| 2 | 2 | |
| 3 | use crate::num::dec2flt::common::{is_8digits, ByteSlice}; | |
| 3 | use crate::num::dec2flt::common::{ByteSlice, is_8digits}; | |
| 4 | 4 | use crate::num::dec2flt::float::RawFloat; |
| 5 | 5 | use crate::num::dec2flt::number::Number; |
| 6 | 6 |
library/core/src/num/dec2flt/slow.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | //! Slow, fallback algorithm for cases the Eisel-Lemire algorithm cannot round. |
| 2 | 2 | |
| 3 | 3 | use crate::num::dec2flt::common::BiasedFp; |
| 4 | use crate::num::dec2flt::decimal::{parse_decimal, Decimal}; | |
| 4 | use crate::num::dec2flt::decimal::{Decimal, parse_decimal}; | |
| 5 | 5 | use crate::num::dec2flt::float::RawFloat; |
| 6 | 6 | |
| 7 | 7 | /// Parse the significant digits and biased, binary exponent of a float. |
library/core/src/num/flt2dec/decoder.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | //! Decodes a floating-point value into individual parts and error ranges. |
| 2 | 2 | |
| 3 | use crate::num::dec2flt::float::RawFloat; | |
| 4 | 3 | use crate::num::FpCategory; |
| 4 | use crate::num::dec2flt::float::RawFloat; | |
| 5 | 5 | |
| 6 | 6 | /// Decoded unsigned finite value, such that: |
| 7 | 7 | /// |
library/core/src/num/flt2dec/mod.rs+1-1| ... | ... | @@ -122,7 +122,7 @@ functions. |
| 122 | 122 | issue = "none" |
| 123 | 123 | )] |
| 124 | 124 | |
| 125 | pub use self::decoder::{decode, DecodableFloat, Decoded, FullDecoded}; | |
| 125 | pub use self::decoder::{DecodableFloat, Decoded, FullDecoded, decode}; | |
| 126 | 126 | use super::fmt::{Formatted, Part}; |
| 127 | 127 | use crate::mem::MaybeUninit; |
| 128 | 128 |
library/core/src/num/flt2dec/strategy/dragon.rs+1-1| ... | ... | @@ -8,7 +8,7 @@ use crate::cmp::Ordering; |
| 8 | 8 | use crate::mem::MaybeUninit; |
| 9 | 9 | use crate::num::bignum::{Big32x40 as Big, Digit32 as Digit}; |
| 10 | 10 | use crate::num::flt2dec::estimator::estimate_scaling_factor; |
| 11 | use crate::num::flt2dec::{round_up, Decoded, MAX_SIG_DIGITS}; | |
| 11 | use crate::num::flt2dec::{Decoded, MAX_SIG_DIGITS, round_up}; | |
| 12 | 12 | |
| 13 | 13 | static POW10: [Digit; 10] = |
| 14 | 14 | [1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 1000000000]; |
library/core/src/num/flt2dec/strategy/grisu.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ |
| 7 | 7 | |
| 8 | 8 | use crate::mem::MaybeUninit; |
| 9 | 9 | use crate::num::diy_float::Fp; |
| 10 | use crate::num::flt2dec::{round_up, Decoded, MAX_SIG_DIGITS}; | |
| 10 | use crate::num::flt2dec::{Decoded, MAX_SIG_DIGITS, round_up}; | |
| 11 | 11 | |
| 12 | 12 | // see the comments in `format_shortest_opt` for the rationale. |
| 13 | 13 | #[doc(hidden)] |
library/core/src/num/mod.rs+2-2| ... | ... | @@ -75,9 +75,9 @@ pub use nonzero::NonZero; |
| 75 | 75 | )] |
| 76 | 76 | pub use nonzero::ZeroablePrimitive; |
| 77 | 77 | #[stable(feature = "signed_nonzero", since = "1.34.0")] |
| 78 | pub use nonzero::{NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize}; | |
| 78 | pub use nonzero::{NonZeroI8, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI128, NonZeroIsize}; | |
| 79 | 79 | #[stable(feature = "nonzero", since = "1.28.0")] |
| 80 | pub use nonzero::{NonZeroU128, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize}; | |
| 80 | pub use nonzero::{NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU128, NonZeroUsize}; | |
| 81 | 81 | #[stable(feature = "saturating_int_impl", since = "1.74.0")] |
| 82 | 82 | pub use saturating::Saturating; |
| 83 | 83 | #[stable(feature = "rust1", since = "1.0.0")] |
library/core/src/ops/async_function.rs+8-2| ... | ... | @@ -79,7 +79,10 @@ mod impls { |
| 79 | 79 | where |
| 80 | 80 | F: AsyncFn<A>, |
| 81 | 81 | { |
| 82 | type CallRefFuture<'a> = F::CallRefFuture<'a> where Self: 'a; | |
| 82 | type CallRefFuture<'a> | |
| 83 | = F::CallRefFuture<'a> | |
| 84 | where | |
| 85 | Self: 'a; | |
| 83 | 86 | |
| 84 | 87 | extern "rust-call" fn async_call_mut(&mut self, args: A) -> Self::CallRefFuture<'_> { |
| 85 | 88 | F::async_call(*self, args) |
| ... | ... | @@ -104,7 +107,10 @@ mod impls { |
| 104 | 107 | where |
| 105 | 108 | F: AsyncFnMut<A>, |
| 106 | 109 | { |
| 107 | type CallRefFuture<'a> = F::CallRefFuture<'a> where Self: 'a; | |
| 110 | type CallRefFuture<'a> | |
| 111 | = F::CallRefFuture<'a> | |
| 112 | where | |
| 113 | Self: 'a; | |
| 108 | 114 | |
| 109 | 115 | extern "rust-call" fn async_call_mut(&mut self, args: A) -> Self::CallRefFuture<'_> { |
| 110 | 116 | F::async_call_mut(*self, args) |
library/core/src/ops/mod.rs+1-1| ... | ... | @@ -172,9 +172,9 @@ pub use self::deref::DerefPure; |
| 172 | 172 | pub use self::deref::Receiver; |
| 173 | 173 | #[stable(feature = "rust1", since = "1.0.0")] |
| 174 | 174 | pub use self::deref::{Deref, DerefMut}; |
| 175 | pub(crate) use self::drop::fallback_surface_drop; | |
| 176 | 175 | #[stable(feature = "rust1", since = "1.0.0")] |
| 177 | 176 | pub use self::drop::Drop; |
| 177 | pub(crate) use self::drop::fallback_surface_drop; | |
| 178 | 178 | #[stable(feature = "rust1", since = "1.0.0")] |
| 179 | 179 | pub use self::function::{Fn, FnMut, FnOnce}; |
| 180 | 180 | #[stable(feature = "rust1", since = "1.0.0")] |
library/core/src/primitive.rs+4-4| ... | ... | @@ -46,7 +46,7 @@ pub use f32; |
| 46 | 46 | #[stable(feature = "core_primitive", since = "1.43.0")] |
| 47 | 47 | pub use f64; |
| 48 | 48 | #[stable(feature = "core_primitive", since = "1.43.0")] |
| 49 | pub use i128; | |
| 49 | pub use i8; | |
| 50 | 50 | #[stable(feature = "core_primitive", since = "1.43.0")] |
| 51 | 51 | pub use i16; |
| 52 | 52 | #[stable(feature = "core_primitive", since = "1.43.0")] |
| ... | ... | @@ -54,13 +54,13 @@ pub use i32; |
| 54 | 54 | #[stable(feature = "core_primitive", since = "1.43.0")] |
| 55 | 55 | pub use i64; |
| 56 | 56 | #[stable(feature = "core_primitive", since = "1.43.0")] |
| 57 | pub use i8; | |
| 57 | pub use i128; | |
| 58 | 58 | #[stable(feature = "core_primitive", since = "1.43.0")] |
| 59 | 59 | pub use isize; |
| 60 | 60 | #[stable(feature = "core_primitive", since = "1.43.0")] |
| 61 | 61 | pub use str; |
| 62 | 62 | #[stable(feature = "core_primitive", since = "1.43.0")] |
| 63 | pub use u128; | |
| 63 | pub use u8; | |
| 64 | 64 | #[stable(feature = "core_primitive", since = "1.43.0")] |
| 65 | 65 | pub use u16; |
| 66 | 66 | #[stable(feature = "core_primitive", since = "1.43.0")] |
| ... | ... | @@ -68,6 +68,6 @@ pub use u32; |
| 68 | 68 | #[stable(feature = "core_primitive", since = "1.43.0")] |
| 69 | 69 | pub use u64; |
| 70 | 70 | #[stable(feature = "core_primitive", since = "1.43.0")] |
| 71 | pub use u8; | |
| 71 | pub use u128; | |
| 72 | 72 | #[stable(feature = "core_primitive", since = "1.43.0")] |
| 73 | 73 | pub use usize; |
library/core/src/ptr/mod.rs+1-1| ... | ... | @@ -467,7 +467,7 @@ pub use crate::intrinsics::write_bytes; |
| 467 | 467 | |
| 468 | 468 | mod metadata; |
| 469 | 469 | #[unstable(feature = "ptr_metadata", issue = "81513")] |
| 470 | pub use metadata::{from_raw_parts, from_raw_parts_mut, metadata, DynMetadata, Pointee, Thin}; | |
| 470 | pub use metadata::{DynMetadata, Pointee, Thin, from_raw_parts, from_raw_parts_mut, metadata}; | |
| 471 | 471 | |
| 472 | 472 | mod non_null; |
| 473 | 473 | #[stable(feature = "nonnull", since = "1.25.0")] |
library/core/src/range.rs+1-1| ... | ... | @@ -24,9 +24,9 @@ mod iter; |
| 24 | 24 | #[unstable(feature = "new_range_api", issue = "125687")] |
| 25 | 25 | pub mod legacy; |
| 26 | 26 | |
| 27 | use Bound::{Excluded, Included, Unbounded}; | |
| 27 | 28 | #[doc(inline)] |
| 28 | 29 | pub use iter::{IterRange, IterRangeFrom, IterRangeInclusive}; |
| 29 | use Bound::{Excluded, Included, Unbounded}; | |
| 30 | 30 | |
| 31 | 31 | #[doc(inline)] |
| 32 | 32 | pub use crate::iter::Step; |
library/core/src/range/iter.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ use crate::iter::{ |
| 2 | 2 | FusedIterator, Step, TrustedLen, TrustedRandomAccess, TrustedRandomAccessNoCoerce, TrustedStep, |
| 3 | 3 | }; |
| 4 | 4 | use crate::num::NonZero; |
| 5 | use crate::range::{legacy, Range, RangeFrom, RangeInclusive}; | |
| 5 | use crate::range::{Range, RangeFrom, RangeInclusive, legacy}; | |
| 6 | 6 | |
| 7 | 7 | /// By-value [`Range`] iterator. |
| 8 | 8 | #[unstable(feature = "new_range_api", issue = "125687")] |
library/core/src/slice/iter.rs+1-1| ... | ... | @@ -11,7 +11,7 @@ use crate::iter::{ |
| 11 | 11 | use crate::marker::PhantomData; |
| 12 | 12 | use crate::mem::{self, SizedTypeProperties}; |
| 13 | 13 | use crate::num::NonZero; |
| 14 | use crate::ptr::{self, without_provenance, without_provenance_mut, NonNull}; | |
| 14 | use crate::ptr::{self, NonNull, without_provenance, without_provenance_mut}; | |
| 15 | 15 | use crate::{cmp, fmt}; |
| 16 | 16 | |
| 17 | 17 | #[stable(feature = "boxed_slice_into_iter", since = "1.80.0")] |
library/core/src/slice/mod.rs+2-2| ... | ... | @@ -39,11 +39,11 @@ mod raw; |
| 39 | 39 | mod rotate; |
| 40 | 40 | mod specialize; |
| 41 | 41 | |
| 42 | #[stable(feature = "inherent_ascii_escape", since = "1.60.0")] | |
| 43 | pub use ascii::EscapeAscii; | |
| 42 | 44 | #[unstable(feature = "str_internals", issue = "none")] |
| 43 | 45 | #[doc(hidden)] |
| 44 | 46 | pub use ascii::is_ascii_simple; |
| 45 | #[stable(feature = "inherent_ascii_escape", since = "1.60.0")] | |
| 46 | pub use ascii::EscapeAscii; | |
| 47 | 47 | #[stable(feature = "slice_get_slice", since = "1.28.0")] |
| 48 | 48 | pub use index::SliceIndex; |
| 49 | 49 | #[unstable(feature = "slice_range", issue = "76393")] |
library/core/src/slice/sort/stable/mod.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | use crate::mem::{self, MaybeUninit, SizedTypeProperties}; |
| 4 | 4 | use crate::slice::sort::shared::smallsort::{ |
| 5 | insertion_sort_shift_left, StableSmallSortTypeImpl, SMALL_SORT_GENERAL_SCRATCH_LEN, | |
| 5 | SMALL_SORT_GENERAL_SCRATCH_LEN, StableSmallSortTypeImpl, insertion_sort_shift_left, | |
| 6 | 6 | }; |
| 7 | 7 | use crate::{cmp, intrinsics}; |
| 8 | 8 |
library/core/src/slice/sort/stable/quicksort.rs+1-1| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | //! This module contains a stable quicksort and partition implementation. |
| 2 | 2 | |
| 3 | 3 | use crate::mem::{self, ManuallyDrop, MaybeUninit}; |
| 4 | use crate::slice::sort::shared::FreezeMarker; | |
| 4 | 5 | use crate::slice::sort::shared::pivot::choose_pivot; |
| 5 | 6 | use crate::slice::sort::shared::smallsort::StableSmallSortTypeImpl; |
| 6 | use crate::slice::sort::shared::FreezeMarker; | |
| 7 | 7 | use crate::{intrinsics, ptr}; |
| 8 | 8 | |
| 9 | 9 | /// Sorts `v` recursively using quicksort. |
library/core/src/str/converts.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | //! Ways to create a `str` from bytes slice. |
| 2 | 2 | |
| 3 | use super::validations::run_utf8_validation; | |
| 4 | 3 | use super::Utf8Error; |
| 4 | use super::validations::run_utf8_validation; | |
| 5 | 5 | use crate::{mem, ptr}; |
| 6 | 6 | |
| 7 | 7 | /// Converts a slice of bytes to a string slice. |
library/core/src/str/iter.rs+2-2| ... | ... | @@ -3,8 +3,8 @@ |
| 3 | 3 | use super::pattern::{DoubleEndedSearcher, Pattern, ReverseSearcher, Searcher}; |
| 4 | 4 | use super::validations::{next_code_point, next_code_point_reverse}; |
| 5 | 5 | use super::{ |
| 6 | from_utf8_unchecked, BytesIsNotEmpty, CharEscapeDebugContinue, CharEscapeDefault, | |
| 7 | CharEscapeUnicode, IsAsciiWhitespace, IsNotEmpty, IsWhitespace, LinesMap, UnsafeBytesToStr, | |
| 6 | BytesIsNotEmpty, CharEscapeDebugContinue, CharEscapeDefault, CharEscapeUnicode, | |
| 7 | IsAsciiWhitespace, IsNotEmpty, IsWhitespace, LinesMap, UnsafeBytesToStr, from_utf8_unchecked, | |
| 8 | 8 | }; |
| 9 | 9 | use crate::fmt::{self, Write}; |
| 10 | 10 | use crate::iter::{ |
library/core/src/task/wake.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | use crate::any::Any; |
| 4 | 4 | use crate::marker::PhantomData; |
| 5 | use crate::mem::{transmute, ManuallyDrop}; | |
| 5 | use crate::mem::{ManuallyDrop, transmute}; | |
| 6 | 6 | use crate::panic::AssertUnwindSafe; |
| 7 | 7 | use crate::{fmt, ptr}; |
| 8 | 8 |
library/core/tests/error.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use core::error::{request_ref, request_value, Request}; | |
| 1 | use core::error::{Request, request_ref, request_value}; | |
| 2 | 2 | |
| 3 | 3 | // Test the `Request` API. |
| 4 | 4 | #[derive(Debug)] |
library/core/tests/future.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use std::future::{join, Future}; | |
| 1 | use std::future::{Future, join}; | |
| 2 | 2 | use std::pin::Pin; |
| 3 | 3 | use std::sync::Arc; |
| 4 | 4 | use std::task::{Context, Poll, Wake}; |
library/core/tests/iter/adapters/map_windows.rs+5-4| ... | ... | @@ -159,10 +159,11 @@ fn output_n2() { |
| 159 | 159 | <Vec<[char; 2]>>::new(), |
| 160 | 160 | ); |
| 161 | 161 | assert_eq!("ab".chars().map_windows(|a: &[_; 2]| *a).collect::<Vec<_>>(), vec![['a', 'b']]); |
| 162 | assert_eq!( | |
| 163 | "abcd".chars().map_windows(|a: &[_; 2]| *a).collect::<Vec<_>>(), | |
| 164 | vec![['a', 'b'], ['b', 'c'], ['c', 'd']], | |
| 165 | ); | |
| 162 | assert_eq!("abcd".chars().map_windows(|a: &[_; 2]| *a).collect::<Vec<_>>(), vec![ | |
| 163 | ['a', 'b'], | |
| 164 | ['b', 'c'], | |
| 165 | ['c', 'd'] | |
| 166 | ],); | |
| 166 | 167 | } |
| 167 | 168 | |
| 168 | 169 | #[test] |
library/core/tests/iter/adapters/zip.rs+1-1| ... | ... | @@ -240,7 +240,7 @@ fn test_zip_trusted_random_access_composition() { |
| 240 | 240 | #[test] |
| 241 | 241 | #[cfg(panic = "unwind")] |
| 242 | 242 | fn test_zip_trusted_random_access_next_back_drop() { |
| 243 | use std::panic::{catch_unwind, AssertUnwindSafe}; | |
| 243 | use std::panic::{AssertUnwindSafe, catch_unwind}; | |
| 244 | 244 | |
| 245 | 245 | let mut counter = 0; |
| 246 | 246 |
library/core/tests/num/bignum.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | use core::num::bignum::tests::Big8x3 as Big; | |
| 2 | 1 | use core::num::bignum::Big32x40; |
| 2 | use core::num::bignum::tests::Big8x3 as Big; | |
| 3 | 3 | |
| 4 | 4 | #[test] |
| 5 | 5 | #[should_panic] |
library/core/tests/num/flt2dec/mod.rs+2-2| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use core::num::flt2dec::{ |
| 2 | decode, round_up, to_exact_exp_str, to_exact_fixed_str, to_shortest_exp_str, to_shortest_str, | |
| 3 | DecodableFloat, Decoded, FullDecoded, Sign, MAX_SIG_DIGITS, | |
| 2 | DecodableFloat, Decoded, FullDecoded, MAX_SIG_DIGITS, Sign, decode, round_up, to_exact_exp_str, | |
| 3 | to_exact_fixed_str, to_shortest_exp_str, to_shortest_str, | |
| 4 | 4 | }; |
| 5 | 5 | use core::num::fmt::{Formatted, Part}; |
| 6 | 6 | use std::mem::MaybeUninit; |
library/core/tests/num/flt2dec/random.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | #![cfg(not(target_arch = "wasm32"))] |
| 2 | 2 | |
| 3 | 3 | use core::num::flt2dec::strategy::grisu::{format_exact_opt, format_shortest_opt}; |
| 4 | use core::num::flt2dec::{decode, DecodableFloat, Decoded, FullDecoded, MAX_SIG_DIGITS}; | |
| 4 | use core::num::flt2dec::{DecodableFloat, Decoded, FullDecoded, MAX_SIG_DIGITS, decode}; | |
| 5 | 5 | use std::mem::MaybeUninit; |
| 6 | 6 | use std::str; |
| 7 | 7 |
library/core/tests/num/mod.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use core::fmt::Debug; |
| 2 | use core::num::{can_not_overflow, IntErrorKind, ParseIntError, TryFromIntError}; | |
| 2 | use core::num::{IntErrorKind, ParseIntError, TryFromIntError, can_not_overflow}; | |
| 3 | 3 | use core::ops::{Add, Div, Mul, Rem, Sub}; |
| 4 | 4 | use core::str::FromStr; |
| 5 | 5 |
library/core/tests/pin_macro.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | use core::marker::PhantomPinned; |
| 4 | 4 | use core::mem::{drop as stuff, transmute}; |
| 5 | use core::pin::{pin, Pin}; | |
| 5 | use core::pin::{Pin, pin}; | |
| 6 | 6 | |
| 7 | 7 | #[test] |
| 8 | 8 | fn basic() { |
library/core/tests/slice.rs+1-1| ... | ... | @@ -1857,8 +1857,8 @@ fn sort_unstable() { |
| 1857 | 1857 | fn select_nth_unstable() { |
| 1858 | 1858 | use core::cmp::Ordering::{Equal, Greater, Less}; |
| 1859 | 1859 | |
| 1860 | use rand::seq::SliceRandom; | |
| 1861 | 1860 | use rand::Rng; |
| 1861 | use rand::seq::SliceRandom; | |
| 1862 | 1862 | |
| 1863 | 1863 | let mut rng = crate::test_rng(); |
| 1864 | 1864 |
library/core/tests/waker.rs+1-1| ... | ... | @@ -22,7 +22,7 @@ static WAKER_VTABLE: RawWakerVTable = RawWakerVTable::new( |
| 22 | 22 | |
| 23 | 23 | // https://github.com/rust-lang/rust/issues/102012#issuecomment-1915282956 |
| 24 | 24 | mod nop_waker { |
| 25 | use core::future::{ready, Future}; | |
| 25 | use core::future::{Future, ready}; | |
| 26 | 26 | use core::pin::Pin; |
| 27 | 27 | use core::task::{Context, Poll, RawWaker, RawWakerVTable, Waker}; |
| 28 | 28 |
library/panic_unwind/src/emcc.rs+5-8| ... | ... | @@ -98,14 +98,11 @@ pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 { |
| 98 | 98 | if exception.is_null() { |
| 99 | 99 | return uw::_URC_FATAL_PHASE1_ERROR as u32; |
| 100 | 100 | } |
| 101 | ptr::write( | |
| 102 | exception, | |
| 103 | Exception { | |
| 104 | canary: &EXCEPTION_TYPE_INFO, | |
| 105 | caught: AtomicBool::new(false), | |
| 106 | data: Some(data), | |
| 107 | }, | |
| 108 | ); | |
| 101 | ptr::write(exception, Exception { | |
| 102 | canary: &EXCEPTION_TYPE_INFO, | |
| 103 | caught: AtomicBool::new(false), | |
| 104 | data: Some(data), | |
| 105 | }); | |
| 109 | 106 | __cxa_throw(exception as *mut _, &EXCEPTION_TYPE_INFO, exception_cleanup); |
| 110 | 107 | } |
| 111 | 108 |
library/proc_macro/src/lib.rs+2-2| ... | ... | @@ -54,7 +54,7 @@ use std::{error, fmt}; |
| 54 | 54 | #[unstable(feature = "proc_macro_diagnostic", issue = "54140")] |
| 55 | 55 | pub use diagnostic::{Diagnostic, Level, MultiSpan}; |
| 56 | 56 | |
| 57 | use crate::escape::{escape_bytes, EscapeOptions}; | |
| 57 | use crate::escape::{EscapeOptions, escape_bytes}; | |
| 58 | 58 | |
| 59 | 59 | /// Determines whether proc_macro has been made accessible to the currently |
| 60 | 60 | /// running program. |
| ... | ... | @@ -371,7 +371,7 @@ impl Extend<TokenStream> for TokenStream { |
| 371 | 371 | /// Public implementation details for the `TokenStream` type, such as iterators. |
| 372 | 372 | #[stable(feature = "proc_macro_lib2", since = "1.29.0")] |
| 373 | 373 | pub mod token_stream { |
| 374 | use crate::{bridge, Group, Ident, Literal, Punct, TokenStream, TokenTree}; | |
| 374 | use crate::{Group, Ident, Literal, Punct, TokenStream, TokenTree, bridge}; | |
| 375 | 375 | |
| 376 | 376 | /// An iterator over `TokenStream`'s `TokenTree`s. |
| 377 | 377 | /// The iteration is "shallow", e.g., the iterator doesn't recurse into delimited groups, |
library/std/src/ascii.rs+1-1| ... | ... | @@ -16,7 +16,7 @@ |
| 16 | 16 | #[unstable(feature = "ascii_char", issue = "110998")] |
| 17 | 17 | pub use core::ascii::Char; |
| 18 | 18 | #[stable(feature = "rust1", since = "1.0.0")] |
| 19 | pub use core::ascii::{escape_default, EscapeDefault}; | |
| 19 | pub use core::ascii::{EscapeDefault, escape_default}; | |
| 20 | 20 | |
| 21 | 21 | /// Extension methods for ASCII-subset only operations. |
| 22 | 22 | /// |
library/std/src/backtrace.rs+1-1| ... | ... | @@ -91,9 +91,9 @@ mod tests; |
| 91 | 91 | use crate::backtrace_rs::{self, BytesOrWideString}; |
| 92 | 92 | use crate::ffi::c_void; |
| 93 | 93 | use crate::panic::UnwindSafe; |
| 94 | use crate::sync::LazyLock; | |
| 94 | 95 | use crate::sync::atomic::AtomicU8; |
| 95 | 96 | use crate::sync::atomic::Ordering::Relaxed; |
| 96 | use crate::sync::LazyLock; | |
| 97 | 97 | use crate::sys::backtrace::{lock, output_filename, set_image_base}; |
| 98 | 98 | use crate::{env, fmt}; |
| 99 | 99 |
library/std/src/collections/hash/map/tests.rs+1-1| ... | ... | @@ -947,7 +947,7 @@ fn test_raw_entry() { |
| 947 | 947 | |
| 948 | 948 | mod test_extract_if { |
| 949 | 949 | use super::*; |
| 950 | use crate::panic::{catch_unwind, AssertUnwindSafe}; | |
| 950 | use crate::panic::{AssertUnwindSafe, catch_unwind}; | |
| 951 | 951 | use crate::sync::atomic::{AtomicUsize, Ordering}; |
| 952 | 952 | |
| 953 | 953 | trait EqSorted: Iterator { |
library/std/src/collections/hash/set/tests.rs+2-2| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use super::HashSet; |
| 2 | 2 | use crate::hash::RandomState; |
| 3 | use crate::panic::{catch_unwind, AssertUnwindSafe}; | |
| 4 | use crate::sync::atomic::{AtomicU32, Ordering}; | |
| 3 | use crate::panic::{AssertUnwindSafe, catch_unwind}; | |
| 5 | 4 | use crate::sync::Arc; |
| 5 | use crate::sync::atomic::{AtomicU32, Ordering}; | |
| 6 | 6 | |
| 7 | 7 | #[test] |
| 8 | 8 | fn test_zero_capacities() { |
library/std/src/collections/mod.rs+4-4| ... | ... | @@ -418,13 +418,13 @@ pub use alloc_crate::collections::TryReserveError; |
| 418 | 418 | )] |
| 419 | 419 | pub use alloc_crate::collections::TryReserveErrorKind; |
| 420 | 420 | #[stable(feature = "rust1", since = "1.0.0")] |
| 421 | pub use alloc_crate::collections::{binary_heap, btree_map, btree_set}; | |
| 422 | #[stable(feature = "rust1", since = "1.0.0")] | |
| 423 | pub use alloc_crate::collections::{linked_list, vec_deque}; | |
| 424 | #[stable(feature = "rust1", since = "1.0.0")] | |
| 425 | 421 | pub use alloc_crate::collections::{BTreeMap, BTreeSet, BinaryHeap}; |
| 426 | 422 | #[stable(feature = "rust1", since = "1.0.0")] |
| 427 | 423 | pub use alloc_crate::collections::{LinkedList, VecDeque}; |
| 424 | #[stable(feature = "rust1", since = "1.0.0")] | |
| 425 | pub use alloc_crate::collections::{binary_heap, btree_map, btree_set}; | |
| 426 | #[stable(feature = "rust1", since = "1.0.0")] | |
| 427 | pub use alloc_crate::collections::{linked_list, vec_deque}; | |
| 428 | 428 | |
| 429 | 429 | #[stable(feature = "rust1", since = "1.0.0")] |
| 430 | 430 | #[doc(inline)] |
library/std/src/error.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ mod tests; |
| 7 | 7 | #[stable(feature = "rust1", since = "1.0.0")] |
| 8 | 8 | pub use core::error::Error; |
| 9 | 9 | #[unstable(feature = "error_generic_member_access", issue = "99301")] |
| 10 | pub use core::error::{request_ref, request_value, Request}; | |
| 10 | pub use core::error::{Request, request_ref, request_value}; | |
| 11 | 11 | |
| 12 | 12 | use crate::backtrace::Backtrace; |
| 13 | 13 | use crate::fmt::{self, Write}; |
library/std/src/f32.rs+2-2| ... | ... | @@ -18,8 +18,8 @@ mod tests; |
| 18 | 18 | #[stable(feature = "rust1", since = "1.0.0")] |
| 19 | 19 | #[allow(deprecated, deprecated_in_future)] |
| 20 | 20 | pub use core::f32::{ |
| 21 | consts, DIGITS, EPSILON, INFINITY, MANTISSA_DIGITS, MAX, MAX_10_EXP, MAX_EXP, MIN, MIN_10_EXP, | |
| 22 | MIN_EXP, MIN_POSITIVE, NAN, NEG_INFINITY, RADIX, | |
| 21 | DIGITS, EPSILON, INFINITY, MANTISSA_DIGITS, MAX, MAX_10_EXP, MAX_EXP, MIN, MIN_10_EXP, MIN_EXP, | |
| 22 | MIN_POSITIVE, NAN, NEG_INFINITY, RADIX, consts, | |
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | 25 | #[cfg(not(test))] |
library/std/src/f64.rs+2-2| ... | ... | @@ -18,8 +18,8 @@ mod tests; |
| 18 | 18 | #[stable(feature = "rust1", since = "1.0.0")] |
| 19 | 19 | #[allow(deprecated, deprecated_in_future)] |
| 20 | 20 | pub use core::f64::{ |
| 21 | consts, DIGITS, EPSILON, INFINITY, MANTISSA_DIGITS, MAX, MAX_10_EXP, MAX_EXP, MIN, MIN_10_EXP, | |
| 22 | MIN_EXP, MIN_POSITIVE, NAN, NEG_INFINITY, RADIX, | |
| 21 | DIGITS, EPSILON, INFINITY, MANTISSA_DIGITS, MAX, MAX_10_EXP, MAX_EXP, MIN, MIN_10_EXP, MIN_EXP, | |
| 22 | MIN_POSITIVE, NAN, NEG_INFINITY, RADIX, consts, | |
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | 25 | #[cfg(not(test))] |
library/std/src/ffi/mod.rs+5-5| ... | ... | @@ -166,11 +166,6 @@ pub mod c_str; |
| 166 | 166 | |
| 167 | 167 | #[stable(feature = "core_c_void", since = "1.30.0")] |
| 168 | 168 | pub use core::ffi::c_void; |
| 169 | #[stable(feature = "core_ffi_c", since = "1.64.0")] | |
| 170 | pub use core::ffi::{ | |
| 171 | c_char, c_double, c_float, c_int, c_long, c_longlong, c_schar, c_short, c_uchar, c_uint, | |
| 172 | c_ulong, c_ulonglong, c_ushort, | |
| 173 | }; | |
| 174 | 169 | #[unstable( |
| 175 | 170 | feature = "c_variadic", |
| 176 | 171 | reason = "the `c_variadic` feature has not been properly tested on \ |
| ... | ... | @@ -178,6 +173,11 @@ pub use core::ffi::{ |
| 178 | 173 | issue = "44930" |
| 179 | 174 | )] |
| 180 | 175 | pub use core::ffi::{VaList, VaListImpl}; |
| 176 | #[stable(feature = "core_ffi_c", since = "1.64.0")] | |
| 177 | pub use core::ffi::{ | |
| 178 | c_char, c_double, c_float, c_int, c_long, c_longlong, c_schar, c_short, c_uchar, c_uint, | |
| 179 | c_ulong, c_ulonglong, c_ushort, | |
| 180 | }; | |
| 181 | 181 | |
| 182 | 182 | #[doc(no_inline)] |
| 183 | 183 | #[stable(feature = "cstr_from_bytes_until_nul", since = "1.69.0")] |
library/std/src/fs/tests.rs+2-2| ... | ... | @@ -11,10 +11,10 @@ use crate::os::unix::fs::symlink as symlink_file; |
| 11 | 11 | #[cfg(unix)] |
| 12 | 12 | use crate::os::unix::fs::symlink as junction_point; |
| 13 | 13 | #[cfg(windows)] |
| 14 | use crate::os::windows::fs::{junction_point, symlink_dir, symlink_file, OpenOptionsExt}; | |
| 14 | use crate::os::windows::fs::{OpenOptionsExt, junction_point, symlink_dir, symlink_file}; | |
| 15 | 15 | use crate::path::Path; |
| 16 | 16 | use crate::sync::Arc; |
| 17 | use crate::sys_common::io::test::{tmpdir, TempDir}; | |
| 17 | use crate::sys_common::io::test::{TempDir, tmpdir}; | |
| 18 | 18 | use crate::time::{Duration, Instant, SystemTime}; |
| 19 | 19 | use crate::{env, str, thread}; |
| 20 | 20 |
library/std/src/io/buffered/bufreader.rs+2-2| ... | ... | @@ -4,8 +4,8 @@ use buffer::Buffer; |
| 4 | 4 | |
| 5 | 5 | use crate::fmt; |
| 6 | 6 | use crate::io::{ |
| 7 | self, uninlined_slow_read_byte, BorrowedCursor, BufRead, IoSliceMut, Read, Seek, SeekFrom, | |
| 8 | SizeHint, SpecReadByte, DEFAULT_BUF_SIZE, | |
| 7 | self, BorrowedCursor, BufRead, DEFAULT_BUF_SIZE, IoSliceMut, Read, Seek, SeekFrom, SizeHint, | |
| 8 | SpecReadByte, uninlined_slow_read_byte, | |
| 9 | 9 | }; |
| 10 | 10 | |
| 11 | 11 | /// The `BufReader<R>` struct adds buffering to any reader. |
library/std/src/io/buffered/bufwriter.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::io::{ |
| 2 | self, ErrorKind, IntoInnerError, IoSlice, Seek, SeekFrom, Write, DEFAULT_BUF_SIZE, | |
| 2 | self, DEFAULT_BUF_SIZE, ErrorKind, IntoInnerError, IoSlice, Seek, SeekFrom, Write, | |
| 3 | 3 | }; |
| 4 | 4 | use crate::mem::{self, ManuallyDrop}; |
| 5 | 5 | use crate::{error, fmt, ptr}; |
library/std/src/io/copy.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use super::{BorrowedBuf, BufReader, BufWriter, Read, Result, Write, DEFAULT_BUF_SIZE}; | |
| 1 | use super::{BorrowedBuf, BufReader, BufWriter, DEFAULT_BUF_SIZE, Read, Result, Write}; | |
| 2 | 2 | use crate::alloc::Allocator; |
| 3 | 3 | use crate::cmp; |
| 4 | 4 | use crate::collections::VecDeque; |
library/std/src/io/copy/tests.rs+1-1| ... | ... | @@ -122,8 +122,8 @@ mod io_benches { |
| 122 | 122 | use test::Bencher; |
| 123 | 123 | |
| 124 | 124 | use crate::fs::{File, OpenOptions}; |
| 125 | use crate::io::prelude::*; | |
| 126 | 125 | use crate::io::BufReader; |
| 126 | use crate::io::prelude::*; | |
| 127 | 127 | |
| 128 | 128 | #[bench] |
| 129 | 129 | fn bench_copy_buf_reader(b: &mut Bencher) { |
library/std/src/io/error/tests.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use super::{const_io_error, Custom, Error, ErrorData, ErrorKind, Repr, SimpleMessage}; | |
| 1 | use super::{Custom, Error, ErrorData, ErrorKind, Repr, SimpleMessage, const_io_error}; | |
| 2 | 2 | use crate::assert_matches::assert_matches; |
| 3 | 3 | use crate::mem::size_of; |
| 4 | 4 | use crate::sys::decode_error_kind; |
library/std/src/io/mod.rs+3-3| ... | ... | @@ -307,9 +307,9 @@ pub(crate) use error::const_io_error; |
| 307 | 307 | pub use self::buffered::WriterPanicked; |
| 308 | 308 | #[unstable(feature = "raw_os_error_ty", issue = "107792")] |
| 309 | 309 | pub use self::error::RawOsError; |
| 310 | pub(crate) use self::stdio::attempt_print_to_stderr; | |
| 311 | 310 | #[stable(feature = "is_terminal", since = "1.70.0")] |
| 312 | 311 | pub use self::stdio::IsTerminal; |
| 312 | pub(crate) use self::stdio::attempt_print_to_stderr; | |
| 313 | 313 | #[unstable(feature = "print_internals", issue = "none")] |
| 314 | 314 | #[doc(hidden)] |
| 315 | 315 | pub use self::stdio::{_eprint, _print}; |
| ... | ... | @@ -322,8 +322,8 @@ pub use self::{ |
| 322 | 322 | copy::copy, |
| 323 | 323 | cursor::Cursor, |
| 324 | 324 | error::{Error, ErrorKind, Result}, |
| 325 | stdio::{stderr, stdin, stdout, Stderr, StderrLock, Stdin, StdinLock, Stdout, StdoutLock}, | |
| 326 | util::{empty, repeat, sink, Empty, Repeat, Sink}, | |
| 325 | stdio::{Stderr, StderrLock, Stdin, StdinLock, Stdout, StdoutLock, stderr, stdin, stdout}, | |
| 326 | util::{Empty, Repeat, Sink, empty, repeat, sink}, | |
| 327 | 327 | }; |
| 328 | 328 | use crate::mem::take; |
| 329 | 329 | use crate::ops::{Deref, DerefMut}; |
library/std/src/io/stdio/tests.rs+3-4| ... | ... | @@ -159,8 +159,7 @@ where |
| 159 | 159 | assert_eq!(rx2.recv().unwrap(), Release2); // release th2 |
| 160 | 160 | th2.join().unwrap(); |
| 161 | 161 | th1.join().unwrap(); |
| 162 | assert_eq!( | |
| 163 | *log.lock().unwrap(), | |
| 164 | [Start1, Acquire1, Start2, Release1, Acquire2, Release2, Acquire1, Release1] | |
| 165 | ); | |
| 162 | assert_eq!(*log.lock().unwrap(), [ | |
| 163 | Start1, Acquire1, Start2, Release1, Acquire2, Release2, Acquire1, Release1 | |
| 164 | ]); | |
| 166 | 165 | } |
library/std/src/io/tests.rs+2-2| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | use super::{repeat, BorrowedBuf, Cursor, SeekFrom}; | |
| 1 | use super::{BorrowedBuf, Cursor, SeekFrom, repeat}; | |
| 2 | 2 | use crate::cmp::{self, min}; |
| 3 | 3 | use crate::io::{ |
| 4 | self, BufRead, BufReader, IoSlice, IoSliceMut, Read, Seek, Write, DEFAULT_BUF_SIZE, | |
| 4 | self, BufRead, BufReader, DEFAULT_BUF_SIZE, IoSlice, IoSliceMut, Read, Seek, Write, | |
| 5 | 5 | }; |
| 6 | 6 | use crate::mem::MaybeUninit; |
| 7 | 7 | use crate::ops::Deref; |
library/std/src/io/util/tests.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::io::prelude::*; |
| 2 | use crate::io::{empty, repeat, sink, BorrowedBuf, Empty, Repeat, SeekFrom, Sink}; | |
| 2 | use crate::io::{BorrowedBuf, Empty, Repeat, SeekFrom, Sink, empty, repeat, sink}; | |
| 3 | 3 | use crate::mem::MaybeUninit; |
| 4 | 4 | |
| 5 | 5 | #[test] |
library/std/src/lib.rs+10-10| ... | ... | @@ -493,9 +493,9 @@ pub use core::default; |
| 493 | 493 | pub use core::future; |
| 494 | 494 | #[stable(feature = "core_hint", since = "1.27.0")] |
| 495 | 495 | pub use core::hint; |
| 496 | #[stable(feature = "i128", since = "1.26.0")] | |
| 496 | #[stable(feature = "rust1", since = "1.0.0")] | |
| 497 | 497 | #[allow(deprecated, deprecated_in_future)] |
| 498 | pub use core::i128; | |
| 498 | pub use core::i8; | |
| 499 | 499 | #[stable(feature = "rust1", since = "1.0.0")] |
| 500 | 500 | #[allow(deprecated, deprecated_in_future)] |
| 501 | 501 | pub use core::i16; |
| ... | ... | @@ -505,9 +505,9 @@ pub use core::i32; |
| 505 | 505 | #[stable(feature = "rust1", since = "1.0.0")] |
| 506 | 506 | #[allow(deprecated, deprecated_in_future)] |
| 507 | 507 | pub use core::i64; |
| 508 | #[stable(feature = "rust1", since = "1.0.0")] | |
| 508 | #[stable(feature = "i128", since = "1.26.0")] | |
| 509 | 509 | #[allow(deprecated, deprecated_in_future)] |
| 510 | pub use core::i8; | |
| 510 | pub use core::i128; | |
| 511 | 511 | #[stable(feature = "rust1", since = "1.0.0")] |
| 512 | 512 | pub use core::intrinsics; |
| 513 | 513 | #[stable(feature = "rust1", since = "1.0.0")] |
| ... | ... | @@ -529,9 +529,9 @@ pub use core::pin; |
| 529 | 529 | pub use core::ptr; |
| 530 | 530 | #[stable(feature = "rust1", since = "1.0.0")] |
| 531 | 531 | pub use core::result; |
| 532 | #[stable(feature = "i128", since = "1.26.0")] | |
| 532 | #[stable(feature = "rust1", since = "1.0.0")] | |
| 533 | 533 | #[allow(deprecated, deprecated_in_future)] |
| 534 | pub use core::u128; | |
| 534 | pub use core::u8; | |
| 535 | 535 | #[stable(feature = "rust1", since = "1.0.0")] |
| 536 | 536 | #[allow(deprecated, deprecated_in_future)] |
| 537 | 537 | pub use core::u16; |
| ... | ... | @@ -541,9 +541,9 @@ pub use core::u32; |
| 541 | 541 | #[stable(feature = "rust1", since = "1.0.0")] |
| 542 | 542 | #[allow(deprecated, deprecated_in_future)] |
| 543 | 543 | pub use core::u64; |
| 544 | #[stable(feature = "rust1", since = "1.0.0")] | |
| 544 | #[stable(feature = "i128", since = "1.26.0")] | |
| 545 | 545 | #[allow(deprecated, deprecated_in_future)] |
| 546 | pub use core::u8; | |
| 546 | pub use core::u128; | |
| 547 | 547 | #[stable(feature = "rust1", since = "1.0.0")] |
| 548 | 548 | #[allow(deprecated, deprecated_in_future)] |
| 549 | 549 | pub use core::usize; |
| ... | ... | @@ -649,9 +649,9 @@ pub mod arch { |
| 649 | 649 | #[stable(feature = "simd_x86", since = "1.27.0")] |
| 650 | 650 | pub use std_detect::is_x86_feature_detected; |
| 651 | 651 | #[unstable(feature = "stdarch_mips_feature_detection", issue = "111188")] |
| 652 | pub use std_detect::{is_mips64_feature_detected, is_mips_feature_detected}; | |
| 652 | pub use std_detect::{is_mips_feature_detected, is_mips64_feature_detected}; | |
| 653 | 653 | #[unstable(feature = "stdarch_powerpc_feature_detection", issue = "111191")] |
| 654 | pub use std_detect::{is_powerpc64_feature_detected, is_powerpc_feature_detected}; | |
| 654 | pub use std_detect::{is_powerpc_feature_detected, is_powerpc64_feature_detected}; | |
| 655 | 655 | } |
| 656 | 656 | |
| 657 | 657 | // This was stabilized in the crate root so we have to keep it there. |
library/std/src/net/ip_addr/tests.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | use crate::net::test::{sa4, tsa}; | |
| 2 | 1 | use crate::net::Ipv4Addr; |
| 2 | use crate::net::test::{sa4, tsa}; | |
| 3 | 3 | |
| 4 | 4 | #[test] |
| 5 | 5 | fn to_socket_addr_socketaddr() { |
library/std/src/net/tcp.rs+1-1| ... | ... | @@ -8,7 +8,7 @@ use crate::io::prelude::*; |
| 8 | 8 | use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut}; |
| 9 | 9 | use crate::iter::FusedIterator; |
| 10 | 10 | use crate::net::{Shutdown, SocketAddr, ToSocketAddrs}; |
| 11 | use crate::sys_common::{net as net_imp, AsInner, FromInner, IntoInner}; | |
| 11 | use crate::sys_common::{AsInner, FromInner, IntoInner, net as net_imp}; | |
| 12 | 12 | use crate::time::Duration; |
| 13 | 13 | |
| 14 | 14 | /// A TCP stream between a local and a remote socket. |
library/std/src/net/udp.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ mod tests; |
| 4 | 4 | use crate::fmt; |
| 5 | 5 | use crate::io::{self, ErrorKind}; |
| 6 | 6 | use crate::net::{Ipv4Addr, Ipv6Addr, SocketAddr, ToSocketAddrs}; |
| 7 | use crate::sys_common::{net as net_imp, AsInner, FromInner, IntoInner}; | |
| 7 | use crate::sys_common::{AsInner, FromInner, IntoInner, net as net_imp}; | |
| 8 | 8 | use crate::time::Duration; |
| 9 | 9 | |
| 10 | 10 | /// A UDP socket. |
library/std/src/num.rs+2-2| ... | ... | @@ -26,9 +26,9 @@ pub use core::num::ZeroablePrimitive; |
| 26 | 26 | #[stable(feature = "rust1", since = "1.0.0")] |
| 27 | 27 | pub use core::num::{FpCategory, ParseFloatError, ParseIntError, TryFromIntError}; |
| 28 | 28 | #[stable(feature = "signed_nonzero", since = "1.34.0")] |
| 29 | pub use core::num::{NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize}; | |
| 29 | pub use core::num::{NonZeroI8, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI128, NonZeroIsize}; | |
| 30 | 30 | #[stable(feature = "nonzero", since = "1.28.0")] |
| 31 | pub use core::num::{NonZeroU128, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize}; | |
| 31 | pub use core::num::{NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU128, NonZeroUsize}; | |
| 32 | 32 | |
| 33 | 33 | #[cfg(test)] |
| 34 | 34 | use crate::fmt; |
library/std/src/os/fortanix_sgx/mod.rs+6-6| ... | ... | @@ -22,12 +22,12 @@ pub mod usercalls { |
| 22 | 22 | /// Lowest-level interfaces to usercalls and usercall ABI type definitions. |
| 23 | 23 | pub mod raw { |
| 24 | 24 | pub use crate::sys::abi::usercalls::raw::{ |
| 25 | accept_stream, alloc, async_queues, bind_stream, close, connect_stream, do_usercall, | |
| 26 | exit, flush, free, insecure_time, launch_thread, read, read_alloc, send, wait, write, | |
| 27 | ByteBuffer, Cancel, Error, Fd, FifoDescriptor, Register, RegisterArgument, Result, | |
| 28 | Return, ReturnValue, Tcs, Usercall, Usercalls as UsercallNrs, EV_RETURNQ_NOT_EMPTY, | |
| 29 | EV_UNPARK, EV_USERCALLQ_NOT_FULL, FD_STDERR, FD_STDIN, FD_STDOUT, RESULT_SUCCESS, | |
| 30 | USERCALL_USER_DEFINED, WAIT_INDEFINITE, WAIT_NO, | |
| 25 | ByteBuffer, Cancel, EV_RETURNQ_NOT_EMPTY, EV_UNPARK, EV_USERCALLQ_NOT_FULL, Error, | |
| 26 | FD_STDERR, FD_STDIN, FD_STDOUT, Fd, FifoDescriptor, RESULT_SUCCESS, Register, | |
| 27 | RegisterArgument, Result, Return, ReturnValue, Tcs, USERCALL_USER_DEFINED, Usercall, | |
| 28 | Usercalls as UsercallNrs, WAIT_INDEFINITE, WAIT_NO, accept_stream, alloc, async_queues, | |
| 29 | bind_stream, close, connect_stream, do_usercall, exit, flush, free, insecure_time, | |
| 30 | launch_thread, read, read_alloc, send, wait, write, | |
| 31 | 31 | }; |
| 32 | 32 | } |
| 33 | 33 | } |
library/std/src/os/unix/net/ancillary.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | // FIXME: This is currently disabled on *BSD. |
| 2 | 2 | |
| 3 | use super::{sockaddr_un, SocketAddr}; | |
| 3 | use super::{SocketAddr, sockaddr_un}; | |
| 4 | 4 | use crate::io::{self, IoSlice, IoSliceMut}; |
| 5 | 5 | use crate::marker::PhantomData; |
| 6 | 6 | use crate::mem::zeroed; |
library/std/src/os/unix/net/datagram.rs+2-2| ... | ... | @@ -12,9 +12,9 @@ |
| 12 | 12 | ))] |
| 13 | 13 | use libc::MSG_NOSIGNAL; |
| 14 | 14 | |
| 15 | use super::{SocketAddr, sockaddr_un}; | |
| 15 | 16 | #[cfg(any(doc, target_os = "android", target_os = "linux"))] |
| 16 | use super::{recv_vectored_with_ancillary_from, send_vectored_with_ancillary_to, SocketAncillary}; | |
| 17 | use super::{sockaddr_un, SocketAddr}; | |
| 17 | use super::{SocketAncillary, recv_vectored_with_ancillary_from, send_vectored_with_ancillary_to}; | |
| 18 | 18 | #[cfg(any(doc, target_os = "android", target_os = "linux"))] |
| 19 | 19 | use crate::io::{IoSlice, IoSliceMut}; |
| 20 | 20 | use crate::net::Shutdown; |
library/std/src/os/unix/net/listener.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use super::{sockaddr_un, SocketAddr, UnixStream}; | |
| 1 | use super::{SocketAddr, UnixStream, sockaddr_un}; | |
| 2 | 2 | use crate::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, OwnedFd, RawFd}; |
| 3 | 3 | use crate::path::Path; |
| 4 | 4 | use crate::sys::cvt; |
library/std/src/os/unix/net/stream.rs+4-4| ... | ... | @@ -1,3 +1,6 @@ |
| 1 | use super::{SocketAddr, sockaddr_un}; | |
| 2 | #[cfg(any(doc, target_os = "android", target_os = "linux"))] | |
| 3 | use super::{SocketAncillary, recv_vectored_with_ancillary_from, send_vectored_with_ancillary_to}; | |
| 1 | 4 | #[cfg(any( |
| 2 | 5 | target_os = "android", |
| 3 | 6 | target_os = "linux", |
| ... | ... | @@ -8,10 +11,7 @@ |
| 8 | 11 | target_os = "nto", |
| 9 | 12 | target_vendor = "apple", |
| 10 | 13 | ))] |
| 11 | use super::{peer_cred, UCred}; | |
| 12 | #[cfg(any(doc, target_os = "android", target_os = "linux"))] | |
| 13 | use super::{recv_vectored_with_ancillary_from, send_vectored_with_ancillary_to, SocketAncillary}; | |
| 14 | use super::{sockaddr_un, SocketAddr}; | |
| 14 | use super::{UCred, peer_cred}; | |
| 15 | 15 | use crate::fmt; |
| 16 | 16 | use crate::io::{self, IoSlice, IoSliceMut}; |
| 17 | 17 | use crate::net::Shutdown; |
library/std/src/os/unix/net/ucred.rs+2-2| ... | ... | @@ -38,7 +38,7 @@ pub(super) use self::impl_linux::peer_cred; |
| 38 | 38 | |
| 39 | 39 | #[cfg(any(target_os = "linux", target_os = "android"))] |
| 40 | 40 | mod impl_linux { |
| 41 | use libc::{c_void, getsockopt, socklen_t, ucred, SOL_SOCKET, SO_PEERCRED}; | |
| 41 | use libc::{SO_PEERCRED, SOL_SOCKET, c_void, getsockopt, socklen_t, ucred}; | |
| 42 | 42 | |
| 43 | 43 | use super::UCred; |
| 44 | 44 | use crate::os::unix::io::AsRawFd; |
| ... | ... | @@ -98,7 +98,7 @@ mod impl_bsd { |
| 98 | 98 | |
| 99 | 99 | #[cfg(target_vendor = "apple")] |
| 100 | 100 | mod impl_apple { |
| 101 | use libc::{c_void, getpeereid, getsockopt, pid_t, socklen_t, LOCAL_PEERPID, SOL_LOCAL}; | |
| 101 | use libc::{LOCAL_PEERPID, SOL_LOCAL, c_void, getpeereid, getsockopt, pid_t, socklen_t}; | |
| 102 | 102 | |
| 103 | 103 | use super::UCred; |
| 104 | 104 | use crate::os::unix::io::AsRawFd; |
library/std/src/os/xous/ffi/definitions.rs+30-36| ... | ... | @@ -126,42 +126,36 @@ impl From<i32> for Error { |
| 126 | 126 | #[stable(feature = "rust1", since = "1.0.0")] |
| 127 | 127 | impl core::fmt::Display for Error { |
| 128 | 128 | fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { |
| 129 | write!( | |
| 130 | f, | |
| 131 | "{}", | |
| 132 | match self { | |
| 133 | Error::NoError => "no error occurred", | |
| 134 | Error::BadAlignment => "memory was not properly aligned", | |
| 135 | Error::BadAddress => "an invalid address was supplied", | |
| 136 | Error::OutOfMemory => "the process or service has run out of memory", | |
| 137 | Error::MemoryInUse => "the requested address is in use", | |
| 138 | Error::InterruptNotFound => | |
| 139 | "the requested interrupt does not exist on this platform", | |
| 140 | Error::InterruptInUse => "the requested interrupt is currently in use", | |
| 141 | Error::InvalidString => "the specified string was not formatted correctly", | |
| 142 | Error::ServerExists => "a server with that address already exists", | |
| 143 | Error::ServerNotFound => "the requetsed server could not be found", | |
| 144 | Error::ProcessNotFound => "the target process does not exist", | |
| 145 | Error::ProcessNotChild => | |
| 146 | "the requested operation can only be done on child processes", | |
| 147 | Error::ProcessTerminated => "the target process has crashed", | |
| 148 | Error::Timeout => "the requested operation timed out", | |
| 149 | Error::InternalError => "an internal error occurred", | |
| 150 | Error::ServerQueueFull => "the server has too many pending messages", | |
| 151 | Error::ThreadNotAvailable => "the specified thread does not exist", | |
| 152 | Error::UnhandledSyscall => "the kernel did not recognize that syscall", | |
| 153 | Error::InvalidSyscall => "the syscall had incorrect parameters", | |
| 154 | Error::ShareViolation => "an attempt was made to share memory twice", | |
| 155 | Error::InvalidThread => "tried to resume a thread that was not ready", | |
| 156 | Error::InvalidPid => "kernel attempted to use a pid that was not valid", | |
| 157 | Error::AccessDenied => "no permission to perform the requested operation", | |
| 158 | Error::UseBeforeInit => "attempt to use a service before initialization finished", | |
| 159 | Error::DoubleFree => "the requested resource was freed twice", | |
| 160 | Error::DebugInProgress => "kernel attempted to activate a thread being debugged", | |
| 161 | Error::InvalidLimit => "process attempted to adjust an invalid limit", | |
| 162 | Error::UnknownError => "an unknown error occurred", | |
| 163 | } | |
| 164 | ) | |
| 129 | write!(f, "{}", match self { | |
| 130 | Error::NoError => "no error occurred", | |
| 131 | Error::BadAlignment => "memory was not properly aligned", | |
| 132 | Error::BadAddress => "an invalid address was supplied", | |
| 133 | Error::OutOfMemory => "the process or service has run out of memory", | |
| 134 | Error::MemoryInUse => "the requested address is in use", | |
| 135 | Error::InterruptNotFound => "the requested interrupt does not exist on this platform", | |
| 136 | Error::InterruptInUse => "the requested interrupt is currently in use", | |
| 137 | Error::InvalidString => "the specified string was not formatted correctly", | |
| 138 | Error::ServerExists => "a server with that address already exists", | |
| 139 | Error::ServerNotFound => "the requetsed server could not be found", | |
| 140 | Error::ProcessNotFound => "the target process does not exist", | |
| 141 | Error::ProcessNotChild => "the requested operation can only be done on child processes", | |
| 142 | Error::ProcessTerminated => "the target process has crashed", | |
| 143 | Error::Timeout => "the requested operation timed out", | |
| 144 | Error::InternalError => "an internal error occurred", | |
| 145 | Error::ServerQueueFull => "the server has too many pending messages", | |
| 146 | Error::ThreadNotAvailable => "the specified thread does not exist", | |
| 147 | Error::UnhandledSyscall => "the kernel did not recognize that syscall", | |
| 148 | Error::InvalidSyscall => "the syscall had incorrect parameters", | |
| 149 | Error::ShareViolation => "an attempt was made to share memory twice", | |
| 150 | Error::InvalidThread => "tried to resume a thread that was not ready", | |
| 151 | Error::InvalidPid => "kernel attempted to use a pid that was not valid", | |
| 152 | Error::AccessDenied => "no permission to perform the requested operation", | |
| 153 | Error::UseBeforeInit => "attempt to use a service before initialization finished", | |
| 154 | Error::DoubleFree => "the requested resource was freed twice", | |
| 155 | Error::DebugInProgress => "kernel attempted to activate a thread being debugged", | |
| 156 | Error::InvalidLimit => "process attempted to adjust an invalid limit", | |
| 157 | Error::UnknownError => "an unknown error occurred", | |
| 158 | }) | |
| 165 | 159 | } |
| 166 | 160 | } |
| 167 | 161 |
library/std/src/os/xous/services.rs+1-1| ... | ... | @@ -19,7 +19,7 @@ pub(crate) use ticktimer::*; |
| 19 | 19 | |
| 20 | 20 | mod ns { |
| 21 | 21 | const NAME_MAX_LENGTH: usize = 64; |
| 22 | use crate::os::xous::ffi::{lend_mut, Connection}; | |
| 22 | use crate::os::xous::ffi::{Connection, lend_mut}; | |
| 23 | 23 | // By making this repr(C), the layout of this struct becomes well-defined |
| 24 | 24 | // and no longer shifts around. |
| 25 | 25 | // By marking it as `align(4096)` we define that it will be page-aligned, |
library/std/src/os/xous/services/systime.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use core::sync::atomic::{AtomicU32, Ordering}; |
| 2 | 2 | |
| 3 | use crate::os::xous::ffi::{connect, Connection}; | |
| 3 | use crate::os::xous::ffi::{Connection, connect}; | |
| 4 | 4 | |
| 5 | 5 | pub(crate) enum SystimeScalar { |
| 6 | 6 | GetUtcTimeMs, |
library/std/src/panic.rs+2-2| ... | ... | @@ -231,11 +231,11 @@ pub macro panic_2015 { |
| 231 | 231 | }), |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | #[stable(feature = "panic_hooks", since = "1.10.0")] | |
| 235 | pub use core::panic::Location; | |
| 234 | 236 | #[doc(hidden)] |
| 235 | 237 | #[unstable(feature = "edition_panic", issue = "none", reason = "use panic!() instead")] |
| 236 | 238 | pub use core::panic::panic_2021; |
| 237 | #[stable(feature = "panic_hooks", since = "1.10.0")] | |
| 238 | pub use core::panic::Location; | |
| 239 | 239 | #[stable(feature = "catch_unwind", since = "1.9.0")] |
| 240 | 240 | pub use core::panic::{AssertUnwindSafe, RefUnwindSafe, UnwindSafe}; |
| 241 | 241 |
library/std/src/path.rs+2-2| ... | ... | @@ -75,14 +75,14 @@ use core::clone::CloneToUninit; |
| 75 | 75 | use crate::borrow::{Borrow, Cow}; |
| 76 | 76 | use crate::collections::TryReserveError; |
| 77 | 77 | use crate::error::Error; |
| 78 | use crate::ffi::{os_str, OsStr, OsString}; | |
| 78 | use crate::ffi::{OsStr, OsString, os_str}; | |
| 79 | 79 | use crate::hash::{Hash, Hasher}; |
| 80 | 80 | use crate::iter::FusedIterator; |
| 81 | 81 | use crate::ops::{self, Deref}; |
| 82 | 82 | use crate::rc::Rc; |
| 83 | 83 | use crate::str::FromStr; |
| 84 | 84 | use crate::sync::Arc; |
| 85 | use crate::sys::path::{is_sep_byte, is_verbatim_sep, parse_prefix, MAIN_SEP_STR}; | |
| 85 | use crate::sys::path::{MAIN_SEP_STR, is_sep_byte, is_verbatim_sep, parse_prefix}; | |
| 86 | 86 | use crate::{cmp, fmt, fs, io, sys}; |
| 87 | 87 | |
| 88 | 88 | //////////////////////////////////////////////////////////////////////////////// |
library/std/src/pipe.rs+1-1| ... | ... | @@ -12,7 +12,7 @@ |
| 12 | 12 | //! ``` |
| 13 | 13 | |
| 14 | 14 | use crate::io; |
| 15 | use crate::sys::anonymous_pipe::{pipe as pipe_inner, AnonPipe}; | |
| 15 | use crate::sys::anonymous_pipe::{AnonPipe, pipe as pipe_inner}; | |
| 16 | 16 | |
| 17 | 17 | /// Create anonymous pipe that is close-on-exec and blocking. |
| 18 | 18 | #[unstable(feature = "anonymous_pipe", issue = "127154")] |
library/std/src/process.rs+1-1| ... | ... | @@ -157,7 +157,7 @@ use crate::io::prelude::*; |
| 157 | 157 | use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut}; |
| 158 | 158 | use crate::num::NonZero; |
| 159 | 159 | use crate::path::Path; |
| 160 | use crate::sys::pipe::{read2, AnonPipe}; | |
| 160 | use crate::sys::pipe::{AnonPipe, read2}; | |
| 161 | 161 | use crate::sys::process as imp; |
| 162 | 162 | #[stable(feature = "command_access", since = "1.57.0")] |
| 163 | 163 | pub use crate::sys_common::process::CommandEnvs; |
library/std/src/process/tests.rs+1-1| ... | ... | @@ -437,7 +437,7 @@ fn test_proc_thread_attributes() { |
| 437 | 437 | use crate::mem; |
| 438 | 438 | use crate::os::windows::io::AsRawHandle; |
| 439 | 439 | use crate::os::windows::process::CommandExt; |
| 440 | use crate::sys::c::{CloseHandle, BOOL, HANDLE}; | |
| 440 | use crate::sys::c::{BOOL, CloseHandle, HANDLE}; | |
| 441 | 441 | use crate::sys::cvt; |
| 442 | 442 | |
| 443 | 443 | #[repr(C)] |
library/std/src/sync/barrier/tests.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::sync::mpsc::{channel, TryRecvError}; | |
| 1 | use crate::sync::mpsc::{TryRecvError, channel}; | |
| 2 | 2 | use crate::sync::{Arc, Barrier}; |
| 3 | 3 | use crate::thread; |
| 4 | 4 |
library/std/src/sync/condvar.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | mod tests; |
| 3 | 3 | |
| 4 | 4 | use crate::fmt; |
| 5 | use crate::sync::{mutex, poison, LockResult, MutexGuard, PoisonError}; | |
| 5 | use crate::sync::{LockResult, MutexGuard, PoisonError, mutex, poison}; | |
| 6 | 6 | use crate::sys::sync as sys; |
| 7 | 7 | use crate::time::{Duration, Instant}; |
| 8 | 8 |
library/std/src/sync/mod.rs+3-3| ... | ... | @@ -161,10 +161,10 @@ |
| 161 | 161 | |
| 162 | 162 | #![stable(feature = "rust1", since = "1.0.0")] |
| 163 | 163 | |
| 164 | #[stable(feature = "rust1", since = "1.0.0")] | |
| 165 | pub use core::sync::atomic; | |
| 166 | 164 | #[unstable(feature = "exclusive_wrapper", issue = "98407")] |
| 167 | 165 | pub use core::sync::Exclusive; |
| 166 | #[stable(feature = "rust1", since = "1.0.0")] | |
| 167 | pub use core::sync::atomic; | |
| 168 | 168 | |
| 169 | 169 | #[stable(feature = "rust1", since = "1.0.0")] |
| 170 | 170 | pub use alloc_crate::sync::{Arc, Weak}; |
| ... | ... | @@ -181,7 +181,7 @@ pub use self::mutex::MappedMutexGuard; |
| 181 | 181 | pub use self::mutex::{Mutex, MutexGuard}; |
| 182 | 182 | #[stable(feature = "rust1", since = "1.0.0")] |
| 183 | 183 | #[allow(deprecated)] |
| 184 | pub use self::once::{Once, OnceState, ONCE_INIT}; | |
| 184 | pub use self::once::{ONCE_INIT, Once, OnceState}; | |
| 185 | 185 | #[stable(feature = "once_cell", since = "1.70.0")] |
| 186 | 186 | pub use self::once_lock::OnceLock; |
| 187 | 187 | #[stable(feature = "rust1", since = "1.0.0")] |
library/std/src/sync/mpmc/context.rs+1-1| ... | ... | @@ -4,8 +4,8 @@ use super::select::Selected; |
| 4 | 4 | use super::waker::current_thread_id; |
| 5 | 5 | use crate::cell::Cell; |
| 6 | 6 | use crate::ptr; |
| 7 | use crate::sync::atomic::{AtomicPtr, AtomicUsize, Ordering}; | |
| 8 | 7 | use crate::sync::Arc; |
| 8 | use crate::sync::atomic::{AtomicPtr, AtomicUsize, Ordering}; | |
| 9 | 9 | use crate::thread::{self, Thread}; |
| 10 | 10 | use crate::time::Instant; |
| 11 | 11 |
library/std/src/sync/mpmc/waker.rs+1-1| ... | ... | @@ -3,8 +3,8 @@ |
| 3 | 3 | use super::context::Context; |
| 4 | 4 | use super::select::{Operation, Selected}; |
| 5 | 5 | use crate::ptr; |
| 6 | use crate::sync::atomic::{AtomicBool, Ordering}; | |
| 7 | 6 | use crate::sync::Mutex; |
| 7 | use crate::sync::atomic::{AtomicBool, Ordering}; | |
| 8 | 8 | |
| 9 | 9 | /// Represents a thread blocked on a specific channel operation. |
| 10 | 10 | pub(crate) struct Entry { |
library/std/src/sync/mpmc/zero.rs+1-1| ... | ... | @@ -9,8 +9,8 @@ use super::utils::Backoff; |
| 9 | 9 | use super::waker::Waker; |
| 10 | 10 | use crate::cell::UnsafeCell; |
| 11 | 11 | use crate::marker::PhantomData; |
| 12 | use crate::sync::atomic::{AtomicBool, Ordering}; | |
| 13 | 12 | use crate::sync::Mutex; |
| 13 | use crate::sync::atomic::{AtomicBool, Ordering}; | |
| 14 | 14 | use crate::time::Instant; |
| 15 | 15 | use crate::{fmt, ptr}; |
| 16 | 16 |
library/std/src/sync/mutex.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ use crate::marker::PhantomData; |
| 7 | 7 | use crate::mem::ManuallyDrop; |
| 8 | 8 | use crate::ops::{Deref, DerefMut}; |
| 9 | 9 | use crate::ptr::NonNull; |
| 10 | use crate::sync::{poison, LockResult, TryLockError, TryLockResult}; | |
| 10 | use crate::sync::{LockResult, TryLockError, TryLockResult, poison}; | |
| 11 | 11 | use crate::sys::sync as sys; |
| 12 | 12 | |
| 13 | 13 | /// A mutual exclusion primitive useful for protecting shared data |
library/std/src/sync/once_lock/tests.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | use crate::sync::OnceLock; | |
| 1 | 2 | use crate::sync::atomic::AtomicUsize; |
| 2 | 3 | use crate::sync::atomic::Ordering::SeqCst; |
| 3 | 4 | use crate::sync::mpsc::channel; |
| 4 | use crate::sync::OnceLock; | |
| 5 | 5 | use crate::{panic, thread}; |
| 6 | 6 | |
| 7 | 7 | fn spawn_and_wait<R: Send + 'static>(f: impl FnOnce() -> R + Send + 'static) -> R { |
library/std/src/sync/reentrant_lock.rs+1-1| ... | ... | @@ -8,7 +8,7 @@ use crate::fmt; |
| 8 | 8 | use crate::ops::Deref; |
| 9 | 9 | use crate::panic::{RefUnwindSafe, UnwindSafe}; |
| 10 | 10 | use crate::sys::sync as sys; |
| 11 | use crate::thread::{current_id, ThreadId}; | |
| 11 | use crate::thread::{ThreadId, current_id}; | |
| 12 | 12 | |
| 13 | 13 | /// A re-entrant mutual exclusion lock |
| 14 | 14 | /// |
library/std/src/sync/rwlock.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ use crate::marker::PhantomData; |
| 7 | 7 | use crate::mem::ManuallyDrop; |
| 8 | 8 | use crate::ops::{Deref, DerefMut}; |
| 9 | 9 | use crate::ptr::NonNull; |
| 10 | use crate::sync::{poison, LockResult, TryLockError, TryLockResult}; | |
| 10 | use crate::sync::{LockResult, TryLockError, TryLockResult, poison}; | |
| 11 | 11 | use crate::sys::sync as sys; |
| 12 | 12 | |
| 13 | 13 | /// A reader-writer lock |
library/std/src/sys/alloc/solid.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use super::{realloc_fallback, MIN_ALIGN}; | |
| 1 | use super::{MIN_ALIGN, realloc_fallback}; | |
| 2 | 2 | use crate::alloc::{GlobalAlloc, Layout, System}; |
| 3 | 3 | |
| 4 | 4 | #[stable(feature = "alloc_system_type", since = "1.28.0")] |
library/std/src/sys/alloc/unix.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use super::{realloc_fallback, MIN_ALIGN}; | |
| 1 | use super::{MIN_ALIGN, realloc_fallback}; | |
| 2 | 2 | use crate::alloc::{GlobalAlloc, Layout, System}; |
| 3 | 3 | use crate::ptr; |
| 4 | 4 |
library/std/src/sys/alloc/windows.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use super::{realloc_fallback, MIN_ALIGN}; | |
| 1 | use super::{MIN_ALIGN, realloc_fallback}; | |
| 2 | 2 | use crate::alloc::{GlobalAlloc, Layout, System}; |
| 3 | 3 | use crate::ffi::c_void; |
| 4 | 4 | use crate::mem::MaybeUninit; |
library/std/src/sys/dbg.rs+1-1| ... | ... | @@ -34,7 +34,7 @@ mod os { |
| 34 | 34 | |
| 35 | 35 | #[cfg(any(target_vendor = "apple", target_os = "freebsd"))] |
| 36 | 36 | mod os { |
| 37 | use libc::{c_int, sysctl, CTL_KERN, KERN_PROC, KERN_PROC_PID}; | |
| 37 | use libc::{CTL_KERN, KERN_PROC, KERN_PROC_PID, c_int, sysctl}; | |
| 38 | 38 | |
| 39 | 39 | use super::DebuggerPresence; |
| 40 | 40 | use crate::io::{Cursor, Read, Seek, SeekFrom}; |
library/std/src/sys/os_str/wtf8.rs+1-1| ... | ... | @@ -7,7 +7,7 @@ use crate::borrow::Cow; |
| 7 | 7 | use crate::collections::TryReserveError; |
| 8 | 8 | use crate::rc::Rc; |
| 9 | 9 | use crate::sync::Arc; |
| 10 | use crate::sys_common::wtf8::{check_utf8_boundary, Wtf8, Wtf8Buf}; | |
| 10 | use crate::sys_common::wtf8::{Wtf8, Wtf8Buf, check_utf8_boundary}; | |
| 11 | 11 | use crate::sys_common::{AsInner, FromInner, IntoInner}; |
| 12 | 12 | use crate::{fmt, mem}; |
| 13 | 13 |
library/std/src/sys/pal/hermit/args.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::ffi::{c_char, CStr, OsString}; | |
| 1 | use crate::ffi::{CStr, OsString, c_char}; | |
| 2 | 2 | use crate::os::hermit::ffi::OsStringExt; |
| 3 | 3 | use crate::sync::atomic::Ordering::{Acquire, Relaxed, Release}; |
| 4 | 4 | use crate::sync::atomic::{AtomicIsize, AtomicPtr}; |
library/std/src/sys/pal/hermit/fs.rs+2-2| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use super::fd::FileDesc; |
| 2 | 2 | use super::hermit_abi::{ |
| 3 | self, dirent64, stat as stat_struct, DT_DIR, DT_LNK, DT_REG, DT_UNKNOWN, O_APPEND, O_CREAT, | |
| 4 | O_DIRECTORY, O_EXCL, O_RDONLY, O_RDWR, O_TRUNC, O_WRONLY, S_IFDIR, S_IFLNK, S_IFMT, S_IFREG, | |
| 3 | self, DT_DIR, DT_LNK, DT_REG, DT_UNKNOWN, O_APPEND, O_CREAT, O_DIRECTORY, O_EXCL, O_RDONLY, | |
| 4 | O_RDWR, O_TRUNC, O_WRONLY, S_IFDIR, S_IFLNK, S_IFMT, S_IFREG, dirent64, stat as stat_struct, | |
| 5 | 5 | }; |
| 6 | 6 | use crate::ffi::{CStr, OsStr, OsString}; |
| 7 | 7 | use crate::io::{self, BorrowedCursor, Error, ErrorKind, IoSlice, IoSliceMut, SeekFrom}; |
library/std/src/sys/pal/hermit/time.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | use core::hash::{Hash, Hasher}; |
| 4 | 4 | |
| 5 | use super::hermit_abi::{self, timespec, CLOCK_MONOTONIC, CLOCK_REALTIME}; | |
| 5 | use super::hermit_abi::{self, CLOCK_MONOTONIC, CLOCK_REALTIME, timespec}; | |
| 6 | 6 | use crate::cmp::Ordering; |
| 7 | 7 | use crate::ops::{Add, AddAssign, Sub, SubAssign}; |
| 8 | 8 | use crate::time::Duration; |
library/std/src/sys/pal/itron/task.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use super::abi; |
| 2 | use super::error::{fail, fail_aborting, ItronError}; | |
| 2 | use super::error::{ItronError, fail, fail_aborting}; | |
| 3 | 3 | use crate::mem::MaybeUninit; |
| 4 | 4 | |
| 5 | 5 | /// Gets the ID of the task in Running state. Panics on failure. |
library/std/src/sys/pal/itron/thread.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | //! Thread implementation backed by μITRON tasks. Assumes `acre_tsk` and |
| 2 | 2 | //! `exd_tsk` are available. |
| 3 | 3 | |
| 4 | use super::error::{expect_success, expect_success_aborting, ItronError}; | |
| 4 | use super::error::{ItronError, expect_success, expect_success_aborting}; | |
| 5 | 5 | use super::time::dur2reltims; |
| 6 | 6 | use super::{abi, task}; |
| 7 | 7 | use crate::cell::UnsafeCell; |
library/std/src/sys/pal/itron/time/tests.rs+14-16| ... | ... | @@ -8,26 +8,24 @@ fn reltim2dur(t: u64) -> Duration { |
| 8 | 8 | fn test_dur2reltims() { |
| 9 | 9 | assert_eq!(dur2reltims(reltim2dur(0)).collect::<Vec<_>>(), vec![]); |
| 10 | 10 | assert_eq!(dur2reltims(reltim2dur(42)).collect::<Vec<_>>(), vec![42]); |
| 11 | assert_eq!( | |
| 12 | dur2reltims(reltim2dur(abi::TMAX_RELTIM as u64)).collect::<Vec<_>>(), | |
| 13 | vec![abi::TMAX_RELTIM] | |
| 14 | ); | |
| 15 | assert_eq!( | |
| 16 | dur2reltims(reltim2dur(abi::TMAX_RELTIM as u64 + 10000)).collect::<Vec<_>>(), | |
| 17 | vec![abi::TMAX_RELTIM, 10000] | |
| 18 | ); | |
| 11 | assert_eq!(dur2reltims(reltim2dur(abi::TMAX_RELTIM as u64)).collect::<Vec<_>>(), vec![ | |
| 12 | abi::TMAX_RELTIM | |
| 13 | ]); | |
| 14 | assert_eq!(dur2reltims(reltim2dur(abi::TMAX_RELTIM as u64 + 10000)).collect::<Vec<_>>(), vec![ | |
| 15 | abi::TMAX_RELTIM, | |
| 16 | 10000 | |
| 17 | ]); | |
| 19 | 18 | } |
| 20 | 19 | |
| 21 | 20 | #[test] |
| 22 | 21 | fn test_dur2tmos() { |
| 23 | 22 | assert_eq!(dur2tmos(reltim2dur(0)).collect::<Vec<_>>(), vec![0]); |
| 24 | 23 | assert_eq!(dur2tmos(reltim2dur(42)).collect::<Vec<_>>(), vec![42]); |
| 25 | assert_eq!( | |
| 26 | dur2tmos(reltim2dur(abi::TMAX_RELTIM as u64)).collect::<Vec<_>>(), | |
| 27 | vec![abi::TMAX_RELTIM] | |
| 28 | ); | |
| 29 | assert_eq!( | |
| 30 | dur2tmos(reltim2dur(abi::TMAX_RELTIM as u64 + 10000)).collect::<Vec<_>>(), | |
| 31 | vec![abi::TMAX_RELTIM, 10000] | |
| 32 | ); | |
| 24 | assert_eq!(dur2tmos(reltim2dur(abi::TMAX_RELTIM as u64)).collect::<Vec<_>>(), vec![ | |
| 25 | abi::TMAX_RELTIM | |
| 26 | ]); | |
| 27 | assert_eq!(dur2tmos(reltim2dur(abi::TMAX_RELTIM as u64 + 10000)).collect::<Vec<_>>(), vec![ | |
| 28 | abi::TMAX_RELTIM, | |
| 29 | 10000 | |
| 30 | ]); | |
| 33 | 31 | } |
library/std/src/sys/pal/sgx/abi/usercalls/tests.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use super::alloc::{copy_from_userspace, copy_to_userspace, User}; | |
| 1 | use super::alloc::{User, copy_from_userspace, copy_to_userspace}; | |
| 2 | 2 | |
| 3 | 3 | #[test] |
| 4 | 4 | fn test_copy_to_userspace_function() { |
library/std/src/sys/pal/sgx/net.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut}; |
| 3 | 3 | use crate::net::{Ipv4Addr, Ipv6Addr, Shutdown, SocketAddr, ToSocketAddrs}; |
| 4 | 4 | use crate::sync::Arc; |
| 5 | 5 | use crate::sys::fd::FileDesc; |
| 6 | use crate::sys::{sgx_ineffective, unsupported, AsInner, FromInner, IntoInner, TryIntoInner}; | |
| 6 | use crate::sys::{AsInner, FromInner, IntoInner, TryIntoInner, sgx_ineffective, unsupported}; | |
| 7 | 7 | use crate::time::Duration; |
| 8 | 8 | use crate::{error, fmt}; |
| 9 | 9 |
library/std/src/sys/pal/sgx/waitqueue/mod.rs+2-2| ... | ... | @@ -16,9 +16,9 @@ mod tests; |
| 16 | 16 | mod spin_mutex; |
| 17 | 17 | mod unsafe_list; |
| 18 | 18 | |
| 19 | use fortanix_sgx_abi::{Tcs, EV_UNPARK, WAIT_INDEFINITE}; | |
| 19 | use fortanix_sgx_abi::{EV_UNPARK, Tcs, WAIT_INDEFINITE}; | |
| 20 | 20 | |
| 21 | pub use self::spin_mutex::{try_lock_or_false, SpinMutex, SpinMutexGuard}; | |
| 21 | pub use self::spin_mutex::{SpinMutex, SpinMutexGuard, try_lock_or_false}; | |
| 22 | 22 | use self::unsafe_list::{UnsafeList, UnsafeListEntry}; |
| 23 | 23 | use super::abi::{thread, usercalls}; |
| 24 | 24 | use crate::num::NonZero; |
library/std/src/sys/pal/solid/abi/fs.rs+2-2| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | //! `solid_fs.h` |
| 2 | 2 | |
| 3 | 3 | pub use libc::{ |
| 4 | ino_t, off_t, stat, time_t, O_APPEND, O_CREAT, O_EXCL, O_RDONLY, O_RDWR, O_TRUNC, O_WRONLY, | |
| 5 | SEEK_CUR, SEEK_END, SEEK_SET, S_IFBLK, S_IFCHR, S_IFDIR, S_IFIFO, S_IFMT, S_IFREG, S_IWRITE, | |
| 4 | O_APPEND, O_CREAT, O_EXCL, O_RDONLY, O_RDWR, O_TRUNC, O_WRONLY, S_IFBLK, S_IFCHR, S_IFDIR, | |
| 5 | S_IFIFO, S_IFMT, S_IFREG, S_IWRITE, SEEK_CUR, SEEK_END, SEEK_SET, ino_t, off_t, stat, time_t, | |
| 6 | 6 | }; |
| 7 | 7 | |
| 8 | 8 | use crate::os::raw::{c_char, c_int, c_uchar}; |
library/std/src/sys/pal/solid/abi/mod.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ mod fs; |
| 4 | 4 | pub mod sockets; |
| 5 | 5 | pub use self::fs::*; |
| 6 | 6 | // `solid_types.h` |
| 7 | pub use super::itron::abi::{ER, ER_ID, E_TMOUT, ID}; | |
| 7 | pub use super::itron::abi::{E_TMOUT, ER, ER_ID, ID}; | |
| 8 | 8 | |
| 9 | 9 | pub const SOLID_ERR_NOTFOUND: ER = -1000; |
| 10 | 10 | pub const SOLID_ERR_NOTSUPPORTED: ER = -1001; |
library/std/src/sys/pal/solid/error.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | pub use self::itron::error::{expect_success, ItronError as SolidError}; | |
| 1 | pub use self::itron::error::{ItronError as SolidError, expect_success}; | |
| 2 | 2 | use super::{abi, itron, net}; |
| 3 | 3 | use crate::io::ErrorKind; |
| 4 | 4 |
library/std/src/sys/pal/solid/net.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use libc::{c_int, c_void, size_t}; |
| 2 | 2 | |
| 3 | use self::netc::{sockaddr, socklen_t, MSG_PEEK}; | |
| 3 | use self::netc::{MSG_PEEK, sockaddr, socklen_t}; | |
| 4 | 4 | use super::abi; |
| 5 | 5 | use crate::ffi::CStr; |
| 6 | 6 | use crate::io::{self, BorrowedBuf, BorrowedCursor, ErrorKind, IoSlice, IoSliceMut}; |
library/std/src/sys/pal/uefi/helpers.rs+1-1| ... | ... | @@ -14,7 +14,7 @@ use r_efi::protocols::{device_path, device_path_to_text}; |
| 14 | 14 | |
| 15 | 15 | use crate::ffi::{OsStr, OsString}; |
| 16 | 16 | use crate::io::{self, const_io_error}; |
| 17 | use crate::mem::{size_of, MaybeUninit}; | |
| 17 | use crate::mem::{MaybeUninit, size_of}; | |
| 18 | 18 | use crate::os::uefi::env::boot_services; |
| 19 | 19 | use crate::os::uefi::ffi::{OsStrExt, OsStringExt}; |
| 20 | 20 | use crate::os::uefi::{self}; |
library/std/src/sys/pal/uefi/os.rs+2-2| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | use r_efi::efi::protocols::{device_path, loaded_image_device_path}; | |
| 2 | 1 | use r_efi::efi::Status; |
| 2 | use r_efi::efi::protocols::{device_path, loaded_image_device_path}; | |
| 3 | 3 | |
| 4 | use super::{helpers, unsupported, RawOsError}; | |
| 4 | use super::{RawOsError, helpers, unsupported}; | |
| 5 | 5 | use crate::error::Error as StdError; |
| 6 | 6 | use crate::ffi::{OsStr, OsString}; |
| 7 | 7 | use crate::marker::PhantomData; |
library/std/src/sys/pal/unix/fd.rs+8-8| ... | ... | @@ -3,14 +3,6 @@ |
| 3 | 3 | #[cfg(test)] |
| 4 | 4 | mod tests; |
| 5 | 5 | |
| 6 | #[cfg(any( | |
| 7 | target_os = "android", | |
| 8 | target_os = "linux", | |
| 9 | target_os = "emscripten", | |
| 10 | target_os = "l4re", | |
| 11 | target_os = "hurd", | |
| 12 | ))] | |
| 13 | use libc::off64_t; | |
| 14 | 6 | #[cfg(not(any( |
| 15 | 7 | target_os = "linux", |
| 16 | 8 | target_os = "emscripten", |
| ... | ... | @@ -19,6 +11,14 @@ use libc::off64_t; |
| 19 | 11 | target_os = "hurd", |
| 20 | 12 | )))] |
| 21 | 13 | use libc::off_t as off64_t; |
| 14 | #[cfg(any( | |
| 15 | target_os = "android", | |
| 16 | target_os = "linux", | |
| 17 | target_os = "emscripten", | |
| 18 | target_os = "l4re", | |
| 19 | target_os = "hurd", | |
| 20 | ))] | |
| 21 | use libc::off64_t; | |
| 22 | 22 | |
| 23 | 23 | use crate::cmp; |
| 24 | 24 | use crate::io::{self, BorrowedCursor, IoSlice, IoSliceMut, Read}; |
library/std/src/sys/pal/unix/fs.rs+6-6| ... | ... | @@ -31,10 +31,6 @@ use libc::fstatat64; |
| 31 | 31 | all(target_os = "linux", target_env = "musl"), |
| 32 | 32 | ))] |
| 33 | 33 | use libc::readdir as readdir64; |
| 34 | #[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "hurd"))] | |
| 35 | use libc::readdir64; | |
| 36 | #[cfg(any(target_os = "emscripten", target_os = "l4re"))] | |
| 37 | use libc::readdir64_r; | |
| 38 | 34 | #[cfg(not(any( |
| 39 | 35 | target_os = "android", |
| 40 | 36 | target_os = "linux", |
| ... | ... | @@ -50,6 +46,10 @@ use libc::readdir64_r; |
| 50 | 46 | target_os = "hurd", |
| 51 | 47 | )))] |
| 52 | 48 | use libc::readdir_r as readdir64_r; |
| 49 | #[cfg(any(all(target_os = "linux", not(target_env = "musl")), target_os = "hurd"))] | |
| 50 | use libc::readdir64; | |
| 51 | #[cfg(any(target_os = "emscripten", target_os = "l4re"))] | |
| 52 | use libc::readdir64_r; | |
| 53 | 53 | use libc::{c_int, mode_t}; |
| 54 | 54 | #[cfg(target_os = "android")] |
| 55 | 55 | use libc::{ |
| ... | ... | @@ -1866,7 +1866,7 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> { |
| 1866 | 1866 | let max_len = u64::MAX; |
| 1867 | 1867 | let (mut writer, _) = open_to_and_set_permissions(to, reader_metadata)?; |
| 1868 | 1868 | |
| 1869 | use super::kernel_copy::{copy_regular_files, CopyResult}; | |
| 1869 | use super::kernel_copy::{CopyResult, copy_regular_files}; | |
| 1870 | 1870 | |
| 1871 | 1871 | match copy_regular_files(reader.as_raw_fd(), writer.as_raw_fd(), max_len) { |
| 1872 | 1872 | CopyResult::Ended(bytes) => Ok(bytes), |
| ... | ... | @@ -2008,7 +2008,7 @@ mod remove_dir_impl { |
| 2008 | 2008 | #[cfg(all(target_os = "linux", target_env = "gnu"))] |
| 2009 | 2009 | use libc::{fdopendir, openat64 as openat, unlinkat}; |
| 2010 | 2010 | |
| 2011 | use super::{lstat, Dir, DirEntry, InnerReadDir, ReadDir}; | |
| 2011 | use super::{Dir, DirEntry, InnerReadDir, ReadDir, lstat}; | |
| 2012 | 2012 | use crate::ffi::CStr; |
| 2013 | 2013 | use crate::io; |
| 2014 | 2014 | use crate::os::unix::io::{AsRawFd, FromRawFd, IntoRawFd}; |
library/std/src/sys/pal/unix/net.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use libc::{c_int, c_void, size_t, sockaddr, socklen_t, MSG_PEEK}; | |
| 1 | use libc::{MSG_PEEK, c_int, c_void, size_t, sockaddr, socklen_t}; | |
| 2 | 2 | |
| 3 | 3 | use crate::ffi::CStr; |
| 4 | 4 | use crate::io::{self, BorrowedBuf, BorrowedCursor, IoSlice, IoSliceMut}; |
library/std/src/sys/pal/unix/process/process_common.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | #[cfg(all(test, not(target_os = "emscripten")))] |
| 2 | 2 | mod tests; |
| 3 | 3 | |
| 4 | use libc::{c_char, c_int, gid_t, pid_t, uid_t, EXIT_FAILURE, EXIT_SUCCESS}; | |
| 4 | use libc::{EXIT_FAILURE, EXIT_SUCCESS, c_char, c_int, gid_t, pid_t, uid_t}; | |
| 5 | 5 | |
| 6 | 6 | use crate::collections::BTreeMap; |
| 7 | 7 | use crate::ffi::{CStr, CString, OsStr, OsString}; |
library/std/src/sys/pal/unix/process/process_fuchsia.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ use libc::{c_int, size_t}; |
| 2 | 2 | |
| 3 | 3 | use crate::num::NonZero; |
| 4 | 4 | use crate::sys::process::process_common::*; |
| 5 | use crate::sys::process::zircon::{zx_handle_t, Handle}; | |
| 5 | use crate::sys::process::zircon::{Handle, zx_handle_t}; | |
| 6 | 6 | use crate::{fmt, io, mem, ptr}; |
| 7 | 7 | |
| 8 | 8 | //////////////////////////////////////////////////////////////////////////////// |
library/std/src/sys/pal/unix/process/process_unix.rs+1-1| ... | ... | @@ -1190,8 +1190,8 @@ impl ExitStatusError { |
| 1190 | 1190 | mod linux_child_ext { |
| 1191 | 1191 | |
| 1192 | 1192 | use crate::os::linux::process as os; |
| 1193 | use crate::sys::pal::unix::linux::pidfd as imp; | |
| 1194 | 1193 | use crate::sys::pal::unix::ErrorKind; |
| 1194 | use crate::sys::pal::unix::linux::pidfd as imp; | |
| 1195 | 1195 | use crate::sys_common::FromInner; |
| 1196 | 1196 | use crate::{io, mem}; |
| 1197 | 1197 |
library/std/src/sys/pal/unix/process/process_vxworks.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | #![forbid(unsafe_op_in_unsafe_fn)] |
| 2 | use libc::{self, c_char, c_int, RTP_ID}; | |
| 2 | use libc::{self, RTP_ID, c_char, c_int}; | |
| 3 | 3 | |
| 4 | 4 | use crate::io::{self, ErrorKind}; |
| 5 | 5 | use crate::num::NonZero; |
library/std/src/sys/pal/unix/stack_overflow.rs+5-6| ... | ... | @@ -36,21 +36,20 @@ impl Drop for Handler { |
| 36 | 36 | target_os = "illumos", |
| 37 | 37 | ))] |
| 38 | 38 | mod imp { |
| 39 | use libc::{ | |
| 40 | MAP_ANON, MAP_FAILED, MAP_FIXED, MAP_PRIVATE, PROT_NONE, PROT_READ, PROT_WRITE, SA_ONSTACK, | |
| 41 | SA_SIGINFO, SIG_DFL, SIGBUS, SIGSEGV, SS_DISABLE, sigaction, sigaltstack, sighandler_t, | |
| 42 | }; | |
| 39 | 43 | #[cfg(not(all(target_os = "linux", target_env = "gnu")))] |
| 40 | 44 | use libc::{mmap as mmap64, mprotect, munmap}; |
| 41 | 45 | #[cfg(all(target_os = "linux", target_env = "gnu"))] |
| 42 | 46 | use libc::{mmap64, mprotect, munmap}; |
| 43 | use libc::{ | |
| 44 | sigaction, sigaltstack, sighandler_t, MAP_ANON, MAP_FAILED, MAP_FIXED, MAP_PRIVATE, | |
| 45 | PROT_NONE, PROT_READ, PROT_WRITE, SA_ONSTACK, SA_SIGINFO, SIGBUS, SIGSEGV, SIG_DFL, | |
| 46 | SS_DISABLE, | |
| 47 | }; | |
| 48 | 47 | |
| 49 | 48 | use super::Handler; |
| 50 | 49 | use crate::cell::Cell; |
| 51 | 50 | use crate::ops::Range; |
| 52 | use crate::sync::atomic::{AtomicBool, AtomicPtr, AtomicUsize, Ordering}; | |
| 53 | 51 | use crate::sync::OnceLock; |
| 52 | use crate::sync::atomic::{AtomicBool, AtomicPtr, AtomicUsize, Ordering}; | |
| 54 | 53 | use crate::sys::pal::unix::os; |
| 55 | 54 | use crate::{io, mem, ptr, thread}; |
| 56 | 55 |
library/std/src/sys/pal/unix/thread.rs+1-1| ... | ... | @@ -516,7 +516,7 @@ mod cgroups { |
| 516 | 516 | |
| 517 | 517 | use crate::borrow::Cow; |
| 518 | 518 | use crate::ffi::OsString; |
| 519 | use crate::fs::{exists, File}; | |
| 519 | use crate::fs::{File, exists}; | |
| 520 | 520 | use crate::io::{BufRead, BufReader, Read}; |
| 521 | 521 | use crate::os::unix::ffi::OsStringExt; |
| 522 | 522 | use crate::path::{Path, PathBuf}; |
library/std/src/sys/pal/unix/thread_parking.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // separate modules for each platform. |
| 3 | 3 | #![cfg(target_os = "netbsd")] |
| 4 | 4 | |
| 5 | use libc::{_lwp_self, c_long, clockid_t, lwpid_t, time_t, timespec, CLOCK_MONOTONIC}; | |
| 5 | use libc::{_lwp_self, CLOCK_MONOTONIC, c_long, clockid_t, lwpid_t, time_t, timespec}; | |
| 6 | 6 | |
| 7 | 7 | use crate::ffi::{c_int, c_void}; |
| 8 | 8 | use crate::ptr; |
library/std/src/sys/pal/wasi/fs.rs+1-1| ... | ... | @@ -13,7 +13,7 @@ use crate::sys::common::small_c_string::run_path_with_cstr; |
| 13 | 13 | use crate::sys::time::SystemTime; |
| 14 | 14 | use crate::sys::unsupported; |
| 15 | 15 | pub use crate::sys_common::fs::exists; |
| 16 | use crate::sys_common::{ignore_notfound, AsInner, FromInner, IntoInner}; | |
| 16 | use crate::sys_common::{AsInner, FromInner, IntoInner, ignore_notfound}; | |
| 17 | 17 | use crate::{fmt, iter, ptr}; |
| 18 | 18 | |
| 19 | 19 | pub struct File { |
library/std/src/sys/pal/windows/args.rs+1-1| ... | ... | @@ -14,8 +14,8 @@ use crate::path::{Path, PathBuf}; |
| 14 | 14 | use crate::sys::path::get_long_path; |
| 15 | 15 | use crate::sys::process::ensure_no_nuls; |
| 16 | 16 | use crate::sys::{c, to_u16s}; |
| 17 | use crate::sys_common::wstr::WStrUnits; | |
| 18 | 17 | use crate::sys_common::AsInner; |
| 18 | use crate::sys_common::wstr::WStrUnits; | |
| 19 | 19 | use crate::{fmt, io, iter, vec}; |
| 20 | 20 | |
| 21 | 21 | /// This is the const equivalent to `NonZero::new(n).unwrap()` |
library/std/src/sys/pal/windows/args/tests.rs+4-4| ... | ... | @@ -47,10 +47,10 @@ fn whitespace_behavior() { |
| 47 | 47 | fn genius_quotes() { |
| 48 | 48 | chk(r#"EXE "" """#, &["EXE", "", ""]); |
| 49 | 49 | chk(r#"EXE "" """"#, &["EXE", "", r#"""#]); |
| 50 | chk( | |
| 51 | r#"EXE "this is """all""" in the same argument""#, | |
| 52 | &["EXE", r#"this is "all" in the same argument"#], | |
| 53 | ); | |
| 50 | chk(r#"EXE "this is """all""" in the same argument""#, &[ | |
| 51 | "EXE", | |
| 52 | r#"this is "all" in the same argument"#, | |
| 53 | ]); | |
| 54 | 54 | chk(r#"EXE "a"""#, &["EXE", r#"a""#]); |
| 55 | 55 | chk(r#"EXE "a"" a"#, &["EXE", r#"a" a"#]); |
| 56 | 56 | // quotes cannot be escaped in command names |
library/std/src/sys/pal/windows/c.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | #![unstable(issue = "none", feature = "windows_c")] |
| 6 | 6 | #![allow(clippy::style)] |
| 7 | 7 | |
| 8 | use core::ffi::{c_uint, c_ulong, c_ushort, c_void, CStr}; | |
| 8 | use core::ffi::{CStr, c_uint, c_ulong, c_ushort, c_void}; | |
| 9 | 9 | use core::{mem, ptr}; |
| 10 | 10 | |
| 11 | 11 | mod windows_sys; |
library/std/src/sys/pal/windows/compat.rs+1-1| ... | ... | @@ -19,7 +19,7 @@ |
| 19 | 19 | //! function is called. In the worst case, multiple threads may all end up |
| 20 | 20 | //! importing the same function unnecessarily. |
| 21 | 21 | |
| 22 | use crate::ffi::{c_void, CStr}; | |
| 22 | use crate::ffi::{CStr, c_void}; | |
| 23 | 23 | use crate::ptr::NonNull; |
| 24 | 24 | use crate::sys::c; |
| 25 | 25 |
library/std/src/sys/pal/windows/fs.rs+3-3| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | use core::ptr::addr_of; |
| 2 | 2 | |
| 3 | 3 | use super::api::{self, WinError}; |
| 4 | use super::{to_u16s, IoResult}; | |
| 4 | use super::{IoResult, to_u16s}; | |
| 5 | 5 | use crate::borrow::Cow; |
| 6 | use crate::ffi::{c_void, OsStr, OsString}; | |
| 6 | use crate::ffi::{OsStr, OsString, c_void}; | |
| 7 | 7 | use crate::io::{self, BorrowedCursor, Error, IoSlice, IoSliceMut, SeekFrom}; |
| 8 | 8 | use crate::mem::{self, MaybeUninit}; |
| 9 | 9 | use crate::os::windows::io::{AsHandle, BorrowedHandle}; |
| ... | ... | @@ -13,7 +13,7 @@ use crate::sync::Arc; |
| 13 | 13 | use crate::sys::handle::Handle; |
| 14 | 14 | use crate::sys::path::maybe_verbatim; |
| 15 | 15 | use crate::sys::time::SystemTime; |
| 16 | use crate::sys::{c, cvt, Align8}; | |
| 16 | use crate::sys::{Align8, c, cvt}; | |
| 17 | 17 | use crate::sys_common::{AsInner, FromInner, IntoInner}; |
| 18 | 18 | use crate::{fmt, ptr, slice}; |
| 19 | 19 |
library/std/src/sys/pal/windows/futex.rs+2-2| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use core::ffi::c_void; |
| 2 | 2 | use core::sync::atomic::{ |
| 3 | AtomicBool, AtomicI16, AtomicI32, AtomicI64, AtomicI8, AtomicIsize, AtomicPtr, AtomicU16, | |
| 4 | AtomicU32, AtomicU64, AtomicU8, AtomicUsize, | |
| 3 | AtomicBool, AtomicI8, AtomicI16, AtomicI32, AtomicI64, AtomicIsize, AtomicPtr, AtomicU8, | |
| 4 | AtomicU16, AtomicU32, AtomicU64, AtomicUsize, | |
| 5 | 5 | }; |
| 6 | 6 | use core::time::Duration; |
| 7 | 7 | use core::{mem, ptr}; |
library/std/src/sys/pal/windows/handle/tests.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::sys::pipe::{anon_pipe, Pipes}; | |
| 1 | use crate::sys::pipe::{Pipes, anon_pipe}; | |
| 2 | 2 | use crate::{thread, time}; |
| 3 | 3 | |
| 4 | 4 | /// Test the synchronous fallback for overlapped I/O. |
library/std/src/sys/pal/windows/net.rs+7-7| ... | ... | @@ -9,7 +9,7 @@ use crate::os::windows::io::{ |
| 9 | 9 | }; |
| 10 | 10 | use crate::sync::OnceLock; |
| 11 | 11 | use crate::sys::c; |
| 12 | use crate::sys_common::{net, AsInner, FromInner, IntoInner}; | |
| 12 | use crate::sys_common::{AsInner, FromInner, IntoInner, net}; | |
| 13 | 13 | use crate::time::Duration; |
| 14 | 14 | use crate::{cmp, mem, ptr, sys}; |
| 15 | 15 | |
| ... | ... | @@ -27,12 +27,12 @@ pub mod netc { |
| 27 | 27 | use crate::sys::c::{self, ADDRESS_FAMILY, ADDRINFOA, SOCKADDR, SOCKET}; |
| 28 | 28 | // re-exports from Windows API bindings. |
| 29 | 29 | pub use crate::sys::c::{ |
| 30 | bind, connect, freeaddrinfo, getpeername, getsockname, getsockopt, listen, setsockopt, | |
| 31 | ADDRESS_FAMILY as sa_family_t, ADDRINFOA as addrinfo, IPPROTO_IP, IPPROTO_IPV6, | |
| 32 | IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP, IPV6_MULTICAST_LOOP, IPV6_V6ONLY, | |
| 33 | IP_ADD_MEMBERSHIP, IP_DROP_MEMBERSHIP, IP_MULTICAST_LOOP, IP_MULTICAST_TTL, IP_TTL, | |
| 34 | SOCKADDR as sockaddr, SOCKADDR_STORAGE as sockaddr_storage, SOCK_DGRAM, SOCK_STREAM, | |
| 35 | SOL_SOCKET, SO_BROADCAST, SO_RCVTIMEO, SO_SNDTIMEO, | |
| 30 | ADDRESS_FAMILY as sa_family_t, ADDRINFOA as addrinfo, IP_ADD_MEMBERSHIP, | |
| 31 | IP_DROP_MEMBERSHIP, IP_MULTICAST_LOOP, IP_MULTICAST_TTL, IP_TTL, IPPROTO_IP, IPPROTO_IPV6, | |
| 32 | IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP, IPV6_MULTICAST_LOOP, IPV6_V6ONLY, SO_BROADCAST, | |
| 33 | SO_RCVTIMEO, SO_SNDTIMEO, SOCK_DGRAM, SOCK_STREAM, SOCKADDR as sockaddr, | |
| 34 | SOCKADDR_STORAGE as sockaddr_storage, SOL_SOCKET, bind, connect, freeaddrinfo, getpeername, | |
| 35 | getsockname, getsockopt, listen, setsockopt, | |
| 36 | 36 | }; |
| 37 | 37 | |
| 38 | 38 | #[allow(non_camel_case_types)] |
library/std/src/sys/pal/windows/process.rs+5-5| ... | ... | @@ -22,8 +22,8 @@ use crate::sys::fs::{File, OpenOptions}; |
| 22 | 22 | use crate::sys::handle::Handle; |
| 23 | 23 | use crate::sys::pipe::{self, AnonPipe}; |
| 24 | 24 | use crate::sys::{cvt, path, stdio}; |
| 25 | use crate::sys_common::process::{CommandEnv, CommandEnvs}; | |
| 26 | 25 | use crate::sys_common::IntoInner; |
| 26 | use crate::sys_common::process::{CommandEnv, CommandEnvs}; | |
| 27 | 27 | use crate::{cmp, env, fmt, mem, ptr}; |
| 28 | 28 | |
| 29 | 29 | //////////////////////////////////////////////////////////////////////////////// |
| ... | ... | @@ -253,10 +253,10 @@ impl Command { |
| 253 | 253 | attribute: usize, |
| 254 | 254 | value: T, |
| 255 | 255 | ) { |
| 256 | self.proc_thread_attributes.insert( | |
| 257 | attribute, | |
| 258 | ProcThreadAttributeValue { size: mem::size_of::<T>(), data: Box::new(value) }, | |
| 259 | ); | |
| 256 | self.proc_thread_attributes.insert(attribute, ProcThreadAttributeValue { | |
| 257 | size: mem::size_of::<T>(), | |
| 258 | data: Box::new(value), | |
| 259 | }); | |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | pub fn spawn( |
library/std/src/sys/pal/windows/process/tests.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use super::{make_command_line, Arg}; | |
| 1 | use super::{Arg, make_command_line}; | |
| 2 | 2 | use crate::env; |
| 3 | 3 | use crate::ffi::{OsStr, OsString}; |
| 4 | 4 | use crate::process::Command; |
library/std/src/sys/pal/xous/net/dns.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ use core::convert::{TryFrom, TryInto}; |
| 3 | 3 | use crate::io; |
| 4 | 4 | use crate::net::{Ipv4Addr, SocketAddr, SocketAddrV4, SocketAddrV6}; |
| 5 | 5 | use crate::os::xous::ffi::lend_mut; |
| 6 | use crate::os::xous::services::{dns_server, DnsLendMut}; | |
| 6 | use crate::os::xous::services::{DnsLendMut, dns_server}; | |
| 7 | 7 | |
| 8 | 8 | pub struct DnsError { |
| 9 | 9 | pub code: u8, |
library/std/src/sys/pal/xous/stdio.rs+2-2| ... | ... | @@ -4,8 +4,8 @@ pub struct Stdin; |
| 4 | 4 | pub struct Stdout {} |
| 5 | 5 | pub struct Stderr; |
| 6 | 6 | |
| 7 | use crate::os::xous::ffi::{lend, try_lend, try_scalar, Connection}; | |
| 8 | use crate::os::xous::services::{log_server, try_connect, LogLend, LogScalar}; | |
| 7 | use crate::os::xous::ffi::{Connection, lend, try_lend, try_scalar}; | |
| 8 | use crate::os::xous::services::{LogLend, LogScalar, log_server, try_connect}; | |
| 9 | 9 | |
| 10 | 10 | impl Stdin { |
| 11 | 11 | pub const fn new() -> Stdin { |
library/std/src/sys/pal/xous/thread.rs+3-3| ... | ... | @@ -4,10 +4,10 @@ use crate::ffi::CStr; |
| 4 | 4 | use crate::io; |
| 5 | 5 | use crate::num::NonZero; |
| 6 | 6 | use crate::os::xous::ffi::{ |
| 7 | blocking_scalar, create_thread, do_yield, join_thread, map_memory, update_memory_flags, | |
| 8 | MemoryFlags, Syscall, ThreadId, | |
| 7 | MemoryFlags, Syscall, ThreadId, blocking_scalar, create_thread, do_yield, join_thread, | |
| 8 | map_memory, update_memory_flags, | |
| 9 | 9 | }; |
| 10 | use crate::os::xous::services::{ticktimer_server, TicktimerScalar}; | |
| 10 | use crate::os::xous::services::{TicktimerScalar, ticktimer_server}; | |
| 11 | 11 | use crate::time::Duration; |
| 12 | 12 | |
| 13 | 13 | pub struct Thread { |
library/std/src/sys/pal/zkvm/args.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use super::{abi, WORD_SIZE}; | |
| 1 | use super::{WORD_SIZE, abi}; | |
| 2 | 2 | use crate::ffi::OsString; |
| 3 | 3 | use crate::fmt; |
| 4 | 4 | use crate::sys::os_str; |
library/std/src/sys/pal/zkvm/os.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use super::{abi, unsupported, WORD_SIZE}; | |
| 1 | use super::{WORD_SIZE, abi, unsupported}; | |
| 2 | 2 | use crate::error::Error as StdError; |
| 3 | 3 | use crate::ffi::{OsStr, OsString}; |
| 4 | 4 | use crate::marker::PhantomData; |
library/std/src/sys/path/windows.rs+1-1| ... | ... | @@ -99,7 +99,7 @@ impl<'a> PrefixParserSlice<'a, '_> { |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | pub fn parse_prefix(path: &OsStr) -> Option<Prefix<'_>> { |
| 102 | use Prefix::{DeviceNS, Disk, Verbatim, VerbatimDisk, VerbatimUNC, UNC}; | |
| 102 | use Prefix::{DeviceNS, Disk, UNC, Verbatim, VerbatimDisk, VerbatimUNC}; | |
| 103 | 103 | |
| 104 | 104 | let parser = PrefixParser::<8>::new(path); |
| 105 | 105 | let parser = parser.as_slice(); |
library/std/src/sys/sync/condvar/pthread.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ use crate::cell::UnsafeCell; |
| 2 | 2 | use crate::ptr; |
| 3 | 3 | use crate::sync::atomic::AtomicPtr; |
| 4 | 4 | use crate::sync::atomic::Ordering::Relaxed; |
| 5 | use crate::sys::sync::{mutex, Mutex}; | |
| 5 | use crate::sys::sync::{Mutex, mutex}; | |
| 6 | 6 | #[cfg(not(target_os = "nto"))] |
| 7 | 7 | use crate::sys::time::TIMESPEC_MAX; |
| 8 | 8 | #[cfg(target_os = "nto")] |
library/std/src/sys/sync/condvar/windows7.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::cell::UnsafeCell; |
| 2 | use crate::sys::sync::{mutex, Mutex}; | |
| 2 | use crate::sys::sync::{Mutex, mutex}; | |
| 3 | 3 | use crate::sys::{c, os}; |
| 4 | 4 | use crate::time::Duration; |
| 5 | 5 |
library/std/src/sys/sync/condvar/xous.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use core::sync::atomic::{AtomicUsize, Ordering}; |
| 2 | 2 | |
| 3 | 3 | use crate::os::xous::ffi::{blocking_scalar, scalar}; |
| 4 | use crate::os::xous::services::{ticktimer_server, TicktimerScalar}; | |
| 4 | use crate::os::xous::services::{TicktimerScalar, ticktimer_server}; | |
| 5 | 5 | use crate::sys::sync::Mutex; |
| 6 | 6 | use crate::time::Duration; |
| 7 | 7 |
library/std/src/sys/sync/mutex/fuchsia.rs+3-3| ... | ... | @@ -40,9 +40,9 @@ |
| 40 | 40 | use crate::sync::atomic::AtomicU32; |
| 41 | 41 | use crate::sync::atomic::Ordering::{Acquire, Relaxed, Release}; |
| 42 | 42 | use crate::sys::futex::zircon::{ |
| 43 | zx_futex_wait, zx_futex_wake_single_owner, zx_handle_t, zx_thread_self, ZX_ERR_BAD_HANDLE, | |
| 44 | ZX_ERR_BAD_STATE, ZX_ERR_INVALID_ARGS, ZX_ERR_TIMED_OUT, ZX_ERR_WRONG_TYPE, ZX_OK, | |
| 45 | ZX_TIME_INFINITE, | |
| 43 | ZX_ERR_BAD_HANDLE, ZX_ERR_BAD_STATE, ZX_ERR_INVALID_ARGS, ZX_ERR_TIMED_OUT, ZX_ERR_WRONG_TYPE, | |
| 44 | ZX_OK, ZX_TIME_INFINITE, zx_futex_wait, zx_futex_wake_single_owner, zx_handle_t, | |
| 45 | zx_thread_self, | |
| 46 | 46 | }; |
| 47 | 47 | |
| 48 | 48 | // The lowest two bits of a `zx_handle_t` are always set, so the lowest bit is used to mark the |
library/std/src/sys/sync/mutex/itron.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | #![forbid(unsafe_op_in_unsafe_fn)] |
| 4 | 4 | |
| 5 | 5 | use crate::sys::pal::itron::abi; |
| 6 | use crate::sys::pal::itron::error::{expect_success, expect_success_aborting, fail, ItronError}; | |
| 6 | use crate::sys::pal::itron::error::{ItronError, expect_success, expect_success_aborting, fail}; | |
| 7 | 7 | use crate::sys::pal::itron::spin::SpinIdOnceCell; |
| 8 | 8 | |
| 9 | 9 | pub struct Mutex { |
library/std/src/sys/sync/mutex/pthread.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use crate::cell::UnsafeCell; |
| 2 | 2 | use crate::io::Error; |
| 3 | use crate::mem::{forget, MaybeUninit}; | |
| 3 | use crate::mem::{MaybeUninit, forget}; | |
| 4 | 4 | use crate::sys::cvt_nz; |
| 5 | 5 | use crate::sys_common::lazy_box::{LazyBox, LazyInit}; |
| 6 | 6 |
library/std/src/sys/sync/mutex/sgx.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::sys::pal::waitqueue::{try_lock_or_false, SpinMutex, WaitQueue, WaitVariable}; | |
| 1 | use crate::sys::pal::waitqueue::{SpinMutex, WaitQueue, WaitVariable, try_lock_or_false}; | |
| 2 | 2 | use crate::sys_common::lazy_box::{LazyBox, LazyInit}; |
| 3 | 3 | |
| 4 | 4 | /// FIXME: `UnsafeList` is not movable. |
library/std/src/sys/sync/mutex/xous.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::os::xous::ffi::{blocking_scalar, do_yield}; |
| 2 | use crate::os::xous::services::{ticktimer_server, TicktimerScalar}; | |
| 2 | use crate::os::xous::services::{TicktimerScalar, ticktimer_server}; | |
| 3 | 3 | use crate::sync::atomic::Ordering::{Acquire, Relaxed, Release}; |
| 4 | 4 | use crate::sync::atomic::{AtomicBool, AtomicUsize}; |
| 5 | 5 |
library/std/src/sys/sync/rwlock/queue.rs+1-1| ... | ... | @@ -110,7 +110,7 @@ |
| 110 | 110 | use crate::cell::OnceCell; |
| 111 | 111 | use crate::hint::spin_loop; |
| 112 | 112 | use crate::mem; |
| 113 | use crate::ptr::{self, null_mut, without_provenance_mut, NonNull}; | |
| 113 | use crate::ptr::{self, NonNull, null_mut, without_provenance_mut}; | |
| 114 | 114 | use crate::sync::atomic::Ordering::{AcqRel, Acquire, Relaxed, Release}; |
| 115 | 115 | use crate::sync::atomic::{AtomicBool, AtomicPtr}; |
| 116 | 116 | use crate::thread::{self, Thread}; |
library/std/src/sys/sync/rwlock/solid.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | #![forbid(unsafe_op_in_unsafe_fn)] |
| 3 | 3 | |
| 4 | 4 | use crate::sys::pal::abi; |
| 5 | use crate::sys::pal::itron::error::{expect_success, expect_success_aborting, fail, ItronError}; | |
| 5 | use crate::sys::pal::itron::error::{ItronError, expect_success, expect_success_aborting, fail}; | |
| 6 | 6 | use crate::sys::pal::itron::spin::SpinIdOnceCell; |
| 7 | 7 | |
| 8 | 8 | pub struct RwLock { |
library/std/src/sys/sync/thread_parking/id.rs+2-2| ... | ... | @@ -10,8 +10,8 @@ |
| 10 | 10 | use crate::cell::UnsafeCell; |
| 11 | 11 | use crate::pin::Pin; |
| 12 | 12 | use crate::sync::atomic::Ordering::{Acquire, Relaxed, Release}; |
| 13 | use crate::sync::atomic::{fence, AtomicI8}; | |
| 14 | use crate::sys::thread_parking::{current, park, park_timeout, unpark, ThreadId}; | |
| 13 | use crate::sync::atomic::{AtomicI8, fence}; | |
| 14 | use crate::sys::thread_parking::{ThreadId, current, park, park_timeout, unpark}; | |
| 15 | 15 | use crate::time::Duration; |
| 16 | 16 | |
| 17 | 17 | pub struct Parker { |
library/std/src/sys/sync/thread_parking/windows7.rs+1-1| ... | ... | @@ -190,7 +190,7 @@ mod keyed_events { |
| 190 | 190 | use core::sync::atomic::Ordering::{Acquire, Relaxed}; |
| 191 | 191 | use core::time::Duration; |
| 192 | 192 | |
| 193 | use super::{Parker, EMPTY, NOTIFIED}; | |
| 193 | use super::{EMPTY, NOTIFIED, Parker}; | |
| 194 | 194 | use crate::sys::c; |
| 195 | 195 | |
| 196 | 196 | pub unsafe fn park(parker: Pin<&Parker>) { |
library/std/src/sys/sync/thread_parking/xous.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::os::xous::ffi::{blocking_scalar, scalar}; |
| 2 | use crate::os::xous::services::{ticktimer_server, TicktimerScalar}; | |
| 2 | use crate::os::xous::services::{TicktimerScalar, ticktimer_server}; | |
| 3 | 3 | use crate::pin::Pin; |
| 4 | 4 | use crate::ptr; |
| 5 | 5 | use crate::sync::atomic::AtomicI8; |
library/std/src/sys/thread_local/guard/key.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | |
| 5 | 5 | use crate::ptr; |
| 6 | 6 | use crate::sys::thread_local::destructors; |
| 7 | use crate::sys::thread_local::key::{set, LazyKey}; | |
| 7 | use crate::sys::thread_local::key::{LazyKey, set}; | |
| 8 | 8 | |
| 9 | 9 | pub fn enable() { |
| 10 | 10 | static DTORS: LazyKey = LazyKey::new(Some(run)); |
library/std/src/sys/thread_local/key/tests.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use super::{get, set, LazyKey}; | |
| 1 | use super::{LazyKey, get, set}; | |
| 2 | 2 | use crate::ptr; |
| 3 | 3 | |
| 4 | 4 | #[test] |
library/std/src/sys/thread_local/key/xous.rs+1-1| ... | ... | @@ -39,7 +39,7 @@ |
| 39 | 39 | use core::arch::asm; |
| 40 | 40 | |
| 41 | 41 | use crate::mem::ManuallyDrop; |
| 42 | use crate::os::xous::ffi::{map_memory, unmap_memory, MemoryFlags}; | |
| 42 | use crate::os::xous::ffi::{MemoryFlags, map_memory, unmap_memory}; | |
| 43 | 43 | use crate::ptr; |
| 44 | 44 | use crate::sync::atomic::Ordering::{Acquire, Relaxed, Release}; |
| 45 | 45 | use crate::sync::atomic::{AtomicPtr, AtomicUsize}; |
library/std/src/sys/thread_local/os.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ use super::abort_on_dtor_unwind; |
| 2 | 2 | use crate::cell::Cell; |
| 3 | 3 | use crate::marker::PhantomData; |
| 4 | 4 | use crate::ptr; |
| 5 | use crate::sys::thread_local::key::{get, set, Key, LazyKey}; | |
| 5 | use crate::sys::thread_local::key::{Key, LazyKey, get, set}; | |
| 6 | 6 | |
| 7 | 7 | #[doc(hidden)] |
| 8 | 8 | #[allow_internal_unstable(thread_local_internals)] |
library/std/src/sys_common/net.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ use crate::ffi::{c_int, c_void}; |
| 5 | 5 | use crate::io::{self, BorrowedCursor, ErrorKind, IoSlice, IoSliceMut}; |
| 6 | 6 | use crate::net::{Ipv4Addr, Ipv6Addr, Shutdown, SocketAddr}; |
| 7 | 7 | use crate::sys::common::small_c_string::run_with_cstr; |
| 8 | use crate::sys::net::{cvt, cvt_gai, cvt_r, init, netc as c, wrlen_t, Socket}; | |
| 8 | use crate::sys::net::{Socket, cvt, cvt_gai, cvt_r, init, netc as c, wrlen_t}; | |
| 9 | 9 | use crate::sys_common::{AsInner, FromInner, IntoInner}; |
| 10 | 10 | use crate::time::Duration; |
| 11 | 11 | use crate::{cmp, fmt, mem, ptr}; |
library/std/src/sys_common/wtf8.rs+1-1| ... | ... | @@ -18,7 +18,7 @@ |
| 18 | 18 | #[cfg(test)] |
| 19 | 19 | mod tests; |
| 20 | 20 | |
| 21 | use core::char::{encode_utf16_raw, encode_utf8_raw}; | |
| 21 | use core::char::{encode_utf8_raw, encode_utf16_raw}; | |
| 22 | 22 | use core::clone::CloneToUninit; |
| 23 | 23 | use core::str::next_code_point; |
| 24 | 24 |
library/std/src/sys_common/wtf8/tests.rs+55-56| ... | ... | @@ -356,32 +356,32 @@ fn wtf8buf_from_iterator() { |
| 356 | 356 | fn f(values: &[u32]) -> Wtf8Buf { |
| 357 | 357 | values.iter().map(|&c| CodePoint::from_u32(c).unwrap()).collect::<Wtf8Buf>() |
| 358 | 358 | } |
| 359 | assert_eq!( | |
| 360 | f(&[0x61, 0xE9, 0x20, 0x1F4A9]), | |
| 361 | Wtf8Buf { bytes: b"a\xC3\xA9 \xF0\x9F\x92\xA9".to_vec(), is_known_utf8: true } | |
| 362 | ); | |
| 359 | assert_eq!(f(&[0x61, 0xE9, 0x20, 0x1F4A9]), Wtf8Buf { | |
| 360 | bytes: b"a\xC3\xA9 \xF0\x9F\x92\xA9".to_vec(), | |
| 361 | is_known_utf8: true | |
| 362 | }); | |
| 363 | 363 | |
| 364 | 364 | assert_eq!(f(&[0xD83D, 0xDCA9]).bytes, b"\xF0\x9F\x92\xA9"); // Magic! |
| 365 | assert_eq!( | |
| 366 | f(&[0xD83D, 0x20, 0xDCA9]), | |
| 367 | Wtf8Buf { bytes: b"\xED\xA0\xBD \xED\xB2\xA9".to_vec(), is_known_utf8: false } | |
| 368 | ); | |
| 369 | assert_eq!( | |
| 370 | f(&[0xD800, 0xDBFF]), | |
| 371 | Wtf8Buf { bytes: b"\xED\xA0\x80\xED\xAF\xBF".to_vec(), is_known_utf8: false } | |
| 372 | ); | |
| 373 | assert_eq!( | |
| 374 | f(&[0xD800, 0xE000]), | |
| 375 | Wtf8Buf { bytes: b"\xED\xA0\x80\xEE\x80\x80".to_vec(), is_known_utf8: false } | |
| 376 | ); | |
| 377 | assert_eq!( | |
| 378 | f(&[0xD7FF, 0xDC00]), | |
| 379 | Wtf8Buf { bytes: b"\xED\x9F\xBF\xED\xB0\x80".to_vec(), is_known_utf8: false } | |
| 380 | ); | |
| 381 | assert_eq!( | |
| 382 | f(&[0x61, 0xDC00]), | |
| 383 | Wtf8Buf { bytes: b"\x61\xED\xB0\x80".to_vec(), is_known_utf8: false } | |
| 384 | ); | |
| 365 | assert_eq!(f(&[0xD83D, 0x20, 0xDCA9]), Wtf8Buf { | |
| 366 | bytes: b"\xED\xA0\xBD \xED\xB2\xA9".to_vec(), | |
| 367 | is_known_utf8: false | |
| 368 | }); | |
| 369 | assert_eq!(f(&[0xD800, 0xDBFF]), Wtf8Buf { | |
| 370 | bytes: b"\xED\xA0\x80\xED\xAF\xBF".to_vec(), | |
| 371 | is_known_utf8: false | |
| 372 | }); | |
| 373 | assert_eq!(f(&[0xD800, 0xE000]), Wtf8Buf { | |
| 374 | bytes: b"\xED\xA0\x80\xEE\x80\x80".to_vec(), | |
| 375 | is_known_utf8: false | |
| 376 | }); | |
| 377 | assert_eq!(f(&[0xD7FF, 0xDC00]), Wtf8Buf { | |
| 378 | bytes: b"\xED\x9F\xBF\xED\xB0\x80".to_vec(), | |
| 379 | is_known_utf8: false | |
| 380 | }); | |
| 381 | assert_eq!(f(&[0x61, 0xDC00]), Wtf8Buf { | |
| 382 | bytes: b"\x61\xED\xB0\x80".to_vec(), | |
| 383 | is_known_utf8: false | |
| 384 | }); | |
| 385 | 385 | assert_eq!(f(&[0xDC00]), Wtf8Buf { bytes: b"\xED\xB0\x80".to_vec(), is_known_utf8: false }); |
| 386 | 386 | } |
| 387 | 387 | |
| ... | ... | @@ -396,36 +396,36 @@ fn wtf8buf_extend() { |
| 396 | 396 | string |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | assert_eq!( | |
| 400 | e(&[0x61, 0xE9], &[0x20, 0x1F4A9]), | |
| 401 | Wtf8Buf { bytes: b"a\xC3\xA9 \xF0\x9F\x92\xA9".to_vec(), is_known_utf8: true } | |
| 402 | ); | |
| 399 | assert_eq!(e(&[0x61, 0xE9], &[0x20, 0x1F4A9]), Wtf8Buf { | |
| 400 | bytes: b"a\xC3\xA9 \xF0\x9F\x92\xA9".to_vec(), | |
| 401 | is_known_utf8: true | |
| 402 | }); | |
| 403 | 403 | |
| 404 | 404 | assert_eq!(e(&[0xD83D], &[0xDCA9]).bytes, b"\xF0\x9F\x92\xA9"); // Magic! |
| 405 | assert_eq!( | |
| 406 | e(&[0xD83D, 0x20], &[0xDCA9]), | |
| 407 | Wtf8Buf { bytes: b"\xED\xA0\xBD \xED\xB2\xA9".to_vec(), is_known_utf8: false } | |
| 408 | ); | |
| 409 | assert_eq!( | |
| 410 | e(&[0xD800], &[0xDBFF]), | |
| 411 | Wtf8Buf { bytes: b"\xED\xA0\x80\xED\xAF\xBF".to_vec(), is_known_utf8: false } | |
| 412 | ); | |
| 413 | assert_eq!( | |
| 414 | e(&[0xD800], &[0xE000]), | |
| 415 | Wtf8Buf { bytes: b"\xED\xA0\x80\xEE\x80\x80".to_vec(), is_known_utf8: false } | |
| 416 | ); | |
| 417 | assert_eq!( | |
| 418 | e(&[0xD7FF], &[0xDC00]), | |
| 419 | Wtf8Buf { bytes: b"\xED\x9F\xBF\xED\xB0\x80".to_vec(), is_known_utf8: false } | |
| 420 | ); | |
| 421 | assert_eq!( | |
| 422 | e(&[0x61], &[0xDC00]), | |
| 423 | Wtf8Buf { bytes: b"\x61\xED\xB0\x80".to_vec(), is_known_utf8: false } | |
| 424 | ); | |
| 425 | assert_eq!( | |
| 426 | e(&[], &[0xDC00]), | |
| 427 | Wtf8Buf { bytes: b"\xED\xB0\x80".to_vec(), is_known_utf8: false } | |
| 428 | ); | |
| 405 | assert_eq!(e(&[0xD83D, 0x20], &[0xDCA9]), Wtf8Buf { | |
| 406 | bytes: b"\xED\xA0\xBD \xED\xB2\xA9".to_vec(), | |
| 407 | is_known_utf8: false | |
| 408 | }); | |
| 409 | assert_eq!(e(&[0xD800], &[0xDBFF]), Wtf8Buf { | |
| 410 | bytes: b"\xED\xA0\x80\xED\xAF\xBF".to_vec(), | |
| 411 | is_known_utf8: false | |
| 412 | }); | |
| 413 | assert_eq!(e(&[0xD800], &[0xE000]), Wtf8Buf { | |
| 414 | bytes: b"\xED\xA0\x80\xEE\x80\x80".to_vec(), | |
| 415 | is_known_utf8: false | |
| 416 | }); | |
| 417 | assert_eq!(e(&[0xD7FF], &[0xDC00]), Wtf8Buf { | |
| 418 | bytes: b"\xED\x9F\xBF\xED\xB0\x80".to_vec(), | |
| 419 | is_known_utf8: false | |
| 420 | }); | |
| 421 | assert_eq!(e(&[0x61], &[0xDC00]), Wtf8Buf { | |
| 422 | bytes: b"\x61\xED\xB0\x80".to_vec(), | |
| 423 | is_known_utf8: false | |
| 424 | }); | |
| 425 | assert_eq!(e(&[], &[0xDC00]), Wtf8Buf { | |
| 426 | bytes: b"\xED\xB0\x80".to_vec(), | |
| 427 | is_known_utf8: false | |
| 428 | }); | |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | 431 | #[test] |
| ... | ... | @@ -556,10 +556,9 @@ fn wtf8_encode_wide() { |
| 556 | 556 | let mut string = Wtf8Buf::from_str("aé "); |
| 557 | 557 | string.push(CodePoint::from_u32(0xD83D).unwrap()); |
| 558 | 558 | string.push_char('💩'); |
| 559 | assert_eq!( | |
| 560 | string.encode_wide().collect::<Vec<_>>(), | |
| 561 | vec![0x61, 0xE9, 0x20, 0xD83D, 0xD83D, 0xDCA9] | |
| 562 | ); | |
| 559 | assert_eq!(string.encode_wide().collect::<Vec<_>>(), vec![ | |
| 560 | 0x61, 0xE9, 0x20, 0xD83D, 0xD83D, 0xDCA9 | |
| 561 | ]); | |
| 563 | 562 | } |
| 564 | 563 | |
| 565 | 564 | #[test] |
library/std/src/thread/mod.rs+3-3| ... | ... | @@ -162,12 +162,12 @@ use crate::any::Any; |
| 162 | 162 | use crate::cell::{Cell, OnceCell, UnsafeCell}; |
| 163 | 163 | use crate::ffi::CStr; |
| 164 | 164 | use crate::marker::PhantomData; |
| 165 | use crate::mem::{self, forget, ManuallyDrop}; | |
| 165 | use crate::mem::{self, ManuallyDrop, forget}; | |
| 166 | 166 | use crate::num::NonZero; |
| 167 | 167 | use crate::pin::Pin; |
| 168 | 168 | use crate::ptr::addr_of_mut; |
| 169 | use crate::sync::atomic::{AtomicUsize, Ordering}; | |
| 170 | 169 | use crate::sync::Arc; |
| 170 | use crate::sync::atomic::{AtomicUsize, Ordering}; | |
| 171 | 171 | use crate::sys::sync::Parker; |
| 172 | 172 | use crate::sys::thread as imp; |
| 173 | 173 | use crate::sys_common::{AsInner, IntoInner}; |
| ... | ... | @@ -178,7 +178,7 @@ use crate::{env, fmt, io, panic, panicking, str}; |
| 178 | 178 | mod scoped; |
| 179 | 179 | |
| 180 | 180 | #[stable(feature = "scoped_threads", since = "1.63.0")] |
| 181 | pub use scoped::{scope, Scope, ScopedJoinHandle}; | |
| 181 | pub use scoped::{Scope, ScopedJoinHandle, scope}; | |
| 182 | 182 | |
| 183 | 183 | //////////////////////////////////////////////////////////////////////////////// |
| 184 | 184 | // Thread-local storage |
library/std/src/thread/scoped.rs+3-3| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | use super::{current, park, Builder, JoinInner, Result, Thread}; | |
| 1 | use super::{Builder, JoinInner, Result, Thread, current, park}; | |
| 2 | 2 | use crate::marker::PhantomData; |
| 3 | use crate::panic::{catch_unwind, resume_unwind, AssertUnwindSafe}; | |
| 4 | use crate::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; | |
| 3 | use crate::panic::{AssertUnwindSafe, catch_unwind, resume_unwind}; | |
| 5 | 4 | use crate::sync::Arc; |
| 5 | use crate::sync::atomic::{AtomicBool, AtomicUsize, Ordering}; | |
| 6 | 6 | use crate::{fmt, io}; |
| 7 | 7 | |
| 8 | 8 | /// A scope to spawn scoped threads in. |
library/std/src/thread/tests.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ use super::Builder; |
| 2 | 2 | use crate::any::Any; |
| 3 | 3 | use crate::panic::panic_any; |
| 4 | 4 | use crate::sync::atomic::{AtomicBool, Ordering}; |
| 5 | use crate::sync::mpsc::{channel, Sender}; | |
| 5 | use crate::sync::mpsc::{Sender, channel}; | |
| 6 | 6 | use crate::sync::{Arc, Barrier}; |
| 7 | 7 | use crate::thread::{self, Scope, ThreadId}; |
| 8 | 8 | use crate::time::{Duration, Instant}; |
library/std/src/time/tests.rs+2-2| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use core::fmt::Debug; |
| 2 | 2 | |
| 3 | 3 | #[cfg(not(target_arch = "wasm32"))] |
| 4 | use test::{black_box, Bencher}; | |
| 4 | use test::{Bencher, black_box}; | |
| 5 | 5 | |
| 6 | 6 | use super::{Duration, Instant, SystemTime, UNIX_EPOCH}; |
| 7 | 7 | |
| ... | ... | @@ -235,8 +235,8 @@ macro_rules! bench_instant_threaded { |
| 235 | 235 | #[bench] |
| 236 | 236 | #[cfg(not(target_arch = "wasm32"))] |
| 237 | 237 | fn $bench_name(b: &mut Bencher) -> crate::thread::Result<()> { |
| 238 | use crate::sync::atomic::{AtomicBool, Ordering}; | |
| 239 | 238 | use crate::sync::Arc; |
| 239 | use crate::sync::atomic::{AtomicBool, Ordering}; | |
| 240 | 240 | |
| 241 | 241 | let running = Arc::new(AtomicBool::new(true)); |
| 242 | 242 |
library/test/src/bench.rs+2-2| ... | ... | @@ -1,15 +1,15 @@ |
| 1 | 1 | //! Benchmarking module. |
| 2 | 2 | |
| 3 | use std::panic::{catch_unwind, AssertUnwindSafe}; | |
| 3 | use std::panic::{AssertUnwindSafe, catch_unwind}; | |
| 4 | 4 | use std::sync::{Arc, Mutex}; |
| 5 | 5 | use std::time::{Duration, Instant}; |
| 6 | 6 | use std::{cmp, io}; |
| 7 | 7 | |
| 8 | use super::Sender; | |
| 8 | 9 | use super::event::CompletedTest; |
| 9 | 10 | use super::options::BenchMode; |
| 10 | 11 | use super::test_result::TestResult; |
| 11 | 12 | use super::types::{TestDesc, TestId}; |
| 12 | use super::Sender; | |
| 13 | 13 | use crate::stats; |
| 14 | 14 | |
| 15 | 15 | /// An identity function that *__hints__* to the compiler to be maximally pessimistic about what |
library/test/src/lib.rs+5-5| ... | ... | @@ -28,17 +28,17 @@ |
| 28 | 28 | |
| 29 | 29 | pub use cli::TestOpts; |
| 30 | 30 | |
| 31 | pub use self::bench::{black_box, Bencher}; | |
| 31 | pub use self::ColorConfig::*; | |
| 32 | pub use self::bench::{Bencher, black_box}; | |
| 32 | 33 | pub use self::console::run_tests_console; |
| 33 | 34 | pub use self::options::{ColorConfig, Options, OutputFormat, RunIgnored, ShouldPanic}; |
| 34 | 35 | pub use self::types::TestName::*; |
| 35 | 36 | pub use self::types::*; |
| 36 | pub use self::ColorConfig::*; | |
| 37 | 37 | |
| 38 | 38 | // Module to be used by rustc to compile tests in libtest |
| 39 | 39 | pub mod test { |
| 40 | 40 | pub use crate::bench::Bencher; |
| 41 | pub use crate::cli::{parse_opts, TestOpts}; | |
| 41 | pub use crate::cli::{TestOpts, parse_opts}; | |
| 42 | 42 | pub use crate::helpers::metrics::{Metric, MetricMap}; |
| 43 | 43 | pub use crate::options::{Options, RunIgnored, RunStrategy, ShouldPanic}; |
| 44 | 44 | pub use crate::test_result::{TestResult, TrFailed, TrFailedMsg, TrIgnored, TrOk}; |
| ... | ... | @@ -53,9 +53,9 @@ pub mod test { |
| 53 | 53 | use std::collections::VecDeque; |
| 54 | 54 | use std::io::prelude::Write; |
| 55 | 55 | use std::mem::ManuallyDrop; |
| 56 | use std::panic::{self, catch_unwind, AssertUnwindSafe, PanicHookInfo}; | |
| 56 | use std::panic::{self, AssertUnwindSafe, PanicHookInfo, catch_unwind}; | |
| 57 | 57 | use std::process::{self, Command, Termination}; |
| 58 | use std::sync::mpsc::{channel, Sender}; | |
| 58 | use std::sync::mpsc::{Sender, channel}; | |
| 59 | 59 | use std::sync::{Arc, Mutex}; |
| 60 | 60 | use std::time::{Duration, Instant}; |
| 61 | 61 | use std::{env, io, thread}; |
library/test/src/term/terminfo/mod.rs+2-2| ... | ... | @@ -7,11 +7,11 @@ use std::io::{self, BufReader}; |
| 7 | 7 | use std::path::Path; |
| 8 | 8 | use std::{env, error, fmt}; |
| 9 | 9 | |
| 10 | use parm::{expand, Param, Variables}; | |
| 10 | use parm::{Param, Variables, expand}; | |
| 11 | 11 | use parser::compiled::{msys_terminfo, parse}; |
| 12 | 12 | use searcher::get_dbpath_for_term; |
| 13 | 13 | |
| 14 | use super::{color, Terminal}; | |
| 14 | use super::{Terminal, color}; | |
| 15 | 15 | |
| 16 | 16 | /// A parsed terminfo database entry. |
| 17 | 17 | #[allow(unused)] |
library/test/src/term/win.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | use std::io; |
| 6 | 6 | use std::io::prelude::*; |
| 7 | 7 | |
| 8 | use super::{color, Terminal}; | |
| 8 | use super::{Terminal, color}; | |
| 9 | 9 | |
| 10 | 10 | /// A Terminal implementation that uses the Win32 Console API. |
| 11 | 11 | pub(crate) struct WinConsole<T> { |
library/test/src/tests.rs+1-1| ... | ... | @@ -3,11 +3,11 @@ use crate::{ |
| 3 | 3 | console::OutputLocation, |
| 4 | 4 | formatters::PrettyFormatter, |
| 5 | 5 | test::{ |
| 6 | parse_opts, | |
| 7 | 6 | MetricMap, |
| 8 | 7 | // FIXME (introduced by #65251) |
| 9 | 8 | // ShouldPanic, StaticTestName, TestDesc, TestDescAndFn, TestOpts, TestTimeOptions, |
| 10 | 9 | // TestType, TrFailedMsg, TrIgnored, TrOk, |
| 10 | parse_opts, | |
| 11 | 11 | }, |
| 12 | 12 | time::{TestTimeOptions, TimeThreshold}, |
| 13 | 13 | }; |
library/unwind/src/unwinding.rs+1-1| ... | ... | @@ -32,7 +32,7 @@ pub use unwinding::abi::{UnwindContext, UnwindException}; |
| 32 | 32 | pub enum _Unwind_Context {} |
| 33 | 33 | |
| 34 | 34 | pub use unwinding::custom_eh_frame_finder::{ |
| 35 | set_custom_eh_frame_finder, EhFrameFinder, FrameInfo, FrameInfoKind, | |
| 35 | EhFrameFinder, FrameInfo, FrameInfoKind, set_custom_eh_frame_finder, | |
| 36 | 36 | }; |
| 37 | 37 | |
| 38 | 38 | pub type _Unwind_Exception_Class = u64; |
rustfmt.toml+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | # Run rustfmt with this config (it should be picked up automatically). |
| 2 | version = "Two" | |
| 2 | style_edition = "2024" | |
| 3 | 3 | use_small_heuristics = "Max" |
| 4 | 4 | merge_derives = false |
| 5 | 5 | group_imports = "StdExternalCrate" |
src/bootstrap/src/bin/main.rs+2-2| ... | ... | @@ -11,8 +11,8 @@ use std::str::FromStr; |
| 11 | 11 | use std::{env, process}; |
| 12 | 12 | |
| 13 | 13 | use bootstrap::{ |
| 14 | find_recent_config_change_ids, human_readable_changes, t, Build, Config, Flags, Subcommand, | |
| 15 | CONFIG_CHANGE_HISTORY, | |
| 14 | Build, CONFIG_CHANGE_HISTORY, Config, Flags, Subcommand, find_recent_config_change_ids, | |
| 15 | human_readable_changes, t, | |
| 16 | 16 | }; |
| 17 | 17 | |
| 18 | 18 | fn main() { |
src/bootstrap/src/core/build_steps/check.rs+2-2| ... | ... | @@ -5,9 +5,9 @@ use std::path::PathBuf; |
| 5 | 5 | use crate::core::build_steps::compile::{ |
| 6 | 6 | add_to_sysroot, run_cargo, rustc_cargo, rustc_cargo_env, std_cargo, std_crates_for_run_make, |
| 7 | 7 | }; |
| 8 | use crate::core::build_steps::tool::{prepare_tool_cargo, SourceType}; | |
| 8 | use crate::core::build_steps::tool::{SourceType, prepare_tool_cargo}; | |
| 9 | 9 | use crate::core::builder::{ |
| 10 | self, crate_description, Alias, Builder, Kind, RunConfig, ShouldRun, Step, | |
| 10 | self, Alias, Builder, Kind, RunConfig, ShouldRun, Step, crate_description, | |
| 11 | 11 | }; |
| 12 | 12 | use crate::core::config::TargetSelection; |
| 13 | 13 | use crate::{Compiler, Mode, Subcommand}; |
src/bootstrap/src/core/build_steps/clean.rs+1-1| ... | ... | @@ -9,7 +9,7 @@ use std::fs; |
| 9 | 9 | use std::io::{self, ErrorKind}; |
| 10 | 10 | use std::path::Path; |
| 11 | 11 | |
| 12 | use crate::core::builder::{crate_description, Builder, RunConfig, ShouldRun, Step}; | |
| 12 | use crate::core::builder::{Builder, RunConfig, ShouldRun, Step, crate_description}; | |
| 13 | 13 | use crate::utils::helpers::t; |
| 14 | 14 | use crate::{Build, Compiler, Kind, Mode, Subcommand}; |
| 15 | 15 |
src/bootstrap/src/core/build_steps/clippy.rs+2-2| ... | ... | @@ -1,12 +1,12 @@ |
| 1 | 1 | //! Implementation of running clippy on the compiler, standard library and various tools. |
| 2 | 2 | |
| 3 | 3 | use super::compile::{librustc_stamp, libstd_stamp, run_cargo, rustc_cargo, std_cargo}; |
| 4 | use super::tool::{prepare_tool_cargo, SourceType}; | |
| 4 | use super::tool::{SourceType, prepare_tool_cargo}; | |
| 5 | 5 | use super::{check, compile}; |
| 6 | 6 | use crate::builder::{Builder, ShouldRun}; |
| 7 | 7 | use crate::core::build_steps::compile::std_crates_for_run_make; |
| 8 | 8 | use crate::core::builder; |
| 9 | use crate::core::builder::{crate_description, Alias, Kind, RunConfig, Step}; | |
| 9 | use crate::core::builder::{Alias, Kind, RunConfig, Step, crate_description}; | |
| 10 | 10 | use crate::{Mode, Subcommand, TargetSelection}; |
| 11 | 11 | |
| 12 | 12 | /// Disable the most spammy clippy lints |
src/bootstrap/src/core/build_steps/compile.rs+3-3| ... | ... | @@ -9,8 +9,8 @@ |
| 9 | 9 | use std::borrow::Cow; |
| 10 | 10 | use std::collections::HashSet; |
| 11 | 11 | use std::ffi::OsStr; |
| 12 | use std::io::prelude::*; | |
| 13 | 12 | use std::io::BufReader; |
| 13 | use std::io::prelude::*; | |
| 14 | 14 | use std::path::{Path, PathBuf}; |
| 15 | 15 | use std::process::Stdio; |
| 16 | 16 | use std::{env, fs, str}; |
| ... | ... | @@ -22,14 +22,14 @@ use crate::core::build_steps::tool::SourceType; |
| 22 | 22 | use crate::core::build_steps::{dist, llvm}; |
| 23 | 23 | use crate::core::builder; |
| 24 | 24 | use crate::core::builder::{ |
| 25 | crate_description, Builder, Cargo, Kind, PathSet, RunConfig, ShouldRun, Step, TaskPath, | |
| 25 | Builder, Cargo, Kind, PathSet, RunConfig, ShouldRun, Step, TaskPath, crate_description, | |
| 26 | 26 | }; |
| 27 | 27 | use crate::core::config::{DebuginfoLevel, LlvmLibunwind, RustcLto, TargetSelection}; |
| 28 | 28 | use crate::utils::exec::command; |
| 29 | 29 | use crate::utils::helpers::{ |
| 30 | 30 | self, exe, get_clang_cl_resource_dir, is_debug_info, is_dylib, symlink_dir, t, up_to_date, |
| 31 | 31 | }; |
| 32 | use crate::{CLang, Compiler, DependencyType, GitRepo, Mode, LLVM_TOOLS}; | |
| 32 | use crate::{CLang, Compiler, DependencyType, GitRepo, LLVM_TOOLS, Mode}; | |
| 33 | 33 | |
| 34 | 34 | #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] |
| 35 | 35 | pub struct Std { |
src/bootstrap/src/core/build_steps/dist.rs+3-3| ... | ... | @@ -14,8 +14,8 @@ use std::io::Write; |
| 14 | 14 | use std::path::{Path, PathBuf}; |
| 15 | 15 | use std::{env, fs}; |
| 16 | 16 | |
| 17 | use object::read::archive::ArchiveFile; | |
| 18 | 17 | use object::BinaryFormat; |
| 18 | use object::read::archive::ArchiveFile; | |
| 19 | 19 | |
| 20 | 20 | use crate::core::build_steps::doc::DocumentationFormat; |
| 21 | 21 | use crate::core::build_steps::tool::{self, Tool}; |
| ... | ... | @@ -24,12 +24,12 @@ use crate::core::build_steps::{compile, llvm}; |
| 24 | 24 | use crate::core::builder::{Builder, Kind, RunConfig, ShouldRun, Step}; |
| 25 | 25 | use crate::core::config::TargetSelection; |
| 26 | 26 | use crate::utils::channel::{self, Info}; |
| 27 | use crate::utils::exec::{command, BootstrapCommand}; | |
| 27 | use crate::utils::exec::{BootstrapCommand, command}; | |
| 28 | 28 | use crate::utils::helpers::{ |
| 29 | 29 | exe, is_dylib, move_file, t, target_supports_cranelift_backend, timeit, |
| 30 | 30 | }; |
| 31 | 31 | use crate::utils::tarball::{GeneratedTarball, OverlayKind, Tarball}; |
| 32 | use crate::{Compiler, DependencyType, Mode, LLVM_TOOLS}; | |
| 32 | use crate::{Compiler, DependencyType, LLVM_TOOLS, Mode}; | |
| 33 | 33 | |
| 34 | 34 | pub fn pkgname(builder: &Builder<'_>, component: &str) -> String { |
| 35 | 35 | format!("{}-{}", component, builder.rust_package_vers()) |
src/bootstrap/src/core/build_steps/doc.rs+3-3| ... | ... | @@ -11,14 +11,14 @@ use std::io::{self, Write}; |
| 11 | 11 | use std::path::{Path, PathBuf}; |
| 12 | 12 | use std::{env, fs, mem}; |
| 13 | 13 | |
| 14 | use crate::Mode; | |
| 14 | 15 | use crate::core::build_steps::compile; |
| 15 | use crate::core::build_steps::tool::{self, prepare_tool_cargo, SourceType, Tool}; | |
| 16 | use crate::core::build_steps::tool::{self, SourceType, Tool, prepare_tool_cargo}; | |
| 16 | 17 | use crate::core::builder::{ |
| 17 | self, crate_description, Alias, Builder, Compiler, Kind, RunConfig, ShouldRun, Step, | |
| 18 | self, Alias, Builder, Compiler, Kind, RunConfig, ShouldRun, Step, crate_description, | |
| 18 | 19 | }; |
| 19 | 20 | use crate::core::config::{Config, TargetSelection}; |
| 20 | 21 | use crate::utils::helpers::{symlink_dir, t, up_to_date}; |
| 21 | use crate::Mode; | |
| 22 | 22 | |
| 23 | 23 | macro_rules! submodule_helper { |
| 24 | 24 | ($path:expr, submodule) => { |
src/bootstrap/src/core/build_steps/format.rs+1-1| ... | ... | @@ -3,8 +3,8 @@ |
| 3 | 3 | use std::collections::VecDeque; |
| 4 | 4 | use std::path::{Path, PathBuf}; |
| 5 | 5 | use std::process::Command; |
| 6 | use std::sync::mpsc::SyncSender; | |
| 7 | 6 | use std::sync::Mutex; |
| 7 | use std::sync::mpsc::SyncSender; | |
| 8 | 8 | |
| 9 | 9 | use build_helper::ci::CiEnv; |
| 10 | 10 | use build_helper::git::get_git_modified_files; |
src/bootstrap/src/core/build_steps/gcc.rs+2-2| ... | ... | @@ -15,8 +15,8 @@ use std::sync::OnceLock; |
| 15 | 15 | use crate::core::builder::{Builder, RunConfig, ShouldRun, Step}; |
| 16 | 16 | use crate::core::config::TargetSelection; |
| 17 | 17 | use crate::utils::exec::command; |
| 18 | use crate::utils::helpers::{self, t, HashStamp}; | |
| 19 | use crate::{generate_smart_stamp_hash, Kind}; | |
| 18 | use crate::utils::helpers::{self, HashStamp, t}; | |
| 19 | use crate::{Kind, generate_smart_stamp_hash}; | |
| 20 | 20 | |
| 21 | 21 | pub struct Meta { |
| 22 | 22 | stamp: HashStamp, |
src/bootstrap/src/core/build_steps/llvm.rs+8-12| ... | ... | @@ -23,9 +23,9 @@ use crate::core::config::{Config, TargetSelection}; |
| 23 | 23 | use crate::utils::channel; |
| 24 | 24 | use crate::utils::exec::command; |
| 25 | 25 | use crate::utils::helpers::{ |
| 26 | self, exe, get_clang_cl_resource_dir, output, t, unhashed_basename, up_to_date, HashStamp, | |
| 26 | self, HashStamp, exe, get_clang_cl_resource_dir, output, t, unhashed_basename, up_to_date, | |
| 27 | 27 | }; |
| 28 | use crate::{generate_smart_stamp_hash, CLang, GitRepo, Kind}; | |
| 28 | use crate::{CLang, GitRepo, Kind, generate_smart_stamp_hash}; | |
| 29 | 29 | |
| 30 | 30 | #[derive(Clone)] |
| 31 | 31 | pub struct LlvmResult { |
| ... | ... | @@ -154,16 +154,12 @@ pub fn prebuilt_llvm_config(builder: &Builder<'_>, target: TargetSelection) -> L |
| 154 | 154 | /// This retrieves the LLVM sha we *want* to use, according to git history. |
| 155 | 155 | pub(crate) fn detect_llvm_sha(config: &Config, is_git: bool) -> String { |
| 156 | 156 | let llvm_sha = if is_git { |
| 157 | get_closest_merge_commit( | |
| 158 | Some(&config.src), | |
| 159 | &config.git_config(), | |
| 160 | &[ | |
| 161 | config.src.join("src/llvm-project"), | |
| 162 | config.src.join("src/bootstrap/download-ci-llvm-stamp"), | |
| 163 | // the LLVM shared object file is named `LLVM-12-rust-{version}-nightly` | |
| 164 | config.src.join("src/version"), | |
| 165 | ], | |
| 166 | ) | |
| 157 | get_closest_merge_commit(Some(&config.src), &config.git_config(), &[ | |
| 158 | config.src.join("src/llvm-project"), | |
| 159 | config.src.join("src/bootstrap/download-ci-llvm-stamp"), | |
| 160 | // the LLVM shared object file is named `LLVM-12-rust-{version}-nightly` | |
| 161 | config.src.join("src/version"), | |
| 162 | ]) | |
| 167 | 163 | .unwrap() |
| 168 | 164 | } else if let Some(info) = channel::read_commit_info_file(&config.src) { |
| 169 | 165 | info.sha.trim().to_owned() |
src/bootstrap/src/core/build_steps/run.rs+2-2| ... | ... | @@ -5,14 +5,14 @@ |
| 5 | 5 | |
| 6 | 6 | use std::path::PathBuf; |
| 7 | 7 | |
| 8 | use crate::Mode; | |
| 8 | 9 | use crate::core::build_steps::dist::distdir; |
| 9 | 10 | use crate::core::build_steps::test; |
| 10 | 11 | use crate::core::build_steps::tool::{self, SourceType, Tool}; |
| 11 | 12 | use crate::core::builder::{Builder, Kind, RunConfig, ShouldRun, Step}; |
| 12 | use crate::core::config::flags::get_completion; | |
| 13 | 13 | use crate::core::config::TargetSelection; |
| 14 | use crate::core::config::flags::get_completion; | |
| 14 | 15 | use crate::utils::exec::command; |
| 15 | use crate::Mode; | |
| 16 | 16 | |
| 17 | 17 | #[derive(Debug, PartialOrd, Ord, Clone, Hash, PartialEq, Eq)] |
| 18 | 18 | pub struct BuildManifest; |
src/bootstrap/src/core/build_steps/setup.rs+2-2| ... | ... | @@ -9,7 +9,7 @@ use std::env::consts::EXE_SUFFIX; |
| 9 | 9 | use std::fmt::Write as _; |
| 10 | 10 | use std::fs::File; |
| 11 | 11 | use std::io::Write; |
| 12 | use std::path::{Path, PathBuf, MAIN_SEPARATOR_STR}; | |
| 12 | use std::path::{MAIN_SEPARATOR_STR, Path, PathBuf}; | |
| 13 | 13 | use std::str::FromStr; |
| 14 | 14 | use std::{fmt, fs, io}; |
| 15 | 15 | |
| ... | ... | @@ -19,7 +19,7 @@ use crate::core::builder::{Builder, RunConfig, ShouldRun, Step}; |
| 19 | 19 | use crate::utils::change_tracker::CONFIG_CHANGE_HISTORY; |
| 20 | 20 | use crate::utils::exec::command; |
| 21 | 21 | use crate::utils::helpers::{self, hex_encode}; |
| 22 | use crate::{t, Config}; | |
| 22 | use crate::{Config, t}; | |
| 23 | 23 | |
| 24 | 24 | #[cfg(test)] |
| 25 | 25 | mod tests; |
src/bootstrap/src/core/build_steps/synthetic_targets.rs+1-1| ... | ... | @@ -7,10 +7,10 @@ |
| 7 | 7 | //! one of the target specs already defined in this module, or create new ones by adding a new step |
| 8 | 8 | //! that calls create_synthetic_target. |
| 9 | 9 | |
| 10 | use crate::Compiler; | |
| 10 | 11 | use crate::core::builder::{Builder, ShouldRun, Step}; |
| 11 | 12 | use crate::core::config::TargetSelection; |
| 12 | 13 | use crate::utils::exec::command; |
| 13 | use crate::Compiler; | |
| 14 | 14 | |
| 15 | 15 | #[derive(Debug, Clone, PartialEq, Eq, Hash)] |
| 16 | 16 | pub(crate) struct MirOptPanicAbortSyntheticTarget { |
src/bootstrap/src/core/build_steps/test.rs+12-17| ... | ... | @@ -15,17 +15,17 @@ use crate::core::build_steps::tool::{self, SourceType, Tool}; |
| 15 | 15 | use crate::core::build_steps::toolstate::ToolState; |
| 16 | 16 | use crate::core::build_steps::{compile, dist, llvm}; |
| 17 | 17 | use crate::core::builder::{ |
| 18 | self, crate_description, Alias, Builder, Compiler, Kind, RunConfig, ShouldRun, Step, | |
| 18 | self, Alias, Builder, Compiler, Kind, RunConfig, ShouldRun, Step, crate_description, | |
| 19 | 19 | }; |
| 20 | use crate::core::config::flags::{get_completion, Subcommand}; | |
| 21 | 20 | use crate::core::config::TargetSelection; |
| 22 | use crate::utils::exec::{command, BootstrapCommand}; | |
| 21 | use crate::core::config::flags::{Subcommand, get_completion}; | |
| 22 | use crate::utils::exec::{BootstrapCommand, command}; | |
| 23 | 23 | use crate::utils::helpers::{ |
| 24 | self, add_link_lib_path, add_rustdoc_cargo_linker_args, dylib_path, dylib_path_var, | |
| 25 | linker_args, linker_flags, t, target_supports_cranelift_backend, up_to_date, LldThreads, | |
| 24 | self, LldThreads, add_link_lib_path, add_rustdoc_cargo_linker_args, dylib_path, dylib_path_var, | |
| 25 | linker_args, linker_flags, t, target_supports_cranelift_backend, up_to_date, | |
| 26 | 26 | }; |
| 27 | 27 | use crate::utils::render_tests::{add_flags_and_try_run_tests, try_run_tests}; |
| 28 | use crate::{envify, CLang, DocTests, GitRepo, Mode}; | |
| 28 | use crate::{CLang, DocTests, GitRepo, Mode, envify}; | |
| 29 | 29 | |
| 30 | 30 | const ADB_TEST_DIR: &str = "/data/local/tmp/work"; |
| 31 | 31 | |
| ... | ... | @@ -1075,12 +1075,8 @@ HELP: to skip test's attempt to check tidiness, pass `--skip src/tools/tidy` to |
| 1075 | 1075 | crate::exit!(1); |
| 1076 | 1076 | } |
| 1077 | 1077 | let all = false; |
| 1078 | crate::core::build_steps::format::format( | |
| 1079 | builder, | |
| 1080 | !builder.config.cmd.bless(), | |
| 1081 | all, | |
| 1082 | &[], | |
| 1083 | ); | |
| 1078 | crate::core::build_steps::format::format(builder, !builder.config.cmd.bless(), all, &[ | |
| 1079 | ]); | |
| 1084 | 1080 | } |
| 1085 | 1081 | |
| 1086 | 1082 | builder.info("tidy check"); |
| ... | ... | @@ -3440,11 +3436,10 @@ impl Step for CodegenGCC { |
| 3440 | 3436 | let compiler = self.compiler; |
| 3441 | 3437 | let target = self.target; |
| 3442 | 3438 | |
| 3443 | builder.ensure(compile::Std::new_with_extra_rust_args( | |
| 3444 | compiler, | |
| 3445 | target, | |
| 3446 | &["-Csymbol-mangling-version=v0", "-Cpanic=abort"], | |
| 3447 | )); | |
| 3439 | builder.ensure(compile::Std::new_with_extra_rust_args(compiler, target, &[ | |
| 3440 | "-Csymbol-mangling-version=v0", | |
| 3441 | "-Cpanic=abort", | |
| 3442 | ])); | |
| 3448 | 3443 | |
| 3449 | 3444 | // If we're not doing a full bootstrap but we're testing a stage2 |
| 3450 | 3445 | // version of libstd, then what we're actually testing is the libstd |
src/bootstrap/src/core/build_steps/tool.rs+2-2| ... | ... | @@ -9,9 +9,9 @@ use crate::core::builder; |
| 9 | 9 | use crate::core::builder::{Builder, Cargo as CargoCommand, RunConfig, ShouldRun, Step}; |
| 10 | 10 | use crate::core::config::TargetSelection; |
| 11 | 11 | use crate::utils::channel::GitInfo; |
| 12 | use crate::utils::exec::{command, BootstrapCommand}; | |
| 12 | use crate::utils::exec::{BootstrapCommand, command}; | |
| 13 | 13 | use crate::utils::helpers::{add_dylib_path, exe, git, t}; |
| 14 | use crate::{gha, Compiler, Kind, Mode}; | |
| 14 | use crate::{Compiler, Kind, Mode, gha}; | |
| 15 | 15 | |
| 16 | 16 | #[derive(Debug, Clone, Hash, PartialEq, Eq)] |
| 17 | 17 | pub enum SourceType { |
src/bootstrap/src/core/build_steps/toolstate.rs+5-9| ... | ... | @@ -42,15 +42,11 @@ pub enum ToolState { |
| 42 | 42 | |
| 43 | 43 | impl fmt::Display for ToolState { |
| 44 | 44 | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
| 45 | write!( | |
| 46 | f, | |
| 47 | "{}", | |
| 48 | match self { | |
| 49 | ToolState::TestFail => "test-fail", | |
| 50 | ToolState::TestPass => "test-pass", | |
| 51 | ToolState::BuildFail => "build-fail", | |
| 52 | } | |
| 53 | ) | |
| 45 | write!(f, "{}", match self { | |
| 46 | ToolState::TestFail => "test-fail", | |
| 47 | ToolState::TestPass => "test-pass", | |
| 48 | ToolState::BuildFail => "build-fail", | |
| 49 | }) | |
| 54 | 50 | } |
| 55 | 51 | } |
| 56 | 52 |
src/bootstrap/src/core/builder.rs+30-33| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use std::any::{type_name, Any}; | |
| 1 | use std::any::{Any, type_name}; | |
| 2 | 2 | use std::cell::{Cell, RefCell}; |
| 3 | 3 | use std::collections::BTreeSet; |
| 4 | 4 | use std::ffi::{OsStr, OsString}; |
| ... | ... | @@ -12,6 +12,7 @@ use std::{env, fs}; |
| 12 | 12 | |
| 13 | 13 | use clap::ValueEnum; |
| 14 | 14 | |
| 15 | pub use crate::Compiler; | |
| 15 | 16 | use crate::core::build_steps::tool::{self, SourceType}; |
| 16 | 17 | use crate::core::build_steps::{ |
| 17 | 18 | check, clean, clippy, compile, dist, doc, gcc, install, llvm, run, setup, test, vendor, |
| ... | ... | @@ -19,14 +20,13 @@ use crate::core::build_steps::{ |
| 19 | 20 | use crate::core::config::flags::{Color, Subcommand}; |
| 20 | 21 | use crate::core::config::{DryRun, SplitDebuginfo, TargetSelection}; |
| 21 | 22 | use crate::utils::cache::Cache; |
| 22 | use crate::utils::exec::{command, BootstrapCommand}; | |
| 23 | use crate::utils::exec::{BootstrapCommand, command}; | |
| 23 | 24 | use crate::utils::helpers::{ |
| 24 | self, add_dylib_path, add_link_lib_path, check_cfg_arg, exe, libdir, linker_args, linker_flags, | |
| 25 | t, LldThreads, | |
| 25 | self, LldThreads, add_dylib_path, add_link_lib_path, check_cfg_arg, exe, libdir, linker_args, | |
| 26 | linker_flags, t, | |
| 26 | 27 | }; |
| 27 | pub use crate::Compiler; | |
| 28 | 28 | use crate::{ |
| 29 | prepare_behaviour_dump_dir, Build, CLang, Crate, DocTests, GitRepo, Mode, EXTRA_CHECK_CFGS, | |
| 29 | Build, CLang, Crate, DocTests, EXTRA_CHECK_CFGS, GitRepo, Mode, prepare_behaviour_dump_dir, | |
| 30 | 30 | }; |
| 31 | 31 | |
| 32 | 32 | #[cfg(test)] |
| ... | ... | @@ -314,33 +314,30 @@ const PATH_REMAP: &[(&str, &[&str])] = &[ |
| 314 | 314 | // actual path is `proc-macro-srv-cli` |
| 315 | 315 | ("rust-analyzer-proc-macro-srv", &["src/tools/rust-analyzer/crates/proc-macro-srv-cli"]), |
| 316 | 316 | // Make `x test tests` function the same as `x t tests/*` |
| 317 | ( | |
| 318 | "tests", | |
| 319 | &[ | |
| 320 | // tidy-alphabetical-start | |
| 321 | "tests/assembly", | |
| 322 | "tests/codegen", | |
| 323 | "tests/codegen-units", | |
| 324 | "tests/coverage", | |
| 325 | "tests/coverage-run-rustdoc", | |
| 326 | "tests/crashes", | |
| 327 | "tests/debuginfo", | |
| 328 | "tests/incremental", | |
| 329 | "tests/mir-opt", | |
| 330 | "tests/pretty", | |
| 331 | "tests/run-make", | |
| 332 | "tests/run-pass-valgrind", | |
| 333 | "tests/rustdoc", | |
| 334 | "tests/rustdoc-gui", | |
| 335 | "tests/rustdoc-js", | |
| 336 | "tests/rustdoc-js-std", | |
| 337 | "tests/rustdoc-json", | |
| 338 | "tests/rustdoc-ui", | |
| 339 | "tests/ui", | |
| 340 | "tests/ui-fulldeps", | |
| 341 | // tidy-alphabetical-end | |
| 342 | ], | |
| 343 | ), | |
| 317 | ("tests", &[ | |
| 318 | // tidy-alphabetical-start | |
| 319 | "tests/assembly", | |
| 320 | "tests/codegen", | |
| 321 | "tests/codegen-units", | |
| 322 | "tests/coverage", | |
| 323 | "tests/coverage-run-rustdoc", | |
| 324 | "tests/crashes", | |
| 325 | "tests/debuginfo", | |
| 326 | "tests/incremental", | |
| 327 | "tests/mir-opt", | |
| 328 | "tests/pretty", | |
| 329 | "tests/run-make", | |
| 330 | "tests/run-pass-valgrind", | |
| 331 | "tests/rustdoc", | |
| 332 | "tests/rustdoc-gui", | |
| 333 | "tests/rustdoc-js", | |
| 334 | "tests/rustdoc-js-std", | |
| 335 | "tests/rustdoc-json", | |
| 336 | "tests/rustdoc-ui", | |
| 337 | "tests/ui", | |
| 338 | "tests/ui-fulldeps", | |
| 339 | // tidy-alphabetical-end | |
| 340 | ]), | |
| 344 | 341 | ]; |
| 345 | 342 | |
| 346 | 343 | fn remap_paths(paths: &mut Vec<PathBuf>) { |
src/bootstrap/src/core/builder/tests.rs+194-261| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | use std::thread; |
| 2 | 2 | |
| 3 | 3 | use super::*; |
| 4 | use crate::Flags; | |
| 4 | 5 | use crate::core::build_steps::doc::DocumentationFormat; |
| 5 | 6 | use crate::core::config::Config; |
| 6 | use crate::Flags; | |
| 7 | 7 | |
| 8 | 8 | fn configure(cmd: &str, host: &[&str], target: &[&str]) -> Config { |
| 9 | 9 | configure_with_args(&[cmd.to_owned()], host, target) |
| ... | ... | @@ -202,10 +202,10 @@ fn test_exclude_kind() { |
| 202 | 202 | fn alias_and_path_for_library() { |
| 203 | 203 | let mut cache = |
| 204 | 204 | run_build(&["library".into(), "core".into()], configure("build", &["A-A"], &["A-A"])); |
| 205 | assert_eq!( | |
| 206 | first(cache.all::<compile::Std>()), | |
| 207 | &[std!(A => A, stage = 0), std!(A => A, stage = 1)] | |
| 208 | ); | |
| 205 | assert_eq!(first(cache.all::<compile::Std>()), &[ | |
| 206 | std!(A => A, stage = 0), | |
| 207 | std!(A => A, stage = 1) | |
| 208 | ]); | |
| 209 | 209 | |
| 210 | 210 | let mut cache = |
| 211 | 211 | run_build(&["library".into(), "core".into()], configure("doc", &["A-A"], &["A-A"])); |
| ... | ... | @@ -216,18 +216,18 @@ mod defaults { |
| 216 | 216 | use pretty_assertions::assert_eq; |
| 217 | 217 | |
| 218 | 218 | use super::{configure, first, run_build}; |
| 219 | use crate::core::builder::*; | |
| 220 | 219 | use crate::Config; |
| 220 | use crate::core::builder::*; | |
| 221 | 221 | |
| 222 | 222 | #[test] |
| 223 | 223 | fn build_default() { |
| 224 | 224 | let mut cache = run_build(&[], configure("build", &["A-A"], &["A-A"])); |
| 225 | 225 | |
| 226 | 226 | let a = TargetSelection::from_user("A-A"); |
| 227 | assert_eq!( | |
| 228 | first(cache.all::<compile::Std>()), | |
| 229 | &[std!(A => A, stage = 0), std!(A => A, stage = 1),] | |
| 230 | ); | |
| 227 | assert_eq!(first(cache.all::<compile::Std>()), &[ | |
| 228 | std!(A => A, stage = 0), | |
| 229 | std!(A => A, stage = 1), | |
| 230 | ]); | |
| 231 | 231 | assert!(!cache.all::<compile::Assemble>().is_empty()); |
| 232 | 232 | // Make sure rustdoc is only built once. |
| 233 | 233 | assert_eq!( |
| ... | ... | @@ -269,34 +269,25 @@ mod defaults { |
| 269 | 269 | // there's not really a need for us to build for target A in this case |
| 270 | 270 | // (since we're producing stage 1 libraries/binaries). But currently |
| 271 | 271 | // bootstrap is just a bit buggy here; this should be fixed though. |
| 272 | assert_eq!( | |
| 273 | first(cache.all::<compile::Std>()), | |
| 274 | &[ | |
| 275 | std!(A => A, stage = 0), | |
| 276 | std!(A => A, stage = 1), | |
| 277 | std!(A => B, stage = 0), | |
| 278 | std!(A => B, stage = 1), | |
| 279 | ] | |
| 280 | ); | |
| 281 | assert_eq!( | |
| 282 | first(cache.all::<compile::Assemble>()), | |
| 283 | &[ | |
| 284 | compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } }, | |
| 285 | compile::Assemble { target_compiler: Compiler { host: a, stage: 1 } }, | |
| 286 | compile::Assemble { target_compiler: Compiler { host: b, stage: 1 } }, | |
| 287 | ] | |
| 288 | ); | |
| 289 | assert_eq!( | |
| 290 | first(cache.all::<tool::Rustdoc>()), | |
| 291 | &[ | |
| 292 | tool::Rustdoc { compiler: Compiler { host: a, stage: 1 } }, | |
| 293 | tool::Rustdoc { compiler: Compiler { host: b, stage: 1 } }, | |
| 294 | ], | |
| 295 | ); | |
| 296 | assert_eq!( | |
| 297 | first(cache.all::<compile::Rustc>()), | |
| 298 | &[rustc!(A => A, stage = 0), rustc!(A => B, stage = 0),] | |
| 299 | ); | |
| 272 | assert_eq!(first(cache.all::<compile::Std>()), &[ | |
| 273 | std!(A => A, stage = 0), | |
| 274 | std!(A => A, stage = 1), | |
| 275 | std!(A => B, stage = 0), | |
| 276 | std!(A => B, stage = 1), | |
| 277 | ]); | |
| 278 | assert_eq!(first(cache.all::<compile::Assemble>()), &[ | |
| 279 | compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } }, | |
| 280 | compile::Assemble { target_compiler: Compiler { host: a, stage: 1 } }, | |
| 281 | compile::Assemble { target_compiler: Compiler { host: b, stage: 1 } }, | |
| 282 | ]); | |
| 283 | assert_eq!(first(cache.all::<tool::Rustdoc>()), &[ | |
| 284 | tool::Rustdoc { compiler: Compiler { host: a, stage: 1 } }, | |
| 285 | tool::Rustdoc { compiler: Compiler { host: b, stage: 1 } }, | |
| 286 | ],); | |
| 287 | assert_eq!(first(cache.all::<compile::Rustc>()), &[ | |
| 288 | rustc!(A => A, stage = 0), | |
| 289 | rustc!(A => B, stage = 0), | |
| 290 | ]); | |
| 300 | 291 | } |
| 301 | 292 | |
| 302 | 293 | #[test] |
| ... | ... | @@ -310,24 +301,22 @@ mod defaults { |
| 310 | 301 | // error_index_generator uses stage 0 to share rustdoc artifacts with the |
| 311 | 302 | // rustdoc tool. |
| 312 | 303 | assert_eq!(first(cache.all::<doc::ErrorIndex>()), &[doc::ErrorIndex { target: a },]); |
| 313 | assert_eq!( | |
| 314 | first(cache.all::<tool::ErrorIndex>()), | |
| 315 | &[tool::ErrorIndex { compiler: Compiler { host: a, stage: 0 } }] | |
| 316 | ); | |
| 304 | assert_eq!(first(cache.all::<tool::ErrorIndex>()), &[tool::ErrorIndex { | |
| 305 | compiler: Compiler { host: a, stage: 0 } | |
| 306 | }]); | |
| 317 | 307 | // docs should be built with the beta compiler, not with the stage0 artifacts. |
| 318 | 308 | // recall that rustdoc is off-by-one: `stage` is the compiler rustdoc is _linked_ to, |
| 319 | 309 | // not the one it was built by. |
| 320 | assert_eq!( | |
| 321 | first(cache.all::<tool::Rustdoc>()), | |
| 322 | &[tool::Rustdoc { compiler: Compiler { host: a, stage: 0 } },] | |
| 323 | ); | |
| 310 | assert_eq!(first(cache.all::<tool::Rustdoc>()), &[tool::Rustdoc { | |
| 311 | compiler: Compiler { host: a, stage: 0 } | |
| 312 | },]); | |
| 324 | 313 | } |
| 325 | 314 | } |
| 326 | 315 | |
| 327 | 316 | mod dist { |
| 328 | 317 | use pretty_assertions::assert_eq; |
| 329 | 318 | |
| 330 | use super::{first, run_build, Config}; | |
| 319 | use super::{Config, first, run_build}; | |
| 331 | 320 | use crate::core::builder::*; |
| 332 | 321 | |
| 333 | 322 | fn configure(host: &[&str], target: &[&str]) -> Config { |
| ... | ... | @@ -342,20 +331,18 @@ mod dist { |
| 342 | 331 | |
| 343 | 332 | assert_eq!(first(cache.all::<dist::Docs>()), &[dist::Docs { host: a },]); |
| 344 | 333 | assert_eq!(first(cache.all::<dist::Mingw>()), &[dist::Mingw { host: a },]); |
| 345 | assert_eq!( | |
| 346 | first(cache.all::<dist::Rustc>()), | |
| 347 | &[dist::Rustc { compiler: Compiler { host: a, stage: 2 } },] | |
| 348 | ); | |
| 349 | assert_eq!( | |
| 350 | first(cache.all::<dist::Std>()), | |
| 351 | &[dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a },] | |
| 352 | ); | |
| 334 | assert_eq!(first(cache.all::<dist::Rustc>()), &[dist::Rustc { | |
| 335 | compiler: Compiler { host: a, stage: 2 } | |
| 336 | },]); | |
| 337 | assert_eq!(first(cache.all::<dist::Std>()), &[dist::Std { | |
| 338 | compiler: Compiler { host: a, stage: 1 }, | |
| 339 | target: a | |
| 340 | },]); | |
| 353 | 341 | assert_eq!(first(cache.all::<dist::Src>()), &[dist::Src]); |
| 354 | 342 | // Make sure rustdoc is only built once. |
| 355 | assert_eq!( | |
| 356 | first(cache.all::<tool::Rustdoc>()), | |
| 357 | &[tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } },] | |
| 358 | ); | |
| 343 | assert_eq!(first(cache.all::<tool::Rustdoc>()), &[tool::Rustdoc { | |
| 344 | compiler: Compiler { host: a, stage: 2 } | |
| 345 | },]); | |
| 359 | 346 | } |
| 360 | 347 | |
| 361 | 348 | #[test] |
| ... | ... | @@ -365,25 +352,19 @@ mod dist { |
| 365 | 352 | let a = TargetSelection::from_user("A-A"); |
| 366 | 353 | let b = TargetSelection::from_user("B-B"); |
| 367 | 354 | |
| 368 | assert_eq!( | |
| 369 | first(cache.all::<dist::Docs>()), | |
| 370 | &[dist::Docs { host: a }, dist::Docs { host: b },] | |
| 371 | ); | |
| 372 | assert_eq!( | |
| 373 | first(cache.all::<dist::Mingw>()), | |
| 374 | &[dist::Mingw { host: a }, dist::Mingw { host: b },] | |
| 375 | ); | |
| 376 | assert_eq!( | |
| 377 | first(cache.all::<dist::Rustc>()), | |
| 378 | &[dist::Rustc { compiler: Compiler { host: a, stage: 2 } },] | |
| 379 | ); | |
| 380 | assert_eq!( | |
| 381 | first(cache.all::<dist::Std>()), | |
| 382 | &[ | |
| 383 | dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, | |
| 384 | dist::Std { compiler: Compiler { host: a, stage: 2 }, target: b }, | |
| 385 | ] | |
| 386 | ); | |
| 355 | assert_eq!(first(cache.all::<dist::Docs>()), &[dist::Docs { host: a }, dist::Docs { | |
| 356 | host: b | |
| 357 | },]); | |
| 358 | assert_eq!(first(cache.all::<dist::Mingw>()), &[dist::Mingw { host: a }, dist::Mingw { | |
| 359 | host: b | |
| 360 | },]); | |
| 361 | assert_eq!(first(cache.all::<dist::Rustc>()), &[dist::Rustc { | |
| 362 | compiler: Compiler { host: a, stage: 2 } | |
| 363 | },]); | |
| 364 | assert_eq!(first(cache.all::<dist::Std>()), &[ | |
| 365 | dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, | |
| 366 | dist::Std { compiler: Compiler { host: a, stage: 2 }, target: b }, | |
| 367 | ]); | |
| 387 | 368 | assert_eq!(first(cache.all::<dist::Src>()), &[dist::Src]); |
| 388 | 369 | } |
| 389 | 370 | |
| ... | ... | @@ -394,38 +375,27 @@ mod dist { |
| 394 | 375 | let a = TargetSelection::from_user("A-A"); |
| 395 | 376 | let b = TargetSelection::from_user("B-B"); |
| 396 | 377 | |
| 397 | assert_eq!( | |
| 398 | first(cache.all::<dist::Docs>()), | |
| 399 | &[dist::Docs { host: a }, dist::Docs { host: b },] | |
| 400 | ); | |
| 401 | assert_eq!( | |
| 402 | first(cache.all::<dist::Mingw>()), | |
| 403 | &[dist::Mingw { host: a }, dist::Mingw { host: b },] | |
| 404 | ); | |
| 405 | assert_eq!( | |
| 406 | first(cache.all::<dist::Rustc>()), | |
| 407 | &[ | |
| 408 | dist::Rustc { compiler: Compiler { host: a, stage: 2 } }, | |
| 409 | dist::Rustc { compiler: Compiler { host: b, stage: 2 } }, | |
| 410 | ] | |
| 411 | ); | |
| 412 | assert_eq!( | |
| 413 | first(cache.all::<dist::Std>()), | |
| 414 | &[ | |
| 415 | dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, | |
| 416 | dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b }, | |
| 417 | ] | |
| 418 | ); | |
| 419 | assert_eq!( | |
| 420 | first(cache.all::<compile::Std>()), | |
| 421 | &[ | |
| 422 | std!(A => A, stage = 0), | |
| 423 | std!(A => A, stage = 1), | |
| 424 | std!(A => A, stage = 2), | |
| 425 | std!(A => B, stage = 1), | |
| 426 | std!(A => B, stage = 2), | |
| 427 | ], | |
| 428 | ); | |
| 378 | assert_eq!(first(cache.all::<dist::Docs>()), &[dist::Docs { host: a }, dist::Docs { | |
| 379 | host: b | |
| 380 | },]); | |
| 381 | assert_eq!(first(cache.all::<dist::Mingw>()), &[dist::Mingw { host: a }, dist::Mingw { | |
| 382 | host: b | |
| 383 | },]); | |
| 384 | assert_eq!(first(cache.all::<dist::Rustc>()), &[ | |
| 385 | dist::Rustc { compiler: Compiler { host: a, stage: 2 } }, | |
| 386 | dist::Rustc { compiler: Compiler { host: b, stage: 2 } }, | |
| 387 | ]); | |
| 388 | assert_eq!(first(cache.all::<dist::Std>()), &[ | |
| 389 | dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, | |
| 390 | dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b }, | |
| 391 | ]); | |
| 392 | assert_eq!(first(cache.all::<compile::Std>()), &[ | |
| 393 | std!(A => A, stage = 0), | |
| 394 | std!(A => A, stage = 1), | |
| 395 | std!(A => A, stage = 2), | |
| 396 | std!(A => B, stage = 1), | |
| 397 | std!(A => B, stage = 2), | |
| 398 | ],); | |
| 429 | 399 | assert_eq!(first(cache.all::<dist::Src>()), &[dist::Src]); |
| 430 | 400 | } |
| 431 | 401 | |
| ... | ... | @@ -438,14 +408,13 @@ mod dist { |
| 438 | 408 | config.hosts = vec![b]; |
| 439 | 409 | let mut cache = run_build(&[], config); |
| 440 | 410 | |
| 441 | assert_eq!( | |
| 442 | first(cache.all::<dist::Rustc>()), | |
| 443 | &[dist::Rustc { compiler: Compiler { host: b, stage: 2 } },] | |
| 444 | ); | |
| 445 | assert_eq!( | |
| 446 | first(cache.all::<compile::Rustc>()), | |
| 447 | &[rustc!(A => A, stage = 0), rustc!(A => B, stage = 1),] | |
| 448 | ); | |
| 411 | assert_eq!(first(cache.all::<dist::Rustc>()), &[dist::Rustc { | |
| 412 | compiler: Compiler { host: b, stage: 2 } | |
| 413 | },]); | |
| 414 | assert_eq!(first(cache.all::<compile::Rustc>()), &[ | |
| 415 | rustc!(A => A, stage = 0), | |
| 416 | rustc!(A => B, stage = 1), | |
| 417 | ]); | |
| 449 | 418 | } |
| 450 | 419 | |
| 451 | 420 | #[test] |
| ... | ... | @@ -456,29 +425,25 @@ mod dist { |
| 456 | 425 | let b = TargetSelection::from_user("B-B"); |
| 457 | 426 | let c = TargetSelection::from_user("C-C"); |
| 458 | 427 | |
| 459 | assert_eq!( | |
| 460 | first(cache.all::<dist::Docs>()), | |
| 461 | &[dist::Docs { host: a }, dist::Docs { host: b }, dist::Docs { host: c },] | |
| 462 | ); | |
| 463 | assert_eq!( | |
| 464 | first(cache.all::<dist::Mingw>()), | |
| 465 | &[dist::Mingw { host: a }, dist::Mingw { host: b }, dist::Mingw { host: c },] | |
| 466 | ); | |
| 467 | assert_eq!( | |
| 468 | first(cache.all::<dist::Rustc>()), | |
| 469 | &[ | |
| 470 | dist::Rustc { compiler: Compiler { host: a, stage: 2 } }, | |
| 471 | dist::Rustc { compiler: Compiler { host: b, stage: 2 } }, | |
| 472 | ] | |
| 473 | ); | |
| 474 | assert_eq!( | |
| 475 | first(cache.all::<dist::Std>()), | |
| 476 | &[ | |
| 477 | dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, | |
| 478 | dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b }, | |
| 479 | dist::Std { compiler: Compiler { host: a, stage: 2 }, target: c }, | |
| 480 | ] | |
| 481 | ); | |
| 428 | assert_eq!(first(cache.all::<dist::Docs>()), &[ | |
| 429 | dist::Docs { host: a }, | |
| 430 | dist::Docs { host: b }, | |
| 431 | dist::Docs { host: c }, | |
| 432 | ]); | |
| 433 | assert_eq!(first(cache.all::<dist::Mingw>()), &[ | |
| 434 | dist::Mingw { host: a }, | |
| 435 | dist::Mingw { host: b }, | |
| 436 | dist::Mingw { host: c }, | |
| 437 | ]); | |
| 438 | assert_eq!(first(cache.all::<dist::Rustc>()), &[ | |
| 439 | dist::Rustc { compiler: Compiler { host: a, stage: 2 } }, | |
| 440 | dist::Rustc { compiler: Compiler { host: b, stage: 2 } }, | |
| 441 | ]); | |
| 442 | assert_eq!(first(cache.all::<dist::Std>()), &[ | |
| 443 | dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, | |
| 444 | dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b }, | |
| 445 | dist::Std { compiler: Compiler { host: a, stage: 2 }, target: c }, | |
| 446 | ]); | |
| 482 | 447 | assert_eq!(first(cache.all::<dist::Src>()), &[dist::Src]); |
| 483 | 448 | } |
| 484 | 449 | |
| ... | ... | @@ -492,10 +457,10 @@ mod dist { |
| 492 | 457 | |
| 493 | 458 | assert_eq!(first(cache.all::<dist::Docs>()), &[dist::Docs { host: c },]); |
| 494 | 459 | assert_eq!(first(cache.all::<dist::Mingw>()), &[dist::Mingw { host: c },]); |
| 495 | assert_eq!( | |
| 496 | first(cache.all::<dist::Std>()), | |
| 497 | &[dist::Std { compiler: Compiler { host: a, stage: 2 }, target: c },] | |
| 498 | ); | |
| 460 | assert_eq!(first(cache.all::<dist::Std>()), &[dist::Std { | |
| 461 | compiler: Compiler { host: a, stage: 2 }, | |
| 462 | target: c | |
| 463 | },]); | |
| 499 | 464 | } |
| 500 | 465 | |
| 501 | 466 | #[test] |
| ... | ... | @@ -505,81 +470,61 @@ mod dist { |
| 505 | 470 | let a = TargetSelection::from_user("A-A"); |
| 506 | 471 | let b = TargetSelection::from_user("B-B"); |
| 507 | 472 | |
| 508 | assert_eq!( | |
| 509 | first(cache.all::<dist::Docs>()), | |
| 510 | &[dist::Docs { host: a }, dist::Docs { host: b },] | |
| 511 | ); | |
| 512 | assert_eq!( | |
| 513 | first(cache.all::<dist::Mingw>()), | |
| 514 | &[dist::Mingw { host: a }, dist::Mingw { host: b },] | |
| 515 | ); | |
| 516 | assert_eq!( | |
| 517 | first(cache.all::<dist::Rustc>()), | |
| 518 | &[ | |
| 519 | dist::Rustc { compiler: Compiler { host: a, stage: 2 } }, | |
| 520 | dist::Rustc { compiler: Compiler { host: b, stage: 2 } }, | |
| 521 | ] | |
| 522 | ); | |
| 523 | assert_eq!( | |
| 524 | first(cache.all::<dist::Std>()), | |
| 525 | &[ | |
| 526 | dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, | |
| 527 | dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b }, | |
| 528 | ] | |
| 529 | ); | |
| 473 | assert_eq!(first(cache.all::<dist::Docs>()), &[dist::Docs { host: a }, dist::Docs { | |
| 474 | host: b | |
| 475 | },]); | |
| 476 | assert_eq!(first(cache.all::<dist::Mingw>()), &[dist::Mingw { host: a }, dist::Mingw { | |
| 477 | host: b | |
| 478 | },]); | |
| 479 | assert_eq!(first(cache.all::<dist::Rustc>()), &[ | |
| 480 | dist::Rustc { compiler: Compiler { host: a, stage: 2 } }, | |
| 481 | dist::Rustc { compiler: Compiler { host: b, stage: 2 } }, | |
| 482 | ]); | |
| 483 | assert_eq!(first(cache.all::<dist::Std>()), &[ | |
| 484 | dist::Std { compiler: Compiler { host: a, stage: 1 }, target: a }, | |
| 485 | dist::Std { compiler: Compiler { host: a, stage: 1 }, target: b }, | |
| 486 | ]); | |
| 530 | 487 | assert_eq!(first(cache.all::<dist::Src>()), &[dist::Src]); |
| 531 | assert_eq!( | |
| 532 | first(cache.all::<compile::Std>()), | |
| 533 | &[ | |
| 534 | std!(A => A, stage = 0), | |
| 535 | std!(A => A, stage = 1), | |
| 536 | std!(A => A, stage = 2), | |
| 537 | std!(A => B, stage = 1), | |
| 538 | std!(A => B, stage = 2), | |
| 539 | ] | |
| 540 | ); | |
| 541 | assert_eq!( | |
| 542 | first(cache.all::<compile::Assemble>()), | |
| 543 | &[ | |
| 544 | compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } }, | |
| 545 | compile::Assemble { target_compiler: Compiler { host: a, stage: 1 } }, | |
| 546 | compile::Assemble { target_compiler: Compiler { host: a, stage: 2 } }, | |
| 547 | compile::Assemble { target_compiler: Compiler { host: b, stage: 2 } }, | |
| 548 | ] | |
| 549 | ); | |
| 488 | assert_eq!(first(cache.all::<compile::Std>()), &[ | |
| 489 | std!(A => A, stage = 0), | |
| 490 | std!(A => A, stage = 1), | |
| 491 | std!(A => A, stage = 2), | |
| 492 | std!(A => B, stage = 1), | |
| 493 | std!(A => B, stage = 2), | |
| 494 | ]); | |
| 495 | assert_eq!(first(cache.all::<compile::Assemble>()), &[ | |
| 496 | compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } }, | |
| 497 | compile::Assemble { target_compiler: Compiler { host: a, stage: 1 } }, | |
| 498 | compile::Assemble { target_compiler: Compiler { host: a, stage: 2 } }, | |
| 499 | compile::Assemble { target_compiler: Compiler { host: b, stage: 2 } }, | |
| 500 | ]); | |
| 550 | 501 | } |
| 551 | 502 | |
| 552 | 503 | #[test] |
| 553 | 504 | fn build_all() { |
| 554 | 505 | let build = Build::new(configure(&["A-A", "B-B"], &["A-A", "B-B", "C-C"])); |
| 555 | 506 | let mut builder = Builder::new(&build); |
| 556 | builder.run_step_descriptions( | |
| 557 | &Builder::get_step_descriptions(Kind::Build), | |
| 558 | &["compiler/rustc".into(), "library".into()], | |
| 559 | ); | |
| 560 | ||
| 561 | assert_eq!( | |
| 562 | first(builder.cache.all::<compile::Std>()), | |
| 563 | &[ | |
| 564 | std!(A => A, stage = 0), | |
| 565 | std!(A => A, stage = 1), | |
| 566 | std!(A => A, stage = 2), | |
| 567 | std!(A => B, stage = 1), | |
| 568 | std!(A => B, stage = 2), | |
| 569 | std!(A => C, stage = 2), | |
| 570 | ] | |
| 571 | ); | |
| 507 | builder.run_step_descriptions(&Builder::get_step_descriptions(Kind::Build), &[ | |
| 508 | "compiler/rustc".into(), | |
| 509 | "library".into(), | |
| 510 | ]); | |
| 511 | ||
| 512 | assert_eq!(first(builder.cache.all::<compile::Std>()), &[ | |
| 513 | std!(A => A, stage = 0), | |
| 514 | std!(A => A, stage = 1), | |
| 515 | std!(A => A, stage = 2), | |
| 516 | std!(A => B, stage = 1), | |
| 517 | std!(A => B, stage = 2), | |
| 518 | std!(A => C, stage = 2), | |
| 519 | ]); | |
| 572 | 520 | assert_eq!(builder.cache.all::<compile::Assemble>().len(), 5); |
| 573 | assert_eq!( | |
| 574 | first(builder.cache.all::<compile::Rustc>()), | |
| 575 | &[ | |
| 576 | rustc!(A => A, stage = 0), | |
| 577 | rustc!(A => A, stage = 1), | |
| 578 | rustc!(A => A, stage = 2), | |
| 579 | rustc!(A => B, stage = 1), | |
| 580 | rustc!(A => B, stage = 2), | |
| 581 | ] | |
| 582 | ); | |
| 521 | assert_eq!(first(builder.cache.all::<compile::Rustc>()), &[ | |
| 522 | rustc!(A => A, stage = 0), | |
| 523 | rustc!(A => A, stage = 1), | |
| 524 | rustc!(A => A, stage = 2), | |
| 525 | rustc!(A => B, stage = 1), | |
| 526 | rustc!(A => B, stage = 2), | |
| 527 | ]); | |
| 583 | 528 | } |
| 584 | 529 | |
| 585 | 530 | #[test] |
| ... | ... | @@ -608,22 +553,20 @@ mod dist { |
| 608 | 553 | |
| 609 | 554 | let a = TargetSelection::from_user("A-A"); |
| 610 | 555 | |
| 611 | assert_eq!( | |
| 612 | first(builder.cache.all::<compile::Std>()), | |
| 613 | &[std!(A => A, stage = 0), std!(A => A, stage = 1), std!(A => C, stage = 2),] | |
| 614 | ); | |
| 615 | assert_eq!( | |
| 616 | first(builder.cache.all::<compile::Assemble>()), | |
| 617 | &[ | |
| 618 | compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } }, | |
| 619 | compile::Assemble { target_compiler: Compiler { host: a, stage: 1 } }, | |
| 620 | compile::Assemble { target_compiler: Compiler { host: a, stage: 2 } }, | |
| 621 | ] | |
| 622 | ); | |
| 623 | assert_eq!( | |
| 624 | first(builder.cache.all::<compile::Rustc>()), | |
| 625 | &[rustc!(A => A, stage = 0), rustc!(A => A, stage = 1),] | |
| 626 | ); | |
| 556 | assert_eq!(first(builder.cache.all::<compile::Std>()), &[ | |
| 557 | std!(A => A, stage = 0), | |
| 558 | std!(A => A, stage = 1), | |
| 559 | std!(A => C, stage = 2), | |
| 560 | ]); | |
| 561 | assert_eq!(first(builder.cache.all::<compile::Assemble>()), &[ | |
| 562 | compile::Assemble { target_compiler: Compiler { host: a, stage: 0 } }, | |
| 563 | compile::Assemble { target_compiler: Compiler { host: a, stage: 1 } }, | |
| 564 | compile::Assemble { target_compiler: Compiler { host: a, stage: 2 } }, | |
| 565 | ]); | |
| 566 | assert_eq!(first(builder.cache.all::<compile::Rustc>()), &[ | |
| 567 | rustc!(A => A, stage = 0), | |
| 568 | rustc!(A => A, stage = 1), | |
| 569 | ]); | |
| 627 | 570 | } |
| 628 | 571 | |
| 629 | 572 | #[test] |
| ... | ... | @@ -652,22 +595,18 @@ mod dist { |
| 652 | 595 | |
| 653 | 596 | let host = TargetSelection::from_user("A-A"); |
| 654 | 597 | |
| 655 | builder.run_step_descriptions( | |
| 656 | &[StepDescription::from::<test::Crate>(Kind::Test)], | |
| 657 | &["library/std".into()], | |
| 658 | ); | |
| 598 | builder.run_step_descriptions(&[StepDescription::from::<test::Crate>(Kind::Test)], &[ | |
| 599 | "library/std".into(), | |
| 600 | ]); | |
| 659 | 601 | |
| 660 | 602 | // Ensure we don't build any compiler artifacts. |
| 661 | 603 | assert!(!builder.cache.contains::<compile::Rustc>()); |
| 662 | assert_eq!( | |
| 663 | first(builder.cache.all::<test::Crate>()), | |
| 664 | &[test::Crate { | |
| 665 | compiler: Compiler { host, stage: 0 }, | |
| 666 | target: host, | |
| 667 | mode: Mode::Std, | |
| 668 | crates: vec!["std".to_owned()], | |
| 669 | },] | |
| 670 | ); | |
| 604 | assert_eq!(first(builder.cache.all::<test::Crate>()), &[test::Crate { | |
| 605 | compiler: Compiler { host, stage: 0 }, | |
| 606 | target: host, | |
| 607 | mode: Mode::Std, | |
| 608 | crates: vec!["std".to_owned()], | |
| 609 | },]); | |
| 671 | 610 | } |
| 672 | 611 | |
| 673 | 612 | #[test] |
| ... | ... | @@ -686,16 +625,14 @@ mod dist { |
| 686 | 625 | first(builder.cache.all::<doc::ErrorIndex>()), |
| 687 | 626 | &[doc::ErrorIndex { target: a },] |
| 688 | 627 | ); |
| 689 | assert_eq!( | |
| 690 | first(builder.cache.all::<tool::ErrorIndex>()), | |
| 691 | &[tool::ErrorIndex { compiler: Compiler { host: a, stage: 1 } }] | |
| 692 | ); | |
| 628 | assert_eq!(first(builder.cache.all::<tool::ErrorIndex>()), &[tool::ErrorIndex { | |
| 629 | compiler: Compiler { host: a, stage: 1 } | |
| 630 | }]); | |
| 693 | 631 | // This is actually stage 1, but Rustdoc::run swaps out the compiler with |
| 694 | 632 | // stage minus 1 if --stage is not 0. Very confusing! |
| 695 | assert_eq!( | |
| 696 | first(builder.cache.all::<tool::Rustdoc>()), | |
| 697 | &[tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } },] | |
| 698 | ); | |
| 633 | assert_eq!(first(builder.cache.all::<tool::Rustdoc>()), &[tool::Rustdoc { | |
| 634 | compiler: Compiler { host: a, stage: 2 } | |
| 635 | },]); | |
| 699 | 636 | } |
| 700 | 637 | |
| 701 | 638 | #[test] |
| ... | ... | @@ -731,10 +668,9 @@ mod dist { |
| 731 | 668 | first(builder.cache.all::<doc::ErrorIndex>()), |
| 732 | 669 | &[doc::ErrorIndex { target: a },] |
| 733 | 670 | ); |
| 734 | assert_eq!( | |
| 735 | first(builder.cache.all::<tool::ErrorIndex>()), | |
| 736 | &[tool::ErrorIndex { compiler: Compiler { host: a, stage: 1 } }] | |
| 737 | ); | |
| 671 | assert_eq!(first(builder.cache.all::<tool::ErrorIndex>()), &[tool::ErrorIndex { | |
| 672 | compiler: Compiler { host: a, stage: 1 } | |
| 673 | }]); | |
| 738 | 674 | // Unfortunately rustdoc is built twice. Once from stage1 for compiletest |
| 739 | 675 | // (and other things), and once from stage0 for std crates. Ideally it |
| 740 | 676 | // would only be built once. If someone wants to fix this, it might be |
| ... | ... | @@ -746,13 +682,10 @@ mod dist { |
| 746 | 682 | // The stage 0 copy is the one downloaded for bootstrapping. It is |
| 747 | 683 | // (currently) needed to run "cargo test" on the linkchecker, and |
| 748 | 684 | // should be relatively "free". |
| 749 | assert_eq!( | |
| 750 | first(builder.cache.all::<tool::Rustdoc>()), | |
| 751 | &[ | |
| 752 | tool::Rustdoc { compiler: Compiler { host: a, stage: 0 } }, | |
| 753 | tool::Rustdoc { compiler: Compiler { host: a, stage: 1 } }, | |
| 754 | tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } }, | |
| 755 | ] | |
| 756 | ); | |
| 685 | assert_eq!(first(builder.cache.all::<tool::Rustdoc>()), &[ | |
| 686 | tool::Rustdoc { compiler: Compiler { host: a, stage: 0 } }, | |
| 687 | tool::Rustdoc { compiler: Compiler { host: a, stage: 1 } }, | |
| 688 | tool::Rustdoc { compiler: Compiler { host: a, stage: 2 } }, | |
| 689 | ]); | |
| 757 | 690 | } |
| 758 | 691 | } |
src/bootstrap/src/core/config/config.rs+8-11| ... | ... | @@ -7,14 +7,14 @@ use std::cell::{Cell, RefCell}; |
| 7 | 7 | use std::collections::{HashMap, HashSet}; |
| 8 | 8 | use std::fmt::{self, Display}; |
| 9 | 9 | use std::io::IsTerminal; |
| 10 | use std::path::{absolute, Path, PathBuf}; | |
| 10 | use std::path::{Path, PathBuf, absolute}; | |
| 11 | 11 | use std::process::Command; |
| 12 | 12 | use std::str::FromStr; |
| 13 | 13 | use std::sync::OnceLock; |
| 14 | 14 | use std::{cmp, env, fs}; |
| 15 | 15 | |
| 16 | 16 | use build_helper::exit; |
| 17 | use build_helper::git::{get_closest_merge_commit, output_result, GitConfig}; | |
| 17 | use build_helper::git::{GitConfig, get_closest_merge_commit, output_result}; | |
| 18 | 18 | use serde::{Deserialize, Deserializer}; |
| 19 | 19 | use serde_derive::Deserialize; |
| 20 | 20 | |
| ... | ... | @@ -22,7 +22,7 @@ use crate::core::build_steps::compile::CODEGEN_BACKEND_PREFIX; |
| 22 | 22 | use crate::core::build_steps::llvm; |
| 23 | 23 | pub use crate::core::config::flags::Subcommand; |
| 24 | 24 | use crate::core::config::flags::{Color, Flags, Warnings}; |
| 25 | use crate::utils::cache::{Interned, INTERNER}; | |
| 25 | use crate::utils::cache::{INTERNER, Interned}; | |
| 26 | 26 | use crate::utils::channel::{self, GitInfo}; |
| 27 | 27 | use crate::utils::helpers::{self, exe, output, t}; |
| 28 | 28 | |
| ... | ... | @@ -1745,14 +1745,11 @@ impl Config { |
| 1745 | 1745 | config.rustc_default_linker = default_linker; |
| 1746 | 1746 | config.musl_root = musl_root.map(PathBuf::from); |
| 1747 | 1747 | config.save_toolstates = save_toolstates.map(PathBuf::from); |
| 1748 | set( | |
| 1749 | &mut config.deny_warnings, | |
| 1750 | match flags.warnings { | |
| 1751 | Warnings::Deny => Some(true), | |
| 1752 | Warnings::Warn => Some(false), | |
| 1753 | Warnings::Default => deny_warnings, | |
| 1754 | }, | |
| 1755 | ); | |
| 1748 | set(&mut config.deny_warnings, match flags.warnings { | |
| 1749 | Warnings::Deny => Some(true), | |
| 1750 | Warnings::Warn => Some(false), | |
| 1751 | Warnings::Default => deny_warnings, | |
| 1752 | }); | |
| 1756 | 1753 | set(&mut config.backtrace_on_ice, backtrace_on_ice); |
| 1757 | 1754 | set(&mut config.rust_verify_llvm_ir, verify_llvm_ir); |
| 1758 | 1755 | config.rust_thin_lto_import_instr_limit = thin_lto_import_instr_limit; |
src/bootstrap/src/core/config/flags.rs+1-1| ... | ... | @@ -9,7 +9,7 @@ use clap::{CommandFactory, Parser, ValueEnum}; |
| 9 | 9 | |
| 10 | 10 | use crate::core::build_steps::setup::Profile; |
| 11 | 11 | use crate::core::builder::{Builder, Kind}; |
| 12 | use crate::core::config::{target_selection_list, Config, TargetSelectionList}; | |
| 12 | use crate::core::config::{Config, TargetSelectionList, target_selection_list}; | |
| 13 | 13 | use crate::{Build, DocTests}; |
| 14 | 14 | |
| 15 | 15 | #[derive(Copy, Clone, Default, Debug, ValueEnum)] |
src/bootstrap/src/core/config/tests.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use std::env; |
| 2 | use std::fs::{remove_file, File}; | |
| 2 | use std::fs::{File, remove_file}; | |
| 3 | 3 | use std::io::Write; |
| 4 | 4 | use std::path::Path; |
| 5 | 5 |
src/bootstrap/src/core/download.rs+2-2| ... | ... | @@ -10,9 +10,9 @@ use build_helper::ci::CiEnv; |
| 10 | 10 | use xz2::bufread::XzDecoder; |
| 11 | 11 | |
| 12 | 12 | use crate::core::config::BUILDER_CONFIG_FILENAME; |
| 13 | use crate::utils::exec::{command, BootstrapCommand}; | |
| 13 | use crate::utils::exec::{BootstrapCommand, command}; | |
| 14 | 14 | use crate::utils::helpers::{check_run, exe, hex_encode, move_file, program_out_of_date}; |
| 15 | use crate::{t, Config}; | |
| 15 | use crate::{Config, t}; | |
| 16 | 16 | |
| 17 | 17 | static SHOULD_FIX_BINS_AND_DYLIBS: OnceLock<bool> = OnceLock::new(); |
| 18 | 18 |
src/bootstrap/src/core/metadata.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ use std::path::PathBuf; |
| 4 | 4 | use serde_derive::Deserialize; |
| 5 | 5 | |
| 6 | 6 | use crate::utils::exec::command; |
| 7 | use crate::{t, Build, Crate}; | |
| 7 | use crate::{Build, Crate, t}; | |
| 8 | 8 | |
| 9 | 9 | /// For more information, see the output of |
| 10 | 10 | /// <https://doc.rust-lang.org/nightly/cargo/commands/cargo-metadata.html> |
src/bootstrap/src/core/sanity.rs+1-1| ... | ... | @@ -15,6 +15,7 @@ use std::{env, fs}; |
| 15 | 15 | |
| 16 | 16 | use build_helper::git::warn_old_master_branch; |
| 17 | 17 | |
| 18 | use crate::Build; | |
| 18 | 19 | #[cfg(not(feature = "bootstrap-self-test"))] |
| 19 | 20 | use crate::builder::Builder; |
| 20 | 21 | use crate::builder::Kind; |
| ... | ... | @@ -22,7 +23,6 @@ use crate::builder::Kind; |
| 22 | 23 | use crate::core::build_steps::tool; |
| 23 | 24 | use crate::core::config::Target; |
| 24 | 25 | use crate::utils::exec::command; |
| 25 | use crate::Build; | |
| 26 | 26 | |
| 27 | 27 | pub struct Finder { |
| 28 | 28 | cache: HashMap<OsString, Option<PathBuf>>, |
src/bootstrap/src/lib.rs+4-4| ... | ... | @@ -35,8 +35,8 @@ use utils::helpers::hex_encode; |
| 35 | 35 | |
| 36 | 36 | use crate::core::builder; |
| 37 | 37 | use crate::core::builder::{Builder, Kind}; |
| 38 | use crate::core::config::{flags, DryRun, LldMode, LlvmLibunwind, Target, TargetSelection}; | |
| 39 | use crate::utils::exec::{command, BehaviorOnFailure, BootstrapCommand, CommandOutput, OutputMode}; | |
| 38 | use crate::core::config::{DryRun, LldMode, LlvmLibunwind, Target, TargetSelection, flags}; | |
| 39 | use crate::utils::exec::{BehaviorOnFailure, BootstrapCommand, CommandOutput, OutputMode, command}; | |
| 40 | 40 | use crate::utils::helpers::{ |
| 41 | 41 | self, dir_is_empty, exe, libdir, mtime, output, set_file_times, symlink_dir, |
| 42 | 42 | }; |
| ... | ... | @@ -45,11 +45,11 @@ mod core; |
| 45 | 45 | mod utils; |
| 46 | 46 | |
| 47 | 47 | pub use core::builder::PathSet; |
| 48 | pub use core::config::flags::{Flags, Subcommand}; | |
| 49 | 48 | pub use core::config::Config; |
| 49 | pub use core::config::flags::{Flags, Subcommand}; | |
| 50 | 50 | |
| 51 | 51 | pub use utils::change_tracker::{ |
| 52 | find_recent_config_change_ids, human_readable_changes, CONFIG_CHANGE_HISTORY, | |
| 52 | CONFIG_CHANGE_HISTORY, find_recent_config_change_ids, human_readable_changes, | |
| 53 | 53 | }; |
| 54 | 54 | |
| 55 | 55 | const LLVM_TOOLS: &[&str] = &[ |
src/bootstrap/src/utils/cc_detect.rs+1-1| ... | ... | @@ -26,7 +26,7 @@ use std::path::{Path, PathBuf}; |
| 26 | 26 | use std::{env, iter}; |
| 27 | 27 | |
| 28 | 28 | use crate::core::config::TargetSelection; |
| 29 | use crate::utils::exec::{command, BootstrapCommand}; | |
| 29 | use crate::utils::exec::{BootstrapCommand, command}; | |
| 30 | 30 | use crate::{Build, CLang, GitRepo}; |
| 31 | 31 | |
| 32 | 32 | // The `cc` crate doesn't provide a way to obtain a path to the detected archiver, |
src/bootstrap/src/utils/change_tracker/tests.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use crate::{find_recent_config_change_ids, CONFIG_CHANGE_HISTORY}; | |
| 1 | use crate::{CONFIG_CHANGE_HISTORY, find_recent_config_change_ids}; | |
| 2 | 2 | |
| 3 | 3 | #[test] |
| 4 | 4 | fn test_find_recent_config_change_ids() { |
src/bootstrap/src/utils/channel.rs+1-1| ... | ... | @@ -9,8 +9,8 @@ use std::fs; |
| 9 | 9 | use std::path::Path; |
| 10 | 10 | |
| 11 | 11 | use super::helpers; |
| 12 | use crate::utils::helpers::{output, t}; | |
| 13 | 12 | use crate::Build; |
| 13 | use crate::utils::helpers::{output, t}; | |
| 14 | 14 | |
| 15 | 15 | #[derive(Clone, Default)] |
| 16 | 16 | pub enum GitInfo { |
src/bootstrap/src/utils/helpers.rs+2-2| ... | ... | @@ -12,10 +12,10 @@ use std::{env, fs, io, str}; |
| 12 | 12 | |
| 13 | 13 | use build_helper::util::fail; |
| 14 | 14 | |
| 15 | use crate::LldMode; | |
| 15 | 16 | use crate::core::builder::Builder; |
| 16 | 17 | use crate::core::config::{Config, TargetSelection}; |
| 17 | 18 | pub use crate::utils::shared_helpers::{dylib_path, dylib_path_var}; |
| 18 | use crate::LldMode; | |
| 19 | 19 | |
| 20 | 20 | #[cfg(test)] |
| 21 | 21 | mod tests; |
| ... | ... | @@ -46,7 +46,7 @@ macro_rules! t { |
| 46 | 46 | } |
| 47 | 47 | pub use t; |
| 48 | 48 | |
| 49 | use crate::utils::exec::{command, BootstrapCommand}; | |
| 49 | use crate::utils::exec::{BootstrapCommand, command}; | |
| 50 | 50 | |
| 51 | 51 | pub fn exe(name: &str, target: TargetSelection) -> String { |
| 52 | 52 | crate::utils::shared_helpers::exe(name, &target.triple) |
src/bootstrap/src/utils/helpers/tests.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use std::fs::{self, remove_file, File}; | |
| 1 | use std::fs::{self, File, remove_file}; | |
| 2 | 2 | use std::io::Write; |
| 3 | 3 | use std::path::PathBuf; |
| 4 | 4 |
src/bootstrap/src/utils/job.rs+7-7| ... | ... | @@ -43,19 +43,19 @@ mod for_windows { |
| 43 | 43 | use std::ffi::c_void; |
| 44 | 44 | use std::{env, io, mem}; |
| 45 | 45 | |
| 46 | use windows::core::PCWSTR; | |
| 47 | use windows::Win32::Foundation::{CloseHandle, DuplicateHandle, DUPLICATE_SAME_ACCESS, HANDLE}; | |
| 46 | use windows::Win32::Foundation::{CloseHandle, DUPLICATE_SAME_ACCESS, DuplicateHandle, HANDLE}; | |
| 48 | 47 | use windows::Win32::System::Diagnostics::Debug::{ |
| 49 | SetErrorMode, SEM_NOGPFAULTERRORBOX, THREAD_ERROR_MODE, | |
| 48 | SEM_NOGPFAULTERRORBOX, SetErrorMode, THREAD_ERROR_MODE, | |
| 50 | 49 | }; |
| 51 | 50 | use windows::Win32::System::JobObjects::{ |
| 52 | AssignProcessToJobObject, CreateJobObjectW, JobObjectExtendedLimitInformation, | |
| 53 | SetInformationJobObject, JOBOBJECT_EXTENDED_LIMIT_INFORMATION, | |
| 54 | JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE, JOB_OBJECT_LIMIT_PRIORITY_CLASS, | |
| 51 | AssignProcessToJobObject, CreateJobObjectW, JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE, | |
| 52 | JOB_OBJECT_LIMIT_PRIORITY_CLASS, JOBOBJECT_EXTENDED_LIMIT_INFORMATION, | |
| 53 | JobObjectExtendedLimitInformation, SetInformationJobObject, | |
| 55 | 54 | }; |
| 56 | 55 | use windows::Win32::System::Threading::{ |
| 57 | GetCurrentProcess, OpenProcess, BELOW_NORMAL_PRIORITY_CLASS, PROCESS_DUP_HANDLE, | |
| 56 | BELOW_NORMAL_PRIORITY_CLASS, GetCurrentProcess, OpenProcess, PROCESS_DUP_HANDLE, | |
| 58 | 57 | }; |
| 58 | use windows::core::PCWSTR; | |
| 59 | 59 | |
| 60 | 60 | use crate::Build; |
| 61 | 61 |
src/bootstrap/src/utils/metrics.rs+1-1| ... | ... | @@ -15,9 +15,9 @@ use build_helper::metrics::{ |
| 15 | 15 | }; |
| 16 | 16 | use sysinfo::{CpuRefreshKind, RefreshKind, System}; |
| 17 | 17 | |
| 18 | use crate::Build; | |
| 18 | 19 | use crate::core::builder::{Builder, Step}; |
| 19 | 20 | use crate::utils::helpers::t; |
| 20 | use crate::Build; | |
| 21 | 21 | |
| 22 | 22 | // Update this number whenever a breaking change is made to the build metrics. |
| 23 | 23 | // |
src/ci/docker/host-x86_64/test-various/uefi_qemu_test/src/main.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ |
| 6 | 6 | |
| 7 | 7 | use core::{panic, ptr}; |
| 8 | 8 | |
| 9 | use r_efi::efi::{Char16, Handle, Status, SystemTable, RESET_SHUTDOWN}; | |
| 9 | use r_efi::efi::{Char16, Handle, RESET_SHUTDOWN, Status, SystemTable}; | |
| 10 | 10 | |
| 11 | 11 | #[panic_handler] |
| 12 | 12 | fn panic_handler(_info: &panic::PanicInfo) -> ! { |
src/etc/test-float-parse/src/gen/fuzz.rs+3-3| ... | ... | @@ -1,14 +1,14 @@ |
| 1 | use std::any::{type_name, TypeId}; | |
| 1 | use std::any::{TypeId, type_name}; | |
| 2 | 2 | use std::collections::BTreeMap; |
| 3 | 3 | use std::fmt::Write; |
| 4 | 4 | use std::marker::PhantomData; |
| 5 | 5 | use std::ops::Range; |
| 6 | 6 | use std::sync::Mutex; |
| 7 | 7 | |
| 8 | use rand::distributions::{Distribution, Standard}; | |
| 9 | 8 | use rand::Rng; |
| 10 | use rand_chacha::rand_core::SeedableRng; | |
| 9 | use rand::distributions::{Distribution, Standard}; | |
| 11 | 10 | use rand_chacha::ChaCha8Rng; |
| 11 | use rand_chacha::rand_core::SeedableRng; | |
| 12 | 12 | |
| 13 | 13 | use crate::{Float, Generator, Int, SEED}; |
| 14 | 14 |
src/etc/test-float-parse/src/lib.rs+2-2| ... | ... | @@ -2,12 +2,12 @@ mod traits; |
| 2 | 2 | mod ui; |
| 3 | 3 | mod validate; |
| 4 | 4 | |
| 5 | use std::any::{type_name, TypeId}; | |
| 5 | use std::any::{TypeId, type_name}; | |
| 6 | 6 | use std::cmp::min; |
| 7 | 7 | use std::ops::RangeInclusive; |
| 8 | 8 | use std::process::ExitCode; |
| 9 | 9 | use std::sync::atomic::{AtomicU64, Ordering}; |
| 10 | use std::sync::{mpsc, OnceLock}; | |
| 10 | use std::sync::{OnceLock, mpsc}; | |
| 11 | 11 | use std::{fmt, time}; |
| 12 | 12 | |
| 13 | 13 | use indicatif::{MultiProgress, ProgressBar}; |
src/etc/test-float-parse/src/traits.rs+1-1| ... | ... | @@ -3,8 +3,8 @@ |
| 3 | 3 | use std::str::FromStr; |
| 4 | 4 | use std::{fmt, ops}; |
| 5 | 5 | |
| 6 | use num::bigint::ToBigInt; | |
| 7 | 6 | use num::Integer; |
| 7 | use num::bigint::ToBigInt; | |
| 8 | 8 | |
| 9 | 9 | use crate::validate::Constants; |
| 10 | 10 |
src/librustdoc/clean/auto_trait.rs+3-3| ... | ... | @@ -4,14 +4,14 @@ use rustc_infer::infer::region_constraints::{Constraint, RegionConstraintData}; |
| 4 | 4 | use rustc_middle::bug; |
| 5 | 5 | use rustc_middle::ty::{self, Region, Ty}; |
| 6 | 6 | use rustc_span::def_id::DefId; |
| 7 | use rustc_span::symbol::{kw, Symbol}; | |
| 7 | use rustc_span::symbol::{Symbol, kw}; | |
| 8 | 8 | use rustc_trait_selection::traits::auto_trait::{self, RegionTarget}; |
| 9 | 9 | use thin_vec::ThinVec; |
| 10 | 10 | use tracing::{debug, instrument}; |
| 11 | 11 | |
| 12 | 12 | use crate::clean::{ |
| 13 | self, clean_generic_param_def, clean_middle_ty, clean_predicate, | |
| 14 | clean_trait_ref_with_constraints, clean_ty_generics, simplify, Lifetime, | |
| 13 | self, Lifetime, clean_generic_param_def, clean_middle_ty, clean_predicate, | |
| 14 | clean_trait_ref_with_constraints, clean_ty_generics, simplify, | |
| 15 | 15 | }; |
| 16 | 16 | use crate::core::DocContext; |
| 17 | 17 |
src/librustdoc/clean/blanket_impl.rs+1-1| ... | ... | @@ -2,8 +2,8 @@ use rustc_hir as hir; |
| 2 | 2 | use rustc_infer::infer::{DefineOpaqueTypes, InferOk, TyCtxtInferExt}; |
| 3 | 3 | use rustc_infer::traits; |
| 4 | 4 | use rustc_middle::ty::{self, Upcast}; |
| 5 | use rustc_span::def_id::DefId; | |
| 6 | 5 | use rustc_span::DUMMY_SP; |
| 6 | use rustc_span::def_id::DefId; | |
| 7 | 7 | use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt; |
| 8 | 8 | use thin_vec::ThinVec; |
| 9 | 9 | use tracing::{debug, instrument, trace}; |
src/librustdoc/clean/cfg.rs+1-1| ... | ... | @@ -10,8 +10,8 @@ use rustc_ast::{LitKind, MetaItem, MetaItemKind, NestedMetaItem}; |
| 10 | 10 | use rustc_data_structures::fx::FxHashSet; |
| 11 | 11 | use rustc_feature::Features; |
| 12 | 12 | use rustc_session::parse::ParseSess; |
| 13 | use rustc_span::symbol::{sym, Symbol}; | |
| 14 | 13 | use rustc_span::Span; |
| 14 | use rustc_span::symbol::{Symbol, sym}; | |
| 15 | 15 | |
| 16 | 16 | use crate::html::escape::Escape; |
| 17 | 17 |
src/librustdoc/clean/cfg/tests.rs+16-17| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use rustc_ast::{MetaItemLit, Path, Safety, StrStyle}; |
| 2 | use rustc_span::symbol::{kw, Ident}; | |
| 3 | use rustc_span::{create_default_session_globals_then, DUMMY_SP}; | |
| 2 | use rustc_span::symbol::{Ident, kw}; | |
| 3 | use rustc_span::{DUMMY_SP, create_default_session_globals_then}; | |
| 4 | 4 | use thin_vec::thin_vec; |
| 5 | 5 | |
| 6 | 6 | use super::*; |
| ... | ... | @@ -267,13 +267,10 @@ fn test_parse_ok() { |
| 267 | 267 | let mi = dummy_meta_item_list!(not, [a]); |
| 268 | 268 | assert_eq!(Cfg::parse(&mi), Ok(!word_cfg("a"))); |
| 269 | 269 | |
| 270 | let mi = dummy_meta_item_list!( | |
| 271 | not, | |
| 272 | [dummy_meta_item_list!( | |
| 273 | any, | |
| 274 | [dummy_meta_item_word("a"), dummy_meta_item_list!(all, [b, c]),] | |
| 275 | ),] | |
| 276 | ); | |
| 270 | let mi = dummy_meta_item_list!(not, [dummy_meta_item_list!(any, [ | |
| 271 | dummy_meta_item_word("a"), | |
| 272 | dummy_meta_item_list!(all, [b, c]), | |
| 273 | ]),]); | |
| 277 | 274 | assert_eq!(Cfg::parse(&mi), Ok(!(word_cfg("a") | (word_cfg("b") & word_cfg("c"))))); |
| 278 | 275 | |
| 279 | 276 | let mi = dummy_meta_item_list!(all, [a, b, c]); |
| ... | ... | @@ -296,16 +293,18 @@ fn test_parse_err() { |
| 296 | 293 | let mi = dummy_meta_item_list!(foo, []); |
| 297 | 294 | assert!(Cfg::parse(&mi).is_err()); |
| 298 | 295 | |
| 299 | let mi = dummy_meta_item_list!( | |
| 300 | all, | |
| 301 | [dummy_meta_item_list!(foo, []), dummy_meta_item_word("b"),] | |
| 302 | ); | |
| 296 | let mi = | |
| 297 | dummy_meta_item_list!( | |
| 298 | all, | |
| 299 | [dummy_meta_item_list!(foo, []), dummy_meta_item_word("b"),] | |
| 300 | ); | |
| 303 | 301 | assert!(Cfg::parse(&mi).is_err()); |
| 304 | 302 | |
| 305 | let mi = dummy_meta_item_list!( | |
| 306 | any, | |
| 307 | [dummy_meta_item_word("a"), dummy_meta_item_list!(foo, []),] | |
| 308 | ); | |
| 303 | let mi = | |
| 304 | dummy_meta_item_list!( | |
| 305 | any, | |
| 306 | [dummy_meta_item_word("a"), dummy_meta_item_list!(foo, []),] | |
| 307 | ); | |
| 309 | 308 | assert!(Cfg::parse(&mi).is_err()); |
| 310 | 309 | |
| 311 | 310 | let mi = dummy_meta_item_list!(not, [dummy_meta_item_list!(foo, []),]); |
src/librustdoc/clean/inline.rs+7-7| ... | ... | @@ -4,25 +4,25 @@ use std::iter::once; |
| 4 | 4 | use std::sync::Arc; |
| 5 | 5 | |
| 6 | 6 | use rustc_data_structures::fx::FxHashSet; |
| 7 | use rustc_hir::Mutability; | |
| 7 | 8 | use rustc_hir::def::{DefKind, Res}; |
| 8 | 9 | use rustc_hir::def_id::{DefId, DefIdSet, LocalDefId, LocalModDefId}; |
| 9 | use rustc_hir::Mutability; | |
| 10 | 10 | use rustc_metadata::creader::{CStore, LoadedMacro}; |
| 11 | 11 | use rustc_middle::ty::fast_reject::SimplifiedType; |
| 12 | 12 | use rustc_middle::ty::{self, TyCtxt}; |
| 13 | 13 | use rustc_span::def_id::LOCAL_CRATE; |
| 14 | 14 | use rustc_span::hygiene::MacroKind; |
| 15 | use rustc_span::symbol::{sym, Symbol}; | |
| 16 | use thin_vec::{thin_vec, ThinVec}; | |
| 15 | use rustc_span::symbol::{Symbol, sym}; | |
| 16 | use thin_vec::{ThinVec, thin_vec}; | |
| 17 | 17 | use tracing::{debug, trace}; |
| 18 | 18 | use {rustc_ast as ast, rustc_hir as hir}; |
| 19 | 19 | |
| 20 | 20 | use super::Item; |
| 21 | 21 | use crate::clean::{ |
| 22 | self, clean_bound_vars, clean_generics, clean_impl_item, clean_middle_assoc_item, | |
| 23 | clean_middle_field, clean_middle_ty, clean_poly_fn_sig, clean_trait_ref_with_constraints, | |
| 24 | clean_ty, clean_ty_alias_inner_type, clean_ty_generics, clean_variant_def, utils, Attributes, | |
| 25 | AttributesExt, ImplKind, ItemId, Type, | |
| 22 | self, Attributes, AttributesExt, ImplKind, ItemId, Type, clean_bound_vars, clean_generics, | |
| 23 | clean_impl_item, clean_middle_assoc_item, clean_middle_field, clean_middle_ty, | |
| 24 | clean_poly_fn_sig, clean_trait_ref_with_constraints, clean_ty, clean_ty_alias_inner_type, | |
| 25 | clean_ty_generics, clean_variant_def, utils, | |
| 26 | 26 | }; |
| 27 | 27 | use crate::core::DocContext; |
| 28 | 28 | use crate::formats::item_type::ItemType; |
src/librustdoc/clean/mod.rs+34-45| ... | ... | @@ -38,18 +38,18 @@ use rustc_ast::token::{Token, TokenKind}; |
| 38 | 38 | use rustc_ast::tokenstream::{TokenStream, TokenTree}; |
| 39 | 39 | use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap, FxIndexSet, IndexEntry}; |
| 40 | 40 | use rustc_errors::codes::*; |
| 41 | use rustc_errors::{struct_span_code_err, FatalError}; | |
| 42 | use rustc_hir::def::{CtorKind, DefKind, Res}; | |
| 43 | use rustc_hir::def_id::{DefId, DefIdMap, DefIdSet, LocalDefId, LOCAL_CRATE}; | |
| 41 | use rustc_errors::{FatalError, struct_span_code_err}; | |
| 44 | 42 | use rustc_hir::PredicateOrigin; |
| 43 | use rustc_hir::def::{CtorKind, DefKind, Res}; | |
| 44 | use rustc_hir::def_id::{DefId, DefIdMap, DefIdSet, LOCAL_CRATE, LocalDefId}; | |
| 45 | 45 | use rustc_hir_analysis::lower_ty; |
| 46 | 46 | use rustc_middle::metadata::Reexport; |
| 47 | 47 | use rustc_middle::middle::resolve_bound_vars as rbv; |
| 48 | 48 | use rustc_middle::ty::{self, AdtKind, GenericArgsRef, Ty, TyCtxt, TypeVisitableExt}; |
| 49 | 49 | use rustc_middle::{bug, span_bug}; |
| 50 | use rustc_span::hygiene::{AstPass, MacroKind}; | |
| 51 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 52 | 50 | use rustc_span::ExpnKind; |
| 51 | use rustc_span::hygiene::{AstPass, MacroKind}; | |
| 52 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 53 | 53 | use rustc_trait_selection::traits::wf::object_region_bounds; |
| 54 | 54 | use thin_vec::ThinVec; |
| 55 | 55 | use tracing::{debug, instrument}; |
| ... | ... | @@ -536,18 +536,14 @@ fn clean_generic_param_def( |
| 536 | 536 | } else { |
| 537 | 537 | None |
| 538 | 538 | }; |
| 539 | ( | |
| 540 | def.name, | |
| 541 | GenericParamDefKind::Type { | |
| 542 | bounds: ThinVec::new(), // These are filled in from the where-clauses. | |
| 543 | default: default.map(Box::new), | |
| 544 | synthetic, | |
| 545 | }, | |
| 546 | ) | |
| 539 | (def.name, GenericParamDefKind::Type { | |
| 540 | bounds: ThinVec::new(), // These are filled in from the where-clauses. | |
| 541 | default: default.map(Box::new), | |
| 542 | synthetic, | |
| 543 | }) | |
| 547 | 544 | } |
| 548 | ty::GenericParamDefKind::Const { has_default, synthetic, is_host_effect: _ } => ( | |
| 549 | def.name, | |
| 550 | GenericParamDefKind::Const { | |
| 545 | ty::GenericParamDefKind::Const { has_default, synthetic, is_host_effect: _ } => { | |
| 546 | (def.name, GenericParamDefKind::Const { | |
| 551 | 547 | ty: Box::new(clean_middle_ty( |
| 552 | 548 | ty::Binder::dummy( |
| 553 | 549 | cx.tcx |
| ... | ... | @@ -569,8 +565,8 @@ fn clean_generic_param_def( |
| 569 | 565 | None |
| 570 | 566 | }, |
| 571 | 567 | synthetic, |
| 572 | }, | |
| 573 | ), | |
| 568 | }) | |
| 569 | } | |
| 574 | 570 | }; |
| 575 | 571 | |
| 576 | 572 | GenericParamDef { name, def_id: def.def_id, kind } |
| ... | ... | @@ -615,25 +611,21 @@ fn clean_generic_param<'tcx>( |
| 615 | 611 | } else { |
| 616 | 612 | ThinVec::new() |
| 617 | 613 | }; |
| 618 | ( | |
| 619 | param.name.ident().name, | |
| 620 | GenericParamDefKind::Type { | |
| 621 | bounds, | |
| 622 | default: default.map(|t| clean_ty(t, cx)).map(Box::new), | |
| 623 | synthetic, | |
| 624 | }, | |
| 625 | ) | |
| 614 | (param.name.ident().name, GenericParamDefKind::Type { | |
| 615 | bounds, | |
| 616 | default: default.map(|t| clean_ty(t, cx)).map(Box::new), | |
| 617 | synthetic, | |
| 618 | }) | |
| 626 | 619 | } |
| 627 | hir::GenericParamKind::Const { ty, default, synthetic, is_host_effect: _ } => ( | |
| 628 | param.name.ident().name, | |
| 629 | GenericParamDefKind::Const { | |
| 620 | hir::GenericParamKind::Const { ty, default, synthetic, is_host_effect: _ } => { | |
| 621 | (param.name.ident().name, GenericParamDefKind::Const { | |
| 630 | 622 | ty: Box::new(clean_ty(ty, cx)), |
| 631 | 623 | default: default.map(|ct| { |
| 632 | 624 | Box::new(ty::Const::from_const_arg(cx.tcx, ct, ty::FeedConstTy::No).to_string()) |
| 633 | 625 | }), |
| 634 | 626 | synthetic, |
| 635 | }, | |
| 636 | ), | |
| 627 | }) | |
| 628 | } | |
| 637 | 629 | }; |
| 638 | 630 | |
| 639 | 631 | GenericParamDef { name, def_id: param.def_id.to_def_id(), kind } |
| ... | ... | @@ -653,10 +645,9 @@ fn is_impl_trait(param: &hir::GenericParam<'_>) -> bool { |
| 653 | 645 | /// |
| 654 | 646 | /// See `lifetime_to_generic_param` in `rustc_ast_lowering` for more information. |
| 655 | 647 | fn is_elided_lifetime(param: &hir::GenericParam<'_>) -> bool { |
| 656 | matches!( | |
| 657 | param.kind, | |
| 658 | hir::GenericParamKind::Lifetime { kind: hir::LifetimeParamKind::Elided(_) } | |
| 659 | ) | |
| 648 | matches!(param.kind, hir::GenericParamKind::Lifetime { | |
| 649 | kind: hir::LifetimeParamKind::Elided(_) | |
| 650 | }) | |
| 660 | 651 | } |
| 661 | 652 | |
| 662 | 653 | pub(crate) fn clean_generics<'tcx>( |
| ... | ... | @@ -1055,10 +1046,11 @@ fn clean_fn_decl_legacy_const_generics(func: &mut Function, attrs: &[ast::Attrib |
| 1055 | 1046 | .. |
| 1056 | 1047 | } = param |
| 1057 | 1048 | { |
| 1058 | func.decl | |
| 1059 | .inputs | |
| 1060 | .values | |
| 1061 | .insert(a.get() as _, Argument { name, type_: *ty, is_const: true }); | |
| 1049 | func.decl.inputs.values.insert(a.get() as _, Argument { | |
| 1050 | name, | |
| 1051 | type_: *ty, | |
| 1052 | is_const: true, | |
| 1053 | }); | |
| 1062 | 1054 | } else { |
| 1063 | 1055 | panic!("unexpected non const in position {pos}"); |
| 1064 | 1056 | } |
| ... | ... | @@ -1402,15 +1394,12 @@ pub(crate) fn clean_middle_assoc_item(assoc_item: &ty::AssocItem, cx: &mut DocCo |
| 1402 | 1394 | let bounds = tcx.explicit_item_bounds(assoc_item.def_id).iter_identity_copied(); |
| 1403 | 1395 | predicates = tcx.arena.alloc_from_iter(bounds.chain(predicates.iter().copied())); |
| 1404 | 1396 | } |
| 1405 | let mut generics = clean_ty_generics( | |
| 1406 | cx, | |
| 1407 | tcx.generics_of(assoc_item.def_id), | |
| 1408 | ty::GenericPredicates { | |
| 1397 | let mut generics = | |
| 1398 | clean_ty_generics(cx, tcx.generics_of(assoc_item.def_id), ty::GenericPredicates { | |
| 1409 | 1399 | parent: None, |
| 1410 | 1400 | predicates, |
| 1411 | 1401 | effects_min_tys: ty::List::empty(), |
| 1412 | }, | |
| 1413 | ); | |
| 1402 | }); | |
| 1414 | 1403 | simplify::move_bounds_to_generic_parameters(&mut generics); |
| 1415 | 1404 | |
| 1416 | 1405 | if let ty::TraitContainer = assoc_item.container { |
src/librustdoc/clean/render_macro_matchers.rs+2-2| ... | ... | @@ -1,11 +1,11 @@ |
| 1 | 1 | use rustc_ast::token::{self, BinOpToken, Delimiter, IdentIsRaw}; |
| 2 | 2 | use rustc_ast::tokenstream::{TokenStream, TokenTree}; |
| 3 | use rustc_ast_pretty::pprust::state::State as Printer; | |
| 4 | 3 | use rustc_ast_pretty::pprust::PrintState; |
| 4 | use rustc_ast_pretty::pprust::state::State as Printer; | |
| 5 | 5 | use rustc_middle::ty::TyCtxt; |
| 6 | 6 | use rustc_session::parse::ParseSess; |
| 7 | use rustc_span::symbol::{kw, Ident, Symbol}; | |
| 8 | 7 | use rustc_span::Span; |
| 8 | use rustc_span::symbol::{Ident, Symbol, kw}; | |
| 9 | 9 | |
| 10 | 10 | /// Render a macro matcher in a format suitable for displaying to the user |
| 11 | 11 | /// as part of an item declaration. |
src/librustdoc/clean/types.rs+13-9| ... | ... | @@ -12,7 +12,7 @@ use rustc_attr::{ConstStability, Deprecation, Stability, StabilityLevel, StableS |
| 12 | 12 | use rustc_const_eval::const_eval::is_unstable_const_fn; |
| 13 | 13 | use rustc_data_structures::fx::{FxHashMap, FxHashSet}; |
| 14 | 14 | use rustc_hir::def::{CtorKind, DefKind, Res}; |
| 15 | use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE}; | |
| 15 | use rustc_hir::def_id::{CrateNum, DefId, LOCAL_CRATE, LocalDefId}; | |
| 16 | 16 | use rustc_hir::lang_items::LangItem; |
| 17 | 17 | use rustc_hir::{BodyId, Mutability}; |
| 18 | 18 | use rustc_hir_analysis::check::intrinsic::intrinsic_operation_unsafety; |
| ... | ... | @@ -22,12 +22,12 @@ use rustc_middle::span_bug; |
| 22 | 22 | use rustc_middle::ty::fast_reject::SimplifiedType; |
| 23 | 23 | use rustc_middle::ty::{self, TyCtxt, Visibility}; |
| 24 | 24 | use rustc_resolve::rustdoc::{ |
| 25 | add_doc_fragment, attrs_to_doc_fragments, inner_docs, span_of_fragments, DocFragment, | |
| 25 | DocFragment, add_doc_fragment, attrs_to_doc_fragments, inner_docs, span_of_fragments, | |
| 26 | 26 | }; |
| 27 | 27 | use rustc_session::Session; |
| 28 | 28 | use rustc_span::hygiene::MacroKind; |
| 29 | use rustc_span::symbol::{kw, sym, Ident, Symbol}; | |
| 30 | use rustc_span::{FileName, Loc, DUMMY_SP}; | |
| 29 | use rustc_span::symbol::{Ident, Symbol, kw, sym}; | |
| 30 | use rustc_span::{DUMMY_SP, FileName, Loc}; | |
| 31 | 31 | use rustc_target::abi::VariantIdx; |
| 32 | 32 | use rustc_target::spec::abi::Abi; |
| 33 | 33 | use thin_vec::ThinVec; |
| ... | ... | @@ -1064,10 +1064,14 @@ impl AttributesExt for [ast::Attribute] { |
| 1064 | 1064 | } |
| 1065 | 1065 | |
| 1066 | 1066 | impl AttributesExt for [(Cow<'_, ast::Attribute>, Option<DefId>)] { |
| 1067 | type AttributeIterator<'a> = impl Iterator<Item = ast::NestedMetaItem> + 'a | |
| 1068 | where Self: 'a; | |
| 1069 | type Attributes<'a> = impl Iterator<Item = &'a ast::Attribute> + 'a | |
| 1070 | where Self: 'a; | |
| 1067 | type AttributeIterator<'a> | |
| 1068 | = impl Iterator<Item = ast::NestedMetaItem> + 'a | |
| 1069 | where | |
| 1070 | Self: 'a; | |
| 1071 | type Attributes<'a> | |
| 1072 | = impl Iterator<Item = &'a ast::Attribute> + 'a | |
| 1073 | where | |
| 1074 | Self: 'a; | |
| 1071 | 1075 | |
| 1072 | 1076 | fn lists(&self, name: Symbol) -> Self::AttributeIterator<'_> { |
| 1073 | 1077 | AttributesExt::iter(self) |
| ... | ... | @@ -1809,8 +1813,8 @@ impl PrimitiveType { |
| 1809 | 1813 | } |
| 1810 | 1814 | |
| 1811 | 1815 | pub(crate) fn simplified_types() -> &'static SimplifiedTypes { |
| 1812 | use ty::{FloatTy, IntTy, UintTy}; | |
| 1813 | 1816 | use PrimitiveType::*; |
| 1817 | use ty::{FloatTy, IntTy, UintTy}; | |
| 1814 | 1818 | static CELL: OnceCell<SimplifiedTypes> = OnceCell::new(); |
| 1815 | 1819 | |
| 1816 | 1820 | let single = |x| iter::once(x).collect(); |
src/librustdoc/clean/types/tests.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use rustc_resolve::rustdoc::{unindent_doc_fragments, DocFragmentKind}; | |
| 1 | use rustc_resolve::rustdoc::{DocFragmentKind, unindent_doc_fragments}; | |
| 2 | 2 | use rustc_span::create_default_session_globals_then; |
| 3 | 3 | |
| 4 | 4 | use super::*; |
src/librustdoc/clean/utils.rs+5-5| ... | ... | @@ -5,12 +5,12 @@ use std::sync::LazyLock as Lazy; |
| 5 | 5 | |
| 6 | 6 | use rustc_ast::tokenstream::TokenTree; |
| 7 | 7 | use rustc_hir::def::{DefKind, Res}; |
| 8 | use rustc_hir::def_id::{DefId, LocalDefId, LOCAL_CRATE}; | |
| 8 | use rustc_hir::def_id::{DefId, LOCAL_CRATE, LocalDefId}; | |
| 9 | 9 | use rustc_metadata::rendered_const; |
| 10 | 10 | use rustc_middle::mir; |
| 11 | 11 | use rustc_middle::ty::{self, GenericArgKind, GenericArgsRef, TyCtxt, TypeVisitableExt}; |
| 12 | use rustc_span::symbol::{kw, sym, Symbol}; | |
| 13 | use thin_vec::{thin_vec, ThinVec}; | |
| 12 | use rustc_span::symbol::{Symbol, kw, sym}; | |
| 13 | use thin_vec::{ThinVec, thin_vec}; | |
| 14 | 14 | use tracing::{debug, warn}; |
| 15 | 15 | use {rustc_ast as ast, rustc_hir as hir}; |
| 16 | 16 | |
| ... | ... | @@ -18,10 +18,10 @@ use crate::clean::auto_trait::synthesize_auto_trait_impls; |
| 18 | 18 | use crate::clean::blanket_impl::synthesize_blanket_impls; |
| 19 | 19 | use crate::clean::render_macro_matchers::render_macro_matcher; |
| 20 | 20 | use crate::clean::{ |
| 21 | clean_doc_module, clean_middle_const, clean_middle_region, clean_middle_ty, inline, | |
| 22 | 21 | AssocItemConstraint, AssocItemConstraintKind, Crate, ExternalCrate, Generic, GenericArg, |
| 23 | 22 | GenericArgs, ImportSource, Item, ItemKind, Lifetime, Path, PathSegment, Primitive, |
| 24 | PrimitiveType, Term, Type, | |
| 23 | PrimitiveType, Term, Type, clean_doc_module, clean_middle_const, clean_middle_region, | |
| 24 | clean_middle_ty, inline, | |
| 25 | 25 | }; |
| 26 | 26 | use crate::core::DocContext; |
| 27 | 27 | use crate::html::format::visibility_to_src_with_space; |
src/librustdoc/config.rs+5-5| ... | ... | @@ -8,15 +8,15 @@ use std::{fmt, io}; |
| 8 | 8 | use rustc_data_structures::fx::FxHashMap; |
| 9 | 9 | use rustc_errors::DiagCtxtHandle; |
| 10 | 10 | use rustc_session::config::{ |
| 11 | self, get_cmd_lint_options, nightly_options, parse_crate_types_from_list, parse_externs, | |
| 12 | parse_target_triple, CodegenOptions, CrateType, ErrorOutputType, Externs, Input, | |
| 13 | JsonUnusedExterns, UnstableOptions, | |
| 11 | self, CodegenOptions, CrateType, ErrorOutputType, Externs, Input, JsonUnusedExterns, | |
| 12 | UnstableOptions, get_cmd_lint_options, nightly_options, parse_crate_types_from_list, | |
| 13 | parse_externs, parse_target_triple, | |
| 14 | 14 | }; |
| 15 | 15 | use rustc_session::lint::Level; |
| 16 | 16 | use rustc_session::search_paths::SearchPath; |
| 17 | use rustc_session::{getopts, EarlyDiagCtxt}; | |
| 18 | use rustc_span::edition::Edition; | |
| 17 | use rustc_session::{EarlyDiagCtxt, getopts}; | |
| 19 | 18 | use rustc_span::FileName; |
| 19 | use rustc_span::edition::Edition; | |
| 20 | 20 | use rustc_target::spec::TargetTriple; |
| 21 | 21 | |
| 22 | 22 | use crate::core::new_dcx; |
src/librustdoc/core.rs+4-4| ... | ... | @@ -8,7 +8,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet}; |
| 8 | 8 | use rustc_data_structures::sync::Lrc; |
| 9 | 9 | use rustc_data_structures::unord::UnordSet; |
| 10 | 10 | use rustc_errors::codes::*; |
| 11 | use rustc_errors::emitter::{stderr_destination, DynEmitter, HumanEmitter}; | |
| 11 | use rustc_errors::emitter::{DynEmitter, HumanEmitter, stderr_destination}; | |
| 12 | 12 | use rustc_errors::json::JsonEmitter; |
| 13 | 13 | use rustc_errors::{DiagCtxtHandle, ErrorGuaranteed, TerminalUrl}; |
| 14 | 14 | use rustc_feature::UnstableFeatures; |
| ... | ... | @@ -17,14 +17,14 @@ use rustc_hir::def_id::{DefId, DefIdMap, DefIdSet, LocalDefId}; |
| 17 | 17 | use rustc_hir::intravisit::{self, Visitor}; |
| 18 | 18 | use rustc_hir::{HirId, Path}; |
| 19 | 19 | use rustc_interface::interface; |
| 20 | use rustc_lint::{late_lint_mod, MissingDoc}; | |
| 20 | use rustc_lint::{MissingDoc, late_lint_mod}; | |
| 21 | 21 | use rustc_middle::hir::nested_filter; |
| 22 | 22 | use rustc_middle::ty::{ParamEnv, Ty, TyCtxt}; |
| 23 | 23 | use rustc_session::config::{self, CrateType, ErrorOutputType, Input, ResolveDocLinks}; |
| 24 | 24 | pub(crate) use rustc_session::config::{Options, UnstableOptions}; |
| 25 | use rustc_session::{lint, Session}; | |
| 25 | use rustc_session::{Session, lint}; | |
| 26 | 26 | use rustc_span::symbol::sym; |
| 27 | use rustc_span::{source_map, Span}; | |
| 27 | use rustc_span::{Span, source_map}; | |
| 28 | 28 | use tracing::{debug, info}; |
| 29 | 29 | |
| 30 | 30 | use crate::clean::inline::build_external_trait; |
src/librustdoc/doctest.rs+2-2| ... | ... | @@ -16,14 +16,14 @@ pub(crate) use markdown::test as test_markdown; |
| 16 | 16 | use rustc_ast as ast; |
| 17 | 17 | use rustc_data_structures::fx::{FxHashMap, FxHashSet}; |
| 18 | 18 | use rustc_errors::{ColorConfig, DiagCtxtHandle, ErrorGuaranteed, FatalError}; |
| 19 | use rustc_hir::def_id::LOCAL_CRATE; | |
| 20 | 19 | use rustc_hir::CRATE_HIR_ID; |
| 20 | use rustc_hir::def_id::LOCAL_CRATE; | |
| 21 | 21 | use rustc_interface::interface; |
| 22 | 22 | use rustc_session::config::{self, CrateType, ErrorOutputType, Input}; |
| 23 | 23 | use rustc_session::lint; |
| 24 | use rustc_span::FileName; | |
| 24 | 25 | use rustc_span::edition::Edition; |
| 25 | 26 | use rustc_span::symbol::sym; |
| 26 | use rustc_span::FileName; | |
| 27 | 27 | use rustc_target::spec::{Target, TargetTriple}; |
| 28 | 28 | use tempfile::{Builder as TempFileBuilder, TempDir}; |
| 29 | 29 | use tracing::debug; |
src/librustdoc/doctest/make.rs+3-3| ... | ... | @@ -10,10 +10,10 @@ use rustc_errors::{ColorConfig, FatalError}; |
| 10 | 10 | use rustc_parse::new_parser_from_source_str; |
| 11 | 11 | use rustc_parse::parser::attr::InnerAttrPolicy; |
| 12 | 12 | use rustc_session::parse::ParseSess; |
| 13 | use rustc_span::FileName; | |
| 13 | 14 | use rustc_span::edition::Edition; |
| 14 | 15 | use rustc_span::source_map::SourceMap; |
| 15 | 16 | use rustc_span::symbol::sym; |
| 16 | use rustc_span::FileName; | |
| 17 | 17 | use tracing::debug; |
| 18 | 18 | |
| 19 | 19 | use super::GlobalTestOptions; |
| ... | ... | @@ -252,8 +252,8 @@ fn parse_source( |
| 252 | 252 | info: &mut ParseSourceInfo, |
| 253 | 253 | crate_name: &Option<&str>, |
| 254 | 254 | ) -> ParsingResult { |
| 255 | use rustc_errors::emitter::{Emitter, HumanEmitter}; | |
| 256 | 255 | use rustc_errors::DiagCtxt; |
| 256 | use rustc_errors::emitter::{Emitter, HumanEmitter}; | |
| 257 | 257 | use rustc_parse::parser::ForceCollect; |
| 258 | 258 | use rustc_span::source_map::FilePathMapping; |
| 259 | 259 | |
| ... | ... | @@ -441,8 +441,8 @@ fn check_if_attr_is_complete(source: &str, edition: Edition) -> Option<AttrKind> |
| 441 | 441 | |
| 442 | 442 | rustc_driver::catch_fatal_errors(|| { |
| 443 | 443 | rustc_span::create_session_if_not_set_then(edition, |_| { |
| 444 | use rustc_errors::emitter::HumanEmitter; | |
| 445 | 444 | use rustc_errors::DiagCtxt; |
| 445 | use rustc_errors::emitter::HumanEmitter; | |
| 446 | 446 | use rustc_span::source_map::FilePathMapping; |
| 447 | 447 | |
| 448 | 448 | let filename = FileName::anon_source_code(source); |
src/librustdoc/doctest/markdown.rs+2-2| ... | ... | @@ -8,10 +8,10 @@ use rustc_span::FileName; |
| 8 | 8 | use tempfile::tempdir; |
| 9 | 9 | |
| 10 | 10 | use super::{ |
| 11 | generate_args_file, CreateRunnableDocTests, DocTestVisitor, GlobalTestOptions, ScrapedDocTest, | |
| 11 | CreateRunnableDocTests, DocTestVisitor, GlobalTestOptions, ScrapedDocTest, generate_args_file, | |
| 12 | 12 | }; |
| 13 | 13 | use crate::config::Options; |
| 14 | use crate::html::markdown::{find_testable_code, ErrorCodes, LangString, MdRelLine}; | |
| 14 | use crate::html::markdown::{ErrorCodes, LangString, MdRelLine, find_testable_code}; | |
| 15 | 15 | |
| 16 | 16 | struct MdCollector { |
| 17 | 17 | tests: Vec<ScrapedDocTest>, |
src/librustdoc/doctest/runner.rs+2-2| ... | ... | @@ -4,8 +4,8 @@ use rustc_data_structures::fx::FxHashSet; |
| 4 | 4 | use rustc_span::edition::Edition; |
| 5 | 5 | |
| 6 | 6 | use crate::doctest::{ |
| 7 | run_test, DocTestBuilder, GlobalTestOptions, IndividualTestOptions, RunnableDocTest, | |
| 8 | RustdocOptions, ScrapedDocTest, TestFailure, UnusedExterns, | |
| 7 | DocTestBuilder, GlobalTestOptions, IndividualTestOptions, RunnableDocTest, RustdocOptions, | |
| 8 | ScrapedDocTest, TestFailure, UnusedExterns, run_test, | |
| 9 | 9 | }; |
| 10 | 10 | use crate::html::markdown::{Ignore, LangString}; |
| 11 | 11 |
src/librustdoc/doctest/rust.rs+4-4| ... | ... | @@ -4,19 +4,19 @@ use std::env; |
| 4 | 4 | |
| 5 | 5 | use rustc_data_structures::fx::FxHashSet; |
| 6 | 6 | use rustc_data_structures::sync::Lrc; |
| 7 | use rustc_hir::def_id::{LocalDefId, CRATE_DEF_ID}; | |
| 8 | use rustc_hir::{self as hir, intravisit, CRATE_HIR_ID}; | |
| 7 | use rustc_hir::def_id::{CRATE_DEF_ID, LocalDefId}; | |
| 8 | use rustc_hir::{self as hir, CRATE_HIR_ID, intravisit}; | |
| 9 | 9 | use rustc_middle::hir::map::Map; |
| 10 | 10 | use rustc_middle::hir::nested_filter; |
| 11 | 11 | use rustc_middle::ty::TyCtxt; |
| 12 | 12 | use rustc_resolve::rustdoc::span_of_fragments; |
| 13 | 13 | use rustc_session::Session; |
| 14 | 14 | use rustc_span::source_map::SourceMap; |
| 15 | use rustc_span::{BytePos, FileName, Pos, Span, DUMMY_SP}; | |
| 15 | use rustc_span::{BytePos, DUMMY_SP, FileName, Pos, Span}; | |
| 16 | 16 | |
| 17 | 17 | use super::{DocTestVisitor, ScrapedDocTest}; |
| 18 | use crate::clean::types::AttributesExt; | |
| 19 | 18 | use crate::clean::Attributes; |
| 19 | use crate::clean::types::AttributesExt; | |
| 20 | 20 | use crate::html::markdown::{self, ErrorCodes, LangString, MdRelLine}; |
| 21 | 21 | |
| 22 | 22 | struct RustCollector { |
src/librustdoc/formats/cache.rs+2-2| ... | ... | @@ -10,12 +10,12 @@ use crate::clean::types::ExternalLocation; |
| 10 | 10 | use crate::clean::{self, ExternalCrate, ItemId, PrimitiveType}; |
| 11 | 11 | use crate::core::DocContext; |
| 12 | 12 | use crate::fold::DocFolder; |
| 13 | use crate::formats::item_type::ItemType; | |
| 14 | 13 | use crate::formats::Impl; |
| 14 | use crate::formats::item_type::ItemType; | |
| 15 | 15 | use crate::html::format::join_with_double_colon; |
| 16 | 16 | use crate::html::markdown::short_markdown_summary; |
| 17 | use crate::html::render::search_index::get_function_type_for_search; | |
| 18 | 17 | use crate::html::render::IndexItem; |
| 18 | use crate::html::render::search_index::get_function_type_for_search; | |
| 19 | 19 | use crate::visit_lib::RustdocEffectiveVisibilities; |
| 20 | 20 | |
| 21 | 21 | /// This cache is used to store information about the [`clean::Crate`] being |
src/librustdoc/formats/mod.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ pub(crate) mod cache; |
| 2 | 2 | pub(crate) mod item_type; |
| 3 | 3 | pub(crate) mod renderer; |
| 4 | 4 | |
| 5 | pub(crate) use renderer::{run_format, FormatRenderer}; | |
| 5 | pub(crate) use renderer::{FormatRenderer, run_format}; | |
| 6 | 6 | use rustc_hir::def_id::DefId; |
| 7 | 7 | |
| 8 | 8 | use crate::clean::{self, ItemId}; |
src/librustdoc/html/format.rs+2-2| ... | ... | @@ -22,12 +22,12 @@ use rustc_metadata::creader::{CStore, LoadedMacro}; |
| 22 | 22 | use rustc_middle::ty; |
| 23 | 23 | use rustc_middle::ty::TyCtxt; |
| 24 | 24 | use rustc_span::symbol::kw; |
| 25 | use rustc_span::{sym, Symbol}; | |
| 25 | use rustc_span::{Symbol, sym}; | |
| 26 | 26 | use rustc_target::spec::abi::Abi; |
| 27 | 27 | use tracing::{debug, trace}; |
| 28 | 28 | use {rustc_ast as ast, rustc_hir as hir}; |
| 29 | 29 | |
| 30 | use super::url_parts_builder::{estimate_item_path_byte_length, UrlPartsBuilder}; | |
| 30 | use super::url_parts_builder::{UrlPartsBuilder, estimate_item_path_byte_length}; | |
| 31 | 31 | use crate::clean::types::ExternalLocation; |
| 32 | 32 | use crate::clean::utils::find_nearest_parent_module; |
| 33 | 33 | use crate::clean::{self, ExternalCrate, PrimitiveType}; |
src/librustdoc/html/highlight.rs+18-26| ... | ... | @@ -12,7 +12,7 @@ use rustc_data_structures::fx::FxHashMap; |
| 12 | 12 | use rustc_lexer::{Cursor, LiteralKind, TokenKind}; |
| 13 | 13 | use rustc_span::edition::Edition; |
| 14 | 14 | use rustc_span::symbol::Symbol; |
| 15 | use rustc_span::{BytePos, Span, DUMMY_SP}; | |
| 15 | use rustc_span::{BytePos, DUMMY_SP, Span}; | |
| 16 | 16 | |
| 17 | 17 | use super::format::{self, Buffer}; |
| 18 | 18 | use crate::clean::PrimitiveType; |
| ... | ... | @@ -72,34 +72,26 @@ fn write_header( |
| 72 | 72 | tooltip: Tooltip, |
| 73 | 73 | extra_classes: &[String], |
| 74 | 74 | ) { |
| 75 | write!( | |
| 76 | out, | |
| 77 | "<div class=\"example-wrap{}\">", | |
| 78 | match tooltip { | |
| 79 | Tooltip::Ignore => " ignore", | |
| 80 | Tooltip::CompileFail => " compile_fail", | |
| 81 | Tooltip::ShouldPanic => " should_panic", | |
| 82 | Tooltip::Edition(_) => " edition", | |
| 83 | Tooltip::None => "", | |
| 84 | }, | |
| 85 | ); | |
| 75 | write!(out, "<div class=\"example-wrap{}\">", match tooltip { | |
| 76 | Tooltip::Ignore => " ignore", | |
| 77 | Tooltip::CompileFail => " compile_fail", | |
| 78 | Tooltip::ShouldPanic => " should_panic", | |
| 79 | Tooltip::Edition(_) => " edition", | |
| 80 | Tooltip::None => "", | |
| 81 | },); | |
| 86 | 82 | |
| 87 | 83 | if tooltip != Tooltip::None { |
| 88 | 84 | let edition_code; |
| 89 | write!( | |
| 90 | out, | |
| 91 | "<a href=\"#\" class=\"tooltip\" title=\"{}\">ⓘ</a>", | |
| 92 | match tooltip { | |
| 93 | Tooltip::Ignore => "This example is not tested", | |
| 94 | Tooltip::CompileFail => "This example deliberately fails to compile", | |
| 95 | Tooltip::ShouldPanic => "This example panics", | |
| 96 | Tooltip::Edition(edition) => { | |
| 97 | edition_code = format!("This example runs with edition {edition}"); | |
| 98 | &edition_code | |
| 99 | } | |
| 100 | Tooltip::None => unreachable!(), | |
| 101 | }, | |
| 102 | ); | |
| 85 | write!(out, "<a href=\"#\" class=\"tooltip\" title=\"{}\">ⓘ</a>", match tooltip { | |
| 86 | Tooltip::Ignore => "This example is not tested", | |
| 87 | Tooltip::CompileFail => "This example deliberately fails to compile", | |
| 88 | Tooltip::ShouldPanic => "This example panics", | |
| 89 | Tooltip::Edition(edition) => { | |
| 90 | edition_code = format!("This example runs with edition {edition}"); | |
| 91 | &edition_code | |
| 92 | } | |
| 93 | Tooltip::None => unreachable!(), | |
| 94 | },); | |
| 103 | 95 | } |
| 104 | 96 | |
| 105 | 97 | if let Some(extra) = extra_content { |
src/librustdoc/html/highlight/tests.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ use expect_test::expect_file; |
| 2 | 2 | use rustc_data_structures::fx::FxHashMap; |
| 3 | 3 | use rustc_span::create_default_session_globals_then; |
| 4 | 4 | |
| 5 | use super::{write_code, DecorationInfo}; | |
| 5 | use super::{DecorationInfo, write_code}; | |
| 6 | 6 | use crate::html::format::Buffer; |
| 7 | 7 | |
| 8 | 8 | const STYLE: &str = r#" |
src/librustdoc/html/layout.rs+2-2| ... | ... | @@ -3,10 +3,10 @@ use std::path::PathBuf; |
| 3 | 3 | use rinja::Template; |
| 4 | 4 | use rustc_data_structures::fx::FxHashMap; |
| 5 | 5 | |
| 6 | use super::static_files::{StaticFiles, STATIC_FILES}; | |
| 6 | use super::static_files::{STATIC_FILES, StaticFiles}; | |
| 7 | 7 | use crate::externalfiles::ExternalHtml; |
| 8 | 8 | use crate::html::format::{Buffer, Print}; |
| 9 | use crate::html::render::{ensure_trailing_slash, StylePath}; | |
| 9 | use crate::html::render::{StylePath, ensure_trailing_slash}; | |
| 10 | 10 | |
| 11 | 11 | #[derive(Clone)] |
| 12 | 12 | pub(crate) struct Layout { |
src/librustdoc/html/markdown.rs+2-2| ... | ... | @@ -35,8 +35,8 @@ use std::str::{self, CharIndices}; |
| 35 | 35 | use std::sync::OnceLock; |
| 36 | 36 | |
| 37 | 37 | use pulldown_cmark::{ |
| 38 | html, BrokenLink, BrokenLinkCallback, CodeBlockKind, CowStr, Event, LinkType, OffsetIter, | |
| 39 | Options, Parser, Tag, TagEnd, | |
| 38 | BrokenLink, BrokenLinkCallback, CodeBlockKind, CowStr, Event, LinkType, OffsetIter, Options, | |
| 39 | Parser, Tag, TagEnd, html, | |
| 40 | 40 | }; |
| 41 | 41 | use rustc_data_structures::fx::FxHashMap; |
| 42 | 42 | use rustc_errors::{Diag, DiagMessage}; |
src/librustdoc/html/markdown/tests.rs+11-11| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | use rustc_span::edition::{Edition, DEFAULT_EDITION}; | |
| 1 | use rustc_span::edition::{DEFAULT_EDITION, Edition}; | |
| 2 | 2 | |
| 3 | 3 | use super::{ |
| 4 | find_testable_code, plain_text_summary, short_markdown_summary, ErrorCodes, HeadingOffset, | |
| 5 | IdMap, Ignore, LangString, LangStringToken, Markdown, MarkdownItemInfo, TagIterator, | |
| 4 | ErrorCodes, HeadingOffset, IdMap, Ignore, LangString, LangStringToken, Markdown, | |
| 5 | MarkdownItemInfo, TagIterator, find_testable_code, plain_text_summary, short_markdown_summary, | |
| 6 | 6 | }; |
| 7 | 7 | |
| 8 | 8 | #[test] |
| ... | ... | @@ -275,14 +275,14 @@ fn test_lang_string_tokenizer() { |
| 275 | 275 | case("foo", &[LangStringToken::LangToken("foo")]); |
| 276 | 276 | case("foo,bar", &[LangStringToken::LangToken("foo"), LangStringToken::LangToken("bar")]); |
| 277 | 277 | case(".foo,.bar", &[]); |
| 278 | case( | |
| 279 | "{.foo,.bar}", | |
| 280 | &[LangStringToken::ClassAttribute("foo"), LangStringToken::ClassAttribute("bar")], | |
| 281 | ); | |
| 282 | case( | |
| 283 | " {.foo,.bar} ", | |
| 284 | &[LangStringToken::ClassAttribute("foo"), LangStringToken::ClassAttribute("bar")], | |
| 285 | ); | |
| 278 | case("{.foo,.bar}", &[ | |
| 279 | LangStringToken::ClassAttribute("foo"), | |
| 280 | LangStringToken::ClassAttribute("bar"), | |
| 281 | ]); | |
| 282 | case(" {.foo,.bar} ", &[ | |
| 283 | LangStringToken::ClassAttribute("foo"), | |
| 284 | LangStringToken::ClassAttribute("bar"), | |
| 285 | ]); | |
| 286 | 286 | case("foo bar", &[LangStringToken::LangToken("foo"), LangStringToken::LangToken("bar")]); |
| 287 | 287 | case("foo\tbar", &[LangStringToken::LangToken("foo"), LangStringToken::LangToken("bar")]); |
| 288 | 288 | case("foo\t, bar", &[LangStringToken::LangToken("foo"), LangStringToken::LangToken("bar")]); |
src/librustdoc/html/render/context.rs+7-7| ... | ... | @@ -3,7 +3,7 @@ use std::collections::BTreeMap; |
| 3 | 3 | use std::io; |
| 4 | 4 | use std::path::{Path, PathBuf}; |
| 5 | 5 | use std::rc::Rc; |
| 6 | use std::sync::mpsc::{channel, Receiver}; | |
| 6 | use std::sync::mpsc::{Receiver, channel}; | |
| 7 | 7 | |
| 8 | 8 | use rinja::Template; |
| 9 | 9 | use rustc_data_structures::fx::{FxHashMap, FxHashSet}; |
| ... | ... | @@ -11,24 +11,24 @@ use rustc_hir::def_id::{DefIdMap, LOCAL_CRATE}; |
| 11 | 11 | use rustc_middle::ty::TyCtxt; |
| 12 | 12 | use rustc_session::Session; |
| 13 | 13 | use rustc_span::edition::Edition; |
| 14 | use rustc_span::{sym, FileName, Symbol}; | |
| 14 | use rustc_span::{FileName, Symbol, sym}; | |
| 15 | 15 | use tracing::info; |
| 16 | 16 | |
| 17 | 17 | use super::print_item::{full_path, item_path, print_item}; |
| 18 | use super::sidebar::{print_sidebar, sidebar_module_like, ModuleLike, Sidebar}; | |
| 19 | use super::{collect_spans_and_sources, scrape_examples_help, AllTypes, LinkFromSrc, StylePath}; | |
| 18 | use super::sidebar::{ModuleLike, Sidebar, print_sidebar, sidebar_module_like}; | |
| 19 | use super::{AllTypes, LinkFromSrc, StylePath, collect_spans_and_sources, scrape_examples_help}; | |
| 20 | 20 | use crate::clean::types::ExternalLocation; |
| 21 | 21 | use crate::clean::utils::has_doc_flag; |
| 22 | 22 | use crate::clean::{self, ExternalCrate}; |
| 23 | 23 | use crate::config::{ModuleSorting, RenderOptions, ShouldMerge}; |
| 24 | 24 | use crate::docfs::{DocFS, PathError}; |
| 25 | 25 | use crate::error::Error; |
| 26 | use crate::formats::FormatRenderer; | |
| 26 | 27 | use crate::formats::cache::Cache; |
| 27 | 28 | use crate::formats::item_type::ItemType; |
| 28 | use crate::formats::FormatRenderer; | |
| 29 | 29 | use crate::html::escape::Escape; |
| 30 | use crate::html::format::{join_with_double_colon, Buffer}; | |
| 31 | use crate::html::markdown::{self, plain_text_summary, ErrorCodes, IdMap}; | |
| 30 | use crate::html::format::{Buffer, join_with_double_colon}; | |
| 31 | use crate::html::markdown::{self, ErrorCodes, IdMap, plain_text_summary}; | |
| 32 | 32 | use crate::html::render::write_shared::write_shared; |
| 33 | 33 | use crate::html::url_parts_builder::UrlPartsBuilder; |
| 34 | 34 | use crate::html::{layout, sources, static_files}; |
src/librustdoc/html/render/mod.rs+9-9| ... | ... | @@ -48,30 +48,30 @@ use rinja::Template; |
| 48 | 48 | use rustc_attr::{ConstStability, DeprecatedSince, Deprecation, StabilityLevel, StableSince}; |
| 49 | 49 | use rustc_data_structures::captures::Captures; |
| 50 | 50 | use rustc_data_structures::fx::{FxHashMap, FxHashSet}; |
| 51 | use rustc_hir::def_id::{DefId, DefIdSet}; | |
| 52 | 51 | use rustc_hir::Mutability; |
| 52 | use rustc_hir::def_id::{DefId, DefIdSet}; | |
| 53 | 53 | use rustc_middle::ty::print::PrintTraitRefExt; |
| 54 | 54 | use rustc_middle::ty::{self, TyCtxt}; |
| 55 | 55 | use rustc_session::RustcVersion; |
| 56 | use rustc_span::symbol::{sym, Symbol}; | |
| 57 | use rustc_span::{BytePos, FileName, RealFileName, DUMMY_SP}; | |
| 56 | use rustc_span::symbol::{Symbol, sym}; | |
| 57 | use rustc_span::{BytePos, DUMMY_SP, FileName, RealFileName}; | |
| 58 | 58 | use serde::ser::SerializeMap; |
| 59 | 59 | use serde::{Serialize, Serializer}; |
| 60 | 60 | use tracing::{debug, info}; |
| 61 | 61 | |
| 62 | 62 | pub(crate) use self::context::*; |
| 63 | pub(crate) use self::span_map::{collect_spans_and_sources, LinkFromSrc}; | |
| 63 | pub(crate) use self::span_map::{LinkFromSrc, collect_spans_and_sources}; | |
| 64 | 64 | pub(crate) use self::write_shared::*; |
| 65 | 65 | use crate::clean::{self, ItemId, RenderedLink}; |
| 66 | 66 | use crate::error::Error; |
| 67 | use crate::formats::Impl; | |
| 67 | 68 | use crate::formats::cache::Cache; |
| 68 | 69 | use crate::formats::item_type::ItemType; |
| 69 | use crate::formats::Impl; | |
| 70 | 70 | use crate::html::escape::Escape; |
| 71 | 71 | use crate::html::format::{ |
| 72 | display_fn, href, join_with_double_colon, print_abi_with_space, print_constness_with_space, | |
| 73 | print_default_space, print_generic_bounds, print_where_clause, visibility_print_with_space, | |
| 74 | Buffer, Ending, HrefError, PrintWithSpace, | |
| 72 | Buffer, Ending, HrefError, PrintWithSpace, display_fn, href, join_with_double_colon, | |
| 73 | print_abi_with_space, print_constness_with_space, print_default_space, print_generic_bounds, | |
| 74 | print_where_clause, visibility_print_with_space, | |
| 75 | 75 | }; |
| 76 | 76 | use crate::html::markdown::{ |
| 77 | 77 | HeadingOffset, IdMap, Markdown, MarkdownItemInfo, MarkdownSummaryLine, |
| ... | ... | @@ -79,7 +79,7 @@ use crate::html::markdown::{ |
| 79 | 79 | use crate::html::static_files::SCRAPE_EXAMPLES_HELP_MD; |
| 80 | 80 | use crate::html::{highlight, sources}; |
| 81 | 81 | use crate::scrape_examples::{CallData, CallLocation}; |
| 82 | use crate::{try_none, DOC_RUST_LANG_ORG_CHANNEL}; | |
| 82 | use crate::{DOC_RUST_LANG_ORG_CHANNEL, try_none}; | |
| 83 | 83 | |
| 84 | 84 | pub(crate) fn ensure_trailing_slash(v: &str) -> impl fmt::Display + '_ { |
| 85 | 85 | crate::html::format::display_fn(move |f| { |
src/librustdoc/html/render/print_item.rs+6-6| ... | ... | @@ -13,27 +13,27 @@ use rustc_hir::def_id::DefId; |
| 13 | 13 | use rustc_index::IndexVec; |
| 14 | 14 | use rustc_middle::ty::{self, TyCtxt}; |
| 15 | 15 | use rustc_span::hygiene::MacroKind; |
| 16 | use rustc_span::symbol::{kw, sym, Symbol}; | |
| 16 | use rustc_span::symbol::{Symbol, kw, sym}; | |
| 17 | 17 | use rustc_target::abi::VariantIdx; |
| 18 | 18 | use tracing::{debug, info}; |
| 19 | 19 | |
| 20 | 20 | use super::type_layout::document_type_layout; |
| 21 | 21 | use super::{ |
| 22 | AssocItemLink, AssocItemRender, Context, ImplRenderingParameters, RenderMode, | |
| 22 | 23 | collect_paths_for_type, document, ensure_trailing_slash, get_filtered_impls_for_reference, |
| 23 | 24 | item_ty_to_section, notable_traits_button, notable_traits_json, render_all_impls, |
| 24 | 25 | render_assoc_item, render_assoc_items, render_attributes_in_code, render_attributes_in_pre, |
| 25 | 26 | render_impl, render_rightside, render_stability_since_raw, |
| 26 | render_stability_since_raw_with_extra, write_section_heading, AssocItemLink, AssocItemRender, | |
| 27 | Context, ImplRenderingParameters, RenderMode, | |
| 27 | render_stability_since_raw_with_extra, write_section_heading, | |
| 28 | 28 | }; |
| 29 | 29 | use crate::clean; |
| 30 | 30 | use crate::config::ModuleSorting; |
| 31 | use crate::formats::item_type::ItemType; | |
| 32 | 31 | use crate::formats::Impl; |
| 32 | use crate::formats::item_type::ItemType; | |
| 33 | 33 | use crate::html::escape::{Escape, EscapeBodyTextWithWbr}; |
| 34 | 34 | use crate::html::format::{ |
| 35 | display_fn, join_with_double_colon, print_abi_with_space, print_constness_with_space, | |
| 36 | print_where_clause, visibility_print_with_space, Buffer, Ending, PrintWithSpace, | |
| 35 | Buffer, Ending, PrintWithSpace, display_fn, join_with_double_colon, print_abi_with_space, | |
| 36 | print_constness_with_space, print_where_clause, visibility_print_with_space, | |
| 37 | 37 | }; |
| 38 | 38 | use crate::html::highlight; |
| 39 | 39 | use crate::html::markdown::{HeadingOffset, MarkdownSummaryLine}; |
src/librustdoc/html/render/search_index.rs+5-6| ... | ... | @@ -8,7 +8,7 @@ use rustc_data_structures::fx::{FxHashMap, FxIndexMap}; |
| 8 | 8 | use rustc_middle::ty::TyCtxt; |
| 9 | 9 | use rustc_span::def_id::DefId; |
| 10 | 10 | use rustc_span::sym; |
| 11 | use rustc_span::symbol::{kw, Symbol}; | |
| 11 | use rustc_span::symbol::{Symbol, kw}; | |
| 12 | 12 | use serde::ser::{Serialize, SerializeSeq, SerializeStruct, Serializer}; |
| 13 | 13 | use thin_vec::ThinVec; |
| 14 | 14 | use tracing::instrument; |
| ... | ... | @@ -1169,14 +1169,13 @@ fn simplify_fn_type<'a, 'tcx>( |
| 1169 | 1169 | *stored_bounds = type_bounds; |
| 1170 | 1170 | } |
| 1171 | 1171 | } |
| 1172 | ty_constraints.push(( | |
| 1173 | RenderTypeId::AssociatedType(name), | |
| 1174 | vec![RenderType { | |
| 1172 | ty_constraints.push((RenderTypeId::AssociatedType(name), vec![ | |
| 1173 | RenderType { | |
| 1175 | 1174 | id: Some(RenderTypeId::Index(idx)), |
| 1176 | 1175 | generics: None, |
| 1177 | 1176 | bindings: None, |
| 1178 | }], | |
| 1179 | )) | |
| 1177 | }, | |
| 1178 | ])) | |
| 1180 | 1179 | } |
| 1181 | 1180 | } |
| 1182 | 1181 | } |
src/librustdoc/html/render/sidebar.rs+2-2| ... | ... | @@ -8,10 +8,10 @@ use rustc_hir::def_id::DefIdSet; |
| 8 | 8 | use rustc_middle::ty::{self, TyCtxt}; |
| 9 | 9 | use tracing::debug; |
| 10 | 10 | |
| 11 | use super::{item_ty_to_section, Context, ItemSection}; | |
| 11 | use super::{Context, ItemSection, item_ty_to_section}; | |
| 12 | 12 | use crate::clean; |
| 13 | use crate::formats::item_type::ItemType; | |
| 14 | 13 | use crate::formats::Impl; |
| 14 | use crate::formats::item_type::ItemType; | |
| 15 | 15 | use crate::html::format::Buffer; |
| 16 | 16 | use crate::html::markdown::{IdMap, MarkdownWithToc}; |
| 17 | 17 |
src/librustdoc/html/render/span_map.rs+1-1| ... | ... | @@ -10,7 +10,7 @@ use rustc_middle::ty::TyCtxt; |
| 10 | 10 | use rustc_span::hygiene::MacroKind; |
| 11 | 11 | use rustc_span::{BytePos, ExpnKind, Span}; |
| 12 | 12 | |
| 13 | use crate::clean::{self, rustc_span, PrimitiveType}; | |
| 13 | use crate::clean::{self, PrimitiveType, rustc_span}; | |
| 14 | 14 | use crate::html::sources; |
| 15 | 15 | |
| 16 | 16 | /// This enum allows us to store two different kinds of information: |
src/librustdoc/html/render/write_shared.rs+5-5| ... | ... | @@ -29,26 +29,26 @@ use itertools::Itertools; |
| 29 | 29 | use regex::Regex; |
| 30 | 30 | use rustc_data_structures::flock; |
| 31 | 31 | use rustc_data_structures::fx::{FxHashMap, FxHashSet}; |
| 32 | use rustc_middle::ty::fast_reject::DeepRejectCtxt; | |
| 33 | 32 | use rustc_middle::ty::TyCtxt; |
| 34 | use rustc_span::def_id::DefId; | |
| 33 | use rustc_middle::ty::fast_reject::DeepRejectCtxt; | |
| 35 | 34 | use rustc_span::Symbol; |
| 35 | use rustc_span::def_id::DefId; | |
| 36 | 36 | use serde::de::DeserializeOwned; |
| 37 | 37 | use serde::ser::SerializeSeq; |
| 38 | 38 | use serde::{Deserialize, Serialize, Serializer}; |
| 39 | 39 | |
| 40 | use super::{collect_paths_for_type, ensure_trailing_slash, Context, RenderMode}; | |
| 40 | use super::{Context, RenderMode, collect_paths_for_type, ensure_trailing_slash}; | |
| 41 | 41 | use crate::clean::{Crate, Item, ItemId, ItemKind}; |
| 42 | 42 | use crate::config::{EmitType, PathToParts, RenderOptions, ShouldMerge}; |
| 43 | 43 | use crate::docfs::PathError; |
| 44 | 44 | use crate::error::Error; |
| 45 | use crate::formats::Impl; | |
| 45 | 46 | use crate::formats::cache::Cache; |
| 46 | 47 | use crate::formats::item_type::ItemType; |
| 47 | use crate::formats::Impl; | |
| 48 | 48 | use crate::html::format::Buffer; |
| 49 | 49 | use crate::html::layout; |
| 50 | 50 | use crate::html::render::ordered_json::{EscapedJson, OrderedJson}; |
| 51 | use crate::html::render::search_index::{build_index, SerializedSearchIndex}; | |
| 51 | use crate::html::render::search_index::{SerializedSearchIndex, build_index}; | |
| 52 | 52 | use crate::html::render::sorted_template::{self, FileFormat, SortedTemplate}; |
| 53 | 53 | use crate::html::render::{AssocItemLink, ImplRenderingParameters, StylePath}; |
| 54 | 54 | use crate::html::static_files::{self, suffix_path}; |
src/librustdoc/html/sources.rs+1-1| ... | ... | @@ -10,7 +10,7 @@ use rustc_data_structures::fx::{FxHashMap, FxHashSet}; |
| 10 | 10 | use rustc_hir::def_id::LOCAL_CRATE; |
| 11 | 11 | use rustc_middle::ty::TyCtxt; |
| 12 | 12 | use rustc_session::Session; |
| 13 | use rustc_span::{sym, FileName}; | |
| 13 | use rustc_span::{FileName, sym}; | |
| 14 | 14 | use tracing::info; |
| 15 | 15 | |
| 16 | 16 | use crate::clean; |
src/librustdoc/html/tests.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use rustc_span::{sym, Symbol}; | |
| 1 | use rustc_span::{Symbol, sym}; | |
| 2 | 2 | |
| 3 | 3 | use crate::html::format::href_relative_parts; |
| 4 | 4 |
src/librustdoc/json/conversions.rs+1-1| ... | ... | @@ -19,8 +19,8 @@ use rustc_target::spec::abi::Abi as RustcAbi; |
| 19 | 19 | use rustdoc_json_types::*; |
| 20 | 20 | |
| 21 | 21 | use crate::clean::{self, ItemId}; |
| 22 | use crate::formats::item_type::ItemType; | |
| 23 | 22 | use crate::formats::FormatRenderer; |
| 23 | use crate::formats::item_type::ItemType; | |
| 24 | 24 | use crate::json::JsonRenderer; |
| 25 | 25 | use crate::passes::collect_intra_doc_links::UrlFragment; |
| 26 | 26 |
src/librustdoc/json/mod.rs+16-22| ... | ... | @@ -8,8 +8,8 @@ mod conversions; |
| 8 | 8 | mod import_finder; |
| 9 | 9 | |
| 10 | 10 | use std::cell::RefCell; |
| 11 | use std::fs::{create_dir_all, File}; | |
| 12 | use std::io::{stdout, BufWriter, Write}; | |
| 11 | use std::fs::{File, create_dir_all}; | |
| 12 | use std::io::{BufWriter, Write, stdout}; | |
| 13 | 13 | use std::path::PathBuf; |
| 14 | 14 | use std::rc::Rc; |
| 15 | 15 | |
| ... | ... | @@ -24,14 +24,14 @@ use rustdoc_json_types as types; |
| 24 | 24 | use rustdoc_json_types::FxHashMap; |
| 25 | 25 | use tracing::{debug, trace}; |
| 26 | 26 | |
| 27 | use crate::clean::types::{ExternalCrate, ExternalLocation}; | |
| 28 | 27 | use crate::clean::ItemKind; |
| 28 | use crate::clean::types::{ExternalCrate, ExternalLocation}; | |
| 29 | 29 | use crate::config::RenderOptions; |
| 30 | 30 | use crate::docfs::PathError; |
| 31 | 31 | use crate::error::Error; |
| 32 | use crate::formats::cache::Cache; | |
| 33 | 32 | use crate::formats::FormatRenderer; |
| 34 | use crate::json::conversions::{id_from_item, id_from_item_default, IntoWithTcx}; | |
| 33 | use crate::formats::cache::Cache; | |
| 34 | use crate::json::conversions::{IntoWithTcx, id_from_item, id_from_item_default}; | |
| 35 | 35 | use crate::{clean, try_err}; |
| 36 | 36 | |
| 37 | 37 | #[derive(Clone)] |
| ... | ... | @@ -253,14 +253,11 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> { |
| 253 | 253 | .iter() |
| 254 | 254 | .chain(&self.cache.external_paths) |
| 255 | 255 | .map(|(&k, &(ref path, kind))| { |
| 256 | ( | |
| 257 | id_from_item_default(k.into(), self.tcx), | |
| 258 | types::ItemSummary { | |
| 259 | crate_id: k.krate.as_u32(), | |
| 260 | path: path.iter().map(|s| s.to_string()).collect(), | |
| 261 | kind: kind.into_tcx(self.tcx), | |
| 262 | }, | |
| 263 | ) | |
| 256 | (id_from_item_default(k.into(), self.tcx), types::ItemSummary { | |
| 257 | crate_id: k.krate.as_u32(), | |
| 258 | path: path.iter().map(|s| s.to_string()).collect(), | |
| 259 | kind: kind.into_tcx(self.tcx), | |
| 260 | }) | |
| 264 | 261 | }) |
| 265 | 262 | .collect(), |
| 266 | 263 | external_crates: self |
| ... | ... | @@ -269,16 +266,13 @@ impl<'tcx> FormatRenderer<'tcx> for JsonRenderer<'tcx> { |
| 269 | 266 | .iter() |
| 270 | 267 | .map(|(crate_num, external_location)| { |
| 271 | 268 | let e = ExternalCrate { crate_num: *crate_num }; |
| 272 | ( | |
| 273 | crate_num.as_u32(), | |
| 274 | types::ExternalCrate { | |
| 275 | name: e.name(self.tcx).to_string(), | |
| 276 | html_root_url: match external_location { | |
| 277 | ExternalLocation::Remote(s) => Some(s.clone()), | |
| 278 | _ => None, | |
| 279 | }, | |
| 269 | (crate_num.as_u32(), types::ExternalCrate { | |
| 270 | name: e.name(self.tcx).to_string(), | |
| 271 | html_root_url: match external_location { | |
| 272 | ExternalLocation::Remote(s) => Some(s.clone()), | |
| 273 | _ => None, | |
| 280 | 274 | }, |
| 281 | ) | |
| 275 | }) | |
| 282 | 276 | }) |
| 283 | 277 | .collect(), |
| 284 | 278 | format_version: types::FORMAT_VERSION, |
src/librustdoc/lib.rs+3-3| ... | ... | @@ -73,14 +73,14 @@ extern crate jemalloc_sys; |
| 73 | 73 | use std::env::{self, VarError}; |
| 74 | 74 | use std::io::{self, IsTerminal}; |
| 75 | 75 | use std::process; |
| 76 | use std::sync::atomic::AtomicBool; | |
| 77 | 76 | use std::sync::Arc; |
| 77 | use std::sync::atomic::AtomicBool; | |
| 78 | 78 | |
| 79 | 79 | use rustc_errors::{DiagCtxtHandle, ErrorGuaranteed, FatalError}; |
| 80 | 80 | use rustc_interface::interface; |
| 81 | 81 | use rustc_middle::ty::TyCtxt; |
| 82 | use rustc_session::config::{make_crate_type_option, ErrorOutputType, RustcOptGroup}; | |
| 83 | use rustc_session::{getopts, EarlyDiagCtxt}; | |
| 82 | use rustc_session::config::{ErrorOutputType, RustcOptGroup, make_crate_type_option}; | |
| 83 | use rustc_session::{EarlyDiagCtxt, getopts}; | |
| 84 | 84 | use tracing::info; |
| 85 | 85 | |
| 86 | 86 | use crate::clean::utils::DOC_RUST_LANG_ORG_CHANNEL; |
src/librustdoc/lint.rs+2-2| ... | ... | @@ -2,8 +2,8 @@ use std::sync::LazyLock as Lazy; |
| 2 | 2 | |
| 3 | 3 | use rustc_data_structures::fx::FxHashMap; |
| 4 | 4 | use rustc_lint::LintStore; |
| 5 | use rustc_lint_defs::{declare_tool_lint, Lint, LintId}; | |
| 6 | use rustc_session::{lint, Session}; | |
| 5 | use rustc_lint_defs::{Lint, LintId, declare_tool_lint}; | |
| 6 | use rustc_session::{Session, lint}; | |
| 7 | 7 | |
| 8 | 8 | /// This function is used to setup the lint initialization. By default, in rustdoc, everything |
| 9 | 9 | /// is "allowed". Depending if we run in test mode or not, we want some of them to be at their |
src/librustdoc/markdown.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use std::fmt::Write as _; |
| 2 | use std::fs::{create_dir_all, read_to_string, File}; | |
| 2 | use std::fs::{File, create_dir_all, read_to_string}; | |
| 3 | 3 | use std::io::prelude::*; |
| 4 | 4 | use std::path::Path; |
| 5 | 5 |
src/librustdoc/passes/calculate_doc_coverage.rs+2-2| ... | ... | @@ -13,9 +13,9 @@ use tracing::debug; |
| 13 | 13 | |
| 14 | 14 | use crate::clean; |
| 15 | 15 | use crate::core::DocContext; |
| 16 | use crate::html::markdown::{find_testable_code, ErrorCodes}; | |
| 17 | use crate::passes::check_doc_test_visibility::{should_have_doc_example, Tests}; | |
| 16 | use crate::html::markdown::{ErrorCodes, find_testable_code}; | |
| 18 | 17 | use crate::passes::Pass; |
| 18 | use crate::passes::check_doc_test_visibility::{Tests, should_have_doc_example}; | |
| 19 | 19 | use crate::visit::DocVisitor; |
| 20 | 20 | |
| 21 | 21 | pub(crate) const CALCULATE_DOC_COVERAGE: Pass = Pass { |
src/librustdoc/passes/check_doc_test_visibility.rs+1-1| ... | ... | @@ -15,7 +15,7 @@ use crate::clean; |
| 15 | 15 | use crate::clean::utils::inherits_doc_hidden; |
| 16 | 16 | use crate::clean::*; |
| 17 | 17 | use crate::core::DocContext; |
| 18 | use crate::html::markdown::{find_testable_code, ErrorCodes, Ignore, LangString, MdRelLine}; | |
| 18 | use crate::html::markdown::{ErrorCodes, Ignore, LangString, MdRelLine, find_testable_code}; | |
| 19 | 19 | use crate::visit::DocVisitor; |
| 20 | 20 | |
| 21 | 21 | pub(crate) const CHECK_DOC_TEST_VISIBILITY: Pass = Pass { |
src/librustdoc/passes/collect_intra_doc_links.rs+7-7| ... | ... | @@ -14,25 +14,25 @@ use rustc_data_structures::intern::Interned; |
| 14 | 14 | use rustc_errors::{Applicability, Diag, DiagMessage}; |
| 15 | 15 | use rustc_hir::def::Namespace::*; |
| 16 | 16 | use rustc_hir::def::{DefKind, Namespace, PerNS}; |
| 17 | use rustc_hir::def_id::{DefId, CRATE_DEF_ID}; | |
| 17 | use rustc_hir::def_id::{CRATE_DEF_ID, DefId}; | |
| 18 | 18 | use rustc_hir::{Mutability, Safety}; |
| 19 | 19 | use rustc_middle::ty::{Ty, TyCtxt}; |
| 20 | 20 | use rustc_middle::{bug, span_bug, ty}; |
| 21 | 21 | use rustc_resolve::rustdoc::{ |
| 22 | has_primitive_or_keyword_docs, prepare_to_doc_link_resolution, source_span_for_markdown_range, | |
| 23 | strip_generics_from_path, MalformedGenerics, | |
| 22 | MalformedGenerics, has_primitive_or_keyword_docs, prepare_to_doc_link_resolution, | |
| 23 | source_span_for_markdown_range, strip_generics_from_path, | |
| 24 | 24 | }; |
| 25 | 25 | use rustc_session::lint::Lint; |
| 26 | use rustc_span::hygiene::MacroKind; | |
| 27 | use rustc_span::symbol::{sym, Ident, Symbol}; | |
| 28 | 26 | use rustc_span::BytePos; |
| 29 | use smallvec::{smallvec, SmallVec}; | |
| 27 | use rustc_span::hygiene::MacroKind; | |
| 28 | use rustc_span::symbol::{Ident, Symbol, sym}; | |
| 29 | use smallvec::{SmallVec, smallvec}; | |
| 30 | 30 | use tracing::{debug, info, instrument, trace}; |
| 31 | 31 | |
| 32 | 32 | use crate::clean::utils::find_nearest_parent_module; |
| 33 | 33 | use crate::clean::{self, Crate, Item, ItemLink, PrimitiveType}; |
| 34 | 34 | use crate::core::DocContext; |
| 35 | use crate::html::markdown::{markdown_links, MarkdownLink, MarkdownLinkRange}; | |
| 35 | use crate::html::markdown::{MarkdownLink, MarkdownLinkRange, markdown_links}; | |
| 36 | 36 | use crate::lint::{BROKEN_INTRA_DOC_LINKS, PRIVATE_INTRA_DOC_LINKS}; |
| 37 | 37 | use crate::passes::Pass; |
| 38 | 38 | use crate::visit::DocVisitor; |
src/librustdoc/passes/lint/bare_urls.rs+4-5| ... | ... | @@ -77,10 +77,9 @@ fn find_raw_urls( |
| 77 | 77 | // For now, we only check "full" URLs (meaning, starting with "http://" or "https://"). |
| 78 | 78 | for match_ in URL_REGEX.find_iter(text) { |
| 79 | 79 | let url_range = match_.range(); |
| 80 | f( | |
| 81 | cx, | |
| 82 | "this URL is not a hyperlink", | |
| 83 | Range { start: range.start + url_range.start, end: range.start + url_range.end }, | |
| 84 | ); | |
| 80 | f(cx, "this URL is not a hyperlink", Range { | |
| 81 | start: range.start + url_range.start, | |
| 82 | end: range.start + url_range.end, | |
| 83 | }); | |
| 85 | 84 | } |
| 86 | 85 | } |
src/librustdoc/passes/lint/check_code_block_syntax.rs+2-2| ... | ... | @@ -2,14 +2,14 @@ |
| 2 | 2 | |
| 3 | 3 | use rustc_data_structures::sync::{Lock, Lrc}; |
| 4 | 4 | use rustc_errors::emitter::Emitter; |
| 5 | use rustc_errors::translation::{to_fluent_args, Translate}; | |
| 5 | use rustc_errors::translation::{Translate, to_fluent_args}; | |
| 6 | 6 | use rustc_errors::{Applicability, DiagCtxt, DiagInner, LazyFallbackBundle}; |
| 7 | 7 | use rustc_parse::{source_str_to_stream, unwrap_or_emit_fatal}; |
| 8 | 8 | use rustc_resolve::rustdoc::source_span_for_markdown_range; |
| 9 | 9 | use rustc_session::parse::ParseSess; |
| 10 | 10 | use rustc_span::hygiene::{AstPass, ExpnData, ExpnKind, LocalExpnId, Transparency}; |
| 11 | 11 | use rustc_span::source_map::{FilePathMapping, SourceMap}; |
| 12 | use rustc_span::{FileName, InnerSpan, DUMMY_SP}; | |
| 12 | use rustc_span::{DUMMY_SP, FileName, InnerSpan}; | |
| 13 | 13 | |
| 14 | 14 | use crate::clean; |
| 15 | 15 | use crate::core::DocContext; |
src/librustdoc/passes/lint/redundant_explicit_links.rs+3-3| ... | ... | @@ -5,15 +5,15 @@ use pulldown_cmark::{ |
| 5 | 5 | }; |
| 6 | 6 | use rustc_ast::NodeId; |
| 7 | 7 | use rustc_errors::SuggestionStyle; |
| 8 | use rustc_hir::def::{DefKind, DocLinkResMap, Namespace, Res}; | |
| 9 | 8 | use rustc_hir::HirId; |
| 9 | use rustc_hir::def::{DefKind, DocLinkResMap, Namespace, Res}; | |
| 10 | 10 | use rustc_lint_defs::Applicability; |
| 11 | 11 | use rustc_resolve::rustdoc::{prepare_to_doc_link_resolution, source_span_for_markdown_range}; |
| 12 | use rustc_span::def_id::DefId; | |
| 13 | 12 | use rustc_span::Symbol; |
| 13 | use rustc_span::def_id::DefId; | |
| 14 | 14 | |
| 15 | use crate::clean::utils::{find_nearest_parent_module, inherits_doc_hidden}; | |
| 16 | 15 | use crate::clean::Item; |
| 16 | use crate::clean::utils::{find_nearest_parent_module, inherits_doc_hidden}; | |
| 17 | 17 | use crate::core::DocContext; |
| 18 | 18 | use crate::html::markdown::main_body_opts; |
| 19 | 19 |
src/librustdoc/passes/strip_aliased_non_local.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ use rustc_middle::ty::{TyCtxt, Visibility}; |
| 3 | 3 | use crate::clean; |
| 4 | 4 | use crate::clean::Item; |
| 5 | 5 | use crate::core::DocContext; |
| 6 | use crate::fold::{strip_item, DocFolder}; | |
| 6 | use crate::fold::{DocFolder, strip_item}; | |
| 7 | 7 | use crate::passes::Pass; |
| 8 | 8 | |
| 9 | 9 | pub(crate) const STRIP_ALIASED_NON_LOCAL: Pass = Pass { |
src/librustdoc/passes/strip_hidden.rs+2-2| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | |
| 3 | 3 | use std::mem; |
| 4 | 4 | |
| 5 | use rustc_hir::def_id::{LocalDefId, CRATE_DEF_ID}; | |
| 5 | use rustc_hir::def_id::{CRATE_DEF_ID, LocalDefId}; | |
| 6 | 6 | use rustc_middle::ty::TyCtxt; |
| 7 | 7 | use rustc_span::symbol::sym; |
| 8 | 8 | use tracing::debug; |
| ... | ... | @@ -11,7 +11,7 @@ use crate::clean; |
| 11 | 11 | use crate::clean::utils::inherits_doc_hidden; |
| 12 | 12 | use crate::clean::{Item, ItemIdSet}; |
| 13 | 13 | use crate::core::DocContext; |
| 14 | use crate::fold::{strip_item, DocFolder}; | |
| 14 | use crate::fold::{DocFolder, strip_item}; | |
| 15 | 15 | use crate::passes::{ImplStripper, Pass}; |
| 16 | 16 | |
| 17 | 17 | pub(crate) const STRIP_HIDDEN: Pass = Pass { |
src/librustdoc/passes/stripper.rs+1-1| ... | ... | @@ -8,7 +8,7 @@ use tracing::debug; |
| 8 | 8 | |
| 9 | 9 | use crate::clean::utils::inherits_doc_hidden; |
| 10 | 10 | use crate::clean::{self, Item, ItemId, ItemIdSet}; |
| 11 | use crate::fold::{strip_item, DocFolder}; | |
| 11 | use crate::fold::{DocFolder, strip_item}; | |
| 12 | 12 | use crate::formats::cache::Cache; |
| 13 | 13 | use crate::visit_lib::RustdocEffectiveVisibilities; |
| 14 | 14 |
src/librustdoc/visit_ast.rs+5-5| ... | ... | @@ -7,19 +7,19 @@ use rustc_data_structures::fx::{FxHashSet, FxIndexMap}; |
| 7 | 7 | use rustc_hir as hir; |
| 8 | 8 | use rustc_hir::def::{DefKind, Res}; |
| 9 | 9 | use rustc_hir::def_id::{DefId, DefIdMap, LocalDefId, LocalDefIdSet}; |
| 10 | use rustc_hir::intravisit::{walk_body, walk_item, Visitor}; | |
| 11 | use rustc_hir::{Node, CRATE_HIR_ID}; | |
| 10 | use rustc_hir::intravisit::{Visitor, walk_body, walk_item}; | |
| 11 | use rustc_hir::{CRATE_HIR_ID, Node}; | |
| 12 | 12 | use rustc_middle::hir::nested_filter; |
| 13 | 13 | use rustc_middle::ty::TyCtxt; |
| 14 | use rustc_span::Span; | |
| 14 | 15 | use rustc_span::def_id::{CRATE_DEF_ID, LOCAL_CRATE}; |
| 15 | 16 | use rustc_span::hygiene::MacroKind; |
| 16 | use rustc_span::symbol::{kw, sym, Symbol}; | |
| 17 | use rustc_span::Span; | |
| 17 | use rustc_span::symbol::{Symbol, kw, sym}; | |
| 18 | 18 | use tracing::debug; |
| 19 | 19 | |
| 20 | 20 | use crate::clean::cfg::Cfg; |
| 21 | 21 | use crate::clean::utils::{inherits_doc_hidden, should_ignore_res}; |
| 22 | use crate::clean::{reexport_chain, AttributesExt, NestedAttributesExt}; | |
| 22 | use crate::clean::{AttributesExt, NestedAttributesExt, reexport_chain}; | |
| 23 | 23 | use crate::core; |
| 24 | 24 | |
| 25 | 25 | /// This module is used to store stuff from Rust's AST in a more convenient |
src/stage0+450-450| ... | ... | @@ -14,456 +14,456 @@ nightly_branch=master |
| 14 | 14 | # All changes below this comment will be overridden the next time the |
| 15 | 15 | # tool is executed. |
| 16 | 16 | |
| 17 | compiler_date=2024-09-04 | |
| 17 | compiler_date=2024-09-22 | |
| 18 | 18 | compiler_version=beta |
| 19 | rustfmt_date=2024-09-04 | |
| 19 | rustfmt_date=2024-09-22 | |
| 20 | 20 | rustfmt_version=nightly |
| 21 | 21 | |
| 22 | dist/2024-09-04/rustc-beta-aarch64-apple-darwin.tar.gz=cb6487c102a7c5822be2236d79a2c4737b0ff284931c61607518a0de8d300abf | |
| 23 | dist/2024-09-04/rustc-beta-aarch64-apple-darwin.tar.xz=2556c7c07811195e94639f6d6556a0f49f3c267e0e3bfc44b1fdc555aac1ffe5 | |
| 24 | dist/2024-09-04/rustc-beta-aarch64-pc-windows-msvc.tar.gz=c207a307bf10a50e2884f4d9408528a22703e1010dd921459541ee11aecc2405 | |
| 25 | dist/2024-09-04/rustc-beta-aarch64-pc-windows-msvc.tar.xz=d6f99991029db32be7527dbe1a6ae840600db6d7497123156e6672f7a0e83aa2 | |
| 26 | dist/2024-09-04/rustc-beta-aarch64-unknown-linux-gnu.tar.gz=b57cb4d25045e23f897078216776f244a73498ea89240077bda7a84c31c2f4fe | |
| 27 | dist/2024-09-04/rustc-beta-aarch64-unknown-linux-gnu.tar.xz=2c2b95c852114d7b18c3db13234ac56f933b70c3cf8b5ac9fce65415434961fe | |
| 28 | dist/2024-09-04/rustc-beta-aarch64-unknown-linux-musl.tar.gz=1f216d67bcd5d1e011bd2c6c69b6791c94e29cf7da3ab7dea82ff71a911e149b | |
| 29 | dist/2024-09-04/rustc-beta-aarch64-unknown-linux-musl.tar.xz=86abb27afb03e347abff65e4e34f1ec2e943af14f04f8cd9dd8666338147562d | |
| 30 | dist/2024-09-04/rustc-beta-arm-unknown-linux-gnueabi.tar.gz=842754febca1a5c6f7ccacf231621ba4578d72718a950ddedbf07a73594fa55f | |
| 31 | dist/2024-09-04/rustc-beta-arm-unknown-linux-gnueabi.tar.xz=3094887ecd5e3432e1ada0bba4a425213215c50680dc30d0c1d15ffda5bc62a0 | |
| 32 | dist/2024-09-04/rustc-beta-arm-unknown-linux-gnueabihf.tar.gz=27192e3423f2b580d7927ae788cf778ff9c092e2eb7cdd5d16b41aa94d2bf03c | |
| 33 | dist/2024-09-04/rustc-beta-arm-unknown-linux-gnueabihf.tar.xz=e57767bd767964d51533e2310f177827842bf49176895280b3de3860caf351ab | |
| 34 | dist/2024-09-04/rustc-beta-armv7-unknown-linux-gnueabihf.tar.gz=b639bfce72277714769d36efab294ef3578573b93037160be7dff9f4a6e6b5ef | |
| 35 | dist/2024-09-04/rustc-beta-armv7-unknown-linux-gnueabihf.tar.xz=fce2b931641d51e88eb3e34d60bebe75384c1981654937b16f1333438d8b0696 | |
| 36 | dist/2024-09-04/rustc-beta-i686-pc-windows-gnu.tar.gz=b58f7013b41044260ab2f9456940d9ce017dcfea06059fae8a672664f8ba00df | |
| 37 | dist/2024-09-04/rustc-beta-i686-pc-windows-gnu.tar.xz=c91958645f3c4cd562a5eb800ddb843aabfa2f067f5659313fdedeb270935bf8 | |
| 38 | dist/2024-09-04/rustc-beta-i686-pc-windows-msvc.tar.gz=9a5075768fe2d42195c639d8c1066a020b573eae24c0c63e9a8876b78c39d673 | |
| 39 | dist/2024-09-04/rustc-beta-i686-pc-windows-msvc.tar.xz=e76c27a8892a5b7a74c4d18d10c745af226711dbf62450378a3034a706624ce1 | |
| 40 | dist/2024-09-04/rustc-beta-i686-unknown-linux-gnu.tar.gz=c10ffb2db62b113af1feab8625f1d88d31c1d4a4246d00e19a3588c9f69c0164 | |
| 41 | dist/2024-09-04/rustc-beta-i686-unknown-linux-gnu.tar.xz=0496fbfa32d6c22929fe94ae5dcaabc47d31d7482f0fe6748ef7b7eb7443b775 | |
| 42 | dist/2024-09-04/rustc-beta-loongarch64-unknown-linux-gnu.tar.gz=64b55368e8044ea44588c98f1529f46d65f7607ebf2fa2d50785abecfb37c188 | |
| 43 | dist/2024-09-04/rustc-beta-loongarch64-unknown-linux-gnu.tar.xz=e03528ee7e4e92d666199ebcdde7d10f1d0fbeb2766217fd95f98da93bc361d0 | |
| 44 | dist/2024-09-04/rustc-beta-loongarch64-unknown-linux-musl.tar.gz=eeb913008ecfbaaa76b7690b2e68bd1e70efc1afda19f44a1aa551a76e4b536a | |
| 45 | dist/2024-09-04/rustc-beta-loongarch64-unknown-linux-musl.tar.xz=c94c3545fa2a491763b1e593419034294c57a3df2ca8064db0b11d2e82e76c85 | |
| 46 | dist/2024-09-04/rustc-beta-powerpc-unknown-linux-gnu.tar.gz=54c97827079aa7646cf206517f603487f4634ab1a17f2a7882b0cd3d6ffae8db | |
| 47 | dist/2024-09-04/rustc-beta-powerpc-unknown-linux-gnu.tar.xz=ee98a0e07989de836ff8ff4e768c6f0f13aa15150d1b59543297f31b2768a5fc | |
| 48 | dist/2024-09-04/rustc-beta-powerpc64-unknown-linux-gnu.tar.gz=a0fcd0f7af5b05a22d9be0abb6f3aa44c028c2606195163d2ad4b0352455ed1f | |
| 49 | dist/2024-09-04/rustc-beta-powerpc64-unknown-linux-gnu.tar.xz=cf35d480a6c0b439d29baacc4ee4087c4d7b5c1b4050302f3146f0bdbffcd472 | |
| 50 | dist/2024-09-04/rustc-beta-powerpc64le-unknown-linux-gnu.tar.gz=ef19ce4d791b1caad30bc5af9e30494161f343d936a3300eb0d7c5e8f37db441 | |
| 51 | dist/2024-09-04/rustc-beta-powerpc64le-unknown-linux-gnu.tar.xz=12adfd58c851d1f7bb23c5698abf6dffa2c26348df55fbb518c27497f7ebdf17 | |
| 52 | dist/2024-09-04/rustc-beta-riscv64gc-unknown-linux-gnu.tar.gz=818151529f1e445f9202d0092f09f02818a2c52ad6814a89b2bbfcb0227c5202 | |
| 53 | dist/2024-09-04/rustc-beta-riscv64gc-unknown-linux-gnu.tar.xz=e195d07d37699d860ce97422bba7f68166292103cedf4932b3ba8c0d9fa7e186 | |
| 54 | dist/2024-09-04/rustc-beta-s390x-unknown-linux-gnu.tar.gz=d4a73ddd7eafdffe7f23720a7202f48676ae0bc49248d3a455c997d718730c5f | |
| 55 | dist/2024-09-04/rustc-beta-s390x-unknown-linux-gnu.tar.xz=475bb6e51f37fc769480345982e14afeee099cdf769773d0d0215d01fc77ce41 | |
| 56 | dist/2024-09-04/rustc-beta-x86_64-apple-darwin.tar.gz=c061d06da7d4a283136d8e80f307c1ef4157739898776f5579b8d92980be0775 | |
| 57 | dist/2024-09-04/rustc-beta-x86_64-apple-darwin.tar.xz=330b580c90ace563c96db64f639668284d8ede835870acf76b106d4c4913f476 | |
| 58 | dist/2024-09-04/rustc-beta-x86_64-pc-windows-gnu.tar.gz=27f9e3c2e9380c689ab0c5e8438f1969261a30445e9b2d38efa9417fba1f4ea2 | |
| 59 | dist/2024-09-04/rustc-beta-x86_64-pc-windows-gnu.tar.xz=62fc92dac7be442dcf306ae1baef471447b80a6a221502bf7b14b249dd599db7 | |
| 60 | dist/2024-09-04/rustc-beta-x86_64-pc-windows-msvc.tar.gz=c52202bf41aafb517959e01cac2e4bbb53144aa0164f9b31e7b9db0af32be6c6 | |
| 61 | dist/2024-09-04/rustc-beta-x86_64-pc-windows-msvc.tar.xz=24db84f0de7573812fe36fed5653fc117c80fc35b02a9340f746ded6a11d3bc0 | |
| 62 | dist/2024-09-04/rustc-beta-x86_64-unknown-freebsd.tar.gz=406f8a37572376fec7563664043b4fc3b0e7a48c738b6ef862da3fc41f33b1d3 | |
| 63 | dist/2024-09-04/rustc-beta-x86_64-unknown-freebsd.tar.xz=93fa021ca3973a52cbccd51771536e2b9a355eae4f4ab95c7168f4af79e96d4e | |
| 64 | dist/2024-09-04/rustc-beta-x86_64-unknown-illumos.tar.gz=a2a5942342b2f5dc7a196500210075ac695f106a18fd487a3c694847013454f3 | |
| 65 | dist/2024-09-04/rustc-beta-x86_64-unknown-illumos.tar.xz=c8b63f35f30bb1d6adb49834b3a42dfc07c27042e8411f1b4777adced6193298 | |
| 66 | dist/2024-09-04/rustc-beta-x86_64-unknown-linux-gnu.tar.gz=145c5d6e0edb688dbe59f9c638959e11718e0bdc625db76bac1d2836efd9f116 | |
| 67 | dist/2024-09-04/rustc-beta-x86_64-unknown-linux-gnu.tar.xz=82845313e17067dac361eada63fdf2479fc177e8aa97aba5cb40a50861e276bc | |
| 68 | dist/2024-09-04/rustc-beta-x86_64-unknown-linux-musl.tar.gz=8351011105a5a338adbd2433ff5aa24cd038a67c0f0d040e4b92926d4aecd28e | |
| 69 | dist/2024-09-04/rustc-beta-x86_64-unknown-linux-musl.tar.xz=b2a972069142d5fdab775fd7709d4bc85b1c2c4167e9c455d2ef1b72cc207fd1 | |
| 70 | dist/2024-09-04/rustc-beta-x86_64-unknown-netbsd.tar.gz=327501931ce36eb5613e5e77fb5356ff24f60078516473cd7f664bc970aee994 | |
| 71 | dist/2024-09-04/rustc-beta-x86_64-unknown-netbsd.tar.xz=6d940ec725fa4931c914c291977f63828fe71e9763a3b8195dda668541c9122f | |
| 72 | dist/2024-09-04/rust-std-beta-aarch64-apple-darwin.tar.gz=9bf325e98fa60fcb7d4f09b796f2fe0e7e7c54e83ffba6d5cf30776a0346972d | |
| 73 | dist/2024-09-04/rust-std-beta-aarch64-apple-darwin.tar.xz=45d632045f5e3f8150d82fdc5163aea1d5ad785cd16da2d46293581b09bda895 | |
| 74 | dist/2024-09-04/rust-std-beta-aarch64-apple-ios.tar.gz=c42f808164d79e023dc4186e47a6032c0877536a0c9459f3e871c66c129b0f75 | |
| 75 | dist/2024-09-04/rust-std-beta-aarch64-apple-ios.tar.xz=9bbe6ae21530fb0555472f9a540b7791d5dce059439608d797507057199e696e | |
| 76 | dist/2024-09-04/rust-std-beta-aarch64-apple-ios-macabi.tar.gz=ae8005ea419f9f19be0c2603529d8801dc77e5344c72c1bd42eed81046fe5113 | |
| 77 | dist/2024-09-04/rust-std-beta-aarch64-apple-ios-macabi.tar.xz=0053948699aba18b2bee7473f335940573aaf4bad6aabb00f28f2a335d280dab | |
| 78 | dist/2024-09-04/rust-std-beta-aarch64-apple-ios-sim.tar.gz=5adc7721f8f7fc0537b11a28ee2df6d90b96222a07590c84fab4dbefe33087d1 | |
| 79 | dist/2024-09-04/rust-std-beta-aarch64-apple-ios-sim.tar.xz=4f3a9b61500ef3a38961288784c61a520baabfa597e997195007e0e229d1e4bf | |
| 80 | dist/2024-09-04/rust-std-beta-aarch64-linux-android.tar.gz=7192a628d6605b437a7203c18d48ac9a5af4879674117e9aebafb5029a10e069 | |
| 81 | dist/2024-09-04/rust-std-beta-aarch64-linux-android.tar.xz=845177bda3220a534b20c66cda3bf27b0681c2977dfbcedeaf41022bc518f832 | |
| 82 | dist/2024-09-04/rust-std-beta-aarch64-pc-windows-gnullvm.tar.gz=1a0ced7e1fbcdd38fcb33f1753f3af8b23f075d4ce38c3d1256ba142ddf80a47 | |
| 83 | dist/2024-09-04/rust-std-beta-aarch64-pc-windows-gnullvm.tar.xz=75272f629adfaacb58c511163ae9b73714fe3f60d5e39b4cd996a42226626518 | |
| 84 | dist/2024-09-04/rust-std-beta-aarch64-pc-windows-msvc.tar.gz=3b19e6dca8515f28a2325d7cf2f098e82e194d4418fce7c3caa94c9c08023646 | |
| 85 | dist/2024-09-04/rust-std-beta-aarch64-pc-windows-msvc.tar.xz=138e8e1a85efb4f66ec878db18dfa48681f3045589c7b9a749afd0104dafd278 | |
| 86 | dist/2024-09-04/rust-std-beta-aarch64-unknown-fuchsia.tar.gz=6da128ca58f46d2608c4d9630c09de263b853f9fe8b6fa41def0749e99a128e0 | |
| 87 | dist/2024-09-04/rust-std-beta-aarch64-unknown-fuchsia.tar.xz=67a2c04a9f4947b4c313220150521f494364c5e589ff23a4584fa60b924ae095 | |
| 88 | dist/2024-09-04/rust-std-beta-aarch64-unknown-linux-gnu.tar.gz=85ccd5a6e81caa63d4d4cfe55eead8a3829a5636d41f7640ea393bf7652eec28 | |
| 89 | dist/2024-09-04/rust-std-beta-aarch64-unknown-linux-gnu.tar.xz=fb91518e70808c659f6f078c0094ca471e4e4f5d81c29c1bdc8907f6bdffc64f | |
| 90 | dist/2024-09-04/rust-std-beta-aarch64-unknown-linux-musl.tar.gz=410b24f1372f84d60804b4bcf20fa2025adaee3c56ab7dabda1e320809acafdb | |
| 91 | dist/2024-09-04/rust-std-beta-aarch64-unknown-linux-musl.tar.xz=64d7fa38af8a1c38e42bc9b9ab909f476d3388b7d02a21ba92519145cb3a3df8 | |
| 92 | dist/2024-09-04/rust-std-beta-aarch64-unknown-linux-ohos.tar.gz=f4722b2a656d4f87bd13d4c8da6116e993e916114c55a2fd1a588e51dfde4ab0 | |
| 93 | dist/2024-09-04/rust-std-beta-aarch64-unknown-linux-ohos.tar.xz=cb9150701f21de444addcdc9a53c83eeed3aaa3bc447e8f6358825a2f889bff2 | |
| 94 | dist/2024-09-04/rust-std-beta-aarch64-unknown-none.tar.gz=26cf0407f17db7645fc1a4051d08246f1325b17941dd5139cb69b782498aa043 | |
| 95 | dist/2024-09-04/rust-std-beta-aarch64-unknown-none.tar.xz=9dcdfd018e2ca6f21d0689adb152917a8695c2f14c4f6a53a5b52280219c2540 | |
| 96 | dist/2024-09-04/rust-std-beta-aarch64-unknown-none-softfloat.tar.gz=1d1e555bb8af601d8df16b80dd263391a4c0805e1203c618fb370de1911a5a17 | |
| 97 | dist/2024-09-04/rust-std-beta-aarch64-unknown-none-softfloat.tar.xz=078d88a6d4882696b3764d10dbd10e0d756752255096690e895903cd83265c70 | |
| 98 | dist/2024-09-04/rust-std-beta-aarch64-unknown-uefi.tar.gz=5933f618e5c99e06c8556871a85016eba58f6de1056468a1ad47823105908fba | |
| 99 | dist/2024-09-04/rust-std-beta-aarch64-unknown-uefi.tar.xz=322f61ff7a6f6b261bbb9c592f50a39fa179c1f870d911a57b2afda7d7b2d196 | |
| 100 | dist/2024-09-04/rust-std-beta-arm-linux-androideabi.tar.gz=e66bc47a75e12569032c81f6c950513e3fc78cf75e496e9873792b4c83f3dca1 | |
| 101 | dist/2024-09-04/rust-std-beta-arm-linux-androideabi.tar.xz=9a84da40c9e5fb55e1ebad0dc9b724fe9d71d86bea0d2227315590f290fdce13 | |
| 102 | dist/2024-09-04/rust-std-beta-arm-unknown-linux-gnueabi.tar.gz=3e8b535ec051eaaf63490649b1258ae64f1786abca6967bdc3eb6c6da96a4d81 | |
| 103 | dist/2024-09-04/rust-std-beta-arm-unknown-linux-gnueabi.tar.xz=4936561a884b3b725a9b78651ea05a36da5e643be4e574416e12ba1c1e5f37d9 | |
| 104 | dist/2024-09-04/rust-std-beta-arm-unknown-linux-gnueabihf.tar.gz=00eb51ffccdac33a39da37878104dded2c5efa01da5adf8bd932a0d9fb49d17b | |
| 105 | dist/2024-09-04/rust-std-beta-arm-unknown-linux-gnueabihf.tar.xz=3eb187c4a6f416672a8a36997aca5f04bab9ec6aee3a0d1f4ad5a0ed950605c3 | |
| 106 | dist/2024-09-04/rust-std-beta-arm-unknown-linux-musleabi.tar.gz=66752ad65876dad43c19973f8967a098236f2605d2aa82df5b0f040247e049c3 | |
| 107 | dist/2024-09-04/rust-std-beta-arm-unknown-linux-musleabi.tar.xz=f508b8c7956209c87259b38bebe5576ca8a5662a4d4747941082dd39d991610e | |
| 108 | dist/2024-09-04/rust-std-beta-arm-unknown-linux-musleabihf.tar.gz=926f2839c6627c822aa9f494e99030873987b6fca66364cc12ba468928a93b9c | |
| 109 | dist/2024-09-04/rust-std-beta-arm-unknown-linux-musleabihf.tar.xz=e2be0999ea8df01c1029b0976861162c9c60e41a87b4097345f2c5822777ee2b | |
| 110 | dist/2024-09-04/rust-std-beta-arm64ec-pc-windows-msvc.tar.gz=ec912c9e372cd0ae1a754305f0645580cf40f9742c4cbcc54952e613d47f595e | |
| 111 | dist/2024-09-04/rust-std-beta-arm64ec-pc-windows-msvc.tar.xz=f86091e5d806a9b4efa388e036ee69fa63fca68feca174c6670cd04966e2725f | |
| 112 | dist/2024-09-04/rust-std-beta-armebv7r-none-eabi.tar.gz=d51aa780c5df5b8b2e1fbbe97f79914ed083ea13528c43cca797ab8931a418d2 | |
| 113 | dist/2024-09-04/rust-std-beta-armebv7r-none-eabi.tar.xz=19cbb2d1d8a6a3a33669da9fab7eb48f78f0682d777d2c2f188daf6d91895bc7 | |
| 114 | dist/2024-09-04/rust-std-beta-armebv7r-none-eabihf.tar.gz=a1ae798b4eaf206510c33d5af1d4c99ed553fce89413449a5f82d5b80a2558aa | |
| 115 | dist/2024-09-04/rust-std-beta-armebv7r-none-eabihf.tar.xz=a0cb421635b927e5b255238658c9f9f5a0b2da60e05c993ecbda35af9318d6bc | |
| 116 | dist/2024-09-04/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.gz=5f9995804004211baefab1d230089a5719bce40b632bd3380044142a89ae5f2d | |
| 117 | dist/2024-09-04/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.xz=66f410541f2f53d44b2a2931b10a229c8143d6e9caabadea2df40704aad71854 | |
| 118 | dist/2024-09-04/rust-std-beta-armv5te-unknown-linux-musleabi.tar.gz=64b62816adc9574f6961832a4c469e1103057ed553a4c42796e3af4962dc694a | |
| 119 | dist/2024-09-04/rust-std-beta-armv5te-unknown-linux-musleabi.tar.xz=3c0b3741af7f9b50d041dd52fe86fb4144c295632a6eba0197e77ac4ca94ab27 | |
| 120 | dist/2024-09-04/rust-std-beta-armv7-linux-androideabi.tar.gz=aa3d37e6fc483c798a9debecf2ae7609609d0560baebb90733582b9bee15c493 | |
| 121 | dist/2024-09-04/rust-std-beta-armv7-linux-androideabi.tar.xz=ed88cf7c141efd01eceb81b3b85e4eef38f559d8652d2fc4bf3395f4e3d2ef48 | |
| 122 | dist/2024-09-04/rust-std-beta-armv7-unknown-linux-gnueabi.tar.gz=f8b34e2dd9bb5b2ea008bf6a69944da389d8d086a1ece57c1572c749717f4df8 | |
| 123 | dist/2024-09-04/rust-std-beta-armv7-unknown-linux-gnueabi.tar.xz=7ae6076c42fecf7b92305af4220abd3d724d49d96def617a67db1ef298b74bb5 | |
| 124 | dist/2024-09-04/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.gz=4e13553b0288f4cd046372c080f4968a2b69bcb489f6929e98e72682b601d4cc | |
| 125 | dist/2024-09-04/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.xz=dbaeb0445cfc110d7879a23ea7c4034cebb4158cd9781d8719f51864356a15d4 | |
| 126 | dist/2024-09-04/rust-std-beta-armv7-unknown-linux-musleabi.tar.gz=164fa06abffc38aaf81c86aeb50fde51c96d713bb78d759a6f7e668c7967bdfb | |
| 127 | dist/2024-09-04/rust-std-beta-armv7-unknown-linux-musleabi.tar.xz=2ec4d5e339593555d02ea738ae1815e27d108fce5faeffd503308780c80a1a8d | |
| 128 | dist/2024-09-04/rust-std-beta-armv7-unknown-linux-musleabihf.tar.gz=36a09d9287c9d89b3946dc6aea2ce846e754ca2b07b667035f62e8d00c81587c | |
| 129 | dist/2024-09-04/rust-std-beta-armv7-unknown-linux-musleabihf.tar.xz=573316d483a27930bd1423ae8c1f2624dba141865150a41a5be317cc53fd850a | |
| 130 | dist/2024-09-04/rust-std-beta-armv7-unknown-linux-ohos.tar.gz=487feddaa3b11ad15b544e3338f4dfeb1f5297ce5d851dec1df36eee7bc016a2 | |
| 131 | dist/2024-09-04/rust-std-beta-armv7-unknown-linux-ohos.tar.xz=866f612bc4fce03e851eb0b370282b35b066018c2b2467d265cbdde4bcc8afbd | |
| 132 | dist/2024-09-04/rust-std-beta-armv7a-none-eabi.tar.gz=3b2f1fefd2d97006264e5ce50839c8c22e9f6553f639e95c8bcc5bd01c54bead | |
| 133 | dist/2024-09-04/rust-std-beta-armv7a-none-eabi.tar.xz=55294ba0b8da663399c427b57157f4a3e43b117c77e011801410a9bfb62584a0 | |
| 134 | dist/2024-09-04/rust-std-beta-armv7r-none-eabi.tar.gz=60ef291da36a614ddfd38c8bac0519113dc1203603181ba3a581df074fb62f07 | |
| 135 | dist/2024-09-04/rust-std-beta-armv7r-none-eabi.tar.xz=6dde05a2b3a57ae340f699f959e7032bb6e53cf7e1ea24bf1dd88766dba2dcdf | |
| 136 | dist/2024-09-04/rust-std-beta-armv7r-none-eabihf.tar.gz=cc2ae41c8c8ee69f26eb55a033e5c6c23ec1e968aaa4c2e03357b62056176725 | |
| 137 | dist/2024-09-04/rust-std-beta-armv7r-none-eabihf.tar.xz=dc7d1e0637369b0a32f8730a771e4b059ce45131b51beb276de8c03e153834b5 | |
| 138 | dist/2024-09-04/rust-std-beta-i586-pc-windows-msvc.tar.gz=d6ce6f7d1412c1e0ec60a09c9db3d9bcbd0075617dd1756fa82e93d3df0ef8e4 | |
| 139 | dist/2024-09-04/rust-std-beta-i586-pc-windows-msvc.tar.xz=60ff61cf60ac63a6c1ce3c6558351e873968ea1f812afdc7516ae5d19d85e54e | |
| 140 | dist/2024-09-04/rust-std-beta-i586-unknown-linux-gnu.tar.gz=4f5204d8d51ecbf0768419076c94dde6e0c776a9403e3e108866eec3faa68d06 | |
| 141 | dist/2024-09-04/rust-std-beta-i586-unknown-linux-gnu.tar.xz=3ba0815668b11d682a54bfc4731aca5f7a821d77ab8ac32f9922bf9d684d72b4 | |
| 142 | dist/2024-09-04/rust-std-beta-i586-unknown-linux-musl.tar.gz=ac1094f3e22829c4e3e27a91dae48f84ab2bca4373a6e851bdee807887e145ab | |
| 143 | dist/2024-09-04/rust-std-beta-i586-unknown-linux-musl.tar.xz=6547347750eefb619ac15256a3e1ef09c3ee633d73b23aae239cfcf4261f0d16 | |
| 144 | dist/2024-09-04/rust-std-beta-i686-linux-android.tar.gz=af1e7557a1008392a0c2eee4f9e6b26ca56b21be2838ff4a4e3784363b1c3423 | |
| 145 | dist/2024-09-04/rust-std-beta-i686-linux-android.tar.xz=b5d395b1c6994447b3358058aaf2219f952cb9fe6d5df0d8a533b9c2ed84134c | |
| 146 | dist/2024-09-04/rust-std-beta-i686-pc-windows-gnu.tar.gz=a0c0535feb405bf313035cdbc690fd80c18e1975ef0da2fcaeaeab66eb8ee461 | |
| 147 | dist/2024-09-04/rust-std-beta-i686-pc-windows-gnu.tar.xz=85b08876c40d2bc1b44bf7d64319d1dae3af2dbd75cf3e3f37b3ea20bd21209c | |
| 148 | dist/2024-09-04/rust-std-beta-i686-pc-windows-gnullvm.tar.gz=60c37fb7de68381a3665728eb6a74ea017d81e2dcae11acf683cebcef7267487 | |
| 149 | dist/2024-09-04/rust-std-beta-i686-pc-windows-gnullvm.tar.xz=a97edc7de6792da17dbcb6b5a67da4aa79784921c2b160185b2c8a806bd4945b | |
| 150 | dist/2024-09-04/rust-std-beta-i686-pc-windows-msvc.tar.gz=ea25bfabaad2bc02b0d37672bdf9357f317fd27031ef6039460e25c066917b11 | |
| 151 | dist/2024-09-04/rust-std-beta-i686-pc-windows-msvc.tar.xz=ef65a47d79945d6375347c9889c3ec3250d4635e1918689cc1f992b7daf4f547 | |
| 152 | dist/2024-09-04/rust-std-beta-i686-unknown-freebsd.tar.gz=5c4ca0b3bca99fc468bc7ada8ef1d202e9be8ba9808298485654ceab545538e8 | |
| 153 | dist/2024-09-04/rust-std-beta-i686-unknown-freebsd.tar.xz=59ffa74e46e807cacd4ea0a1b16ce0ec7152c4458ad9f86feea82162b1c53da6 | |
| 154 | dist/2024-09-04/rust-std-beta-i686-unknown-linux-gnu.tar.gz=dc535c0b1fe81cc6d1bbd8fecbc0625cb85c44a6f10dd8641fb8ae88083febc5 | |
| 155 | dist/2024-09-04/rust-std-beta-i686-unknown-linux-gnu.tar.xz=624ce72e0b60a7b0d9a06b6925fd0e9a3bd50d9d7ed59db4a16145ff5381c232 | |
| 156 | dist/2024-09-04/rust-std-beta-i686-unknown-linux-musl.tar.gz=6d43cf9f2dc34205616b17eafa8bf28f951de538e6d80ab4993d9b840b72ba49 | |
| 157 | dist/2024-09-04/rust-std-beta-i686-unknown-linux-musl.tar.xz=b397f611d609167ddf2b5699d7cfef9da9c6c78988c7ca2c32b2f81f6640eba6 | |
| 158 | dist/2024-09-04/rust-std-beta-i686-unknown-uefi.tar.gz=878584e638e92902521231a4b578ae1828d1e06093104b6ceca9a22a6c05939d | |
| 159 | dist/2024-09-04/rust-std-beta-i686-unknown-uefi.tar.xz=2806b9124d6145b65bfefc2e72a8ec3f745d3972904b7a2546bcaf649028a332 | |
| 160 | dist/2024-09-04/rust-std-beta-loongarch64-unknown-linux-gnu.tar.gz=eb2792e0b57b36ed03762eff460bfbb7d8b28aaa309702e7e6414eba0a7d0e63 | |
| 161 | dist/2024-09-04/rust-std-beta-loongarch64-unknown-linux-gnu.tar.xz=c36d7526ad190b15a41a1695be4b813d09d649395b1e91bf6dadc336333c690d | |
| 162 | dist/2024-09-04/rust-std-beta-loongarch64-unknown-linux-musl.tar.gz=d891dc7b3c1d05a1c245076a6656f2ad33cba79073e36e8e1eb11ab0c0045cdd | |
| 163 | dist/2024-09-04/rust-std-beta-loongarch64-unknown-linux-musl.tar.xz=6dbbd097bba35b9f0465a6d6b4d19d8b4700dbeecc1b0919aa99c72cad564a0a | |
| 164 | dist/2024-09-04/rust-std-beta-loongarch64-unknown-none.tar.gz=54da489ea59169e39b50d0be0221e20cf03bdad413854e0f35f66c323bf4e88e | |
| 165 | dist/2024-09-04/rust-std-beta-loongarch64-unknown-none.tar.xz=4c360c531107de92b695dd389514dc0af053a04d28c566a06a25e467d5ab548f | |
| 166 | dist/2024-09-04/rust-std-beta-loongarch64-unknown-none-softfloat.tar.gz=7ce834710452cb0569cdd234698f647db87e774d3e964493e17017a81a417aba | |
| 167 | dist/2024-09-04/rust-std-beta-loongarch64-unknown-none-softfloat.tar.xz=3e554450f5107e02335fa14fc7c7a2a3d4718741001f0f4e43984a3c0841ddf4 | |
| 168 | dist/2024-09-04/rust-std-beta-nvptx64-nvidia-cuda.tar.gz=e8c8607e58379162fe0ec072bd544c97d73619df88eb56aeccdf2ebd5357f1b3 | |
| 169 | dist/2024-09-04/rust-std-beta-nvptx64-nvidia-cuda.tar.xz=1dd759c92e6c1f67d5b697e1034b4962434a17211383741d0cc71acda9fcf209 | |
| 170 | dist/2024-09-04/rust-std-beta-powerpc-unknown-linux-gnu.tar.gz=83907d49dd4cf4f73c1295571400c9761bae7a3b2447c140a358a07710e28f93 | |
| 171 | dist/2024-09-04/rust-std-beta-powerpc-unknown-linux-gnu.tar.xz=f1ec605497fb3d7d364f2dfb7bc5c4898940518c1712b0271372ee608d61fd34 | |
| 172 | dist/2024-09-04/rust-std-beta-powerpc64-unknown-linux-gnu.tar.gz=ac2b94c0f76c1f23be43880c01aab0a45d47e48a6c53b5dcfcf4e9507aa481e9 | |
| 173 | dist/2024-09-04/rust-std-beta-powerpc64-unknown-linux-gnu.tar.xz=129ff2031d8ae69c34e944516bb47e093a2f2b47972bd401337fc1dc8b0f2b93 | |
| 174 | dist/2024-09-04/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.gz=2dd17129ca857bfa97d8ae3429984f80a116cc9f967809b7e5bdcc5845398a30 | |
| 175 | dist/2024-09-04/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.xz=06426a601db3dfc60f01b03bc201d21cc6bdc9b633a564e7025518decb91fea1 | |
| 176 | dist/2024-09-04/rust-std-beta-riscv32i-unknown-none-elf.tar.gz=80bcbeed550e6ac30e9826cb801be5206d7937d2d940fca2d40ddabec62e2111 | |
| 177 | dist/2024-09-04/rust-std-beta-riscv32i-unknown-none-elf.tar.xz=2994ee26443be51f11e8cc6e66aa2ee38e7f9440efbe0aa6aa2c513b3fe07f33 | |
| 178 | dist/2024-09-04/rust-std-beta-riscv32im-unknown-none-elf.tar.gz=09f2b6dd18ebff39077a252e0d4b63b3557a49fb3a4f218f50f127aa44f653ec | |
| 179 | dist/2024-09-04/rust-std-beta-riscv32im-unknown-none-elf.tar.xz=156c0ef4be19442b8f59269815e570faa464332ccd2a8db91828eff9ab702ea7 | |
| 180 | dist/2024-09-04/rust-std-beta-riscv32imac-unknown-none-elf.tar.gz=037ceaaf4b1356f72d16f2a6c0dfe50b1df8a82743da79262b020712ffcfb7ff | |
| 181 | dist/2024-09-04/rust-std-beta-riscv32imac-unknown-none-elf.tar.xz=a6e6f00d5df339ac19ebe2c661a5a4ec9b648328767db864b3db1bde0b330bfe | |
| 182 | dist/2024-09-04/rust-std-beta-riscv32imafc-unknown-none-elf.tar.gz=6da55a90ba454e77dd2c90d5d5c5ed833befab415ba65adf27d8e36645b189c0 | |
| 183 | dist/2024-09-04/rust-std-beta-riscv32imafc-unknown-none-elf.tar.xz=9213accb8bc2b3a678c3b3cb4300015b1cc52798157e3898d99699b96bac486d | |
| 184 | dist/2024-09-04/rust-std-beta-riscv32imc-unknown-none-elf.tar.gz=5504f5fe7b45570922f7901476b8ac1eb28e9a7643bf5ace75bb368a644a05f8 | |
| 185 | dist/2024-09-04/rust-std-beta-riscv32imc-unknown-none-elf.tar.xz=50109eb03c075ced8ebcff0909450f173e00491efece5874b8b59ad750bfc9ad | |
| 186 | dist/2024-09-04/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.gz=1ed3d0c1066b52dd2174ed45635386ff22798de8cee92765503fbcf71463094a | |
| 187 | dist/2024-09-04/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.xz=e2b22ed31374775441c6d80da80a52bc7558a1363776363ae341e78d0abf34fb | |
| 188 | dist/2024-09-04/rust-std-beta-riscv64gc-unknown-linux-musl.tar.gz=eff055a0e773741c4c2101791feea744c57ae95c50ad32ebec616daab1d098c8 | |
| 189 | dist/2024-09-04/rust-std-beta-riscv64gc-unknown-linux-musl.tar.xz=680c9c2de4c7abf391d073709988593eb1daffe19876bd789a0f810f9d8d8458 | |
| 190 | dist/2024-09-04/rust-std-beta-riscv64gc-unknown-none-elf.tar.gz=ae71d4f0789955cc883948c75aad9e492e37c206a64561705c8b7a9fec243f3e | |
| 191 | dist/2024-09-04/rust-std-beta-riscv64gc-unknown-none-elf.tar.xz=f41ecbae85295dda2dde95653a059be1852eacc28c175d36cb82cdacbf97a5e9 | |
| 192 | dist/2024-09-04/rust-std-beta-riscv64imac-unknown-none-elf.tar.gz=1db39d0674e227b0fcacbc9de7aea52a349f515aaa8ea595cfbd91c6138e0b4c | |
| 193 | dist/2024-09-04/rust-std-beta-riscv64imac-unknown-none-elf.tar.xz=971c6dd1c7e3c6ab14d6d5f563edf974c87cbfd2a2028bced6e01175c8abafe6 | |
| 194 | dist/2024-09-04/rust-std-beta-s390x-unknown-linux-gnu.tar.gz=029150a3c19afdafaff023ffd80f7aa1c2cfce7d7464339b0873a6e3da10a923 | |
| 195 | dist/2024-09-04/rust-std-beta-s390x-unknown-linux-gnu.tar.xz=22a4612a5a7b38adb3e63ec8526444e51fe222c125c2ba51499987a3906b1cf5 | |
| 196 | dist/2024-09-04/rust-std-beta-sparc64-unknown-linux-gnu.tar.gz=069c8fc749bc2ed94179af8e38849b83912c84cd551c4bf27f95e99def8ed0fc | |
| 197 | dist/2024-09-04/rust-std-beta-sparc64-unknown-linux-gnu.tar.xz=5b436df8a26688cc9853f5e12735187e9924a44101e21c4e59fc3dd38778e39a | |
| 198 | dist/2024-09-04/rust-std-beta-sparcv9-sun-solaris.tar.gz=77f6b8e4760ea43aac97ebb177223ad943fbbcc55dc3656afa400d7d1ea35787 | |
| 199 | dist/2024-09-04/rust-std-beta-sparcv9-sun-solaris.tar.xz=d2b3e49982ccdb966f420eaba9d582108b227f1acb485f0b176762871d41ef3c | |
| 200 | dist/2024-09-04/rust-std-beta-thumbv6m-none-eabi.tar.gz=5e511b55cc961482998cca16def2424e749cf83a46a52b235e902baf8a653cca | |
| 201 | dist/2024-09-04/rust-std-beta-thumbv6m-none-eabi.tar.xz=8491ec0a3233b04909ad307bf679d6a012fe153eb9ae544956c8fa87a57dd55c | |
| 202 | dist/2024-09-04/rust-std-beta-thumbv7em-none-eabi.tar.gz=9b4d4913146843b01b4b6b7d8e1230c01f764a2ae2433dbb3264bfad14d0b3c6 | |
| 203 | dist/2024-09-04/rust-std-beta-thumbv7em-none-eabi.tar.xz=ee700f3dca7d811a230222627ecc6c22d9850151adf47c2a48fb840a079508aa | |
| 204 | dist/2024-09-04/rust-std-beta-thumbv7em-none-eabihf.tar.gz=d54ea14641f79deb2b661e1fe9e9ff56d85189da5ced0f96c16503892c4b367a | |
| 205 | dist/2024-09-04/rust-std-beta-thumbv7em-none-eabihf.tar.xz=cd1529c6f77a079fbf15bcf81d41b4f18a8572729975b2a3ac91e18841e93495 | |
| 206 | dist/2024-09-04/rust-std-beta-thumbv7m-none-eabi.tar.gz=fe214540eafddf6dc65ca94f1dad3a12df9e92a157060a9c27a730d99a706b28 | |
| 207 | dist/2024-09-04/rust-std-beta-thumbv7m-none-eabi.tar.xz=2b9b1289855f7d9520eab69bc8c4e8505857e44b1e498968e47e3e847ae5a7da | |
| 208 | dist/2024-09-04/rust-std-beta-thumbv7neon-linux-androideabi.tar.gz=dc28759dc83a72d5c8505e90abb98ee55fb0ac53736422c95b631e063f566e5f | |
| 209 | dist/2024-09-04/rust-std-beta-thumbv7neon-linux-androideabi.tar.xz=b25c463af699783e8df43d7ccc5d1692d97e8a1ade8322dcf0cd74246d1d94b8 | |
| 210 | dist/2024-09-04/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.gz=bb8ebf0008749bafb9cee686c7b09db4e4585178b506bc9bec6508577bc98713 | |
| 211 | dist/2024-09-04/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.xz=afb9a8ed9a5dccb0c43eb6a920c647735648a1378413ff1fae754a7e5f972b06 | |
| 212 | dist/2024-09-04/rust-std-beta-thumbv8m.base-none-eabi.tar.gz=b090d076b04e7894a94c1ed892825a3f6d27aa3908d40d1a66f098b9d53f4309 | |
| 213 | dist/2024-09-04/rust-std-beta-thumbv8m.base-none-eabi.tar.xz=3213f7cb7365420b767779edc091a35f9e3a39e9439d0bf542dcc099eff25ce7 | |
| 214 | dist/2024-09-04/rust-std-beta-thumbv8m.main-none-eabi.tar.gz=5d977dc47e7c04d1f729a2a153e2c37ceab7d9a049b111505146e82b7b3bc30b | |
| 215 | dist/2024-09-04/rust-std-beta-thumbv8m.main-none-eabi.tar.xz=8e9cef53163ff70ec8868d11d7c237cf40ced06852fcb193b3ef45232c3cd90a | |
| 216 | dist/2024-09-04/rust-std-beta-thumbv8m.main-none-eabihf.tar.gz=01f1916e4de4401ef0b7c43bfb0df72169f36ab09eda9ee923ef0d6608b8fafb | |
| 217 | dist/2024-09-04/rust-std-beta-thumbv8m.main-none-eabihf.tar.xz=1a9a9fe79884bd8e8e35cc8bcf3d1fb7a82ee4a40c630b78a302aabb047959f1 | |
| 218 | dist/2024-09-04/rust-std-beta-wasm32-unknown-emscripten.tar.gz=66da8c5a7e579df020ef012747f9c8ce6a3094bdf43a99dc3763a9234eda3fff | |
| 219 | dist/2024-09-04/rust-std-beta-wasm32-unknown-emscripten.tar.xz=34ba780c992a10428fac49c9149d1f613fac221dd92866a93795543a991c29af | |
| 220 | dist/2024-09-04/rust-std-beta-wasm32-unknown-unknown.tar.gz=485304f0705ea8ef1a3516cd01e9b63e010af514edc03774cd87284367ed5e04 | |
| 221 | dist/2024-09-04/rust-std-beta-wasm32-unknown-unknown.tar.xz=414608d21dd7cd268ad57a6be916b0be2c95433e2bc14083ff8c4a7a7cc8952b | |
| 222 | dist/2024-09-04/rust-std-beta-wasm32-wasi.tar.gz=c745c8682a54abe37c2734bf0c7931b6d10269eb56c07765e39dd289dab67e01 | |
| 223 | dist/2024-09-04/rust-std-beta-wasm32-wasi.tar.xz=732c12837772531eabc44a7d4a545e130e2ae220d3670748fa2050cd4c65a18b | |
| 224 | dist/2024-09-04/rust-std-beta-wasm32-wasip1.tar.gz=2b54c587ddd908481f5561d6de60c7fdbef234ca2ecec4eb4d4791416038f7db | |
| 225 | dist/2024-09-04/rust-std-beta-wasm32-wasip1.tar.xz=799ee151f0aa3c5ec132f03c42152393d966c9249972967133edef56b30d66ae | |
| 226 | dist/2024-09-04/rust-std-beta-wasm32-wasip1-threads.tar.gz=120b8cad5a2a153bee58ccf81824e6a1c7c16befdd2785f963a9b2dfc350b9f2 | |
| 227 | dist/2024-09-04/rust-std-beta-wasm32-wasip1-threads.tar.xz=5d74a8dc4731ab433cf796e7568122c7ca1463c648d2b49876ae1deaeaefa314 | |
| 228 | dist/2024-09-04/rust-std-beta-wasm32-wasip2.tar.gz=911e60f2976d3b98dc9f6e82f72c459c5e07713e2dde2c7337569a71db2d1218 | |
| 229 | dist/2024-09-04/rust-std-beta-wasm32-wasip2.tar.xz=947d312ec07c6190dcd4abeb493a2b67ac64a9a549ef30372c8eee7164c74883 | |
| 230 | dist/2024-09-04/rust-std-beta-x86_64-apple-darwin.tar.gz=7b6e65885f14982f1112a2c0e8dd3266b1c4313276342ed98f2681432720b8c6 | |
| 231 | dist/2024-09-04/rust-std-beta-x86_64-apple-darwin.tar.xz=cdbe462e3935c5a34415275afe830a6b5edae2fda84ed35e836ae868c884d19f | |
| 232 | dist/2024-09-04/rust-std-beta-x86_64-apple-ios.tar.gz=f75e7896ed5c9b64f817e9b2d6ed4d637e19ff26a14f72a570b4eff532f5b32b | |
| 233 | dist/2024-09-04/rust-std-beta-x86_64-apple-ios.tar.xz=60db5599bdad826b32637dfd2989daa90597b278ac14b42ede3a7c15aed119e0 | |
| 234 | dist/2024-09-04/rust-std-beta-x86_64-apple-ios-macabi.tar.gz=3f57688112d2d80010636724acec5083bce0bc0a901f9ccbd76a09bb21de2b17 | |
| 235 | dist/2024-09-04/rust-std-beta-x86_64-apple-ios-macabi.tar.xz=841dcf3eba0ad5b7bc8a4d55fabca80a1a27a3d697431c251b48912131148b6e | |
| 236 | dist/2024-09-04/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.gz=96af596e4bc63519decc0e17005006aee8a2f22258d86b6efa25a94fbbe62f23 | |
| 237 | dist/2024-09-04/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.xz=4215a327f11bc7fa02546e69cb52c6c7bfe6a1ca602a6bf7a266e11937204bef | |
| 238 | dist/2024-09-04/rust-std-beta-x86_64-linux-android.tar.gz=80849fc95791de8cf98da9ebd405a4e268445b22b9413c8545870fe83f5891c7 | |
| 239 | dist/2024-09-04/rust-std-beta-x86_64-linux-android.tar.xz=f849ad9d7ccc7eda06404e3bd67f150c3d8dfa66609405435fb2ba09c00ca136 | |
| 240 | dist/2024-09-04/rust-std-beta-x86_64-pc-solaris.tar.gz=f871244a44131b1e2f56ad7c77ccb4e7433f39d6b248951f449914a65178bea3 | |
| 241 | dist/2024-09-04/rust-std-beta-x86_64-pc-solaris.tar.xz=933b3b634b5caf57213be093977b0f56ba3609dc9407ac026079f75f4783642d | |
| 242 | dist/2024-09-04/rust-std-beta-x86_64-pc-windows-gnu.tar.gz=28ef28c4b17b5e8a20ae5f19feeb4643864f64ac8e9c68b84f8cec067317c339 | |
| 243 | dist/2024-09-04/rust-std-beta-x86_64-pc-windows-gnu.tar.xz=1e40daa830d390d57c0dd23331849edf45adc0a35d120725bfd9fae43edf13e1 | |
| 244 | dist/2024-09-04/rust-std-beta-x86_64-pc-windows-gnullvm.tar.gz=b9a6e290d7b9c71b4a33164116cc523654c3147168a04fc7608a27397c100944 | |
| 245 | dist/2024-09-04/rust-std-beta-x86_64-pc-windows-gnullvm.tar.xz=a6e1db0945d1a5243caf2d1ad7d24b4dd16f8882d3e88118f203c91ff5e2cd52 | |
| 246 | dist/2024-09-04/rust-std-beta-x86_64-pc-windows-msvc.tar.gz=8d70d70a645b36e6de01b08a34a28a995c73f91e8a285607a5516180d3a93350 | |
| 247 | dist/2024-09-04/rust-std-beta-x86_64-pc-windows-msvc.tar.xz=d5a6fc72bf9dc0b7083d364358232a5df68b2b9f03a1a553bbeecf2a84936cb8 | |
| 248 | dist/2024-09-04/rust-std-beta-x86_64-unknown-freebsd.tar.gz=01e159405178d883deb8eb09e9101826e7591c8d8fd6840133c0e8f77e00e395 | |
| 249 | dist/2024-09-04/rust-std-beta-x86_64-unknown-freebsd.tar.xz=7fddda753b5f3e244de9427de6399052c81df87bd2b76d2c1f9a0fa4d1d1cddf | |
| 250 | dist/2024-09-04/rust-std-beta-x86_64-unknown-fuchsia.tar.gz=2c37eaef53b50d812205ed24de580165bfa800658ab9a9ea503667105119a544 | |
| 251 | dist/2024-09-04/rust-std-beta-x86_64-unknown-fuchsia.tar.xz=8d1e3d290c5736c4e7a48a6b1a88ba18b9e68876638896b31b61917c6fcd2af4 | |
| 252 | dist/2024-09-04/rust-std-beta-x86_64-unknown-illumos.tar.gz=83a57ec9e9696a63dadf9307e0cce117b92be8e9b7d17edfe410d38f75629202 | |
| 253 | dist/2024-09-04/rust-std-beta-x86_64-unknown-illumos.tar.xz=3db6747b556581f02e0cf058b93538785d1eca9aaefe36dc8b7667428fa05ef7 | |
| 254 | dist/2024-09-04/rust-std-beta-x86_64-unknown-linux-gnu.tar.gz=fe737fb11bd2a16b7636013f37041a35126f0bf8b2c562ac38384d45e49088c4 | |
| 255 | dist/2024-09-04/rust-std-beta-x86_64-unknown-linux-gnu.tar.xz=a7a3f5245067b2967bbc4bd010ac3a6e9613cc9b6462c53cdcf0b91eab6cddbb | |
| 256 | dist/2024-09-04/rust-std-beta-x86_64-unknown-linux-gnux32.tar.gz=8b3fa007713d4e37de79d5662a3de446d378e00fc631478e465fb170447c49ea | |
| 257 | dist/2024-09-04/rust-std-beta-x86_64-unknown-linux-gnux32.tar.xz=c2dd95e94f9a9bc2d31e807a3b7cc5cb43a994cd4400ac1636ade3005344146b | |
| 258 | dist/2024-09-04/rust-std-beta-x86_64-unknown-linux-musl.tar.gz=a294420b029900027530932ebd29cbd3f17672fffc60128122473088329f8cb8 | |
| 259 | dist/2024-09-04/rust-std-beta-x86_64-unknown-linux-musl.tar.xz=72a1c8052534e1b986ebd1bb5364de9e9e67353cfc6de7341f759d8da370bf2d | |
| 260 | dist/2024-09-04/rust-std-beta-x86_64-unknown-linux-ohos.tar.gz=7227b14f3148302d954756bd4df570289aa8dedd8d889b5399821356ac097f8a | |
| 261 | dist/2024-09-04/rust-std-beta-x86_64-unknown-linux-ohos.tar.xz=61cf15b98ba67fb648ee87901bc33644efc342c2b6401ab8b6a14cae755cbd8d | |
| 262 | dist/2024-09-04/rust-std-beta-x86_64-unknown-netbsd.tar.gz=61b604f112031aadd7ad87e535cbb4966c53099e276fc76d99fecd0e912b2e28 | |
| 263 | dist/2024-09-04/rust-std-beta-x86_64-unknown-netbsd.tar.xz=428a0a6955266ac0e74b11bb4c58a461c041f13f241d5a2d698139b4b5839ad5 | |
| 264 | dist/2024-09-04/rust-std-beta-x86_64-unknown-none.tar.gz=c8b29984bf2b6d77893cda301e55dd128da76bad7dd87c751aa5585add2262fd | |
| 265 | dist/2024-09-04/rust-std-beta-x86_64-unknown-none.tar.xz=1460566b927586f6afa531aa1cefa9aec0d4e829a08a151638a42c255b6a7ef3 | |
| 266 | dist/2024-09-04/rust-std-beta-x86_64-unknown-redox.tar.gz=17503716bb940d50db15bd1b467fe03ff15474f1b0b162eb3f2891699d898768 | |
| 267 | dist/2024-09-04/rust-std-beta-x86_64-unknown-redox.tar.xz=66007a1f995597a697747886eacbe38c9d6a588b1ed365e6b4b522c72bc7b8af | |
| 268 | dist/2024-09-04/rust-std-beta-x86_64-unknown-uefi.tar.gz=b612bac841c9f93bc6189971bf82df47e8730cf1696d2d6f3344be67a6c28f0c | |
| 269 | dist/2024-09-04/rust-std-beta-x86_64-unknown-uefi.tar.xz=3dd0f70f8f226160700a52c19aebc2f27801360a8d2882702c5a0be94560da3b | |
| 270 | dist/2024-09-04/cargo-beta-aarch64-apple-darwin.tar.gz=3efe0d5356824c1620e223686c81cf10b629db0a0c385c3177b5fe1866776b5c | |
| 271 | dist/2024-09-04/cargo-beta-aarch64-apple-darwin.tar.xz=07deeec79d74a39b0cf971bd980936eb476005bf0e832adef9e4521bba3c010b | |
| 272 | dist/2024-09-04/cargo-beta-aarch64-pc-windows-msvc.tar.gz=c9da3632a36a2db512015580bd20e0b5207f8a0d98ae093a99755e4c512215f8 | |
| 273 | dist/2024-09-04/cargo-beta-aarch64-pc-windows-msvc.tar.xz=b0b9aabd90863c1671ad80955277c2f006654779837cb1358774b8189fba357b | |
| 274 | dist/2024-09-04/cargo-beta-aarch64-unknown-linux-gnu.tar.gz=cb862535909b1f0fea6ee40a6a888f2f860f95b8700b1d5167bd7a41b9e33958 | |
| 275 | dist/2024-09-04/cargo-beta-aarch64-unknown-linux-gnu.tar.xz=b1ff8f714cda2c98a7129e861adcf33245bd84bdfbdcec9fb1a89545dcd033f7 | |
| 276 | dist/2024-09-04/cargo-beta-aarch64-unknown-linux-musl.tar.gz=5c3659e979393c8c1dbe1a6ccb09eea412671363e228f0c7ab4bd4896cd48470 | |
| 277 | dist/2024-09-04/cargo-beta-aarch64-unknown-linux-musl.tar.xz=0435e1332b1bc40a280fc867eab54e925135eba774c3bc0553a8bb100d644f59 | |
| 278 | dist/2024-09-04/cargo-beta-arm-unknown-linux-gnueabi.tar.gz=6f7f079ef04c4b1d14864cba67ec650a3e43f3baa81fea1797d00067f22a72a8 | |
| 279 | dist/2024-09-04/cargo-beta-arm-unknown-linux-gnueabi.tar.xz=549607bdeacd26fa770ecb00ce54cb3ea72c5568e65966c1fddc3a540b9f6e6a | |
| 280 | dist/2024-09-04/cargo-beta-arm-unknown-linux-gnueabihf.tar.gz=e23b18a2a86bca5320b66c54d43a54d90db1b787443cb0e04d66e9d7428fece7 | |
| 281 | dist/2024-09-04/cargo-beta-arm-unknown-linux-gnueabihf.tar.xz=5968c534ce88a2574a4f59a0ced82df36aef9c7338ed9c718e85aad514a792f4 | |
| 282 | dist/2024-09-04/cargo-beta-armv7-unknown-linux-gnueabihf.tar.gz=3170e39d306e797e5631884c629ecb33a54635056b5a71fbebe5372c1c34da37 | |
| 283 | dist/2024-09-04/cargo-beta-armv7-unknown-linux-gnueabihf.tar.xz=76b729642fdba25c015e49e444e158170d3ed2ac0a533ba7c6095ecdc0862ba5 | |
| 284 | dist/2024-09-04/cargo-beta-i686-pc-windows-gnu.tar.gz=c58826189772af945c9d40868e80d64359f4108afa06d150a3d350323b0eb8df | |
| 285 | dist/2024-09-04/cargo-beta-i686-pc-windows-gnu.tar.xz=1b644d661778bfcbec892eab17bee06861940037992821c4ded8321a69c0f6a8 | |
| 286 | dist/2024-09-04/cargo-beta-i686-pc-windows-msvc.tar.gz=e026eac2c2e891976e085d26591d85000dccf3c3654f3edd65e99c6c0ba43574 | |
| 287 | dist/2024-09-04/cargo-beta-i686-pc-windows-msvc.tar.xz=e7307b2e55302228c5036991ca6141a5202a16f43b0148607f3802fdc90aa0cc | |
| 288 | dist/2024-09-04/cargo-beta-i686-unknown-linux-gnu.tar.gz=0a00604bad2096cd0b0db59a1b41b5737696015a4ddc60f9b1132829a4cd0a5f | |
| 289 | dist/2024-09-04/cargo-beta-i686-unknown-linux-gnu.tar.xz=a623eecb18a21b2dc6a4b62876b8fa4fc467c53fdd0cfdac493f89d619be5aa7 | |
| 290 | dist/2024-09-04/cargo-beta-loongarch64-unknown-linux-gnu.tar.gz=64955892d99d0e7f0042016d7a5e3ac87f89b6f514b1934611050f89aa5f6a28 | |
| 291 | dist/2024-09-04/cargo-beta-loongarch64-unknown-linux-gnu.tar.xz=3c7c3061c466fc4a1eb836c97cab95d511778d77d220189a6a77f8e5b46e4888 | |
| 292 | dist/2024-09-04/cargo-beta-loongarch64-unknown-linux-musl.tar.gz=be1c255840307bd24c2c8b5c92e2fa0eed6037daf3ed9597e17bc56f313ef506 | |
| 293 | dist/2024-09-04/cargo-beta-loongarch64-unknown-linux-musl.tar.xz=d0e456bc8b64a0ee778e69eac75b6a258c37f7b2d06496a8dfcc47d91e1c2dd1 | |
| 294 | dist/2024-09-04/cargo-beta-powerpc-unknown-linux-gnu.tar.gz=b9cd94c4ac9a11eece8712b325d08007b641d5da7487fd38b30dbaf0f3d1b5a4 | |
| 295 | dist/2024-09-04/cargo-beta-powerpc-unknown-linux-gnu.tar.xz=68dd4a74494fe8f02781a2b338eff5f5cc78d66048eddd3ed7cc3e31dcecd2c8 | |
| 296 | dist/2024-09-04/cargo-beta-powerpc64-unknown-linux-gnu.tar.gz=b464ad7a1233e3ad5129340e623a60d2ad0882843acbef60a9aed45a453ccac1 | |
| 297 | dist/2024-09-04/cargo-beta-powerpc64-unknown-linux-gnu.tar.xz=1167f3d38628c01b11dfb9f66eacdf4cd519b46ea1b8c9d182a390e7d552a933 | |
| 298 | dist/2024-09-04/cargo-beta-powerpc64le-unknown-linux-gnu.tar.gz=eb16d3791a79aa384326e2e79aeafd8d3e27adf4733a5bcca441e278e578b60e | |
| 299 | dist/2024-09-04/cargo-beta-powerpc64le-unknown-linux-gnu.tar.xz=d100dcb6437e87b3b687a7059dd932567855f68d962a109268fcce5a5aa688c6 | |
| 300 | dist/2024-09-04/cargo-beta-riscv64gc-unknown-linux-gnu.tar.gz=ee771d98286302d4a8a93ba5165c342a2fbe770bf7758f8bbc490ad188d2e5cc | |
| 301 | dist/2024-09-04/cargo-beta-riscv64gc-unknown-linux-gnu.tar.xz=d2e9eb5a1800545eec4186b5252737f3b3a02d232473e6864e4c6fd752a69623 | |
| 302 | dist/2024-09-04/cargo-beta-s390x-unknown-linux-gnu.tar.gz=b35ef65a54c9dd068a699f4210c0c88bd2777308fd7ddad3c7d0b9a1c994657e | |
| 303 | dist/2024-09-04/cargo-beta-s390x-unknown-linux-gnu.tar.xz=eaee5c891aab499438427c2c965c2c8f4471a3b051effee139f251f544ac4ac4 | |
| 304 | dist/2024-09-04/cargo-beta-x86_64-apple-darwin.tar.gz=917ba277cb3f050fb3e65126b587245bf89891256faec33a57e2b1a064075534 | |
| 305 | dist/2024-09-04/cargo-beta-x86_64-apple-darwin.tar.xz=179d6fe24981d477eb806ba714bd639750577cb9de2d152116e994d3955ade38 | |
| 306 | dist/2024-09-04/cargo-beta-x86_64-pc-windows-gnu.tar.gz=6aa52989d1ccb25b03433dec436507455256cb1e2ed305ba747c342551d0778f | |
| 307 | dist/2024-09-04/cargo-beta-x86_64-pc-windows-gnu.tar.xz=bc0403c00fa2093f09d95b1ad091850b2450f4e1d7fac225a730d7363074806b | |
| 308 | dist/2024-09-04/cargo-beta-x86_64-pc-windows-msvc.tar.gz=5c1e018191c296ddc443699e48c4f1a3e700983fc45ea230172f35881d09e103 | |
| 309 | dist/2024-09-04/cargo-beta-x86_64-pc-windows-msvc.tar.xz=f1b44ff315f5332815263d5b0a1cd06f852431acbf5cc902bb6723c3398e11d6 | |
| 310 | dist/2024-09-04/cargo-beta-x86_64-unknown-freebsd.tar.gz=7da980ccdb2d6bc0946749fcceaed7124f311b38bf28cef0797ca85909f5d5fb | |
| 311 | dist/2024-09-04/cargo-beta-x86_64-unknown-freebsd.tar.xz=a935462749686fb68eac699ea67ef1afaa22ed0b147d2e4d0a6712f225341fa2 | |
| 312 | dist/2024-09-04/cargo-beta-x86_64-unknown-illumos.tar.gz=ccc3d29e88482885090f6fb954518bcb0b6bd3f54283702df9e0e80b78454c01 | |
| 313 | dist/2024-09-04/cargo-beta-x86_64-unknown-illumos.tar.xz=c0cb33e5088f2b9f5fe8bedb3915fec10e7f65563013b914e0738486b5e8ebab | |
| 314 | dist/2024-09-04/cargo-beta-x86_64-unknown-linux-gnu.tar.gz=84fdbbc0912c4020dd1baec1d603c5d5c1986c7b321d3d9c0c42184aa6347f15 | |
| 315 | dist/2024-09-04/cargo-beta-x86_64-unknown-linux-gnu.tar.xz=8f8948750141c3ee8a50e575f196bd972876e784cf1793b256a5a9462c9e3d44 | |
| 316 | dist/2024-09-04/cargo-beta-x86_64-unknown-linux-musl.tar.gz=9ef6b7450b94ce202f1b603151075bf8f595022f2c52f6bcd1c4a72423db2b80 | |
| 317 | dist/2024-09-04/cargo-beta-x86_64-unknown-linux-musl.tar.xz=5b63b98d67e211057fbaeb1db3721b90252a331143ca267bb30eebca4ac01cdd | |
| 318 | dist/2024-09-04/cargo-beta-x86_64-unknown-netbsd.tar.gz=69d500e2fca1c44fea31310b0636a9af009d4ec96b5ed2335864c47350fa7b59 | |
| 319 | dist/2024-09-04/cargo-beta-x86_64-unknown-netbsd.tar.xz=7da3c2641f0ecdbd8b770402356416750a52265a6848d3734fce2195c889768a | |
| 320 | dist/2024-09-04/clippy-beta-aarch64-apple-darwin.tar.gz=15395c04235f2475d5e41371e2797f181af71275f82f04fbb885b1cd7a197f45 | |
| 321 | dist/2024-09-04/clippy-beta-aarch64-apple-darwin.tar.xz=8be6fb9e0cafcd262594cfc4a36807bede9e158cbf7eb38c0f25144bf3bfdd1e | |
| 322 | dist/2024-09-04/clippy-beta-aarch64-pc-windows-msvc.tar.gz=b043e41facce81a5fc607f2268330b279d7e26975e409158ac2cbbc841d10f85 | |
| 323 | dist/2024-09-04/clippy-beta-aarch64-pc-windows-msvc.tar.xz=ba41705b213f863416120c28fa4a7959cf41e261cce8233b12fd91aa0157d601 | |
| 324 | dist/2024-09-04/clippy-beta-aarch64-unknown-linux-gnu.tar.gz=b093269be813ea76964de2c03c7380bcefab1e7d6e31c93fd3f374619a99a5f0 | |
| 325 | dist/2024-09-04/clippy-beta-aarch64-unknown-linux-gnu.tar.xz=06d71273208fcbfa5958987038eacda066d4518b5cd6bd7405a981bf841868ae | |
| 326 | dist/2024-09-04/clippy-beta-aarch64-unknown-linux-musl.tar.gz=aa159e61c4986def9d27f55504d822d6023c277a546e95079161577ae2991df4 | |
| 327 | dist/2024-09-04/clippy-beta-aarch64-unknown-linux-musl.tar.xz=7a3023b98a1c72c993d176c85f4790b234c41f35184636d29deeba40d51587a2 | |
| 328 | dist/2024-09-04/clippy-beta-arm-unknown-linux-gnueabi.tar.gz=8e30a0377b780311bf51bdc48dcf233a344cb2fd9ae9aec174bc87d29f94c34b | |
| 329 | dist/2024-09-04/clippy-beta-arm-unknown-linux-gnueabi.tar.xz=488c28d10f45a498b1054fad9feb72a848d0668cd12d29b3a81f5569b1145018 | |
| 330 | dist/2024-09-04/clippy-beta-arm-unknown-linux-gnueabihf.tar.gz=db25c9aa95b08acdaeaba407367a823e9e2094b0616c80b0c8a84d7c2f6c4292 | |
| 331 | dist/2024-09-04/clippy-beta-arm-unknown-linux-gnueabihf.tar.xz=7c320cc979ebdde8753093a0e4b1da850b1b680c1ecd10c5d3e33242af12e4dd | |
| 332 | dist/2024-09-04/clippy-beta-armv7-unknown-linux-gnueabihf.tar.gz=835c0912556cd5b0b180856359db8d75204830984fb1b5f72bf436f137955fa2 | |
| 333 | dist/2024-09-04/clippy-beta-armv7-unknown-linux-gnueabihf.tar.xz=836a54126122c2abfc649982708d97b6451eaf3a31ba556ed73ec1f4269be738 | |
| 334 | dist/2024-09-04/clippy-beta-i686-pc-windows-gnu.tar.gz=90b52880cbd51bacb9597ee4fed07fa13fc399f03c5ba840c0c9e6c0a096b772 | |
| 335 | dist/2024-09-04/clippy-beta-i686-pc-windows-gnu.tar.xz=c41be130f3276c4c905eab580e866682e4f3bbdd11b348f4d1438c67602fb036 | |
| 336 | dist/2024-09-04/clippy-beta-i686-pc-windows-msvc.tar.gz=f023406dc34bb09d020a41fdf6ceb3e60c90dd38380fbbcc26e9f4e144eebca0 | |
| 337 | dist/2024-09-04/clippy-beta-i686-pc-windows-msvc.tar.xz=b21746ec1a2c9fc76ce82917b65c8e73482aaefe5f99282f0c5e9682a3af486e | |
| 338 | dist/2024-09-04/clippy-beta-i686-unknown-linux-gnu.tar.gz=cce9cd9d470250c73437e151622b02f804fff3db045c6de25ee949aed435c383 | |
| 339 | dist/2024-09-04/clippy-beta-i686-unknown-linux-gnu.tar.xz=9565f70c8d90540d464fb1f3b8bff52b77bf55189ab938b2c18bdeed751e9e4c | |
| 340 | dist/2024-09-04/clippy-beta-loongarch64-unknown-linux-gnu.tar.gz=0d1d63a8eca4d0812446f94bc793fbb7660da11babf5d8607d2798749c938a6b | |
| 341 | dist/2024-09-04/clippy-beta-loongarch64-unknown-linux-gnu.tar.xz=db178c0eaddcb318653d4b05fe0d97738440713f0cd120657cc2a3e758d52432 | |
| 342 | dist/2024-09-04/clippy-beta-loongarch64-unknown-linux-musl.tar.gz=a604be9f091f88e97f702f619d86b91bff0a20fbd267200ac1e66df2bd823766 | |
| 343 | dist/2024-09-04/clippy-beta-loongarch64-unknown-linux-musl.tar.xz=93c395e07a8457b8904c470751490326303e2ceaa93b737f8fc521b49dfbd69b | |
| 344 | dist/2024-09-04/clippy-beta-powerpc-unknown-linux-gnu.tar.gz=08aa4a8ccd7569a0513c2443e2b10993cbb92bed531370891452bd3dd8c0eb82 | |
| 345 | dist/2024-09-04/clippy-beta-powerpc-unknown-linux-gnu.tar.xz=f6b0222261e1e2b1465549eda331c16d4ea6729d15e6fe208dbc4cce115e75e7 | |
| 346 | dist/2024-09-04/clippy-beta-powerpc64-unknown-linux-gnu.tar.gz=96e2dca5adb7f5ffe41e5ff30e9419575f3991adde8bdbba023d11f344044dc1 | |
| 347 | dist/2024-09-04/clippy-beta-powerpc64-unknown-linux-gnu.tar.xz=3ced511aca7268960c616d0105da02a92d83b7983b6accbb37eba722eff64cbf | |
| 348 | dist/2024-09-04/clippy-beta-powerpc64le-unknown-linux-gnu.tar.gz=421c27b25b79b9c88e4b65ac7cd0a4f06934a63324c56870cd7fff905869a33e | |
| 349 | dist/2024-09-04/clippy-beta-powerpc64le-unknown-linux-gnu.tar.xz=63254a01ab1a9a21cdb5a0b3a4da9e8ae7921b9ceec2339df4bbfb19ea7c6454 | |
| 350 | dist/2024-09-04/clippy-beta-riscv64gc-unknown-linux-gnu.tar.gz=4ee751b09816886f8edbc431ab8c63df6c664dbedc40a67748fb17a639a070f1 | |
| 351 | dist/2024-09-04/clippy-beta-riscv64gc-unknown-linux-gnu.tar.xz=7e9ffb62ab6c8f1cbb5f9e0b0a3c79cf104dfac09be2ef1d5e6b6c0c34b406c7 | |
| 352 | dist/2024-09-04/clippy-beta-s390x-unknown-linux-gnu.tar.gz=0a49c1e844859f27b1283087c476a559c4c3a4c33c8ce2748165cc5c0b0ed039 | |
| 353 | dist/2024-09-04/clippy-beta-s390x-unknown-linux-gnu.tar.xz=6daec872df52125b3de854ff0962433ba13b7cbe5519edfb29944fbc4cc817ad | |
| 354 | dist/2024-09-04/clippy-beta-x86_64-apple-darwin.tar.gz=6611771ce0e7cc19fbbb9383875edaf7de975b6cf154fcd5cd18a09f09793a36 | |
| 355 | dist/2024-09-04/clippy-beta-x86_64-apple-darwin.tar.xz=1c90c63f87b43797aa04b88e4c1d0fe0f2ad131060fc8495be190d0ebd89a43e | |
| 356 | dist/2024-09-04/clippy-beta-x86_64-pc-windows-gnu.tar.gz=53a04c1426bc151fec4699848e33141df1b04097d4883c07fc07d2bf0bcddf8a | |
| 357 | dist/2024-09-04/clippy-beta-x86_64-pc-windows-gnu.tar.xz=be748b65b238e3e948e2421f82a72d1108ec79651381b1dcdaaa97df15c981df | |
| 358 | dist/2024-09-04/clippy-beta-x86_64-pc-windows-msvc.tar.gz=24ea01230bbf6b4f43094cfcf6c7c72e6d319c493ff3817456c667b89026c608 | |
| 359 | dist/2024-09-04/clippy-beta-x86_64-pc-windows-msvc.tar.xz=37130d66eeaed68f0780b1dc19f2f59a2a0419350920521690d4870d7d71d8f1 | |
| 360 | dist/2024-09-04/clippy-beta-x86_64-unknown-freebsd.tar.gz=4e427b7ea0f334bd6ea8c2de7fc1d5bf43d5333bc7a435cf65543c564fab6e41 | |
| 361 | dist/2024-09-04/clippy-beta-x86_64-unknown-freebsd.tar.xz=b221491159f5352dd392f6ee6419f9d5d693ac347df9863fdac77f2ca1cf6a67 | |
| 362 | dist/2024-09-04/clippy-beta-x86_64-unknown-illumos.tar.gz=9d835b4369fb51ab8c1eafb553b9304548e91dd32784ae81cb783b40985d2eee | |
| 363 | dist/2024-09-04/clippy-beta-x86_64-unknown-illumos.tar.xz=a6780c72c71f2e6c6e1bbc8bc4e639389ab9b7aed0ee7e2e0c21819156b5578e | |
| 364 | dist/2024-09-04/clippy-beta-x86_64-unknown-linux-gnu.tar.gz=613bf471668edb8209910dd13086cbefed0da6dea46dce2013a000ecc4315e45 | |
| 365 | dist/2024-09-04/clippy-beta-x86_64-unknown-linux-gnu.tar.xz=e3328f37cfc89de1aabd89653a42ff54b8dadcc49e651b22fda325c00644309d | |
| 366 | dist/2024-09-04/clippy-beta-x86_64-unknown-linux-musl.tar.gz=d6a7a5ee37587c0b92aabfc5b9466d175cb8d05d209412a5beee8a61c241396f | |
| 367 | dist/2024-09-04/clippy-beta-x86_64-unknown-linux-musl.tar.xz=dc73b566be162eef2032eccb69b3542ab3c72b760fe7eeaacfcd367ee0b20f12 | |
| 368 | dist/2024-09-04/clippy-beta-x86_64-unknown-netbsd.tar.gz=6f1e0be96b59a63a6616b68717c0a393fd99ec1a768affdd5c86249e5eb5d210 | |
| 369 | dist/2024-09-04/clippy-beta-x86_64-unknown-netbsd.tar.xz=30fff8aceaedf6d76c6fc0636c2ddecc97fb66f9219b86299550b7312f043e38 | |
| 370 | dist/2024-09-04/rustfmt-nightly-aarch64-apple-darwin.tar.gz=37a5383ba608540ed57484e221e87f3cd78fd35f068e98f0da1d3932d86d2eff | |
| 371 | dist/2024-09-04/rustfmt-nightly-aarch64-apple-darwin.tar.xz=a3935c24f5ac1d69756f4598f227e43304ede4e35f9808b3db9f04adfecc5445 | |
| 372 | dist/2024-09-04/rustfmt-nightly-aarch64-pc-windows-msvc.tar.gz=0b21dd8c54055102a41f7ad622565c1fc36ff97642f2e2998e48d1cb1ebae196 | |
| 373 | dist/2024-09-04/rustfmt-nightly-aarch64-pc-windows-msvc.tar.xz=2a543dbf79042924e8c05aaeed97ff37089c8f6994977b932bacb0403f11584c | |
| 374 | dist/2024-09-04/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.gz=8d9b19108587e6d8d12270ff025579dc559173245e08b94113bb91a7ada80670 | |
| 375 | dist/2024-09-04/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.xz=d288770b8a85e24b35561129cc2a09c848006c547ce5fa35d33c8ed7e85d5322 | |
| 376 | dist/2024-09-04/rustfmt-nightly-aarch64-unknown-linux-musl.tar.gz=2e69adc7e75efcd889108d185f200db6280494b05de6a06291dbf26ef32e5d42 | |
| 377 | dist/2024-09-04/rustfmt-nightly-aarch64-unknown-linux-musl.tar.xz=fca74af6db1c53a79a4412a020f56ec9c61603d3373eaa936a57dad45f3751d7 | |
| 378 | dist/2024-09-04/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.gz=b2be0123cde401aaed259a9387e04f3978fbddce98096b3a8a654b76f92f2e6b | |
| 379 | dist/2024-09-04/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.xz=c44c42a59887f1479383694f43688f9f2a8174ac89fdf657b2e8619372e0bcef | |
| 380 | dist/2024-09-04/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.gz=3d99bab3656d0318173c414dcb8930291ab43285883ca80a04d854023a4201a3 | |
| 381 | dist/2024-09-04/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.xz=29e506c1a18449b84a643f0075f1263cd8512662f55e2c5b18305213e4246783 | |
| 382 | dist/2024-09-04/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.gz=b486ff8e1e136ba15c9bb14db08dcd14b612adf1617cf1f820a23ee403958049 | |
| 383 | dist/2024-09-04/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.xz=b4d593b5a89bb42e7f9eaa17df12778dd816c75e8997e964371286041691cbbf | |
| 384 | dist/2024-09-04/rustfmt-nightly-i686-pc-windows-gnu.tar.gz=dcf94a642166b0664a63c4162a2d303c75fdef6f2a7f9b3e502ba5baae117f69 | |
| 385 | dist/2024-09-04/rustfmt-nightly-i686-pc-windows-gnu.tar.xz=4b27ac17748d8cdcd2bc7b9956541333997c6ec56f7a770628dc8e57fc7f442f | |
| 386 | dist/2024-09-04/rustfmt-nightly-i686-pc-windows-msvc.tar.gz=8a3caf2dc2b786ca58f6d37c011dc210e883398a3734f9f13678a9e57c5ccf5d | |
| 387 | dist/2024-09-04/rustfmt-nightly-i686-pc-windows-msvc.tar.xz=e129b88dd69200e305cc5ae16231952d85f9461dad13fd3bae5e889dac89d9c6 | |
| 388 | dist/2024-09-04/rustfmt-nightly-i686-unknown-linux-gnu.tar.gz=1bc390abb8f754d5b8679b33186b97262dadff9c6db7268cfbcfe605c628a681 | |
| 389 | dist/2024-09-04/rustfmt-nightly-i686-unknown-linux-gnu.tar.xz=8420198b0a22aaa5951678b954bcce636c78ba6567a06484c830b3eded815228 | |
| 390 | dist/2024-09-04/rustfmt-nightly-loongarch64-unknown-linux-gnu.tar.gz=05071fe12ed4030464f996fe36dd2e3f60d3701956275499acaeaf03a16e36eb | |
| 391 | dist/2024-09-04/rustfmt-nightly-loongarch64-unknown-linux-gnu.tar.xz=2bfdabab0d03e570c073463a8867bbdb54879f501b0822906fa2aa5705603d7c | |
| 392 | dist/2024-09-04/rustfmt-nightly-loongarch64-unknown-linux-musl.tar.gz=0c7e3b10626a9d9a3f8522175085169ea4e34568a7be0093c6682bb9659bf65f | |
| 393 | dist/2024-09-04/rustfmt-nightly-loongarch64-unknown-linux-musl.tar.xz=deb2b51a41dae2e72188fa6c06c4a7bdb08c2723b3ce823602087bd9eb36eb07 | |
| 394 | dist/2024-09-04/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.gz=e34590ec2cbd481ffd237101c239f27bd2298517bb7fc9c9f9b6d71abfff69e4 | |
| 395 | dist/2024-09-04/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.xz=9cd0d3dd57b764ad054d4295f822a7fd74a1b1ee5babf77ed2dc2c39ee60b7a2 | |
| 396 | dist/2024-09-04/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.gz=62566938d97058dd38b1e0c97aa4421d709ce988544956d6a4aaf3e54425dbce | |
| 397 | dist/2024-09-04/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.xz=8f27c6fc5b56092302e49da973ff08f0d3131465bf9a701a9ddc91d373acc435 | |
| 398 | dist/2024-09-04/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.gz=7637f3b8060635595a3d2fb83fef68e9990ff1adb1bd3288c7c41767b37ee2c4 | |
| 399 | dist/2024-09-04/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.xz=3275f15e3d7e9ccb991f6f9a7059acefd0bee49bfd4cf0724aed11e51e3772db | |
| 400 | dist/2024-09-04/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.gz=29379bab930e7b350cec51be33663ad67a0d30922d658006911f895221dcbffd | |
| 401 | dist/2024-09-04/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.xz=4f71e948ec587836315d7ec98e6f3c6125a298faf1321b4524257d3c9664f9eb | |
| 402 | dist/2024-09-04/rustfmt-nightly-s390x-unknown-linux-gnu.tar.gz=5b9361317481269e090b4270bcf754caca8a1797f6b2d83a4c570a4024bb0dc3 | |
| 403 | dist/2024-09-04/rustfmt-nightly-s390x-unknown-linux-gnu.tar.xz=db3bf98663017bec6b6beba5848a350d4d34f39e3f98bacb321866112cff7c15 | |
| 404 | dist/2024-09-04/rustfmt-nightly-x86_64-apple-darwin.tar.gz=9d5b8c84f82ededb2370c20afdb6b7d06d97161a65348f4ee2b6ab2171236cd0 | |
| 405 | dist/2024-09-04/rustfmt-nightly-x86_64-apple-darwin.tar.xz=e880f57ba68bce871fa67230db19aab1f146548254867f09e0d83750bbb50a1c | |
| 406 | dist/2024-09-04/rustfmt-nightly-x86_64-pc-windows-gnu.tar.gz=8b2c79814b202661c74584d7c4aeb35cc0c8520c4df1c81f2fb2896a22385191 | |
| 407 | dist/2024-09-04/rustfmt-nightly-x86_64-pc-windows-gnu.tar.xz=c193e2f2b859239aa0489c65663fb83c4bd7a87571d5b6ca6572f722c46cef64 | |
| 408 | dist/2024-09-04/rustfmt-nightly-x86_64-pc-windows-msvc.tar.gz=8d6583366248882490371ef5d4532f82ba1779cb993b0078ca6903f9b6a0c5be | |
| 409 | dist/2024-09-04/rustfmt-nightly-x86_64-pc-windows-msvc.tar.xz=0b69fdd8edb566a75cdff616e09223b10796a91eaf8bd90aa11ddd6af61381b9 | |
| 410 | dist/2024-09-04/rustfmt-nightly-x86_64-unknown-freebsd.tar.gz=0a452883a9a494f1613f9b0c796d13745e56eb85597142a677c78daeca95a67c | |
| 411 | dist/2024-09-04/rustfmt-nightly-x86_64-unknown-freebsd.tar.xz=01eb4d938f6e9228cae297688340daf298bf6e5322a4e3cdb4e06554fa131deb | |
| 412 | dist/2024-09-04/rustfmt-nightly-x86_64-unknown-illumos.tar.gz=4d9220bee07e3576f34c3a3dd327723ed660a774c4391f7a4a7e6a78ea2ca88c | |
| 413 | dist/2024-09-04/rustfmt-nightly-x86_64-unknown-illumos.tar.xz=2e2cd60bbb356d7b702c511ba56b480ffe0bbceef8f945be0f7b8e338d7998a0 | |
| 414 | dist/2024-09-04/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.gz=4aac5347a6011ff27609b4a6b413454d610a5687253a7e09d1bcc8c0e3aa0e6f | |
| 415 | dist/2024-09-04/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz=ad3a0127c2cc09893fb19e4c58faa6188afeb575996ee4708eae6c5713ff9646 | |
| 416 | dist/2024-09-04/rustfmt-nightly-x86_64-unknown-linux-musl.tar.gz=869fbf24ca816b0bf931da79920ae8edaef8a749271434c6522f7ff55920a507 | |
| 417 | dist/2024-09-04/rustfmt-nightly-x86_64-unknown-linux-musl.tar.xz=f4870110759f28ad1cdde912fd3f79bd8eb0073bd42e436a456f0d04e7c2bd26 | |
| 418 | dist/2024-09-04/rustfmt-nightly-x86_64-unknown-netbsd.tar.gz=eac75028d080b3d4ab86dbbb4f46c7734c60bd747e0325afbaa3b7a7cf0003be | |
| 419 | dist/2024-09-04/rustfmt-nightly-x86_64-unknown-netbsd.tar.xz=fe13bf3e0ec3088b35608d65b76f77014e0b90886ba81decfa21019ff222c79b | |
| 420 | dist/2024-09-04/rustc-nightly-aarch64-apple-darwin.tar.gz=ecda4ccde26bf6f8405ddbb838239c4f42e9136001e8954b21357d86343ad06d | |
| 421 | dist/2024-09-04/rustc-nightly-aarch64-apple-darwin.tar.xz=cdb1b12e6acf5b2bc5a5328f7cb292760d391b3e269d2b2143c87a344efcc9dd | |
| 422 | dist/2024-09-04/rustc-nightly-aarch64-pc-windows-msvc.tar.gz=46af634f433b9c7182637880f7b910ef13d2da9b1d7d4e255f9cd302691b99fc | |
| 423 | dist/2024-09-04/rustc-nightly-aarch64-pc-windows-msvc.tar.xz=a14935b0b82835388886c826b703057af093dfe16f0367c058dd6d352e585859 | |
| 424 | dist/2024-09-04/rustc-nightly-aarch64-unknown-linux-gnu.tar.gz=68ced431fa8682f83dd79901ccb986accc5a6d948c837c43eb5fa244c19eab88 | |
| 425 | dist/2024-09-04/rustc-nightly-aarch64-unknown-linux-gnu.tar.xz=fa078e5edc9f6c7be5a39eac722f142d526b68e30acc8f81bd001035fd657a83 | |
| 426 | dist/2024-09-04/rustc-nightly-aarch64-unknown-linux-musl.tar.gz=c88a3c5cbb7a8a55f18d27f2c573192d824e33657a143641d1c8fa1504cbc805 | |
| 427 | dist/2024-09-04/rustc-nightly-aarch64-unknown-linux-musl.tar.xz=00170baf596aa6e043598e3c38153f29c1cbfe4a63298d4007979877e9c3e1c2 | |
| 428 | dist/2024-09-04/rustc-nightly-arm-unknown-linux-gnueabi.tar.gz=19a55b89192897c77240404ff7ed8c64cdba106db13be4a1ae86a9ac44753c30 | |
| 429 | dist/2024-09-04/rustc-nightly-arm-unknown-linux-gnueabi.tar.xz=42937abfd803faed251cecc7ac74abcc3c40332b8466535cc1727138fe03beeb | |
| 430 | dist/2024-09-04/rustc-nightly-arm-unknown-linux-gnueabihf.tar.gz=3cc5d6e89cd8b53db0c2900a73e59c188e90d042b2e43502e384f44d229b93e7 | |
| 431 | dist/2024-09-04/rustc-nightly-arm-unknown-linux-gnueabihf.tar.xz=4e1ff68b91e0cc730ca6012aa577aaf73dd5108d0b26575eaade0a2380914fe0 | |
| 432 | dist/2024-09-04/rustc-nightly-armv7-unknown-linux-gnueabihf.tar.gz=082a2efdf341bdfd9bbe3e2340ae8dbf71bff71908439696d30fa25d00c5fe1b | |
| 433 | dist/2024-09-04/rustc-nightly-armv7-unknown-linux-gnueabihf.tar.xz=0b480d334a3709ca23dfd4839b518391031b6afde4cea0c30f08f160e39592a0 | |
| 434 | dist/2024-09-04/rustc-nightly-i686-pc-windows-gnu.tar.gz=bf06c7a0faebb7dbfa2c09d02f506410f05abc6aa2ba54c515f2a429e904de2a | |
| 435 | dist/2024-09-04/rustc-nightly-i686-pc-windows-gnu.tar.xz=c49f577fa788bb6b40350dd9e9f9088ded647f0a5cf5df69135a83d2e085d9ca | |
| 436 | dist/2024-09-04/rustc-nightly-i686-pc-windows-msvc.tar.gz=e42254e299e367c9414c4b61715125410ddc3ecb30f2457e4eb843725c6b6abd | |
| 437 | dist/2024-09-04/rustc-nightly-i686-pc-windows-msvc.tar.xz=91a752b8a61b81281203297712b1bc775a227d9626b4c84d9e10130f428f843d | |
| 438 | dist/2024-09-04/rustc-nightly-i686-unknown-linux-gnu.tar.gz=6f23df634f3e7028d9a6e9989e1edbc2d00e9b435473807f526fd58c150baf3d | |
| 439 | dist/2024-09-04/rustc-nightly-i686-unknown-linux-gnu.tar.xz=de7cef873379e3d5ef80b402b9d98bdf74366de27e8f928125081628937baf76 | |
| 440 | dist/2024-09-04/rustc-nightly-loongarch64-unknown-linux-gnu.tar.gz=ef0946845c41e096dced01baf6e843c57fcf695c82d5408a1b7c0a5bbd150b39 | |
| 441 | dist/2024-09-04/rustc-nightly-loongarch64-unknown-linux-gnu.tar.xz=d43bb8987a3bb394d7d2cf39d78f54505700525b250cb30741b903bf8712f3bf | |
| 442 | dist/2024-09-04/rustc-nightly-loongarch64-unknown-linux-musl.tar.gz=00013767600b1a5153ed4faa9d227fd55a905c375f712a7ca59573a317684c97 | |
| 443 | dist/2024-09-04/rustc-nightly-loongarch64-unknown-linux-musl.tar.xz=cf1c4351f70e951290583213dade06fe4a61e6dcbc2d0e69be54ea91210051de | |
| 444 | dist/2024-09-04/rustc-nightly-powerpc-unknown-linux-gnu.tar.gz=be1957674fdda24a9cd8935789db35a17d3a0d71219bb6f1256af74c64ffc697 | |
| 445 | dist/2024-09-04/rustc-nightly-powerpc-unknown-linux-gnu.tar.xz=20541daa3925834012ab68f186a1f1ab4d060cced96646e2142a0f14c04b6ad6 | |
| 446 | dist/2024-09-04/rustc-nightly-powerpc64-unknown-linux-gnu.tar.gz=0eb6741b87d430573c9b0d5b9ba9725c0c03caabc01d5ee258867ea19aedafdc | |
| 447 | dist/2024-09-04/rustc-nightly-powerpc64-unknown-linux-gnu.tar.xz=8ad4670b74093e3c7055149649145a4af2b2a3d24a68bf893ed72202cc934946 | |
| 448 | dist/2024-09-04/rustc-nightly-powerpc64le-unknown-linux-gnu.tar.gz=2d7b60aa2d4853eba2bb2644cb14768a5a864386da0854aca7c1f6397374dca2 | |
| 449 | dist/2024-09-04/rustc-nightly-powerpc64le-unknown-linux-gnu.tar.xz=17792328178392ad96b1a0c05405c61d0b1e7196bdca9e55baebff12a4949725 | |
| 450 | dist/2024-09-04/rustc-nightly-riscv64gc-unknown-linux-gnu.tar.gz=2db9fe19d4e1d7f68a0802868d9344e23932190e2d46407523208a67b5ba053a | |
| 451 | dist/2024-09-04/rustc-nightly-riscv64gc-unknown-linux-gnu.tar.xz=f0d4df5e4cfeff06eb2cb07c6f9ac0596130923133571fd1702d56a0251ebb99 | |
| 452 | dist/2024-09-04/rustc-nightly-s390x-unknown-linux-gnu.tar.gz=4d3fea9ec53336195c0daa2b2937507c2216537647829466a19acee2ce9e201a | |
| 453 | dist/2024-09-04/rustc-nightly-s390x-unknown-linux-gnu.tar.xz=84ca3dccf7af68a343fed4d209771bac7439149695f63517bd048287f4539add | |
| 454 | dist/2024-09-04/rustc-nightly-x86_64-apple-darwin.tar.gz=f6f43ebb82851edae301033a2cfbd02724849c7fda42294818f3081f74d3a1a3 | |
| 455 | dist/2024-09-04/rustc-nightly-x86_64-apple-darwin.tar.xz=55b0db99f02bd4c5595117663f6b6cc739f63723999062ced0096727e627f072 | |
| 456 | dist/2024-09-04/rustc-nightly-x86_64-pc-windows-gnu.tar.gz=6cb63e57f9873e40695b735b8cdb9f0de70306f1692161cd8f7767b4016dcf39 | |
| 457 | dist/2024-09-04/rustc-nightly-x86_64-pc-windows-gnu.tar.xz=79bf54beceda0a7f6580d3ef336d8deae3991b3b57e4c6aba635f9d848cc860d | |
| 458 | dist/2024-09-04/rustc-nightly-x86_64-pc-windows-msvc.tar.gz=7757651c78d5000926bd5e91996ea8abdc32db8e67b31271cb70680f551edd5f | |
| 459 | dist/2024-09-04/rustc-nightly-x86_64-pc-windows-msvc.tar.xz=4671e03fc7100bac43cf332e387161c0ccde77d3f893a9dfdd27be63fff39932 | |
| 460 | dist/2024-09-04/rustc-nightly-x86_64-unknown-freebsd.tar.gz=675f49fc6a51d5e715789bc9ad92b9db12a94a033254e34efb65358700207bb5 | |
| 461 | dist/2024-09-04/rustc-nightly-x86_64-unknown-freebsd.tar.xz=f9efc43f26600caf2ef7c8084fe94ae31ba540ae7e9f104e6a587c6e4272cd6b | |
| 462 | dist/2024-09-04/rustc-nightly-x86_64-unknown-illumos.tar.gz=9bd74b7ee78a02306f47640b99d752ea373ffdd88067376d9f03564f07edfb24 | |
| 463 | dist/2024-09-04/rustc-nightly-x86_64-unknown-illumos.tar.xz=67c5d546df9fa451d42804de2d439229e9b21eb9329ff16eeadcc52f5b6393d1 | |
| 464 | dist/2024-09-04/rustc-nightly-x86_64-unknown-linux-gnu.tar.gz=dfc427db6a14237a12fd077ccc44c07e7bb46a1b2965a3fb1ddd78a2ec334b81 | |
| 465 | dist/2024-09-04/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz=8d307dce871ae5f7cc1410e85bb7b38f80aed5c1138030b4f112e727fb8c654b | |
| 466 | dist/2024-09-04/rustc-nightly-x86_64-unknown-linux-musl.tar.gz=b7f84d8aab03afcf2bab8ed21fa3ece6ac418d076e0195381110adfac2aa1fbc | |
| 467 | dist/2024-09-04/rustc-nightly-x86_64-unknown-linux-musl.tar.xz=296083c6b50b7dffe8a62884bac7e831e29487a31c8e6fb319f04f0e62157175 | |
| 468 | dist/2024-09-04/rustc-nightly-x86_64-unknown-netbsd.tar.gz=96986595ce82c735b87fe75f00722514c49e7118d38c4bced554c9017377ec91 | |
| 469 | dist/2024-09-04/rustc-nightly-x86_64-unknown-netbsd.tar.xz=bf8c9411ff7279fd56bb7e3c68ac29c8ce79ba031317b76aac6a74d20f1511f0 | |
| \ No newline at end of file | ||
| 22 | dist/2024-09-22/rustc-beta-aarch64-apple-darwin.tar.gz=59b70ccc04680e74bbd1e13368bbf5639679fb8e1e7ba39ae4a235f9a96522f6 | |
| 23 | dist/2024-09-22/rustc-beta-aarch64-apple-darwin.tar.xz=d4b18e0a269e7b66dbbdf03d7da6b478c6cff9cd52ef34f110b68a9ff0111d0f | |
| 24 | dist/2024-09-22/rustc-beta-aarch64-pc-windows-msvc.tar.gz=7cc2e8511801c27360e17cc0380e30e5eb6cc185224aba94bf9ed852e5ff2ce0 | |
| 25 | dist/2024-09-22/rustc-beta-aarch64-pc-windows-msvc.tar.xz=a9f8f8e691b9a307ddc4468cc34964063253292f18869d21dc91ca437bbc08fd | |
| 26 | dist/2024-09-22/rustc-beta-aarch64-unknown-linux-gnu.tar.gz=5940e8c99d329fae3cc4b1d5709e9481e8f2b1dc799363ae0a1429ea4df4ad41 | |
| 27 | dist/2024-09-22/rustc-beta-aarch64-unknown-linux-gnu.tar.xz=c7c36aada972ea10e50e0904530d06b2df074f9981dec4dcc66efeaa16499c1b | |
| 28 | dist/2024-09-22/rustc-beta-aarch64-unknown-linux-musl.tar.gz=2ae2b1e2d90c130be5274806db1e4dcdfe0b588fe72f967e58b128aa1d28a7eb | |
| 29 | dist/2024-09-22/rustc-beta-aarch64-unknown-linux-musl.tar.xz=d8297b214d4ef841bb5963e71353ce08a4d3aead47a2cdf234e0846ad0b1ccbb | |
| 30 | dist/2024-09-22/rustc-beta-arm-unknown-linux-gnueabi.tar.gz=256b62cd5f1bc17c081277752a49d38104ce438e83342e6bbb467442e9250563 | |
| 31 | dist/2024-09-22/rustc-beta-arm-unknown-linux-gnueabi.tar.xz=457ea31587b8ff8c9fcc7a9ed4bf958625c7b9e55d640329ccdf432309a6583f | |
| 32 | dist/2024-09-22/rustc-beta-arm-unknown-linux-gnueabihf.tar.gz=4cc8f851eff833100fe4d7c421c25e65d4779d8cdbb9b5e2cb3c8f5ebf9f8e98 | |
| 33 | dist/2024-09-22/rustc-beta-arm-unknown-linux-gnueabihf.tar.xz=6ab386aaab687a253b3d28b12307ad5c8df2ea1a0af281a8fab6fe6d24ee6130 | |
| 34 | dist/2024-09-22/rustc-beta-armv7-unknown-linux-gnueabihf.tar.gz=0b548c45c2ec840942b29a68ad38debd8a2ec7c920d3be7cda91365e0a8fce80 | |
| 35 | dist/2024-09-22/rustc-beta-armv7-unknown-linux-gnueabihf.tar.xz=bc1ce3524199c62230fc08b9dab1282d2f31d3cd1a892cbc8bfab0257e0ff5dc | |
| 36 | dist/2024-09-22/rustc-beta-i686-pc-windows-gnu.tar.gz=a407a4dda4c24e8e9d510843aa9e8f06291622d240538a14c1d924d8b7d84e33 | |
| 37 | dist/2024-09-22/rustc-beta-i686-pc-windows-gnu.tar.xz=fe3b235ed043d14856f47babf433ae214d9b64480b1824053fee8b99ca69cc69 | |
| 38 | dist/2024-09-22/rustc-beta-i686-pc-windows-msvc.tar.gz=a156aa0fb17b5edf476f97b8e839f9fe550ed3edd63a2fe2936a7fe0f388ece4 | |
| 39 | dist/2024-09-22/rustc-beta-i686-pc-windows-msvc.tar.xz=0e46e75722b10bbbd2631c2676089665f92ce092408ed63aa14c99b1fc385369 | |
| 40 | dist/2024-09-22/rustc-beta-i686-unknown-linux-gnu.tar.gz=5523e67362db0840d6f0ab6a1deec99c1b64c32fae94362792b0aa031bfd39d6 | |
| 41 | dist/2024-09-22/rustc-beta-i686-unknown-linux-gnu.tar.xz=45a820f2ebd182ec3237436a567960d2bd0f92e9e603aa394b1a6eafbd9ba0fa | |
| 42 | dist/2024-09-22/rustc-beta-loongarch64-unknown-linux-gnu.tar.gz=bdbe165ffd50974b32f4b570da7908c125739c0321f700d12cc481f32ab76eaa | |
| 43 | dist/2024-09-22/rustc-beta-loongarch64-unknown-linux-gnu.tar.xz=997a8387989676848355e30dea1b131fa96945e62cef8f011025c52351db1269 | |
| 44 | dist/2024-09-22/rustc-beta-loongarch64-unknown-linux-musl.tar.gz=a49f46df49a9aa974ff10361ae29267d2c86c10486399803a5a6879e638212f2 | |
| 45 | dist/2024-09-22/rustc-beta-loongarch64-unknown-linux-musl.tar.xz=ee236f4dab4a06d23b6040a47afdf73496bc9093b3b29fae896f5f5bbe87c222 | |
| 46 | dist/2024-09-22/rustc-beta-powerpc-unknown-linux-gnu.tar.gz=e83c1253643c4ff70301bab198db731ac65c6d3b0ec847d7aa68bd6afef6ee93 | |
| 47 | dist/2024-09-22/rustc-beta-powerpc-unknown-linux-gnu.tar.xz=f7f09a5028ca3f45475cedec7518ead06b2e305554292462d82b2032e5d83f73 | |
| 48 | dist/2024-09-22/rustc-beta-powerpc64-unknown-linux-gnu.tar.gz=9ef2829f5b2bc9666bba319875eecbda37840d204f7c1493dce2a4f2f45d45c5 | |
| 49 | dist/2024-09-22/rustc-beta-powerpc64-unknown-linux-gnu.tar.xz=140489beedcf46e02931ce8f69e9008ea4c7e3c332d0a3482d4495d7fff21b81 | |
| 50 | dist/2024-09-22/rustc-beta-powerpc64le-unknown-linux-gnu.tar.gz=63a34f34425d6c11d62768a3cdfc4602d96ae0f11d82344412a69a3b1ec550b9 | |
| 51 | dist/2024-09-22/rustc-beta-powerpc64le-unknown-linux-gnu.tar.xz=108d429397a5cef93151439646b684109d1b619c1a6f11544062e407258f4897 | |
| 52 | dist/2024-09-22/rustc-beta-riscv64gc-unknown-linux-gnu.tar.gz=77cb4dea8b55779e0f3de1f48e74de966d3a2dc27946228b42b0eae654d53e5a | |
| 53 | dist/2024-09-22/rustc-beta-riscv64gc-unknown-linux-gnu.tar.xz=93b7dc39c3da7560cbabef5a35dddec111a4d9c0ec0e2b0648925975c5042b31 | |
| 54 | dist/2024-09-22/rustc-beta-s390x-unknown-linux-gnu.tar.gz=58b1eed6046552703f8993b36d2a571d12db806ca9665d276c338fc89f79b980 | |
| 55 | dist/2024-09-22/rustc-beta-s390x-unknown-linux-gnu.tar.xz=39ad5c20dd703e5949f008ed21e671b1438a1160b4aece5ba434ae03f32004cf | |
| 56 | dist/2024-09-22/rustc-beta-x86_64-apple-darwin.tar.gz=c5082f7773f1573a1f60148ed744f148169b3c58ca38539e72688cb31221003e | |
| 57 | dist/2024-09-22/rustc-beta-x86_64-apple-darwin.tar.xz=a797564192dc84184d5af88ecb4d295ab266cde4a1c4407b06c56f656800e336 | |
| 58 | dist/2024-09-22/rustc-beta-x86_64-pc-windows-gnu.tar.gz=0f29dc08756a36f42e9937cf9e2f8c5cc7771fab5b791b58dd7b038dcb20e2ca | |
| 59 | dist/2024-09-22/rustc-beta-x86_64-pc-windows-gnu.tar.xz=9a9f6178208f01487a132ab91ffb1251722df3f6e3ccc7f4b3e79dc389b7217a | |
| 60 | dist/2024-09-22/rustc-beta-x86_64-pc-windows-msvc.tar.gz=2f2b828b46dea57c9896149a5ffc5cc6db368d90067c498f554b9ea75de0990f | |
| 61 | dist/2024-09-22/rustc-beta-x86_64-pc-windows-msvc.tar.xz=42c64410633bf748134ba004ef397f2319556e44fc2862a4f3a5e847e334fdbf | |
| 62 | dist/2024-09-22/rustc-beta-x86_64-unknown-freebsd.tar.gz=9ba0fdecbd343606bbdf2d4b401d64ed5de82e4bd508c0e6b6bcc21365c4b840 | |
| 63 | dist/2024-09-22/rustc-beta-x86_64-unknown-freebsd.tar.xz=aeabedce922b315fb872127a6102a76e9fe5e1932b14a7210f31191f9a85488b | |
| 64 | dist/2024-09-22/rustc-beta-x86_64-unknown-illumos.tar.gz=4d5348b0ef100a1691f655acee54447866d76b46f88e23ee641eb5e4b4318b4c | |
| 65 | dist/2024-09-22/rustc-beta-x86_64-unknown-illumos.tar.xz=046b8d0139b97d78a741251ef7094629394f67cbb817a7239de704b4ff3a8963 | |
| 66 | dist/2024-09-22/rustc-beta-x86_64-unknown-linux-gnu.tar.gz=81ba8a28534746a9c33c98a98aeeea89f6c057333827d919b2f404991e0ded45 | |
| 67 | dist/2024-09-22/rustc-beta-x86_64-unknown-linux-gnu.tar.xz=358bbda124aa68416d55d8ed6c9a184f8ea7ae166f3f0427e8c9ac40900bd4b6 | |
| 68 | dist/2024-09-22/rustc-beta-x86_64-unknown-linux-musl.tar.gz=8594ed15236342879b4c486e4d5e2440891e9dec52302e1bb6393008eaf876e7 | |
| 69 | dist/2024-09-22/rustc-beta-x86_64-unknown-linux-musl.tar.xz=e45cdb771899998e42bf3f9e965a4b4557199b1632843c0472731d48ea664834 | |
| 70 | dist/2024-09-22/rustc-beta-x86_64-unknown-netbsd.tar.gz=ba1d8b89c65441cfe6fa1341c6a7e21dc596df13cef8e8038d8d7ac376bd91fc | |
| 71 | dist/2024-09-22/rustc-beta-x86_64-unknown-netbsd.tar.xz=95fb21a9730eaf815ba6da5f42b997accca0b578870207912a2ea359b588421e | |
| 72 | dist/2024-09-22/rust-std-beta-aarch64-apple-darwin.tar.gz=60127b21a176a56664e537a8e6d81c18c5406706f12e3a406ebad8c86f5fc442 | |
| 73 | dist/2024-09-22/rust-std-beta-aarch64-apple-darwin.tar.xz=04d163b5bb40aa4ed7e712006155549eb5ca094e71b89b4a3e5142c40d0b2102 | |
| 74 | dist/2024-09-22/rust-std-beta-aarch64-apple-ios.tar.gz=1463a6f3a55b1c7795c0417040423f2dc1d9a3df343ee4bd2d9c96b2de5c84e8 | |
| 75 | dist/2024-09-22/rust-std-beta-aarch64-apple-ios.tar.xz=74a06570dd6bd8b501ccdcdf25b9b5ccac25936b883b37be6a0296d5e59394b6 | |
| 76 | dist/2024-09-22/rust-std-beta-aarch64-apple-ios-macabi.tar.gz=ccdf0df40f435ca4c5f8d6b67cf06b48c1792d5b1592cb129e7e40e7690c3c5b | |
| 77 | dist/2024-09-22/rust-std-beta-aarch64-apple-ios-macabi.tar.xz=4388b9b3ab0e048b6c8349a3ceae6afc078bdc217172d7ef0271afb5e181fb6f | |
| 78 | dist/2024-09-22/rust-std-beta-aarch64-apple-ios-sim.tar.gz=4428d02fe8e43b5d082149991e88a4c9d342157fa1c2cd91903812240fb5bb08 | |
| 79 | dist/2024-09-22/rust-std-beta-aarch64-apple-ios-sim.tar.xz=21f9c521dc8203584ce0c56536818431ec19f259f86b8d8cab5a33f7e44165cf | |
| 80 | dist/2024-09-22/rust-std-beta-aarch64-linux-android.tar.gz=d9d238db60d1e54366cfb4f20e2a6c6b8bc055f83716837970261b074cc93218 | |
| 81 | dist/2024-09-22/rust-std-beta-aarch64-linux-android.tar.xz=aab44af6a7f1dc483c943be9fd0b2ade0c938a844acc8deab76843e3dc514355 | |
| 82 | dist/2024-09-22/rust-std-beta-aarch64-pc-windows-gnullvm.tar.gz=fccf8f5199da8c0fe2d1dec6ee384c9761f2e6334e5dce28add413f29207e902 | |
| 83 | dist/2024-09-22/rust-std-beta-aarch64-pc-windows-gnullvm.tar.xz=d6373d38a862120c08afa569ea9941945b43ce1676f45ca995fb3b30c34500ec | |
| 84 | dist/2024-09-22/rust-std-beta-aarch64-pc-windows-msvc.tar.gz=e0b31c36068626fbf2133a352002cbd8f4c2b6a1b5379a0ab0fd3bc640576e9d | |
| 85 | dist/2024-09-22/rust-std-beta-aarch64-pc-windows-msvc.tar.xz=d10defe0175f8872ebb68d2dd331fa9bbbeb1fa892188371665547567f7f2738 | |
| 86 | dist/2024-09-22/rust-std-beta-aarch64-unknown-fuchsia.tar.gz=dda6f7b74035c963dd89a2e003d6c7baca2e2db9bfdd3007f95743e44bd08cb0 | |
| 87 | dist/2024-09-22/rust-std-beta-aarch64-unknown-fuchsia.tar.xz=23944ba7752e89e860f19f3c18d2951bb5c7c6b707bd6e06914f7d48aafee40c | |
| 88 | dist/2024-09-22/rust-std-beta-aarch64-unknown-linux-gnu.tar.gz=b00fa5fea66b2af7d173d6405a59c529a1dd0b793d735c2d97fcab7775693ed4 | |
| 89 | dist/2024-09-22/rust-std-beta-aarch64-unknown-linux-gnu.tar.xz=34bd748cc5bc0a6b6d8e6d8ea23693d7628bed11ebcd886860cd5c0b31ac3c0d | |
| 90 | dist/2024-09-22/rust-std-beta-aarch64-unknown-linux-musl.tar.gz=ecb1b709c48556fabc527d976e6cc69b8b69384cb4c45e691195a12b9cdba383 | |
| 91 | dist/2024-09-22/rust-std-beta-aarch64-unknown-linux-musl.tar.xz=2c90df930935dcf9f9725588ed6579100fdf676267305f715f03e413a04c3032 | |
| 92 | dist/2024-09-22/rust-std-beta-aarch64-unknown-linux-ohos.tar.gz=56782db097cca16a0d6e8466b83b35bfd7334d5f48b9ac5c500767eeba30c122 | |
| 93 | dist/2024-09-22/rust-std-beta-aarch64-unknown-linux-ohos.tar.xz=9b41b551b5f88dfa3fdcc1d22102f102627c5c88e42353edaceda6da3b76d97b | |
| 94 | dist/2024-09-22/rust-std-beta-aarch64-unknown-none.tar.gz=087fccd0b40fe73a545885a58758eafb86e9bb7b9588d047c9536e5bd8c201b6 | |
| 95 | dist/2024-09-22/rust-std-beta-aarch64-unknown-none.tar.xz=60039451dc07ada83944606e67363ca32b22879293bc41a6d66f6545e7e3f1aa | |
| 96 | dist/2024-09-22/rust-std-beta-aarch64-unknown-none-softfloat.tar.gz=0e1f73720beaecff935d0a90272448f5dfb0c912b2e366239c46c6ab3b854cfc | |
| 97 | dist/2024-09-22/rust-std-beta-aarch64-unknown-none-softfloat.tar.xz=c2670b262833415d43b22485c2734d87d8748315e6471a2a384249b2cba6e581 | |
| 98 | dist/2024-09-22/rust-std-beta-aarch64-unknown-uefi.tar.gz=edfd391f36b6aa6758649ca6f9706d671956f078e572ea9ce5f9423a1310e817 | |
| 99 | dist/2024-09-22/rust-std-beta-aarch64-unknown-uefi.tar.xz=59b09f6cef1d97b273262d3ccdd95d9c46766b82e935cb46538514292cd04a39 | |
| 100 | dist/2024-09-22/rust-std-beta-arm-linux-androideabi.tar.gz=f84267d71217b79a5e622a281ce926c1a54ee9122e19b2647d1aa85afa9132be | |
| 101 | dist/2024-09-22/rust-std-beta-arm-linux-androideabi.tar.xz=57e80fea8463416012339fc6f74e9ae4da7d92042d05311bc8a9620fec3541b2 | |
| 102 | dist/2024-09-22/rust-std-beta-arm-unknown-linux-gnueabi.tar.gz=556ff5b6947ed37f5215953fbcbe3e82313e7deb9d32d5b86feabe46c8328e56 | |
| 103 | dist/2024-09-22/rust-std-beta-arm-unknown-linux-gnueabi.tar.xz=3f0721bc56fa232ca4203dcb43f1ef8f453373d9a0fa4720d89c51b827407a91 | |
| 104 | dist/2024-09-22/rust-std-beta-arm-unknown-linux-gnueabihf.tar.gz=57b81555f7d7695e985e1538795c97b9f0573cd84d6fda25a09d49ac54bd1a24 | |
| 105 | dist/2024-09-22/rust-std-beta-arm-unknown-linux-gnueabihf.tar.xz=66d5af25be1dfc99fbeb1aa0c7eee30dc2d3e5766affb73e6e7c0e7b9a78abff | |
| 106 | dist/2024-09-22/rust-std-beta-arm-unknown-linux-musleabi.tar.gz=23cfcb1cde1e95f55442ebb8ba155a0e13ec932cd7a8ab20a2ad09596a79b3a4 | |
| 107 | dist/2024-09-22/rust-std-beta-arm-unknown-linux-musleabi.tar.xz=660d3f7b05da3d5b01775989546a687fe40090d193289c3ad24317c07c5eb445 | |
| 108 | dist/2024-09-22/rust-std-beta-arm-unknown-linux-musleabihf.tar.gz=ee453c78eacca64fd0a6f1c066a6728ddca0ecbd6e184b63a4b4455f77183f07 | |
| 109 | dist/2024-09-22/rust-std-beta-arm-unknown-linux-musleabihf.tar.xz=b003790997ebe0bfa095b0fe38db67db179a2f9e93f4b49852f5ec04828337f4 | |
| 110 | dist/2024-09-22/rust-std-beta-arm64ec-pc-windows-msvc.tar.gz=60f03912a464169464800a603606e2cb8a302c998bd59f582cdd3b9bf39ecc82 | |
| 111 | dist/2024-09-22/rust-std-beta-arm64ec-pc-windows-msvc.tar.xz=6d1858acf2f2cfb3daac89ae21cfc7a7df3e1f57dac0aaa3ee70057b1974c0f2 | |
| 112 | dist/2024-09-22/rust-std-beta-armebv7r-none-eabi.tar.gz=b23fd4380d20e289e58b86afaad1df0636004c74a03d7f3ff861f26c6ca308f8 | |
| 113 | dist/2024-09-22/rust-std-beta-armebv7r-none-eabi.tar.xz=beac209cec83a56315c109fc3a0e3b6b16f8044de270e23cdd9dc3e2b5db3af3 | |
| 114 | dist/2024-09-22/rust-std-beta-armebv7r-none-eabihf.tar.gz=731064c4b9b35d420f740ff5fbc4f6dd1f038e3225db19ca861af6db5f283ea7 | |
| 115 | dist/2024-09-22/rust-std-beta-armebv7r-none-eabihf.tar.xz=04b406b44da8aee6a077f9f971b5ba62bc98fb09413fe47fd892c67798381d5b | |
| 116 | dist/2024-09-22/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.gz=26dc6030f28453478e790879547f22a63ae810572cac790d4ed944eb68c96d87 | |
| 117 | dist/2024-09-22/rust-std-beta-armv5te-unknown-linux-gnueabi.tar.xz=2aa9589c9512388e75c3c93e53b6a90ce5c973d98830a64388b0ec22618504c5 | |
| 118 | dist/2024-09-22/rust-std-beta-armv5te-unknown-linux-musleabi.tar.gz=0020c2142cef0ab6bd62c4212f01dce2675104e0da5e701cbf03ee7c45a0fb2c | |
| 119 | dist/2024-09-22/rust-std-beta-armv5te-unknown-linux-musleabi.tar.xz=b891ccdcbd8abf7d56d31b84800a17cbe1f6d4242584598433e38eff5a9a16c0 | |
| 120 | dist/2024-09-22/rust-std-beta-armv7-linux-androideabi.tar.gz=128b86795a07b47088fbc51a251f6b112379454940878150547b54ffb95890e9 | |
| 121 | dist/2024-09-22/rust-std-beta-armv7-linux-androideabi.tar.xz=26497ef07fb7f42198b4fc02b122497fc09bd215eb7e3e01c789b481bd2d86ae | |
| 122 | dist/2024-09-22/rust-std-beta-armv7-unknown-linux-gnueabi.tar.gz=933f22ab901b9de042b17548e0218de699275a8553b8056d2d85430858f4e1bc | |
| 123 | dist/2024-09-22/rust-std-beta-armv7-unknown-linux-gnueabi.tar.xz=495f8186e0c589882d1e1f1cf21ab28ea5531bad327b6d5ae1ca83d26c77944e | |
| 124 | dist/2024-09-22/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.gz=53c87859857618a011e94c14c5641927503c5543831acd16498d7fb244eb00b8 | |
| 125 | dist/2024-09-22/rust-std-beta-armv7-unknown-linux-gnueabihf.tar.xz=7ee039186087e320396e56cdd9e5a6b7993c44783e3a80fd86e74e41be646a57 | |
| 126 | dist/2024-09-22/rust-std-beta-armv7-unknown-linux-musleabi.tar.gz=fa9f256a201c4fe5cd95363c2cb02d87565a321e27554e83d63f1d61ed55dfda | |
| 127 | dist/2024-09-22/rust-std-beta-armv7-unknown-linux-musleabi.tar.xz=fd3eced91b52924bb6d4acb3cc6c3bd7b45a1879e353f22442cb1e76ed5a7f28 | |
| 128 | dist/2024-09-22/rust-std-beta-armv7-unknown-linux-musleabihf.tar.gz=b683d929fd6a6b60a786ec154970338158cc2b7bce28601b70966b898017b131 | |
| 129 | dist/2024-09-22/rust-std-beta-armv7-unknown-linux-musleabihf.tar.xz=518fa28ee0292b95322bea4c0b714146a1b94c730e49bb6a84038520c91a668b | |
| 130 | dist/2024-09-22/rust-std-beta-armv7-unknown-linux-ohos.tar.gz=d0f8659cddfc6da0b0dd815794f86ec1ffa0a243020dc9190c4358c6cdc03fdf | |
| 131 | dist/2024-09-22/rust-std-beta-armv7-unknown-linux-ohos.tar.xz=89f39595aa42f23efa2b3853c466cddd6a932043bae3373193c25b788c15efd6 | |
| 132 | dist/2024-09-22/rust-std-beta-armv7a-none-eabi.tar.gz=c1fc1973cc683c313e50542f1a6b69f1b5a5b4ac558b45954f79ef4dff9d5f75 | |
| 133 | dist/2024-09-22/rust-std-beta-armv7a-none-eabi.tar.xz=00c45dfc370ea40d8993519bdb5cce8f5167401434f0b7553b6fdf7c5b49da87 | |
| 134 | dist/2024-09-22/rust-std-beta-armv7r-none-eabi.tar.gz=ef54f8762f1d190b822e58b845889ac9c2dba4250cf0d693a3b1cbf64e2cf8a2 | |
| 135 | dist/2024-09-22/rust-std-beta-armv7r-none-eabi.tar.xz=9375a15e96f7b3da4394bcda8ce34c452417f4278f07926830d5b00b155cb338 | |
| 136 | dist/2024-09-22/rust-std-beta-armv7r-none-eabihf.tar.gz=85a5ae26f11c47872649699eaf01557aac746831b4c30de7b892438cc736b679 | |
| 137 | dist/2024-09-22/rust-std-beta-armv7r-none-eabihf.tar.xz=e9dde209b4e0de6ae76b316c5e3aa2923f208bd9aa7858fef5177ba2e3b06119 | |
| 138 | dist/2024-09-22/rust-std-beta-i586-pc-windows-msvc.tar.gz=652bc4cbf176d0780a81cff637684fd8f1cdc99c7a58d68325f54564942d46dc | |
| 139 | dist/2024-09-22/rust-std-beta-i586-pc-windows-msvc.tar.xz=367eca53e9c4be297454751d2d8b7f5503caf669962a44ea92290b0772969fb6 | |
| 140 | dist/2024-09-22/rust-std-beta-i586-unknown-linux-gnu.tar.gz=7c48fb48b02628358ae3572c92d5cc112734e99606c78d04b29e665ee03f36ec | |
| 141 | dist/2024-09-22/rust-std-beta-i586-unknown-linux-gnu.tar.xz=4ac829df3b8b5e7864b883713a90ed18a9b08f45a3da2af2c6b3f700c8d7c27c | |
| 142 | dist/2024-09-22/rust-std-beta-i586-unknown-linux-musl.tar.gz=7786d5b5e0cb8489df5456854cbbdfefbb8b4a3755f61e62747abc224e48dfc6 | |
| 143 | dist/2024-09-22/rust-std-beta-i586-unknown-linux-musl.tar.xz=e2ec9458a99a159480a45b8107041b3b4054316ba15adaf802690d2bf66b2f22 | |
| 144 | dist/2024-09-22/rust-std-beta-i686-linux-android.tar.gz=54edc2ca229e1a5aad5077800c492cf5038da341555eda11fc4b77d1a3896def | |
| 145 | dist/2024-09-22/rust-std-beta-i686-linux-android.tar.xz=a75135f1e04b716855fce5b830797ea87bd428d54c06190cc8067ba5952d7215 | |
| 146 | dist/2024-09-22/rust-std-beta-i686-pc-windows-gnu.tar.gz=4c5b54eecd6efbb03a3a01f57c265d47c49df49dd584e67b493205fcec92a59b | |
| 147 | dist/2024-09-22/rust-std-beta-i686-pc-windows-gnu.tar.xz=7ec6292ac497b450277c17cca3ca87321d5b6bd545bd479b37698ceebdcbf719 | |
| 148 | dist/2024-09-22/rust-std-beta-i686-pc-windows-gnullvm.tar.gz=0deb2de1b9830099bb6de1bb99e4658c8e4e3438e555f239c85309b771293e6b | |
| 149 | dist/2024-09-22/rust-std-beta-i686-pc-windows-gnullvm.tar.xz=f35566df72b302dd446d449ffc8a775015b30970911c5284a3d4c1866e004a6b | |
| 150 | dist/2024-09-22/rust-std-beta-i686-pc-windows-msvc.tar.gz=17e505c8ece5c89988896b1c14400b203e2588bc7777189bef89335cc868fb1d | |
| 151 | dist/2024-09-22/rust-std-beta-i686-pc-windows-msvc.tar.xz=197fe430d6fce984ca397ba664beb25d4a0216180cd8fc2797710a8c541573a8 | |
| 152 | dist/2024-09-22/rust-std-beta-i686-unknown-freebsd.tar.gz=9d7ff528d75e80ebb8255c9b6ef3f5ec6db579524e03dc3aad540690401fb7b8 | |
| 153 | dist/2024-09-22/rust-std-beta-i686-unknown-freebsd.tar.xz=81152e616efe27a4ae80d2ffc86b79211c31ab324faa7847606f6ed839a3d470 | |
| 154 | dist/2024-09-22/rust-std-beta-i686-unknown-linux-gnu.tar.gz=b1913a26f2258531596e1ef31fc42d720f807f04b068802ea3a0164d877d694c | |
| 155 | dist/2024-09-22/rust-std-beta-i686-unknown-linux-gnu.tar.xz=3be89fd0c0f0a5b6d5cea23feffd32573be29ec1ce6c96b88ac35e04cf1eaa46 | |
| 156 | dist/2024-09-22/rust-std-beta-i686-unknown-linux-musl.tar.gz=e446e4cbb904f89fbaf7bd48be6975671db2cc2ad018fc03e967dff2bbce0e3d | |
| 157 | dist/2024-09-22/rust-std-beta-i686-unknown-linux-musl.tar.xz=453d6a6b1872e884aeae40936e950b7c2d0ce291c9f5882fc9c15a6b3e9c86fe | |
| 158 | dist/2024-09-22/rust-std-beta-i686-unknown-uefi.tar.gz=a330462d4b0ade7028d2c2bd8764b1225cc9eac90b014c8899f971fadf002cba | |
| 159 | dist/2024-09-22/rust-std-beta-i686-unknown-uefi.tar.xz=8fdb9e12d0cf92e0c4fcbcdc57daceb2cf17b21786e1252904ec0faba4b90a9d | |
| 160 | dist/2024-09-22/rust-std-beta-loongarch64-unknown-linux-gnu.tar.gz=82859d2feb163fa7ac068db184e8c76261771dc47838bd952301ffd8037d885a | |
| 161 | dist/2024-09-22/rust-std-beta-loongarch64-unknown-linux-gnu.tar.xz=1fa1ae996cd7010b4ab9006bfcb69098fcadbfc7a8f6988bdd34c62d2d6309f3 | |
| 162 | dist/2024-09-22/rust-std-beta-loongarch64-unknown-linux-musl.tar.gz=e4200a2c1eb5a1420071fde891266849da5d46aaf46031129ae329175a3708f8 | |
| 163 | dist/2024-09-22/rust-std-beta-loongarch64-unknown-linux-musl.tar.xz=15fc279f0c1370d05543af48c493d91687e3de2dc25123a1b657919494a0653c | |
| 164 | dist/2024-09-22/rust-std-beta-loongarch64-unknown-none.tar.gz=4cc49f8231bca8c19e4d449cf3b3cd84d5db9e4665394ebada29ea626cee4dc4 | |
| 165 | dist/2024-09-22/rust-std-beta-loongarch64-unknown-none.tar.xz=b3b7959a696c75575edb3676520f64178151df1d523128c6ed6e28cd0c8051b9 | |
| 166 | dist/2024-09-22/rust-std-beta-loongarch64-unknown-none-softfloat.tar.gz=7b15fd753967116653b4372e10796ae2ea35910872f517a2d1c6dd3539717915 | |
| 167 | dist/2024-09-22/rust-std-beta-loongarch64-unknown-none-softfloat.tar.xz=87f88922e5c3a17af392bade5af1ce94f03aac275e6ed3dbadc9d6c720223c7f | |
| 168 | dist/2024-09-22/rust-std-beta-nvptx64-nvidia-cuda.tar.gz=f1d4f6887d12f1316bcf515bd07f9474bb9e036dfe78171720d72e98de580791 | |
| 169 | dist/2024-09-22/rust-std-beta-nvptx64-nvidia-cuda.tar.xz=2dcaa78854d5b619e9609db70fa805cdf1e5baf2fac35f3eefb66ae854e78891 | |
| 170 | dist/2024-09-22/rust-std-beta-powerpc-unknown-linux-gnu.tar.gz=c4ae30e180d94550da74b09f6005a6224136d8b5d752e9cdb1b44081a95b8c9f | |
| 171 | dist/2024-09-22/rust-std-beta-powerpc-unknown-linux-gnu.tar.xz=c6438a341e8008b3c475e3250d52df2cb0a505862a14ed70e89884086a56e54f | |
| 172 | dist/2024-09-22/rust-std-beta-powerpc64-unknown-linux-gnu.tar.gz=8ff723f008f1ff81541f2f14d68ad1e77a2842577dcbe4f5109f6c54fdc42726 | |
| 173 | dist/2024-09-22/rust-std-beta-powerpc64-unknown-linux-gnu.tar.xz=c5704ef9d690721790d127ca341e4747d572bd34f636894fe897d23660a11467 | |
| 174 | dist/2024-09-22/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.gz=13d46982612f710d7aacf1a9636502418fdc673dde21641e1c52d2c55c8c35a1 | |
| 175 | dist/2024-09-22/rust-std-beta-powerpc64le-unknown-linux-gnu.tar.xz=9e33e5c0ffd8511705258a741b448e167fdb13229d1d8bb36ef0b41a1f9c49ec | |
| 176 | dist/2024-09-22/rust-std-beta-riscv32i-unknown-none-elf.tar.gz=f7e0cc15730cfcd05ac904a3fb6012a99310c15402db19e915860fc4bc1f55ce | |
| 177 | dist/2024-09-22/rust-std-beta-riscv32i-unknown-none-elf.tar.xz=af179ee477d53727d01feeb704776370482f8aa6f6bd51d7dcbcf90010d36b74 | |
| 178 | dist/2024-09-22/rust-std-beta-riscv32im-unknown-none-elf.tar.gz=9673565000aebce56cddf905d27ec651d2c2845e9a2768ec38d10e18443924d8 | |
| 179 | dist/2024-09-22/rust-std-beta-riscv32im-unknown-none-elf.tar.xz=38a5d0812838d5596a7a4804ee46e97bc5f4814056f93ad0988b7f2f34a90325 | |
| 180 | dist/2024-09-22/rust-std-beta-riscv32imac-unknown-none-elf.tar.gz=cb397f91bf2c66a0f7d704c320964885aaeacec90a0f562358e8678e749c1e64 | |
| 181 | dist/2024-09-22/rust-std-beta-riscv32imac-unknown-none-elf.tar.xz=ff95fa7f5598ed1f25e2aa0be9fb89ef0a7b145ffa9bcba7479bb3c0d83808b5 | |
| 182 | dist/2024-09-22/rust-std-beta-riscv32imafc-unknown-none-elf.tar.gz=9049a87a4bea3319c7bf8162d5289ce252897e3ee637a0b6bca841c3507b98c4 | |
| 183 | dist/2024-09-22/rust-std-beta-riscv32imafc-unknown-none-elf.tar.xz=e24970b400b30728a9ee5202b0fdb9734c115e015178817629220390badb7e50 | |
| 184 | dist/2024-09-22/rust-std-beta-riscv32imc-unknown-none-elf.tar.gz=aa06101ff7386aac69a1dafeb39645344fae3c0ca02537078029c4ba073aa1af | |
| 185 | dist/2024-09-22/rust-std-beta-riscv32imc-unknown-none-elf.tar.xz=13e358d57a5bfe3e4ca2c8ca5e6c8d026cfac417b3c050ebd9bcd5d24f3a5f6c | |
| 186 | dist/2024-09-22/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.gz=5d880502cba47ed72006ef6e60fe004885c0f215d589a20456d41dcec8238503 | |
| 187 | dist/2024-09-22/rust-std-beta-riscv64gc-unknown-linux-gnu.tar.xz=a242f39d05716b72aeebdf83357835bae0d2386feca6759f343721148b7a0d4d | |
| 188 | dist/2024-09-22/rust-std-beta-riscv64gc-unknown-linux-musl.tar.gz=117ec2433159f057fcd7fbae9d85042979340ab00f8d1b940c3adc5d3c791803 | |
| 189 | dist/2024-09-22/rust-std-beta-riscv64gc-unknown-linux-musl.tar.xz=be0f262d8ed5122fee6b67abd4b78e419839e4005cfff1db9813ae655fbea23f | |
| 190 | dist/2024-09-22/rust-std-beta-riscv64gc-unknown-none-elf.tar.gz=78e28d3d341cedd0fe5ef0036b3b3c246b9f86e5e61d3bfd7e03e95d03920985 | |
| 191 | dist/2024-09-22/rust-std-beta-riscv64gc-unknown-none-elf.tar.xz=43bb14df9b4947f111c1e4ba9c4092b73a895c9431a299e4b076d387477f5687 | |
| 192 | dist/2024-09-22/rust-std-beta-riscv64imac-unknown-none-elf.tar.gz=e325c2ad8623b87456c12e17b29aa7f52ad243971002b4763677052f9b305eff | |
| 193 | dist/2024-09-22/rust-std-beta-riscv64imac-unknown-none-elf.tar.xz=ca02e01254defcfbf0a48ab574dc4b5aecd6a6be2ddc835704986284916019d8 | |
| 194 | dist/2024-09-22/rust-std-beta-s390x-unknown-linux-gnu.tar.gz=79044a23a910bfd8488c382a3d2eab0c6a7ba9677165878b02f28a6c75d3a0b5 | |
| 195 | dist/2024-09-22/rust-std-beta-s390x-unknown-linux-gnu.tar.xz=6a1196d2b2f30e22497a739e3b1ee302339ed442e0b807c707d1c4eb7c53ff3b | |
| 196 | dist/2024-09-22/rust-std-beta-sparc64-unknown-linux-gnu.tar.gz=fa3ad826bcf924094ad5cf19779fbfa70f656c1d2e66f4aee5dcf51792af74f4 | |
| 197 | dist/2024-09-22/rust-std-beta-sparc64-unknown-linux-gnu.tar.xz=d5f701446546c6cb64b413be37f3c4a0739010f25616b6a295adfcefb16e8642 | |
| 198 | dist/2024-09-22/rust-std-beta-sparcv9-sun-solaris.tar.gz=1ac5c327d5a0d0256d16968aab3bf35828c995c818ba73788421da56404f165e | |
| 199 | dist/2024-09-22/rust-std-beta-sparcv9-sun-solaris.tar.xz=fd6c7f163d2d6006eb85cc68e2794850f82dfe09f9173390cd0c167d90622d8d | |
| 200 | dist/2024-09-22/rust-std-beta-thumbv6m-none-eabi.tar.gz=8f082a38dfe968d8f987bfec0822e221d0ab8ab73dfd451b63de7644ccaeb239 | |
| 201 | dist/2024-09-22/rust-std-beta-thumbv6m-none-eabi.tar.xz=044bca675ac6b621ced7f2bc9a9909814c0b0818505ca1bfcd765c1859a9ed7f | |
| 202 | dist/2024-09-22/rust-std-beta-thumbv7em-none-eabi.tar.gz=f3e1789a409b58b9769db8587ddbd21352e6634ff5a508b6ad82237cc85409be | |
| 203 | dist/2024-09-22/rust-std-beta-thumbv7em-none-eabi.tar.xz=5f36d0504401bf6cbd2eed78e4575a190300ae26c581ee8599ab8d6e32dfafaf | |
| 204 | dist/2024-09-22/rust-std-beta-thumbv7em-none-eabihf.tar.gz=a0ed6b4c71570e900e1605302ef865f7df9405e19245ed45ff5f7654eb3cbea7 | |
| 205 | dist/2024-09-22/rust-std-beta-thumbv7em-none-eabihf.tar.xz=6fd7fac23460b49ca5246a6471de4f39d92764231ef2eac5f51d177c9d14ce2a | |
| 206 | dist/2024-09-22/rust-std-beta-thumbv7m-none-eabi.tar.gz=21e1983e3f9c481677db7c839d5b2b301bae748ef52e1d0b5c3fbf9347732c66 | |
| 207 | dist/2024-09-22/rust-std-beta-thumbv7m-none-eabi.tar.xz=ade8b1a2c128c298ba1d20ea7c7585af2a2b3a17b55a8dc6d39f0eebf0f01e66 | |
| 208 | dist/2024-09-22/rust-std-beta-thumbv7neon-linux-androideabi.tar.gz=29c7c493c9fee6afa8aea0f337da66118216ee21b373303432ccfb6375cd8428 | |
| 209 | dist/2024-09-22/rust-std-beta-thumbv7neon-linux-androideabi.tar.xz=d63e1c8cf97c0834a3825d9a552ed0ce744b2471028f49cbad6f7df1f7bfad7c | |
| 210 | dist/2024-09-22/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.gz=0cec39208ae369c146d49dbc98984edb993c318a5dcbff205d3fa6b651400bc0 | |
| 211 | dist/2024-09-22/rust-std-beta-thumbv7neon-unknown-linux-gnueabihf.tar.xz=158f249f6446503ad5c558dba966ca69f57161aa90fa995a9e9b68fb3e38e732 | |
| 212 | dist/2024-09-22/rust-std-beta-thumbv8m.base-none-eabi.tar.gz=8df09685f21eb9285adff2493ea6a9b3a04ce2e24b0761a47b44f0257b3485ff | |
| 213 | dist/2024-09-22/rust-std-beta-thumbv8m.base-none-eabi.tar.xz=0a119d100a6bddf66047e98d453b8c54ab0952712c38b1e396bbef81114d4423 | |
| 214 | dist/2024-09-22/rust-std-beta-thumbv8m.main-none-eabi.tar.gz=e7e234a7a8f687f0649654f562b12e09d332229dfd9e8d81a780afd9d8eac8ea | |
| 215 | dist/2024-09-22/rust-std-beta-thumbv8m.main-none-eabi.tar.xz=a3c6c68ad6c24d080af8034168b36bbb24edc30e1fce2ac91bc3fa09ac34a678 | |
| 216 | dist/2024-09-22/rust-std-beta-thumbv8m.main-none-eabihf.tar.gz=1662be2b7ec3db6331ef545ac59c844733c3d1cdc728aef78049fecf37a416c5 | |
| 217 | dist/2024-09-22/rust-std-beta-thumbv8m.main-none-eabihf.tar.xz=b19dd77e7582da1785f78e85e39a9d966c7a747641e6772dd18cbd489b4940b8 | |
| 218 | dist/2024-09-22/rust-std-beta-wasm32-unknown-emscripten.tar.gz=a7ae18e142b5b7a3fbab372bbf4e829626b52a67a10496f2cdecc89aab029310 | |
| 219 | dist/2024-09-22/rust-std-beta-wasm32-unknown-emscripten.tar.xz=75a9a2dae5117b714a08024588cb4f5e5a6f07f28af55013f49fbe7cc8e2a690 | |
| 220 | dist/2024-09-22/rust-std-beta-wasm32-unknown-unknown.tar.gz=25bf0342788e03ad52ee4835f280f3d92bf2324db3acfcf2654c5f5d37d43431 | |
| 221 | dist/2024-09-22/rust-std-beta-wasm32-unknown-unknown.tar.xz=21798a2663b6d0e7347404666d5341b51c5d5de108cd68efbd1466b7c4002a62 | |
| 222 | dist/2024-09-22/rust-std-beta-wasm32-wasi.tar.gz=02c1fcc01d28005432f6e53b6f8cecda2b555d482f713ec70ac92b1507121ec7 | |
| 223 | dist/2024-09-22/rust-std-beta-wasm32-wasi.tar.xz=f2b4ae22141d39202bddd45e3373a8520684dd71460ceb3cdc9bc7d09aedd774 | |
| 224 | dist/2024-09-22/rust-std-beta-wasm32-wasip1.tar.gz=f59a67c3acc927e72278f66553cd10bb3d81e16045c76671d38d09c8a462c78f | |
| 225 | dist/2024-09-22/rust-std-beta-wasm32-wasip1.tar.xz=0f4eea80dcd13008f55d7120f2239aed87a6dcf693f70983caffc36a4be72ffb | |
| 226 | dist/2024-09-22/rust-std-beta-wasm32-wasip1-threads.tar.gz=2581846fe64f1d9547ec293875be715251174c5b163a7c533dcae81fd55ea6d6 | |
| 227 | dist/2024-09-22/rust-std-beta-wasm32-wasip1-threads.tar.xz=ad6d869148eea87192f786fca0302983094b25a1afec2813012ba3133e8994c8 | |
| 228 | dist/2024-09-22/rust-std-beta-wasm32-wasip2.tar.gz=091057da389eb1d464353acca41e158130f969ad20f90827a4dc38bd363a68fa | |
| 229 | dist/2024-09-22/rust-std-beta-wasm32-wasip2.tar.xz=c91b4440326443a4987758ac161b79f5aa30d23662a5c99a3c0adfedc0eb8e51 | |
| 230 | dist/2024-09-22/rust-std-beta-x86_64-apple-darwin.tar.gz=180a9b1d5fb71ec3e88dd4e3a88f6f1da433a191125ecdf98c0169bd7b0511b3 | |
| 231 | dist/2024-09-22/rust-std-beta-x86_64-apple-darwin.tar.xz=7d066c7b394c5b15027472fa388b9379ae8a7d4a990e02c0785f63a6f1b7f0c7 | |
| 232 | dist/2024-09-22/rust-std-beta-x86_64-apple-ios.tar.gz=4ebdf9f16075859830e76e40547d1d56230ed8715e57f254c82d467634aa63e5 | |
| 233 | dist/2024-09-22/rust-std-beta-x86_64-apple-ios.tar.xz=0bdcf11914a169b86b945df232a30c69f991393e3871956b55ca88a0ad65bf79 | |
| 234 | dist/2024-09-22/rust-std-beta-x86_64-apple-ios-macabi.tar.gz=45ea8961f12b31e8404ebd178586711f7e4d4729d96ee298623240d8163766aa | |
| 235 | dist/2024-09-22/rust-std-beta-x86_64-apple-ios-macabi.tar.xz=a36a3ed36c0224edaa5161b1c2cb7acb2736d0c2845d56064bde1c94af4e2db1 | |
| 236 | dist/2024-09-22/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.gz=8d217487118140549fdc2223954d38a7932a2e9004a07924f853139395f8d88d | |
| 237 | dist/2024-09-22/rust-std-beta-x86_64-fortanix-unknown-sgx.tar.xz=66d7b8cc0b92af4f0458eab631faee6069c3bdf8e35200fa3d573177b1b354c8 | |
| 238 | dist/2024-09-22/rust-std-beta-x86_64-linux-android.tar.gz=7efbe112fdf33d55ada19f3803b2552796d1027281b6c652a19465e4902a22bf | |
| 239 | dist/2024-09-22/rust-std-beta-x86_64-linux-android.tar.xz=cacbf59cc9bad0a212d9fb86c81434350fb0b4842918bf7dc51fe978d21402b6 | |
| 240 | dist/2024-09-22/rust-std-beta-x86_64-pc-solaris.tar.gz=073833d7b60d396be6890552f7068e885dc0fd4536e5049e88d97c71df31f126 | |
| 241 | dist/2024-09-22/rust-std-beta-x86_64-pc-solaris.tar.xz=c6cbc8c41eb2e071cad032ae7587c5ae2e841f1d074c328229e3b7f271fe9330 | |
| 242 | dist/2024-09-22/rust-std-beta-x86_64-pc-windows-gnu.tar.gz=0b5c7c007faa77fb28fe7cf275846f23adf0aa3fa1338dc93f86c05f7c605ded | |
| 243 | dist/2024-09-22/rust-std-beta-x86_64-pc-windows-gnu.tar.xz=c1ec0ad342ec630f2ed909c54b0ca7f9073a85977da3a86eb5ef68d5c13ad4b9 | |
| 244 | dist/2024-09-22/rust-std-beta-x86_64-pc-windows-gnullvm.tar.gz=5cf9a1daad4b60f7946adbdc9bde0d0d3ce438902f0a158f5f4f423f10960886 | |
| 245 | dist/2024-09-22/rust-std-beta-x86_64-pc-windows-gnullvm.tar.xz=d8cfeec61cbbf6bb1b4234bd53a777ad2157def8dc232ba4b5f16bc81f4f1524 | |
| 246 | dist/2024-09-22/rust-std-beta-x86_64-pc-windows-msvc.tar.gz=795ac3edcb9f0f10f36a19be14641918b5b0d647d5cc38e8652040437e409538 | |
| 247 | dist/2024-09-22/rust-std-beta-x86_64-pc-windows-msvc.tar.xz=dacb5baf49d2b3dd8727a159f8fd348967f987a95162e587c8e5add57dd6d31e | |
| 248 | dist/2024-09-22/rust-std-beta-x86_64-unknown-freebsd.tar.gz=089f99e1cbeab86b5d7ba9d582c5771c8d229ece1f81ad110716618823692deb | |
| 249 | dist/2024-09-22/rust-std-beta-x86_64-unknown-freebsd.tar.xz=8749c2ae47644c16f62a310500ab91e5403a25c3e023a2c6e25cfa16217c98e9 | |
| 250 | dist/2024-09-22/rust-std-beta-x86_64-unknown-fuchsia.tar.gz=becef9619e8ad1d4de66796c5877fd9798e5c943fb93a893aacd7819465f8a15 | |
| 251 | dist/2024-09-22/rust-std-beta-x86_64-unknown-fuchsia.tar.xz=3801cc566789ae0313a5d10159cd0c94cbbcd8636409ba69ace73fae972ce2eb | |
| 252 | dist/2024-09-22/rust-std-beta-x86_64-unknown-illumos.tar.gz=ba74cfa20f8c53865d96d26b9aaaa7abebf2269d1c3fe2bcd70e3cd7bd4e78d1 | |
| 253 | dist/2024-09-22/rust-std-beta-x86_64-unknown-illumos.tar.xz=8f0a00cb53e21c90d60eb02853412d4cf671a1667bbbf7fe9a64183d966a9e48 | |
| 254 | dist/2024-09-22/rust-std-beta-x86_64-unknown-linux-gnu.tar.gz=1188997812bfef02c93a13a7d31a9df560383a875bb6a3cbdbb03eaf5fa0d649 | |
| 255 | dist/2024-09-22/rust-std-beta-x86_64-unknown-linux-gnu.tar.xz=12583cfd10835abf0f340fe8e141683cdce3e4df5a00998a04361b59203321e6 | |
| 256 | dist/2024-09-22/rust-std-beta-x86_64-unknown-linux-gnux32.tar.gz=854f01a511c01b003facf4beb89a511395f0efcdc2284ad279b92837349eaa95 | |
| 257 | dist/2024-09-22/rust-std-beta-x86_64-unknown-linux-gnux32.tar.xz=b016d4584a44064feee64de50963ccfbfaaecb792c88c97a079f279a0c1df955 | |
| 258 | dist/2024-09-22/rust-std-beta-x86_64-unknown-linux-musl.tar.gz=912eea9c27b6fd251c5b92ae24d6321d5effe9586dbbd473e16a8dee2b758291 | |
| 259 | dist/2024-09-22/rust-std-beta-x86_64-unknown-linux-musl.tar.xz=96bf10ef8fee6f8571b6601ab89e65562a91312502630c139d986b6e1ec9fbac | |
| 260 | dist/2024-09-22/rust-std-beta-x86_64-unknown-linux-ohos.tar.gz=09e42b412f0891d608a9d4030203fe09645fc763ecad4be5ae790122a5d01f4a | |
| 261 | dist/2024-09-22/rust-std-beta-x86_64-unknown-linux-ohos.tar.xz=dd84077f22ac4abea1c143d5d293425a85fad62ac65a4b31f18b9100c4e1076e | |
| 262 | dist/2024-09-22/rust-std-beta-x86_64-unknown-netbsd.tar.gz=9aa5fa7bf57fbb95c3a6f718c0a2b62f32c6d1c9ccf93b392d4e166d311e0833 | |
| 263 | dist/2024-09-22/rust-std-beta-x86_64-unknown-netbsd.tar.xz=765cf1a81b03ce210a88e87404a64d5b378f6615e428c385fac7a33b646f1276 | |
| 264 | dist/2024-09-22/rust-std-beta-x86_64-unknown-none.tar.gz=e00c50362ffc95a1704912ea35c7b1792ead7906d98937fd73b9fa9fe31a520c | |
| 265 | dist/2024-09-22/rust-std-beta-x86_64-unknown-none.tar.xz=280cf203356db9c32898197a3b5954901897a5b3059547f67c59cf5780c46386 | |
| 266 | dist/2024-09-22/rust-std-beta-x86_64-unknown-redox.tar.gz=77069fcc33bc481ac8e18697884c1f3e3004a5fe5b265acb419b5f60c03fd2c9 | |
| 267 | dist/2024-09-22/rust-std-beta-x86_64-unknown-redox.tar.xz=254dba227a76cb476fbc2a897169713969bf00f691ef77e03d303473db130523 | |
| 268 | dist/2024-09-22/rust-std-beta-x86_64-unknown-uefi.tar.gz=4f1fb25ef423ab3cd5577f3e081771494978998acb8c04dda9de8a7d56cce985 | |
| 269 | dist/2024-09-22/rust-std-beta-x86_64-unknown-uefi.tar.xz=fc21de2770ff0d0eb44d0939db5b274b0f408eb1a904c9eaf4db4c9463b5ff8d | |
| 270 | dist/2024-09-22/cargo-beta-aarch64-apple-darwin.tar.gz=489c1b6aef3a7275e2e7a644677dde933a738534966089fe28c52c61dff04f2c | |
| 271 | dist/2024-09-22/cargo-beta-aarch64-apple-darwin.tar.xz=5fe4d6a15e4f51f0575f2aee12eb644a95e548a4f03a80835296c44b1daf18a6 | |
| 272 | dist/2024-09-22/cargo-beta-aarch64-pc-windows-msvc.tar.gz=5c5c408b026e0332c4e5d816c7a6a961ae5af0174f02b793edd613e56c672494 | |
| 273 | dist/2024-09-22/cargo-beta-aarch64-pc-windows-msvc.tar.xz=4e060bccd78dc8abba7c7006585103b6bfa473a0f1cdd9e2c6b10d4fb8294f8c | |
| 274 | dist/2024-09-22/cargo-beta-aarch64-unknown-linux-gnu.tar.gz=45cee09ecd3655b3a822b9c85e3f61f8e40b3fb510728503a3691f56ce415274 | |
| 275 | dist/2024-09-22/cargo-beta-aarch64-unknown-linux-gnu.tar.xz=d8902eb0c3a725ef6345d325907ac10a7eb81e274c59aa589bf05aedea5958cb | |
| 276 | dist/2024-09-22/cargo-beta-aarch64-unknown-linux-musl.tar.gz=67e6658e39c0381554ac025c26564888804eb9d8a3e1178726652fff03bc21b4 | |
| 277 | dist/2024-09-22/cargo-beta-aarch64-unknown-linux-musl.tar.xz=427e7a4781dcdd2e316eb0c2751257597b4af58da8a5fd8407a8402814b65148 | |
| 278 | dist/2024-09-22/cargo-beta-arm-unknown-linux-gnueabi.tar.gz=735d1b824d3a375a6b9c5a5d22fb5e607d3ad06ff70cebe81b84007967c6a5c7 | |
| 279 | dist/2024-09-22/cargo-beta-arm-unknown-linux-gnueabi.tar.xz=749c017f8c25d0df23a160e02a765bb5e967f7657fdf3105d0d7ce64afe83524 | |
| 280 | dist/2024-09-22/cargo-beta-arm-unknown-linux-gnueabihf.tar.gz=050ae56d0398150212a75493562e6654cc14b7a1ebd6051bde146b5d408d24c8 | |
| 281 | dist/2024-09-22/cargo-beta-arm-unknown-linux-gnueabihf.tar.xz=1088b61e20981dabe406ff52965f48ab1542dd84d9673f7d56b21145d0b604b3 | |
| 282 | dist/2024-09-22/cargo-beta-armv7-unknown-linux-gnueabihf.tar.gz=43dfb8491dcb64b91e6786366300a0ee3fd00f1815cd84f3bb4247e6b723a6d6 | |
| 283 | dist/2024-09-22/cargo-beta-armv7-unknown-linux-gnueabihf.tar.xz=90266fcba10bd88e1f8f5d8420ee6835fe3e337dad1cc43ab7ef79edbe1a1b98 | |
| 284 | dist/2024-09-22/cargo-beta-i686-pc-windows-gnu.tar.gz=6dca2e273600ee0f92a416901a7713ffd6db420b953e62d51d95bc85c1dbe27b | |
| 285 | dist/2024-09-22/cargo-beta-i686-pc-windows-gnu.tar.xz=36fa46c7edcfc881568435f366e76f1989479356d93b8982981658fd44b80f4d | |
| 286 | dist/2024-09-22/cargo-beta-i686-pc-windows-msvc.tar.gz=bd99a9cf662fbe90b79711776f972d2d574fcd6f0053bb672e4cdb35fc67ddf3 | |
| 287 | dist/2024-09-22/cargo-beta-i686-pc-windows-msvc.tar.xz=8a995e56a96217cd999e786b16a69de1ec6e9db6412cd2c9c6ce090ed21a84bf | |
| 288 | dist/2024-09-22/cargo-beta-i686-unknown-linux-gnu.tar.gz=ae115caa9516a96f144db9751b185503e1c648ea9b7e8b0a6aa10200315e6458 | |
| 289 | dist/2024-09-22/cargo-beta-i686-unknown-linux-gnu.tar.xz=54b125ce0c00afa7bdebf5cb592249c37ac21d78479129a46d0b70d86fe6bf17 | |
| 290 | dist/2024-09-22/cargo-beta-loongarch64-unknown-linux-gnu.tar.gz=21d2ca9f6d715e44fae058b7c26abc873930ac2823e72c9f8c983f7d089bd91a | |
| 291 | dist/2024-09-22/cargo-beta-loongarch64-unknown-linux-gnu.tar.xz=b9b395041d328a09643b7e727705aa7705bf67c08edb3d26b78405ce454c6798 | |
| 292 | dist/2024-09-22/cargo-beta-loongarch64-unknown-linux-musl.tar.gz=da7853da9096b6ddebc3b3da948b90ac448663dc9a5d2940cad420360d5934a2 | |
| 293 | dist/2024-09-22/cargo-beta-loongarch64-unknown-linux-musl.tar.xz=9997e251abe606e390e3d2c280233f435f8ab46a6a3d24ce95d7a700ec049664 | |
| 294 | dist/2024-09-22/cargo-beta-powerpc-unknown-linux-gnu.tar.gz=1715eabf3860f2fa7e1e27f2163a5243c8000b6216c0e7ac8dec993061ff479b | |
| 295 | dist/2024-09-22/cargo-beta-powerpc-unknown-linux-gnu.tar.xz=f4e0f364c4ca68dc7b40b40bf13e28284a9bf6e6075b10504b9e6979d4a1a375 | |
| 296 | dist/2024-09-22/cargo-beta-powerpc64-unknown-linux-gnu.tar.gz=70cb2337910933f0ce22ef57e8dec4ab5732855d0657e56ed237e3e483aa07d2 | |
| 297 | dist/2024-09-22/cargo-beta-powerpc64-unknown-linux-gnu.tar.xz=1e9e383a093b54b8f7bff8dbf2f38590c148d0c9e18399bc128a09a6c67565bd | |
| 298 | dist/2024-09-22/cargo-beta-powerpc64le-unknown-linux-gnu.tar.gz=6e01a5a6cf68b8385d2a2eaa07984ba62ef4df6811be2ade5dd7b22ba7d4bd69 | |
| 299 | dist/2024-09-22/cargo-beta-powerpc64le-unknown-linux-gnu.tar.xz=70d0e45fba27db3322c3e4d802cdcd37503d2a848b9c0c2b9b759d48611c19ab | |
| 300 | dist/2024-09-22/cargo-beta-riscv64gc-unknown-linux-gnu.tar.gz=baabb56c3670a0dab62fc7c0e5cb07474de795e81a6be42c57a91c2249e9b960 | |
| 301 | dist/2024-09-22/cargo-beta-riscv64gc-unknown-linux-gnu.tar.xz=fd87e580bd0d4b47340b797fb52aeda83854556328869ebd1ce7136bcf8ead78 | |
| 302 | dist/2024-09-22/cargo-beta-s390x-unknown-linux-gnu.tar.gz=dbf01fb97c1aa9db57b68fa863dca5df81e1f83c1686bdbc01c702b0148bba7a | |
| 303 | dist/2024-09-22/cargo-beta-s390x-unknown-linux-gnu.tar.xz=f2eaf49ad1a05b5acf3050159aeb7351544c5aa14a46b381b0e2659eb857bce8 | |
| 304 | dist/2024-09-22/cargo-beta-x86_64-apple-darwin.tar.gz=cdd90fe77bff57d0acae21499c0188fac2ddf7aa24dba07dcbf900444ceb1295 | |
| 305 | dist/2024-09-22/cargo-beta-x86_64-apple-darwin.tar.xz=2c8acbf6eb4076ad876993f09714a2b1664031a41a12ff395c1f9c4bd0283640 | |
| 306 | dist/2024-09-22/cargo-beta-x86_64-pc-windows-gnu.tar.gz=f16189ad7a0d311b17b6bb6ced913cde0115ac07e9a950b85d4336c488456c6c | |
| 307 | dist/2024-09-22/cargo-beta-x86_64-pc-windows-gnu.tar.xz=1d4bf171c84def4110ee3f4e4798ab3ee52d0323bc2fc4abd564f229a23846da | |
| 308 | dist/2024-09-22/cargo-beta-x86_64-pc-windows-msvc.tar.gz=c3e27d6a38eb46fca153ef17cea76b11664e8171e0aa76af594e67ed9dffbef5 | |
| 309 | dist/2024-09-22/cargo-beta-x86_64-pc-windows-msvc.tar.xz=b64792d6ec70ee083dac929343ab45f4a52039c7fbc6cb223b02663591c8f544 | |
| 310 | dist/2024-09-22/cargo-beta-x86_64-unknown-freebsd.tar.gz=40bf96a087dc1d57ba495733975ff34a4e75e51d7ddffc025561f0951adb57ca | |
| 311 | dist/2024-09-22/cargo-beta-x86_64-unknown-freebsd.tar.xz=7912a49f7a181145b71a197014e3de6594b216959cd7c95a003fcd13854cb056 | |
| 312 | dist/2024-09-22/cargo-beta-x86_64-unknown-illumos.tar.gz=1c3dfd5dcb8e7c8ba947b67f5bc466bae26ca1518a74798cfe5a21997bfcf71d | |
| 313 | dist/2024-09-22/cargo-beta-x86_64-unknown-illumos.tar.xz=6f620a91c2bc145f894f5736a9818f7b54583a93e7eb2d0ac202f46a38040b99 | |
| 314 | dist/2024-09-22/cargo-beta-x86_64-unknown-linux-gnu.tar.gz=c6c20977054f56fc279e666cf02da65acb376c1b08bbbc998cf34d0cc2b5bb7b | |
| 315 | dist/2024-09-22/cargo-beta-x86_64-unknown-linux-gnu.tar.xz=9cca7e46ad35f0f69d8fe628a95e44388ed5cb62c1b77f2bab03dab28a05a650 | |
| 316 | dist/2024-09-22/cargo-beta-x86_64-unknown-linux-musl.tar.gz=74005a4511ca2087ebb92db7e19a2e31e3ddcdef93e27da544bbc444df01dc32 | |
| 317 | dist/2024-09-22/cargo-beta-x86_64-unknown-linux-musl.tar.xz=94215716623cadc8bf4a119612ad7482661905748d4e43ddff1855d4746f3972 | |
| 318 | dist/2024-09-22/cargo-beta-x86_64-unknown-netbsd.tar.gz=fd9b2dd77b76b2ac44dbeb80e46371669223fe8ca57e4d480deeb162168c38d5 | |
| 319 | dist/2024-09-22/cargo-beta-x86_64-unknown-netbsd.tar.xz=d419dbb9d1c905eb841c6870ddc8afe946b7618d3a0c6f39f8feeba6ecc74f0d | |
| 320 | dist/2024-09-22/clippy-beta-aarch64-apple-darwin.tar.gz=60aba239287116d7e0f58fc71e510fdb7582003efdb3011765f732b1e494c7e1 | |
| 321 | dist/2024-09-22/clippy-beta-aarch64-apple-darwin.tar.xz=00ef2da71c8e3f5be8401128509ff99130eebd5c0b90b5b5c16dc0465c2a18f8 | |
| 322 | dist/2024-09-22/clippy-beta-aarch64-pc-windows-msvc.tar.gz=7ff2952e057849ec69a7d1147920c2b6ecb99fe7984afe627c5514c8c6a8811c | |
| 323 | dist/2024-09-22/clippy-beta-aarch64-pc-windows-msvc.tar.xz=cc3e145daaf3674c1436d4380171ce5e26b075975121dac5c1d5c5d6cfa1a6e6 | |
| 324 | dist/2024-09-22/clippy-beta-aarch64-unknown-linux-gnu.tar.gz=430c6d5ded52d04bfe93fce17f8fef57ce3ab05715767b85d6c9b59e521671b2 | |
| 325 | dist/2024-09-22/clippy-beta-aarch64-unknown-linux-gnu.tar.xz=df4b9444dd435133bcfe386955b1d4b63c13e4acd766dc3bb9742c21431926d4 | |
| 326 | dist/2024-09-22/clippy-beta-aarch64-unknown-linux-musl.tar.gz=7064208f59db897b1107072a3cc1a516d53888ea1c549bdf3cfd8479c65ec0c3 | |
| 327 | dist/2024-09-22/clippy-beta-aarch64-unknown-linux-musl.tar.xz=1d33c3e2b4daa1ba7f1a6399790d1b76fdfe1ac9d293859983412d5e1e3663a1 | |
| 328 | dist/2024-09-22/clippy-beta-arm-unknown-linux-gnueabi.tar.gz=b851cb5bcb31a2105039b55a613d937113fd45f5c1fbd4e3d24eecbed85a0bb0 | |
| 329 | dist/2024-09-22/clippy-beta-arm-unknown-linux-gnueabi.tar.xz=a17f46c82fa28bfa9e3c9ff99cd25a888b6ff0c08a887ef4056b8ae29437a67a | |
| 330 | dist/2024-09-22/clippy-beta-arm-unknown-linux-gnueabihf.tar.gz=784a1a0134d54cff72c9bf59ee1e750d0493fef5bde06bf778bc98321d833031 | |
| 331 | dist/2024-09-22/clippy-beta-arm-unknown-linux-gnueabihf.tar.xz=c11461066103bf92f21298e5cb3b009cf4ac07bde5d99ce9ab97c1cbdf7c73f5 | |
| 332 | dist/2024-09-22/clippy-beta-armv7-unknown-linux-gnueabihf.tar.gz=98c74f6a0692482355045bb4b0977887b419a8aa3c4654b9b59cd0d867f261ac | |
| 333 | dist/2024-09-22/clippy-beta-armv7-unknown-linux-gnueabihf.tar.xz=20c82e6bbefdbaca22911a63a41d0aa05ed0ffad4571090c053cb354b49acd23 | |
| 334 | dist/2024-09-22/clippy-beta-i686-pc-windows-gnu.tar.gz=3da558108df227ceb0ff7a2837d1bd2f5a75a0c7167f0b3c380d1aa5b2fa3e77 | |
| 335 | dist/2024-09-22/clippy-beta-i686-pc-windows-gnu.tar.xz=f657f1cdc9f91243112834afbe5fe60f8b43e914504c8aed1994a13ac98bc575 | |
| 336 | dist/2024-09-22/clippy-beta-i686-pc-windows-msvc.tar.gz=cf27f06843f5e0706aace4be4b9973fd164b57697b44d00852a9545d336c6fd2 | |
| 337 | dist/2024-09-22/clippy-beta-i686-pc-windows-msvc.tar.xz=74dd229cdf65ce19ded1ed27cf5fb31c20f6a45879b277ad43aedc818eed514c | |
| 338 | dist/2024-09-22/clippy-beta-i686-unknown-linux-gnu.tar.gz=4d22b439675ec118d021a85dc75540d7a3331364395e21bc1a2d76c26aabe9d3 | |
| 339 | dist/2024-09-22/clippy-beta-i686-unknown-linux-gnu.tar.xz=bfc60e9fe1dbed050904efc71e8d0e5c90dae7f949fc7c81312de0c129f4d058 | |
| 340 | dist/2024-09-22/clippy-beta-loongarch64-unknown-linux-gnu.tar.gz=25df67e21543e3a3b71500f55da1abe6182a24aabe1f5bb1e57fe99821a22d97 | |
| 341 | dist/2024-09-22/clippy-beta-loongarch64-unknown-linux-gnu.tar.xz=7b56b6f7704742821f42396f5c517adda129b68f05da258d371cc8a3bc7356f3 | |
| 342 | dist/2024-09-22/clippy-beta-loongarch64-unknown-linux-musl.tar.gz=f7305d23b8b850b4169a2ae6816c9db721a989ffbb642a4645ed95068a6553fe | |
| 343 | dist/2024-09-22/clippy-beta-loongarch64-unknown-linux-musl.tar.xz=9576586590c11c86e8b029c32f17916ebd13d27d8750e30a927a4a986dd47aea | |
| 344 | dist/2024-09-22/clippy-beta-powerpc-unknown-linux-gnu.tar.gz=1eb483594b3ca3ab8e0eac99e7699be151791fcdf0349714b0da923ea33b92bc | |
| 345 | dist/2024-09-22/clippy-beta-powerpc-unknown-linux-gnu.tar.xz=42b9373a18ebf76394513cb75f8072ca094efbdfd8c60cc2249b04fad344f677 | |
| 346 | dist/2024-09-22/clippy-beta-powerpc64-unknown-linux-gnu.tar.gz=fa6438d40613bb99062118bfb293f6f252a21c927d222c7cdfe4cee865d30d16 | |
| 347 | dist/2024-09-22/clippy-beta-powerpc64-unknown-linux-gnu.tar.xz=7cfba858f149b327cbd9bf292080a2ae20404018228ab556eeefc3776f429785 | |
| 348 | dist/2024-09-22/clippy-beta-powerpc64le-unknown-linux-gnu.tar.gz=5f6d94333400f99bbb0762be18fa9390885c13f4fe0ad7ea05b57808b26653e4 | |
| 349 | dist/2024-09-22/clippy-beta-powerpc64le-unknown-linux-gnu.tar.xz=38042ee6161d8e8b04faf58a4bca98cf7940ece6ec42eb44ce29bdb9aedb6c89 | |
| 350 | dist/2024-09-22/clippy-beta-riscv64gc-unknown-linux-gnu.tar.gz=b5056a3d8a8b3bbd888647117b316404b2701803bff09737cca18e16611ed3cd | |
| 351 | dist/2024-09-22/clippy-beta-riscv64gc-unknown-linux-gnu.tar.xz=9322024609e563bb0d1f342bae2deab1d0c0ae951c2e94fe74ddc22fe2c7d3f2 | |
| 352 | dist/2024-09-22/clippy-beta-s390x-unknown-linux-gnu.tar.gz=8b52721fc1df5cd158e12ae80a2936929f64a7b2506c55793b4a7d28522f0e3e | |
| 353 | dist/2024-09-22/clippy-beta-s390x-unknown-linux-gnu.tar.xz=66dedbc154a11588a03616b92823c63502276123e66e9ff110c2e63cc7ed3529 | |
| 354 | dist/2024-09-22/clippy-beta-x86_64-apple-darwin.tar.gz=66ba82b5e5097a2e35053fcb5db9ca44a152c1172f75d689688454561c8b3712 | |
| 355 | dist/2024-09-22/clippy-beta-x86_64-apple-darwin.tar.xz=cfaa2e71b847103660336ad58025fff26f2928a4d7bcc5907fef91e70b63e1fc | |
| 356 | dist/2024-09-22/clippy-beta-x86_64-pc-windows-gnu.tar.gz=fef4e4f2c68294908e170c78efb657c02166fbfbc45b6ce65fbfb5c76ce6d20c | |
| 357 | dist/2024-09-22/clippy-beta-x86_64-pc-windows-gnu.tar.xz=0eec7155f78dfd0cc2e6ac996053492d7ba8a4fa5203f779a92b04ad42e8f651 | |
| 358 | dist/2024-09-22/clippy-beta-x86_64-pc-windows-msvc.tar.gz=4dc7b6c972ed13417fa831ee20b9e4cc0a3895c39d4f059d1a14ebe51f7430e3 | |
| 359 | dist/2024-09-22/clippy-beta-x86_64-pc-windows-msvc.tar.xz=c9f3fb89a31cbba2b575cbb7fc74c09c087940b138b34015239c8938ed6d6f14 | |
| 360 | dist/2024-09-22/clippy-beta-x86_64-unknown-freebsd.tar.gz=cd7e5a9ee6be58a627b13d2e85c05aebd64414f854229aca917f3334acbe2352 | |
| 361 | dist/2024-09-22/clippy-beta-x86_64-unknown-freebsd.tar.xz=7d81d8fd02506935f289e22c6a8f3433bc2c78ea02bbfa4950a31f49eb95344b | |
| 362 | dist/2024-09-22/clippy-beta-x86_64-unknown-illumos.tar.gz=d38eda29de151d13b0fb1f58b090b63e049e095a326e26b76055383ba13285a0 | |
| 363 | dist/2024-09-22/clippy-beta-x86_64-unknown-illumos.tar.xz=3100a9e357e6ded30499d4a60a6ff64f26d99e1cbd1eea11ca7fcf92a9c1f293 | |
| 364 | dist/2024-09-22/clippy-beta-x86_64-unknown-linux-gnu.tar.gz=c09c9e00e653ffdb51c4edca6aa1e23572092c45a1cb81235f05bc75331d68c3 | |
| 365 | dist/2024-09-22/clippy-beta-x86_64-unknown-linux-gnu.tar.xz=1e2fa4de890d7bc6c2828df95a729a55cb2b255a25d96194ccca0c3e06a580ba | |
| 366 | dist/2024-09-22/clippy-beta-x86_64-unknown-linux-musl.tar.gz=ac80d0b1b7f3e451c3bd00fd882b547a9b87e95c3fc0d332050859ff827782a9 | |
| 367 | dist/2024-09-22/clippy-beta-x86_64-unknown-linux-musl.tar.xz=1178ff5a580bd131ecb9a7b0ad2894c09f2882bcfc483ca14e1fd780925e97ed | |
| 368 | dist/2024-09-22/clippy-beta-x86_64-unknown-netbsd.tar.gz=b69d92c035e456d4d1dd8a09032a92f8226c9f39579966e86c2e202ac9995d29 | |
| 369 | dist/2024-09-22/clippy-beta-x86_64-unknown-netbsd.tar.xz=a0e827a24ffe8d2b38efff5da0972eee15e098f790b49035b21a72ebf1cb17ef | |
| 370 | dist/2024-09-22/rustfmt-nightly-aarch64-apple-darwin.tar.gz=4e632df4953f955b24414d929c352ce1f6e196c50cedde3da4d8663f5f1dd77e | |
| 371 | dist/2024-09-22/rustfmt-nightly-aarch64-apple-darwin.tar.xz=d7f8d8442b25053e767ec85e50aa2a6f9bb01e45a2ec3fdec56ef1c305a91ba2 | |
| 372 | dist/2024-09-22/rustfmt-nightly-aarch64-pc-windows-msvc.tar.gz=eaee820d549347d15f1b96e3c85517a65e2a5655b86e27927eb6646a7c1d7b67 | |
| 373 | dist/2024-09-22/rustfmt-nightly-aarch64-pc-windows-msvc.tar.xz=5fb16519d2acb68df963800c9a5036f1ee38b6ea02a115c40b6622338cf7052c | |
| 374 | dist/2024-09-22/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.gz=037999e2fed25ae76b70960133a811a29707712d2141fc74a1db312cfe6020e1 | |
| 375 | dist/2024-09-22/rustfmt-nightly-aarch64-unknown-linux-gnu.tar.xz=b10d1947baafc6160ce8d5902936c2b3469a1558b71263671e581ac5b1c14f0e | |
| 376 | dist/2024-09-22/rustfmt-nightly-aarch64-unknown-linux-musl.tar.gz=eb33ec39c232a6ddeab1b8038222f96407b9671052f995e0a60ada332a1ccb3f | |
| 377 | dist/2024-09-22/rustfmt-nightly-aarch64-unknown-linux-musl.tar.xz=396775133e37dac5de8e71e5d8fea26c19dbfc7841244a35c3529f5dfec93163 | |
| 378 | dist/2024-09-22/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.gz=4885a99dbab8f33288501532b287c20f981bdcd10ea4d9ccffe585d5338c43d3 | |
| 379 | dist/2024-09-22/rustfmt-nightly-arm-unknown-linux-gnueabi.tar.xz=af165d8090fd3c32efc7e5f58dd57d4a2c228cc6a9939c40024d896c35119bf6 | |
| 380 | dist/2024-09-22/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.gz=150086cbd94e084b30faaebabc809cff11eca87a4aa4ff2b2b89286e0af6760e | |
| 381 | dist/2024-09-22/rustfmt-nightly-arm-unknown-linux-gnueabihf.tar.xz=49ab34e495e893037431851e65a35ea7e9d0b46ba651f7d73591bd659c031bd7 | |
| 382 | dist/2024-09-22/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.gz=c61c6bb8a96c19a848155a38560e0a6dac91ec5f1ee2c602a060cd6039324839 | |
| 383 | dist/2024-09-22/rustfmt-nightly-armv7-unknown-linux-gnueabihf.tar.xz=81b7ae3c5e27830fa10a17e062c56bcfe66413b994b27951b63f67faabd296d4 | |
| 384 | dist/2024-09-22/rustfmt-nightly-i686-pc-windows-gnu.tar.gz=585896ee3c2b1644ebcba6a81b2f2dabc47da151f6100b5660e208c3a2967952 | |
| 385 | dist/2024-09-22/rustfmt-nightly-i686-pc-windows-gnu.tar.xz=ca875f395d33249cbfd657cfab1b4c596de1453c4451c7bb4466ebec639ad016 | |
| 386 | dist/2024-09-22/rustfmt-nightly-i686-pc-windows-msvc.tar.gz=4dbce4c329cac38785408eb1a8b2ff5358fd18b59276435695324a03a7018fa9 | |
| 387 | dist/2024-09-22/rustfmt-nightly-i686-pc-windows-msvc.tar.xz=10aea1e2abaae9d098afff8d080cc9d84bfb3f77e2e72ec0a639d61dc5900fd8 | |
| 388 | dist/2024-09-22/rustfmt-nightly-i686-unknown-linux-gnu.tar.gz=140897d538c0f7df473c3f704ec7e9198c9e903b5882688f0494166647dbd91e | |
| 389 | dist/2024-09-22/rustfmt-nightly-i686-unknown-linux-gnu.tar.xz=06e85fa8391eb7d82902ef55af8ee89a16f07b32e4839a848ac09b506f4227e3 | |
| 390 | dist/2024-09-22/rustfmt-nightly-loongarch64-unknown-linux-gnu.tar.gz=4103e5daf242f72c0c7875044ea2ee5f2c88bc5c87ba1e685eee526038663e7d | |
| 391 | dist/2024-09-22/rustfmt-nightly-loongarch64-unknown-linux-gnu.tar.xz=fe424f1c13eb8257036db3e843d4c6b7b0e3bbf310f1d42719046f86dd635c95 | |
| 392 | dist/2024-09-22/rustfmt-nightly-loongarch64-unknown-linux-musl.tar.gz=86304bb8673decae3d6e8b923765b410948277ea00d0cc5b14bb448da149aa8d | |
| 393 | dist/2024-09-22/rustfmt-nightly-loongarch64-unknown-linux-musl.tar.xz=743abf4d3ea8b3e1e8dbed6d9f75ee84680b0636e8e7c536b13bd69a41c8a0d9 | |
| 394 | dist/2024-09-22/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.gz=db68cf7bfaa00b8f6c544b615eabdea998540ae70ec23af6b7370153a6706a64 | |
| 395 | dist/2024-09-22/rustfmt-nightly-powerpc-unknown-linux-gnu.tar.xz=fe1abd02ed36a3720c41c46c77136c89c5addc2c8e5e2cbe25331a34082f4b7a | |
| 396 | dist/2024-09-22/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.gz=c6bb214d68fe7d631398a8684df49f4d1faeb42f9d422c247328e508bdaee830 | |
| 397 | dist/2024-09-22/rustfmt-nightly-powerpc64-unknown-linux-gnu.tar.xz=230e19228f80fa4da3036d4eac5b9f9dde02b47d32c43278190da4d322461fd1 | |
| 398 | dist/2024-09-22/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.gz=b21b569a1831a2ea621c35e19a1820f236fdfc54d38a387789b7750b1af26043 | |
| 399 | dist/2024-09-22/rustfmt-nightly-powerpc64le-unknown-linux-gnu.tar.xz=28f8c4aa4cf00561d6c9dfddc13fdf5fba7b936f9f510b9ecc84160385d590d0 | |
| 400 | dist/2024-09-22/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.gz=5cd81cb8c792abb3c31da225424ef5d1f6006163d3ddee06a95bb4286a29123e | |
| 401 | dist/2024-09-22/rustfmt-nightly-riscv64gc-unknown-linux-gnu.tar.xz=58eedfc8cda153ea5ee92278bf08a0625d129d3e208b3e0244e2b90819c7cc2e | |
| 402 | dist/2024-09-22/rustfmt-nightly-s390x-unknown-linux-gnu.tar.gz=17a0c073de3c6e3769a86d0438b1132762456153f3739c6652f94fca270e3a4b | |
| 403 | dist/2024-09-22/rustfmt-nightly-s390x-unknown-linux-gnu.tar.xz=d7001fc75844be6859a57d2263075ff1b7ac2d88c62452bd42fef97b0afe03d7 | |
| 404 | dist/2024-09-22/rustfmt-nightly-x86_64-apple-darwin.tar.gz=7bc303ca8b36c782f2034441cbb6d3dc3ea891114895d2027cce9d8cd25ce348 | |
| 405 | dist/2024-09-22/rustfmt-nightly-x86_64-apple-darwin.tar.xz=119dcbdeda0fc6cb80d18e6e908646cbaedd615f5a501922344c795ffd1dc7d8 | |
| 406 | dist/2024-09-22/rustfmt-nightly-x86_64-pc-windows-gnu.tar.gz=b14962a790a48b609eda7e1a847c85759cd7dc7f9d0ac9914f126f458b4ae268 | |
| 407 | dist/2024-09-22/rustfmt-nightly-x86_64-pc-windows-gnu.tar.xz=3a710fdf3d35c0a42f5c43341aa00390644d82e76c52aa59f4d652a6ab980b3d | |
| 408 | dist/2024-09-22/rustfmt-nightly-x86_64-pc-windows-msvc.tar.gz=946233868c179df3c133fa04bde2c863028a69776c7416aa4a33adb102d63783 | |
| 409 | dist/2024-09-22/rustfmt-nightly-x86_64-pc-windows-msvc.tar.xz=1db1094ee7c9cad7a16b227de6763b835bc33c0650ba2eb9b380c430a766b81c | |
| 410 | dist/2024-09-22/rustfmt-nightly-x86_64-unknown-freebsd.tar.gz=68bc0322c947af0d98f63fc3e41322c12ce8be2bd185091b14407792d407f59b | |
| 411 | dist/2024-09-22/rustfmt-nightly-x86_64-unknown-freebsd.tar.xz=66e380f40e18c8a1ce91a9eaf7f662cacd580fc2b276cc854c03d795a5b9d547 | |
| 412 | dist/2024-09-22/rustfmt-nightly-x86_64-unknown-illumos.tar.gz=5048bd14d07ed54f5120b0488925f69ff92d2fe00f1e19ae3a8a39a56201c09b | |
| 413 | dist/2024-09-22/rustfmt-nightly-x86_64-unknown-illumos.tar.xz=d2f903f996c265b4d70bb88d47e85dd7382b3298f9ff02ad4502f32d6f9919dd | |
| 414 | dist/2024-09-22/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.gz=f0c150cb2fcbb7cfc4982426be6760093aa6cf854d84ed3c793f766fba6a0cc8 | |
| 415 | dist/2024-09-22/rustfmt-nightly-x86_64-unknown-linux-gnu.tar.xz=5d5cc741435c63b162417f425f7cf9445a13c109687cc85f28424fc51192e333 | |
| 416 | dist/2024-09-22/rustfmt-nightly-x86_64-unknown-linux-musl.tar.gz=a3252a997f60b086ea8c9c32665277f33cf574fdefee859ee448dc0b7eed5be9 | |
| 417 | dist/2024-09-22/rustfmt-nightly-x86_64-unknown-linux-musl.tar.xz=b888f58dce3689e75ea6c23904481f7fec110f0aea45b75a9390d2160e0d3151 | |
| 418 | dist/2024-09-22/rustfmt-nightly-x86_64-unknown-netbsd.tar.gz=4663adcc009bd376b0787760854fb694eaa0edff88f72b4cf486f7180f6a1c2b | |
| 419 | dist/2024-09-22/rustfmt-nightly-x86_64-unknown-netbsd.tar.xz=bfc83277d2217b3a908c3f9153db1336b63270c70c6cd83a2628cf18c41db47f | |
| 420 | dist/2024-09-22/rustc-nightly-aarch64-apple-darwin.tar.gz=ade996e00dd338a86cdcb25961d07c936edec1392526d78dd5de156ba012fe55 | |
| 421 | dist/2024-09-22/rustc-nightly-aarch64-apple-darwin.tar.xz=147d0cfe57be988564d30fcba7fc0c69979b5fbdd91e4a08ac8e580be8a1cc6f | |
| 422 | dist/2024-09-22/rustc-nightly-aarch64-pc-windows-msvc.tar.gz=e6a59a0303abbabb3b373fda7fb697ad2cfd31011f231fbdfd45c1cbd64e8bd7 | |
| 423 | dist/2024-09-22/rustc-nightly-aarch64-pc-windows-msvc.tar.xz=9ee27bc608470ef29a51272656d0ed5e03946dcc3411412ef8b05cc70f97f8b9 | |
| 424 | dist/2024-09-22/rustc-nightly-aarch64-unknown-linux-gnu.tar.gz=3ec6f8cee20883195c102bdcffee31d695698bb6eaf45502720edbc16b02f471 | |
| 425 | dist/2024-09-22/rustc-nightly-aarch64-unknown-linux-gnu.tar.xz=7f8fabd6433acb752131071c5bee76752fcc88e08ffff4684a7badb9ed4bc50e | |
| 426 | dist/2024-09-22/rustc-nightly-aarch64-unknown-linux-musl.tar.gz=7a8756afcd643b78aa6834497935d7bc0ede1ae74150fa83fff85243deb5e554 | |
| 427 | dist/2024-09-22/rustc-nightly-aarch64-unknown-linux-musl.tar.xz=de39081dbeeb0715d433e0cd56e62db45c3bb5bf04d1e7dc3fa097e7b3ca97dc | |
| 428 | dist/2024-09-22/rustc-nightly-arm-unknown-linux-gnueabi.tar.gz=ea6bd6b337d24a7c9995fa95d8884e66755d016fb1d50fea063129a410bec22a | |
| 429 | dist/2024-09-22/rustc-nightly-arm-unknown-linux-gnueabi.tar.xz=fa195b2588675831274ca21c0d2420e5729d1c21c4c245f2fd1d2c044d7ede1c | |
| 430 | dist/2024-09-22/rustc-nightly-arm-unknown-linux-gnueabihf.tar.gz=6f0719613ec54221e978e7136baa00eb25b8b3d627e5de5ee3488c9d9e869b97 | |
| 431 | dist/2024-09-22/rustc-nightly-arm-unknown-linux-gnueabihf.tar.xz=9e0bbd283a0377f881f1c048660c54700561762e220ff2713566d3fb6eb56cce | |
| 432 | dist/2024-09-22/rustc-nightly-armv7-unknown-linux-gnueabihf.tar.gz=c8f88bb948119a9ff218571eb3ff0144915b2ce4a404d445db9f8f9c25044aa3 | |
| 433 | dist/2024-09-22/rustc-nightly-armv7-unknown-linux-gnueabihf.tar.xz=1c41588099d929a7e9dd56cba22782f5202fac2829b924b1aa7dab3e03c52960 | |
| 434 | dist/2024-09-22/rustc-nightly-i686-pc-windows-gnu.tar.gz=af2d30b4925e786ace64d4a11bb05ac6f7df1636989a3656d1aa9fe56cdc330f | |
| 435 | dist/2024-09-22/rustc-nightly-i686-pc-windows-gnu.tar.xz=4bfe618c3702ea805b63beac19cbf0561d262e67d87765a4e10ea9defded53c4 | |
| 436 | dist/2024-09-22/rustc-nightly-i686-pc-windows-msvc.tar.gz=c4e57fe6fec40d874c8fb54227b310072dc98f35f99b8cc741e6818a67941f6d | |
| 437 | dist/2024-09-22/rustc-nightly-i686-pc-windows-msvc.tar.xz=ed10535a830e2e1ab22767a24b82b3314b7ef4ac3c318954ee8f2384b287d8e7 | |
| 438 | dist/2024-09-22/rustc-nightly-i686-unknown-linux-gnu.tar.gz=da5e36f6bb3d9f00b8e5db5aceefcf8ad38552b85a1a4f60f7b700148cd49152 | |
| 439 | dist/2024-09-22/rustc-nightly-i686-unknown-linux-gnu.tar.xz=5831b0209eb64a44b6bfc8aa4b092faaae85101f58f79c4e869bffec22361f1b | |
| 440 | dist/2024-09-22/rustc-nightly-loongarch64-unknown-linux-gnu.tar.gz=f31871890aa6249528b43119d0f050d27c5f404b560d48660cd4c9e7a3a80b76 | |
| 441 | dist/2024-09-22/rustc-nightly-loongarch64-unknown-linux-gnu.tar.xz=19dc59393d25edef8a341bb137ad1f4ca20741038b0111dc81d6e61c0a7a1975 | |
| 442 | dist/2024-09-22/rustc-nightly-loongarch64-unknown-linux-musl.tar.gz=8ebea352863ef014e4dafbafe5a28ddfff6a26f3e4cf728fb4099ecd3444a3ec | |
| 443 | dist/2024-09-22/rustc-nightly-loongarch64-unknown-linux-musl.tar.xz=97196b586f44022d2c24b7378830f716abceb451244035f74c40b6c1587f6c50 | |
| 444 | dist/2024-09-22/rustc-nightly-powerpc-unknown-linux-gnu.tar.gz=6f4d2428ec7a4d5e1540b53e35904b9f9ff5b8fcd05cf3311b005dbfd426d65b | |
| 445 | dist/2024-09-22/rustc-nightly-powerpc-unknown-linux-gnu.tar.xz=c2bc66d7d763c1d4c5752b60ab563fe5b870dd35533712046acd40f258f7a337 | |
| 446 | dist/2024-09-22/rustc-nightly-powerpc64-unknown-linux-gnu.tar.gz=d0e6f42aafc8d8b289b55c1ba4a34039c747a7445b347f05017606801a7d81a4 | |
| 447 | dist/2024-09-22/rustc-nightly-powerpc64-unknown-linux-gnu.tar.xz=9612777e56955ab5446e3ef20e0d579fbeceedc3bdc4d0053367be2191551fd7 | |
| 448 | dist/2024-09-22/rustc-nightly-powerpc64le-unknown-linux-gnu.tar.gz=811099c8b6adc017678c4e43c8f7b02b2bde267eac1bbc023b1f22c184894231 | |
| 449 | dist/2024-09-22/rustc-nightly-powerpc64le-unknown-linux-gnu.tar.xz=f766dab0fa46122c26e5a7736da65e8a2df9c2c6578093b6532dbd88a162d1a5 | |
| 450 | dist/2024-09-22/rustc-nightly-riscv64gc-unknown-linux-gnu.tar.gz=21e9896e5184d797445a19ce5788d8dabe86302d5f63bf8c07105b52a237c13b | |
| 451 | dist/2024-09-22/rustc-nightly-riscv64gc-unknown-linux-gnu.tar.xz=002da974c9606726cc7e6f68cda012ef305e420cf6f7a0de84bf791c007fecd6 | |
| 452 | dist/2024-09-22/rustc-nightly-s390x-unknown-linux-gnu.tar.gz=adfa4248f4ad883a04d67f923325c28b7400853063f2d8017cca8f4100ec1125 | |
| 453 | dist/2024-09-22/rustc-nightly-s390x-unknown-linux-gnu.tar.xz=8334aa8a99d2a8034267394d44b0e5036d053c247812dbd5bc90bdb2344e4713 | |
| 454 | dist/2024-09-22/rustc-nightly-x86_64-apple-darwin.tar.gz=385aa935fb1762423d1a11c0928597e502adbab9809a86c17d98096c31f65775 | |
| 455 | dist/2024-09-22/rustc-nightly-x86_64-apple-darwin.tar.xz=f2bb16e1618dbcc7dda85e0ff4460ee270a99871477380a6412f575bd02f4cf5 | |
| 456 | dist/2024-09-22/rustc-nightly-x86_64-pc-windows-gnu.tar.gz=6e3894c7651bfb48c741aba516ee99690616431643db82cd186fe408675d07b4 | |
| 457 | dist/2024-09-22/rustc-nightly-x86_64-pc-windows-gnu.tar.xz=5661b5ba3a496106f4b0019d4ce81dbcb4b4a0db68a90bac64a95a0bd9201514 | |
| 458 | dist/2024-09-22/rustc-nightly-x86_64-pc-windows-msvc.tar.gz=564f7a0582f3b900201cda4fe502e191b651a845210d21a40a119b94e2e51133 | |
| 459 | dist/2024-09-22/rustc-nightly-x86_64-pc-windows-msvc.tar.xz=1804ebc7ade5c49ec4b82cac2261cf159b8c852a7e06f3faafbf990214936d2b | |
| 460 | dist/2024-09-22/rustc-nightly-x86_64-unknown-freebsd.tar.gz=7455de95ddb8e565ddeaf2da7d80d890c60bc653f52afcab5244476d35305e0b | |
| 461 | dist/2024-09-22/rustc-nightly-x86_64-unknown-freebsd.tar.xz=36a7cf6e8245c3879c08d5e3acfb0155ebcdc6c5b06edc51d43376c44d9ed0b4 | |
| 462 | dist/2024-09-22/rustc-nightly-x86_64-unknown-illumos.tar.gz=143f5ce723a8f5e54af64a3b31d83243a808355705b1402be5de821759187066 | |
| 463 | dist/2024-09-22/rustc-nightly-x86_64-unknown-illumos.tar.xz=c88c8d2ae8f221fe1db978802c98368472381b443bed9501371c03617865785d | |
| 464 | dist/2024-09-22/rustc-nightly-x86_64-unknown-linux-gnu.tar.gz=0ea098f78927d9fdf4ec075a04e989b6ac83bc1f1225aca5960281cd65046a3b | |
| 465 | dist/2024-09-22/rustc-nightly-x86_64-unknown-linux-gnu.tar.xz=33e5e1e0b758de383281ae704d3dd1ee337d8e28515d6b4584dd2691587c7f0e | |
| 466 | dist/2024-09-22/rustc-nightly-x86_64-unknown-linux-musl.tar.gz=723f5eaceef968b05286a17b7868c7e0cf222ac33d23a9ac3f761fc274b87c38 | |
| 467 | dist/2024-09-22/rustc-nightly-x86_64-unknown-linux-musl.tar.xz=1b00b14a57b6f3b7edbf9adc05d3ed28ed1e2b8ced921a444d13dd1ef577e715 | |
| 468 | dist/2024-09-22/rustc-nightly-x86_64-unknown-netbsd.tar.gz=6cd2651e4e8aedd8aef8d325a72cf18694ee7a14077c7331d96e2e7c03b9c57a | |
| 469 | dist/2024-09-22/rustc-nightly-x86_64-unknown-netbsd.tar.xz=0c6144559f040a209183d6f02f61caf485f0174190e643870d1d6c9744bfede3 | |
| \ No newline at end of file |
src/tools/build-manifest/src/main.rs+5-8| ... | ... | @@ -598,14 +598,11 @@ impl Builder { |
| 598 | 598 | }) |
| 599 | 599 | .collect(); |
| 600 | 600 | |
| 601 | dst.insert( | |
| 602 | pkg.manifest_component_name(), | |
| 603 | Package { | |
| 604 | version: version_info.version.unwrap_or_default(), | |
| 605 | git_commit_hash: version_info.git_commit, | |
| 606 | target: targets, | |
| 607 | }, | |
| 608 | ); | |
| 601 | dst.insert(pkg.manifest_component_name(), Package { | |
| 602 | version: version_info.version.unwrap_or_default(), | |
| 603 | git_commit_hash: version_info.git_commit, | |
| 604 | target: targets, | |
| 605 | }); | |
| 609 | 606 | } |
| 610 | 607 | |
| 611 | 608 | fn url(&self, path: &Path) -> String { |
src/tools/build-manifest/src/manifest.rs+1-1| ... | ... | @@ -3,8 +3,8 @@ use std::path::{Path, PathBuf}; |
| 3 | 3 | |
| 4 | 4 | use serde::{Serialize, Serializer}; |
| 5 | 5 | |
| 6 | use crate::versions::PkgType; | |
| 7 | 6 | use crate::Builder; |
| 7 | use crate::versions::PkgType; | |
| 8 | 8 | |
| 9 | 9 | #[derive(Serialize)] |
| 10 | 10 | #[serde(rename_all = "kebab-case")] |
src/tools/bump-stage0/src/main.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | #![deny(unused_variables)] |
| 2 | 2 | |
| 3 | 3 | use anyhow::{Context, Error}; |
| 4 | use build_helper::stage0_parser::{parse_stage0_file, Stage0Config, VersionMetadata}; | |
| 4 | use build_helper::stage0_parser::{Stage0Config, VersionMetadata, parse_stage0_file}; | |
| 5 | 5 | use curl::easy::Easy; |
| 6 | 6 | use indexmap::IndexMap; |
| 7 | 7 |
src/tools/compiletest/src/common.rs+1-1| ... | ... | @@ -11,7 +11,7 @@ use serde::de::{Deserialize, Deserializer, Error as _}; |
| 11 | 11 | use test::{ColorConfig, OutputFormat}; |
| 12 | 12 | |
| 13 | 13 | pub use self::Mode::*; |
| 14 | use crate::util::{add_dylib_path, PathBufExt}; | |
| 14 | use crate::util::{PathBufExt, add_dylib_path}; | |
| 15 | 15 | |
| 16 | 16 | macro_rules! string_enum { |
| 17 | 17 | ($(#[$meta:meta])* $vis:vis enum $name:ident { $($variant:ident => $repr:expr,)* }) => { |
src/tools/compiletest/src/errors.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use std::fmt; |
| 2 | 2 | use std::fs::File; |
| 3 | use std::io::prelude::*; | |
| 4 | 3 | use std::io::BufReader; |
| 4 | use std::io::prelude::*; | |
| 5 | 5 | use std::path::Path; |
| 6 | 6 | use std::str::FromStr; |
| 7 | 7 | use std::sync::OnceLock; |
src/tools/compiletest/src/header.rs+2-2| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use std::collections::HashSet; |
| 2 | 2 | use std::env; |
| 3 | 3 | use std::fs::File; |
| 4 | use std::io::prelude::*; | |
| 5 | 4 | use std::io::BufReader; |
| 5 | use std::io::prelude::*; | |
| 6 | 6 | use std::path::{Path, PathBuf}; |
| 7 | 7 | use std::process::Command; |
| 8 | 8 | use std::sync::OnceLock; |
| ... | ... | @@ -11,7 +11,7 @@ use regex::Regex; |
| 11 | 11 | use tracing::*; |
| 12 | 12 | |
| 13 | 13 | use crate::common::{Config, Debugger, FailMode, Mode, PassMode}; |
| 14 | use crate::header::cfg::{parse_cfg_name_directive, MatchOutcome}; | |
| 14 | use crate::header::cfg::{MatchOutcome, parse_cfg_name_directive}; | |
| 15 | 15 | use crate::header::needs::CachedNeedsConditions; |
| 16 | 16 | use crate::util::static_regex; |
| 17 | 17 | use crate::{extract_cdb_version, extract_gdb_version}; |
src/tools/compiletest/src/header/needs.rs+1-1| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use crate::common::{Config, Sanitizer}; |
| 2 | use crate::header::{llvm_has_libzstd, IgnoreDecision}; | |
| 2 | use crate::header::{IgnoreDecision, llvm_has_libzstd}; | |
| 3 | 3 | |
| 4 | 4 | pub(super) fn handle_needs( |
| 5 | 5 | cache: &CachedNeedsConditions, |
src/tools/compiletest/src/header/tests.rs+4-5| ... | ... | @@ -4,7 +4,7 @@ use std::str::FromStr; |
| 4 | 4 | |
| 5 | 5 | use super::iter_header; |
| 6 | 6 | use crate::common::{Config, Debugger, Mode}; |
| 7 | use crate::header::{parse_normalize_rule, EarlyProps, HeadersCache}; | |
| 7 | use crate::header::{EarlyProps, HeadersCache, parse_normalize_rule}; | |
| 8 | 8 | |
| 9 | 9 | fn make_test_description<R: Read>( |
| 10 | 10 | config: &Config, |
| ... | ... | @@ -226,10 +226,9 @@ fn revisions() { |
| 226 | 226 | let config: Config = cfg().build(); |
| 227 | 227 | |
| 228 | 228 | assert_eq!(parse_rs(&config, "//@ revisions: a b c").revisions, vec!["a", "b", "c"],); |
| 229 | assert_eq!( | |
| 230 | parse_makefile(&config, "# revisions: hello there").revisions, | |
| 231 | vec!["hello", "there"], | |
| 232 | ); | |
| 229 | assert_eq!(parse_makefile(&config, "# revisions: hello there").revisions, vec![ | |
| 230 | "hello", "there" | |
| 231 | ],); | |
| 233 | 232 | } |
| 234 | 233 | |
| 235 | 234 | #[test] |
src/tools/compiletest/src/lib.rs+3-3| ... | ... | @@ -34,10 +34,10 @@ use test::ColorConfig; |
| 34 | 34 | use tracing::*; |
| 35 | 35 | use walkdir::WalkDir; |
| 36 | 36 | |
| 37 | use self::header::{make_test_description, EarlyProps}; | |
| 37 | use self::header::{EarlyProps, make_test_description}; | |
| 38 | 38 | use crate::common::{ |
| 39 | expected_output_path, output_base_dir, output_relative_path, Config, Debugger, Mode, PassMode, | |
| 40 | TestPaths, UI_EXTENSIONS, | |
| 39 | Config, Debugger, Mode, PassMode, TestPaths, UI_EXTENSIONS, expected_output_path, | |
| 40 | output_base_dir, output_relative_path, | |
| 41 | 41 | }; |
| 42 | 42 | use crate::header::HeadersCache; |
| 43 | 43 | use crate::util::logv; |
src/tools/compiletest/src/read2.rs+1-1| ... | ... | @@ -232,9 +232,9 @@ mod imp { |
| 232 | 232 | use std::process::{ChildStderr, ChildStdout}; |
| 233 | 233 | use std::{io, slice}; |
| 234 | 234 | |
| 235 | use miow::Overlapped; | |
| 235 | 236 | use miow::iocp::{CompletionPort, CompletionStatus}; |
| 236 | 237 | use miow::pipe::NamedPipe; |
| 237 | use miow::Overlapped; | |
| 238 | 238 | use windows::Win32::Foundation::ERROR_BROKEN_PIPE; |
| 239 | 239 | |
| 240 | 240 | struct Pipe<'a> { |
src/tools/compiletest/src/read2/tests.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use std::io::Write; |
| 2 | 2 | |
| 3 | use crate::read2::{ProcOutput, FILTERED_PATHS_PLACEHOLDER_LEN, MAX_OUT_LEN}; | |
| 3 | use crate::read2::{FILTERED_PATHS_PLACEHOLDER_LEN, MAX_OUT_LEN, ProcOutput}; | |
| 4 | 4 | |
| 5 | 5 | #[test] |
| 6 | 6 | fn test_abbreviate_short_string() { |
src/tools/compiletest/src/runtest.rs+10-10| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | use std::borrow::Cow; |
| 4 | 4 | use std::collections::{HashMap, HashSet}; |
| 5 | 5 | use std::ffi::OsString; |
| 6 | use std::fs::{self, create_dir_all, File}; | |
| 6 | use std::fs::{self, File, create_dir_all}; | |
| 7 | 7 | use std::hash::{DefaultHasher, Hash, Hasher}; |
| 8 | 8 | use std::io::prelude::*; |
| 9 | 9 | use std::io::{self, BufReader}; |
| ... | ... | @@ -18,18 +18,18 @@ use regex::{Captures, Regex}; |
| 18 | 18 | use tracing::*; |
| 19 | 19 | |
| 20 | 20 | use crate::common::{ |
| 21 | expected_output_path, incremental_dir, output_base_dir, output_base_name, | |
| 22 | output_testname_unique, Assembly, Codegen, CodegenUnits, CompareMode, Config, CoverageMap, | |
| 23 | CoverageRun, Crashes, DebugInfo, Debugger, FailMode, Incremental, JsDocTest, MirOpt, PassMode, | |
| 24 | Pretty, RunMake, RunPassValgrind, Rustdoc, RustdocJson, TestPaths, Ui, UI_EXTENSIONS, UI_FIXED, | |
| 25 | UI_RUN_STDERR, UI_RUN_STDOUT, UI_STDERR, UI_STDOUT, UI_SVG, UI_WINDOWS_SVG, | |
| 21 | Assembly, Codegen, CodegenUnits, CompareMode, Config, CoverageMap, CoverageRun, Crashes, | |
| 22 | DebugInfo, Debugger, FailMode, Incremental, JsDocTest, MirOpt, PassMode, Pretty, RunMake, | |
| 23 | RunPassValgrind, Rustdoc, RustdocJson, TestPaths, UI_EXTENSIONS, UI_FIXED, UI_RUN_STDERR, | |
| 24 | UI_RUN_STDOUT, UI_STDERR, UI_STDOUT, UI_SVG, UI_WINDOWS_SVG, Ui, expected_output_path, | |
| 25 | incremental_dir, output_base_dir, output_base_name, output_testname_unique, | |
| 26 | 26 | }; |
| 27 | 27 | use crate::compute_diff::{write_diff, write_filtered_diff}; |
| 28 | 28 | use crate::errors::{self, Error, ErrorKind}; |
| 29 | 29 | use crate::header::TestProps; |
| 30 | use crate::read2::{read2_abbreviated, Truncated}; | |
| 31 | use crate::util::{add_dylib_path, logv, static_regex, PathBufExt}; | |
| 32 | use crate::{json, ColorConfig}; | |
| 30 | use crate::read2::{Truncated, read2_abbreviated}; | |
| 31 | use crate::util::{PathBufExt, add_dylib_path, logv, static_regex}; | |
| 32 | use crate::{ColorConfig, json}; | |
| 33 | 33 | |
| 34 | 34 | mod debugger; |
| 35 | 35 | |
| ... | ... | @@ -62,7 +62,7 @@ fn disable_error_reporting<F: FnOnce() -> R, R>(f: F) -> R { |
| 62 | 62 | use std::sync::Mutex; |
| 63 | 63 | |
| 64 | 64 | use windows::Win32::System::Diagnostics::Debug::{ |
| 65 | SetErrorMode, SEM_NOGPFAULTERRORBOX, THREAD_ERROR_MODE, | |
| 65 | SEM_NOGPFAULTERRORBOX, SetErrorMode, THREAD_ERROR_MODE, | |
| 66 | 66 | }; |
| 67 | 67 | |
| 68 | 68 | static LOCK: Mutex<()> = Mutex::new(()); |
src/tools/compiletest/src/runtest/mir_opt.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ use std::fs; |
| 2 | 2 | use std::path::{Path, PathBuf}; |
| 3 | 3 | |
| 4 | 4 | use glob::glob; |
| 5 | use miropt_test_tools::{files_for_miropt_test, MiroptTest, MiroptTestFile}; | |
| 5 | use miropt_test_tools::{MiroptTest, MiroptTestFile, files_for_miropt_test}; | |
| 6 | 6 | use tracing::debug; |
| 7 | 7 | |
| 8 | 8 | use super::{Emit, TestCx, WillExecute}; |
src/tools/compiletest/src/runtest/rustdoc.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use std::process::Command; |
| 2 | 2 | |
| 3 | use super::{remove_and_create_dir_all, TestCx}; | |
| 3 | use super::{TestCx, remove_and_create_dir_all}; | |
| 4 | 4 | |
| 5 | 5 | impl TestCx<'_> { |
| 6 | 6 | pub(super) fn run_rustdoc_test(&self) { |
src/tools/compiletest/src/runtest/rustdoc_json.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use std::process::Command; |
| 2 | 2 | |
| 3 | use super::{remove_and_create_dir_all, TestCx}; | |
| 3 | use super::{TestCx, remove_and_create_dir_all}; | |
| 4 | 4 | |
| 5 | 5 | impl TestCx<'_> { |
| 6 | 6 | pub(super) fn run_rustdoc_json_test(&self) { |
src/tools/compiletest/src/runtest/ui.rs+2-2| ... | ... | @@ -2,12 +2,12 @@ use std::collections::HashSet; |
| 2 | 2 | use std::fs::OpenOptions; |
| 3 | 3 | use std::io::Write; |
| 4 | 4 | |
| 5 | use rustfix::{apply_suggestions, get_suggestions_from_json, Filter}; | |
| 5 | use rustfix::{Filter, apply_suggestions, get_suggestions_from_json}; | |
| 6 | 6 | use tracing::debug; |
| 7 | 7 | |
| 8 | 8 | use super::{ |
| 9 | 9 | AllowUnused, Emit, ErrorKind, FailMode, LinkToAux, PassMode, TargetLocation, TestCx, |
| 10 | TestOutput, Truncated, WillExecute, UI_FIXED, | |
| 10 | TestOutput, Truncated, UI_FIXED, WillExecute, | |
| 11 | 11 | }; |
| 12 | 12 | use crate::{errors, json}; |
| 13 | 13 |
src/tools/coverage-dump/src/covfun.rs+2-2| ... | ... | @@ -2,10 +2,10 @@ use std::collections::HashMap; |
| 2 | 2 | use std::fmt::{self, Debug, Write as _}; |
| 3 | 3 | use std::sync::OnceLock; |
| 4 | 4 | |
| 5 | use anyhow::{anyhow, Context}; | |
| 5 | use anyhow::{Context, anyhow}; | |
| 6 | 6 | use regex::Regex; |
| 7 | 7 | |
| 8 | use crate::parser::{unescape_llvm_string_contents, Parser}; | |
| 8 | use crate::parser::{Parser, unescape_llvm_string_contents}; | |
| 9 | 9 | |
| 10 | 10 | pub(crate) fn dump_covfun_mappings( |
| 11 | 11 | llvm_ir: &str, |
src/tools/coverage-dump/src/prf_names.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ use std::sync::OnceLock; |
| 4 | 4 | use anyhow::{anyhow, ensure}; |
| 5 | 5 | use regex::Regex; |
| 6 | 6 | |
| 7 | use crate::parser::{unescape_llvm_string_contents, Parser}; | |
| 7 | use crate::parser::{Parser, unescape_llvm_string_contents}; | |
| 8 | 8 | |
| 9 | 9 | /// Scans through the contents of an LLVM IR assembly file to find `__llvm_prf_names` |
| 10 | 10 | /// entries, decodes them, and creates a table that maps name hash values to |
src/tools/error_index_generator/main.rs+1-1| ... | ... | @@ -12,7 +12,7 @@ use std::io::Write; |
| 12 | 12 | use std::path::{Path, PathBuf}; |
| 13 | 13 | use std::str::FromStr; |
| 14 | 14 | |
| 15 | use mdbook::book::{parse_summary, BookItem, Chapter}; | |
| 15 | use mdbook::book::{BookItem, Chapter, parse_summary}; | |
| 16 | 16 | use mdbook::{Config, MDBook}; |
| 17 | 17 | use rustc_errors::codes::DIAGNOSTICS; |
| 18 | 18 |
src/tools/generate-copyright/src/cargo_metadata.rs+6-9| ... | ... | @@ -99,15 +99,12 @@ pub fn get_metadata( |
| 99 | 99 | } |
| 100 | 100 | // otherwise it's an out-of-tree dependency |
| 101 | 101 | let package_id = Package { name: package.name, version: package.version.to_string() }; |
| 102 | output.insert( | |
| 103 | package_id, | |
| 104 | PackageMetadata { | |
| 105 | license: package.license.unwrap_or_else(|| String::from("Unspecified")), | |
| 106 | authors: package.authors, | |
| 107 | notices: BTreeMap::new(), | |
| 108 | is_in_libstd: None, | |
| 109 | }, | |
| 110 | ); | |
| 102 | output.insert(package_id, PackageMetadata { | |
| 103 | license: package.license.unwrap_or_else(|| String::from("Unspecified")), | |
| 104 | authors: package.authors, | |
| 105 | notices: BTreeMap::new(), | |
| 106 | is_in_libstd: None, | |
| 107 | }); | |
| 111 | 108 | } |
| 112 | 109 | } |
| 113 | 110 |
src/tools/jsondoclint/src/main.rs+2-2| ... | ... | @@ -1,10 +1,10 @@ |
| 1 | 1 | use std::io::{BufWriter, Write}; |
| 2 | 2 | use std::path::{Path, PathBuf}; |
| 3 | 3 | |
| 4 | use anyhow::{bail, Result}; | |
| 4 | use anyhow::{Result, bail}; | |
| 5 | 5 | use clap::Parser; |
| 6 | 6 | use fs_err as fs; |
| 7 | use rustdoc_json_types::{Crate, Id, FORMAT_VERSION}; | |
| 7 | use rustdoc_json_types::{Crate, FORMAT_VERSION, Id}; | |
| 8 | 8 | use serde::Serialize; |
| 9 | 9 | use serde_json::Value; |
| 10 | 10 |
src/tools/jsondoclint/src/validator.rs+1-1| ... | ... | @@ -11,7 +11,7 @@ use rustdoc_json_types::{ |
| 11 | 11 | use serde_json::Value; |
| 12 | 12 | |
| 13 | 13 | use crate::item_kind::Kind; |
| 14 | use crate::{json_find, Error, ErrorKind}; | |
| 14 | use crate::{Error, ErrorKind, json_find}; | |
| 15 | 15 | |
| 16 | 16 | // This is a rustc implementation detail that we rely on here |
| 17 | 17 | const LOCAL_CRATE_ID: u32 = 0; |
src/tools/jsondoclint/src/validator/tests.rs+71-100| ... | ... | @@ -1,5 +1,5 @@ |
| 1 | 1 | use rustc_hash::FxHashMap; |
| 2 | use rustdoc_json_types::{Item, ItemKind, Visibility, FORMAT_VERSION}; | |
| 2 | use rustdoc_json_types::{FORMAT_VERSION, Item, ItemKind, Visibility}; | |
| 3 | 3 | |
| 4 | 4 | use super::*; |
| 5 | 5 | use crate::json_find::SelectorPart; |
| ... | ... | @@ -25,42 +25,32 @@ fn errors_on_missing_links() { |
| 25 | 25 | root: id("0"), |
| 26 | 26 | crate_version: None, |
| 27 | 27 | includes_private: false, |
| 28 | index: FxHashMap::from_iter([( | |
| 29 | id("0"), | |
| 30 | Item { | |
| 31 | name: Some("root".to_owned()), | |
| 32 | id: id(""), | |
| 33 | crate_id: 0, | |
| 34 | span: None, | |
| 35 | visibility: Visibility::Public, | |
| 36 | docs: None, | |
| 37 | links: FxHashMap::from_iter([("Not Found".to_owned(), id("1"))]), | |
| 38 | attrs: vec![], | |
| 39 | deprecation: None, | |
| 40 | inner: ItemEnum::Module(Module { | |
| 41 | is_crate: true, | |
| 42 | items: vec![], | |
| 43 | is_stripped: false, | |
| 44 | }), | |
| 45 | }, | |
| 46 | )]), | |
| 28 | index: FxHashMap::from_iter([(id("0"), Item { | |
| 29 | name: Some("root".to_owned()), | |
| 30 | id: id(""), | |
| 31 | crate_id: 0, | |
| 32 | span: None, | |
| 33 | visibility: Visibility::Public, | |
| 34 | docs: None, | |
| 35 | links: FxHashMap::from_iter([("Not Found".to_owned(), id("1"))]), | |
| 36 | attrs: vec![], | |
| 37 | deprecation: None, | |
| 38 | inner: ItemEnum::Module(Module { is_crate: true, items: vec![], is_stripped: false }), | |
| 39 | })]), | |
| 47 | 40 | paths: FxHashMap::default(), |
| 48 | 41 | external_crates: FxHashMap::default(), |
| 49 | 42 | format_version: rustdoc_json_types::FORMAT_VERSION, |
| 50 | 43 | }; |
| 51 | 44 | |
| 52 | check( | |
| 53 | &k, | |
| 54 | &[Error { | |
| 55 | kind: ErrorKind::NotFound(vec![vec![ | |
| 56 | SelectorPart::Field("index".to_owned()), | |
| 57 | SelectorPart::Field("0".to_owned()), | |
| 58 | SelectorPart::Field("links".to_owned()), | |
| 59 | SelectorPart::Field("Not Found".to_owned()), | |
| 60 | ]]), | |
| 61 | id: id("1"), | |
| 62 | }], | |
| 63 | ); | |
| 45 | check(&k, &[Error { | |
| 46 | kind: ErrorKind::NotFound(vec![vec![ | |
| 47 | SelectorPart::Field("index".to_owned()), | |
| 48 | SelectorPart::Field("0".to_owned()), | |
| 49 | SelectorPart::Field("links".to_owned()), | |
| 50 | SelectorPart::Field("Not Found".to_owned()), | |
| 51 | ]]), | |
| 52 | id: id("1"), | |
| 53 | }]); | |
| 64 | 54 | } |
| 65 | 55 | |
| 66 | 56 | // Test we would catch |
| ... | ... | @@ -72,60 +62,48 @@ fn errors_on_local_in_paths_and_not_index() { |
| 72 | 62 | crate_version: None, |
| 73 | 63 | includes_private: false, |
| 74 | 64 | index: FxHashMap::from_iter([ |
| 75 | ( | |
| 76 | id("0:0:1572"), | |
| 77 | Item { | |
| 78 | id: id("0:0:1572"), | |
| 79 | crate_id: 0, | |
| 80 | name: Some("microcore".to_owned()), | |
| 81 | span: None, | |
| 82 | visibility: Visibility::Public, | |
| 83 | docs: None, | |
| 84 | links: FxHashMap::from_iter([(("prim@i32".to_owned(), id("0:1:1571")))]), | |
| 85 | attrs: Vec::new(), | |
| 86 | deprecation: None, | |
| 87 | inner: ItemEnum::Module(Module { | |
| 88 | is_crate: true, | |
| 89 | items: vec![id("0:1:717")], | |
| 90 | is_stripped: false, | |
| 91 | }), | |
| 92 | }, | |
| 93 | ), | |
| 94 | ( | |
| 95 | id("0:1:717"), | |
| 96 | Item { | |
| 97 | id: id("0:1:717"), | |
| 98 | crate_id: 0, | |
| 99 | name: Some("i32".to_owned()), | |
| 100 | span: None, | |
| 101 | visibility: Visibility::Public, | |
| 102 | docs: None, | |
| 103 | links: FxHashMap::default(), | |
| 104 | attrs: Vec::new(), | |
| 105 | deprecation: None, | |
| 106 | inner: ItemEnum::Primitive(Primitive { name: "i32".to_owned(), impls: vec![] }), | |
| 107 | }, | |
| 108 | ), | |
| 109 | ]), | |
| 110 | paths: FxHashMap::from_iter([( | |
| 111 | id("0:1:1571"), | |
| 112 | ItemSummary { | |
| 65 | (id("0:0:1572"), Item { | |
| 66 | id: id("0:0:1572"), | |
| 113 | 67 | crate_id: 0, |
| 114 | path: vec!["microcore".to_owned(), "i32".to_owned()], | |
| 115 | kind: ItemKind::Primitive, | |
| 116 | }, | |
| 117 | )]), | |
| 68 | name: Some("microcore".to_owned()), | |
| 69 | span: None, | |
| 70 | visibility: Visibility::Public, | |
| 71 | docs: None, | |
| 72 | links: FxHashMap::from_iter([(("prim@i32".to_owned(), id("0:1:1571")))]), | |
| 73 | attrs: Vec::new(), | |
| 74 | deprecation: None, | |
| 75 | inner: ItemEnum::Module(Module { | |
| 76 | is_crate: true, | |
| 77 | items: vec![id("0:1:717")], | |
| 78 | is_stripped: false, | |
| 79 | }), | |
| 80 | }), | |
| 81 | (id("0:1:717"), Item { | |
| 82 | id: id("0:1:717"), | |
| 83 | crate_id: 0, | |
| 84 | name: Some("i32".to_owned()), | |
| 85 | span: None, | |
| 86 | visibility: Visibility::Public, | |
| 87 | docs: None, | |
| 88 | links: FxHashMap::default(), | |
| 89 | attrs: Vec::new(), | |
| 90 | deprecation: None, | |
| 91 | inner: ItemEnum::Primitive(Primitive { name: "i32".to_owned(), impls: vec![] }), | |
| 92 | }), | |
| 93 | ]), | |
| 94 | paths: FxHashMap::from_iter([(id("0:1:1571"), ItemSummary { | |
| 95 | crate_id: 0, | |
| 96 | path: vec!["microcore".to_owned(), "i32".to_owned()], | |
| 97 | kind: ItemKind::Primitive, | |
| 98 | })]), | |
| 118 | 99 | external_crates: FxHashMap::default(), |
| 119 | 100 | format_version: rustdoc_json_types::FORMAT_VERSION, |
| 120 | 101 | }; |
| 121 | 102 | |
| 122 | check( | |
| 123 | &krate, | |
| 124 | &[Error { | |
| 125 | id: id("0:1:1571"), | |
| 126 | kind: ErrorKind::Custom("Id for local item in `paths` but not in `index`".to_owned()), | |
| 127 | }], | |
| 128 | ); | |
| 103 | check(&krate, &[Error { | |
| 104 | id: id("0:1:1571"), | |
| 105 | kind: ErrorKind::Custom("Id for local item in `paths` but not in `index`".to_owned()), | |
| 106 | }]); | |
| 129 | 107 | } |
| 130 | 108 | |
| 131 | 109 | #[test] |
| ... | ... | @@ -135,25 +113,18 @@ fn checks_local_crate_id_is_correct() { |
| 135 | 113 | root: id("root"), |
| 136 | 114 | crate_version: None, |
| 137 | 115 | includes_private: false, |
| 138 | index: FxHashMap::from_iter([( | |
| 139 | id("root"), | |
| 140 | Item { | |
| 141 | id: id("root"), | |
| 142 | crate_id: LOCAL_CRATE_ID.wrapping_add(1), | |
| 143 | name: Some("irrelavent".to_owned()), | |
| 144 | span: None, | |
| 145 | visibility: Visibility::Public, | |
| 146 | docs: None, | |
| 147 | links: FxHashMap::default(), | |
| 148 | attrs: Vec::new(), | |
| 149 | deprecation: None, | |
| 150 | inner: ItemEnum::Module(Module { | |
| 151 | is_crate: true, | |
| 152 | items: vec![], | |
| 153 | is_stripped: false, | |
| 154 | }), | |
| 155 | }, | |
| 156 | )]), | |
| 116 | index: FxHashMap::from_iter([(id("root"), Item { | |
| 117 | id: id("root"), | |
| 118 | crate_id: LOCAL_CRATE_ID.wrapping_add(1), | |
| 119 | name: Some("irrelavent".to_owned()), | |
| 120 | span: None, | |
| 121 | visibility: Visibility::Public, | |
| 122 | docs: None, | |
| 123 | links: FxHashMap::default(), | |
| 124 | attrs: Vec::new(), | |
| 125 | deprecation: None, | |
| 126 | inner: ItemEnum::Module(Module { is_crate: true, items: vec![], is_stripped: false }), | |
| 127 | })]), | |
| 157 | 128 | paths: FxHashMap::default(), |
| 158 | 129 | external_crates: FxHashMap::default(), |
| 159 | 130 | format_version: FORMAT_VERSION, |
src/tools/lint-docs/src/lib.rs+18-24| ... | ... | @@ -19,30 +19,24 @@ mod groups; |
| 19 | 19 | /// level of the lint, which will be more difficult to support, since rustc |
| 20 | 20 | /// currently does not track that historical information. |
| 21 | 21 | static RENAMES: &[(Level, &[(&str, &str)])] = &[ |
| 22 | ( | |
| 23 | Level::Allow, | |
| 24 | &[ | |
| 25 | ("single-use-lifetime", "single-use-lifetimes"), | |
| 26 | ("elided-lifetime-in-path", "elided-lifetimes-in-paths"), | |
| 27 | ("async-idents", "keyword-idents"), | |
| 28 | ("disjoint-capture-migration", "rust-2021-incompatible-closure-captures"), | |
| 29 | ("keyword-idents", "keyword-idents-2018"), | |
| 30 | ("or-patterns-back-compat", "rust-2021-incompatible-or-patterns"), | |
| 31 | ], | |
| 32 | ), | |
| 33 | ( | |
| 34 | Level::Warn, | |
| 35 | &[ | |
| 36 | ("bare-trait-object", "bare-trait-objects"), | |
| 37 | ("unstable-name-collision", "unstable-name-collisions"), | |
| 38 | ("unused-doc-comment", "unused-doc-comments"), | |
| 39 | ("redundant-semicolon", "redundant-semicolons"), | |
| 40 | ("overlapping-patterns", "overlapping-range-endpoints"), | |
| 41 | ("non-fmt-panic", "non-fmt-panics"), | |
| 42 | ("unused-tuple-struct-fields", "dead-code"), | |
| 43 | ("static-mut-ref", "static-mut-refs"), | |
| 44 | ], | |
| 45 | ), | |
| 22 | (Level::Allow, &[ | |
| 23 | ("single-use-lifetime", "single-use-lifetimes"), | |
| 24 | ("elided-lifetime-in-path", "elided-lifetimes-in-paths"), | |
| 25 | ("async-idents", "keyword-idents"), | |
| 26 | ("disjoint-capture-migration", "rust-2021-incompatible-closure-captures"), | |
| 27 | ("keyword-idents", "keyword-idents-2018"), | |
| 28 | ("or-patterns-back-compat", "rust-2021-incompatible-or-patterns"), | |
| 29 | ]), | |
| 30 | (Level::Warn, &[ | |
| 31 | ("bare-trait-object", "bare-trait-objects"), | |
| 32 | ("unstable-name-collision", "unstable-name-collisions"), | |
| 33 | ("unused-doc-comment", "unused-doc-comments"), | |
| 34 | ("redundant-semicolon", "redundant-semicolons"), | |
| 35 | ("overlapping-patterns", "overlapping-range-endpoints"), | |
| 36 | ("non-fmt-panic", "non-fmt-panics"), | |
| 37 | ("unused-tuple-struct-fields", "dead-code"), | |
| 38 | ("static-mut-ref", "static-mut-refs"), | |
| 39 | ]), | |
| 46 | 40 | (Level::Deny, &[("exceeding-bitshifts", "arithmetic-overflow")]), |
| 47 | 41 | ]; |
| 48 | 42 |
src/tools/opt-dist/src/main.rs+1-1| ... | ... | @@ -6,7 +6,7 @@ use utils::io; |
| 6 | 6 | |
| 7 | 7 | use crate::bolt::{bolt_optimize, with_bolt_instrumented}; |
| 8 | 8 | use crate::environment::{Environment, EnvironmentBuilder}; |
| 9 | use crate::exec::{cmd, Bootstrap}; | |
| 9 | use crate::exec::{Bootstrap, cmd}; | |
| 10 | 10 | use crate::tests::run_tests; |
| 11 | 11 | use crate::timer::Timer; |
| 12 | 12 | use crate::training::{ |
src/tools/opt-dist/src/tests.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use anyhow::Context; |
| 2 | 2 | use camino::{Utf8Path, Utf8PathBuf}; |
| 3 | 3 | |
| 4 | use crate::environment::{executable_extension, Environment}; | |
| 4 | use crate::environment::{Environment, executable_extension}; | |
| 5 | 5 | use crate::exec::cmd; |
| 6 | 6 | use crate::utils::io::{copy_directory, find_file_in_dir, unpack_archive}; |
| 7 | 7 |
src/tools/opt-dist/src/training.rs+2-2| ... | ... | @@ -3,8 +3,8 @@ use build_helper::{LLVM_PGO_CRATES, RUSTC_PGO_CRATES}; |
| 3 | 3 | use camino::{Utf8Path, Utf8PathBuf}; |
| 4 | 4 | use humansize::BINARY; |
| 5 | 5 | |
| 6 | use crate::environment::{executable_extension, Environment}; | |
| 7 | use crate::exec::{cmd, CmdBuilder}; | |
| 6 | use crate::environment::{Environment, executable_extension}; | |
| 7 | use crate::exec::{CmdBuilder, cmd}; | |
| 8 | 8 | use crate::utils::io::{count_files, delete_directory}; |
| 9 | 9 | use crate::utils::with_log_group; |
| 10 | 10 |
src/tools/opt-dist/src/utils/artifact_size.rs+1-1| ... | ... | @@ -11,7 +11,7 @@ use crate::utils::io::get_files_from_dir; |
| 11 | 11 | pub fn print_binary_sizes(env: &Environment) -> anyhow::Result<()> { |
| 12 | 12 | use std::fmt::Write; |
| 13 | 13 | |
| 14 | use humansize::{format_size, BINARY}; | |
| 14 | use humansize::{BINARY, format_size}; | |
| 15 | 15 | |
| 16 | 16 | let root = env.build_artifacts().join("stage2"); |
| 17 | 17 |
src/tools/rust-installer/src/combiner.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | use std::io::{Read, Write}; |
| 2 | 2 | use std::path::Path; |
| 3 | 3 | |
| 4 | use anyhow::{bail, Context, Result}; | |
| 4 | use anyhow::{Context, Result, bail}; | |
| 5 | 5 | use tar::Archive; |
| 6 | 6 | |
| 7 | 7 | use super::{Scripter, Tarballer}; |
src/tools/rust-installer/src/compression.rs+8-11| ... | ... | @@ -81,17 +81,14 @@ impl CompressionFormat { |
| 81 | 81 | let file = crate::util::create_new_file(path)?; |
| 82 | 82 | |
| 83 | 83 | Ok(match self { |
| 84 | CompressionFormat::Gz => Box::new(GzEncoder::new( | |
| 85 | file, | |
| 86 | match profile { | |
| 87 | CompressionProfile::Fast => flate2::Compression::fast(), | |
| 88 | CompressionProfile::Balanced => flate2::Compression::new(6), | |
| 89 | CompressionProfile::Best => flate2::Compression::best(), | |
| 90 | CompressionProfile::NoOp => panic!( | |
| 91 | "compression profile 'no-op' should not call `CompressionFormat::encode`." | |
| 92 | ), | |
| 93 | }, | |
| 94 | )), | |
| 84 | CompressionFormat::Gz => Box::new(GzEncoder::new(file, match profile { | |
| 85 | CompressionProfile::Fast => flate2::Compression::fast(), | |
| 86 | CompressionProfile::Balanced => flate2::Compression::new(6), | |
| 87 | CompressionProfile::Best => flate2::Compression::best(), | |
| 88 | CompressionProfile::NoOp => panic!( | |
| 89 | "compression profile 'no-op' should not call `CompressionFormat::encode`." | |
| 90 | ), | |
| 91 | })), | |
| 95 | 92 | CompressionFormat::Xz => { |
| 96 | 93 | let encoder = match profile { |
| 97 | 94 | CompressionProfile::NoOp => panic!( |
src/tools/rust-installer/src/generator.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ use std::collections::BTreeSet; |
| 2 | 2 | use std::io::Write; |
| 3 | 3 | use std::path::Path; |
| 4 | 4 | |
| 5 | use anyhow::{bail, format_err, Context, Result}; | |
| 5 | use anyhow::{Context, Result, bail, format_err}; | |
| 6 | 6 | |
| 7 | 7 | use super::{Scripter, Tarballer}; |
| 8 | 8 | use crate::compression::{CompressionFormats, CompressionProfile}; |
src/tools/rust-installer/src/tarballer.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ use std::fs::{read_link, symlink_metadata}; |
| 2 | 2 | use std::io::{BufWriter, Write}; |
| 3 | 3 | use std::path::Path; |
| 4 | 4 | |
| 5 | use anyhow::{bail, Context, Result}; | |
| 5 | use anyhow::{Context, Result, bail}; | |
| 6 | 6 | use tar::{Builder, Header, HeaderMode}; |
| 7 | 7 | use walkdir::WalkDir; |
| 8 | 8 |
src/tools/rust-installer/src/util.rs+4-4| ... | ... | @@ -1,15 +1,15 @@ |
| 1 | 1 | use std::fs; |
| 2 | // FIXME: what about Windows? Are default ACLs executable? | |
| 3 | #[cfg(unix)] | |
| 4 | use std::os::unix::fs::symlink as symlink_file; | |
| 5 | 2 | // Needed to set the script mode to executable. |
| 6 | 3 | #[cfg(unix)] |
| 7 | 4 | use std::os::unix::fs::OpenOptionsExt; |
| 5 | // FIXME: what about Windows? Are default ACLs executable? | |
| 6 | #[cfg(unix)] | |
| 7 | use std::os::unix::fs::symlink as symlink_file; | |
| 8 | 8 | #[cfg(windows)] |
| 9 | 9 | use std::os::windows::fs::symlink_file; |
| 10 | 10 | use std::path::Path; |
| 11 | 11 | |
| 12 | use anyhow::{format_err, Context, Result}; | |
| 12 | use anyhow::{Context, Result, format_err}; | |
| 13 | 13 | use walkdir::WalkDir; |
| 14 | 14 | |
| 15 | 15 | /// Converts a `&Path` to a UTF-8 `&str`. |
src/tools/rustbook/src/main.rs+2-2| ... | ... | @@ -1,9 +1,9 @@ |
| 1 | 1 | use std::env; |
| 2 | 2 | use std::path::{Path, PathBuf}; |
| 3 | 3 | |
| 4 | use clap::{arg, crate_version, ArgMatches, Command}; | |
| 5 | use mdbook::errors::Result as Result3; | |
| 4 | use clap::{ArgMatches, Command, arg, crate_version}; | |
| 6 | 5 | use mdbook::MDBook; |
| 6 | use mdbook::errors::Result as Result3; | |
| 7 | 7 | use mdbook_i18n_helpers::preprocessors::Gettext; |
| 8 | 8 | use mdbook_spec::Spec; |
| 9 | 9 | use mdbook_trpl_listing::TrplListing; |
src/tools/rustdoc-themes/main.rs+2-2| ... | ... | @@ -1,8 +1,8 @@ |
| 1 | 1 | use std::env::args; |
| 2 | use std::fs::{create_dir_all, File}; | |
| 2 | use std::fs::{File, create_dir_all}; | |
| 3 | 3 | use std::io::{BufRead, BufReader, BufWriter, Write}; |
| 4 | 4 | use std::path::Path; |
| 5 | use std::process::{exit, Command}; | |
| 5 | use std::process::{Command, exit}; | |
| 6 | 6 | |
| 7 | 7 | fn get_themes<P: AsRef<Path>>(style_path: P) -> Vec<String> { |
| 8 | 8 | let mut ret = Vec::with_capacity(10); |
src/tools/suggest-tests/src/main.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use std::process::ExitCode; |
| 2 | 2 | |
| 3 | use build_helper::git::{get_git_modified_files, GitConfig}; | |
| 3 | use build_helper::git::{GitConfig, get_git_modified_files}; | |
| 4 | 4 | use suggest_tests::get_suggestions; |
| 5 | 5 | |
| 6 | 6 | fn main() -> ExitCode { |
src/tools/suggest-tests/src/static_suggestions.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | use std::sync::OnceLock; |
| 2 | 2 | |
| 3 | use crate::{sug, Suggestion}; | |
| 3 | use crate::{Suggestion, sug}; | |
| 4 | 4 | |
| 5 | 5 | // FIXME: perhaps this could use `std::lazy` when it is stablizied |
| 6 | 6 | macro_rules! static_suggestions { |
src/tools/tidy/src/ext_tool_checks.rs+4-5| ... | ... | @@ -172,11 +172,10 @@ fn check_impl( |
| 172 | 172 | let files; |
| 173 | 173 | if file_args_clang_format.is_empty() { |
| 174 | 174 | let llvm_wrapper = root_path.join("compiler/rustc_llvm/llvm-wrapper"); |
| 175 | files = find_with_extension( | |
| 176 | root_path, | |
| 177 | Some(llvm_wrapper.as_path()), | |
| 178 | &[OsStr::new("h"), OsStr::new("cpp")], | |
| 179 | )?; | |
| 175 | files = find_with_extension(root_path, Some(llvm_wrapper.as_path()), &[ | |
| 176 | OsStr::new("h"), | |
| 177 | OsStr::new("cpp"), | |
| 178 | ])?; | |
| 180 | 179 | file_args_clang_format.extend(files.iter().map(|p| p.as_os_str())); |
| 181 | 180 | } |
| 182 | 181 | let args = merge_args(&cfg_args_clang_format, &file_args_clang_format); |
src/tools/tidy/src/main.rs+1-1| ... | ... | @@ -9,7 +9,7 @@ use std::num::NonZeroUsize; |
| 9 | 9 | use std::path::PathBuf; |
| 10 | 10 | use std::str::FromStr; |
| 11 | 11 | use std::sync::atomic::{AtomicBool, Ordering}; |
| 12 | use std::thread::{self, scope, ScopedJoinHandle}; | |
| 12 | use std::thread::{self, ScopedJoinHandle, scope}; | |
| 13 | 13 | use std::{env, process}; |
| 14 | 14 | |
| 15 | 15 | use tidy::*; |
src/tools/tidy/src/target_specific_tests.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | use std::collections::BTreeMap; |
| 5 | 5 | use std::path::Path; |
| 6 | 6 | |
| 7 | use crate::iter_header::{iter_header, HeaderLine}; | |
| 7 | use crate::iter_header::{HeaderLine, iter_header}; | |
| 8 | 8 | use crate::walk::filter_not_rust; |
| 9 | 9 | |
| 10 | 10 | const LLVM_COMPONENTS_HEADER: &str = "needs-llvm-components:"; |
src/tools/tidy/src/unknown_revision.rs+1-1| ... | ... | @@ -12,7 +12,7 @@ use std::sync::OnceLock; |
| 12 | 12 | use ignore::DirEntry; |
| 13 | 13 | use regex::Regex; |
| 14 | 14 | |
| 15 | use crate::iter_header::{iter_header, HeaderLine}; | |
| 15 | use crate::iter_header::{HeaderLine, iter_header}; | |
| 16 | 16 | use crate::walk::{filter_dirs, filter_not_rust, walk}; |
| 17 | 17 | |
| 18 | 18 | pub fn check(tests_path: impl AsRef<Path>, bad: &mut bool) { |
src/tools/unicode-table-generator/src/case_mapping.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ use std::char; |
| 2 | 2 | use std::collections::BTreeMap; |
| 3 | 3 | use std::fmt::{self, Write}; |
| 4 | 4 | |
| 5 | use crate::{fmt_list, UnicodeData}; | |
| 5 | use crate::{UnicodeData, fmt_list}; | |
| 6 | 6 | |
| 7 | 7 | const INDEX_MASK: u32 = 1 << 22; |
| 8 | 8 |
src/tools/unicode-table-generator/src/main.rs+1-1| ... | ... | @@ -82,7 +82,7 @@ mod raw_emitter; |
| 82 | 82 | mod skiplist; |
| 83 | 83 | mod unicode_download; |
| 84 | 84 | |
| 85 | use raw_emitter::{emit_codepoints, emit_whitespace, RawEmitter}; | |
| 85 | use raw_emitter::{RawEmitter, emit_codepoints, emit_whitespace}; | |
| 86 | 86 | |
| 87 | 87 | static PROPERTIES: &[&str] = &[ |
| 88 | 88 | "Alphabetic", |
src/tools/unicode-table-generator/src/raw_emitter.rs+21-27| ... | ... | @@ -360,15 +360,12 @@ impl Canonicalized { |
| 360 | 360 | let unique_mapping = unique_mapping |
| 361 | 361 | .into_iter() |
| 362 | 362 | .map(|(key, value)| { |
| 363 | ( | |
| 364 | key, | |
| 365 | match value { | |
| 366 | UniqueMapping::Canonicalized(idx) => { | |
| 367 | u8::try_from(canonical_words.len() + idx).unwrap() | |
| 368 | } | |
| 369 | UniqueMapping::Canonical(idx) => u8::try_from(idx).unwrap(), | |
| 370 | }, | |
| 371 | ) | |
| 363 | (key, match value { | |
| 364 | UniqueMapping::Canonicalized(idx) => { | |
| 365 | u8::try_from(canonical_words.len() + idx).unwrap() | |
| 366 | } | |
| 367 | UniqueMapping::Canonical(idx) => u8::try_from(idx).unwrap(), | |
| 368 | }) | |
| 372 | 369 | }) |
| 373 | 370 | .collect::<HashMap<_, _>>(); |
| 374 | 371 | |
| ... | ... | @@ -383,24 +380,21 @@ impl Canonicalized { |
| 383 | 380 | let canonicalized_words = canonicalized_words |
| 384 | 381 | .into_iter() |
| 385 | 382 | .map(|v| { |
| 386 | ( | |
| 387 | u8::try_from(v.0).unwrap(), | |
| 388 | match v.1 { | |
| 389 | Mapping::RotateAndInvert(amount) => { | |
| 390 | assert_eq!(amount, amount & LOWER_6); | |
| 391 | 1 << 6 | (amount as u8) | |
| 392 | } | |
| 393 | Mapping::Rotate(amount) => { | |
| 394 | assert_eq!(amount, amount & LOWER_6); | |
| 395 | amount as u8 | |
| 396 | } | |
| 397 | Mapping::Invert => 1 << 6, | |
| 398 | Mapping::ShiftRight(shift_by) => { | |
| 399 | assert_eq!(shift_by, shift_by & LOWER_6); | |
| 400 | 1 << 7 | (shift_by as u8) | |
| 401 | } | |
| 402 | }, | |
| 403 | ) | |
| 383 | (u8::try_from(v.0).unwrap(), match v.1 { | |
| 384 | Mapping::RotateAndInvert(amount) => { | |
| 385 | assert_eq!(amount, amount & LOWER_6); | |
| 386 | 1 << 6 | (amount as u8) | |
| 387 | } | |
| 388 | Mapping::Rotate(amount) => { | |
| 389 | assert_eq!(amount, amount & LOWER_6); | |
| 390 | amount as u8 | |
| 391 | } | |
| 392 | Mapping::Invert => 1 << 6, | |
| 393 | Mapping::ShiftRight(shift_by) => { | |
| 394 | assert_eq!(shift_by, shift_by & LOWER_6); | |
| 395 | 1 << 7 | (shift_by as u8) | |
| 396 | } | |
| 397 | }) | |
| 404 | 398 | }) |
| 405 | 399 | .collect::<Vec<(u8, u8)>>(); |
| 406 | 400 | Canonicalized { unique_mapping, canonical_words, canonicalized_words } |
src/tools/unstable-book-gen/src/main.rs+3-3| ... | ... | @@ -5,11 +5,11 @@ use std::env; |
| 5 | 5 | use std::fs::{self, write}; |
| 6 | 6 | use std::path::Path; |
| 7 | 7 | |
| 8 | use tidy::features::{collect_lang_features, collect_lib_features, Features}; | |
| 8 | use tidy::features::{Features, collect_lang_features, collect_lib_features}; | |
| 9 | 9 | use tidy::t; |
| 10 | 10 | use tidy::unstable_book::{ |
| 11 | collect_unstable_book_section_file_names, collect_unstable_feature_names, LANG_FEATURES_DIR, | |
| 12 | LIB_FEATURES_DIR, PATH_STR, | |
| 11 | LANG_FEATURES_DIR, LIB_FEATURES_DIR, PATH_STR, collect_unstable_book_section_file_names, | |
| 12 | collect_unstable_feature_names, | |
| 13 | 13 | }; |
| 14 | 14 | |
| 15 | 15 | fn generate_stub_issue(path: &Path, name: &str, issue: u32) { |
tests/mir-opt/instsimplify/combine_transmutes.rs+1-1| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | #![feature(custom_mir)] |
| 6 | 6 | |
| 7 | 7 | use std::intrinsics::mir::*; |
| 8 | use std::mem::{transmute, ManuallyDrop, MaybeUninit}; | |
| 8 | use std::mem::{ManuallyDrop, MaybeUninit, transmute}; | |
| 9 | 9 | |
| 10 | 10 | // EMIT_MIR combine_transmutes.identity_transmutes.InstSimplify-after-simplifycfg.diff |
| 11 | 11 | pub unsafe fn identity_transmutes() { |
tests/run-make/c-link-to-rust-va-list-fn/checkrust.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | #![crate_type = "staticlib"] |
| 2 | 2 | #![feature(c_variadic)] |
| 3 | 3 | |
| 4 | use std::ffi::{c_char, c_double, c_int, c_long, c_longlong, CStr, CString, VaList}; | |
| 4 | use std::ffi::{CStr, CString, VaList, c_char, c_double, c_int, c_long, c_longlong}; | |
| 5 | 5 | |
| 6 | 6 | macro_rules! continue_if { |
| 7 | 7 | ($cond:expr) => { |
tests/run-make/c-unwind-abi-catch-lib-panic/main.rs+1-1| ... | ... | @@ -3,7 +3,7 @@ |
| 3 | 3 | //! This test triggers a panic in a Rust library that our foreign function invokes. This shows |
| 4 | 4 | //! that we can unwind through the C code in that library, and catch the underlying panic. |
| 5 | 5 | |
| 6 | use std::panic::{catch_unwind, AssertUnwindSafe}; | |
| 6 | use std::panic::{AssertUnwindSafe, catch_unwind}; | |
| 7 | 7 | |
| 8 | 8 | fn main() { |
| 9 | 9 | // Call `add_small_numbers`, passing arguments that will NOT trigger a panic. |
tests/run-make/c-unwind-abi-catch-panic/main.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | //! |
| 3 | 3 | //! This test triggers a panic when calling a foreign function that calls *back* into Rust. |
| 4 | 4 | |
| 5 | use std::panic::{catch_unwind, AssertUnwindSafe}; | |
| 5 | use std::panic::{AssertUnwindSafe, catch_unwind}; | |
| 6 | 6 | |
| 7 | 7 | fn main() { |
| 8 | 8 | // Call `add_small_numbers`, passing arguments that will NOT trigger a panic. |
tests/run-make/compiler-builtins/rmake.rs+1-1| ... | ... | @@ -17,8 +17,8 @@ |
| 17 | 17 | use std::collections::HashSet; |
| 18 | 18 | use std::path::PathBuf; |
| 19 | 19 | |
| 20 | use run_make_support::object::read::archive::ArchiveFile; | |
| 21 | 20 | use run_make_support::object::read::Object; |
| 21 | use run_make_support::object::read::archive::ArchiveFile; | |
| 22 | 22 | use run_make_support::object::{ObjectSection, ObjectSymbol, RelocationTarget}; |
| 23 | 23 | use run_make_support::rfs::{read, read_dir}; |
| 24 | 24 | use run_make_support::{cmd, env_var, object}; |
tests/run-make/compressed-debuginfo-zstd/rmake.rs+1-1| ... | ... | @@ -8,7 +8,7 @@ |
| 8 | 8 | //@ only-linux |
| 9 | 9 | //@ ignore-cross-compile |
| 10 | 10 | |
| 11 | use run_make_support::{llvm_readobj, run_in_tmpdir, Rustc}; | |
| 11 | use run_make_support::{Rustc, llvm_readobj, run_in_tmpdir}; | |
| 12 | 12 | |
| 13 | 13 | fn check_compression(compression: &str, to_find: &str) { |
| 14 | 14 | // check compressed debug sections via rustc flag |
tests/run-make/crate-loading/multiple-dep-versions.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | extern crate dep_2_reexport; |
| 2 | 2 | extern crate dependency; |
| 3 | 3 | use dep_2_reexport::Type; |
| 4 | use dependency::{do_something, Trait}; | |
| 4 | use dependency::{Trait, do_something}; | |
| 5 | 5 | |
| 6 | 6 | fn main() { |
| 7 | 7 | do_something(Type); |
tests/run-make/crate-loading/rmake.rs+6-6| ... | ... | @@ -64,10 +64,10 @@ note: there are multiple different versions of crate `dependency` in the depende |
| 64 | 64 | 5 | fn foo(&self); |
| 65 | 65 | | -------------- the method is available for `dep_2_reexport::Type` here |
| 66 | 66 | | |
| 67 | ::: multiple-dep-versions.rs:4:32 | |
| 67 | ::: multiple-dep-versions.rs:4:18 | |
| 68 | 68 | | |
| 69 | 4 | use dependency::{do_something, Trait}; | |
| 70 | | ----- `Trait` imported here doesn't correspond to the right version of crate `dependency`"#, | |
| 69 | 4 | use dependency::{Trait, do_something}; | |
| 70 | | ----- `Trait` imported here doesn't correspond to the right version of crate `dependency`"#, | |
| 71 | 71 | ) |
| 72 | 72 | .assert_stderr_contains( |
| 73 | 73 | r#" |
| ... | ... | @@ -92,9 +92,9 @@ note: there are multiple different versions of crate `dependency` in the depende |
| 92 | 92 | 6 | fn bar(); |
| 93 | 93 | | --------- the associated function is available for `dep_2_reexport::Type` here |
| 94 | 94 | | |
| 95 | ::: multiple-dep-versions.rs:4:32 | |
| 95 | ::: multiple-dep-versions.rs:4:18 | |
| 96 | 96 | | |
| 97 | 4 | use dependency::{do_something, Trait}; | |
| 98 | | ----- `Trait` imported here doesn't correspond to the right version of crate `dependency`"#, | |
| 97 | 4 | use dependency::{Trait, do_something}; | |
| 98 | | ----- `Trait` imported here doesn't correspond to the right version of crate `dependency`"#, | |
| 99 | 99 | ); |
| 100 | 100 | } |
tests/run-make/extern-fn-explicit-align/test.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | // Issue #80127: Passing structs via FFI should work with explicit alignment. |
| 2 | 2 | |
| 3 | use std::ffi::{c_char, CStr}; | |
| 3 | use std::ffi::{CStr, c_char}; | |
| 4 | 4 | use std::ptr::null_mut; |
| 5 | 5 | |
| 6 | 6 | #[repr(C)] |
tests/run-make/foreign-exceptions/foo.rs+1-1| ... | ... | @@ -2,7 +2,7 @@ |
| 2 | 2 | // are caught by catch_unwind. Also tests that Rust panics can unwind through |
| 3 | 3 | // C++ code. |
| 4 | 4 | |
| 5 | use std::panic::{catch_unwind, AssertUnwindSafe}; | |
| 5 | use std::panic::{AssertUnwindSafe, catch_unwind}; | |
| 6 | 6 | |
| 7 | 7 | struct DropCheck<'a>(&'a mut bool); |
| 8 | 8 | impl<'a> Drop for DropCheck<'a> { |
tests/run-make/naked-symbol-visibility/rmake.rs+1-1| ... | ... | @@ -1,7 +1,7 @@ |
| 1 | 1 | //@ ignore-windows |
| 2 | 2 | //@ only-x86_64 |
| 3 | use run_make_support::object::read::{File, Object, Symbol}; | |
| 4 | 3 | use run_make_support::object::ObjectSymbol; |
| 4 | use run_make_support::object::read::{File, Object, Symbol}; | |
| 5 | 5 | use run_make_support::targets::is_windows; |
| 6 | 6 | use run_make_support::{dynamic_lib_name, rfs, rustc}; |
| 7 | 7 |
tests/run-make/rustdoc-shared-flags/rmake.rs+1-1| ... | ... | @@ -1,4 +1,4 @@ |
| 1 | use run_make_support::{rustc, rustdoc, Diff}; | |
| 1 | use run_make_support::{Diff, rustc, rustdoc}; | |
| 2 | 2 | |
| 3 | 3 | fn compare_outputs(args: &[&str]) { |
| 4 | 4 | let rustc_output = rustc().args(args).run().stdout_utf8(); |
tests/run-make/split-debuginfo/main.rs+1-1| ... | ... | @@ -1,6 +1,6 @@ |
| 1 | 1 | extern crate bar; |
| 2 | 2 | |
| 3 | use bar::{make_bar, Bar}; | |
| 3 | use bar::{Bar, make_bar}; | |
| 4 | 4 | |
| 5 | 5 | fn main() { |
| 6 | 6 | let b = make_bar(3); |
tests/run-make/type-mismatch-same-crate-name/crateA.rs+1-1| ... | ... | @@ -12,5 +12,5 @@ mod bar { |
| 12 | 12 | |
| 13 | 13 | // This makes the publicly accessible path |
| 14 | 14 | // differ from the internal one. |
| 15 | pub use bar::{bar, Bar}; | |
| 15 | pub use bar::{Bar, bar}; | |
| 16 | 16 | pub use foo::Foo; |
tests/run-make/wasm-export-all-symbols/rmake.rs+7-10| ... | ... | @@ -20,16 +20,13 @@ fn test(args: &[&str]) { |
| 20 | 20 | rustc().input("main.rs").target("wasm32-wasip1").args(args).run(); |
| 21 | 21 | |
| 22 | 22 | verify_exports(Path::new("foo.wasm"), &[("foo", Func), ("FOO", Global), ("memory", Memory)]); |
| 23 | verify_exports( | |
| 24 | Path::new("main.wasm"), | |
| 25 | &[ | |
| 26 | ("foo", Func), | |
| 27 | ("FOO", Global), | |
| 28 | ("_start", Func), | |
| 29 | ("__main_void", Func), | |
| 30 | ("memory", Memory), | |
| 31 | ], | |
| 32 | ); | |
| 23 | verify_exports(Path::new("main.wasm"), &[ | |
| 24 | ("foo", Func), | |
| 25 | ("FOO", Global), | |
| 26 | ("_start", Func), | |
| 27 | ("__main_void", Func), | |
| 28 | ("memory", Memory), | |
| 29 | ]); | |
| 33 | 30 | } |
| 34 | 31 | |
| 35 | 32 | fn verify_exports(path: &Path, exports: &[(&str, wasmparser::ExternalKind)]) { |
tests/run-pass-valgrind/exit-flushes.rs+1-1| ... | ... | @@ -4,7 +4,7 @@ |
| 4 | 4 | // https://github.com/rust-lang/rust/pull/30365#issuecomment-165763679 |
| 5 | 5 | |
| 6 | 6 | use std::env; |
| 7 | use std::process::{exit, Command}; | |
| 7 | use std::process::{Command, exit}; | |
| 8 | 8 | |
| 9 | 9 | fn main() { |
| 10 | 10 | if env::args().len() > 1 { |
tests/rustdoc-js-std/path-maxeditdistance.js+5-5| ... | ... | @@ -11,7 +11,7 @@ const EXPECTED = [ |
| 11 | 11 | { 'path': 'std::vec::IntoIter', 'name': 'into_iter' }, |
| 12 | 12 | { 'path': 'std::vec::ExtractIf', 'name': 'into_iter' }, |
| 13 | 13 | { 'path': 'std::vec::Splice', 'name': 'into_iter' }, |
| 14 | { 'path': 'std::collections::VecDeque', 'name': 'into_iter' }, | |
| 14 | { 'path': 'std::collections::vec_deque::VecDeque', 'name': 'into_iter' }, | |
| 15 | 15 | ], |
| 16 | 16 | }, |
| 17 | 17 | { |
| ... | ... | @@ -25,10 +25,10 @@ const EXPECTED = [ |
| 25 | 25 | { 'path': 'std::vec::IntoIter', 'name': 'into_iter' }, |
| 26 | 26 | { 'path': 'std::vec::ExtractIf', 'name': 'into_iter' }, |
| 27 | 27 | { 'path': 'std::vec::Splice', 'name': 'into_iter' }, |
| 28 | { 'path': 'std::collections::VecDeque', 'name': 'iter' }, | |
| 29 | { 'path': 'std::collections::VecDeque', 'name': 'iter_mut' }, | |
| 30 | { 'path': 'std::collections::VecDeque', 'name': 'from_iter' }, | |
| 31 | { 'path': 'std::collections::VecDeque', 'name': 'into_iter' }, | |
| 28 | { 'path': 'std::collections::vec_deque::VecDeque', 'name': 'iter' }, | |
| 29 | { 'path': 'std::collections::vec_deque::VecDeque', 'name': 'iter_mut' }, | |
| 30 | { 'path': 'std::collections::vec_deque::VecDeque', 'name': 'from_iter' }, | |
| 31 | { 'path': 'std::collections::vec_deque::VecDeque', 'name': 'into_iter' }, | |
| 32 | 32 | ], |
| 33 | 33 | }, |
| 34 | 34 | { |
tests/rustdoc-json/reexport/same_name_different_types.rs+1-1| ... | ... | @@ -17,6 +17,6 @@ pub mod nested { |
| 17 | 17 | //@ ismany "$.index[*].inner[?(@.use.name == 'Bar')].use.id" $foo_fn $foo_struct |
| 18 | 18 | |
| 19 | 19 | //@ count "$.index[*].inner[?(@.use.name == 'Foo')]" 2 |
| 20 | pub use nested::Foo; | |
| 21 | 20 | //@ count "$.index[*].inner[?(@.use.name == 'Bar')]" 2 |
| 22 | 21 | pub use Foo as Bar; |
| 22 | pub use nested::Foo; |
tests/rustdoc-json/type/inherent_associated_type_bound.rs+4-1| ... | ... | @@ -16,5 +16,8 @@ pub struct Carrier<'a>(&'a ()); |
| 16 | 16 | pub fn user(_: for<'b> fn(Carrier<'b>::Focus<i32>)) {} |
| 17 | 17 | |
| 18 | 18 | impl<'a> Carrier<'a> { |
| 19 | pub type Focus<T> = &'a mut T where T: 'a; | |
| 19 | pub type Focus<T> | |
| 20 | = &'a mut T | |
| 21 | where | |
| 22 | T: 'a; | |
| 20 | 23 | } |