Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
52f7a21
Relax ordering rules for `asm!` operands
Amanieu Dec 16, 2022
40185db
Delete old re-exports from rustc_smir
celinval Mar 4, 2023
2c9b8c5
Implementing "<test_binary> --list --format json" #107307 #49359
parthopdas Feb 8, 2023
b66db7e
Create new rustc_smir struct to map future crates
celinval Mar 4, 2023
8d13454
Canonicalize the ROOT VAR
compiler-errors Mar 7, 2023
3bfcfd0
fix var equality issue with old canonicalizer
compiler-errors Mar 7, 2023
775bacd
Simplify `sort_by` calls
WaffleLapkin Mar 7, 2023
5eaeb71
Change item collection to be on demand
celinval Mar 7, 2023
a439c02
may not => cannot
compiler-errors Mar 7, 2023
0f4255e
Dedup copy field errors for identical types
compiler-errors Mar 8, 2023
8a99ffc
Suppress copy impl error when post-normalized type references errors
compiler-errors Mar 7, 2023
08e5a77
Don't report E0740 for type error
compiler-errors Mar 7, 2023
64eea3c
Tweak E0740
compiler-errors Mar 7, 2023
be60bcb
Rename `MapInPlace` as `FlatMapInPlace`.
nnethercote Mar 8, 2023
204ba32
fix: evaluate with wrong obligation stack
LYF1999 Mar 8, 2023
20a8119
Rollup merge of #105798 - Amanieu:relax-asm, r=joshtriplett
GuillaumeGomez Mar 8, 2023
d810534
Rollup merge of #108148 - parthopdas:master, r=oli-obk
GuillaumeGomez Mar 8, 2023
ae46eba
Rollup merge of #108839 - compiler-errors:canonicalize-the-root-var, …
GuillaumeGomez Mar 8, 2023
e4844a5
Rollup merge of #108846 - celinval:smir-poc, r=oli-obk
GuillaumeGomez Mar 8, 2023
292f553
Rollup merge of #108873 - WaffleLapkin:cmp, r=cjgillot
GuillaumeGomez Mar 8, 2023
780c2c1
Rollup merge of #108882 - compiler-errors:E0740, r=eholk
GuillaumeGomez Mar 8, 2023
5b7b922
Rollup merge of #108883 - compiler-errors:post-norm-copy-err, r=BoxyUwU
GuillaumeGomez Mar 8, 2023
62d18cb
Rollup merge of #108884 - compiler-errors:tweak-illegal-copy-impl-mes…
GuillaumeGomez Mar 8, 2023
ec7485c
Rollup merge of #108887 - nnethercote:rename-MapInPlace, r=lqd
GuillaumeGomez Mar 8, 2023
4b60218
Rollup merge of #108901 - LYF1999:yf/108897, r=lcnr
GuillaumeGomez Mar 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename MapInPlace as FlatMapInPlace.
After removing the `map_in_place` method, which isn't much use because
modifying every element in a collection such as a `Vec` can be done
trivially with iteration.
  • Loading branch information
nnethercote committed Mar 8, 2023
commit be60bcb28a4e4099e29aa8f6e9e3ca851193344b
2 changes: 1 addition & 1 deletion compiler/rustc_ast/src/mut_visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::ptr::P;
use crate::token::{self, Token};
use crate::tokenstream::*;

use rustc_data_structures::map_in_place::MapInPlace;
use rustc_data_structures::flat_map_in_place::FlatMapInPlace;
use rustc_data_structures::sync::Lrc;
use rustc_span::source_map::Spanned;
use rustc_span::symbol::Ident;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,7 @@ use smallvec::{Array, SmallVec};
use std::ptr;
use thin_vec::ThinVec;

pub trait MapInPlace<T>: Sized {
fn map_in_place<F>(&mut self, mut f: F)
where
F: FnMut(T) -> T,
{
self.flat_map_in_place(|e| Some(f(e)))
}

pub trait FlatMapInPlace<T>: Sized {
fn flat_map_in_place<F, I>(&mut self, f: F)
where
F: FnMut(T) -> I,
Expand Down Expand Up @@ -66,14 +59,14 @@ macro_rules! flat_map_in_place {
};
}

impl<T> MapInPlace<T> for Vec<T> {
impl<T> FlatMapInPlace<T> for Vec<T> {
flat_map_in_place!();
}

impl<T, A: Array<Item = T>> MapInPlace<T> for SmallVec<A> {
impl<T, A: Array<Item = T>> FlatMapInPlace<T> for SmallVec<A> {
flat_map_in_place!();
}

impl<T> MapInPlace<T> for ThinVec<T> {
impl<T> FlatMapInPlace<T> for ThinVec<T> {
flat_map_in_place!();
}
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ pub fn cold_path<F: FnOnce() -> R, R>(f: F) -> R {
pub mod base_n;
pub mod binary_search_util;
pub mod captures;
pub mod flat_map_in_place;
pub mod flock;
pub mod functor;
pub mod fx;
pub mod graph;
pub mod intern;
pub mod jobserver;
pub mod macros;
pub mod map_in_place;
pub mod obligation_forest;
pub mod owning_ref;
pub mod sip128;
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_expand/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use rustc_ast::tokenstream::{LazyAttrTokenStream, TokenTree};
use rustc_ast::NodeId;
use rustc_ast::{self as ast, AttrStyle, Attribute, HasAttrs, HasTokens, MetaItem};
use rustc_attr as attr;
use rustc_data_structures::flat_map_in_place::FlatMapInPlace;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::map_in_place::MapInPlace;
use rustc_feature::{Feature, Features, State as FeatureState};
use rustc_feature::{
ACCEPTED_FEATURES, ACTIVE_FEATURES, REMOVED_FEATURES, STABLE_REMOVED_FEATURES,
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_expand/src/expand.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use rustc_ast::{ForeignItemKind, HasAttrs, HasNodeId};
use rustc_ast::{Inline, ItemKind, MacStmtStyle, MetaItemKind, ModKind};
use rustc_ast::{NestedMetaItem, NodeId, PatKind, StmtKind, TyKind};
use rustc_ast_pretty::pprust;
use rustc_data_structures::map_in_place::MapInPlace;
use rustc_data_structures::flat_map_in_place::FlatMapInPlace;
use rustc_data_structures::sync::Lrc;
use rustc_errors::PResult;
use rustc_feature::Features;
Expand Down