Skip to content

Commit 8d3f3f0

Browse files
committed
Rollup merge of rust-lang#49117 - nivkner:fixme_fixup3, r=estebank
address some FIXME whose associated issues were marked as closed part of rust-lang#44366
2 parents 245f4c4 + 66d120c commit 8d3f3f0

File tree

14 files changed

+40
-77
lines changed

14 files changed

+40
-77
lines changed

src/liballoc/tests/slice.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1351,7 +1351,7 @@ fn test_copy_from_slice_dst_shorter() {
13511351
const MAX_LEN: usize = 80;
13521352

13531353
static DROP_COUNTS: [AtomicUsize; MAX_LEN] = [
1354-
// FIXME #5244: AtomicUsize is not Copy.
1354+
// FIXME(RFC 1109): AtomicUsize is not Copy.
13551355
AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0),
13561356
AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0),
13571357
AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0),

src/libcore/convert.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ impl<'a, T: ?Sized, U: ?Sized> AsRef<U> for &'a mut T where T: AsRef<U>
382382
}
383383
}
384384

385-
// FIXME (#23442): replace the above impls for &/&mut with the following more general one:
385+
// FIXME (#45742): replace the above impls for &/&mut with the following more general one:
386386
// // As lifts over Deref
387387
// impl<D: ?Sized + Deref, U: ?Sized> AsRef<U> for D where D::Target: AsRef<U> {
388388
// fn as_ref(&self) -> &U {
@@ -399,7 +399,7 @@ impl<'a, T: ?Sized, U: ?Sized> AsMut<U> for &'a mut T where T: AsMut<U>
399399
}
400400
}
401401

402-
// FIXME (#23442): replace the above impl for &mut with the following more general one:
402+
// FIXME (#45742): replace the above impl for &mut with the following more general one:
403403
// // AsMut lifts over DerefMut
404404
// impl<D: ?Sized + Deref, U: ?Sized> AsMut<U> for D where D::Target: AsMut<U> {
405405
// fn as_mut(&mut self) -> &mut U {

