Skip to content

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

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

Merged
merged 16 commits into from
Dec 25, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 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
32 changes: 6 additions & 26 deletions src/librustc_codegen_llvm/llvm/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>;

Expand Down Expand Up @@ -1687,56 +1684,39 @@ 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>,
loc_line_out: &mut c_uint,
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,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/build/matches/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/hair/pattern/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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![] }
}

Expand Down
3 changes: 2 additions & 1 deletion src/librustdoc/clean/cfg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
12 changes: 5 additions & 7 deletions src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1232,10 +1232,8 @@ fn write_minify_replacer<W: Write>(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<F>(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);
Expand All @@ -1248,8 +1246,8 @@ fn clean_srcpath<F>(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,
}
}
Expand Down Expand Up @@ -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());
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not .to_str().unwrap() (as before in clean_srcpath)? It will only be a dead link if replacement characters are inserted.

Copy link
Contributor Author

@nivkner nivkner Dec 23, 2018

Choose a reason for hiding this comment

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

because I saw the same thing being done a few lines below so I assumed that was expected outcome.
also the intent of the FIXME was not failing when non-utf8 paths are encountered (so panicking here would have the same result), I am not sure it necessarily means the resulting link has to work.

href.push('/');
});
let mut fname = p.file_name()
Expand Down Expand Up @@ -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")
Expand Down
6 changes: 1 addition & 5 deletions src/test/auxiliary/rust_test_helpers.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/test/run-pass/impl-trait/lifetimes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<SingleRegionStruct> { x }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use std::collections::HashMap;
use issue_31702_1::U256;

pub struct Ethash {
engine_params: for<'a> fn() -> Option<&'a Vec<u8>>,
engine_params: fn() -> Option<&'static Vec<u8>>,
u256_params: HashMap<String, U256>,
}

Expand Down
5 changes: 0 additions & 5 deletions src/test/run-pass/issues/issue-31702.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/borrowck/assign_mutable_fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/borrowck/borrowck-describe-lvalue.ast.nll.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -370,7 +370,7 @@ LL | drop(x);
This warning will become a hard error in the future.

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
Expand Down
4 changes: 2 additions & 2 deletions src/test/ui/borrowck/borrowck-describe-lvalue.ast.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/test/ui/borrowck/borrowck-describe-lvalue.mir.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/borrowck/borrowck-describe-lvalue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-36082.ast.nll.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-36082.ast.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/issues/issue-36082.mir.stderr
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 0 additions & 2 deletions src/test/ui/issues/issue-36082.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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| {
| _______________________________________________^
Expand All @@ -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| {
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
@@ -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| {
| _______________________________________________^
Expand All @@ -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| {
Expand All @@ -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
Expand Down
Loading