From 3773ae26a0cf7b6806602e7994087d3a3f37c3cb Mon Sep 17 00:00:00 2001 From: Niv Kaminer Date: Mon, 17 Dec 2018 17:28:03 +0200 Subject: [PATCH 01/15] FIXME(45827) remove comment since errors are reported --- .../propagate-approximated-shorter-to-static-no-bound.rs | 3 --- ...propagate-approximated-shorter-to-static-no-bound.stderr | 6 +++--- .../propagate-approximated-shorter-to-static-wrong-bound.rs | 3 --- ...pagate-approximated-shorter-to-static-wrong-bound.stderr | 6 +++--- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs index 4bef6cf8cd160..76105afb13e6e 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.rs @@ -12,9 +12,6 @@ // approximate the shorter end-point (`'y`) to with `'static`. This is // because `'y` is higher-ranked but we know of no relations to other // regions. Note that `'static` shows up in the stderr output as `'0`. -// -// FIXME(#45827) Because of shortcomings in the MIR type checker, -// these errors are not (yet) reported. // compile-flags:-Zborrowck=mir -Zverbose diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr index f22dbdba934e8..2b0474332d6e8 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-no-bound.stderr @@ -1,5 +1,5 @@ note: External requirements - --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:45:47 + --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:42:47 | LL | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { | _______________________________________________^ @@ -20,7 +20,7 @@ LL | | }); = note: where '_#1r: '_#0r note: No external requirements - --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:44:1 + --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:41:1 | LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { LL | | establish_relationships(&cell_a, &cell_b, |_outlives, x, y| { @@ -34,7 +34,7 @@ LL | | } = note: defining type: DefId(0/0:6 ~ propagate_approximated_shorter_to_static_no_bound[317d]::supply[0]) with substs [] error[E0521]: borrowed data escapes outside of function - --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:45:5 + --> $DIR/propagate-approximated-shorter-to-static-no-bound.rs:42:5 | LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { | ------ `cell_a` is a reference that is only valid in the function body diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs index 05e9818b91e56..79bd029411e5a 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.rs @@ -13,9 +13,6 @@ // because `'y` is higher-ranked but we know of only irrelevant // relations to other regions. Note that `'static` shows up in the // stderr output as `'0`. -// -// FIXME(#45827) Because of shortcomings in the MIR type checker, -// these errors are not (yet) reported. // compile-flags:-Zborrowck=mir -Zverbose diff --git a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr index 2b1cb5a30ceda..f76787c8d7d16 100644 --- a/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr +++ b/src/test/ui/nll/closure-requirements/propagate-approximated-shorter-to-static-wrong-bound.stderr @@ -1,5 +1,5 @@ note: External requirements - --> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:48:47 + --> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:45:47 | LL | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| { | _______________________________________________^ @@ -20,7 +20,7 @@ LL | | }); = note: where '_#1r: '_#0r note: No external requirements - --> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:47:1 + --> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:44:1 | LL | / fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { LL | | establish_relationships(&cell_a, &cell_b, |_outlives1, _outlives2, x, y| { @@ -34,7 +34,7 @@ LL | | } = note: defining type: DefId(0/0:6 ~ propagate_approximated_shorter_to_static_wrong_bound[317d]::supply[0]) with substs [] error[E0521]: borrowed data escapes outside of function - --> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:48:5 + --> $DIR/propagate-approximated-shorter-to-static-wrong-bound.rs:45:5 | LL | fn supply<'a, 'b>(cell_a: Cell<&'a u32>, cell_b: Cell<&'b u32>) { | ------ `cell_a` is a reference that is only valid in the function body From cf329d5978a9d09f8d4df4afa360823167c8ea5d Mon Sep 17 00:00:00 2001 From: Niv Kaminer Date: Mon, 17 Dec 2018 17:31:27 +0200 Subject: [PATCH 02/15] FIXME(49821) remove fixme since a tip about let binding is given --- src/test/ui/issues/issue-36082.ast.stderr | 2 +- src/test/ui/issues/issue-36082.mir.stderr | 2 +- src/test/ui/issues/issue-36082.rs | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/test/ui/issues/issue-36082.ast.stderr b/src/test/ui/issues/issue-36082.ast.stderr index b79958de5cb36..720a11bfe44d0 100644 --- a/src/test/ui/issues/issue-36082.ast.stderr +++ b/src/test/ui/issues/issue-36082.ast.stderr @@ -1,5 +1,5 @@ error[E0597]: borrowed value does not live long enough - --> $DIR/issue-36082.rs:23:19 + --> $DIR/issue-36082.rs:21:19 | LL | let val: &_ = x.borrow().0; | ^^^^^^^^^^ - temporary value dropped here while still borrowed diff --git a/src/test/ui/issues/issue-36082.mir.stderr b/src/test/ui/issues/issue-36082.mir.stderr index 7fa7cee0aec1e..4a6fa787d31b9 100644 --- a/src/test/ui/issues/issue-36082.mir.stderr +++ b/src/test/ui/issues/issue-36082.mir.stderr @@ -1,5 +1,5 @@ error[E0716]: temporary value dropped while borrowed - --> $DIR/issue-36082.rs:23:19 + --> $DIR/issue-36082.rs:21:19 | LL | let val: &_ = x.borrow().0; | ^^^^^^^^^^ - temporary value is freed at the end of this statement diff --git a/src/test/ui/issues/issue-36082.rs b/src/test/ui/issues/issue-36082.rs index b8a498a4dc85c..c8b92bba6e7ff 100644 --- a/src/test/ui/issues/issue-36082.rs +++ b/src/test/ui/issues/issue-36082.rs @@ -11,8 +11,6 @@ // revisions: ast mir //[mir]compile-flags: -Z borrowck=mir -// FIXME(#49821) -- No tip about using a let binding - use std::cell::RefCell; fn main() { From 7092fca98465457c7512e313d52a5f92797942da Mon Sep 17 00:00:00 2001 From: Niv Kaminer Date: Mon, 17 Dec 2018 18:21:00 +0200 Subject: [PATCH 03/15] FIXME(44217) remove fixme because the allocator logic was removed, but platform specific code remains --- src/tools/tidy/src/pal.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/tidy/src/pal.rs b/src/tools/tidy/src/pal.rs index acf72022c60ed..da5d1a3eaa4a7 100644 --- a/src/tools/tidy/src/pal.rs +++ b/src/tools/tidy/src/pal.rs @@ -58,7 +58,7 @@ const EXCEPTION_PATHS: &[&str] = &[ "src/rtstartup", // Not sure what to do about this. magic stuff for mingw // temporary exceptions - "src/libstd/lib.rs", // FIXME(#44217) + "src/libstd/lib.rs", "src/libstd/path.rs", "src/libstd/f32.rs", "src/libstd/f64.rs", From cc568e7be1ee6fea6e594f8ecd34d4fe05610e8b Mon Sep 17 00:00:00 2001 From: Niv Kaminer Date: Mon, 17 Dec 2018 18:34:04 +0200 Subject: [PATCH 04/15] FIXME(49824) remove fixme because there is no free region error anymore --- src/test/ui/borrowck/borrowck-describe-lvalue.ast.stderr | 4 ++-- src/test/ui/borrowck/borrowck-describe-lvalue.mir.stderr | 6 +++--- src/test/ui/borrowck/borrowck-describe-lvalue.rs | 1 - 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/test/ui/borrowck/borrowck-describe-lvalue.ast.stderr b/src/test/ui/borrowck/borrowck-describe-lvalue.ast.stderr index bc6385ffd920b..c028b2c486812 100644 --- a/src/test/ui/borrowck/borrowck-describe-lvalue.ast.stderr +++ b/src/test/ui/borrowck/borrowck-describe-lvalue.ast.stderr @@ -220,7 +220,7 @@ LL | }; | - first borrow ends here error[E0499]: cannot borrow `**x` as mutable more than once at a time - --> $DIR/borrowck-describe-lvalue.rs:307:25 + --> $DIR/borrowck-describe-lvalue.rs:306:25 | LL | let y = &mut x; | - first mutable borrow occurs here @@ -231,7 +231,7 @@ LL | } | - first borrow ends here error[E0382]: use of moved value: `x` - --> $DIR/borrowck-describe-lvalue.rs:318:22 + --> $DIR/borrowck-describe-lvalue.rs:317:22 | LL | drop(x); | - value moved here diff --git a/src/test/ui/borrowck/borrowck-describe-lvalue.mir.stderr b/src/test/ui/borrowck/borrowck-describe-lvalue.mir.stderr index 5721c52ba2172..69855cc984195 100644 --- a/src/test/ui/borrowck/borrowck-describe-lvalue.mir.stderr +++ b/src/test/ui/borrowck/borrowck-describe-lvalue.mir.stderr @@ -10,7 +10,7 @@ LL | *y = 1; | ------ first borrow later used here error[E0499]: cannot borrow `x` as mutable more than once at a time - --> $DIR/borrowck-describe-lvalue.rs:307:20 + --> $DIR/borrowck-describe-lvalue.rs:306:20 | LL | let y = &mut x; | ------ first mutable borrow occurs here @@ -21,7 +21,7 @@ LL | *y = 1; | ------ first borrow later used here error: captured variable cannot escape `FnMut` closure body - --> $DIR/borrowck-describe-lvalue.rs:305:16 + --> $DIR/borrowck-describe-lvalue.rs:304:16 | LL | || { | - inferred to be a `FnMut` closure @@ -362,7 +362,7 @@ LL | drop(x); | - mutable borrow later used here error[E0382]: use of moved value: `x` - --> $DIR/borrowck-describe-lvalue.rs:318:22 + --> $DIR/borrowck-describe-lvalue.rs:317:22 | LL | drop(x); | - value moved here diff --git a/src/test/ui/borrowck/borrowck-describe-lvalue.rs b/src/test/ui/borrowck/borrowck-describe-lvalue.rs index 649de888ab0a2..29f29f106dff6 100644 --- a/src/test/ui/borrowck/borrowck-describe-lvalue.rs +++ b/src/test/ui/borrowck/borrowck-describe-lvalue.rs @@ -299,7 +299,6 @@ fn main() { } // Field from upvar nested { - // FIXME(#49824) -- the free region error below should probably not be there let mut x = 0; || { || { //[mir]~ ERROR captured variable cannot escape `FnMut` closure body From e06b81e029c8e37a4b5e153e85977022b0167f9e Mon Sep 17 00:00:00 2001 From: Niv Kaminer Date: Mon, 17 Dec 2018 18:38:42 +0200 Subject: [PATCH 05/15] FIXME(21232) update fixme to point to the open issue about accepting partial initialization --- src/test/ui/borrowck/assign_mutable_fields.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/ui/borrowck/assign_mutable_fields.rs b/src/test/ui/borrowck/assign_mutable_fields.rs index 4e41f44ef5bb3..1b9ecbeafe422 100644 --- a/src/test/ui/borrowck/assign_mutable_fields.rs +++ b/src/test/ui/borrowck/assign_mutable_fields.rs @@ -12,7 +12,7 @@ // var, but we do not permit you to use the complete var afterwards. // We hope to fix this at some point. // -// FIXME(#21232) +// FIXME(#54987) fn assign_both_fields_and_use() { let mut x: (u32, u32); From aedbe9a9634fdd821ed317557b06993b554d89a1 Mon Sep 17 00:00:00 2001 From: Niv Kaminer Date: Mon, 17 Dec 2018 20:38:50 +0200 Subject: [PATCH 06/15] FIXME(31702) remove fixme, move auxiliaries to the right place and fix hr_lifetime_in_assoc_type warning --- src/test/run-pass/{ => issues}/auxiliary/issue-31702-1.rs | 0 src/test/run-pass/{ => issues}/auxiliary/issue-31702-2.rs | 2 +- src/test/run-pass/issues/issue-31702.rs | 5 ----- 3 files changed, 1 insertion(+), 6 deletions(-) rename src/test/run-pass/{ => issues}/auxiliary/issue-31702-1.rs (100%) rename src/test/run-pass/{ => issues}/auxiliary/issue-31702-2.rs (94%) diff --git a/src/test/run-pass/auxiliary/issue-31702-1.rs b/src/test/run-pass/issues/auxiliary/issue-31702-1.rs similarity index 100% rename from src/test/run-pass/auxiliary/issue-31702-1.rs rename to src/test/run-pass/issues/auxiliary/issue-31702-1.rs diff --git a/src/test/run-pass/auxiliary/issue-31702-2.rs b/src/test/run-pass/issues/auxiliary/issue-31702-2.rs similarity index 94% rename from src/test/run-pass/auxiliary/issue-31702-2.rs rename to src/test/run-pass/issues/auxiliary/issue-31702-2.rs index c5b1bc6dfb08d..ae8743b62ee05 100644 --- a/src/test/run-pass/auxiliary/issue-31702-2.rs +++ b/src/test/run-pass/issues/auxiliary/issue-31702-2.rs @@ -16,7 +16,7 @@ use std::collections::HashMap; use issue_31702_1::U256; pub struct Ethash { - engine_params: for<'a> fn() -> Option<&'a Vec>, + engine_params: fn() -> Option<&'static Vec>, u256_params: HashMap, } diff --git a/src/test/run-pass/issues/issue-31702.rs b/src/test/run-pass/issues/issue-31702.rs index 8ce06e8d34339..4011d12ad961b 100644 --- a/src/test/run-pass/issues/issue-31702.rs +++ b/src/test/run-pass/issues/issue-31702.rs @@ -11,11 +11,6 @@ // run-pass // aux-build:issue-31702-1.rs // aux-build:issue-31702-2.rs -// ignore-test: FIXME(#31702) when this test was added it was thought that the -// accompanying llvm update would fix it, but -// unfortunately it appears that was not the case. In -// the interest of not deleting the test, though, -// this is just tagged with ignore-test // this test is actually entirely in the linked library crates From b1db8f8833e004889454f9a09287ed4efa28ddf7 Mon Sep 17 00:00:00 2001 From: Niv Kaminer Date: Tue, 18 Dec 2018 11:27:31 +0200 Subject: [PATCH 07/15] FIXME(45992) remove fixme since the lint is being tested --- src/test/run-pass/impl-trait/lifetimes.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/run-pass/impl-trait/lifetimes.rs b/src/test/run-pass/impl-trait/lifetimes.rs index e5a98962ff3ab..920fe07c91496 100644 --- a/src/test/run-pass/impl-trait/lifetimes.rs +++ b/src/test/run-pass/impl-trait/lifetimes.rs @@ -41,7 +41,6 @@ impl<'a> SingleRegionTrait<'a> for &'a u32 {} struct SingleRegionStruct<'a>(&'a u32); fn simple_type_hrtb<'b>() -> impl for<'a> SingleRegionTrait<'a> { 5 } -// FIXME(cramertj) add test after #45992 lands to ensure lint is triggered fn elision_single_region_trait(x: &u32) -> impl SingleRegionTrait { x } fn elision_single_region_struct(x: SingleRegionStruct) -> impl Into { x } From 5d7fad35eb66bcd128b8897dd8c84e75c1aa142d Mon Sep 17 00:00:00 2001 From: Niv Kaminer Date: Tue, 18 Dec 2018 12:29:30 +0200 Subject: [PATCH 08/15] FIXME(47184) update fixmes to point to issues specific to them --- src/librustc_mir/build/matches/test.rs | 2 +- src/librustc_mir/hair/pattern/mod.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/librustc_mir/build/matches/test.rs b/src/librustc_mir/build/matches/test.rs index c8dec6d0b9764..69706924dc966 100644 --- a/src/librustc_mir/build/matches/test.rs +++ b/src/librustc_mir/build/matches/test.rs @@ -347,7 +347,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> { span: test.span, ty: mty, - // FIXME(#47184): This constant comes from user + // FIXME(#54571): This constant comes from user // input (a constant in a pattern). Are // there forms where users can add type // annotations here? For example, an diff --git a/src/librustc_mir/hair/pattern/mod.rs b/src/librustc_mir/hair/pattern/mod.rs index f78a70f6a25f4..0324bfb892e45 100644 --- a/src/librustc_mir/hair/pattern/mod.rs +++ b/src/librustc_mir/hair/pattern/mod.rs @@ -83,7 +83,7 @@ impl<'tcx> PatternTypeProjections<'tcx> { } pub(crate) fn ref_binding(&self) -> Self { - // FIXME(#47184): ignore for now + // FIXME(#55401): ignore for now PatternTypeProjections { contents: vec![] } } From 86808249b4bc213540d41989c7c12df48021593d Mon Sep 17 00:00:00 2001 From: Niv Kaminer Date: Tue, 18 Dec 2018 15:38:43 +0200 Subject: [PATCH 09/15] FIXME(2665) remove fixme since the c files are included by the testsuite --- src/test/auxiliary/rust_test_helpers.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/test/auxiliary/rust_test_helpers.c b/src/test/auxiliary/rust_test_helpers.c index 2a14b3da7b7d0..feb51557ec648 100644 --- a/src/test/auxiliary/rust_test_helpers.c +++ b/src/test/auxiliary/rust_test_helpers.c @@ -163,11 +163,7 @@ rust_get_null_ptr() { return 0; } -/* Debug helpers strictly to verify ABI conformance. - * - * FIXME (#2665): move these into a testcase when the testsuite - * understands how to have explicit C files included. - */ +// Debug helpers strictly to verify ABI conformance. struct quad { uint64_t a; From 1aaad19418aef16b2e7688e36016b729ac2538ae Mon Sep 17 00:00:00 2001 From: Niv Kaminer Date: Tue, 18 Dec 2018 19:08:11 +0200 Subject: [PATCH 10/15] FIXME(RFC1868) point the fixme to the tracking issue --- src/librustdoc/clean/cfg.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/librustdoc/clean/cfg.rs b/src/librustdoc/clean/cfg.rs index 847786d123efc..e70284e4948ec 100644 --- a/src/librustdoc/clean/cfg.rs +++ b/src/librustdoc/clean/cfg.rs @@ -10,7 +10,8 @@ //! Representation of a `#[doc(cfg(...))]` attribute. -// FIXME: Once RFC #1868 is implemented, switch to use those structures instead. +// FIXME: Once the portability lint RFC is implemented (see tracking issue #41619), +// switch to use those structures instead. use std::mem; use std::fmt::{self, Write}; From 897c18235a28e9470badd4a3e93a0641dd9c2865 Mon Sep 17 00:00:00 2001 From: Niv Kaminer Date: Tue, 18 Dec 2018 20:58:15 +0200 Subject: [PATCH 11/15] FIXME(52456) remove fixme and combine all extern items in one block --- src/librustc_codegen_llvm/llvm/ffi.rs | 32 +++++---------------------- 1 file changed, 6 insertions(+), 26 deletions(-) diff --git a/src/librustc_codegen_llvm/llvm/ffi.rs b/src/librustc_codegen_llvm/llvm/ffi.rs index 4732db88ec1cb..5c59439fdfb6f 100644 --- a/src/librustc_codegen_llvm/llvm/ffi.rs +++ b/src/librustc_codegen_llvm/llvm/ffi.rs @@ -1601,15 +1601,12 @@ extern "C" { -> &'a Value; pub fn LLVMRustDIBuilderCreateOpDeref() -> i64; pub fn LLVMRustDIBuilderCreateOpPlusUconst() -> i64; -} -#[allow(improper_ctypes)] // FIXME(#52456) needed for RustString. -extern "C" { + #[allow(improper_ctypes)] pub fn LLVMRustWriteTypeToString(Type: &Type, s: &RustString); + #[allow(improper_ctypes)] pub fn LLVMRustWriteValueToString(value_ref: &Value, s: &RustString); -} -extern "C" { pub fn LLVMIsAConstantInt(value_ref: &Value) -> Option<&Value>; pub fn LLVMIsAConstantFP(value_ref: &Value) -> Option<&Value>; @@ -1687,21 +1684,15 @@ extern "C" { pub fn LLVMRustDestroyArchive(AR: &'static mut Archive); pub fn LLVMRustGetSectionName(SI: &SectionIterator, data: &mut *const c_char) -> size_t; -} -#[allow(improper_ctypes)] // FIXME(#52456) needed for RustString. -extern "C" { + #[allow(improper_ctypes)] pub fn LLVMRustWriteTwineToString(T: &Twine, s: &RustString); -} -extern "C" { pub fn LLVMContextSetDiagnosticHandler(C: &Context, Handler: DiagnosticHandler, DiagnosticContext: *mut c_void); -} -#[allow(improper_ctypes)] // FIXME(#52456) needed for RustString. -extern "C" { + #[allow(improper_ctypes)] pub fn LLVMRustUnpackOptimizationDiagnostic(DI: &'a DiagnosticInfo, pass_name_out: &RustString, function_out: &mut Option<&'a Value>, @@ -1709,34 +1700,23 @@ extern "C" { loc_column_out: &mut c_uint, loc_filename_out: &RustString, message_out: &RustString); -} -extern "C" { pub fn LLVMRustUnpackInlineAsmDiagnostic(DI: &'a DiagnosticInfo, cookie_out: &mut c_uint, message_out: &mut Option<&'a Twine>, instruction_out: &mut Option<&'a Value>); -} -#[allow(improper_ctypes)] // FIXME(#52456) needed for RustString. -extern "C" { + #[allow(improper_ctypes)] pub fn LLVMRustWriteDiagnosticInfoToString(DI: &DiagnosticInfo, s: &RustString); -} - -extern "C" { pub fn LLVMRustGetDiagInfoKind(DI: &DiagnosticInfo) -> DiagnosticKind; pub fn LLVMRustSetInlineAsmDiagnosticHandler(C: &Context, H: InlineAsmDiagHandler, CX: *mut c_void); -} -#[allow(improper_ctypes)] // FIXME(#52456) needed for RustString. -extern "C" { + #[allow(improper_ctypes)] pub fn LLVMRustWriteSMDiagnosticToString(d: &SMDiagnostic, s: &RustString); -} -extern "C" { pub fn LLVMRustWriteArchive(Dst: *const c_char, NumMembers: size_t, Members: *const &RustArchiveMember, From d88d319a5d9d8f339d9d0fde71bb3b9979c9093b Mon Sep 17 00:00:00 2001 From: Niv Kaminer Date: Tue, 18 Dec 2018 22:47:13 +0200 Subject: [PATCH 12/15] FIXME(53451) remove fixme and unnecessary pubs --- src/libproc_macro/bridge/client.rs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/libproc_macro/bridge/client.rs b/src/libproc_macro/bridge/client.rs index f5e12713e4e72..d6c2848b03433 100644 --- a/src/libproc_macro/bridge/client.rs +++ b/src/libproc_macro/bridge/client.rs @@ -25,8 +25,7 @@ macro_rules! define_handles { } impl HandleCounters { - // FIXME(#53451) public to work around `Cannot create local mono-item` ICE. - pub extern "C" fn get() -> &'static Self { + extern "C" fn get() -> &'static Self { static COUNTERS: HandleCounters = HandleCounters { $($oty: AtomicUsize::new(1),)* $($ity: AtomicUsize::new(1),)* @@ -345,9 +344,7 @@ pub struct Client { pub(super) f: F, } -// FIXME(#53451) public to work around `Cannot create local mono-item` ICE, -// affecting not only the function itself, but also the `BridgeState` `thread_local!`. -pub extern "C" fn __run_expand1( +extern "C" fn run_expand1( mut bridge: Bridge, f: fn(::TokenStream) -> ::TokenStream, ) -> Buffer { @@ -392,15 +389,13 @@ impl Client ::TokenStream> { pub const fn expand1(f: fn(::TokenStream) -> ::TokenStream) -> Self { Client { get_handle_counters: HandleCounters::get, - run: __run_expand1, + run: run_expand1, f, } } } -// FIXME(#53451) public to work around `Cannot create local mono-item` ICE, -// affecting not only the function itself, but also the `BridgeState` `thread_local!`. -pub extern "C" fn __run_expand2( +extern "C" fn run_expand2( mut bridge: Bridge, f: fn(::TokenStream, ::TokenStream) -> ::TokenStream, ) -> Buffer { @@ -446,7 +441,7 @@ impl Client ::TokenStream> { pub const fn expand2(f: fn(::TokenStream, ::TokenStream) -> ::TokenStream) -> Self { Client { get_handle_counters: HandleCounters::get, - run: __run_expand2, + run: run_expand2, f, } } From 957a9c7c666801019478f1ff1535d8395127fa6f Mon Sep 17 00:00:00 2001 From: Niv Kaminer Date: Wed, 19 Dec 2018 10:54:35 +0200 Subject: [PATCH 13/15] Revert "FIXME(53451) remove fixme and unnecessary pubs" This reverts commit d88d319a5d9d8f339d9d0fde71bb3b9979c9093b. --- src/libproc_macro/bridge/client.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/libproc_macro/bridge/client.rs b/src/libproc_macro/bridge/client.rs index d6c2848b03433..f5e12713e4e72 100644 --- a/src/libproc_macro/bridge/client.rs +++ b/src/libproc_macro/bridge/client.rs @@ -25,7 +25,8 @@ macro_rules! define_handles { } impl HandleCounters { - extern "C" fn get() -> &'static Self { + // FIXME(#53451) public to work around `Cannot create local mono-item` ICE. + pub extern "C" fn get() -> &'static Self { static COUNTERS: HandleCounters = HandleCounters { $($oty: AtomicUsize::new(1),)* $($ity: AtomicUsize::new(1),)* @@ -344,7 +345,9 @@ pub struct Client { pub(super) f: F, } -extern "C" fn run_expand1( +// FIXME(#53451) public to work around `Cannot create local mono-item` ICE, +// affecting not only the function itself, but also the `BridgeState` `thread_local!`. +pub extern "C" fn __run_expand1( mut bridge: Bridge, f: fn(::TokenStream) -> ::TokenStream, ) -> Buffer { @@ -389,13 +392,15 @@ impl Client ::TokenStream> { pub const fn expand1(f: fn(::TokenStream) -> ::TokenStream) -> Self { Client { get_handle_counters: HandleCounters::get, - run: run_expand1, + run: __run_expand1, f, } } } -extern "C" fn run_expand2( +// FIXME(#53451) public to work around `Cannot create local mono-item` ICE, +// affecting not only the function itself, but also the `BridgeState` `thread_local!`. +pub extern "C" fn __run_expand2( mut bridge: Bridge, f: fn(::TokenStream, ::TokenStream) -> ::TokenStream, ) -> Buffer { @@ -441,7 +446,7 @@ impl Client ::TokenStream> { pub const fn expand2(f: fn(::TokenStream, ::TokenStream) -> ::TokenStream) -> Self { Client { get_handle_counters: HandleCounters::get, - run: run_expand2, + run: __run_expand2, f, } } From 0e72c80afe9024ea7824579cd12c428264bb4783 Mon Sep 17 00:00:00 2001 From: Niv Kaminer Date: Mon, 17 Dec 2018 23:45:26 +0200 Subject: [PATCH 14/15] FIXME(9639) remove fixme and accept non-utf8 paths in compiletest --- src/tools/compiletest/src/runtest.rs | 36 ++++++++++++++-------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index 45527a7cce535..8c6e97893fb43 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -27,7 +27,7 @@ use util::{logv, PathBufExt}; use std::collections::hash_map::DefaultHasher; use std::collections::{HashMap, HashSet, VecDeque}; use std::env; -use std::ffi::OsString; +use std::ffi::{OsStr, OsString}; use std::fmt; use std::fs::{self, create_dir_all, File}; use std::hash::{Hash, Hasher}; @@ -760,13 +760,13 @@ impl<'test> TestCx<'test> { } drop(stdout); - let debugger_script = self.make_out_name("debugger.script"); - // FIXME (#9639): This needs to handle non-utf8 paths - let debugger_opts = vec![ - "-quiet".to_owned(), - "-batch".to_owned(), - "-nx".to_owned(), - format!("-command={}", debugger_script.to_str().unwrap()), + let mut debugger_script = OsString::from("-command="); + debugger_script.push(self.make_out_name("debugger.script")); + let debugger_opts: &[&OsStr] = &[ + "-quiet".as_ref(), + "-batch".as_ref(), + "-nx".as_ref(), + &debugger_script, ]; let gdb_path = self.config.gdb.as_ref().unwrap(); @@ -775,12 +775,12 @@ impl<'test> TestCx<'test> { stdout, stderr, } = Command::new(&gdb_path) - .args(&debugger_opts) + .args(debugger_opts) .output() .expect(&format!("failed to exec `{:?}`", gdb_path)); let cmdline = { let mut gdb = Command::new(&format!("{}-gdb", self.config.target)); - gdb.args(&debugger_opts); + gdb.args(debugger_opts); let cmdline = self.make_cmdline(&gdb, ""); logv(self.config, format!("executing {}", cmdline)); cmdline @@ -868,18 +868,18 @@ impl<'test> TestCx<'test> { debug!("script_str = {}", script_str); self.dump_output_file(&script_str, "debugger.script"); - let debugger_script = self.make_out_name("debugger.script"); + let mut debugger_script = OsString::from("-command="); + debugger_script.push(self.make_out_name("debugger.script")); - // FIXME (#9639): This needs to handle non-utf8 paths - let debugger_opts = vec![ - "-quiet".to_owned(), - "-batch".to_owned(), - "-nx".to_owned(), - format!("-command={}", debugger_script.to_str().unwrap()), + let debugger_opts: &[&OsStr] = &[ + "-quiet".as_ref(), + "-batch".as_ref(), + "-nx".as_ref(), + &debugger_script, ]; let mut gdb = Command::new(self.config.gdb.as_ref().unwrap()); - gdb.args(&debugger_opts) + gdb.args(debugger_opts) .env("PYTHONPATH", rust_pp_module_abs_path); debugger_run_result = self.compose_and_run( From 7894717e91ec8a01681bc38ca2273b91037e1ece Mon Sep 17 00:00:00 2001 From: Niv Kaminer Date: Wed, 19 Dec 2018 19:03:05 +0200 Subject: [PATCH 15/15] FIXME(9639) remove fixme and accept non-utf8 paths in librustdoc --- src/librustdoc/html/render.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 46002c089cf9f..6da1471c6a687 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1232,10 +1232,8 @@ fn write_minify_replacer(dst: &mut W, /// static HTML tree. Each component in the cleaned path will be passed as an /// argument to `f`. The very last component of the path (ie the file name) will /// be passed to `f` if `keep_filename` is true, and ignored otherwise. -// FIXME (#9639): The closure should deal with &[u8] instead of &str -// FIXME (#9639): This is too conservative, rejecting non-UTF-8 paths fn clean_srcpath(src_root: &Path, p: &Path, keep_filename: bool, mut f: F) where - F: FnMut(&str), + F: FnMut(&OsStr), { // make it relative, if possible let p = p.strip_prefix(src_root).unwrap_or(p); @@ -1248,8 +1246,8 @@ fn clean_srcpath(src_root: &Path, p: &Path, keep_filename: bool, mut f: F) wh } match c { - Component::ParentDir => f("up"), - Component::Normal(c) => f(c.to_str().unwrap()), + Component::ParentDir => f("up".as_ref()), + Component::Normal(c) => f(c), _ => continue, } } @@ -1348,7 +1346,7 @@ impl<'a> SourceCollector<'a> { cur.push(component); fs::create_dir_all(&cur).unwrap(); root_path.push_str("../"); - href.push_str(component); + href.push_str(&component.to_string_lossy()); href.push('/'); }); let mut fname = p.file_name() @@ -2227,7 +2225,7 @@ impl<'a> Item<'a> { }; clean_srcpath(&src_root, file, false, |component| { - path.push_str(component); + path.push_str(&component.to_string_lossy()); path.push('/'); }); let mut fname = file.file_name().expect("source has no filename")