Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

address some FIXME whose associated issues were marked as closed #49117

Merged
merged 15 commits into from
Mar 22, 2018
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
2 changes: 1 addition & 1 deletion src/liballoc/tests/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ fn test_copy_from_slice_dst_shorter() {
const MAX_LEN: usize = 80;

static DROP_COUNTS: [AtomicUsize; MAX_LEN] = [
// FIXME #5244: AtomicUsize is not Copy.
// FIXME(RFC 1109): AtomicUsize is not Copy.
AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0),
AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0),
AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0),
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ impl<'a, T: ?Sized, U: ?Sized> AsRef<U> for &'a mut T where T: AsRef<U>
}
}

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

// FIXME (#23442): replace the above impl for &mut with the following more general one:
// FIXME (#45742): replace the above impl for &mut with the following more general one:
// // AsMut lifts over DerefMut
// impl<D: ?Sized + Deref, U: ?Sized> AsMut<U> for D where D::Target: AsMut<U> {
// fn as_mut(&mut self) -> &mut U {
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/iter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1872,7 +1872,7 @@ impl<I: Iterator> Iterator for Peekable<I> {

#[inline]
fn nth(&mut self, n: usize) -> Option<I::Item> {
// FIXME(#6393): merge these when borrow-checking gets better.
// FIXME(#43234): merge these when borrow-checking gets better.
if n == 0 {
match self.peeked.take() {
Some(v) => v,
Expand Down
5 changes: 2 additions & 3 deletions src/librustc_mir/build/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,9 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
// Evaluate the initializer, if present.
if let Some(init) = initializer {
unpack!(block = this.in_opt_scope(
opt_destruction_scope.map(|de|(de, source_info)), block, move |this| {
opt_destruction_scope.map(|de|(de, source_info)), block, |this| {
let scope = (init_scope, source_info);
this.in_scope(scope, lint_level, block, move |this| {
// FIXME #30046 ^~~~
this.in_scope(scope, lint_level, block, |this| {
this.expr_into_pattern(block, pattern, init)
})
}));
Expand Down
14 changes: 7 additions & 7 deletions src/librustc_mir/util/elaborate_drops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
});
}
DropStyle::Conditional => {
let unwind = self.unwind; // FIXME(#6393)
let unwind = self.unwind; // FIXME(#43234)
let succ = self.succ;
let drop_bb = self.complete_drop(Some(DropFlagMode::Deep), succ, unwind);
self.elaborator.patch().patch_terminator(bb, TerminatorKind::Goto {
Expand Down Expand Up @@ -268,7 +268,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
// Clear the "master" drop flag at the end. This is needed
// because the "master" drop protects the ADT's discriminant,
// which is invalidated after the ADT is dropped.
let (succ, unwind) = (self.succ, self.unwind); // FIXME(#6393)
let (succ, unwind) = (self.succ, self.unwind); // FIXME(#43234)
(
self.drop_flag_reset_block(DropFlagMode::Shallow, succ, unwind),
unwind.map(|unwind| {
Expand Down Expand Up @@ -344,7 +344,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
let interior = self.place.clone().deref();
let interior_path = self.elaborator.deref_subpath(self.path);

let succ = self.succ; // FIXME(#6393)
let succ = self.succ; // FIXME(#43234)
let unwind = self.unwind;
let succ = self.box_free_block(ty, succ, unwind);
let unwind_succ = self.unwind.map(|unwind| {
Expand Down Expand Up @@ -717,7 +717,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
ptr_based)
});

let succ = self.succ; // FIXME(#6393)
let succ = self.succ; // FIXME(#43234)
let loop_block = self.drop_loop(
succ,
cur,
Expand Down Expand Up @@ -798,7 +798,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>
self.open_drop_for_adt(def, substs)
}
ty::TyDynamic(..) => {
let unwind = self.unwind; // FIXME(#6393)
let unwind = self.unwind; // FIXME(#43234)
let succ = self.succ;
self.complete_drop(Some(DropFlagMode::Deep), succ, unwind)
}
Expand Down Expand Up @@ -849,7 +849,7 @@ impl<'l, 'b, 'tcx, D> DropCtxt<'l, 'b, 'tcx, D>

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

let block_start = Location { block: free_block, statement_index: 0 };
Expand Down
25 changes: 3 additions & 22 deletions src/librustc_resolve/resolve_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1026,28 +1026,9 @@ fn import_path_to_string(names: &[SpannedIdent],
if names.is_empty() {
import_directive_subclass_to_string(subclass)
} else {
// FIXME: Remove this entire logic after #48116 is fixed.
//
// Note that this code looks a little wonky, it's currently here to
// hopefully help debug #48116, but otherwise isn't intended to
// cause any problems.
let x = format!(
"{}::{}",
names_to_string(names),
import_directive_subclass_to_string(subclass),
);
if names.is_empty() || x.starts_with("::") {
span_bug!(
span,
"invalid name `{}` at {:?}; global = {}, names = {:?}, subclass = {:?}",
x,
span,
global,
names,
subclass
);
}
return x
format!("{}::{}",
names_to_string(names),
import_directive_subclass_to_string(subclass))
}
}
}
Expand Down
21 changes: 6 additions & 15 deletions src/librustc_trans_utils/symbol_names_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
//! paths etc in all kinds of annoying scenarios.

use rustc::hir;
use rustc::hir::intravisit::{self, Visitor, NestedVisitorMap};
use rustc::ty::TyCtxt;
use syntax::ast;

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

tcx.dep_graph.with_ignore(|| {
let mut visitor = SymbolNamesTest { tcx: tcx };
// FIXME(#37712) could use ItemLikeVisitor if trait items were item-like
tcx.hir.krate().visit_all_item_likes(&mut visitor.as_deep_visitor());
tcx.hir.krate().visit_all_item_likes(&mut visitor);
})
}

Expand Down Expand Up @@ -66,23 +64,16 @@ impl<'a, 'tcx> SymbolNamesTest<'a, 'tcx> {
}
}

impl<'a, 'tcx> Visitor<'tcx> for SymbolNamesTest<'a, 'tcx> {
fn nested_visit_map<'this>(&'this mut self) -> NestedVisitorMap<'this, 'tcx> {
NestedVisitorMap::None
}

impl<'a, 'tcx> hir::itemlikevisit::ItemLikeVisitor<'tcx> for SymbolNamesTest<'a, 'tcx> {
fn visit_item(&mut self, item: &'tcx hir::Item) {
self.process_attrs(item.id);
intravisit::walk_item(self, item);
}

fn visit_trait_item(&mut self, ti: &'tcx hir::TraitItem) {
self.process_attrs(ti.id);
intravisit::walk_trait_item(self, ti)
fn visit_trait_item(&mut self, trait_item: &'tcx hir::TraitItem) {
self.process_attrs(trait_item.id);
}

fn visit_impl_item(&mut self, ii: &'tcx hir::ImplItem) {
self.process_attrs(ii.id);
intravisit::walk_impl_item(self, ii)
fn visit_impl_item(&mut self, impl_item: &'tcx hir::ImplItem) {
self.process_attrs(impl_item.id);
}
}
12 changes: 3 additions & 9 deletions src/librustc_typeck/check/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2869,27 +2869,21 @@ impl<'a, 'gcx, 'tcx> FnCtxt<'a, 'gcx, 'tcx> {
let origin = self.misc(call_span);
let ures = self.at(&origin, self.param_env).sup(ret_ty, formal_ret);

// FIXME(#15760) can't use try! here, FromError doesn't default
// FIXME(#27336) can't use ? here, Try::from_error doesn't default
// to identity so the resulting type is not constrained.
match ures {
Ok(ok) => {
// Process any obligations locally as much as
// we can. We don't care if some things turn
// out unconstrained or ambiguous, as we're
// just trying to get hints here.
let result = self.save_and_restore_in_snapshot_flag(|_| {
self.save_and_restore_in_snapshot_flag(|_| {
let mut fulfill = FulfillmentContext::new();
let ok = ok; // FIXME(#30046)
for obligation in ok.obligations {
fulfill.register_predicate_obligation(self, obligation);
}
fulfill.select_where_possible(self)
});

match result {
Ok(()) => { }
Err(_) => return Err(()),
}
}).map_err(|_| ())?;
}
Err(_) => return Err(()),
}
Expand Down
1 change: 0 additions & 1 deletion src/libstd/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ mod tests {

macro_rules! test_checked_next_power_of_two {
($test_name:ident, $T:ident) => (
#[cfg_attr(target_os = "emscripten", ignore)] // FIXME(#39119)
fn $test_name() {
#![test]
assert_eq!((0 as $T).checked_next_power_of_two(), Some(1));
Expand Down
2 changes: 0 additions & 2 deletions src/libsyntax/parse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ pub fn str_lit(lit: &str, diag: Option<(Span, &Handler)>) -> String {
debug!("parse_str_lit: given {}", escape_default(lit));
let mut res = String::with_capacity(lit.len());

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

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

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

/// Eat everything up to a non-whitespace
Expand Down
21 changes: 14 additions & 7 deletions src/libsyntax/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -627,8 +627,15 @@ fn path_node(ids: Vec<Ident>) -> ast::Path {
}

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

fn mk_tests(cx: &TestCtxt) -> P<ast::Item> {
Expand Down Expand Up @@ -681,7 +688,6 @@ fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> P<ast::Expr> {
// gensym information.

let span = ignored_span(cx, test.span);
let path = test.path.clone();
let ecx = &cx.ext_cx;
let self_id = ecx.ident_of("self");
let test_id = ecx.ident_of("test");
Expand All @@ -693,10 +699,11 @@ fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> P<ast::Expr> {
// creates $name: $expr
let field = |name, expr| ecx.field_imm(span, ecx.ident_of(name), expr);

debug!("encoding {}", path_name_i(&path[..]));

// path to the #[test] function: "foo::bar::baz"
let path_string = path_name_i(&path[..]);
let path_string = path_name_i(&test.path[..]);

debug!("encoding {}", path_string);

let name_expr = ecx.expr_str(span, Symbol::intern(&path_string));

// self::test::StaticTestName($name_expr)
Expand Down Expand Up @@ -743,7 +750,7 @@ fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> P<ast::Expr> {
diag.bug("expected to find top-level re-export name, but found None");
}
};
visible_path.extend(path);
visible_path.extend_from_slice(&test.path[..]);

// Rather than directly give the test function to the test
// harness, we create a wrapper like one of the following:
Expand Down
1 change: 0 additions & 1 deletion src/test/run-pass/issue-27889.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

// Test that a field can have the same name in different variants
// of an enum
// FIXME #27889

pub enum Foo {
X { foo: u32 },
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-28561.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct Array<T> {
f32: [T; 32],
}

// FIXME(#7622): merge with `Array` once `[T; N]: Clone` where `T: Clone`
// FIXME(#44580): merge with `Array` once `[T; N]: Clone` where `T: Clone`
#[derive(Clone, Copy)]
struct CopyArray<T: Copy> {
f00: [T; 00],
Expand Down
5 changes: 0 additions & 5 deletions src/tools/compiletest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,11 +452,6 @@ pub fn run_tests(config: &Config) {
_ => { /* proceed */ }
}

// FIXME(#33435) Avoid spurious failures in codegen-units/partitioning tests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the only removal that gives me pause, the rest LGTM.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Checked the issue again. This was the fix mentioned, so reverting commit.

if let Mode::CodegenUnits = config.mode {
let _ = fs::remove_dir_all("tmp/partitioning-tests");
}

let opts = test_opts(config);
let tests = make_tests(config);
// sadly osx needs some file descriptor limits raised for running tests in
Expand Down
5 changes: 0 additions & 5 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2358,11 +2358,6 @@ impl<'test> TestCx<'test> {
}

fn run_rmake_test(&self) {
// FIXME(#11094): we should fix these tests
if self.config.host != self.config.target {
return;
}

let cwd = env::current_dir().unwrap();
let src_root = self.config
.src_base
Expand Down