mirror of
				https://github.com/rust-lang/rust.git
				synced 2025-11-03 22:49:17 +00:00 
			
		
		
		
	The two kinds of delayed bug have quite different semantics so a stronger conceptual separation is nice. (`is_error` is a good example, because the two kinds have different behaviour.) The commit also moves the `DelayedBug` variant after `Error` in `Level`, to reflect the fact that it's weaker than `Error` -- it might trigger an error but also might not. (The pre-existing `downgrade_to_delayed_bug` function also reflects the notion that delayed bugs are lower/after normal errors.) Plus it condenses some of the comments on `Level` into a table, for easier reading, and introduces `can_be_top_or_sub` to indicate which levels can be used in top-level diagnostics vs. subdiagnostics. Finally, it renames `DiagCtxtInner::span_delayed_bugs` as `DiagCtxtInner::delayed_bugs`. The `span_` prefix is unnecessary because some delayed bugs don't have a span.
		
			
				
	
	
		
			26 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
note: no errors encountered even though delayed bugs were created
 | 
						|
 | 
						|
note: those delayed bugs will now be shown as internal compiler errors
 | 
						|
 | 
						|
error: internal compiler error: {OpaqueTypeKey { def_id: DefId(rpit::{opaque#0}), args: [] }: OpaqueTypeDecl { hidden_type: OpaqueHiddenType { span: no-location (#0), ty: Alias(Opaque, AliasTy { args: [], def_id: DefId(foo::{opaque#0}) }) } }}
 | 
						|
   |
 | 
						|
   = 
 | 
						|
           
 | 
						|
 | 
						|
error: internal compiler error: error performing ParamEnvAnd { param_env: ParamEnv { caller_bounds: [], reveal: UserFacing }, value: ProvePredicate { predicate: Binder { value: ProjectionPredicate(AliasTy { args: [FnDef(DefId(rpit), []), ()], def_id: DefId(ops::function::FnOnce::Output) }, Term::Ty(Alias(Opaque, AliasTy { args: [], def_id: DefId(foo::{opaque#0}) }))), bound_vars: [] } } }
 | 
						|
  --> $DIR/equality-in-canonical-query.rs:21:5
 | 
						|
   |
 | 
						|
LL |     same_output(foo, rpit);
 | 
						|
   |     ^^^^^^^^^^^^^^^^^^^^^^
 | 
						|
   |
 | 
						|
 | 
						|
  --> $DIR/equality-in-canonical-query.rs:21:5
 | 
						|
   |
 | 
						|
LL |     same_output(foo, rpit);
 | 
						|
   |     ^^^^^^^^^^^^^^^^^^^^^^
 | 
						|
 | 
						|
query stack during panic:
 | 
						|
end of query stack
 | 
						|
error: aborting due to 2 previous errors
 | 
						|
 |