src/libcore/iter/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1872,7 +1872,7 @@ impl<I: Iterator> Iterator for Peekable<I> {
18721872

18731873
#[inline]
18741874
fn nth(&mut self, n: usize) -> Option<I::Item> {
1875-
// FIXME(#6393): merge these when borrow-checking gets better.
1875+
// FIXME(#43234): merge these when borrow-checking gets better.
18761876
if n == 0 {
18771877
match self.peeked.take() {
18781878
Some(v) => v,

src/librustc_mir/build/block.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,9 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
117117
// Evaluate the initializer, if present.
118118
if let Some(init) = initializer {
119119
unpack!(block = this.in_opt_scope(
120-
opt_destruction_scope.map(|de|(de, source_info)), block, move |this| {
120+
opt_destruction_scope.map(|de|(de, source_info)), block, |this| {
121121
let scope = (init_scope, source_info);
122-
this.in_scope(scope, lint_level, block, move |this| {
123-
// FIXME #30046 ^~~~
122+
this.in_scope(scope, lint_level, block, |this| {
124123
this.expr_into_pattern(block, pattern, init)
125124
})
126125
}));

src/librustc_mir/util/elaborate_drops.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
177177
});
178178
}
179179
DropStyle::Conditional => {
180-
let unwind = self.unwind; // FIXME(#6393)
180+
let unwind = self.unwind; // FIXME(#43234)
181181
let succ = self.succ;
182182
let drop_bb = self.complete_drop(Some(DropFlagMode::Deep), succ, unwind);
183183
self.elaborator.patch().patch_terminator(bb, TerminatorKind::Goto {
@@ -268,7 +268,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
268268
// Clear the "master" drop flag at the end. This is needed
269269
// because the "master" drop protects the ADT's discriminant,
270270
// which is invalidated after the ADT is dropped.
271-
let (succ, unwind) = (self.succ, self.unwind); // FIXME(#6393)
271+
let (succ, unwind) = (self.succ, self.unwind); // FIXME(#43234)
272272
(
273273
self.drop_flag_reset_block(DropFlagMode::Shallow, succ, unwind),
274274
unwind.map(|unwind| {
@@ -344,7 +344,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
344344
let interior = self.place.clone().deref();
345345
let interior_path = self.elaborator.deref_subpath(self.path);
346346

347-
let succ = self.succ; // FIXME(#6393)
347+
let succ = self.succ; // FIXME(#43234)
348348
let unwind = self.unwind;
349349
let succ = self.box_free_block(ty, succ, unwind);
350350
let unwind_succ = self.unwind.map(|unwind| {
@@ -717,7 +717,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
717717
ptr_based)
718718
});
719719

720-
let succ = self.succ; // FIXME(#6393)
720+
let succ = self.succ; // FIXME(#43234)
721721
let loop_block = self.drop_loop(
722722
succ,
723723
cur,
@@ -798,7 +798,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
798798
self.open_drop_for_adt(def, substs)
799799
}
800800
ty::TyDynamic(..) => {
801-
let unwind = self.unwind; // FIXME(#6393)
801+
let unwind = self.unwind; // FIXME(#43234)
802802
let succ = self.succ;
803803
self.complete_drop(Some(DropFlagMode::Deep), succ, unwind)
804804
}
@@ -849,7 +849,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
849849

850850
fn elaborated_drop_block<'a>(&mut self) -> BasicBlock {
851851
debug!("elaborated_drop_block({:?})", self);
852-
let unwind = self.unwind; // FIXME(#6393)
852+
let unwind = self.unwind; // FIXME(#43234)
853853
let succ = self.succ;
854854
let blk = self.drop_block(succ, unwind);
855855
self.elaborate_drop(blk);
@@ -882,7 +882,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
882882
args: vec![Operand::Move(self.place.clone())],
883883
destination: Some((unit_temp, target)),
884884
cleanup: None
885-
}; // FIXME(#6393)
885+
}; // FIXME(#43234)
886886
let free_block = self.new_block(unwind, call);
887887

888888
let block_start = Location { block: free_block, statement_index: 0 };

src/librustc_resolve/resolve_imports.rs

+3-22
Original file line numberDiff line numberDiff line change
@@ -1025,28 +1025,9 @@ fn import_path_to_string(names: &[SpannedIdent],
10251025
if names.is_empty() {
10261026
import_directive_subclass_to_string(subclass)
10271027
} else {
1028-
// FIXME: Remove this entire logic after #48116 is fixed.
1029-
//
1030-
// Note that this code looks a little wonky, it's currently here to
1031-
// hopefully help debug #48116, but otherwise isn't intended to
1032-
// cause any problems.
1033-
let x = format!(
1034-
"{}::{}",
1035-
names_to_string(names),
1036-
import_directive_subclass_to_string(subclass),
1037-
);
1038-
if names.is_empty() || x.starts_with("::") {
1039-
span_bug!(
1040-
span,
1041-
"invalid name `{}` at {:?}; global = {}, names = {:?}, subclass = {:?}",
1042-
x,
1043-
span,
1044-
global,
1045-
names,
1046-
subclass
1047-
);
1048-
}
1049-
return x
1028+
format!("{}::{}",
1029+
names_to_string(names),
1030+
import_directive_subclass_to_string(subclass))
10501031
}
10511032
}
10521033
}

src/librustc_trans_utils/symbol_names_test.rs

+6-15
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
//! paths etc in all kinds of annoying scenarios.
1616
1717
use rustc::hir;
18-
use rustc::hir::intravisit::{self, Visitor, NestedVisitorMap};
1918
use rustc::ty::TyCtxt;
2019
use syntax::ast;
2120

@@ -34,8 +33,7 @@ pub fn report_symbol_names<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
3433

3534
tcx.dep_graph.with_ignore(|| {
3635
let mut visitor = SymbolNamesTest { tcx: tcx };
37-
// FIXME(#37712) could use ItemLikeVisitor if trait items were item-like
38-
tcx.hir.krate().visit_all_item_likes(&mut visitor.as_deep_visitor());
36+
tcx.hir.krate().visit_all_item_likes(&mut visitor);
3937
})
4038
}
4139

@@ -66,23 +64,16 @@ impl<'a, 'tcx> SymbolNamesTest<'a, 'tcx> {
6664
}
6765
}
6866

69-
impl<'a, 'tcx> Visitor<'tcx> for SymbolNamesTest<'a, 'tcx> {
70-
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
71-
NestedVisitorMap::None
72-
}
73-
67+
impl<'a, 'tcx> hir::itemlikevisit::ItemLikeVisitor<'tcx> for SymbolNamesTest<'a, 'tcx> {
7468
fn visit_item(&mut self, item: &'tcx hir::Item) {
7569
self.process_attrs(item.id);
76-
intravisit::walk_item(self, item);
7770
}
7871

79-
fn visit_trait_item(&mut self, ti: &'tcx hir::TraitItem) {
80-
self.process_attrs(ti.id);
81-
intravisit::walk_trait_item(self, ti)
72+
fn visit_trait_item(&mut self, trait_item: &'tcx hir::TraitItem) {
73+
self.process_attrs(trait_item.id);
8274
}
8375

84-
fn visit_impl_item(&mut self, ii: &'tcx hir::ImplItem) {
85-
self.process_attrs(ii.id);
86-
intravisit::walk_impl_item(self, ii)
76+
fn visit_impl_item(&mut self, impl_item: &'tcx hir::ImplItem) {
77+
self.process_attrs(impl_item.id);
8778
}
8879
}

src/librustc_typeck/check/mod.rs

+3-9
Original file line numberDiff line numberDiff line change
@@ -2884,27 +2884,21 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
28842884
let origin = self.misc(call_span);
28852885
let ures = self.at(&origin, self.param_env).sup(ret_ty, formal_ret);
28862886

2887-
// FIXME(#15760) can't use try! here, FromError doesn't default
2887+
// FIXME(#27336) can't use ? here, Try::from_error doesn't default
28882888
// to identity so the resulting type is not constrained.
28892889
match ures {
28902890
Ok(ok) => {
28912891
// Process any obligations locally as much as
28922892
// we can. We don't care if some things turn
28932893
// out unconstrained or ambiguous, as we're
28942894
// just trying to get hints here.
2895-
let result = self.save_and_restore_in_snapshot_flag(|_| {
2895+
self.save_and_restore_in_snapshot_flag(|_| {
28962896
let mut fulfill = FulfillmentContext::new();
2897-
let ok = ok; // FIXME(#30046)
28982897
for obligation in ok.obligations {
28992898
fulfill.register_predicate_obligation(self, obligation);
29002899
}
29012900
fulfill.select_where_possible(self)
2902-
});
2903-
2904-
match result {
2905-
Ok(()) => { }
2906-
Err(_) => return Err(()),
2907-
}
2901+
}).map_err(|_| ())?;
29082902
}
29092903
Err(_) => return Err(()),
29102904
}

src/libstd/num.rs

-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ mod tests {
169169

170170
macro_rules! test_checked_next_power_of_two {
171171
($test_name:ident, $T:ident) => (
172-
#[cfg_attr(target_os = "emscripten", ignore)] // FIXME(#39119)
173172
fn $test_name() {
174173
#![test]
175174
assert_eq!((0 as $T).checked_next_power_of_two(), Some(1));

src/libsyntax/parse/mod.rs

-2
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,6 @@ pub fn str_lit(lit: &str, diag: Option<(Span, &Handler)>) -> String {
298298
debug!("parse_str_lit: given {}", escape_default(lit));
299299
let mut res = String::with_capacity(lit.len());
300300

301-
// FIXME #8372: This could be a for-loop if it didn't borrow the iterator
302301
let error = |i| format!("lexer should have rejected {} at {}", lit, i);
303302

304303
/// Eat everything up to a non-whitespace
@@ -503,7 +502,6 @@ pub fn byte_lit(lit: &str) -> (u8, usize) {
503502
pub fn byte_str_lit(lit: &str) -> Lrc<Vec<u8>> {
504503
let mut res = Vec::with_capacity(lit.len());
505504

506-
// FIXME #8372: This could be a for-loop if it didn't borrow the iterator
507505
let error = |i| format!("lexer should have rejected {} at {}", lit, i);
508506

509507
/// Eat everything up to a non-whitespace

src/libsyntax/test.rs

+14-7
Original file line numberDiff line numberDiff line change
@@ -628,8 +628,15 @@ fn path_node(ids: Vec<Ident>) -> ast::Path {
628628
}
629629

630630
fn path_name_i(idents: &[Ident]) -> String {
631-
// FIXME: Bad copies (#2543 -- same for everything else that says "bad")
632-
idents.iter().map(|i| i.to_string()).collect::<Vec<String>>().join("::")
631+
let mut path_name = "".to_string();
632+
let mut idents_iter = idents.iter().peekable();
633+
while let Some(ident) = idents_iter.next() {
634+
path_name.push_str(&ident.name.as_str());
635+
if let Some(_) = idents_iter.peek() {
636+
path_name.push_str("::")
637+
}
638+
}
639+
path_name
633640
}
634641

635642
fn mk_tests(cx: &TestCtxt) -> P<ast::Item> {
@@ -682,7 +689,6 @@ fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> P<ast::Expr> {
682689
// gensym information.
683690

684691
let span = ignored_span(cx, test.span);
685-
let path = test.path.clone();
686692
let ecx = &cx.ext_cx;
687693
let self_id = ecx.ident_of("self");
688694
let test_id = ecx.ident_of("test");
@@ -694,10 +700,11 @@ fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> P<ast::Expr> {
694700
// creates $name: $expr
695701
let field = |name, expr| ecx.field_imm(span, ecx.ident_of(name), expr);
696702

697-
debug!("encoding {}", path_name_i(&path[..]));
698-
699703
// path to the #[test] function: "foo::bar::baz"
700-
let path_string = path_name_i(&path[..]);
704+
let path_string = path_name_i(&test.path[..]);
705+
706+
debug!("encoding {}", path_string);
707+
701708
let name_expr = ecx.expr_str(span, Symbol::intern(&path_string));
702709

703710
// self::test::StaticTestName($name_expr)
@@ -744,7 +751,7 @@ fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> P<ast::Expr> {
744751
diag.bug("expected to find top-level re-export name, but found None");
745752
}
746753
};
747-
visible_path.extend(path);
754+
visible_path.extend_from_slice(&test.path[..]);
748755

749756
// Rather than directly give the test function to the test
750757
// harness, we create a wrapper like one of the following:

src/test/run-pass/issue-27889.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
// Test that a field can have the same name in different variants
1212
// of an enum
13-
// FIXME #27889
1413

1514
pub enum Foo {
1615
X { foo: u32 },

src/test/run-pass/issue-28561.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ struct Array<T> {
4545
f32: [T; 32],
4646
}
4747

48-
// FIXME(#7622): merge with `Array` once `[T; N]: Clone` where `T: Clone`
48+
// FIXME(#44580): merge with `Array` once `[T; N]: Clone` where `T: Clone`
4949
#[derive(Clone, Copy)]
5050
struct CopyArray<T: Copy> {
5151
f00: [T; 00],

src/tools/compiletest/src/runtest.rs

-5
Original file line numberDiff line numberDiff line change
@@ -2358,11 +2358,6 @@ impl<'test> TestCx<'test> {
23582358
}
23592359

23602360
fn run_rmake_test(&self) {
2361-
// FIXME(#11094): we should fix these tests
2362-
if self.config.host != self.config.target {
2363-
return;
2364-
}
2365-
23662361
let cwd = env::current_dir().unwrap();
23672362
let src_root = self.config
23682363
.src_base

0 commit comments

Comments
 (0)